Changes in src/AST/Expr.hpp [e67991f:99da267]
- File:
-
- 1 edited
-
src/AST/Expr.hpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Expr.hpp
re67991f r99da267 30 30 31 31 // Must be included in *all* AST classes; should be #undef'd at the end of the file 32 #define MUTATE_FRIEND template<typename node_t> friend node_t * mutate(const node_t * node); 32 #define MUTATE_FRIEND \ 33 template<typename node_t> friend node_t * mutate(const node_t * node); \ 34 template<typename node_t> friend node_t * shallowCopy(const node_t * node); 35 33 36 34 37 class ConverterOldToNew; … … 47 50 48 51 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, 52 ParamEntry( 53 UniqueId id, const Decl * declptr, const Type * actual, const Type * formal, 51 54 const Expr * e ) 52 55 : decl( id ), declptr( declptr ), actualType( actual ), formalType( formal ), expr( e ) {} … … 112 115 case Empty: new(&data.resnSlots) ResnSlots{}; mode = Slots; // fallthrough 113 116 case Slots: return data.resnSlots; 114 case Params: assert f(false, "Cannot return to resnSlots from Params"); abort();117 case Params: assert(!"Cannot return to resnSlots from Params"); 115 118 } 116 assertf(false, "unreachable");119 return *((ResnSlots*)nullptr); 117 120 } 118 121 … … 121 124 return data.resnSlots; 122 125 } 123 assert f(false,"Mode was not already resnSlots");124 abort();126 assert(!"Mode was not already resnSlots"); 127 return *((ResnSlots*)nullptr); 125 128 } 126 129 … … 131 134 case Params: return data.inferParams; 132 135 } 133 assertf(false, "unreachable"); 136 assert(!"unreachable"); 137 return *((InferredParams*)nullptr); 134 138 } 135 139 … … 138 142 return data.inferParams; 139 143 } 140 assert f(false,"Mode was not already Params");141 abort();144 assert(!"Mode was not already Params"); 145 return *((InferredParams*)nullptr); 142 146 } 143 147 144 148 void set_inferParams( InferredParams && ps ) { 145 149 switch(mode) { 146 case Slots: 150 case Slots: 147 151 data.resnSlots.~ResnSlots(); 148 152 // fallthrough 149 case Empty: 153 case Empty: 150 154 new(&data.inferParams) InferredParams{ std::move( ps ) }; 151 155 mode = Params; … … 171 175 data.inferParams[p.first] = std::move(p.second); 172 176 } 173 } else assert f(false,"invalid mode");177 } else assert(!"invalid mode"); 174 178 } 175 179 }; … … 383 387 384 388 ConstantExpr( 385 const CodeLocation & loc, const Type * ty, const std::string & r, 389 const CodeLocation & loc, const Type * ty, const std::string & r, 386 390 std::optional<unsigned long long> i ) 387 391 : Expr( loc, ty ), rep( r ), ival( i ) {} … … 769 773 public: 770 774 ptr<Expr> expr; 771 readonly< Decl> deleteStmt;772 773 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 ) 774 778 : Expr( loc, e->result ), expr( e ), deleteStmt( del ) { assert( expr->result ); } 775 779
Note:
See TracChangeset
for help on using the changeset viewer.