Skip to content

Commit b334f25

Browse files
authored
---
yaml --- r: 348903 b: refs/heads/master c: f692420 h: refs/heads/master i: 348901: 924d151 348899: 5c02690 348895: 04930ee
1 parent 628f1bb commit b334f25

File tree

170 files changed

+2262
-1901
lines changed

Some content is hidden

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

170 files changed

+2262
-1901
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: b2a1e1c1ffb8994e420358d86fe9b98dc9e59076
2+
refs/heads/master: f692420e317c3da01abcd3b3a951b0b4f46c29ca
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ set(SWIFT_ANALYZE_CODE_COVERAGE FALSE CACHE STRING
125125
# SWIFT_VERSION is deliberately /not/ cached so that an existing build directory
126126
# can be reused when a new version of Swift comes out (assuming the user hasn't
127127
# manually set it as part of their own CMake configuration).
128-
set(SWIFT_VERSION "5.1")
128+
set(SWIFT_VERSION "5.1.1")
129129

130130
set(SWIFT_VENDOR "" CACHE STRING
131131
"The vendor name of the Swift compiler")

trunk/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
| | **Architecture** | **Master** | **Package** |
77
|---|:---:|:---:|:---:|
88
| **macOS** | x86_64 |[![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-osx/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-incremental-RA-osx)|[![Build Status](https://ci.swift.org/job/oss-swift-package-osx/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-osx)|
9-
| **Ubuntu 14.04** | x86_64 | [![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-14_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-14_04)|[![Build Status](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-14_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-14_04)|
109
| **Ubuntu 16.04** | x86_64 | [![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-16_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-16_04)|[![Build Status](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-16_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-16_04)|
1110
| **Ubuntu 18.04** | x86_64 | [![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-18_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-18_04)|[![Build Status](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-18_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-18_04)|
1211

trunk/cmake/modules/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ set(SWIFT_LIBRARY_DIRS ${SWIFT_LIBRARY_OUTPUT_INTDIR})
1616
configure_file(
1717
SwiftConfig.cmake.in
1818
${swift_cmake_builddir}/SwiftConfig.cmake
19-
@ONLY)
19+
@ONLY)

trunk/cmake/modules/SwiftConfig.cmake.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ set(SWIFT_VERSION @SWIFT_VERSION@)
66
set(SWIFT_MAIN_SRC_DIR @SWIFT_SOURCE_DIR@)
77

88
set(SWIFT_INCLUDE_DIRS "@SWIFT_INCLUDE_DIRS@")
9-
set(SWIFT_LIBRARY_DIRS "@SWIFT_CONFIG_LIBRARY_DIRS@")
9+
set(SWIFT_LIBRARY_DIRS "@SWIFT_LIBRARY_DIRS@")
1010

1111
# These variables are duplicated, but they must match the LLVM variables of the
1212
# same name. The variables ending in "S" could some day become lists, and are
1313
# preserved for convention and compatibility.
1414
set(SWIFT_INCLUDE_DIR "@SWIFT_INCLUDE_DIRS@")
15-
set(SWIFT_LIBRARY_DIR "@SWIFT_CONFIG_LIBRARY_DIRS@")
15+
set(SWIFT_LIBRARY_DIR "@SWIFT_LIBRARY_DIRS@")
1616

1717
set(SWIFT_CMAKE_DIR "@SWIFT_CMAKE_DIR@")
1818
set(SWIFT_BINARY_DIR "@SWIFT_BINARY_DIR@")

trunk/include/swift/AST/ASTDemangler.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ class ASTBuilder {
5858
using BuiltTypeDecl = swift::GenericTypeDecl *; // nominal or type alias
5959
using BuiltProtocolDecl = swift::ProtocolDecl *;
6060
explicit ASTBuilder(ASTContext &ctx) : Ctx(ctx) {}
61-
62-
/// The resolver to use for type checking, if necessary.
63-
LazyResolver *Resolver = nullptr;
6461

6562
ASTContext &getASTContext() { return Ctx; }
6663
DeclContext *getNotionalDC();

trunk/include/swift/AST/ASTTypeIDZone.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ SWIFT_TYPEID_NAMED(InfixOperatorDecl *, InfixOperatorDecl)
3333
SWIFT_TYPEID_NAMED(IterableDeclContext *, IterableDeclContext)
3434
SWIFT_TYPEID_NAMED(ModuleDecl *, ModuleDecl)
3535
SWIFT_TYPEID_NAMED(NominalTypeDecl *, NominalTypeDecl)
36+
SWIFT_TYPEID_NAMED(OpaqueTypeDecl *, OpaqueTypeDecl)
3637
SWIFT_TYPEID_NAMED(OperatorDecl *, OperatorDecl)
3738
SWIFT_TYPEID_NAMED(Optional<PropertyWrapperMutability>,
3839
PropertyWrapperMutability)

trunk/include/swift/AST/ASTTypeIDs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class IterableDeclContext;
3434
class ModuleDecl;
3535
class NominalTypeDecl;
3636
class OperatorDecl;
37+
class OpaqueTypeDecl;
3738
class PrecedenceGroupDecl;
3839
struct PropertyWrapperBackingPropertyInfo;
3940
struct PropertyWrapperTypeInfo;

trunk/include/swift/AST/AnyRequest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class AnyRequest {
5454
friend llvm::DenseMapInfo<swift::AnyRequest>;
5555

5656
static hash_code hashForHolder(uint64_t typeID, hash_code requestHash) {
57-
return hash_combine(hash_value(typeID), requestHash);
57+
return hash_combine(typeID, requestHash);
5858
}
5959

6060
/// Abstract base class used to hold the specific request kind.

trunk/include/swift/AST/Decl.h

Lines changed: 34 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -340,12 +340,7 @@ class alignas(1 << DeclAlignInBits) Decl {
340340
IsUserAccessible : 1
341341
);
342342

343-
SWIFT_INLINE_BITFIELD(AbstractStorageDecl, ValueDecl, 1+1+1,
344-
/// Whether a keypath component can directly reference this storage,
345-
/// or if it must use the overridden declaration instead.
346-
HasComputedValidKeyPathComponent : 1,
347-
ValidKeyPathComponent : 1,
348-
343+
SWIFT_INLINE_BITFIELD(AbstractStorageDecl, ValueDecl, 1,
349344
/// Whether this property is a type property (currently unfortunately
350345
/// called 'static').
351346
IsStatic : 1
@@ -393,7 +388,7 @@ class alignas(1 << DeclAlignInBits) Decl {
393388
SWIFT_INLINE_BITFIELD(SubscriptDecl, VarDecl, 2,
394389
StaticSpelling : 2
395390
);
396-
SWIFT_INLINE_BITFIELD(AbstractFunctionDecl, ValueDecl, 3+8+1+1+1+1+1+1+1+1,
391+
SWIFT_INLINE_BITFIELD(AbstractFunctionDecl, ValueDecl, 3+8+1+1+1+1+1+1,
397392
/// \see AbstractFunctionDecl::BodyKind
398393
BodyKind : 3,
399394

@@ -409,12 +404,6 @@ class alignas(1 << DeclAlignInBits) Decl {
409404
/// Whether the function body throws.
410405
Throws : 1,
411406

412-
/// Whether this function requires a new vtable entry.
413-
NeedsNewVTableEntry : 1,
414-
415-
/// Whether NeedsNewVTableEntry is valid.
416-
HasComputedNeedsNewVTableEntry : 1,
417-
418407
/// Whether this member was synthesized as part of a derived
419408
/// protocol conformance.
420409
Synthesized : 1,
@@ -423,7 +412,10 @@ class alignas(1 << DeclAlignInBits) Decl {
423412
HasSingleExpressionBody : 1
424413
);
425414

426-
SWIFT_INLINE_BITFIELD(FuncDecl, AbstractFunctionDecl, 1+2+1+1+2,
415+
SWIFT_INLINE_BITFIELD(FuncDecl, AbstractFunctionDecl, 1+1+2+1+1+2,
416+
/// Whether we've computed the 'static' flag yet.
417+
IsStaticComputed : 1,
418+
427419
/// Whether this function is a 'static' method.
428420
IsStatic : 1,
429421

@@ -859,17 +851,6 @@ class alignas(1 << DeclAlignInBits) Decl {
859851
return getValidationState() > ValidationState::Unchecked;
860852
}
861853

862-
/// Manually indicate that validation is complete for the declaration. For
863-
/// example: during importing, code synthesis, or derived conformances.
864-
///
865-
/// For normal code validation, please use DeclValidationRAII instead.
866-
///
867-
/// FIXME -- Everything should use DeclValidationRAII instead of this.
868-
void setValidationToChecked() {
869-
if (!isBeingValidated())
870-
Bits.Decl.ValidationState = unsigned(ValidationState::Checked);
871-
}
872-
873854
bool escapedFromIfConfig() const {
874855
return Bits.Decl.EscapedFromIfConfig;
875856
}
@@ -2610,6 +2591,9 @@ class ValueDecl : public Decl {
26102591
/// if the base declaration is \c open, the override might have to be too.
26112592
bool hasOpenAccess(const DeclContext *useDC) const;
26122593

2594+
/// FIXME: This is deprecated.
2595+
bool isRecursiveValidation() const;
2596+
26132597
/// Retrieve the "interface" type of this value, which uses
26142598
/// GenericTypeParamType if the declaration is generic. For a generic
26152599
/// function, this will have a GenericFunctionType with a
@@ -2769,12 +2753,6 @@ class ValueDecl : public Decl {
27692753
/// Get the representative for this value's opaque result type, if it has one.
27702754
OpaqueReturnTypeRepr *getOpaqueResultTypeRepr() const;
27712755

2772-
/// Set the opaque return type decl for this decl.
2773-
///
2774-
/// `this` must be of a decl type that supports opaque return types, and
2775-
/// must not have previously had an opaque result type set.
2776-
void setOpaqueResultTypeDecl(OpaqueTypeDecl *D);
2777-
27782756
/// Retrieve the attribute associating this declaration with a
27792757
/// function builder, if there is one.
27802758
CustomAttr *getAttachedFunctionBuilder() const;
@@ -4535,10 +4513,6 @@ class AbstractStorageDecl : public ValueDecl {
45354513
Bits.AbstractStorageDecl.IsStatic = IsStatic;
45364514
}
45374515

4538-
void computeIsValidKeyPathComponent();
4539-
4540-
OpaqueTypeDecl *OpaqueReturn = nullptr;
4541-
45424516
public:
45434517

45444518
/// Should this declaration be treated as if annotated with transparent
@@ -4779,18 +4753,9 @@ class AbstractStorageDecl : public ValueDecl {
47794753
/// property from the given module?
47804754
bool isResilient(ModuleDecl *M, ResilienceExpansion expansion) const;
47814755

4782-
void setIsValidKeyPathComponent(bool value) {
4783-
Bits.AbstractStorageDecl.HasComputedValidKeyPathComponent = true;
4784-
Bits.AbstractStorageDecl.ValidKeyPathComponent = value;
4785-
}
4786-
47874756
/// True if the storage can be referenced by a keypath directly.
47884757
/// Otherwise, its override must be referenced.
4789-
bool isValidKeyPathComponent() const {
4790-
if (!Bits.AbstractStorageDecl.HasComputedValidKeyPathComponent)
4791-
const_cast<AbstractStorageDecl *>(this)->computeIsValidKeyPathComponent();
4792-
return Bits.AbstractStorageDecl.ValidKeyPathComponent;
4793-
}
4758+
bool isValidKeyPathComponent() const;
47944759

47954760
/// True if the storage exports a property descriptor for key paths in
47964761
/// other modules.
@@ -4805,14 +4770,6 @@ class AbstractStorageDecl : public ValueDecl {
48054770

48064771
bool hasAnyDynamicReplacementAccessors() const;
48074772

4808-
OpaqueTypeDecl *getOpaqueResultTypeDecl() const {
4809-
return OpaqueReturn;
4810-
}
4811-
void setOpaqueResultTypeDecl(OpaqueTypeDecl *decl) {
4812-
assert(!OpaqueReturn && "already has opaque type decl");
4813-
OpaqueReturn = decl;
4814-
}
4815-
48164773
// Implement isa/cast/dyncast/etc.
48174774
static bool classof(const Decl *D) {
48184775
return D->getKind() >= DeclKind::First_AbstractStorageDecl &&
@@ -5590,6 +5547,8 @@ class ImportAsMemberStatus {
55905547

55915548
/// Base class for function-like declarations.
55925549
class AbstractFunctionDecl : public GenericContext, public ValueDecl {
5550+
friend class NeedsNewVTableEntryRequest;
5551+
55935552
public:
55945553
enum class BodyKind {
55955554
/// The function did not have a body in the source code file.
@@ -5659,6 +5618,11 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
56595618
/// Location of the 'throws' token.
56605619
SourceLoc ThrowsLoc;
56615620

5621+
struct {
5622+
unsigned NeedsNewVTableEntryComputed : 1;
5623+
unsigned NeedsNewVTableEntry : 1;
5624+
} LazySemanticInfo = { };
5625+
56625626
AbstractFunctionDecl(DeclKind Kind, DeclContext *Parent, DeclName Name,
56635627
SourceLoc NameLoc, bool Throws, SourceLoc ThrowsLoc,
56645628
bool HasImplicitSelfDecl,
@@ -5670,8 +5634,6 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
56705634
Bits.AbstractFunctionDecl.HasImplicitSelfDecl = HasImplicitSelfDecl;
56715635
Bits.AbstractFunctionDecl.Overridden = false;
56725636
Bits.AbstractFunctionDecl.Throws = Throws;
5673-
Bits.AbstractFunctionDecl.NeedsNewVTableEntry = false;
5674-
Bits.AbstractFunctionDecl.HasComputedNeedsNewVTableEntry = false;
56755637
Bits.AbstractFunctionDecl.Synthesized = false;
56765638
Bits.AbstractFunctionDecl.HasSingleExpressionBody = false;
56775639
}
@@ -5841,16 +5803,9 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
58415803
return getBodyKind() == BodyKind::MemberwiseInitializer;
58425804
}
58435805

5844-
void setNeedsNewVTableEntry(bool value) {
5845-
Bits.AbstractFunctionDecl.HasComputedNeedsNewVTableEntry = true;
5846-
Bits.AbstractFunctionDecl.NeedsNewVTableEntry = value;
5847-
}
5848-
5849-
bool needsNewVTableEntry() const {
5850-
if (!Bits.AbstractFunctionDecl.HasComputedNeedsNewVTableEntry)
5851-
const_cast<AbstractFunctionDecl *>(this)->computeNeedsNewVTableEntry();
5852-
return Bits.AbstractFunctionDecl.NeedsNewVTableEntry;
5853-
}
5806+
/// For a method of a class, checks whether it will require a new entry in the
5807+
/// vtable.
5808+
bool needsNewVTableEntry() const;
58545809

58555810
bool isEffectiveLinkageMoreVisibleThan(ValueDecl *other) const {
58565811
return (std::min(getEffectiveAccess(), AccessLevel::Public) >
@@ -5992,14 +5947,13 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, SelfAccessKind SAK);
59925947
class FuncDecl : public AbstractFunctionDecl {
59935948
friend class AbstractFunctionDecl;
59945949
friend class SelfAccessKindRequest;
5950+
friend class IsStaticRequest;
59955951

59965952
SourceLoc StaticLoc; // Location of the 'static' token or invalid.
59975953
SourceLoc FuncLoc; // Location of the 'func' token.
59985954

59995955
TypeLoc FnRetType;
60005956

6001-
OpaqueTypeDecl *OpaqueReturn = nullptr;
6002-
60035957
protected:
60045958
FuncDecl(DeclKind Kind,
60055959
SourceLoc StaticLoc, StaticSpellingKind StaticSpelling,
@@ -6015,14 +5969,14 @@ class FuncDecl : public AbstractFunctionDecl {
60155969
StaticLoc(StaticLoc), FuncLoc(FuncLoc) {
60165970
assert(!Name.getBaseName().isSpecial());
60175971

6018-
Bits.FuncDecl.IsStatic =
6019-
StaticLoc.isValid() || StaticSpelling != StaticSpellingKind::None;
60205972
Bits.FuncDecl.StaticSpelling = static_cast<unsigned>(StaticSpelling);
60215973

60225974
Bits.FuncDecl.ForcedStaticDispatch = false;
60235975
Bits.FuncDecl.SelfAccess =
60245976
static_cast<unsigned>(SelfAccessKind::NonMutating);
60255977
Bits.FuncDecl.SelfAccessComputed = false;
5978+
Bits.FuncDecl.IsStaticComputed = false;
5979+
Bits.FuncDecl.IsStatic = false;
60265980
}
60275981

60285982
private:
@@ -6042,6 +5996,13 @@ class FuncDecl : public AbstractFunctionDecl {
60425996
return None;
60435997
}
60445998

5999+
Optional<bool> getCachedIsStatic() const {
6000+
if (Bits.FuncDecl.IsStaticComputed)
6001+
return Bits.FuncDecl.IsStatic;
6002+
6003+
return None;
6004+
}
6005+
60456006
public:
60466007
/// Factory function only for use by deserialization.
60476008
static FuncDecl *createDeserialized(ASTContext &Context, SourceLoc StaticLoc,
@@ -6064,16 +6025,16 @@ class FuncDecl : public AbstractFunctionDecl {
60646025

60656026
Identifier getName() const { return getFullName().getBaseIdentifier(); }
60666027

6067-
bool isStatic() const {
6068-
return Bits.FuncDecl.IsStatic;
6069-
}
6028+
bool isStatic() const;
6029+
60706030
/// \returns the way 'static'/'class' was spelled in the source.
60716031
StaticSpellingKind getStaticSpelling() const {
60726032
return static_cast<StaticSpellingKind>(Bits.FuncDecl.StaticSpelling);
60736033
}
60746034
/// \returns the way 'static'/'class' should be spelled for this declaration.
60756035
StaticSpellingKind getCorrectStaticSpelling() const;
60766036
void setStatic(bool IsStatic = true) {
6037+
Bits.FuncDecl.IsStaticComputed = true;
60776038
Bits.FuncDecl.IsStatic = IsStatic;
60786039
}
60796040

@@ -6145,15 +6106,7 @@ class FuncDecl : public AbstractFunctionDecl {
61456106
}
61466107

61476108
OperatorDecl *getOperatorDecl() const;
6148-
6149-
OpaqueTypeDecl *getOpaqueResultTypeDecl() const {
6150-
return OpaqueReturn;
6151-
}
6152-
void setOpaqueResultTypeDecl(OpaqueTypeDecl *decl) {
6153-
assert(!OpaqueReturn && "already has opaque type decl");
6154-
OpaqueReturn = decl;
6155-
}
6156-
6109+
61576110
/// Returns true if the function is forced to be statically dispatched.
61586111
bool hasForcedStaticDispatch() const {
61596112
return Bits.FuncDecl.ForcedStaticDispatch;

trunk/include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ ERROR(cannot_convert_argument_value,none,
381381
(Type,Type))
382382

383383
NOTE(candidate_has_invalid_argument_at_position,none,
384-
"candidate expects value of type %0 at position #%1",
384+
"candidate expects value of type %0 for parameter #%1",
385385
(Type, unsigned))
386386

387387
ERROR(cannot_convert_array_to_variadic,none,

trunk/include/swift/AST/FileUnit.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ class FileUnit : public DeclContext {
6060

6161
/// Look up an opaque return type by the mangled name of the declaration
6262
/// that defines it.
63-
virtual OpaqueTypeDecl *lookupOpaqueResultType(StringRef MangledName,
64-
LazyResolver *resolver) {
63+
virtual OpaqueTypeDecl *lookupOpaqueResultType(StringRef MangledName) {
6564
return nullptr;
6665
}
6766

trunk/include/swift/AST/Module.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,7 @@ class ModuleDecl : public DeclContext, public TypeDecl {
354354

355355
/// Look up an opaque return type by the mangled name of the declaration
356356
/// that defines it.
357-
OpaqueTypeDecl *lookupOpaqueResultType(StringRef MangledName,
358-
LazyResolver *resolver);
357+
OpaqueTypeDecl *lookupOpaqueResultType(StringRef MangledName);
359358

360359
/// Find ValueDecls in the module and pass them to the given consumer object.
361360
///

0 commit comments

Comments
 (0)