From 83f50fab5317ea62c8298a82c1de5054d5795ac9 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sat, 5 Dec 2015 07:13:25 +0000 Subject: [PATCH] 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 --- include/llvm/Target/TargetLowering.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); } -- 2.34.1