gecko-dev/build/build-clang/partial-revert-llvmorg-15-init-11205-gcead4eceb01b_clang_18.patch
Mike Hommey fb939bec25 Bug 1892128 - Simplify the llvm-symbolizer patch for bug 1798613. r=firefox-build-system-reviewers,sergesanspaille
Reverting the entire commit that is causing problems has caused a number
of conflicts with further changes in LLVM in the past year and a half,
making us have to revert a bunch of other patches.

Instead of doing that, we just revert the small part of the original
change that is causing the problem, avoiding conflicts with newer
changes. This also gives us a better hint at what's really going on.

Differential Revision: https://phabricator.services.mozilla.com/D207829
2024-04-18 19:48:58 +00:00

36 lines
1.6 KiB
Diff

This partially reverts commit cead4eceb01b935fae07bf4a7e91911b344d2fec for
causing timeouts on some webrtc tests under TSan (bug 1798613), presumably
because the change made llvm-symbolizer too slow.
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
index 792df53d304a..75692d56ee55 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -1520,25 +1520,7 @@ DWARFCompileUnit *DWARFContext::getCompileUnitForCodeAddress(uint64_t Address) {
DWARFCompileUnit *DWARFContext::getCompileUnitForDataAddress(uint64_t Address) {
uint64_t CUOffset = getDebugAranges()->findAddress(Address);
- if (DWARFCompileUnit *OffsetCU = getCompileUnitForOffset(CUOffset))
- return OffsetCU;
-
- // Global variables are often missed by the above search, for one of two
- // reasons:
- // 1. .debug_aranges may not include global variables. On clang, it seems we
- // put the globals in the aranges, but this isn't true for gcc.
- // 2. Even if the global variable is in a .debug_arange, global variables
- // may not be captured in the [start, end) addresses described by the
- // parent compile unit.
- //
- // So, we walk the CU's and their child DI's manually, looking for the
- // specific global variable.
- for (std::unique_ptr<DWARFUnit> &CU : compile_units()) {
- if (CU->getVariableForAddress(Address)) {
- return static_cast<DWARFCompileUnit *>(CU.get());
- }
- }
- return nullptr;
+ return getCompileUnitForOffset(CUOffset);
}
DWARFContext::DIEsForAddress DWARFContext::getDIEsForAddress(uint64_t Address,