[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:
Chandler Carruth 2014-05-03 10:39:05 +00:00
parent ddd0cb5ecf
commit 7ff07727b5
2 changed files with 8 additions and 1 deletions

View File

@ -73,6 +73,8 @@ public:
struct FilesMade : public llvm::FoldingSet<PDFileEntry> {
llvm::BumpPtrAllocator Alloc;
~FilesMade();
void addDiagnostic(const PathDiagnostic &PD,
StringRef ConsumerName,
StringRef fileName);

View File

@ -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) {