diff options
author | Anna Zaks <ganna@apple.com> | 2011-09-20 16:37:36 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2011-09-20 16:37:36 +0000 |
commit | e97436732c0f20aa15ecbf92a5f905eee888528f (patch) | |
tree | 1171f5c3e9d4999723c4f529a5cc4c7d2020ebcf /include | |
parent | 23803374d8db054192ea6fcb766b87e04f26c8fb (diff) | |
download | clang-e97436732c0f20aa15ecbf92a5f905eee888528f.tar.gz |
[analyzer] Refactor PathDiagnosticLocation: Lazily query LocationContext for a ParentMap as needed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140147 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h b/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h index 55179779b4..326635d90c 100644 --- a/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h +++ b/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h @@ -98,8 +98,8 @@ private: FullSourceLoc Loc; PathDiagnosticRange Range; - FullSourceLoc genLocation(const ParentMap *PM=0) const; - PathDiagnosticRange genRange(const ParentMap *PM=0) const; + FullSourceLoc genLocation(const LocationContext *LC=0) const; + PathDiagnosticRange genRange(const LocationContext *LC=0) const; public: PathDiagnosticLocation() @@ -119,7 +119,10 @@ public: PathDiagnosticLocation(const Stmt *s, const SourceManager &sm, - const LocationContext *lc); + const LocationContext *lc) + : K(StmtK), S(s), D(0), SM(&sm), + Loc(genLocation(lc)), Range(genRange(lc)) {} + PathDiagnosticLocation(const Decl *d, const SourceManager &sm) : K(DeclK), S(0), D(d), SM(&sm), |