Skip to content

Commit 23f1ba3

Browse files
Reapply "[NFC][DebugInfo][DWARF] Create new low-level dwarf library (#… (#145959) (#146112)
Reapply "[NFC][DebugInfo][DWARF] Create new low-level dwarf library (#… (#145959) This reapplies cbf781f, with fixes for the shared-library build and the unconventional sanitizer-runtime build. Original Description: This is the culmination of a series of changes described in [1]. Although somewhat large by line count, it is almost entirely mechanical, creating a new library in DebugInfo/DWARF/LowLevel. This new library has very minimal dependencies, allowing it to be used from more places than the normal DebugInfo/DWARF library--in particular from MC. 1. https://discourse.llvm.org/t/rfc-debuginfo-dwarf-refactor-into-to-lower-and-higher-level-libraries/86665/2
1 parent a4be46e commit 23f1ba3

File tree

57 files changed

+893
-801
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+893
-801
lines changed

bolt/include/bolt/Core/DIEBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#include "llvm/CodeGen/DIE.h"
2121
#include "llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h"
2222
#include "llvm/DebugInfo/DWARF/DWARFDie.h"
23-
#include "llvm/DebugInfo/DWARF/DWARFExpression.h"
2423
#include "llvm/DebugInfo/DWARF/DWARFUnit.h"
24+
#include "llvm/DebugInfo/DWARF/LowLevel/DWARFExpression.h"
2525
#include "llvm/Support/Allocator.h"
2626

2727
#include <list>

