Ignore:
Timestamp:
Jul 16, 2019, 10:38:32 AM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
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
Message:

WithStmt? is now a Declaration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/SymbolTable.hpp

    r7dc2e57b re67991f  
    3737                readonly<DeclWithType> id = nullptr;  ///< Identifier of declaration
    3838                readonly<Expr> baseExpr = nullptr;    ///< Implied containing aggregate (from WithExpr)
    39                 readonly<Node> deleter = nullptr;     ///< Node deleting this declaration (if non-null)
     39                readonly<Decl> deleter = nullptr;     ///< Node deleting this declaration (if non-null)
    4040                unsigned long scope = 0;              ///< Scope of identifier
    4141
    4242                IdData() = default;
    43                 IdData( const DeclWithType * i, const Expr * base, const Node * del, unsigned long s )
     43                IdData( const DeclWithType * i, const Expr * base, const Decl * del, unsigned long s )
    4444                : id( i ), baseExpr( base ), deleter( del ), scope( s ) {}
    45                
     45
    4646                /// Modify an existing node with a new deleter
    47                 IdData( const IdData & o, const Node * del )
     47                IdData( const IdData & o, const Decl * del )
    4848                : id( o.id ), baseExpr( o.baseExpr ), deleter( del ), scope( o.scope ) {}
    4949
     
    5858        struct scoped {
    5959                readonly<D> decl;     ///< wrapped declaration
    60                 unsigned long scope;  ///< scope of this declaration 
     60                unsigned long scope;  ///< scope of this declaration
    6161
    6262                scoped(const D * d, unsigned long s) : decl(d), scope(s) {}
     
    8888        ~SymbolTable();
    8989
    90         // when using an indexer manually (e.g., within a mutator traversal), it is necessary to 
     90        // when using an indexer manually (e.g., within a mutator traversal), it is necessary to
    9191        // tell the indexer explicitly when scopes begin and end
    9292        void enterScope();
     
    118118        void addId( const DeclWithType * decl, const Expr * baseExpr = nullptr );
    119119        /// Adds a deleted identifier declaration to the symbol table
    120         void addDeletedId( const DeclWithType * decl, const Node * deleter );
     120        void addDeletedId( const DeclWithType * decl, const Decl * deleter );
    121121
    122122        /// Adds a type to the symbol table
     
    136136
    137137        /// adds all of the IDs from WithStmt exprs
    138         void addWith( const std::vector< ptr<Expr> > & withExprs, const Node * withStmt );
     138        void addWith( const std::vector< ptr<Expr> > & withExprs, const Decl * withStmt );
    139139
    140140        /// convenience function for adding a list of Ids to the indexer
     
    154154        const SymbolTable * atScope( unsigned long i ) const;
    155155
    156         /// Removes matching autogenerated constructors and destructors so that they will not be 
     156        /// Removes matching autogenerated constructors and destructors so that they will not be
    157157        /// selected. If returns false, passed decl should not be added.
    158158        bool removeSpecialOverrides( IdData & decl, MangleTable::Ptr & mangleTable );
     
    164164                        Delete  ///< Delete the earlier version with the delete statement
    165165                } mode;
    166                 const Node * deleter;  ///< Statement that deletes this expression
     166                const Decl * deleter;  ///< Statement that deletes this expression
    167167
    168168        private:
    169169                OnConflict() : mode(Error), deleter(nullptr) {}
    170                 OnConflict( const Node * d ) : mode(Delete), deleter(d) {}
     170                OnConflict( const Decl * d ) : mode(Delete), deleter(d) {}
    171171        public:
    172172                OnConflict( const OnConflict& ) = default;
    173173
    174174                static OnConflict error() { return {}; }
    175                 static OnConflict deleteWith( const Node * d ) { return { d }; }
     175                static OnConflict deleteWith( const Decl * d ) { return { d }; }
    176176        };
    177177
    178178        /// true if the existing identifier conflicts with the added identifier
    179179        bool addedIdConflicts(
    180                 const IdData & existing, const DeclWithType * added, OnConflict handleConflicts, 
    181                 const Node * deleter );
     180                const IdData & existing, const DeclWithType * added, OnConflict handleConflicts,
     181                const Decl * deleter );
    182182
    183183        /// common code for addId, addDeletedId, etc.
    184         void addId( 
    185                 const DeclWithType * decl, OnConflict handleConflicts, const Expr * baseExpr = nullptr, 
    186                 const Node * deleter = nullptr );
     184        void addId(
     185                const DeclWithType * decl, OnConflict handleConflicts, const Expr * baseExpr = nullptr,
     186                const Decl * deleter = nullptr );
    187187
    188188        /// adds all of the members of the Aggregate (addWith helper)
Note: See TracChangeset for help on using the changeset viewer.