Skip to content

Commit b267fda

Browse files
committed
Merge branch 'master' of https://github.com/apple/swift
2 parents 7e51593 + b31e416 commit b267fda

File tree

69 files changed

+672
-671
lines changed

Some content is hidden

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

69 files changed

+672
-671
lines changed

.pep8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[flake8]
2-
filename = *.py,80+-check,Benchmark_Driver,Benchmark_DTrace.in,Benchmark_GuardMalloc.in,Benchmark_RuntimeLeaksRunner.in,build-script,check-incremental,gyb,line-directive,mock-distcc,ns-html2rst,recursive-lipo,rth,run-test,submit-benchmark-results,update-checkout,viewcfg,backtrace-check,coverage-build-db,coverage-generate-data,coverage-touch-tests
2+
filename = *.py,80+-check,backtrace-check,Benchmark_Driver,Benchmark_DTrace.in,Benchmark_GuardMalloc.in,Benchmark_RuntimeLeaksRunner.in,build-script,check-incremental,clang++,coverage-build-db,coverage-generate-data,coverage-touch-tests,gyb,ld,line-directive,mock-distcc,ns-html2rst,PathSanitizingFileCheck,recursive-lipo,rth,run-test,submit-benchmark-results,update-checkout,viewcfg

benchmark/scripts/compare_perf_tests.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@
7171
PAIN_DETAIL = """
7272
{0}: {1}"""
7373

74+
RATIO_MIN = None
75+
RATIO_MAX = None
76+
7477

7578
def main():
7679
global RATIO_MIN
@@ -146,11 +149,11 @@ def main():
146149

147150
ratio_total = 0
148151
for key in new_results.keys():
149-
ratio = (old_results[key]+0.001)/(new_results[key]+0.001)
152+
ratio = (old_results[key] + 0.001) / (new_results[key] + 0.001)
150153
ratio_list[key] = round(ratio, 2)
151154
ratio_total *= ratio
152-
delta = (((float(new_results[key]+0.001) /
153-
(old_results[key]+0.001)) - 1) * 100)
155+
delta = (((float(new_results[key] + 0.001) /
156+
(old_results[key] + 0.001)) - 1) * 100)
154157
delta_list[key] = round(delta, 2)
155158
if ((old_results[key] < new_results[key] and
156159
new_results[key] < old_max_results[key]) or
@@ -174,17 +177,17 @@ def main():
174177
delta_width = max_width(delta_list, title='DELTA (%)')
175178

176179
markdown_table_header = "\n" + MARKDOWN_ROW.format(
177-
"TEST".ljust(test_name_width),
178-
old_branch.ljust(old_time_width),
179-
new_branch.ljust(new_time_width),
180-
"DELTA (%)".ljust(delta_width),
181-
"SPEEDUP".ljust(2))
180+
"TEST".ljust(test_name_width),
181+
old_branch.ljust(old_time_width),
182+
new_branch.ljust(new_time_width),
183+
"DELTA (%)".ljust(delta_width),
184+
"SPEEDUP".ljust(2))
182185
markdown_table_header += MARKDOWN_ROW.format(
183-
HEADER_SPLIT.ljust(test_name_width),
184-
HEADER_SPLIT.ljust(old_time_width),
185-
HEADER_SPLIT.ljust(new_time_width),
186-
HEADER_SPLIT.ljust(delta_width),
187-
HEADER_SPLIT.ljust(2))
186+
HEADER_SPLIT.ljust(test_name_width),
187+
HEADER_SPLIT.ljust(old_time_width),
188+
HEADER_SPLIT.ljust(new_time_width),
189+
HEADER_SPLIT.ljust(delta_width),
190+
HEADER_SPLIT.ljust(2))
188191
markdown_regression = ""
189192
for i, key in enumerate(decreased_perf_list):
190193
ratio = "{0:.2f}x".format(ratio_list[key])

benchmark/single-source/NSDictionaryCastToSwift.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// rdar://problem/18539730
1515
//
1616
// Description:
17-
// Create a NSDictionary instance and cast it to [String: NSObject].
17+
// Create an NSDictionary instance and cast it to [String: NSObject].
1818
import Foundation
1919
import TestsUtils
2020

