From bd94500d3aa60092fb0f1e90f53fb0d03fa502a8 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 13 Apr 2009 16:31:14 +0000 Subject: 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 --- lib/Basic/SourceManager.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/Basic/SourceManager.cpp') diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp index d3fbeeb1bb..ed541bfc6b 100644 --- a/lib/Basic/SourceManager.cpp +++ b/lib/Basic/SourceManager.cpp @@ -157,6 +157,12 @@ const LineEntry *LineTableInfo::FindNearestLineEntry(unsigned FID, return &*--I; } +/// \brief Add a new line entry that has already been encoded into +/// the internal representation of the line table. +void LineTableInfo::AddEntry(unsigned FID, + const std::vector &Entries) { + LineEntries[FID] = Entries; +} /// getLineTableFilenameID - Return the uniqued ID for the specified filename. /// @@ -224,6 +230,11 @@ void SourceManager::AddLineNote(SourceLocation Loc, unsigned LineNo, EntryExit, FileKind); } +LineTableInfo &SourceManager::getLineTable() { + if (LineTable == 0) + LineTable = new LineTableInfo(); + return *LineTable; +} //===----------------------------------------------------------------------===// // Private 'Create' methods. -- cgit v1.2.3-18-g5258