Changeset b419abb
- Timestamp:
- Mar 15, 2019, 2:22:25 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- fdae913
- Parents:
- b8665e3
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PersistentMap.h
rb8665e3 rb419abb 114 114 } 115 115 116 // PersistentMap( Mode m, Base&& b ) : data(), mode(m) {117 // init<Base>(std::move(b));118 // }119 120 // template<typename P, typename K, typename V>121 // PersistentMap( Mode m, P&& o, K&& k, V&& v ) : data(), mode(m) {122 // init<Ins>(std::forward<P>(o), std::forward<K>(k), std::forward<V>(v));123 // }124 125 // template<typename P, typename K>126 // PersistentMap( Mode m, P&& o, K&& k ) : data(), mode(m) {127 // init<Rem>(std::forward<P>(o), std::forward<K>(k));128 // }129 130 116 public: 131 117 using size_type = std::size_t; -
src/SymTab/Indexer.cc
rb8665e3 rb419abb 17 17 18 18 #include <cassert> // for assert, strict_dynamic_cast 19 #include <iostream> // for operator<<, basic_ostream, ostream20 19 #include <string> // for string, operator<<, operator!= 21 20 #include <memory> // for shared_ptr, make_shared … … 40 39 #include "SynTree/Type.h" // for Type, StructInstType, UnionInstType 41 40 42 #define debugPrint(x) if ( doDebug ) { std::cerr << x; }43 44 41 namespace SymTab { 45 42 46 43 // Statistics block 47 // namespace { 48 49 // static inline auto stats_idtable() { 50 // using namespace Stats::Counters; 51 // static auto group = build<CounterGroup>("IdTable"); 52 // static struct { 53 // SimpleCounter * find; 54 // AverageCounter<double> * size; 55 // AverageCounter<double> * key; 56 // } ret = { 57 // .find = build<SimpleCounter>("Find calls", group), 58 // .size = build<AverageCounter<double>>("Average Size", group), 59 // .key = build<AverageCounter<double>>("Average Key Size", group), 60 // }; 61 // return ret; 62 // } 63 64 // static inline auto stats_indexers() { 65 // using namespace Stats::Counters; 66 // static auto group = build<CounterGroup>("Indexers"); 67 // static struct { 68 // SimpleCounter * count; 69 // AverageCounter<double> * size; 70 // AverageCounter<double> * depth_a; 71 // MaxCounter<size_t> * depth_m; 72 // SimpleCounter * new_scopes; 73 // AverageCounter<double> * avg_scope_depth; 74 // MaxCounter<size_t> * max_scope_depth; 75 // SimpleCounter * add_calls; 76 // SimpleCounter * lookup_calls; 77 // SimpleCounter * map_lookups; 78 // } ret = { 79 // .count = build<SimpleCounter>("Count", group), 80 // .size = build<AverageCounter<double>>("Average Size", group), 81 // .depth_a = build<AverageCounter<double>>("Average Depth", group), 82 // .depth_m = build<MaxCounter<size_t>>("Max Depth", group), 83 // .new_scopes = build<SimpleCounter>("Scopes", group), 84 // .avg_scope_depth = build<AverageCounter<double>>("Average Scope", group), 85 // .max_scope_depth = build<MaxCounter<size_t>>("Max Scope", group), 86 // .add_calls = build<SimpleCounter>("Add Calls", group), 87 // .lookup_calls = build<SimpleCounter>("Lookup Calls", group), 88 // .map_lookups = build<SimpleCounter>("Map Lookups", group), 89 // }; 90 // return ret; 91 // } 92 // } 93 94 // std::ostream & operator<<( std::ostream & out, const Indexer::IdData & data ) { 95 // return out << "(" << data.id << "," << data.baseExpr << ")"; 96 // } 97 98 // void dump( const Indexer::IdTable &table, std::ostream &os ) { 99 // for ( IdTable::const_iterator id = table.begin(); id != table.end(); ++id ) { 100 // for ( MangleTable::const_iterator mangle = id->second.begin(); mangle != id->second.end(); ++mangle ) { 101 // os << mangle->second << std::endl; 102 // } 103 // } 104 // } 105 106 // template< typename Decl > 107 // void dump( const PersistentMap< std::string, Decl* > &table, std::ostream &os ) { 108 // for ( auto decl : table ) { 109 // os << decl.second << std::endl; 110 // } // for 111 // } 44 namespace { 45 static inline auto stats() { 46 using namespace Stats::Counters; 47 static auto group = build<CounterGroup>("Indexers"); 48 static struct { 49 SimpleCounter * count; 50 AverageCounter<double> * size; 51 SimpleCounter * new_scopes; 52 SimpleCounter * lazy_scopes; 53 AverageCounter<double> * avg_scope_depth; 54 MaxCounter<size_t> * max_scope_depth; 55 SimpleCounter * add_calls; 56 SimpleCounter * lookup_calls; 57 SimpleCounter * map_lookups; 58 SimpleCounter * map_mutations; 59 } ret = { 60 .count = build<SimpleCounter>("Count", group), 61 .size = build<AverageCounter<double>>("Average Size", group), 62 .new_scopes = build<SimpleCounter>("Scopes", group), 63 .lazy_scopes = build<SimpleCounter>("Lazy Scopes", group), 64 .avg_scope_depth = build<AverageCounter<double>>("Average Scope", group), 65 .max_scope_depth = build<MaxCounter<size_t>>("Max Scope", group), 66 .add_calls = build<SimpleCounter>("Add Calls", group), 67 .lookup_calls = build<SimpleCounter>("Lookup Calls", group), 68 .map_lookups = build<SimpleCounter>("Map Lookups", group), 69 .map_mutations = build<SimpleCounter>("Map Mutations", group) 70 }; 71 return ret; 72 } 73 } 112 74 113 75 void Indexer::removeSpecialOverrides( const std::string &id, std::list< IdData > & out ) const { … … 162 124 } 163 125 164 // if a type contains user defined ctor/dtor/assign, then special rules trigger, which determine 165 // the set of ctor/dtor/assign that can be used by the requester. In particular, if the user defines 166 // a default ctor, then the generated default ctor is unavailable, likewise for copy ctor 167 // and dtor. If the user defines any ctor/dtor, then no generated field ctors are available. 168 // If the user defines any ctor then the generated default ctor is unavailable (intrinsic default 169 // ctor must be overridden exactly). If the user defines anything that looks like a copy constructor, 170 // then the generated copy constructor is unavailable, and likewise for the assignment operator. 126 // if a type contains user defined ctor/dtor/assign, then special rules trigger, which 127 // determinethe set of ctor/dtor/assign that can be used by the requester. In particular, 128 // if the user defines a default ctor, then the generated default ctor is unavailable, 129 // likewise for copy ctor and dtor. If the user defines any ctor/dtor, then no generated 130 // field ctors are available. If the user defines any ctor then the generated default ctor 131 // is unavailable (intrinsic default ctor must be overridden exactly). If the user defines 132 // anything that looks like a copy constructor, then the generated copy constructor is 133 // unavailable, and likewise for the assignment operator. 171 134 for ( std::pair< const std::string, ValueType > & pair : funcMap ) { 172 135 ValueType & val = pair.second; … … 177 140 178 141 // only implicitly delete non-user defined functions that are not intrinsic, and are 179 // not copy functions (assignment or copy constructor). If a user-defined copy function exists, 180 // do not pass along the non-user-defined copy functions since signatures do not have to match, 181 // and the generated functions will often be cheaper. 142 // not copy functions (assignment or copy constructor). If a user-defined copy 143 // function exists, do not pass along the non-user-defined copy functions since 144 // signatures do not have to match, and the generated functions will often be 145 // cheaper. 182 146 if ( isNotUserDefinedFunc ) { 183 147 if ( isCopyFunc ) { 184 // Skip over non-user-defined copy functions when there is a user-defined copy function. 185 // Since their signatures do not have to be exact, deleting them is the wrong choice. 148 // Skip over non-user-defined copy functions when there is a user-defined 149 // copy function. Since their signatures do not have to be exact, deleting 150 // them is the wrong choice. 186 151 if ( existsUserDefinedCopyFunc ) continue; 187 152 } else { … … 198 163 Indexer::Indexer() 199 164 : idTable(), typeTable(), structTable(), enumTable(), unionTable(), traitTable(), 200 prevScope(), scope( 0 ) {} 201 202 Indexer::~Indexer() {} 165 prevScope(), scope( 0 ), repScope( 0 ) { ++*stats().count; } 166 167 Indexer::~Indexer() { 168 stats().size->push( idTable ? idTable->size() : 0 ); 169 } 170 171 void Indexer::lazyInitScope() { 172 if ( repScope < scope ) { 173 ++*stats().lazy_scopes; 174 // create rollback 175 prevScope = std::make_shared<Indexer>( *this ); 176 // update repScope 177 repScope = scope; 178 } 179 } 203 180 204 181 void Indexer::enterScope() { 205 // save current state in prevScope and increment scope206 prevScope = std::make_shared<Indexer>( *this );207 182 ++scope; 208 183 209 // if ( doDebug ) {210 // std::cerr << "--- Entering scope " << scope << std::endl;211 // }184 ++*stats().new_scopes; 185 stats().avg_scope_depth->push( scope ); 186 stats().max_scope_depth->push( scope ); 212 187 } 213 188 214 189 void Indexer::leaveScope() { 215 // if ( doDebug ) { 216 // std::cerr << "--- Leaving scope " << scope << " containing" << std::endl; 217 // dump( idTable, std::cerr ); 218 // dump( typeTable, std::cerr ); 219 // dump( structTable, std::cerr ); 220 // dump( enumTable, std::cerr ); 221 // dump( unionTable, std::cerr ); 222 // dump( traitTable, std::cerr ); 223 // } 224 225 // replace all maps and scope index with previous scope's versions 226 *this = *prevScope; 190 if ( repScope == scope ) { 191 // replace all maps and scope index with previous scope's versions 192 Ptr prev = prevScope; // make sure prevScope stays live 193 *this = std::move(*prevScope); // replace with previous scope 194 } 195 196 --scope; 227 197 } 228 198 229 199 void Indexer::lookupId( const std::string &id, std::list< IdData > &out ) const { 200 ++*stats().lookup_calls; 230 201 if ( ! idTable ) return; 231 202 203 ++*stats().map_lookups; 232 204 auto decls = idTable->find( id ); 233 205 if ( decls == idTable->end() ) return; … … 244 216 245 217 NamedTypeDecl *Indexer::lookupType( const std::string &id ) const { 218 ++*stats().lookup_calls; 246 219 if ( ! typeTable ) return nullptr; 220 ++*stats().map_lookups; 247 221 auto it = typeTable->find( id ); 248 222 return it == typeTable->end() ? nullptr : it->second.decl; … … 250 224 251 225 StructDecl *Indexer::lookupStruct( const std::string &id ) const { 226 ++*stats().lookup_calls; 252 227 if ( ! structTable ) return nullptr; 228 ++*stats().map_lookups; 253 229 auto it = structTable->find( id ); 254 230 return it == structTable->end() ? nullptr : it->second.decl; … … 256 232 257 233 EnumDecl *Indexer::lookupEnum( const std::string &id ) const { 234 ++*stats().lookup_calls; 258 235 if ( ! enumTable ) return nullptr; 236 ++*stats().map_lookups; 259 237 auto it = enumTable->find( id ); 260 238 return it == enumTable->end() ? nullptr : it->second.decl; … … 262 240 263 241 UnionDecl *Indexer::lookupUnion( const std::string &id ) const { 242 ++*stats().lookup_calls; 264 243 if ( ! unionTable ) return nullptr; 244 ++*stats().map_lookups; 265 245 auto it = unionTable->find( id ); 266 246 return it == unionTable->end() ? nullptr : it->second.decl; … … 268 248 269 249 TraitDecl *Indexer::lookupTrait( const std::string &id ) const { 250 ++*stats().lookup_calls; 270 251 if ( ! traitTable ) return nullptr; 252 ++*stats().map_lookups; 271 253 auto it = traitTable->find( id ); 272 254 return it == traitTable->end() ? nullptr : it->second.decl; 273 255 } 274 256 275 const Indexer* Indexer::atScope( unsigned long scope) const {276 // scan back to scope; guaranteed one indexer per scope by construction of enterScope,277 // final indexer in list has scope 0, cannot be > scope257 const Indexer* Indexer::atScope( unsigned long target ) const { 258 // by lazy construction, final indexer in list has repScope 0, cannot be > target 259 // otherwise, will find first scope representing the target 278 260 const Indexer* indexer = this; 279 while ( indexer-> scope > scope) {261 while ( indexer->repScope > target ) { 280 262 indexer = indexer->prevScope.get(); 281 263 } 282 264 return indexer; 283 265 } 284 285 // const Indexer::IdData * Indexer::localLookupId(286 // const std::string &id, const std::string &mangleName ) const {287 // if ( ! idTable ) return nullptr;288 289 // // lookup name290 // auto decls = idTable->find( id );291 // if ( decls == idTable->end() ) return nullptr;292 293 // // lookup mangleName294 // // assume any mangle-table pointer added is non-null295 // const MangleTable& mangleTable = *(decls->second);296 // auto decl = mangleTable.find( mangleName );297 // if ( decl == mangleTable.end() ) return nullptr;298 299 // // skip identifiers not defined in this scope300 // if ( decl->second.scope != scope ) return nullptr;301 // return &decl->second;302 // }303 304 // Indexer::IdData * Indexer::lookupIdAtScope(305 // const std::string &id, const std::string &mangleName, unsigned long scope ) {306 // return const_cast<IdData *>(307 // const_cast<const Indexer *>(this)->lookupIdAtScope( id, mangleName, scope ));308 // }309 310 // NamedTypeDecl *Indexer::lookupTypeAtScope( const std::string &id, unsigned long scope ) const {311 312 // if ( ! tables ) return ++*stats_indexers().lookup_calls, nullptr;313 // if ( tables->scope < scope ) return ++*stats_indexers().lookup_calls, nullptr;314 // if ( tables->scope > scope ) return tables->base.lookupTypeAtScope( id, scope );315 316 // ++*stats_indexers().map_lookups;317 // TypeTable::const_iterator ret = tables->typeTable.find( id );318 // return ret != tables->typeTable.end() ?319 // ++*stats_indexers().lookup_calls, ret->second :320 // tables->base.lookupTypeAtScope( id, scope );321 // }322 323 // StructDecl *Indexer::lookupStructAtScope( const std::string &id, unsigned long scope ) const {324 // if ( ! tables ) return ++*stats_indexers().lookup_calls, nullptr;325 // if ( tables->scope < scope ) return ++*stats_indexers().lookup_calls, nullptr;326 // if ( tables->scope > scope ) return tables->base.lookupStructAtScope( id, scope );327 328 // ++*stats_indexers().map_lookups;329 // StructTable::const_iterator ret = tables->structTable.find( id );330 // return ret != tables->structTable.end() ?331 // ++*stats_indexers().lookup_calls, ret->second :332 // tables->base.lookupStructAtScope( id, scope );333 // }334 335 // EnumDecl *Indexer::lookupEnumAtScope( const std::string &id, unsigned long scope ) const {336 // if ( ! tables ) return ++*stats_indexers().lookup_calls, nullptr;337 // if ( tables->scope < scope ) return ++*stats_indexers().lookup_calls, nullptr;338 // if ( tables->scope > scope ) return tables->base.lookupEnumAtScope( id, scope );339 340 // ++*stats_indexers().map_lookups;341 // EnumTable::const_iterator ret = tables->enumTable.find( id );342 // return ret != tables->enumTable.end() ?343 // ++*stats_indexers().lookup_calls, ret->second :344 // tables->base.lookupEnumAtScope( id, scope );345 // }346 347 // UnionDecl *Indexer::lookupUnionAtScope( const std::string &id, unsigned long scope ) const {348 // if ( ! tables ) return ++*stats_indexers().lookup_calls, nullptr;349 // if ( tables->scope < scope ) return ++*stats_indexers().lookup_calls, nullptr;350 // if ( tables->scope > scope ) return tables->base.lookupUnionAtScope( id, scope );351 352 // ++*stats_indexers().map_lookups;353 // UnionTable::const_iterator ret = tables->unionTable.find( id );354 // return ret != tables->unionTable.end() ?355 // ++*stats_indexers().lookup_calls, ret->second :356 // tables->base.lookupUnionAtScope( id, scope );357 // }358 359 // TraitDecl *Indexer::lookupTraitAtScope( const std::string &id, unsigned long scope ) const {360 // if ( ! tables ) return ++*stats_indexers().lookup_calls, nullptr;361 // if ( tables->scope < scope ) return ++*stats_indexers().lookup_calls, nullptr;362 // if ( tables->scope > scope ) return tables->base.lookupTraitAtScope( id, scope );363 364 // ++*stats_indexers().map_lookups;365 // TraitTable::const_iterator ret = tables->traitTable.find( id );366 // return ret != tables->traitTable.end() ?367 // ++*stats_indexers().lookup_calls, ret->second :368 // tables->base.lookupTraitAtScope( id, scope );369 // }370 266 371 267 NamedTypeDecl *Indexer::globalLookupType( const std::string &id ) const { … … 408 304 const Indexer::IdData & existing, DeclarationWithType *added, 409 305 Indexer::OnConflict handleConflicts, BaseSyntaxNode * deleteStmt ) { 410 // if we're giving the same name mangling to things of different types then there is something wrong 306 // if we're giving the same name mangling to things of different types then there is 307 // something wrong 411 308 assert( (isObject( added ) && isObject( existing.id ) ) 412 309 || ( isFunction( added ) && isFunction( existing.id ) ) ); … … 454 351 if ( ! idTable ) return false; 455 352 353 ++*stats().map_lookups; 456 354 auto decls = idTable->find( id ); 457 355 if ( decls == idTable->end() ) return false; … … 473 371 if ( ! idTable ) return false; 474 372 373 ++*stats().map_lookups; 475 374 auto decls = idTable->find( id ); 476 375 if ( decls == idTable->end() ) return false; … … 491 390 DeclarationWithType *decl, OnConflict handleConflicts, Expression * baseExpr, 492 391 BaseSyntaxNode * deleteStmt ) { 392 ++*stats().add_calls; 493 393 if ( decl->name == "" ) return; 494 // debugPrint( "Adding Id " << decl->name << std::endl );495 394 496 395 const std::string &name = decl->name; … … 525 424 mangleTable = MangleTable::new_ptr(); 526 425 } else { 426 ++*stats().map_lookups; 527 427 auto decls = idTable->find( name ); 528 428 if ( decls == idTable->end() ) { … … 531 431 mangleTable = decls->second; 532 432 // skip in-scope repeat declarations of same identifier 433 ++*stats().map_lookups; 533 434 auto existing = mangleTable->find( mangleName ); 534 435 if ( existing != mangleTable->end() … … 538 439 if ( handleConflicts.mode == OnConflict::Delete ) { 539 440 // set delete expression for conflicting identifier 441 lazyInitScope(); 442 *stats().map_mutations += 2; 540 443 idTable = idTable->set( 541 444 name, … … 551 454 552 455 // add/overwrite with new identifier 456 lazyInitScope(); 457 *stats().map_mutations += 2; 553 458 idTable = idTable->set( 554 459 name, … … 578 483 } 579 484 } 580 // does not need to be added to the table if both existing and added have a base that are the same 485 // does not need to be added to the table if both existing and added have a base that are 486 // the same 581 487 return true; 582 488 } 583 489 584 490 void Indexer::addType( NamedTypeDecl *decl ) { 491 ++*stats().add_calls; 585 492 const std::string &id = decl->name; 586 493 … … 588 495 typeTable = TypeTable::new_ptr(); 589 496 } else { 497 ++*stats().map_lookups; 590 498 auto existing = typeTable->find( id ); 591 499 if ( existing != typeTable->end() … … 594 502 } 595 503 504 lazyInitScope(); 505 ++*stats().map_mutations; 596 506 typeTable = typeTable->set( id, Scoped<NamedTypeDecl>{ decl, scope } ); 597 507 } … … 611 521 612 522 void Indexer::addStruct( StructDecl *decl ) { 523 ++*stats().add_calls; 613 524 const std::string &id = decl->name; 614 525 … … 616 527 structTable = StructTable::new_ptr(); 617 528 } else { 529 ++*stats().map_lookups; 618 530 auto existing = structTable->find( id ); 619 531 if ( existing != structTable->end() … … 622 534 } 623 535 536 lazyInitScope(); 537 ++*stats().map_mutations; 624 538 structTable = structTable->set( id, Scoped<StructDecl>{ decl, scope } ); 625 539 } 626 540 627 541 void Indexer::addEnum( EnumDecl *decl ) { 542 ++*stats().add_calls; 628 543 const std::string &id = decl->name; 629 544 … … 631 546 enumTable = EnumTable::new_ptr(); 632 547 } else { 548 ++*stats().map_lookups; 633 549 auto existing = enumTable->find( id ); 634 550 if ( existing != enumTable->end() … … 637 553 } 638 554 555 lazyInitScope(); 556 ++*stats().map_mutations; 639 557 enumTable = enumTable->set( id, Scoped<EnumDecl>{ decl, scope } ); 640 558 } … … 645 563 646 564 void Indexer::addUnion( UnionDecl *decl ) { 565 ++*stats().add_calls; 647 566 const std::string &id = decl->name; 648 567 … … 650 569 unionTable = UnionTable::new_ptr(); 651 570 } else { 571 ++*stats().map_lookups; 652 572 auto existing = unionTable->find( id ); 653 573 if ( existing != unionTable->end() … … 656 576 } 657 577 578 lazyInitScope(); 579 ++*stats().map_mutations; 658 580 unionTable = unionTable->set( id, Scoped<UnionDecl>{ decl, scope } ); 659 581 } 660 582 661 583 void Indexer::addTrait( TraitDecl *decl ) { 584 ++*stats().add_calls; 662 585 const std::string &id = decl->name; 663 586 … … 665 588 traitTable = TraitTable::new_ptr(); 666 589 } else { 590 ++*stats().map_lookups; 667 591 auto existing = traitTable->find( id ); 668 592 if ( existing != traitTable->end() … … 671 595 } 672 596 597 lazyInitScope(); 598 ++*stats().map_mutations; 673 599 traitTable = traitTable->set( id, Scoped<TraitDecl>{ decl, scope } ); 674 600 } … … 722 648 } 723 649 724 // void Indexer::print( std::ostream &os, int indent ) const {725 // using std::cerr;726 727 // if ( tables ) {728 // os << "--- scope " << tables->scope << " ---" << std::endl;729 730 // os << "===idTable===" << std::endl;731 // dump( tables->idTable, os );732 // os << "===typeTable===" << std::endl;733 // dump( tables->typeTable, os );734 // os << "===structTable===" << std::endl;735 // dump( tables->structTable, os );736 // os << "===enumTable===" << std::endl;737 // dump( tables->enumTable, os );738 // os << "===unionTable===" << std::endl;739 // dump( tables->unionTable, os );740 // os << "===contextTable===" << std::endl;741 // dump( tables->traitTable, os );742 743 // tables->base.print( os, indent );744 // } else {745 // os << "--- end ---" << std::endl;746 // }747 // }748 749 650 Expression * Indexer::IdData::combine( ResolvExpr::Cost & cost ) const { 750 651 Expression * ret = nullptr; -
src/SymTab/Indexer.h
rb8665e3 rb419abb 17 17 18 18 #include <functional> // for function 19 #include <iosfwd> // for ostream20 19 #include <list> // for list 21 20 #include <memory> // for shared_ptr, enable_shared_from_this … … 35 34 virtual ~Indexer(); 36 35 37 // when using an indexer manually (e.g., within a mutator traversal), it is necessary to tell the indexer38 // explicitly when scopes begin and end36 // when using an indexer manually (e.g., within a mutator traversal), it is necessary to 37 // tell the indexer explicitly when scopes begin and end 39 38 void enterScope(); 40 39 void leaveScope(); … … 74 73 TraitDecl *lookupTrait( const std::string &id ) const; 75 74 76 // void print( std::ostream &os, int indent = 0 ) const;77 78 /// looks up a specific mangled ID in local scope only79 // IdData * lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope );80 // const IdData * localLookupId( const std::string &id, const std::string &mangleName ) const;81 // equivalents to lookup functions that only look at tables at scope `scope` (which should be >= tables->scope)82 // NamedTypeDecl *lookupTypeAtScope( const std::string &id, unsigned long scope ) const;83 // StructDecl *lookupStructAtScope( const std::string &id, unsigned long scope ) const;84 // EnumDecl *lookupEnumAtScope( const std::string &id, unsigned long scope ) const;85 // UnionDecl *lookupUnionAtScope( const std::string &id, unsigned long scope ) const;86 // TraitDecl *lookupTraitAtScope( const std::string &id, unsigned long scope ) const;87 88 75 /// Gets the type declaration with the given ID at global scope 89 76 NamedTypeDecl *globalLookupType( const std::string &id ) const; … … 118 105 void addFunctionType( FunctionType * ftype ); 119 106 120 // bool doDebug = false; ///< Display debugging trace?121 107 private: 122 108 /// Wraps a Decl* with a scope … … 148 134 Ptr prevScope; ///< reference to indexer for parent scope 149 135 unsigned long scope; ///< Scope index of this indexer 136 unsigned long repScope; ///< Scope index of currently represented scope 137 138 /// Ensures that a proper backtracking scope exists before a mutation 139 void lazyInitScope(); 150 140 151 141 /// Gets the indexer at the given scope
Note: See TracChangeset
for help on using the changeset viewer.