[Lldb-commits] [lldb] [lldb][AArch64][Linux] Add llvm_unreachable after some RegisterSetType switches (PR #223375)

via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 14 04:42:32 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: David Spickett (DavidSpickett)

<details>
<summary>Changes</summary>

The ones where you are supposed to case X: return Y;. We do enable the not fully covered switch warning, so the unreachable just makes the mistake more obvious.

I did not change GetInvalidationMask because this will be refactored by #<!-- -->223373.

---
Full diff: https://github.com/llvm/llvm-project/pull/223375.diff


1 Files Affected:

- (modified) lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp (+6) 


``````````diff
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
index 85781be08c1bc..1889cab95ab66 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
@@ -132,6 +132,8 @@ unsigned int NativeRegisterContextLinux_arm64::GetPtraceSet(
   case RegisterSetType::POE:
     return llvm::ELF::NT_ARM_POE;
   }
+
+  llvm_unreachable("No ptrace set for this RegisterType.");
 }
 
 size_t NativeRegisterContextLinux_arm64::GetSetSize(
@@ -166,6 +168,8 @@ size_t NativeRegisterContextLinux_arm64::GetSetSize(
   case RegisterSetType::POE:
     return sizeof(m_poe_regs);
   }
+
+  llvm_unreachable("No set size for this RegisterType.");
 }
 
 void *NativeRegisterContextLinux_arm64::GetSetBuffer(
@@ -198,6 +202,8 @@ void *NativeRegisterContextLinux_arm64::GetSetBuffer(
   case RegisterSetType::POE:
     return &m_poe_regs;
   }
+
+  llvm_unreachable("No set buffer for this RegisterType.");
 }
 
 // A NativeRegisterContext is constructed per thread, but all threads' registers

``````````

</details>


https://github.com/llvm/llvm-project/pull/223375


More information about the lldb-commits mailing list