diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-13 16:31:14 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-13 16:31:14 +0000 |
commit | 4c7626e7b6824fd088f1ac1a496a13e9d3886089 (patch) | |
tree | f04ede58f7ba994a23b7e8d5f3166aea0e1b9d70 /clang/lib/Basic/SourceManager.cpp | |
parent | 57d6bd36b293462ff35bb9d9ae9952be390d033e (diff) | |
download | bcm5719-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.cpp | 11 |
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. |