Skip to content

Commit 0046550

Browse files
committed
Merge branch 'master' into RemoveRedundantBufferZeroingNSStringAPI
2 parents 45661f6 + a7d5733 commit 0046550

File tree

121 files changed

+2174
-555
lines changed

Some content is hidden

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

121 files changed

+2174
-555
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
| **macOS** | x86_64 |[![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-osx/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-incremental-RA-osx)|[![Build Status](https://ci.swift.org/job/oss-swift-package-osx/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-osx)|
99
| **Ubuntu 16.04** | x86_64 | [![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-16_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-16_04)|[![Build Status](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-16_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-16_04)|
1010
| **Ubuntu 18.04** | x86_64 | [![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-18_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-18_04)|[![Build Status](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-18_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-18_04)|
11+
| **Ubuntu 20.04** | x86_64 | [![Build Status](https://ci.swift.org/job/oss-swift-package-ubuntu-20_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-ubuntu-20_04)|[![Build Status](https://ci.swift.org/job/oss-swift-package-ubuntu-20_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-ubuntu-20_04)|
12+
| **CentOS 8** | x86_64 | [![Build Status](https://ci.swift.org/job/oss-swift-package-centos-8/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-centos-8)|[![Build Status](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-18_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-centos-8)|
13+
| **Amazon Linux 2** | x86_64 | [![Build Status](https://ci.swift.org/job/oss-swift-package-amazon-linux-2/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-amazon-linux-2)|[![Build Status](https://ci.swift.org/job/oss-swift-package-amazon-linux-2/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-amazon-linux-2)|
1114

1215
**Swift Community-Hosted CI Platforms**
1316

cmake/modules/AddSwift.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,13 +348,11 @@ function(_add_host_variant_link_flags target)
348348
${CMAKE_BINARY_DIR}/winsdk_lib_${SWIFT_HOST_VARIANT_ARCH}_symlinks)
349349
elseif(SWIFT_HOST_VARIANT_SDK STREQUAL HAIKU)
350350
target_link_libraries(${target} PRIVATE
351-
atomic
352351
bsd)
353352
target_link_options(${target} PRIVATE
354353
"SHELL:-Xlinker -Bsymbolic")
355354
elseif(SWIFT_HOST_VARIANT_SDK STREQUAL ANDROID)
356355
target_link_libraries(${target} PRIVATE
357-
atomic
358356
dl
359357
log
360358
# We need to add the math library, which is linked implicitly by libc++

docs/ContinuousIntegration.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ macOS platform | @swift-ci Please smoke benchmark | S
9292
Linux platform | @swift-ci Please test Linux platform | Swift Test Linux Platform (smoke test)<br>Swift Test Linux Platform
9393
Linux platform | @swift-ci Please clean test Linux platform | Swift Test Linux Platform (smoke test)<br>Swift Test Linux Platform
9494
macOS platform | @swift-ci Please ASAN test | Swift ASAN Test OS X Platform
95+
Ubuntu 20.04 | @swift-ci Please test Ubuntu 20.04 platform | Swift Test Ubuntu 20.04 Platform
96+
CentOS 8 | @swift-ci Please test CentOS 8 platform | Swift Test CentOS 8 Platform
97+
Amazon Linux 2 | @swift-ci Please test Amazon Linux 2 platform | Swift Test Amazon Linux 2 Platform
9598

9699
The core principles of validation testing is that:
97100

include/swift/AST/ASTContext.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ namespace swift {
121121
class UnifiedStatsReporter;
122122
class IndexSubset;
123123
struct SILAutoDiffDerivativeFunctionKey;
124+
struct SubASTContextDelegate;
124125

125126
enum class KnownProtocolKind : uint8_t;
126127

@@ -719,7 +720,8 @@ class ASTContext final {
719720
Optional<ModuleDependencies> getModuleDependencies(
720721
StringRef moduleName,
721722
bool isUnderlyingClangModule,
722-
ModuleDependenciesCache &cache);
723+
ModuleDependenciesCache &cache,
724+
SubASTContextDelegate &delegate);
723725

724726
/// Load extensions to the given nominal type from the external
725727
/// module loaders.

include/swift/AST/DiagnosticsSema.def

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3054,6 +3054,18 @@ ERROR(derivative_attr_original_already_has_derivative,none,
30543054
"a derivative already exists for %0", (DeclName))
30553055
NOTE(derivative_attr_duplicate_note,none,
30563056
"other attribute declared here", ())
3057+
ERROR(derivative_attr_access_level_mismatch,none,
3058+
"derivative function must have same access level as original function; "
3059+
"derivative function %2 is "
3060+
"%select{private|fileprivate|internal|public|open}3, "
3061+
"but original function %0 is "
3062+
"%select{private|fileprivate|internal|public|open}1",
3063+
(/*original*/ DeclName, /*original*/ AccessLevel,
3064+
/*derivative*/ DeclName, /*derivative*/ AccessLevel))
3065+
NOTE(derivative_attr_fix_access,none,
3066+
"mark the derivative function as "
3067+
"'%select{private|fileprivate|internal|@usableFromInline|@usableFromInline}0' "
3068+
"to match the original function", (AccessLevel))
30573069

30583070
// @transpose
30593071
ERROR(transpose_attr_invalid_linearity_parameter_or_result,none,

include/swift/AST/Evaluator.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ class Evaluator {
245245
/// diagnostics through the given diagnostics engine.
246246
Evaluator(DiagnosticEngine &diags,
247247
bool debugDumpCycles,
248-
bool buildDependencyGraph);
248+
bool buildDependencyGraph,
249+
bool enableExperimentalPrivateDeps);
249250

250251
/// Emit GraphViz output visualizing the request graph.
251252
void emitRequestEvaluatorGraphViz(llvm::StringRef graphVizPath);

include/swift/AST/EvaluatorDependencies.h

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,22 @@ struct DependencyCollector {
113113
llvm::SmallVector<evaluator::DependencySource, 8> dependencySources;
114114

115115
public:
116-
DependencyCollector() = default;
116+
enum class Mode {
117+
// Enables the current "status quo" behavior of the dependency collector.
118+
//
119+
// By default, the dependency collector moves to register dependencies in
120+
// the referenced name trackers at the top of the active dependency stack.
121+
StatusQuo,
122+
// Enables an experimental mode to only register private dependencies.
123+
//
124+
// This mode restricts the dependency collector to ignore changes of
125+
// scope. This has practical effect of charging all unqualified lookups to
126+
// the primary file being acted upon instead of to the destination file.
127+
ExperimentalPrivateDependencies,
128+
};
129+
Mode mode;
130+
131+
explicit DependencyCollector(Mode mode) : mode{mode} {};
117132

118133
public:
119134
/// Registers a named reference from the current dependency scope to a member
@@ -206,19 +221,43 @@ struct DependencyCollector {
206221
};
207222

208223
private:
224+
/// Returns the first dependency source registered with the tracker, or
225+
/// \c nullptr if no dependency sources have been registered.
226+
SourceFile *getFirstDependencySourceOrNull() const {
227+
if (dependencySources.empty())
228+
return nullptr;
229+
return dependencySources.front().getPointer();
230+
}
231+
209232
/// If there is an active dependency source, returns its
210233
/// \c ReferencedNameTracker. Else, returns \c nullptr.
211234
ReferencedNameTracker *getActiveDependencyTracker() const {
212-
if (auto *source = getActiveDependencySourceOrNull())
213-
return source->getRequestBasedReferencedNameTracker();
214-
return nullptr;
235+
SourceFile *source = nullptr;
236+
switch (mode) {
237+
case Mode::StatusQuo:
238+
source = getActiveDependencySourceOrNull();
239+
break;
240+
case Mode::ExperimentalPrivateDependencies:
241+
source = getFirstDependencySourceOrNull();
242+
break;
243+
}
244+
245+
if (!source)
246+
return nullptr;
247+
248+
return source->getRequestBasedReferencedNameTracker();
215249
}
216250

217251
/// Returns \c true if the scope of the current active source cascades.
218252
///
219253
/// If there is no active scope, the result always cascades.
220254
bool isActiveSourceCascading() const {
221-
return getActiveSourceScope() == evaluator::DependencyScope::Cascading;
255+
switch (mode) {
256+
case Mode::StatusQuo:
257+
return getActiveSourceScope() == evaluator::DependencyScope::Cascading;
258+
case Mode::ExperimentalPrivateDependencies:
259+
return false;
260+
}
222261
}
223262
};
224263
} // end namespace evaluator

include/swift/AST/ModuleLoader.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "llvm/ADT/SmallSet.h"
2626
#include "llvm/ADT/StringSet.h"
2727
#include "llvm/ADT/TinyPtrVector.h"
28+
#include "swift/AST/ModuleDependencies.h"
2829

2930
namespace llvm {
3031
class FileCollector;
@@ -84,6 +85,15 @@ class DependencyTracker {
8485
std::shared_ptr<clang::DependencyCollector> getClangCollector();
8586
};
8687

88+
/// Abstract interface to run an action in a sub ASTContext.
89+
struct SubASTContextDelegate {
90+
virtual bool runInSubContext(ASTContext &ctx, StringRef interfacePath,
91+
llvm::function_ref<bool(ASTContext&)> action) {
92+
llvm_unreachable("function should be overriden");
93+
}
94+
virtual ~SubASTContextDelegate() = default;
95+
};
96+
8797
/// Abstract interface that loads named modules into the AST.
8898
class ModuleLoader {
8999
virtual void anchor();
@@ -186,7 +196,7 @@ class ModuleLoader {
186196
/// if no such module exists.
187197
virtual Optional<ModuleDependencies> getModuleDependencies(
188198
StringRef moduleName,
189-
ModuleDependenciesCache &cache) = 0;
199+
ModuleDependenciesCache &cache, SubASTContextDelegate &delegate) = 0;
190200
};
191201

192202
} // namespace swift

include/swift/Basic/LangOptions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,10 @@ namespace swift {
357357
/// conformances.
358358
bool EnableExperimentalAdditiveArithmeticDerivedConformances = false;
359359

360+
/// Whether to enable a more aggressive mode of incremental dependency
361+
/// gathering that never captures cascading edges.
362+
bool EnableExperientalPrivateIntransitiveDependencies = false;
363+
360364
/// Enable verification when every SubstitutionMap is constructed.
361365
bool VerifyAllSubstitutionMaps = false;
362366

include/swift/ClangImporter/ClangImporter.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,8 @@ class ClangImporter final : public ClangModuleLoader {
370370
void verifyAllModules() override;
371371

372372
Optional<ModuleDependencies> getModuleDependencies(
373-
StringRef moduleName, ModuleDependenciesCache &cache) override;
373+
StringRef moduleName, ModuleDependenciesCache &cache,
374+
SubASTContextDelegate &delegate) override;
374375

375376
/// Add dependency information for the bridging header.
376377
///

0 commit comments

Comments
 (0)