summaryrefslogtreecommitdiffstats
path: root/clang/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
commita0c0d88ba8b088aa6551f8f64fdf8cbb51c4df15 (patch)
tree2fde3745f2665f7246d870ad7a9b9f65fad516fc /clang/lib/CodeGen/CodeGenFunction.cpp
parent0d025421cd6a89bb355136ce9700d391fa7b3c9c (diff)
downloadbcm5719-llvm-a0c0d88ba8b088aa6551f8f64fdf8cbb51c4df15.tar.gz
bcm5719-llvm-a0c0d88ba8b088aa6551f8f64fdf8cbb51c4df15.zip
factor a creation of Int32Ty.
llvm-svn: 85422
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index ba93e5d0ebc..c6111fac197 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/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),
OpenPOWER on IntegriCloud