Skip to content

Commit ab6533a

Browse files
authored
Merge branch 'master' into mracek/arm64e
2 parents cade91c + adbf8da commit ab6533a

File tree

264 files changed

+12886
-2788
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

264 files changed

+12886
-2788
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -895,30 +895,13 @@ function(_add_swift_host_executable_single name)
895895
LINK_LIBRARIES_VAR_NAME link_libraries
896896
LIBRARY_SEARCH_DIRECTORIES_VAR_NAME library_search_directories)
897897

898-
handle_swift_sources(
899-
dependency_target
900-
unused_module_dependency_target
901-
unused_sib_dependency_target
902-
unused_sibopt_dependency_target
903-
unused_sibgen_dependency_target
904-
SWIFTEXE_SINGLE_SOURCES SWIFTEXE_SINGLE_EXTERNAL_SOURCES ${name}
905-
DEPENDS
906-
${SWIFTEXE_SINGLE_DEPENDS}
907-
MODULE_NAME ${name}
908-
SDK ${SWIFTEXE_SINGLE_SDK}
909-
ARCHITECTURE ${SWIFTEXE_SINGLE_ARCHITECTURE}
910-
COMPILE_FLAGS ${SWIFTEXE_SINGLE_COMPILE_FLAGS}
911-
IS_MAIN)
912-
add_swift_source_group("${SWIFTEXE_SINGLE_EXTERNAL_SOURCES}")
913-
914898
add_executable(${name}
915899
${SWIFTEXE_SINGLE_SOURCES}
916900
${SWIFTEXE_SINGLE_EXTERNAL_SOURCES})
917901

918902
add_dependencies_multiple_targets(
919903
TARGETS "${name}"
920904
DEPENDS
921-
${dependency_target}
922905
${LLVM_COMMON_DEPENDS}
923906
${SWIFTEXE_SINGLE_DEPENDS})
924907
llvm_update_compile_flags("${name}")
@@ -960,17 +943,6 @@ function(_add_swift_host_executable_single name)
960943

961944
swift_common_llvm_config("${name}" ${SWIFTEXE_SINGLE_LLVM_LINK_COMPONENTS})
962945

963-
# NOTE(compnerd) use the C linker language to invoke `clang` rather than
964-
# `clang++` as we explicitly link against the C++ runtime. We were previously
965-
# actually passing `-nostdlib++` to avoid the C++ runtime linkage.
966-
if(${SWIFTEXE_SINGLE_SDK} STREQUAL ANDROID)
967-
set_property(TARGET "${name}" PROPERTY
968-
LINKER_LANGUAGE "C")
969-
else()
970-
set_property(TARGET "${name}" PROPERTY
971-
LINKER_LANGUAGE "CXX")
972-
endif()
973-
974946
set_target_properties(${name} PROPERTIES FOLDER "Swift executables")
975947
endfunction()
976948

cmake/modules/SwiftConfigureSDK.cmake

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,9 @@ macro(configure_sdk_darwin
127127
COMMAND "xcrun" "--sdk" "${xcrun_name}" "--show-sdk-path"
128128
OUTPUT_VARIABLE SWIFT_SDK_${prefix}_PATH
129129
OUTPUT_STRIP_TRAILING_WHITESPACE)
130-
if(NOT EXISTS "${SWIFT_SDK_${prefix}_PATH}/System/Library/Frameworks/module.map")
131-
message(FATAL_ERROR "${name} SDK not found at ${SWIFT_SDK_${prefix}_PATH}.")
132-
endif()
133130
endif()
134131

135-
if(NOT EXISTS "${SWIFT_SDK_${prefix}_PATH}/System/Library/Frameworks/module.map")
132+
if(NOT EXISTS "${SWIFT_SDK_${prefix}_PATH}/SDKSettings.plist")
136133
message(FATAL_ERROR "${name} SDK not found at SWIFT_SDK_${prefix}_PATH.")
137134
endif()
138135

