Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.hpp

    r7870799 rb8524ca  
    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: assertf(false, "Cannot return to resnSlots from Params"); abort();
     114                        case Params: assert(!"Cannot return to resnSlots from Params");
    115115                        }
     116                        return *((ResnSlots*)nullptr);
    116117                }
    117118
     
    120121                                return data.resnSlots;
    121122                        }
    122                         assertf(false, "Mode was not already resnSlots");
    123                         abort();
     123                        assert(!"Mode was not already resnSlots");
     124                        return *((ResnSlots*)nullptr);
    124125                }
    125126
     
    130131                        case Params: return data.inferParams;
    131132                        }
    132                         assertf(false, "unreachable");
     133                        assert(!"unreachable");
     134                        return *((InferredParams*)nullptr);
    133135                }
    134136
     
    137139                                return data.inferParams;
    138140                        }
    139                         assertf(false, "Mode was not already Params");
    140                         abort();
     141                        assert(!"Mode was not already Params");
     142                        return *((InferredParams*)nullptr);
    141143                }
    142144
    143145                void set_inferParams( InferredParams && ps ) {
    144146                        switch(mode) {
    145                         case Slots:
     147                        case Slots: 
    146148                                data.resnSlots.~ResnSlots();
    147149                                // fallthrough
    148                         case Empty:
     150                        case Empty: 
    149151                                new(&data.inferParams) InferredParams{ std::move( ps ) };
    150152                                mode = Params;
     
    170172                                        data.inferParams[p.first] = std::move(p.second);
    171173                                }
    172                         } else assertf(false, "invalid mode");
     174                        } else assert(!"invalid mode");
    173175                }
    174176        };
     
    382384
    383385        ConstantExpr(
    384                 const CodeLocation & loc, const Type * ty, const std::string & r,
     386                const CodeLocation & loc, const Type * ty, const std::string & r, 
    385387                        std::optional<unsigned long long> i )
    386388        : Expr( loc, ty ), rep( r ), ival( i ) {}
Note: See TracChangeset for help on using the changeset viewer.