[Lldb-commits] [lldb] [lldb] Add static_assert to catch increases to size of Symbol (PR #200919)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Jun 1 12:48:26 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Dave Lee (kastiglione)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/200919.diff
1 Files Affected:
- (modified) lldb/include/lldb/Symbol/Symbol.h (+8)
``````````diff
diff --git a/lldb/include/lldb/Symbol/Symbol.h b/lldb/include/lldb/Symbol/Symbol.h
index 77da9b779bcdf..9d911464dd787 100644
--- a/lldb/include/lldb/Symbol/Symbol.h
+++ b/lldb/include/lldb/Symbol/Symbol.h
@@ -360,6 +360,14 @@ class Symbol : public SymbolContextScope {
} // namespace lldb_private
+#if __SIZEOF_POINTER__ == 8
+static_assert(sizeof(lldb_private::Symbol) == 80,
+ "Symbol size must be kept to a minimum");
+#elif __SIZEOF_POINTER__ == 4
+static_assert(sizeof(lldb_private::Symbol) == 52,
+ "Symbol size must be kept to a minimum");
+#endif
+
namespace llvm {
namespace json {
``````````
</details>
https://github.com/llvm/llvm-project/pull/200919
More information about the lldb-commits
mailing list