[llvm] r264515 - NFC: static_assert instead of comment

JF Bastien via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 26 11:14:27 PDT 2016


Author: jfb
Date: Sat Mar 26 13:14:27 2016
New Revision: 264515

URL: http://llvm.org/viewvc/llvm-project?rev=264515&view=rev
Log:
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

Modified:
    llvm/trunk/lib/CodeGen/MachineInstr.cpp

Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=264515&r1=264514&r2=264515&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Sat Mar 26 13:14:27 2016
@@ -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
   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));
 }
 




More information about the llvm-commits mailing list