From e4ad58272970ecd850d233862f40a72d15649639 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Tue, 10 Jan 2012 20:47:20 +0000 Subject: [PATCH] Fix some leftover control reaches end of non-void function warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147874 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCDisassembler/EDDisassembler.cpp | 11 +++++------ lib/Target/PTX/PTXSubtarget.cpp | 1 + lib/Target/Sparc/Sparc.h | 4 ++-- lib/Target/Sparc/SparcInstrInfo.cpp | 1 + 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/MC/MCDisassembler/EDDisassembler.cpp b/lib/MC/MCDisassembler/EDDisassembler.cpp index 86983357336..46869dac768 100644 --- a/lib/MC/MCDisassembler/EDDisassembler.cpp +++ b/lib/MC/MCDisassembler/EDDisassembler.cpp @@ -79,19 +79,18 @@ static int getLLVMSyntaxVariant(Triple::ArchType arch, case EDDisassembler::kEDAssemblySyntaxX86ATT: if (arch == Triple::x86 || arch == Triple::x86_64) return 0; - else - return -1; + break; case EDDisassembler::kEDAssemblySyntaxX86Intel: if (arch == Triple::x86 || arch == Triple::x86_64) return 1; - else - return -1; + break; case EDDisassembler::kEDAssemblySyntaxARMUAL: if (arch == Triple::arm || arch == Triple::thumb) return 0; - else - return -1; + break; } + + return -1; } EDDisassembler *EDDisassembler::getDisassembler(Triple::ArchType arch, diff --git a/lib/Target/PTX/PTXSubtarget.cpp b/lib/Target/PTX/PTXSubtarget.cpp index b3b6ffb5405..aa8f0525932 100644 --- a/lib/Target/PTX/PTXSubtarget.cpp +++ b/lib/Target/PTX/PTXSubtarget.cpp @@ -64,4 +64,5 @@ std::string PTXSubtarget::getPTXVersionString() const { case PTX_VERSION_2_2: return "2.2"; case PTX_VERSION_2_3: return "2.3"; } + llvm_unreachable("Invalid PTX version"); } diff --git a/lib/Target/Sparc/Sparc.h b/lib/Target/Sparc/Sparc.h index 0217c749b83..ce6ae17b6ca 100644 --- a/lib/Target/Sparc/Sparc.h +++ b/lib/Target/Sparc/Sparc.h @@ -18,7 +18,6 @@ #include "MCTargetDesc/SparcMCTargetDesc.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Target/TargetMachine.h" -#include namespace llvm { class FunctionPass; @@ -102,7 +101,8 @@ namespace llvm { case SPCC::FCC_LE: return "le"; case SPCC::FCC_ULE: return "ule"; case SPCC::FCC_O: return "o"; - } + } + llvm_unreachable("Invalid cond code"); } } // end namespace llvm #endif diff --git a/lib/Target/Sparc/SparcInstrInfo.cpp b/lib/Target/Sparc/SparcInstrInfo.cpp index ccb6443de73..52266ffe682 100644 --- a/lib/Target/Sparc/SparcInstrInfo.cpp +++ b/lib/Target/Sparc/SparcInstrInfo.cpp @@ -109,6 +109,7 @@ static SPCC::CondCodes GetOppositeBranchCondition(SPCC::CondCodes CC) case SPCC::FCC_NE: return SPCC::FCC_E; case SPCC::FCC_E: return SPCC::FCC_NE; } + llvm_unreachable("Invalid cond code"); } MachineInstr * -- 2.34.1