Skip to content

Commit 310bc36

Browse files
Merge remote-tracking branch 'apple/main' into katei/merge-main-2021-02-03
2 parents 7e5373a + bb0c6b3 commit 310bc36

File tree

231 files changed

+3017
-1247
lines changed

Some content is hidden

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

231 files changed

+3017
-1247
lines changed

cmake/modules/SwiftSharedCMakeConfig.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ macro(swift_common_standalone_build_config_llvm product)
9797
endif()
9898
endif()
9999

100+
if(LLVM_ENABLE_ZLIB)
101+
find_package(ZLIB REQUIRED)
102+
endif()
103+
100104
include(AddLLVM)
101105
include(AddSwiftTableGen) # This imports TableGen from LLVM.
102106
include(HandleLLVMOptions)

docs/Testing.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,16 @@ For every target above, there are variants for different optimizations:
199199
* the target with ``-optimize`` suffix (e.g., ``check-swift-optimize``) -- runs
200200
execution tests in ``-O`` mode. This target will only run tests marked as
201201
``executable_test``.
202-
* the target with ``-optimize-unchecked`` suffix (e.g.,
203-
``check-swift-optimize-unchecked``) -- runs execution tests in
202+
* the target with ``-optimize_unchecked`` suffix (e.g.,
203+
``check-swift-optimize_unchecked``) -- runs execution tests in
204204
``-Ounchecked`` mode. This target will only run tests marked as
205205
``executable_test``.
206-
* the target with ``-executable`` suffix (e.g.,
207-
``check-swift-executable-iphoneos-arm64``) -- runs tests marked with
208-
``executable_test`` in ``-Onone`` mode.
209-
* the target with ``-non-executable`` suffix (e.g.,
210-
``check-swift-non-executable-iphoneos-arm64``) -- runs tests not marked with
206+
* the target with ``-only_executable`` suffix (e.g.,
207+
``check-swift-only_executable-iphoneos-arm64``) -- runs tests marked with
211208
``executable_test`` in ``-Onone`` mode.
209+
* the target with ``-only_non_executable`` suffix (e.g.,
210+
``check-swift-only_non_executable-iphoneos-arm64``) -- runs tests not marked
211+
with ``executable_test`` in ``-Onone`` mode.
212212
213213
### Writing tests
214214

include/swift/ABI/TrailingObjects.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
#define SWIFT_ABI_TRAILINGOBJECTS_H
5757

5858
#include "llvm/Support/Alignment.h"
59-
#include "llvm/Support/AlignOf.h"
6059
#include "llvm/Support/Compiler.h"
6160
#include "llvm/Support/MathExtras.h"
6261
#include "llvm/Support/type_traits.h"

include/swift/AST/DiagnosticsSema.def

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4169,8 +4169,8 @@ ERROR(actor_isolated_objc,none,
41694169
"actor-isolated %0 %1 cannot be @objc",
41704170
(DescriptiveDeclKind, DeclName))
41714171
NOTE(protocol_witness_async_conflict,none,
4172-
"candidate is %select{not |}0'async', but protocol requirement is%select{| not}0",
4173-
(bool))
4172+
"candidate is %select{not |}0'async', but%select{| @objc}1 protocol requirement is%select{| not}0",
4173+
(bool, bool))
41744174
ERROR(async_autoclosure_nonasync_function,none,
41754175
"'async' autoclosure parameter in a non-'async' function", ())
41764176

