Commit Graph

1701 Commits

Author SHA1 Message Date
Saleem Abdulrasool
910fbee14e gardening: make c++98-compat-extra-semi an error
This cleans up 90 instances of this warning and reduces the build spew
when building on Linux.  This helps identify actual issues when
building which can get lost in the stream of warning messages.  It also
helps restore the ability to build the compiler with gcc.
2021-11-27 11:40:17 -08:00
Xi Ge
06e63896cd ModuleInterface: consume _const keyword at var and parameter decls and keep them in textual/binary modules
This is to ensure users can start adding these annotations. Type checker supports will come in later commits.

Related to pitch: https://forums.swift.org/t/pitch-compile-time-constant-values/53606

rdar://85268028
2021-11-19 22:13:23 -08:00
Robert Widmann
e7e11df927 Model Sequence Archetypes 2021-11-16 11:38:57 -08:00
Robert Widmann
658de80ca8 Merge pull request #39627 from CodaFi/the-replacements
Suggest Replacement Types for Invalid Placeholders
2021-11-10 16:23:29 -08:00
Robert Widmann
22405cefea Plumb the "Is Type Sequence" Bit Through the Surface AST 2021-11-08 13:48:30 -08:00
Arnold Schwaighofer
2b41beeb12 Merge pull request #39966 from aschwaighofer/feature_specialize_with_availability
Define a feature for _specialize with availability
2021-11-08 12:13:33 -08:00
Robert Widmann
1fe2e4b3e7 Relax Restrictions on Placeholder Types Appearing in Interface Types
These restrictions are meant to keep placeholder types from escaping TypeCheckType. But there's really no harm in that happening as long as we diagnose it on the way out in the places it's banned. (We also need to make sure we're only diagnosing things in primaries, but that's a minor issue). The end result is that we lose information because a lot of the AST that has placeholders in it becomes filled with error types instead.

Lift the restriction on placeholders appearing in the interface type, teach the mangler to treat them as unresolved types, and teach serialization to treat them as error types.
2021-11-03 10:29:15 -07:00
Robert Widmann
f807dfe9e3 Parse @_typeSequence in Generic Parameter Position
Stage in the parsing for this attribute, nothing else.

Motivated by two important reasons:

1) The pitch for variadic generics does not lay down a concrete syntax
   for variadic generic parameters.
2) Paring T... and T* needlessly complicate the lexer as we must now
   disambiguate them with respect to other internal operator characters
   (e.g. `T...>` must lex as `(T...)>` and not `T ...>`

Which itself adds another motivation

3) We need to start parsing this attribute *now* to avoid condfail'ing
   ourselves later.
2021-11-02 14:42:12 -07:00
Arnold Schwaighofer
0bb29449bd Fix spelling of accessor to getAvailabeAttrs -> getAvailableAttrs 2021-10-30 06:16:30 -07:00
QuietMisdreavus
dd88e0dda6 Merge pull request #39865 from apple/QuietMisdreavus/private-swiftc-symbols
[Driver][SymbolGraph] add new flag -symbol-graph-minimum-access-level

rdar://79099869
2021-10-29 13:01:22 -06:00
Victoria Mitchell
156e58d69a use symbol graph opts instead of serialization opts for SGFs 2021-10-21 17:12:49 -06:00
Doug Gregor
bab9189bd7 Merge pull request #39835 from DougGregor/isolated-params-serialization
Properly serialize 'isolated' bit on function parameter declarations.
2021-10-20 12:16:56 -07:00
Doug Gregor
8dbfb04aed Properly serialize 'isolated' bit on function parameter declarations.
Fixes rdar://83380879.
2021-10-20 10:00:13 -07:00
Ellie Shin
6f34844b49 Merge pull request #39705 from apple/es-module-alias-serialize
[Module aliasing] Serialize SIL and binaries with module real names for referenced or imported modules. Resolves rdar://83632529
2021-10-18 21:55:45 -07:00
elsh
e3d5ae0172 Add SIL re-ingest test 2021-10-14 19:03:31 -07:00
Becca Royal-Gordon
354f3470a0 Add @_nonSendable decl attribute
This attribute creates an unavailable extension with a `Sendable` conformance so that the type is explicity marked as not being `Sendable`.

