Changeset e67991f for src/SymTab
- Timestamp:
- Jul 16, 2019, 10:38:32 AM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 6f15121
- Parents:
- 7dc2e57b
- Location:
- src/SymTab
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Indexer.cc
r7dc2e57b re67991f 210 210 bool Indexer::addedIdConflicts( 211 211 const Indexer::IdData & existing, const DeclarationWithType * added, 212 Indexer::OnConflict handleConflicts, const BaseSyntaxNode* deleteStmt ) {212 Indexer::OnConflict handleConflicts, const Declaration * deleteStmt ) { 213 213 // if we're giving the same name mangling to things of different types then there is 214 214 // something wrong … … 432 432 433 433 void Indexer::addId(const DeclarationWithType * decl, OnConflict handleConflicts, const Expression * baseExpr, 434 const BaseSyntaxNode* deleteStmt ) {434 const Declaration * deleteStmt ) { 435 435 ++* stats().add_calls; 436 436 const std::string &name = decl->name; … … 510 510 } 511 511 512 void Indexer::addDeletedId( const DeclarationWithType * decl, const BaseSyntaxNode* deleteStmt ) {512 void Indexer::addDeletedId( const DeclarationWithType * decl, const Declaration * deleteStmt ) { 513 513 // default handling of conflicts is to raise an error 514 514 addId( decl, OnConflict::error(), nullptr, deleteStmt ); … … 661 661 } 662 662 663 void Indexer::addWith( const std::list< Expression * > & withExprs, const BaseSyntaxNode* withStmt ) {663 void Indexer::addWith( const std::list< Expression * > & withExprs, const Declaration * withStmt ) { 664 664 for ( const Expression * expr : withExprs ) { 665 665 if ( expr->result ) { … … 704 704 ret = new VariableExpr( const_cast<DeclarationWithType *>(id) ); 705 705 } 706 if ( deleteStmt ) ret = new DeletedExpr( ret, const_cast< BaseSyntaxNode*>(deleteStmt) );706 if ( deleteStmt ) ret = new DeletedExpr( ret, const_cast<Declaration *>(deleteStmt) ); 707 707 return ret; 708 708 } -
src/SymTab/Indexer.h
r7dc2e57b re67991f 44 44 45 45 /// non-null if this declaration is deleted 46 const BaseSyntaxNode* deleteStmt = nullptr;46 const Declaration * deleteStmt = nullptr; 47 47 /// scope of identifier 48 48 unsigned long scope = 0; … … 51 51 IdData() = default; 52 52 IdData( 53 const DeclarationWithType * id, const Expression * baseExpr, const BaseSyntaxNode* deleteStmt,53 const DeclarationWithType * id, const Expression * baseExpr, const Declaration * deleteStmt, 54 54 unsigned long scope ) 55 55 : id( id ), baseExpr( baseExpr ), deleteStmt( deleteStmt ), scope( scope ) {} 56 IdData( const IdData& o, const BaseSyntaxNode* deleteStmt )56 IdData( const IdData& o, const Declaration * deleteStmt ) 57 57 : id( o.id ), baseExpr( o.baseExpr ), deleteStmt( deleteStmt ), scope( o.scope ) {} 58 58 … … 83 83 84 84 void addId( const DeclarationWithType * decl, const Expression * baseExpr = nullptr ); 85 void addDeletedId( const DeclarationWithType * decl, const BaseSyntaxNode* deleteStmt );85 void addDeletedId( const DeclarationWithType * decl, const Declaration * deleteStmt ); 86 86 87 87 void addType( const NamedTypeDecl * decl ); … … 94 94 95 95 /// adds all of the IDs from WithStmt exprs 96 void addWith( const std::list< Expression * > & withExprs, const BaseSyntaxNode* withStmt );96 void addWith( const std::list< Expression * > & withExprs, const Declaration * withStmt ); 97 97 98 98 /// convenience function for adding a list of Ids to the indexer … … 152 152 Delete ///< Delete the earlier version with the delete statement 153 153 } mode; 154 const BaseSyntaxNode* deleteStmt; ///< Statement that deletes this expression154 const Declaration * deleteStmt; ///< Statement that deletes this expression 155 155 156 156 private: 157 157 OnConflict() : mode(Error), deleteStmt(nullptr) {} 158 OnConflict( const BaseSyntaxNode* d ) : mode(Delete), deleteStmt(d) {}158 OnConflict( const Declaration * d ) : mode(Delete), deleteStmt(d) {} 159 159 public: 160 160 OnConflict( const OnConflict& ) = default; 161 161 162 162 static OnConflict error() { return {}; } 163 static OnConflict deleteWith( const BaseSyntaxNode* d ) { return { d }; }163 static OnConflict deleteWith( const Declaration * d ) { return { d }; } 164 164 }; 165 165 … … 167 167 bool addedIdConflicts( 168 168 const IdData & existing, const DeclarationWithType * added, OnConflict handleConflicts, 169 const BaseSyntaxNode* deleteStmt );169 const Declaration * deleteStmt ); 170 170 171 171 /// common code for addId, addDeletedId, etc. 172 172 void addId(const DeclarationWithType * decl, OnConflict handleConflicts, 173 const Expression * baseExpr = nullptr, const BaseSyntaxNode* deleteStmt = nullptr );173 const Expression * baseExpr = nullptr, const Declaration * deleteStmt = nullptr ); 174 174 175 175 /// adds all of the members of the Aggregate (addWith helper)
Note: See TracChangeset
for help on using the changeset viewer.