summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorDevin Coughlin <dcoughlin@apple.com>2015-09-15 01:13:53 +0000
committerDevin Coughlin <dcoughlin@apple.com>2015-09-15 01:13:53 +0000
commitca5ab2b0d4d975402d07511ad6b6a14fc47ee68c (patch)
tree778013db9ff0c66bc50edc0933ddecb28c7cbbf8 /clang/lib/Sema/SemaOverload.cpp
parentb73002fb4ec3e4c7d5e46c3c447123ae388af626 (diff)
downloadbcm5719-llvm-ca5ab2b0d4d975402d07511ad6b6a14fc47ee68c.tar.gz
bcm5719-llvm-ca5ab2b0d4d975402d07511ad6b6a14fc47ee68c.zip
[analyzer] Skip Pre/Post handlers for ObjC calls when receiver is nil.
In Objective-C, method calls with nil receivers are essentially no-ops. They do not fault (although the returned value may be garbage depending on the declared return type and architecture). Programmers are aware of this behavior and will complain about a false alarm when the analyzer diagnoses API violations for method calls when the receiver is known to be nil. Rather than require each individual checker to be aware of this behavior and suppress a warning when the receiver is nil, this commit changes ExprEngineObjC so that VisitObjCMessage skips calling checker pre/post handlers when the receiver is definitely nil. Instead, it adds a new event, ObjCMessageNil, that is only called in that case. The CallAndMessageChecker explicitly cares about this case, so I've changed it to add a callback for ObjCMessageNil and moved the logic in PreObjCMessage that handles nil receivers to the new callback. rdar://problem/18092611 Differential Revision: http://reviews.llvm.org/D12123 llvm-svn: 247653
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud