Changeset fbcde64 for src/SynTree
- Timestamp:
- Mar 30, 2017, 5:21:07 PM (8 years ago)
- 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:
- 936a287
- Parents:
- 89ae7f4
- Location:
- src/SynTree
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.cc
r89ae7f4 rfbcde64 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 17 09:42:04201713 // Update Count : 5 112 // Last Modified On : Thu Mar 30 16:41:13 2017 13 // Update Count : 52 14 14 // 15 15 … … 571 571 572 572 573 CompoundLiteralExpr::CompoundLiteralExpr( Type * type, Initializer * initializer ) : type( type ),initializer( initializer ) {573 CompoundLiteralExpr::CompoundLiteralExpr( Type * type, Initializer * initializer ) : initializer( initializer ) { 574 574 assert( type && initializer ); 575 set_result( type ->clone());576 } 577 578 CompoundLiteralExpr::CompoundLiteralExpr( const CompoundLiteralExpr &other ) : Expression( other ), type( other.type->clone() ),initializer( other.initializer->clone() ) {}575 set_result( type ); 576 } 577 578 CompoundLiteralExpr::CompoundLiteralExpr( const CompoundLiteralExpr &other ) : Expression( other ), initializer( other.initializer->clone() ) {} 579 579 580 580 CompoundLiteralExpr::~CompoundLiteralExpr() { 581 581 delete initializer; 582 delete type;583 582 } 584 583 … … 586 585 os << "Compound Literal Expression: " << std::endl; 587 586 os << std::string( indent+2, ' ' ); 588 type->print( os, indent + 2 );587 get_result()->print( os, indent + 2 ); 589 588 os << std::string( indent+2, ' ' ); 590 589 initializer->print( os, indent + 2 ); -
src/SynTree/Expression.h
r89ae7f4 rfbcde64 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jan 14 14:37:54201713 // Update Count : 3712 // Last Modified On : Thu Mar 30 16:44:00 2017 13 // Update Count : 41 14 14 // 15 15 … … 35 35 36 36 Type *& get_result() { return result; } 37 const Type * get_result() const { return result; } 37 38 void set_result( Type * newValue ) { result = newValue; } 38 39 bool has_result() const { return result != nullptr; } … … 586 587 virtual ~CompoundLiteralExpr(); 587 588 588 Type * get_type() const { return type; }589 void set_type( Type * t ) { type = t; }590 591 589 Initializer * get_initializer() const { return initializer; } 592 590 void set_initializer( Initializer * i ) { initializer = i; } … … 597 595 virtual void print( std::ostream & os, int indent = 0 ) const; 598 596 private: 599 Type * type;600 597 Initializer * initializer; 601 598 }; -
src/SynTree/Mutator.cc
r89ae7f4 rfbcde64 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 16 15:02:23201713 // Update Count : 2 112 // Last Modified On : Thu Mar 30 16:45:19 2017 13 // Update Count : 22 14 14 // 15 15 … … 369 369 compLitExpr->set_env( maybeMutate( compLitExpr->get_env(), *this ) ); 370 370 compLitExpr->set_result( maybeMutate( compLitExpr->get_result(), *this ) ); 371 compLitExpr->set_type( maybeMutate( compLitExpr->get_type(), *this ) );372 371 compLitExpr->set_initializer( maybeMutate( compLitExpr->get_initializer(), *this ) ); 373 372 return compLitExpr; -
src/SynTree/Visitor.cc
r89ae7f4 rfbcde64 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 16 15:01:25 201713 // Update Count : 2 312 // Last Modified On : Thu Mar 30 16:45:25 2017 13 // Update Count : 24 14 14 // 15 15 … … 292 292 void Visitor::visit( CompoundLiteralExpr *compLitExpr ) { 293 293 maybeAccept( compLitExpr->get_result(), *this ); 294 maybeAccept( compLitExpr->get_type(), *this );295 294 maybeAccept( compLitExpr->get_initializer(), *this ); 296 295 }
Note: See TracChangeset
for help on using the changeset viewer.