diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-05 21:05:54 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-05 21:05:54 +0000 |
commit | d2564e3afb1d9fe42c4b092dfd0bcf472aa535e1 (patch) | |
tree | 779af716dfcdb72a3855bb1da70efb9a50da01d5 /llvm/lib/VMCore/ConstantFold.cpp | |
parent | fd7e42b65d7bd07eb956f2605216b9b3419263a9 (diff) | |
download | bcm5719-llvm-d2564e3afb1d9fe42c4b092dfd0bcf472aa535e1.tar.gz bcm5719-llvm-d2564e3afb1d9fe42c4b092dfd0bcf472aa535e1.zip |
Move remaining stuff to the isInteger predicate.
llvm-svn: 92771
Diffstat (limited to 'llvm/lib/VMCore/ConstantFold.cpp')
-rw-r--r-- | llvm/lib/VMCore/ConstantFold.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/VMCore/ConstantFold.cpp b/llvm/lib/VMCore/ConstantFold.cpp index 87220dee08a..3a24389134e 100644 --- a/llvm/lib/VMCore/ConstantFold.cpp +++ b/llvm/lib/VMCore/ConstantFold.cpp @@ -1229,10 +1229,10 @@ static int IdxCompare(LLVMContext &Context, Constant *C1, Constant *C2, // Ok, we have two differing integer indices. Sign extend them to be the same // type. Long is always big enough, so we use it. - if (C1->getType() != Type::getInt64Ty(Context)) + if (!C1->getType()->isInteger(64)) C1 = ConstantExpr::getSExt(C1, Type::getInt64Ty(Context)); - if (C2->getType() != Type::getInt64Ty(Context)) + if (!C2->getType()->isInteger(64)) C2 = ConstantExpr::getSExt(C2, Type::getInt64Ty(Context)); if (C1 == C2) return 0; // They are equal @@ -2042,10 +2042,10 @@ Constant *llvm::ConstantFoldGetElementPtr(LLVMContext &Context, // Before adding, extend both operands to i64 to avoid // overflow trouble. - if (PrevIdx->getType() != Type::getInt64Ty(Context)) + if (!PrevIdx->getType()->isInteger(64)) PrevIdx = ConstantExpr::getSExt(PrevIdx, Type::getInt64Ty(Context)); - if (Div->getType() != Type::getInt64Ty(Context)) + if (!Div->getType()->isInteger(64)) Div = ConstantExpr::getSExt(Div, Type::getInt64Ty(Context)); |