Changeset 9ddcee1 for src/AST


Ignore:
Timestamp:
Feb 1, 2024, 5:13:04 PM (21 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
020fa10
Parents:
496ffc17
Message:

Remove EnumPosExpr, an early design that no longer used. The implementation of the feature has been replaced by ReplacePseudoFunc

Location:
src/AST
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.cpp

    r496ffc17 r9ddcee1  
    307307}
    308308
    309 //
    310 
    311 // --- EnumPosExpr
    312 EnumPosExpr::EnumPosExpr( const CodeLocation & loc, const EnumInstType * ty)
    313 : Expr( loc, new BasicType{ BasicType::UnsignedInt }), type( ty ) {
    314         assert( ty );
    315 }
    316 
    317 EnumPosExpr::EnumPosExpr( const CodeLocation & loc, const Expr * expr )
    318 : Expr( loc, new BasicType{ BasicType::UnsignedInt }), expr(expr) {
    319         assert( expr );
    320 }
    321 
    322 
    323309// --- LogicalExpr
    324310
  • src/AST/Expr.hpp

    r496ffc17 r9ddcee1  
    548548};
    549549
    550 class EnumPosExpr final : public Expr {
    551 public:
    552         ptr<EnumInstType> type;
    553         ptr<Expr> expr;
    554        
    555         EnumPosExpr( const CodeLocation & loc, const EnumInstType * ty );
    556         EnumPosExpr( const CodeLocation & loc, const Expr * expr );
    557         const Expr * accept( Visitor & v ) const override { return v.visit( this ); }
    558 private:
    559         EnumPosExpr * clone() const override { return new EnumPosExpr{ *this }; }
    560         MUTATE_FRIEND
    561 };
    562 
    563550/// Variants of short-circuiting logical expression
    564551enum LogicalFlag { OrExpr, AndExpr };
  • src/AST/Fwd.hpp

    r496ffc17 r9ddcee1  
    8989class OffsetofExpr;
    9090class OffsetPackExpr;
    91 class EnumPosExpr;
    9291class LogicalExpr;
    9392class ConditionalExpr;
  • src/AST/Node.cpp

    r496ffc17 r9ddcee1  
    232232template class ast::ptr_base< ast::OffsetPackExpr, ast::Node::ref_type::weak >;
    233233template class ast::ptr_base< ast::OffsetPackExpr, ast::Node::ref_type::strong >;
    234 template class ast::ptr_base< ast::EnumPosExpr, ast::Node::ref_type::weak >;
    235 template class ast::ptr_base< ast::EnumPosExpr, ast::Node::ref_type::strong >;
    236234template class ast::ptr_base< ast::LogicalExpr, ast::Node::ref_type::weak >;
    237235template class ast::ptr_base< ast::LogicalExpr, ast::Node::ref_type::strong >;
  • src/AST/Pass.hpp

    r496ffc17 r9ddcee1  
    191191        const ast::Expr *             visit( const ast::OffsetofExpr         * ) override final;
    192192        const ast::Expr *             visit( const ast::OffsetPackExpr       * ) override final;
    193         const ast::Expr *             visit( const ast::EnumPosExpr          * ) override final;
    194193        const ast::Expr *             visit( const ast::LogicalExpr          * ) override final;
    195194        const ast::Expr *             visit( const ast::ConditionalExpr      * ) override final;
  • src/AST/Pass.impl.hpp

    r496ffc17 r9ddcee1  
    14521452
    14531453//--------------------------------------------------------------------------
    1454 // EnumPosExpr
    1455 template< typename core_t>
    1456 const ast::Expr * ast::Pass< core_t >::visit( const ast::EnumPosExpr * node ) {
    1457         VISIT_START( node );
    1458 
    1459         if ( __visit_children() ) {
    1460                 guard_symtab guard { *this };
    1461                 maybe_accept( node, &EnumPosExpr::type );
    1462                 maybe_accept( node, &EnumPosExpr::expr );
    1463         }
    1464 
    1465         VISIT_END( Expr, node );
    1466 }
    1467 
    1468 //--------------------------------------------------------------------------
    14691454// LogicalExpr
    14701455template< typename core_t >
  • src/AST/Print.cpp

    r496ffc17 r9ddcee1  
    11861186        }
    11871187
    1188         virtual const ast::Expr * visit( const ast::EnumPosExpr * node ) override final {
    1189                 os << "Enum Position Expression on: ";
    1190                 ++indent;
    1191                 safe_print( node->type );
    1192                 --indent;
    1193                 postprint( node );
    1194                 return node;
    1195         }
    1196 
    11971188        virtual const ast::Expr * visit( const ast::LogicalExpr * node ) override final {
    11981189                os << "Short-circuited operation (" << (node->isAnd ? "and" : "or") << ") on: ";
  • src/AST/Visitor.hpp

    r496ffc17 r9ddcee1  
    7979    virtual const ast::Expr *             visit( const ast::OffsetofExpr         * ) = 0;
    8080    virtual const ast::Expr *             visit( const ast::OffsetPackExpr       * ) = 0;
    81     virtual const ast::Expr *             visit( const ast::EnumPosExpr          * ) = 0;
    8281    virtual const ast::Expr *             visit( const ast::LogicalExpr          * ) = 0;
    8382    virtual const ast::Expr *             visit( const ast::ConditionalExpr      * ) = 0;
Note: See TracChangeset for help on using the changeset viewer.