[llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JIT.cpp JITEmitter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Jun 1 10:29:35 PDT 2006
Changes in directory llvm/lib/ExecutionEngine/JIT:
JIT.cpp updated: 1.66 -> 1.67
JITEmitter.cpp updated: 1.102 -> 1.103
---
Log message:
Fix -pedantic warnings.
---
Diffs of the changes: (+14 -14)
JIT.cpp | 22 +++++++++++-----------
JITEmitter.cpp | 6 +++---
2 files changed, 14 insertions(+), 14 deletions(-)
Index: llvm/lib/ExecutionEngine/JIT/JIT.cpp
diff -u llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.66 llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.67
--- llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.66 Fri May 12 01:33:48 2006
+++ llvm/lib/ExecutionEngine/JIT/JIT.cpp Thu Jun 1 12:29:22 2006
@@ -94,7 +94,7 @@
isa<PointerType>(FTy->getParamType(1)) &&
isa<PointerType>(FTy->getParamType(2))) {
int (*PF)(int, char **, const char **) =
- (int(*)(int, char **, const char **))FPtr;
+ (int(*)(int, char **, const char **))(intptr_t)FPtr;
// Call the function.
GenericValue rv;
@@ -107,7 +107,7 @@
if ((FTy->getParamType(0) == Type::IntTy ||
FTy->getParamType(0) == Type::UIntTy) &&
isa<PointerType>(FTy->getParamType(1))) {
- int (*PF)(int, char **) = (int(*)(int, char **))FPtr;
+ int (*PF)(int, char **) = (int(*)(int, char **))(intptr_t)FPtr;
// Call the function.
GenericValue rv;
@@ -120,7 +120,7 @@
(FTy->getParamType(0) == Type::IntTy ||
FTy->getParamType(0) == Type::UIntTy)) {
GenericValue rv;
- int (*PF)(int) = (int(*)(int))FPtr;
+ int (*PF)(int) = (int(*)(int))(intptr_t)FPtr;
rv.IntVal = PF(ArgValues[0].IntVal);
return rv;
}
@@ -134,33 +134,33 @@
switch (RetTy->getTypeID()) {
default: assert(0 && "Unknown return type for function call!");
case Type::BoolTyID:
- rv.BoolVal = ((bool(*)())FPtr)();
+ rv.BoolVal = ((bool(*)())(intptr_t)FPtr)();
return rv;
case Type::SByteTyID:
case Type::UByteTyID:
- rv.SByteVal = ((char(*)())FPtr)();
+ rv.SByteVal = ((char(*)())(intptr_t)FPtr)();
return rv;
case Type::ShortTyID:
case Type::UShortTyID:
- rv.ShortVal = ((short(*)())FPtr)();
+ rv.ShortVal = ((short(*)())(intptr_t)FPtr)();
return rv;
case Type::VoidTyID:
case Type::IntTyID:
case Type::UIntTyID:
- rv.IntVal = ((int(*)())FPtr)();
+ rv.IntVal = ((int(*)())(intptr_t)FPtr)();
return rv;
case Type::LongTyID:
case Type::ULongTyID:
- rv.LongVal = ((int64_t(*)())FPtr)();
+ rv.LongVal = ((int64_t(*)())(intptr_t)FPtr)();
return rv;
case Type::FloatTyID:
- rv.FloatVal = ((float(*)())FPtr)();
+ rv.FloatVal = ((float(*)())(intptr_t)FPtr)();
return rv;
case Type::DoubleTyID:
- rv.DoubleVal = ((double(*)())FPtr)();
+ rv.DoubleVal = ((double(*)())(intptr_t)FPtr)();
return rv;
case Type::PointerTyID:
- return PTOGV(((void*(*)())FPtr)());
+ return PTOGV(((void*(*)())(intptr_t)FPtr)());
}
}
Index: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
diff -u llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.102 llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.103
--- llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.102 Tue May 16 01:45:50 2006
+++ llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp Thu Jun 1 12:29:22 2006
@@ -494,7 +494,7 @@
MutexGuard locked(TheJIT->lock);
/// Get the target-specific JIT resolver function.
state.getStubToFunctionMap(locked)[Location] = F;
- return (void*)LazyResolverFn;
+ return (void*)(intptr_t)LazyResolverFn;
}
/// getGOTIndexForAddress - Return a new or existing index in the GOT for
@@ -527,7 +527,7 @@
// Call the lazy resolver function unless we already KNOW it is an external
// function, in which case we just skip the lazy resolution step.
- void *Actual = (void*)LazyResolverFn;
+ void *Actual = (void*)(intptr_t)LazyResolverFn;
if (F->isExternal() && F->hasExternalLinkage())
Actual = TheJIT->getPointerToFunction(F);
@@ -535,7 +535,7 @@
// resolver function.
Stub = TheJIT->getJITInfo().emitFunctionStub(Actual, MCE);
- if (Actual != (void*)LazyResolverFn) {
+ if (Actual != (void*)(intptr_t)LazyResolverFn) {
// If we are getting the stub for an external function, we really want the
// address of the stub in the GlobalAddressMap for the JIT, not the address
// of the external function.
More information about the llvm-commits
mailing list