[cfe-commits] r85422 - /cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
Chris Lattner
sabre at nondot.org
Wed Oct 28 13:36:47 PDT 2009
Author: lattner
Date: Wed Oct 28 15:36:47 2009
New Revision: 85422
URL: http://llvm.org/viewvc/llvm-project?rev=85422&view=rev
Log:
factor a creation of Int32Ty.
Modified:
cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=85422&r1=85421&r2=85422&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Wed Oct 28 15:36:47 2009
@@ -496,9 +496,10 @@
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 @@
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),
More information about the cfe-commits
mailing list