Changes in src/SymTab/Validate.cc [a16764a6:bbf3fda]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
ra16764a6 rbbf3fda 89 89 void previsit( StructDecl * aggregateDecl ); 90 90 void previsit( UnionDecl * aggregateDecl ); 91 void previsit( StaticAssertDecl * assertDecl ); 91 92 92 93 private: … … 147 148 void previsit( ObjectDecl * object ); 148 149 void previsit( FunctionDecl * func ); 150 void previsit( FunctionType * ftype ); 149 151 void previsit( StructDecl * aggrDecl ); 150 152 void previsit( UnionDecl * aggrDecl ); … … 296 298 } 297 299 298 bool isStructOrUnion( Declaration *decl ) {299 return dynamic_cast< StructDecl * >( decl ) || dynamic_cast< UnionDecl * >( decl ) ;300 bool shouldHoist( Declaration *decl ) { 301 return dynamic_cast< StructDecl * >( decl ) || dynamic_cast< UnionDecl * >( decl ) || dynamic_cast< StaticAssertDecl * >( decl ); 300 302 } 301 303 … … 310 312 } // if 311 313 // Always remove the hoisted aggregate from the inner structure. 312 GuardAction( [aggregateDecl]() { filter( aggregateDecl->members, isStructOrUnion, false ); } );314 GuardAction( [aggregateDecl]() { filter( aggregateDecl->members, shouldHoist, false ); } ); 313 315 } 314 316 … … 328 330 if ( inst->baseUnion ) { 329 331 declsToAddBefore.push_front( inst->baseUnion ); 332 } 333 } 334 335 void HoistStruct::previsit( StaticAssertDecl * assertDecl ) { 336 if ( parentAggr ) { 337 declsToAddBefore.push_back( assertDecl ); 330 338 } 331 339 } … … 626 634 627 635 void ForallPointerDecay::previsit( ObjectDecl *object ) { 628 forallFixer( object->type->forall, object );629 if ( PointerType *pointer = dynamic_cast< PointerType * >( object->type) ) {630 forallFixer( pointer->base->forall, object);631 } // if636 // ensure that operator names only apply to functions or function pointers 637 if ( CodeGen::isOperator( object->name ) && ! dynamic_cast< FunctionType * >( object->type->stripDeclarator() ) ) { 638 SemanticError( object->location, toCString( "operator ", object->name.c_str(), " is not a function or function pointer." ) ); 639 } 632 640 object->fixUniqueId(); 633 641 } 634 642 635 643 void ForallPointerDecay::previsit( FunctionDecl *func ) { 636 forallFixer( func->type->forall, func );637 644 func->fixUniqueId(); 645 } 646 647 void ForallPointerDecay::previsit( FunctionType * ftype ) { 648 forallFixer( ftype->forall, ftype ); 638 649 } 639 650
Note:
See TracChangeset
for help on using the changeset viewer.