Skip to content

[BOLT][DWARF][NFC] Remove unused check. #99237

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

Closed
wants to merge 1 commit into from
Closed

Conversation

ayermolo
Copy link
Contributor

This is a followup for:
9dab912
Looking at this code more I don't think the check is really necessary.

This is a followup for:
llvm@9dab912
Looking at this code more I don't think the check is really necessary.
@llvmbot
Copy link
Member

llvmbot commented Jul 16, 2024

@llvm/pr-subscribers-bolt

Author: Alexander Yermolovich (ayermolo)

Changes

This is a followup for:
9dab912
Looking at this code more I don't think the check is really necessary.


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

1 Files Affected:

  • (modified) bolt/lib/Core/DIEBuilder.cpp (-10)
diff --git a/bolt/lib/Core/DIEBuilder.cpp b/bolt/lib/Core/DIEBuilder.cpp
index 7815a305c0518..d896681da63b8 100644
--- a/bolt/lib/Core/DIEBuilder.cpp
+++ b/bolt/lib/Core/DIEBuilder.cpp
@@ -617,14 +617,6 @@ void DIEBuilder::cloneDieReferenceAttribute(
     DIE &Die, const DWARFUnit &U, const DWARFDie &InputDIE,
     const DWARFAbbreviationDeclaration::AttributeSpec AttrSpec,
     const DWARFFormValue &Val) {
-  uint64_t Ref;
-  if (std::optional<uint64_t> Off = Val.getAsRelativeReference())
-    Ref = Val.getUnit()->getOffset() + *Off;
-  else if (Off = Val.getAsDebugInfoReference(); Off)
-    Ref = *Off;
-  else
-    return;
-
   DIE *NewRefDie = nullptr;
   DWARFUnit *RefUnit = nullptr;
 
@@ -641,8 +633,6 @@ void DIEBuilder::cloneDieReferenceAttribute(
   DIEInfo &DieInfo = getDIEInfo(*UnitId, DIEId);
 
   if (!DieInfo.Die) {
-    assert(Ref > InputDIE.getOffset());
-    (void)Ref;
     BC.errs() << "BOLT-WARNING: [internal-dwarf-error]: encounter unexpected "
                  "unallocated DIE. Should be alloc!\n";
     // We haven't cloned this DIE yet. Just create an empty one and

@ayermolo
Copy link
Contributor Author

Superseded by #99324

@ayermolo ayermolo closed this Jul 17, 2024
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.

3 participants