Skip to content

Commit 1508b6f

Browse files
committed
[gardening][Driver] Replace typedef with using
1 parent 312771e commit 1508b6f

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

include/swift/Driver/Action.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ namespace driver {
3434

3535
class Action {
3636
public:
37-
typedef ArrayRef<const Action *>::size_type size_type;
38-
typedef ArrayRef<const Action *>::iterator iterator;
39-
typedef ArrayRef<const Action *>::const_iterator const_iterator;
37+
using size_type = ArrayRef<const Action *>::size_type;
38+
using iterator = ArrayRef<const Action *>::iterator;
39+
using const_iterator = ArrayRef<const Action *>::const_iterator;
4040

4141
enum ActionClass {
4242
Input = 0,

include/swift/Driver/DependencyGraph.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ class DependencyGraphImpl {
140140
class StringSetIterator {
141141
llvm::StringSet<>::const_iterator I;
142142
public:
143-
typedef llvm::StringSet<>::const_iterator::value_type value_type;
144-
typedef std::input_iterator_tag iterator_category;
145-
typedef ptrdiff_t difference_type;
146-
typedef value_type &reference;
147-
typedef value_type *pointer;
143+
using value_type = llvm::StringSet<>::const_iterator::value_type;
144+
using iterator_category = std::input_iterator_tag;
145+
using difference_type = ptrdiff_t;
146+
using reference = value_type &;
147+
using pointer = value_type *;
148148

149149
/*implicit*/ StringSetIterator(llvm::StringSet<>::const_iterator base)
150150
: I(base) {}

include/swift/Driver/Util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ namespace swift {
2727

2828
namespace driver {
2929
/// An input argument from the command line and its inferred type.
30-
typedef std::pair<file_types::ID, const llvm::opt::Arg *> InputPair;
30+
using InputPair = std::pair<file_types::ID, const llvm::opt::Arg *>;
3131
/// Type used for a list of input arguments.
32-
typedef SmallVector<InputPair, 16> InputFileList;
32+
using InputFileList = SmallVector<InputPair, 16>;
3333

3434
enum class LinkKind {
3535
None,

lib/Driver/Driver.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,8 +776,7 @@ static Arg *makeInputArg(const DerivedArgList &Args, OptTable &Opts,
776776
return A;
777777
}
778778

779-
780-
typedef std::function<void(InputArgList &, unsigned)> RemainingArgsHandler;
779+
using RemainingArgsHandler = std::function<void(InputArgList &, unsigned)>;
781780

782781
std::unique_ptr<InputArgList>
783782
parseArgsUntil(const llvm::opt::OptTable& Opts,

lib/Driver/ParseableOutput.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace {
3030
CommandInput(StringRef Path) : Path(Path) {}
3131
};
3232

33-
typedef std::pair<file_types::ID, std::string> OutputPair;
33+
using OutputPair = std::pair<file_types::ID, std::string>;
3434
} // end anonymous namespace
3535

3636
namespace swift {

0 commit comments

Comments
 (0)