Changeset ed34540 for src/SymTab
- Timestamp:
 - Jun 26, 2018, 1:17:11 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, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
 - Children:
 - 88d955f
 - Parents:
 - 0b3b2ae
 - Location:
 - src/SymTab
 - Files:
 - 
      
- 2 edited
 
- 
          
  Indexer.cc (modified) (2 diffs)
 - 
          
  Indexer.h (modified) (1 diff)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
src/SymTab/Indexer.cc
r0b3b2ae red34540 272 272 } 273 273 274 NamedTypeDecl *Indexer::globalLookupType( const std::string &id ) const { 275 return lookupTypeAtScope( id, 0 ); 276 } 277 274 278 StructDecl *Indexer::globalLookupStruct( const std::string &id ) const { 275 279 return lookupStructAtScope( id, 0 ); … … 503 507 504 508 bool addedTypeConflicts( NamedTypeDecl *existing, NamedTypeDecl *added ) { 505 if ( existing-> get_base() == 0) {509 if ( existing->base == nullptr ) { 506 510 return false; 507 } else if ( added-> get_base() == 0) {511 } else if ( added->base == nullptr ) { 508 512 return true; 509 513 } else { 510 SemanticError( added, "redeclaration of " ); 511 } 514 assert( existing->base && added->base ); 515 // typedef redeclarations are errors only if types are different 516 if ( ! ResolvExpr::typesCompatible( existing->base, added->base, Indexer() ) ) { 517 SemanticError( added->location, "redeclaration of " + added->name ); 518 } 519 } 520 // does not need to be added to the table if both existing and added have a base that are the same 521 return true; 512 522 } 513 523  - 
      
src/SymTab/Indexer.h
r0b3b2ae red34540 71 71 TraitDecl *lookupTrait( const std::string &id ) const; 72 72 73 /// Gets the type declaration with the given ID at global scope 74 NamedTypeDecl *globalLookupType( const std::string &id ) const; 73 75 /// Gets the struct declaration with the given ID at global scope 74 76 StructDecl *globalLookupStruct( const std::string &id ) const;  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.