From: Yang Fan Date: Fri, 29 Jan 2021 02:44:44 +0000 (+0800) Subject: [NFC][DebugInfo] Fix Wreturn-type gcc warning X-Git-Tag: llvmorg-14-init~16602 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5f258cb03f249601222496e6bb350fe2cc3431e;p=platform%2Fupstream%2Fllvm.git [NFC][DebugInfo] Fix Wreturn-type gcc warning GCC warning: ``` /llvm-project/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp: In member function ‘llvm::Expected llvm::dwarf::CFIProgram::Instruction::getOperandAsUnsigned(const llvm::dwarf::CFIProgram&, uint32_t) const’: /llvm-project/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp:425:1: warning: control reaches end of non-void function [-Wreturn-type] 425 | } | ^ /llvm-project/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp: In member function ‘llvm::Expected llvm::dwarf::CFIProgram::Instruction::getOperandAsSigned(const llvm::dwarf::CFIProgram&, uint32_t) const’: /llvm-project/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp:477:1: warning: control reaches end of non-void function [-Wreturn-type] 477 | } | ^ ``` --- diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp index d95cbb7..3ff1c07 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp @@ -422,6 +422,7 @@ CFIProgram::Instruction::getOperandAsUnsigned(const CFIProgram &CFIP, return Operand * CodeAlignmentFactor; } } + llvm_unreachable("invalid operand type"); } llvm::Expected @@ -474,6 +475,7 @@ CFIProgram::Instruction::getOperandAsSigned(const CFIProgram &CFIP, return Operand * DataAlignmentFactor; } } + llvm_unreachable("invalid operand type"); } Error UnwindTable::parseRows(const CFIProgram &CFIP, UnwindRow &Row,