Skip to content

Commit 382ff2a

Browse files
committed
Frontend: add a frontend argument to pass down block list config file path
1 parent de424d9 commit 382ff2a

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
@@ -566,6 +566,9 @@ namespace swift {
566566
/// The model of concurrency to be used.
567567
ConcurrencyModel ActiveConcurrencyModel = ConcurrencyModel::Standard;
568568

569+
/// All block list configuration files to be honored in this compilation.
570+
std::vector<std::string> BlocklistConfigFilePath;
571+
569572
bool isConcurrencyModelTaskToThread() const {
570573
return ActiveConcurrencyModel == ConcurrencyModel::TaskToThread;
571574
}

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
@@ -694,6 +694,10 @@ ASTContext::ASTContext(
694694
// Register any request-evaluator functions available at the AST layer.
695695
registerAccessRequestFunctions(evaluator);
696696
registerNameLookupRequestFunctions(evaluator);
697+
// Insert all block list config paths.
698+
for (auto path: langOpts.BlocklistConfigFilePath) {
699+
blockListConfig.addConfigureFilePath(path);
700+
}
697701
}
698702

699703
ASTContext::~ASTContext() {

lib/Frontend/CompilerInvocation.cpp

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

12121212
Opts.DumpTypeWitnessSystems = Args.hasArg(OPT_dump_type_witness_systems);
12131213

1214+
for (auto A : Args.getAllArgValues(options::OPT_block_list_file)) {
1215+
Opts.BlocklistConfigFilePath.push_back(A);
1216+
}
12141217
if (const Arg *A = Args.getLastArg(options::OPT_concurrency_model)) {
12151218
Opts.ActiveConcurrencyModel =
12161219
llvm::StringSwitch<ConcurrencyModel>(A->getValue())

0 commit comments

Comments
 (0)