Changes in src/AST/Expr.hpp [b8524ca:e67991f]
- File:
-
- 1 edited
-
src/AST/Expr.hpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Expr.hpp
rb8524ca re67991f 47 47 48 48 ParamEntry() : decl( 0 ), declptr( nullptr ), actualType( nullptr ), formalType( nullptr ), expr( nullptr ) {} 49 ParamEntry( 50 UniqueId id, const Decl * declptr, const Type * actual, const Type * formal, 49 ParamEntry( 50 UniqueId id, const Decl * declptr, const Type * actual, const Type * formal, 51 51 const Expr * e ) 52 52 : decl( id ), declptr( declptr ), actualType( actual ), formalType( formal ), expr( e ) {} … … 112 112 case Empty: new(&data.resnSlots) ResnSlots{}; mode = Slots; // fallthrough 113 113 case Slots: return data.resnSlots; 114 case Params: assert (!"Cannot return to resnSlots from Params");114 case Params: assertf(false, "Cannot return to resnSlots from Params"); abort(); 115 115 } 116 return *((ResnSlots*)nullptr);116 assertf(false, "unreachable"); 117 117 } 118 118 … … 121 121 return data.resnSlots; 122 122 } 123 assert (!"Mode was not already resnSlots");124 return *((ResnSlots*)nullptr);123 assertf(false, "Mode was not already resnSlots"); 124 abort(); 125 125 } 126 126 … … 131 131 case Params: return data.inferParams; 132 132 } 133 assert(!"unreachable"); 134 return *((InferredParams*)nullptr); 133 assertf(false, "unreachable"); 135 134 } 136 135 … … 139 138 return data.inferParams; 140 139 } 141 assert (!"Mode was not already Params");142 return *((InferredParams*)nullptr);140 assertf(false, "Mode was not already Params"); 141 abort(); 143 142 } 144 143 145 144 void set_inferParams( InferredParams && ps ) { 146 145 switch(mode) { 147 case Slots: 146 case Slots: 148 147 data.resnSlots.~ResnSlots(); 149 148 // fallthrough 150 case Empty: 149 case Empty: 151 150 new(&data.inferParams) InferredParams{ std::move( ps ) }; 152 151 mode = Params; … … 172 171 data.inferParams[p.first] = std::move(p.second); 173 172 } 174 } else assert (!"invalid mode");173 } else assertf(false, "invalid mode"); 175 174 } 176 175 }; … … 384 383 385 384 ConstantExpr( 386 const CodeLocation & loc, const Type * ty, const std::string & r, 385 const CodeLocation & loc, const Type * ty, const std::string & r, 387 386 std::optional<unsigned long long> i ) 388 387 : Expr( loc, ty ), rep( r ), ival( i ) {} … … 770 769 public: 771 770 ptr<Expr> expr; 772 readonly< Node> deleteStmt;773 774 DeletedExpr( const CodeLocation & loc, const Expr * e, const Node* del )771 readonly<Decl> deleteStmt; 772 773 DeletedExpr( const CodeLocation & loc, const Expr * e, const Decl * del ) 775 774 : Expr( loc, e->result ), expr( e ), deleteStmt( del ) { assert( expr->result ); } 776 775
Note:
See TracChangeset
for help on using the changeset viewer.