Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.h

    ra8b27c6 r4e66a18  
    2121
    2222#include "Alternative.h"                 // for AltList, Alternative
    23 #include "ExplodedActual.h"              // for ExplodedActual
    2423#include "ResolvExpr/Cost.h"             // for Cost, Cost::infinity
    2524#include "ResolvExpr/TypeEnvironment.h"  // for AssertionSet, OpenVarSet
     
    3231
    3332namespace 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 alternative
    38         using ExplodedArgs = std::vector< std::vector< ExplodedActual > >;
    39        
    4033        class AlternativeFinder : public Visitor {
    4134          public:
    4235                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 
    7036                void find( Expression *expr, bool adjust = false, bool prune = true, bool failFast = true );
    7137                /// Calls find with the adjust flag set; adjustment turns array and function types into equivalent pointer types
     
    13399                /// Adds alternatives for offsetof expressions, given the base type and name of the member
    134100                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 );
    142104                template< typename OutputIterator >
    143105                void inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out );
Note: See TracChangeset for help on using the changeset viewer.