docs/ContinuousIntegration.md

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ We describe each in detail below:
3535

3636
Platform | Comment | Check Status
3737
------------ | ------- | ------------
38-
All supported platforms | @swift-ci Please smoke test | Swift Test Linux Platform (smoke test) <br> Swift Test OS X Platform (smoke test)
39-
All supported platforms | @swift-ci Please smoke test and merge | Swift Test Linux Platform (smoke test) <br> Swift Test OS X Platform (smoke test)
38+
All supported platforms | @swift-ci Please smoke test | Swift Test Linux Platform (smoke test)<br>Swift Test OS X Platform (smoke test)
39+
All supported platforms | @swift-ci Please smoke test and mere | Swift Test Linux Platform (smoke test)<br>Swift Test OS X Platform (smoke test)
4040
OS X platform | @swift-ci Please smoke test OS X platform | Swift Test OS X Platform (smoke test)
4141
Linux platform | @swift-ci Please smoke test Linux platform | Swift Test Linux Platform (smoke test)
4242

@@ -66,14 +66,14 @@ A smoke test on Linux does the following:
6666

6767
Platform | Comment | Check Status
6868
------------ | ------- | ------------
69-
All supported platforms | @swift-ci Please test | Swift Test Linux Platform (smoke test)<br>Swift Test OS X Platform (smoke test)<br>Swift Test Linux Platform<br>Swift Test OS X Platform<br>
70-
All supported platforms | @swift-ci Please clean test | Swift Test Linux Platform (smoke test)<br>Swift Test OS X Platform (smoke test)<br>Swift Test Linux Platform<br>Swift Test OS X Platform<br>
71-
All supported platforms | @swift-ci Please test and merge | Swift Test Linux Platform (smoke test) <br> Swift Test OS X Platform (smoke test)<br> Swift Test Linux Platform <br>Swift Test OS X Platform
72-
OS X platform | @swift-ci Please test OS X platform | Swift Test OS X Platform (smoke test)<br>Swift Test OS X Platform
69+
All supported platforms | @swift-ci Please test | Swift Test Linux Platform (smoke test)<br>Swift Test OS X Platform (smoke test)<br>Swift Test Linux Platform<br>Swift Test OS X Platform<br>
70+
All supported platforms | @swift-ci Please clean test | Swift Test Linux Platform (smoke test)<br>Swift Test OS X Platform (smoke test)<br>Swift Test Linux Platform<br>Swift Test OS X Platform<br>
71+
All supported platforms | @swift-ci Please test and merge | Swift Test Linux Platform (smoke test)<br>Swift Test OS X Platform (smoke test)<br> Swift Test Linux Platform <br>Swift Test OS X Platform
72+
OS X platform | @swift-ci Please test OS X platform | Swift Test OS X Platform (smoke test)<br>Swift Test OS X Platform
7373
OS X platform | @swift-ci Please clean test OS X platform | Swift Test OS X Platform (smoke test)<br>Swift Test OS X Platform
7474
OS X platform | @swift-ci Please benchmark | Swift Benchmark on OS X Platform
75-
Linux platform | @swift-ci Please test Linux platform | Swift Test Linux Platform (smoke test) <br> Swift Test Linux Platform
76-
Linux platform | @swift-ci Please clean test Linux platform | Swift Test Linux Platform (smoke test) <br> Swift Test Linux Platform
75+
Linux platform | @swift-ci Please test Linux platform | Swift Test Linux Platform (smoke test)<br>Swift Test Linux Platform
76+
Linux platform | @swift-ci Please clean test Linux platform | Swift Test Linux Platform (smoke test)<br>Swift Test Linux Platform
7777

7878
The core principles of validation testing is that:
7979

@@ -118,25 +118,32 @@ A validation test on Linux does the following:
118118

119119
## Cross Repository Testing
120120

