[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.
Chandler Carruth via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 9 17:23:48 PST 2016
chandlerc added a comment.
In http://reviews.llvm.org/D17993#371454, @hfinkel wrote:
> In http://reviews.llvm.org/D17993#370793, @chandlerc wrote:
>
> > If we're not going to fully implement "fdelete-null-pointer-checks" we shouldn't claim to... I'm really worried about us accepting that flag and not actually honoring it.
> >
> > However, I *do* think this should be guarded by a flag, and it should be specific to the 'this' pointer. And I'm also sufficiently terrified of this that I think the flag should be off to start with so that folks can find out how bad this is really going to be...
>
>
> I agree with you, but I don't really understand why this particular use of nonnull is scary. Do you really think we have people calling member functions on null pointers on purpose and checking for a null this pointer in their code?
Yes, we saw an astonishing number of instances of this when turning on the warning.
I don't have any real sympathy for the pattern or principle of the code -- it is *really* bad. But at the same time, I do have sympathy for the users of Clang who often inherited that code and would have to make substantial plans to fix all of it before this kind of thing could be rolled out.
http://reviews.llvm.org/D17993
More information about the cfe-commits
mailing list