[Lldb-commits] [lldb] [lldb] Use AST nodes as Subscript and BitField arguments in DIL (PR #169363)
Michael Buch via lldb-commits
lldb-commits at lists.llvm.org
Tue Dec 9 03:31:30 PST 2025
================
@@ -141,46 +141,46 @@ class UnaryOpNode : public ASTNode {
class ArraySubscriptNode : public ASTNode {
public:
- ArraySubscriptNode(uint32_t location, ASTNodeUP base, int64_t index)
+ ArraySubscriptNode(uint32_t location, ASTNodeUP base, ASTNodeUP index)
: ASTNode(location, NodeKind::eArraySubscriptNode),
- m_base(std::move(base)), m_index(index) {}
+ 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(); }
- int64_t GetIndex() const { return m_index; }
+ ASTNode *GetIndex() const { return m_index.get(); }
static bool classof(const ASTNode *node) {
return node->GetKind() == NodeKind::eArraySubscriptNode;
}
private:
ASTNodeUP m_base;
- int64_t m_index;
+ ASTNodeUP m_index;
};
class BitFieldExtractionNode : public ASTNode {
public:
- BitFieldExtractionNode(uint32_t location, ASTNodeUP base, int64_t first_index,
- int64_t last_index)
+ BitFieldExtractionNode(uint32_t location, ASTNodeUP base,
+ ASTNodeUP first_index, ASTNodeUP last_index)
: ASTNode(location, NodeKind::eBitExtractionNode),
- m_base(std::move(base)), m_first_index(first_index),
- m_last_index(last_index) {}
+ m_base(std::move(base)), m_first_index(std::move(first_index)),
+ m_last_index(std::move(last_index)) {}
----------------
Michael137 wrote:
Based on `Interpreter::Evaluate`, we unconditionally dereference (we should probably add an assert there). So these can't ever be nullptr
https://github.com/llvm/llvm-project/pull/169363
More information about the lldb-commits
mailing list