aboutsummaryrefslogtreecommitdiff
path: root/src/relooper/Relooper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/relooper/Relooper.cpp')
-rw-r--r--src/relooper/Relooper.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/relooper/Relooper.cpp b/src/relooper/Relooper.cpp
index ae8577b1..6ea9e7f4 100644
--- a/src/relooper/Relooper.cpp
+++ b/src/relooper/Relooper.cpp
@@ -253,20 +253,11 @@ int Shape::IdCounter = 0;
void MultipleShape::RenderLoopPrefix() {
if (NeedLoop) {
- if (Labeled) {
- PrintIndented("L%d: do {\n", Id);
- } else {
- PrintIndented("do {\n");
- }
- Indenter::Indent();
+ PrintIndented("L%d: \n", Id);
}
}
void MultipleShape::RenderLoopPostfix() {
- if (NeedLoop) {
- Indenter::Unindent();
- PrintIndented("} while(0);\n");
- }
}
void MultipleShape::Render(bool InLoop) {
@@ -921,7 +912,10 @@ void Relooper::Calculate(Block *Entry) {
Branch *Details = iter->second;
if (Details->Type != Branch::Direct) {
assert(LoopStack.size() > 0);
- if (Details->Ancestor != LoopStack.top()) {
+ // If the ancestor is not at the top of the stack, we need a labelled break. We also
+ // always need a labeled break for multiple blocks, which are always labeled.
+ MultipleShape *Multiple;
+ if (Details->Ancestor != LoopStack.top() || Shape::IsMultiple(Details->Ancestor)) {
LabeledShape *Labeled = Shape::IsLabeled(Details->Ancestor);
Labeled->Labeled = true;
Details->Labeled = true;