diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-13 16:31:14 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-13 16:31:14 +0000 |
commit | bd94500d3aa60092fb0f1e90f53fb0d03fa502a8 (patch) | |
tree | dd90843141e75cf924a7653bb074db647ff3e23f /include/clang/Basic/SourceManager.h | |
parent | d4f77aa7c276be49aee5e59ef509cb91e26aa79f (diff) |
Include the SourceManager's line table in the PCH file. We can now
properly cope with #line directives in PCH files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68963 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index dcf344e412..217640eaa5 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -589,7 +589,13 @@ public: void AddLineNote(SourceLocation Loc, unsigned LineNo, int FilenameID, bool IsFileEntry, bool IsFileExit, bool IsSystemHeader, bool IsExternCHeader); - + + /// \brief Determine if the source manager has a line table. + bool hasLineTable() const { return LineTable != 0; } + + /// \brief Retrieve the stored line table. + LineTableInfo &getLineTable(); + //===--------------------------------------------------------------------===// // Other miscellaneous methods. //===--------------------------------------------------------------------===// @@ -624,6 +630,11 @@ public: unsigned sloc_entry_size() const { return SLocEntryTable.size(); } + const SrcMgr::SLocEntry &getSLocEntry(FileID FID) const { + assert(FID.ID < SLocEntryTable.size() && "Invalid id"); + return SLocEntryTable[FID.ID]; + } + private: friend class SrcMgr::ContentCache; // Used for deserialization. @@ -654,11 +665,6 @@ private: /// memory buffer. const SrcMgr::ContentCache* createMemBufferContentCache(const llvm::MemoryBuffer *Buf); - - const SrcMgr::SLocEntry &getSLocEntry(FileID FID) const { - assert(FID.ID < SLocEntryTable.size() && "Invalid id"); - return SLocEntryTable[FID.ID]; - } FileID getFileIDSlow(unsigned SLocOffset) const; |