[PATCH] D52635: [FunctionAttrs] Propagate 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:19:55 PDT 2018


xbolva00 updated this revision to Diff 167406.

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,4 +1,6 @@
+; RUN: opt -S -functionattrs %s | FileCheck %s
 ; RUN: opt -S -functionattrs -enable-nonnull-arg-prop %s | FileCheck %s
+; RUN: opt -S -passes=function-attrs %s | FileCheck %s
 ; RUN: opt -S -passes=function-attrs -enable-nonnull-arg-prop %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,11 +76,8 @@
 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,
+    "enable-nonnull-arg-prop", cl::Hidden, cl::init(true),
     cl::desc("Try to propagate nonnull argument attributes from callsites to "
              "caller functions."));
 


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


More information about the llvm-commits mailing list