ADT
ast-experimental
enum
forall-pointer-decay
pthread-emulation
qualifiedEnum
Last change
on this file since 3a4732f was de31a1d, checked in by Andrew Beach <ajbeach@…>, 4 years ago |
Converted the two LabelGenerator singletons into a single pure-static class.
|
-
Property mode
set to
100644
|
File size:
1.1 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 : Andrew Beach
|
---|
12 | // Last Modified On : Mon Nov 8 10:16:00 2021
|
---|
13 | // Update Count : 8
|
---|
14 | //
|
---|
15 |
|
---|
16 | #pragma once
|
---|
17 |
|
---|
18 | #include <string> // for string
|
---|
19 |
|
---|
20 | #include "SynTree/Label.h" // for Label
|
---|
21 |
|
---|
22 | class Statement;
|
---|
23 | namespace ast {
|
---|
24 | class Stmt;
|
---|
25 | class Label;
|
---|
26 | }
|
---|
27 |
|
---|
28 | namespace ControlStruct {
|
---|
29 |
|
---|
30 | class LabelGenerator {
|
---|
31 | static int current;
|
---|
32 | static LabelGenerator *labelGenerator;
|
---|
33 | protected:
|
---|
34 | LabelGenerator() {}
|
---|
35 | public:
|
---|
36 | static LabelGenerator *getGenerator();
|
---|
37 | static Label newLabel(std::string suffix, Statement * stmt = nullptr);
|
---|
38 | static ast::Label newLabel( const std::string&, const ast::Stmt * );
|
---|
39 | static void reset() { current = 0; }
|
---|
40 | static void rewind() { current--; }
|
---|
41 | };
|
---|
42 |
|
---|
43 | } // namespace ControlStruct
|
---|
44 |
|
---|
45 | // Local Variables: //
|
---|
46 | // tab-width: 4 //
|
---|
47 | // mode: c++ //
|
---|
48 | // compile-command: "make install" //
|
---|
49 | // End: //
|
---|
Note:
See
TracBrowser
for help on using the repository browser.