Fine-grained autolinking control

This change adds the following options to allow for greater control over the compiler's autolinking directive use:
- '-disable-autolink-library': equivalent to an existing '-disable-autolink-framework', this option takes a library name as input and ensures the compiler does not produce an autolink directive '-l<library-name>'.
- '-disable-autolink-frameworks': a boolean disable flag which turns off insertion of autolinking directives for all imported frameworks (of the type '-framework <framework-name>')
- '-disable-all-autolinking': a boolean disable flag which turns off insertion of *any* autolinking directives.

Resolves rdar://100859983
This commit is contained in:
Artem Chikin
2023-10-05 15:12:48 -07:00
parent 90506909d3
commit 57e4f244d1
7 changed files with 116 additions and 15 deletions

View File

@@ -2601,6 +2601,11 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
for (const Arg *A : Args.filtered(OPT_disable_autolink_framework)) {
Opts.DisableAutolinkFrameworks.push_back(A->getValue());
}
for (const Arg *A : Args.filtered(OPT_disable_autolink_library)) {
Opts.DisableAutolinkLibraries.push_back(A->getValue());
}
Opts.DisableFrameworkAutolinking = Args.hasArg(OPT_disable_autolink_frameworks);
Opts.DisableAllAutolinking = Args.hasArg(OPT_disable_all_autolinking);
Opts.GenerateProfile |= Args.hasArg(OPT_profile_generate);
const Arg *ProfileUse = Args.getLastArg(OPT_profile_use);