Ignore:
Timestamp:
Jan 19, 2017, 11:04:27 AM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
2175062
Parents:
5ebb2fbc (diff), 68e6031 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r5ebb2fbc re9e4e9ee  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec 13 14:51:27 2016
    13 // Update Count     : 362
     12// Last Modified On : Wed Jan 18 15:23:08 2017
     13// Update Count     : 414
    1414//
    1515
     
    111111        }
    112112
    113         void CodeGenerator::genAttributes( std::list< Attribute * > & attributes ) {
    114                 if ( ! attributes.empty() ) {
    115                         output << "__attribute__ ((";
    116                         for ( Attribute *& attr : attributes ) {
    117                                 if ( ! attr->empty() ) {
    118                                         output << attr->get_name() << "(";
    119                                         genCommaList( attr->get_parameters().begin(), attr->get_parameters().end() );
    120                                         output << ")";
    121                                 } // if
    122                                 output << ",";
    123                         } // for
    124                         output << ")) ";
    125                 } // if
    126         }
     113        void CodeGenerator::genAttributes( list< Attribute * > & attributes ) {
     114          if ( attributes.empty() ) return;
     115                output << "__attribute__ ((";
     116                for ( list< Attribute * >::iterator attr( attributes.begin() );; ) {
     117                        output << (*attr)->get_name();
     118                        if ( ! (*attr)->get_parameters().empty() ) {
     119                                output << "(";
     120                                genCommaList( (*attr)->get_parameters().begin(), (*attr)->get_parameters().end() );
     121                                output << ")";
     122                        } // if
     123                  if ( ++attr == attributes.end() ) break;
     124                        output << ",";                                                          // separator
     125                } // for
     126                output << ")) ";
     127        } // CodeGenerator::genAttributes
    127128
    128129
Note: See TracChangeset for help on using the changeset viewer.