Skip to content

Commit 869b6bf

Browse files
authored
Merge pull request #15473 from ikesyo/frontend-using-over-typedef
[gardening][Frontend] Replace `typedef` with `using`
2 parents 02a2af6 + f737add commit 869b6bf

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

include/swift/Frontend/OutputFileMap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
namespace swift {
3030

31-
typedef llvm::DenseMap<file_types::ID, std::string> TypeToPathMap;
31+
using TypeToPathMap = llvm::DenseMap<file_types::ID, std::string>;
3232

3333
class OutputFileMap {
3434
private:

lib/Frontend/OutputFileMap.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ OutputFileMap::getOrCreateOutputMapForSingleOutput() {
6565
}
6666

6767
void OutputFileMap::dump(llvm::raw_ostream &os, bool Sort) const {
68-
typedef std::pair<file_types::ID, std::string> TypePathPair;
68+
using TypePathPair = std::pair<file_types::ID, std::string>;
6969

7070
auto printOutputPair = [&os](StringRef InputPath,
7171
const TypePathPair &OutputPair) -> void {
@@ -74,7 +74,7 @@ void OutputFileMap::dump(llvm::raw_ostream &os, bool Sort) const {
7474
};
7575

7676
if (Sort) {
77-
typedef std::pair<StringRef, TypeToPathMap> PathMapPair;
77+
using PathMapPair = std::pair<StringRef, TypeToPathMap>;
7878
std::vector<PathMapPair> Maps;
7979
for (auto &InputPair : InputToOutputsMap) {
8080
Maps.emplace_back(InputPair.first(), InputPair.second);

lib/Frontend/SerializedDiagnosticConsumer.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ class AbbreviationMap {
8383
}
8484
};
8585

86-
typedef SmallVector<uint64_t, 64> RecordData;
87-
typedef SmallVectorImpl<uint64_t> RecordDataImpl;
86+
using RecordData = SmallVector<uint64_t, 64>;
87+
using RecordDataImpl = SmallVectorImpl<uint64_t>;
8888

8989
struct SharedState : llvm::RefCountedBase<SharedState> {
9090
SharedState(StringRef serializedDiagnosticsPath)
@@ -113,8 +113,8 @@ struct SharedState : llvm::RefCountedBase<SharedState> {
113113
/// \brief The collection of files used.
114114
llvm::DenseMap<const char *, unsigned> Files;
115115

116-
typedef llvm::DenseMap<const void *, std::pair<unsigned, StringRef> >
117-
DiagFlagsTy;
116+
using DiagFlagsTy =
117+
llvm::DenseMap<const void *, std::pair<unsigned, StringRef>>;
118118

119119
/// \brief Map for uniquing strings.
120120
DiagFlagsTy DiagFlags;
@@ -560,4 +560,3 @@ void SerializedDiagnosticConsumer::handleDiagnostic(
560560
if (bracketDiagnostic)
561561
exitDiagBlock();
562562
}
563-

0 commit comments

Comments
 (0)