Commit Graph

2428 Commits

Author SHA1 Message Date
Konrad `ktoso` Malawski
7d1ce789ad Revert "Revert "Isolated synchronous deinit"" 2024-09-17 17:35:38 +09:00
Doug Gregor
4e7fb73b0c Provide the buffer ID for source files created for C swift_attr attributes
When rendering a swift_attr attribute for parsing, we were creating both
the backing buffer and a source file, but not providing the buffer's ID
to the source file, so we couldn't find the source code again. Fix that.

While here, also register the source file with the module, so we can
find the source file again based on location.
2024-09-16 21:45:34 -07: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
Allan Shortlidge
02dbb96b94 AST: Rename AvailabilityContext to AvailabilityRange.
The generality of the `AvailabilityContext` name made it seem like it
encapsulates more than it does. Really it just augments `VersionRange` with
additional set algebra operations that are useful for availability
computations. The `AvailabilityContext` name should be reserved for something
pulls together more than just a single version.
2024-09-13 16:25:18 -07:00
fahadnayyar
7753ad0885 Merge pull request #76131 from fahadnayyar/cxx-interop-frt-retain-release-diagnostics
Fixed diagnostics for incorrect parameters of retain/release function…
2024-09-11 10:24:20 -07:00
fahadnayyar
f3f4e1913b Fixed diagnostics for incorrect signature of retain/release functions of SWIFT_SHARED_REFERENCE C++ types. 2024-09-10 16:15:07 -07:00
swift-ci
f3fac46bbc Merge remote-tracking branch 'origin/main' into rebranch 2024-09-09 08:35:46 -07:00
Alex Lorenz
8ea7569b14 Merge pull request #76286 from hyp/eng/bodyParamsimport
[cxx-interop] do not rely on bodyParams being always non-null when im…
2024-09-09 08:24:30 -07:00
swift-ci
9717c082ca Merge remote-tracking branch 'origin/main' into rebranch 2024-09-06 09:16:29 -07:00
fahadnayyar
e3ea4e1b54 Merge pull request #75897 from fahadnayyar/f-dev-frt-return-ownership-annotations-pr
[cxx-interop] Add SWIFT_RETURNS_RETAINED and SWIFT_RETURNS_UNRETAINED…
2024-09-06 09:16:08 -07:00
swift-ci
da55e84c74 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-05 15:35:33 -07:00
fahadnayyar
ea4328384d [cxx-interop] Add SWIFT_RETURNS_RETAINED and SWIFT_RETURNS_UNRETAINED annotations to specify ownership of FRT returned by a C++ method or function
rdar://135306908
2024-09-05 11:44:31 -07:00
Alex Lorenz
86886d96c9 [cxx-interop] do not rely on bodyParams being always non-null when importing function's name
This change fixes a swift-ide-test crash that occured in the Interop\Cxx\stdlib\msvcprt-module-interface.swift testcase with a newer MSVC, as one of its operator() had a parameter with a type that couldn't have been imported. The change ensures that body params are not used if they're null.
2024-09-05 10:54:52 -07:00
Alejandro Alonso
f4f60f4344 Remove Value requirement Add GenericTypeParamKind 2024-09-04 15:13:43 -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
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
33cd94ec00 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-03 10:04:55 -07:00
Allan Shortlidge
3f626f50fe Merge pull request #76203 from tshortli/availability-context-cleanup
AST: Clean up `AvailabilityContext` and uses
2024-09-03 09:42:25 -07:00
swift-ci
dd7533d4e7 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-03 09:33:55 -07:00
Konrad `ktoso` Malawski
c86e4a8738 Merge pull request #60057 from nickolas-pohilets/mpokhylets/isolated-deinit
Co-authored-by: Konrad `ktoso` Malawski <ktoso@apple.com>
2024-09-04 01:16:56 +09:00
swift-ci
f1877410ef Merge remote-tracking branch 'origin/main' into rebranch 2024-09-03 02:53:13 -07:00
Gábor Horváth
54efb012f9 Merge pull request #76209 from swiftlang/gaborh/nonescapable-attr
[cxx-interop] Add a SWIFT_NONESCAPABLE attribute to the bridging header
2024-09-03 10:48:55 +01:00
Allan Shortlidge
8ab7f54cd4 AST/Sema: Favor AvailabilityContext over VersionTuple/VersionRange.
For the purposes of availability calculations, direct use of
`llvm::VersionTuple` and `VersionRange` is discouraged, since these fundamental
version representations are divorced from their context. For example, comparing
an iOS platform version to a visionOS platform version is invalid since the
versioning systems of the two platforms differ. Although visionOS inherits
avialability from iOS, an iOS version must be converted to a visionOS version
prior to comparison. In the future, `AvailabilityContext` can be enriched to
carry the information necessary to verify that its algebraic operations are
being performed on compatible values.

NFC.
2024-09-02 18:24:31 -07:00
Allan Shortlidge
8052e3f9dc AST: Remove 'OS' from AvailabilityContext member names.
An `AvailabilityContext` represents an abstract version range in which
something is available. In the future, these version ranges may not necessarily
always correspond to operating system version ranges.

