[llvm] [BOLT][DWARF][NFC] Cleanup RangesBase check (PR #97840)
Sayhaan Siddiqui via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 5 10:55:40 PDT 2024
https://github.com/sayhaan updated https://github.com/llvm/llvm-project/pull/97840
>From 419734c3c36b4ecc2552ef9ddf0d68dd60222925 Mon Sep 17 00:00:00 2001
From: Sayhaan Siddiqui <sayhaan at meta.com>
Date: Fri, 28 Jun 2024 11:20:30 -0700
Subject: [PATCH 1/2] Cleanup RangesBase check
Summary:
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: https://phabricator.intern.facebook.com/D59175269
---
bolt/lib/Rewrite/DWARFRewriter.cpp | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/bolt/lib/Rewrite/DWARFRewriter.cpp b/bolt/lib/Rewrite/DWARFRewriter.cpp
index 1f426d0adfc61c..b054770646a0a9 100644
--- a/bolt/lib/Rewrite/DWARFRewriter.cpp
+++ b/bolt/lib/Rewrite/DWARFRewriter.cpp
@@ -2165,21 +2165,21 @@ void DWARFRewriter::convertToRangesPatchDebugInfo(
DIEBldr.replaceValue(&Die, LowPCAttrInfo.getAttribute(),
LowPCAttrInfo.getForm(), DIEInteger(0));
}
- }
- // Original CU didn't have DW_AT_*_base. We converted it's children (or
- // dwo), so need to insert it into CU.
- if (RangesBase) {
- if (Unit.getVersion() >= 5) {
- DIEBldr.addValue(&Die, RangeBaseAttribute, dwarf::DW_FORM_sec_offset,
- DIEInteger(*RangesBase));
- } else {
- DIEBldr.addValue(&Die, RangeBaseAttribute, dwarf::DW_FORM_sec_offset,
- DIEInteger(INT_MAX));
- auto RangesWriterIterator =
- LegacyRangesWritersByCU.find(*Unit.getDWOId());
- assert(RangesWriterIterator != LegacyRangesWritersByCU.end() &&
- "RangesWriter does not exist for DWOId");
- RangesWriterIterator->second->setDie(&Die);
+ // Original CU didn't have DW_AT_*_base. We converted it's children (or
+ // dwo), so need to insert it into CU.
+ if (RangesBase) {
+ if (Unit.getVersion() >= 5) {
+ DIEBldr.addValue(&Die, RangeBaseAttribute, dwarf::DW_FORM_sec_offset,
+ DIEInteger(*RangesBase));
+ } else {
+ DIEBldr.addValue(&Die, RangeBaseAttribute, dwarf::DW_FORM_sec_offset,
+ DIEInteger(INT_MAX));
+ auto RangesWriterIterator =
+ LegacyRangesWritersByCU.find(*Unit.getDWOId());
+ assert(RangesWriterIterator != LegacyRangesWritersByCU.end() &&
+ "RangesWriter does not exist for DWOId");
+ RangesWriterIterator->second->setDie(&Die);
+ }
}
}
>From 2922b73874e55b637ba785d50822c42ac6c79d73 Mon Sep 17 00:00:00 2001
From: Sayhaan Siddiqui <sayhaan at meta.com>
Date: Fri, 5 Jul 2024 10:13:16 -0700
Subject: [PATCH 2/2] Formatting changes
---
bolt/lib/Rewrite/DWARFRewriter.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bolt/lib/Rewrite/DWARFRewriter.cpp b/bolt/lib/Rewrite/DWARFRewriter.cpp
index b054770646a0a9..9bf73f1a7ae80d 100644
--- a/bolt/lib/Rewrite/DWARFRewriter.cpp
+++ b/bolt/lib/Rewrite/DWARFRewriter.cpp
@@ -2170,14 +2170,14 @@ void DWARFRewriter::convertToRangesPatchDebugInfo(
if (RangesBase) {
if (Unit.getVersion() >= 5) {
DIEBldr.addValue(&Die, RangeBaseAttribute, dwarf::DW_FORM_sec_offset,
- DIEInteger(*RangesBase));
+ DIEInteger(*RangesBase));
} else {
DIEBldr.addValue(&Die, RangeBaseAttribute, dwarf::DW_FORM_sec_offset,
- DIEInteger(INT_MAX));
+ DIEInteger(INT_MAX));
auto RangesWriterIterator =
LegacyRangesWritersByCU.find(*Unit.getDWOId());
assert(RangesWriterIterator != LegacyRangesWritersByCU.end() &&
- "RangesWriter does not exist for DWOId");
+ "RangesWriter does not exist for DWOId");
RangesWriterIterator->second->setDie(&Die);
}
}
More information about the llvm-commits
mailing list