Skip to content

Commit 3df46fd

Browse files
authored
---
yaml --- r: 348857 b: refs/heads/master c: 2b04447 h: refs/heads/master i: 348855: 5d76ecc
1 parent 74f440c commit 3df46fd

File tree

122 files changed

+1154
-1027
lines changed

Some content is hidden

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

122 files changed

+1154
-1027
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: 6e3671da418ad944d3fa62ad0990314015d71952
2+
refs/heads/master: 2b0444713ac8182d6114f08fb0c29fb1ff747a0d
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/include/swift/ABI/Metadata.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -998,8 +998,6 @@ struct TargetClassMetadata : public TargetAnyClassMetadata<Runtime> {
998998
using StoredPointer = typename Runtime::StoredPointer;
999999
using StoredSize = typename Runtime::StoredSize;
10001000

1001-
friend class ReflectionContext;
1002-
10031001
TargetClassMetadata() = default;
10041002
constexpr TargetClassMetadata(const TargetAnyClassMetadata<Runtime> &base,
10051003
ClassFlags flags,

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: 23 additions & 62 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
@@ -423,7 +418,10 @@ class alignas(1 << DeclAlignInBits) Decl {
423418
HasSingleExpressionBody : 1
424419
);
425420

426-
SWIFT_INLINE_BITFIELD(FuncDecl, AbstractFunctionDecl, 1+2+1+1+2,
421+
SWIFT_INLINE_BITFIELD(FuncDecl, AbstractFunctionDecl, 1+1+2+1+1+2,
422+
/// Whether we've computed the 'static' flag yet.
423+
IsStaticComputed : 1,
424+
427425
/// Whether this function is a 'static' method.
428426
IsStatic : 1,
429427

@@ -859,17 +857,6 @@ class alignas(1 << DeclAlignInBits) Decl {
859857
return getValidationState() > ValidationState::Unchecked;
860858
}
861859

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-
873860
bool escapedFromIfConfig() const {
874861
return Bits.Decl.EscapedFromIfConfig;
875862
}
@@ -2610,6 +2597,9 @@ class ValueDecl : public Decl {
26102597
/// if the base declaration is \c open, the override might have to be too.
26112598
bool hasOpenAccess(const DeclContext *useDC) const;
26122599

2600+
/// FIXME: This is deprecated.
2601+
bool isRecursiveValidation() const;
2602+
26132603
/// Retrieve the "interface" type of this value, which uses
26142604
/// GenericTypeParamType if the declaration is generic. For a generic
26152605
/// function, this will have a GenericFunctionType with a
@@ -2769,12 +2759,6 @@ class ValueDecl : public Decl {
27692759
/// Get the representative for this value's opaque result type, if it has one.
27702760
OpaqueReturnTypeRepr *getOpaqueResultTypeRepr() const;
27712761

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-
27782762
/// Retrieve the attribute associating this declaration with a
27792763
/// function builder, if there is one.
27802764
CustomAttr *getAttachedFunctionBuilder() const;
@@ -4535,10 +4519,6 @@ class AbstractStorageDecl : public ValueDecl {
45354519
Bits.AbstractStorageDecl.IsStatic = IsStatic;
45364520
}
45374521

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

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

4782-
void setIsValidKeyPathComponent(bool value) {
4783-
Bits.AbstractStorageDecl.HasComputedValidKeyPathComponent = true;
4784-
Bits.AbstractStorageDecl.ValidKeyPathComponent = value;
4785-
}
4786-
47874762
/// True if the storage can be referenced by a keypath directly.
47884763
/// 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-
}
4764+
bool isValidKeyPathComponent() const;
47944765

47954766
/// True if the storage exports a property descriptor for key paths in
47964767
/// other modules.
@@ -4805,14 +4776,6 @@ class AbstractStorageDecl : public ValueDecl {
48054776

48064777
bool hasAnyDynamicReplacementAccessors() const;
48074778

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-
48164779
// Implement isa/cast/dyncast/etc.
48174780
static bool classof(const Decl *D) {
48184781
return D->getKind() >= DeclKind::First_AbstractStorageDecl &&
@@ -5992,14 +5955,13 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, SelfAccessKind SAK);
59925955
class FuncDecl : public AbstractFunctionDecl {
59935956
friend class AbstractFunctionDecl;
59945957
friend class SelfAccessKindRequest;
5958+
friend class IsStaticRequest;
59955959

59965960
SourceLoc StaticLoc; // Location of the 'static' token or invalid.
59975961
SourceLoc FuncLoc; // Location of the 'func' token.
59985962

59995963
TypeLoc FnRetType;
60005964

6001-
OpaqueTypeDecl *OpaqueReturn = nullptr;
6002-
60035965
protected:
60045966
FuncDecl(DeclKind Kind,
60055967
SourceLoc StaticLoc, StaticSpellingKind StaticSpelling,
@@ -6015,14 +5977,14 @@ class FuncDecl : public AbstractFunctionDecl {
60155977
StaticLoc(StaticLoc), FuncLoc(FuncLoc) {
60165978
assert(!Name.getBaseName().isSpecial());
60175979

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

60225982
Bits.FuncDecl.ForcedStaticDispatch = false;
60235983
Bits.FuncDecl.SelfAccess =
60245984
static_cast<unsigned>(SelfAccessKind::NonMutating);
60255985
Bits.FuncDecl.SelfAccessComputed = false;
5986+
Bits.FuncDecl.IsStaticComputed = false;
5987+
Bits.FuncDecl.IsStatic = false;
60265988
}
60275989

60285990
private:
@@ -6042,6 +6004,13 @@ class FuncDecl : public AbstractFunctionDecl {
60426004
return None;
60436005
}
60446006

6007+
Optional<bool> getCachedIsStatic() const {
6008+
if (Bits.FuncDecl.IsStaticComputed)
6009+
return Bits.FuncDecl.IsStatic;
6010+
6011+
return None;
6012+
}
6013+
60456014
public:
60466015
/// Factory function only for use by deserialization.
60476016
static FuncDecl *createDeserialized(ASTContext &Context, SourceLoc StaticLoc,
@@ -6064,16 +6033,16 @@ class FuncDecl : public AbstractFunctionDecl {
60646033

60656034
Identifier getName() const { return getFullName().getBaseIdentifier(); }
60666035

6067-
bool isStatic() const {
6068-
return Bits.FuncDecl.IsStatic;
6069-
}
6036+
bool isStatic() const;
6037+
60706038
/// \returns the way 'static'/'class' was spelled in the source.
60716039
StaticSpellingKind getStaticSpelling() const {
60726040
return static_cast<StaticSpellingKind>(Bits.FuncDecl.StaticSpelling);
60736041
}
60746042
/// \returns the way 'static'/'class' should be spelled for this declaration.
60756043
StaticSpellingKind getCorrectStaticSpelling() const;
60766044
void setStatic(bool IsStatic = true) {
6045+
Bits.FuncDecl.IsStaticComputed = true;
60776046
Bits.FuncDecl.IsStatic = IsStatic;
60786047
}
60796048

@@ -6145,15 +6114,7 @@ class FuncDecl : public AbstractFunctionDecl {
61456114
}
61466115

61476116
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-
6117+
61576118
/// Returns true if the function is forced to be statically dispatched.
61586119
bool hasForcedStaticDispatch() const {
61596120
return Bits.FuncDecl.ForcedStaticDispatch;

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
///

trunk/include/swift/AST/SearchPathOptions.h

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#ifndef SWIFT_AST_SEARCHPATHOPTIONS_H
1414
#define SWIFT_AST_SEARCHPATHOPTIONS_H
1515

16+
#include "swift/Basic/ArrayRefView.h"
1617
#include "llvm/ADT/Hashing.h"
1718

1819
#include <string>
@@ -81,30 +82,38 @@ class SearchPathOptions {
8182
/// would for a non-system header.
8283
bool DisableModulesValidateSystemDependencies = false;
8384

85+
private:
86+
static StringRef
87+
pathStringFromFrameworkSearchPath(const FrameworkSearchPath &next) {
88+
return next.Path;
89+
};
90+
91+
public:
8492
/// Return a hash code of any components from these options that should
8593
/// contribute to a Swift Bridging PCH hash.
8694
llvm::hash_code getPCHHashComponents() const {
87-
using llvm::hash_value;
8895
using llvm::hash_combine;
89-
auto Code = hash_value(SDKPath);
90-
for (auto Import : ImportSearchPaths) {
91-
Code = hash_combine(Code, Import);
92-
}
93-
for (auto VFSFile : VFSOverlayFiles) {
94-
Code = hash_combine(Code, VFSFile);
95-
}
96-
for (const auto &FrameworkPath : FrameworkSearchPaths) {
97-
Code = hash_combine(Code, FrameworkPath.Path);
98-
}
99-
for (auto LibraryPath : LibrarySearchPaths) {
100-
Code = hash_combine(Code, LibraryPath);
101-
}
102-
Code = hash_combine(Code, RuntimeResourcePath);
103-
for (auto RuntimeLibraryImportPath : RuntimeLibraryImportPaths) {
104-
Code = hash_combine(Code, RuntimeLibraryImportPath);
105-
}
106-
Code = hash_combine(Code, DisableModulesValidateSystemDependencies);
107-
return Code;
96+
using llvm::hash_combine_range;
97+
98+
using FrameworkPathView = ArrayRefView<FrameworkSearchPath, StringRef,
99+
pathStringFromFrameworkSearchPath>;
100+
FrameworkPathView frameworkPathsOnly{FrameworkSearchPaths};
101+
102+
return hash_combine(SDKPath,
103+
hash_combine_range(ImportSearchPaths.begin(),
104+
ImportSearchPaths.end()),
105+
hash_combine_range(VFSOverlayFiles.begin(),
106+
VFSOverlayFiles.end()),
107+
// FIXME: Should we include the system-ness of framework
108+
// search paths too?
109+
hash_combine_range(frameworkPathsOnly.begin(),
110+
frameworkPathsOnly.end()),
111+
hash_combine_range(LibrarySearchPaths.begin(),
112+
LibrarySearchPaths.end()),
113+
RuntimeResourcePath,
114+
hash_combine_range(RuntimeLibraryImportPaths.begin(),
115+
RuntimeLibraryImportPaths.end()),
116+
DisableModulesValidateSystemDependencies);
108117
}
109118
};
110119

trunk/include/swift/AST/SourceFile.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ class SourceFile final : public FileUnit {
117117
/// The scope map that describes this source file.
118118
std::unique_ptr<ASTScope> Scope;
119119

120+
/// The set of validated opaque return type decls in the source file.
121+
llvm::SmallVector<OpaqueTypeDecl *, 4> OpaqueReturnTypes;
122+
llvm::StringMap<OpaqueTypeDecl *> ValidatedOpaqueReturnTypes;
123+
/// The set of parsed decls with opaque return types that have not yet
124+
/// been validated.
125+
llvm::SetVector<ValueDecl *> UnvalidatedDeclsWithOpaqueReturnTypes;
126+
120127
friend ASTContext;
121128
friend Impl;
122129
public:
@@ -130,13 +137,6 @@ class SourceFile final : public FileUnit {
130137
/// The list of local type declarations in the source file.
131138
llvm::SetVector<TypeDecl *> LocalTypeDecls;
132139

133-
/// The set of validated opaque return type decls in the source file.
134-
llvm::SmallVector<OpaqueTypeDecl *, 4> OpaqueReturnTypes;
135-
llvm::StringMap<OpaqueTypeDecl *> ValidatedOpaqueReturnTypes;
136-
/// The set of parsed decls with opaque return types that have not yet
137-
/// been validated.
138-
llvm::DenseSet<ValueDecl *> UnvalidatedDeclsWithOpaqueReturnTypes;
139-
140140
/// A set of special declaration attributes which require the
141141
/// Foundation module to be imported to work. If the foundation
142142
/// module is still not imported by the time type checking is
@@ -430,14 +430,13 @@ class SourceFile final : public FileUnit {
430430
void setSyntaxRoot(syntax::SourceFileSyntax &&Root);
431431
bool hasSyntaxRoot() const;
432432

433-
OpaqueTypeDecl *lookupOpaqueResultType(StringRef MangledName,
434-
LazyResolver *resolver) override;
433+
OpaqueTypeDecl *lookupOpaqueResultType(StringRef MangledName) override;
435434

436435
void addUnvalidatedDeclWithOpaqueResultType(ValueDecl *vd) {
437436
UnvalidatedDeclsWithOpaqueReturnTypes.insert(vd);
438437
}
439438

440-
void markDeclWithOpaqueResultTypeAsValidated(ValueDecl *vd);
439+
ArrayRef<OpaqueTypeDecl *> getOpaqueReturnTypeDecls();
441440

442441
private:
443442

0 commit comments

Comments
 (0)