forked from OSchip/llvm-project
[leaks] The PDFileEntry nodes in the FilesMade FoldingSet contain
a std::vector that allocates on the heap. As a consequence, we have to run all of their destructors when tearing down the set, not just deallocate the memory blobs. llvm-svn: 207902
This commit is contained in:
parent
ddd0cb5ecf
commit
7ff07727b5
|
@ -72,7 +72,9 @@ public:
|
|||
|
||||
struct FilesMade : public llvm::FoldingSet<PDFileEntry> {
|
||||
llvm::BumpPtrAllocator Alloc;
|
||||
|
||||
|
||||
~FilesMade();
|
||||
|
||||
void addDiagnostic(const PathDiagnostic &PD,
|
||||
StringRef ConsumerName,
|
||||
StringRef fileName);
|
||||
|
|
|
@ -451,6 +451,11 @@ void PathDiagnosticConsumer::FlushDiagnostics(
|
|||
Diags.clear();
|
||||
}
|
||||
|
||||
PathDiagnosticConsumer::FilesMade::~FilesMade() {
|
||||
for (PDFileEntry &Entry : *this)
|
||||
Entry.~PDFileEntry();
|
||||
}
|
||||
|
||||
void PathDiagnosticConsumer::FilesMade::addDiagnostic(const PathDiagnostic &PD,
|
||||
StringRef ConsumerName,
|
||||
StringRef FileName) {
|
||||
|
|
Loading…
Reference in New Issue