From d4ff3360ae972da790834818b6b63f54037334d4 Mon Sep 17 00:00:00 2001 From: JF Bastien Date: Sat, 26 Mar 2016 18:14:27 +0000 Subject: 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 --- llvm/lib/CodeGen/MachineInstr.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/MachineInstr.cpp') 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::value, + "must be trivially copyable to memmove"); std::memmove(Dst, Src, NumOps * sizeof(MachineOperand)); } -- cgit v1.2.3