aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-02-04 12:48:33 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-02-04 12:48:33 -0800
commitcaf592912e7834c2024438c7d2feb9bf6a37adbd (patch)
treebd2a9673aac0d108154f2a3cccb9a34093151476
parent5535dcad8cdca9c6ad949e4e2df8a5ee9919b3a2 (diff)
revert 73313a7ef6ab384a3130e50f4904b8ae232cf4a5 - stop labeling ifs in relooper due to speed concerns
-rw-r--r--src/relooper/Relooper.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/relooper/Relooper.cpp b/src/relooper/Relooper.cpp
index 6ea9e7f4..ae8577b1 100644
--- a/src/relooper/Relooper.cpp
+++ b/src/relooper/Relooper.cpp
@@ -253,11 +253,20 @@ int Shape::IdCounter = 0;
void MultipleShape::RenderLoopPrefix() {
if (NeedLoop) {
- PrintIndented("L%d: \n", Id);
+ if (Labeled) {
+ PrintIndented("L%d: do {\n", Id);
+ } else {
+ PrintIndented("do {\n");
+ }
+ Indenter::Indent();
}
}
void MultipleShape::RenderLoopPostfix() {
+ if (NeedLoop) {
+ Indenter::Unindent();
+ PrintIndented("} while(0);\n");
+ }
}
void MultipleShape::Render(bool InLoop) {
@@ -912,10 +921,7 @@ void Relooper::Calculate(Block *Entry) {
Branch *Details = iter->second;
if (Details->Type != Branch::Direct) {
assert(LoopStack.size() > 0);
- // 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)) {
+ if (Details->Ancestor != LoopStack.top()) {
LabeledShape *Labeled = Shape::IsLabeled(Details->Ancestor);
Labeled->Labeled = true;
Details->Labeled = true;