Commit Graph

495 Commits

Author SHA1 Message Date
Owen Voorhees
07fb294c8a [APIDigester] Provide a category when serializing diagnostics representing API or ABI breakage 2021-05-04 19:35:35 -07:00
Karoy Lorentey
40529fbe25 [stdlib][test] Update stdlib abi test docs 2021-04-28 15:39:01 -07:00
Karoy Lorentey
b11c6e42ea [stdlib][test] Update stdlib abi test docs 2021-04-28 14:10:06 -07:00
Luciano Almeida
ca8ffdcc47 [tests][SR-9425] Adapt existing api-digester tests cases to new enum equatable witness 2021-04-20 19:50:13 -03:00
Doug Gregor
fcd5d43457 Revert "stdlib: Add reasync variants of '&&', '||' and '??'" 2021-04-05 16:45:44 -07:00
Slava Pestov
c473869141 stdlib: Add reasync variants of '&&', '||' and '??'
Fixes rdar://problem/72770687.
2021-03-31 19:21:08 -04:00
tbkka
26ab27648e Casting from AnyHashable to AnyHashable should never create another wrapper (#36470)
* Casting from AnyHashable to AnyHashable should never create another wrapper

This adds a conformance for _HasCustomAnyHashableRepresentation to
AnyHashable that simply returns self.  This ensures that anytime
you try to create a new AnyHashable wrapper for an existing
AnyHashable, you just get back the original.

Resolves rdar://75180619

* Move the `Struct AnyHashable` change to `without-asserts` list

As suggested by @lorentey
2021-03-22 09:03:29 -07:00
Doug Gregor
9579390024 [SE-0304] Rename ConcurrentValue to Sendable 2021-03-18 22:48:20 -07:00
Doug Gregor
7496701c9f Limit ConcurrentValue inference to non-public, non-frozen structs and enums 2021-03-02 16:26:08 -08:00
Doug Gregor
b5e4b085aa Infer ConcurrentValue conformances for structs and enums.
When a struct or enum has only ConcurrentValue-conforming instance
data, infer conformance to ConcurrentValue.
2021-03-02 00:23:33 -08:00
Doug Gregor
267838db44 Undo change to "expected" output. It was in the wrong place 2021-02-22 16:00:20 -08:00
Doug Gregor
364b245b4a Update test for intentionally-benign ABI change to standard library 2021-02-22 07:25:23 -08:00
Doug Gregor
d9e4184742 Make Error and CodingKey conform to ConcurrentValue.
Make both Error and CodingKey conform to ConcurrentValue, so that
thrown errors always conform to ConcurrentValue. Downgrade (to
warnings) and ConcurrentValue-related diagnostics that are triggered
by this change in existing Error and CodingKey-conforming types to
reduce the impact on source compatibility.
2021-02-20 22:01:28 -08:00
Doug Gregor
06dc593cec Merge pull request #35264 from DougGregor/concurrent-value-protocol
[Concurrency] Introduce "ConcurrentValue" protocol and checking.
2021-02-05 10:28:26 -08:00
Doug Gregor
866a8d8944 Introduce checking for ConcurrentValue conformance across actors.
When referring to an actor-isolated declaration from outside of the
actor, ensure that the types involved conform to the `ConcurrentValue`
protocol. Otherwise, produce a diagnostic stating that it is unsafe to
pass such types across actors.

Apply the same rule to local captures within concurrent code.
2021-02-03 17:37:43 -08:00
Karoy Lorentey
70584f92b7 [test] Reinstate stdlib ABI checks
The noasserts flavor was previously XFAILed.

rdar://72856256
2021-02-02 21:32:07 -08:00
Doug Gregor
5897dbed5c Update tests for deterministic serialization/printing of members 2021-01-20 13:40:48 -08:00
Mishal Shah
79324dfb4c Disable stability-stdlib-abi-without-asserts.test (72856256) 2021-01-07 09:41:05 -08:00
Nate Cook
e56a76baa7 Update API Digester test w/ temporary RangeSet removal (#35160) 2020-12-19 12:00:50 +00:00
Nate Cook
c35b567001 Temporary removal of RangeSet/DiscontiguousSlice (#35076) 2020-12-14 08:42:01 -06:00
Erik Eckstein
7f6d86655e stdlib: add availability attributes to the COW debug checking functions.
This is only relevant for assert builds of the library.
Fixes an undefined symbol error if an executable, compiled with an assert build of the stdlib, is back deployed on a platform which does not support lazy symbol binding.

rdar://problem/71201102
2020-11-13 10:41:25 +01:00
Xi Ge
00577acacd ABI checker: when invoking via build system, explicitly mention ABI breakge in diagnostics
The error messages emitted from the ABI checker are mostly explanations of breakages. We should
explicitly mention why they are emitted to differentiate them from other compiler diagnostics.

rdar://68864860
2020-09-14 10:50:28 -07:00
Xi Ge
950eb74e67 ABI Checker: use lower-cased decl keywords to be consistent with source. NFC 2020-09-12 10:35:03 -07:00
Xi Ge
55e77785df ABI checker: add a mechansim for specifying allowd ABI breakages
When the checker found a breakage listed in the user-specified list,
the breage should be consumed internally without failing the check.

rdar://68086477
2020-08-31 10:57:15 -07:00
Xi Ge
5faedbd1ab Merge pull request #33667 from nkcsgexi/allow-list-rename
ABIChecker: rename argument -protocol-requirement-white-list to -protocol-requirement-allow-list. NFC
2020-08-27 16:52:34 -07:00
Xi Ge
103b61c8be ABIChecker: rename argument -protocol-requirement-white-list to -protocol-requirement-allow-list 2020-08-27 12:06:25 -07:00
Xi Ge
1a44db3dcf ABIChecker: exclude decls with the @_alwaysEmitIntoClient attribute
Removing or updating @_alwaysEmitIntoClient functions are never ABI-breaking, thus
we should exclude them from the symbol set for ABI stability checking.

rdar://67883661
2020-08-27 10:58:48 -07:00
Xi Ge
8f72547e2f [test] ABIChecker: add a test for -use-interface-for-module flag 2020-08-25 16:40:59 -07:00
Slava Pestov
92bc89b78f GSB: Add an inferred AnyObject constraint to @objc protocol requirement signatures
This simplifies GenericSignatureImpl::requiresClass(), which no longer
has to look through the conformances of the equivalence class.
2020-08-13 00:23:47 -04:00
Saleem Abdulrasool
84ea2a984b SR-13362: no baseline is available for the standard library on ASi
The standard library on non-Intel targets get compared to the baseline
from the Intel targets which is not guaranteed to be identical.  Mark
the checks as expected failures on non-x86_64 targets.  Although this is
entirely unsatisfying, it allows progress in the short term.
2020-08-07 09:12:03 -07:00
Vedant Kumar
2308bb18b1 Add _getMetadataSection{,Count,Name} to API digester allow list (#33138)
These APIs are needed to build SwiftReflectionTest.swift when testing
Release builds.

This rolls back 014918c0, which hid these APIs in non-asserts builds
causing a failure:

  https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android-arm64/5708/consoleText

rdar://66103895
2020-07-28 15:19:18 -07:00
Meghana Gupta
c042638a37 Merge pull request #33098 from meg-gupta/updatestyle
Update code as per Apple Style Guide
2020-07-25 07:44:44 -07:00
Augusto Noronha
3cb8f9b6fc Add entrypoints to the runtime that exposes metadata necessary for reflection tests on Linux (#32339) 2020-07-24 15:26:15 -07:00
Meghana Gupta
b34791a0a0 Update code as per Apple Style Guide
whitelist -> allowlist
blacklist -> denylist
2020-07-24 11:37:15 -07:00
Karoy Lorentey
a8c785b58a [test] Update & reenable stdlib ABI stability tests 2020-07-17 21:59:45 -07:00
Mishal Shah
40d00247f0 [Apple Silicon] [Test] Remove explicitly-specified target. 2020-07-02 19:14:56 -07:00
Mishal Shah
02b740378f [Apple Silicon] [Test] Generalize api-digester tests for Apple Silicon macOS.
Most of this is enabled by an upstream change to generalize the tests
for the api-digester to properly handle all targets. The primary change
here is to account for the Swift-level ABI differences for the standard
library between Apple Silicon macOS and Intel macOS. Specifically, anything
related to Float80 will be removed from the standard library on Apple Silicon
macOS, so account for the differences.
2020-07-02 17:57:59 -07:00
Mishal Shah
92ca9fc924 [Apple Silicon] Generalize tests for other macOS architectures
Most of the changes fall into a few categories:
* Replace explicit "x86_64" with %target-cpu in lit tests
* Cope with architecture differences in IR/asm/etc. macOS-specific tests
2020-07-02 16:27:46 -07:00
Xi Ge
4448a229df ABI-checker: include Swift symbols only when ABI checking is enabled
ABI checking logics are largely Swift-specific, so we should exclude
symbols from the underlying Clang module.

rdar://64373983
2020-06-16 16:41:07 -07:00
Argyrios Kyrtzidis
f89a385756 [ClangImporter] Follow-up for #32214, fix assertion hit due to missing check 2020-06-15 18:28:26 -07:00
Argyrios Kyrtzidis
915e215a3d [ClangImporter] Make sure that inherited convenience constructors are included in members of IterableDeclContext
Previously inherited constructors would be skipped from added in member list, depending on the order of request evaluator calls.
This was a regression compared to swift 5.2
2020-06-10 13:23:12 -07:00
Joe Groff
124808ddb6 Merge pull request #32088 from jckarter/final-keypath-methods
Make an internal KeyPath helper final.
2020-05-29 18:44:56 -07:00
Joe Groff
b89ef78ce5 Adding final to public API is API-stable.
Client code can't override or subclass a `public` declaration already, so although the ABI differs, the API is the same
whether something is `final` or not.
2020-05-28 14:10:39 -07:00
Xi Ge
c5730beb42 API checker: only diagnose adding enum cases to exhaustive enums
Adding new cases to a non-exhaustive enum type isn't source-breaking
since it only triggers a warning.

rdar://63464929
2020-05-23 15:56:22 -07:00
Xi Ge
9883e664b2 ABIChecker: don't diagnose missing availability attribute for decls where the attribute doesn't apply
rdar://62990671
2020-05-11 08:35:11 -07:00
Doug Gregor
72f1beab28 [Test] Downscope api-digester generalization to all *Apple* platforms 2020-05-01 15:58:46 -07:00
Doug Gregor
f1fcec14f4 [Test] Generalize api-digester tests to all platforms.
The API digester tests were being run only for macOS, mainly
because they were not using %target-swift consistently. Lift
the unnecessary restriction so we run these tests more widely.
2020-05-01 14:56:01 -07:00
Xi Ge
533e4b2e34 test: re-enable api-digester/compare-dump-abi.swift 2020-04-27 15:38:49 -07:00
Arnold Schwaighofer
1fa728fe02 Disable test compare-dump-abi.swift to unblock PR testing
rdar://62111064
2020-04-21 09:02:52 -07:00
Xi Ge
c68c1234b4 ABI-checker: add an option to dump generated baselines into a directory. NFC
Using a directory instead of an exact file name for the generated
baseline allows the tool to use target triple as file name, which is
expected by the diagnostic phase.
2020-04-20 14:31:58 -07:00