Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Unified Diff: lib/Transforms/NaCl/ExpandVarArgs.cpp

Issue 14060026: PNaCl: Add NoAlias attributes in ExpandByVal and ExpandVarArgs passes (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Put noalias on the varargs function, not call Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/Transforms/NaCl/ExpandVarArgs.cpp
diff --git a/lib/Transforms/NaCl/ExpandVarArgs.cpp b/lib/Transforms/NaCl/ExpandVarArgs.cpp
index cbafbc275741af9a60b8fc59715cd01131412c6e..d3a271627319474dbc6fa7a8636793420ee02b88 100644
--- a/lib/Transforms/NaCl/ExpandVarArgs.cpp
+++ b/lib/Transforms/NaCl/ExpandVarArgs.cpp
@@ -87,6 +87,11 @@ static void ExpandVarArgFunc(Function *Func) {
NewFunc->getBasicBlockList().splice(NewFunc->begin(),
Func->getBasicBlockList());
+ // Declare the new argument as "noalias".
+ NewFunc->setAttributes(
+ Func->getAttributes().addAttribute(
+ Func->getContext(), FTy->getNumParams() + 1, Attribute::NoAlias));
+
// Move the arguments across to the new function.
for (Function::arg_iterator Arg = Func->arg_begin(), E = Func->arg_end(),
NewArg = NewFunc->arg_begin();

Powered by Google App Engine
This is Rietveld 408576698