aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-11-11 02:29:29 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-11-11 02:29:29 +0000
commit55e874299f2ad827646a4ca9ea38c402aaeb38c9 (patch)
treed9cb06d4f8c89486868bb6ac941c120e86f99917 /lib/CodeGen/CodeGenFunction.cpp
parentd2f016f8f27db0820c46fbfbf2bcc0825f3a4284 (diff)
Centralize basic block creation in CodeGenFunction::createBasicBlock.
- No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59017 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index c4a3324561..f66c6ea861 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -38,7 +38,7 @@ llvm::BasicBlock *CodeGenFunction::getBasicBlockForLabel(const LabelStmt *S) {
if (BB) return BB;
// Create, but don't insert, the new block.
- return BB = llvm::BasicBlock::Create(S->getName());
+ return BB = createBasicBlock(S->getName());
}
llvm::Constant *
@@ -98,7 +98,7 @@ void CodeGenFunction::StartFunction(const Decl *D, QualType RetTy,
CurFn = Fn;
assert(CurFn->isDeclaration() && "Function already has body?");
- llvm::BasicBlock *EntryBB = llvm::BasicBlock::Create("entry", CurFn);
+ llvm::BasicBlock *EntryBB = createBasicBlock("entry", CurFn);
// Create a marker to make it easy to insert allocas into the entryblock
// later. Don't create this with the builder, because we don't want it
@@ -107,7 +107,7 @@ void CodeGenFunction::StartFunction(const Decl *D, QualType RetTy,
AllocaInsertPt = new llvm::BitCastInst(Undef, llvm::Type::Int32Ty, "allocapt",
EntryBB);
- ReturnBlock = llvm::BasicBlock::Create("return");
+ ReturnBlock = createBasicBlock("return");
ReturnValue = 0;
if (!RetTy->isVoidType())
ReturnValue = CreateTempAlloca(ConvertType(RetTy), "retval");
@@ -168,7 +168,7 @@ bool CodeGenFunction::isDummyBlock(const llvm::BasicBlock *BB) {
void CodeGenFunction::StartBlock(const char *N) {
llvm::BasicBlock *BB = Builder.GetInsertBlock();
if (!isDummyBlock(BB))
- EmitBlock(llvm::BasicBlock::Create(N));
+ EmitBlock(createBasicBlock(N));
else
BB->setName(N);
}
@@ -225,7 +225,7 @@ void CodeGenFunction::EmitIndirectSwitches() {
} else {
// No possible targets for indirect goto, just emit an infinite
// loop.
- Default = llvm::BasicBlock::Create("indirectgoto.loop", CurFn);
+ Default = createBasicBlock("indirectgoto.loop", CurFn);
llvm::BranchInst::Create(Default, Default);
}