@@ -587,6 +587,8 @@ Error DwarfTransformer::convert(uint32_t NumThreads, OutputAggregator &Out) {
587
587
DWARFDie Die = getDie (*CU);
588
588
CUInfo CUI (DICtx, dyn_cast<DWARFCompileUnit>(CU.get ()));
589
589
handleDie (Out, CUI, Die);
590
+ // Release the line table, once we're done.
591
+ DICtx.clearLineTableForUnit (CU.get ());
590
592
}
591
593
} else {
592
594
// 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) {
612
614
DWARFDie Die = getDie (*CU);
613
615
if (Die) {
614
616
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 {
616
618
std::string storage;
617
619
raw_string_ostream StrStream (storage);
618
620
OutputAggregator ThreadOut (Out.GetOS () ? &StrStream : nullptr );
@@ -623,6 +625,9 @@ Error DwarfTransformer::convert(uint32_t NumThreads, OutputAggregator &Out) {
623
625
StrStream.flush ();
624
626
Out << storage;
625
627
}
628
+ // Release the line table, once we're done.
629
+ DICtx.clearLineTableForUnit (CU.get ());
630
+
626
631
Out.Merge (ThreadOut);
627
632
});
628
633
}
0 commit comments