[analyzer] Don't emit extra context arrow after returning from an inlined call.
authorJordan Rose <jordan_rose@apple.com>
Fri, 12 Apr 2013 00:44:01 +0000 (00:44 +0000)
committerJordan Rose <jordan_rose@apple.com>
Fri, 12 Apr 2013 00:44:01 +0000 (00:44 +0000)
commitce781ae6ae6a403930cdc67c90e13d11af6764a4
treee354f433b9050f76d3ca47bcda542642cfabdb67
parent59d29e9b55cef46cfadfbaac5691a9666a1b66dd
[analyzer] Don't emit extra context arrow after returning from an inlined call.

In this code

  int getZero() {
    return 0;
  }

  void test() {
    int problem = 1 / getZero(); // expected-warning {{Division by zero}}
  }

we generate these arrows:

    +-----------------+
    |                 v
    int problem = 1 / getZero();
                  ^   |
                  +---+

where the top one represents the control flow up to the first call, and the
bottom one represents the flow to the division.* It turns out, however, that
we were generating the top arrow twice, as if attempting to "set up context"
after we had already returned from the call. This resulted in poor
highlighting in Xcode.

* Arguably the best location for the division is the '/', but that's a
  different problem.

<rdar://problem/13326040>

llvm-svn: 179350
clang/lib/StaticAnalyzer/Core/BugReporter.cpp
clang/test/Analysis/inline-plist.c
clang/test/Analysis/inlining/eager-reclamation-path-notes.c
clang/test/Analysis/inlining/eager-reclamation-path-notes.cpp
clang/test/Analysis/inlining/path-notes.c
clang/test/Analysis/inlining/path-notes.cpp
clang/test/Analysis/inlining/path-notes.m
clang/test/Analysis/retain-release-path-notes.m