mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 22:00:10 +00:00
[Driver] Group together linker options using addAllArgs (#68349)
This commit is contained in:
parent
dcf9d946f5
commit
894927b491
@ -262,11 +262,9 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_L);
|
||||
ToolChain.AddFilePathLibArgs(Args, CmdArgs);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_s);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_t);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_Z_Flag);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_r);
|
||||
Args.addAllArgs(CmdArgs,
|
||||
{options::OPT_T_Group, options::OPT_s, options::OPT_t,
|
||||
options::OPT_Z_Flag, options::OPT_r});
|
||||
|
||||
if (D.isUsingLTO()) {
|
||||
assert(!Inputs.empty() && "Must have at least one input.");
|
||||
|
@ -133,8 +133,7 @@ void fuchsia::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
}
|
||||
}
|
||||
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_L);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_u);
|
||||
Args.addAllArgs(CmdArgs, {options::OPT_L, options::OPT_u});
|
||||
|
||||
ToolChain.AddFilePathLibArgs(Args, CmdArgs);
|
||||
|
||||
|
@ -530,8 +530,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
ToolChain.addFastMathRuntimeIfAvailable(Args, CmdArgs);
|
||||
}
|
||||
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_L);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_u);
|
||||
Args.addAllArgs(CmdArgs, {options::OPT_L, options::OPT_u});
|
||||
|
||||
ToolChain.AddFilePathLibArgs(Args, CmdArgs);
|
||||
|
||||
|
@ -120,8 +120,7 @@ void nacltools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));
|
||||
}
|
||||
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_L);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_u);
|
||||
Args.addAllArgs(CmdArgs, {options::OPT_L, options::OPT_u});
|
||||
|
||||
ToolChain.AddFilePathLibArgs(Args, CmdArgs);
|
||||
|
||||
|
@ -266,12 +266,9 @@ void netbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
}
|
||||
}
|
||||
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_L);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_s);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_t);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_Z_Flag);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_r);
|
||||
Args.addAllArgs(CmdArgs,
|
||||
{options::OPT_L, options::OPT_T_Group, options::OPT_s,
|
||||
options::OPT_t, options::OPT_Z_Flag, options::OPT_r});
|
||||
|
||||
bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
|
||||
bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
|
||||
|
@ -208,11 +208,9 @@ void tools::PScpu::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
CmdArgs.push_back("--lto=full");
|
||||
}
|
||||
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_L);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_s);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_t);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_r);
|
||||
Args.addAllArgs(CmdArgs,
|
||||
{options::OPT_L, options::OPT_T_Group, options::OPT_s,
|
||||
options::OPT_t, options::OPT_r});
|
||||
|
||||
if (Args.hasArg(options::OPT_Z_Xlinker__no_demangle))
|
||||
CmdArgs.push_back("--no-demangle");
|
||||
|
@ -190,8 +190,8 @@ void RISCV::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
|
||||
AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
|
||||
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_L);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_u);
|
||||
Args.addAllArgs(CmdArgs, {options::OPT_L, options::OPT_u});
|
||||
|
||||
ToolChain.AddFilePathLibArgs(Args, CmdArgs);
|
||||
Args.addAllArgs(CmdArgs,
|
||||
{options::OPT_T_Group, options::OPT_s, options::OPT_t,
|
||||
|
@ -73,8 +73,8 @@ void wasm::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
if (Args.hasArg(options::OPT_s))
|
||||
CmdArgs.push_back("--strip-all");
|
||||
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_L);
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_u);
|
||||
Args.addAllArgs(CmdArgs, {options::OPT_L, options::OPT_u});
|
||||
|
||||
ToolChain.AddFilePathLibArgs(Args, CmdArgs);
|
||||
|
||||
bool IsCommand = true;
|
||||
|
@ -156,10 +156,9 @@ void zos::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
CmdArgs.push_back("/dev/null");
|
||||
}
|
||||
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_u);
|
||||
|
||||
// Add archive library search paths.
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_L);
|
||||
Args.addAllArgs(CmdArgs, {options::OPT_L, options::OPT_u});
|
||||
|
||||
ToolChain.AddFilePathLibArgs(Args, CmdArgs);
|
||||
|
||||
// Specify linker input file(s)
|
||||
|
Loading…
Reference in New Issue
Block a user