Ignore:
Timestamp:
Jan 11, 2017, 4:11:02 PM (9 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
075734f
Parents:
bb82c03 (diff), d3a85240 (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    rbb82c03 r2162c2c  
    5454};
    5555
     56struct ParamEntry;
     57typedef std::map< UniqueId, ParamEntry > InferredParams;
     58
    5659/// ParamEntry contains the i.d. of a declaration and a type that is derived from that declaration,
    5760/// but subject to decay-to-pointer and type parameter renaming
    5861struct ParamEntry {
    59         ParamEntry(): decl( 0 ), actualType( 0 ), formalType( 0 ), expr( 0 ) {}
    60         ParamEntry( UniqueId decl, Type *actualType, Type *formalType, Expression* expr ): decl( decl ), actualType( actualType ), formalType( formalType ), expr( expr ) {}
     62        ParamEntry(): decl( 0 ), actualType( 0 ), formalType( 0 ), expr( 0 ), inferParams( new InferredParams ) {}
     63        ParamEntry( UniqueId decl, Type *actualType, Type *formalType, Expression* expr ): decl( decl ), actualType( actualType ), formalType( formalType ), expr( expr ), inferParams( new InferredParams ) {}
    6164        ParamEntry( const ParamEntry &other );
    6265        ~ParamEntry();
     
    6770        Type *formalType;
    6871        Expression* expr;
    69 };
    70 
    71 typedef std::map< UniqueId, ParamEntry > InferredParams;
     72        std::unique_ptr< InferredParams > inferParams;
     73};
    7274
    7375/// ApplicationExpr represents the application of a function to a set of parameters.  This is the result of running an
     
    634636};
    635637
     638/// UntypedTupleExpr represents a tuple expression ( [a, b, c] ) before resolution
     639class UntypedTupleExpr : public Expression {
     640  public:
     641        UntypedTupleExpr( const std::list< Expression * > & exprs, Expression *_aname = nullptr );
     642        UntypedTupleExpr( const UntypedTupleExpr &other );
     643        virtual ~UntypedTupleExpr();
     644
     645        std::list<Expression*>& get_exprs() { return exprs; }
     646
     647        virtual UntypedTupleExpr *clone() const { return new UntypedTupleExpr( *this ); }
     648        virtual void accept( Visitor &v ) { v.visit( this ); }
     649        virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     650        virtual void print( std::ostream &os, int indent = 0 ) const;
     651  private:
     652        std::list<Expression*> exprs;
     653};
     654
    636655/// TupleExpr represents a tuple expression ( [a, b, c] )
    637656class TupleExpr : public Expression {
    638657  public:
    639         TupleExpr( const std::list< Expression * > & exprs = std::list< Expression * >(), Expression *_aname = nullptr );
     658        TupleExpr( const std::list< Expression * > & exprs, Expression *_aname = nullptr );
    640659        TupleExpr( const TupleExpr &other );
    641660        virtual ~TupleExpr();
    642661
    643         void set_exprs( std::list<Expression*> newValue ) { exprs = newValue; }
    644662        std::list<Expression*>& get_exprs() { return exprs; }
    645663
Note: See TracChangeset for help on using the changeset viewer.