Changes in src/SymTab/Validate.cc [60c3b06c:522363e]
- File:
-
- 1 edited
-
src/SymTab/Validate.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
r60c3b06c r522363e 56 56 #include "FixFunction.h" // for FixFunction 57 57 #include "Indexer.h" // for Indexer 58 #include "InitTweak/GenInit.h" // for fixReturnStatements59 58 #include "InitTweak/InitTweak.h" // for isCtorDtorAssign 60 59 #include "Parser/LinkageSpec.h" // for C … … 151 150 /// Replaces array and function types in forall lists by appropriate pointer type and assigns each Object and Function declaration a unique ID. 152 151 struct ForallPointerDecay final { 153 void previsit( ObjectDecl * object );154 void previsit( FunctionDecl * func );152 void previsit( ObjectDecl *object ); 153 void previsit( FunctionDecl *func ); 155 154 }; 156 155 … … 580 579 581 580 /// Fix up assertions - flattens assertion lists, removing all trait instances 582 void forallFixer( std::list< TypeDecl * > & forall, BaseSyntaxNode * node) {583 for ( TypeDecl * type : f orall) {581 void forallFixer( Type * func ) { 582 for ( TypeDecl * type : func->get_forall() ) { 584 583 std::list< DeclarationWithType * > asserts; 585 584 asserts.splice( asserts.end(), type->assertions ); … … 600 599 assertion = assertion->acceptMutator( fixer ); 601 600 if ( fixer.get_isVoid() ) { 602 throw SemanticError( "invalid type void in assertion of function ", node);601 throw SemanticError( "invalid type void in assertion of function ", func ); 603 602 } // if 604 603 } // for … … 608 607 609 608 void ForallPointerDecay::previsit( ObjectDecl *object ) { 610 forallFixer( object-> type->forall, object);611 if ( PointerType *pointer = dynamic_cast< PointerType * >( object-> type) ) {612 forallFixer( pointer-> base->forall, object);609 forallFixer( object->get_type() ); 610 if ( PointerType *pointer = dynamic_cast< PointerType * >( object->get_type() ) ) { 611 forallFixer( pointer->get_base() ); 613 612 } // if 614 613 object->fixUniqueId(); … … 616 615 617 616 void ForallPointerDecay::previsit( FunctionDecl *func ) { 618 forallFixer( func-> type->forall, func);617 forallFixer( func->get_type() ); 619 618 func->fixUniqueId(); 620 619 }
Note:
See TracChangeset
for help on using the changeset viewer.