diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-01-21 18:28:30 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-01-21 18:28:30 +0000 |
commit | 78328be4b7ed079aa7013c324b27f85ea6301f41 (patch) | |
tree | 0bf9fa7e99cfe3040ec386b67db65c77d5ea416b /clang/lib/StaticAnalyzer/Core/BugReporter.cpp | |
parent | 15c3e7dab522ec3aa49b1571dcfd079c62d49d40 (diff) | |
download | bcm5719-llvm-78328be4b7ed079aa7013c324b27f85ea6301f41.tar.gz bcm5719-llvm-78328be4b7ed079aa7013c324b27f85ea6301f41.zip |
[analyzer] Show notes inside implicit calls at the last explicit call site.
Before:
struct Wrapper { <-- 2. Calling default constructor for 'NonTrivial'.
NonTrivial m;
};
Wrapper w; <-- 1. Calling implicit default constructor for 'Wrapper'.
After:
struct Wrapper {
NonTrivial m;
};
Wrapper w; <-- 1. Calling implicit default constructor for 'Wrapper'.
^-- 2. Calling default constructor for 'NonTrivial'.
llvm-svn: 173067
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/BugReporter.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index d64aa39febe..38069a56ac7 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -264,16 +264,19 @@ static void adjustCallLocations(PathPieces &Pieces, } if (LastCallLocation) { - if (!Call->callEnter.asLocation().isValid()) + if (!Call->callEnter.asLocation().isValid() || + Call->getCaller()->isImplicit()) Call->callEnter = *LastCallLocation; - if (!Call->callReturn.asLocation().isValid()) + if (!Call->callReturn.asLocation().isValid() || + Call->getCaller()->isImplicit()) Call->callReturn = *LastCallLocation; } // Recursively clean out the subclass. Keep this call around if // it contains any informative diagnostics. PathDiagnosticLocation *ThisCallLocation; - if (Call->callEnterWithin.asLocation().isValid()) + if (Call->callEnterWithin.asLocation().isValid() && + !Call->getCallee()->isImplicit()) ThisCallLocation = &Call->callEnterWithin; else ThisCallLocation = &Call->callEnter; |