From 276dd188c428d4fb1b3e887fe70a929a71892bf9 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 5 Sep 2013 00:02:25 +0000 Subject: Note when a decl is used in AST files. When an AST file is built based on another AST file, it can use a decl from the fist file, and therefore mark the "isUsed" bit. We need to note this in the AST file so that the bit is set correctly when the second AST file is loaded. This patch introduces the distinction between setIsUsed() and markUsed() so that we don't call into the ASTMutationListener callback when it wouldn't be appropriate. Fixes PR16635. llvm-svn: 190016 --- clang/lib/Frontend/MultiplexConsumer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/lib/Frontend') diff --git a/clang/lib/Frontend/MultiplexConsumer.cpp b/clang/lib/Frontend/MultiplexConsumer.cpp index f8ee36a50dc..9cf68a5e9b2 100644 --- a/clang/lib/Frontend/MultiplexConsumer.cpp +++ b/clang/lib/Frontend/MultiplexConsumer.cpp @@ -107,6 +107,8 @@ public: virtual void AddedObjCPropertyInClassExtension(const ObjCPropertyDecl *Prop, const ObjCPropertyDecl *OrigProp, const ObjCCategoryDecl *ClassExt); + void DeclarationMarkedUsed(const Decl *D) LLVM_OVERRIDE; + private: std::vector Listeners; }; @@ -175,6 +177,10 @@ void MultiplexASTMutationListener::AddedObjCPropertyInClassExtension( for (size_t i = 0, e = Listeners.size(); i != e; ++i) Listeners[i]->AddedObjCPropertyInClassExtension(Prop, OrigProp, ClassExt); } +void MultiplexASTMutationListener::DeclarationMarkedUsed(const Decl *D) { + for (size_t i = 0, e = Listeners.size(); i != e; ++i) + Listeners[i]->DeclarationMarkedUsed(D); +} } // end namespace clang -- cgit v1.2.3