Changeset 74bba15 for src/SymTab/Validate.cc
- Timestamp:
- Sep 26, 2017, 5:19:32 PM (7 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, resolv-new, with_gc
- Children:
- 5dc26f5
- Parents:
- af58ee0 (diff), a7d151f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
raf58ee0 r74bba15 56 56 #include "FixFunction.h" // for FixFunction 57 57 #include "Indexer.h" // for Indexer 58 #include "InitTweak/GenInit.h" // for fixReturnStatements 58 59 #include "InitTweak/InitTweak.h" // for isCtorDtorAssign 59 60 #include "Parser/LinkageSpec.h" // for C … … 150 151 /// Replaces array and function types in forall lists by appropriate pointer type and assigns each Object and Function declaration a unique ID. 151 152 struct ForallPointerDecay final { 152 void previsit( ObjectDecl * object );153 void previsit( FunctionDecl * func );153 void previsit( ObjectDecl * object ); 154 void previsit( FunctionDecl * func ); 154 155 }; 155 156 … … 579 580 580 581 /// Fix up assertions - flattens assertion lists, removing all trait instances 581 void forallFixer( Type * func) {582 for ( TypeDecl * type : f unc->get_forall()) {582 void forallFixer( std::list< TypeDecl * > & forall, BaseSyntaxNode * node ) { 583 for ( TypeDecl * type : forall ) { 583 584 std::list< DeclarationWithType * > asserts; 584 585 asserts.splice( asserts.end(), type->assertions ); … … 599 600 assertion = assertion->acceptMutator( fixer ); 600 601 if ( fixer.get_isVoid() ) { 601 throw SemanticError( "invalid type void in assertion of function ", func);602 throw SemanticError( "invalid type void in assertion of function ", node ); 602 603 } // if 603 604 } // for … … 607 608 608 609 void ForallPointerDecay::previsit( ObjectDecl *object ) { 609 forallFixer( object-> get_type());610 if ( PointerType *pointer = dynamic_cast< PointerType * >( object-> get_type()) ) {611 forallFixer( pointer-> get_base());610 forallFixer( object->type->forall, object ); 611 if ( PointerType *pointer = dynamic_cast< PointerType * >( object->type ) ) { 612 forallFixer( pointer->base->forall, object ); 612 613 } // if 613 614 object->fixUniqueId(); … … 615 616 616 617 void ForallPointerDecay::previsit( FunctionDecl *func ) { 617 forallFixer( func-> get_type());618 forallFixer( func->type->forall, func ); 618 619 func->fixUniqueId(); 619 620 }
Note: See TracChangeset
for help on using the changeset viewer.