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.
This commit is contained in:
Lioncash 2019-05-04 19:15:18 -04:00 committed by MerryMage
parent 1f6878fb46
commit fdbafbc1ae

View file

@ -230,7 +230,7 @@ bool Argument::IsInMemory() const {
RegAlloc::ArgumentInfo RegAlloc::GetArgumentInfo(IR::Inst* inst) { RegAlloc::ArgumentInfo RegAlloc::GetArgumentInfo(IR::Inst* inst) {
ArgumentInfo ret = {Argument{*this}, Argument{*this}, Argument{*this}, Argument{*this}}; ArgumentInfo ret = {Argument{*this}, Argument{*this}, Argument{*this}, Argument{*this}};
for (size_t i = 0; i < inst->NumArgs(); i++) { 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; ret[i].value = arg;
if (!arg.IsImmediate() && !IsValuelessType(arg.GetType())) { if (!arg.IsImmediate() && !IsValuelessType(arg.GetType())) {
ASSERT_MSG(ValueLocation(arg.GetInst()), "argument must already been defined"); ASSERT_MSG(ValueLocation(arg.GetInst()), "argument must already been defined");