Skip to content

Commit 0af4fd2

Browse files
committed
---
yaml --- r: 335741 b: refs/heads/rxwei-patch-1 c: 445d426 h: refs/heads/master i: 335739: 902957e
1 parent 022191c commit 0af4fd2

File tree

12 files changed

+52
-74
lines changed

12 files changed

+52
-74
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: b616f6c0a4fb5f3d3b2035782215a0d205176904
1018+
refs/heads/rxwei-patch-1: 445d426b16011faa9c17fe69ee054ddec4053f9d
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/include/swift/SIL/SILInstruction.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4186,17 +4186,9 @@ class ConvertEscapeToNoEscapeInst final
41864186
SILFunction &F, SILOpenedArchetypesState &OpenedArchetypes,
41874187
bool lifetimeGuaranteed);
41884188
public:
4189-
/// Return true if we have extended the lifetime of the argument of the
4190-
/// convert_escape_to_no_escape to be over all uses of the trivial type.
41914189
bool isLifetimeGuaranteed() const {
41924190
return lifetimeGuaranteed;
41934191
}
4194-
4195-
/// Mark that we have extended the lifetime of the argument of the
4196-
/// convert_escape_to_no_escape to be over all uses of the trivial type.
4197-
///
4198-
/// NOTE: This is a one way operation.
4199-
void setLifetimeGuaranteed() { lifetimeGuaranteed = true; }
42004192
};
42014193

42024194
/// ThinFunctionToPointerInst - Convert a thin function pointer to a

