summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-01-05 21:05:54 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-01-05 21:05:54 +0000
commit8c65f6e71c1d46d823b9a884819992a9255edd54 (patch)
tree8fbef7d34f7ad7c92c4448013b6f60282eb53d14 /lib/ExecutionEngine
parent718bf3f89d69f76791fec73b1edd55c450a93f12 (diff)
downloadllvm-8c65f6e71c1d46d823b9a884819992a9255edd54.tar.gz
llvm-8c65f6e71c1d46d823b9a884819992a9255edd54.tar.bz2
llvm-8c65f6e71c1d46d823b9a884819992a9255edd54.tar.xz
Move remaining stuff to the isInteger predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92771 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/ExecutionEngine.cpp8
-rw-r--r--lib/ExecutionEngine/JIT/JIT.cpp2
2 files changed, 4 insertions, 6 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index 35e69229e7..c466400393 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -356,7 +356,7 @@ int ExecutionEngine::runFunctionAsMain(Function *Fn,
}
// FALLS THROUGH
case 1:
- if (FTy->getParamType(0) != Type::getInt32Ty(Fn->getContext())) {
+ if (!FTy->getParamType(0)->isInteger(32)) {
llvm_report_error("Invalid type for first argument of main() supplied");
}
// FALLS THROUGH
@@ -618,13 +618,11 @@ GenericValue ExecutionEngine::getConstantValue(const Constant *C) {
GV.DoubleVal = GV.IntVal.bitsToDouble();
break;
case Type::FloatTyID:
- assert(DestTy == Type::getInt32Ty(DestTy->getContext()) &&
- "Invalid bitcast");
+ assert(DestTy->isInteger(32) && "Invalid bitcast");
GV.IntVal.floatToBits(GV.FloatVal);
break;
case Type::DoubleTyID:
- assert(DestTy == Type::getInt64Ty(DestTy->getContext()) &&
- "Invalid bitcast");
+ assert(DestTy->isInteger(64) && "Invalid bitcast");
GV.IntVal.doubleToBits(GV.DoubleVal);
break;
case Type::PointerTyID:
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp
index f8165ce223..faf724fa85 100644
--- a/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/lib/ExecutionEngine/JIT/JIT.cpp
@@ -411,7 +411,7 @@ GenericValue JIT::runFunction(Function *F,
// Handle some common cases first. These cases correspond to common `main'
// prototypes.
- if (RetTy == Type::getInt32Ty(F->getContext()) || RetTy->isVoidTy()) {
+ if (RetTy->isInteger(32) || RetTy->isVoidTy()) {
switch (ArgValues.size()) {
case 3:
if (FTy->getParamType(0)->isInteger(32) &&