diff options
Diffstat (limited to 'node/ExprNode.cc')
| -rw-r--r-- | node/ExprNode.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/node/ExprNode.cc b/node/ExprNode.cc index 4183120..ba505fc 100644 --- a/node/ExprNode.cc +++ b/node/ExprNode.cc @@ -66,6 +66,17 @@ Value L2RCastingNode::CodeGen() { return context_->GetBuilder()->CreateLoad(type_->GetLLVMType(), left); } +GetAddressNode::GetAddressNode(Context* context, + std::shared_ptr<ExprNode> lvalue) + : ExprNode(context) + , lvalue_(lvalue) {} + +Value GetAddressNode::CodeGen() { + Value left = lvalue_->CodeGen(); + type_ = context_->GetTypeManager()->GetPointerType(lvalue_->GetType()); + return left; +} + IdentifierNode::IdentifierNode(Context* context, const std::string& name) : ExprNode(context) , name_(name) {} |
