- Timestamp:
- Jan 3, 2018, 10:10:20 AM (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:
- 4e22d7d
- Parents:
- b3048d4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/GenInit.cc
rb3048d4 r300d75b 41 41 #include "SynTree/Type.h" // for Type, ArrayType, Type::Qualifiers 42 42 #include "SynTree/Visitor.h" // for acceptAll, maybeAccept 43 #include "Tuples/Tuples.h" // for maybeImpure 43 44 44 45 namespace InitTweak { … … 186 187 // need to resolve array dimensions in order to accurately determine if constexpr 187 188 ResolvExpr::findSingleExpression( arrayType->dimension, SymTab::SizeType->clone(), indexer ); 188 // don't need to hoist dimension if it's a constexpr- only need to if there's potential for side effects.189 if ( isConstExpr( arrayType->get_dimension()) ) return;189 // don't need to hoist dimension if it's definitely pure - only need to if there's potential for side effects. 190 if ( ! Tuples::maybeImpure( arrayType->dimension ) ) return; 190 191 191 192 ObjectDecl * arrayDimension = new ObjectDecl( dimensionName.newName(), storageClasses, LinkageSpec::C, 0, SymTab::SizeType->clone(), new SingleInit( arrayType->get_dimension() ) );
Note: See TracChangeset
for help on using the changeset viewer.