[llvm] [TableGen] Use std::array::fill instead of std::memset. NFC (PR #169204)

via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 23 00:36:32 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-tablegen

Author: Craig Topper (topperc)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/169204.diff


1 Files Affected:

- (modified) llvm/utils/TableGen/Common/CodeGenDAGPatterns.h (+1-1) 


``````````diff
diff --git a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.h b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.h
index 2cd7ec1521feb..8146f54cd3db5 100644
--- a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.h
+++ b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.h
@@ -71,7 +71,7 @@ struct MachineValueTypeSet {
     return Count;
   }
   LLVM_ATTRIBUTE_ALWAYS_INLINE
-  void clear() { std::memset(Words.data(), 0, NumWords * sizeof(WordType)); }
+  void clear() { Words.fill(0); }
   LLVM_ATTRIBUTE_ALWAYS_INLINE
   bool empty() const {
     for (WordType W : Words)

``````````

</details>


https://github.com/llvm/llvm-project/pull/169204


More information about the llvm-commits mailing list