[analyzer] Remove LocationContext and a dependency from PathDiagnosticLoaction.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140146 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp
index 043f5d2..7a0a543 100644
--- a/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -877,7 +877,7 @@
}
if (S != Original)
- L = PathDiagnosticLocation(S, L.getManager(), L.getLocationContext());
+ L = PathDiagnosticLocation(S, L.getManager(), PDB.getLocationContext());
}
if (firstCharOnly)
diff --git a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
index 40b73de..6ef2b07 100644
--- a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
+++ b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
@@ -147,7 +147,7 @@
PathDiagnosticLocation::PathDiagnosticLocation(const Stmt *s,
const SourceManager &sm,
const LocationContext *lc)
- : K(StmtK), S(s), D(0), SM(&sm), LC(lc)
+ : K(StmtK), S(s), D(0), SM(&sm)
{
const ParentMap* PM = 0;
if (lc)
@@ -264,7 +264,7 @@
case RangeK:
break;
case StmtK:
- return FullSourceLoc(getValidSourceLocation(S, LC->getParentMap()),
+ return FullSourceLoc(getValidSourceLocation(S, *PM),
const_cast<SourceManager&>(*SM));
case DeclK:
return FullSourceLoc(D->getLocation(), const_cast<SourceManager&>(*SM));
@@ -309,7 +309,7 @@
case Stmt::BinaryConditionalOperatorClass:
case Stmt::ConditionalOperatorClass:
case Stmt::ObjCForCollectionStmtClass: {
- SourceLocation L = getValidSourceLocation(S, LC->getParentMap());
+ SourceLocation L = getValidSourceLocation(S, *PM);
return SourceRange(L, L);
}
}