Skip to content

[BOLT][DWARF][NFC] Cleanup version check #97839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

sayhaan
Copy link
Member

@sayhaan sayhaan commented Jul 5, 2024

Cleans up version check to remove redundant else branch.

Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: https://phabricator.intern.facebook.com/D59175264
@sayhaan sayhaan marked this pull request as ready for review July 5, 2024 17:48
@llvmbot llvmbot added the BOLT label Jul 5, 2024
@llvmbot
Copy link
Member

llvmbot commented Jul 5, 2024

@llvm/pr-subscribers-bolt

Author: Sayhaan Siddiqui (sayhaan)

Changes

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 --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));
     }

@sayhaan sayhaan merged commit a40daa3 into llvm:main Jul 9, 2024
10 checks passed
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
Cleans up version check to remove redundant else branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants