[PATCH] D30806: [nonnull] Teach Clang to attach the nonnull LLVM attribute to declarations and calls instead of just definitions, and then teach it to *not* attach such attributes even if the source code contains them.
David Majnemer via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 10 00:47:52 PST 2017
majnemer added inline comments.
================
Comment at: lib/AST/ASTContext.cpp:8786
+ if (OverrideNonnull && OverrideNonnullArgs)
+ *OverrideNonnullArgs |= 1 << ArgTypes.size();
+
----------------
`1U` to avoid overflow UB?
================
Comment at: lib/CodeGen/CGCall.cpp:2082
+ if (getNonNullAttr(FD, PVD, ParamType, PVD->getFunctionScopeIndex()) &&
+ (OverrideNonnullArgs & (1 << ArgNo)) == 0)
+ Attrs.addAttribute(llvm::Attribute::NonNull);
----------------
Ditto.
https://reviews.llvm.org/D30806
More information about the cfe-commits
mailing list