[Lldb-commits] [lldb] [lldb] Explicitly handle unreachable code (PR #230372)

Fabrice de Gans via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 12 04:40:20 PDT 2026


https://github.com/Steelskin updated https://github.com/llvm/llvm-project/pull/230372

>From d34017edb466fa9846432d44d42c3e38a9261160 Mon Sep 17 00:00:00 2001
From: Fabrice de Gans <steelskin at gmail.com>
Date: Fri, 9 Oct 2026 08:12:11 +0200
Subject: [PATCH] [lldb] Explicitly handle unreachable code

This silences a warning with MSVC, which does not treat the switch as
exhaustive unlike gcc and clang.
---
 .../Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.cpp    | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lldb/source/Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.cpp b/lldb/source/Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.cpp
index 12cf2bccee503..893c1b27ade50 100644
--- a/lldb/source/Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.cpp
+++ b/lldb/source/Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.cpp
@@ -13,6 +13,7 @@
 #include "lldb/Utility/RegisterType.h"
 #include "lldb/lldb-enumerations.h"
 #include "llvm/ADT/bit.h"
+#include "llvm/Support/ErrorHandling.h"
 
 using namespace lldb_private;
 
@@ -254,6 +255,7 @@ RegisterTypeBuilderClang::GetRegisterType(const RegisterInfo &reg_info) {
   case RegisterType::eRegisterTypeKindUnion:
     return {};
   }
+  llvm_unreachable("Unhandled RegisterType kind");
 }
 
 std::optional<CompilerType> RegisterTypeBuilderClang::GetExistingCompilerType(



More information about the lldb-commits mailing list