mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-08 11:37:03 +00:00
Fix ffiInvoke() use of DataLayout, broken in 242414
From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242456 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cb19d4c525
commit
ec56faaa64
@ -198,7 +198,7 @@ static bool ffiInvoke(RawFunc Fn, Function *F, ArrayRef<GenericValue> ArgVals,
|
|||||||
const unsigned ArgNo = A->getArgNo();
|
const unsigned ArgNo = A->getArgNo();
|
||||||
Type *ArgTy = FTy->getParamType(ArgNo);
|
Type *ArgTy = FTy->getParamType(ArgNo);
|
||||||
args[ArgNo] = ffiTypeFor(ArgTy);
|
args[ArgNo] = ffiTypeFor(ArgTy);
|
||||||
ArgBytes += TD->getTypeStoreSize(ArgTy);
|
ArgBytes += TD.getTypeStoreSize(ArgTy);
|
||||||
}
|
}
|
||||||
|
|
||||||
SmallVector<uint8_t, 128> ArgData;
|
SmallVector<uint8_t, 128> ArgData;
|
||||||
@ -210,7 +210,7 @@ static bool ffiInvoke(RawFunc Fn, Function *F, ArrayRef<GenericValue> ArgVals,
|
|||||||
const unsigned ArgNo = A->getArgNo();
|
const unsigned ArgNo = A->getArgNo();
|
||||||
Type *ArgTy = FTy->getParamType(ArgNo);
|
Type *ArgTy = FTy->getParamType(ArgNo);
|
||||||
values[ArgNo] = ffiValueFor(ArgTy, ArgVals[ArgNo], ArgDataPtr);
|
values[ArgNo] = ffiValueFor(ArgTy, ArgVals[ArgNo], ArgDataPtr);
|
||||||
ArgDataPtr += TD->getTypeStoreSize(ArgTy);
|
ArgDataPtr += TD.getTypeStoreSize(ArgTy);
|
||||||
}
|
}
|
||||||
|
|
||||||
Type *RetTy = FTy->getReturnType();
|
Type *RetTy = FTy->getReturnType();
|
||||||
@ -219,7 +219,7 @@ static bool ffiInvoke(RawFunc Fn, Function *F, ArrayRef<GenericValue> ArgVals,
|
|||||||
if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, NumArgs, rtype, &args[0]) == FFI_OK) {
|
if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, NumArgs, rtype, &args[0]) == FFI_OK) {
|
||||||
SmallVector<uint8_t, 128> ret;
|
SmallVector<uint8_t, 128> ret;
|
||||||
if (RetTy->getTypeID() != Type::VoidTyID)
|
if (RetTy->getTypeID() != Type::VoidTyID)
|
||||||
ret.resize(TD->getTypeStoreSize(RetTy));
|
ret.resize(TD.getTypeStoreSize(RetTy));
|
||||||
ffi_call(&cif, Fn, ret.data(), values.data());
|
ffi_call(&cif, Fn, ret.data(), values.data());
|
||||||
switch (RetTy->getTypeID()) {
|
switch (RetTy->getTypeID()) {
|
||||||
case Type::IntegerTyID:
|
case Type::IntegerTyID:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user