121-
Currently @swift-ci pull request testing only supports testing changes against individual repositories. This is something that will most likely be fixed in the future. But in the short term, please follow the following workflow for performing cross repository testing:
121+
Simply provide the URL from corresponding pull requests in the same comment as "@swift-ci Please test" phrase. List all of the pull requests and then provide the specific test phrase you would like to trigger. Currently, it will only merge the main pull request you requested testing from as opposed to all of the PR's.
122122

123-
1. Make sure that all repos have been checked out:
123+
For example:
124124

125-
./swift/utils/update-checkout --clone
125+
```
126+
Please test with following pull request:
127+
https://github.com/apple/swift/pull/4574
126128
127-
2. On Darwin and Linux run:
129+
@swift-ci Please test Linux platform
130+
```
128131

129-
./swift/utils/build-toolchain local.swift
132+
```
133+
Please test with following PR:
134+
https://github.com/apple/swift-lldb/pull/48
135+
https://github.com/apple/swift-package-manager/pull/632
130136
131-
If everything passes, a .tar.gz package file will be produced in the . directory.
137+
@swift-ci Please test macOS platform
138+
```
132139

133-
3. Create a separate PR for each repository that needs to be changed. Each should reference the main Swift PR and create a reference to all of the others from the main PR.
140+
1. Create a separate PR for each repository that needs to be changed. Each should reference the main Swift PR and create a reference to all of the others from the main PR.
134141

135-
4. Gate all commits on @swift-ci smoke test and merge. As stated above, it is important that *all* checkins perform PR testing since if breakage enters the tree PR testing becomes less effective. If you have done local testing (using build-toolchain) and have made appropriate changes to the other repositories then perform a smoke test and merge should be sufficient for correctness. This is not meant to check for correctness in your commits, but rather to be sure that no one landed changes in other repositories or in swift that cause your PR to no longer be correct. If you were unable to make workarounds to th eother repositories, this smoke test will break *after* Swift has built. Check the log to make sure that it is the expected failure for that platform/repository that coincides with the failure your PR is supposed to fix.
142+
2. Gate all commits on @swift-ci smoke test and merge. As stated above, it is important that *all* checkins perform PR testing since if breakage enters the tree PR testing becomes less effective. If you have done local testing (using build-toolchain) and have made appropriate changes to the other repositories then perform a smoke test and merge should be sufficient for correctness. This is not meant to check for correctness in your commits, but rather to be sure that no one landed changes in other repositories or in swift that cause your PR to no longer be correct. If you were unable to make workarounds to th eother repositories, this smoke test will break *after* Swift has built. Check the log to make sure that it is the expected failure for that platform/repository that coincides with the failure your PR is supposed to fix.
136143

137-
5. Merge all of the pull requests simultaneously.
144+
3. Merge all of the pull requests simultaneously.
138145

139-
6. Watch the public incremental build on ci.swift.org to make sure that you did not make any mistakes. It should complete within 30-40 minutes depending on what else was being committed in the mean time.
146+
4. Watch the public incremental build on ci.swift.org to make sure that you did not make any mistakes. It should complete within 30-40 minutes depending on what else was being committed in the mean time.
140147

141148

142149
## ci.swift.org bots

docs/HighLevelSILOptimizations.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ array.uninitialized(count: Builtin.Word) -> (Array<Element>, Builtin.RawPointer)
165165
The caller is responsible for writing the elements to the element storage.
166166

167167
array.props.isCocoa/needsElementTypeCheck -> Bool
168+
168169
Reads storage descriptors properties (isCocoa, needsElementTypeCheck).
169170
This is not control dependent or guarded. The optimizer has
170171
semantic knowledge of the state transfer those properties cannot make:

docs/proposals/TypeState.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ dimensions without having to manually manage a matrix of states. This seems
127127
particularly useful in cases where you have inheritance. A base class may
128128
define its own set of states. A derived class will have those states, plus
129129
additional dimensions if they wanted. For example, an NSView could be visible
130-
or not, while a NSButton derived class could be Normal or Pressed Down, etc.
130+
or not, while an NSButton derived class could be Normal or Pressed Down, etc.
131131

132132
Generics: "mechanisms like type parameterization need to be duplicated for
133133
typestate, so that we can talk not only about a list of files, but also about a

