Commit Graph

1272 Commits

Author SHA1 Message Date
Richard Wei
51acf75cb5 Fix compiler crash when emitting objc header with C++ interop enabled
This was because `LoweredFunctionSignature::visitParameterList` has a special case for parameters with an empty LLVM representation (e.g. an empty struct) but forgot to increment the counter, which then tripped the assertion.

Resolves #70016.
2023-11-24 02:25:08 -08:00
Finagolfin
a03f6e5b3a [Build] Enable building and CI testing the early Swift Driver on linux with the prebuilt host toolchain 2023-11-08 20:09:59 +05:30
Meghana Gupta
01612aec21 Disable Driver/bad_tmpdir.swift failing in CI 2023-10-27 13:51:03 -07:00
Adrian Prantl
5d978b44ca Revert "Revert "Make the DWARF version emitted by the Swift compiler configurable."" 2023-10-26 12:29:18 -07:00
Adrian Prantl
2a32ca5944 Revert "Make the DWARF version emitted by the Swift compiler configurable." 2023-10-25 13:28:28 -07:00
Adrian Prantl
a26bbb0baf Make the DWARF version emitted by the Swift compiler configurable.
Previously it was hardcoded to version 4 on all platforms.
This patch introduces a driver and frontend option -dwarf-version to configure it if needed.
2023-10-24 12:30:16 -07:00
Evan Wilde
05fb5075ed Revert "test: un-XFAIL on Windows for rebranch"
This reverts commit ed9e4dbc19.

This test has started failing again, as it was before September, so I'm
going to revert the removal of the xfail. It's testing the old driver
anyway, which folks shouldn't be using.
2023-10-07 22:05:56 -07:00
Saleem Abdulrasool
ed9e4dbc19 test: un-XFAIL on Windows for rebranch
This test is now passing on Windows.  Simply remove the XFAIL to match
the current state.
2023-09-15 14:32:27 -07:00
swift-ci
d7622b5963 Merge remote-tracking branch 'origin/main' into rebranch 2023-09-04 18:36:48 -07:00
Saleem Abdulrasool
d4304e7287 Update windows-link-job.swift
Fix an incorrect alteration to the test
2023-09-04 14:52:18 -07:00
swift-ci
d2293917b3 Merge remote-tracking branch 'origin/main' into rebranch 2023-09-04 10:33:15 -07:00
Saleem Abdulrasool
6407c646ab test: mark a job incompatible with Swift parser
Due to the fact that we do not statically link the toolchain, we cannot
currently support this test.  Mark it as unavailable currently with the
early syntax parser enabled.
2023-09-04 08:01:59 -07:00
swift-ci
dbe6df083f Merge remote-tracking branch 'origin/main' into rebranch 2023-09-01 09:13:39 -07:00
Manu
02b5fa2c8e Fix some typos in the codebase 2023-08-31 18:50:10 -03:00
swift-ci
fca0dc0a16 Merge remote-tracking branch 'origin/main' into rebranch 2023-08-29 07:34:13 -07:00
Allan Shortlidge
5186971a02 Frontend: Introduce -experimental-serialize-external-decls-only option.
This option is designed to be used in conjunction with
`-experimental-lazy-typecheck` and `-experimental-skip-all-function-bodies`
when emitting a resilient module. The emitted binary module should contain only
the decls needed by clients and should contain roughly the same contents as it
would if the corresponding swiftinterface were emitted instead and then built.

This functionality is a work in progress. Some parts of the AST may still get
typechecked unnecessarily. Additionally, serialization does not trigger the
appropriate typechecking requests for some ASTs and then fails due to missing
types.

Resolves rdar://114230586
2023-08-28 21:22:20 -07:00
Cory Benfield
955927eceb Update scudo runtime library name
The scudo runtime was renamed to indicate that it now must run
standalone from other sanitizers. This patch updates the driver to
search for the appropriate filename.

