Index: llvm/lib/Object/ELF.cpp =================================================================== --- llvm/lib/Object/ELF.cpp +++ llvm/lib/Object/ELF.cpp @@ -438,6 +438,7 @@ #include "llvm/BinaryFormat/DynamicTags.def" #undef HEXAGON_DYNAMIC_TAG } + llvm_unreachable("Previous switch() should have return'ed!"); case ELF::EM_MIPS: switch (Type) { @@ -445,6 +446,7 @@ #include "llvm/BinaryFormat/DynamicTags.def" #undef MIPS_DYNAMIC_TAG } + llvm_unreachable("Previous switch() should have return'ed!"); case ELF::EM_PPC64: switch (Type) { @@ -452,6 +454,7 @@ #include "llvm/BinaryFormat/DynamicTags.def" #undef PPC64_DYNAMIC_TAG } + llvm_unreachable("Previous switch() should have return'ed!"); } #undef DYNAMIC_TAG switch (Type) { Index: llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp =================================================================== --- llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp +++ llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp @@ -113,6 +113,7 @@ case RT64_8: return IsPCRel ? ELF::R_X86_64_PC8 : ELF::R_X86_64_8; } + llvm_unreachable("Previous switch() should have return'ed!"); case MCSymbolRefExpr::VK_GOT: switch (Type) { case RT64_64: @@ -124,6 +125,7 @@ case RT64_8: llvm_unreachable("Unimplemented"); } + llvm_unreachable("Previous switch() should have return'ed!"); case MCSymbolRefExpr::VK_GOTOFF: assert(Type == RT64_64); assert(!IsPCRel); @@ -140,6 +142,7 @@ case RT64_8: llvm_unreachable("Unimplemented"); } + llvm_unreachable("Previous switch() should have return'ed!"); case MCSymbolRefExpr::VK_DTPOFF: assert(!IsPCRel); switch (Type) { @@ -152,6 +155,7 @@ case RT64_8: llvm_unreachable("Unimplemented"); } + llvm_unreachable("Previous switch() should have return'ed!"); case MCSymbolRefExpr::VK_SIZE: assert(!IsPCRel); switch (Type) { @@ -164,6 +168,7 @@ case RT64_8: llvm_unreachable("Unimplemented"); } + llvm_unreachable("Previous switch() should have return'ed!"); case MCSymbolRefExpr::VK_TLSCALL: return ELF::R_X86_64_TLSDESC_CALL; case MCSymbolRefExpr::VK_TLSDESC: @@ -196,6 +201,7 @@ case X86::reloc_riprel_4byte_movq_load: return ELF::R_X86_64_REX_GOTPCRELX; } + llvm_unreachable("Previous switch() should have return'ed!"); } } @@ -233,6 +239,7 @@ case RT32_8: return IsPCRel ? ELF::R_386_PC8 : ELF::R_386_8; } + llvm_unreachable("Previous switch() should have return'ed!"); case MCSymbolRefExpr::VK_GOT: assert(Type == RT32_32); if (IsPCRel)