reg_alloc: Use std::exchange
This commit is contained in:
parent
e0c12ec2ad
commit
4ce9c65cfb
1 changed files with 2 additions and 2 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue