diff options
| author | Nagi5Yeq <wu@x-nagi.com> | 2020-05-30 00:25:03 +0800 |
|---|---|---|
| committer | Nagi5Yeq <wu@x-nagi.com> | 2020-05-30 00:25:03 +0800 |
| commit | 56d68765016fc7aa68fe7b522de5e84c7a12123a (patch) | |
| tree | ba9828637913aa40bc1b1509c5127be9bded3a6e /node/ExprNode.cc | |
| parent | f15a071f6d599d2a21083dfb041b18db8d482949 (diff) | |
global variable, constant support
Diffstat (limited to 'node/ExprNode.cc')
| -rw-r--r-- | node/ExprNode.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/node/ExprNode.cc b/node/ExprNode.cc index ba505fc..93f0068 100644 --- a/node/ExprNode.cc +++ b/node/ExprNode.cc @@ -88,10 +88,10 @@ Value IdentifierNode::CodeGen() { } FunctionCallNode::FunctionCallNode(Context* context, const std::string& name, - std::list<std::shared_ptr<ExprNode>> args) + std::list<std::shared_ptr<ExprNode>>&& args) : ExprNode(context) , name_(name) - , args_(args) {} + , args_(std::move(args)) {} Value FunctionCallNode::CodeGen() { TypeManager* manager = context_->GetTypeManager(); @@ -107,7 +107,7 @@ Value FunctionCallNode::CodeGen() { std::vector<Value> ArgValues(args_.size()); auto ArgTypeIt = ArgTypes.begin(); auto ArgValueIt = ArgValues.begin(); - for (auto arg : args_) { + for (auto&& arg : args_) { Value argv = arg->CodeGen(); Value ConvertedArgv = manager->CreateCast(*ArgTypeIt, arg->GetType(), argv, context_); |
