source: src/ControlStruct/LabelGenerator.h @ af68f0a

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 af68f0a 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
RevLine 
[51587aa]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//
[af68f0a]7// LabelGenerator.h --
[51587aa]8//
[843054c2]9// Author           : Rodolfo G. Esteves
[51587aa]10// Created On       : Mon May 18 07:44:20 2015
[27de955]11// Last Modified By : Rob Schluntz
12// Last Modified On : Wed Jun 03 14:16:26 2015
13// Update Count     : 5
[51587aa]14//
[a08ba92]15
[51b7345]16#ifndef LABEL_GENERATOR_H
17#define LABEL_GENERATOR_H
18
19#include "SynTree/SynTree.h"
[27de955]20#include <string>
[51b7345]21
22namespace ControlStruct {
[a08ba92]23        class LabelGenerator {
24          public:
25                static LabelGenerator *getGenerator();
[af68f0a]26                Label newLabel(std::string suffix, Statement * stmt = nullptr);
[a08ba92]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        };
[51b7345]35} // namespace ControlStruct
36
[d9a0e76]37#endif // LABEL_GENERATOR_H
[51b7345]38
[51587aa]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.