Commit Graph

121 Commits

Author SHA1 Message Date
Evan Wilde
2c216e08eb Add new OS platforms
LLVM added UEFI and LiteOS platforms. We don't currently support them,
so we should crash on the unsupported OS for now to avoid accidents
later.
2023-07-17 10:55:57 -07:00
Evan Wilde
41d59b215a Update Triple.h location
Triple moved from ADT to TargetParser. Updating includes to reflect
that.
2023-07-17 10:53:42 -07:00
Evan Wilde
250082df25 [NFC] Reformat all the LLVMs
Reformatting everything now that we have `llvm` namespaces. I've
separated this from the main commit to help manage merge-conflicts and
for making it a bit easier to read the mega-patch.
2023-06-27 09:03:52 -07:00
Evan Wilde
f3ff561c6f [NFC] add llvm namespace to Optional and None
This is phase-1 of switching from llvm::Optional to std::optional in the
next rebranch. llvm::Optional was removed from upstream LLVM, so we need
to migrate off rather soon. On Darwin, std::optional, and llvm::Optional
have the same layout, so we don't need to be as concerned about ABI
beyond the name mangling. `llvm::Optional` is only returned from one
function in
```
getStandardTypeSubst(StringRef TypeName,
                     bool allowConcurrencyManglings);
```
It's the return value, so it should not impact the mangling of the
function, and the layout is the same as `std::optional`, so it should be
mostly okay. This function doesn't appear to have users, and the ABI was
already broken 2 years ago for concurrency and no one seemed to notice
so this should be "okay".

I'm doing the migration incrementally so that folks working on main can
cherry-pick back to the release/5.9 branch. Once 5.9 is done and locked
away, then we can go through and finish the replacement. Since `None`
and `Optional` show up in contexts where they are not `llvm::None` and
`llvm::Optional`, I'm preparing the work now by going through and
removing the namespace unwrapping and making the `llvm` namespace
explicit. This should make it fairly mechanical to go through and
replace llvm::Optional with std::optional, and llvm::None with
std::nullopt. It's also a change that can be brought onto the
release/5.9 with minimal impact. This should be an NFC change.
2023-06-27 09:03:52 -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
Erik Eckstein
ab1b343dad use new llvm::Optional API
`getValue` -> `value`
`getValueOr` -> `value_or`
`hasValue` -> `has_value`
`map` -> `transform`

The old API will be deprecated in the rebranch.
To avoid merge conflicts, use the new API already in the main branch.

rdar://102362022
2022-11-21 19:44:24 +01:00
Evan Wilde
2ee40ee582 Adding Swift 5.7 compatibility versions
Swift 5.7 corresponds with: macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0
2022-09-13 11:09:42 -07:00
Evan Wilde
1c55135b15 Adding compatibility versions for 5.6
5.6 corresponds with:
5.6: macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4
2022-09-13 11:07:59 -07:00
Evan Wilde
a7806db9fe Fix version bugs
Swift 5.3 was the Swift stdlib from 11.0 up to and including 11.2, not
11.3.

Swift 5.3 was active from watchOS 7.0 up to and including 7.3, not 7.4.
2022-09-13 11:04:16 -07:00
Ben Barham
cbcd6c75f5 [next] Handle new LLVM triples 2022-05-05 16:25:10 -07:00
Ben Barham
114b4d96e4 [next] Use new VersionTuple API
The `VersionTuple` API was changed llvm/llvm-project
219672b8dd06c4765185fa3161c98437d49b4a1b to return `VersionTuple`
from `get*Version` rather than pass in major, minor, and subminor output
parameters. Update uses to the new API.

