Merge pull request #68138 from rastogishubham/MCCASSwift

Add driver options to swift to enable MCCAS.
This commit is contained in:
Shubham Sandeep Rastogi
2023-09-08 10:17:10 -07:00
committed by GitHub
11 changed files with 124 additions and 26 deletions

View File

@@ -266,6 +266,10 @@ setIRGenOutputOptsFromFrontendOptions(IRGenOptions &IRGenOpts,
}
}(FrontendOpts.RequestedAction);
IRGenOpts.UseCASBackend = FrontendOpts.UseCASBackend;
IRGenOpts.CASObjMode = FrontendOpts.CASObjMode;
IRGenOpts.EmitCASIDFile = FrontendOpts.EmitCASIDFile;
// If we're in JIT mode, set the requisite flags.
if (FrontendOpts.RequestedAction == FrontendOptions::ActionType::Immediate) {
IRGenOpts.UseJIT = true;
@@ -1447,7 +1451,8 @@ static bool ParseClangImporterArgs(ClangImporterOptions &Opts,
DiagnosticEngine &Diags,
StringRef workingDirectory,
const LangOptions &LangOpts,
const FrontendOptions &FrontendOpts) {
const FrontendOptions &FrontendOpts,
bool RequiresCAS) {
using namespace options;
if (const Arg *a = Args.getLastArg(OPT_tools_directory)) {
@@ -1575,7 +1580,7 @@ static bool ParseClangImporterArgs(ClangImporterOptions &Opts,
// Forward the FrontendOptions to clang importer option so it can be
// accessed when creating clang module compilation invocation.
if (FrontendOpts.EnableCaching)
if (RequiresCAS)
Opts.CASOpts = FrontendOpts.CASOpts;
return false;
@@ -3034,7 +3039,7 @@ bool CompilerInvocation::parseArgs(
}
if (ParseClangImporterArgs(ClangImporterOpts, ParsedArgs, Diags,
workingDirectory, LangOpts, FrontendOpts)) {
workingDirectory, LangOpts, FrontendOpts, requiresCAS())) {
return true;
}