Skip to content

Commit 6766336

Browse files
committed
Merge remote-tracking branch 'apple/swift-5.0-branch' into 5.0-branch-abi-checker
2 parents eaefa75 + 25034af commit 6766336

File tree

200 files changed

+4350
-3120
lines changed

Some content is hidden

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

200 files changed

+4350
-3120
lines changed

docs/ABI/Mangling.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,9 @@ Property behaviors are implemented using private protocol conformances.
633633
::
634634

635635
concrete-protocol-conformance ::= type protocol-conformance-ref any-protocol-conformance-list 'HC'
636-
protocol-conformance-ref ::= protocol module? 'HP'
636+
protocol-conformance-ref ::= protocol 'HP' // same module as conforming type
637+
protocol-conformance-ref ::= protocol 'Hp' // same module as protocol
638+
protocol-conformance-ref ::= protocol module // "retroactive"
637639

638640
any-protocol-conformance ::= concrete-protocol-conformance
639641
any-protocol-conformance ::= dependent-protocol-conformance
@@ -651,10 +653,13 @@ Property behaviors are implemented using private protocol conformances.
651653
dependent-associated-conformance ::= type protocol
652654

653655
A compact representation used to represent mangled protocol conformance witness
654-
arguments at runtime. The ``module`` is only specified for conformances that are
655-
"retroactive", meaning that the context in which the conformance is defined is
656-
in neither the protocol or type module. The concrete protocol conformances that
657-
follow are for the conditional conformance requirements.
656+
arguments at runtime. The ``module`` is only specified for conformances that
657+
are "retroactive", meaning that the context in which the conformance is defined
658+
is in neither the protocol or type module. For a non-retroactive conformance
659+
where both the type *and* the protocol are in the same module, or for
660+
synthesized conformances that have no owning module, the "HP" operator is
661+
preferred. The concrete protocol conformances that follow are for the
662+
conditional conformance requirements.
658663

659664
Dependent protocol conformances mangle the access path required to extract a
660665
protocol conformance from some conformance passed into the environment. The

