[PATCH] D139452: [Object][NFC] Remove unneeded llvm_unreachable

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 13:20:51 PST 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG956c7dca29c7: [Object][NFC] Remove unneeded llvm_unreachable (authored by gAlfonso-bit, committed by MaskRay).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139452

Files:
  llvm/lib/Object/ELFObjectFile.cpp


Index: llvm/lib/Object/ELFObjectFile.cpp
===================================================================
--- llvm/lib/Object/ELFObjectFile.cpp
+++ llvm/lib/Object/ELFObjectFile.cpp
@@ -783,8 +783,6 @@
     return readBBAddrMapImpl(Obj->getELFFile(), TextSectionIndex);
   if (const auto *Obj = dyn_cast<ELF32BEObjectFile>(this))
     return readBBAddrMapImpl(Obj->getELFFile(), TextSectionIndex);
-  if (const auto *Obj = cast<ELF64BEObjectFile>(this))
-    return readBBAddrMapImpl(Obj->getELFFile(), TextSectionIndex);
-  else
-    llvm_unreachable("Unsupported binary format");
+  return readBBAddrMapImpl(cast<ELF64BEObjectFile>(this)->getELFFile(),
+                           TextSectionIndex);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139452.498131.patch
Type: text/x-patch
Size: 708 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230216/84a7625f/attachment.bin>


More information about the llvm-commits mailing list