From: Craig Topper Date: Sat, 5 Dec 2015 07:13:25 +0000 (+0000) Subject: Use std::fill instead of memset to initialize an array to avoid hardcoded count and... X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=83f50fab5317ea62c8298a82c1de5054d5795ac9;p=oota-llvm.git Use std::fill instead of memset to initialize an array to avoid hardcoded count and a multiply. The outputed code is identical. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254842 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index e247abcb2f7..e99c9f758f8 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -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(); }