Use std::fill instead of memset to initialize an array to avoid hardcoded count and...
authorCraig Topper <craig.topper@gmail.com>
Sat, 5 Dec 2015 07:13:25 +0000 (07:13 +0000)
committerCraig Topper <craig.topper@gmail.com>
Sat, 5 Dec 2015 07:13:25 +0000 (07:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254842 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetLowering.h

index e247abc..e99c9f7 100644 (file)
@@ -1293,7 +1293,7 @@ protected:
 
   /// Remove all register classes.
   void clearRegisterClasses() {
 
   /// 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();
   }
 
     AvailableRegClasses.clear();
   }