diff options
author | Alexander Yermolovich <ayermolo@fb.com> | 2021-08-02 10:41:35 -0700 |
---|---|---|
committer | Alexander Yermolovich <ayermolo@fb.com> | 2021-08-02 10:41:47 -0700 |
commit | 5a865b0b1ee650bc4d9b96fea98a1daa8e5933b6 (patch) | |
tree | b8ca23a66ddd019ff24a3d9a30fd54e9641c9078 /llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp | |
parent | ce1c59dea6d01e8ec3d4cb911438254283e4646c (diff) | |
download | llvm-5a865b0b1ee650bc4d9b96fea98a1daa8e5933b6.zip llvm-5a865b0b1ee650bc4d9b96fea98a1daa8e5933b6.tar.gz llvm-5a865b0b1ee650bc4d9b96fea98a1daa8e5933b6.tar.bz2 |
[DWARF] Don't process .debug_info relocations for DWO Context
When we build with split dwarf in single mode the .o files that contain both "normal" debug sections and dwo sections, along with relocaiton sections for "normal" debug sections.
When we create DWARF context in DWARFObjInMemory we process relocations and store them in the map for .debug_info, etc section.
For DWO Context we also do it for non dwo dwarf sections. Which I believe is not necessary. This leads to a lot of memory being wasted. We observed 70GB extra memory being used.
I went with context sensitive approach, flag is passed in. I am not sure if it's always safe not to process relocations for regular debug sections if Obj contains .dwo sections.
If it is alternatvie might be just to scan, in constructor, sections and if there are .dwo sections not to process regular debug ones.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D106624
Diffstat (limited to 'llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp')
-rw-r--r-- | llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp index 4cafc9a..9a48066 100644 --- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp @@ -2519,8 +2519,9 @@ TEST(DWARFDebugInfo, TestErrorReporting) { // DWARFContext parses whole file and finds the two errors we expect. int Errors = 0; - std::unique_ptr<DWARFContext> Ctx1 = - DWARFContext::create(**Obj, nullptr, "", [&](Error E) { + std::unique_ptr<DWARFContext> Ctx1 = DWARFContext::create( + **Obj, DWARFContext::ProcessDebugRelocations::Process, nullptr, "", + [&](Error E) { ++Errors; consumeError(std::move(E)); }); |