[Lldb-commits] [lldb] [lldb] Fix GCC's `-Wreturn-type` warnings (PR #127974)

via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 20 01:25:54 PST 2025


https://github.com/foxtran updated https://github.com/llvm/llvm-project/pull/127974

>From c51a54691108320a41037c12473ad2b5c2a7be34 Mon Sep 17 00:00:00 2001
From: "Igor S. Gerasimov" <i.s.ger at ya.ru>
Date: Thu, 20 Feb 2025 10:04:13 +0100
Subject: [PATCH] Fix GCC's -Wreturn-type warning

---
 lldb/source/DataFormatters/TypeSummary.cpp | 2 ++
 lldb/source/ValueObject/DILLexer.cpp       | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/lldb/source/DataFormatters/TypeSummary.cpp b/lldb/source/DataFormatters/TypeSummary.cpp
index 2c863b364538f..d18fca12fcdff 100644
--- a/lldb/source/DataFormatters/TypeSummary.cpp
+++ b/lldb/source/DataFormatters/TypeSummary.cpp
@@ -58,6 +58,8 @@ std::string TypeSummaryImpl::GetSummaryKindName() {
     return "c++";
   case Kind::eBytecode:
     return "bytecode";
+  case default:
+    llvm_unreachable("Unknown type kind name");
   }
 }
 
diff --git a/lldb/source/ValueObject/DILLexer.cpp b/lldb/source/ValueObject/DILLexer.cpp
index c7acfec347af4..bbb5fafdacbe5 100644
--- a/lldb/source/ValueObject/DILLexer.cpp
+++ b/lldb/source/ValueObject/DILLexer.cpp
@@ -29,6 +29,8 @@ llvm::StringRef Token::GetTokenName(Kind kind) {
     return "l_paren";
   case Kind::r_paren:
     return "r_paren";
+  default:
+    llvm_unreachable("Unknown token name");
   }
 }
 



More information about the lldb-commits mailing list