Skip to content

Commit 52a6fbf

Browse files
authored
Merge pull request #2652 from swiftwasm/main
[pull] swiftwasm from main
2 parents dfa5144 + 7a7237b commit 52a6fbf

File tree

155 files changed

+5175
-891
lines changed

Some content is hidden

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

155 files changed

+5175
-891
lines changed

.mailmap

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ Ankit Aggarwal <[email protected]> <[email protected]>
99
Argyrios Kyrtzidis <[email protected]> <[email protected]>
1010
1111
12-
12+
Becca Royal-Gordon <[email protected]> <[email protected]>
13+
Becca Royal-Gordon <[email protected]> <[email protected]>
14+
Becca Royal-Gordon <[email protected]> <[email protected]>
15+
Becca Royal-Gordon <[email protected]> <[email protected]>
1316
Ben Cohen <[email protected]>
1417
1518
@@ -81,12 +84,13 @@ John Regner <[email protected]> <[email protected]>
8184
8285
8386
84-
8587
Kevin Saldaña <[email protected]>
8688
Kim Topley <[email protected]>
8789
8890
8991
Kuba Mracek <[email protected]>
92+
93+
9094
Luiz Fernando Silva <[email protected]>
9195
9296

include/swift/ABI/MetadataValues.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ namespace SpecialPointerAuthDiscriminators {
11861186
const uint16_t EscalationNotificationFunction = 0x5be4; // = 23524
11871187

11881188
/// Swift async context parameter stored in the extended frame info.
1189-
const uint16_t SwiftAsyncContextExtendedFrameEntry = 0xc31a;
1189+
const uint16_t SwiftAsyncContextExtendedFrameEntry = 0xc31a; // = 49946
11901190
}
11911191

11921192
/// The number of arguments that will be passed directly to a generic

