aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/BugReporter.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-01-21 18:28:30 +0000
committerJordan Rose <jordan_rose@apple.com>2013-01-21 18:28:30 +0000
commit187f8bd88bfc92cf3fea62b7d8db5f92edce410a (patch)
treee6c2701466f4928246709df9db463b7511b62324 /lib/StaticAnalyzer/Core/BugReporter.cpp
parent125eb3e3b6cc2f3e7b2e0e04e59c924f936520f5 (diff)
[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'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173067 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/BugReporter.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/BugReporter.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp
index d64aa39feb..38069a56ac 100644
--- a/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/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;