Skip to content

Commit bb1e5d7

Browse files
authored
Merge branch 'main' into dispatch-less
2 parents c9f5676 + 67f978b commit bb1e5d7

File tree

310 files changed

+1226
-908
lines changed

Some content is hidden

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

310 files changed

+1226
-908
lines changed

include/swift/AST/Attr.def

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ SIMPLE_DECL_ATTR(_specializeExtension, SpecializeExtension,
593593
105)
594594

595595
CONTEXTUAL_SIMPLE_DECL_ATTR(async, Async,
596-
DeclModifier | OnVar | OnFunc | ConcurrencyOnly |
596+
DeclModifier | OnVar | OnFunc |
597597
ABIBreakingToAdd | ABIBreakingToRemove |
598598
APIBreakingToAdd | APIBreakingToRemove,
599599
106)
@@ -653,11 +653,7 @@ SIMPLE_DECL_ATTR(_inheritActorContext, InheritActorContext,
653653
ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIBreakingToRemove,
654654
116)
655655

656-
CONTEXTUAL_SIMPLE_DECL_ATTR(spawn, Spawn,
657-
DeclModifier | OnVar | ConcurrencyOnly |
658-
ABIBreakingToAdd | ABIBreakingToRemove |
659-
APIBreakingToAdd | APIBreakingToRemove,
660-
117)
656+
// 117 was 'spawn' and is now unused
661657

