[llvm] [BOLT][DWARF][NFC] Cleanup version check (PR #97839)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 5 11:05:37 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-bolt

Author: Sayhaan Siddiqui (sayhaan)

<details>
<summary>Changes</summary>

Cleans up version check to remove redundant else branch.

---
Full diff: https://github.com/llvm/llvm-project/pull/97839.diff


1 Files Affected:

- (modified) bolt/lib/Rewrite/DWARFRewriter.cpp (+1-4) 


``````````diff
diff --git a/bolt/lib/Rewrite/DWARFRewriter.cpp b/bolt/lib/Rewrite/DWARFRewriter.cpp
index 1f426d0adfc61..bf27c64d14315 100644
--- a/bolt/lib/Rewrite/DWARFRewriter.cpp
+++ b/bolt/lib/Rewrite/DWARFRewriter.cpp
@@ -1342,10 +1342,7 @@ void DWARFRewriter::updateDWARFObjectAddressRanges(
       assert(RangesWriterIterator != LegacyRangesWritersByCU.end() &&
              "RangesWriter does not exist for DWOId");
       RangesWriterIterator->second->setDie(&Die);
-    } else if (Unit.getVersion() == 5) {
-      DIEBldr.addValue(&Die, dwarf::DW_AT_rnglists_base,
-                       dwarf::DW_FORM_sec_offset, DIEInteger(*RangesBase));
-    } else {
+    } else if (Unit.getVersion() >= 5) {
       DIEBldr.addValue(&Die, dwarf::DW_AT_rnglists_base,
                        dwarf::DW_FORM_sec_offset, DIEInteger(*RangesBase));
     }

``````````

</details>


https://github.com/llvm/llvm-project/pull/97839


More information about the llvm-commits mailing list