[llvm] 162c275 - [dsymutil] Stop emulating dsymutil-classic CIE caching behavior
Jonas Devlieghere via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 6 20:17:48 PDT 2021
Author: Jonas Devlieghere
Date: 2021-04-06T20:15:41-07:00
New Revision: 162c2759b66a5ecc5ffa59fb0e894e8bbb377f6a
URL: https://github.com/llvm/llvm-project/commit/162c2759b66a5ecc5ffa59fb0e894e8bbb377f6a
DIFF: https://github.com/llvm/llvm-project/commit/162c2759b66a5ecc5ffa59fb0e894e8bbb377f6a.diff
LOG: [dsymutil] Stop emulating dsymutil-classic CIE caching behavior
Stop emulating dsymutil-classic which only cached the last used CIE for
reuse.
Added:
Modified:
llvm/lib/DWARFLinker/DWARFLinker.cpp
llvm/test/tools/dsymutil/X86/frame-2.test
Removed:
################################################################################
diff --git a/llvm/lib/DWARFLinker/DWARFLinker.cpp b/llvm/lib/DWARFLinker/DWARFLinker.cpp
index 6fe3cbdc8836..3ad1f48aff2e 100644
--- a/llvm/lib/DWARFLinker/DWARFLinker.cpp
+++ b/llvm/lib/DWARFLinker/DWARFLinker.cpp
@@ -1901,12 +1901,7 @@ void DWARFLinker::patchFrameInfoForObject(const DWARFFile &File,
auto IteratorInserted = EmittedCIEs.insert(
std::make_pair(CIEData, TheDwarfEmitter->getFrameSectionSize()));
// If there is no CIE yet for this ID, emit it.
- if (IteratorInserted.second ||
- // FIXME: dsymutil-classic only caches the last used CIE for
- // reuse. Mimic that behavior for now. Just removing that
- // second half of the condition and the LastCIEOffset variable
- // makes the code DTRT.
- LastCIEOffset != IteratorInserted.first->getValue()) {
+ if (IteratorInserted.second) {
LastCIEOffset = TheDwarfEmitter->getFrameSectionSize();
IteratorInserted.first->getValue() = LastCIEOffset;
TheDwarfEmitter->emitCIE(CIEData);
diff --git a/llvm/test/tools/dsymutil/X86/frame-2.test b/llvm/test/tools/dsymutil/X86/frame-2.test
index 235d2ca18ca1..4ae94e25f7ca 100644
--- a/llvm/test/tools/dsymutil/X86/frame-2.test
+++ b/llvm/test/tools/dsymutil/X86/frame-2.test
@@ -7,9 +7,6 @@
# Check the handling of multiple
diff erent CIEs. To have CIEs that
# appear to be
diff erent, use a dwarf2 version of the file along with
# a dwarf 4 version. The CIE header version (and layout) will be
diff erent.
-# FIXME: this test also checks that we didn't reuse the first CIE when it
-# appears again. This is a behavior we inherited from dsymutil-classic
-# but this should be fixed (see comment in patchFrameInfoForObject())
---
triple: 'i386-apple-darwin'
objects:
@@ -39,11 +36,6 @@ objects:
# CHECK-NEXT: Version:{{.*}}4
# CHECK-NOT: FDE
# CHECK: FDE cie=[[CIEDW4]] pc=00003000...00003
-# CHECK-NOT: FDE
-# CHECK: [[CIEDW2:[0-9a-f]*]] {{[0-9a-f]*}} ffffffff CIE
-# CHECK-NEXT: Format: DWARF32
-# CHECK-NEXT: Version:{{.*}}1
-# CHECK-NOT: FDE
-# CHECK: FDE cie=[[CIEDW2]] pc=00004000...00004
+# CHECK: FDE cie=00000000 pc=00004000...00004
# CHECK-NOT: FDE
# CHECK: .eh_frame contents:
More information about the llvm-commits
mailing list