Skip to content

Commit 2c2431e

Browse files
committed
Frontend: add a frontend argument to pass down block list config file path
1 parent ba31c97 commit 2c2431e

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,9 @@ namespace swift {
556556
/// The model of concurrency to be used.
557557
ConcurrencyModel ActiveConcurrencyModel = ConcurrencyModel::Standard;
558558

559+
/// All block list configuration files to be honored in this compilation.
560+
std::vector<std::string> BlocklistConfigFilePath;
561+
559562
bool isConcurrencyModelTaskToThread() const {
560563
return ActiveConcurrencyModel == ConcurrencyModel::TaskToThread;
561564
}

include/swift/Option/FrontendOptions.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ def Raccess_note : Separate<["-"], "Raccess-note">,
240240
def Raccess_note_EQ : Joined<["-"], "Raccess-note=">,
241241
Alias<Raccess_note>;
242242

243+
def block_list_file
244+
: Separate<["-"], "blocklist-file">, MetaVarName<"<path>">,
245+
HelpText<"The path to a blocklist configuration file">;
243246
} // end let Flags = [FrontendOption, NoDriverOption]
244247

245248
def debug_crash_Group : OptionGroup<"<automatic crashing options>">;

lib/AST/ASTContext.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,10 @@ ASTContext::ASTContext(
707707
registerNameLookupRequestFunctions(evaluator);
708708

709709
createModuleToExecutablePluginMap();
710+
// Insert all block list config paths.
711+
for (auto path: langOpts.BlocklistConfigFilePath) {
712+
blockListConfig.addConfigureFilePath(path);
713+
}
710714
}
711715

712716
ASTContext::~ASTContext() {

lib/Frontend/CompilerInvocation.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
11641164

11651165
Opts.DumpTypeWitnessSystems = Args.hasArg(OPT_dump_type_witness_systems);
11661166

1167+
for (auto A : Args.getAllArgValues(options::OPT_block_list_file)) {
1168+
Opts.BlocklistConfigFilePath.push_back(A);
1169+
}
11671170
if (const Arg *A = Args.getLastArg(options::OPT_concurrency_model)) {
11681171
Opts.ActiveConcurrencyModel =
11691172
llvm::StringSwitch<ConcurrencyModel>(A->getValue())

0 commit comments

Comments
 (0)