include/swift/AST/DiagnosticsSema.def

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,11 +1700,11 @@ ERROR(type_witness_not_accessible_type,none,
17001700
"matches a requirement in protocol %3",
17011701
(DescriptiveDeclKind, DeclName, AccessLevel, DeclName))
17021702
ERROR(witness_not_usable_from_inline,none,
1703-
"%0 %1 must be declared '@usableFromInline' because "
1703+
"%0 %1 must be declared '@usableFromInline' "
17041704
"because it matches a requirement in protocol %2",
17051705
(DescriptiveDeclKind, DeclName, DeclName))
17061706
WARNING(witness_not_usable_from_inline_warn,none,
1707-
"%0 %1 should be declared '@usableFromInline' because "
1707+
"%0 %1 should be declared '@usableFromInline' "
17081708
"because it matches a requirement in protocol %2",
17091709
(DescriptiveDeclKind, DeclName, DeclName))
17101710
ERROR(type_witness_objc_generic_parameter,none,
@@ -3942,6 +3942,10 @@ ERROR(dynamic_replacement_function_not_found, none,
39423942
"replaced function %0 could not be found", (DeclName))
39433943
ERROR(dynamic_replacement_accessor_not_found, none,
39443944
"replaced accessor for %0 could not be found", (DeclName))
3945+
ERROR(dynamic_replacement_accessor_ambiguous, none,
3946+
"replaced accessor for %0 occurs in multiple places", (DeclName))
3947+
NOTE(dynamic_replacement_accessor_ambiguous_candidate, none,
3948+
"candidate accessor found in module %0", (DeclName))
39453949
ERROR(dynamic_replacement_function_of_type_not_found, none,
39463950
"replaced function %0 of type %1 could not be found", (DeclName, Type))
39473951
NOTE(dynamic_replacement_found_function_of_type, none,
@@ -4276,6 +4280,10 @@ WARNING(non_exhaustive_switch_warn,none, "switch must be exhaustive", ())
42764280
WARNING(override_nsobject_hashvalue,none,
42774281
"override of 'NSObject.hashValue' is deprecated; "
42784282
"override 'NSObject.hash' to get consistent hashing behavior", ())
4283+
WARNING(hashvalue_implementation,none,
4284+
"'Hashable.hashValue' is deprecated as a protocol requirement; "
4285+
"conform type %0 to 'Hashable' by implementing 'hash(into:)' instead",
4286+
(Type))
42794287

42804288
#ifndef DIAG_NO_UNDEF
42814289
# if defined(DIAG)

include/swift/AST/KnownIdentifiers.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ IDENTIFIER(appendInterpolation)
175175
IDENTIFIER_WITH_NAME(dollarInterpolation, "$interpolation")
176176
IDENTIFIER(arrayLiteral)
177177
IDENTIFIER(dictionaryLiteral)
178-
IDENTIFIER_(getBuiltinLogicValue)
179178
IDENTIFIER(className)
180179

181180
IDENTIFIER_(ErrorType)

include/swift/Demangling/DemangleNodes.def

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ NODE(PropertyDescriptor)
156156
CONTEXT_NODE(Protocol)
157157
CONTEXT_NODE(ProtocolSymbolicReference)
158158
NODE(ProtocolConformance)
159-
NODE(ProtocolConformanceRef)
159+
NODE(ProtocolConformanceRefInTypeModule)
160+
NODE(ProtocolConformanceRefInProtocolModule)
161+
NODE(ProtocolConformanceRefInOtherModule)
160162
NODE(ProtocolDescriptor)
161163
NODE(ProtocolConformanceDescriptor)
162164
NODE(ProtocolList)

include/swift/Demangling/Demangler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ class Demangler : public NodeFactory {
458458
NodePointer getDependentGenericParamType(int depth, int index);
459459
NodePointer demangleGenericParamIndex();
460460
NodePointer popProtocolConformance();
461-
NodePointer demangleProtocolConformanceRef();
461+
NodePointer demangleRetroactiveProtocolConformanceRef();
462462
NodePointer popAnyProtocolConformance();
463463
NodePointer demangleConcreteProtocolConformance();
464464
NodePointer popDependentProtocolConformance();

include/swift/Demangling/TypeDecoder.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,15 @@ class TypeDecoder {
163163
case NodeKind::BoundGenericClass:
164164
{
165165
#if SWIFT_OBJC_INTEROP
166-
if (Node->getNumChildren() == 2)
167-
if (auto mangledName = getObjCClassOrProtocolName(Node->getChild(0)))
166+
if (Node->getNumChildren() >= 2) {
167+
auto ChildNode = Node->getChild(0);
168+
if (ChildNode->getKind() == NodeKind::Type &&
169+
ChildNode->getNumChildren() > 0)
170+
ChildNode = ChildNode->getChild(0);
171+
172+
if (auto mangledName = getObjCClassOrProtocolName(ChildNode))
168173
return Builder.createObjCClassType(mangledName->str());
174+
}
169175
#endif
170176
LLVM_FALLTHROUGH;
171177
}

include/swift/IDE/Utils.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,13 +598,16 @@ enum class LabelRangeEndAt: int8_t {
598598
struct CallArgInfo {
599599
Expr *ArgExp;
600600
CharSourceRange LabelRange;
601+
bool IsTrailingClosure;
601602
CharSourceRange getEntireCharRange(const SourceManager &SM) const;
602603
};
603604

604605
std::vector<CallArgInfo>
605606
getCallArgInfo(SourceManager &SM, Expr *Arg, LabelRangeEndAt EndKind);
606607

607608
// Get the ranges of argument labels from an Arg, either tuple or paren.
609+
// This includes empty ranges for any unlabelled arguments, and excludes
610+
// trailing closures.
608611
std::vector<CharSourceRange>
609612
getCallArgLabelRanges(SourceManager &SM, Expr *Arg, LabelRangeEndAt EndKind);
610613

include/swift/Parse/Parser.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,8 +1333,7 @@ class Parser {
13331333
ParserResult<Expr> parseExprCallSuffix(ParserResult<Expr> fn,
13341334
bool isExprBasic);
13351335
ParserResult<Expr> parseExprCollection();
1336-
ParserResult<Expr> parseExprArray(SourceLoc LSquareLoc);
1337-
ParserResult<Expr> parseExprDictionary(SourceLoc LSquareLoc);
1336+
ParserResult<Expr> parseExprCollectionElement(Optional<bool> &isDictionary);
13381337
ParserResult<Expr> parseExprPoundAssert();
13391338
ParserResult<Expr> parseExprPoundUnknown(SourceLoc LSquareLoc);
13401339
ParserResult<Expr>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// This file is processed by CMake.
2+
// See https://cmake.org/cmake/help/v3.0/command/configure_file.html.
3+
4+
#ifndef SWIFT_RUNTIME_CMAKECONFIG_H
5+
6+
#cmakedefine01 SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT
7+
8+
#endif

include/swift/Runtime/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
configure_file(CMakeConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/CMakeConfig.h
2+
ESCAPE_QUOTES @ONLY)

0 commit comments

Comments
 (0)