bolt/lib/Core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
set(LLVM_LINK_COMPONENTS
22
DebugInfoDWARF
3+
DebugInfoDWARFLowLevel
34
Demangle
45
MC
56
MCDisassembler

bolt/lib/Core/DIEBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
#include "llvm/CodeGen/DIE.h"
1515
#include "llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h"
1616
#include "llvm/DebugInfo/DWARF/DWARFDie.h"
17-
#include "llvm/DebugInfo/DWARF/DWARFExpression.h"
1817
#include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
1918
#include "llvm/DebugInfo/DWARF/DWARFTypeUnit.h"
2019
#include "llvm/DebugInfo/DWARF/DWARFUnit.h"
2120
#include "llvm/DebugInfo/DWARF/DWARFUnitIndex.h"
21+
#include "llvm/DebugInfo/DWARF/LowLevel/DWARFExpression.h"
2222
#include "llvm/Support/Casting.h"
2323
#include "llvm/Support/Debug.h"
2424
#include "llvm/Support/ErrorHandling.h"

bolt/lib/Core/DebugNames.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#include "bolt/Core/DebugNames.h"
1010
#include "bolt/Core/BinaryContext.h"
11-
#include "llvm/DebugInfo/DWARF/DWARFExpression.h"
1211
#include "llvm/DebugInfo/DWARF/DWARFTypeUnit.h"
12+
#include "llvm/DebugInfo/DWARF/LowLevel/DWARFExpression.h"
1313
#include "llvm/Support/EndianStream.h"
1414
#include "llvm/Support/LEB128.h"
1515
#include <cstdint>

bolt/lib/Rewrite/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
set(LLVM_LINK_COMPONENTS
22
Core
33
DebugInfoDWARF
4+
DebugInfoDWARFLowLevel
45
JITLink
56
MC
67
Object

bolt/lib/Rewrite/DWARFRewriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
2525
#include "llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h"
2626
#include "llvm/DebugInfo/DWARF/DWARFDebugLoc.h"
27-
#include "llvm/DebugInfo/DWARF/DWARFExpression.h"
2827
#include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
2928
#include "llvm/DebugInfo/DWARF/DWARFTypeUnit.h"
3029
#include "llvm/DebugInfo/DWARF/DWARFUnit.h"
30+
#include "llvm/DebugInfo/DWARF/LowLevel/DWARFExpression.h"
3131
#include "llvm/MC/MCAsmBackend.h"
3232
#include "llvm/MC/MCAssembler.h"
3333
#include "llvm/MC/MCObjectWriter.h"

compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ $LINK $LIBCXX_ARCHIVE_DIR/libc++.a \
174174
$LLVM_BUILD/lib/libLLVMObject.a \
175175
$LLVM_BUILD/lib/libLLVMBinaryFormat.a \
176176
$LLVM_BUILD/lib/libLLVMDebugInfoDWARF.a \
177+
$LLVM_BUILD/lib/libLLVMDebugInfoDWARFLowLevel.a \
177178
$LLVM_BUILD/lib/libLLVMDebugInfoGSYM.a \
178179
$LLVM_BUILD/lib/libLLVMSupport.a \
179180
$LLVM_BUILD/lib/libLLVMDebugInfoPDB.a \

lldb/source/Expression/DWARFExpression.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
#include "lldb/Target/StackID.h"
3737
#include "lldb/Target/Target.h"
3838
#include "lldb/Target/Thread.h"
39-
#include "llvm/DebugInfo/DWARF/DWARFExpression.h"
39+
#include "llvm/DebugInfo/DWARF/DWARFExpressionPrinter.h"
40+
#include "llvm/DebugInfo/DWARF/LowLevel/DWARFExpression.h"
4041

4142
using namespace lldb;
4243
using namespace lldb_private;
@@ -81,7 +82,7 @@ void DWARFExpression::DumpLocation(Stream *s, lldb::DescriptionLevel level,
8182
llvm::DIDumpOptions DumpOpts;
8283
DumpOpts.GetNameForDWARFReg = GetRegName;
8384
llvm::DWARFExpression E(m_data.GetAsLLVM(), m_data.GetAddressByteSize());
84-
llvm::DWARFExpressionPrinter::print(&E, s->AsRawOstream(), DumpOpts, nullptr);
85+
llvm::printDwarfExpression(&E, s->AsRawOstream(), DumpOpts, nullptr);
8586
}
8687

8788
RegisterKind DWARFExpression::GetRegisterKind() const { return m_reg_kind; }

lldb/source/Symbol/UnwindPlan.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
#include "lldb/Utility/Log.h"
1818
#include "llvm/ADT/STLExtras.h"
1919
#include "llvm/DebugInfo/DIContext.h"
20-
#include "llvm/DebugInfo/DWARF/DWARFExpression.h"
20+
#include "llvm/DebugInfo/DWARF/DWARFExpressionPrinter.h"
21+
#include "llvm/DebugInfo/DWARF/LowLevel/DWARFExpression.h"
2122
#include <optional>
2223

2324
using namespace lldb;
@@ -89,8 +90,7 @@ static void DumpDWARFExpr(Stream &s, llvm::ArrayRef<uint8_t> expr, Thread *threa
8990
order_and_width->second);
9091
llvm::DWARFExpression E(data, order_and_width->second,
9192
llvm::dwarf::DWARF32);
92-
llvm::DWARFExpressionPrinter::print(&E, s.AsRawOstream(),
93-
llvm::DIDumpOptions(), nullptr);
93+
printDwarfExpression(&E, s.AsRawOstream(), llvm::DIDumpOptions(), nullptr);
9494
} else
9595
s.PutCString("dwarf-expr");
9696
}

lldb/unittests/Symbol/PostfixExpressionTest.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
#include "lldb/Utility/StreamString.h"
1212
#include "llvm/ADT/StringExtras.h"
1313
#include "llvm/DebugInfo/DIContext.h"
14-
#include "llvm/DebugInfo/DWARF/DWARFExpression.h"
14+
#include "llvm/DebugInfo/DWARF/DWARFExpressionPrinter.h"
15+
#include "llvm/DebugInfo/DWARF/LowLevel/DWARFExpression.h"
1516
#include "llvm/Support/FormatVariadic.h"
1617
#include "llvm/Support/raw_ostream.h"
1718
#include "gmock/gmock.h"
@@ -160,7 +161,7 @@ static std::string ParseAndGenerateDWARF(llvm::StringRef expr) {
160161
std::string result;
161162
llvm::raw_string_ostream os(result);
162163
llvm::DWARFExpression E(extractor, addr_size, llvm::dwarf::DWARF32);
163-
llvm::DWARFExpressionPrinter::print(&E, os, llvm::DIDumpOptions(), nullptr);
164+
llvm::printDwarfExpression(&E, os, llvm::DIDumpOptions(), nullptr);
164165
return result;
165166
}
166167

0 commit comments

Comments
 (0)