mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Frontend: add a frontend argument to pass down block list config file path
This commit is contained in:
@@ -556,6 +556,9 @@ namespace swift {
|
||||
/// The model of concurrency to be used.
|
||||
ConcurrencyModel ActiveConcurrencyModel = ConcurrencyModel::Standard;
|
||||
|
||||
/// All block list configuration files to be honored in this compilation.
|
||||
std::vector<std::string> BlocklistConfigFilePath;
|
||||
|
||||
bool isConcurrencyModelTaskToThread() const {
|
||||
return ActiveConcurrencyModel == ConcurrencyModel::TaskToThread;
|
||||
}
|
||||
|
||||
@@ -240,6 +240,9 @@ def Raccess_note : Separate<["-"], "Raccess-note">,
|
||||
def Raccess_note_EQ : Joined<["-"], "Raccess-note=">,
|
||||
Alias<Raccess_note>;
|
||||
|
||||
def block_list_file
|
||||
: Separate<["-"], "blocklist-file">, MetaVarName<"<path>">,
|
||||
HelpText<"The path to a blocklist configuration file">;
|
||||
} // end let Flags = [FrontendOption, NoDriverOption]
|
||||
|
||||
def debug_crash_Group : OptionGroup<"<automatic crashing options>">;
|
||||
|
||||
@@ -707,6 +707,10 @@ ASTContext::ASTContext(
|
||||
registerNameLookupRequestFunctions(evaluator);
|
||||
|
||||
createModuleToExecutablePluginMap();
|
||||
// Insert all block list config paths.
|
||||
for (auto path: langOpts.BlocklistConfigFilePath) {
|
||||
blockListConfig.addConfigureFilePath(path);
|
||||
}
|
||||
}
|
||||
|
||||
ASTContext::~ASTContext() {
|
||||
|
||||
@@ -1164,6 +1164,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
|
||||
Opts.DumpTypeWitnessSystems = Args.hasArg(OPT_dump_type_witness_systems);
|
||||
|
||||
for (auto A : Args.getAllArgValues(options::OPT_block_list_file)) {
|
||||
Opts.BlocklistConfigFilePath.push_back(A);
|
||||
}
|
||||
if (const Arg *A = Args.getLastArg(options::OPT_concurrency_model)) {
|
||||
Opts.ActiveConcurrencyModel =
|
||||
llvm::StringSwitch<ConcurrencyModel>(A->getValue())
|
||||
|
||||
Reference in New Issue
Block a user