Changeset 61255ad
- Timestamp:
- Nov 30, 2017, 3:58:26 PM (5 years ago)
- Branches:
- aaron-thesis, arm-eh, 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:
- a378ca7
- Parents:
- 4429b04
- Location:
- src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.h
r4429b04 r61255ad 81 81 virtual void visit( FinallyStmt * finallyStmt ) override final; 82 82 virtual void visit( WaitForStmt * waitforStmt ) override final; 83 virtual void visit( WithStmt * withStmt ) override final; 83 84 virtual void visit( NullStmt * nullStmt ) override final; 84 85 virtual void visit( DeclStmt * declStmt ) override final; … … 172 173 virtual Statement * mutate( FinallyStmt * finallyStmt ) override final; 173 174 virtual Statement * mutate( WaitForStmt * waitforStmt ) override final; 175 virtual Statement * mutate( WithStmt * withStmt ) override final; 174 176 virtual NullStmt * mutate( NullStmt * nullStmt ) override final; 175 177 virtual Statement * mutate( DeclStmt * declStmt ) override final; -
src/Common/PassVisitor.impl.h
r4429b04 r61255ad 988 988 // NullStmt 989 989 template< typename pass_type > 990 void PassVisitor< pass_type >::visit( WithStmt * node ) { 991 VISIT_BODY( node ); 992 } 993 994 template< typename pass_type > 995 Statement * PassVisitor< pass_type >::mutate( WithStmt * node ) { 996 MUTATE_BODY( Statement, node ); 997 } 998 999 //-------------------------------------------------------------------------- 1000 // NullStmt 1001 template< typename pass_type > 990 1002 void PassVisitor< pass_type >::visit( NullStmt * node ) { 991 1003 VISIT_BODY( node ); -
src/SynTree/Mutator.cc
r4429b04 r61255ad 203 203 } 204 204 205 Statement * Mutator::mutate( WithStmt * withStmt ) { 206 mutateAll( withStmt->exprs, *this ); 207 withStmt->stmt = maybeMutate( withStmt->stmt, *this ); 208 return withStmt; 209 } 210 205 211 NullStmt * Mutator::mutate( NullStmt *nullStmt ) { 206 212 return nullStmt; -
src/SynTree/Mutator.h
r4429b04 r61255ad 50 50 virtual Statement * mutate( FinallyStmt * catchStmt ); 51 51 virtual Statement * mutate( WaitForStmt * waitforStmt ); 52 virtual Statement * mutate( WithStmt * withStmt ); 52 53 virtual NullStmt * mutate( NullStmt * nullStmt ); 53 54 virtual Statement * mutate( DeclStmt * declStmt ); -
src/SynTree/Statement.cc
r4429b04 r61255ad 455 455 } 456 456 457 458 WithStmt::WithStmt( const std::list< Expression * > & exprs, Statement * stmt ) : Statement( std::list<Label>() ), exprs( exprs ), stmt( stmt ) {} 459 WithStmt::WithStmt( const WithStmt & other ) : Statement( other ), stmt( maybeClone( other.stmt ) ) { 460 cloneAll( other.exprs, exprs ); 461 } 462 WithStmt::~WithStmt() { 463 deleteAll( exprs ); 464 delete stmt; 465 } 466 467 void WithStmt::print( std::ostream & os, Indenter indent ) const { 468 os << "With statement" << endl; 469 os << indent << "... with statement:" << endl << indent+1; 470 stmt->print( os, indent+1 ); 471 } 472 473 457 474 NullStmt::NullStmt( std::list<Label> labels ) : Statement( labels ) {} 458 475 NullStmt::NullStmt() : Statement( std::list<Label>() ) {} -
src/SynTree/Statement.h
r4429b04 r61255ad 432 432 }; 433 433 434 class WithStmt : public Statement { 435 public: 436 std::list< Expression * > exprs; 437 Statement * stmt; 438 439 WithStmt( const std::list< Expression * > & exprs, Statement * stmt ); 440 WithStmt( const WithStmt & other ); 441 virtual ~WithStmt(); 442 443 virtual WithStmt * clone() const override { return new WithStmt( *this ); } 444 virtual void accept( Visitor & v ) override { v.visit( this ); } 445 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 446 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 447 }; 448 434 449 435 450 // represents a declaration that occurs as part of a compound statement -
src/SynTree/SynTree.h
r4429b04 r61255ad 55 55 class FinallyStmt; 56 56 class WaitForStmt; 57 class WithStmt; 57 58 class NullStmt; 58 59 class DeclStmt; -
src/SynTree/Visitor.cc
r4429b04 r61255ad 174 174 } 175 175 176 void Visitor::visit( __attribute__((unused)) NullStmt *nullStmt ) { 176 void Visitor::visit( WithStmt * withStmt ) { 177 acceptAll( withStmt->exprs, *this ); 178 maybeAccept( withStmt->stmt, *this ); 179 } 180 181 void Visitor::visit( NullStmt * ) { 177 182 } 178 183 -
src/SynTree/Visitor.h
r4429b04 r61255ad 52 52 virtual void visit( FinallyStmt * finallyStmt ); 53 53 virtual void visit( WaitForStmt * waitforStmt ); 54 virtual void visit( WithStmt * withStmt ); 54 55 virtual void visit( NullStmt * nullStmt ); 55 56 virtual void visit( DeclStmt * declStmt );
Note: See TracChangeset
for help on using the changeset viewer.