Changeset eba74ba for src/SynTree
- Timestamp:
- May 25, 2018, 2:51:06 PM (8 years ago)
- Branches:
- new-env, with_gc
- Children:
- cdc4d43
- Parents:
- 3ef35bd (diff), 58e822a (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. - Location:
- src/SynTree
- Files:
-
- 3 edited
-
ApplicationExpr.cc (modified) (1 diff)
-
Expression.cc (modified) (1 diff)
-
Expression.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/ApplicationExpr.cc
r3ef35bd reba74ba 42 42 } 43 43 44 ParamEntry::ParamEntry( ParamEntry && other ) : 45 decl( other.decl ), actualType( other.actualType ), formalType( other.formalType ), expr( other.expr ), inferParams( std::move( other.inferParams ) ) { 46 other.actualType = nullptr; 47 other.formalType = nullptr; 48 other.expr = nullptr; 49 } 50 51 ParamEntry & ParamEntry::operator=( ParamEntry && other ) { 52 if ( &other == this ) return *this; 53 decl = other.decl; 54 actualType = other.actualType; 55 formalType = other.formalType; 56 expr = other.expr; 57 other.actualType = nullptr; 58 other.formalType = nullptr; 59 other.expr = nullptr; 60 inferParams = std::move( other.inferParams ); 61 return *this; 62 } 63 44 64 ApplicationExpr::ApplicationExpr( Expression *funcExpr, const std::list<Expression *> & args ) : function( funcExpr ), args( args ) { 45 65 PointerType *pointer = strict_dynamic_cast< PointerType* >( funcExpr->get_result() ); -
src/SynTree/Expression.cc
r3ef35bd reba74ba 50 50 } 51 51 52 void Expression::spliceInferParams( Expression * other ) { 53 if ( ! other ) return; 54 for ( auto p : other->inferParams ) { 55 inferParams[p.first] = std::move( p.second ); 56 } 57 } 58 52 59 Expression::~Expression() { 53 60 delete env; -
src/SynTree/Expression.h
r3ef35bd reba74ba 41 41 ParamEntry( UniqueId decl, Type * actualType, Type * formalType, Expression* expr ): decl( decl ), actualType( actualType ), formalType( formalType ), expr( expr ), inferParams( new InferredParams ) {} 42 42 ParamEntry( const ParamEntry & other ); 43 ParamEntry( ParamEntry&& other ); 43 44 ParamEntry & operator=( const ParamEntry & other ); 45 ParamEntry & operator=( ParamEntry && other ); 44 46 45 47 UniqueId decl; … … 74 76 75 77 InferredParams & get_inferParams() { return inferParams; } 78 79 // move other's inferParams to this 80 void spliceInferParams( Expression * other ); 76 81 77 82 virtual Expression * clone() const override = 0;
Note:
See TracChangeset
for help on using the changeset viewer.