- File:
-
- 1 edited
-
src/ResolvExpr/AlternativeFinder.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/AlternativeFinder.h
ra8b27c6 r4e66a18 21 21 22 22 #include "Alternative.h" // for AltList, Alternative 23 #include "ExplodedActual.h" // for ExplodedActual24 23 #include "ResolvExpr/Cost.h" // for Cost, Cost::infinity 25 24 #include "ResolvExpr/TypeEnvironment.h" // for AssertionSet, OpenVarSet … … 32 31 33 32 namespace ResolvExpr { 34 class ArgPack;35 36 /// First index is which argument, second index is which alternative for that argument,37 /// third index is which exploded element of that alternative38 using ExplodedArgs = std::vector< std::vector< ExplodedActual > >;39 40 33 class AlternativeFinder : public Visitor { 41 34 public: 42 35 AlternativeFinder( const SymTab::Indexer &indexer, const TypeEnvironment &env ); 43 44 AlternativeFinder( const AlternativeFinder& o )45 : indexer(o.indexer), alternatives(o.alternatives), env(o.env),46 targetType(o.targetType) {}47 48 AlternativeFinder( AlternativeFinder&& o )49 : indexer(o.indexer), alternatives(std::move(o.alternatives)), env(o.env),50 targetType(o.targetType) {}51 52 AlternativeFinder& operator= ( const AlternativeFinder& o ) {53 if (&o == this) return *this;54 55 // horrific nasty hack to rebind references...56 alternatives.~AltList();57 new(this) AlternativeFinder(o);58 return *this;59 }60 61 AlternativeFinder& operator= ( AlternativeFinder&& o ) {62 if (&o == this) return *this;63 64 // horrific nasty hack to rebind references...65 alternatives.~AltList();66 new(this) AlternativeFinder(std::move(o));67 return *this;68 }69 70 36 void find( Expression *expr, bool adjust = false, bool prune = true, bool failFast = true ); 71 37 /// Calls find with the adjust flag set; adjustment turns array and function types into equivalent pointer types … … 133 99 /// Adds alternatives for offsetof expressions, given the base type and name of the member 134 100 template< typename StructOrUnionType > void addOffsetof( StructOrUnionType *aggInst, const std::string &name ); 135 /// Takes a final result and checks if its assertions can be satisfied 136 template<typename OutputIterator> 137 void validateFunctionAlternative( const Alternative &func, ArgPack& result, const std::vector<ArgPack>& results, OutputIterator out ); 138 /// Finds matching alternatives for a function, given a set of arguments 139 template<typename OutputIterator> 140 void makeFunctionAlternatives( const Alternative &func, FunctionType *funcType, const ExplodedArgs& args, OutputIterator out ); 141 /// Checks if assertion parameters match for a new alternative 101 bool instantiateFunction( std::list< DeclarationWithType* >& formals, const AltList &actuals, bool isVarArgs, OpenVarSet& openVars, TypeEnvironment &resultEnv, AssertionSet &resultNeed, AssertionSet &resultHave, AltList & out ); 102 template< typename OutputIterator > 103 void makeFunctionAlternatives( const Alternative &func, FunctionType *funcType, const AltList &actualAlt, OutputIterator out ); 142 104 template< typename OutputIterator > 143 105 void inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out );
Note:
See TracChangeset
for help on using the changeset viewer.