Changeset b29f8f3 for src/SymTab
- Timestamp:
- Jul 29, 2015, 12:07:38 PM (10 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 093f1a0
- Parents:
- 1e8f143 (diff), 51b986f (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. - Location:
- src/SymTab
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/AddVisit.h
r1e8f143 rb29f8f3 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 16:14:32 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sun May 17 16:16:38201513 // Update Count : 311 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Jul 14 12:26:17 2015 13 // Update Count : 4 14 14 // 15 15 … … 57 57 inline void addVisit(ForStmt *forStmt, Visitor &visitor) { 58 58 addVisitStatement( forStmt->get_body(), visitor ); 59 maybeAccept( forStmt->get_initialization(), visitor );59 acceptAll( forStmt->get_initialization(), visitor ); 60 60 maybeAccept( forStmt->get_condition(), visitor ); 61 61 maybeAccept( forStmt->get_increment(), visitor ); -
src/SymTab/TypeEquality.cc
r1e8f143 rb29f8f3 10 10 // Created On : Tue Jul 07 16:28:29 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Thu Jul 09 11:18:46201513 // Update Count : 3 612 // Last Modified On : Mon Jul 20 14:16:11 2015 13 // Update Count : 37 14 14 // 15 15 … … 91 91 // and must both have a dimension expression or not have a dimension 92 92 result = result && arrayType->get_isVarLen() == at->get_isVarLen() 93 && ( arrayType->get_dimension() != 0 && at->get_dimension() != 094 || arrayType->get_dimension() == 0 && at->get_dimension() == 0);93 && ((arrayType->get_dimension() != 0 && at->get_dimension() != 0) 94 || (arrayType->get_dimension() == 0 && at->get_dimension() == 0)); 95 95 96 96 if ( vlaErr ) { -
src/SymTab/Validate.cc
r1e8f143 rb29f8f3 10 10 // Created On : Sun May 17 21:50:04 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Mon Jul 13 14:38:19201513 // Update Count : 1 8412 // Last Modified On : Wed Jul 22 13:16:00 2015 13 // Update Count : 194 14 14 // 15 15 … … 169 169 virtual TypeDecl *mutate( TypeDecl *typeDecl ); 170 170 virtual DeclarationWithType *mutate( FunctionDecl *funcDecl ); 171 virtual ObjectDecl*mutate( ObjectDecl *objDecl );171 virtual DeclarationWithType *mutate( ObjectDecl *objDecl ); 172 172 virtual CompoundStmt *mutate( CompoundStmt *compoundStmt ); 173 173 virtual Type *mutate( TypeInstType *aggregateUseType ); … … 203 203 void validateType( Type *type, const Indexer *indexer ) { 204 204 Pass1 pass1; 205 Pass2 pass2( false, indexer ); 205 206 Pass3 pass3( indexer ); 206 207 type->accept( pass1 ); 208 type->accept( pass2 ); 207 209 type->accept( pass3 ); 208 210 } … … 403 405 } // for 404 406 } // for 407 408 if ( ctx->get_parameters().size() != contextInst->get_parameters().size() ) { 409 throw SemanticError( "incorrect number of context parameters: ", contextInst ); 410 } // if 411 405 412 applySubstitution( ctx->get_parameters().begin(), ctx->get_parameters().end(), contextInst->get_parameters().begin(), ctx->get_members().begin(), ctx->get_members().end(), back_inserter( contextInst->get_members() ) ); 406 413 } … … 534 541 init->get_args().push_back( new NameExpr( "0" ) ); 535 542 Statement *initStmt = new ExprStmt( noLabels, init ); 543 std::list<Statement *> initList; 544 initList.push_back( initStmt ); 536 545 537 546 UntypedExpr *cond = new UntypedExpr( new NameExpr( "?<?" ) ); … … 559 568 assignExpr->get_args().push_back( srcIndex ); 560 569 561 *out++ = new ForStmt( noLabels, init Stmt, cond, inc, new ExprStmt( noLabels, assignExpr ) );570 *out++ = new ForStmt( noLabels, initList, cond, inc, new ExprStmt( noLabels, assignExpr ) ); 562 571 } 563 572 … … 612 621 delete assigns.front(); 613 622 assigns.pop_front(); 614 } 623 } // for 615 624 616 625 declsToAdd.insert( declsToAdd.begin(), assigns.begin(), assigns.end() ); … … 827 836 rtt->get_parameters().clear(); 828 837 cloneAll(typeInst->get_parameters(), rtt->get_parameters()); 829 } 838 } // if 830 839 delete typeInst; 831 840 return ret; … … 881 890 } 882 891 883 ObjectDecl*EliminateTypedef::mutate( ObjectDecl * objDecl ) {892 DeclarationWithType *EliminateTypedef::mutate( ObjectDecl * objDecl ) { 884 893 TypedefMap oldNames = typedefNames; 885 ObjectDecl *ret = Mutator::mutate( objDecl ); 894 DeclarationWithType *ret = Mutator::mutate( objDecl ); 895 if ( FunctionType *funtype = dynamic_cast<FunctionType *>( ret->get_type() ) ) { 896 return new FunctionDecl( ret->get_name(), ret->get_storageClass(), ret->get_linkage(), funtype, 0, ret->get_isInline(), ret->get_isNoreturn() ); 897 } else if ( objDecl->get_isInline() || objDecl->get_isNoreturn() ) { 898 throw SemanticError( "invalid inline or _Noreturn specification in declaration of ", objDecl ); 899 } // if 886 900 typedefNames = oldNames; 887 901 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.