/// tree.
virtual void InitializeSema(Sema &S);
+ /// \brief Inform the semantic consumer that Sema is no longer available.
+ virtual void ForgetSema() { SemaObj = 0; }
+
/// \brief Retrieve the IdentifierInfo for the named identifier.
///
/// This routine builds a new IdentifierInfo for the given identifier. If any
/// tree.
virtual void InitializeSema(Sema &S) {}
+ /// \brief Inform the semantic consumer that Sema is no longer available.
+ virtual void ForgetSema() {}
+
/// \brief Load the contents of the global method pool for a given
/// selector.
///
/// tree.
virtual void InitializeSema(Sema &S) {}
+ /// \brief Inform the semantic consumer that Sema is no longer available.
+ virtual void ForgetSema() {}
+
// isa/cast/dyn_cast support
static bool classof(const ASTConsumer *Consumer) {
return Consumer->SemaConsumer;
while ((ADecl = P.RetrievePendingObjCImpDecl()))
Consumer->HandleTopLevelDecl(ADecl.getAsVal<DeclGroupRef>());
- // process any TopLevelDecls generated by #pragma weak
+ // Process any TopLevelDecls generated by #pragma weak.
for (llvm::SmallVector<Decl*,2>::iterator
I = S.WeakTopLevelDecls().begin(),
E = S.WeakTopLevelDecls().end(); I != E; ++I)
Consumer->HandleTranslationUnit(Ctx);
+ if (ExternalSemaSource *ESS =
+ dyn_cast_or_null<ExternalSemaSource>(Ctx.getExternalSource()))
+ ESS->ForgetSema();
+
+ if (SemaConsumer *SC = dyn_cast<SemaConsumer>(Consumer))
+ SC->ForgetSema();
+
if (PrintStats) {
fprintf(stderr, "\nSTATISTICS:\n");
P.getActions().PrintStats();