Skip to content

Commit 047cc43

Browse files
committed
---
yaml --- r: 344031 b: refs/heads/master-rebranch c: 039f67b h: refs/heads/master i: 344029: f6eb1ad 344027: 7be9b55 344023: 964f1a9 344015: 455f961 343999: 5584e73
1 parent 7d5864f commit 047cc43

File tree

231 files changed

+2238
-3746
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

+2238
-3746
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-02-a: ddd2b2976aa9bfde5f20fe37f6bd2
14551455
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-03-a: 171cc166f2abeb5ca2a4003700a8a78a108bd300
14561456
refs/heads/benlangmuir-patch-1: baaebaf39d52f3bf36710d4fe40cf212e996b212
14571457
refs/heads/i-do-redeclare: 8c4e6d5de5c1e3f0a2cedccf319df713ea22c48e
1458-
refs/heads/master-rebranch: 941f19184e7b59547c6c9df9714b179ac4ab20ea
1458+
refs/heads/master-rebranch: 039f67be14b837fdd8f9b22a7b4184dbeb5a48f7
14591459
refs/heads/rdar-53901732: 9bd06af3284e18a109cdbf9aa59d833b24eeca7b
14601460
refs/heads/revert-26776-subst-always-returns-a-type: 1b8e18fdd391903a348970a4c848995d4cdd789c
14611461
refs/heads/tensorflow-merge: 8b854f62f80d4476cb383d43c4aac2001dde3cec

branches/master-rebranch/CHANGELOG.md

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -26,63 +26,6 @@ CHANGELOG
2626
Swift Next
2727
----------
2828

29-
* [SR-11298][]:
30-
31-
A class-constrained protocol extension, where the extended protocol does
32-
not impose a class constraint, will now infer the constraint implicitly.
33-
34-
```swift
35-
protocol Foo {}
36-
class Bar: Foo {
37-
var someProperty: Int = 0
38-
}
39-
40-
// Even though 'Foo' does not impose a class constraint, it is automatically
41-
// inferred due to the Self: Bar constraint.
42-
extension Foo where Self: Bar {
43-
var anotherProperty: Int {
44-
get { return someProperty }
45-
// As a result, the setter is now implicitly nonmutating, just like it would
46-
// be if 'Foo' had a class constraint.
47-
set { someProperty = newValue }
48-
}
49-
}
50-
```
51-
52-
As a result, this could lead to code that currently compiles today to throw an error.
53-
54-
```swift
55-
protocol Foo {
56-
var someProperty: Int { get set }
57-
}
58-
59-
class Bar: Foo {
60-
var someProperty = 0
61-
}
62-
63-
extension Foo where Self: Bar {
64-
var anotherProperty1: Int {
65-
get { return someProperty }
66-
// This will now error, because the protocol requirement
67-
// is implicitly mutating and the setter is implicitly
68-
// nonmutating.
69-
set { someProperty = newValue } // Error
70-
}
71-
}
72-
```
73-
74-
**Workaround**: Define a new mutable variable inside the setter that has a reference to `self`:
75-
76-
```swift
77-
var anotherProperty1: Int {
78-
get { return someProperty }
79-
set {
80-
var mutableSelf = self
81-
mutableSelf.someProperty = newValue // Okay
82-
}
83-
}
84-
```
85-
8629
* [SE-0253][]:
8730

8831
Values of types that declare `func callAsFunction` methods can be called
@@ -108,7 +51,7 @@ Swift Next
10851

10952
* [SR-4206][]:
11053

111-
A method override is no longer allowed to have a generic signature with
54+
A method override is no longer allowed to have a generic signature with
11255
requirements not imposed by the base method. For example:
11356

