Backed out changeset 5669c20b0617 (bug 1903669) for causing crashtest failures on...
[gecko.git] / build / build-clang / partial-revert-llvmorg-15-init-11205-gcead4eceb01b_clang_18.patch
blob457120e78d213b62f7956cba8c00817e4d4455bc
1 This partially reverts commit cead4eceb01b935fae07bf4a7e91911b344d2fec for
2 causing timeouts on some webrtc tests under TSan (bug 1798613), presumably
3 because the change made llvm-symbolizer too slow.
5 diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
6 index 792df53d304a..75692d56ee55 100644
7 --- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
8 +++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
9 @@ -1520,25 +1520,7 @@ DWARFCompileUnit *DWARFContext::getCompileUnitForCodeAddress(uint64_t Address) {
11 DWARFCompileUnit *DWARFContext::getCompileUnitForDataAddress(uint64_t Address) {
12 uint64_t CUOffset = getDebugAranges()->findAddress(Address);
13 - if (DWARFCompileUnit *OffsetCU = getCompileUnitForOffset(CUOffset))
14 - return OffsetCU;
16 - // Global variables are often missed by the above search, for one of two
17 - // reasons:
18 - // 1. .debug_aranges may not include global variables. On clang, it seems we
19 - // put the globals in the aranges, but this isn't true for gcc.
20 - // 2. Even if the global variable is in a .debug_arange, global variables
21 - // may not be captured in the [start, end) addresses described by the
22 - // parent compile unit.
23 - //
24 - // So, we walk the CU's and their child DI's manually, looking for the
25 - // specific global variable.
26 - for (std::unique_ptr<DWARFUnit> &CU : compile_units()) {
27 - if (CU->getVariableForAddress(Address)) {
28 - return static_cast<DWARFCompileUnit *>(CU.get());
29 - }
30 - }
31 - return nullptr;
32 + return getCompileUnitForOffset(CUOffset);
35 DWARFContext::DIEsForAddress DWARFContext::getDIEsForAddress(uint64_t Address,