diff options
author | JF Bastien <jfb@google.com> | 2016-03-26 18:14:27 +0000 |
---|---|---|
committer | JF Bastien <jfb@google.com> | 2016-03-26 18:14:27 +0000 |
commit | d4ff3360ae972da790834818b6b63f54037334d4 (patch) | |
tree | 3148e1ce09d6cc7ddd2968b97cac42160e6e61ce /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | 6462d8c1d91052aff56c60939e48564af9084ea6 (diff) | |
download | bcm5719-llvm-d4ff3360ae972da790834818b6b63f54037334d4.tar.gz bcm5719-llvm-d4ff3360ae972da790834818b6b63f54037334d4.zip |
NFC: static_assert instead of comment
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
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index bc99a069192..99646d96196 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -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" @@ -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)); } |