11457
```
@@ -7822,4 +7765,3 @@ Swift 1.0
78227765
[SR-8974]: <https://bugs.swift.org/browse/SR-8974>
78237766
[SR-9043]: <https://bugs.swift.org/browse/SR-9043>
78247767
[SR-9827]: <https://bugs.swift.org/browse/SR-9827>
7825-
[SR-11298]: <https://bugs.swift.org/browse/SR-11298>

branches/master-rebranch/include/swift/AST/ASTNode.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ namespace swift {
3636
enum class DeclKind : uint8_t;
3737
enum class StmtKind;
3838

39-
struct ASTNode : public llvm::PointerUnion<Expr*, Stmt*, Decl*> {
39+
struct ASTNode : public llvm::PointerUnion3<Expr*, Stmt*, Decl*> {
4040
// Inherit the constructors from PointerUnion.
41-
using PointerUnion::PointerUnion;
42-
41+
using PointerUnion3::PointerUnion3;
42+
4343
SourceRange getSourceRange() const;
4444

4545
/// Return the location of the start of the statement.

branches/master-rebranch/include/swift/AST/Builtins.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ BUILTIN_BINARY_OPERATION(ExactUDiv, "udiv_exact", "n", IntegerOrVector)
7575
BUILTIN_BINARY_OPERATION(URem, "urem", "n", Integer)
7676
BUILTIN_BINARY_OPERATION(FRem, "frem", "n", FloatOrVector)
7777
BUILTIN_BINARY_OPERATION(Xor, "xor", "n", IntegerOrVector)
78-
// This builtin is an optimizer hint and always returns the first argument.
79-
BUILTIN_BINARY_OPERATION(Expect, "int_expect", "n", Integer)
8078
#undef BUILTIN_BINARY_OPERATION
8179

8280
/// These builtins are analogous the similarly named llvm intrinsics. The

branches/master-rebranch/include/swift/AST/Decl.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,13 +1505,12 @@ class alignas(8) _GenericContext {
15051505
TrailingWhereClause *TrailingWhere = nullptr;
15061506

15071507
/// The generic signature of this declaration.
1508-
llvm::PointerIntPair<GenericSignature *, 1, bool> GenericSigAndBit;
1508+
GenericSignature *GenericSig = nullptr;
15091509
};
15101510

15111511
class GenericContext : private _GenericContext, public DeclContext {
15121512
friend class GenericParamListRequest;
1513-
friend class GenericSignatureRequest;
1514-
1513+
15151514
protected:
15161515
GenericContext(DeclContextKind Kind, DeclContext *Parent,
15171516
GenericParamList *Params);
@@ -1535,8 +1534,7 @@ class GenericContext : private _GenericContext, public DeclContext {
15351534
/// }
15361535
/// \endcode
15371536
bool isGeneric() const { return getGenericParams() != nullptr; }
1538-
bool hasComputedGenericSignature() const;
1539-
1537+
15401538
/// Retrieve the trailing where clause for this extension, if any.
15411539
TrailingWhereClause *getTrailingWhereClause() const {
15421540
return TrailingWhere;
@@ -4790,7 +4788,7 @@ class VarDecl : public AbstractStorageDecl {
47904788
};
47914789

47924790
protected:
4793-
PointerUnion<PatternBindingDecl *, Stmt *, VarDecl *> Parent;
4791+
PointerUnion3<PatternBindingDecl *, Stmt *, VarDecl *> Parent;
47944792

47954793
VarDecl(DeclKind kind, bool isStatic, Introducer introducer,
47964794
bool issCaptureList, SourceLoc nameLoc, Identifier name,

branches/master-rebranch/include/swift/AST/DeclContext.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,7 @@ class alignas(1 << DeclContextAlignInBits) DeclContext {
261261

262262
/// Returns the kind of context this is.
263263
DeclContextKind getContextKind() const;
264-
265-
/// Returns whether this context has value semantics.
266-
bool hasValueSemantics() const;
267-
264+
268265
/// Determines whether this context is itself a local scope in a
269266
/// code block. A context that appears in such a scope, like a
270267
/// local type declaration, does not itself become a local context.

branches/master-rebranch/include/swift/AST/DiagnosticsClangImporter.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ WARNING(implicit_bridging_header_imported_from_module,none,
9191
"is deprecated and will be removed in a later version of Swift",
9292
(StringRef, Identifier))
9393

94+
WARNING(clang_vfs_overlay_is_ignored,none,
95+
"ignoring '-ivfsoverlay' options provided to '-Xcc' in favor of "
96+
"'-vfsoverlay'", ())
97+
9498
#ifndef DIAG_NO_UNDEF
9599
# if defined(DIAG)
96100
# undef DIAG

branches/master-rebranch/include/swift/AST/DiagnosticsSIL.def

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -360,75 +360,61 @@ ERROR(pound_assert_failure,none,
360360
NOTE(constexpr_unknown_reason_default,none,
361361
"cannot evaluate expression as constant here", ())
362362
NOTE(constexpr_unevaluable_operation,none,
363-
"cannot constant evaluate operation%select{| used by this call}0", (bool))
363+
"cannot constant evaluate operation", ())
364364

365365
NOTE(constexpr_too_many_instructions,none,
366366
"exceeded instruction limit: %0 when evaluating the expression "
367367
"at compile time", (unsigned))
368-
NOTE(constexpr_limit_exceeding_instruction,none, "limit exceeded "
369-
"%select{here|during this call}0", (bool))
368+
NOTE(constexpr_limit_exceeding_instruction,none, "limit exceeded here", ())
370369

371370
NOTE(constexpr_loop_found_note,none,
372371
"control-flow loop found during evaluation ", ())
373-
NOTE(constexpr_loop_instruction,none, "found loop "
374-
"%select{here|inside this call}0", (bool))
372+
NOTE(constexpr_loop_instruction,none, "found loop here", ())
375373

376374
NOTE(constexpr_overflow,none, "integer overflow detected", ())
377-
NOTE(constexpr_overflow_operation,none, "operation"
378-
"%select{| performed during this call}0 overflows", (bool))
375+
NOTE(constexpr_overflow_operation,none, "operation overflows", ())
379376

380377
NOTE(constexpr_trap,none, "trap detected", ())
381-
NOTE(constexpr_trap_operation,none, "operation"
382-
"%select{| performed during this call}0 traps", (bool))
383-
384-
NOTE(constexpr_assertion_failed, none, "assertion failed with message: %0",
385-
(StringRef))
386-
NOTE(constexpr_assertion_failed_here, none, "assertion failed"
387-
"%select{ here| during this call}0 ", (bool))
378+
NOTE(constexpr_trap_operation,none, "operation traps", ())
388379

389380
NOTE(constexpr_invalid_operand_seen, none,
390381
"operation with invalid operands encountered during evaluation",())
391382
NOTE(constexpr_operand_invalid_here, none,
392-
"operation with invalid operands encountered "
393-
"%select{here|during this call}0", (bool))
383+
"operation with invalid operands encountered here",())
394384

395385
NOTE(constexpr_value_unknown_at_top_level,none,
396386
"cannot evaluate top-level value as constant here",())
397387
NOTE(constexpr_multiple_writers_found_at_top_level,none,
398388
"top-level value has multiple assignments",())
399389

400390
NOTE(constexpr_unsupported_instruction_found, none,
401-
"encountered operation not supported by the evaluator: %0", (StringRef))
402-
NOTE(constexpr_unsupported_instruction_found_here,none, "operation"
403-
"%select{| used by this call is}0 not supported by the evaluator", (bool))
391+
"encountered operation not supported by the evaluator", ())
392+
NOTE(constexpr_unsupported_instruction_found_here,none,
393+
"operation not supported by the evaluator", ())
404394

405395
NOTE(constexpr_unknown_function_called, none,
406-
"encountered call to '%0' whose body is not available", (StringRef))
396+
"encountered call to a function whose body is not available", ())
407397
NOTE(constexpr_unknown_function_called_here, none,
408-
"%select{|calls a }0function whose body is not available", (bool))
398+
"call to a function whose body is not available", ())
409399

410400
NOTE(constexpr_untracked_sil_value_use_found, none,
411401
"encountered use of a variable not tracked by the evaluator", ())
412402
NOTE(constexpr_untracked_sil_value_used_here, none,
413-
"untracked variable used %select{here|by this call}0", (bool))
414-
415-
NOTE(constexpr_unresolvable_witness_call, none,
416-
"encountered unresolvable witness method call: '%0'", (StringRef))
417-
NOTE(constexpr_no_witness_table_entry, none, "cannot find witness table entry "
418-
"%select{for this call|for a witness-method invoked during this call}0",
419-
(bool))
420-
NOTE(constexpr_witness_call_with_no_conformance, none,
421-
"cannot find concrete conformance "
422-
"%select{for this call|for a witness-method invoked during this call}0",
423-
(bool))
403+
"untracked variable used here", ())
404+
405+
NOTE(constexpr_witness_call_with_no_conformance_found, none,
406+
"cannot find concrete conformance for a witness method call", ())
407+
NOTE(constexpr_witness_call_with_no_target_found, none,
408+
"cannot resolve a witness method call to a concrete function", ())
409+
NOTE(constexpr_witness_call_found_here, none,
410+
"witness method call found here", ())
424411

425412
NOTE(constexpr_unknown_control_flow_due_to_skip,none, "branch depends on "
426413
"non-constant value produced by an unevaluated instructions", ())
427414
NOTE(constexpr_returned_by_unevaluated_instruction,none,
428415
"return value of an unevaluated instruction is not a constant", ())
429416
NOTE(constexpr_mutated_by_unevaluated_instruction,none, "value mutable by an "
430417
"unevaluated instruction is not a constant", ())
431-
ERROR(not_constant_evaluable, none, "not constant evaluable", ())
432418

433419
ERROR(non_physical_addressof,none,
434420
"addressof only works with purely physical lvalues; "

branches/master-rebranch/include/swift/AST/GenericSignatureBuilder.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ class GenericSignatureBuilder {
9292
class ResolvedType;
9393

9494
using UnresolvedRequirementRHS =
95-
llvm::PointerUnion<Type, PotentialArchetype *, LayoutConstraint>;
95+
llvm::PointerUnion3<Type, PotentialArchetype *, LayoutConstraint>;
9696

9797
using RequirementRHS =
98-
llvm::PointerUnion<Type, PotentialArchetype *, LayoutConstraint>;
98+
llvm::PointerUnion3<Type, PotentialArchetype *, LayoutConstraint>;
9999

100100
/// The location of a requirement as written somewhere in the source.
101101
typedef llvm::PointerUnion<const TypeRepr *, const RequirementRepr *>
@@ -1373,8 +1373,8 @@ class GenericSignatureBuilder::FloatingRequirementSource {
13731373
} kind;
13741374

13751375
using Storage =
1376-
llvm::PointerUnion<const RequirementSource *, const TypeRepr *,
1377-
const RequirementRepr *>;
1376+
llvm::PointerUnion3<const RequirementSource *, const TypeRepr *,
1377+
const RequirementRepr *>;
13781378

13791379
Storage storage;
13801380

branches/master-rebranch/include/swift/AST/ModuleLoader.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
#include "llvm/ADT/SmallSet.h"
2525
#include "llvm/ADT/TinyPtrVector.h"
2626

27-
namespace llvm {
28-
class FileCollector;
29-
}
30-
3127
namespace clang {
3228
class DependencyCollector;
3329
}
@@ -58,9 +54,8 @@ enum class Bridgeability : unsigned {
5854
class DependencyTracker {
5955
std::shared_ptr<clang::DependencyCollector> clangCollector;
6056
public:
61-
explicit DependencyTracker(
62-
bool TrackSystemDeps,
63-
std::shared_ptr<llvm::FileCollector> FileCollector = {});
57+
58+
explicit DependencyTracker(bool TrackSystemDeps);
6459

6560
/// Adds a file as a dependency.
6661
///

branches/master-rebranch/include/swift/AST/TypeCheckRequests.h

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ struct WhereClauseOwner {
365365

366366
/// The source of the where clause, which can be a generic parameter list
367367
/// or a declaration that can have a where clause.
368-
llvm::PointerUnion<GenericParamList *, Decl *, SpecializeAttr *> source;
368+
llvm::PointerUnion3<GenericParamList *, Decl *, SpecializeAttr *> source;
369369

370370
WhereClauseOwner(Decl *decl);
371371

@@ -1160,27 +1160,6 @@ class FunctionOperatorRequest :
11601160
bool isCached() const { return true; }
11611161
};
11621162

1163-
class GenericSignatureRequest :
1164-
public SimpleRequest<GenericSignatureRequest,
1165-
GenericSignature *(GenericContext *),
1166-
CacheKind::SeparatelyCached> {
1167-
public:
1168-
using SimpleRequest::SimpleRequest;
1169-
1170-
private:
1171-
friend SimpleRequest;
1172-
1173-
// Evaluation.
1174-
llvm::Expected<GenericSignature *>
1175-
evaluate(Evaluator &evaluator, GenericContext *value) const;
1176-
1177-
public:
1178-
// Separate caching.
1179-
bool isCached() const { return true; }
1180-
Optional<GenericSignature *> getCachedResult() const;
1181-
void cacheResult(GenericSignature *value) const;
1182-
};
1183-
11841163
// Allow AnyValue to compare two Type values, even though Type doesn't
11851164
// support ==.
11861165
template<>

branches/master-rebranch/include/swift/AST/TypeCheckerTypeIDZone.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ SWIFT_REQUEST(TypeChecker, FunctionBuilderTypeRequest, Type(ValueDecl *),
4949
Cached, NoLocationInfo)
5050
SWIFT_REQUEST(TypeChecker, FunctionOperatorRequest, OperatorDecl *(FuncDecl *),
5151
Cached, NoLocationInfo)
52-
SWIFT_REQUEST(NameLookup, GenericSignatureRequest,
53-
GenericSignature *(GenericContext *),
54-
SeparatelyCached, NoLocationInfo)
5552
SWIFT_REQUEST(TypeChecker, InferredGenericSignatureRequest,
5653
GenericSignature *(ModuleDecl *, GenericSignature *,
5754
SmallVector<GenericParamList *, 2>,

branches/master-rebranch/include/swift/Basic/LLVM.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ namespace llvm {
4242
template<typename T> class MutableArrayRef;
4343
template<typename T> class TinyPtrVector;
4444
template<typename T> class Optional;
45-
template <typename ...PTs> class PointerUnion;
45+
template <typename PT1, typename PT2> class PointerUnion;
46+
template <typename PT1, typename PT2, typename PT3> class PointerUnion3;
4647
class SmallBitVector;
4748

4849
// Other common classes.
@@ -67,6 +68,7 @@ namespace swift {
6768
using llvm::None;
6869
using llvm::Optional;
6970
using llvm::PointerUnion;
71+
using llvm::PointerUnion3;
7072
using llvm::SmallBitVector;
7173
using llvm::SmallPtrSet;
7274
using llvm::SmallPtrSetImpl;

branches/master-rebranch/include/swift/ClangImporter/ClangImporter.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
namespace llvm {
2525
class Triple;
26-
class FileCollector;
2726
template<typename Fn> class function_ref;
2827
}
2928

@@ -150,8 +149,7 @@ class ClangImporter final : public ClangModuleLoader {
150149
/// Create a new clang::DependencyCollector customized to
151150
/// ClangImporter's specific uses.
152151
static std::shared_ptr<clang::DependencyCollector>
153-
createDependencyCollector(bool TrackSystemDeps,
154-
std::shared_ptr<llvm::FileCollector> FileCollector);
152+
createDependencyCollector(bool TrackSystemDeps);
155153

156154
/// Append visible module names to \p names. Note that names are possibly
157155
/// duplicated, and not guaranteed to be ordered in any way.

0 commit comments

Comments
 (0)