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:
Shubham Sandeep Rastogi
2023-05-09 09:00:23 -07:00
parent c3b97469da
commit 3c949028e8
11 changed files with 124 additions and 26 deletions

View File

@@ -263,7 +263,8 @@ namespace swift {
const IRGenOptions &opts,
UnifiedStatsReporter *stats, DiagnosticEngine &diags,
llvm::raw_pwrite_stream &out,
llvm::sys::Mutex *diagMutex = nullptr);
llvm::sys::Mutex *diagMutex = nullptr,
llvm::raw_pwrite_stream *casid = nullptr);
/// Wrap a serialized module inside a swift AST section in an object file.
void createSwiftModuleObjectFile(SILModule &SILMod, StringRef Buffer,