summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/SourceManager.cpp
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
commit4c7626e7b6824fd088f1ac1a496a13e9d3886089 (patch)
treef04ede58f7ba994a23b7e8d5f3166aea0e1b9d70 /clang/lib/Basic/SourceManager.cpp
parent57d6bd36b293462ff35bb9d9ae9952be390d033e (diff)
downloadbcm5719-llvm-4c7626e7b6824fd088f1ac1a496a13e9d3886089.tar.gz
bcm5719-llvm-4c7626e7b6824fd088f1ac1a496a13e9d3886089.zip
Include the SourceManager's line table in the PCH file. We can now
properly cope with #line directives in PCH files. llvm-svn: 68963
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r--clang/lib/Basic/SourceManager.cpp11
1 files changed, 11 insertions, 0 deletions
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<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.
OpenPOWER on IntegriCloud