Changeset 6cf27a07 for src/SymTab


Ignore:
Timestamp:
Jul 21, 2016, 2:07:01 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
ccb447e
Parents:
b81adcc4
Message:

reorganize global init so that it is simpler and generates less unnecessary code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Autogen.h

    rb81adcc4 r6cf27a07  
    144144                genCall( srcParam, dstParam, fname, back_inserter( stmts ), obj->get_type(), forward );
    145145
    146                 // currently genCall should produce only one element, but if that changes then the next line needs to be updated to grab the statement which contains the call
    147                 assert( stmts.size() == 1 );
    148                 Statement * callStmt = stmts.front();
    149                 if ( (fname == "?{}" || fname == "^?{}") && ( !obj || ( obj && obj->get_bitfieldWidth() == NULL ) ) ) {
    150                         // implicitly generated ctor/dtor calls should be wrapped
    151                         // so that later passes are aware they were generated.
    152                         // xxx - don't mark as an implicit ctor/dtor if obj is a bitfield,
    153                         // because this causes the address to be taken at codegen, which is illegal in C.
    154                         callStmt = new ImplicitCtorDtorStmt( callStmt );
    155                 }
    156                 *out++ = callStmt;
     146                // currently genCall should produce at most one element, but if that changes then the next line needs to be updated to grab the statement which contains the call
     147                assert( stmts.size() <= 1 );
     148    if ( stmts.size() == 1 ) {
     149                Statement * callStmt = stmts.front();
     150                if ( (fname == "?{}" || fname == "^?{}") && ( !obj || ( obj && obj->get_bitfieldWidth() == NULL ) ) ) {
     151                        // implicitly generated ctor/dtor calls should be wrapped
     152                        // so that later passes are aware they were generated.
     153                        // xxx - don't mark as an implicit ctor/dtor if obj is a bitfield,
     154                        // because this causes the address to be taken at codegen, which is illegal in C.
     155                        callStmt = new ImplicitCtorDtorStmt( callStmt );
     156                }
     157                *out++ = callStmt;
     158    }
    157159        }
    158160} // namespace SymTab
Note: See TracChangeset for help on using the changeset viewer.