================
@@ -108,6 +110,26 @@ class UnaryOpNode : public ASTNode {
   ASTNodeUP m_operand;
 };
 
+class ArraySubscriptNode : public ASTNode {
+public:
+  ArraySubscriptNode(uint32_t location, ASTNodeUP base, llvm::APInt index)
+      : ASTNode(location, NodeKind::eArraySubscriptNode),
+        m_base(std::move(base)), m_index(std::move(index)) {}
+
+  llvm::Expected<lldb::ValueObjectSP> Accept(Visitor *v) const override;
+
+  ASTNode *GetBase() const { return m_base.get(); }
+  const llvm::APInt *GetIndex() const { return &m_index; }
----------------
labath wrote:

I think this should return a (const) reference to make it clear it can't be 
null.

(I know the same can be said about the GetBase, and I'd actually do that there 
as well, but it's less of a surprise there since the object is already stored 
as a pointer)

https://github.com/llvm/llvm-project/pull/138551
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to