Commit Graph

12 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis 429416cabd [CAS] Store the input index along the compiler results
This allows replaying the cached compiler results from an upstream CAS,
if we know the key, without needing access to the caching key input CAS tree.
2026-05-19 11:09:35 -07:00
Argyrios Kyrtzidis 2c4988d6f9 Merge pull request #87981 from akyrtzi/akyrtzi/pr/swiftscan-casfsbuilder-apis
[CAS][SwiftScan] Introduce APIs for creating a CASFS root
2026-03-20 16:45:40 -07:00
Argyrios Kyrtzidis b0537d7a7b [CAS][SwiftScan] Introduce APIs for creating a CASFS root
These are APIs that are wrapping `llvm::cas::CASFSBuilder`
2026-03-20 10:58:11 -07:00
Ben Langmuir 768fb73f8b Merge pull request #87862 from benlangmuir/casoptions-adaptation
[cas] Adapt to clang::CASOptions change to remove internal cache of instances
2026-03-19 09:42:20 -07:00
Ben Langmuir 11312f84de [cas] Introduce a frontend option to write CAS hash to an xattr
With the new option, when doing caching we write the hash that we already
computed for the main output file to an extended attribute (xattr) on the file.
This is equivalent to clang's -fwrite-output-hash-xattr option.

The format of the xattr is
name: com.apple.clang.cas_output_hash
data:
* Null-terminated hash schema name, e.g. llvm.builtin.v2[BLAKE3].
* Hash length (4 bytes, little-endian).
* Hash bytes

rdar://171185394
2026-03-16 15:06:33 -07:00
Ben Langmuir d7065a6d64 [cas] Adapt to clang::CASOptions change to remove internal cache of instances
Migrate all callers of getOrCreateDatabases to either create their own CAS
instances using createDatabases() or to use the ones stored in the
CompilerInstance. Also forwards the instances into the ClangImporter and its
various clang::CompilerInstance instances.

Validated locally that this does not result in any additional calls to
createDatabases across all the swift tests. In fact, there are fewer due to an
improvement on the clange side, so I also checked that the overall reduction
doesn't hide any issues. Looking at individual cas paths that are opened, which
are per-test paths, there are none that open more than before.
2026-03-13 14:16:47 -07:00
Anthony Latsis 345c601626 Address some overload deprecations in llvm::support::endian
See:
* https://github.com/llvm/llvm-project/pull/161045
* https://github.com/llvm/llvm-project/pull/160979
2025-12-01 11:19:25 +00:00
Steven Wu 627c64f391 [Caching][NFC] Unify the two cache replay code path
There were two cache replay code exists, one for cache replay from
swift-frontend, the other for replay using C API from libSwiftScan. It
is easy to forget to update one copy when new specialized cache replay
logic is added for some output kinds. Now unify the replay logics to a
single location to avoid confusion. This is a rewrite of the existing
logic and NFCI.
2024-12-19 14:10:46 -08:00
Steven Wu f073d16c43 [Caching] Fix symbol graph output from driver APIs
Add the logics to replay symbol graph output from driver APIs.
2024-12-18 14:44:01 -08:00
Steven Wu a22bd3ad80 [MCCAS] Simplify MCCAS replay logic. NFC 2024-12-18 14:44:01 -08:00
Steven Wu 58d71379aa [Caching] Fix cache replay logics for makefile dependency file
Make sure the driver replay logics from C API can replay makefile
dependency file correctly.

rdar://141567785
2024-12-18 14:44:00 -08:00
Artem Chikin 338b9141e3 Move libSwiftScan from 'tools' to 'lib/Tooling'
'tools' should be reserved for executable tools.
2024-11-14 08:44:32 -08:00