Changeset 71806e0 for src/AST


Ignore:
Timestamp:
Nov 10, 2022, 8:21:54 PM (19 months ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, ast-experimental, master
Children:
7491f97, e4d7c1c
Parents:
639e4fc
Message:

Rename InlineValueDecl? to InlineMemberDecl?

Location:
src/AST
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r639e4fc r71806e0  
    236236        }
    237237
    238         // InlineValueDecl vanish after EnumAndPointerDecay pass so no necessary to implement NewToOld
    239         const ast::DeclWithType * visit( const ast::InlineValueDecl * node ) override final {   
     238        // InlineMemberDecl vanish after EnumAndPointerDecay pass so no necessary to implement NewToOld
     239        const ast::DeclWithType * visit( const ast::InlineMemberDecl * node ) override final { 
    240240                assert( false );
    241241                (void) node;
     
    18691869        }
    18701870
    1871         virtual void visit( const InlineValueDecl * old ) override final {
     1871        virtual void visit( const InlineMemberDecl * old ) override final {
    18721872                if ( inCache( old ) ) {
    18731873                        return;
     
    18761876                auto&& attr = GET_ACCEPT_V(attributes, Attribute);
    18771877 
    1878                 auto decl = new ast::InlineValueDecl(
     1878                auto decl = new ast::InlineMemberDecl(
    18791879                        old->location,
    18801880                        old->name,
  • src/AST/Decl.hpp

    r639e4fc r71806e0  
    411411};
    412412
    413 class InlineValueDecl final : public DeclWithType {
     413class InlineMemberDecl final : public DeclWithType {
    414414public:
    415415        ptr<Type> type;
    416416
    417         InlineValueDecl( const CodeLocation & loc, const std::string & name, const Type * type,
     417        InlineMemberDecl( const CodeLocation & loc, const std::string & name, const Type * type,
    418418                Storage::Classes storage = {}, Linkage::Spec linkage = Linkage::Cforall,
    419419                std::vector< ptr<Attribute> > && attrs = {}, Function::Specs fs = {} )
     
    425425        const DeclWithType * accept( Visitor& v ) const override { return v.visit( this ); }
    426426private:
    427         InlineValueDecl * clone() const override { return new InlineValueDecl{ *this }; }
     427        InlineMemberDecl * clone() const override { return new InlineMemberDecl{ *this }; }
    428428        MUTATE_FRIEND
    429429};
  • src/AST/Fwd.hpp

    r639e4fc r71806e0  
    3737class DirectiveDecl;
    3838class StaticAssertDecl;
    39 class InlineValueDecl;
     39class InlineMemberDecl;
    4040
    4141class Stmt;
  • src/AST/Pass.hpp

    r639e4fc r71806e0  
    141141        const ast::DirectiveDecl *    visit( const ast::DirectiveDecl        * ) override final;
    142142        const ast::StaticAssertDecl * visit( const ast::StaticAssertDecl     * ) override final;
    143         const ast::DeclWithType *     visit( const ast::InlineValueDecl      * ) override final;
     143        const ast::DeclWithType *     visit( const ast::InlineMemberDecl      * ) override final;
    144144        const ast::CompoundStmt *     visit( const ast::CompoundStmt         * ) override final;
    145145        const ast::Stmt *             visit( const ast::ExprStmt             * ) override final;
  • src/AST/Pass.impl.hpp

    r639e4fc r71806e0  
    805805// DeclWithType
    806806template< typename core_t >
    807 const ast::DeclWithType * ast::Pass< core_t >::visit( const ast::InlineValueDecl * node ) {
    808         VISIT_START( node );
    809 
    810         if ( __visit_children() ) {
    811                 {
    812                         guard_symtab guard { *this };
    813                         maybe_accept( node, &InlineValueDecl::type );
     807const ast::DeclWithType * ast::Pass< core_t >::visit( const ast::InlineMemberDecl * node ) {
     808        VISIT_START( node );
     809
     810        if ( __visit_children() ) {
     811                {
     812                        guard_symtab guard { *this };
     813                        maybe_accept( node, &InlineMemberDecl::type );
    814814                }
    815815        }
  • src/AST/Print.cpp

    r639e4fc r71806e0  
    401401        }
    402402
    403         virtual const ast::DeclWithType * visit( const ast::InlineValueDecl * node ) override final {
     403        virtual const ast::DeclWithType * visit( const ast::InlineMemberDecl * node ) override final {
    404404                os << "inline ";
    405405                if ( ! node->name.empty() ) os << node->name;
  • src/AST/Visitor.hpp

    r639e4fc r71806e0  
    3333    virtual const ast::DirectiveDecl *    visit( const ast::DirectiveDecl        * ) = 0;
    3434    virtual const ast::StaticAssertDecl * visit( const ast::StaticAssertDecl     * ) = 0;
    35     virtual const ast::DeclWithType *     visit( const ast::InlineValueDecl      * ) = 0;
     35    virtual const ast::DeclWithType *     visit( const ast::InlineMemberDecl      * ) = 0;
    3636    virtual const ast::CompoundStmt *     visit( const ast::CompoundStmt         * ) = 0;
    3737    virtual const ast::Stmt *             visit( const ast::ExprStmt             * ) = 0;
Note: See TracChangeset for help on using the changeset viewer.