[PATCH] D47229: Make atomic non-member functions as nonnull
JF Bastien via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 22 14:43:16 PDT 2018
jfb created this revision.
jfb added a reviewer: arphaman.
Herald added subscribers: cfe-commits, aheejin.
As a companion to libc++ patch https://reviews.llvm.org/D47225, mark builtin atomic non-member functions which accept pointers as nonnull.
The atomic non-member functions accept pointers to std::atomic / std::atomic_flag as well as to the non-atomic value. These are all dereferenced unconditionally when lowered, and therefore will fault if null. It's a tiny gotcha for new users, especially when they pass in NULL as expected value (instead of passing a pointer to a NULL value).
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 16152 bytes
Desc: not available
More information about the cfe-commits