Changes in src/AST/Expr.hpp [ae265b55:99da267]
- File:
-
- 1 edited
-
src/AST/Expr.hpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Expr.hpp
rae265b55 r99da267 50 50 51 51 ParamEntry() : decl( 0 ), declptr( nullptr ), actualType( nullptr ), formalType( nullptr ), expr( nullptr ) {} 52 ParamEntry( 53 UniqueId id, const Decl * declptr, const Type * actual, const Type * formal, 52 ParamEntry( 53 UniqueId id, const Decl * declptr, const Type * actual, const Type * formal, 54 54 const Expr * e ) 55 55 : decl( id ), declptr( declptr ), actualType( actual ), formalType( formal ), expr( e ) {} … … 115 115 case Empty: new(&data.resnSlots) ResnSlots{}; mode = Slots; // fallthrough 116 116 case Slots: return data.resnSlots; 117 case Params: assert f(false, "Cannot return to resnSlots from Params"); abort();117 case Params: assert(!"Cannot return to resnSlots from Params"); 118 118 } 119 assertf(false, "unreachable");119 return *((ResnSlots*)nullptr); 120 120 } 121 121 … … 124 124 return data.resnSlots; 125 125 } 126 assert f(false,"Mode was not already resnSlots");127 abort();126 assert(!"Mode was not already resnSlots"); 127 return *((ResnSlots*)nullptr); 128 128 } 129 129 … … 134 134 case Params: return data.inferParams; 135 135 } 136 assertf(false, "unreachable"); 136 assert(!"unreachable"); 137 return *((InferredParams*)nullptr); 137 138 } 138 139 … … 141 142 return data.inferParams; 142 143 } 143 assert f(false,"Mode was not already Params");144 abort();144 assert(!"Mode was not already Params"); 145 return *((InferredParams*)nullptr); 145 146 } 146 147 147 148 void set_inferParams( InferredParams && ps ) { 148 149 switch(mode) { 149 case Slots: 150 case Slots: 150 151 data.resnSlots.~ResnSlots(); 151 152 // fallthrough 152 case Empty: 153 case Empty: 153 154 new(&data.inferParams) InferredParams{ std::move( ps ) }; 154 155 mode = Params; … … 174 175 data.inferParams[p.first] = std::move(p.second); 175 176 } 176 } else assert f(false,"invalid mode");177 } else assert(!"invalid mode"); 177 178 } 178 179 }; … … 358 359 MemberExpr * clone() const override { return new MemberExpr{ *this }; } 359 360 MUTATE_FRIEND 360 361 // Custructor overload meant only for AST conversion362 enum NoOpConstruction { NoOpConstructionChosen };363 MemberExpr( const CodeLocation & loc, const DeclWithType * mem, const Expr * agg,364 NoOpConstruction overloadSelector );365 friend class ::ConverterOldToNew;366 friend class ::ConverterNewToOld;367 361 }; 368 362 … … 393 387 394 388 ConstantExpr( 395 const CodeLocation & loc, const Type * ty, const std::string & r, 389 const CodeLocation & loc, const Type * ty, const std::string & r, 396 390 std::optional<unsigned long long> i ) 397 391 : Expr( loc, ty ), rep( r ), ival( i ) {} … … 779 773 public: 780 774 ptr<Expr> expr; 781 readonly< Decl> deleteStmt;782 783 DeletedExpr( const CodeLocation & loc, const Expr * e, const Decl* del )775 readonly<Node> deleteStmt; 776 777 DeletedExpr( const CodeLocation & loc, const Expr * e, const Node * del ) 784 778 : Expr( loc, e->result ), expr( e ), deleteStmt( del ) { assert( expr->result ); } 785 779
Note:
See TracChangeset
for help on using the changeset viewer.