[PATCH] D47894: [clang]: Add support for "-fno-delete-null-pointer-checks"

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 7 14:45:08 PDT 2018


efriedma added a comment.

For the kernel, specifically, strlen() isn't an issue because it builds with -fno-builtin, but the kernel uses explicit nonnull attributes in a few places.  But I guess we can assume they know what they're doing if nonnull is explicitly specified. 
 We probably want to call this out in the users manual, though.

We add nonnull attributes to the LLVM IR in a few other places which don't involve the C nonnull attribute: we assume C++ references are always non-null, and we use the "static" array modifier to assume arrays are non-null.  We probably shouldn't add those attributes if fno-delete-null-pointer-checks is specified.


Repository:
  rC Clang

https://reviews.llvm.org/D47894





More information about the cfe-commits mailing list