Skip to content

Commit 9b4e20f

Browse files
Merge pull request #5299 from swiftwasm/main
[pull] swiftwasm from main
2 parents ff334d2 + 69a1311 commit 9b4e20f

File tree

143 files changed

+4276
-1656
lines changed

Some content is hidden

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

143 files changed

+4276
-1656
lines changed

docs/SIL.rst

Lines changed: 527 additions & 17 deletions
Large diffs are not rendered by default.

include/swift/ABI/MetadataValues.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,6 +1442,9 @@ namespace SpecialPointerAuthDiscriminators {
14421442

14431443
/// C type StoreExtraInhabitantTag function descriminator
14441444
const uint16_t StoreExtraInhabitantTagFunction = 0x9bf6; // = 39926
1445+
1446+
// Relative protocol witness table descriminator
1447+
const uint16_t RelativeProtocolWitnessTable = 0xb830; // = 47152
14451448
}
14461449

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

include/swift/AST/ASTDemangler.h

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,16 @@ namespace Demangle {
3737
SWIFT_BEGIN_INLINE_NAMESPACE
3838

3939
Type getTypeForMangling(ASTContext &ctx,
40-
llvm::StringRef mangling);
40+
llvm::StringRef mangling,
41+
GenericSignature genericSig=GenericSignature());
4142

4243
TypeDecl *getTypeDeclForMangling(ASTContext &ctx,
43-
llvm::StringRef mangling);
44+
llvm::StringRef mangling,
45+
GenericSignature genericSig=GenericSignature());
4446

4547
TypeDecl *getTypeDeclForUSR(ASTContext &ctx,
46-
llvm::StringRef usr);
48+
llvm::StringRef usr,
49+
GenericSignature genericSig=GenericSignature());
4750

