Changeset 954463b8
- Timestamp:
- Jun 2, 2015, 3:31:41 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:
- 27de955
- Parents:
- 4eb1db6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/LabelFixer.cc
r4eb1db6 r954463b8 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Fri May 29 15:57:12 201513 // Update Count : 8212 // Last Modified On : Tue Jun 02 15:30:32 2015 13 // Update Count : 93 14 14 // 15 15 … … 76 76 assert( llabel.size() > 0 ); 77 77 78 Entry * e = new Entry( definition ); 79 78 80 for ( std::list< Label >::iterator i = llabel.begin(); i != llabel.end(); i++ ) { 79 if ( labelTable.find( *i ) == labelTable.end() ) { 81 if ( labelTable.find( *i ) == labelTable.end() ) { 82 // all labels on this statement need to use the same entry, so this should only be created once 80 83 // undefined and unused until now, add an entry 81 labelTable[ *i ] = new Entry( definition );82 } else if ( labelTable[ *i ]->defined() ) { \84 labelTable[ *i ] = e; 85 } else if ( labelTable[ *i ]->defined() ) { 83 86 // defined twice, error 84 87 throw SemanticError( "Duplicate definition of label: " + *i ); 85 88 } else { 86 // used previously, but undefined until now -> set its definition to this location 87 labelTable[ *i ]->set_definition( definition ); 89 // used previously, but undefined until now -> link with this entry 90 Entry * oldEntry = labelTable[ *i ]; 91 e->add_uses( oldEntry->get_uses() ); 92 labelTable[ *i ] = e; 88 93 } // if 89 94 } // for
Note: See TracChangeset
for help on using the changeset viewer.