[PATCH] D97647: [lld][ELF] Removing redundant cast. NFC.

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 28 16:50:59 PST 2021


sbc100 updated this revision to Diff 327006.
sbc100 edited the summary of this revision.
sbc100 added a comment.

cleanup


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97647/new/

https://reviews.llvm.org/D97647

Files:
  lld/ELF/InputSection.cpp
  lld/test/ELF/merge-string.s


Index: lld/test/ELF/merge-string.s
===================================================================
--- lld/test/ELF/merge-string.s
+++ lld/test/ELF/merge-string.s
@@ -7,16 +7,16 @@
 // RUN: ld.lld -O 0 %t.o -o %t.so -shared
 // RUN: llvm-readobj -S --section-data --symbols %t.so | FileCheck --check-prefix=NOMERGE %s
 
-        .section	.rodata1,"aMS", at progbits,1
-	.asciz	"abc"
+        .section        .rodata1,"aMS", at progbits,1
+        .asciz  "abc"
 foo:
-	.ascii	"a"
+        .ascii  "a"
 bar:
         .asciz  "bc"
         .asciz  "bc"
 
         .section        .rodata2,"aMS", at progbits,2
-        .align  2
+        .p2align  1
 zed:
         .short  20
         .short  0
Index: lld/ELF/InputSection.cpp
===================================================================
--- lld/ELF/InputSection.cpp
+++ lld/ELF/InputSection.cpp
@@ -1429,8 +1429,7 @@
 uint64_t MergeInputSection::getParentOffset(uint64_t offset) const {
   // If Offset is not at beginning of a section piece, it is not in the map.
   // In that case we need to search from the original section piece vector.
-  const SectionPiece &piece =
-      *(const_cast<MergeInputSection *>(this)->getSectionPiece (offset));
+  const SectionPiece &piece = *getSectionPiece(offset);
   uint64_t addend = offset - piece.inputOff;
   return piece.outputOff + addend;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97647.327006.patch
Type: text/x-patch
Size: 1341 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210301/01466a2a/attachment.bin>


More information about the llvm-commits mailing list