Skip to content

Commit 4f759ff

Browse files
authored
Merge pull request #7588 from apple/cherrypick/rebranch/29a1567435ed
[DWARFLinker] Release input DWARF after object has been linked (llvm#68376)
2 parents e5921e4 + ab5871e commit 4f759ff

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

llvm/include/llvm/DWARFLinker/DWARFLinker.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@ class DWARFFile {
276276

277277
/// Helpful address information(list of valid address ranges, relocations).
278278
std::unique_ptr<AddressesMap> Addresses;
279+
280+
/// Unloads object file and corresponding AddressesMap and Dwarf Context.
281+
void unload() {
282+
Addresses.reset();
283+
Dwarf.reset();
284+
}
279285
};
280286

281287
typedef std::map<std::string, std::string> swiftInterfacesMap;
@@ -524,7 +530,8 @@ class DWARFLinker {
524530
/// the debug object.
525531
void clear() {
526532
CompileUnits.clear();
527-
File.Addresses->clear();
533+
ModuleUnits.clear();
534+
File.unload();
528535
}
529536
};
530537

0 commit comments

Comments
 (0)