summaryrefslogtreecommitdiff
path: root/node/ExprNode.hh
diff options
context:
space:
mode:
Diffstat (limited to 'node/ExprNode.hh')
-rw-r--r--node/ExprNode.hh23
1 files changed, 18 insertions, 5 deletions
diff --git a/node/ExprNode.hh b/node/ExprNode.hh
index b985140..bf24f4d 100644
--- a/node/ExprNode.hh
+++ b/node/ExprNode.hh
@@ -60,15 +60,28 @@ class L2RCastingNode : public ExprNode {
std::shared_ptr<ExprNode> lvalue_;
};
-// like L2RCastingNode, but won't do the load, type is the pointer to lvalue
-// instead.
-class GetAddressNode : public ExprNode {
+// access an rvalue pointer, this generates one GEP instruction
+class PointerAccessNode : public ExprNode {
public:
- GetAddressNode(Context* context, std::shared_ptr<ExprNode> lvalue);
+ PointerAccessNode(Context* context, std::shared_ptr<ExprNode> lhs,
+ std::shared_ptr<ExprNode> rhs);
virtual Value CodeGen() override;
protected:
- std::shared_ptr<ExprNode> lvalue_;
+ std::shared_ptr<ExprNode> lhs_;
+ std::shared_ptr<ExprNode> rhs_;
+};
+
+// access an array or lvalue pointer
+class ArrayAccessNode : public ExprNode {
+ public:
+ ArrayAccessNode(Context* context, std::shared_ptr<ExprNode> lhs,
+ std::shared_ptr<ExprNode> rhs);
+ virtual Value CodeGen() override;
+
+ protected:
+ std::shared_ptr<ExprNode> lhs_;
+ std::shared_ptr<ExprNode> rhs_;
};
class IdentifierNode : public ExprNode {