Skip to content

Commit 99b0be2

Browse files
committed
RequirementMachine: Dump histograms after deleting requirement machine instances
1 parent 417b789 commit 99b0be2

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lib/AST/RequirementMachine/RewriteContext.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,16 @@ RequirementMachine *RewriteContext::getRequirementMachine(
671671
/// We print stats in the destructor, which should get executed at the end of
672672
/// a compilation job.
673673
RewriteContext::~RewriteContext() {
674+
for (const auto &pair : Machines)
675+
delete pair.second;
676+
677+
Machines.clear();
678+
679+
for (const auto &pair : Components)
680+
delete pair.second.Machine;
681+
682+
Components.clear();
683+
674684
if (Context.LangOpts.AnalyzeRequirementMachine) {
675685
llvm::dbgs() << "--- Requirement Machine Statistics ---\n";
676686
llvm::dbgs() << "\n* Symbol kind:\n";
@@ -690,14 +700,4 @@ RewriteContext::~RewriteContext() {
690700
llvm::dbgs() << "\n* Generating conformance equations:\n";
691701
GeneratingConformancesHistogram.dump(llvm::dbgs());
692702
}
693-
694-
for (const auto &pair : Machines)
695-
delete pair.second;
696-
697-
Machines.clear();
698-
699-
for (const auto &pair : Components)
700-
delete pair.second.Machine;
701-
702-
Components.clear();
703703
}

0 commit comments

Comments
 (0)