Skip to content

Commit 3d70871

Browse files
committed
---
yaml --- r: 348839 b: refs/heads/master c: 70b1d91 h: refs/heads/master i: 348837: e40957c 348835: 24d3917 348831: 192c5a0
1 parent 48a85ca commit 3d70871

File tree

98 files changed

+672
-796
lines changed

Some content is hidden

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

98 files changed

+672
-796
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: f6226d926cfe650764a7a726e4ddf6fdbb230eba
2+
refs/heads/master: 70b1d91315daf48ef28eb0787da9f6bd5cebffd3
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.1")
128+
set(SWIFT_VERSION "5.1")
129129

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

trunk/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
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)|
910
| **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)|
1011
| **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)|
1112

trunk/include/swift/ABI/Metadata.h

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

1001+
friend class ReflectionContext;
1002+
10011003
TargetClassMetadata() = default;
10021004
constexpr TargetClassMetadata(const TargetAnyClassMetadata<Runtime> &base,
10031005
ClassFlags flags,

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(typeID, requestHash);
57+
return hash_combine(hash_value(typeID), requestHash);
5858
}
5959

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

trunk/include/swift/AST/Decl.h

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

343-
SWIFT_INLINE_BITFIELD(AbstractStorageDecl, ValueDecl, 1,
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+
344349
/// Whether this property is a type property (currently unfortunately
345350
/// called 'static').
346351
IsStatic : 1
@@ -4530,6 +4535,8 @@ class AbstractStorageDecl : public ValueDecl {
45304535
Bits.AbstractStorageDecl.IsStatic = IsStatic;
45314536
}
45324537

4538+
void computeIsValidKeyPathComponent();
4539+
45334540
OpaqueTypeDecl *OpaqueReturn = nullptr;
45344541

45354542
public:
@@ -4772,9 +4779,18 @@ class AbstractStorageDecl : public ValueDecl {
47724779
/// property from the given module?
47734780
bool isResilient(ModuleDecl *M, ResilienceExpansion expansion) const;
47744781

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

47794795
/// True if the storage exports a property descriptor for key paths in
47804796
/// other modules.

trunk/include/swift/AST/SearchPathOptions.h

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

16-
#include "swift/Basic/ArrayRefView.h"
1716
#include "llvm/ADT/Hashing.h"
1817

1918
#include <string>
@@ -82,38 +81,30 @@ class SearchPathOptions {
8281
/// would for a non-system header.
8382
bool DisableModulesValidateSystemDependencies = false;
8483

85-
private:
86-
static StringRef
87-
pathStringFromFrameworkSearchPath(const FrameworkSearchPath &next) {
88-
return next.Path;
89-
};
90-
91-
public:
9284
/// Return a hash code of any components from these options that should
9385
/// contribute to a Swift Bridging PCH hash.
9486
llvm::hash_code getPCHHashComponents() const {
87+
using llvm::hash_value;
9588
using llvm::hash_combine;
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);
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;
117108
}
118109
};
119110

trunk/include/swift/AST/TypeCheckRequests.h

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,8 @@ struct WhereClauseOwner {
380380
SourceLoc getLoc() const;
381381

382382
friend hash_code hash_value(const WhereClauseOwner &owner) {
383-
return llvm::hash_combine(owner.dc, owner.source.getOpaqueValue());
383+
return hash_combine(hash_value(owner.dc),
384+
hash_value(owner.source.getOpaqueValue()));
384385
}
385386

386387
friend bool operator==(const WhereClauseOwner &lhs,
@@ -1208,7 +1209,6 @@ class UnderlyingTypeRequest :
12081209
bool isCached() const { return true; }
12091210
Optional<Type> getCachedResult() const;
12101211
void cacheResult(Type value) const;
1211-
void diagnoseCycle(DiagnosticEngine &diags) const;
12121212
};
12131213

12141214
class OperatorPrecedenceGroupRequest
@@ -1255,23 +1255,6 @@ class EnumRawValuesRequest :
12551255
void cacheResult(bool value) const;
12561256
};
12571257

1258-
class IsABICompatibleOverrideRequest
1259-
: public SimpleRequest<IsABICompatibleOverrideRequest, bool(ValueDecl *),
1260-
CacheKind::Cached> {
1261-
public:
1262-
using SimpleRequest::SimpleRequest;
1263-
1264-
private:
1265-
friend SimpleRequest;
1266-
1267-
// Evaluation.
1268-
llvm::Expected<bool> evaluate(Evaluator &evaluator, ValueDecl *decl) const;
1269-
1270-
public:
1271-
// Caching.
1272-
bool isCached() const { return true; }
1273-
};
1274-
12751258
// Allow AnyValue to compare two Type values, even though Type doesn't
12761259
// support ==.
12771260
template<>

trunk/include/swift/AST/TypeCheckerTypeIDZone.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,3 @@ SWIFT_REQUEST(TypeChecker, UnderlyingTypeRequest, Type(TypeAliasDecl *),
142142
SeparatelyCached, NoLocationInfo)
143143
SWIFT_REQUEST(TypeChecker, USRGenerationRequest, std::string(const ValueDecl *),
144144
Cached, NoLocationInfo)
145-
SWIFT_REQUEST(TypeChecker, IsABICompatibleOverrideRequest,
146-
bool(ValueDecl *), Cached, NoLocationInfo)

trunk/include/swift/AST/TypeLoc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ struct TypeLoc {
6868
TypeLoc clone(ASTContext &ctx) const;
6969

7070
friend llvm::hash_code hash_value(const TypeLoc &owner) {
71-
return llvm::hash_combine(owner.Ty.getPointer(), owner.TyR);
71+
return hash_combine(llvm::hash_value(owner.Ty.getPointer()),
72+
llvm::hash_value(owner.TyR));
7273
}
7374

7475
friend bool operator==(const TypeLoc &lhs,

trunk/include/swift/Basic/LangOptions.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,6 @@ namespace swift {
325325
/// set to true.
326326
bool ExperimentalDependenciesIncludeIntrafileOnes = false;
327327

328-
/// Whether to enable experimental differentiable programming features:
329-
/// `@differentiable` declaration attribute, etc.
330-
bool EnableExperimentalDifferentiableProgramming = false;
331-
332328
/// Sets the target we are building for and updates platform conditions
333329
/// to match.
334330
///
@@ -445,10 +441,12 @@ namespace swift {
445441
/// Return a hash code of any components from these options that should
446442
/// contribute to a Swift Bridging PCH hash.
447443
llvm::hash_code getPCHHashComponents() const {
444+
auto code = llvm::hash_value(Target.str());
448445
SmallString<16> Scratch;
449446
llvm::raw_svector_ostream OS(Scratch);
450447
OS << EffectiveLanguageVersion;
451-
return llvm::hash_combine(Target.str(), OS.str());
448+
code = llvm::hash_combine(code, OS.str());
449+
return code;
452450
}
453451

454452
private:

trunk/include/swift/Basic/SourceLoc.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,10 @@ template <> struct DenseMapInfo<swift::SourceRange> {
265265
}
266266

267267
static unsigned getHashValue(const swift::SourceRange &Val) {
268-
return hash_combine(Val.Start.getOpaquePointerValue(),
269-
Val.End.getOpaquePointerValue());
268+
return hash_combine(DenseMapInfo<const void *>::getHashValue(
269+
Val.Start.getOpaquePointerValue()),
270+
DenseMapInfo<const void *>::getHashValue(
271+
Val.End.getOpaquePointerValue()));
270272
}
271273

272274
static bool isEqual(const swift::SourceRange &LHS,

trunk/include/swift/ClangImporter/ClangImporterOptions.h

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,23 @@ class ClangImporterOptions {
9999
/// Return a hash code of any components from these options that should
100100
/// contribute to a Swift Bridging PCH hash.
101101
llvm::hash_code getPCHHashComponents() const {
102+
using llvm::hash_value;
102103
using llvm::hash_combine;
103-
using llvm::hash_combine_range;
104-
105-
return hash_combine(ModuleCachePath,
106-
hash_combine_range(ExtraArgs.begin(), ExtraArgs.end()),
107-
OverrideResourceDir,
108-
TargetCPU,
109-
BridgingHeader,
110-
PrecompiledHeaderOutputDir,
111-
static_cast<uint8_t>(Mode),
112-
DetailedPreprocessingRecord,
113-
ImportForwardDeclarations,
114-
InferImportAsMember,
115-
DisableSwiftBridgeAttr,
116-
DisableOverlayModules);
104+
105+
auto Code = hash_value(ModuleCachePath);
106+
Code = hash_combine(Code, llvm::hash_combine_range(ExtraArgs.begin(),
107+
ExtraArgs.end()));
108+
Code = hash_combine(Code, OverrideResourceDir);
109+
Code = hash_combine(Code, TargetCPU);
110+
Code = hash_combine(Code, BridgingHeader);
111+
Code = hash_combine(Code, PrecompiledHeaderOutputDir);
112+
Code = hash_combine(Code, static_cast<uint8_t>(Mode));
113+
Code = hash_combine(Code, DetailedPreprocessingRecord);
114+
Code = hash_combine(Code, ImportForwardDeclarations);
115+
Code = hash_combine(Code, InferImportAsMember);
116+
Code = hash_combine(Code, DisableSwiftBridgeAttr);
117+
Code = hash_combine(Code, DisableOverlayModules);
118+
return Code;
117119
}
118120
};
119121

trunk/include/swift/IDE/IDERequests.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ struct CursorInfoOwner {
3838
CursorInfoOwner(SourceFile *File, SourceLoc Loc): File(File), Loc(Loc) { }
3939

4040
friend llvm::hash_code hash_value(const CursorInfoOwner &CI) {
41-
return llvm::hash_combine(CI.File, CI.Loc.getOpaquePointerValue());
41+
return hash_combine(hash_value(CI.File),
42+
hash_value(CI.Loc.getOpaquePointerValue()));
4243
}
4344

4445
friend bool operator==(const CursorInfoOwner &lhs, const CursorInfoOwner &rhs) {
@@ -96,9 +97,9 @@ struct RangeInfoOwner {
9697
RangeInfoOwner(SourceFile *File, unsigned Offset, unsigned Length);
9798

9899
friend llvm::hash_code hash_value(const RangeInfoOwner &CI) {
99-
return llvm::hash_combine(CI.File,
100-
CI.StartLoc.getOpaquePointerValue(),
101-
CI.EndLoc.getOpaquePointerValue());
100+
return hash_combine(hash_value(CI.File),
101+
hash_value(CI.StartLoc.getOpaquePointerValue()),
102+
hash_value(CI.EndLoc.getOpaquePointerValue()));
102103
}
103104

104105
friend bool operator==(const RangeInfoOwner &lhs, const RangeInfoOwner &rhs) {
@@ -182,9 +183,9 @@ struct OverridenDeclsOwner {
182183
Transitive(Transitive) {}
183184

184185
friend llvm::hash_code hash_value(const OverridenDeclsOwner &CI) {
185-
return llvm::hash_combine(CI.VD,
186-
CI.IncludeProtocolRequirements,
187-
CI.Transitive);
186+
return hash_combine(hash_value(CI.VD),
187+
hash_value(CI.IncludeProtocolRequirements),
188+
hash_value(CI.Transitive));
188189
}
189190

190191
friend bool operator==(const OverridenDeclsOwner &lhs,

trunk/include/swift/Option/Options.td

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,6 @@ def disable_bridging_pch : Flag<["-"], "disable-bridging-pch">,
424424
Flags<[HelpHidden]>,
425425
HelpText<"Disable automatic generation of bridging PCH files">;
426426

427-
// Experimental feature options
428-
def enable_experimental_differentiable_programming : Flag<["-"], "enable-experimental-differentiable-programming">,
429-
Flags<[FrontendOption]>,
430-
HelpText<"Enable experimental differentiable programming features">;
431-
432427
// Diagnostic control options
433428
def suppress_warnings : Flag<["-"], "suppress-warnings">,
434429
Flags<[FrontendOption]>,

trunk/include/swift/Parse/ASTGen.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ class ASTGen {
6767

6868
private:
6969
DeclAttributes
70-
generateDeclAttributes(const syntax::Syntax &D, SourceLoc Loc,
71-
bool includeComments);
70+
generateDeclAttributes(const syntax::DeclSyntax &D,
71+
const Optional<syntax::AttributeListSyntax> &attrs,
72+
const Optional<syntax::ModifierListSyntax> &modifiers,
73+
SourceLoc Loc, bool includeComments);
7274

7375
void generateFreeStandingGenericWhereClause(
7476
const syntax::GenericWhereClauseSyntax &syntax,

trunk/include/swift/Parse/Parser.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -895,9 +895,9 @@ class Parser {
895895
bool parseMatchingToken(tok K, SourceLoc &TokLoc, Diag<> ErrorDiag,
896896
SourceLoc OtherLoc);
897897

898-
ParsedSyntaxResult<ParsedTokenSyntax>
899-
parseMatchingTokenSyntax(tok K, Diag<> ErrorDiag, SourceLoc OtherLoc,
900-
bool silenceDiag = false);
898+
llvm::Optional<ParsedTokenSyntax>
899+
parseMatchingTokenSyntax(tok K, SourceLoc &TokLoc, Diag<> ErrorDiag,
900+
SourceLoc OtherLoc);
901901

902902
/// Returns the proper location for a missing right brace, parenthesis, etc.
903903
SourceLoc getLocForMissingMatchingToken() const;
@@ -919,6 +919,7 @@ class Parser {
919919
llvm::function_ref<ParserStatus()> callback);
920920
ParserStatus parseListSyntax(tok RightK, SourceLoc LeftLoc,
921921
llvm::Optional<ParsedTokenSyntax> &LastComma,
922+
SourceLoc &RightLoc,
922923
llvm::Optional<ParsedTokenSyntax> &Right,
923924
llvm::SmallVectorImpl<ParsedSyntax>& Junk,
924925
bool AllowSepAfterLast, Diag<> ErrorDiag,

trunk/include/swift/Sema/IDETypeCheckingRequests.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ struct DeclApplicabilityOwner {
3838
DC(DC), Ty(Ty), ExtensionOrMember(VD) {}
3939

4040
friend llvm::hash_code hash_value(const DeclApplicabilityOwner &CI) {
41-
return llvm::hash_combine(CI.Ty.getPointer(), CI.ExtensionOrMember);
41+
return hash_combine(hash_value(CI.Ty.getPointer()),
42+
hash_value(CI.ExtensionOrMember));
4243
}
4344

4445
friend bool operator==(const DeclApplicabilityOwner &lhs,
@@ -95,8 +96,8 @@ struct TypePair {
9596
TypePair(Type FirstTy, Type SecondTy): FirstTy(FirstTy), SecondTy(SecondTy) {}
9697
TypePair(): TypePair(Type(), Type()) {}
9798
friend llvm::hash_code hash_value(const TypePair &TI) {
98-
return llvm::hash_combine(TI.FirstTy.getPointer(),
99-
TI.SecondTy.getPointer());
99+
return hash_combine(hash_value(TI.FirstTy.getPointer()),
100+
hash_value(TI.SecondTy.getPointer()));
100101
}
101102

102103
friend bool operator==(const TypePair &lhs,
@@ -132,7 +133,9 @@ struct TypeRelationCheckInput {
132133
OpenArchetypes(OpenArchetypes) {}
133134

134135
friend llvm::hash_code hash_value(const TypeRelationCheckInput &TI) {
135-
return llvm::hash_combine(TI.Pair, TI.Relation, TI.OpenArchetypes);
136+
return hash_combine(hash_value(TI.Pair),
137+
hash_value(TI.Relation),
138+
hash_value(TI.OpenArchetypes));
136139
}
137140

138141
friend bool operator==(const TypeRelationCheckInput &lhs,

0 commit comments

Comments
 (0)