branches/rxwei-patch-1/lib/SILOptimizer/Mandatory/ClosureLifetimeFixup.cpp

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,12 @@ static void extendLifetimeToEndOfFunction(SILFunction &Fn,
123123
auto OptionalEscapingClosureTy = SILType::getOptionalType(EscapingClosureTy);
124124
auto loc = RegularLocation::getAutoGeneratedLocation();
125125

126-
Cvt->setLifetimeGuaranteed();
126+
SILBuilderWithScope B(Cvt);
127+
auto NewCvt = B.createConvertEscapeToNoEscape(
128+
Cvt->getLoc(), Cvt->getOperand(), Cvt->getType(), true);
129+
Cvt->replaceAllUsesWith(NewCvt);
130+
Cvt->eraseFromParent();
131+
Cvt = NewCvt;
127132

128133
// If our Cvt is in the initial block, we do not need to use the SSA updater
129134
// since we know Cvt can not be in a loop and must dominate all exits
@@ -412,7 +417,14 @@ static bool tryExtendLifetimeToLastUse(
412417
// Insert a copy at the convert_escape_to_noescape [not_guaranteed] and
413418
// change the instruction to the guaranteed form.
414419
auto EscapingClosure = Cvt->getOperand();
415-
Cvt->setLifetimeGuaranteed();
420+
{
421+
SILBuilderWithScope B(Cvt);
422+
auto NewCvt = B.createConvertEscapeToNoEscape(
423+
Cvt->getLoc(), Cvt->getOperand(), Cvt->getType(), true);
424+
Cvt->replaceAllUsesWith(NewCvt);
425+
Cvt->eraseFromParent();
426+
Cvt = NewCvt;
427+
}
416428

417429
SILBuilderWithScope B2(Cvt);
418430
auto ClosureCopy = B2.createCopyValue(loc, EscapingClosure);
@@ -498,7 +510,14 @@ static bool trySwitchEnumPeephole(ConvertEscapeToNoEscapeInst *Cvt) {
498510
if (!onlyDestroy)
499511
return false;
500512

501-
Cvt->setLifetimeGuaranteed();
513+
// Replace the convert_escape_to_noescape instruction.
514+
{
515+
SILBuilderWithScope B(Cvt);
516+
auto NewCvt = B.createConvertEscapeToNoEscape(
517+
Cvt->getLoc(), Cvt->getOperand(), Cvt->getType(), true);
518+
Cvt->replaceAllUsesWith(NewCvt);
519+
Cvt->eraseFromParent();
520+
}
502521

503522
// Extend the lifetime.
504523
SILBuilderWithScope B(SwitchEnum1);

branches/rxwei-patch-1/lib/Sema/CSSimplify.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,8 @@ bool constraints::areConservativelyCompatibleArgumentLabels(
132132
hasCurriedSelf = false;
133133
} else if (baseType->is<AnyMetatypeType>() && decl->isInstanceMember()) {
134134
hasCurriedSelf = false;
135-
} else if (auto *EED = dyn_cast<EnumElementDecl>(decl)) {
136-
// enum elements have either `(Self.Type) -> (Arg...) -> Self`, or
137-
// `(Self.Type) -> Self`, in the former case self type has to be
138-
// stripped off.
139-
hasCurriedSelf = bool(EED->getParameterList());
135+
} else if (isa<EnumElementDecl>(decl)) {
136+
hasCurriedSelf = false;
140137
} else {
141138
hasCurriedSelf = true;
142139
}

branches/rxwei-patch-1/test/ClangImporter/MixedSource/autolinking.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
// Linux uses a different autolinking mechanism, based on
44
// swift-autolink-extract. This file tests the Darwin mechanism.
5-
// UNSUPPORTED: autolink-extract
5+
// UNSUPPORTED: OS=linux-gnu
6+
// UNSUPPORTED: OS=linux-gnueabihf
7+
// UNSUPPORTED: OS=freebsd
8+
// UNSUPPORTED: OS=linux-androideabi
69

710
// Use a type declared in the Clang part of the module.
811
public let y = Test()

branches/rxwei-patch-1/test/ClangImporter/autolinking.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414

1515
// Linux uses a different autolinking mechanism, based on
1616
// swift-autolink-extract. This file tests the Darwin mechanism.
17-
// UNSUPPORTED: autolink-extract
17+
// UNSUPPORTED: OS=linux-gnu
18+
// UNSUPPORTED: OS=linux-gnueabihf
19+
// UNSUPPORTED: OS=freebsd
20+
// UNSUPPORTED: OS=linux-androideabi
1821

1922
import LinkMusket
2023
import LinkFramework

branches/rxwei-patch-1/test/Constraints/enum_cases.swift

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -124,34 +124,3 @@ func rdar34583132() {
124124
}
125125
}
126126
}
127-
128-
func rdar_49159472() {
129-
struct A {}
130-
struct B {}
131-
struct C {}
132-
133-
enum E {
134-
case foo(a: A, b: B?)
135-
136-
var foo: C? {
137-
return nil
138-
}
139-
}
140-
141-
class Test {
142-
var e: E
143-
144-
init(_ e: E) {
145-
self.e = e
146-
}
147-
148-
func bar() {
149-
e = .foo(a: A(), b: nil) // Ok
150-
e = E.foo(a: A(), b: nil) // Ok
151-
baz(e: .foo(a: A(), b: nil)) // Ok
152-
baz(e: E.foo(a: A(), b: nil)) // Ok
153-
}
154-
155-
func baz(e: E) {}
156-
}
157-
}

branches/rxwei-patch-1/test/DebugInfo/compiler-flags.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
// Check that we don't write temporary file names in the debug info
1919
// RUN: env TMP=abc/def TMPDIR=abc/def %target-swift-frontend %s -I abc/def/xyz -g -emit-ir -debug-info-store-invocation -o - | %FileCheck --check-prefix CHECK-TEMP %s
2020
// RUN: env TMP=%t TMPDIR=%t %target-swift-frontend %s -I %t/xyz -g -emit-ir -debug-info-store-invocation -o - | %FileCheck --check-prefix CHECK-TEMP %s
21-
// CHECK-TEMP: !DICompileUnit({{.*}} flags: "{{.*}} -I {{(\\22)?}}<temporary-file>
21+
// CHECK-TEMP: !DICompileUnit({{.*}} flags: "{{.*}} -I <temporary-file>
2222

branches/rxwei-patch-1/test/IDE/complete_constructor.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@
5050
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=AVAILABLE_1 | %FileCheck %s -check-prefix=AVAILABLE_1
5151
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=AVAILABLE_2 | %FileCheck %s -check-prefix=AVAILABLE_2
5252

53-
// REQUIRES: rdar49240981
54-
5553
func freeFunc() {}
5654

5755
//===---
@@ -92,10 +90,11 @@ func testImplicitConstructors2() {
9290
}
9391
func testImplicitConstructors2P() {
9492
ImplicitConstructors2(#^IMPLICIT_CONSTRUCTORS_2P^#
95-
// IMPLICIT_CONSTRUCTORS_2P: Begin completions
96-
// IMPLICIT_CONSTRUCTORS_2P-NEXT: Decl[Constructor]/CurrNominal: ['(']{#instanceVar: Int#}[')'][#ImplicitConstructors2#]{{; name=.+$}}
97-
// IMPLICIT_CONSTRUCTORS_2P-NEXT: Decl[Constructor]/CurrNominal: ['('][')'][#ImplicitConstructors2#]; name=
98-
// IMPLICIT_CONSTRUCTORS_2P-NEXT: End completions
93+
// IMPLICIT_CONSTRUCTORS_2P: Begin completions, 3 items
94+
// IMPLICIT_CONSTRUCTORS_2P-DAG: Decl[Constructor]/CurrNominal: ['('][')'][#ImplicitConstructors2#]; name=
95+
// IMPLICIT_CONSTRUCTORS_2P-DAG: Decl[Constructor]/CurrNominal: ['(']{#instanceVar: Int#}[')'][#ImplicitConstructors2#]{{; name=.+$}}
96+
// IMPLICIT_CONSTRUCTORS_2P-DAG: Decl[Constructor]/CurrNominal: ['('][')'][#ImplicitConstructors2#]; name=
97+
// IMPLICIT_CONSTRUCTORS_2P: End completions
9998
}
10099

101100
struct ExplicitConstructors1 {
@@ -290,10 +289,11 @@ func testHaveRParen1() {
290289

291290
func testHaveRParen2() {
292291
ImplicitConstructors2(#^HAVE_RPAREN_2^#)
293-
// HAVE_RPAREN_2-NOT: Decl[Constructor]
294-
// HAVE_RPAREN_2: Decl[Constructor]/CurrNominal: ['(']{#instanceVar: Int#}[')'][#ImplicitConstructors2#]{{; name=.+$}}
295-
// HAVE_RPAREN_2: Decl[Constructor]/CurrNominal: ['('][')'][#ImplicitConstructors2#]; name=
296-
// HAVE_RPAREN_2-NOT: Decl[Constructor]
292+
// HAVE_RPAREN_2: Begin completions, 3 items
293+
// HAVE_RPAREN_2-DAG: Decl[Constructor]/CurrNominal: ['('][')'][#ImplicitConstructors2#]; name=
294+
// HAVE_RPAREN_2-DAG: Decl[Constructor]/CurrNominal: ['(']{#instanceVar: Int#}[')'][#ImplicitConstructors2#]{{; name=.+$}}
295+
// HAVE_RPAREN_2-DAG: Decl[Constructor]/CurrNominal: ['('][')'][#ImplicitConstructors2#]; name=
296+
// HAVE_RPAREN_2: End completions
297297
}
298298

299299
func testHaveComma1() {

branches/rxwei-patch-1/test/Serialization/autolinking-inlinable-inferred.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111

1212
// Linux uses a different autolinking mechanism, based on
1313
// swift-autolink-extract. This file tests the Darwin mechanism.
14-
/// UNSUPPORTED: autolink-extract
14+
// UNSUPPORTED: OS=linux-gnu
15+
// UNSUPPORTED: OS=linux-gnueabihf
16+
// UNSUPPORTED: OS=freebsd
17+
// UNSUPPORTED: OS=linux-androideabi
1518

1619
import autolinking_module_inferred
1720

branches/rxwei-patch-1/test/Serialization/autolinking.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121

2222
// Linux uses a different autolinking mechanism, based on
2323
// swift-autolink-extract. This file tests the Darwin mechanism.
24-
// UNSUPPORTED: autolink-extract
24+
// UNSUPPORTED: OS=linux-gnu
25+
// UNSUPPORTED: OS=linux-gnueabihf
26+
// UNSUPPORTED: OS=freebsd
27+
// UNSUPPORTED: OS=linux-androideabi
2528

2629
import someModule
2730

branches/rxwei-patch-1/unittests/Reflection/RemoteMirrorInterop/test.swift

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)