mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 07:30:43 +03:00
Partial fix for #69 — LDC1 from master fails to build Tango.
Fixed regression that has been introduced in commit 9889067
.
This commit is contained in:
parent
efcbe8390a
commit
15a903580b
5 changed files with 20 additions and 18 deletions
|
@ -87,11 +87,7 @@ llvm::FunctionType* DtoFunctionType(Type* type, Type* thistype, Type* nesttype,
|
|||
// member functions
|
||||
if (thistype)
|
||||
{
|
||||
bool toref = (thistype->toBasetype()->ty == Tstruct);
|
||||
#if STRUCTTHISREF
|
||||
fty.is_arg_this_ref = toref;
|
||||
#endif
|
||||
fty.arg_this = new IrFuncTyArg(thistype, toref);
|
||||
fty.arg_this = new IrFuncTyArg(thistype, thistype->toBasetype()->ty == Tstruct);
|
||||
lidx++;
|
||||
}
|
||||
|
||||
|
@ -712,7 +708,10 @@ void DtoDefineFunction(FuncDeclaration* fd)
|
|||
assert(thisvar);
|
||||
|
||||
LLValue* thismem = thisvar;
|
||||
if (!f->fty.is_arg_this_ref) {
|
||||
#if STRUCTTHISREF
|
||||
if (!f->fty.arg_this->byref)
|
||||
#endif
|
||||
{
|
||||
thismem = DtoRawAlloca(thisvar->getType(), 0, "this"); // FIXME: align?
|
||||
DtoStore(thisvar, thismem);
|
||||
irfunction->thisArg = thismem;
|
||||
|
@ -722,6 +721,7 @@ void DtoDefineFunction(FuncDeclaration* fd)
|
|||
fd->vthis->ir.irParam = new IrParameter(fd->vthis);
|
||||
fd->vthis->ir.irParam->value = thismem;
|
||||
fd->vthis->ir.irParam->arg = f->fty.arg_this;
|
||||
fd->vthis->ir.irParam->isVthis = true;
|
||||
|
||||
DtoDwarfLocalVariable(thismem, fd->vthis);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue