1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

moveOperands - assert Src/Dst MachineOperands are non-null.

Fixes static-analyzer warnings.
This commit is contained in:
Simon Pilgrim 2020-01-11 14:36:46 +00:00
parent 98153c77dd
commit 07757bd26d

View File

@ -187,8 +187,8 @@ static void moveOperands(MachineOperand *Dst, MachineOperand *Src,
unsigned NumOps, MachineRegisterInfo *MRI) {
if (MRI)
return MRI->moveOperands(Dst, Src, NumOps);
// MachineOperand is a trivially copyable type so we can just use memmove.
assert(Dst && Src && "Unknown operands");
std::memmove(Dst, Src, NumOps * sizeof(MachineOperand));
}