Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.hpp

    rb8524ca re67991f  
    4747
    4848        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,
    5151                const Expr * e )
    5252        : decl( id ), declptr( declptr ), actualType( actual ), formalType( formal ), expr( e ) {}
     
    112112                        case Empty: new(&data.resnSlots) ResnSlots{}; mode = Slots; // fallthrough
    113113                        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();
    115115                        }
    116                         return *((ResnSlots*)nullptr);
     116                        assertf(false, "unreachable");
    117117                }
    118118
     
    121121                                return data.resnSlots;
    122122                        }
    123                         assert(!"Mode was not already resnSlots");
    124                         return *((ResnSlots*)nullptr);
     123                        assertf(false, "Mode was not already resnSlots");
     124                        abort();
    125125                }
    126126
     
    131131                        case Params: return data.inferParams;
    132132                        }
    133                         assert(!"unreachable");
    134                         return *((InferredParams*)nullptr);
     133                        assertf(false, "unreachable");
    135134                }
    136135
     
    139138                                return data.inferParams;
    140139                        }
    141                         assert(!"Mode was not already Params");
    142                         return *((InferredParams*)nullptr);
     140                        assertf(false, "Mode was not already Params");
     141                        abort();
    143142                }
    144143
    145144                void set_inferParams( InferredParams && ps ) {
    146145                        switch(mode) {
    147                         case Slots: 
     146                        case Slots:
    148147                                data.resnSlots.~ResnSlots();
    149148                                // fallthrough
    150                         case Empty: 
     149                        case Empty:
    151150                                new(&data.inferParams) InferredParams{ std::move( ps ) };
    152151                                mode = Params;
     
    172171                                        data.inferParams[p.first] = std::move(p.second);
    173172                                }
    174                         } else assert(!"invalid mode");
     173                        } else assertf(false, "invalid mode");
    175174                }
    176175        };
     
    384383
    385384        ConstantExpr(
    386                 const CodeLocation & loc, const Type * ty, const std::string & r, 
     385                const CodeLocation & loc, const Type * ty, const std::string & r,
    387386                        std::optional<unsigned long long> i )
    388387        : Expr( loc, ty ), rep( r ), ival( i ) {}
     
    770769public:
    771770        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 )
    775774        : Expr( loc, e->result ), expr( e ), deleteStmt( del ) { assert( expr->result ); }
    776775
Note: See TracChangeset for help on using the changeset viewer.