[CAS] Improve swift cas options

Using the same CASOption from clang to communicate CAS configurations so
it is easier to exchange CAS configuration between them.
This commit is contained in:
Steven Wu
2023-06-12 15:33:35 -07:00
parent b1b16981fe
commit 2b7d38dc16
15 changed files with 289 additions and 39 deletions

View File

@@ -352,8 +352,16 @@ bool ArgsToFrontendOptionsConverter::convert(
}
Opts.EnableCAS = Args.hasArg(OPT_enable_cas);
Opts.CASPath =
Opts.CASOpts.CASPath =
Args.getLastArgValue(OPT_cas_path, llvm::cas::getDefaultOnDiskCASPath());
Opts.CASOpts.PluginPath = Args.getLastArgValue(OPT_cas_plugin_path);
for (StringRef Opt : Args.getAllArgValues(OPT_cas_plugin_option)) {
StringRef Name, Value;
std::tie(Name, Value) = Opt.split('=');
Opts.CASOpts.PluginOptions.emplace_back(std::string(Name),
std::string(Value));
}
Opts.CASFSRootIDs = Args.getAllArgValues(OPT_cas_fs);
Opts.ClangIncludeTrees = Args.getAllArgValues(OPT_clang_include_tree_root);