Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Indexer.h

    ref5b828 r114bde6  
    3434                virtual ~Indexer();
    3535
    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 
    3737                // tell the indexer explicitly when scopes begin and end
    3838                void enterScope();
     
    5050                        // NOTE: shouldn't need either of these constructors, but gcc-4 does not properly support initializer lists with default members.
    5151                        IdData() = default;
    52                         IdData(
     52                        IdData( 
    5353                                DeclarationWithType * id, Expression * baseExpr, BaseSyntaxNode * deleteStmt,
    54                                 unsigned long scope )
     54                                unsigned long scope ) 
    5555                                : id( id ), baseExpr( baseExpr ), deleteStmt( deleteStmt ), scope( scope ) {}
    5656                        IdData( const IdData& o, BaseSyntaxNode * deleteStmt )
     
    6161
    6262                /// 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;
    6464                /// 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;
    6766                /// 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;
    7068                /// 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;
    7370                /// 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;
    7672                /// 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;
    7974
    8075                /// 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;
    8277                /// 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;
    8479                /// 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;
    8681                /// 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;
    8883
    8984                void addId( DeclarationWithType * decl, Expression * baseExpr = nullptr );
    9085                void addDeletedId( DeclarationWithType * decl, BaseSyntaxNode * deleteStmt );
    9186
    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 );
    9994
    10095                /// adds all of the IDs from WithStmt exprs
     
    111106
    112107          private:
    113                 /// Wraps a Decl * with a scope
     108                /// Wraps a Decl* with a scope
    114109                template<typename Decl>
    115110                struct Scoped {
    116                         Decl * decl;           ///< declaration
     111                        Decl* decl;           ///< declaration
    117112                        unsigned long scope;  ///< scope of this declaration
    118113
    119                         Scoped(Decl * d, unsigned long s) : decl(d), scope(s) {}
     114                        Scoped(Decl* d, unsigned long s) : decl(d), scope(s) {}
    120115                };
    121116
     
    145140
    146141                /// Gets the indexer at the given scope
    147                 const Indexer * atScope( unsigned long scope ) const;
     142                const Indexer* atScope( unsigned long scope ) const;
    148143
    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 
    150145                /// selected. If returns false, passed decl should not be added.
    151146                bool removeSpecialOverrides( IdData& decl, MangleTable::Ptr& mangleTable );
     
    171166                /// true if the existing identifier conflicts with the added identifier
    172167                bool addedIdConflicts(
    173                         const IdData& existing, DeclarationWithType * added, OnConflict handleConflicts,
     168                        const IdData& existing, DeclarationWithType * added, OnConflict handleConflicts, 
    174169                        BaseSyntaxNode * deleteStmt );
    175170
    176171                /// common code for addId, addDeletedId, etc.
    177                 void addId(
    178                         DeclarationWithType * decl, OnConflict handleConflicts,
     172                void addId( 
     173                        DeclarationWithType * decl, OnConflict handleConflicts, 
    179174                        Expression * baseExpr = nullptr, BaseSyntaxNode * deleteStmt = nullptr );
    180175
     
    183178
    184179                /// 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;
    186181                /// 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;
    188183        };
    189184} // namespace SymTab
Note: See TracChangeset for help on using the changeset viewer.