Changeset 861799c for src/SymTab


Ignore:
Timestamp:
Mar 10, 2017, 11:00:13 AM (8 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:
c857ad3
Parents:
0e7ea335
Message:

fix 0,1 member access, fix autogenerated routines missing size for sized generic types

Location:
src/SymTab
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Autogen.cc

    r0e7ea335 r861799c  
    151151        bool hasDynamicLayout( AggrDecl * aggregateDecl ) {
    152152                for ( TypeDecl * param : aggregateDecl->get_parameters() ) {
    153                         if ( param->get_kind() == TypeDecl::Any ) return true;
     153                        if ( param->isComplete() ) return true;
    154154                }
    155155                return false;
  • src/SymTab/Validate.cc

    r0e7ea335 r861799c  
    224224                HoistStruct::hoistStruct( translationUnit );
    225225                ReturnTypeFixer::fix( translationUnit ); // must happen before autogen
     226                acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions
    226227                autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecayPass
    227228                acceptAll( translationUnit, epc );
    228                 acceptAll( translationUnit, lrt );
    229229                ReturnChecker::checkFunctionReturns( translationUnit );
    230230                compoundliteral.mutateDeclarationList( translationUnit );
     
    838838                assertf( retVals.size() == 0 || retVals.size() == 1, "Function %s has too many return values: %d", functionDecl->get_name().c_str(), retVals.size() );
    839839                if ( retVals.size() == 1 ) {
    840                         // ensure all function return values have a name - use the name of the function to disambiguate (this also provides a nice bit of help for debugging)
    841                         // ensure other return values have a name
     840                        // ensure all function return values have a name - use the name of the function to disambiguate (this also provides a nice bit of help for debugging).
     841                        // ensure other return values have a name.
    842842                        DeclarationWithType * ret = retVals.front();
    843843                        if ( ret->get_name() == "" ) {
Note: See TracChangeset for help on using the changeset viewer.