Commit Graph

2092 Commits

Author SHA1 Message Date
Nate Chandler
6bc2013df0 [NFC] ASTPrinter: Remove unneeded list resize.
Don't bother saving the previous ExcludeAttrList's size and restoring it
after execution when that list isn't modified.
2024-09-25 21:06:36 -07:00
Doug Gregor
0aff85ced7 Emit mangled names for public symbols into the .swiftinterface
When the frontend option `-abi-comments-in-module-interface` is provided
during interface printing, the printed interface will contain
additional comments that provide the mangled names for public symbols.
This is an experiment in seeing how much information we can
meaningfully extract from a printed Swift interface for the purpose of
bridging with other languages.
2024-09-25 15:49:34 -07:00
swift-ci
5b6002caeb Merge remote-tracking branch 'origin/main' into rebranch 2024-09-24 01:55:37 -07:00
Allan Shortlidge
0fb36a5f39 AST: Make $SpecializeAttributeWithAvailability a baseline feature.
It has been available since at least Swift 5.8.
2024-09-23 21:48:09 -07:00
Konrad `ktoso` Malawski
d89347bed0 Merge branch 'main' into wip-experimental-isolated-deinit 2024-09-20 18:34:45 +09:00
swift-ci
ae4fee5d4e Merge remote-tracking branch 'origin/main' into rebranch 2024-09-19 13:54:31 -07:00
Doug Gregor
5b2520e379 Remove IfConfigDecl from the AST
The swift-syntax tree retains information about the parsed #if
regions. Drop it from the semantic AST.
2024-09-18 20:51:54 -07:00
swift-ci
5039a2d86c Merge remote-tracking branch 'origin/main' into rebranch 2024-09-18 10:55:29 -07:00
Michael Gottesman
2eea17ac1d Merge pull request #76491 from gottesmm/rdar135594964
[sending] Look through the sending type repr when printing the type of a function result using the type repr fallback path.
2024-09-18 10:38:55 -07:00
Michael Gottesman
15a34a530f [sending] Look through the sending type repr when printing the type of a function result using the type repr fallback path.
When we print types in the AST printer if for some reason we cannot find the
appropriate type to print or if the user explicitly asks, we fall back and use a
type repr instead.

This behavior causes a problem due to the implementation of sending results
using a sending type repr to communicate that the relevant function has a
sending result, but we actually do not use the sending type repr from that point
on. So as a result, in this fallback case, we put in one too many sending on the
result.

rdar://135594964
2024-09-17 16:54:42 -07:00
Konrad `ktoso` Malawski
7d1ce789ad Revert "Revert "Isolated synchronous deinit"" 2024-09-17 17:35:38 +09:00
Ben Barham
a7b50f357f Merge remote-tracking branch 'origin/main' into manual-main-merge
Conflicts:
  - `lib/Driver/ToolChains.cpp` conflicting with the `addAllArgs` rename
    for multiple options
2024-09-16 13:53:18 -07:00
Meghana Gupta
68bfc0d3b4 Make NonEscapableTypes as a suppressible experimental feature 2024-09-13 13:13:17 -07:00
Meghana Gupta
2b011b0a3a [NFC] Rename/reorg LifetimeDependence utils 2024-09-09 22:02:44 -07:00
swift-ci
290cda09b1 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-09 09:15:25 -07:00
Doug Gregor
c0fea1f224 Disable printing of #ifs from the AST
The option to print #ifs defaulted to "on", but was disabled in most of
the actual compiler inputs that mattered, and the results weren't ever
actually used. Remove the option so we never print #ifs.
2024-09-08 09:52:37 -07:00
Tony Allevato
aebe2ab309 Fix missing operators in synthesized == impls printed by -print-ast.
`visitBinaryExpr` wasn't handling `UnresolvedDeclRefExpr` nodes, which the
synthesized `==` implementation uses to compare fields/payloads. Also fixed
the test that wasn't catching it since it also left out the operators.
2024-09-07 20:13:13 -04:00
swift-ci
99519cb291 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-05 22:53:33 -07:00
Allan Shortlidge
a770371a80 ModuleInterface: Print patterns with opaque result types using some keyword.
Previously, the opaque types in patterns were printed using their full stable
reference which cannot be resolved when parsing a swiftinterface.

