[llvm] c3d39cb - [ADT][NFC] Constexpr-ify if in DenseMap::clear (#108243)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 11 11:55:09 PDT 2024
Author: Marc Auberer
Date: 2024-09-11T20:55:03+02:00
New Revision: c3d39cbb9a5e76f253c865dd544ccdf8eec95029
URL: https://github.com/llvm/llvm-project/commit/c3d39cbb9a5e76f253c865dd544ccdf8eec95029
DIFF: https://github.com/llvm/llvm-project/commit/c3d39cbb9a5e76f253c865dd544ccdf8eec95029.diff
LOG: [ADT][NFC] Constexpr-ify if in DenseMap::clear (#108243)
Make if constexpr due to constexpr condition.
Added:
Modified:
llvm/include/llvm/ADT/DenseMap.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h
index fb267cf5cee1c6..083d5c9388f7c8 100644
--- a/llvm/include/llvm/ADT/DenseMap.h
+++ b/llvm/include/llvm/ADT/DenseMap.h
@@ -120,7 +120,7 @@ class DenseMapBase : public DebugEpochBase {
}
const KeyT EmptyKey = getEmptyKey();
- if (std::is_trivially_destructible<ValueT>::value) {
+ if constexpr (std::is_trivially_destructible_v<ValueT>) {
// Use a simpler loop when values don't need destruction.
for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P)
P->getFirst() = EmptyKey;
More information about the llvm-commits
mailing list