From 8c3cc1467f1e52b3da7ef1e02d2591e2edcc0a9e Mon Sep 17 00:00:00 2001 From: Frits van Bommel Date: Wed, 15 Apr 2009 20:59:21 +0200 Subject: [PATCH] Remove 'noalias' and 'nocapture' from %.nest_arg. They no longer apply now that it may point to a struct containing variables from outer functions. --- gen/functions.cpp | 2 +- gen/tocall.cpp | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/gen/functions.cpp b/gen/functions.cpp index 485d1750..212c1055 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -89,7 +89,7 @@ const llvm::FunctionType* DtoFunctionType(Type* type, Type* thistype, Type* nest // and nested functions else if (nesttype) { - f->fty.arg_nest = new IrFuncTyArg(nesttype, false, NoAlias | NoCapture); + f->fty.arg_nest = new IrFuncTyArg(nesttype, false); lidx++; } diff --git a/gen/tocall.cpp b/gen/tocall.cpp index a8efe2b9..241780a0 100644 --- a/gen/tocall.cpp +++ b/gen/tocall.cpp @@ -358,16 +358,7 @@ DValue* DtoCallFunction(Loc& loc, Type* resulttype, DValue* fnval, Expressions* { Attr.Index = retinptr ? 2 : 1; Attr.Attrs = tf->fty.arg_nest->attrs; - // For delegates, we can't assume 'nest' is noalias and nocapture - // (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); + attrs.push_back(Attr); } }