[Sema] Patch to issue warning on comparing parameters with
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 18 Nov 2014 21:57:54 +0000 (21:57 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 18 Nov 2014 21:57:54 +0000 (21:57 +0000)
commitef202d96c79f4a3c3f0ed15de073be9a012de92e
tree93684c756716d15b44b6d17bc97b89d4e7bc487c
parent38765e6d89aa7c83eae34c7ad0cab351a90bc5b6
[Sema] Patch to issue warning on comparing parameters with
nonnull attribute when comparison is always true/false.
Original patch by Steven Wu. I have added extra code to prevent issuing of
warning  when the nonnull parameter is modified prior to the comparison.
This addition prevents false positives in the most obvious cases.
There may still be false positive warnings in some cases (as one of my tests
indicates), but benefit far outweighs such cases. rdar://18712242

llvm-svn: 222264
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/ScopeInfo.h
clang/lib/Sema/ScopeInfo.cpp
clang/lib/Sema/SemaChecking.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/Sema/nonnull.c