Skip to content

Commit 07c7f59

Browse files
committed
Merge branch 'main' of github.com:apple/swift into maxd/main-merge
# Conflicts: # stdlib/private/StdlibUnittest/RaceTest.swift # stdlib/private/SwiftPrivateThreadExtras/SwiftPrivateThreadExtras.swift # stdlib/private/SwiftPrivateThreadExtras/ThreadBarriers.swift # stdlib/public/Concurrency/ThreadSanitizer.cpp # test/stdlib/Character.swift # test/stdlib/Error.swift # test/stdlib/FloatingPoint.swift.gyb # test/stdlib/KeyPath.swift # test/stdlib/Mirror.swift # test/stdlib/NumericParsing.swift.gyb # test/stdlib/Optional.swift # test/stdlib/Repeat.swift # test/stdlib/StaticString.swift # test/stdlib/UnsafePointer.swift.gyb # test/stdlib/UnsafeRawBufferPointer.swift # test/stdlib/UnsafeRawPointer.swift
2 parents 6c41d09 + c78674f commit 07c7f59

File tree

110 files changed

+2759
-654
lines changed

Some content is hidden

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

110 files changed

+2759
-654
lines changed

cmake/modules/SwiftConfigureSDK.cmake

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ function(_report_sdk prefix)
6363
if(NOT prefix IN_LIST SWIFT_DARWIN_PLATFORMS)
6464
foreach(arch ${SWIFT_SDK_${prefix}_ARCHITECTURES})
6565
message(STATUS " ${arch} libc header path: ${SWIFT_SDK_${prefix}_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY}")
66-
message(STATUS " ${arch} libc architecture specific header path: ${SWIFT_SDK_${prefix}_ARCH_${arch}_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY}")
6766
endforeach()
6867
endif()
6968

@@ -288,7 +287,6 @@ macro(configure_sdk_unix name architectures)
288287
swift_android_sysroot(android_sysroot)
289288
set(SWIFT_SDK_ANDROID_ARCH_${arch}_PATH "${android_sysroot}")
290289
set(SWIFT_SDK_ANDROID_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY "${android_sysroot}/usr/include" CACHE STRING "Path to C library headers")
291-
set(SWIFT_SDK_ANDROID_ARCH_${arch}_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY "${android_sysroot}/usr/include" CACHE STRING "Path to C library architecture headers")
292290

293291
if("${arch}" STREQUAL "armv7")
294292
set(SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_TRIPLE "arm-linux-androideabi")
@@ -320,10 +318,8 @@ macro(configure_sdk_unix name architectures)
320318

321319
if("${prefix}" STREQUAL "HAIKU")
322320
set(SWIFT_SDK_HAIKU_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY "/system/develop/headers/posix" CACHE STRING "Path to C library headers")
323-
set(SWIFT_SDK_HAIKU_ARCH_${arch}_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY "/system/develop/headers" CACHE STRING "Path to C library architecture headers")
324321
else()
325322
set(SWIFT_SDK_${prefix}_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY "/usr/include" CACHE STRING "Path to C library headers")
326-
set(SWIFT_SDK_${prefix}_ARCH_${arch}_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY "${SWIFT_SDK_${prefix}_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY}/${CMAKE_LIBRARY_ARCHITECTURE}" CACHE STRING "Path to C library architecture headers")
327323
endif()
328324

