[lld] 3d1b000 - [lld] s/dyn_cast/isa in InputSection.cpp

Pavel Labath via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 02:45:49 PDT 2020


Author: Pavel Labath
Date: 2020-08-24T11:45:30+02:00
New Revision: 3d1b0000f9da83d3f636d76b2108cd5121f4f4b0

URL: https://github.com/llvm/llvm-project/commit/3d1b0000f9da83d3f636d76b2108cd5121f4f4b0
DIFF: https://github.com/llvm/llvm-project/commit/3d1b0000f9da83d3f636d76b2108cd5121f4f4b0.diff

LOG: [lld] s/dyn_cast/isa in InputSection.cpp

Avoids a -Wunused-variable with gcc.

Added: 
    

Modified: 
    lld/ELF/InputSection.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index 914c4e0d5962..ad4a12855ad1 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -1104,7 +1104,7 @@ void InputSectionBase::relocateAlloc(uint8_t *buf, uint8_t *bufEnd) {
   // a jmp insn must be modified to shrink the jmp insn or to flip the jmp
   // insn.  This is primarily used to relax and optimize jumps created with
   // basic block sections.
-  if (auto *sec = dyn_cast<InputSection>(this)) {
+  if (isa<InputSection>(this)) {
     for (const JumpInstrMod &jumpMod : jumpInstrMods) {
       uint64_t offset = jumpMod.offset;
       uint8_t *bufLoc = buf + offset;


        


More information about the llvm-commits mailing list