diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-08-17 19:34:38 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-08-17 19:34:38 +0000 |
commit | 631f6b779f4d248755ad71398d0f296653dd62cf (patch) | |
tree | 817597699dc876210d1681a258acaaca031345a9 /include/clang/Serialization | |
parent | 7fd6ba58d980ec2bf312a80444948501dd27d020 (diff) |
Notes
Diffstat (limited to 'include/clang/Serialization')
-rw-r--r-- | include/clang/Serialization/ASTReader.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h index 1b40494fd43ca..18e23870a7653 100644 --- a/include/clang/Serialization/ASTReader.h +++ b/include/clang/Serialization/ASTReader.h @@ -843,6 +843,9 @@ private: /// \brief Whether we have tried loading the global module index yet. bool TriedLoadingGlobalIndex; + ///\brief Whether we are currently processing update records. + bool ProcessingUpdateRecords; + typedef llvm::DenseMap<unsigned, SwitchCase *> SwitchCaseMapTy; /// \brief Mapping from switch-case IDs in the chain to switch-case statements /// @@ -1042,6 +1045,23 @@ private: ~ReadingKindTracker() { Reader.ReadingKind = PrevKind; } }; + /// \brief RAII object to mark the start of processing updates. + class ProcessingUpdatesRAIIObj { + ASTReader &Reader; + bool PrevState; + + ProcessingUpdatesRAIIObj(const ProcessingUpdatesRAIIObj &) = delete; + void operator=(const ProcessingUpdatesRAIIObj &) = delete; + + public: + ProcessingUpdatesRAIIObj(ASTReader &reader) + : Reader(reader), PrevState(Reader.ProcessingUpdateRecords) { + Reader.ProcessingUpdateRecords = true; + } + + ~ProcessingUpdatesRAIIObj() { Reader.ProcessingUpdateRecords = PrevState; } + }; + /// \brief Suggested contents of the predefines buffer, after this /// PCH file has been processed. /// @@ -2130,6 +2150,8 @@ public: /// \brief Loads comments ranges. void ReadComments() override; + + bool isProcessingUpdateRecords() { return ProcessingUpdateRecords; } }; /// \brief Helper class that saves the current stream position and |