Changeset a08ba92 for translator/ControlStruct/LabelGenerator.h
- Timestamp:
- May 19, 2015, 4:58:14 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:
- 843054c2
- Parents:
- 01aeade
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/ControlStruct/LabelGenerator.h
r01aeade ra08ba92 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // XXX.cc--7 // LabelGenerator.h -- 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : 12 // Last Modified On : 13 // Update Count : 011 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue May 19 15:33:20 2015 13 // Update Count : 3 14 14 // 15 15 16 #ifndef LABEL_GENERATOR_H 16 17 #define LABEL_GENERATOR_H … … 19 20 20 21 namespace ControlStruct { 21 22 23 static LabelGenerator *getGenerator();24 Label newLabel();25 void reset() { current = 0; }26 void rewind() { current--; }27 28 LabelGenerator(): current(0) {}29 30 int current;31 static LabelGenerator *labelGenerator;32 22 class LabelGenerator { 23 public: 24 static LabelGenerator *getGenerator(); 25 Label newLabel(); 26 void reset() { current = 0; } 27 void rewind() { current--; } 28 protected: 29 LabelGenerator(): current(0) {} 30 private: 31 int current; 32 static LabelGenerator *labelGenerator; 33 }; 33 34 } // namespace ControlStruct 34 35 35 36 #endif // LABEL_GENERATOR_H 36 37 37 /*38 Local Variables:39 mode: c++40 End:41 */42 38 // Local Variables: // 43 39 // tab-width: 4 //
Note: See TracChangeset
for help on using the changeset viewer.