aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-13 16:31:14 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-13 16:31:14 +0000
commitbd94500d3aa60092fb0f1e90f53fb0d03fa502a8 (patch)
treedd90843141e75cf924a7653bb074db647ff3e23f /lib/Basic
parentd4f77aa7c276be49aee5e59ef509cb91e26aa79f (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 'lib/Basic')
-rw-r--r--lib/Basic/SourceManager.cpp11
1 files changed, 11 insertions, 0 deletions
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<LineEntry> &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.