From 4c7626e7b6824fd088f1ac1a496a13e9d3886089 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. llvm-svn: 68963 --- clang/lib/Basic/SourceManager.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'clang/lib/Basic/SourceManager.cpp') diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index d3fbeeb1bb8..ed541bfc6bc 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/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