Skip to content

Resolve conflicts with upstream main #4104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 62 commits into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
f1b6217
Re-enable a test requiring an optimized stdlib to ensure we pattern m…
gottesmm Nov 1, 2021
f748c84
[Sema][MiscDiag] Fix constantness diag to handle result builder patterns
Dec 15, 2021
1947102
Change the logic for adding new task status records to a task
rokhinip Dec 17, 2021
e35eba0
Remove old addChild and detachChild stuff from files
rokhinip Dec 17, 2021
8581d1d
[Sema] Avoid misleading diagnostics for incomplete enum computed prop…
LucianoPAlmeida Dec 26, 2021
29879ea
[Parser] Improving wording for invalid empty computed properties and …
LucianoPAlmeida Dec 29, 2021
f48f3ad
[Test] Checked variable lifetimes extend self.
nate-chandler Jan 5, 2022
cb205a6
[Test] Checked variable lifetimes not extend weak.
nate-chandler Jan 5, 2022
4a45182
Implement the Indic grapheme breaking rules
Azoy Jan 6, 2022
b349f09
Ensure `SWIFT_DARWIN_PLATFORMS` is defined when loading stdlib options
edymtt Jan 6, 2022
0977920
[Concurrency] Add tracing for major operations in the concurrency run…
mikeash Oct 21, 2021
3b82dc0
[gardening] align platform checks when enabling bitcode inclusion
edymtt Jan 7, 2022
bf12625
[Sema] Downgrade to a warning public imports of an underlying private…
xymus Jan 7, 2022
12166a9
Optimize NSString->AnyHashable and String->AnyHashable
Catfish-Man Jan 8, 2022
0cf765a
[build] Remove SWIFT_SDK_${OS}_ARCH_${ARCH}_LIBC_ARCHITECTURE_INCLUDE…
finagolfin Jan 8, 2022
3f815ac
Merge pull request #40770 from xymus/public-overlays
xymus Jan 10, 2022
3d03925
Merge pull request #39378 from Catfish-Man/any-hashable-in-this-economy
Catfish-Man Jan 10, 2022
b0ed490
Merge pull request #40768 from edymtt/polish-bitcode-conditions
edymtt Jan 10, 2022
0dbcf79
ABI checker: check validity of extended nominals before continue
nkcsgexi Jan 10, 2022
b0bebcd
[move-function] Add some tests that show we can handle a defer captur…
gottesmm Jan 10, 2022
79f9a59
Merge pull request #40744 from nate-chandler/lexical_lifetimes/test/v…
nate-chandler Jan 10, 2022
24a6f37
Merge pull request #40774 from buttaface/arch
compnerd Jan 10, 2022
7a37ad3
Ensure that we set opaque type substitutions on local variables.
DougGregor Jan 10, 2022
4d18573
SILGen: Continue emitting local decls after hitting a return.
jckarter Jan 11, 2022
3df1e72
Merge pull request #40785 from nkcsgexi/87150470
nkcsgexi Jan 11, 2022
7059fea
[move-function] Make sure that we error if the user re-initializes a …
gottesmm Jan 10, 2022
967465e
Merge pull request #40579 from guitard0g/constantness-result-builders
Jan 11, 2022
81f7124
Merge pull request #40790 from DougGregor/opaque-type-local-variables
DougGregor Jan 11, 2022
91966de
Merge pull request #40705 from LucianoPAlmeida/SR-15657-diag-enum-cp
LucianoPAlmeida Jan 11, 2022
eecb741
[SwiftSyntax] Avoid linking clangAST in SwiftSyntaxParserLib build
ahoppen Jan 11, 2022
2860a0d
Merge pull request #40789 from gottesmm/pr-c08df4932418337dc441a39a68…
gottesmm Jan 11, 2022
708b81f
Merge pull request #40792 from jckarter/emit-local-decls-after-return
jckarter Jan 11, 2022
7c63b8a
Merge pull request #40756 from edymtt/add-precondition-for-swift-darw…
edymtt Jan 11, 2022
aec240e
test: add a local lit configuration for Interop
compnerd Jan 11, 2022
89af8c9
Removing unused ctx variable
etcwilde Jan 11, 2022
5023a93
Tolerate missing Sendable conformances on superclasses.
DougGregor Jan 11, 2022
e935692
Merge pull request #40070 from mikeash/concurrency-tracing
mikeash Jan 11, 2022
487b16a
Merge pull request #40005 from gottesmm/pr-596b3ad22fdb5e2e847eef3e84…
gottesmm Jan 11, 2022
6ca7366
Merge pull request #40746 from Azoy/indic-grapheme-clusters
Azoy Jan 11, 2022
77f4dfa
Merge pull request #40797 from etcwilde/ewilde/clean-csapply-warning
etcwilde Jan 11, 2022
a89ea38
[ASTPrinter] Print expressions
louisdh Dec 22, 2021
6e051cc
[ASTPrinter] Simplify call and dictionary expr printing
louisdh Dec 23, 2021
9da3746
[ASTPrinter] More expression printing
louisdh Jan 11, 2022
b20b18d
[ASTPrinter] Remove unnecessary condition
louisdh Jan 11, 2022
40266eb
[move-function] Fix _move SILGen test to match current codegen.
gottesmm Jan 11, 2022
f09752a
Merge pull request #40801 from DougGregor/missing-inherited-conformance
DougGregor Jan 11, 2022
13807f2
[ASTPrinter] Fix error for `PackExpr`
louisdh Jan 11, 2022
659e145
Propagate Pattern Arena When Allocating PackExpansionTypes
CodaFi Jan 11, 2022
55caa0d
Merge pull request #40762 from ahoppen/pr/build-clangast-for-parserlib
akyrtzi Jan 11, 2022
5da4d80
Merge pull request #40806 from gottesmm/pr-b9dc163b9dbcd71a95433388c5…
CodaFi Jan 12, 2022
4a88173
[Diagnostics][Sema] Improving wording same type is check
LucianoPAlmeida Jan 12, 2022
a1cb9bb
[AutoDiff] Move differentiable curry thunk bug reproducer to an XFAIL…
rxwei Jan 12, 2022
a4fe57f
Merge pull request #40606 from apple/rokhinip/86347801-task-creation-…
rokhinip Jan 12, 2022
f3dd7f7
Merge pull request #40808 from CodaFi/standing-room-only
xedin Jan 12, 2022
add1bbb
Merge pull request #40691 from louisdh/astprinter-expressions
hamishknight Jan 12, 2022
680698e
[Distributed] Fix `_executeDistributedFunction` resume and result buf…
xedin Jan 12, 2022
372ada0
test: add handling for Wasm/WASI (#39519)
MaxDesiatov Jan 12, 2022
3987cb2
Merge pull request #40811 from LucianoPAlmeida/minor-is-diag
LucianoPAlmeida Jan 12, 2022
ce2fe03
Merge pull request #40813 from rxwei/rid-of-requirement-machine-flag
rxwei Jan 12, 2022
c78674f
Merge pull request #40796 from compnerd/literally
compnerd Jan 12, 2022
07c7f59
Merge branch 'main' of github.com:apple/swift into maxd/main-merge
MaxDesiatov Jan 12, 2022
8dc0528
Revert "Merge pull request #40774 from buttaface/arch"
MaxDesiatov Jan 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/swift/ABI/Executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ class ExecutorRef {
/// Is this executor the main executor?
bool isMainExecutor() const;

/// Get the raw value of the Implementation field, for tracing.
uintptr_t getRawImplementation() { return Implementation; }

bool operator==(ExecutorRef other) const {
return Identity == other.Identity;
}
Expand Down
8 changes: 8 additions & 0 deletions include/swift/ABI/Task.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,14 @@ class AsyncTask : public Job {

/// Set the task's ID field to the next task ID.
void setTaskId();
uint64_t getTaskId();

/// Get the task's resume function, for logging purposes only. This will
/// attempt to see through the various adapters that are sometimes used, and
/// failing that will return ResumeTask. The returned function pointer may
/// have a different signature than ResumeTask, and it's only for identifying
/// code associated with the task.
const void *getResumeFunctionForLogging();

/// Given that we've already fully established the job context
/// in the current thread, start running this task. To establish
Expand Down
6 changes: 3 additions & 3 deletions include/swift/ABI/TaskStatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace swift {
/// access by a cancelling thread. In particular, the chain of
/// status records must not be disturbed. When the task leaves
/// the scope that requires the status record, the record can
/// be unregistered from the task with `swift_task_removeStatusRecord`,
/// be unregistered from the task with `removeStatusRecord`,
/// at which point the memory can be returned to the system.
class TaskStatusRecord {
public:
Expand Down Expand Up @@ -256,7 +256,7 @@ class TaskGroupTaskStatusRecord : public TaskStatusRecord {
///
/// The end of any call to the function will be ordered before the
/// end of a call to unregister this record from the task. That is,
/// code may call `swift_task_removeStatusRecord` and freely
/// code may call `removeStatusRecord` and freely
/// assume after it returns that this function will not be
/// subsequently used.
class CancellationNotificationStatusRecord : public TaskStatusRecord {
Expand Down Expand Up @@ -284,7 +284,7 @@ class CancellationNotificationStatusRecord : public TaskStatusRecord {
///
/// The end of any call to the function will be ordered before the
/// end of a call to unregister this record from the task. That is,
/// code may call `swift_task_removeStatusRecord` and freely
/// code may call `removeStatusRecord` and freely
/// assume after it returns that this function will not be
/// subsequently used.
class EscalationNotificationStatusRecord : public TaskStatusRecord {
Expand Down
7 changes: 5 additions & 2 deletions include/swift/AST/DiagnosticsParse.def
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,11 @@ ERROR(enum_case_dot_prefix,none,
ERROR(static_var_decl_global_scope,none,
"%select{%error|static properties|class properties}0 may only be declared on a type",
(StaticSpellingKind))
ERROR(computed_property_no_accessors, none,
"%select{computed property|subscript}0 must have accessors specified", (bool))
ERROR(unexpected_curly_braces_in_decl, none,
"unexpected '{' in declaration", ())
ERROR(missing_accessor_return_decl,none,
"missing return in %select{accessor|subscript}0 expected to return %1",
(bool, TypeRepr*))
ERROR(expected_getset_in_protocol,none,
"expected get or set in a protocol property", ())
ERROR(unexpected_getset_implementation_in_protocol,none,
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ WARNING(conditional_downcast_same_type,none,
"bridging conversion; did you mean to use 'as'?}2",
(Type, Type, unsigned))
WARNING(is_expr_same_type,none,
"checking a value with optional type %0 against dynamic type %1 "
"checking a value with optional type %0 against type %1 "
"succeeds whenever the value is non-nil; did you mean to use "
"'!= nil'?", (Type, Type))
WARNING(downcast_to_unrelated,none,
Expand Down
10 changes: 10 additions & 0 deletions include/swift/AST/PrintOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ struct PrintOptions {
/// Whether to print function definitions.
bool FunctionDefinitions = false;

/// Whether to print expressions.
bool PrintExprs = false;

/// Whether to print '{ get set }' on readwrite computed properties.
bool PrintGetSetOnRWProperties = true;

Expand Down Expand Up @@ -644,6 +647,13 @@ struct PrintOptions {
///
/// This is only intended for debug output.
static PrintOptions printEverything() {
PrintOptions result = printDeclarations();
result.FunctionDefinitions = true;
result.PrintExprs = true;
return result;
}

static PrintOptions printDeclarations() {
PrintOptions result = printVerbose();
result.ExcludeAttrList.clear();
result.ExcludeAttrList.push_back(DAK_FixedLayout);
Expand Down
1 change: 1 addition & 0 deletions include/swift/Frontend/FrontendOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class FrontendOptions {
EmitSyntax, ///< Parse and dump Syntax tree as JSON
DumpAST, ///< Parse, type-check, and dump AST
PrintAST, ///< Parse, type-check, and pretty-print AST
PrintASTDecl, ///< Parse, type-check, and pretty-print AST declarations

/// Parse and dump scope map.
DumpScopeMaps,
Expand Down
4 changes: 4 additions & 0 deletions include/swift/Option/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,10 @@ def print_ast : Flag<["-"], "print-ast">,
HelpText<"Parse and type-check input file(s) and pretty print AST(s)">,
ModeOpt,
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild]>;
def print_ast_decl : Flag<["-"], "print-ast-decl">,
HelpText<"Parse and type-check input file(s) and pretty print declarations from AST(s)">,
ModeOpt,
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild]>;
def dump_pcm : Flag<["-"], "dump-pcm">,
HelpText<"Dump debugging information about a precompiled Clang module">,
ModeOpt,
Expand Down
5 changes: 2 additions & 3 deletions include/swift/Parse/Parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -1169,10 +1169,9 @@ class Parser {
struct ParsedAccessors;
ParserStatus parseGetSet(ParseDeclOptions Flags,
GenericParamList *GenericParams,
ParameterList *Indices,
ParameterList *Indices, TypeRepr *ResultType,
ParsedAccessors &accessors,
AbstractStorageDecl *storage,
SourceLoc StaticLoc);
AbstractStorageDecl *storage, SourceLoc StaticLoc);
ParserResult<VarDecl> parseDeclVarGetSet(PatternBindingEntry &entry,
ParseDeclOptions Flags,
SourceLoc StaticLoc,
Expand Down
48 changes: 1 addition & 47 deletions include/swift/Runtime/Concurrency.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#ifndef SWIFT_RUNTIME_CONCURRENCY_H
#define SWIFT_RUNTIME_CONCURRENCY_H

#include "swift/ABI/AsyncLet.h"
#include "swift/ABI/Task.h"
#include "swift/ABI/TaskGroup.h"
#include "swift/ABI/AsyncLet.h"
#include "swift/ABI/TaskStatus.h"

#pragma clang diagnostic push
Expand Down Expand Up @@ -466,40 +466,6 @@ void swift_asyncLet_consume_throwing(SWIFT_ASYNC_CONTEXT AsyncContext *,
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
bool swift_taskGroup_hasTaskGroupRecord();

/// Add a status record to a task. The record should not be
/// modified while it is registered with a task.
///
/// This must be called synchronously with the task.
///
/// If the task is already cancelled, returns `false` but still adds
/// the status record.
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
bool swift_task_addStatusRecord(TaskStatusRecord *record);

/// Add a status record to a task if the task has not already
/// been cancelled. The record should not be modified while it is
/// registered with a task.
///
/// This must be called synchronously with the task.
///
/// If the task is already cancelled, returns `false` and does not
/// add the status record.
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
bool swift_task_tryAddStatusRecord(TaskStatusRecord *record);

/// Remove a status record from a task. After this call returns,
/// the record's memory can be freely modified or deallocated.
///
/// This must be called synchronously with the task. The record must
/// be registered with the task or else this may crash.
///
/// The given record need not be the last record added to
/// the task, but the operation may be less efficient if not.
///
/// Returns false if the task has been cancelled.
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
bool swift_task_removeStatusRecord(TaskStatusRecord *record);

/// Signifies whether the current task is in the middle of executing the
/// operation block of a `with(Throwing)TaskGroup(...) { <operation> }`.
///
Expand All @@ -509,18 +475,6 @@ bool swift_task_removeStatusRecord(TaskStatusRecord *record);
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
bool swift_task_hasTaskGroupStatusRecord();

/// Attach a child task to its parent task and return the newly created
/// `ChildTaskStatusRecord`.
///
/// The record must be removed with by the parent invoking
/// `swift_task_detachChild` when the child has completed.
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
ChildTaskStatusRecord* swift_task_attachChild(AsyncTask *child);

/// Remove a child task from the parent tracking it.
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
void swift_task_detachChild(ChildTaskStatusRecord *record);

SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
size_t swift_task_getJobFlags(AsyncTask* task);

Expand Down
9 changes: 5 additions & 4 deletions lib/APIDigester/ModuleAnalyzerNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1906,10 +1906,11 @@ void SwiftDeclCollector::lookupVisibleDecls(ArrayRef<ModuleDecl *> Modules) {
for (auto *D: KnownDecls) {
if (auto *Ext = dyn_cast<ExtensionDecl>(D)) {
if (HandledExtensions.find(Ext) == HandledExtensions.end()) {
auto *NTD = Ext->getExtendedNominal();
// Check if the extension is from other modules.
if (!llvm::is_contained(Modules, NTD->getModuleContext())) {
ExtensionMap[NTD].push_back(Ext);
if (auto *NTD = Ext->getExtendedNominal()) {
// Check if the extension is from other modules.
if (!llvm::is_contained(Modules, NTD->getModuleContext())) {
ExtensionMap[NTD].push_back(Ext);
}
}
}
}
Expand Down
13 changes: 9 additions & 4 deletions lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ struct ASTContext::Implementation {
llvm::FoldingSet<TypeAliasType> TypeAliasTypes;
llvm::FoldingSet<TupleType> TupleTypes;
llvm::FoldingSet<PackType> PackTypes;
llvm::FoldingSet<PackExpansionType> PackExpansionTypes;
llvm::DenseMap<llvm::PointerIntPair<TypeBase*, 3, unsigned>,
MetatypeType*> MetatypeTypes;
llvm::DenseMap<llvm::PointerIntPair<TypeBase*, 3, unsigned>,
Expand Down Expand Up @@ -471,7 +472,6 @@ struct ASTContext::Implementation {
llvm::FoldingSet<SILBoxType> SILBoxTypes;
llvm::DenseMap<BuiltinIntegerWidth, BuiltinIntegerType*> IntegerTypes;
llvm::FoldingSet<BuiltinVectorType> BuiltinVectorTypes;
llvm::FoldingSet<PackExpansionType> PackExpansionTypes;
llvm::FoldingSet<DeclName::CompoundDeclName> CompoundNames;
llvm::DenseMap<UUID, OpenedArchetypeType *> OpenedExistentialArchetypes;
llvm::FoldingSet<IndexSubset> IndexSubsets;
Expand Down Expand Up @@ -2960,20 +2960,25 @@ Type TupleTypeElt::getType() const {
PackExpansionType *PackExpansionType::get(Type patternTy) {
assert(patternTy && "Missing pattern type in expansion");

auto properties = patternTy->getRecursiveProperties();
auto arena = getArena(properties);

auto &context = patternTy->getASTContext();
llvm::FoldingSetNodeID id;
PackExpansionType::Profile(id, patternTy);

void *insertPos;
if (PackExpansionType *expType =
context.getImpl().PackExpansionTypes.FindNodeOrInsertPos(id,
insertPos))
context.getImpl()
.getArena(arena)
.PackExpansionTypes.FindNodeOrInsertPos(id, insertPos))
return expType;

const ASTContext *canCtx = patternTy->isCanonical() ? &context : nullptr;
PackExpansionType *expansionTy = new (context, AllocationArena::Permanent)
PackExpansionType(patternTy, canCtx);
context.getImpl().PackExpansionTypes.InsertNode(expansionTy, insertPos);
context.getImpl().getArena(arena).PackExpansionTypes.InsertNode(expansionTy,
insertPos);
return expansionTy;
}

Expand Down
Loading