include/swift/AST/ASTMangler.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ class ASTMangler : public Mangler {
6868
std::function<bool (SymbolicReferent)> CanSymbolicReference;
6969

7070
bool canSymbolicReference(SymbolicReferent referent) {
71+
// Marker protocols cannot ever be symbolically referenced.
72+
if (auto nominal = referent.dyn_cast<const NominalTypeDecl *>()) {
73+
if (auto proto = dyn_cast<ProtocolDecl>(nominal)) {
74+
if (proto->isMarkerProtocol())
75+
return false;
76+
}
77+
}
78+
7179
return AllowSymbolicReferences
7280
&& (!CanSymbolicReference || CanSymbolicReference(referent));
7381
}

include/swift/AST/AbstractSourceFileDepGraphFactory.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ class AbstractSourceFileDepGraphFactory {
8787

8888
void addAUsedDecl(const DependencyKey &def, const DependencyKey &use);
8989

90+
/// Add an external dependency node to the graph. If the provided fingerprint
91+
/// is not \c None, it is added to the def key.
92+
void addAnExternalDependency(const DependencyKey &def,
93+
const DependencyKey &use,
94+
Optional<Fingerprint> dependencyFingerprint);
95+
9096
static Optional<Fingerprint>
9197
getFingerprintIfAny(std::pair<const NominalTypeDecl *, const ValueDecl *>) {
9298
return None;

include/swift/AST/Attr.def

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,12 @@ SIMPLE_DECL_ATTR(concurrent, Concurrent,
606606
APIBreakingToAdd | APIBreakingToRemove,
607607
107)
608608

609+
SIMPLE_DECL_ATTR(_marker, Marker,
610+
OnProtocol | UserInaccessible |
611+
ABIBreakingToAdd | ABIBreakingToRemove |
612+
APIBreakingToAdd | APIBreakingToRemove,
613+
108)
614+
609615
#undef TYPE_ATTR
610616
#undef DECL_ATTR_ALIAS
611617
#undef CONTEXTUAL_DECL_ATTR_ALIAS

include/swift/AST/Decl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4162,6 +4162,10 @@ class ProtocolDecl final : public NominalTypeDecl {
41624162
ProtocolRethrowsRequirementList getRethrowingRequirements() const;
41634163
bool isRethrowingProtocol() const;
41644164

4165+
/// Determine whether this is a "marker" protocol, meaning that is indicates
4166+
/// semantics but has no corresponding witness table.
4167+
bool isMarkerProtocol() const;
4168+
41654169
private:
41664170
void computeKnownProtocolKind() const;
41674171

include/swift/AST/DiagnosticsRefactoring.def

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,23 @@ WARNING(mismatched_rename, none, "the name at the given location cannot be renam
5454

5555
ERROR(no_insert_position, none, "cannot find inserting position", ())
5656

57+
ERROR(missing_callback_arg, none, "cannot refactor as callback closure argument missing", ())
58+
59+
ERROR(mismatched_callback_args, none, "cannot refactor as callback arguments do not match declaration", ())
60+
61+
ERROR(unknown_callback_conditions, none, "cannot refactor complex if conditions", ())
62+
63+
ERROR(mixed_callback_conditions, none, "cannot refactor mixed nil and not-nil conditions", ())
64+
65+
ERROR(callback_multiple_bound_names, none, "cannot refactor when multiple names bound to single declaration, had '%0' and found '%1'", (StringRef, StringRef))
66+
67+
ERROR(callback_with_fallthrough, none, "cannot refactor switch with fallthrough", ())
68+
69+
ERROR(callback_with_default, none, "cannot refactor switch with default case", ())
70+
71+
ERROR(callback_multiple_case_items, none, "cannot refactor switch using a case with multiple items", ())
72+
73+
ERROR(callback_where_case_item, none, "cannot refactor switch using a case with where clause", ())
74+
5775
#define UNDEFINE_DIAGNOSTIC_MACROS
5876
#include "DefineDiagnosticMacros.h"

include/swift/AST/DiagnosticsSema.def

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5581,6 +5581,17 @@ NOTE(result_builder_missing_build_limited_availability, none,
55815581
"expression shuffles the elements of this tuple; "
55825582
"this behavior is deprecated", ())
55835583

5584+
//------------------------------------------------------------------------------
5585+
// MARK: marker protocol diagnostics
5586+
//------------------------------------------------------------------------------
5587+
ERROR(marker_protocol_requirement, none,
5588+
"marker protocol %0 cannot have any requirements", (DeclName))
5589+
ERROR(marker_protocol_inherit_nonmarker, none,
5590+
"marker protocol %0 cannot inherit non-marker protocol %1",
5591+
(DeclName, DeclName))
5592+
ERROR(marker_protocol_value,none,
5593+
"marker protocol %0 can only be used in generic constraints", (DeclName))
5594+
55845595
//------------------------------------------------------------------------------
55855596
// MARK: differentiable programming diagnostics
55865597
//------------------------------------------------------------------------------

include/swift/AST/KnownStdlibTypes.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,6 @@ KNOWN_STDLIB_TYPE_DECL(KeyedEncodingContainer, NominalTypeDecl, 1)
9191
KNOWN_STDLIB_TYPE_DECL(KeyedDecodingContainer, NominalTypeDecl, 1)
9292
KNOWN_STDLIB_TYPE_DECL(RangeReplaceableCollection, ProtocolDecl, 1)
9393

94+
KNOWN_STDLIB_TYPE_DECL(Result, NominalTypeDecl, 2)
95+
9496
#undef KNOWN_STDLIB_TYPE_DECL

include/swift/AST/Module.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,20 @@ class ModuleDecl : public DeclContext, public TypeDecl {
734734

735735
/// Calls \p callback for each source file of the module.
736736
void collectBasicSourceFileInfo(
737-
llvm::function_ref<void(const BasicSourceFileInfo &)> callback);
737+
llvm::function_ref<void(const BasicSourceFileInfo &)> callback) const;
738+
739+
public:
740+
/// Retrieve a fingerprint value that summarizes the contents of this module.
741+
///
742+
/// This interface hash a of a module is guaranteed to change if the interface
743+
/// hash of any of its (primary) source files changes. For example, when
744+
/// building incrementally, the interface hash of this module will change when
745+
/// the primaries contributing to its content changes. In contrast, when
746+
/// a module is deserialized, the hash of every source file contributes to
747+
/// the module's interface hash. It therefore serves as an effective, if
748+
/// coarse-grained, way of determining when top-level changes to a module's
749+
/// contents have been made.
750+
Fingerprint getFingerprint() const;
738751

739752
SourceRange getSourceRange() const { return SourceRange(); }
740753

0 commit comments

Comments
 (0)