Skip to content

Commit 1fb165a

Browse files
committed
Merge branch 'master' into rename-conflicting-classes-and-methods
1 parent 49c3547 commit 1fb165a

File tree

112 files changed

+7624
-6009
lines changed

Some content is hidden

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

112 files changed

+7624
-6009
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,10 @@ endif()
775775
# Should we cross-compile the standard library for Windows?
776776
is_sdk_requested(WINDOWS swift_build_windows)
777777
if(swift_build_windows AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
778-
configure_sdk_windows(WINDOWS "Windows" "msvc" "aarch64;armv7;i686;x86_64")
778+
if("${SWIFT_SDK_WINDOWS_ARCHITECTURES}" STREQUAL "")
779+
set(SWIFT_SDK_WINDOWS_ARCHITECTURES aarch64;armv7;i686;x86_64)
780+
endif()
781+
configure_sdk_windows(WINDOWS "Windows" "msvc" "${SWIFT_SDK_WINDOWS_ARCHITECTURES}")
779782
endif()
780783

781784
if("${SWIFT_SDKS}" STREQUAL "")

cmake/modules/AddSwift.cmake

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,11 @@ function(_add_variant_c_compile_link_flags)
132132
endif()
133133

134134
if("${CFLAGS_SDK}" STREQUAL "ANDROID")
135-
list(APPEND result
136-
"--sysroot=${SWIFT_SDK_ANDROID_ARCH_${CFLAGS_ARCH}_PATH}"
137-
# Use the linker included in the Android NDK.
138-
"-B" "${SWIFT_SDK_ANDROID_ARCH_${CFLAGS_ARCH}_NDK_PREBUILT_PATH}/${SWIFT_SDK_ANDROID_ARCH_${CFLAGS_ARCH}_NDK_TRIPLE}/bin/")
135+
# lld can handle targeting the android build. However, if lld is not
136+
# enabled, then fallback to the linker included in the android NDK.
137+
if(NOT SWIFT_ENABLE_LLD_LINKER)
138+
list(APPEND result "-B" "${SWIFT_SDK_ANDROID_ARCH_${CFLAGS_ARCH}_NDK_PREBUILT_PATH}/${SWIFT_SDK_ANDROID_ARCH_${CFLAGS_ARCH}_NDK_TRIPLE}/bin")
139+
endif()
139140
endif()
140141

141142
if(IS_DARWIN)
@@ -227,8 +228,8 @@ function(_add_variant_c_compile_flags)
227228
# -D_MD or D_MDd either, as CMake does this automatically.
228229
if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
229230
list(APPEND result -Xclang;--dependent-lib=oldnames)
230-
# TODO(compnerd) handle /MT, /MTd, /MD, /MDd
231-
if("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
231+
# TODO(compnerd) handle /MT, /MTd
232+
if("${CFLAGS_BUILD_TYPE}" STREQUAL "Debug")
232233
list(APPEND result "-D_MDd")
233234
list(APPEND result -Xclang;--dependent-lib=msvcrtd)
234235
else()

docs/ABI/Mangling.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Globals
6464
global ::= context 'MXE' // extension descriptor
6565
global ::= context 'MXX' // anonymous context descriptor
6666
global ::= context identifier 'MXY' // anonymous context descriptor
67-
global ::= type assoc_type_path 'MXA' // generic parameter ref
67+
global ::= type assoc-type-list 'MXA' // generic parameter ref
6868
global ::= protocol 'Mp' // protocol descriptor
6969

7070
global ::= nominal-type 'Mo' // class metadata immediate member base offset
@@ -91,15 +91,13 @@ Globals
9191
global ::= type protocol-conformance 'WL' // lazy protocol witness table cache variable
9292

9393
global ::= protocol-conformance identifier 'Wt' // associated type metadata accessor
94-
global ::= protocol-conformance assoc_type_path nominal-type 'WT' // associated type witness table accessor
94+
global ::= protocol-conformance assoc-type-list nominal-type 'WT' // associated type witness table accessor
9595
global ::= type protocol-conformance 'Wl' // lazy protocol witness table accessor
9696

9797
global ::= type 'WV' // value witness table
9898
global ::= entity 'Wvd' // field offset
9999
global ::= entity 'WC' // resilient enum tag index
100100

101-
assoc_type_path ::= identifier '_' identifier*
102-
103101
A direct symbol resolves directly to the address of an object. An
104102
indirect symbol resolves to the address of a pointer to the object.
105103
They are distinct manglings to make a certain class of bugs

docs/WindowsBuild.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,12 @@ pushd "%swift_source_dir%/build/Ninja-DebugAssert/swift-windows-amd64"
233233
cmake -G "Ninja" "%swift_source_dir%/swift"^
234234
-DCMAKE_BUILD_TYPE=Debug^
235235
-DSWIFT_PATH_TO_CMARK_SOURCE="%swift_source_dir%/cmark"^
236-
-DSWIFT_PATH_TO_CMARK_BUILD="%swift_source_dir%/build/Ninja-RelWithDebInfoAssert/cmark-windows-amd64"^
237-
-DSWIFT_CMARK_LIBRARY_DIR="%swift_source_dir%/build/Ninja-RelWithDebInfoAssert/cmark-windows-amd64/src"^
236+
-DSWIFT_PATH_TO_CMARK_BUILD="%swift_source_dir%/build/Ninja-DebugAssert/cmark-windows-amd64"^
237+
-DSWIFT_CMARK_LIBRARY_DIR="%swift_source_dir%/build/Ninja-DebugAssert/cmark-windows-amd64/src"^
238238
-DSWIFT_PATH_TO_LLVM_SOURCE="%swift_source_dir%/llvm"^
239-
-DSWIFT_PATH_TO_LLVM_BUILD="%swift_source_dir%/build/Ninja-RelWithDebInfoAssert/llvm-windows-amd64"^
239+
-DSWIFT_PATH_TO_LLVM_BUILD="%swift_source_dir%/build/Ninja-DebugAssert/llvm-windows-amd64"^
240240
-DSWIFT_PATH_TO_CLANG_SOURCE="%swift_source_dir%/llvm/tools/clang"^
241-
-DSWIFT_PATH_TO_CLANG_BUILD="%swift_source_dir%/build/Ninja-RelWithDebInfoAssert/llvm-windows-amd64"^
241+
-DSWIFT_PATH_TO_CLANG_BUILD="%swift_source_dir%/build/Ninja-DebugAssert/llvm-windows-amd64"^
242242
-DICU_UC_INCLUDE_DIRS="%swift_source_dir%/icu/include"^
243243
-DICU_UC_LIBRARY_DIRS="%swift_source_dir%/icu/lib64"^
244244
-DICU_I18N_INCLUDE_DIRS="%swift_source_dir%/icu/include"^

include/swift/AST/Decl.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3116,18 +3116,26 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
31163116
/// called to make it immediately visible.
31173117
void makeMemberVisible(ValueDecl *member);
31183118

3119+
/// Special-behaviour flags passed to lookupDirect()
3120+
enum class LookupDirectFlags {
3121+
/// Whether to avoid loading any new extension.
3122+
/// Used by the module loader to break recursion.
3123+
IgnoreNewExtensions = 1 << 0,
3124+
/// Whether to include @_implements members.
3125+
/// Used by conformance-checking to find special @_implements members.
3126+
IncludeAttrImplements = 1 << 1,
3127+
};
3128+
31193129
/// Find all of the declarations with the given name within this nominal type
31203130
/// and its extensions.
31213131
///
31223132
/// This routine does not look into superclasses, nor does it consider
31233133
/// protocols to which the nominal type conforms. Furthermore, the resulting
31243134
/// set of declarations has not been filtered for visibility, nor have
31253135
/// overridden declarations been removed.
3126-
///
3127-
/// \param ignoreNewExtensions Whether to avoid loading any new extension.
3128-
/// Used by the module loader to break recursion.
31293136
TinyPtrVector<ValueDecl *> lookupDirect(DeclName name,
3130-
bool ignoreNewExtensions = false);
3137+
OptionSet<LookupDirectFlags> flags =
3138+
OptionSet<LookupDirectFlags>());
31313139

31323140
/// Collect the set of protocols to which this type should implicitly
31333141
/// conform, such as AnyObject (for classes).

include/swift/AST/DiagnosticsModuleDiffer.def

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ ERROR(raw_type_change,none,"%0(%1) is now %2 representable", (StringRef, StringR
4242

4343
ERROR(removed_decl,none,"%0 has been removed%select{| (deprecated)}1", (StringRef, bool))
4444

45+
ERROR(removed_setter,none,"%0 has removed its setter", (StringRef))
46+
4547
ERROR(moved_decl,none,"%0 has been moved to %1", (StringRef, StringRef))
4648

4749
ERROR(renamed_decl,none,"%0 has been renamed to %1", (StringRef, StringRef))
@@ -62,6 +64,10 @@ ERROR(conformance_removed,none,"%0 has removed %select{conformance to|inherited
6264

6365
ERROR(conformance_added,none,"%0 has added inherited protocol %1", (StringRef, StringRef))
6466

67+
ERROR(default_associated_type_removed,none,"%0 has removed default type %1", (StringRef, StringRef))
68+
69+
ERROR(protocol_req_added,none,"%0 has been added as a protocol requirement", (StringRef))
70+
6571
#ifndef DIAG_NO_UNDEF
6672
# if defined(DIAG)
6773
# undef DIAG

include/swift/AST/LookupKinds.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ enum NLOptions : unsigned {
5757
/// This lookup should only return type declarations.
5858
NL_OnlyTypes = 0x80,
5959

60+
/// Include synonyms declared with @_implements()
61+
NL_IncludeAttributeImplements = 0x100,
62+
6063
/// This lookup is known to not add any additional dependencies to the
6164
/// primary source file.
6265
///

include/swift/AST/Types.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4088,7 +4088,8 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
40884088
void Profile(llvm::FoldingSetNodeID &ID) {
40894089
Profile(ID, getGenericSignature(), getExtInfo(), getCoroutineKind(),
40904090
getCalleeConvention(), getParameters(), getYields(),
4091-
getResults(), getOptionalErrorResult());
4091+
getResults(), getOptionalErrorResult(),
4092+
getWitnessMethodConformanceOrNone());
40924093
}
40934094
static void Profile(llvm::FoldingSetNodeID &ID,
40944095
GenericSignature *genericSig,
@@ -4098,7 +4099,8 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
40984099
ArrayRef<SILParameterInfo> params,
40994100
ArrayRef<SILYieldInfo> yields,
41004101
ArrayRef<SILResultInfo> results,
4101-
Optional<SILResultInfo> errorResult);
4102+
Optional<SILResultInfo> errorResult,
4103+
Optional<ProtocolConformanceRef> conformance);
41024104

41034105
// Implement isa/cast/dyncast/etc.
41044106
static bool classof(const TypeBase *T) {

include/swift/IDE/DigesterEnums.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ NODE_KIND(DeclGetter, Getter)
4545
NODE_KIND(DeclSetter, Setter)
4646
NODE_KIND(DeclVar, Var)
4747
NODE_KIND(DeclTypeAlias, TypeAlias)
48+
NODE_KIND(DeclAssociatedType, AssociatedType)
49+
NODE_KIND(DeclSubscript, Subscript)
4850

4951
NODE_ANNOTATION(Added)
5052
NODE_ANNOTATION(Removed)
@@ -100,6 +102,7 @@ KEY(throwing)
100102
KEY(mutating)
101103
KEY(static)
102104
KEY(deprecated)
105+
KEY(protocolReq)
103106
KEY(implicit)
104107
KEY(typeAttributes)
105108
KEY(declAttributes)
@@ -111,6 +114,7 @@ KEY(conformingProtocols)
111114
KEY(enumRawTypeName)
112115
KEY(genericSig)
113116
KEY(fixedbinaryorder)
117+
KEY(hasSetter)
114118

115119
KNOWN_TYPE(Optional)
116120
KNOWN_TYPE(ImplicitlyUnwrappedOptional)

include/swift/Runtime/Atomic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// is formally UB by C++11 language rules, we should be OK because neither
2323
// the processor model nor the optimizer can realistically reorder our uses
2424
// of 'consume'.
25-
#if __arm64__ || __arm__
25+
#if defined(__arm__) || defined(_M_ARM) || defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64)
2626
# define SWIFT_MEMORY_ORDER_CONSUME (std::memory_order_relaxed)
2727
#else
2828
# define SWIFT_MEMORY_ORDER_CONSUME (std::memory_order_consume)

0 commit comments

Comments
 (0)