Use IndirectByvalRewrite for non-POD args and extern(C++) on Posix (#2728)

Fixing one aspect of issue #2702; not tackling the different destruction
rules yet.
This commit is contained in:
Martin Kinkelin 2018-06-19 20:09:35 +02:00 committed by GitHub
parent f8880c6c38
commit 3ca43c51b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 61 additions and 30 deletions

View file

@ -170,7 +170,7 @@ llvm::FunctionType *DtoFunctionType(Type *type, IrFuncTy &irFty, Type *thistype,
// ref/out
attrs.addDereferenceable(loweredDType->size());
} else {
if (abi->passByVal(loweredDType)) {
if (abi->passByVal(f, loweredDType)) {
// LLVM ByVal parameters are pointers to a copy in the function
// parameters stack. The caller needs to provide a pointer to the
// original argument.