diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-26 07:57:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-26 07:57:50 +0000 |
commit | 5b9a504720fb52594ca3686e10eb6c0cfa2e7d62 (patch) | |
tree | 2b3ede0125e8d0dc986ff7f0477c3212c5a42cf0 /include/clang/Basic/SourceManager.h | |
parent | 987cd3da36e90aa21a9e290f5b383cf010762b83 (diff) |
start plumbing together the line table information. So far we just
unique the Filenames in #line directives, assigning them UIDs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63010 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index a58662443d..d8c17e11da 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -31,6 +31,7 @@ class SourceManager; class FileManager; class FileEntry; class IdentifierTokenInfo; +class LineTableInfo; /// SrcMgr - Public enums and private classes that are part of the /// SourceManager implementation. @@ -224,7 +225,6 @@ namespace SrcMgr { return E; } }; - } // end SrcMgr namespace. } // end clang namespace @@ -275,6 +275,10 @@ class SourceManager { /// is very common to look up many tokens from the same file. mutable FileID LastFileIDLookup; + /// LineTable - This holds information for #line directives. It is referenced + /// by indices from SLocEntryTable. + LineTableInfo *LineTable; + /// LastLineNo - These ivars serve as a cache used in the getLineNumber /// method which is used to speedup getLineNumber calls to nearby locations. mutable FileID LastLineNoFileIDQuery; @@ -292,23 +296,13 @@ class SourceManager { explicit SourceManager(const SourceManager&); void operator=(const SourceManager&); public: - SourceManager() : NumLinearScans(0), NumBinaryProbes(0) { + SourceManager() : LineTable(0), NumLinearScans(0), NumBinaryProbes(0) { clearIDTables(); } - ~SourceManager() {} - - void clearIDTables() { - MainFileID = FileID(); - SLocEntryTable.clear(); - LastLineNoFileIDQuery = FileID(); - LastLineNoContentCache = 0; - LastFileIDLookup = FileID(); - - // Use up FileID #0 as an invalid instantiation. - NextOffset = 0; - createInstantiationLoc(SourceLocation(), SourceLocation(), 1); - } - + ~SourceManager(); + + void clearIDTables(); + //===--------------------------------------------------------------------===// // MainFileID creation and querying methods. //===--------------------------------------------------------------------===// @@ -553,6 +547,15 @@ public: } //===--------------------------------------------------------------------===// + // Line Table Manipulation Routines + //===--------------------------------------------------------------------===// + + /// getLineTableFilenameID - Return the uniqued ID for the specified filename. + /// + unsigned getLineTableFilenameID(const char *Ptr, unsigned Len); + + + //===--------------------------------------------------------------------===// // Other miscellaneous methods. //===--------------------------------------------------------------------===// |