329325
if("${prefix}" STREQUAL "LINUX")
@@ -373,7 +369,6 @@ macro(configure_sdk_unix name architectures)
373369
set(SWIFT_SDK_WASI_ARCH_wasm32_PATH "${SWIFT_WASI_SYSROOT_PATH}")
374370
set(SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasi")
375371
set(SWIFT_SDK_WASI_ARCH_wasm32_LIBC_INCLUDE_DIRECTORY "${SWIFT_WASI_SYSROOT_PATH}/include")
376-
set(SWIFT_SDK_WASI_ARCH_wasm32_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY "${SWIFT_WASI_SYSROOT_PATH}/include")
377372
else()
378373
message(FATAL_ERROR "unknown Unix OS: ${prefix}")
379374
endif()

include/swift/ABI/Executor.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ class ExecutorRef {
124124
/// Is this executor the main executor?
125125
bool isMainExecutor() const;
126126

127+
/// Get the raw value of the Implementation field, for tracing.
128+
uintptr_t getRawImplementation() { return Implementation; }
129+
127130
bool operator==(ExecutorRef other) const {
128131
return Identity == other.Identity;
129132
}

include/swift/ABI/Task.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,14 @@ class AsyncTask : public Job {
272272

273273
/// Set the task's ID field to the next task ID.
274274
void setTaskId();
275+
uint64_t getTaskId();
276+
277+
/// Get the task's resume function, for logging purposes only. This will
278+
/// attempt to see through the various adapters that are sometimes used, and
279+
/// failing that will return ResumeTask. The returned function pointer may
280+
/// have a different signature than ResumeTask, and it's only for identifying
281+
/// code associated with the task.
282+
const void *getResumeFunctionForLogging();
275283

276284
/// Given that we've already fully established the job context
277285
/// in the current thread, start running this task. To establish

include/swift/ABI/TaskStatus.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace swift {
3535
/// access by a cancelling thread. In particular, the chain of
3636
/// status records must not be disturbed. When the task leaves
3737
/// the scope that requires the status record, the record can
38-
/// be unregistered from the task with `swift_task_removeStatusRecord`,
38+
/// be unregistered from the task with `removeStatusRecord`,
3939
/// at which point the memory can be returned to the system.
4040
class TaskStatusRecord {
4141
public:
@@ -256,7 +256,7 @@ class TaskGroupTaskStatusRecord : public TaskStatusRecord {
256256
///
257257
/// The end of any call to the function will be ordered before the
258258
/// end of a call to unregister this record from the task. That is,
259-
/// code may call `swift_task_removeStatusRecord` and freely
259+
/// code may call `removeStatusRecord` and freely
260260
/// assume after it returns that this function will not be
261261
/// subsequently used.
262262
class CancellationNotificationStatusRecord : public TaskStatusRecord {
@@ -284,7 +284,7 @@ class CancellationNotificationStatusRecord : public TaskStatusRecord {
284284
///
285285
/// The end of any call to the function will be ordered before the
286286
/// end of a call to unregister this record from the task. That is,
287-
/// code may call `swift_task_removeStatusRecord` and freely
287+
/// code may call `removeStatusRecord` and freely
288288
/// assume after it returns that this function will not be
289289
/// subsequently used.
290290
class EscalationNotificationStatusRecord : public TaskStatusRecord {

include/swift/AST/DiagnosticsParse.def

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,11 @@ ERROR(enum_case_dot_prefix,none,
251251
ERROR(static_var_decl_global_scope,none,
252252
"%select{%error|static properties|class properties}0 may only be declared on a type",
253253
(StaticSpellingKind))
254-
ERROR(computed_property_no_accessors, none,
255-
"%select{computed property|subscript}0 must have accessors specified", (bool))
254+
ERROR(unexpected_curly_braces_in_decl, none,
255+
"unexpected '{' in declaration", ())
256+
ERROR(missing_accessor_return_decl,none,
257+
"missing return in %select{accessor|subscript}0 expected to return %1",
258+
(bool, TypeRepr*))
256259
ERROR(expected_getset_in_protocol,none,
257260
"expected get or set in a protocol property", ())
258261
ERROR(unexpected_getset_implementation_in_protocol,none,

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ WARNING(conditional_downcast_same_type,none,
11081108
"bridging conversion; did you mean to use 'as'?}2",
11091109
(Type, Type, unsigned))
11101110
WARNING(is_expr_same_type,none,
1111-
"checking a value with optional type %0 against dynamic type %1 "
1111+
"checking a value with optional type %0 against type %1 "
11121112
"succeeds whenever the value is non-nil; did you mean to use "
11131113
"'!= nil'?", (Type, Type))
11141114
WARNING(downcast_to_unrelated,none,

include/swift/AST/PrintOptions.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ struct PrintOptions {
128128
/// Whether to print function definitions.
129129
bool FunctionDefinitions = false;
130130

131+
/// Whether to print expressions.
132+
bool PrintExprs = false;
133+
131134
/// Whether to print '{ get set }' on readwrite computed properties.
132135
bool PrintGetSetOnRWProperties = true;
133136

@@ -644,6 +647,13 @@ struct PrintOptions {
644647
///
645648
/// This is only intended for debug output.
646649
static PrintOptions printEverything() {
650+
PrintOptions result = printDeclarations();
651+
result.FunctionDefinitions = true;
652+
result.PrintExprs = true;
653+
return result;
654+
}
655+
656+
static PrintOptions printDeclarations() {
647657
PrintOptions result = printVerbose();
648658
result.ExcludeAttrList.clear();
649659
result.ExcludeAttrList.push_back(DAK_FixedLayout);

include/swift/Frontend/FrontendOptions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ class FrontendOptions {
118118
EmitSyntax, ///< Parse and dump Syntax tree as JSON
119119
DumpAST, ///< Parse, type-check, and dump AST
120120
PrintAST, ///< Parse, type-check, and pretty-print AST
121+
PrintASTDecl, ///< Parse, type-check, and pretty-print AST declarations
121122

122123
/// Parse and dump scope map.
123124
DumpScopeMaps,

include/swift/Option/Options.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,10 @@ def print_ast : Flag<["-"], "print-ast">,
10511051
HelpText<"Parse and type-check input file(s) and pretty print AST(s)">,
10521052
ModeOpt,
10531053
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild]>;
1054+
def print_ast_decl : Flag<["-"], "print-ast-decl">,
1055+
HelpText<"Parse and type-check input file(s) and pretty print declarations from AST(s)">,
1056+
ModeOpt,
1057+
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild]>;
10541058
def dump_pcm : Flag<["-"], "dump-pcm">,
10551059
HelpText<"Dump debugging information about a precompiled Clang module">,
10561060
ModeOpt,

include/swift/Parse/Parser.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,10 +1169,9 @@ class Parser {
11691169
struct ParsedAccessors;
11701170
ParserStatus parseGetSet(ParseDeclOptions Flags,
11711171
GenericParamList *GenericParams,
1172-
ParameterList *Indices,
1172+
ParameterList *Indices, TypeRepr *ResultType,
11731173
ParsedAccessors &accessors,
1174-
AbstractStorageDecl *storage,
1175-
SourceLoc StaticLoc);
1174+
AbstractStorageDecl *storage, SourceLoc StaticLoc);
11761175
ParserResult<VarDecl> parseDeclVarGetSet(PatternBindingEntry &entry,
11771176
ParseDeclOptions Flags,
11781177
SourceLoc StaticLoc,

0 commit comments

Comments
 (0)