13 Commits

Author SHA1 Message Date
Saleem Abdulrasool
54f5837c7b swift-scan-test: adjust frontend detection for Windows
Ensure that we account for file system arc separators and extensions by
using the LLVM functions rather than trying to simply do string
matching. This allows us to properly handle inputs on Windows.
2025-12-11 15:29:56 -08:00
Anthony Latsis
ea5d89d0d0 tools: Set Swift bug report message in some executable targets
If these programs crash, we want them to print the Swift bug report
message, not the default LLVM one, which leads to
https://github.com/llvm/llvm-project/issues.

While here, hoist the setting of the bug report message to the
START_PROGRAM macro so that we don't forget to set it in the future.
2025-09-19 12:05:31 +01:00
Steven Wu
9d59044bb1 [BrdigingHeader] Auto bridging header chaining
Add ability to automatically chaining the bridging headers discovered from all
dependencies module when doing swift caching build. This will eliminate all
implicit bridging header imports from the build and make the bridging header
importing behavior much more reliable, while keep the compatibility at maximum.

For example, if the current module A depends on module B and C, and both B and
C are binary modules that uses bridging header, when building module A,
dependency scanner will construct a new header that chains three bridging
headers together with the option to build a PCH from it. This will make all
importing errors more obvious while improving the performance.
2025-02-05 09:41:04 -08:00
Ben Barham
b7954411ec Merge remote-tracking branch 'origin/main' into manually-merge-main-to-rebranch
Conflicts:
  - `include/swift/AST/PluginRegistry.h`
2024-06-27 14:56:11 -07:00
Steven Wu
1912d0b1e7 [Caching] Teach libSwiftScan to replay all diagnostics kind
Add support for serialized diagnostics, parseable output, and other
kinds of output from diagnostics engine to the libSwiftScan
replayCompilation API.

rdar://129015959
2024-06-17 13:32:10 -07:00
swift-ci
e54e333862 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-22 14:15:04 -07:00
Steven Wu
47598bbe8f [ScanDependency] Respect working directory set inside invocation
Teach scanner to respect the working directory set in the invocation
through scanner C API.

Also add test infrastructure to testing scanner from C API. Break up
DependencyScan lib into two so the swift-scan-test and remain small
without understanding swift AST.

rdar://127626011
2024-05-22 11:04:45 -07:00
Ben Barham
440421bcc5 Rename ThreadPool to StdThreadPool
`ThreadPool` was split up in LLVM
6594f428de91e333c1cbea4f55e79b18d31024c4.
2024-04-08 08:58:58 -07:00
Ben Barham
1fdda023b3 Rename StringRef::endswith references to StringRef::ends_with
Missed this when doing the `startswith` renaming. `endswith` has also
been deprecated upstream (and presumably soon to be removed).
2024-04-01 10:59:16 -07:00
Steven Wu
53239831bd [swift-scan-test] Fix the matching bracket in message
Fix a matching bracket in diagnostics.
2024-01-22 11:54:06 -08:00
Steven Wu
f232ebb286 [Caching] Don't parse LLVMArgs in cache replay instance
`llvm::cl::ParseCommandLineOptions()` is not thread-safe to be called
from libSwiftScan so replaying multiple commands in parallel can crash
the build system. Since the replay instance is not used for compilation
and only need information from command-line arguments to create outputs
and diagnostics, ignore LLVMArgs when replaying.

rdar://120423882
2024-01-04 13:31:09 -08:00
Steven Wu
76bde39ee7 [Caching] Encoding cache key for input file with index instead of path
Avoid path encoding difference (for example, real_path vs. path from
symlink) by eliminating the path from cache key. Cache key is now
encoded with the index of the input file from all the input files from
the command-line, reguardless if those inputs will produce output or
not. This is to ensure stable ordering even the batching is different.

Add a new cache computation API that is preferred for using input index
directly. Old API for cache key is deprecated but still updated to
fallback to real_path comparsion if needed.

As a result of swift scan API change, rename the feature in JSON file to
avoid version confusion between swift-driver and libSwiftScan.

rdar://119387650
2023-12-18 14:06:00 -08:00
Steven Wu
034c15ce54 [Caching] Add new CacheReplay APIs to libSwiftScan
Add new APIs libSwiftScan that can be used for cache query and cache
replay. This enables swift-driver or build system to query the cache and
replay the compilation results without invocation swift-frontend for
better scheduling.
2023-11-03 15:59:56 -07:00