Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 1 | //===- MultiplexConsumer.cpp - AST Consumer for PCH Generation --*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file defines the MultiplexConsumer class. It also declares and defines |
| 11 | // MultiplexASTDeserializationListener and MultiplexASTMutationListener, which |
| 12 | // are implementation details of MultiplexConsumer. |
| 13 | // |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
| 16 | #include "clang/Frontend/MultiplexConsumer.h" |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 17 | #include "clang/AST/ASTMutationListener.h" |
| 18 | #include "clang/AST/DeclGroup.h" |
| 19 | #include "clang/Serialization/ASTDeserializationListener.h" |
| 20 | |
| 21 | using namespace clang; |
| 22 | |
| 23 | namespace clang { |
| 24 | |
| 25 | // This ASTDeserializationListener forwards its notifications to a set of |
| 26 | // child listeners. |
| 27 | class MultiplexASTDeserializationListener |
| 28 | : public ASTDeserializationListener { |
| 29 | public: |
| 30 | // Does NOT take ownership of the elements in L. |
| 31 | MultiplexASTDeserializationListener( |
| 32 | const std::vector<ASTDeserializationListener*>& L); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 33 | void ReaderInitialized(ASTReader *Reader) override; |
| 34 | void IdentifierRead(serialization::IdentID ID, |
| 35 | IdentifierInfo *II) override; |
| 36 | void TypeRead(serialization::TypeIdx Idx, QualType T) override; |
| 37 | void DeclRead(serialization::DeclID ID, const Decl *D) override; |
| 38 | void SelectorRead(serialization::SelectorID iD, Selector Sel) override; |
| 39 | void MacroDefinitionRead(serialization::PreprocessedEntityID, |
| 40 | MacroDefinition *MD) override; |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 41 | private: |
| 42 | std::vector<ASTDeserializationListener*> Listeners; |
| 43 | }; |
| 44 | |
| 45 | MultiplexASTDeserializationListener::MultiplexASTDeserializationListener( |
| 46 | const std::vector<ASTDeserializationListener*>& L) |
| 47 | : Listeners(L) { |
| 48 | } |
| 49 | |
| 50 | void MultiplexASTDeserializationListener::ReaderInitialized( |
| 51 | ASTReader *Reader) { |
| 52 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 53 | Listeners[i]->ReaderInitialized(Reader); |
| 54 | } |
| 55 | |
| 56 | void MultiplexASTDeserializationListener::IdentifierRead( |
| 57 | serialization::IdentID ID, IdentifierInfo *II) { |
| 58 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 59 | Listeners[i]->IdentifierRead(ID, II); |
| 60 | } |
| 61 | |
| 62 | void MultiplexASTDeserializationListener::TypeRead( |
| 63 | serialization::TypeIdx Idx, QualType T) { |
| 64 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 65 | Listeners[i]->TypeRead(Idx, T); |
| 66 | } |
| 67 | |
| 68 | void MultiplexASTDeserializationListener::DeclRead( |
| 69 | serialization::DeclID ID, const Decl *D) { |
| 70 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 71 | Listeners[i]->DeclRead(ID, D); |
| 72 | } |
| 73 | |
| 74 | void MultiplexASTDeserializationListener::SelectorRead( |
| 75 | serialization::SelectorID ID, Selector Sel) { |
| 76 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 77 | Listeners[i]->SelectorRead(ID, Sel); |
| 78 | } |
| 79 | |
| 80 | void MultiplexASTDeserializationListener::MacroDefinitionRead( |
Argyrios Kyrtzidis | e24692b | 2011-09-15 18:02:56 +0000 | [diff] [blame] | 81 | serialization::PreprocessedEntityID ID, MacroDefinition *MD) { |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 82 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 83 | Listeners[i]->MacroDefinitionRead(ID, MD); |
| 84 | } |
| 85 | |
| 86 | // This ASTMutationListener forwards its notifications to a set of |
| 87 | // child listeners. |
| 88 | class MultiplexASTMutationListener : public ASTMutationListener { |
| 89 | public: |
| 90 | // Does NOT take ownership of the elements in L. |
Argyrios Kyrtzidis | 409e245 | 2012-02-10 20:10:38 +0000 | [diff] [blame] | 91 | MultiplexASTMutationListener(ArrayRef<ASTMutationListener*> L); |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 92 | void CompletedTagDefinition(const TagDecl *D) override; |
| 93 | void AddedVisibleDecl(const DeclContext *DC, const Decl *D) override; |
| 94 | void AddedCXXImplicitMember(const CXXRecordDecl *RD, const Decl *D) override; |
| 95 | void AddedCXXTemplateSpecialization(const ClassTemplateDecl *TD, |
| 96 | const ClassTemplateSpecializationDecl *D) override; |
| 97 | void AddedCXXTemplateSpecialization(const VarTemplateDecl *TD, |
| 98 | const VarTemplateSpecializationDecl *D) override; |
| 99 | void AddedCXXTemplateSpecialization(const FunctionTemplateDecl *TD, |
| 100 | const FunctionDecl *D) override; |
| 101 | void DeducedReturnType(const FunctionDecl *FD, QualType ReturnType) override; |
| 102 | void CompletedImplicitDefinition(const FunctionDecl *D) override; |
| 103 | void StaticDataMemberInstantiated(const VarDecl *D) override; |
| 104 | void AddedObjCCategoryToInterface(const ObjCCategoryDecl *CatD, |
| 105 | const ObjCInterfaceDecl *IFD) override; |
| 106 | void AddedObjCPropertyInClassExtension(const ObjCPropertyDecl *Prop, |
| 107 | const ObjCPropertyDecl *OrigProp, |
| 108 | const ObjCCategoryDecl *ClassExt) override; |
| 109 | void DeclarationMarkedUsed(const Decl *D) override; |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 110 | void DeclarationMarkedOpenMPThreadPrivate(const Decl *D) override; |
Eli Friedman | 86164e8 | 2013-09-05 00:02:25 +0000 | [diff] [blame] | 111 | |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 112 | private: |
| 113 | std::vector<ASTMutationListener*> Listeners; |
| 114 | }; |
| 115 | |
| 116 | MultiplexASTMutationListener::MultiplexASTMutationListener( |
Argyrios Kyrtzidis | 409e245 | 2012-02-10 20:10:38 +0000 | [diff] [blame] | 117 | ArrayRef<ASTMutationListener*> L) |
| 118 | : Listeners(L.begin(), L.end()) { |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | void MultiplexASTMutationListener::CompletedTagDefinition(const TagDecl *D) { |
| 122 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 123 | Listeners[i]->CompletedTagDefinition(D); |
| 124 | } |
| 125 | |
| 126 | void MultiplexASTMutationListener::AddedVisibleDecl( |
| 127 | const DeclContext *DC, const Decl *D) { |
| 128 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 129 | Listeners[i]->AddedVisibleDecl(DC, D); |
| 130 | } |
| 131 | |
| 132 | void MultiplexASTMutationListener::AddedCXXImplicitMember( |
| 133 | const CXXRecordDecl *RD, const Decl *D) { |
| 134 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 135 | Listeners[i]->AddedCXXImplicitMember(RD, D); |
| 136 | } |
| 137 | void MultiplexASTMutationListener::AddedCXXTemplateSpecialization( |
| 138 | const ClassTemplateDecl *TD, const ClassTemplateSpecializationDecl *D) { |
| 139 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 140 | Listeners[i]->AddedCXXTemplateSpecialization(TD, D); |
| 141 | } |
Sebastian Redl | 5bbcdbf | 2011-04-14 14:07:59 +0000 | [diff] [blame] | 142 | void MultiplexASTMutationListener::AddedCXXTemplateSpecialization( |
Larisse Voufo | ef4579c | 2013-08-06 01:03:05 +0000 | [diff] [blame] | 143 | const VarTemplateDecl *TD, const VarTemplateSpecializationDecl *D) { |
| 144 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 145 | Listeners[i]->AddedCXXTemplateSpecialization(TD, D); |
| 146 | } |
| 147 | void MultiplexASTMutationListener::AddedCXXTemplateSpecialization( |
Sebastian Redl | 5bbcdbf | 2011-04-14 14:07:59 +0000 | [diff] [blame] | 148 | const FunctionTemplateDecl *TD, const FunctionDecl *D) { |
| 149 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 150 | Listeners[i]->AddedCXXTemplateSpecialization(TD, D); |
| 151 | } |
Richard Smith | 9dadfab | 2013-05-11 05:45:24 +0000 | [diff] [blame] | 152 | void MultiplexASTMutationListener::DeducedReturnType(const FunctionDecl *FD, |
| 153 | QualType ReturnType) { |
| 154 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 155 | Listeners[i]->DeducedReturnType(FD, ReturnType); |
| 156 | } |
Sebastian Redl | 58a2cd8 | 2011-04-24 16:28:06 +0000 | [diff] [blame] | 157 | void MultiplexASTMutationListener::CompletedImplicitDefinition( |
| 158 | const FunctionDecl *D) { |
| 159 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 160 | Listeners[i]->CompletedImplicitDefinition(D); |
| 161 | } |
Sebastian Redl | f79a719 | 2011-04-29 08:19:30 +0000 | [diff] [blame] | 162 | void MultiplexASTMutationListener::StaticDataMemberInstantiated( |
| 163 | const VarDecl *D) { |
| 164 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 165 | Listeners[i]->StaticDataMemberInstantiated(D); |
| 166 | } |
Argyrios Kyrtzidis | 1da95db | 2012-02-10 20:10:36 +0000 | [diff] [blame] | 167 | void MultiplexASTMutationListener::AddedObjCCategoryToInterface( |
| 168 | const ObjCCategoryDecl *CatD, |
| 169 | const ObjCInterfaceDecl *IFD) { |
| 170 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 171 | Listeners[i]->AddedObjCCategoryToInterface(CatD, IFD); |
| 172 | } |
| 173 | void MultiplexASTMutationListener::AddedObjCPropertyInClassExtension( |
| 174 | const ObjCPropertyDecl *Prop, |
| 175 | const ObjCPropertyDecl *OrigProp, |
| 176 | const ObjCCategoryDecl *ClassExt) { |
| 177 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 178 | Listeners[i]->AddedObjCPropertyInClassExtension(Prop, OrigProp, ClassExt); |
| 179 | } |
Eli Friedman | 86164e8 | 2013-09-05 00:02:25 +0000 | [diff] [blame] | 180 | void MultiplexASTMutationListener::DeclarationMarkedUsed(const Decl *D) { |
| 181 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 182 | Listeners[i]->DeclarationMarkedUsed(D); |
| 183 | } |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 184 | void MultiplexASTMutationListener::DeclarationMarkedOpenMPThreadPrivate( |
| 185 | const Decl *D) { |
| 186 | for (size_t i = 0, e = Listeners.size(); i != e; ++i) |
| 187 | Listeners[i]->DeclarationMarkedOpenMPThreadPrivate(D); |
| 188 | } |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 189 | |
| 190 | } // end namespace clang |
| 191 | |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 192 | MultiplexConsumer::MultiplexConsumer( |
| 193 | std::vector<std::unique_ptr<ASTConsumer>> C) |
| 194 | : Consumers(std::move(C)), MutationListener(), DeserializationListener() { |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 195 | // Collect the mutation listeners and deserialization listeners of all |
| 196 | // children, and create a multiplex listener each if so. |
| 197 | std::vector<ASTMutationListener*> mutationListeners; |
| 198 | std::vector<ASTDeserializationListener*> serializationListeners; |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 199 | for (auto &Consumer : Consumers) { |
| 200 | if (auto *mutationListener = Consumer->GetASTMutationListener()) |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 201 | mutationListeners.push_back(mutationListener); |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 202 | if (auto *serializationListener = Consumer->GetASTDeserializationListener()) |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 203 | serializationListeners.push_back(serializationListener); |
| 204 | } |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 205 | if (!mutationListeners.empty()) { |
| 206 | MutationListener = |
| 207 | llvm::make_unique<MultiplexASTMutationListener>(mutationListeners); |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 208 | } |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 209 | if (!serializationListeners.empty()) { |
| 210 | DeserializationListener = |
| 211 | llvm::make_unique<MultiplexASTDeserializationListener>( |
| 212 | serializationListeners); |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 213 | } |
| 214 | } |
| 215 | |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 216 | MultiplexConsumer::~MultiplexConsumer() {} |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 217 | |
| 218 | void MultiplexConsumer::Initialize(ASTContext &Context) { |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 219 | for (auto &Consumer : Consumers) |
| 220 | Consumer->Initialize(Context); |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 221 | } |
| 222 | |
Argyrios Kyrtzidis | 88c2596 | 2011-11-18 00:26:59 +0000 | [diff] [blame] | 223 | bool MultiplexConsumer::HandleTopLevelDecl(DeclGroupRef D) { |
Argyrios Kyrtzidis | 6f3ce97 | 2011-11-28 04:56:00 +0000 | [diff] [blame] | 224 | bool Continue = true; |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 225 | for (auto &Consumer : Consumers) |
| 226 | Continue = Continue && Consumer->HandleTopLevelDecl(D); |
Argyrios Kyrtzidis | 6f3ce97 | 2011-11-28 04:56:00 +0000 | [diff] [blame] | 227 | return Continue; |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 228 | } |
| 229 | |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 230 | void MultiplexConsumer::HandleInlineMethodDefinition(CXXMethodDecl *D) { |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 231 | for (auto &Consumer : Consumers) |
| 232 | Consumer->HandleInlineMethodDefinition(D); |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 233 | } |
| 234 | |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 235 | void MultiplexConsumer::HandleCXXStaticMemberVarInstantiation(VarDecl *VD) { |
| 236 | for (auto &Consumer : Consumers) |
| 237 | Consumer->HandleCXXStaticMemberVarInstantiation(VD); |
Rafael Espindola | 234fe65 | 2012-03-05 10:54:55 +0000 | [diff] [blame] | 238 | } |
| 239 | |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 240 | void MultiplexConsumer::HandleInterestingDecl(DeclGroupRef D) { |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 241 | for (auto &Consumer : Consumers) |
| 242 | Consumer->HandleInterestingDecl(D); |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 243 | } |
| 244 | |
| 245 | void MultiplexConsumer::HandleTranslationUnit(ASTContext &Ctx) { |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 246 | for (auto &Consumer : Consumers) |
| 247 | Consumer->HandleTranslationUnit(Ctx); |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 248 | } |
| 249 | |
| 250 | void MultiplexConsumer::HandleTagDeclDefinition(TagDecl *D) { |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 251 | for (auto &Consumer : Consumers) |
| 252 | Consumer->HandleTagDeclDefinition(D); |
| 253 | } |
| 254 | |
| 255 | void MultiplexConsumer::HandleTagDeclRequiredDefinition(const TagDecl *D) { |
| 256 | for (auto &Consumer : Consumers) |
| 257 | Consumer->HandleTagDeclRequiredDefinition(D); |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 258 | } |
| 259 | |
Argyrios Kyrtzidis | 6d96836 | 2012-02-10 20:10:44 +0000 | [diff] [blame] | 260 | void MultiplexConsumer::HandleCXXImplicitFunctionInstantiation(FunctionDecl *D){ |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 261 | for (auto &Consumer : Consumers) |
| 262 | Consumer->HandleCXXImplicitFunctionInstantiation(D); |
Argyrios Kyrtzidis | 6d96836 | 2012-02-10 20:10:44 +0000 | [diff] [blame] | 263 | } |
| 264 | |
Argyrios Kyrtzidis | 6f3ce97 | 2011-11-28 04:56:00 +0000 | [diff] [blame] | 265 | void MultiplexConsumer::HandleTopLevelDeclInObjCContainer(DeclGroupRef D) { |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 266 | for (auto &Consumer : Consumers) |
| 267 | Consumer->HandleTopLevelDeclInObjCContainer(D); |
| 268 | } |
| 269 | |
| 270 | void MultiplexConsumer::HandleImplicitImportDecl(ImportDecl *D) { |
| 271 | for (auto &Consumer : Consumers) |
| 272 | Consumer->HandleImplicitImportDecl(D); |
| 273 | } |
| 274 | |
| 275 | void MultiplexConsumer::HandleLinkerOptionPragma(llvm::StringRef Opts) { |
| 276 | for (auto &Consumer : Consumers) |
| 277 | Consumer->HandleLinkerOptionPragma(Opts); |
| 278 | } |
| 279 | |
| 280 | void MultiplexConsumer::HandleDetectMismatch(llvm::StringRef Name, llvm::StringRef Value) { |
| 281 | for (auto &Consumer : Consumers) |
| 282 | Consumer->HandleDetectMismatch(Name, Value); |
| 283 | } |
| 284 | |
| 285 | void MultiplexConsumer::HandleDependentLibrary(llvm::StringRef Lib) { |
| 286 | for (auto &Consumer : Consumers) |
| 287 | Consumer->HandleDependentLibrary(Lib); |
Argyrios Kyrtzidis | 6f3ce97 | 2011-11-28 04:56:00 +0000 | [diff] [blame] | 288 | } |
| 289 | |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 290 | void MultiplexConsumer::CompleteTentativeDefinition(VarDecl *D) { |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 291 | for (auto &Consumer : Consumers) |
| 292 | Consumer->CompleteTentativeDefinition(D); |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 293 | } |
| 294 | |
| 295 | void MultiplexConsumer::HandleVTable( |
| 296 | CXXRecordDecl *RD, bool DefinitionRequired) { |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 297 | for (auto &Consumer : Consumers) |
| 298 | Consumer->HandleVTable(RD, DefinitionRequired); |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | ASTMutationListener *MultiplexConsumer::GetASTMutationListener() { |
| 302 | return MutationListener.get(); |
| 303 | } |
| 304 | |
| 305 | ASTDeserializationListener *MultiplexConsumer::GetASTDeserializationListener() { |
| 306 | return DeserializationListener.get(); |
| 307 | } |
| 308 | |
| 309 | void MultiplexConsumer::PrintStats() { |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 310 | for (auto &Consumer : Consumers) |
| 311 | Consumer->PrintStats(); |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 312 | } |
| 313 | |
| 314 | void MultiplexConsumer::InitializeSema(Sema &S) { |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 315 | for (auto &Consumer : Consumers) |
| 316 | if (SemaConsumer *SC = dyn_cast<SemaConsumer>(Consumer.get())) |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 317 | SC->InitializeSema(S); |
| 318 | } |
| 319 | |
| 320 | void MultiplexConsumer::ForgetSema() { |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 321 | for (auto &Consumer : Consumers) |
| 322 | if (SemaConsumer *SC = dyn_cast<SemaConsumer>(Consumer.get())) |
Nico Weber | 5aa74af | 2011-01-25 20:34:14 +0000 | [diff] [blame] | 323 | SC->ForgetSema(); |
| 324 | } |