[PATCH] D53342: [SimplifyLibCalls][WIP] Mark known arguments with nonnull

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 17 15:10:37 PDT 2018


efriedma added a comment.

The approach is fine.



================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:188
+static bool setNonNullParam(CallInst *CI, unsigned ArgNo) {
+  if (!CI->paramHasAttr(ArgNo, Attribute::NonNull)) {
+    CI->addParamAttr(ArgNo, Attribute::NonNull);
----------------
I think you're missing a check for null-pointer-is-valid metadata here.


https://reviews.llvm.org/D53342





More information about the llvm-commits mailing list