mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Fix -pedantic warnings.
llvm-svn: 28636
This commit is contained in:
parent
50af98a5f2
commit
6838320f46
@ -94,7 +94,7 @@ GenericValue JIT::runFunction(Function *F,
|
||||
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 @@ GenericValue JIT::runFunction(Function *F,
|
||||
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 @@ GenericValue JIT::runFunction(Function *F,
|
||||
(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 @@ GenericValue JIT::runFunction(Function *F,
|
||||
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)());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -494,7 +494,7 @@ namespace {
|
||||
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 @@ void *JITResolver::getFunctionStub(Function *F) {
|
||||
|
||||
// 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 @@ void *JITResolver::getFunctionStub(Function *F) {
|
||||
// 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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user