[Lldb-commits] [lldb] [LLDB] Add field member operators to DIL (PR #138093)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri May 2 06:00:03 PDT 2025


================
@@ -88,6 +89,29 @@ class IdentifierNode : public ASTNode {
   std::string m_name;
 };
 
+class MemberOfNode : public ASTNode {
+public:
+  MemberOfNode(uint32_t location, ASTNodeUP base, bool is_arrow,
+               ConstString name)
+      : ASTNode(location, NodeKind::eMemberOfNode), m_base(std::move(base)),
+        m_is_arrow(is_arrow), m_field_name(name) { }
+
+  llvm::Expected<lldb::ValueObjectSP> Accept(Visitor *v) const override;
+
+  ASTNode *base() const { return m_base.get(); }
+  bool IsArrow() const { return m_is_arrow; }
+  ConstString FieldName() const { return m_field_name; }
----------------
labath wrote:

Let's not use ConstString here. All this does here is increase lldb memory consumption.

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


More information about the lldb-commits mailing list