mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 19:06:02 +03:00
Remove 'noalias' and 'nocapture' from %.nest_arg. They no longer apply now that
it may point to a struct containing variables from outer functions.
This commit is contained in:
parent
c19ab2e539
commit
8c3cc1467f
2 changed files with 2 additions and 11 deletions
|
@ -89,7 +89,7 @@ const llvm::FunctionType* DtoFunctionType(Type* type, Type* thistype, Type* nest
|
||||||
// and nested functions
|
// and nested functions
|
||||||
else if (nesttype)
|
else if (nesttype)
|
||||||
{
|
{
|
||||||
f->fty.arg_nest = new IrFuncTyArg(nesttype, false, NoAlias | NoCapture);
|
f->fty.arg_nest = new IrFuncTyArg(nesttype, false);
|
||||||
lidx++;
|
lidx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -358,16 +358,7 @@ DValue* DtoCallFunction(Loc& loc, Type* resulttype, DValue* fnval, Expressions*
|
||||||
{
|
{
|
||||||
Attr.Index = retinptr ? 2 : 1;
|
Attr.Index = retinptr ? 2 : 1;
|
||||||
Attr.Attrs = tf->fty.arg_nest->attrs;
|
Attr.Attrs = tf->fty.arg_nest->attrs;
|
||||||
// For delegates, we can't assume 'nest' is noalias and nocapture
|
attrs.push_back(Attr);
|
||||||
// (like we can with nested functions) since it might actually be
|
|
||||||
// a 'this', and thus neither attribute generally applies to it.
|
|
||||||
// TODO: don't remove nocapture if it's a "pure" delegate?
|
|
||||||
if (delegatecall) {
|
|
||||||
Attr.Attrs &= ~(llvm::Attribute::NoAlias | llvm::Attribute::NoCapture);
|
|
||||||
}
|
|
||||||
// LLVM doesn't like it when no bits are set...
|
|
||||||
if (Attr.Attrs)
|
|
||||||
attrs.push_back(Attr);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue