Changeset d4778a6
- Timestamp:
- May 11, 2015, 3:11:49 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- b1a6d6b, c11e31c
- Parents:
- 48e99f2
- Location:
- translator
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/ControlStruct/ForExprMutator.cc
r48e99f2 rd4778a6 5 5 namespace ControlStruct { 6 6 Statement *ForExprMutator::mutate( ForStmt *forStmt ) { 7 DeclStmt *decl;8 if ( ( decl = dynamic_cast< DeclStmt * > ( forStmt->get_initialization() )) != 0) {7 forStmt->set_body( forStmt->get_body()->acceptMutator( *this ) ); 8 if ( DeclStmt *decl = dynamic_cast< DeclStmt * > ( forStmt->get_initialization() ) ) { 9 9 // create compound statement, move declaration outside, leave _for_ as-is 10 10 CompoundStmt *block = new CompoundStmt( std::list< Label >() ); -
translator/SymTab/Indexer.cc
r48e99f2 rd4778a6 157 157 leaveScope(); 158 158 } 159 160 void Indexer::visit( ForStmt *forStmt ) { 161 // for statements introduce a level of scope 162 enterScope(); 163 Visitor::visit( forStmt ); 164 leaveScope(); 165 } 166 159 167 160 168 void Indexer::lookupId( const std::string &id, std::list< DeclarationWithType* > &list ) const { -
translator/SymTab/Indexer.h
r48e99f2 rd4778a6 32 32 virtual void visit( StructInstType *contextInst ); 33 33 virtual void visit( UnionInstType *contextInst ); 34 34 35 virtual void visit( ForStmt *forStmt ); 36 35 37 // when using an indexer manually (e.g., within a mutator traversal), it is necessary to tell the indexer 36 38 // explicitly when scopes begin and end
Note: See TracChangeset
for help on using the changeset viewer.