Changeset e766208 for src/ControlStruct/LabelFixer.h
- Timestamp:
- Jul 30, 2015, 4:05:02 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:
- e01559c
- Parents:
- 51b986f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/LabelFixer.h
r51b986f re766208 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon Jun 29 17:24:39201513 // Update Count : 2911 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Jul 28 13:09:02 2015 13 // Update Count : 31 14 14 // 15 15 … … 63 63 class Entry { 64 64 public: 65 union UsageLoc {66 Statement * stmt;67 Expression * expr;68 69 void accept( Visitor &visitor );70 };71 72 65 Entry( Statement *to ) : definition( to ) {} 73 Entry( Statement *to, Statement *from );74 Entry( Statement *to, Expression *from );75 bool used() { return ( usage.empty() ); }76 66 bool defined() { return ( definition != 0 ); } 77 67 bool insideLoop(); … … 83 73 void set_definition( Statement *def ) { definition = def; } 84 74 85 std::list< UsageLoc > &get_uses() { return usage; }86 void add_use( Statement *use ) {87 UsageLoc loc;88 loc.stmt = use;89 usage.push_back( loc );90 }91 void add_use( Expression *use ) {92 UsageLoc loc;93 loc.expr = use;94 usage.push_back( loc );95 }96 97 void add_uses ( Entry &other ) { usage.insert( usage.end(), other.usage.begin(), other.usage.end() ); }98 75 private: 99 76 Label label; 100 77 Statement *definition; 101 std::list<UsageLoc> usage;102 78 }; 103 79 104 80 std::map < Label, Entry *> labelTable; 105 81 LabelGenerator *generator; 106 Statement * currentStatement;107 82 }; 108 83 } // namespace ControlStruct
Note: See TracChangeset
for help on using the changeset viewer.