For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.
llvm-svn: 33073
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 236ec4b..f3d6ca8 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -173,11 +173,11 @@
BasicBlock *Dest1 = cast<BasicBlock>(BI->getOperand(0));
BasicBlock *Dest2 = cast<BasicBlock>(BI->getOperand(1));
- if (ConstantBool *Cond = dyn_cast<ConstantBool>(BI->getCondition())) {
+ if (ConstantInt *Cond = dyn_cast<ConstantInt>(BI->getCondition())) {
// Are we branching on constant?
// YES. Change to unconditional branch...
- BasicBlock *Destination = Cond->getValue() ? Dest1 : Dest2;
- BasicBlock *OldDest = Cond->getValue() ? Dest2 : Dest1;
+ BasicBlock *Destination = Cond->getBoolValue() ? Dest1 : Dest2;
+ BasicBlock *OldDest = Cond->getBoolValue() ? Dest2 : Dest1;
//cerr << "Function: " << T->getParent()->getParent()
// << "\nRemoving branch from " << T->getParent()