Mercurial > projects > ldc
diff gen/statements.cpp @ 305:2b72433d5c8c trunk
[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support.
Fixed problems with label collisions when using labels inside inline asm. LabelStatement is now easily reached given its
Identifier, which should be useful elsewhere too.
Enabled inline asm for building the lib/compiler/llvmdc runtime code, fixing branches out of asm makes this possible.
author | lindquist |
---|---|
date | Fri, 27 Jun 2008 22:04:35 +0200 |
parents | 3ebc136702dd |
children | 6b62e8cdf970 |
line wrap: on
line diff
--- a/gen/statements.cpp Wed Jun 25 23:42:38 2008 +0200 +++ b/gen/statements.cpp Fri Jun 27 22:04:35 2008 +0200 @@ -1045,6 +1045,8 @@ if (p->asmBlock) { IRAsmStmt* a = new IRAsmStmt; + a->code += p->func()->decl->mangle(); + a->code += "_"; a->code += ident->toChars(); a->code += ":"; p->asmBlock->s.push_back(a); @@ -1052,18 +1054,17 @@ } 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); } @@ -1086,7 +1087,7 @@ llvm::BasicBlock* oldend = gIR->scopeend(); llvm::BasicBlock* bb = llvm::BasicBlock::Create("aftergoto", p->topfunc(), oldend); - DtoGoto(&loc, label, enclosingtryfinally); + DtoGoto(&loc, label->ident, enclosingtryfinally); p->scope() = IRScope(bb,oldend); }