source: src/ControlStruct/LabelGenerator.h @ b510ac2

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since b510ac2 was af68f0a, checked in by Rob Schluntz <rschlunt@…>, 7 years ago

change all break/continue statements into goto for consistency and fix bug with labeled break

  • Property mode set to 100644
File size: 1.0 KB
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// LabelGenerator.h --
8//
9// Author           : Rodolfo G. Esteves
10// Created On       : Mon May 18 07:44:20 2015
11// Last Modified By : Rob Schluntz
12// Last Modified On : Wed Jun 03 14:16:26 2015
13// Update Count     : 5
14//
15
16#ifndef LABEL_GENERATOR_H
17#define LABEL_GENERATOR_H
18
19#include "SynTree/SynTree.h"
20#include <string>
21
22namespace ControlStruct {
23        class LabelGenerator {
24          public:
25                static LabelGenerator *getGenerator();
26                Label newLabel(std::string suffix, Statement * stmt = nullptr);
27                void reset() { current = 0; }
28                void rewind() { current--; }
29          protected:
30                LabelGenerator(): current(0) {}
31          private:
32                int current;
33                static LabelGenerator *labelGenerator;
34        };
35} // namespace ControlStruct
36
37#endif // LABEL_GENERATOR_H
38
39// Local Variables: //
40// tab-width: 4 //
41// mode: c++ //
42// compile-command: "make install" //
43// End: //
Note: See TracBrowser for help on using the repository browser.