source: src/ControlStruct/LabelGenerator.cc@ 74d1804

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 with_gc
Last change on this file since 74d1804 was de62360d, checked in by Peter A. Buhr <pabuhr@…>, 10 years ago

fix computed goto, fixed -std=, implicit typedefs for enum and aggregates, add _Noreturn _Thread_local

  • Property mode set to 100644
File size: 1.1 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//
[a08ba92]7// LabelGenerator.cc --
[51587aa]8//
[843054c2]9// Author : Rodolfo G. Esteves
[51587aa]10// Created On : Mon May 18 07:44:20 2015
[5f2f2d7]11// Last Modified By : Peter A. Buhr
[de62360d]12// Last Modified On : Tue Jun 23 12:18:34 2015
13// Update Count : 13
[51587aa]14//
[a08ba92]15
[51b73452]16#include <iostream>
[5f2f2d7]17#include <sstream>
[51b73452]18
19#include "LabelGenerator.h"
20
21namespace ControlStruct {
[a08ba92]22 LabelGenerator *LabelGenerator::labelGenerator = 0;
[51b73452]23
[a08ba92]24 LabelGenerator *LabelGenerator::getGenerator() {
25 if ( LabelGenerator::labelGenerator == 0 )
26 LabelGenerator::labelGenerator = new LabelGenerator();
[51b73452]27
[a08ba92]28 return labelGenerator;
29 }
[51b73452]30
[de62360d]31 Label LabelGenerator::newLabel( std::string suffix ) {
[5f2f2d7]32 std::ostringstream os;
[27de955]33 os << "__L" << current++ << "__" << suffix;
[5f2f2d7]34 std::string ret = os.str();
[a08ba92]35 return Label( ret );
36 }
[51b73452]37} // namespace ControlStruct
[a08ba92]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.