Changeset 4040425 for src/SymTab
- Timestamp:
- Mar 2, 2016, 6:15:02 PM (9 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:
- 36ebd03, b63e376
- Parents:
- 8f610e85
- Location:
- src/SymTab
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/AggregateTable.h
r8f610e85 r4040425 10 10 // Created On : Sun May 17 16:17:26 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun May 17 16:19:29 201513 // Update Count : 412 // Last Modified On : Wed Mar 2 17:31:00 2016 13 // Update Count : 5 14 14 // 15 15 … … 42 42 typedef StackTable< EnumDecl, AggregateTableConflictFunction< EnumDecl > > EnumTable; 43 43 typedef StackTable< UnionDecl, AggregateTableConflictFunction< UnionDecl > > UnionTable; 44 typedef StackTable< ContextDecl, AggregateTableConflictFunction< ContextDecl > > ContextTable;44 typedef StackTable< TraitDecl, AggregateTableConflictFunction< TraitDecl > > TraitTable; 45 45 } // namespace SymTab 46 46 -
src/SymTab/FixFunction.cc
r8f610e85 r4040425 10 10 // Created On : Sun May 17 16:19:49 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun May 17 16:22:54 201513 // Update Count : 212 // Last Modified On : Wed Mar 2 17:31:10 2016 13 // Update Count : 3 14 14 // 15 15 … … 61 61 } 62 62 63 Type * FixFunction::mutate( ContextInstType *aggregateUseType) {63 Type * FixFunction::mutate(TraitInstType *aggregateUseType) { 64 64 return aggregateUseType; 65 65 } -
src/SymTab/FixFunction.h
r8f610e85 r4040425 10 10 // Created On : Sun May 17 17:02:08 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun May 17 17:03:43 201513 // Update Count : 212 // Last Modified On : Wed Mar 2 17:34:06 2016 13 // Update Count : 3 14 14 // 15 15 … … 38 38 virtual Type* mutate(UnionInstType *aggregateUseType); 39 39 virtual Type* mutate(EnumInstType *aggregateUseType); 40 virtual Type* mutate( ContextInstType *aggregateUseType);40 virtual Type* mutate(TraitInstType *aggregateUseType); 41 41 virtual Type* mutate(TypeInstType *aggregateUseType); 42 42 virtual Type* mutate(TupleType *tupleType); -
src/SymTab/ImplementationType.cc
r8f610e85 r4040425 10 10 // Created On : Sun May 17 21:32:01 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun May 17 21:34:40 201513 // Update Count : 212 // Last Modified On : Wed Mar 2 17:31:20 2016 13 // Update Count : 3 14 14 // 15 15 … … 37 37 virtual void visit(UnionInstType *aggregateUseType); 38 38 virtual void visit(EnumInstType *aggregateUseType); 39 virtual void visit( ContextInstType *aggregateUseType);39 virtual void visit(TraitInstType *aggregateUseType); 40 40 virtual void visit(TypeInstType *aggregateUseType); 41 41 virtual void visit(TupleType *tupleType); … … 96 96 } 97 97 98 void ImplementationType::visit( ContextInstType *aggregateUseType) {98 void ImplementationType::visit(TraitInstType *aggregateUseType) { 99 99 } 100 100 -
src/SymTab/Indexer.cc
r8f610e85 r4040425 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 21:37:33 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Wed Aug 05 13:52:42 201513 // Update Count : 1 011 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 2 17:31:29 2016 13 // Update Count : 11 14 14 // 15 15 … … 143 143 } 144 144 145 void Indexer::visit( ContextDecl *aggregateDecl ) {145 void Indexer::visit( TraitDecl *aggregateDecl ) { 146 146 enterScope(); 147 147 acceptAll( aggregateDecl->get_parameters(), *this ); … … 293 293 294 294 295 void Indexer::visit( ContextInstType *contextInst ) {295 void Indexer::visit( TraitInstType *contextInst ) { 296 296 acceptAll( contextInst->get_parameters(), *this ); 297 297 acceptAll( contextInst->get_members(), *this ); … … 350 350 } 351 351 352 ContextDecl * Indexer::lookupContext( const std::string &id ) const {352 TraitDecl * Indexer::lookupTrait( const std::string &id ) const { 353 353 return contextTable.lookup( id ); 354 354 } -
src/SymTab/Indexer.h
r8f610e85 r4040425 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 21:38:55 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Thu Sep 17 16:05:38 201513 // Update Count : 511 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 2 17:34:14 2016 13 // Update Count : 6 14 14 // 15 15 … … 39 39 virtual void visit( UnionDecl *aggregateDecl ); 40 40 virtual void visit( EnumDecl *aggregateDecl ); 41 virtual void visit( ContextDecl *aggregateDecl );41 virtual void visit( TraitDecl *aggregateDecl ); 42 42 43 43 virtual void visit( CompoundStmt *compoundStmt ); … … 67 67 virtual void visit( UntypedValofExpr *valofExpr ); 68 68 69 virtual void visit( ContextInstType *contextInst );69 virtual void visit( TraitInstType *contextInst ); 70 70 virtual void visit( StructInstType *contextInst ); 71 71 virtual void visit( UnionInstType *contextInst ); … … 84 84 EnumDecl *lookupEnum( const std::string &id ) const; 85 85 UnionDecl *lookupUnion( const std::string &id ) const; 86 ContextDecl *lookupContext( const std::string &id ) const;86 TraitDecl *lookupTrait( const std::string &id ) const; 87 87 88 88 void print( std::ostream &os, int indent = 0 ) const; … … 93 93 EnumTable enumTable; 94 94 UnionTable unionTable; 95 ContextTable contextTable;95 TraitTable contextTable; 96 96 97 97 bool doDebug; // display debugging trace -
src/SymTab/Validate.cc
r8f610e85 r4040425 10 10 // Created On : Sun May 17 21:50:04 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jan 27 22:03:12201613 // Update Count : 22 512 // Last Modified On : Wed Mar 2 17:31:39 2016 13 // Update Count : 226 14 14 // 15 15 … … 101 101 virtual void visit( StructInstType *structInst ); 102 102 virtual void visit( UnionInstType *unionInst ); 103 virtual void visit( ContextInstType *contextInst );103 virtual void visit( TraitInstType *contextInst ); 104 104 virtual void visit( StructDecl *structDecl ); 105 105 virtual void visit( UnionDecl *unionDecl ); … … 137 137 virtual void visit( UnionDecl *structDecl ); 138 138 virtual void visit( TypeDecl *typeDecl ); 139 virtual void visit( ContextDecl *ctxDecl );139 virtual void visit( TraitDecl *ctxDecl ); 140 140 virtual void visit( FunctionDecl *functionDecl ); 141 141 … … 192 192 virtual Declaration *mutate( UnionDecl * unionDecl ); 193 193 virtual Declaration *mutate( EnumDecl * enumDecl ); 194 virtual Declaration *mutate( ContextDecl * contextDecl );194 virtual Declaration *mutate( TraitDecl * contextDecl ); 195 195 196 196 template<typename AggDecl> … … 404 404 } 405 405 406 void Pass2::visit( ContextInstType *contextInst ) {406 void Pass2::visit( TraitInstType *contextInst ) { 407 407 Parent::visit( contextInst ); 408 ContextDecl *ctx = indexer->lookupContext( contextInst->get_name() );408 TraitDecl *ctx = indexer->lookupTrait( contextInst->get_name() ); 409 409 if ( ! ctx ) { 410 410 throw SemanticError( "use of undeclared context " + contextInst->get_name() ); … … 412 412 for ( std::list< TypeDecl * >::const_iterator i = ctx->get_parameters().begin(); i != ctx->get_parameters().end(); ++i ) { 413 413 for ( std::list< DeclarationWithType * >::const_iterator assert = (*i )->get_assertions().begin(); assert != (*i )->get_assertions().end(); ++assert ) { 414 if ( ContextInstType *otherCtx = dynamic_cast< ContextInstType * >(*assert ) ) {414 if ( TraitInstType *otherCtx = dynamic_cast< TraitInstType * >(*assert ) ) { 415 415 cloneAll( otherCtx->get_members(), contextInst->get_members() ); 416 416 } else { … … 476 476 while ( ! toBeDone.empty() ) { 477 477 for ( std::list< DeclarationWithType * >::iterator assertion = toBeDone.begin(); assertion != toBeDone.end(); ++assertion ) { 478 if ( ContextInstType *ctx = dynamic_cast< ContextInstType * >( (*assertion )->get_type() ) ) {478 if ( TraitInstType *ctx = dynamic_cast< TraitInstType * >( (*assertion )->get_type() ) ) { 479 479 for ( std::list< Declaration * >::const_iterator i = ctx->get_members().begin(); i != ctx->get_members().end(); ++i ) { 480 480 DeclarationWithType *dwt = dynamic_cast< DeclarationWithType * >( *i ); … … 851 851 } 852 852 853 void AutogenerateRoutines::visit( ContextDecl *) {853 void AutogenerateRoutines::visit( TraitDecl *) { 854 854 // ensure that we don't add assignment ops for types defined as part of the context 855 855 } … … 1075 1075 } 1076 1076 1077 Declaration *EliminateTypedef::mutate( ContextDecl * contextDecl ) {1077 Declaration *EliminateTypedef::mutate( TraitDecl * contextDecl ) { 1078 1078 Mutator::mutate( contextDecl ); 1079 1079 return handleAggregate( contextDecl );
Note: See TracChangeset
for help on using the changeset viewer.