Changeset 15f5c5e
- Timestamp:
- Jun 28, 2018, 2:39:21 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:
- d419d8e
- Parents:
- e73becf
- git-author:
- Rob Schluntz <rschlunt@…> (06/28/18 14:36:35)
- git-committer:
- Rob Schluntz <rschlunt@…> (06/28/18 14:39:21)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
re73becf r15f5c5e 80 80 81 81 namespace SymTab { 82 struct LinkNestedTypes final : public WithDeclsToAdd { 83 void previsit( AggregateDecl * aggr ); 84 82 /// hoists declarations that are difficult to hoist while parsing 83 struct HoistTypeDecls final : public WithDeclsToAdd { 85 84 void previsit( SizeofExpr * ); 86 85 void previsit( AlignofExpr * ); … … 269 268 PassVisitor<FindSpecialDeclarations> finder; 270 269 PassVisitor<LabelAddressFixer> labelAddrFixer; 271 PassVisitor< LinkNestedTypes> nestedTypes;272 273 acceptAll( translationUnit, nestedTypes );270 PassVisitor<HoistTypeDecls> hoistDecls; 271 272 acceptAll( translationUnit, hoistDecls ); 274 273 EliminateTypedef::eliminateTypedef( translationUnit ); 275 274 ReturnTypeFixer::fix( translationUnit ); // must happen before autogen … … 303 302 304 303 305 void LinkNestedTypes::previsit( AggregateDecl * aggr ) { 306 for ( auto it = aggr->members.begin(); it != aggr->members.end(); ) { 307 auto current = it++; 308 Declaration * member = *current; 309 if ( AggregateDecl * child = dynamic_cast<AggregateDecl *>( member ) ) { 310 child->parent = aggr; 311 } 312 } 313 } 314 315 void LinkNestedTypes::handleType( Type * type ) { 304 void HoistTypeDecls::handleType( Type * type ) { 316 305 // some type declarations are buried in expressions and not easy to hoist during parsing; hoist them here 317 306 AggregateDecl * aggr = nullptr; … … 328 317 } 329 318 330 void LinkNestedTypes::previsit( SizeofExpr * expr ) {319 void HoistTypeDecls::previsit( SizeofExpr * expr ) { 331 320 handleType( expr->type ); 332 321 } 333 322 334 void LinkNestedTypes::previsit( AlignofExpr * expr ) {323 void HoistTypeDecls::previsit( AlignofExpr * expr ) { 335 324 handleType( expr->type ); 336 325 } 337 326 338 void LinkNestedTypes::previsit( UntypedOffsetofExpr * expr ) {327 void HoistTypeDecls::previsit( UntypedOffsetofExpr * expr ) { 339 328 handleType( expr->type ); 340 329 }
Note: See TracChangeset
for help on using the changeset viewer.