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 | bd94500d3aa60092fb0f1e90f53fb0d03fa502a8 (patch) | |
tree | dd90843141e75cf924a7653bb074db647ff3e23f /include/clang/Basic/SourceManagerInternals.h | |
parent | d4f77aa7c276be49aee5e59ef509cb91e26aa79f (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 'include/clang/Basic/SourceManagerInternals.h')
-rw-r--r-- | include/clang/Basic/SourceManagerInternals.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/clang/Basic/SourceManagerInternals.h b/include/clang/Basic/SourceManagerInternals.h index 2f90f64b0f..0bcb68e460 100644 --- a/include/clang/Basic/SourceManagerInternals.h +++ b/include/clang/Basic/SourceManagerInternals.h @@ -102,7 +102,8 @@ public: assert(ID < FilenamesByID.size() && "Invalid FilenameID"); return FilenamesByID[ID]->getKeyData(); } - + unsigned getNumFilenames() const { return FilenamesByID.size(); } + void AddLineNote(unsigned FID, unsigned Offset, unsigned LineNo, int FilenameID); void AddLineNote(unsigned FID, unsigned Offset, @@ -113,6 +114,15 @@ public: /// FindNearestLineEntry - Find the line entry nearest to FID that is before /// it. If there is no line entry before Offset in FID, return null. const LineEntry *FindNearestLineEntry(unsigned FID, unsigned Offset); + + // Low-level access + typedef std::map<unsigned, std::vector<LineEntry> >::iterator iterator; + iterator begin() { return LineEntries.begin(); } + iterator end() { return LineEntries.end(); } + + /// \brief Add a new line entry that has already been encoded into + /// the internal representation of the line table. + void AddEntry(unsigned FID, const std::vector<LineEntry> &Entries); }; } // end namespace clang |