Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Indexer.h

    r0ac366b r4670c79  
    1919#include <list>               // for list
    2020#include <string>             // for string
    21 #include <functional>         // for function
    2221
    2322#include "SynTree/Visitor.h"  // for Visitor
     
    4140
    4241                struct IdData {
    43                         DeclarationWithType * id = nullptr;
    44                         Expression * baseExpr = nullptr; // WithExpr
    45 
    46                         /// non-null if this declaration is deleted
    47                         BaseSyntaxNode * deleteStmt = nullptr;
     42                        DeclarationWithType * id;
     43                        Expression * baseExpr; // WithExpr
    4844
    4945                        Expression * combine() const;
     
    6662
    6763                /// looks up a specific mangled ID at the given scope
    68                 IdData * lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope );
    69                 const IdData * lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope ) const;
     64                DeclarationWithType *lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope ) const;
    7065                /// returns true if there exists a declaration with C linkage and the given name with a different mangled name
    7166                bool hasIncompatibleCDecl( const std::string &id, const std::string &mangleName, unsigned long scope ) const;
     
    7974                TraitDecl *lookupTraitAtScope( const std::string &id, unsigned long scope ) const;
    8075
    81                 typedef std::function<bool(IdData &, const std::string &)> ConflictFunction;
    82 
    83                 void addId( DeclarationWithType * decl, Expression * baseExpr = nullptr );
    84                 void addDeletedId( DeclarationWithType * decl, BaseSyntaxNode * deleteStmt );
    85 
     76                void addId( DeclarationWithType *decl, Expression * baseExpr = nullptr );
    8677                void addType( NamedTypeDecl *decl );
    8778                void addStruct( const std::string &id );
     
    9384
    9485                /// adds all of the IDs from WithStmt exprs
    95                 void addWith( std::list< Expression * > & withExprs, BaseSyntaxNode * withStmt );
     86                void addWith( std::list< Expression * > & withExprs );
    9687
    9788                /// adds all of the members of the Aggregate (addWith helper)
    98                 void addMembers( AggregateDecl * aggr, Expression * expr, ConflictFunction );
     89                void addMembers( AggregateDecl * aggr, Expression * expr );
    9990
    10091                /// convenience function for adding a list of Ids to the indexer
     
    126117                /// Ensures that tables variable is writable (i.e. allocated, uniquely owned by this Indexer, and at the current scope)
    127118                void makeWritable();
    128 
    129                 /// common code for addId, addDeletedId, etc.
    130                 void addId( DeclarationWithType * decl, ConflictFunction, Expression * baseExpr = nullptr, BaseSyntaxNode * deleteStmt = nullptr );
    131119        };
    132120} // namespace SymTab
Note: See TracChangeset for help on using the changeset viewer.