summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-09-20 21:25:00 +0000
committerAnna Zaks <ganna@apple.com>2011-09-20 21:25:00 +0000
commitb2dfc2b7be60978e47a459d47cb9c8e0cc31ffca (patch)
tree722a90cc6c5aab0a10c54e9824b6de82e3b30c03
parentd3a0f954a389c0df3643085fcc63a282f1fc2ea7 (diff)
downloadbcm5719-llvm-b2dfc2b7be60978e47a459d47cb9c8e0cc31ffca.tar.gz
bcm5719-llvm-b2dfc2b7be60978e47a459d47cb9c8e0cc31ffca.zip
[analyzer] Refactor PathDiagnosticLocation: Use the pre-computed Range and Location for profile.
llvm-svn: 140180
-rw-r--r--clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
index b8a811a6e18..211c1284709 100644
--- a/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
+++ b/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
@@ -351,22 +351,9 @@ void PathDiagnosticLocation::flatten() {
//===----------------------------------------------------------------------===//
void PathDiagnosticLocation::Profile(llvm::FoldingSetNodeID &ID) const {
- ID.AddInteger((unsigned) K);
- switch (K) {
- case RangeK:
- ID.AddInteger(R.getBegin().getRawEncoding());
- ID.AddInteger(R.getEnd().getRawEncoding());
- break;
- case SingleLocK:
- ID.AddInteger(R.getBegin().getRawEncoding());
- break;
- case StmtK:
- ID.Add(S);
- break;
- case DeclK:
- ID.Add(D);
- break;
- }
+ ID.AddInteger(Range.getBegin().getRawEncoding());
+ ID.AddInteger(Range.getEnd().getRawEncoding());
+ ID.AddInteger(Loc.getRawEncoding());
return;
}
OpenPOWER on IntegriCloud