Resolves rdar://127771885.
2024-09-05 16:08:42 -07:00
Allan Shortlidge
2788c1dac1 AST: Introduce PrintWithOpaqueResultTypeKeywordRAII utility. 2024-09-05 16:08:42 -07:00
swift-ci
da55e84c74 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-05 15:35:33 -07:00
Alejandro Alonso
19fc174f30 Don't create fake GTPDs for SIL generic signatures 2024-09-04 15:13:47 -07:00
Alejandro Alonso
e0f2b812e8 Add serialization and parser tests for SIL 2024-09-04 15:13:47 -07:00
Slava Pestov
1ff1b9479a AST: Pick off some usages of GenericTypeParamType::getDecl() 2024-09-04 15:13:46 -07:00
Alejandro Alonso
f4f60f4344 Remove Value requirement Add GenericTypeParamKind 2024-09-04 15:13:43 -07:00
Alejandro Alonso
0df42e9841 Lower UDRE to TypeValue if it references a value generic 2024-09-04 15:13:29 -07:00
Alejandro Alonso
3e9c4633ca Add some new diagnostics and tests 2024-09-04 15:13:27 -07:00
Alejandro Alonso
75c2cbf593 Implement value generics
Some requirement machine work

Rename requirement to Value

Rename more things to Value

Fix integer checking for requirement

some docs and parser changes

Minor fixes
2024-09-04 15:13:25 -07:00
swift-ci
b29ebad446 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-04 12:04:17 -07:00
Slava Pestov
a3c0e225a7 Merge pull request #76238 from slavapestov/existential-signature-rework-part-3
Allow type variables to appear inside opened existential archetypes
2024-09-04 14:53:18 -04:00
swift-ci
3693ed74c4 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-04 07:56:21 -07:00
Doug Gregor
601a5c3c0c Merge pull request #76187 from DougGregor/extract-inlinable-text-swift-syntax
Implement extractInlinableText with swift-syntax
2024-09-04 07:53:40 -07:00
Slava Pestov
1778a9f595 AST: Print opened existential substitutions in ASTPrinter/ASTDumper 2024-09-04 10:42:18 -04:00
swift-ci
756fe355fa Merge remote-tracking branch 'origin/main' into rebranch 2024-09-03 22:34:34 -07:00
Alex Hoppen
c5aa49ba64 Revert "Isolated synchronous deinit" 2024-09-03 18:11:26 -07:00
swift-ci
dd7533d4e7 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-03 09:33:55 -07:00
Konrad `ktoso` Malawski
c55ad6fa88 Merge branch 'main' into mpokhylets/isolated-deinit 2024-09-02 23:16:17 +09:00
Doug Gregor
a73711ef4b Implement extractInlinableText with swift-syntax
Replace the existing C++ implementation of extractInlinableText with
a new implementation based on swift-syntax. It uses SwiftIfConfig to
remove inactive regions (with a special mode), and a new compiler-only
entrypoint in the library to remove comments and `#sourceLocation`.
2024-08-30 16:43:41 -07:00
swift-ci
f624072420 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-29 03:33:30 -07:00
Mykola Pokhylets
e0ad7bde82 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	include/swift/Basic/Features.def
#	lib/AST/ASTPrinter.cpp
#	lib/AST/FeatureSet.cpp
2024-08-29 11:28:43 +02:00
Hamish Knight
1cb0f8fdd5 [AST] Rename isPrivateStdlibDecl -> isPrivateSystemDecl
This better reflects what we're actually checking
here.
2024-08-28 18:31:51 +01:00
swift-ci
1450e0889d Merge remote-tracking branch 'origin/main' into rebranch 2024-08-20 19:16:30 -07:00
swift-ci
b08f7a1307 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-20 13:58:19 -07:00
Slava Pestov
5577f27661 AST: Opened existential environments store outer substitutions 2024-08-20 16:54:51 -04:00
Slava Pestov
b434c9fb56 Merge pull request #75984 from slavapestov/clean-up-opened-archetype
Clean up OpenedArchetypeType construction and more
2024-08-20 16:52:55 -04:00
Slava Pestov
50ab7f52a2 AST: Remove more usages of ArchetypeType::getRoot() 2024-08-20 11:51:31 -04:00
swift-ci
5a20ae5fce Merge remote-tracking branch 'origin/main' into rebranch 2024-08-20 06:35:14 -07:00
Doug Gregor
cccf6c1114 Introduce @unsafe and the ability to prohibit use of unsafe declarations
Allow any declaration to be marked with `@unsafe`, meaning that it
involves unsafe code. This also extends to C declarations marked with
the `swift_attr("unsafe")` attribute.

Under a separate experimental flag (`DisallowUnsafe`), diagnose any
attempt to use an `@unsafe` declaration or any unsafe language feature
(such as `unowned(unsafe)`, `@unchecked Sendable`). This begins to
define a "safe" mode in Swift that prohibits memory-unsafe constructs.
2024-08-19 14:33:07 -07:00
swift-ci
a5ec343a08 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-17 06:14:34 -07:00
Slava Pestov
0e853a358e Merge pull request #75935 from slavapestov/remove-transform
AST: Replace remaining uses of Type::transform() with transformRec()
2024-08-17 09:11:52 -04:00