ADT
aaron-thesis
arm-eh
ast-experimental
cleanup-dtors
ctor
deferred_resn
demangler
enum
forall-pointer-decay
gc_noraii
jacob/cs343-translation
jenkins-sandbox
memory
new-ast
new-ast-unique-expr
new-env
no_list
persistent-indexer
pthread-emulation
qualifiedEnum
resolv-new
string
with_gc
Last change
on this file since 643a2e1 was d9a0e76, checked in by Peter A. Buhr <pabuhr@…>, 11 years ago |
remove Parser.old, add -XCFA to driver, copy ptrdiff_t from stddef.h in preclude, remove casts from initialization constants, adjust formatting
|
-
Property mode
set to
100644
|
File size:
588 bytes
|
Line | |
---|
1 | #include <iostream>
|
---|
2 | #include <strstream>
|
---|
3 |
|
---|
4 | #include "LabelGenerator.h"
|
---|
5 |
|
---|
6 | namespace ControlStruct {
|
---|
7 | LabelGenerator *LabelGenerator::labelGenerator = 0;
|
---|
8 |
|
---|
9 | LabelGenerator *LabelGenerator::getGenerator() {
|
---|
10 | if ( LabelGenerator::labelGenerator == 0 )
|
---|
11 | LabelGenerator::labelGenerator = new LabelGenerator();
|
---|
12 |
|
---|
13 | return labelGenerator;
|
---|
14 | }
|
---|
15 |
|
---|
16 | Label LabelGenerator::newLabel() {
|
---|
17 | std::ostrstream os;
|
---|
18 | os << "__L" << current++ << "__";// << std::ends;
|
---|
19 | os.freeze( false );
|
---|
20 | std::string ret = std::string (os.str(), os.pcount());
|
---|
21 | return Label( ret );
|
---|
22 | }
|
---|
23 | } // namespace ControlStruct
|
---|
Note:
See
TracBrowser
for help on using the repository browser.