[lld] r321737 - Use a switch. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 3 08:52:15 PST 2018


Author: rafael
Date: Wed Jan  3 08:52:15 2018
New Revision: 321737

URL: http://llvm.org/viewvc/llvm-project?rev=321737&view=rev
Log:
Use a switch. NFC.

Modified:
    lld/trunk/ELF/Relocations.cpp

Modified: lld/trunk/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=321737&r1=321736&r2=321737&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Wed Jan  3 08:52:15 2018
@@ -396,15 +396,18 @@ static bool isStaticLinkTimeConstant(Rel
 }
 
 static RelExpr toPlt(RelExpr Expr) {
-  if (Expr == R_PPC_OPD)
+  switch (Expr) {
+  case R_PPC_OPD:
     return R_PPC_PLT_OPD;
-  if (Expr == R_PC)
+  case R_PC:
     return R_PLT_PC;
-  if (Expr == R_PAGE_PC)
+  case R_PAGE_PC:
     return R_PLT_PAGE_PC;
-  if (Expr == R_ABS)
+  case R_ABS:
     return R_PLT;
-  return Expr;
+  default:
+    return Expr;
+  }
 }
 
 static RelExpr fromPlt(RelExpr Expr) {




More information about the llvm-commits mailing list