mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-18 12:29:27 +00:00
Remove use of the ConstantHandling interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10793 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c6646ebdb9
commit
5585b335e5
@ -27,10 +27,11 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "llvm/Transforms/Scalar.h"
|
#include "llvm/Transforms/Scalar.h"
|
||||||
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
#include "llvm/Instructions.h"
|
#include "llvm/Instructions.h"
|
||||||
#include "llvm/ConstantHandling.h"
|
#include "llvm/Type.h"
|
||||||
#include "llvm/Analysis/Dominators.h"
|
#include "llvm/Analysis/Dominators.h"
|
||||||
#include "llvm/Assembly/Writer.h"
|
#include "llvm/Assembly/Writer.h"
|
||||||
#include "llvm/Transforms/Utils/Local.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!");
|
assert(C != 0 && "C is not specified!");
|
||||||
if (Bound == 0) return false;
|
if (Bound == 0) return false;
|
||||||
|
|
||||||
ConstantBool *Val;
|
Constant *Val = ConstantExpr::get(BO, Bound, C);
|
||||||
switch (BO) {
|
if (ConstantBool *CB = dyn_cast<ConstantBool>(Val))
|
||||||
default: assert(0 && "Unknown Condition code!");
|
return !CB->getValue(); // Return true if the condition is false...
|
||||||
case Instruction::SetEQ: Val = *Bound == *C; break;
|
return false;
|
||||||
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...
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// contradicts - Return true if the relationship specified by the operand
|
// contradicts - Return true if the relationship specified by the operand
|
||||||
|
Loading…
Reference in New Issue
Block a user