Changeset fdd0509 for src/InitTweak
- Timestamp:
- Dec 22, 2017, 4:15:24 PM (7 years ago)
- 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:
- ddb80bd
- Parents:
- c1bf35f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/GenInit.cc
rc1bf35f rfdd0509 30 30 #include "InitTweak.h" // for isConstExpr, InitExpander, checkIn... 31 31 #include "Parser/LinkageSpec.h" // for isOverridable, C 32 #include "ResolvExpr/Resolver.h" 32 33 #include "SymTab/Autogen.h" // for genImplicitCall, SizeType 33 34 #include "SymTab/Mangler.h" // for Mangler … … 89 90 }; 90 91 91 struct HoistArrayDimension final : public WithDeclsToAdd, public WithShortCircuiting, public WithGuards {92 struct HoistArrayDimension final : public WithDeclsToAdd, public WithShortCircuiting, public WithGuards, public WithIndexer { 92 93 /// hoist dimension from array types in object declaration so that it uses a single 93 94 /// const variable of type size_t, so that side effecting array dimensions are only … … 104 105 void premutate( FunctionType * ) { visit_children = false; } 105 106 107 // need this so that enumerators are added to the indexer, due to premutate(AggregateDecl *) 108 void premutate( EnumDecl * ) {} 109 106 110 void hoist( Type * type ); 107 111 … … 180 184 if ( ! arrayType->get_dimension() ) return; // xxx - recursive call to hoist? 181 185 186 // need to resolve array dimensions in order to accurately determine if constexpr 187 ResolvExpr::findSingleExpression( arrayType->dimension, SymTab::SizeType->clone(), indexer ); 182 188 // don't need to hoist dimension if it's a constexpr - only need to if there's potential for side effects. 183 189 if ( isConstExpr( arrayType->get_dimension() ) ) return; … … 196 202 void HoistArrayDimension::premutate( FunctionDecl * ) { 197 203 GuardValue( inFunction ); 204 inFunction = true; 198 205 } 199 206
Note: See TracChangeset
for help on using the changeset viewer.