Implement function-try-blocks. However, there's a very subtle bug that I can't track down.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70155 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp
index 348ab3d..397d28b 100644
--- a/lib/Analysis/BugReporter.cpp
+++ b/lib/Analysis/BugReporter.cpp
@@ -189,7 +189,7 @@
if (Stmt *S = GetNextStmt(N))
return PathDiagnosticLocation(S, SMgr);
- return FullSourceLoc(CodeDecl.getBody(getContext())->getRBracLoc(), SMgr);
+ return FullSourceLoc(CodeDecl.getBodyRBrace(getContext()), SMgr);
}
PathDiagnosticLocation
@@ -825,7 +825,9 @@
// Finally, add an initial edge from the start location of the first
// statement (if it doesn't already exist).
- if (const CompoundStmt *CS = PDB.getCodeDecl().getBody(PDB.getContext()))
+ // FIXME: Should handle CXXTryStmt if analyser starts supporting C++.
+ if (const CompoundStmt *CS =
+ PDB.getCodeDecl().getCompoundBody(PDB.getContext()))
if (!CS->body_empty()) {
SourceLocation Loc = (*CS->body_begin())->getLocStart();
rawAddEdge(PathDiagnosticLocation(Loc, PDB.getSourceManager()));