diff options
author | George Karpenkov <ekarpenkov@apple.com> | 2019-01-18 03:13:40 +0000 |
---|---|---|
committer | George Karpenkov <ekarpenkov@apple.com> | 2019-01-18 03:13:40 +0000 |
commit | 1055c850977b151ba9b05f4ca42c72e1a63ad0ef (patch) | |
tree | 4121cbc6e9ce84e516f5de6ae4c1ec7f5705f191 /lib/StaticAnalyzer/Core/PathDiagnostic.cpp | |
parent | bf3e81e62e49ceacc50ba312b858d4f28403ee6b (diff) |
[analyzer] Extend the PathDiagnosticLocation constructor to handle CallExitEnd
Differential Revision: https://reviews.llvm.org/D56890
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351513 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/PathDiagnostic.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/PathDiagnostic.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp index 3e93bb6a7c..005bae097c 100644 --- a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp +++ b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp @@ -735,6 +735,12 @@ PathDiagnosticLocation::create(const ProgramPoint& P, return getLocationForCaller(CEE->getCalleeContext(), CEE->getLocationContext(), SMng); + } else if (auto CEB = P.getAs<CallExitBegin>()) { + if (const ReturnStmt *RS = CEB->getReturnStmt()) + return PathDiagnosticLocation::createBegin(RS, SMng, + CEB->getLocationContext()); + return PathDiagnosticLocation( + CEB->getLocationContext()->getDecl()->getSourceRange().getEnd(), SMng); } else if (Optional<BlockEntrance> BE = P.getAs<BlockEntrance>()) { CFGElement BlockFront = BE->getBlock()->front(); if (auto StmtElt = BlockFront.getAs<CFGStmt>()) { |