Commit Graph

6982 Commits

Author SHA1 Message Date
Mishal Shah
80e4e0465c Merge pull request #66530 from swift-riscv/add-riscv64-as-supported-architecture
Add riscv64 as supported architecture on linux
2023-07-03 12:19:32 -05:00
Holly Borla
7a46466b65 Merge pull request #66967 from hborla/extension-macro
[Macros] Generalize `conformance` macros as `extension` macros
2023-06-29 08:57:04 -07:00
Kuba (Brecka) Mracek
d427696bf9 Allow @_silgen_name to be used on globals and add a @_silgen_name(raw: ...) version that skips mangling (#66540)
Attribute @_silgen_name is today only allowed to be used on functions, this change allows usage on globals as well. The motivation for that is to be able to "forward declare" globals just like it's today possible to do with functions (for the cases where it's not practical or convenient to use a bridging header).

Separately, this change also adds a @_silgen_name(raw: ...) syntax, which simply avoids mangling the name (by using the \01 name prefix that LLVM uses). The motivation for that is to be able to reference the "magic Darwin linker symbols" that can be used to look up section bounds (in the current dylib/module) -- those symbols don't use the underscore prefix in their mangled names.
2023-06-29 08:37:51 -07:00
Holly Borla
725374e0d8 [Macros] Implement attached extension macros. 2023-06-27 21:22:12 -07:00
Alastair Houghton
e197c00e3e Merge pull request #66883 from al45tair/eng/PR-111214571
[Freestanding] Remove uses of stat() and dlsym().
2023-06-23 22:05:45 +01:00
Alastair Houghton
e5ece81cc9 [Freestanding] Remove uses of stat() and dlsym().
We shouldn't be using stat() or dlsym() in the freestanding
runtime.

