From c92db3d4c4dfce149cb6fe372d2a03ef0ab6d3c1 Mon Sep 17 00:00:00 2001 From: Yang Fan Date: Fri, 29 Jan 2021 10:44:44 +0800 Subject: [PATCH] [NFC][DebugInfo] Fix Wreturn-type gcc warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 | } | ^ ``` --- lib/DebugInfo/DWARF/DWARFDebugFrame.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp b/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp index d95cbb70225..3ff1c0700dd 100644 --- a/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp +++ b/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,