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