diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-11 17:49:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-11 17:49:14 +0000 |
commit | 1d96ccc69a265435cc1fb0eafe208857290e7dd2 (patch) | |
tree | 1d45ab0258b12cf1fd64844f9041a1c9368f0e09 /include/llvm/Support/SourceMgr.h | |
parent | b27a41b44092c0a6e439203586cc944187de3388 (diff) |
add a trivial line # cache to SourceMgr to make repeated queries to
FindLineNumber much faster when in sequence.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78693 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/SourceMgr.h')
-rw-r--r-- | include/llvm/Support/SourceMgr.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/llvm/Support/SourceMgr.h b/include/llvm/Support/SourceMgr.h index 37cdc0a1f4..5b6f56b436 100644 --- a/include/llvm/Support/SourceMgr.h +++ b/include/llvm/Support/SourceMgr.h @@ -65,10 +65,14 @@ class SourceMgr { // include files in. std::vector<std::string> IncludeDirectories; + /// LineNoCache - This is a cache for line number queries, its implementation + /// is really private to SourceMgr.cpp. + mutable void *LineNoCache; + SourceMgr(const SourceMgr&); // DO NOT IMPLEMENT void operator=(const SourceMgr&); // DO NOT IMPLEMENT public: - SourceMgr() {} + SourceMgr() : LineNoCache(0) {} ~SourceMgr(); void setIncludeDirs(const std::vector<std::string> &Dirs) { |