summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReader.cpp
diff options
context:
space:
mode:
authorVassil Vassilev <v.g.vassilev@gmail.com>2016-07-22 21:08:24 +0000
committerVassil Vassilev <v.g.vassilev@gmail.com>2016-07-22 21:08:24 +0000
commit19765fb68c67df88ad03bfa6e56b1f1f39ee6ffc (patch)
tree573203ffb0e3ba2d332498ef3ad6791b14138de3 /clang/lib/Serialization/ASTReader.cpp
parentb73d7aed71c3f750f2ca64b93eed83eac10e1458 (diff)
downloadbcm5719-llvm-19765fb68c67df88ad03bfa6e56b1f1f39ee6ffc.tar.gz
bcm5719-llvm-19765fb68c67df88ad03bfa6e56b1f1f39ee6ffc.zip
[modules] Teach the ASTWriter to ignore mutations coming from the ASTReader.
Processing update records (and loading a module, in general) might trigger unexpected calls to the ASTWriter (being a mutation listener). Now we have a mechanism to suppress those calls to the ASTWriter but notify other possible mutation listeners. Fixes https://llvm.org/bugs/show_bug.cgi?id=28332 Patch by Cristina Cristescu and me. Reviewed by Richard Smith (D21800). llvm-svn: 276473
Diffstat (limited to 'clang/lib/Serialization/ASTReader.cpp')
-rw-r--r--clang/lib/Serialization/ASTReader.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 6bfae07b82b..27b7048f375 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -8644,6 +8644,7 @@ void ASTReader::FinishedDeserializing() {
auto Updates = std::move(PendingExceptionSpecUpdates);
PendingExceptionSpecUpdates.clear();
for (auto Update : Updates) {
+ ProcessingUpdatesRAIIObj ProcessingUpdates(*this);
auto *FPT = Update.second->getType()->castAs<FunctionProtoType>();
auto ESI = FPT->getExtProtoInfo().ExceptionSpec;
if (auto *Listener = Context.getASTMutationListener())
@@ -8714,6 +8715,7 @@ ASTReader::ASTReader(
AllowConfigurationMismatch(AllowConfigurationMismatch),
ValidateSystemInputs(ValidateSystemInputs),
UseGlobalIndex(UseGlobalIndex), TriedLoadingGlobalIndex(false),
+ ProcessingUpdateRecords(false),
CurrSwitchCaseStmts(&SwitchCaseStmts), NumSLocEntriesRead(0),
TotalNumSLocEntries(0), NumStatementsRead(0), TotalNumStatements(0),
NumMacrosRead(0), TotalNumMacros(0), NumIdentifierLookups(0),
OpenPOWER on IntegriCloud