Skip to content

Commit 36d3b13

Browse files
Merge remote-tracking branch 'apple/main' into maxd/main-merge
2 parents 59e77cc + 4f3f68e commit 36d3b13

File tree

221 files changed

+5532
-994
lines changed

Some content is hidden

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

221 files changed

+5532
-994
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Joe Shajrawi <[email protected]> <[email protected]>
7979
8080
8181
82+
8283
8384
8485
Kevin Saldaña <[email protected]>

cmake/modules/SwiftConfigureSDK.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,9 @@ macro(configure_sdk_unix name architectures)
297297
else()
298298
message(SEND_ERROR "Couldn't find SWIFT_SDK_ANDROID_ARCH_armv7_PATH")
299299
endif()
300-
set(SWIFT_SDK_ANDROID_ARCH_${arch}_TRIPLE "armv7-none-linux-androideabi")
300+
set(SWIFT_SDK_ANDROID_ARCH_${arch}_TRIPLE "armv7-unknown-linux-androideabi")
301301
# The Android ABI isn't part of the module triple.
302-
set(SWIFT_SDK_ANDROID_ARCH_${arch}_MODULE "armv7-none-linux-android")
302+
set(SWIFT_SDK_ANDROID_ARCH_${arch}_MODULE "armv7-unknown-linux-android")
303303
elseif("${arch}" STREQUAL "aarch64")
304304
set(SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_TRIPLE "aarch64-linux-android")
305305
set(SWIFT_SDK_ANDROID_ARCH_${arch}_ALT_SPELLING "aarch64")

docs/ABI/Mangling.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,8 @@ Function Specializations
10081008
::
10091009

10101010
specialization ::= type '_' type* 'Tg' SPEC-INFO // Generic re-abstracted specialization
1011+
specialization ::= type '_' type* 'TB' SPEC-INFO // Alternative mangling for generic re-abstracted specializations,
1012+
// used for functions with re-abstracted resilient parameter types.
10111013
specialization ::= type '_' type* 'Ts' SPEC-INFO // Generic re-abstracted prespecialization
10121014
specialization ::= type '_' type* 'TG' SPEC-INFO // Generic not re-abstracted specialization
10131015
specialization ::= type '_' type* 'Ti' SPEC-INFO // Inlined function with generic substitutions.

