mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add driver options to swift to enable MCCAS.
To enable MCCAS, the following driver options have been added -cas-backend: Enable MCCAS backend in swift, the option -cache-compile-job must also be used. -cas-backend-mode=native: Set the CAS Backend mode to emit an object file after materializing it from the CAS. -cas-backend-mode=casid: Emit a file with the CASID for the CAS that was created. -cas-backend-mode=verify: Verify that the object file created is identical to the object file materialized from the CAS. -cas-emit-casid-file: Emit a .casid file next to the object file when CAS Backend is enabled.
This commit is contained in:
@@ -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;
|
||||
@@ -1440,7 +1444,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)) {
|
||||
@@ -1568,7 +1573,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;
|
||||
@@ -3025,7 +3030,7 @@ bool CompilerInvocation::parseArgs(
|
||||
}
|
||||
|
||||
if (ParseClangImporterArgs(ClangImporterOpts, ParsedArgs, Diags,
|
||||
workingDirectory, LangOpts, FrontendOpts)) {
|
||||
workingDirectory, LangOpts, FrontendOpts, requiresCAS())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user