Commit Graph

1745 Commits

Author SHA1 Message Date
Saleem Abdulrasool
0a2b10b777 Merge pull request #61815 from MillerTechnologyPeru/trunk/riscv64
[stdlib] Add RISCV64 support
2022-11-02 09:53:34 -07:00
Alsey Coleman Miller
62b7be4e9c [stdlib] Add RISCV64 support 2022-11-01 23:59:42 -07:00
Pavel Yaskevich
f779f8059f [Basic] Make it possible to access some experimental features in production compilers
Resolves: rdar://99884335
2022-11-01 10:15:51 -07:00
Doug Gregor
2b87836a0a Enable valid-parse checking with the new parser
Ensure that any time the existing parser accepts a source file,
the new parser produces a valid parse (no unexpected/missing nodes) for
that same source file.
2022-09-30 21:47:07 -07:00
Doug Gregor
aa6f99a85d Merge pull request #61283 from DougGregor/enable-round-trip-testing
[New parser] Enable round-trip testing of the new parser in +Asserts builds
2022-09-26 08:40:31 -07:00
Doug Gregor
3708c6649f [New parser] Enable round-trip testing of the new parser in +Asserts builds 2022-09-24 12:49:02 -07:00
Evan Wilde
4a5a6fb729 Merge pull request #61078 from etcwilde/ewilde/update-target-versions
Fix and update `getSwiftRuntimeCompatibilityVersionForTarget`
2022-09-23 08:24:12 -07: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
Robert Widmann
a71b970b01 Revert "Add link between swiftBasic and swiftAST"
This reverts commit 901081359b.
2022-09-09 00:21:57 -07:00
Robert Widmann
18b79ffcfd Resolve a Layering Violation in libBasic
Basic should not be allowed to link Parse, yet it was doing so
to allow Version to provide a constructor that would conveniently
parse a StringRef. This entrypoint also emitted diagnostics, so it
pulled in libAST.

Sink the version parser entrypoint down into Parse where it belongs
and point all the clients to the right place.
2022-09-09 00:21:30 -07:00
Evan Wilde
901081359b Add link between swiftBasic and swiftAST
swiftBasic uses `InFlightDiagnostic::flush`, which is defined in
swiftAST. The build graph did not contain that link edge, so it failed
to link on Windows. No idea how it's working on macOS.
2022-09-08 10:06:57 -07:00
Doug Gregor
9df77e9932 Add a stub constructor for LangOptions.
Having an out-of-line definition for the LangOptions constructor makes
it easier to enable experimental features one at a time for a build,
without rebuilding everything.
2022-09-07 18:14:07 -07:00
swift-ci
40d3b02cfa Merge remote-tracking branch 'origin/main' into rebranch 2022-07-25 06:35:29 -07:00
Egor Zhdan
8165806aa0 Merge pull request #60174 from apple/egorzhdan/scs-stringref-p1
[cxx-interop][SwiftCompilerSources] Use `llvm::StringRef` instead of `BridgedStringRef`
2022-07-25 14:26:59 +01:00
swift-ci
b99996dbbd Merge remote-tracking branch 'origin/main' into rebranch 2022-07-21 13:37:34 -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
Egor Zhdan
0e2d438c5b [cxx-interop][SwiftCompilerSources] Use llvm::StringRef instead of BridgedStringRef
rdar://83361000
2022-07-21 16:32:16 +01:00
swift-ci
da96ee6bd2 Merge remote-tracking branch 'origin/main' into rebranch 2022-07-20 12:38:23 -07:00
Doug Gregor
0fdba62bd8 Merge pull request #59055 from DougGregor/future-feature
[SE-0362] Piecemeal adoption of upcoming language improvements
2022-07-20 12:26:00 -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
swift-ci
e9c324099a Merge remote-tracking branch 'origin/main' into rebranch 2022-07-18 16:13:31 -07:00
Alexis Laferrière
86eb55c3ab Merge pull request #60107 from xymus/swiftmodule-tag-fix
[Serialization] Use a more reliable macro to get the compiler tag
2022-07-18 16:10:00 -07:00
Alexis Laferrière
36b87d3c5c [Serialization] Use a more reliable macro to get the compiler tag
Use only the SWIFT_COMPILER_VERSION macro to check for swiftmodules
being written by the same compiler that reads it. In practice, it's the
macro used for release builds of the compiler.

rdar://96868333
2022-07-18 13:20:20 -07:00
swift-ci
d5231efc77 Merge remote-tracking branch 'origin/main' into rebranch 2022-07-07 03:52:56 -07:00
Egor Zhdan
38edc7f377 [cxx-interop][SwiftCompilerSources] Remove getCopiedBridgedStringRef and freeBridgedStringRef
`std::string`s can now be passed directly between Swift and C++.

rdar://83361087
2022-07-06 12:57:50 +01:00
swift-ci
797e0acecf Merge remote-tracking branch 'origin/main' into rebranch 2022-06-07 11:13:30 -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
Artem Chikin
19c5c201dc [Parseable Output] Generate valid output for files of unknown types
When we encounter an input or output with an unknown extension 'TY_INVALID', still produce valid JSON specifying the type as "unknown" instead of either crashing or producing malformed JSON.

Resolves rdar://94348593
2022-06-03 11:40:32 -07:00
swift-ci
d32d3311ab Merge remote-tracking branch 'origin/main' into rebranch 2022-05-30 11:14:36 -07:00
Doug Gregor
2cc91d04c9 Temporarily reinstate LangOptions::EnableBareSlashRegexLiterals for LLDB 2022-05-30 08:33:47 -07:00
Doug Gregor
2fbe202146 Introduce FUTURE_FEATURE definitions for features staged in Swift 6.
Using the same feature set logic as experimental features, provide
feature names for "future" features, which are changes that will
become available with Swift 6. Use the feature check when determining
whether to implementation the feature instead of a language version
check, and map existing flags for these features (when available) over
to the feature set.

