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"
|
|
|
|
#include "clang/Serialization/ASTDeserializationListener.h"
|
|
|
|
|
|
|
|
using namespace clang;
|
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
|
|
|
|
// This ASTDeserializationListener forwards its notifications to a set of
|
|
|
|
// child listeners.
|
|
|
|
class MultiplexASTDeserializationListener
|
|
|
|
: public ASTDeserializationListener {
|
|
|
|
public:
|
|
|
|
// Does NOT take ownership of the elements in L.
|
|
|
|
MultiplexASTDeserializationListener(
|
|
|
|
const std::vector<ASTDeserializationListener*>& L);
|
2014-03-13 14:07:04 +08:00
|
|
|
void ReaderInitialized(ASTReader *Reader) override;
|
|
|
|
void IdentifierRead(serialization::IdentID ID,
|
|
|
|
IdentifierInfo *II) override;
|
2015-06-19 00:41:53 +08:00
|
|
|
void MacroRead(serialization::MacroID ID, MacroInfo *MI) override;
|
2014-03-13 14:07:04 +08:00
|
|
|
void TypeRead(serialization::TypeIdx Idx, QualType T) override;
|
|
|
|
void DeclRead(serialization::DeclID ID, const Decl *D) override;
|
|
|
|
void SelectorRead(serialization::SelectorID iD, Selector Sel) override;
|
|
|
|
void MacroDefinitionRead(serialization::PreprocessedEntityID,
|
2015-05-04 10:25:31 +08:00
|
|
|
MacroDefinitionRecord *MD) override;
|
2015-06-19 00:41:53 +08:00
|
|
|
void ModuleRead(serialization::SubmoduleID ID, Module *Mod) override;
|
2015-05-04 10:25:31 +08:00
|
|
|
|
2011-01-26 04:34:14 +08:00
|
|
|
private:
|
2015-05-04 10:25:31 +08:00
|
|
|
std::vector<ASTDeserializationListener *> Listeners;
|
2011-01-26 04:34:14 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
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,
|
|
|
|
const FunctionDecl *Delete) override;
|
2014-03-13 14:07:04 +08:00
|
|
|
void CompletedImplicitDefinition(const FunctionDecl *D) override;
|
|
|
|
void StaticDataMemberInstantiated(const VarDecl *D) override;
|
|
|
|
void AddedObjCCategoryToInterface(const ObjCCategoryDecl *CatD,
|
|
|
|
const ObjCInterfaceDecl *IFD) override;
|
2015-06-19 00:41:53 +08:00
|
|
|
void FunctionDefinitionInstantiated(const FunctionDecl *D) override;
|
2014-03-13 14:07:04 +08:00
|
|
|
void AddedObjCPropertyInClassExtension(const ObjCPropertyDecl *Prop,
|
|
|
|
const ObjCPropertyDecl *OrigProp,
|
|
|
|
const ObjCCategoryDecl *ClassExt) 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;
|
2015-05-15 10:34:32 +08:00
|
|
|
void RedefinedHiddenDefinition(const NamedDecl *D, Module *M) override;
|
2015-06-26 13:28:36 +08:00
|
|
|
void AddedAttributeToRecord(const Attr *Attr,
|
|
|
|
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(
|
|
|
|
const CXXDestructorDecl *DD, const FunctionDecl *Delete) {
|
|
|
|
for (auto *L : Listeners)
|
|
|
|
L->ResolvedOperatorDelete(DD, Delete);
|
|
|
|
}
|
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);
|
|
|
|
}
|
2011-04-29 16:19:30 +08:00
|
|
|
void MultiplexASTMutationListener::StaticDataMemberInstantiated(
|
|
|
|
const VarDecl *D) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->StaticDataMemberInstantiated(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);
|
|
|
|
}
|
2015-06-19 00:41:53 +08:00
|
|
|
void MultiplexASTMutationListener::FunctionDefinitionInstantiated(
|
|
|
|
const FunctionDecl *D) {
|
|
|
|
for (auto &Listener : Listeners)
|
|
|
|
Listener->FunctionDefinitionInstantiated(D);
|
|
|
|
}
|
2012-02-11 04:10:36 +08:00
|
|
|
void MultiplexASTMutationListener::AddedObjCPropertyInClassExtension(
|
|
|
|
const ObjCPropertyDecl *Prop,
|
|
|
|
const ObjCPropertyDecl *OrigProp,
|
|
|
|
const ObjCCategoryDecl *ClassExt) {
|
|
|
|
for (size_t i = 0, e = Listeners.size(); i != e; ++i)
|
|
|
|
Listeners[i]->AddedObjCPropertyInClassExtension(Prop, OrigProp, ClassExt);
|
|
|
|
}
|
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);
|
|
|
|
}
|
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
|
|
|
}
|
2015-06-26 13:28:36 +08:00
|
|
|
|
|
|
|
void MultiplexASTMutationListener::AddedAttributeToRecord(
|
|
|
|
const Attr *Attr,
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-11 03:56:51 +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
|
|
|
}
|
|
|
|
|
2014-05-24 04:37:38 +08:00
|
|
|
void MultiplexConsumer::HandleInlineMethodDefinition(CXXMethodDecl *D) {
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Consumer->HandleInlineMethodDefinition(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
|
|
|
}
|
|
|
|
|
|
|
|
void MultiplexConsumer::HandleLinkerOptionPragma(llvm::StringRef Opts) {
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Consumer->HandleLinkerOptionPragma(Opts);
|
2014-07-17 07:52:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void MultiplexConsumer::HandleDetectMismatch(llvm::StringRef Name, llvm::StringRef Value) {
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Consumer->HandleDetectMismatch(Name, Value);
|
2014-07-17 07:52:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void MultiplexConsumer::HandleDependentLibrary(llvm::StringRef Lib) {
|
2014-08-11 03:56:51 +08:00
|
|
|
for (auto &Consumer : Consumers)
|
|
|
|
Consumer->HandleDependentLibrary(Lib);
|
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
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
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();
|
|
|
|
}
|