summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-09-20 21:38:35 +0000
committerAnna Zaks <ganna@apple.com>2011-09-20 21:38:35 +0000
commitc29bed398971e550a4cacddf3dcf2b6b8a6e37b4 (patch)
tree24005460986f13145de014f4313f7c6be77477c0 /clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
parent61a003315e74d7e072e6702b0384921696d9f767 (diff)
downloadbcm5719-llvm-c29bed398971e550a4cacddf3dcf2b6b8a6e37b4.tar.gz
bcm5719-llvm-c29bed398971e550a4cacddf3dcf2b6b8a6e37b4.zip
[analyzer] Refactor PathDiagnosticLocation: Make PathDiagnosticLocation(SourceLocation...) private. Most of the effort here goes to making BugReport refer to a PathDiagnosticLocation instead of FullSourceLocation.
(Another step closer to the goal of having Diagnostics which can recover from invalid SourceLocations.) llvm-svn: 140182
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
index 211c1284709..2de96bd1015 100644
--- a/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
+++ b/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
@@ -156,9 +156,15 @@ static SourceLocation getValidSourceLocation(const Stmt* S,
}
PathDiagnosticLocation
- PathDiagnosticLocation::createBeginStmt(const Stmt *S,
- const SourceManager &SM,
- LocationOrAnalysisContext LAC) {
+ PathDiagnosticLocation::createBegin(const Decl *D,
+ const SourceManager &SM) {
+ return PathDiagnosticLocation(D->getLocStart(), SM, SingleLocK);
+}
+
+PathDiagnosticLocation
+ PathDiagnosticLocation::createBegin(const Stmt *S,
+ const SourceManager &SM,
+ LocationOrAnalysisContext LAC) {
return PathDiagnosticLocation(getValidSourceLocation(S, LAC),
SM, SingleLocK);
}
@@ -170,6 +176,12 @@ PathDiagnosticLocation
}
PathDiagnosticLocation
+ PathDiagnosticLocation::createMemberLoc(const MemberExpr *ME,
+ const SourceManager &SM) {
+ return PathDiagnosticLocation(ME->getMemberLoc(), SM, SingleLocK);
+}
+
+PathDiagnosticLocation
PathDiagnosticLocation::createBeginBrace(const CompoundStmt *CS,
const SourceManager &SM) {
SourceLocation L = CS->getLBracLoc();
OpenPOWER on IntegriCloud