Skip to content

[gardening][Driver] Replace typedef with using #15228

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 23, 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
6 changes: 3 additions & 3 deletions include/swift/Driver/Action.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ namespace driver {

class Action {
public:
typedef ArrayRef<const Action *>::size_type size_type;
typedef ArrayRef<const Action *>::iterator iterator;
typedef ArrayRef<const Action *>::const_iterator const_iterator;
using size_type = ArrayRef<const Action *>::size_type;
using iterator = ArrayRef<const Action *>::iterator;
using const_iterator = ArrayRef<const Action *>::const_iterator;

enum ActionClass {
Input = 0,
Expand Down
10 changes: 5 additions & 5 deletions include/swift/Driver/DependencyGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ class DependencyGraphImpl {
class StringSetIterator {
llvm::StringSet<>::const_iterator I;
public:
typedef llvm::StringSet<>::const_iterator::value_type value_type;
typedef std::input_iterator_tag iterator_category;
typedef ptrdiff_t difference_type;
typedef value_type &reference;
typedef value_type *pointer;
using value_type = llvm::StringSet<>::const_iterator::value_type;
using iterator_category = std::input_iterator_tag;
using difference_type = ptrdiff_t;
using reference = value_type &;
using pointer = value_type *;

/*implicit*/ StringSetIterator(llvm::StringSet<>::const_iterator base)
: I(base) {}
Expand Down
4 changes: 2 additions & 2 deletions include/swift/Driver/Util.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ namespace swift {

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

enum class LinkKind {
None,
Expand Down
3 changes: 1 addition & 2 deletions lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -776,8 +776,7 @@ static Arg *makeInputArg(const DerivedArgList &Args, OptTable &Opts,
return A;
}


typedef std::function<void(InputArgList &, unsigned)> RemainingArgsHandler;
using RemainingArgsHandler = std::function<void(InputArgList &, unsigned)>;

std::unique_ptr<InputArgList>
parseArgsUntil(const llvm::opt::OptTable& Opts,
Expand Down
2 changes: 1 addition & 1 deletion lib/Driver/ParseableOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace {
CommandInput(StringRef Path) : Path(Path) {}
};

typedef std::pair<file_types::ID, std::string> OutputPair;
using OutputPair = std::pair<file_types::ID, std::string>;
} // end anonymous namespace

namespace swift {
Expand Down