Let TargetABI::passByValue() know when a parameter is byref (either explicitly

or because it's a static array) by giving it the pointer type instead of the
type itself.
This fixes Derelict compilation on x86-64, where the ABI wasn't expecting a
static array to be passed in at all.
This commit is contained in:
Frits van Bommel
2009-05-22 00:19:54 +02:00
parent d537ad0d48
commit 2739cd108c

View File

@@ -145,7 +145,7 @@ const llvm::FunctionType* DtoFunctionType(Type* type, Type* thistype, Type* nest
argtype = ltd;
}
// byval
else if (abi->passByVal(argtype))
else if (abi->passByVal(byref ? argtype->pointerTo() : argtype))
{
if (!byref) a |= llvm::Attribute::ByVal;
byref = true;