Skip to content

Commit 64401ac

Browse files
[NFC] Replace StringMap<char, A> with StringSet<A> (swiftlang#27986)
1 parent 14107ac commit 64401ac

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/swift/AST/DiagnosticEngine.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "swift/AST/TypeLoc.h"
2222
#include "swift/AST/DeclNameLoc.h"
2323
#include "swift/AST/DiagnosticConsumer.h"
24-
#include "llvm/ADT/StringMap.h"
24+
#include "llvm/ADT/StringSet.h"
2525
#include "llvm/Support/Allocator.h"
2626
#include "llvm/Support/VersionTuple.h"
2727

@@ -655,7 +655,7 @@ namespace swift {
655655
/// A set of all strings involved in current transactional chain.
656656
/// This is required because diagnostics are not directly emitted
657657
/// but rather stored until all transactions complete.
658-
llvm::StringMap<char, llvm::BumpPtrAllocator &> TransactionStrings;
658+
llvm::StringSet<llvm::BumpPtrAllocator &> TransactionStrings;
659659

660660
/// The number of open diagnostic transactions. Diagnostics are only
661661
/// emitted once all transactions have closed.

lib/AST/DiagnosticEngine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,7 @@ void DiagnosticEngine::onTentativeDiagnosticFlush(Diagnostic &diagnostic) {
10261026
if (content.empty())
10271027
continue;
10281028

1029-
auto I = TransactionStrings.insert(std::make_pair(content, char())).first;
1029+
auto I = TransactionStrings.insert(content).first;
10301030
argument = DiagnosticArgument(StringRef(I->getKeyData()));
10311031
}
10321032
}

0 commit comments

Comments
 (0)