662658
CONTEXTUAL_SIMPLE_DECL_ATTR(distributed, DistributedActor,
663659
DeclModifier | OnClass | OnFunc |

include/swift/AST/Module.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,6 @@ class ModuleDecl : public DeclContext, public TypeDecl {
774774
void collectBasicSourceFileInfo(
775775
llvm::function_ref<void(const BasicSourceFileInfo &)> callback) const;
776776

777-
public:
778777
/// Retrieve a fingerprint value that summarizes the contents of this module.
779778
///
780779
/// This interface hash a of a module is guaranteed to change if the interface
@@ -787,6 +786,15 @@ class ModuleDecl : public DeclContext, public TypeDecl {
787786
/// contents have been made.
788787
Fingerprint getFingerprint() const;
789788

789+
/// Returns an approximation of whether the given module could be
790+
/// redistributed and consumed by external clients.
791+
///
792+
/// FIXME: The scope of this computation should be limited entirely to
793+
/// RenamedDeclRequest. Unfortunately, it has been co-opted to support the
794+
/// \c SerializeOptionsForDebugging hack. Once this information can be
795+
/// transferred from module files to the dSYMs, remove this.
796+
bool isExternallyConsumed() const;
797+
790798
SourceRange getSourceRange() const { return SourceRange(); }
791799

792800
static bool classof(const DeclContext *DC) {

include/swift/AST/TypeCheckRequests.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3003,6 +3003,23 @@ class AsyncAlternativeRequest
30033003
bool isCached() const { return true; }
30043004
};
30053005

3006+
class RenamedDeclRequest
3007+
: public SimpleRequest<RenamedDeclRequest,
3008+
ValueDecl *(const ValueDecl *, const AvailableAttr *),
3009+
RequestFlags::Cached> {
3010+
public:
3011+
using SimpleRequest::SimpleRequest;
3012+
3013+
private:
3014+
friend SimpleRequest;
3015+
3016+
ValueDecl *evaluate(Evaluator &evaluator, const ValueDecl *attached,
3017+
const AvailableAttr *attr) const;
3018+
3019+
public:
3020+
bool isCached() const { return true; }
3021+
};
3022+
30063023
void simple_display(llvm::raw_ostream &out, Type value);
30073024
void simple_display(llvm::raw_ostream &out, const TypeRepr *TyR);
30083025
void simple_display(llvm::raw_ostream &out, ImplicitMemberAction action);

include/swift/AST/TypeCheckerTypeIDZone.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,3 +334,6 @@ SWIFT_REQUEST(TypeChecker, GetImplicitSendableRequest,
334334
SWIFT_REQUEST(TypeChecker, AsyncAlternativeRequest,
335335
AbstractFunctionDecl *(AbstractFunctionDecl *),
336336
Cached, NoLocationInfo)
337+
SWIFT_REQUEST(TypeChecker, RenamedDeclRequest,
338+
ValueDecl *(const ValueDecl *),
339+
Cached, NoLocationInfo)

include/swift/Frontend/Frontend.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -403,15 +403,6 @@ class CompilerInvocation {
403403
SerializationOptions
404404
computeSerializationOptions(const SupplementaryOutputPaths &outs,
405405
const ModuleDecl *module) const;
406-
407-
/// Returns an approximation of whether the given module could be
408-
/// redistributed and consumed by external clients.
409-
///
410-
/// FIXME: The scope of this computation should be limited entirely to
411-
/// PrintAsObjC. Unfortunately, it has been co-opted to support the
412-
/// \c SerializeOptionsForDebugging hack. Once this information can be
413-
/// transferred from module files to the dSYMs, remove this.
414-
bool isModuleExternallyConsumed(const ModuleDecl *mod) const;
415406
};
416407

417408
/// A class which manages the state and execution of the compiler.

include/swift/PrintAsObjC/PrintAsObjC.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ namespace swift {
2525
/// header.
2626
///
2727
/// Returns true on error.
28-
bool printAsObjC(raw_ostream &out, ModuleDecl *M, StringRef bridgingHeader,
29-
AccessLevel minRequiredAccess);
28+
bool printAsObjC(raw_ostream &out, ModuleDecl *M, StringRef bridgingHeader);
3029
}
3130

3231
#endif

include/swift/Runtime/Exclusivity.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,6 @@ SWIFT_RUNTIME_EXPORT
4040
void swift_beginAccess(void *pointer, ValueBuffer *buffer,
4141
ExclusivityFlags flags, void *pc);
4242

43-
/// Loads the replacement function pointer from \p ReplFnPtr and returns the
44-
/// replacement function if it should be called.
45-
/// Returns null if the original function (which is passed in \p CurrFn) should
46-
/// be called.
47-
#ifdef __APPLE__
48-
__attribute__((weak_import))
49-
#endif
50-
SWIFT_RUNTIME_EXPORT
51-
char *swift_getFunctionReplacement(char **ReplFnPtr, char *CurrFn);
52-
53-
/// Returns the original function of a replaced function, which is loaded from
54-
/// \p OrigFnPtr.
55-
/// This function is called from a replacement function to call the original
56-
/// function.
57-
#ifdef __APPLE__
58-
__attribute__((weak_import))
59-
#endif
60-
SWIFT_RUNTIME_EXPORT
61-
char *swift_getOrigOfReplaceable(char **OrigFnPtr);
6243

6344
/// Stop dynamically tracking an access.
6445
SWIFT_RUNTIME_EXPORT
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
//===--- FunctionReplacement.h --------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
#ifndef SWIFT_RUNTIME_FUNCTIONREPLACEMENT_H
14+
#define SWIFT_RUNTIME_FUNCTIONREPLACEMENT_H
15+
16+
#include "swift/Runtime/Config.h"
17+
18+
namespace swift {
19+
20+
/// Loads the replacement function pointer from \p ReplFnPtr and returns the
21+
/// replacement function if it should be called.
22+
/// Returns null if the original function (which is passed in \p CurrFn) should
23+
/// be called.
24+
#ifdef __APPLE__
25+
__attribute__((weak_import))
26+
#endif
27+
SWIFT_RUNTIME_EXPORT char *
28+
swift_getFunctionReplacement(char **ReplFnPtr, char *CurrFn);
29+
30+
/// Returns the original function of a replaced function, which is loaded from
31+
/// \p OrigFnPtr.
32+
/// This function is called from a replacement function to call the original
33+
/// function.
34+
#ifdef __APPLE__
35+
__attribute__((weak_import))
36+
#endif
37+
SWIFT_RUNTIME_EXPORT char *
38+
swift_getOrigOfReplaceable(char **OrigFnPtr);
39+
40+
} // namespace swift
41+
42+
#endif

include/swift/SIL/AbstractionPattern.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,13 @@ class AbstractionPattern {
13781378
/// Swift type.
13791379
AbstractionPattern getObjCMethodAsyncCompletionHandlerType(
13801380
CanType swiftCompletionHandlerType) const;
1381+
1382+
/// If this pattern refers to a foreign ObjC method that was imported as
1383+
/// async, return the bridged-back-to-ObjC completion handler type.
1384+
CanType getObjCMethodAsyncCompletionHandlerForeignType(
1385+
ForeignAsyncConvention convention,
1386+
Lowering::TypeConverter &TC
1387+
) const;
13811388

13821389
void dump() const LLVM_ATTRIBUTE_USED;
13831390
void print(raw_ostream &OS) const;

lib/AST/Decl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5994,7 +5994,7 @@ bool VarDecl::isMemberwiseInitialized(bool preferDeclaredProperties) const {
59945994
}
59955995

59965996
bool VarDecl::isAsyncLet() const {
5997-
return getAttrs().hasAttribute<AsyncAttr>() || getAttrs().hasAttribute<SpawnAttr>();
5997+
return getAttrs().hasAttribute<AsyncAttr>();
59985998
}
59995999

60006000
void ParamDecl::setSpecifier(Specifier specifier) {

0 commit comments

Comments
 (0)