Skip to content

Commit f4b8d25

Browse files
author
Kevin Frei
committed
Release line tables when we're done with them
1 parent 6731144 commit f4b8d25

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,8 @@ Error DwarfTransformer::convert(uint32_t NumThreads, OutputAggregator &Out) {
587587
DWARFDie Die = getDie(*CU);
588588
CUInfo CUI(DICtx, dyn_cast<DWARFCompileUnit>(CU.get()));
589589
handleDie(Out, CUI, Die);
590+
// Release the line table, once we're done.
591+
DICtx.clearLineTableForUnit(CU.get());
590592
}
591593
} else {
592594
// LLVM Dwarf parser is not thread-safe and we need to parse all DWARF up
@@ -612,7 +614,7 @@ Error DwarfTransformer::convert(uint32_t NumThreads, OutputAggregator &Out) {
612614
DWARFDie Die = getDie(*CU);
613615
if (Die) {
614616
CUInfo CUI(DICtx, dyn_cast<DWARFCompileUnit>(CU.get()));
615-
pool.async([this, CUI, &LogMutex, &Out, Die]() mutable {
617+
pool.async([this, CUI, &CU, &LogMutex, &Out, Die]() mutable {
616618
std::string storage;
617619
raw_string_ostream StrStream(storage);
618620
OutputAggregator ThreadOut(Out.GetOS() ? &StrStream : nullptr);
@@ -623,6 +625,9 @@ Error DwarfTransformer::convert(uint32_t NumThreads, OutputAggregator &Out) {
623625
StrStream.flush();
624626
Out << storage;
625627
}
628+
// Release the line table, once we're done.
629+
DICtx.clearLineTableForUnit(CU.get());
630+
626631
Out.Merge(ThreadOut);
627632
});
628633
}

0 commit comments

Comments
 (0)