aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-09-20 23:27:32 +0000
committerAnna Zaks <ganna@apple.com>2011-09-20 23:27:32 +0000
commitef70724e66d8ede0edbe260fbcdd9781688bb1fd (patch)
tree6f018ab2b35558f1ec6d1b4dbf6c657fad55dccc /lib
parentc20f399889f53f74eef0404388de4086b36d2948 (diff)
[analyzer] Refactor PathDiagnosticLocation: Remove SourceRange member from PathDiagnosticLocation - FullSourceLoc Loc and PathDiagnosticRange Range are sufficient.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140206 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/StaticAnalyzer/Core/PathDiagnostic.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
index 932689cf5c..6fbfddbfd7 100644
--- a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
+++ b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
@@ -228,7 +228,7 @@ PathDiagnosticLocation PathDiagnosticLocation::createSingleLocation(
}
FullSourceLoc
- PathDiagnosticLocation::genLocation(LocationOrAnalysisContext LAC) const {
+ PathDiagnosticLocation::genLocation(SourceLocation L, LocationOrAnalysisContext LAC) const {
assert(isValid());
// Note that we want a 'switch' here so that the compiler can warn us in
// case we add more cases.
@@ -243,17 +243,17 @@ FullSourceLoc
return FullSourceLoc(D->getLocation(), const_cast<SourceManager&>(*SM));
}
- return FullSourceLoc(R.getBegin(), const_cast<SourceManager&>(*SM));
+ return FullSourceLoc(L, const_cast<SourceManager&>(*SM));
}
PathDiagnosticRange
- PathDiagnosticLocation::genRange(LocationOrAnalysisContext LAC) const {
+ PathDiagnosticLocation::genRange(SourceLocation L, LocationOrAnalysisContext LAC) const {
assert(isValid());
// Note that we want a 'switch' here so that the compiler can warn us in
// case we add more cases.
switch (K) {
case SingleLocK:
- return PathDiagnosticRange(R, true);
+ return PathDiagnosticRange(SourceRange(L,L), true);
case RangeK:
break;
case StmtK: {
@@ -302,19 +302,16 @@ PathDiagnosticRange
}
}
- return R;
+ return SourceRange(L,L);
}
void PathDiagnosticLocation::flatten() {
if (K == StmtK) {
- R = asRange();
K = RangeK;
S = 0;
D = 0;
}
else if (K == DeclK) {
- SourceLocation L = D->getLocation();
- R = SourceRange(L, L);
K = SingleLocK;
S = 0;
D = 0;