From fdbafbc1aef26193c87af20af142df267b64a44e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 4 May 2019 19:15:18 -0400 Subject: [PATCH] x64/reg_alloc: Remove reference qualifier to variable in GetArgumentInfo() The result of GetArg() is returned by value, so this is essentially still a copy. While the previous code *is* valid, this communicates what is actually happening a little more explicitly. --- src/backend/x64/reg_alloc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/x64/reg_alloc.cpp b/src/backend/x64/reg_alloc.cpp index 30b3dd6c..ae078c44 100644 --- a/src/backend/x64/reg_alloc.cpp +++ b/src/backend/x64/reg_alloc.cpp @@ -230,7 +230,7 @@ bool Argument::IsInMemory() const { RegAlloc::ArgumentInfo RegAlloc::GetArgumentInfo(IR::Inst* inst) { ArgumentInfo ret = {Argument{*this}, Argument{*this}, Argument{*this}, Argument{*this}}; for (size_t i = 0; i < inst->NumArgs(); i++) { - const IR::Value& arg = inst->GetArg(i); + const IR::Value arg = inst->GetArg(i); ret[i].value = arg; if (!arg.IsImmediate() && !IsValuelessType(arg.GetType())) { ASSERT_MSG(ValueLocation(arg.GetInst()), "argument must already been defined");