Changeset c4570af3
- Timestamp:
- Nov 30, 2023, 5:00:22 PM (13 months ago)
- Branches:
- master
- Children:
- 4dc3b8c, dd900b5
- Parents:
- 37b3151
- Location:
- src/AST
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Expr.cpp
r37b3151 rc4570af3 222 222 } 223 223 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 233 224 bool MemberExpr::get_lvalue() const { 234 225 // This is actually wrong by C, but it works with our current set-up. … … 388 379 stmts.emplace_back( new ExprStmt{ loc, tupleExpr } ); 389 380 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;396 381 } 397 382 -
src/AST/Expr.hpp
r37b3151 rc4570af3 35 35 template<typename node_t> friend node_t * shallowCopy(const node_t * node); 36 36 37 38 class ConverterOldToNew;39 class ConverterNewToOld;40 41 37 namespace ast { 42 38 … … 439 435 MemberExpr * clone() const override { return new MemberExpr{ *this }; } 440 436 MUTATE_FRIEND 441 442 // Custructor overload meant only for AST conversion443 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;448 437 }; 449 438 … … 458 447 ConstantExpr( 459 448 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 ) {} 462 451 463 452 /// Gets the integer value of this constant, if one is appropriate to its type. … … 483 472 484 473 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.type489 ptr<Type> underlyer;490 friend class ::ConverterOldToNew;491 friend class ::ConverterNewToOld;492 474 }; 493 475 … … 779 761 const Expr * accept( Visitor & v ) const override { return v.visit( this ); } 780 762 781 friend class ::ConverterOldToNew;782 783 763 private: 784 764 TupleAssignExpr * clone() const override { return new TupleAssignExpr{ *this }; } 785 TupleAssignExpr( const CodeLocation & loc, const Type * result, const StmtExpr * s );786 787 765 MUTATE_FRIEND 788 766 };
Note: See TracChangeset
for help on using the changeset viewer.