include/swift/AST/Builtins.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ BUILTIN_SIL_OPERATION(GepRaw, "gepRaw", Integer)
259259

260260
/// Gep (Builtin.RawPointer, Builtin.Word, T.Type) -> Builtin.RawPointer
261261
///
262-
/// Like the GepRaw-bultin, but multiplies the index by stride-of type 'T'.
262+
/// Like the GepRaw-builtin, but multiplies the index by stride-of type 'T'.
263263
BUILTIN_SIL_OPERATION(Gep, "gep", Integer)
264264

265265
/// getTailAddr(Builtin.RawPointer,

include/swift/AST/Expr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,7 @@ class DynamicSubscriptExpr final
17531753
/// bar.foo. These always have unresolved type.
17541754
class UnresolvedMemberExpr final
17551755
: public Expr,
1756-
public TrailingCallArguments<UnresolvedMemberExpr> {
1756+
public TrailingCallArguments<UnresolvedMemberExpr> {
17571757
SourceLoc DotLoc;
17581758
DeclNameLoc NameLoc;
17591759
DeclName Name;

lib/AST/ASTPrinter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3358,7 +3358,6 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
33583358

33593359
ASTPrinter &Printer;
33603360
const PrintOptions &Options;
3361-
Optional<std::vector<GenericParamList *>> UnwrappedGenericParams;
33623361

33633362
/// Whether we are printing something in a function parameter position, and
33643363
/// thus want to print @escaping if it escapes.

lib/AST/ASTScope.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ ASTScope::ASTScope(const ASTScope *parent, ArrayRef<ASTScope *> children)
132132

133133
// Add child nodes, reparenting them to this node.
134134
storedChildren.reserve(children.size());
135-
for (auto child : children ) {
135+
for (auto child : children) {
136136
child->parentAndExpanded.setPointer(this);
137137
storedChildren.push_back(child);
138138
}
@@ -592,7 +592,7 @@ void ASTScope::expand() const {
592592
break;
593593

594594
case ASTScopeKind::Accessors: {
595-
// Add children for all of the the explicitly-written accessors.
595+
// Add children for all of the explicitly-written accessors.
596596
SmallVector<ASTScope *, 4> accessors;
597597
auto addAccessor = [&](FuncDecl *accessor) {
598598
if (!accessor) return;

lib/AST/ArchetypeBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ bool ArchetypeBuilder::addSameTypeRequirementBetweenArchetypes(
11961196
// along back edges.
11971197
bool creatingCycle = false;
11981198
auto T2Parent = T2;
1199-
while(T2Parent != nullptr) {
1199+
while (T2Parent != nullptr) {
12001200
if (T2Parent->getRepresentative() == T1)
12011201
creatingCycle = true;
12021202
T2Parent = T2Parent->getParent();

lib/IDE/CodeCompletion.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3066,16 +3066,6 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
30663066
return false;
30673067
}
30683068

3069-
bool isOptionSetDecl(NominalTypeDecl *D) {
3070-
auto optionSetType = dyn_cast<ProtocolDecl>(Ctx.getOptionSetDecl());
3071-
if (!optionSetType)
3072-
return false;
3073-
3074-
SmallVector<ProtocolConformance *, 1> conformances;
3075-
return D->lookupConformance(CurrDeclContext->getParentModule(),
3076-
optionSetType, conformances);
3077-
}
3078-
30793069
void getTupleExprCompletions(TupleType *ExprType) {
30803070
unsigned Index = 0;
30813071
for (auto TupleElt : ExprType->getElements()) {

lib/IRGen/GenClass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ Address irgen::emitTailProjection(IRGenFunction &IGF, llvm::Value *Base,
575575

576576
/// Try to stack promote a class instance with possible tail allocated arrays.
577577
///
578-
/// Returns the alloca if successfull, or nullptr otherwise.
578+
/// Returns the alloca if successful, or nullptr otherwise.
579579
static llvm::Value *stackPromote(IRGenFunction &IGF,
580580
const StructLayout &ClassLayout,
581581
int &StackAllocSize,

lib/Parse/ParseType.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ ParserResult<TypeRepr> Parser::parseTypeIdentifierOrTypeComposition() {
464464
SmallString<32> replacement;
465465
auto Begin = Protocols.begin();
466466
replacement += extractText(*Begin);
467-
while(++Begin != Protocols.end()) {
467+
while (++Begin != Protocols.end()) {
468468
replacement += " & ";
469469
replacement += extractText(*Begin);
470470
}

lib/SILGen/RValue.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -560,16 +560,15 @@ RValue RValue::extractElement(unsigned n) && {
560560
assert(isComplete() && "rvalue is not complete");
561561

562562
CanTupleType tupleTy = dyn_cast<TupleType>(type);
563-
if (!tupleTy) {
564-
assert(n == 0);
563+
if (!tupleTy) {
564+
assert(n == 0);
565565
unsigned to = getRValueSize(type);
566-
assert(to == values.size());
567-
RValue element({llvm::makeArrayRef(values).slice(0, to), type});
568-
makeUsed();
569-
return element;
566+
assert(to == values.size());
567+
RValue element({llvm::makeArrayRef(values).slice(0, to), type});
568+
makeUsed();
569+
return element;
570570
}
571571

572-
573572
auto range = getElementRange(tupleTy, n);
574573
unsigned from = range.first, to = range.second;
575574

@@ -583,12 +582,12 @@ void RValue::extractElements(SmallVectorImpl<RValue> &elements) && {
583582
assert(isComplete() && "rvalue is not complete");
584583

585584
CanTupleType tupleTy = dyn_cast<TupleType>(type);
586-
if (!tupleTy) {
585+
if (!tupleTy) {
587586
unsigned to = getRValueSize(type);
588-
assert(to == values.size());
589-
elements.push_back({llvm::makeArrayRef(values).slice(0, to), type});
590-
makeUsed();
591-
return;
587+
assert(to == values.size());
588+
elements.push_back({llvm::makeArrayRef(values).slice(0, to), type});
589+
makeUsed();
590+
return;
592591
}
593592

594593
unsigned from = 0;

lib/SILGen/SILGenApply.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2976,25 +2976,25 @@ namespace {
29762976
if (arg.isRValue()) {
29772977
if (CanTupleType substArgType =
29782978
dyn_cast<TupleType>(arg.getSubstType())) {
2979-
// The original type isn't necessarily a tuple.
2980-
assert(origParamType.matchesTuple(substArgType));
2981-
2982-
auto loc = arg.getKnownRValueLocation();
2983-
SmallVector<RValue, 4> elts;
2984-
std::move(arg).asKnownRValue().extractElements(elts);
2985-
for (auto i : indices(substArgType.getElementTypes())) {
2986-
emit({ loc, std::move(elts[i]) },
2987-
origParamType.getTupleElementType(i));
2988-
}
2989-
return;
2990-
}
2991-
2992-
auto loc = arg.getKnownRValueLocation();
2993-
SmallVector<RValue, 1> elts;
2994-
std::move(arg).asKnownRValue().extractElements(elts);
2995-
emit({ loc, std::move(elts[0]) },
2996-
origParamType.getTupleElementType(0));
2997-
return;
2979+
// The original type isn't necessarily a tuple.
2980+
assert(origParamType.matchesTuple(substArgType));
2981+
2982+
auto loc = arg.getKnownRValueLocation();
2983+
SmallVector<RValue, 4> elts;
2984+
std::move(arg).asKnownRValue().extractElements(elts);
2985+
for (auto i : indices(substArgType.getElementTypes())) {
2986+
emit({ loc, std::move(elts[i]) },
2987+
origParamType.getTupleElementType(i));
2988+
}
2989+
return;
2990+
}
2991+
2992+
auto loc = arg.getKnownRValueLocation();
2993+
SmallVector<RValue, 1> elts;
2994+
std::move(arg).asKnownRValue().extractElements(elts);
2995+
emit({ loc, std::move(elts[0]) },
2996+
origParamType.getTupleElementType(0));
2997+
return;
29982998
}
29992999

30003000
// Otherwise, we're working with an expression.

0 commit comments

Comments
 (0)