Skip to content

Commit

Permalink
NFC: static_assert instead of comment
Browse files Browse the repository at this point in the history
Summary: isPodLike is as close as we have for is_trivially_copyable.

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D18483

llvm-svn: 264515
  • Loading branch information
jfbastien committed Mar 26, 2016
1 parent 6462d8c commit d4ff336
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llvm/lib/CodeGen/MachineInstr.cpp
Expand Up @@ -38,6 +38,7 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/type_traits.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegisterInfo.h"
Expand Down Expand Up @@ -757,7 +758,8 @@ static void moveOperands(MachineOperand *Dst, MachineOperand *Src,
if (MRI)
return MRI->moveOperands(Dst, Src, NumOps);

// MachineOperand is a trivially copyable type so we can just use memmove.
static_assert(isPodLike<MachineOperand>::value,
"must be trivially copyable to memmove");
std::memmove(Dst, Src, NumOps * sizeof(MachineOperand));
}

Expand Down

0 comments on commit d4ff336

Please sign in to comment.