NFC.
2024-09-02 16:47:14 -07:00
Gabor Horvath
1842867de2 [cxx-interop][NFC] Fix some clang-tidy warnings
Mostly remove redundant includes, adding missing namespace end comments
and using isa_and_nonnull.
2024-09-02 15:24:47 +01:00
Gabor Horvath
738b4c6d8d [cxx-interop] Add a SWIFT_NONESCAPABLE attribute to the bridging header
This makes it easier to experiment with noescapable types in interop.
Moreover, we always wanted to have this annotation for completeness,
similar to SWIFT_NONCOPYABLE.
2024-09-02 14:51:27 +01: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
swift-ci
24622569e8 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-23 13:14:26 -07:00
Egor Zhdan
386c8eba13 [cxx-interop] Do not import std::chrono::time_zone_link
This type is non-copyable, but its implementation in libstdc++13 does not explicitly declare a deleted copy constructor.

After rebranch, we should start using API Notes to annotate the type as a non-copyable type in Swift.

For now, this change disables import of this type.

See https://github.com/swiftlang/swift/pull/73086

rdar://134432426
2024-08-23 16:34:18 +01: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
Mykola Pokhylets
50b1313175 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	lib/SILGen/SILGenDistributed.cpp
#	lib/Sema/TypeCheckConcurrency.cpp
2024-08-15 16:58:43 +02:00
Ben Barham
467e528200 Merge remote-tracking branch 'origin/main' into manual-rebranch-merge
Conflicts:
  - `lib/Serialization/ModuleFormat.h` bumped version to account for
    differences between main and rebranch.
2024-08-09 15:22:39 -07:00
Slava Pestov
375363a473 AST: Move global conformance lookup entry points to ConformanceLookup.h 2024-08-08 23:35:58 -04:00
swift-ci
538d700717 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-17 22:45:20 -07:00
Carl Peto
3689427834 [AVR] standard library support for AVR
- when compiling embedded cross compile target standard libraries, include AVR
- add 16-bit pointer as a conditional compilation condition and get the void pointer size right for gyb sources
- attempt to fix clang importer not importing __swift_intptr_t correctly on 16 bit platforms
- changed the unit test target to avr-none-none-elf to match the cmake build

[AVR] got the standard library compiling in a somewhat restricted form:

General
- updated the Embedded Runtime
- tweaked CTypes.swift to fix clang import on 16 bit platforms

Strings
- as discussed in https://forums.swift.org/t/stringguts-stringobject-internals-how-to-layout-on-16-bit-platforms/73130, I went for just using the same basic layout in 16 bit as 32 bit but with 16 bit pointers/ints... the conversation is ongoing, I think something more efficient is possible but at least this compiles and will probably work (inefficiently)

Unicode
- the huge arrays of unicode stuff in UnicodeStubs would not compile, so I skipped it for AVR for now.

Synchronization
- disabled building the Synchronization library on AVR for now. It's arguable if it adds value on this platform anyway.
2024-07-16 12:28:27 +01:00
Mykola Pokhylets
816d62c972 Merge remote-tracking branch 'upstream/main' into mpokhylets/isolated-deinit
# Conflicts:
#	include/swift/Basic/Features.def
#	lib/SILGen/SILGenDestructor.cpp
#	test/Concurrency/flow_isolation.swift
#	test/abi/macOS/arm64/concurrency.swift
#	test/abi/macOS/x86_64/concurrency.swift
2024-07-11 13:11:59 +02:00
Mykola Pokhylets
63e538e469 Import dealloc method as deinit 2024-07-11 13:09:05 +02:00
swift-ci
a32c1896dc Merge remote-tracking branch 'origin/main' into rebranch 2024-07-10 23:09:47 -07:00
Meghana Gupta
8137aed238 Rename LifetimeDependentReturnTypeRepr -> LifetimeDependentTypeRepr 2024-07-10 14:20:03 -07:00
swift-ci
b7921a8232 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-06 14:34:09 -07:00
Slava Pestov
ca9c09f8a1 Remove some unused variables 2024-07-06 12:05:47 -04:00
Slava Pestov
86d567f95a AST: ModuleDecl::lookupConformance() is a static method 2024-07-06 12:05:47 -04:00
Slava Pestov
fae01d9776 AST: Remove ModuleDecl parameter from more places 2024-07-06 12:05:46 -04:00
Ben Barham
4c5284fd40 Merge pull request #74851 from bnbarham/rebranch-build-after-branch
[rebranch] Various changes to get rebranch compiling after taking new clang branch
2024-07-02 22:01:17 -07:00
Ben Barham
47a06b232f [ClangImporter] Rename isUnnamedBitfield to isUnnamedBitField 2024-07-02 16:13:49 -07:00
swift-ci
2201e05fb8 Merge remote-tracking branch 'origin/main' into rebranch 2024-07-02 14:15:46 -07:00
Michael Gottesman
34195ff213 Merge pull request #74610 from gottesmm/pr-324fd70c13e87a329334341aae4667f2d1be152c
[sending] Remove transferring.
2024-07-02 14:02:18 -07:00
Ben Barham
701800fbeb [ClangImporter] Handle DefaultArgument now being a TemplateArgmentLoc
This was changed in upstream LLVM 142c3f394e1b34dcefcaf0887a6fd4711b78eeb3.
2024-07-01 14:52:52 -07:00