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
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index dcf344e..217640e 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -589,7 +589,13 @@
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 @@
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 @@
/// 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;