[Lldb-commits] [lldb] [LLDB] Add `ScalarLiteralNode` and literal parsing in DIL (PR #152308)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 11 09:22:02 PDT 2025


================
@@ -178,6 +179,40 @@ class BitFieldExtractionNode : public ASTNode {
   int64_t m_last_index;
 };
 
+class ScalarLiteralNode : public ASTNode {
+public:
+  ScalarLiteralNode(uint32_t location, Scalar value, uint32_t radix,
+                    bool is_unsigned, bool is_long, bool is_longlong)
+      : ASTNode(location, NodeKind::eScalarLiteralNode), m_value(value),
+        m_radix(radix), m_is_unsigned(is_unsigned), m_is_long(is_long),
+        m_is_longlong(is_longlong) {}
----------------
labath wrote:

There are two schools of thought. One wants to initialize everything to avoid non-determinism/UB. Another wants to avoid initialization (when there's no reasonable thing to initialize to) to let sanitizers catch cases where the value is (erroneously) used uninitialized.

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


More information about the lldb-commits mailing list