reg_alloc: Use std::exchange

This commit is contained in:
MerryMage 2018-01-26 01:51:04 +00:00
parent e0c12ec2ad
commit 4ce9c65cfb

View file

@ -6,6 +6,7 @@
#include <algorithm> #include <algorithm>
#include <numeric> #include <numeric>
#include <utility>
#include <xbyak.h> #include <xbyak.h>
@ -487,8 +488,7 @@ void RegAlloc::Move(HostLoc to, HostLoc from) {
EmitMove(to, from); EmitMove(to, from);
LocInfo(to) = LocInfo(from); LocInfo(to) = std::exchange(LocInfo(from), {});
LocInfo(from) = {};
} }
void RegAlloc::CopyToScratch(HostLoc to, HostLoc from) { void RegAlloc::CopyToScratch(HostLoc to, HostLoc from) {