Changeset 4934ea3
- Timestamp:
- Jul 30, 2018, 4:43:47 PM (6 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, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 2ff9f4a
- Parents:
- f072892
- git-author:
- Rob Schluntz <rschlunt@…> (07/26/18 15:04:52)
- git-committer:
- Rob Schluntz <rschlunt@…> (07/30/18 16:43:47)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
rf072892 r4934ea3 61 61 #include "Parser/LinkageSpec.h" // for C 62 62 #include "ResolvExpr/typeops.h" // for typesCompatible 63 #include "ResolvExpr/Resolver.h" // for findSingleExpression 63 64 #include "SymTab/Autogen.h" // for SizeType 64 65 #include "SynTree/Attribute.h" // for noAttributes, Attribute … … 247 248 }; 248 249 249 struct ArrayLength {250 struct ArrayLength : public WithIndexer { 250 251 /// for array types without an explicit length, compute the length and store it so that it 251 252 /// is known to the rest of the phases. For example, … … 258 259 259 260 void previsit( ObjectDecl * objDecl ); 261 void previsit( ArrayType * arrayType ); 260 262 }; 261 263 … … 1239 1241 } 1240 1242 1243 void ArrayLength::previsit( ArrayType * type ) { 1244 if ( type->dimension ) { 1245 // need to resolve array dimensions early so that constructor code can correctly determine 1246 // if a type is a VLA (and hence whether its elements need to be constructed) 1247 ResolvExpr::findSingleExpression( type->dimension, SymTab::SizeType->clone(), indexer ); 1248 1249 // must re-evaluate whether a type is a VLA, now that more information is available 1250 // (e.g. the dimension may have been an enumerator, which was unknown prior to this step) 1251 type->isVarLen = ! InitTweak::isConstExpr( type->dimension ); 1252 } 1253 } 1254 1241 1255 struct LabelFinder { 1242 1256 std::set< Label > & labels;
Note: See TracChangeset
for help on using the changeset viewer.