Ignore:
Timestamp:
Oct 2, 2017, 3:02:21 PM (4 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
e472d54
Parents:
9bae71f
Message:

First draft of iterative bottom-up resolver [BROKEN]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.h

    r9bae71f raeb75b1  
    3434          public:
    3535                AlternativeFinder( const SymTab::Indexer &indexer, const TypeEnvironment &env );
     36
     37                AlternativeFinder( const AlternativeFinder& o )
     38                        : indexer(o.indexer), alternatives(o.alternatives), env(o.env),
     39                          targetType(o.targetType) {}
     40               
     41                AlternativeFinder( AlternativeFinder&& o )
     42                        : indexer(o.indexer), alternatives(std::move(o.alternatives)), env(o.env),
     43                          targetType(o.targetType) {}
     44               
     45                AlternativeFinder& operator= ( const AlternativeFinder& o ) {
     46                        if (&o == this) return *this;
     47                       
     48                        // horrific nasty hack to rebind references...
     49                        alternatives.~AltList();
     50                        new(this) AlternativeFinder(o);
     51                        return *this;
     52                }
     53
     54                AlternativeFinder& operator= ( AlternativeFinder&& o ) {
     55                        if (&o == this) return *this;
     56                       
     57                        // horrific nasty hack to rebind references...
     58                        alternatives.~AltList();
     59                        new(this) AlternativeFinder(std::move(o));
     60                        return *this;
     61                }
     62
    3663                void find( Expression *expr, bool adjust = false, bool prune = true );
    3764                /// Calls find with the adjust flag set; adjustment turns array and function types into equivalent pointer types
     
    94121                /// Adds alternatives for offsetof expressions, given the base type and name of the member
    95122                template< typename StructOrUnionType > void addOffsetof( StructOrUnionType *aggInst, const std::string &name );
    96                 bool instantiateFunction( std::list< DeclarationWithType* >& formals, const AltList &actuals, bool isVarArgs, OpenVarSet& openVars, TypeEnvironment &resultEnv, AssertionSet &resultNeed, AssertionSet &resultHave, AltList & out );
     123/*CUT   bool instantiateFunction( std::list< DeclarationWithType* >& formals, const AltList &actuals, bool isVarArgs, OpenVarSet& openVars, TypeEnvironment &resultEnv, AssertionSet &resultNeed, AssertionSet &resultHave, AltList & out );
    97124                template< typename OutputIterator >
    98125                void makeFunctionAlternatives( const Alternative &func, FunctionType *funcType, const AltList &actualAlt, OutputIterator out );
     126*/              template<typename OutputIterator>
     127                void makeFunctionAlternatives( const Alternative &func, FunctionType *funcType, const std::vector< AlternativeFinder >& args, OutputIterator out );
    99128                template< typename OutputIterator >
    100129                void inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out );
Note: See TracChangeset for help on using the changeset viewer.