docs/Android.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ $ NDK_PATH="path/to/android-ndk21"
103103
$ build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swiftc \ # The Swift compiler built in the previous step.
104104
# The location of the tools used to build Android binaries
105105
-tools-directory ${NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/bin/ \
106-
-target armv7a-none-linux-androideabi \ # Targeting android-armv7, and supply the path to libgcc.
106+
-target armv7a-unknown-linux-androideabi \ # Targeting android-armv7, and supply the path to libgcc.
107107
-L ${NDK_PATH}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/armv7-a \
108108
-sdk ${NDK_PATH}/platforms/android-21/arch-arm \ # Use the same architecture and API version as you used to build the stdlib in the previous step.
109109
hello.swift

include/swift/AST/ExtInfo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,7 @@ class SILExtInfo {
827827
SILExtInfo withNoEscape(bool noEscape = true) const {
828828
return builder.withNoEscape(noEscape).build();
829829
}
830+
830831

831832
SILExtInfo withAsync(bool isAsync = true) const {
832833
return builder.withAsync(isAsync).build();

include/swift/AST/IRGenOptions.h

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

141141
/// The parent async context stored within a child async context.
142142
PointerAuthSchema AsyncContextParent;
143+
144+
/// The function to call to resume running in the parent context.
145+
PointerAuthSchema AsyncContextResume;
143146
};
144147

145148
enum class JITDebugArtifact : unsigned {

include/swift/AST/TypeExpansionContext.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ class TypeExpansionContext {
8989
other.expansion == this->expansion;
9090
}
9191

92+
bool operator!=(const TypeExpansionContext &other) const {
93+
return !operator==(other);
94+
}
95+
9296
bool operator<(const TypeExpansionContext other) const {
9397
assert(other.inContext != this->inContext ||
9498
other.isContextWholeModule == this->isContextWholeModule);

include/swift/Demangling/DemangleNodes.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ NODE(GenericProtocolWitnessTableInstantiationFunction)
104104
NODE(ResilientProtocolWitnessTable)
105105
NODE(GenericSpecialization)
106106
NODE(GenericSpecializationNotReAbstracted)
107+
NODE(GenericSpecializationInResilienceDomain)
107108
NODE(GenericSpecializationParam)
108109
NODE(GenericSpecializationPrespecialized)
109110
NODE(InlinedGenericFunction)

include/swift/Driver/Compilation.h

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "swift/Basic/OutputFileMap.h"
2525
#include "swift/Basic/Statistic.h"
2626
#include "swift/Driver/Driver.h"
27+
#include "swift/Driver/FineGrainedDependencyDriverGraph.h"
2728
#include "swift/Driver/Job.h"
2829
#include "swift/Driver/Util.h"
2930
#include "llvm/ADT/StringRef.h"
@@ -78,6 +79,29 @@ using CommandSet = llvm::SmallPtrSet<const Job *, 16>;
7879

7980
class Compilation {
8081
public:
82+
struct Result {
83+
/// Set to true if any job exits abnormally (i.e. crashes).
84+
bool hadAbnormalExit;
85+
/// The exit code of this driver process.
86+
int exitCode;
87+
/// The dependency graph built up during the compilation of this module.
88+
///
89+
/// This data is used for cross-module module dependencies.
90+
fine_grained_dependencies::ModuleDepGraph depGraph;
91+
92+
Result(const Result &) = delete;
93+
Result &operator=(const Result &) = delete;
94+
95+
Result(Result &&) = default;
96+
Result &operator=(Result &&) = default;
97+
98+
/// Construct a \c Compilation::Result from just an exit code.
99+
static Result code(int code) {
100+
return Compilation::Result{false, code,
101+
fine_grained_dependencies::ModuleDepGraph()};
102+
}
103+
};
104+
81105
class IncrementalSchemeComparator {
82106
const bool EnableIncrementalBuildWhenConstructed;
83107
const bool &EnableIncrementalBuild;
@@ -490,7 +514,7 @@ class Compilation {
490514
///
491515
/// \returns result code for the Compilation's Jobs; 0 indicates success and
492516
/// -2 indicates that one of the Compilation's Jobs crashed during execution
493-
int performJobs(std::unique_ptr<sys::TaskQueue> &&TQ);
517+
Compilation::Result performJobs(std::unique_ptr<sys::TaskQueue> &&TQ);
494518

495519
/// Returns whether the callee is permitted to pass -emit-loaded-module-trace
496520
/// to a frontend job.
@@ -534,13 +558,11 @@ class Compilation {
534558
private:
535559
/// Perform all jobs.
536560
///
537-
/// \param[out] abnormalExit Set to true if any job exits abnormally (i.e.
538-
/// crashes).
539561
/// \param TQ The task queue on which jobs will be scheduled.
540562
///
541563
/// \returns exit code of the first failed Job, or 0 on success. If a Job
542564
/// crashes during execution, a negative value will be returned.
543-
int performJobsImpl(bool &abnormalExit, std::unique_ptr<sys::TaskQueue> &&TQ);
565+
Compilation::Result performJobsImpl(std::unique_ptr<sys::TaskQueue> &&TQ);
544566

545567
/// Performs a single Job by executing in place, if possible.
546568
///
@@ -550,7 +572,7 @@ class Compilation {
550572
/// will no longer exist, or it will call exit() if the program was
551573
/// successfully executed. In the event of an error, this function will return
552574
/// a negative value indicating a failure to execute.
553-
int performSingleCommand(const Job *Cmd);
575+
Compilation::Result performSingleCommand(const Job *Cmd);
554576
};
555577

556578
} // end namespace driver

include/swift/Driver/FineGrainedDependencyDriverGraph.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ class ModuleDepGraph {
188188
std::unordered_map<std::string, unsigned> dotFileSequenceNumber;
189189

190190
public:
191-
const bool verifyFineGrainedDependencyGraphAfterEveryImport;
192-
const bool emitFineGrainedDependencyDotFileAfterEveryImport;
191+
bool verifyFineGrainedDependencyGraphAfterEveryImport;
192+
bool emitFineGrainedDependencyDotFileAfterEveryImport;
193193

194194
private:
195195
/// If tracing dependencies, holds a vector used to hold the current path
@@ -203,7 +203,7 @@ class ModuleDepGraph {
203203
dependencyPathsToJobs;
204204

205205
/// For helping with performance tuning, may be null:
206-
UnifiedStatsReporter *const stats;
206+
UnifiedStatsReporter *stats;
207207

208208
//==============================================================================
209209
// MARK: ModuleDepGraph - mutating dependencies
@@ -493,7 +493,12 @@ class ModuleDepGraph {
493493

494494
template <typename Nodes>
495495
std::vector<const driver::Job *>
496-
findJobsToRecompileWhenNodesChange(const Nodes &);
496+
findJobsToRecompileWhenNodesChange(const Nodes &nodes) {
497+
std::vector<ModuleDepGraphNode *> foundDependents;
498+
for (ModuleDepGraphNode *n : nodes)
499+
findPreviouslyUntracedDependents(foundDependents, n);
500+
return jobsContaining(foundDependents);
501+
}
497502

498503
private:
499504
std::vector<const driver::Job *>

0 commit comments

Comments
 (0)