2011-01-26 04:34:14 +08:00
|
|
|
//===- MultiplexConsumer.cpp - AST Consumer for PCH Generation --*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines the MultiplexConsumer class. It also declares and defines
|
|
|
|
// MultiplexASTDeserializationListener and MultiplexASTMutationListener, which
|
|
|
|
// are implementation details of MultiplexConsumer.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "clang/Frontend/MultiplexConsumer.h"
|
|
|
|
#include "clang/AST/ASTMutationListener.h"
|
|
|
|
#include "clang/AST/DeclGroup.h"
|
|
|
|
|
|
|
|
using namespace clang;
|
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
|
|
|
|
MultiplexASTDeserializationListener::MultiplexASTDeserializationListener(
|
|
|
|
const std::vector<ASTDeserializationListener*>& L)
|
|
|
|
: Listeners(L) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void MultiplexASTDeserializationListener::ReaderInitialized(
|
|
|
|
ASTReader *Reader) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->ReaderInitialized(Reader);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MultiplexASTDeserializationListener::IdentifierRead(
|
|
|
|
serialization::IdentID ID, IdentifierInfo *II) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->IdentifierRead(ID, II);
|
|
|
|
}
|
|
|
|
|
2015-06-19 00:41:53 +08:00
|
|
|
void MultiplexASTDeserializationListener::MacroRead(
|
|
|
|
serialization::MacroID ID, MacroInfo *MI) {
|
|
|
|
for (auto &Listener : Listeners)
|
|
|
|
Listener->MacroRead(ID, MI);
|
|
|
|
}
|
|
|
|
|
2011-01-26 04:34:14 +08:00
|
|
|
void MultiplexASTDeserializationListener::TypeRead(
|
|
|
|
serialization::TypeIdx Idx, QualType T) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->TypeRead(Idx, T);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MultiplexASTDeserializationListener::DeclRead(
|
|
|
|
serialization::DeclID ID, const Decl *D) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->DeclRead(ID, D);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MultiplexASTDeserializationListener::SelectorRead(
|
|
|
|
serialization::SelectorID ID, Selector Sel) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->SelectorRead(ID, Sel);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MultiplexASTDeserializationListener::MacroDefinitionRead(
|
2015-05-04 10:25:31 +08:00
|
|
|
serialization::PreprocessedEntityID ID, MacroDefinitionRecord *MD) {
|
2011-01-26 04:34:14 +08:00
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->MacroDefinitionRead(ID, MD);
|
|
|
|
}
|
|
|
|
|
2015-06-19 00:41:53 +08:00
|
|
|
void MultiplexASTDeserializationListener::ModuleRead(
|
|
|
|
serialization::SubmoduleID ID, Module *Mod) {
|
|
|
|
for (auto &Listener : Listeners)
|
|
|
|
Listener->ModuleRead(ID, Mod);
|
|
|
|
}
|
|
|
|
|
2011-01-26 04:34:14 +08:00
|
|
|
// This ASTMutationListener forwards its notifications to a set of
|
|
|
|
// child listeners.
|
|
|
|
class MultiplexASTMutationListener : public ASTMutationListener {
|
|
|
|
public:
|
|
|
|
// Does NOT take ownership of the elements in L.
|
2012-02-11 04:10:38 +08:00
|
|
|
MultiplexASTMutationListener(ArrayRef<ASTMutationListener*> L);
|
2014-03-13 14:07:04 +08:00
|
|
|
void CompletedTagDefinition(const TagDecl *D) override;
|
|
|
|
void AddedVisibleDecl(const DeclContext *DC, const Decl *D) override;
|
|
|
|
void AddedCXXImplicitMember(const CXXRecordDecl *RD, const Decl *D) override;
|
|
|
|
void AddedCXXTemplateSpecialization(const ClassTemplateDecl *TD,
|
|
|
|
const ClassTemplateSpecializationDecl *D) override;
|
|
|
|
void AddedCXXTemplateSpecialization(const VarTemplateDecl *TD,
|
|
|
|
const VarTemplateSpecializationDecl *D) override;
|
|
|
|
void AddedCXXTemplateSpecialization(const FunctionTemplateDecl *TD,
|
|
|
|
const FunctionDecl *D) override;
|
2015-06-19 00:41:53 +08:00
|
|
|
void ResolvedExceptionSpec(const FunctionDecl *FD) override;
|
2014-03-13 14:07:04 +08:00
|
|
|
void DeducedReturnType(const FunctionDecl *FD, QualType ReturnType) override;
|
2015-03-10 09:41:22 +08:00
|
|
|
void ResolvedOperatorDelete(const CXXDestructorDecl *DD,
|
2017-10-13 09:55:36 +08:00
|
|
|
const FunctionDecl *Delete,
|
|
|
|
Expr *ThisArg) override;
|
2014-03-13 14:07:04 +08:00
|
|
|
void CompletedImplicitDefinition(const FunctionDecl *D) override;
|
2017-12-05 09:31:47 +08:00
|
|
|
void InstantiationRequested(const ValueDecl *D) override;
|
|
|
|
void VariableDefinitionInstantiated(const VarDecl *D) override;
|
|
|
|
void FunctionDefinitionInstantiated(const FunctionDecl *D) override;
|
2016-01-07 06:34:54 +08:00
|
|
|
void DefaultArgumentInstantiated(const ParmVarDecl *D) override;
|
2016-08-25 05:25:37 +08:00
|
|
|
void DefaultMemberInitializerInstantiated(const FieldDecl *D) override;
|
2014-03-13 14:07:04 +08:00
|
|
|
void AddedObjCCategoryToInterface(const ObjCCategoryDecl *CatD,
|
|
|
|
const ObjCInterfaceDecl *IFD) override;
|
2014-03-02 17:32:10 +08:00
|
|
|
void DeclarationMarkedUsed(const Decl *D) override;
|
2014-11-11 12:05:39 +08:00
|
|
|
void DeclarationMarkedOpenMPThreadPrivate(const Decl *D) override;
|
2016-05-09 22:59:13 +08:00
|
|
|
void DeclarationMarkedOpenMPDeclareTarget(const Decl *D,
|
|
|
|
const Attr *Attr) override;
|
2015-05-15 10:34:32 +08:00
|
|
|
void RedefinedHiddenDefinition(const NamedDecl *D, Module *M) override;
|
2018-07-31 03:24:48 +08:00
|
|
|
void AddedAttributeToRecord(const Attr *Attr,
|
2015-06-26 13:28:36 +08:00
|
|
|
const RecordDecl *Record) override;
|
2013-09-05 08:02:25 +08:00
|
|
|
|
2011-01-26 04:34:14 +08:00
|
|
|
private:
|
|
|
|
std::vector<ASTMutationListener*> Listeners;
|
|
|
|
};
|
|
|
|
|
|
|
|
MultiplexASTMutationListener::MultiplexASTMutationListener(
|
2012-02-11 04:10:38 +08:00
|
|
|
ArrayRef<ASTMutationListener*> L)
|
|
|
|
: Listeners(L.begin(), L.end()) {
|
2011-01-26 04:34:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void MultiplexASTMutationListener::CompletedTagDefinition(const TagDecl *D) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->CompletedTagDefinition(D);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MultiplexASTMutationListener::AddedVisibleDecl(
|
|
|
|
const DeclContext *DC, const Decl *D) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->AddedVisibleDecl(DC, D);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MultiplexASTMutationListener::AddedCXXImplicitMember(
|
|
|
|
const CXXRecordDecl *RD, const Decl *D) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->AddedCXXImplicitMember(RD, D);
|
|
|
|
}
|
|
|
|
void MultiplexASTMutationListener::AddedCXXTemplateSpecialization(
|
|
|
|
const ClassTemplateDecl *TD, const ClassTemplateSpecializationDecl *D) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->AddedCXXTemplateSpecialization(TD, D);
|
|
|
|
}
|
2013-08-06 09:03:05 +08:00
|
|
|
void MultiplexASTMutationListener::AddedCXXTemplateSpecialization(
|
|
|
|
const VarTemplateDecl *TD, const VarTemplateSpecializationDecl *D) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->AddedCXXTemplateSpecialization(TD, D);
|
|
|
|
}
|
2011-04-14 22:07:59 +08:00
|
|
|
void MultiplexASTMutationListener::AddedCXXTemplateSpecialization(
|
|
|
|
const FunctionTemplateDecl *TD, const FunctionDecl *D) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->AddedCXXTemplateSpecialization(TD, D);
|
|
|
|
}
|
2015-06-19 00:41:53 +08:00
|
|
|
void MultiplexASTMutationListener::ResolvedExceptionSpec(
|
|
|
|
const FunctionDecl *FD) {
|
|
|
|
for (auto &Listener : Listeners)
|
|
|
|
Listener->ResolvedExceptionSpec(FD);
|
|
|
|
}
|
2013-05-11 13:45:24 +08:00
|
|
|
void MultiplexASTMutationListener::DeducedReturnType(const FunctionDecl *FD,
|
|
|
|
QualType ReturnType) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->DeducedReturnType(FD, ReturnType);
|
|
|
|
}
|
2015-03-10 09:41:22 +08:00
|
|
|
void MultiplexASTMutationListener::ResolvedOperatorDelete(
|
2017-10-13 09:55:36 +08:00
|
|
|
const CXXDestructorDecl *DD, const FunctionDecl *Delete, Expr *ThisArg) {
|
2015-03-10 09:41:22 +08:00
|
|
|
for (auto *L : Listeners)
|
2017-10-13 09:55:36 +08:00
|
|
|
L->ResolvedOperatorDelete(DD, Delete, ThisArg);
|
2015-03-10 09:41:22 +08:00
|
|
|
}
|
2011-04-25 00:28:06 +08:00
|
|
|
void MultiplexASTMutationListener::CompletedImplicitDefinition(
|
|
|
|
const FunctionDecl *D) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->CompletedImplicitDefinition(D);
|
|
|
|
}
|
2017-12-05 09:31:47 +08:00
|
|
|
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) {
|
2011-04-29 16:19:30 +08:00
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
2017-12-05 09:31:47 +08:00
|
|
|
Listeners[i]->VariableDefinitionInstantiated(D);
|
|
|
|
}
|
|
|
|
void MultiplexASTMutationListener::FunctionDefinitionInstantiated(
|
|
|
|
const FunctionDecl *D) {
|
|
|
|
for (auto &Listener : Listeners)
|
|
|
|
Listener->FunctionDefinitionInstantiated(D);
|
2011-04-29 16:19:30 +08:00
|
|
|
}
|
2016-01-07 06:34:54 +08:00
|
|
|
void MultiplexASTMutationListener::DefaultArgumentInstantiated(
|
|
|
|
const ParmVarDecl *D) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->DefaultArgumentInstantiated(D);
|
|
|
|
}
|
2016-08-25 05:25:37 +08:00
|
|
|
void MultiplexASTMutationListener::DefaultMemberInitializerInstantiated(
|
|
|
|
const FieldDecl *D) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->DefaultMemberInitializerInstantiated(D);
|
|
|
|
}
|
2012-02-11 04:10:36 +08:00
|
|
|
void MultiplexASTMutationListener::AddedObjCCategoryToInterface(
|
|
|
|
const ObjCCategoryDecl *CatD,
|
|
|
|
const ObjCInterfaceDecl *IFD) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->AddedObjCCategoryToInterface(CatD, IFD);
|
|
|
|
}
|
2013-09-05 08:02:25 +08:00
|
|
|
void MultiplexASTMutationListener::DeclarationMarkedUsed(const Decl *D) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->DeclarationMarkedUsed(D);
|
|
|
|
}
|
2014-11-11 12:05:39 +08:00
|
|
|
void MultiplexASTMutationListener::DeclarationMarkedOpenMPThreadPrivate(
|
|
|
|
const Decl *D) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->DeclarationMarkedOpenMPThreadPrivate(D);
|
|
|
|
}
|
2016-04-06 19:38:59 +08:00
|
|
|
void MultiplexASTMutationListener::DeclarationMarkedOpenMPDeclareTarget(
|
2016-05-09 22:59:13 +08:00
|
|
|
const Decl *D, const Attr *Attr) {
|
2016-04-06 19:38:59 +08:00
|
|
|
for (auto *L : Listeners)
|
2016-05-09 22:59:13 +08:00
|
|
|
L->DeclarationMarkedOpenMPDeclareTarget(D, Attr);
|
2016-04-06 19:38:59 +08:00
|
|
|
}
|
2015-05-15 10:34:32 +08:00
|
|
|
void MultiplexASTMutationListener::RedefinedHiddenDefinition(const NamedDecl *D,
|
|
|
|
Module *M) {
|
2015-03-26 12:09:53 +08:00
|
|
|
for (auto *L : Listeners)
|
2015-05-15 10:34:32 +08:00
|
|
|
L->RedefinedHiddenDefinition(D, M);
|
2015-03-26 12:09:53 +08:00
|
|
|
}
|
2018-07-31 03:24:48 +08:00
|
|
|
|
2015-06-26 13:28:36 +08:00
|
|
|
void MultiplexASTMutationListener::AddedAttributeToRecord(
|
2018-07-31 03:24:48 +08:00
|
|
|
const Attr *Attr,
|
2015-06-26 13:28:36 +08:00
|
|
|
const RecordDecl *Record) {
|
|
|
|
for (auto *L : Listeners)
|
|
|
|
L->AddedAttributeToRecord(Attr, Record);
|
|
|
|
}
|
2011-01-26 04:34:14 +08:00
|
|
|
|
|
|
|
} // end namespace clang
|
|
|
|
|
2014-08-11 03:56:51 +08:00
|
|
|
MultiplexConsumer::MultiplexConsumer(
|
|
|
|
std::vector<std::unique_ptr<ASTConsumer>> C)
|
|
|
|
: Consumers(std::move(C)), MutationListener(), DeserializationListener() {
|
2011-01-26 04:34:14 +08:00
|
|
|
// Collect the mutation listeners and deserialization listeners of all
|
|
|
|
// children, and create a multiplex listener each if so.
|
|
|
|
std::vector<ASTMutationListener*> mutationListeners;
|
|
|
|
std::vector<ASTDeserializationListener*> serializationListeners;
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers) {
|
|
|
|
if (auto *mutationListener = Consumer->GetASTMutationListener())
|
2011-01-26 04:34:14 +08:00
|
|
|
mutationListeners.push_back(mutationListener);
|
2014-08-11 03:56:51 +08:00
|
|
|
if (auto *serializationListener = Consumer->GetASTDeserializationListener())
|
2011-01-26 04:34:14 +08:00
|
|
|
serializationListeners.push_back(serializationListener);
|
|
|
|
}
|
2014-08-11 03:56:51 +08:00
|
|
|
if (!mutationListeners.empty()) {
|
|
|
|
MutationListener =
|
|
|
|
llvm::make_unique<MultiplexASTMutationListener>(mutationListeners);
|
2011-01-26 04:34:14 +08:00
|
|
|
}
|
2014-08-11 03:56:51 +08:00
|
|
|
if (!serializationListeners.empty()) {
|
|
|
|
DeserializationListener =
|
|
|
|
llvm::make_unique<MultiplexASTDeserializationListener>(
|
|
|
|
serializationListeners);
|
2011-01-26 04:34:14 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-10-20 21:23:58 +08:00
|
|
|
MultiplexConsumer::~MultiplexConsumer() {}
|
2011-01-26 04:34:14 +08:00
|
|
|
|
|
|
|
void MultiplexConsumer::Initialize(ASTContext &Context) {
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Consumer->Initialize(Context);
|
2011-01-26 04:34:14 +08:00
|
|
|
}
|
|
|
|
|
2011-11-18 08:26:59 +08:00
|
|
|
bool MultiplexConsumer::HandleTopLevelDecl(DeclGroupRef D) {
|
2011-11-28 12:56:00 +08:00
|
|
|
bool Continue = true;
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Continue = Continue && Consumer->HandleTopLevelDecl(D);
|
2011-11-28 12:56:00 +08:00
|
|
|
return Continue;
|
2011-01-26 04:34:14 +08:00
|
|
|
}
|
|
|
|
|
2016-03-30 14:27:31 +08:00
|
|
|
void MultiplexConsumer::HandleInlineFunctionDefinition(FunctionDecl *D) {
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
2016-03-30 14:27:31 +08:00
|
|
|
Consumer->HandleInlineFunctionDefinition(D);
|
2014-05-24 04:37:38 +08:00
|
|
|
}
|
|
|
|
|
2014-08-11 03:56:51 +08:00
|
|
|
void MultiplexConsumer::HandleCXXStaticMemberVarInstantiation(VarDecl *VD) {
|
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Consumer->HandleCXXStaticMemberVarInstantiation(VD);
|
2012-03-05 18:54:55 +08:00
|
|
|
}
|
|
|
|
|
2011-01-26 04:34:14 +08:00
|
|
|
void MultiplexConsumer::HandleInterestingDecl(DeclGroupRef D) {
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Consumer->HandleInterestingDecl(D);
|
2011-01-26 04:34:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void MultiplexConsumer::HandleTranslationUnit(ASTContext &Ctx) {
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Consumer->HandleTranslationUnit(Ctx);
|
2011-01-26 04:34:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void MultiplexConsumer::HandleTagDeclDefinition(TagDecl *D) {
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Consumer->HandleTagDeclDefinition(D);
|
2011-01-26 04:34:14 +08:00
|
|
|
}
|
|
|
|
|
2014-07-17 07:52:46 +08:00
|
|
|
void MultiplexConsumer::HandleTagDeclRequiredDefinition(const TagDecl *D) {
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Consumer->HandleTagDeclRequiredDefinition(D);
|
2014-07-17 07:52:46 +08:00
|
|
|
}
|
|
|
|
|
2012-02-11 04:10:44 +08:00
|
|
|
void MultiplexConsumer::HandleCXXImplicitFunctionInstantiation(FunctionDecl *D){
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Consumer->HandleCXXImplicitFunctionInstantiation(D);
|
2012-02-11 04:10:44 +08:00
|
|
|
}
|
|
|
|
|
2011-11-28 12:56:00 +08:00
|
|
|
void MultiplexConsumer::HandleTopLevelDeclInObjCContainer(DeclGroupRef D) {
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Consumer->HandleTopLevelDeclInObjCContainer(D);
|
2011-11-28 12:56:00 +08:00
|
|
|
}
|
|
|
|
|
2014-07-17 07:52:46 +08:00
|
|
|
void MultiplexConsumer::HandleImplicitImportDecl(ImportDecl *D) {
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Consumer->HandleImplicitImportDecl(D);
|
2014-07-17 07:52:46 +08:00
|
|
|
}
|
|
|
|
|
2011-01-26 04:34:14 +08:00
|
|
|
void MultiplexConsumer::CompleteTentativeDefinition(VarDecl *D) {
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Consumer->CompleteTentativeDefinition(D);
|
2011-01-26 04:34:14 +08:00
|
|
|
}
|
|
|
|
|
2016-01-27 03:30:26 +08:00
|
|
|
void MultiplexConsumer::AssignInheritanceModel(CXXRecordDecl *RD) {
|
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Consumer->AssignInheritanceModel(RD);
|
|
|
|
}
|
|
|
|
|
2015-01-15 12:07:35 +08:00
|
|
|
void MultiplexConsumer::HandleVTable(CXXRecordDecl *RD) {
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
2015-01-15 12:07:35 +08:00
|
|
|
Consumer->HandleVTable(RD);
|
2011-01-26 04:34:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
ASTMutationListener *MultiplexConsumer::GetASTMutationListener() {
|
|
|
|
return MutationListener.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
ASTDeserializationListener *MultiplexConsumer::GetASTDeserializationListener() {
|
|
|
|
return DeserializationListener.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
void MultiplexConsumer::PrintStats() {
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Consumer->PrintStats();
|
2011-01-26 04:34:14 +08:00
|
|
|
}
|
|
|
|
|
2016-02-10 03:07:16 +08:00
|
|
|
bool MultiplexConsumer::shouldSkipFunctionBody(Decl *D) {
|
|
|
|
bool Skip = true;
|
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Skip = Skip && Consumer->shouldSkipFunctionBody(D);
|
|
|
|
return Skip;
|
|
|
|
}
|
|
|
|
|
2011-01-26 04:34:14 +08:00
|
|
|
void MultiplexConsumer::InitializeSema(Sema &S) {
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
if (SemaConsumer *SC = dyn_cast<SemaConsumer>(Consumer.get()))
|
2011-01-26 04:34:14 +08:00
|
|
|
SC->InitializeSema(S);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MultiplexConsumer::ForgetSema() {
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
if (SemaConsumer *SC = dyn_cast<SemaConsumer>(Consumer.get()))
|
2011-01-26 04:34:14 +08:00
|
|
|
SC->ForgetSema();
|
|
|
|
}
|