Changeset c0d00b6 for src/ResolvExpr/AlternativeFinder.h
- Timestamp:
- Nov 25, 2017, 3:22:18 PM (8 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- c6e2c18
- Parents:
- 9d06142 (diff), 3de176d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
src/ResolvExpr/AlternativeFinder.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/AlternativeFinder.h
r9d06142 rc0d00b6 21 21 22 22 #include "Alternative.h" // for AltList, Alternative 23 #include "ExplodedActual.h" // for ExplodedActual 23 24 #include "ResolvExpr/Cost.h" // for Cost, Cost::infinity 24 25 #include "ResolvExpr/TypeEnvironment.h" // for AssertionSet, OpenVarSet … … 31 32 32 33 namespace ResolvExpr { 34 struct 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 alternative 38 using ExplodedArgs = std::vector< std::vector< ExplodedActual > >; 39 33 40 class AlternativeFinder : public Visitor { 34 41 public: 35 42 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 36 70 void find( Expression *expr, bool adjust = false, bool prune = true, bool failFast = true ); 37 71 /// Calls find with the adjust flag set; adjustment turns array and function types into equivalent pointer types … … 99 133 /// Adds alternatives for offsetof expressions, given the base type and name of the member 100 134 template< typename StructOrUnionType > void addOffsetof( StructOrUnionType *aggInst, const std::string &name ); 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 ); 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 104 142 template< typename OutputIterator > 105 143 void inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out );
Note:
See TracChangeset
for help on using the changeset viewer.