Changeset 4b7cce6 for src/ResolvExpr/Candidate.hpp
- Timestamp:
- Jun 11, 2019, 3:42:10 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 432ce7a
- Parents:
- 3da7c19
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Candidate.hpp
r3da7c19 r4b7cce6 30 30 /// A list of unresolved assertions 31 31 using AssertionList = std::vector<AssertionSet::value_type>; 32 33 /// Convenience to merge AssertionList into AssertionSet 34 static inline void mergeAssertionSet( AssertionSet & dst, const AssertionList & src ) { 35 for ( const auto & s : src ) { dst.emplace( s ); } 36 } 32 37 } 33 38 … … 43 48 ast::AssertionList need; ///< Assertions which need to be resolved 44 49 45 Candidate() = default; 50 Candidate() : expr(), cost( Cost::zero ), cvtCost( Cost::zero ), env(), open(), need() {} 51 52 Candidate( const ast::Expr * x, const ast::TypeEnvironment & e ) 53 : expr( x ), cost( Cost::zero ), cvtCost( Cost::zero ), env( e ), open(), need() {} 54 55 Candidate( const Candidate & o, const ast::Expr * x ) 56 : expr( x ), cost( o.cost ), cvtCost( Cost::zero ), env( o.env ), open( o.open ), 57 need( o.need ) {} 58 59 Candidate( 60 const ast::Expr * x, ast::TypeEnvironment && e, ast::OpenVarSet && o, 61 ast::AssertionSet && n, const Cost & c ) 62 : expr( x ), cost( c ), cvtCost( Cost::zero ), env( std::move( e ) ), open( std::move( o ) ), 63 need( n.begin(), n.end() ) {} 46 64 }; 47 65 … … 51 69 /// List of candidates 52 70 using CandidateList = std::vector< CandidateRef >; 71 72 /// Sum the cost of a list of candidates 73 static inline Cost sumCost( const CandidateList & candidates ) { 74 Cost total = Cost::zero; 75 for ( const CandidateRef & r : candidates ) { total += r->cost; } 76 return total; 77 } 53 78 54 79 /// Holdover behaviour from old `findMinCost` -- xxx -- can maybe be eliminated?
Note: See TracChangeset
for help on using the changeset viewer.