diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-10-16 22:46:09 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-10-16 22:46:09 +0000 |
commit | bdfe48ac80573e026595af91e541474dbf02565f (patch) | |
tree | 39fdd5eae2daf6a116dad36c73c11c7195fbbe6a /include/clang/Basic/SourceManager.h | |
parent | 4ce74bd425dccd9d9ad6ccfc9ffbc01698a6e71a (diff) |
While writing source-location entries to a PCH file, go through an
interface that can load those source-location entries on demand (from
another PCH file).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84287 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index 7eb988f005..8a69cba066 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -685,26 +685,19 @@ public: /// void PrintStats() const; - // Iteration over the source location entry table. - typedef std::vector<SrcMgr::SLocEntry>::const_iterator sloc_entry_iterator; - - sloc_entry_iterator sloc_entry_begin() const { - return SLocEntryTable.begin(); - } - - sloc_entry_iterator sloc_entry_end() const { - return SLocEntryTable.end(); - } - unsigned sloc_entry_size() const { return SLocEntryTable.size(); } - const SrcMgr::SLocEntry &getSLocEntry(FileID FID) const { - assert(FID.ID < SLocEntryTable.size() && "Invalid id"); + const SrcMgr::SLocEntry &getSLocEntry(unsigned ID) const { + assert(ID < SLocEntryTable.size() && "Invalid id"); if (ExternalSLocEntries && - FID.ID < SLocEntryLoaded.size() && - !SLocEntryLoaded[FID.ID]) - ExternalSLocEntries->ReadSLocEntry(FID.ID); - return SLocEntryTable[FID.ID]; + ID < SLocEntryLoaded.size() && + !SLocEntryLoaded[ID]) + ExternalSLocEntries->ReadSLocEntry(ID); + return SLocEntryTable[ID]; + } + + const SrcMgr::SLocEntry &getSLocEntry(FileID FID) const { + return getSLocEntry(FID.ID); } unsigned getNextOffset() const { return NextOffset; } |