diff options
author | Chris Lattner <sabre@nondot.org> | 2004-01-12 19:12:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-01-12 19:12:50 +0000 |
commit | c9fb4a3b89127660e38ec28801e4c735342d6786 (patch) | |
tree | 725378aa201bf6642edd90c9b92ab205d28c88bf /llvm/lib/Transforms | |
parent | 429963742e21924e92a65ba2cc3f9f8ef5bbf41a (diff) | |
download | bcm5719-llvm-c9fb4a3b89127660e38ec28801e4c735342d6786.tar.gz bcm5719-llvm-c9fb4a3b89127660e38ec28801e4c735342d6786.zip |
Remove use of the ConstantHandling interfaces
llvm-svn: 10793
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp b/llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp index f0c4071580d..d9e96485fc4 100644 --- a/llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp +++ b/llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp @@ -27,10 +27,11 @@ //===----------------------------------------------------------------------===// #include "llvm/Transforms/Scalar.h" +#include "llvm/Constants.h" #include "llvm/Pass.h" #include "llvm/Function.h" #include "llvm/Instructions.h" -#include "llvm/ConstantHandling.h" +#include "llvm/Type.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Assembly/Writer.h" #include "llvm/Transforms/Utils/Local.h" @@ -1129,20 +1130,10 @@ static bool CheckCondition(Constant *Bound, Constant *C, assert(C != 0 && "C is not specified!"); if (Bound == 0) return false; - ConstantBool *Val; - switch (BO) { - default: assert(0 && "Unknown Condition code!"); - case Instruction::SetEQ: Val = *Bound == *C; break; - case Instruction::SetNE: Val = *Bound != *C; break; - case Instruction::SetLT: Val = *Bound < *C; break; - case Instruction::SetGT: Val = *Bound > *C; break; - case Instruction::SetLE: Val = *Bound <= *C; break; - case Instruction::SetGE: Val = *Bound >= *C; break; - } - - // ConstantHandling code may not succeed in the comparison... - if (Val == 0) return false; - return !Val->getValue(); // Return true if the condition is false... + Constant *Val = ConstantExpr::get(BO, Bound, C); + if (ConstantBool *CB = dyn_cast<ConstantBool>(Val)) + return !CB->getValue(); // Return true if the condition is false... + return false; } // contradicts - Return true if the relationship specified by the operand |