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