Skip to content

Commit 2bb9c8f

Browse files
authored
Merge pull request #2225 from swiftwasm/main
[pull] swiftwasm from main
2 parents 902461e + 5f3ac71 commit 2bb9c8f

File tree

116 files changed

+1094
-6002
lines changed

Some content is hidden

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

116 files changed

+1094
-6002
lines changed

docs/SIL.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5894,6 +5894,25 @@ This instruction is assumed to forward a fixed ownership (set upon its
58945894
construction) and lowers to 'unchecked_bitwise_cast' in non-ossa code. This
58955895
causes the cast to lose its guarantee of layout-compatibility.
58965896

5897+
unchecked_ownership_conversion
5898+
``````````````````````````````
5899+
::
5900+
5901+
sil-instruction ::= 'unchecked_ownership_conversion' sil-operand ',' sil-value-ownership-kind 'to' sil-value-ownership-kind
5902+
5903+
%1 = unchecked_ownership_conversion %0 : $A, @guaranteed to @owned
5904+
5905+
Converts its operand to an identical value of the same type but with
5906+
different ownership without performing any semantic operations
5907+
normally required by for ownership conversion.
5908+
5909+
This is used in Objective-C compatible destructors to convert a
5910+
guaranteed parameter to an owned parameter without performing a
5911+
semantic copy.
5912+
5913+
The resulting value must meet the usual ownership requirements; for
5914+
example, a trivial type must have '.none' ownership.
5915+
58975916
ref_to_raw_pointer
58985917
``````````````````
58995918
::

include/swift/AST/Builtins.def

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,15 @@ BUILTIN_MISC_OPERATION_WITH_SILGEN(CancelAsyncTask, "cancelAsyncTask", "", Speci
736736
/// a function to execute.
737737
BUILTIN_MISC_OPERATION_WITH_SILGEN(CreateAsyncTask, "createAsyncTask", "", Special)
738738

739+
/// createAsyncTaskFuture(): (
740+
/// Int, Builtin.NativeObject?, @escaping () async throws -> T
741+
/// ) -> Builtin.NativeObject
742+
///
743+
/// Create a new asynchronous task future, given flags, an (optional) parent
744+
/// task and a function to execute.
745+
BUILTIN_MISC_OPERATION_WITH_SILGEN(CreateAsyncTaskFuture,
746+
"createAsyncTaskFuture", "", Special)
747+
739748
/// globalStringTablePointer has type String -> Builtin.RawPointer.
740749
/// It returns an immortal, global string table pointer for strings constructed
741750
/// from string literals. We consider it effects as readnone meaning that it

include/swift/AST/DiagnosticsFrontend.def

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ ERROR(error_mode_cannot_emit_interface,none,
128128
ERROR(error_mode_cannot_emit_module_summary,none,
129129
"this mode does not support emitting module summary files", ())
130130
ERROR(cannot_emit_ir_skipping_function_bodies,none,
131-
"-experimental-skip-*-function-bodies do not support emitting IR", ())
131+
"the -experimental-skip-*-function-bodies* flags do not support "
132+
"emitting IR", ())
132133

133134
WARNING(emit_reference_dependencies_without_primary_file,none,
134135
"ignoring -emit-reference-dependencies (requires -primary-file)", ())
@@ -415,9 +416,9 @@ ERROR(expectation_missing_opening_braces,none,
415416
ERROR(expectation_missing_closing_braces,none,
416417
"didn't find '}}' to match '{{' in expectation", ())
417418

418-
WARNING(module_incompatible_with_skip_non_inlinable_function_bodies,none,
419-
"module '%0' cannot be built with "
420-
"-experimental-skip-non-inlinable-function-bodies; this option has "
419+
WARNING(module_incompatible_with_skip_function_bodies,none,
420+
"module '%0' cannot be built with any of the "
421+
"-experimental-skip-*-function-bodies* flags; they have "
421422
"been automatically disabled", (StringRef))
422423

423424
#define UNDEFINE_DIAGNOSTIC_MACROS

include/swift/AST/GenericParamList.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ class GenericParamList final :
324324
if (WhereLoc.isInvalid())
325325
return SourceRange();
326326

327+
if (Requirements.empty())
328+
return WhereLoc;
329+
327330
auto endLoc = Requirements.back().getSourceRange().End;
328331
return SourceRange(WhereLoc, endLoc);
329332
}
@@ -352,16 +355,18 @@ class alignas(RequirementRepr) TrailingWhereClause final :
352355
friend TrailingObjects;
353356

354357
SourceLoc WhereLoc;
358+
SourceLoc EndLoc;
355359

356360
/// The number of requirements. The actual requirements are tail-allocated.
357361
unsigned NumRequirements;
358362

359-
TrailingWhereClause(SourceLoc whereLoc,
363+
TrailingWhereClause(SourceLoc whereLoc, SourceLoc endLoc,
360364
ArrayRef<RequirementRepr> requirements);
361365

362366
public:
363367
/// Create a new trailing where clause with the given set of requirements.
364-
static TrailingWhereClause *create(ASTContext &ctx, SourceLoc whereLoc,
368+
static TrailingWhereClause *create(ASTContext &ctx,
369+
SourceLoc whereLoc, SourceLoc endLoc,
365370
ArrayRef<RequirementRepr> requirements);
366371

367372
/// Retrieve the location of the 'where' keyword.
@@ -379,8 +384,7 @@ class alignas(RequirementRepr) TrailingWhereClause final :
379384

380385
/// Compute the source range containing this trailing where clause.
381386
SourceRange getSourceRange() const {
382-
return SourceRange(WhereLoc,
383-
getRequirements().back().getSourceRange().End);
387+
return SourceRange(WhereLoc, EndLoc);
384388
}
385389

386390
void print(llvm::raw_ostream &OS, bool printWhereKeyword) const;

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,6 @@ namespace swift {
258258
/// This is a staging flag; eventually it will be removed.
259259
bool EnableDeserializationRecovery = true;
260260

261-
/// Someday, ASTScopeLookup will supplant lookup in the parser
262-
bool DisableParserLookup = false;
263-
264261
/// Whether to enable the new operator decl and precedencegroup lookup
265262
/// behavior. This is a staging flag, and will be removed in the future.
266263
bool EnableNewOperatorLookup = false;

0 commit comments

Comments
 (0)