swift
8a82ab34 - [rebranch] Adjust to "[clang][cas] Remove an invalid cantFail from CompileJobResultSchema"

Commit
3 days ago
[rebranch] Adjust to "[clang][cas] Remove an invalid cantFail from CompileJobResultSchema" ``` /Users/alatsis/Desktop/rebranch/swift-2/lib/Frontend/CachingUtils.cpp:93:40: error: no matching constructor for initialization of 'clang::cas::CompileJobResultSchema' clang::cas::CompileJobResultSchema Schema(CAS); ``` The llvm-commit replaced the public `CompileJobResultSchema(ObjectStore &)` constructor with a fallible static factory `create(ObjectStore &)` returning `Expected`, making the `(ObjectStore &, ObjectRef)` constructor private, so that a CAS store failure surfaces as an `Error` instead of an invalid `cantFail`. Migrate both `clang::cas` construction sites to `create`, propagate the failure through the enclosing `Error`/`Expected`-returning control flow via `takeError()`, and update member access from `Schema.` to `Schema->`. See https://github.com/llvm/llvm-project/commit/b693d6fedb6cbfd15ef7cd8c42891c7b888615c5 (No PR found). Assisted-by: Claude Code Cherry-picked to main, where llvm-project is still on stable/21.x and clang::cas::CompileJobResultSchema has only the public CompileJobResultSchema(ObjectStore &) constructor -- create() does not exist and, on stable/23.x, the one-argument constructor is private. There is no spelling that compiles against both, so guard the construction on LLVM_VERSION_MAJOR >= 23 and wrap the older constructor in a std::optional, which keeps the code below identical (Schema->) on both branches. Remove the guard when main moves to clang 23.
Author
Committer
Parents
Loading