LLVM rename: https://reviews.llvm.org/D138157
2023-08-23 15:36:24 -07:00
Allan Shortlidge
c05b3e4d66 Tests: Adopt -experimental-lazy-typecheck in tests.
Also, restructure the `CHECK:` lines for the `-emit-tbd` test. The number of
columns in the `.tbd` file appears to be variable, so we can't assume a layout
for the symbols in the YAML.
2023-08-18 16:29:56 -07:00
Finagolfin
30ba49e7fa [android][test] Fix a handful of tests and disable one CxxToSwiftToCxx bridging test
Also, make the analogous change to apple/swift-driver#1372, which gets the
sanitizer tests working on Android again, and remove the lld_lto feature in the
tests, which is now unused.
2023-08-12 16:36:35 +05:30
Doug Gregor
c2f5a9ad32 [Darwin macro platform paths] Add iOS simulator test 2023-07-20 17:13:25 -07:00
Ben Barham
591737e1c9 [Test] Small test fix
We want to redirect stderr to stdout, not to ^1.
2023-06-28 15:15:27 -07:00
Doug Gregor
1ec900e2a0 [Macros] Add default plugin paths for Darwin SDKs and platforms.
Corresponding to https://github.com/apple/swift-driver/pull/1377, this
adds some default plugin paths for Darwin SDKs and platforms.
Fixes rdar://110819604.
2023-06-16 14:55:20 -07:00
Egor Zhdan
d5c301823c Merge pull request #66546 from finagolfin/runtime
[Driver] Remove unused runtime library path on non-Darwin platforms
2023-06-15 13:03:46 +01:00
Tristan Labelle
11f34b7ec9 Fix linting error 2023-06-13 10:28:42 -04:00
Tristan Labelle
0d5aa7fcbe Fix non-glob paths in touch.py 2023-06-12 14:27:03 -04:00
Tristan Labelle
6308cd0834 Migrate test to touch.py 2023-06-12 14:21:34 -04:00
Finagolfin
8f0c2d3ace [Driver] Remove unused runtime library path on non-Darwin platforms
Translation of apple/swift-driver#1374 to the legacy C++ Driver, with the
addition of a test.
2023-06-12 01:04:19 +05:30
Tristan Labelle
3c51106fad Fix tests on Windows CI with vs2022 2023-06-09 16:41:05 -04:00
Yuta Saito
c994500d82 [Driver] Use WebAssembly toolchain for WASI target
The toolchain was introduced in 710816d3e0
but was not used. Test cases now use fake resource dir to lookup
static-executable-args.lnk file, which is required by the toolchain but
is not present when not building stdlib for WASI.
2023-06-08 11:40:10 +00:00
Rintaro Ishizaki
495f9b2105 Merge pull request #66145 from rintaro/revert-driver-external-plugin-path-rdar108624128
Revert "[Driver] Derive '-external-plugin-path'"
2023-05-26 09:54:48 -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
Rintaro Ishizaki
64b353c5bd Revert "[Driver] Derive '-external-plugin-path'"
This reverts commit b0f5c3977f.

rdar://109851266
2023-05-25 13:39:40 -07:00
Max Desiatov
0fc365960c Merge pull request #65795 from apple/maxd/fix-missing-cmake-value
CMake: fix missing `SWIFT_CONCURRENCY_GLOBAL_EXECUTOR` value

`SWIFT_CONCURRENCY_GLOBAL_EXECUTOR` is defined in `stdlib/cmake/modules/StdlibOptions.cmake`, which is not included during the first pass of evaluation of the root `CMakeLists.txt`. It is available on subsequent evaluations after the value is stored in CMake cache. This led to subtle bugs, where `usr/lib/swift_static/linux/static-stdlib-args.lnk` didn't contain certain flags on clean toolchain builds, but did contain them in incremental builds.

Not having these autolinking flags in toolchain builds leads to errors when statically linking executables on Linux.

Additionally, since are trivial tests previously didn't link Dispatch statically, the didn't expose a bug where `%import-static-libdispatch` substitution had a missing value. To fix that I had to update `lit.cfg` and clean up some of the related path computations to infer a correct substitution value.

Resolves some of the errors reported in https://github.com/apple/swift/issues/65097.
2023-05-17 20:52:05 +01:00
Saleem Abdulrasool
e22cf2e993 Merge pull request #65946 from tristanlabelle/fix-one-way-external-fine-test
Fix test on Windows by expanding "*{a,b,c}" wildcard syntax
2023-05-16 12:13:59 -07:00
Tristan Labelle
5876f6d505 Expand "*{a,b,c}" syntax in test's touch -t call for Windows 2023-05-16 08:48:48 -04:00
Slava Pestov
c2338aa0f6 Backward deployment shim for swift_allocate{Metadata,WitnessTable}Pack() 2023-05-12 15:44:12 -04:00
Max Desiatov
2db62cade8 Fix -DSWIFT_PATH_TO_LIBDISPATCH_STATIC_BUILD value 2023-05-10 14:05:25 +01:00
Rintaro Ishizaki
b0f5c3977f [Driver] Derive '-external-plugin-path'
When the current toolchain is not a Xcode toolchain, derive
'-external-plugin-path' poinintng Xcode plugins paths, so we can use
plugins in Xcode.

