diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-10 03:52:48 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-10 03:52:48 +0000 |
commit | 14f79002e58556798e86168c63e48d533287eda5 (patch) | |
tree | abf9da0e0bb6aea4cdb6ce2a744d1e018d045dbc /include/clang/Basic/SourceManager.h | |
parent | 52e5602056e4cade24cbcca57767e94e1d430b03 (diff) |
PCH serialization/deserialization of the source manager. With this
improvement, source locations read from the PCH file will properly
resolve to the source files that were used to build the PCH file
itself.
Once we have the preprocessor state stored in the PCH file, source
locations that refer to macro instantiations that occur in the PCH
file should have the appropriate instantiation information.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68758 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index d068e44f7c..dcf344e412 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -183,7 +183,7 @@ namespace SrcMgr { unsigned SpellingLoc; /// InstantiationLocStart/InstantiationLocEnd - In a macro expansion, these - /// indicate the start and end of the instantiation. In object-line macros, + /// indicate the start and end of the instantiation. In object-like macros, /// these will be the same. In a function-like macro instantiation, the /// start will be the identifier and the end will be the ')'. unsigned InstantiationLocStart, InstantiationLocEnd; @@ -610,7 +610,20 @@ public: /// Read - Reconstitute a SourceManager from Bitcode. static SourceManager* CreateAndRegister(llvm::Deserializer& S, FileManager &FMgr); - + + // 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(); } + private: friend class SrcMgr::ContentCache; // Used for deserialization. |