Skip to content

Commit 8388a5b

Browse files
[ADT] Rename identity_cxx20 to identity (llvm#164927)
Now that the old llvm::identity has moved into IndexedMap.h under a different name, this patch renames identity_cxx20 to identity. Note that llvm::identity closely models std::identity from C++20.
1 parent 30e7715 commit 8388a5b

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

llvm/include/llvm/ADT/STLForwardCompat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ struct detector<std::void_t<Op<Args...>>, Op, Args...> {
125125
template <template <class...> class Op, class... Args>
126126
using is_detected = typename detail::detector<void, Op, Args...>::value_t;
127127

128-
struct identity_cxx20 // NOLINT(readability-identifier-naming)
128+
struct identity // NOLINT(readability-identifier-naming)
129129
{
130130
using is_transparent = void;
131131

llvm/include/llvm/ADT/SparseMultiSet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ namespace llvm {
8282
/// @tparam SparseT An unsigned integer type. See above.
8383
///
8484
template <typename ValueT, typename KeyT = unsigned,
85-
typename KeyFunctorT = identity_cxx20, typename SparseT = uint8_t>
85+
typename KeyFunctorT = identity, typename SparseT = uint8_t>
8686
class SparseMultiSet {
8787
static_assert(std::is_unsigned_v<SparseT>,
8888
"SparseT must be an unsigned integer type");

llvm/include/llvm/ADT/SparseSet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ struct SparseSetValFunctor {
113113
/// @tparam SparseT An unsigned integer type. See above.
114114
///
115115
template <typename ValueT, typename KeyT = unsigned,
116-
typename KeyFunctorT = identity_cxx20, typename SparseT = uint8_t>
116+
typename KeyFunctorT = identity, typename SparseT = uint8_t>
117117
class SparseSet {
118118
static_assert(std::is_unsigned_v<SparseT>,
119119
"SparseT must be an unsigned integer type");

llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ namespace llvm {
8989
/// allocated once for the pass. It can be cleared in constant time and reused
9090
/// without any frees.
9191
using RegUnit2SUnitsMap =
92-
SparseMultiSet<PhysRegSUOper, unsigned, identity_cxx20, uint16_t>;
92+
SparseMultiSet<PhysRegSUOper, unsigned, identity, uint16_t>;
9393

9494
/// Track local uses of virtual registers. These uses are gathered by the DAG
9595
/// builder and may be consulted by the scheduler to avoid iterating an entire

llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ using ExecutorAddrDiff = uint64_t;
3434
class ExecutorAddr {
3535
public:
3636
/// A wrap/unwrap function that leaves pointers unmodified.
37-
using rawPtr = llvm::identity_cxx20;
37+
using rawPtr = llvm::identity;
3838

3939
#if __has_feature(ptrauth_calls)
4040
template <typename T> class PtrauthSignDefault {

llvm/lib/CodeGen/RegAllocFast.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class RegAllocFastImpl {
211211
unsigned getSparseSetIndex() const { return VirtReg.virtRegIndex(); }
212212
};
213213

214-
using LiveRegMap = SparseSet<LiveReg, unsigned, identity_cxx20, uint16_t>;
214+
using LiveRegMap = SparseSet<LiveReg, unsigned, identity, uint16_t>;
215215
/// This map contains entries for each virtual register that is currently
216216
/// available in a physical register.
217217
LiveRegMap LiveVirtRegs;

llvm/unittests/ADT/STLForwardCompatTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ TEST(TransformTest, ToUnderlying) {
185185
}
186186

187187
TEST(STLForwardCompatTest, IdentityCxx20) {
188-
llvm::identity_cxx20 identity;
188+
llvm::identity identity;
189189

190190
// Test with an lvalue.
191191
int X = 42;

0 commit comments

Comments
 (0)