We also fully suppress diagnostics about unavailable Sendable conformances in Swift 5 mode code. (This is not fully developed yet—it should return to being a warning in concurrent contexts.)

The behavior when a @_nonSendable and a Sendable conformance are both on the same type is also not right yet.
2021-10-14 12:14:46 -07:00
elsh
adf33e0bb9 Add doc comments
Rename test
2021-10-12 15:03:30 -07:00
elsh
96fb3d6112 [Module aliasing] Serialize binary with module real name
Resolves rdar://83632529
2021-10-12 13:59:34 -07:00
Mishal Shah
c2fd49cebb Merge pull request #39473 from apple/rebranch
Update swift:main to support llvm-project:stable/20210726 changes (Rebranch merge)
2021-10-11 09:00:51 -07:00
swift-ci
3f8fea8508 Merge remote-tracking branch 'origin/main' into rebranch 2021-10-06 10:17:29 -07:00
Arnold Schwaighofer
c2b2f1331f SIL representation 2021-10-06 04:54:49 -07:00
Arnold Schwaighofer
8840ea6b5b Add support for parsing an availability argument in @_specialize 2021-10-05 14:46:17 -07:00
Richard Howell
140c02466a Add -prefix-serialized-debugging-options (#39555)
This commit adds a new frontend flag that applies debug path prefixing to the
paths serialized in swiftmodule files. This makes it possible to use swiftmodule
files that have been built on different machines by applying the inverse map
when debugging, in a similar fashion to source path prefixing.

The inverse mapping in LLDB will be handled in a follow up PR.

Second pass at #39138

Tests updated to handle windows path separators.

This reverts commit f5aa95b381.
2021-10-04 22:41:32 -07:00
Meghana Gupta
f458d9b490 Fix unnecessary one-time recompile of stdlib with -enable-ossa-flag (#39516)
* Fix unnecessary one-time recompile of stdlib with -enable-ossa-flag

This includes a bit in the module format to represent if the module was
compiled with -enable-ossa-modules flag. When compiling a client module
with -enable-ossa-modules flag, all dependent modules are checked for this bit,
if not on, recompilation is triggered with -enable-ossa-modules.

* Updated tests
2021-10-04 18:46:40 -07:00
Saleem Abdulrasool
f5aa95b381 Revert "Add -prefix-serialized-debugging-options" (#39544)
Reverts #39138

This is causing a failure on Windows: https://ci-external.swift.org/job/oss-swift-windows-x86_64-vs2019/6659/consoleText
2021-10-01 11:19:44 -07:00
swift-ci
c51550f30e Merge remote-tracking branch 'origin/main' into rebranch 2021-09-30 15:11:41 -07:00
Richard Howell
ce6b4b3ee0 Add -prefix-serialized-debugging-options
This commit adds the `-prefix-serialized-debugging-options` flag,
which is used to apply the debug prefix map to serialized debugging
options embedded in the swiftmodule files.
2021-09-30 08:18:03 -07:00
swift-ci
fa88fb5d98 Merge remote-tracking branch 'origin/main' into rebranch 2021-09-25 01:53:16 -07:00
Robert Widmann
7c2bd1282c Collect Fingerprints for Nested Decls
Serialization was reporting that it did not have fingerprints for these declarations. When combined with the driver's new type body fingerprint work for extensions, this effectively hid changes to the bodies of these nested types from the driver's incremental build infrastructure.

Make sure we recur into all of the iterable decl contexts when serializing decls to collect as many fingerprints as we can.

rdar://83469936
2021-09-24 14:29:55 -07:00
swift-ci
f8df0dc8a2 Merge remote-tracking branch 'origin/main' into rebranch 2021-09-21 19:53:25 -07:00
Xi Ge
fef225c272 Merge pull request #39387 from nkcsgexi/emit-module-emit-abi
Frontend: teach -emit-module and -merge-modules to emit ABI descriptor files
2021-09-21 19:49:39 -07:00
swift-ci
4ec5df9a2a Merge remote-tracking branch 'origin/main' into rebranch 2021-09-21 16:53:46 -07:00
Xi Ge
f97653ef37 Frontend: teach -emit-module and -merge-modules to emit ABI descriptor files 2021-09-21 16:51:52 -07:00
Alexis Laferrière
5c2122a08c [Serialization] Restrict resilient swiftmodules to the compiler that built them
Introduce a new loading restriction that is more strict than the serialization
version check on swiftmodules. Tagged compilers will only load
library-evolution enabled swiftmodules that are produced by a compiler with the
exact same revision id. This will be more reliable in production
environments than using the serialization version which we forgot to
update from time to time. This shouldn't affect development compilers that
will still load any module with a compatible serialization version.

rdar://83105234
2021-09-20 18:06:35 -07:00
Nate Chandler
b4291916f2 Merge branch 'main' into rebranch
Conflicts:
        include/swift/SIL/SILBuilder.h
2021-09-15 13:30:12 -07:00
Alexis Laferrière
c38d1773d2 [Serialization] Restrict loading swiftmodule files to the builder's SDK
Serialize the canonical name of the SDK used when building a swiftmodule
file and use it to ensure that the swiftmodule file is loaded only with
the same SDK. The SDK name must be passed down from the frontend.

This will report unsupported configurations like:

- Installing roots between incompatible SDKs without deleting the
swiftmodule files.
- Having multiple targets in the same project using different SDKs.
- Loading a swiftmodule created with a newer SDK (and stdlib) with an
older SDK.

All of these lead to hard to investigate deserialization failures and
this change should detect them early, before reaching a deserialization
failure.

rdar://78048939
2021-09-13 16:44:08 -07:00
swift-ci
0fd4d30f55 Merge remote-tracking branch 'origin/main' into rebranch 2021-09-13 13:33:27 -07:00
Andrew Trick
4828285944 Add pointer_to_address [align=] option.
Support for addresses with arbitrary alignment as opposed to their
element type's natural in-memory alignment.

Required for bytestream encoding/decoding without resorting to memcpy.

SIL instruction flag, documentation, printing, parsing, serialization,
and IRGen.
2021-09-13 10:26:14 -07:00
swift-ci
54989e14c8 Merge remote-tracking branch 'origin/main' into rebranch 2021-09-11 00:53:34 -07:00
Doug Gregor
04135a3db6 [Serialization] Remove an assertion that fires spuriously.
This assertion does not account for the fact that a particular
requirement can be imported both as async and with a completion
handler, and therefore one of those two views won't have a witness.
The assertion is no longer catching anything useful, so remove it.

Addresses rdar://77684000.
2021-09-10 21:41:10 -07:00
swift-ci
a34e4eb804 Merge remote-tracking branch 'origin/main' into rebranch 2021-09-08 16:32:59 -07:00
Andrew Trick
33fecc9b21 Serialize SIL forwarding ownership on terminators. 2021-09-07 10:20:14 -07:00
swift-ci
a4534699a9 Merge remote-tracking branch 'origin/main' into rebranch 2021-09-01 19:48:42 -07:00
Anthony Latsis
eb1bd07bb3 NFC: Remove the now dead ProtocolDecl::existentialTypeSupported() 2021-08-31 19:21:26 +03:00
swift-ci
9b5a798d37 Merge remote-tracking branch 'origin/main' into rebranch 2021-08-26 16:53:29 -07:00
Kavon Farvardin
c0607b345f Revert "Merge pull request #33767 from theblixguy/chore/remove-self-or-associated-type-diagnostic"
The following regression test added for this feature is not passing:

Swift(linux-x86_64) :: decl/protocol/protocols_with_self_or_assoc_reqs_executable.swift

with a compiler crash happening during SILFunctionTransform "Devirtualizer".

Reverting to unblock CI.

This reverts commit f96057e260, reversing
changes made to 3fc18f3603.
2021-08-26 16:46:42 -07:00
swift-ci
2ed72f1514 Merge remote-tracking branch 'origin/main' into rebranch 2021-08-26 14:13:47 -07:00
Konrad `ktoso` Malawski
f96057e260 Merge pull request #33767 from theblixguy/chore/remove-self-or-associated-type-diagnostic
SE-0309: Unlock existential types for all protocols
2021-08-27 06:09:47 +09:00
swift-ci
33d94e0805 Merge remote-tracking branch 'origin/main' into rebranch 2021-08-19 16:13:41 -07:00
Alexis Laferrière
05645a1887 Merge pull request #38958 from xymus/fix-ioi-proto-composition
[Serialization] Write protocol compositions as dependencies of protocols
2021-08-19 16:05:13 -07:00