@@ -4218,9 +4218,6 @@ ERROR(objc_ambiguous_async_convention,none,
42184218
NOTE(objc_ambiguous_async_convention_candidate,none,
42194219
"%0 provides async here", (DeclName))
42204220

4221-
ERROR(satisfy_async_objc,none,
4222-
"satisfying an asychronous @objc %select{method|initializer}0 with "
4223-
"a synchronous %select{method|initializer}0 is not supported", (bool))
42244221
ERROR(async_objc_dynamic_self,none,
42254222
"asynchronous method returning 'Self' cannot be '@objc'", ())
42264223

include/swift/AST/FineGrainedDependencyFormat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#ifndef SWIFT_AST_FINEGRAINEDDEPENDENCYFORMAT_H
1414
#define SWIFT_AST_FINEGRAINEDDEPENDENCYFORMAT_H
1515

16-
#include "llvm/Bitcode/RecordLayout.h"
16+
#include "llvm/Bitcode/BitcodeConvenience.h"
1717
#include "llvm/Bitstream/BitCodes.h"
1818

1919
namespace llvm {

include/swift/Basic/AnyValue.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ namespace llvm {
3030
return hash_value(ptr.getOpaqueValue());
3131
}
3232

33-
// FIXME: Belongs in LLVM itself
34-
template<typename T>
35-
hash_code hash_value(const llvm::Optional<T> &opt) {
36-
if (!opt)
37-
return 1;
38-
return hash_value(*opt);
39-
}
40-
4133
template<typename T>
4234
bool operator==(const TinyPtrVector<T> &lhs, const TinyPtrVector<T> &rhs) {
4335
if (lhs.size() != rhs.size())

include/swift/Basic/DiagnosticOptions.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ class DiagnosticOptions {
4141
/// Indicates whether diagnostic passes should be skipped.
4242
bool SkipDiagnosticPasses = false;
4343

44+
/// Additional non-source files which will have diagnostics emitted in them,
45+
/// and which should be scanned for expectations by the diagnostic verifier.
46+
std::vector<std::string> AdditionalVerifierFiles;
47+
4448
/// Keep emitting subsequent diagnostics after a fatal error.
4549
bool ShowDiagnosticsAfterFatalError = false;
4650

@@ -54,22 +58,23 @@ class DiagnosticOptions {
5458
/// Treat all warnings as errors
5559
bool WarningsAsErrors = false;
5660

57-
// When printing diagnostics, include the diagnostic name at the end
61+
/// When printing diagnostics, include the diagnostic name (diag::whatever) at
62+
/// the end.
5863
bool PrintDiagnosticNames = false;
5964

6065
/// If set to true, include educational notes in printed output if available.
6166
/// Educational notes are documentation which supplement diagnostics.
6267
bool PrintEducationalNotes = false;
6368

64-
// If set to true, use the more descriptive experimental formatting style for
65-
// diagnostics.
69+
/// Whether to emit diagnostics in the terse LLVM style or in a more
70+
/// descriptive style that's specific to Swift (currently experimental).
6671
FormattingStyle PrintedFormattingStyle = FormattingStyle::LLVM;
6772

6873
std::string DiagnosticDocumentationPath = "";
6974

7075
std::string LocalizationCode = "";
7176

72-
// Diagnostic messages directory path.
77+
/// Path to a directory of diagnostic localization tables.
7378
std::string LocalizationPath = "";
7479

7580
/// Return a hash code of any components from these options that should

include/swift/ClangImporter/SwiftAbstractBasicWriter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ class DataStreamBasicWriter
4444
public:
4545
using super::asImpl;
4646

47+
DataStreamBasicWriter(clang::ASTContext &ctx) : super(ctx) {}
48+
4749
/// Perform all the calls necessary to write out the given type.
4850
void writeTypeRef(const clang::Type *type) {
4951
asImpl().writeUInt64(uint64_t(type->getTypeClass()));

include/swift/Driver/Action.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ class StaticLinkJobAction : public JobAction {
397397
};
398398

399399
class VerifyModuleInterfaceJobAction : public JobAction {
400-
virtual void anchor();
400+
virtual void anchor() override;
401401
file_types::ID inputType;
402402

403403
public:

include/swift/Frontend/DiagnosticVerifier.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class DiagnosticVerifier : public DiagnosticConsumer {
6565
SourceManager &SM;
6666
std::vector<CapturedDiagnosticInfo> CapturedDiagnostics;
6767
ArrayRef<unsigned> BufferIDs;
68+
SmallVector<unsigned, 4> AdditionalBufferIDs;
6869
bool AutoApplyFixes;
6970
bool IgnoreUnknown;
7071

@@ -74,6 +75,10 @@ class DiagnosticVerifier : public DiagnosticConsumer {
7475
: SM(SM), BufferIDs(BufferIDs), AutoApplyFixes(AutoApplyFixes),
7576
IgnoreUnknown(IgnoreUnknown) {}
7677

78+
void appendAdditionalBufferID(unsigned bufferID) {
79+
AdditionalBufferIDs.push_back(bufferID);
80+
}
81+
7782
virtual void handleDiagnostic(SourceManager &SM,
7883
const DiagnosticInfo &Info) override;
7984

0 commit comments

Comments
 (0)