Ignore:
Timestamp:
Apr 5, 2017, 6:07:58 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
c51b5a3
Parents:
fbd7ad6
Message:

change all break/continue statements into goto for consistency and fix bug with labeled break

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/LabelGenerator.cc

    rfbd7ad6 raf68f0a  
    2020#include "SynTree/Label.h"
    2121#include "SynTree/Attribute.h"
     22#include "SynTree/Statement.h"
    2223
    2324namespace ControlStruct {
     
    3132        }
    3233
    33         Label LabelGenerator::newLabel( std::string suffix ) {
     34        Label LabelGenerator::newLabel( std::string suffix, Statement * stmt ) {
    3435                std::ostringstream os;
    3536                os << "__L" << current++ << "__" << suffix;
     37                if ( stmt && ! stmt->get_labels().empty() ) {
     38                        os << "_" << stmt->get_labels().front() << "__";
     39                }
    3640                std::string ret = os.str();
    3741                Label l( ret );
Note: See TracChangeset for help on using the changeset viewer.