mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-09-25 14:50:18 +02:00
Fixed passing of structs and static arrays into functions.
Not sure if it is correct, though.
This commit is contained in:
+4
-1
@@ -752,8 +752,11 @@ void DtoDefineFunction(FuncDeclaration* fd)
|
|||||||
|
|
||||||
bool refout = vd->storage_class & (STCref | STCout);
|
bool refout = vd->storage_class & (STCref | STCout);
|
||||||
bool lazy = vd->storage_class & STClazy;
|
bool lazy = vd->storage_class & STClazy;
|
||||||
|
#if DMDV2
|
||||||
|
if (!refout)
|
||||||
|
#else
|
||||||
if (!refout && (!f->fty.args[i]->byref || lazy))
|
if (!refout && (!f->fty.args[i]->byref || lazy))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
// alloca a stack slot for this first class value arg
|
// alloca a stack slot for this first class value arg
|
||||||
const LLType* argt;
|
const LLType* argt;
|
||||||
|
|||||||
+6
-1
@@ -86,7 +86,12 @@ void IrFuncTy::getParam(Type* dty, int idx, DValue* val, llvm::Value* lval)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DtoStore(val->getRVal(), lval);
|
LLValue *rval = val->getRVal();
|
||||||
|
#if DMDV2
|
||||||
|
if (DtoIsPassedByRef(val->type))
|
||||||
|
rval = DtoLoad(rval);
|
||||||
|
#endif
|
||||||
|
DtoStore(rval, lval);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user