Changeset cc32d83
- Timestamp:
- May 3, 2018, 4:10:05 PM (6 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, with_gc
- Children:
- b97ebf1
- Parents:
- 637dd9c
- Location:
- src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r637dd9c rcc32d83 887 887 if ( asmStmt->get_instruction() ) asmStmt->get_instruction()->accept( *visitor ); 888 888 output << " )" ; 889 } 890 891 void CodeGenerator::postvisit( DirectiveStmt * dirStmt ) { 892 output << dirStmt->directive; 889 893 } 890 894 -
src/CodeGen/CodeGenerator.h
r637dd9c rcc32d83 99 99 void postvisit( ExprStmt * ); 100 100 void postvisit( AsmStmt * ); 101 void postvisit( DirectiveStmt * ); 101 102 void postvisit( AsmDecl * ); // special: statement in declaration context 102 103 void postvisit( IfStmt * ); -
src/Common/PassVisitor.h
r637dd9c rcc32d83 71 71 virtual void visit( ExprStmt * exprStmt ) override final; 72 72 virtual void visit( AsmStmt * asmStmt ) override final; 73 virtual void visit( DirectiveStmt * dirStmt ) override final; 73 74 virtual void visit( IfStmt * ifStmt ) override final; 74 75 virtual void visit( WhileStmt * whileStmt ) override final; … … 168 169 virtual Statement * mutate( ExprStmt * exprStmt ) override final; 169 170 virtual Statement * mutate( AsmStmt * asmStmt ) override final; 171 virtual Statement * mutate( DirectiveStmt * dirStmt ) override final; 170 172 virtual Statement * mutate( IfStmt * ifStmt ) override final; 171 173 virtual Statement * mutate( WhileStmt * whileStmt ) override final; -
src/Common/PassVisitor.impl.h
r637dd9c rcc32d83 777 777 778 778 //-------------------------------------------------------------------------- 779 // AsmStmt 780 template< typename pass_type > 781 void PassVisitor< pass_type >::visit( DirectiveStmt * node ) { 782 VISIT_START( node ) 783 784 VISIT_END( node ); 785 } 786 787 template< typename pass_type > 788 Statement * PassVisitor< pass_type >::mutate( DirectiveStmt * node ) { 789 MUTATE_START( node ); 790 791 MUTATE_END( Statement, node ); 792 } 793 794 //-------------------------------------------------------------------------- 779 795 // IfStmt 780 796 template< typename pass_type > -
src/Parser/StatementNode.cc
r637dd9c rcc32d83 321 321 322 322 Statement * build_directive( string * directive ) { 323 cout << *directive << endl; 324 return nullptr; 323 return new DirectiveStmt( *directive ); 325 324 } 326 325 -
src/SynTree/Mutator.h
r637dd9c rcc32d83 39 39 virtual Statement * mutate( ExprStmt * exprStmt ) = 0; 40 40 virtual Statement * mutate( AsmStmt * asmStmt ) = 0; 41 virtual Statement * mutate( DirectiveStmt * dirStmt ) = 0; 41 42 virtual Statement * mutate( IfStmt * ifStmt ) = 0; 42 43 virtual Statement * mutate( WhileStmt * whileStmt ) = 0; -
src/SynTree/Statement.cc
r637dd9c rcc32d83 94 94 95 95 96 DirectiveStmt::DirectiveStmt( const std::string & directive ) : Statement(), directive( directive ) {} 97 98 void DirectiveStmt::print( std::ostream &os, Indenter ) const { 99 os << "GCC Directive:" << directive << endl; 100 } 101 102 96 103 const char *BranchStmt::brType[] = { "Goto", "Break", "Continue" }; 97 104 -
src/SynTree/Statement.h
r637dd9c rcc32d83 126 126 }; 127 127 128 class DirectiveStmt : public Statement { 129 public: 130 std::string directive; 131 132 DirectiveStmt( const std::string & ); 133 virtual ~DirectiveStmt(){} 134 135 virtual DirectiveStmt * clone() const { return new DirectiveStmt( *this ); } 136 virtual void accept( Visitor & v ) { v.visit( this ); } 137 virtual Statement * acceptMutator( Mutator & m ) { return m.mutate( this ); } 138 virtual void print( std::ostream & os, Indenter indent = {} ) const; 139 }; 140 128 141 class IfStmt : public Statement { 129 142 public: -
src/SynTree/SynTree.h
r637dd9c rcc32d83 44 44 class ExprStmt; 45 45 class AsmStmt; 46 class DirectiveStmt; 46 47 class IfStmt; 47 48 class WhileStmt; -
src/SynTree/Visitor.h
r637dd9c rcc32d83 41 41 virtual void visit( ExprStmt * exprStmt ) = 0; 42 42 virtual void visit( AsmStmt * asmStmt ) = 0; 43 virtual void visit( DirectiveStmt * directiveStmt ) = 0; 43 44 virtual void visit( IfStmt * ifStmt ) = 0; 44 45 virtual void visit( WhileStmt * whileStmt ) = 0;
Note: See TracChangeset
for help on using the changeset viewer.