[PATCH] D52635: [FunctionAttrs] Re-enable propagation of nonnull argument attributes from callsites to callers

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 27 15:32:33 PDT 2018


xbolva00 updated this revision to Diff 167409.
xbolva00 retitled this revision from "[FunctionAttrs] Propagate nonnull argument attributes from callsites to callers" to "[FunctionAttrs] Re-enable propagation of nonnull argument attributes from callsites to callers".

https://reviews.llvm.org/D52635

Files:
  lib/Transforms/IPO/FunctionAttrs.cpp
  test/Transforms/FunctionAttrs/nonnull.ll


Index: test/Transforms/FunctionAttrs/nonnull.ll
===================================================================
--- test/Transforms/FunctionAttrs/nonnull.ll
+++ test/Transforms/FunctionAttrs/nonnull.ll
@@ -1,5 +1,5 @@
-; RUN: opt -S -functionattrs -enable-nonnull-arg-prop %s | FileCheck %s
-; RUN: opt -S -passes=function-attrs -enable-nonnull-arg-prop %s | FileCheck %s
+; RUN: opt -S -functionattrs %s | FileCheck %s
+; RUN: opt -S -passes=function-attrs %s | FileCheck %s
 
 declare nonnull i8* @ret_nonnull()
 
Index: lib/Transforms/IPO/FunctionAttrs.cpp
===================================================================
--- lib/Transforms/IPO/FunctionAttrs.cpp
+++ lib/Transforms/IPO/FunctionAttrs.cpp
@@ -76,14 +76,6 @@
 STATISTIC(NumNoRecurse, "Number of functions marked as norecurse");
 STATISTIC(NumNoUnwind, "Number of functions marked as nounwind");
 
-// FIXME: This is disabled by default to avoid exposing security vulnerabilities
-// in C/C++ code compiled by clang:
-// http://lists.llvm.org/pipermail/cfe-dev/2017-January/052066.html
-static cl::opt<bool> EnableNonnullArgPropagation(
-    "enable-nonnull-arg-prop", cl::Hidden,
-    cl::desc("Try to propagate nonnull argument attributes from callsites to "
-             "caller functions."));
-
 static cl::opt<bool> DisableNoUnwindInference(
     "disable-nounwind-inference", cl::Hidden,
     cl::desc("Stop inferring nounwind attribute during function-attrs pass"));
@@ -618,9 +610,6 @@
 /// arguments. This may be important because inlining can cause information loss
 /// when attribute knowledge disappears with the inlined call.
 static bool addArgumentAttrsFromCallsites(Function &F) {
-  if (!EnableNonnullArgPropagation)
-    return false;
-
   bool Changed = false;
 
   // For an argument attribute to transfer from a callsite to the parent, the


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52635.167409.patch
Type: text/x-patch
Size: 1836 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180927/aa596ad3/attachment.bin>


More information about the llvm-commits mailing list