Changeset 0f40912
- Timestamp:
- Apr 3, 2018, 1:58:10 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, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- 593370c
- Parents:
- bd87b138
- git-author:
- Rob Schluntz <rschlunt@…> (04/03/18 11:14:58)
- git-committer:
- Rob Schluntz <rschlunt@…> (04/03/18 13:58:10)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
rbd87b138 r0f40912 89 89 void previsit( StructDecl * aggregateDecl ); 90 90 void previsit( UnionDecl * aggregateDecl ); 91 void previsit( StaticAssertDecl * assertDecl ); 91 92 92 93 private: … … 296 297 } 297 298 298 bool isStructOrUnion( Declaration *decl ) {299 return dynamic_cast< StructDecl * >( decl ) || dynamic_cast< UnionDecl * >( decl ) ;299 bool shouldHoist( Declaration *decl ) { 300 return dynamic_cast< StructDecl * >( decl ) || dynamic_cast< UnionDecl * >( decl ) || dynamic_cast< StaticAssertDecl * >( decl ); 300 301 } 301 302 … … 310 311 } // if 311 312 // Always remove the hoisted aggregate from the inner structure. 312 GuardAction( [aggregateDecl]() { filter( aggregateDecl->members, isStructOrUnion, false ); } );313 GuardAction( [aggregateDecl]() { filter( aggregateDecl->members, shouldHoist, false ); } ); 313 314 } 314 315 … … 328 329 if ( inst->baseUnion ) { 329 330 declsToAddBefore.push_front( inst->baseUnion ); 331 } 332 } 333 334 void HoistStruct::previsit( StaticAssertDecl * assertDecl ) { 335 if ( parentAggr ) { 336 declsToAddBefore.push_back( assertDecl ); 330 337 } 331 338 }
Note: See TracChangeset
for help on using the changeset viewer.