rdar://108624128
2023-05-04 16:41:45 -07:00
Erik Eckstein
6375647383 driver: add swift-frontend options to select the tool to run
Tool selection is primarily done by checking the executable (= symlink) name.
But sometimes (e.g. if the tool symlink is not there) it's useful to have an option for selecting the tool.
The selection option (e.g. -sil-opt) must be the first argument of swift-frontend.
2023-04-28 15:18:16 +02:00
Rintaro Ishizaki
a551c01d6a [Macros] Track plugin dependencies
* Factor out ASTContext plugin loading to newly introduced 'PluginLoader'
* Insert 'DependencyTracker' to 'PluginLoader'
* Add dependencies right before loading the plugins

rdar://104938481
2023-04-25 10:50:32 -07:00
Doug Gregor
928c821ba3 Update tests yet again 2023-03-22 09:12:16 -07:00
Doug Gregor
9bb4d261b1 Try harder to deal with / vs. \, the third hardest problem in computer science 2023-03-22 07:15:49 -07:00
Doug Gregor
b1788529ae Cope with Windows paths 2023-03-22 00:41:47 -07:00
Doug Gregor
74b12e8f23 [Driver] Implement inference of -plugin-path arguments.
This was previously implemented in the new driver; backport it to the
existing driver, which is still used by SourceKit.

Fixes rdar://106790436.
2023-03-21 21:23:49 -07:00
Saleem Abdulrasool
19c7bb5a22 Driver: add support for baremetal targets
This allows building the Swift standard library for targets which may
not have an actual OS running.  This is identified by the OS field in
the target triple being set to `none`.
2023-03-20 17:59:13 -04:00
Ben Barham
2b43cf2911 [Test] Rename substitution so it isn't incorrectly substituted
`%swiftc_driver` is a substitution already, which means
`%swiftc_driver_stdlib_target` was actually being substituted as
`%swiftc_driver` first with `-stdlib-target` tacked on the end.

Resolves rdar://106170241 and rdar://106170343.
2023-03-05 14:22:02 -08:00
Meghana Gupta
7feab0b1d3 Disable batch_mode_dependencies_make_wrong_order.swift 2023-03-03 17:25:29 -08:00
Saleem Abdulrasool
4075d706a2 stdlib: remove the dependency on the injected modules
Inject the necessary module maps and apinotes via the VFS.  This cleans
up the developer build in preparation for a secondary change to remove
this need for deployed scenarios as well.  Injecting the content via the
VFS will enable us restore the ability to work with a pristine
installation of Visual Studio, dropping the custom action for the Swift
installer, and open the pathway to per-user installation of Swift.

Thanks to @bnbarham for the help and discussion in resolving the test
issues.
2023-02-28 09:40:51 -08:00
Tim Kientzle
5ab60e673a Remove support for linking arclite (#63662)
* Remove support for linking arclite

Darwin no longer uses arclite and it's no longer distributed
in the macOS SDKs.

This leaves the options -link-objc-runtime and -no-link-objc-runtime
in place, but strips out all the logic that actually used them.

* Remove a dead function

* Warn if `-link-objc-runtime` is used

* Update tests to not look for arclite library

* Add an explicit test for the deprecation warning

* Move the macOS-only -link-objc-runtime test to a separate test file
2023-02-23 12:20:33 -08:00
Joe Groff
69e4b95fb8 SIL: Model noescape partial_applys with ownership in OSSA.
Although nonescaping closures are representationally trivial pointers to their
on-stack context, it is useful to model them as borrowing their captures, which
allows for checking correct use of move-only values across the closure, and
lets us model the lifetime dependence between a closure and its captures without
an ad-hoc web of `mark_dependence` instructions.

During ownership elimination, We eliminate copy/destroy_value instructions and
end the partial_apply's lifetime with an explicit dealloc_stack as before,
for compatibility with existing IRGen and non-OSSA aware passes.
2023-02-16 21:43:53 -08:00