[llvm] 3284adf - [NFC][ADT] Rename StringMapEntry *Create() into StringMapEntry *create.
Alexey Lapshin via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 25 07:15:58 PST 2022
Author: Alexey Lapshin
Date: 2022-12-25T15:26:35+01:00
New Revision: 3284adf67170f5b3d79f0beb91a4248f8c45bef3
URL: https://github.com/llvm/llvm-project/commit/3284adf67170f5b3d79f0beb91a4248f8c45bef3
DIFF: https://github.com/llvm/llvm-project/commit/3284adf67170f5b3d79f0beb91a4248f8c45bef3.diff
LOG: [NFC][ADT] Rename StringMapEntry *Create() into StringMapEntry *create.
Added:
Modified:
llvm/include/llvm/ADT/StringMap.h
llvm/include/llvm/ADT/StringMapEntry.h
llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h
llvm/lib/IR/Value.cpp
llvm/unittests/ADT/StringMapTest.cpp
llvm/unittests/ADT/StringSetTest.cpp
llvm/unittests/CodeGen/DwarfStringPoolEntryRefTest.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/StringMap.h b/llvm/include/llvm/ADT/StringMap.h
index eda82b4ef5255..0849bef53ba16 100644
--- a/llvm/include/llvm/ADT/StringMap.h
+++ b/llvm/include/llvm/ADT/StringMap.h
@@ -155,7 +155,7 @@ class StringMap : public StringMapImpl,
continue;
}
- TheTable[I] = MapEntryTy::Create(
+ TheTable[I] = MapEntryTy::create(
static_cast<MapEntryTy *>(Bucket)->getKey(), getAllocator(),
static_cast<MapEntryTy *>(Bucket)->getValue());
HashTable[I] = RHSHashTable[I];
@@ -336,7 +336,7 @@ class StringMap : public StringMapImpl,
if (Bucket == getTombstoneVal())
--NumTombstones;
Bucket =
- MapEntryTy::Create(Key, getAllocator(), std::forward<ArgsTy>(Args)...);
+ MapEntryTy::create(Key, getAllocator(), std::forward<ArgsTy>(Args)...);
++NumItems;
assert(NumItems + NumTombstones <= NumBuckets);
diff --git a/llvm/include/llvm/ADT/StringMapEntry.h b/llvm/include/llvm/ADT/StringMapEntry.h
index b5fc6d595f863..98b51cc1aebd5 100644
--- a/llvm/include/llvm/ADT/StringMapEntry.h
+++ b/llvm/include/llvm/ADT/StringMapEntry.h
@@ -123,7 +123,7 @@ class StringMapEntry final : public StringMapEntryStorage<ValueTy> {
/// Create a StringMapEntry for the specified key construct the value using
/// \p InitiVals.
template <typename AllocatorTy, typename... InitTy>
- static StringMapEntry *Create(StringRef key, AllocatorTy &allocator,
+ static StringMapEntry *create(StringRef key, AllocatorTy &allocator,
InitTy &&...initVals) {
return new (StringMapEntryBase::allocateWithKey(
sizeof(StringMapEntry), alignof(StringMapEntry), key, allocator))
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h
index 3733c6c51f19d..671ccf5d0e152 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h
@@ -60,7 +60,7 @@ class LVStringPool {
if (isValidIndex(Index))
return Index;
size_t Value = Entries.size();
- ValueType *Entry = ValueType::Create(Key, Allocator, std::move(Value));
+ ValueType *Entry = ValueType::create(Key, Allocator, std::move(Value));
StringTable.insert(Entry);
Entries.push_back(Entry);
return Value;
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index 4faf1abf7480b..6dc7af9c119fe 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -352,7 +352,7 @@ void Value::setNameImpl(const Twine &NewName) {
// Create the new name.
MallocAllocator Allocator;
- setValueName(ValueName::Create(NameRef, Allocator));
+ setValueName(ValueName::create(NameRef, Allocator));
getValueName()->setValue(this);
return;
}
diff --git a/llvm/unittests/ADT/StringMapTest.cpp b/llvm/unittests/ADT/StringMapTest.cpp
index 415d7f6c31f52..f40f22ad140cb 100644
--- a/llvm/unittests/ADT/StringMapTest.cpp
+++ b/llvm/unittests/ADT/StringMapTest.cpp
@@ -236,7 +236,7 @@ TEST_F(StringMapTest, IterationTest) {
TEST_F(StringMapTest, StringMapEntryTest) {
MallocAllocator Allocator;
StringMap<uint32_t>::value_type *entry =
- StringMap<uint32_t>::value_type::Create(
+ StringMap<uint32_t>::value_type::create(
StringRef(testKeyFirst, testKeyLength), Allocator, 1u);
EXPECT_STREQ(testKey, entry->first().data());
EXPECT_EQ(1u, entry->second);
@@ -246,7 +246,7 @@ TEST_F(StringMapTest, StringMapEntryTest) {
// Test insert() method.
TEST_F(StringMapTest, InsertTest) {
SCOPED_TRACE("InsertTest");
- testMap.insert(StringMap<uint32_t>::value_type::Create(
+ testMap.insert(StringMap<uint32_t>::value_type::create(
StringRef(testKeyFirst, testKeyLength), testMap.getAllocator(), 1u));
assertSingleItemMap();
}
@@ -376,14 +376,14 @@ TEST_F(StringMapTest, MoveOnly) {
StringMap<MoveOnly> t;
t.insert(std::make_pair("Test", MoveOnly(42)));
StringRef Key = "Test";
- StringMapEntry<MoveOnly>::Create(Key, t.getAllocator(), MoveOnly(42))
+ StringMapEntry<MoveOnly>::create(Key, t.getAllocator(), MoveOnly(42))
->Destroy(t.getAllocator());
}
TEST_F(StringMapTest, CtorArg) {
StringRef Key = "Test";
MallocAllocator Allocator;
- StringMapEntry<MoveOnly>::Create(Key, Allocator, Immovable())
+ StringMapEntry<MoveOnly>::create(Key, Allocator, Immovable())
->Destroy(Allocator);
}
diff --git a/llvm/unittests/ADT/StringSetTest.cpp b/llvm/unittests/ADT/StringSetTest.cpp
index 413314976ac2a..e3703f6f01508 100644
--- a/llvm/unittests/ADT/StringSetTest.cpp
+++ b/llvm/unittests/ADT/StringSetTest.cpp
@@ -35,7 +35,7 @@ TEST_F(StringSetTest, InsertAndCountStringMapEntry) {
// which are required for set_
diff erence(StringSet, StringSet).
StringSet<> Set;
StringMapEntry<StringRef> *Element =
- StringMapEntry<StringRef>::Create("A", Set.getAllocator());
+ StringMapEntry<StringRef>::create("A", Set.getAllocator());
Set.insert(*Element);
size_t Count = Set.count(*Element);
size_t Expected = 1;
diff --git a/llvm/unittests/CodeGen/DwarfStringPoolEntryRefTest.cpp b/llvm/unittests/CodeGen/DwarfStringPoolEntryRefTest.cpp
index 623ac4e1a878e..6e901f7a18f27 100644
--- a/llvm/unittests/CodeGen/DwarfStringPoolEntryRefTest.cpp
+++ b/llvm/unittests/CodeGen/DwarfStringPoolEntryRefTest.cpp
@@ -19,7 +19,7 @@ using namespace llvm;
TEST(DwarfStringPoolEntryRefTest, TestFullEntry) {
BumpPtrAllocator Allocator;
StringMapEntry<DwarfStringPoolEntry> *StringEntry1 =
- StringMapEntry<DwarfStringPoolEntry>::Create(
+ StringMapEntry<DwarfStringPoolEntry>::create(
"Key1", Allocator, DwarfStringPoolEntry{nullptr, 0, 0});
EXPECT_TRUE(StringEntry1->getKey() == "Key1");
@@ -40,7 +40,7 @@ TEST(DwarfStringPoolEntryRefTest, TestFullEntry) {
EXPECT_FALSE(Ref1 != Ref2);
StringMapEntry<DwarfStringPoolEntry> *StringEntry2 =
- StringMapEntry<DwarfStringPoolEntry>::Create(
+ StringMapEntry<DwarfStringPoolEntry>::create(
"Key2", Allocator, DwarfStringPoolEntry{nullptr, 0x1000, 1});
EXPECT_TRUE(StringEntry2->getKey() == "Key2");
EXPECT_TRUE(StringEntry2->second.Symbol == nullptr);
@@ -64,7 +64,7 @@ TEST(DwarfStringPoolEntryRefTest, TestShortEntry) {
BumpPtrAllocator Allocator;
DwarfStringPoolEntry DwarfEntry1 = {nullptr, 0, 0};
StringMapEntry<DwarfStringPoolEntry *> *StringEntry1 =
- StringMapEntry<DwarfStringPoolEntry *>::Create("Key1", Allocator,
+ StringMapEntry<DwarfStringPoolEntry *>::create("Key1", Allocator,
&DwarfEntry1);
EXPECT_TRUE(StringEntry1->getKey() == "Key1");
@@ -87,7 +87,7 @@ TEST(DwarfStringPoolEntryRefTest, TestShortEntry) {
DwarfStringPoolEntry DwarfEntry2 = {nullptr, 0x1000, 1};
StringMapEntry<DwarfStringPoolEntry *> *StringEntry2 =
- StringMapEntry<DwarfStringPoolEntry *>::Create("Key2", Allocator,
+ StringMapEntry<DwarfStringPoolEntry *>::create("Key2", Allocator,
&DwarfEntry2);
EXPECT_TRUE(StringEntry2->getKey() == "Key2");
EXPECT_TRUE(StringEntry2->second->Symbol == nullptr);
@@ -107,12 +107,12 @@ TEST(DwarfStringPoolEntryRefTest, CompareFullAndShort) {
DwarfStringPoolEntry DwarfEntry1 = {nullptr, 0, 0};
StringMapEntry<DwarfStringPoolEntry *> *StringEntry1 =
- StringMapEntry<DwarfStringPoolEntry *>::Create("Key1", Allocator,
+ StringMapEntry<DwarfStringPoolEntry *>::create("Key1", Allocator,
&DwarfEntry1);
DwarfStringPoolEntryRef Ref1(*StringEntry1);
StringMapEntry<DwarfStringPoolEntry> *StringEntry2 =
- StringMapEntry<DwarfStringPoolEntry>::Create(
+ StringMapEntry<DwarfStringPoolEntry>::create(
"Key1", Allocator, DwarfStringPoolEntry{nullptr, 0, 0});
DwarfStringPoolEntryRef Ref2(*StringEntry2);
More information about the llvm-commits
mailing list