Skip to content

Commit 8eb0e07

Browse files
committed
---
yaml --- r: 327657 b: refs/heads/tensorflow c: 56abf9e h: refs/heads/master i: 327655: a9e36e7
1 parent 9851a58 commit 8eb0e07

File tree

7 files changed

+15
-84
lines changed

7 files changed

+15
-84
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-04-25-a: 22f738a831d43aff2b9c9773bcb65
816816
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-05-08-a: 7d98cc16689baba5c8a3b90a9329bdcc1a12b4e9
817817
refs/heads/cherr42: a566ad54b073c2c56ac0a705d0a5bed9743135a5
818818
"refs/heads/codable_test_comment_fix": fc8f6824f7f347e1e8db55bff62db385c5728b5a
819-
refs/heads/tensorflow: dc59cd2043f001eec89cc2aa5704b2dc48f7d357
819+
refs/heads/tensorflow: 56abf9e0f9265fabb135b94555d11dd658992aa0
820820
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-11-a: 8126fd7a652e2f70ad6d76505239e34fb2ef3e1a
821821
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-12-a: b3fd3dd84df6717f2e2e9df58c6d7e99fed57086
822822
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-13-a: 71135119579039dc321c5f65d870050fe36efda2

branches/tensorflow/lib/Sema/CSRanking.cpp

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -822,27 +822,17 @@ SolutionCompareResult ConstraintSystem::compareSolutions(
822822
continue;
823823
}
824824

