Skip to content

Commit 19101b2

Browse files
Address comments.
1 parent b2d4676 commit 19101b2

File tree

8 files changed

+14
-13
lines changed

8 files changed

+14
-13
lines changed

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,7 +2215,7 @@ DataAggregator::writeAggregatedFile(StringRef OutputFilename) const {
22152215
OutFile << "boltedcollection\n";
22162216
if (opts::BasicAggregation) {
22172217
OutFile << "no_lbr";
2218-
for (const auto &Entry : EventNames)
2218+
for (const StringMapEntry<EmptyStringSetTag> &Entry : EventNames)
22192219
OutFile << " " << Entry.getKey();
22202220
OutFile << "\n";
22212221

@@ -2291,7 +2291,7 @@ std::error_code DataAggregator::writeBATYAML(BinaryContext &BC,
22912291

22922292
ListSeparator LS(",");
22932293
raw_string_ostream EventNamesOS(BP.Header.EventNames);
2294-
for (const auto &EventEntry : EventNames)
2294+
for (const StringMapEntry<EmptyStringSetTag> &EventEntry : EventNames)
22952295
EventNamesOS << LS << EventEntry.first().str();
22962296

22972297
BP.Header.Flags = opts::BasicAggregation ? BinaryFunction::PF_BASIC

bolt/lib/Profile/YAMLProfileWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ std::error_code YAMLProfileWriter::writeProfile(const RewriteInstance &RI) {
382382
StringSet<> EventNames = RI.getProfileReader()->getEventNames();
383383
if (!EventNames.empty()) {
384384
std::string Sep;
385-
for (const auto &EventEntry : EventNames) {
385+
for (const StringMapEntry<EmptyStringSetTag> &EventEntry : EventNames) {
386386
BP.Header.EventNames += Sep + EventEntry.first().str();
387387
Sep = ",";
388388
}

llvm/include/llvm/ADT/StringMap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ class LLVM_ALLOCATORHOLDER_EMPTYBASE StringMap
302302
if (FindInRHS == RHS.end())
303303
return false;
304304

305-
if constexpr (!std::is_same_v<ValueTy, StringSetTag>) {
305+
if constexpr (!std::is_same_v<ValueTy, EmptyStringSetTag>) {
306306
if (!(KeyValue.getValue() == FindInRHS->getValue()))
307307
return false;
308308
}

llvm/include/llvm/ADT/StringMapEntry.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
namespace llvm {
2323

2424
/// The "value type" of StringSet represented as an empty struct.
25-
struct StringSetTag {};
25+
struct EmptyStringSetTag {};
2626

2727
/// StringMapEntryBase - Shared base class of StringMapEntry instances.
2828
class StringMapEntryBase {
@@ -88,13 +88,13 @@ class StringMapEntryStorage : public StringMapEntryBase {
8888
};
8989

9090
template <>
91-
class StringMapEntryStorage<StringSetTag> : public StringMapEntryBase {
91+
class StringMapEntryStorage<EmptyStringSetTag> : public StringMapEntryBase {
9292
public:
93-
explicit StringMapEntryStorage(size_t keyLength, StringSetTag = {})
93+
explicit StringMapEntryStorage(size_t keyLength, EmptyStringSetTag = {})
9494
: StringMapEntryBase(keyLength) {}
9595
StringMapEntryStorage(StringMapEntryStorage &entry) = delete;
9696

97-
StringSetTag getValue() const { return {}; }
97+
EmptyStringSetTag getValue() const { return {}; }
9898
};
9999

100100
/// StringMapEntry - This is used to represent one value that is inserted into

llvm/include/llvm/ADT/StringSet.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ namespace llvm {
2222

2323
/// StringSet - A wrapper for StringMap that provides set-like functionality.
2424
template <class AllocatorTy = MallocAllocator>
25-
class StringSet : public StringMap<StringSetTag, AllocatorTy> {
26-
using Base = StringMap<StringSetTag, AllocatorTy>;
25+
class StringSet : public StringMap<EmptyStringSetTag, AllocatorTy> {
26+
using Base = StringMap<EmptyStringSetTag, AllocatorTy>;
2727

2828
public:
2929
StringSet() = default;

llvm/include/llvm/DWARFLinker/StringPool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace dwarf_linker {
2020

2121
/// StringEntry keeps data of the string: the length, external offset
2222
/// and a string body which is placed right after StringEntry.
23-
using StringEntry = StringMapEntry<StringSetTag>;
23+
using StringEntry = StringMapEntry<EmptyStringSetTag>;
2424

2525
class StringPoolEntryInfo {
2626
public:

mlir/include/mlir/Support/Timing.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class DefaultTimingManagerImpl;
4444
/// This is a POD type with pointer size, so it should be passed around by
4545
/// value. The underlying data is owned by the `TimingManager`.
4646
class TimingIdentifier {
47-
using EntryType = llvm::StringMapEntry<llvm::StringSetTag>;
47+
using EntryType = llvm::StringMapEntry<llvm::EmptyStringSetTag>;
4848

4949
public:
5050
TimingIdentifier(const TimingIdentifier &) = default;

mlir/lib/Support/Timing.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ class TimingManagerImpl {
5050
llvm::sys::SmartRWMutex<true> identifierMutex;
5151

5252
/// A thread local cache of identifiers to reduce lock contention.
53-
ThreadLocalCache<llvm::StringMap<llvm::StringMapEntry<llvm::StringSetTag> *>>
53+
ThreadLocalCache<
54+
llvm::StringMap<llvm::StringMapEntry<llvm::EmptyStringSetTag> *>>
5455
localIdentifierCache;
5556

5657
TimingManagerImpl() : identifiers(identifierAllocator) {}

0 commit comments

Comments
 (0)