Changes in src/AST/Expr.hpp [b8524ca:7870799]
- File:
-
- 1 edited
-
src/AST/Expr.hpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Expr.hpp
rb8524ca r7870799 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);117 116 } 118 117 … … 121 120 return data.resnSlots; 122 121 } 123 assert (!"Mode was not already resnSlots");124 return *((ResnSlots*)nullptr);122 assertf(false, "Mode was not already resnSlots"); 123 abort(); 125 124 } 126 125 … … 131 130 case Params: return data.inferParams; 132 131 } 133 assert(!"unreachable"); 134 return *((InferredParams*)nullptr); 132 assertf(false, "unreachable"); 135 133 } 136 134 … … 139 137 return data.inferParams; 140 138 } 141 assert (!"Mode was not already Params");142 return *((InferredParams*)nullptr);139 assertf(false, "Mode was not already Params"); 140 abort(); 143 141 } 144 142 145 143 void set_inferParams( InferredParams && ps ) { 146 144 switch(mode) { 147 case Slots: 145 case Slots: 148 146 data.resnSlots.~ResnSlots(); 149 147 // fallthrough 150 case Empty: 148 case Empty: 151 149 new(&data.inferParams) InferredParams{ std::move( ps ) }; 152 150 mode = Params; … … 172 170 data.inferParams[p.first] = std::move(p.second); 173 171 } 174 } else assert (!"invalid mode");172 } else assertf(false, "invalid mode"); 175 173 } 176 174 }; … … 384 382 385 383 ConstantExpr( 386 const CodeLocation & loc, const Type * ty, const std::string & r, 384 const CodeLocation & loc, const Type * ty, const std::string & r, 387 385 std::optional<unsigned long long> i ) 388 386 : Expr( loc, ty ), rep( r ), ival( i ) {}
Note:
See TracChangeset
for help on using the changeset viewer.