]> granicus.if.org Git - clang/commit
[analyzer; new edges] Eliminate "cycle edges" for a single subexpression.
authorJordan Rose <jordan_rose@apple.com>
Mon, 3 Jun 2013 23:00:00 +0000 (23:00 +0000)
committerJordan Rose <jordan_rose@apple.com>
Mon, 3 Jun 2013 23:00:00 +0000 (23:00 +0000)
commit3b5977e690b3d4476938a548bbd6f66c4a4a6dcd
tree57b2487bc7ca983f13eb3e18f1aa7954c559a4d1
parent66c2399931dd5cf036db34286579ddc5208a9a95
[analyzer; new edges] Eliminate "cycle edges" for a single subexpression.

Generating context arrows can result in quite a few arrows surrounding a
relatively simple expression, often containing only a single path note.

|
1 +--2---+
v/       v
auto m = new m // 3 (the path note)
|\       |
5 +--4---+
v

Note also that 5 and 1 are two ends of the "same" arrow, i.e. they go from
event to event. 3 is not an arrow but the path note itself.

Now, if we see a pair of edges like 2 and 4---where 4 is the reverse of 2
and there is optionally a single path note between them---we will
eliminate /both/ edges. Anything more complicated will be left as is
(more edges involved, an inlined call, etc).

The next commit will refine this to preserve the arrows in a larger
expression, so that we don't lose all context.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183162 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/BugReporter.cpp
test/Analysis/edges-new.mm