[analyzer] Silently drop all reports within synthesized bodies.
authorJordan Rose <jordan_rose@apple.com>
Thu, 1 Aug 2013 22:16:30 +0000 (22:16 +0000)
committerJordan Rose <jordan_rose@apple.com>
Thu, 1 Aug 2013 22:16:30 +0000 (22:16 +0000)
commit5fbe7f97664dc2024252c03729198eb4b958a03c
tree1e3c6f972c5b5ea7dc1052da47295d4adc2df4a5
parent3e8c33cff5c28911b8ee9cd5f5d8de2c4362c009
[analyzer] Silently drop all reports within synthesized bodies.

Much of our diagnostic machinery is set up to assume that the report
end path location is valid. Moreover, the user may be quite confused
when something goes wrong in our BodyFarm-synthesized function bodies,
which may be simplified or modified from the real implementations.
Rather than try to make this all work somehow, just drop the report so
that we don't try to go on with an invalid source location.

Note that we still handle reports whose /paths/ go through invalid
locations, just not those that are reported in one.

We do have to be careful not to lose warnings because of this.
The impetus for this change was an autorelease being processed within
the synthesized body, and there may be other possible issues that are
worth reporting in some way. We'll take these as they come, however.

<rdar://problem/14611722>

llvm-svn: 187624
clang/lib/StaticAnalyzer/Core/BugReporter.cpp
clang/test/Analysis/inlining/path-notes.m