Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.hpp

    r99da267 re67991f  
    3030
    3131// 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);
    3633
    3734class ConverterOldToNew;
     
    5047
    5148        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,
    5451                const Expr * e )
    5552        : decl( id ), declptr( declptr ), actualType( actual ), formalType( formal ), expr( e ) {}
     
    115112                        case Empty: new(&data.resnSlots) ResnSlots{}; mode = Slots; // fallthrough
    116113                        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();
    118115                        }
    119                         return *((ResnSlots*)nullptr);
     116                        assertf(false, "unreachable");
    120117                }
    121118
     
    124121                                return data.resnSlots;
    125122                        }
    126                         assert(!"Mode was not already resnSlots");
    127                         return *((ResnSlots*)nullptr);
     123                        assertf(false, "Mode was not already resnSlots");
     124                        abort();
    128125                }
    129126
     
    134131                        case Params: return data.inferParams;
    135132                        }
    136                         assert(!"unreachable");
    137                         return *((InferredParams*)nullptr);
     133                        assertf(false, "unreachable");
    138134                }
    139135
     
    142138                                return data.inferParams;
    143139                        }
    144                         assert(!"Mode was not already Params");
    145                         return *((InferredParams*)nullptr);
     140                        assertf(false, "Mode was not already Params");
     141                        abort();
    146142                }
    147143
    148144                void set_inferParams( InferredParams && ps ) {
    149145                        switch(mode) {
    150                         case Slots: 
     146                        case Slots:
    151147                                data.resnSlots.~ResnSlots();
    152148                                // fallthrough
    153                         case Empty: 
     149                        case Empty:
    154150                                new(&data.inferParams) InferredParams{ std::move( ps ) };
    155151                                mode = Params;
     
    175171                                        data.inferParams[p.first] = std::move(p.second);
    176172                                }
    177                         } else assert(!"invalid mode");
     173                        } else assertf(false, "invalid mode");
    178174                }
    179175        };
     
    387383
    388384        ConstantExpr(
    389                 const CodeLocation & loc, const Type * ty, const std::string & r, 
     385                const CodeLocation & loc, const Type * ty, const std::string & r,
    390386                        std::optional<unsigned long long> i )
    391387        : Expr( loc, ty ), rep( r ), ival( i ) {}
     
    773769public:
    774770        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 )
    778774        : Expr( loc, e->result ), expr( e ), deleteStmt( del ) { assert( expr->result ); }
    779775
Note: See TracChangeset for help on using the changeset viewer.