docs/SIL.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1961,7 +1961,7 @@ alloc_stack
19611961
```````````
19621962
::
19631963

1964-
sil-instruction ::= 'alloc_stack' sil-type (',' debug-var-attr)*
1964+
sil-instruction ::= 'alloc_stack' '[dynamic_lifetime]'? sil-type (',' debug-var-attr)*
19651965

19661966
%1 = alloc_stack $T
19671967
// %1 has type $*T
@@ -1980,6 +1980,10 @@ predecessors, the stack height and order of allocations must be consistent
19801980
coming from all predecessor blocks. ``alloc_stack`` allocations must be
19811981
deallocated in last-in, first-out stack order.
19821982

1983+
The ``dynamic_lifetime`` attribute specifies that the initialization and
1984+
destruction of the stored value cannot be verified at compile time.
1985+
This is the case, e.g. for conditionally initialized objects.
1986+
19831987
The memory is not retainable. To allocate a retainable box for a value
19841988
type, use ``alloc_box``.
19851989

docs/WindowsBuild.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ git clone https://github.com/compnerd/windows-swift windows-swift
4545

4646
## Acquire ICU, SQLite3, curl, libxml2 and zlib
4747

48-
Go to [compnerd's windows-swift azure page](https://dev.azure.com/compnerd/windows-swift/_build) and open [Pipelines](https://dev.azure.com/compnerd/windows-swift/_build) where you'll see bots (hopefully green) for:
48+
Go to [compnerd's windows-swift azure page](https://dev.azure.com/compnerd/swift-build/_build) and open [Pipelines](https://dev.azure.com/compnerd/swift-build/_build) where you'll see bots (hopefully green) for:
4949

50-
- [ICU](https://dev.azure.com/compnerd/windows-swift/_build?definitionId=9)
51-
- [SQLite](https://dev.azure.com/compnerd/windows-swift/_build?definitionId=12&_a=summary)
52-
- [curl](https://dev.azure.com/compnerd/windows-swift/_build?definitionId=11&_a=summary)
53-
- [libxml2](https://dev.azure.com/compnerd/windows-swift/_build?definitionId=10&_a=summary)
54-
- [zlib](https://dev.azure.com/compnerd/windows-swift/_build?definitionId=16&_a=summary)
50+
- [ICU](https://dev.azure.com/compnerd/swift-build/_build?definitionId=9)
51+
- [SQLite](https://dev.azure.com/compnerd/swift-build/_build?definitionId=12&_a=summary)
52+
- [curl](https://dev.azure.com/compnerd/swift-build/_build?definitionId=11&_a=summary)
53+
- [libxml2](https://dev.azure.com/compnerd/swift-build/_build?definitionId=10&_a=summary)
54+
- [zlib](https://dev.azure.com/compnerd/swift-build/_build?definitionId=16&_a=summary)
5555

5656
Download each of the zip files and copy their contents into S:/Library. The directory structure should resemble:
5757

include/swift/AST/ASTMangler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class ASTMangler : public Mangler {
3939
bool OptimizeProtocolNames = true;
4040

4141
/// If enabled, use Objective-C runtime names when mangling @objc Swift
42-
/// protocols.
43-
bool UseObjCProtocolNames = false;
42+
/// protocols and classes.
43+
bool UseObjCRuntimeNames = false;
4444

4545
/// If enabled, non-canonical types are allowed and type alias types get a
4646
/// special mangling.

include/swift/AST/ASTTypeIDZone.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@ SWIFT_TYPEID_NAMED(TypeAliasDecl *, TypeAliasDecl)
5454
SWIFT_TYPEID_NAMED(ValueDecl *, ValueDecl)
5555
SWIFT_TYPEID_NAMED(VarDecl *, VarDecl)
5656
SWIFT_TYPEID(FingerprintAndMembers)
57+
SWIFT_TYPEID(Identifier)

include/swift/AST/ASTTypeIDs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ struct TypeWitnessAndDecl;
6262
enum class AncestryFlags : uint8_t;
6363
enum class ImplicitMemberAction : uint8_t;
6464
struct FingerprintAndMembers;
65+
class Identifier;
6566

6667
// Define the AST type zone (zone 1)
6768
#define SWIFT_TYPEID_ZONE AST

include/swift/AST/AccessScope.h

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,16 @@ namespace swift {
2424
/// a particular declaration can be accessed.
2525
class AccessScope {
2626
/// The declaration context (if not public) along with a bit saying
27-
/// whether this scope is private (or not).
27+
/// whether this scope is private, SPI or not.
28+
/// If the declaration context is set, the bit means that the scope is
29+
/// private or not. If the declaration context is null, the bit means that
30+
/// this scope is SPI or not.
2831
llvm::PointerIntPair<const DeclContext *, 1, bool> Value;
32+
2933
public:
30-
AccessScope(const DeclContext *DC, bool isPrivate = false);
34+
AccessScope(const DeclContext *DC, bool isPrivate = false, bool isSPI = false);
3135

32-
static AccessScope getPublic() { return AccessScope(nullptr); }
36+
static AccessScope getPublic(bool isSPI = false) { return AccessScope(nullptr, false, isSPI); }
3337

3438
/// Check if private access is allowed. This is a lexical scope check in Swift
3539
/// 3 mode. In Swift 4 mode, declarations and extensions of the same type will
@@ -46,18 +50,24 @@ class AccessScope {
4650
}
4751

4852
bool isPublic() const { return !Value.getPointer(); }
49-
bool isPrivate() const { return Value.getInt(); }
53+
bool isPrivate() const { return Value.getPointer() && Value.getInt(); }
5054
bool isFileScope() const;
5155
bool isInternal() const;
5256

57+
// Is this a public scope
58+
bool isSPI() const { return !Value.getPointer() && Value.getInt(); }
59+
5360
/// Returns true if this is a child scope of the specified other access scope.
5461
///
5562
/// \see DeclContext::isChildContextOf
5663
bool isChildOf(AccessScope AS) const {
5764
if (!isPublic() && !AS.isPublic())
5865
return allowsPrivateAccess(getDeclContext(), AS.getDeclContext());
59-
if (isPublic() && AS.isPublic())
66+
if (isPublic() && AS.isPublic()) {
67+
if (isSPI() != AS.isSPI())
68+
return isSPI();
6069
return false;
70+
}
6171
return AS.isPublic();
6272
}
6373

@@ -76,6 +86,8 @@ class AccessScope {
7686
/// have common intersection, or None if scopes don't intersect.
7787
const Optional<AccessScope> intersectWith(AccessScope accessScope) const {
7888
if (hasEqualDeclContextWith(accessScope)) {
89+
if (isSPI())
90+
return *this;
7991
if (isPrivate())
8092
return *this;
8193
return accessScope;

include/swift/AST/Attr.def

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,9 @@ DECL_ATTR(derivative, Derivative,
541541
97)
542542

543543
DECL_ATTR(_spi, SPIAccessControl,
544-
OnFunc | OnExtension | OnGenericType | OnVar | OnSubscript | OnConstructor |
545-
OnImport | AllowMultipleAttributes | UserInaccessible |
544+
OnAbstractFunction | OnExtension | OnGenericType | OnVar | OnSubscript |
545+
OnImport | OnAccessor | OnEnumElement |
546+
AllowMultipleAttributes | UserInaccessible |
546547
ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove,
547548
98)
548549

include/swift/AST/Comment.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,27 @@ class DocComment {
9393
};
9494

9595
/// Get a parsed documentation comment for the declaration, if there is one.
96+
///
97+
/// \param AllowSerialized Allow loading serialized doc comment data, including
98+
/// comment ranges.
9699
DocComment *getSingleDocComment(swift::markup::MarkupContext &Context,
97-
const Decl *D);
100+
const Decl *D, bool AllowSerialized = false);
98101

99-
const Decl *getDocCommentProvidingDecl(const Decl *D);
102+
/// Get the declaration that actually provides a doc comment for another.
103+
///
104+
/// \param AllowSerialized Allow loading serialized doc comment data, including
105+
/// comment ranges.
106+
const Decl *getDocCommentProvidingDecl(const Decl *D,
107+
bool AllowSerialized = false);
100108

101109
/// Attempt to get a doc comment from the declaration, or other inherited
102110
/// sources, like from base classes or protocols.
111+
///
112+
/// \param AllowSerialized Allow loading serialized doc comment data, including
113+
/// comment ranges.
103114
DocComment *getCascadingDocComment(swift::markup::MarkupContext &MC,
104-
const Decl *D);
115+
const Decl *D,
116+
bool AllowSerialized = false);
105117

106118
/// Extract comments parts from the given Markup node.
107119
swift::markup::CommentParts

0 commit comments

Comments
 (0)