comparison gen/statements.cpp @ 980:ae710cba0884

Clean up the code generated when jumping out of inline asm and make label names more expressive.
author Frits van Bommel <fvbommel wxs.nl>
date Wed, 18 Feb 2009 22:50:22 +0100
parents fe93215deb82
children 2667e3a145be
comparison
equal deleted inserted replaced
979:523bf4f166bc 980:ae710cba0884
1222 std::string labelname = p->func()->getScopedLabelName(ident->toChars()); 1222 std::string labelname = p->func()->getScopedLabelName(ident->toChars());
1223 llvm::BasicBlock*& labelBB = p->func()->labelToBB[labelname]; 1223 llvm::BasicBlock*& labelBB = p->func()->labelToBB[labelname];
1224 1224
1225 llvm::BasicBlock* oldend = gIR->scopeend(); 1225 llvm::BasicBlock* oldend = gIR->scopeend();
1226 if (labelBB != NULL) { 1226 if (labelBB != NULL) {
1227 labelBB->moveBefore(oldend); 1227 labelBB->moveBefore(oldend);
1228 } else { 1228 } else {
1229 labelBB = llvm::BasicBlock::Create("label", p->topfunc(), oldend); 1229 labelBB = llvm::BasicBlock::Create("label_" + labelname, p->topfunc(), oldend);
1230 } 1230 }
1231 1231
1232 if (!p->scopereturned()) 1232 if (!p->scopereturned())
1233 llvm::BranchInst::Create(labelBB, p->scopebb()); 1233 llvm::BranchInst::Create(labelBB, p->scopebb());
1234 1234
1235 p->scope() = IRScope(labelBB,oldend); 1235 p->scope() = IRScope(labelBB,oldend);
1236 } 1236 }
1237 1237
1238 if (statement) 1238 if (statement)