Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.hpp

    rb8524ca r7870799  
    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);
    117116                }
    118117
     
    121120                                return data.resnSlots;
    122121                        }
    123                         assert(!"Mode was not already resnSlots");
    124                         return *((ResnSlots*)nullptr);
     122                        assertf(false, "Mode was not already resnSlots");
     123                        abort();
    125124                }
    126125
     
    131130                        case Params: return data.inferParams;
    132131                        }
    133                         assert(!"unreachable");
    134                         return *((InferredParams*)nullptr);
     132                        assertf(false, "unreachable");
    135133                }
    136134
     
    139137                                return data.inferParams;
    140138                        }
    141                         assert(!"Mode was not already Params");
    142                         return *((InferredParams*)nullptr);
     139                        assertf(false, "Mode was not already Params");
     140                        abort();
    143141                }
    144142
    145143                void set_inferParams( InferredParams && ps ) {
    146144                        switch(mode) {
    147                         case Slots: 
     145                        case Slots:
    148146                                data.resnSlots.~ResnSlots();
    149147                                // fallthrough
    150                         case Empty: 
     148                        case Empty:
    151149                                new(&data.inferParams) InferredParams{ std::move( ps ) };
    152150                                mode = Params;
     
    172170                                        data.inferParams[p.first] = std::move(p.second);
    173171                                }
    174                         } else assert(!"invalid mode");
     172                        } else assertf(false, "invalid mode");
    175173                }
    176174        };
     
    384382
    385383        ConstantExpr(
    386                 const CodeLocation & loc, const Type * ty, const std::string & r, 
     384                const CodeLocation & loc, const Type * ty, const std::string & r,
    387385                        std::optional<unsigned long long> i )
    388386        : Expr( loc, ty ), rep( r ), ival( i ) {}
Note: See TracChangeset for help on using the changeset viewer.