4851
/// An implementation of MetadataReader's BuilderType concept that
4952
/// just finds and builds things in the AST.
@@ -55,6 +58,11 @@ class ASTBuilder {
5558
/// Created lazily.
5659
DeclContext *NotionalDC = nullptr;
5760

61+
/// The generic signature for interpreting type parameters. This is used
62+
/// because the mangling for a type parameter doesn't record whether it
63+
/// is a pack or not, so we have to find it here.
64+
GenericSignature GenericSig;
65+
5866
public:
5967
using BuiltType = swift::Type;
6068
using BuiltTypeDecl = swift::GenericTypeDecl *; // nominal or type alias
@@ -66,7 +74,8 @@ class ASTBuilder {
6674

6775
static constexpr bool needsToPrecomputeParentGenericContextShapes = false;
6876

69-
explicit ASTBuilder(ASTContext &ctx) : Ctx(ctx) {}
77+
explicit ASTBuilder(ASTContext &ctx, GenericSignature genericSig)
78+
: Ctx(ctx), GenericSig(genericSig) {}
7079

7180
ASTContext &getASTContext() { return Ctx; }
7281
DeclContext *getNotionalDC();
@@ -102,6 +111,12 @@ class ASTBuilder {
102111

103112
Type createTupleType(ArrayRef<Type> eltTypes, StringRef labels);
104113

114+
Type createPackType(ArrayRef<Type> eltTypes);
115+
116+
Type createSILPackType(ArrayRef<Type> eltTypes, bool isElementAddress);
117+
118+
Type createPackExpansionType(Type patternType, Type countType);
119+
105120
Type createFunctionType(
106121
ArrayRef<Demangle::FunctionParam<Type>> params,
107122
Type output, FunctionTypeFlags flags,

include/swift/AST/DiagnosticsSIL.def

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -760,12 +760,11 @@ ERROR(sil_moveonlychecker_notconsumable_but_assignable_was_consumed_global_var,
760760
ERROR(sil_moveonlychecker_notconsumable_but_assignable_was_consumed_global_let, none,
761761
"'%0' was consumed but it is illegal to consume a noncopyable global let. One can only read from it",
762762
(StringRef))
763-
ERROR(sil_moveonlychecker_notconsumable_but_assignable_was_consumed_escaping_let, none,
764-
"'%0' was consumed but it is illegal to consume a noncopyable escaping immutable capture. One can only read from it",
765-
(StringRef))
766763
ERROR(sil_moveonlychecker_notconsumable_but_assignable_was_consumed_escaping_var, none,
767-
"'%0' was consumed but it is illegal to consume a noncopyable escaping mutable capture. One can only read from it or assign over it",
764+
"'%0' was consumed but it is illegal to consume a noncopyable mutable capture of an escaping closure. One can only read from it or assign over it",
768765
(StringRef))
766+
ERROR(sil_moveonlychecker_let_capture_consumed, none,
767+
"'%0' was consumed but it is illegal to consume a noncopyable immutable capture of an escaping closure. One can only read from it", (StringRef))
769768

770769
NOTE(sil_moveonlychecker_moveonly_field_consumed_here, none,
771770
"move only field consumed here", ())

include/swift/AST/DiagnosticsSema.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3893,6 +3893,9 @@ ERROR(optional_used_as_boolean,none,
38933893
ERROR(integer_used_as_boolean,none,
38943894
"type %0 cannot be used as a boolean; "
38953895
"test for '%select{!|=}1= 0' instead", (Type, bool))
3896+
ERROR(integer_used_as_boolean_literal,none,
3897+
"integer literal value '%0' cannot be used as a boolean; "
3898+
"did you mean '%select{false|true}1'?", (StringRef, bool))
38963899

38973900
ERROR(interpolation_missing_proto,none,
38983901
"string interpolation requires the protocol 'ExpressibleByStringInterpolation' to be defined",

include/swift/AST/IRGenOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ struct PointerAuthOptions : clang::PointerAuthOptions {
204204

205205
/// C type StoreExtraInhabitantTag function descriminator.
206206
PointerAuthSchema StoreExtraInhabitantTagFunction;
207+
208+
/// Relative protocol witness table descriminator.
209+
PointerAuthSchema RelativeProtocolWitnessTable;
207210
};
208211

209212
enum class JITDebugArtifact : unsigned {

include/swift/AST/SemanticAttrs.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,9 @@ SEMANTICS_ATTR(LIFETIMEMANAGEMENT_COPY, "lifetimemanagement.copy")
120120

121121
SEMANTICS_ATTR(NO_PERFORMANCE_ANALYSIS, "no_performance_analysis")
122122

123+
// A flag used to turn off moveonly diagnostics on functions that allocbox to
124+
// stack specialized.
125+
SEMANTICS_ATTR(NO_MOVEONLY_DIAGNOSTICS, "sil.optimizer.moveonly.diagnostic.ignore")
126+
123127
#undef SEMANTICS_ATTR
124128

include/swift/AST/TypeCheckRequests.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3181,16 +3181,16 @@ void simple_display(llvm::raw_ostream &out,
31813181
/// Resolve a given custom attribute to an attached macro declaration.
31823182
class ResolveMacroRequest
31833183
: public SimpleRequest<ResolveMacroRequest,
3184-
MacroDecl *(UnresolvedMacroReference,
3185-
DeclContext *),
3184+
ConcreteDeclRef(UnresolvedMacroReference,
3185+
DeclContext *),
31863186
RequestFlags::Cached> {
31873187
public:
31883188
using SimpleRequest::SimpleRequest;
31893189

31903190
private:
31913191
friend SimpleRequest;
31923192

3193-
MacroDecl *
3193+
ConcreteDeclRef
31943194
evaluate(Evaluator &evaluator, UnresolvedMacroReference macroRef,
31953195
DeclContext *dc) const;
31963196

include/swift/AST/TypeCheckerTypeIDZone.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ SWIFT_REQUEST(TypeChecker, ResolveImplicitMemberRequest,
341341
evaluator::SideEffect(NominalTypeDecl *, ImplicitMemberAction),
342342
Uncached, NoLocationInfo)
343343
SWIFT_REQUEST(TypeChecker, ResolveMacroRequest,
344-
MacroDecl *(CustomAttr *, DeclContext *),
344+
ConcreteDeclRef(UnresolvedMacroReference, DeclContext *),
345345
Cached, NoLocationInfo)
346346
SWIFT_REQUEST(TypeChecker, ResolveTypeEraserTypeRequest,
347347
Type(ProtocolDecl *, TypeEraserAttr *),

include/swift/Basic/LangOptions.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ namespace swift {
331331
bool UseMalloc = false;
332332

333333
/// Specifies how strict concurrency checking will be.
334-
StrictConcurrency StrictConcurrencyLevel = StrictConcurrency::Targeted;
334+
StrictConcurrency StrictConcurrencyLevel = StrictConcurrency::Minimal;
335335

336336
/// Enable experimental concurrency model.
337337
bool EnableExperimentalConcurrency = false;
@@ -532,6 +532,9 @@ namespace swift {
532532
/// The model of concurrency to be used.
533533
ConcurrencyModel ActiveConcurrencyModel = ConcurrencyModel::Standard;
534534

535+
/// Allows the explicit 'import Builtin' within Swift modules.
536+
bool EnableBuiltinModule = false;
537+
535538
bool isConcurrencyModelTaskToThread() const {
536539
return ActiveConcurrencyModel == ConcurrencyModel::TaskToThread;
537540
}

0 commit comments

Comments
 (0)