[PATCH] D18483: NFC: static_assert instead of comment
JF Bastien via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 26 11:19:38 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL264515: NFC: static_assert instead of comment (authored by jfb).
Changed prior to commit:
http://reviews.llvm.org/D18483?vs=51690&id=51718#toc
Repository:
rL LLVM
http://reviews.llvm.org/D18483
Files:
llvm/trunk/lib/CodeGen/MachineInstr.cpp
Index: llvm/trunk/lib/CodeGen/MachineInstr.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp
+++ llvm/trunk/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 @@
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));
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18483.51718.patch
Type: text/x-patch
Size: 841 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160326/a5a2bf3a/attachment.bin>
More information about the llvm-commits
mailing list