Skip to content

Commit 315fb7a

Browse files
authored
Merge pull request #2197 from swiftwasm/main
[pull] swiftwasm from main
2 parents 46a447a + 515dc39 commit 315fb7a

File tree

157 files changed

+2560
-1416
lines changed

Some content is hidden

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

157 files changed

+2560
-1416
lines changed

include/swift/AST/Decl.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6509,6 +6509,13 @@ class ConstructorDecl : public AbstractFunctionDecl {
65096509
GenericParamList *GenericParams,
65106510
DeclContext *Parent);
65116511

6512+
static ConstructorDecl *
6513+
createImported(ASTContext &ctx, ClangNode clangNode, DeclName name,
6514+
SourceLoc constructorLoc, bool failable,
6515+
SourceLoc failabilityLoc, bool throws, SourceLoc throwsLoc,
6516+
ParameterList *bodyParams, GenericParamList *genericParams,
6517+
DeclContext *parent);
6518+
65126519
SourceLoc getConstructorLoc() const { return getNameLoc(); }
65136520
SourceLoc getStartLoc() const { return getConstructorLoc(); }
65146521
SourceRange getSourceRange() const;

include/swift/AST/DiagnosticsSema.def

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,10 +1554,13 @@ ERROR(observingprop_requires_initializer,none,
15541554
"non-member observing properties require an initializer", ())
15551555
ERROR(global_requires_initializer,none,
15561556
"global '%select{var|let}0' declaration requires an initializer expression"
1557-
"%select{ or getter/setter specifier|}0", (bool))
1557+
"%select{ or an explicitly stated getter|}0", (bool))
15581558
ERROR(static_requires_initializer,none,
1559-
"%select{ERROR|'static var'|'class var'|}0 declaration requires an initializer "
1560-
"expression or getter/setter specifier", (StaticSpellingKind))
1559+
"'%select{ERROR|static|class|}0 %select{var|let}1' declaration requires "
1560+
"an initializer expression or an explicitly stated getter",
1561+
(StaticSpellingKind, bool))
1562+
NOTE(static_requires_initializer_add_init,none,
1563+
"add an initializer to silence this error", ())
15611564
ERROR(pattern_type_access,none,
15621565
"%select{%select{variable|constant}0|property}1 "
15631566
"%select{must be declared %select{"

include/swift/Runtime/Concurrent.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,8 @@ template <class ElemTy> struct ConcurrentReadableArray {
508508
}
509509

510510
void push_back(const ElemTy &elem) {
511-
ScopedLock guard(WriterLock);
512-
511+
Mutex::ScopedLock guard(WriterLock);
512+
513513
auto *storage = Elements.load(std::memory_order_relaxed);
514514
auto count = storage ? storage->Count.load(std::memory_order_relaxed) : 0;
515515
if (count >= Capacity) {
@@ -594,9 +594,6 @@ struct ConcurrentReadableHashMap {
594594
"Elements must not have destructors (they won't be called).");
595595

596596
private:
597-
// A scoped lock type to use on MutexTy.
598-
using ScopedLockTy = ScopedLockT<MutexTy, false>;
599-
600597
/// The reciprocal of the load factor at which we expand the table. A value of
601598
/// 4 means that we resize at 1/4 = 75% load factor.
602599
static const size_t ResizeProportion = 4;
@@ -1043,7 +1040,7 @@ struct ConcurrentReadableHashMap {
10431040
/// The return value is ignored when `created` is `false`.
10441041
template <class KeyTy, typename Call>
10451042
void getOrInsert(KeyTy key, const Call &call) {
1046-
ScopedLockTy guard(WriterLock);
1043+
typename MutexTy::ScopedLock guard(WriterLock);
10471044

10481045
auto indices = IndexStorage{Indices.load(std::memory_order_relaxed)};
10491046
auto indicesCapacityLog2 = indices.getCapacityLog2();
@@ -1092,7 +1089,7 @@ struct ConcurrentReadableHashMap {
10921089
/// Clear the hash table, freeing (when safe) all memory currently used for
10931090
/// indices and elements.
10941091
void clear() {
1095-
ScopedLockTy guard(WriterLock);
1092+
typename MutexTy::ScopedLock guard(WriterLock);
10961093

10971094
IndexStorage indices = Indices.load(std::memory_order_relaxed);
10981095
auto *elements = Elements.load(std::memory_order_relaxed);

0 commit comments

Comments
 (0)