Changeset c4570af3


Ignore:
Timestamp:
Nov 30, 2023, 5:00:22 PM (3 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
4dc3b8c, dd900b5
Parents:
37b3151
Message:

Removed some code that supported ast conversion, it supported ast translation, and that is done.

Location:
src/AST
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.cpp

    r37b3151 rc4570af3  
    222222}
    223223
    224 MemberExpr::MemberExpr( const CodeLocation & loc, const DeclWithType * mem, const Expr * agg,
    225     MemberExpr::NoOpConstruction overloadSelector )
    226 : Expr( loc ), member( mem ), aggregate( agg ) {
    227         assert( member );
    228         assert( aggregate );
    229         assert( aggregate->result );
    230         (void) overloadSelector;
    231 }
    232 
    233224bool MemberExpr::get_lvalue() const {
    234225        // This is actually wrong by C, but it works with our current set-up.
     
    388379        stmts.emplace_back( new ExprStmt{ loc, tupleExpr } );
    389380        stmtExpr = new StmtExpr{ loc, new CompoundStmt{ loc, std::move(stmts) } };
    390 }
    391 
    392 TupleAssignExpr::TupleAssignExpr(
    393         const CodeLocation & loc, const Type * result, const StmtExpr * s )
    394 : Expr( loc, result ), stmtExpr() {
    395         stmtExpr = s;
    396381}
    397382
  • src/AST/Expr.hpp

    r37b3151 rc4570af3  
    3535        template<typename node_t> friend node_t * shallowCopy(const node_t * node);
    3636
    37 
    38 class ConverterOldToNew;
    39 class ConverterNewToOld;
    40 
    4137namespace ast {
    4238
     
    439435        MemberExpr * clone() const override { return new MemberExpr{ *this }; }
    440436        MUTATE_FRIEND
    441 
    442         // Custructor overload meant only for AST conversion
    443         enum NoOpConstruction { NoOpConstructionChosen };
    444         MemberExpr( const CodeLocation & loc, const DeclWithType * mem, const Expr * agg,
    445             NoOpConstruction overloadSelector );
    446         friend class ::ConverterOldToNew;
    447         friend class ::ConverterNewToOld;
    448437};
    449438
     
    458447        ConstantExpr(
    459448                const CodeLocation & loc, const Type * ty, const std::string & r,
    460                         std::optional<unsigned long long> i )
    461         : Expr( loc, ty ), rep( r ), ival( i ), underlyer(ty) {}
     449                        const std::optional<unsigned long long> & i )
     450        : Expr( loc, ty ), rep( r ), ival( i ) {}
    462451
    463452        /// Gets the integer value of this constant, if one is appropriate to its type.
     
    483472
    484473        std::optional<unsigned long long> ival;
    485 
    486         // Intended only for legacy support of roundtripping the old AST.
    487         // Captures the very-locally inferred type, before the resolver modifies the type of this ConstantExpression.
    488         // In the old AST it's constExpr->constant.type
    489         ptr<Type> underlyer;
    490         friend class ::ConverterOldToNew;
    491         friend class ::ConverterNewToOld;
    492474};
    493475
     
    779761        const Expr * accept( Visitor & v ) const override { return v.visit( this ); }
    780762
    781         friend class ::ConverterOldToNew;
    782 
    783763private:
    784764        TupleAssignExpr * clone() const override { return new TupleAssignExpr{ *this }; }
    785     TupleAssignExpr( const CodeLocation & loc, const Type * result, const StmtExpr * s );
    786 
    787765        MUTATE_FRIEND
    788766};
Note: See TracChangeset for help on using the changeset viewer.