[lld] r305010 - Use LLVM_FALLTHROUGH.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 8 13:16:21 PDT 2017


Author: ruiu
Date: Thu Jun  8 15:16:21 2017
New Revision: 305010

URL: http://llvm.org/viewvc/llvm-project?rev=305010&view=rev
Log:
Use LLVM_FALLTHROUGH.

Modified:
    lld/trunk/ELF/InputSection.cpp
    lld/trunk/ELF/Target.cpp

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=305010&r1=305009&r2=305010&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Thu Jun  8 15:16:21 2017
@@ -20,6 +20,7 @@
 #include "Target.h"
 #include "Thunks.h"
 #include "llvm/Object/Decompressor.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Compression.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Path.h"
@@ -682,7 +683,7 @@ void InputSectionBase::relocateAlloc(uin
       // Patch a nop (0x60000000) to a ld.
       if (BufLoc + 8 <= BufEnd && read32be(BufLoc + 4) == 0x60000000)
         write32be(BufLoc + 4, 0xe8410028); // ld %r2, 40(%r1)
-    // fallthrough
+      LLVM_FALLTHROUGH;
     default:
       Target->relocateOne(BufLoc, Type, TargetVA);
       break;

Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=305010&r1=305009&r2=305010&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Thu Jun  8 15:16:21 2017
@@ -2085,7 +2085,7 @@ RelExpr MipsTargetInfo<ELFT>::getRelExpr
       return R_MIPS_GOT_GP_PC;
     if (&S == ElfSym::MipsLocalGp)
       return R_MIPS_GOT_GP;
-    // fallthrough
+    LLVM_FALLTHROUGH;
   case R_MIPS_GOT_OFST:
     return R_ABS;
   case R_MIPS_PC32:
@@ -2099,7 +2099,7 @@ RelExpr MipsTargetInfo<ELFT>::getRelExpr
   case R_MIPS_GOT16:
     if (S.isLocal())
       return R_MIPS_GOT_LOCAL_PAGE;
-  // fallthrough
+    LLVM_FALLTHROUGH;
   case R_MIPS_CALL16:
   case R_MIPS_GOT_DISP:
   case R_MIPS_TLS_GOTTPREL:
@@ -2353,7 +2353,7 @@ void MipsTargetInfo<ELFT>::relocateOne(u
   case R_MIPS_TLS_GD:
   case R_MIPS_TLS_LDM:
     checkInt<16>(Loc, Val, Type);
-  // fallthrough
+    LLVM_FALLTHROUGH;
   case R_MIPS_CALL16:
   case R_MIPS_CALL_LO16:
   case R_MIPS_GOT_LO16:




More information about the llvm-commits mailing list