[lld] r234869 - Simplify short switch-cases.

Rui Ueyama ruiu at google.com
Tue Apr 14 00:19:30 PDT 2015


Author: ruiu
Date: Tue Apr 14 02:19:29 2015
New Revision: 234869

URL: http://llvm.org/viewvc/llvm-project?rev=234869&view=rev
Log:
Simplify short switch-cases.

Modified:
    lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.h

Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.h?rev=234869&r1=234868&r2=234869&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.h Tue Apr 14 02:19:29 2015
@@ -41,12 +41,7 @@ public:
   bool isPLTRelocation(const Reference &r) const override {
     if (r.kindNamespace() != Reference::KindNamespace::ELF)
       return false;
-    switch (r.kindValue()) {
-    case llvm::ELF::R_HEX_JMP_SLOT:
-      return true;
-    default:
-      return false;
-    }
+    return r.kindValue() == llvm::ELF::R_HEX_JMP_SLOT;
   }
 
   /// \brief Hexagon has only one relative relocation
@@ -54,12 +49,7 @@ public:
   bool isRelativeReloc(const Reference &r) const override {
     if (r.kindNamespace() != Reference::KindNamespace::ELF)
       return false;
-    switch (r.kindValue()) {
-    case llvm::ELF::R_HEX_RELATIVE:
-      return true;
-    default:
-      return false;
-    }
+    return r.kindValue() == llvm::ELF::R_HEX_RELATIVE;
   }
 };
 





More information about the llvm-commits mailing list