825-
if (choice1.getKind() == OverloadChoiceKind::KeyPathDynamicMemberLookup) {
826-
if (choice2.getKind() == OverloadChoiceKind::DynamicMemberLookup)
827-
// Dynamic member lookup through a keypath is better than one using
828-
// string because it carries more type information.
829-
score1 += weight;
830-
else
831-
// Otherwise let's prefer non-dynamic declaration.
832-
score2 += weight;
833-
825+
// Dynamic member lookup through a keypath is better than one using string
826+
// because it carries more type information.
827+
if (choice1.getKind() == OverloadChoiceKind::KeyPathDynamicMemberLookup &&
828+
choice2.getKind() == OverloadChoiceKind::DynamicMemberLookup) {
829+
score1 += weight;
834830
continue;
835831
}
836832

837-
if (choice2.getKind() == OverloadChoiceKind::KeyPathDynamicMemberLookup) {
838-
if (choice1.getKind() == OverloadChoiceKind::DynamicMemberLookup)
839-
// Dynamic member lookup through a keypath is better than one using
840-
// string because it carries more type information.
841-
score2 += weight;
842-
else
843-
// Otherwise let's prefer non-dynamic declaration.
844-
score1 += weight;
845-
833+
if (choice1.getKind() == OverloadChoiceKind::DynamicMemberLookup &&
834+
choice2.getKind() == OverloadChoiceKind::KeyPathDynamicMemberLookup) {
835+
score2 += weight;
846836
continue;
847837
}
848838

branches/tensorflow/lib/Sema/MiscDiagnostics.cpp

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,13 @@
2222
#include "swift/AST/Pattern.h"
2323
#include "swift/Basic/Defer.h"
2424
#include "swift/Basic/SourceManager.h"
25-
#include "swift/Basic/Statistic.h"
2625
#include "swift/Basic/StringExtras.h"
2726
#include "swift/Parse/Lexer.h"
2827
#include "swift/Parse/Parser.h"
2928
#include "swift/Sema/IDETypeChecking.h"
3029
#include "llvm/ADT/MapVector.h"
3130
#include "llvm/ADT/StringSwitch.h"
3231
#include "llvm/Support/SaveAndRestore.h"
33-
34-
#define DEBUG_TYPE "Sema"
3532
using namespace swift;
3633

3734
/// Return true if this expression is an implicit promotion from T to T?.
@@ -1995,10 +1992,6 @@ class VarDeclUsageChecker : public ASTWalker {
19951992
/// This is a mapping from VarDecls to the if/while/guard statement that they
19961993
/// occur in, when they are in a pattern in a StmtCondition.
19971994
llvm::SmallDenseMap<VarDecl*, LabeledConditionalStmt*> StmtConditionForVD;
1998-
1999-
#ifndef NDEBUG
2000-
llvm::SmallPtrSet<Expr*, 32> AllExprsSeen;
2001-
#endif
20021995

20031996
bool sawError = false;
20041997

@@ -2739,19 +2732,13 @@ void VarDeclUsageChecker::markStoredOrInOutExpr(Expr *E, unsigned Flags) {
27392732

27402733
/// The heavy lifting happens when visiting expressions.
27412734
std::pair<bool, Expr *> VarDeclUsageChecker::walkToExprPre(Expr *E) {
2742-
STATISTIC(VarDeclUsageCheckerExprVisits,
2743-
"# of times VarDeclUsageChecker::walkToExprPre is called");
2744-
++VarDeclUsageCheckerExprVisits;
2745-
27462735
// Sema leaves some subexpressions null, which seems really unfortunate. It
27472736
// should replace them with ErrorExpr.
27482737
if (E == nullptr || !E->getType() || E->getType()->hasError()) {
27492738
sawError = true;
27502739
return { false, E };
27512740
}
27522741

2753-
assert(AllExprsSeen.insert(E).second && "duplicate traversal");
2754-
27552742
// If this is a DeclRefExpr found in a random place, it is a load of the
27562743
// vardecl.
27572744
if (auto *DRE = dyn_cast<DeclRefExpr>(E)) {
@@ -2796,13 +2783,9 @@ std::pair<bool, Expr *> VarDeclUsageChecker::walkToExprPre(Expr *E) {
27962783
return { false, E };
27972784
}
27982785

2799-
// If we see an OpenExistentialExpr, remember the mapping for its OpaqueValue
2800-
// and only walk the subexpr.
2801-
if (auto *oee = dyn_cast<OpenExistentialExpr>(E)) {
2786+
// If we see an OpenExistentialExpr, remember the mapping for its OpaqueValue.
2787+
if (auto *oee = dyn_cast<OpenExistentialExpr>(E))
28022788
OpaqueValueMap[oee->getOpaqueValue()] = oee->getExistentialValue();
2803-
oee->getSubExpr()->walk(*this);
2804-
return { false, E };
2805-
}
28062789

28072790
// Visit bindings.
28082791
if (auto ove = dyn_cast<OpaqueValueExpr>(E)) {

branches/tensorflow/test/Constraints/keypath_dynamic_member_lookup.swift

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -367,26 +367,3 @@ func make_sure_delayed_keypath_dynamic_member_works() {
367367
}
368368
}
369369
}
370-
371-
372-
// SR-11465 - Ambiguity in expression which matches both dynamic member lookup and declaration from constrained extension
373-
374-
@dynamicMemberLookup
375-
struct SR_11465<RawValue> {
376-
var rawValue: RawValue
377-
378-
subscript<Subject>(dynamicMember keyPath: KeyPath<RawValue, Subject>) -> Subject {
379-
rawValue[keyPath: keyPath]
380-
}
381-
}
382-
383-
extension SR_11465: Hashable, Equatable where RawValue: Hashable {
384-
func hash(into hasher: inout Hasher) {
385-
hasher.combine(self.rawValue)
386-
}
387-
}
388-
389-
func test_constrained_ext_vs_dynamic_member() {
390-
// CHECK: function_ref @$s29keypath_dynamic_member_lookup8SR_11465VAASHRzlE9hashValueSivg
391-
_ = SR_11465<Int>(rawValue: 1).hashValue // Ok, keep choice from constrained extension
392-
}

branches/tensorflow/test/ParseableInterface/inherited-generic-parameters.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
// RUN: %target-swift-frontend -typecheck %s -emit-module-interface-path %t/main.swiftinterface -enable-library-evolution
44
// RUN: %FileCheck %s < %t/main.swiftinterface
55

6-
// RUN: %target-build-swift %s -emit-module-interface-path %t/main.swiftinterface -enable-library-evolution
7-
// RUN: %FileCheck %s < %t/main.swiftinterface
6+
// RUN: %target-swift-frontend -emit-module -module-name main -primary-file %s -emit-module-path %t/main~partial.swiftmodule -enable-library-evolution
87

9-
// RUN: %target-build-swift %s -emit-module-interface-path %t/main.swiftinterface -enable-library-evolution -wmo
8+
// RUN: %target-swift-frontend -merge-modules %t/main~partial.swiftmodule -emit-module-path %t/main.swiftmodule -emit-module-interface-path %t/main.swiftinterface -enable-library-evolution
109
// RUN: %FileCheck %s < %t/main.swiftinterface
1110

1211
// This test makes sure that we substitute uses of the superclass's generic

branches/tensorflow/test/ParseableInterface/where-clause.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
// RUN: %target-swift-frontend -typecheck %s -emit-module-interface-path %t/main.swiftinterface -enable-library-evolution
44
// RUN: %FileCheck %s < %t/main.swiftinterface
55

6-
// RUN: %target-build-swift %s -emit-module-interface-path %t/main.swiftinterface -enable-library-evolution
7-
// RUN: %FileCheck %s < %t/main.swiftinterface
6+
// RUN: %target-swift-frontend -emit-module -module-name main -primary-file %s -emit-module-path %t/main~partial.swiftmodule -enable-library-evolution
87

9-
// RUN: %target-build-swift %s -emit-module-interface-path %t/main.swiftinterface -enable-library-evolution -wmo
8+
// RUN: %target-swift-frontend -merge-modules %t/main~partial.swiftmodule -emit-module-path %t/main.swiftmodule -emit-module-interface-path %t/main.swiftinterface -enable-library-evolution
109
// RUN: %FileCheck %s < %t/main.swiftinterface
1110

1211
// CHECK: import Swift

branches/tensorflow/validation-test/compiler_scale/var_decl_usage_checker.swift.gyb

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

0 commit comments

Comments
 (0)