source: translator/ControlStruct/LabelGenerator.cc @ d11f789

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change on this file since d11f789 was 51b7345, checked in by Peter A. Buhr <pabuhr@…>, 10 years ago

initial commit

  • Property mode set to 100644
File size: 602 bytes
RevLine 
[51b7345]1#include <iostream>
2#include <strstream>
3
4#include "LabelGenerator.h"
5
6namespace ControlStruct {
7
8  LabelGenerator *LabelGenerator::labelGenerator = 0;
9
10  LabelGenerator *LabelGenerator::getGenerator() {
11    if ( LabelGenerator::labelGenerator == 0 )
12      LabelGenerator::labelGenerator = new LabelGenerator();
13
14    return labelGenerator;
15  }
16
17  Label LabelGenerator::newLabel() {
18    std::ostrstream os;
19    os << "__L" << current++ << "__";// << std::ends;
20    os.freeze( false );
21    std::string ret = std::string (os.str(), os.pcount());
22    return Label( ret );
23  }
24
25} // namespace ControlStruct
Note: See TracBrowser for help on using the repository browser.