rdar://111214571
rdar://106555012
2023-06-23 17:05:59 +01:00
Michael Buch
511c344577 [Build] Introduce --lldb-configure-tests option
We recently changed the build-script to stop configuring LLDB
tests if `SKIP_TESTS_LLDB` is set  (see rdar://109774179 and
https://github.com/apple/swift/pull/66171).

A common use-case is to build lldb without `-t` (to avoid running the
tests) and then run the tests separately later. However, if we don't
specify the `-t` flag to the build-script, `SKIP_TESTS_LLDB` is implicitly set.
Meaning this multi-step way of running lldb tests regressed.

This patch addresses this by creating a new `--lldb-configure-tests`
option which when set makes sure we set the CMake variable
`LLDB_INCLUDE_TESTS` (which will be the default behaviour).

The preset for which we originally introduced the `SKIP_TESTS_LLDB` check
now sets this new option to `0` to avoid configuring LLDB tests. The
preset skips running the tests anyway, we're not losing test coverage.
2023-06-23 12:32:32 +01:00
Yuta Saito
f527f72640 Merge pull request #66423 from kateinoigakukun/pr-0c7c2f57b05a694965ab652f57cbfead006a33d7
[static-stdlib] Move static-executable-args.lnk under stdlib/public/Resources/linux
2023-06-19 19:30:53 +09:00
Yuta Saito
5528b40acb Merge pull request #66534 from kateinoigakukun/pr-a7645923603fc716c8f3b55bfd113d3972dc3bb6
[wasm][build] Recognize wasi-wasm32 as valid host
2023-06-19 16:33:53 +09:00
Mike Ash
cdc72fd291 Merge pull request #66679 from mikeash/disable-tracing-minimal
[Build] Set swift-stdlib-tracing=0 for minimal stdlib builds.
2023-06-16 10:29:27 -04:00
Saleem Abdulrasool
ee0d1c08ca Merge pull request #66514 from compnerd/installer
build: update build rules for new MSI set
2023-06-15 13:08:35 -07:00
Mike Ash
290970a8c4 [Build] Set swift-stdlib-tracing=0 for minimal stdlib builds. 2023-06-15 15:42:07 -04:00
swift-ci
fde2cf5e4d Merge pull request #59934 from apple/disable-downstream-project-test-pr-smoke
Disable downstream project tests in smoke test trigger
2023-06-15 01:50:27 -07:00
swift-ci
5e3ba59a86 Merge pull request #66655 from apple/maxd/bsi-bsd-arm64
build-script-impl: add support for `freebsd-arm64`
2023-06-14 21:04:49 -07:00
swift-ci
dc0a3c9143 Merge pull request #66652 from apple/maxd/bootstrap-bsd-cmake
swift_build_support cmake.py: allow bootstrapping CMake on FreeBSD
2023-06-14 20:30:30 -07:00
Ben Barham
e0c9aa1398 Merge pull request #66440 from bnbarham/sprinkle-utf8
[Build] Read all shell output as UTF-8
2023-06-14 17:35:11 -07:00
Max Desiatov
c435405e1b build-script-impl: add support for freebsd-arm64
Lack of this line causes a build error: `Unknown host tools target: freebsd-arm64`.
2023-06-15 01:04:54 +01:00
swift-ci
38050cde87 Merge pull request #66641 from apple/maxd/bsd-arm64
swift_build_support: support FreeBSD on arm64 in `targets.py`
2023-06-14 16:20:15 -07:00
Max Desiatov
c5d6e3ca05 swift_build_support cmake.py: allow bootstrapping CMake on FreeBSD
A given FreeBSD version may not always have latest CMake installed if any at all. Let's bootstrap it the same way we do it on Linux.
2023-06-15 00:04:39 +01:00
swift-ci
12b1843289 Merge pull request #66377 from mikeash/section-scan-signposts
[Runtime] Add tracing for section scans.
2023-06-14 13:50:28 -07:00
Max Desiatov
2dc5da0366 swift_build_support: support FreeBSD on arm64 in targets.py 2023-06-14 20:47:52 +01:00
Mike Ash
110f428780 [Runtime] Add tracing for section scans.
Section scans (for metadata, protocols, etc.) can be costly. This change adds tracing calls to those scans so we can more easily see how much time is spent in these scans and where they're initiated.

This adds an os_signpost implementation controlled by SWIFT_STDLIB_TRACING, and a default empty implementation for when that's disabled.

rdar://110266743
2023-06-14 12:07:44 -04:00
Meghana Gupta
5d401fb70a Remove select_value SIL instruction 2023-06-13 14:13:43 -07:00
Yuta Saito
e228cd8b5f [wasm][build] Recognize wasi-wasm32 as valid host
wasi-wasm32 support in build system was added in
b1236e92f9 but we forgot to add it to the
host for the case when we are building the standalone stdlib for the
target.
2023-06-10 10:12:39 +00:00
futurejones
ea330b269c add riscv64 as supported architecture on linux 2023-06-10 15:43:28 +09:00
Saleem Abdulrasool
2f073715cc build: update build rules for new MSI set
This corresponds to apple/swift-installer-scripts#207 which restructures
the MSIs and enables a number of new features.  It switches us to:
- durable GUIDs which will enable upgrades
- enables dual-purpose MSIs
- switches the installer to per-user installs
- should drop the requirement on Administrator rights
- splits the MSIs into smaller chunks to provide a nicer installer
  experience
- reduces the complexity in the management of the manifest
2023-06-09 16:32:58 -07:00
Kuba (Brecka) Mracek
e3d940eb59 Move _used+_section from DECL_MODIFIER_KINDS to DECL_ATTR_KINDS in AttributeKinds.py (#66194) 2023-06-09 14:41:16 -07:00
Yuta Saito
2410da4259 [static-stdlib] Move static-executable-args.lnk under stdlib/public/Resources/linux
This is a preparatory change for adding a static executable support for WASI
2023-06-08 11:46:18 +00:00
Rintaro Ishizaki
46e98c1433 Merge pull request #66295 from rintaro/sourcekit-syntactic-macroexpansion
[SourceKit] Add request to expand macros syntactically
2023-06-07 22:44:36 -07:00
Alastair Houghton
b948a30675 Merge pull request #66436 from al45tair/eng/PR-110420951
[LSan] Disable backtracing for the lsan builds.
2023-06-08 04:58:38 +01:00
Ben Barham
02603e37ac [Build] Read all shell output as UTF-8
Encodes the output back into ASCII as there's been issues with printing
UTF-8 in the past.

Resolves rdar://110412212.
2023-06-07 15:35:55 -07:00
Rintaro Ishizaki
c3d1304345 [SourceKit] Add request to expand macros syntactically
Expand macros in the specified source file syntactically (without any
module imports, nor typechecking).

Request would look like:
```
{
  key.compilerargs: [...]
  key.sourcefile: <file name>
  key.sourcetext: <source text> (optional)
  key.expansions: [<expansion specifier>...]
}
```
`key.compilerargs` are used for getting plugins search paths. If
`key.sourcetext` is not specified, it's loaded from the file system.
Each `<expansion sepecifier>` is
```
{
  key.offset: <offset>
  key.modulename: <plugin module name>
  key.typename: <macro typename>
  key.macro_roles: [<macro role UID>...]
}
```
Clients have to provide the module and type names because that's
semantic.

Response is a `CategorizedEdits` just like (semantic) "ExpandMacro"
refactoring. But without `key.buffer_name`. Nested expnasions are not
supported at this point.
2023-06-07 14:26:40 -07:00
Alastair Houghton
174b110187 [LSan] Disable backtracing for the lsan builds.
We don't need or want it there, and it's causing dependency problems in
our CMake build system.

rdar://110420951
2023-06-07 22:20:38 +01:00
Alex Hoppen
65e37f7c3a Merge pull request #66013 from ahoppen/ahoppen/sourcekitd-barriers
[sourcekitd] Allow client to enable use of dispatch barriers for open/edit/close on the message handling queue
2023-06-07 12:47:52 -07:00
Owen Voorhees
208eaac1aa Merge pull request #66365 from owenv/pr/ovoorhees/macro-settings
Add flags to toolchain Info.plist to allow using macros from Apple's SDKs with an open-source toolchain when building in Xcode
2023-06-07 12:41:54 -07:00
Holly Borla
e5f75029de [AST] Add 'initializes' and 'accesses' attributes for init accessor
definite initialization dependencies.
2023-06-06 18:59:13 -07:00
Holly Borla
684ef9c482 [AST] Add a new accessor kind for init accessors. 2023-06-06 18:57:31 -07:00
Owen Voorhees
5a7ba23b84 Add flags to toolchain Info.plist to allow using macros from Apple's SDKs when building in Xcode 2023-06-06 17:27:48 -07:00
Michael Gottesman
65a9ba457c [sil-mode.el] Add syntax highlighting for noimplicit copy instructions. 2023-06-06 13:50:04 -04:00
Ben Barham
07b7d1b61c Merge pull request #66292 from bnbarham/skip-early-swift
[CI] Disable early swift driver/syntax on Linux presets
2023-06-02 14:32:52 -07:00
Egor Zhdan
a5f0dbcff6 Merge pull request #66272 from apple/egorzhdan/lldb-pretty-printer-identifier
[utils] Show the string value of `swift::Identifier` in LLDB
2023-06-02 18:32:33 +01:00
Egor Zhdan
4269c027ec [utils] Show the string value of swift::Identifier in LLDB
This adds a straightforward LLDB pretty printer for `swift::Identifier` which prints its string value.
2023-06-02 15:52:20 +01:00
Michael Buch
f0ff384ddf Merge pull request #66078 from Michael137/bugfix/lldb-asan-bots-libcxx-testing
[Build] Build libcxx on lldb ASAN/UBSAN bots
2023-06-02 13:19:37 +01:00
Ben Barham
e82d860af9 [CI] Disable early swift driver/syntax on Linux presets
Allow Linux builds on a host with Swift installed. This will allow us to
PR test enabling the early swift driver/syntax builds (once the Linux
docker images are updated).
2023-06-01 17:35:46 -07:00
Alex Hoppen
d4ffe402d2 Use dispatch barriers for open/edit/close on the message handling queue 2023-05-31 18:03:17 -07:00
Max Desiatov
bbfd410e7b swift_build_support/cmake.py: parallelize default CMake build (#66212)
CMake's bootstrapping script can't infer a number of parallel build jobs from the number of CPU cores on its own, which means that it's not parallelized by default. Let's get the value of CPU cores when `build_jobs` argument is not explicitly set.

`make -j` only has an effect on CMake's post-bootstrap build jobs, while a substantial amount of time was spent building code sequentially in CMake's bootstrap script without that `--parallelize` option, which is called on a line preceding the `make -j` invocation.
2023-05-30 22:29:15 +01:00
Michael Buch
2bf08f0e42 [Build] Build libcxx on lldb ASAN/UBSAN bots
The preset for ubsan/asan buildbots include the
`buildbot_incremental_base` preset, which builds/runs
tests. But the tests now require libcxx to be built
since https://github.com/apple/swift/pull/66018
2023-05-27 13:39:19 +01:00
Michael Buch
dfed93d50b Merge pull request #66171 from apple/bugfix/lldb-buildbots-skip-lldb-tests-to-main
[Build] Don't configure LLDB with tests enabled if the tests will be skipped
2023-05-27 09:29:27 +01:00
Kuba (Brecka) Mracek
2d5f33e2e3 Add @_used and @_section attributes for global variables and top-level functions (#65901)
* Add @_used and @_section attributes for global variables and top-level functions

This adds:
- @_used attribute that flags as a global variable or a top-level function as
  "do not dead-strip" via llvm.used, roughly the equivalent of
  __attribute__((used)) in C/C++.
- @_section("...") attribute that places a global variable or a top-level
  function into a section with that name, roughly the equivalent of
  __attribute__((section("..."))) in C/C++.
2023-05-26 14:02:32 -07:00
Michael Buch
2d41efe996 [Build] Don't configure LLDB with tests enabled if the tests will be skipped
Currently the `--skip-test-lldb` flag will only skip *running* the
tests. But we still pass `LLDB_INCLUDE_TESTS` to CMake when configuring
LLDB.

Since https://github.com/apple/swift/pull/66018 configuring LLDB tests will
now always require libcxx to be built. For some presets (e.g.,
`buildbot_osx_package`) we don't need to build libcxx and we explicitly
pass `--skip-test-lldb`; this means if we were to try configure LLDB
tests we would hard error.

The proposed solution is to check whether the user wants to skip LLDB
tests, and if so, set `LLDB_INCLUDE_TESTS=FALSE`.

rdar://109774179
2023-05-26 14:39:32 +01:00