Changeset 2c187378 for src/ResolvExpr/Alternative.cc
- Timestamp:
- Oct 17, 2018, 4:16:18 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- fbecee5
- Parents:
- da48183
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Alternative.cc
rda48183 r2c187378 20 20 #include <utility> // for move 21 21 22 #include "Common/utility.h" // for maybeClone22 #include "Common/utility.h" // for cloneAll 23 23 #include "ResolvExpr/Cost.h" // for Cost, Cost::zero, operator<< 24 24 #include "ResolvExpr/TypeEnvironment.h" // for TypeEnvironment … … 35 35 Alternative::Alternative( const Alternative &o, Expression *expr, const Cost &cost ) 36 36 : cost( cost ), cvtCost( Cost::zero ), expr( expr ), env( o.env ), openVars( o.openVars ), 37 need( o.need ) {}37 need() { cloneAll( o.need, need ); } 38 38 39 39 Alternative::Alternative( Expression *expr, const TypeEnvironment &env, 40 const OpenVarSet& openVars, const AssertionList& need, const Cost& cost )40 const OpenVarSet& openVars, const AssertionList& oneed, const Cost& cost ) 41 41 : cost( cost ), cvtCost( Cost::zero ), expr( expr ), env( env ), openVars( openVars ), 42 need( need ) {}42 need() { cloneAll( oneed, need ); } 43 43 44 44 Alternative::Alternative( Expression *expr, const TypeEnvironment &env, 45 const OpenVarSet& openVars, const AssertionList& need, const Cost& cost,45 const OpenVarSet& openVars, const AssertionList& oneed, const Cost& cost, 46 46 const Cost &cvtCost ) 47 47 : cost( cost ), cvtCost( cvtCost ), expr( expr ), env( env ), openVars( openVars ), 48 need( need ) {} 48 need() { cloneAll( oneed, need ); } 49 50 Alternative::Alternative( Expression *expr, const TypeEnvironment &env, 51 const OpenVarSet &openVars, const AssertionSet &oneed, const Cost &cost) 52 : cost( cost ), cvtCost( Cost::zero ), expr( expr ), env( env ), openVars( openVars ), 53 need() { cloneAll( oneed, need ); } 54 55 Alternative::Alternative( Expression *expr, const TypeEnvironment &env, 56 const OpenVarSet &openVars, const AssertionSet &oneed, const Cost &cost, 57 const Cost& cvtCost ) 58 : cost( cost ), cvtCost( cvtCost ), expr( expr ), env( env ), openVars( openVars ), 59 need() { cloneAll( oneed, need ); } 60 61 Alternative::Alternative( Expression *expr, TypeEnvironment &&env, OpenVarSet &&openVars, 62 AssertionSet &&needSet, const Cost &cost ) 63 : cost( cost ), cvtCost( Cost::zero ), expr( expr ), env( std::move(env) ), 64 openVars( std::move(openVars) ), need( needSet.begin(), needSet.end() ) {} 65 66 Alternative::Alternative( Expression *expr, TypeEnvironment &&env, OpenVarSet &&openVars, 67 AssertionSet &&needSet, const Cost &cost, const Cost &cvtCost ) 68 : cost( cost ), cvtCost( cvtCost ), expr( expr ), env( std::move(env) ), 69 openVars( std::move(openVars) ), need( needSet.begin(), needSet.end() ) {} 49 70 50 71 Alternative::Alternative( const Alternative &other ) 51 72 : cost( other.cost ), cvtCost( other.cvtCost ), expr( maybeClone( other.expr ) ), 52 env( other.env ), openVars( other.openVars ), need( other.need ) {}73 env( other.env ), openVars( other.openVars ), need() { cloneAll( other.need, need ); } 53 74 54 75 Alternative &Alternative::operator=( const Alternative &other ) { … … 60 81 env = other.env; 61 82 openVars = other.openVars; 62 need = other.need; 83 need.clear(); 84 cloneAll( other.need, need ); 63 85 return *this; 64 86 } … … 67 89 : cost( other.cost ), cvtCost( other.cvtCost ), expr( other.expr ), 68 90 env( std::move( other.env ) ), openVars( std::move( other.openVars ) ), 69 need( std::move( other.need ) ) { 70 other.expr = nullptr; 71 } 91 need( std::move( other.need ) ) { other.expr = nullptr; } 72 92 73 93 Alternative & Alternative::operator=( Alternative && other ) {
Note: See TracChangeset
for help on using the changeset viewer.