};
llvm::DenseMap<Module*, PerModuleInitializers*> ModuleInitializers;
- /// Diagnostics that are emitted if and only if the given function is
- /// codegen'ed. Access these through FunctionDecl::addDeferredDiag() and
- /// FunctionDecl::takeDeferredDiags().
- llvm::DenseMap<const FunctionDecl *, std::vector<PartialDiagnosticAt>>
- DeferredDiags;
-
public:
/// \brief A type synonym for the TemplateOrInstantiation mapping.
typedef llvm::PointerUnion<VarTemplateDecl *, MemberSpecializationInfo *>
/// \brief Allocator for partial diagnostics.
PartialDiagnostic::StorageAllocator DiagAllocator;
+ /// Diagnostics that are emitted if and only if the given function is
+ /// codegen'ed. Access these through FunctionDecl::addDeferredDiag() and
+ /// FunctionDecl::takeDeferredDiags().
+ llvm::DenseMap<const FunctionDecl *, std::vector<PartialDiagnosticAt>>
+ DeferredDiags;
+
/// \brief The current C++ ABI.
std::unique_ptr<CXXABI> ABI;
CXXABI *createCXXABI(const TargetInfo &T);
DiagnosticBuilder Builder(getDiags().Report(Loc, PD.getDiagID()));
PD.Emit(Builder);
}
+ // Clear the deferred diags so they don't outlive the ASTContext's
+ // PartialDiagnostic allocator.
+ DeferredDiags.clear();
}
void CodeGenModule::UpdateCompletedType(const TagDecl *TD) {