Ignore:
Timestamp:
Nov 5, 2021, 1:46:46 PM (3 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
21fe17f
Parents:
77c01ec
Message:

Fix Labels pass translated. This is fix label, mult-level exit and label generator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/LabelGenerator.h

    r77c01ec rb8ab91a  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 22 09:20:14 2017
    13 // Update Count     : 6
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Mon Nov  1 12:19:00 2021
     13// Update Count     : 7
    1414//
    1515
     
    2121
    2222class Statement;
     23namespace ast {
     24        class Stmt;
     25        class Label;
     26}
    2327
    2428namespace ControlStruct {
     
    3539                static LabelGenerator *labelGenerator;
    3640        };
     41
     42class LabelGenerator_new {
     43        int current;
     44        static LabelGenerator_new *labelGenerator;
     45
     46        LabelGenerator_new() : current(0) {}
     47public:
     48        static LabelGenerator_new *getGenerator();
     49
     50        ast::Label newLabel( const std::string& suffix, const ast::Stmt * stmt );
     51        void reset() { current = 0; }
     52        void rewind() { --current; }
     53};
     54
    3755} // namespace ControlStruct
    3856
Note: See TracChangeset for help on using the changeset viewer.