Changes in src/SymTab/Indexer.h [ef5b828:114bde6]
- File:
-
- 1 edited
-
src/SymTab/Indexer.h (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Indexer.h
ref5b828 r114bde6 34 34 virtual ~Indexer(); 35 35 36 // when using an indexer manually (e.g., within a mutator traversal), it is necessary to 36 // when using an indexer manually (e.g., within a mutator traversal), it is necessary to 37 37 // tell the indexer explicitly when scopes begin and end 38 38 void enterScope(); … … 50 50 // NOTE: shouldn't need either of these constructors, but gcc-4 does not properly support initializer lists with default members. 51 51 IdData() = default; 52 IdData( 52 IdData( 53 53 DeclarationWithType * id, Expression * baseExpr, BaseSyntaxNode * deleteStmt, 54 unsigned long scope ) 54 unsigned long scope ) 55 55 : id( id ), baseExpr( baseExpr ), deleteStmt( deleteStmt ), scope( scope ) {} 56 56 IdData( const IdData& o, BaseSyntaxNode * deleteStmt ) … … 61 61 62 62 /// Gets all declarations with the given ID 63 void lookupId( const std::string & id, std::list< IdData > &out ) const;63 void lookupId( const std::string &id, std::list< IdData > &out ) const; 64 64 /// Gets the top-most type declaration with the given ID 65 const NamedTypeDecl * lookupType( const std::string & id ) const; 66 NamedTypeDecl * lookupMutableType( const std::string & id ) const; 65 NamedTypeDecl *lookupType( const std::string &id ) const; 67 66 /// Gets the top-most struct declaration with the given ID 68 const StructDecl * lookupStruct( const std::string & id ) const; 69 StructDecl * lookupMutableStruct( const std::string & id ) const; 67 StructDecl *lookupStruct( const std::string &id ) const; 70 68 /// Gets the top-most enum declaration with the given ID 71 const EnumDecl * lookupEnum( const std::string & id ) const; 72 EnumDecl * lookupMutableEnum( const std::string & id ) const; 69 EnumDecl *lookupEnum( const std::string &id ) const; 73 70 /// Gets the top-most union declaration with the given ID 74 const UnionDecl * lookupUnion( const std::string & id ) const; 75 UnionDecl * lookupMutableUnion( const std::string & id ) const; 71 UnionDecl *lookupUnion( const std::string &id ) const; 76 72 /// Gets the top-most trait declaration with the given ID 77 const TraitDecl * lookupTrait( const std::string & id ) const; 78 TraitDecl * lookupMutableTrait( const std::string & id ) const; 73 TraitDecl *lookupTrait( const std::string &id ) const; 79 74 80 75 /// Gets the type declaration with the given ID at global scope 81 const NamedTypeDecl * globalLookupType( const std::string &id ) const;76 NamedTypeDecl *globalLookupType( const std::string &id ) const; 82 77 /// Gets the struct declaration with the given ID at global scope 83 const StructDecl * globalLookupStruct( const std::string &id ) const;78 StructDecl *globalLookupStruct( const std::string &id ) const; 84 79 /// Gets the union declaration with the given ID at global scope 85 const UnionDecl * globalLookupUnion( const std::string &id ) const;80 UnionDecl *globalLookupUnion( const std::string &id ) const; 86 81 /// Gets the enum declaration with the given ID at global scope 87 const EnumDecl * globalLookupEnum( const std::string &id ) const;82 EnumDecl *globalLookupEnum( const std::string &id ) const; 88 83 89 84 void addId( DeclarationWithType * decl, Expression * baseExpr = nullptr ); 90 85 void addDeletedId( DeclarationWithType * decl, BaseSyntaxNode * deleteStmt ); 91 86 92 void addType( NamedTypeDecl * decl );93 void addStruct( const std::string & id );94 void addStruct( StructDecl * decl );95 void addEnum( EnumDecl * decl );96 void addUnion( const std::string & id );97 void addUnion( UnionDecl * decl );98 void addTrait( TraitDecl * decl );87 void addType( NamedTypeDecl *decl ); 88 void addStruct( const std::string &id ); 89 void addStruct( StructDecl *decl ); 90 void addEnum( EnumDecl *decl ); 91 void addUnion( const std::string &id ); 92 void addUnion( UnionDecl *decl ); 93 void addTrait( TraitDecl *decl ); 99 94 100 95 /// adds all of the IDs from WithStmt exprs … … 111 106 112 107 private: 113 /// Wraps a Decl * with a scope108 /// Wraps a Decl* with a scope 114 109 template<typename Decl> 115 110 struct Scoped { 116 Decl * decl; ///< declaration111 Decl* decl; ///< declaration 117 112 unsigned long scope; ///< scope of this declaration 118 113 119 Scoped(Decl * d, unsigned long s) : decl(d), scope(s) {}114 Scoped(Decl* d, unsigned long s) : decl(d), scope(s) {} 120 115 }; 121 116 … … 145 140 146 141 /// Gets the indexer at the given scope 147 const Indexer * atScope( unsigned long scope ) const;142 const Indexer* atScope( unsigned long scope ) const; 148 143 149 /// Removes matching autogenerated constructors and destructors so that they will not be 144 /// Removes matching autogenerated constructors and destructors so that they will not be 150 145 /// selected. If returns false, passed decl should not be added. 151 146 bool removeSpecialOverrides( IdData& decl, MangleTable::Ptr& mangleTable ); … … 171 166 /// true if the existing identifier conflicts with the added identifier 172 167 bool addedIdConflicts( 173 const IdData& existing, DeclarationWithType * added, OnConflict handleConflicts, 168 const IdData& existing, DeclarationWithType * added, OnConflict handleConflicts, 174 169 BaseSyntaxNode * deleteStmt ); 175 170 176 171 /// common code for addId, addDeletedId, etc. 177 void addId( 178 DeclarationWithType * decl, OnConflict handleConflicts, 172 void addId( 173 DeclarationWithType * decl, OnConflict handleConflicts, 179 174 Expression * baseExpr = nullptr, BaseSyntaxNode * deleteStmt = nullptr ); 180 175 … … 183 178 184 179 /// returns true if there exists a declaration with C linkage and the given name with the same mangled name 185 bool hasCompatibleCDecl( const std::string & id, const std::string &mangleName ) const;180 bool hasCompatibleCDecl( const std::string &id, const std::string &mangleName ) const; 186 181 /// returns true if there exists a declaration with C linkage and the given name with a different mangled name 187 bool hasIncompatibleCDecl( const std::string & id, const std::string &mangleName ) const;182 bool hasIncompatibleCDecl( const std::string &id, const std::string &mangleName ) const; 188 183 }; 189 184 } // namespace SymTab
Note:
See TracChangeset
for help on using the changeset viewer.