diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-12-05 01:31:47 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-12-05 01:31:47 +0000 |
commit | 891fc7f37a0be80c59a791d283f5e568254c07fa (patch) | |
tree | 880831f30f7be7807a86934a43a5996f48133eac /clang/lib/Frontend/MultiplexConsumer.cpp | |
parent | 913b42b0e180044c343d666d29412b1b1ff59749 (diff) | |
download | bcm5719-llvm-891fc7f37a0be80c59a791d283f5e568254c07fa.tar.gz bcm5719-llvm-891fc7f37a0be80c59a791d283f5e568254c07fa.zip |
Generalize "static data member instantiated" notification to cover variable templates too.
While here, split the "point of instantiation changed" notification out from
it; these two really are orthogonal changes.
llvm-svn: 319727
Diffstat (limited to 'clang/lib/Frontend/MultiplexConsumer.cpp')
-rw-r--r-- | clang/lib/Frontend/MultiplexConsumer.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/clang/lib/Frontend/MultiplexConsumer.cpp b/clang/lib/Frontend/MultiplexConsumer.cpp index 16000bc159d..04a8f6c1cdf 100644 --- a/clang/lib/Frontend/MultiplexConsumer.cpp +++ b/clang/lib/Frontend/MultiplexConsumer.cpp @@ -119,12 +119,13 @@ public: const FunctionDecl *Delete, Expr *ThisArg) override; void CompletedImplicitDefinition(const FunctionDecl *D) override; - void StaticDataMemberInstantiated(const VarDecl *D) override; + void InstantiationRequested(const ValueDecl *D) override; + void VariableDefinitionInstantiated(const VarDecl *D) override; + void FunctionDefinitionInstantiated(const FunctionDecl *D) override; void DefaultArgumentInstantiated(const ParmVarDecl *D) override; void DefaultMemberInitializerInstantiated(const FieldDecl *D) override; void AddedObjCCategoryToInterface(const ObjCCategoryDecl *CatD, const ObjCInterfaceDecl *IFD) override; - void FunctionDefinitionInstantiated(const FunctionDecl *D) override; void DeclarationMarkedUsed(const Decl *D) override; void DeclarationMarkedOpenMPThreadPrivate(const Decl *D) override; void DeclarationMarkedOpenMPDeclareTarget(const Decl *D, @@ -193,10 +194,19 @@ void MultiplexASTMutationListener::CompletedImplicitDefinition( for (size_t i = 0, e = Listeners.size(); i != e; ++i) Listeners[i]->CompletedImplicitDefinition(D); } -void MultiplexASTMutationListener::StaticDataMemberInstantiated( - const VarDecl *D) { +void MultiplexASTMutationListener::InstantiationRequested(const ValueDecl *D) { + for (size_t i = 0, e = Listeners.size(); i != e; ++i) + Listeners[i]->InstantiationRequested(D); +} +void MultiplexASTMutationListener::VariableDefinitionInstantiated( + const VarDecl *D) { for (size_t i = 0, e = Listeners.size(); i != e; ++i) - Listeners[i]->StaticDataMemberInstantiated(D); + Listeners[i]->VariableDefinitionInstantiated(D); +} +void MultiplexASTMutationListener::FunctionDefinitionInstantiated( + const FunctionDecl *D) { + for (auto &Listener : Listeners) + Listener->FunctionDefinitionInstantiated(D); } void MultiplexASTMutationListener::DefaultArgumentInstantiated( const ParmVarDecl *D) { @@ -214,11 +224,6 @@ void MultiplexASTMutationListener::AddedObjCCategoryToInterface( for (size_t i = 0, e = Listeners.size(); i != e; ++i) Listeners[i]->AddedObjCCategoryToInterface(CatD, IFD); } -void MultiplexASTMutationListener::FunctionDefinitionInstantiated( - const FunctionDecl *D) { - for (auto &Listener : Listeners) - Listener->FunctionDefinitionInstantiated(D); -} void MultiplexASTMutationListener::DeclarationMarkedUsed(const Decl *D) { for (size_t i = 0, e = Listeners.size(); i != e; ++i) Listeners[i]->DeclarationMarkedUsed(D); |