Skip to content
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

[DWARF] Clarify a variable name. NFC #88814

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

MaskRay
Copy link
Member

@MaskRay MaskRay commented Apr 15, 2024

The parameter of findDebugNamesOffsets has been renamed to
EndOfHeaderOffset in #88064 to make it clear it is a section offset
instead of an offset relative to the current name index. Rename the call
site variable as well.

Created using spr 1.3.5-bogner
@llvmbot
Copy link
Member

llvmbot commented Apr 15, 2024

@llvm/pr-subscribers-debuginfo

Author: Fangrui Song (MaskRay)

Changes

The parameter of findDebugNamesOffsets has been renamed to
EndOfHeaderOffset in #88064 to make it clear it is a section offset
instead of an offset relative to the current name index. Rename the call
site variable as well.


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

1 Files Affected:

  • (modified) llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp (+3-3)
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp b/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
index 22c9e8cd143c2e..ac19ac79329718 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
@@ -572,12 +572,12 @@ dwarf::findDebugNamesOffsets(uint64_t EndOfHeaderOffset,
 
 Error DWARFDebugNames::NameIndex::extract() {
   const DWARFDataExtractor &AS = Section.AccelSection;
-  uint64_t hdrSize = Base;
-  if (Error E = Hdr.extract(AS, &hdrSize))
+  uint64_t EndOfHeaderOffset = Base;
+  if (Error E = Hdr.extract(AS, &EndOfHeaderOffset))
     return E;
 
   const unsigned SectionOffsetSize = dwarf::getDwarfOffsetByteSize(Hdr.Format);
-  Offsets = dwarf::findDebugNamesOffsets(hdrSize, Hdr);
+  Offsets = dwarf::findDebugNamesOffsets(EndOfHeaderOffset, Hdr);
 
   uint64_t Offset =
       Offsets.EntryOffsetsBase + (Hdr.NameCount * SectionOffsetSize);

Copy link
Collaborator

@dwblaikie dwblaikie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this!

@MaskRay MaskRay merged commit 2e26ee9 into main Apr 16, 2024
5 of 6 checks passed
@MaskRay MaskRay deleted the users/MaskRay/spr/dwarf-clarify-a-variable-name-nfc branch April 16, 2024 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants