Commit Graph

658 Commits

Author SHA1 Message Date
Konrad `ktoso` Malawski
4f8c0152c3 update some missing places with _ 2022-03-16 08:35:37 +09:00
YR Chen
b359d4af89 Fix type of memcmp on Windows 2022-03-13 16:32:05 +08:00
Saleem Abdulrasool
0bc375d97c Revert "visualc: clean up the module definition"
This reverts commit c194d1cf24.
2022-03-07 18:25:25 -08:00
Robert Widmann
7cd3541c62 Merge pull request #41656 from MillerTechnologyPeru/feature/ppc32
[stdlib] Added PowerPC 32-bit support
2022-03-07 15:08:26 -08:00
Saleem Abdulrasool
c194d1cf24 visualc: clean up the module definition
Clean up the submodules in visualc to not export all imported modules.
The one special case is `vcruntime` which re-exports `SAL` due to a
dependency in the headers.  The import of `visualc` however will
re-export all submodules to keep the current behaviour.  This is
required to get the ARM64 SDK building on newer MSVC toolsets.
2022-03-07 10:59:00 -08:00
Jonathan Grynspan
845182252c Add exported symbol on non-Apple platforms to enumerate MetadataSection structures at runtime. 2022-03-04 23:44:10 -05:00
Alsey Coleman Miller
0ab3eec987 Added PowerPC 32-bit support 2022-03-03 22:21:33 -05:00
Robert Widmann
beda891274 Merge pull request #40557 from 3405691582/UnifiedModulemap 2022-02-21 22:45:55 -08:00
Tim Kientzle
4d91b45988 [RemoteMirror] Get spare bit info from reflection records (#40906)
This adds a new reflection record type carrying spare bit information for multi-payload enums.

The compiler includes this for any type that might need it in order to accurately reflect the contents of the enum. The RemoteMirror library will use this if present to determine how to project the contents of the enum. If not present (for example, in older binaries), the RemoteMirror library falls back on an internal calculation of the spare bitmask.

A few notes:
 * The internal calculation is not perfect.  In particular, it does not support MPEs that contain other enums (e.g., optionals).  It should accurately refuse to project any MPE that it does not correctly support.
 * The new reflection field is designed to be expandable; this might someday avoid the need for a new section.

Resolves rdar://61158214
2022-02-21 17:06:14 -08:00
3405691582
600d500ed6 [stdlib] Use the single-header Glibc modulemap.
This migrates OpenBSD to use the single-header Glibc modulemap proposed
and implemented in #32404, and necessitates introducing some missing
headers for building Foundation added in #38341.

Additionally, incorporate nullability annotations in SwiftShims per
2022-02-11 13:04:12 -05:00
Robert Widmann
f5bc40be10 Merge pull request #35707 from buttaface/droid
[android] Switch to new single-header modulemap for Bionic too
2022-02-10 15:50:19 -08:00
Daniel Rodríguez Troitiño
c6c88ce714 [cmake] Allow overriding Clang resource symlink target (#41301)
When building with a prebuilt Clang, the changes introduced in #40707
supposed that the toolchain was in its final path.

When building in stages (first the toolchain, then the standard
library), the toolchain might not be in the final path, and the created
symlink will point to a machine-local path that does not make sense.

The changes introduced should not modify the existing behaviour
introduced by #40707, but should allow customizing the final
installation target using the CMake cached variable for those setups
that need the flexibility.
2022-02-09 14:37:40 -08:00
Karoy Lorentey
b20f0158b2 Merge pull request #41274 from lorentey/remove-Dispatch-shims
[shims] Remove the _SwiftDispatchOverlayShims module
2022-02-09 14:36:49 -08:00
Kuba (Brecka) Mracek
6fe3ccc47d Drop read/write/close LibcShims and use the platform APIs directly from the SwiftPrivate module (#40211) 2022-02-08 15:32:49 -08:00
Karoy Lorentey
4e90871b4c [shims] Remove the _SwiftDispatchOverlayShims module
This module used to be a private implementation detail of the Distpatch overlay on Apple platforms, and swift-corelibs-libdispatch elsewhere.

Darwin hasn't been using this module for a couple years now, and swift-corelibs-dispatch stopped using it with https://github.com/apple/swift-corelibs-libdispatch/pull/592. We are now free to remove it from the Swift toolchain -- which is good, as it contains declarations that are specific to Dispatch, and the compiler/stdlib is not the right place to maintain them.
2022-02-08 11:38:45 -08:00
Karoy Lorentey
6d20137711 [shims] Remove the _SwiftXCTestOverlayShims module
This used to be a private implementation detail of the XCTest overlay.

This module has been unused since the Xcode 12.5 release, but we temporarily kept it in the toolchain in case a downloadable toolchain gets used with an older Xcode. (The module used to be imported by the XCTest overlay interface, so its removal would have made it tricky to import XCTest in that scenario.)

Including the 13.3 beta, there have now been seven Xcode releases since the last one that imported this module, and the compiler/stdlib repository no longer supports building with Xcode 12.4 or below. It seems reasonable to stop installing this module on the toolchain now.

rdar://80552912
2022-02-07 17:16:03 -08:00
ShenYj
c0658c7adc The one here seems to be the end of '__swift__' 2022-01-28 12:39:32 +08:00
Evan Wilde
3de0bbb476 Merge pull request #40707 from buttaface/symlink-clang
[build] Link the Swift resource directory against the headers from a prebuilt clang, if building with one
2022-01-12 18:10:53 -08:00
Alejandro Alonso
6ca7366cd8 Merge pull request #40746 from Azoy/indic-grapheme-clusters
[stdlib] Implement the Indic grapheme breaking rules
2022-01-11 12:50:02 -08:00
Alejandro Alonso
4a451829f8 Implement the Indic grapheme breaking rules 2022-01-05 16:18:54 -08:00
Jonathan Grynspan
099fdc2e41 Fix an issue on COFF/ELF targets where the runtime would register each loaded image twice (at least early on.) 2022-01-01 11:39:25 -05:00
Butta
8fd1d64a4e [build] Link the Swift resource directory against the headers from a prebuilt clang, if building with one 2021-12-26 16:59:21 +05:30
Erik Eckstein
3d33f11e6c cmake/build-script: rename the libswift option to "bootstrapping"
In cmake, rename LIBSWIFT_BUILD_MODE to BOOTSTRAPPING_MODE.
Also, rename the lit feature "libswift" to "swift_in_compiler".
2021-12-22 11:31:52 +01:00
Arnold Schwaighofer
cf3951394a Revert "Fix an issue on COFF/ELF targets where the runtime would register each loaded image twice (at least early on.)" 2021-12-21 07:15:08 -08:00
Jonathan Grynspan
7fe5ea7398 Fix an issue on COFF/ELF targets where the runtime would register each loaded image twice (at least early on.) 2021-12-20 15:15:02 -05:00
Pavel Yaskevich
3f4c06eb1b [Distributed] Runtime: Add skeleton support for accessible function sections 2021-12-17 10:52:56 -08:00
Butta
5eb29d99dd [android] Switch to new single-header modulemap for Bionic too 2021-12-13 23:23:45 +05:30
Alejandro Alonso
8a5f728daf Merge pull request #40340 from Azoy/drop-icu
[stdlib] Drop ICU
2021-12-07 01:44:38 -08:00
David Smith
fc3e718771 Initial support for compile-time generation of vprintf format strings, behind the SWIFT_STDLIB_STATIC_PRINT flag 2021-12-02 16:58:36 -08:00
Alejandro Alonso
21ee3a5e0f Drop ICU
update freestanding deps
2021-11-30 13:53:08 -08:00
Alejandro Alonso
ac6c08f157 [stdlib] Make the rest of the scalar properties native (#40233)
* Factor out the scalar bit array index mechanism

* Implement native numeric scalar properties

* Implement native scalar name aliases

* Implement native scalar mappings

* Implement native scalar names

* Implement native scalar age

* Implement native scalar general category

* Address Michael's and others comments

fix special mappings

fix bug
2021-11-30 12:40:32 -08:00
Erik Eckstein
61db072617 cmake: fix libswift build dependencies
Unfortunately using the convenient "bootstrapping0-all", etc. custom targets does not work.
For some reason it does not cause a dependent file (like libswift's SIL.o) being rebuilt when a depenency (like swift-frontend from the previous bootstrapping stage) changes.
Instead we have to list al library- and executable-targets explicitly.
2021-11-23 18:33:43 +01:00
Alejandro Alonso
3b402f0179 [stdlib] Implement native Unicode.Scalar binary properties (#39597)
* Generate Unicode data for Scalar Binary Properties

* Use native scalar binary property lookup

* Add _BinaryProperties to Scalar Properties

narrow access control

* Upgrade the notice to a warning in UnicodeScalarProperties
2021-11-15 15:20:46 -08:00
Saleem Abdulrasool
d001831041 Shims: strongly link swift_isStackAllocationSafe on !Darwin
Windows objects to the multiple different aliases for
`swift_isStackAllocationSafe`.  Use strong linkage on all non-ABI stable
targets.  This should repair the Windows build and matches the
conditional emission in the stdlib.

Thanks to @lorentey for the discussion around how to handle this and the
pointer to where this was getting introduced!
2021-11-05 18:39:05 -07:00
Erik Eckstein
09552abc44 libswift: improve the bootstrapping-with-hostlibs build mode
Don't build the swiftCore module files in the bootstrapping phases. Instead use the module files in the SDK.
This reduces the build time overhead from 3min -> 30seconds.
2021-11-05 18:32:25 +01:00
Karoy Lorentey
6313748c5d Merge pull request #39405 from Bo98/copy_shim_headers-all
[build] Add copy_shim_headers to all target
2021-11-01 17:29:43 -07:00
Alejandro Alonso
5a0bbb9f89 [stdlib] Implement native grapheme breaking for String (#37864)
* Implement GraphemeWalker that does native grapheme breaking

* Bridged strings use native grapheme breaking for forward strides

* Implement bidirectional native grapheme breaking for native and foreign strings

* Remove ICU's grapheme breaking support

* Use UnicodeScalarView to implement GraphemeWalker

use an Iterator approach

remove Iterator conformance

* Incorporate Michael's feedback

more comments addressed

fix crlf bug

* Try bringing back some old fast paths

* Parameterize nextBoundary and previousBoundary

Parameterize nextBoundary and previousBoundary

* Implement Michael's suggestions
2021-11-01 16:52:28 -07:00
Jonathan Grynspan
f1bf7badba [SE-0322] Temporary uninitialized buffers
Adds two new IRGen-level builtins (one for allocating, the other for deallocating), a stdlib shim function for enhanced stack-promotion heuristics, and the proposed public stdlib functions.
2021-10-25 11:20:10 -04:00
Kuba (Brecka) Mracek
7538949859 Split out CommandLine enum into a separate static library, allow removing it from stdlib (#39591)
This is for the 'freestanding' build to stop assuming the platform has argc/argv.

- Introduce a new sub-library, libswiftCommandLineSupport.a
- Move stubs/CommandLine.cpp into this library
- Conditionally embed it into libswiftCore
- Conditionally embed it into libswiftPrivateLibcExtras if not in libswiftCore to support testing
- Add SWIFT_STDLIB_HAS_COMMANDLINE CMake (and build-script) flag
2021-10-13 07:02:43 -07:00
Kuba (Brecka) Mracek
c2c1bfb053 Add SWIFT_STDLIB_HAS_ENVIRON to remove usage of getenv/environ from stdlib (#39599) 2021-10-12 07:16:36 -07:00
Alex Hoppen
6e07ee8f90 Fix a couple of build warning
Fixes a couple of compiler warnings that occur frequently when building the compiler:
- Copy the nullability annotation definitions from `Visibility.h` to `BridgedSwiftObject.h` and wrap all code that contains nullability annotations in `SWIFT_BEGIN_NULLABILITY_ANNOTATIONS` and `SWIFT_END_NULLABILITY_ANNOTATIONS` (supressing the warning `type nullability specifier '_Nullable' is a Clang extension [-Wnullability-extension]`)
- Suppress warnings about using `$` (mangling prefix) as an identifier using pragmas (supressing the warning `'$' in identifier [-Wdollar-in-identifier-extension]`)
- Change the macro condition of `SWIFT_NODISCARD` from `__cplusplus >= 201402l` (which checked for >= C++14) to `__cplusplus > 201402l`. This appears to have been a copy-paste error from `LLVM_NODISCARD` (supressing the warning `use of the 'nodiscard' attribute is a C++17 extension [-Wc++17-extensions]`)
2021-10-08 10:11:33 +02:00
Alejandro Alonso
3664eca684 Generate Unicode normalization data for SwiftShims 2021-09-29 14:20:21 -07:00
Erik Eckstein
af71088d29 libswift: bootstrapping build
Adding build modes for libswift: off, hosttools, bootstrapping, bootstrapping-with-hostlibs
The two bootstrapping modes are new. For details see libswift/README.md
2021-09-28 18:51:42 +02:00
Bo Anderson
f569eee5e1 [build] Add copy_shim_headers to all target 2021-09-23 03:47:52 +01:00
Kuba (Brecka) Mracek
500c643dcb Remove _swift_stdlib_putchar_unlocked (#39383) 2021-09-21 18:00:03 -07:00
Yuta Saito
9b13d1f8bb [stdlib] Fix cc mismatch violation on swift_isClassType
_isClassType is mainly called by compiler-generated code, but it's also
called by stdlib. The call-site of stdlib used @_silgen_name to link the
function, so it's called through swiftcc. However its cc is defined as
C-cc, so caller and callee used different cc.
This patch adds C-compatible decl of swift_isClassType in shims so that
it can be called by stdlib with C-cc.
This change doesn't break ABI because `_isClassType` in stdlib was
defined as internal API.
2021-09-05 02:38:32 +00:00
Saleem Abdulrasool
b175cc830a Shims: remove last remnant of Windows ARM64 workaround
The Windows ARM64 builds can require a newer build of VS2019 (update 3
or newer).  This removes the workaround from the shims.  This was needed
for older installations of Visual Studio and no longer works with Visual
Studio 2022.
2021-09-04 08:59:04 -07:00
Karoy Lorentey
a072d2c310 [shims] Remove all remaining overlay shims modules except XCTest and Dispatch 2021-07-13 18:16:56 -07:00
Karoy Lorentey
a8b6afd827 [shims] Remove some obsolete shims modules
The corresponding overlays are maintained outside of this repository, and they haven’t been importing these shims for years.

SDKs that shipped between Xcode 10.2 and Xcode 11 (or so) contained overlay modules that imported these shims modules, so future toolchain builds won’t work correctly with those SDKs. (This is fine! We do not expect toolchain builds to work with years old Xcode installations anyway.)
2021-06-30 19:29:34 -07:00
Andrew Trick
07f65f38a3 Use a decent sentinel value to poison references
Only relevant for -Xfrontend -enable-copy-propagation in debug builds.
It's only an experimental mode for now for shrinking lifetimes while
providing lldb an easy way to report a friendly error.

Goals:
- two repetitive digits that don't look like garbage
- less than a page, so it can never be a real pointer
- reserve as many low bits as possible so it can't be a tagged pointer
- not used by any other memory smashers

0x440 is 64-byte aligned which is plenty for any conceivable object
allocator.
2021-06-02 15:42:45 -07:00