Changeset b29f8f3 for src/CodeGen


Ignore:
Timestamp:
Jul 29, 2015, 12:07:38 PM (10 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
093f1a0
Parents:
1e8f143 (diff), 51b986f (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 from origin

Location:
src/CodeGen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r1e8f143 rb29f8f3  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jun 26 16:52:58 2015
    13 // Update Count     : 144
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Wed Jul 15 14:47:42 2015
     13// Update Count     : 177
    1414//
    1515
     
    3838        int CodeGenerator::tabsize = 4;
    3939
    40         // the kinds of statements that would ideally be separated by more whitespace
     40        // the kinds of statements that would ideally be followed by whitespace
    4141        bool wantSpacing( Statement * stmt) {
    4242                return dynamic_cast< IfStmt * >( stmt ) || dynamic_cast< CompoundStmt * >( stmt ) ||
     
    588588
    589589        void CodeGenerator::visit( ForStmt *forStmt ) {
    590                 output << "for (";
    591 
    592                 if ( forStmt->get_initialization() != 0 )
    593                         forStmt->get_initialization()->accept( *this );
    594                 else
    595                         output << ";";
    596                
     590                // initialization is always hoisted, so don't
     591                // bother doing anything with that
     592                output << "for (;";
     593
    597594                if ( forStmt->get_condition() != 0 )
    598595                        forStmt->get_condition()->accept( *this );
  • src/CodeGen/GenType.cc

    r1e8f143 rb29f8f3  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Jul 08 16:08:24 2015
    13 // Update Count     : 10
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Jul  9 16:43:52 2015
     13// Update Count     : 13
    1414//
    1515
     
    9393                        os << "_Atomic ";
    9494                } // if
     95                if ( qualifiers.isAttribute ) {
     96                        os << "__attribute(( )) ";
     97                } // if
    9598                if ( dimension != 0 ) {
    9699                        CodeGenerator cg( os );
    97100                        dimension->accept( cg );
    98101                } else if ( isVarLen ) {
    99                         // no dimension expression on a VLA
    100                         // means it came in with the * token
     102                        // no dimension expression on a VLA means it came in with the * token
    101103                        os << "*";
    102104                } // if
     
    202204                        typeString = "_Atomic " + typeString;
    203205                } // if
     206                if ( type->get_isAttribute() ) {
     207                        typeString = "__attribute(( )) " + typeString;
     208                } // if
    204209        }
    205210} // namespace CodeGen
Note: See TracChangeset for help on using the changeset viewer.