Skip to content

Commit e6a7176

Browse files
committed
---
yaml --- r: 335743 b: refs/heads/rxwei-patch-1 c: 65d8d29 h: refs/heads/master i: 335741: 0af4fd2 335739: 902957e 335735: 37cf94d 335727: 5023812 335711: 50dd15a 335679: e8ddc03 335615: 5c1b079
1 parent a8978e7 commit e6a7176

File tree

238 files changed

+1069
-2315
lines changed

Some content is hidden

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

238 files changed

+1069
-2315
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
10151015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
10161016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
10171017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018-
refs/heads/rxwei-patch-1: 697675b6a3b5a829cb4ecfc94a6b12ecfe8eca2c
1018+
refs/heads/rxwei-patch-1: 65d8d29d2a1b4778097101c3aed1b1df963d3441
10191019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
10201020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
10211021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9

branches/rxwei-patch-1/CHANGELOG.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,6 @@ Swift 5.1
9999
foo(0) // prints "Any" in Swift < 5.1, "T" in Swift 5.1
100100
```
101101

102-
* [SE-0245][]:
103-
104-
`Array` and `ContiguousArray` now have `init(unsafeUninitializedCapacity:initializingWith:)`,
105-
which provides access to the array's uninitialized storage.
106-
107102
**Add new entries to the top of this section, not here!**
108103

109104
Swift 5.0
@@ -7511,7 +7506,6 @@ Swift 1.0
75117506
[SE-0228]: <https://github.com/apple/swift-evolution/blob/master/proposals/0228-fix-expressiblebystringinterpolation.md>
75127507
[SE-0230]: <https://github.com/apple/swift-evolution/blob/master/proposals/0230-flatten-optional-try.md>
75137508
[SE-0235]: <https://github.com/apple/swift-evolution/blob/master/proposals/0235-add-result.md>
7514-
[SE-0245]: <https://github.com/apple/swift-evolution/blob/master/proposals/0245-array-uninitialized-initializer.md>
75157509

75167510
[SR-106]: <https://bugs.swift.org/browse/SR-106>
75177511
[SR-419]: <https://bugs.swift.org/browse/SR-419>

branches/rxwei-patch-1/CMakeLists.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -883,11 +883,12 @@ find_package(PythonInterp REQUIRED)
883883
# Find optional dependencies.
884884
#
885885

886-
if(LLVM_ENABLE_LIBXML2)
887-
find_package(Libxml2 REQUIRED)
888-
else()
889-
find_package(LibXml2)
890-
endif()
886+
# Find libxml.
887+
# FIXME: unify with CLANG_HAVE_LIBXML, which is set in LLVM anyway.
888+
find_package(LibXml2)
889+
option(SWIFT_HAVE_LIBXML
890+
"Whether to build with libxml"
891+
${LIBXML2_FOUND})
891892

892893
# You need libedit linked in order to check if you have el_wgets.
893894
cmake_push_check_state()

branches/rxwei-patch-1/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ To read the compiler documentation, start by installing the
297297
[Sphinx](http://sphinx-doc.org) documentation generator tool by running the
298298
command:
299299

300-
easy_install -U "Sphinx < 2.0"
300+
easy_install -U Sphinx
301301

302302
Once complete, you can build the Swift documentation by changing directory into
303303
[docs](https://github.com/apple/swift/tree/master/docs) and typing `make`. This

branches/rxwei-patch-1/benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ function (swift_benchmark_compile_archopts)
314314

315315
set(common_options
316316
"-c"
317+
"-Xfrontend" "-verify-sil-ownership"
317318
"-target" "${target}"
318319
"-${BENCH_COMPILE_ARCHOPTS_OPT}" ${PAGE_ALIGNMENT_OPTION})
319320

@@ -343,6 +344,7 @@ function (swift_benchmark_compile_archopts)
343344

344345
set(common_options_driver
345346
"-c"
347+
"-Xfrontend" "-verify-sil-ownership"
346348
"-target" "${target}"
347349
"-${driver_opt}")
348350

branches/rxwei-patch-1/cmake/modules/SwiftSource.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ function(_compile_swift_files
236236
endif()
237237

238238
if(SWIFTFILE_IS_STDLIB)
239+
list(APPEND swift_flags "-Xfrontend" "-verify-sil-ownership")
239240
list(APPEND swift_flags "-Xfrontend" "-enable-mandatory-semantic-arc-opts")
240241
endif()
241242

branches/rxwei-patch-1/docs/WindowsBuild.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ cmake -G Ninja^
125125
-DLLVM_ENABLE_ASSERTIONS=ON^
126126
-DLLVM_ENABLE_PDB=YES^
127127
-DLLVM_ENABLE_PROJECTS=clang^
128-
-DLLVM_TARGETS_TO_BUILD="AArch64;ARM;X86"^
128+
-DLLVM_TARGETS_TO_BUILD=X86^
129129
S:/llvm
130130
popd
131131
cmake --build "S:\b\llvm"
@@ -208,7 +208,7 @@ cmake -G Ninja^
208208
-DLLDB_PATH_TO_LLVM_BUILD="S:\b\llvm"^
209209
-DLLDB_PATH_TO_SWIFT_BUILD="S:\b\swift"^
210210
-DLLVM_ENABLE_ASSERTIONS=ON^
211-
-DPYTHON_HOME="%ProgramFiles(x86)%\Microsoft Visual Studio\Shared\Python37_64"^
211+
-DPYTHON_HOME=%ProgramFiles(x86)%\Microsoft Visual Studio\Shared\Python37_64^
212212
S:\lldb
213213
popd
214214
cmake --build S:\b\lldb

branches/rxwei-patch-1/include/swift/AST/Decl.h

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4715,7 +4715,7 @@ class VarDecl : public AbstractStorageDecl {
47154715
/// Set \p v to be the pattern produced VarDecl that is the parent of this
47164716
/// var decl.
47174717
void setParentVarDecl(VarDecl *v) {
4718-
assert(v && v != this);
4718+
assert(v);
47194719
Parent = v;
47204720
}
47214721

@@ -4906,7 +4906,7 @@ class ParamDecl : public VarDecl {
49064906
SourceLoc SpecifierLoc;
49074907

49084908
struct StoredDefaultArgument {
4909-
PointerUnion<Expr *, VarDecl *> DefaultArg;
4909+
Expr *DefaultArg = nullptr;
49104910
Initializer *InitContext = nullptr;
49114911
StringRef StringRepresentation;
49124912
};
@@ -4963,20 +4963,12 @@ class ParamDecl : public VarDecl {
49634963

49644964
Expr *getDefaultValue() const {
49654965
if (auto stored = DefaultValueAndFlags.getPointer())
4966-
return stored->DefaultArg.dyn_cast<Expr *>();
4967-
return nullptr;
4968-
}
4969-
4970-
VarDecl *getStoredProperty() const {
4971-
if (auto stored = DefaultValueAndFlags.getPointer())
4972-
return stored->DefaultArg.dyn_cast<VarDecl *>();
4966+
return stored->DefaultArg;
49734967
return nullptr;
49744968
}
49754969

49764970
void setDefaultValue(Expr *E);
49774971

4978-
void setStoredProperty(VarDecl *var);
4979-
49804972
Initializer *getDefaultArgumentInitContext() const {
49814973
if (auto stored = DefaultValueAndFlags.getPointer())
49824974
return stored->InitContext;
@@ -5569,14 +5561,12 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
55695561

55705562
class OperatorDecl;
55715563

5564+
/// Note: These align with '%select's in diagnostics.
55725565
enum class SelfAccessKind : uint8_t {
5573-
NonMutating,
5574-
Mutating,
5575-
__Consuming,
5566+
NonMutating = 0,
5567+
Mutating = 1,
5568+
__Consuming = 2,
55765569
};
5577-
5578-
/// Diagnostic printing of \c SelfAccessKind.
5579-
llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, SelfAccessKind SAK);
55805570

55815571
/// FuncDecl - 'func' declaration.
55825572
class FuncDecl : public AbstractFunctionDecl {

branches/rxwei-patch-1/include/swift/AST/DefaultArgumentKind.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ enum class DefaultArgumentKind : uint8_t {
5252
EmptyArray,
5353
/// An empty dictionary literal.
5454
EmptyDictionary,
55-
/// A reference to the stored property. This is a special default argument
56-
/// kind for the synthesized memberwise constructor to emit a call to the
57-
// property's initializer.
58-
StoredProperty,
5955
};
6056
enum { NumDefaultArgumentKindBits = 4 };
6157

branches/rxwei-patch-1/include/swift/AST/DiagnosticEngine.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ namespace swift {
3030
class ValueDecl;
3131

3232
enum class PatternKind : uint8_t;
33-
enum class SelfAccessKind : uint8_t;
3433
enum class ReferenceOwnership : uint8_t;
3534
enum class StaticSpellingKind : uint8_t;
3635
enum class DescriptiveDeclKind : uint8_t;
@@ -78,7 +77,6 @@ namespace swift {
7877
Type,
7978
TypeRepr,
8079
PatternKind,
81-
SelfAccessKind,
8280
ReferenceOwnership,
8381
StaticSpellingKind,
8482
DescriptiveDeclKind,
@@ -107,7 +105,6 @@ namespace swift {
107105
Type TypeVal;
108106
TypeRepr *TyR;
109107
PatternKind PatternKindVal;
110-
SelfAccessKind SelfAccessKindVal;
111108
ReferenceOwnership ReferenceOwnershipVal;
112109
StaticSpellingKind StaticSpellingKindVal;
113110
DescriptiveDeclKind DescriptiveDeclKindVal;
@@ -172,10 +169,6 @@ namespace swift {
172169
: Kind(DiagnosticArgumentKind::ReferenceOwnership),
173170
ReferenceOwnershipVal(RO) {}
174171

175-
DiagnosticArgument(SelfAccessKind SAK)
176-
: Kind(DiagnosticArgumentKind::SelfAccessKind),
177-
SelfAccessKindVal(SAK) {}
178-
179172
DiagnosticArgument(StaticSpellingKind SSK)
180173
: Kind(DiagnosticArgumentKind::StaticSpellingKind),
181174
StaticSpellingKindVal(SSK) {}
@@ -256,11 +249,6 @@ namespace swift {
256249
return ReferenceOwnershipVal;
257250
}
258251

259-
SelfAccessKind getAsSelfAccessKind() const {
260-
assert(Kind == DiagnosticArgumentKind::SelfAccessKind);
261-
return SelfAccessKindVal;
262-
}
263-
264252
StaticSpellingKind getAsStaticSpellingKind() const {
265253
assert(Kind == DiagnosticArgumentKind::StaticSpellingKind);
266254
return StaticSpellingKindVal;

branches/rxwei-patch-1/include/swift/AST/DiagnosticsSema.def

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,20 +1108,24 @@ ERROR(attribute_requires_operator_identifier,none,
11081108
ERROR(attribute_requires_single_argument,none,
11091109
"'%0' requires a function with one argument", (StringRef))
11101110

1111-
ERROR(mutating_invalid_global_scope,none, "%0 is only valid on methods",
1112-
(SelfAccessKind))
1113-
ERROR(mutating_invalid_classes,none, "%0 isn't valid on methods in "
1114-
"classes or class-bound protocols", (SelfAccessKind))
1111+
ERROR(mutating_invalid_global_scope,none,
1112+
"'%select{nonmutating|mutating|__consuming}0' is only valid on methods",
1113+
(unsigned))
1114+
ERROR(mutating_invalid_classes,none,
1115+
"'%select{nonmutating|mutating|__consuming}0' isn't valid on methods in "
1116+
"classes or class-bound protocols", (bool))
11151117

11161118
ERROR(functions_mutating_and_not,none,
1117-
"method must not be declared both %0 and %1",
1118-
(SelfAccessKind, SelfAccessKind))
1119+
"method must not be declared both "
1120+
"%select{nonmutating|mutating|__consuming}0 and "
1121+
"%select{nonmutating|mutating|__consuming}1",
1122+
(unsigned, unsigned))
11191123
ERROR(static_functions_not_mutating,none,
11201124
"static functions must not be declared mutating", ())
11211125

11221126
ERROR(modify_mutatingness_differs_from_setter,none,
1123-
"'modify' accessor cannot be %0 when the setter is %1",
1124-
(SelfAccessKind, SelfAccessKind))
1127+
"'modify' accessor cannot be %select{nonmutating|mutating}0 "
1128+
"when the setter is %select{mutating|nonmutating}0", (bool))
11251129

11261130
ERROR(transparent_in_protocols_not_supported,none,
11271131
"'@_transparent' attribute is not supported on declarations within protocols", ())
@@ -1518,8 +1522,6 @@ ERROR(extension_specialization,none,
15181522
"type %0 with constraints specified by a 'where' clause", (Identifier))
15191523
ERROR(extension_stored_property,none,
15201524
"extensions must not contain stored properties", ())
1521-
NOTE(extension_stored_property_fixit,none,
1522-
"Remove '=' to make %0 a computed property", (Identifier))
15231525
ERROR(extension_nongeneric_trailing_where,none,
15241526
"trailing 'where' clause for extension of non-generic type %0",
15251527
(DeclName))
@@ -1869,8 +1871,8 @@ NOTE(protocol_witness_prefix_postfix_conflict,none,
18691871
"candidate is %select{|prefix, |postfix, }1not "
18701872
"%select{prefix|postfix}0 as required", (bool, unsigned))
18711873
NOTE(protocol_witness_mutation_modifier_conflict,none,
1872-
"candidate is marked %0 but protocol does not allow it",
1873-
(SelfAccessKind))
1874+
"candidate is marked '%select{nonmutating|mutating|__consuming}0' but "
1875+
"protocol does not allow it", (unsigned))
18741876
NOTE(protocol_witness_settable_conflict,none,
18751877
"candidate is not settable, but protocol requires it", ())
18761878
NOTE(protocol_witness_rethrows_conflict,none,

branches/rxwei-patch-1/include/swift/AST/KnownProtocols.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ PROTOCOL(Error)
6767
PROTOCOL_(ErrorCodeProtocol)
6868
PROTOCOL(OptionSet)
6969
PROTOCOL(CaseIterable)
70-
PROTOCOL(SIMDScalar)
7170

7271
PROTOCOL_(BridgedNSError)
7372
PROTOCOL_(BridgedStoredNSError)

branches/rxwei-patch-1/include/swift/AST/SILOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class SILOptions {
112112
std::string SILOutputFileNameForDebugging;
113113

114114
/// If set to true, compile with the SIL Ownership Model enabled.
115-
bool VerifySILOwnership = true;
115+
bool VerifySILOwnership = false;
116116

117117
/// Assume that code will be executed in a single-threaded environment.
118118
bool AssumeSingleThreaded = false;

branches/rxwei-patch-1/include/swift/AST/Stmt.h

Lines changed: 17 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
#ifndef SWIFT_AST_STMT_H
1818
#define SWIFT_AST_STMT_H
1919

20-
#include "swift/AST/ASTNode.h"
2120
#include "swift/AST/Availability.h"
2221
#include "swift/AST/AvailabilitySpec.h"
22+
#include "swift/AST/ASTNode.h"
2323
#include "swift/AST/IfConfigClause.h"
2424
#include "swift/AST/TypeAlignments.h"
2525
#include "swift/Basic/NullablePtr.h"
26-
#include "llvm/ADT/TinyPtrVector.h"
2726
#include "llvm/Support/TrailingObjects.h"
2827

2928
namespace swift {
@@ -985,22 +984,24 @@ class CaseStmt final
985984
SourceLoc CaseLoc;
986985
SourceLoc ColonLoc;
987986

988-
llvm::PointerIntPair<Stmt *, 1, bool> BodyAndHasFallthrough;
987+
llvm::PointerIntPair<Stmt *, 1, bool> BodyAndHasBoundDecls;
989988

990-
Optional<MutableArrayRef<VarDecl *>> CaseBodyVariables;
989+
/// Set to true if we have a fallthrough.
990+
///
991+
/// TODO: Once we have CaseBodyVarDecls, use the bit in BodyAndHasBoundDecls
992+
/// for this instead. This is separate now for staging reasons.
993+
bool hasFallthrough;
991994

992995
CaseStmt(SourceLoc CaseLoc, ArrayRef<CaseLabelItem> CaseLabelItems,
993-
SourceLoc UnknownAttrLoc, SourceLoc ColonLoc, Stmt *Body,
994-
Optional<MutableArrayRef<VarDecl *>> CaseBodyVariables,
995-
Optional<bool> Implicit,
996+
bool HasBoundDecls, SourceLoc UnknownAttrLoc, SourceLoc ColonLoc,
997+
Stmt *Body, Optional<bool> Implicit,
996998
NullablePtr<FallthroughStmt> fallthroughStmt);
997999

9981000
public:
9991001
static CaseStmt *
10001002
create(ASTContext &C, SourceLoc CaseLoc,
1001-
ArrayRef<CaseLabelItem> CaseLabelItems, SourceLoc UnknownAttrLoc,
1002-
SourceLoc ColonLoc, Stmt *Body,
1003-
Optional<MutableArrayRef<VarDecl *>> CaseBodyVariables,
1003+
ArrayRef<CaseLabelItem> CaseLabelItems, bool HasBoundDecls,
1004+
SourceLoc UnknownAttrLoc, SourceLoc ColonLoc, Stmt *Body,
10041005
Optional<bool> Implicit = None,
10051006
NullablePtr<FallthroughStmt> fallthroughStmt = nullptr);
10061007

@@ -1019,18 +1020,18 @@ class CaseStmt final
10191020
}
10201021

10211022
NullablePtr<CaseStmt> getFallthroughDest() {
1022-
if (!hasFallthroughDest())
1023+
if (!hasFallthrough)
10231024
return nullptr;
10241025
return (*getTrailingObjects<FallthroughStmt *>())->getFallthroughDest();
10251026
}
10261027

1027-
bool hasFallthroughDest() const { return BodyAndHasFallthrough.getInt(); }
1028+
bool hasFallthroughDest() const { return hasFallthrough; }
10281029

1029-
Stmt *getBody() const { return BodyAndHasFallthrough.getPointer(); }
1030-
void setBody(Stmt *body) { BodyAndHasFallthrough.setPointer(body); }
1030+
Stmt *getBody() const { return BodyAndHasBoundDecls.getPointer(); }
1031+
void setBody(Stmt *body) { BodyAndHasBoundDecls.setPointer(body); }
10311032

10321033
/// True if the case block declares any patterns with local variable bindings.
1033-
bool hasBoundDecls() const { return CaseBodyVariables.hasValue(); }
1034+
bool hasBoundDecls() const { return BodyAndHasBoundDecls.getInt(); }
10341035

10351036
/// Get the source location of the 'case' or 'default' of the first label.
10361037
SourceLoc getLoc() const { return CaseLoc; }
@@ -1055,38 +1056,14 @@ class CaseStmt final
10551056
return UnknownAttrLoc.isValid();
10561057
}
10571058

1058-
Optional<ArrayRef<VarDecl *>> getCaseBodyVariables() const {
1059-
if (!CaseBodyVariables)
1060-
return None;
1061-
ArrayRef<VarDecl *> a = *CaseBodyVariables;
1062-
return a;
1063-
}
1064-
1065-
Optional<MutableArrayRef<VarDecl *>> getCaseBodyVariables() {
1066-
return CaseBodyVariables;
1067-
}
1068-
1069-
ArrayRef<VarDecl *> getCaseBodyVariablesOrEmptyArray() const {
1070-
if (!CaseBodyVariables)
1071-
return ArrayRef<VarDecl *>();
1072-
ArrayRef<VarDecl *> a = *CaseBodyVariables;
1073-
return a;
1074-
}
1075-
1076-
MutableArrayRef<VarDecl *> getCaseBodyVariablesOrEmptyArray() {
1077-
if (!CaseBodyVariables)
1078-
return MutableArrayRef<VarDecl *>();
1079-
return *CaseBodyVariables;
1080-
}
1081-
10821059
static bool classof(const Stmt *S) { return S->getKind() == StmtKind::Case; }
10831060

10841061
size_t numTrailingObjects(OverloadToken<CaseLabelItem>) const {
10851062
return getNumCaseLabelItems();
10861063
}
10871064

10881065
size_t numTrailingObjects(OverloadToken<FallthroughStmt *>) const {
1089-
return hasFallthroughDest() ? 1 : 0;
1066+
return hasFallthrough ? 1 : 0;
10901067
}
10911068
};
10921069

0 commit comments

Comments
 (0)