aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-28 20:36:47 +0000
committerChris Lattner <sabre@nondot.org>2009-10-28 20:36:47 +0000
commit85e74acfcfb0c835a2e6c1adab314e997917039a (patch)
tree85c9e5c44de998f3d79f455e3f1834de1db51ad1 /lib/CodeGen/CodeGenFunction.cpp
parent680a3f3581fe9f17802522eeafa403b9c9dfa34a (diff)
factor a creation of Int32Ty.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85422 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index ba93e5d0eb..c6111fac19 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -496,9 +496,10 @@ llvm::BasicBlock *CodeGenFunction::GetIndirectGotoBlock() {
EmitBlock(createBasicBlock("indirectgoto"));
+ const llvm::IntegerType *Int32Ty = llvm::Type::getInt32Ty(VMContext);
+
// Create the PHI node that indirect gotos will add entries to.
- llvm::Value *DestVal =
- Builder.CreatePHI(llvm::Type::getInt32Ty(VMContext), "indirect.goto.dest");
+ llvm::Value *DestVal = Builder.CreatePHI(Int32Ty, "indirect.goto.dest");
// Create the switch instruction. For now, set the insert block to this block
// which will be fixed as labels are added.
@@ -524,8 +525,6 @@ llvm::BasicBlock *CodeGenFunction::GetIndirectGotoBlock() {
IndirectGotoSwitch->setSuccessor(0,
getBasicBlockForLabel(AddrTakenLabelsByID[0]));
- const llvm::IntegerType *Int32Ty = llvm::Type::getInt32Ty(VMContext);
-
// FIXME: The iteration order of this is nondeterminstic!
for (unsigned i = 1, e = AddrTakenLabelsByID.size(); i != e; ++i)
IndirectGotoSwitch->addCase(llvm::ConstantInt::get(Int32Ty, i+1),