Note that `getMacOSXVersion` is slightly different in that it returns a
boolean while taking a `VersionTuple` output parameter to match its
previous behaviour. There doesn't seem to be any use that actually
checks this value though, so we should either update the API to return
an `Optional` and actually check it *or* remove the "failure" case and
return a `VersionTuple` like all the others.
2022-05-05 16:25:10 -07:00
Allan Shortlidge
c6410645cc Frontend: Add a separate inlining version floor for the macCatalyst platform, which was introduced as 13.1. Create a variant of the tests for -target-min-inlining-version specifically for macCatalyst (unfortunately, covering the macCatalyst platform in the same test file is prohibitively difficult because the tests never run with macCatalyst as the host OS and therefore the target triple substitutions need to be explicit).
Resolves rdar://90858579
2022-03-29 11:40:52 -07:00
Allan Shortlidge
b563dc0736 Frontend: Replace the abi magic value accepted by -target-min-inlining-version with a min magic value instead. The new value corresponds to the OS versions in which Swift was introduced. The introduction OS is a better floor for availability checking than the OS in which Swift became ABI stable because inlinable functions may reference clang declarations which have availability between Swift's introduction and ABI stability and framework developers ought to get diagnostics for unguarded use of those APIs in inlinable code. 2022-03-14 19:26:36 -07:00
Allan Shortlidge
e25b822f7a Merge pull request #41673 from tshortli/inlining-availability-checking
Add -target-min-inlining-version to aid type checking for inlinable functions in resilient libraries
2022-03-07 17:30:59 -08:00
Alsey Coleman Miller
b85e673a78 [stdlib] Added Armv5 support 2022-03-06 00:56:32 -05:00
Becca Royal-Gordon
bbcd980aff Add flag for minimum inlining version 2022-03-04 10:54:52 -08:00
Ben Barham
624337148b [NFC] Formatting cleanup to help with next conflicts 2021-10-15 17:15:51 +10:00
Doug Gregor
a91feb3309 Update the OS runtime mapping for Apple OS versions.
Fixes the rest of rdar://84065193, makingn sure we don't link against
compatibility libraries we don't need.
2021-10-13 23:02:11 -07:00
swift-ci
c51550f30e Merge remote-tracking branch 'origin/main' into rebranch 2021-09-30 15:11:41 -07:00
Doug Gregor
f4aa6266df arm64 macOS was introduced with version Swift
Generalize the check from arm64e to also include arm64. Fixes
rdar://83502661.
2021-09-27 14:05:25 -07:00
swift-ci
220daa4c05 Merge remote-tracking branch 'origin/main' into rebranch 2021-09-24 10:53:33 -07:00
Kuba Mracek
b073df2c6d 64-bit watchOS should imply a 5.3 minimum version of the Swift runtime 2021-09-23 18:02:56 -07:00
swift-ci
5f454ca504 Merge remote-tracking branch 'origin/main' into rebranch 2021-09-21 21:13:29 -07:00
Kuba (Brecka) Mracek
942b0e8a63 The concurrency compat library should not be unconditionally used in arm64e builds (#39385) 2021-09-21 21:01:21 -07:00
swift-ci
cd7ed018bf Merge remote-tracking branch 'origin/main' into rebranch 2021-09-02 11:56:28 -07:00
Varun Gandhi
4a16261c4d [Driver] Update OS versions for rpath checks.
Make sure that we add the appropriate rpaths so that the appropriate
_Concurrency back-deployment library can be picked up.

We don't need to update the Swift driver since it uses the C++ driver
as the source of truth to determine if the relevant rpath should be
added or not.
2021-09-01 15:37:24 -07:00
Arnold Schwaighofer
de0218bf09 Adjust to LLVM's DarwinSDKInfo.h changes 2021-08-05 12:15:22 -07:00
Robert Widmann
22f3e9620b Remap aarch64_32 to arm64_32 When Searching for Modules
The triple name aarch64_32 does not actually name a valid platform. The
actual platform (and valid triple arch string, confusingly enough) is
arm64_32. Remap between the two to correct for this difference.

rdar://77281393
2021-04-28 17:39:06 -07:00
Robert Widmann
0149ccd0ca Add arm64_32 support for Swift
Commit the platform definition and build script work necessary to
cross-compile for arm64_32.

arm64_32 is a variant of AARCH64 that supports an ILP32 architecture.
2021-04-20 14:59:04 -07:00
swift_jenkins
d73adae0f2 Merge remote-tracking branch 'origin/main' into next 2020-10-29 18:01:19 -07:00
Alejandro Alonso
424802fb34 Revert SE-0283 (#34492)
Reverted despite build failures.
2020-10-29 17:32:06 -07:00
David Smith
0180aca9fc Merge branch 'main' into david/fix-merge-conflict 2020-10-27 13:05:20 -07:00
Azoy
df9778e2e8 [Compatibility53] Add compatibility library for 5.3 and backport tuple Equatable conformance
Fix some comments

Unnecessary cast
2020-10-22 18:27:03 -04:00
swift_jenkins
e2959e8e82 Merge remote-tracking branch 'origin/master' into master-next 2020-09-04 14:34:24 -07:00
Xi Ge
028a75572c ModuleInterface: remark potential version differences between SDK and prebuilt modules
Prebuilt-module directory now contains a SystemVersion.plist file copied from the SDK
it's built from. This patch teaches the compiler to remark this version and the SDK version
when -Rmodule-interface-rebuild is specified. The difference between these versions could
help us debug unusable prebuilt modules.
2020-09-04 11:45:05 -07:00
David Zarzycki
00f4700496 Handle expanded enums in upstream LLVM (ZOS and GOFF) 2020-08-12 09:05:38 -04:00
swift_jenkins
17f5af1476 Merge remote-tracking branch 'origin/master' into master-next 2020-07-28 16:43:56 -07:00
Brent Royal-Gordon
6e7c6fdd9b Merge pull request #33148 from brentdax/runtime-revolution
Adjust to simulator compiler-rt change
2020-07-28 16:42:09 -07:00
Nathan Hawes
f95ac38627 Fix build failures (CNK platform removed upstream, a StringRef -> std::string conversion) 2020-07-28 11:54:38 -07:00
Brent Royal-Gordon
86ff24bfbf [NFC] Clean up unused simulator special cases
The previous commit makes various simulator-specific platform helpers dead code. Remove them.
2020-07-27 18:21:42 -07:00
Xi Ge
cc8d27c419 Front-end: sink SDK version implementation to lib/Basic. NFC 2020-07-27 16:16:12 -07:00
Mishal Shah
60d996f060 [Apple Silicon] Add support for triple and availability canonicalization 2020-07-02 19:26:25 -07:00
Mishal Shah
3c9e72f6e1 [Apple Silicon] [macCatalyst] Baseline arm64(e) macCatalyst at Swift 5.3/iOS 14.0. 2020-07-02 18:28:33 -07:00
Mishal Shah
134f202e01 [Apple Silicon] Baseline arm64 macOS at Swift 5.3 / macOS 10.16 2020-07-02 16:42:15 -07:00
Doug Gregor
14c4ea773f [Simulators] Only infer simulator environment when there is no environment. 2020-04-20 08:50:35 -07:00
Doug Gregor
b63e9a6bcf [Frontend] Infer simulator environment in the frontend, too.
Some code paths that see target triples go through the frontend
without seeing the driver. Therefore, perform the same "simulator"
inference for x86 iOS/tvOS/watchOS triples also in the frontend,
to ensure that we remain compatible. Also make sure that
-print-target-info performs the appropriate adjustment.
2020-04-20 08:50:35 -07:00
Doug Gregor
2e3b220d44 [Basic] Remove swift::tripleIsAnySimulator().
It's just Triple::isSimulatorEnvironment() now.
2020-04-20 08:50:34 -07:00
Doug Gregor
574f0e8a5b [Platform] Stop inferring simulator-ness.
The *-simulator target triples have been used consistently in tools for
several years to indicate simulator targets. Stop inferring the
simulator part, rdar://problem/35810403.
2020-04-20 08:50:34 -07:00
Saleem Abdulrasool
fbbf61f297 Revert "[Darwin] Further restrict inference of the simulator environment" 2020-04-19 16:43:22 -07:00
Doug Gregor
22cdddd84e Merge pull request #30771 from DougGregor/stop-inferring-simulator
[Darwin] Further restrict inference of the simulator environment
2020-04-17 20:59:39 -07:00