Use std::fill instead of memset to initialize an array to avoid hardcoded count and...
[oota-llvm.git] / include / llvm / Target / TargetLowering.h
index e247abcb2f752f12243efcb3bdf1105a8249aba1..e99c9f758f8ea662d0ae554aa60572bdd923b6f5 100644 (file)
@@ -1293,7 +1293,7 @@ protected:
 
   /// Remove all register classes.
   void clearRegisterClasses() {
-    memset(RegClassForVT, 0,MVT::LAST_VALUETYPE * sizeof(TargetRegisterClass*));
+    std::fill(std::begin(RegClassForVT), std::end(RegClassForVT), nullptr);
 
     AvailableRegClasses.clear();
   }