[llvm] [BOLT] Clean up DIEStreamer (NFC) (PR #95028)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 10 12:28:20 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-bolt
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
DIEStreamer no longer needs Rewriter, so we can remove the constructor
parameter and clean up the callers.
---
Full diff: https://github.com/llvm/llvm-project/pull/95028.diff
1 Files Affected:
- (modified) bolt/lib/Rewrite/DWARFRewriter.cpp (+7-8)
``````````diff
diff --git a/bolt/lib/Rewrite/DWARFRewriter.cpp b/bolt/lib/Rewrite/DWARFRewriter.cpp
index bf0e2bd0ab5a2..e1b3762a31660 100644
--- a/bolt/lib/Rewrite/DWARFRewriter.cpp
+++ b/bolt/lib/Rewrite/DWARFRewriter.cpp
@@ -278,8 +278,7 @@ class DIEStreamer : public DwarfStreamer {
}
public:
- DIEStreamer(DIEBuilder *DIEBldr, DWARFRewriter &Rewriter,
- GDBIndex &GDBIndexSection,
+ DIEStreamer(DIEBuilder *DIEBldr, GDBIndex &GDBIndexSection,
DWARFLinkerBase::OutputFileType OutFileType,
raw_pwrite_stream &OutFile,
DWARFLinkerBase::MessageHandlerTy Warning)
@@ -460,11 +459,11 @@ static std::optional<uint64_t> getAsAddress(const DWARFUnit &DU,
static std::unique_ptr<DIEStreamer>
createDIEStreamer(const Triple &TheTriple, raw_pwrite_stream &OutFile,
StringRef Swift5ReflectionSegmentName, DIEBuilder &DIEBldr,
- DWARFRewriter &Rewriter, GDBIndex &GDBIndexSection) {
+ GDBIndex &GDBIndexSection) {
std::unique_ptr<DIEStreamer> Streamer = std::make_unique<DIEStreamer>(
- &DIEBldr, Rewriter, GDBIndexSection,
- DWARFLinkerBase::OutputFileType::Object, OutFile,
+ &DIEBldr, GDBIndexSection, DWARFLinkerBase::OutputFileType::Object,
+ OutFile,
[&](const Twine &Warning, StringRef Context, const DWARFDie *) {});
Error Err = Streamer->init(TheTriple, Swift5ReflectionSegmentName);
if (Err)
@@ -502,7 +501,7 @@ emitDWOBuilder(const std::string &DWOName, DIEBuilder &DWODIEBuilder,
auto TheTriple = std::make_unique<Triple>(File->makeTriple());
std::unique_ptr<DIEStreamer> Streamer =
createDIEStreamer(*TheTriple, *ObjOS, "DwoStreamerInitAug2",
- DWODIEBuilder, Rewriter, GDBIndexSection);
+ DWODIEBuilder, GDBIndexSection);
DWARFRewriter::UnitMetaVectorType TUMetaVector;
DWARFRewriter::UnitMeta CUMI = {0, 0, 0};
if (SplitCU.getContext().getMaxDWOVersion() >= 5) {
@@ -733,7 +732,7 @@ void DWARFRewriter::updateDebugInfo() {
const object::ObjectFile *File = BC.DwCtx->getDWARFObj().getFile();
auto TheTriple = std::make_unique<Triple>(File->makeTriple());
std::unique_ptr<DIEStreamer> Streamer = createDIEStreamer(
- *TheTriple, *ObjOS, "TypeStreamer", DIEBlder, *this, GDBIndexSection);
+ *TheTriple, *ObjOS, "TypeStreamer", DIEBlder, GDBIndexSection);
CUOffsetMap OffsetMap =
finalizeTypeSections(DIEBlder, *Streamer, GDBIndexSection);
@@ -1456,7 +1455,7 @@ CUOffsetMap DWARFRewriter::finalizeTypeSections(DIEBuilder &DIEBlder,
const object::ObjectFile *File = BC.DwCtx->getDWARFObj().getFile();
auto TheTriple = std::make_unique<Triple>(File->makeTriple());
std::unique_ptr<DIEStreamer> TypeStreamer = createDIEStreamer(
- *TheTriple, *ObjOS, "TypeStreamer", DIEBlder, *this, GDBIndexSection);
+ *TheTriple, *ObjOS, "TypeStreamer", DIEBlder, GDBIndexSection);
// generate debug_info and CUMap
CUOffsetMap CUMap;
``````````
</details>
https://github.com/llvm/llvm-project/pull/95028
More information about the llvm-commits
mailing list