patch: add 'nonnull' attribute when passing reference types

Nick Lewycky nlewycky at google.com
Mon May 19 23:35:42 PDT 2014


The attached patch updates CodeGen to add the llvm 'nonnull' attribute
whenever the return or argument type is a reference (lvalue or rvalue
reference).

There is more we could do here (for instance, 'this' pointers are also
never null), but I'm starting here since the bulk of the change is merely
updating the tests. In particular I added 'nonnull' whenever the mangled
name indicated a reference type was involved. For Microsoft mangling tests
and some Objective-C++ tests, I simply updated the tests with no attempt to
reason about the correctness.

Please review!

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140519/5a0ad8a2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nonnull-references-1.patch
Type: text/x-patch
Size: 60100 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140519/5a0ad8a2/attachment.bin>


More information about the cfe-commits mailing list