As an internal implementation detail, this makes it easier to reason
about when specific features are enabled (or not). If we decide to go
with piecemeal adoption support for features, it can provide an
alternative path to enabling features that feeds this mechanism.
2022-05-30 08:32:56 -07:00
swift-ci
4ee528a886 Merge remote-tracking branch 'origin/main' into rebranch 2022-05-27 15:14:25 -07:00
Doug Gregor
6d82448dc8 Add -enable-experimental-feature X for experimental features.
Experimental features can only be enabled in non-production (+Asserts)
builds. They can be detected with `hasFeature` in the same manner as
"future" features.

The `-enable-experimental-feature X` flag will also look for future
features by that name, so that when an experimental feature becomes an
accepted future feature, it will still be enabled in the same manner.

Switch variadic generics over to this approach, eliminating the
specific LangOption for it.
2022-05-26 11:50:39 -07:00
Ben Barham
92b6dd24c2 Merge branch 'main' into manually-merge-main 2022-05-25 15:55:35 -07:00
swift-ci
645d73f27e Merge pull request #58480 from beccadax/so-i-put-versions-in-your-version-numbers
Update SWIFT_COMPILER_VERSION language features
2022-05-24 17:47:43 -07:00
swift-ci
f6cdcc736d Merge remote-tracking branch 'origin/main' into rebranch 2022-05-18 15:18:15 -07:00
Alexis Laferrière
c341010fbd [Basic][Serialization] Intro and use isCurrentCompilerTagged 2022-05-17 16:45:34 -07:00
Ben Barham
4e1eb1abe8 Merge pull request #58620 from bnbarham/rebranch-fixes
[rebranch] Various fixes to get macos to a compiling state
2022-05-06 09:59:38 -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
Josh Soref
66663b1286 Spelling basic (#42541)
* spelling: add

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: attributes

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: bridging

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: deserialization

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: initialize

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: invariants

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: lazily

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: occurred

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: offset

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: optimization

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: our

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: process

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: substitution

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: the operation

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: the

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-05-04 14:53:24 -07:00
Becca Royal-Gordon
3843c7cd5e Update SWIFT_COMPILER_VERSION language features
The `SWIFT_COMPILER_VERSION` define is used to stamp a vendor’s version number into a Swift compiler binary. It can be queried from Swift code using `#if _compiler_version` and from Clang by using a preprocessor definition called `__SWIFT_COMPILER_VERSION`. These are unsupported compiler-internal features used primarily by Apple Swift.

In Swift 1.0 through 5.5, Apple Swift used a scheme for `SWIFT_COMPILER_VERSION` where the major version matched the embedded clang (e.g. 1300 for Apple Clang 13.0.0) and the minor version was ignored. Starting in Swift 5.6, Apple Swift started using major and minor version numbers that matched the Swift.org version number. This makes them easier to understand, but it means that version 1300.0.x was followed by version 5.6.x. Not only did version numbers go backwards, but also the old logic to ignore minor versions was now a liability, because it meant you would not be able to target a change to 5.7.x compilers but not 5.6.x compilers.

This commit addresses the problem by:

* Modifying the existing `#if _compiler_version(string-literal)` feature so it transforms the major version into a major and minor that will compare correctly to new version numbers. For instance, “1300.*” is transformed into “1.300”, which will compare correctly to a “5.6” or “5.7” version even if it doesn’t really capture the fact that “1300” was a Swift 5.5 compiler. As a bonus, this allows you to use the feature to backwards-compatibly test new compilers using the existing feature: “5007.*” will be seen by compilers before 5.7 as an unknown future version, but will be seen by 5.7 compilers as targeting them.

* Modifying the `__SWIFT_COMPILER_VERSION` clang define similarly so that, to preprocessor conditions written for the old scheme, a 5.7 compiler will appear to have major version 5007.

* Adding a new variant of `#if _compiler_version` with the same syntax as `#if swift` and `#if compiler`—that is, taking a comparison operator and a bare set of dotted version numbers, rather than a string literal. Going forward, this will be how version checks are written once compatibility with compilers before this change is no longer a concern.

These changes are only lightly tested because tests have to work without any compiler version defined (the default in most configurations), but I’ve tested what I can.

Fixes rdar://89841295.
2022-04-27 18:27:52 -07:00
Ben Barham
e2c9836a1d [CursorInfo] Add Clang documentation to SymbolGraph output
This currently doesn't check for inherited docs, ie. either the
imported declaration has docs or it doesn't. There's also a few odd
cases with mixed doc types and when each line is prefixed with '*', but
it's good enough for an initial implementation.

Moves UTF8 sanitisation out of ASTPrinter.h and into Unicode.h so that
it can be used here as well.

Resolves rdar://91388603.
2022-04-08 13:46:38 -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
Doug Gregor
d6d21892f3 Handle output file maps that use the key "objc-header".
This anachronously-named key is nonetheless still important to accept,
or else we'll fail to emit the generated header.

Fixes rdar://90900115.
2022-03-28 10:06:59 -07:00
Alex Lorenz
2e3aa87737 Revert "Revert "Merge pull request #41831 from hyp/unify-header""
This reverts commit 4c9582c295.
2022-03-19 13:36:28 -07:00
Michael Gottesman
07e54bf641 Merge pull request #41890 from hyp/dev/unify-header
Revert "Merge pull request #41831 from hyp/unify-header"
2022-03-18 10:32:24 -07:00