Commit Graph

426 Commits

Author SHA1 Message Date
Michael Spencer
b2640e15e4 [test] Rename all module.map files to module.modulemap
`module.map` as a module map name has been discouraged since 2014, and
Clang will soon warn on its usage. This patch renames all instances of
`module.map` in the Swift tests to `module.modulemap` in preparation
for this change to Clang.

rdar://106123303
2023-08-21 15:58:59 -07:00
Steven Wu
67e919f632 Merge pull request #67229 from cachemeifyoucan/eng/PR-dep-scan-avoid-repeated-cmd-update
[DependencyScan] Prevent command-line flags added again on re-scan
2023-07-19 13:44:38 -07:00
Steven Wu
0c56f1468c Merge pull request #67226 from cachemeifyoucan/eng/PR-virtualize-module-trace-file
[OutputBackend] Virtualize LoadedModuleTraceFile
2023-07-13 15:28:08 -07:00
Daniel Rodríguez Troitiño
70376a15f0 [ScanDependencies] Fix JSON generation under certain circunstances. (#67246)
The code of `ScanDependencies.cpp` was creating invalid JSON since #66031
because in the case of having `extraPcmArgs` and `swiftOverlayDependencies`,
but not `bridgingHeader`, a comma will not be added at the end of
`extraPcmArgs`, creating an invalid JSON file. Additionally that same PR
added a trailing comma at the end of the `swiftOverlayDependencies`, which
valid JSON does not allow, but that bug was removed in #66366.

Both problems are, however, present in the 5.9 branch, because #66936
included #66031, but not #66366.

Besides fixing the problem in `ScanDependencies.cpp` I modified every test
that uses `--scan-dependencies` to pass the produced JSON through
Python's `json.tool` in order to validate proper JSON is produced. In
most cases I was able to pipe the output of the tool into `FileCheck`,
but in some cases the validation is done by itself because the checks
depend on the exact format generated by `--scan-dependencies`. In
a couple of tests I added a call to `FileCheck` that seemed to be
missing.

Without these changes, two tests seems to be generating invalid JSON in
my machine:

- `ScanDependencies/local_cache_consistency.swift` (which outputs `Expecting ',' delimiter: line 525 column 11 (char 22799)`)
- `ScanDependencies/placholder_overlay_deps.swift`
2023-07-12 14:19:20 -07:00
Steven Wu
5fb778b7d2 [DependencyScan] Prevent command-line flags added again on re-scan
Add a flag `finalized` to indicate that a module entry in the dependency
cache is finalized and no longer needs to be updated. This prevents the
command-line flags from dependency inputs get added multiple times on
re-scan with the same service.

While during normal compilation, adding the same command-line flags
multiple times are fine, it is bad for caching builds as a new
compilation cache key needs to be computed every time.
2023-07-11 13:46:03 -07:00
Steven Wu
da62873402 [OutputBackend] Virtualize LoadedModuleTraceFile
Virtualize LoadedModuleTraceFile output using the new appending support
in virtual output backend.
2023-07-11 13:42:29 -07:00
Steven Wu
47137709a4 [CAS] Virtualize TBD output
Virtualize TBD file output so we can check the output determinisim and
also be cached.
2023-06-12 13:22:10 -07:00
Steven Wu
8fb0d5f803 Virtualize swiftconstvalues output
Virtualize swiftconstvalues output so it can be cached inside CAS.
2023-06-12 13:22:10 -07:00
Ellie Shin
3cd653d7ae Merge pull request #66226 from apple/es-alias-rename
Update module aliasing terms in diagnostics and comments
2023-06-01 15:51:25 -07:00
Slava Pestov
ef466ca9d0 Basic: Remove VariadicGenerics feature 2023-05-31 23:41:23 -04:00
Ellie Shin
8c66776ce1 Update module aliasing terms in diagnostics and comments
s/underlying_name/real_name

rdar://110028578
2023-05-31 11:47:11 -07:00
Daniel Rodríguez Troitiño
8f0382c109 [test] Replace swift_obj_root for alternates that work in LLVM unified builds (#66167)
In LLVM unified builds `%swift_obj_root` points to `<LLVM build dir>/tools/swift`,
and folders like `bin`, `lib` and `share` are not under `swift_obj_root`, which
makes some tests fail.

For the cases in which `%swift_obj_root/lib` was used, replace it by
using `%swift-lib-dir` instead. Replicate `%swift-lib-dir` to create
`%swift-bin-dir` and `%swift-share-dir`, and use those instead of
`%swift_obj_root/bin` and `%swift_obj_root/share`.

This alternates work both in Swift build-script builds and also in LLVM
unified builds.
2023-05-26 08:39:31 -07:00
Artem Chikin
e2ea6cb824 [Explicit Module Builds] Add 'ClangImporter' setting for explicitly-built modules
This will mean that '-disable-implicit-swift-modules' also automatically implies two things:
1. Clang modules must also be explicit, and the importer's clang instance will get '-fno-implicit-modules' and '-fno-implicit-module-maps'
2. The importer's clang instance will no longer get a '-fmodules-cache-path=', since it is not needed in explicit builds
2023-05-15 09:45:42 -07:00
Daniel Rodríguez Troitiño
1566eccbad [test] Take care of change out of deleted directories (#65664)
These two tests were changing directories into the temporary, never
changing out of there, and then recreating the temporary, which left the
rest of the test executing in a non-existing directory.

Modify those tests to change out to the previous directory and avoid
executing any command in a non-existing directory.
2023-05-05 14:43:15 -07:00
Holly Borla
234b5dc660 [SE-0393] Require the repeat keyword for generic requirement expansions. 2023-04-12 22:04:01 -07:00
Steven Wu
09b8af86fb Virtualize swift compiler outputs (#63206)
Using a virutal output backend to capture all the outputs from
swift-frontend invocation. This allows redirecting and/or mirroring
compiler outputs to multiple location using different OutputBackend.

As an example usage for the virtual outputs, teach swift compiler to
check its output determinism by running the compiler invocation
twice and compare the hash of all its outputs.

Virtual output will be used to enable caching in the future.
2023-04-05 23:34:37 +08:00
Alejandro Alonso
4a681160dc Merge pull request #64673 from Azoy/builtin-module-feature
[Frontend] Add BuiltinModule experimental feature
2023-03-29 23:12:40 -07:00
Ben Barham
85d176e68b [Test] Re-enable previously failing ASAN test
This was fixed by https://github.com/apple/swift/pull/63881, ie. a stack
use after scope.

Resolves rdar://100508951.
2023-03-28 10:50:47 -07:00
Alejandro Alonso
c21899ee0f Add BuiltinModule experimental feature 2023-03-28 09:41:37 -07:00
Anthony Latsis
14b70f306b DiagnosticVerifier: Default expected fix-it start line to the diagnostic's 2023-03-08 12:10:27 +03:00
Anthony Latsis
8306f870ec DiagnosticVerifier: Default expected fix-it end line to start line 2023-03-08 12:10:27 +03:00
Sophia Poirier
70cffb06f3 [Variadic Generics] type parameter pack syntax change: T... -> each T 2023-03-02 14:42:28 -08:00
Alejandro Alonso
023c40c809 Add option to explicitly import Builtin 2023-02-16 15:23:45 -08:00
Saleem Abdulrasool
e48ee8d0b2 test: enable crash-in-user-code on Windows
This test was disabled on Windows through the `MSC_VER` condition.  The
failure was due to the redirection of the output which does not behave
entirely the expected way with the lit shell.  Use a temporary file
instead and enable the test on Windows.
2023-01-18 11:22:04 -08:00
Holly Borla
6725f365ba [Variadic Generics] Update tests for syntax changes. 2023-01-07 09:50:14 -08:00
Anthony Latsis
746c7aff7d [NFC] AST: Rename CompoundIdentTypeReprMemberTypeRepr 2023-01-07 07:14:41 +03:00
Alexis Laferrière
c266e9dce5 Merge pull request #62185 from xymus/improve-rmodule-loading
Improve `-Rmodule-loading` to show both the path to the source and to the cached file actually loaded
2022-11-28 14:25:15 -08:00
Alexis Laferrière
ed877ff0f2 [Test] Make more permissive checks against the format of -Rmodule-loading 2022-11-18 10:44:07 -08:00
Robert Widmann
37e7052c68 Remove -emit-syntax and -verify-syntax-tree 2022-11-16 15:07:48 -08:00
Alexis Laferrière
5dbdb87299 [Frontend] Allow aliasing the stdlib Swift module 2022-11-04 11:10:47 -07:00
Artem Chikin
c51efbed9c Add option to suppress emission of remarks ('-suppress-remarks')
And enforce it especially in downstream contexts such as building interfaces of SDK dependencies, where the remarks are not actionable by the user.
2022-10-28 10:49:27 -07:00
Anthony Latsis
6a09b8e16c Merge pull request #61448 from AnthonyLatsis/no-xcode-projects
Don’t suggest adding the project in the "submit a bug report" message
2022-10-18 23:52:03 +03:00
Anthony Latsis
7e286fdd57 Don’t suggest adding the project in the "submit a bug report" message
Instead, stimulate users to follow the referenced bug reporting guidelines,
which contain all the necessary information. We’d rather encourage attempts
at reducing issues before attaching Xcode projects. This is an accompaniment
to https://github.com/apple/swift-org-website/pull/158.
2022-10-18 19:19:15 +03:00
Hamish Knight
48ea933804 Parse an ellipsis T... for type parameter packs
In a generic parameter list, parse an ellipsis
to produce a type parameter pack. This replaces
the previous `@_typeSequence` attribute.
2022-10-14 15:40:12 +01:00
Artem Chikin
2817883cb0 [Compile Time Constant Extraction] Allow quoted protocol names inside argument list to '-const-gather-protocols-file' 2022-10-12 10:11:52 -07:00
Arnold Schwaighofer
13786d52c2 Frontend/clang-args-diags.swift currently fails on ASAN bots
Temporarily disable the test.

rdar://100508951
2022-09-30 06:06:22 -07:00
Anthony Latsis
b65e1bb5b5 Merge pull request #60840 from AnthonyLatsis/migrate-test-suite-to-gh-issues-14
Gardening: Migrate test suite to GH issues p. 14
2022-09-03 22:01:39 +03:00
Kavon Farvardin
c310abd918 add -emit-ast and -emit-parse as aliases for the -dump-* flags
This is mainly to improve usability for Swift compiler developers.

resolves rdar://99357128
2022-08-30 17:13:53 -07:00
Anthony Latsis
81f8fd60ba Gardening: Migrate test suite to GH issues: Frontend 2022-08-30 00:47:35 +03:00
Holly Borla
8713d78704 [PrintOptions] Print explicit 'any' in SIL. 2022-08-18 01:15:12 -04:00
Artem Chikin
6e7f3076b8 Add rudimentary emission of compile-time-known default-initialized property values of specific conformances. 2022-08-01 11:06:59 -07:00
Artem Chikin
85b767dea2 Merge pull request #60139 from artemcm/AddConstValueExtractionPathHandling
Add supplementary output path handling for extracted compile-time-known values
2022-07-21 13:19:42 -07:00
Doug Gregor
569859ab60 Add hasFeature(X) to check for future features 2022-07-19 21:27:39 -07:00
Doug Gregor
a317fad88d Add -enable-upcoming-feature X command-line argument.
Introduce the `-enable-upcoming-feature X` command-line argument to
allow one to opt into features that will be enabled in an upcoming language
mode. Stage in several features this way (`ConciseMagicFile`,
`ForwardTrailingClosures`, `BareSlashRegexLiterals`).
2022-07-19 21:20:12 -07:00
Artem Chikin
b1fee939f1 Add supplementary output path handling for extracted compile-time-known values 2022-07-19 16:24:26 -07:00
Egor Zhdan
c99083e173 Merge pull request #59650 from buttaface/sdk
[test] Fix test that's failing on the Android CI since string processing was enabled by default
2022-06-28 16:06:25 +01:00
Andrew Trick
f428b512cc [test] Disable tests until we fix _StringProcessing #59653
These are failing due to #42611.
2022-06-23 14:09:23 -07:00
Butta
a240752487 [test] Fix test that's failing on the Android CI since string processing was enabled by default
Also, move the test to test/Frontend/ where it belongs and disable implicit
concurrency import too.
2022-06-23 01:27:14 +05:30
Richard Wei
94e8f5393e Enable string processing by default.
Make frontend flag `-enable-experimental-string-processing` default to true.
2022-06-12 20:25:16 -07:00
Artem Chikin
11f24ca20d Merge pull request #59256 from artemcm/FrontendParseableUnknownExtensions
[Parseable Output] Generate valid output for files of unknown types
2022-06-07 10:57:41 -07:00