Improve ABI conformance on x86 by passing the sret parameter in EAX if there's

no `this`.
This commit is contained in:
Frits van Bommel
2009-05-31 12:43:59 +02:00
parent 1e9ad13b12
commit 2fe8f2cd74
2 changed files with 11 additions and 2 deletions

View File

@@ -322,7 +322,8 @@ DValue* DtoCallFunction(Loc& loc, Type* resulttype, DValue* fnval, Expressions*
// add attrs for hidden ptr
Attr.Index = 1;
Attr.Attrs = tf->fty.arg_sret->attrs;
assert((Attr.Attrs & llvm::Attribute::StructRet) && "Sret arg not sret?");
assert((Attr.Attrs & (llvm::Attribute::StructRet | llvm::Attribute::InReg))
&& "Sret arg not sret or inreg?");
attrs.push_back(Attr);
}