changeset 298:3b8ada4c9f8b trunk

[svn r319] Call substatement->toIR in LabelStatement::toIR even when the label is inside an asm block.
author ChristianK
date Tue, 24 Jun 2008 17:24:55 +0200
parents 5de180867c46
children df8a7b8d5929
files gen/statements.cpp
diffstat 1 files changed, 16 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/gen/statements.cpp	Mon Jun 23 19:19:37 2008 +0200
+++ b/gen/statements.cpp	Tue Jun 24 17:24:55 2008 +0200
@@ -1070,21 +1070,24 @@
         a->code += ident->toChars();
         a->code += ":";
         p->asmBlock->s.push_back(a);
-        return;
+    }
+    else
+    {
+        
+        assert(tf == NULL);
+        
+        llvm::BasicBlock* oldend = gIR->scopeend();
+        if (llvmBB)
+                llvmBB->moveBefore(oldend);
+        else
+                llvmBB = llvm::BasicBlock::Create("label", p->topfunc(), oldend);
+        
+        if (!p->scopereturned())
+                llvm::BranchInst::Create(llvmBB, p->scopebb());
+        
+        p->scope() = IRScope(llvmBB,oldend);
     }
 
-    assert(tf == NULL);
-
-    llvm::BasicBlock* oldend = gIR->scopeend();
-    if (llvmBB)
-        llvmBB->moveBefore(oldend);
-    else
-        llvmBB = llvm::BasicBlock::Create("label", p->topfunc(), oldend);
-
-    if (!p->scopereturned())
-        llvm::BranchInst::Create(llvmBB, p->scopebb());
-
-    p->scope() = IRScope(llvmBB,oldend);
     if (statement)
         statement->toIR(p);
 }