Skip to content

[gardening][Frontend] Replace typedef with using #15473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/swift/Frontend/OutputFileMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

namespace swift {

typedef llvm::DenseMap<file_types::ID, std::string> TypeToPathMap;
using TypeToPathMap = llvm::DenseMap<file_types::ID, std::string>;

class OutputFileMap {
private:
Expand Down
4 changes: 2 additions & 2 deletions lib/Frontend/OutputFileMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ OutputFileMap::getOrCreateOutputMapForSingleOutput() {
}

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

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

if (Sort) {
typedef std::pair<StringRef, TypeToPathMap> PathMapPair;
using PathMapPair = std::pair<StringRef, TypeToPathMap>;
std::vector<PathMapPair> Maps;
for (auto &InputPair : InputToOutputsMap) {
Maps.emplace_back(InputPair.first(), InputPair.second);
Expand Down
9 changes: 4 additions & 5 deletions lib/Frontend/SerializedDiagnosticConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ class AbbreviationMap {
}
};

typedef SmallVector<uint64_t, 64> RecordData;
typedef SmallVectorImpl<uint64_t> RecordDataImpl;
using RecordData = SmallVector<uint64_t, 64>;
using RecordDataImpl = SmallVectorImpl<uint64_t>;

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

typedef llvm::DenseMap<const void *, std::pair<unsigned, StringRef> >
DiagFlagsTy;
using DiagFlagsTy =
llvm::DenseMap<const void *, std::pair<unsigned, StringRef>>;

/// \brief Map for uniquing strings.
DiagFlagsTy DiagFlags;
Expand Down Expand Up @@ -560,4 +560,3 @@ void SerializedDiagnosticConsumer::handleDiagnostic(
if (bracketDiagnostic)
exitDiagBlock();
}