mirror of
https://github.com/rui314/mold.git
synced 2024-10-05 00:57:08 +03:00
Refactor
This commit is contained in:
parent
06cdd7e951
commit
ed9a29b713
@ -346,10 +346,11 @@ static std::pair<i64, i64> get_plt_size(Context<E> &ctx) {
|
||||
}
|
||||
|
||||
template <typename E>
|
||||
void parse_nonpositional_args(Context<E> &ctx,
|
||||
std::vector<std::string> &remaining) {
|
||||
std::vector<std::string> parse_nonpositional_args(Context<E> &ctx) {
|
||||
std::span<std::string_view> args = ctx.cmdline_args;
|
||||
args = args.subspan(1);
|
||||
|
||||
std::vector<std::string> remaining;
|
||||
std::string_view arg;
|
||||
|
||||
ctx.arg.color_diagnostics = isatty(STDERR_FILENO);
|
||||
@ -1054,12 +1055,11 @@ void parse_nonpositional_args(Context<E> &ctx,
|
||||
|
||||
if (version_shown && remaining.empty())
|
||||
exit(0);
|
||||
return remaining;
|
||||
}
|
||||
|
||||
#define INSTANTIATE(E) \
|
||||
template \
|
||||
void parse_nonpositional_args(Context<E> &ctx, \
|
||||
std::vector<std::string> &remaining)
|
||||
template std::vector<std::string> parse_nonpositional_args(Context<E> &ctx);
|
||||
|
||||
INSTANTIATE_ALL;
|
||||
|
||||
|
@ -374,9 +374,7 @@ static int elf_main(int argc, char **argv) {
|
||||
|
||||
// Parse non-positional command line options
|
||||
ctx.cmdline_args = expand_response_files(ctx, argv);
|
||||
|
||||
std::vector<std::string> file_args;
|
||||
parse_nonpositional_args(ctx, file_args);
|
||||
std::vector<std::string> file_args = parse_nonpositional_args(ctx);
|
||||
|
||||
// If no -m option is given, deduce it from input files.
|
||||
if (ctx.arg.emulation == -1)
|
||||
|
@ -1349,8 +1349,7 @@ void process_run_subcommand(Context<E> &ctx, int argc, char **argv);
|
||||
//
|
||||
|
||||
template <typename E>
|
||||
void
|
||||
parse_nonpositional_args(Context<E> &ctx, std::vector<std::string> &remaining);
|
||||
std::vector<std::string> parse_nonpositional_args(Context<E> &ctx);
|
||||
|
||||
//
|
||||
// passes.cc
|
||||
|
Loading…
Reference in New Issue
Block a user