summaryrefslogtreecommitdiff
path: root/lib/VMCore/ConstantFold.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-01-11 18:21:29 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-01-11 18:21:29 +0000
commit4fe16d607d11e29d742208894909733f5ad01f8f (patch)
treea669ba57373e87d31c3af6f301fe4a61f773f4b3 /lib/VMCore/ConstantFold.cpp
parent34dceb47573b0aedd188b5e72bb848ba29a4960f (diff)
downloadllvm-4fe16d607d11e29d742208894909733f5ad01f8f.tar.gz
llvm-4fe16d607d11e29d742208894909733f5ad01f8f.tar.bz2
llvm-4fe16d607d11e29d742208894909733f5ad01f8f.tar.xz
Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r--lib/VMCore/ConstantFold.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp
index 3fdd579546..85e5992dcf 100644
--- a/lib/VMCore/ConstantFold.cpp
+++ b/lib/VMCore/ConstantFold.cpp
@@ -317,7 +317,7 @@ Constant *llvm::ConstantFoldSelectInstruction(const Constant *Cond,
const Constant *V1,
const Constant *V2) {
if (const ConstantInt *CB = dyn_cast<ConstantInt>(Cond))
- if (CB->getType() == Type::BoolTy)
+ if (CB->getType() == Type::Int1Ty)
return const_cast<Constant*>(CB->getBoolValue() ? V1 : V2);
if (isa<UndefValue>(V1)) return const_cast<Constant*>(V2);
@@ -555,7 +555,7 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode,
// so look at directly computing the value.
if (const ConstantInt *CI1 = dyn_cast<ConstantInt>(C1)) {
if (const ConstantInt *CI2 = dyn_cast<ConstantInt>(C2)) {
- if (CI1->getType() == Type::BoolTy && CI2->getType() == Type::BoolTy) {
+ if (CI1->getType() == Type::Int1Ty && CI2->getType() == Type::Int1Ty) {
switch (Opcode) {
default:
break;
@@ -1037,7 +1037,7 @@ Constant *llvm::ConstantFoldCompareInstruction(unsigned short pred,
// Handle some degenerate cases first
if (isa<UndefValue>(C1) || isa<UndefValue>(C2))
- return UndefValue::get(Type::BoolTy);
+ return UndefValue::get(Type::Int1Ty);
// icmp eq/ne(null,GV) -> false/true
if (C1->isNullValue()) {
@@ -1058,7 +1058,7 @@ Constant *llvm::ConstantFoldCompareInstruction(unsigned short pred,
}
if (isa<ConstantInt>(C1) && isa<ConstantInt>(C2) &&
- C1->getType() == Type::BoolTy && C2->getType() == Type::BoolTy) {
+ C1->getType() == Type::Int1Ty && C2->getType() == Type::Int1Ty) {
bool C1Val = cast<ConstantInt>(C1)->getBoolValue();
bool C2Val = cast<ConstantInt>(C2)->getBoolValue();
switch (pred) {