Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    r2f86ddf r0b00df0  
    2121#include <memory>                 // for allocator, unique_ptr
    2222#include <string>                 // for string
     23#include <vector>                 // for vector
    2324
    2425#include "BaseSyntaxNode.h"       // for BaseSyntaxNode
     
    3839/// but subject to decay-to-pointer and type parameter renaming
    3940struct ParamEntry {
    40         ParamEntry(): decl( 0 ), actualType( 0 ), formalType( 0 ), expr( 0 ), inferParams( new InferredParams ) {}
    41         ParamEntry( UniqueId decl, Type * actualType, Type * formalType, Expression* expr ): decl( decl ), actualType( actualType ), formalType( formalType ), expr( expr ), inferParams( new InferredParams ) {}
     41        ParamEntry(): decl( 0 ), actualType( 0 ), formalType( 0 ), expr( 0 )/*, inferParams( new InferredParams )*/ {}
     42        ParamEntry( UniqueId decl, Type * actualType, Type * formalType, Expression* expr ): decl( decl ), actualType( actualType ), formalType( formalType ), expr( expr )/*, inferParams( new InferredParams )*/ {}
    4243        ParamEntry( const ParamEntry & other );
    4344        ParamEntry( ParamEntry && other );
     
    5051        Type * formalType;
    5152        Expression * expr;
    52         std::unique_ptr< InferredParams > inferParams;
     53        // std::unique_ptr< InferredParams > inferParams;
    5354};
    5455
     
    5960        TypeSubstitution * env;
    6061        bool extension = false;
    61         InferredParams inferParams;
     62        InferredParams inferParams;       ///< Post-resolution inferred parameter slots
     63        std::vector<UniqueId> resnSlots;  ///< Pre-resolution inferred parameter slots
     64       
     65        // xxx - should turn inferParams+resnSlots into a union to save some memory
    6266
    6367        Expression();
     
    7377        bool get_extension() const { return extension; }
    7478        Expression * set_extension( bool exten ) { extension = exten; return this; }
    75 
    76         InferredParams & get_inferParams() { return inferParams; }
    7779
    7880        // move other's inferParams to this
     
    591593class ImplicitCopyCtorExpr : public Expression {
    592594public:
    593         ApplicationExpr * callExpr = nullptr;
     595        ApplicationExpr * callExpr;
     596        std::list< ObjectDecl * > tempDecls;
     597        std::list< ObjectDecl * > returnDecls;
     598        std::list< Expression * > dtors;
    594599
    595600        ImplicitCopyCtorExpr( ApplicationExpr * callExpr );
    596601        ImplicitCopyCtorExpr( const ImplicitCopyCtorExpr & other );
    597602        virtual ~ImplicitCopyCtorExpr();
     603
     604        ApplicationExpr * get_callExpr() const { return callExpr; }
     605        void set_callExpr( ApplicationExpr * newValue ) { callExpr = newValue; }
     606
     607        std::list< ObjectDecl * > & get_tempDecls() { return tempDecls; }
     608        std::list< ObjectDecl * > & get_returnDecls() { return returnDecls; }
     609        std::list< Expression * > & get_dtors() { return dtors; }
    598610
    599611        virtual ImplicitCopyCtorExpr * clone() const { return new ImplicitCopyCtorExpr( * this ); }
Note: See TracChangeset for help on using the changeset viewer.