Skip to content

Commit 05c8471

Browse files
committed
---
yaml --- r: 343418 b: refs/heads/master-rebranch c: 992cc03 h: refs/heads/master
1 parent d95e1f2 commit 05c8471

File tree

167 files changed

+1638
-1730
lines changed

Some content is hidden

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

167 files changed

+1638
-1730
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: 8c17868afaf157d2b0d551027d8a376af8a80e7f
1458+
refs/heads/master-rebranch: 992cc032a7c7b12ca5964bce6a7e0728a0a48ddf
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: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,6 @@ CHANGELOG
2626
Swift Next
2727
----------
2828

29-
* [SE-0253][]:
30-
31-
Values of types that declare `func callAsFunction` methods can be called
32-
like functions. The call syntax is shorthand for applying
33-
`func callAsFunction` methods.
34-
35-
```swift
36-
struct Adder {
37-
var base: Int
38-
func callAsFunction(_ x: Int) -> Int {
39-
return x + base
40-
}
41-
}
42-
var adder = Adder(base: 3)
43-
adder(10) // returns 13, same as `adder.callAsFunction(10)`
44-
```
45-
46-
* `func callAsFunction` argument labels are required at call sites.
47-
* Multiple `func callAsFunction` methods on a single type are supported.
48-
* `mutating func callAsFunction` is supported.
49-
* `func callAsFunction` works with `throws` and `rethrows`.
50-
* `func callAsFunction` works with trailing closures.
51-
5229
* [SR-4206][]:
5330

5431
A method override is no longer allowed to have a generic signature with
@@ -7734,7 +7711,6 @@ Swift 1.0
77347711
[SE-0244]: <https://github.com/apple/swift-evolution/blob/master/proposals/0244-opaque-result-types.md>
77357712
[SE-0245]: <https://github.com/apple/swift-evolution/blob/master/proposals/0245-array-uninitialized-initializer.md>
77367713
[SE-0252]: <https://github.com/apple/swift-evolution/blob/master/proposals/0252-keypath-dynamic-member-lookup.md>
7737-
[SE-0253]: <https://github.com/apple/swift-evolution/blob/master/proposals/0253-callable.md>
77387714
[SE-0254]: <https://github.com/apple/swift-evolution/blob/master/proposals/0254-static-subscripts.md>
77397715

77407716
[SR-106]: <https://bugs.swift.org/browse/SR-106>

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ namespace swift {
6969
class LazyGenericContextData;
7070
class LazyIterableDeclContextData;
7171
class LazyMemberLoader;
72+
class LazyMemberParser;
7273
class LazyResolver;
7374
class PatternBindingDecl;
7475
class PatternBindingInitializer;
@@ -424,6 +425,12 @@ class ASTContext final {
424425
void setLazyResolver(LazyResolver *resolver);
425426

426427
public:
428+
/// Add a lazy parser for resolving members later.
429+
void addLazyParser(LazyMemberParser *parser);
430+
431+
/// Remove a lazy parser.
432+
void removeLazyParser(LazyMemberParser *parser);
433+
427434
/// getIdentifier - Return the uniqued and AST-Context-owned version of the
428435
/// specified string.
429436
Identifier getIdentifier(StringRef Str) const;
@@ -815,6 +822,12 @@ class ASTContext final {
815822
LazyContextData *getOrCreateLazyContextData(const DeclContext *decl,
816823
LazyMemberLoader *lazyLoader);
817824

825+
/// Use the lazy parsers associated with the context to populate the members
826+
/// of the given decl context.
827+
///
828+
/// \param IDC The context whose member decls should be lazily parsed.
829+
std::vector<Decl *> parseMembers(IterableDeclContext *IDC);
830+
818831
/// Get the lazy function data for the given generic context.
819832
///
820833
/// \param lazyLoader If non-null, the lazy loader to use when creating the

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/Decl.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4789,7 +4789,7 @@ class VarDecl : public AbstractStorageDecl {
47894789
};
47904790

47914791
protected:
4792-
PointerUnion<PatternBindingDecl *, Stmt *, VarDecl *> Parent;
4792+
PointerUnion3<PatternBindingDecl *, Stmt *, VarDecl *> Parent;
47934793

47944794
VarDecl(DeclKind kind, bool isStatic, Introducer introducer,
47954795
bool issCaptureList, SourceLoc nameLoc, Identifier name,
@@ -5594,8 +5594,6 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
55945594
SourceRange BodyRange;
55955595
};
55965596

5597-
friend class ParseAbstractFunctionBodyRequest;
5598-
55995597
CaptureInfo Captures;
56005598

56015599
/// Location of the 'throws' token.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ namespace swift {
5151
class GenericParamList;
5252
class LazyResolver;
5353
class LazyMemberLoader;
54+
class LazyMemberParser;
5455
class GenericSignature;
5556
class GenericTypeParamDecl;
5657
class GenericTypeParamType;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ namespace swift {
657657
}
658658

659659
/// Return all \c DiagnosticConsumers.
660-
ArrayRef<DiagnosticConsumer *> getConsumers() const {
660+
ArrayRef<DiagnosticConsumer *> getConsumers() {
661661
return Consumers;
662662
}
663663

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class DiagnosticSuppression {
3737
public:
3838
explicit DiagnosticSuppression(DiagnosticEngine &diags);
3939
~DiagnosticSuppression();
40-
static bool isEnabled(const DiagnosticEngine &diags);
4140
};
4241

4342
}

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/DiagnosticsSema.def

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,9 @@ ERROR(cannot_convert_default_arg_value,none,
361361
(Type,Type))
362362
ERROR(cannot_convert_default_arg_value_protocol,none,
363363
"default argument value of type %0 does not conform to %1", (Type,Type))
364+
ERROR(default_argument_literal_cannot_convert, none,
365+
"cannot call %0 %1 because default argument of type %2 cannot be "
366+
"converted to type %3", (DescriptiveDeclKind, DeclName, Type, Type))
364367
ERROR(cannot_convert_default_arg_value_nil,none,
365368
"nil default argument value cannot be converted to type %0", (Type))
366369

@@ -1625,11 +1628,6 @@ NOTE(objc_generic_extension_using_type_parameter_here,none,
16251628
"generic parameter used here", ())
16261629
NOTE(objc_generic_extension_using_type_parameter_try_objc,none,
16271630
"add '@objc' to allow uses of 'self' within the function body", ())
1628-
ERROR(invalid_nominal_extension,none,
1629-
"extension of type %0 must be declared as an extension of %1",
1630-
(Type, Type))
1631-
NOTE(invalid_nominal_extension_rewrite,none,
1632-
"did you mean to extend %0 instead?", (Type))
16331631

16341632
// Protocols
16351633
ERROR(type_does_not_conform,none,

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 *>
@@ -1374,8 +1374,8 @@ class GenericSignatureBuilder::FloatingRequirementSource {
13741374
} kind;
13751375

13761376
using Storage =
1377-
llvm::PointerUnion<const RequirementSource *, const TypeRepr *,
1378-
const RequirementRepr *>;
1377+
llvm::PointerUnion3<const RequirementSource *, const TypeRepr *,
1378+
const RequirementRepr *>;
13791379

13801380
Storage storage;
13811381

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ class DeclName {
590590
llvm::raw_ostream &printPretty(llvm::raw_ostream &os) const;
591591

592592
/// Dump this name to standard error.
593-
LLVM_ATTRIBUTE_DEPRECATED(void dump() const LLVM_ATTRIBUTE_USED,
593+
LLVM_ATTRIBUTE_DEPRECATED(void dump() const,
594594
"only for use within the debugger");
595595
};
596596

@@ -672,7 +672,7 @@ class ObjCSelector {
672672
}
673673

674674
/// Dump this selector to standard error.
675-
LLVM_ATTRIBUTE_DEPRECATED(void dump() const LLVM_ATTRIBUTE_USED,
675+
LLVM_ATTRIBUTE_DEPRECATED(void dump() const,
676676
"only for use within the debugger");
677677

678678
/// Compare two Objective-C selectors, producing -1 if \c *this comes before

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,21 @@ class LazyContextData {
8585
LazyMemberLoader *loader;
8686
};
8787

88+
/// A class that can lazily parse members for an iterable decl context.
89+
class LazyMemberParser {
90+
public:
91+
virtual ~LazyMemberParser() = default;
92+
93+
/// Retrieves the parsed members for the given decl context \p IDC.
94+
virtual std::vector<Decl *> parseMembers(IterableDeclContext *IDC) = 0;
95+
96+
/// Return whether the iterable decl context needs parsing.
97+
virtual bool hasUnparsedMembers(const IterableDeclContext *IDC) = 0;
98+
99+
/// Parse all delayed decl list members.
100+
virtual void parseAllDelayedDeclLists() = 0;
101+
};
102+
88103
/// Context data for generic contexts.
89104
class LazyGenericContextData : public LazyContextData {
90105
public:

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/ParseRequests.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,6 @@ class ParseMembersRequest :
4848
bool isCached() const { return true; }
4949
};
5050

51-
/// Parse the body of a function, initializer, or deinitializer.
52-
class ParseAbstractFunctionBodyRequest :
53-
public SimpleRequest<ParseAbstractFunctionBodyRequest,
54-
BraceStmt *(AbstractFunctionDecl *),
55-
CacheKind::SeparatelyCached>
56-
{
57-
public:
58-
using SimpleRequest::SimpleRequest;
59-
60-
private:
61-
friend SimpleRequest;
62-
63-
// Evaluation.
64-
BraceStmt *evaluate(Evaluator &evaluator, AbstractFunctionDecl *afd) const;
65-
66-
public:
67-
// Caching
68-
bool isCached() const { return true; }
69-
Optional<BraceStmt *> getCachedResult() const;
70-
void cacheResult(BraceStmt *value) const;
71-
};
72-
7351
/// The zone number for the parser.
7452
#define SWIFT_TYPEID_ZONE Parse
7553
#define SWIFT_TYPEID_HEADER "swift/AST/ParseTypeIDZone.def"

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@
1515
//===----------------------------------------------------------------------===//
1616

1717
SWIFT_REQUEST(Parse, ParseMembersRequest)
18-
SWIFT_REQUEST(Parse, ParseAbstractFunctionBodyRequest)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ struct WhereClauseOwner {
369369

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

374374
WhereClauseOwner(Decl *decl);
375375

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

@@ -148,8 +147,7 @@ class ClangImporter final : public ClangModuleLoader {
148147
/// Create a new clang::DependencyCollector customized to
149148
/// ClangImporter's specific uses.
150149
static std::shared_ptr<clang::DependencyCollector>
151-
createDependencyCollector(bool TrackSystemDeps,
152-
std::shared_ptr<llvm::FileCollector> FileCollector);
150+
createDependencyCollector(bool TrackSystemDeps);
153151

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

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ class ClangImporterOptions {
9696
/// When set, don't enforce warnings with -Werror.
9797
bool DebuggerSupport = false;
9898

99+
/// When set, clobber the Clang instance's virtual file system with the Swift
100+
/// virtual file system.
101+
bool ForceUseSwiftVirtualFileSystem = false;
102+
99103
/// Return a hash code of any components from these options that should
100104
/// contribute to a Swift Bridging PCH hash.
101105
llvm::hash_code getPCHHashComponents() const {

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ class CompilerInstance {
616616

617617
private:
618618
void createREPLFile(const ImplicitImports &implicitImports);
619+
std::unique_ptr<DelayedParsingCallbacks> computeDelayedParsingCallback();
619620

620621
void addMainFileToModule(const ImplicitImports &implicitImports);
621622

@@ -624,17 +625,20 @@ class CompilerInstance {
624625
SourceFile::ASTStage_t LimitStage);
625626

626627
void parseLibraryFile(unsigned BufferID,
627-
const ImplicitImports &implicitImports);
628+
const ImplicitImports &implicitImports,
629+
DelayedParsingCallbacks *DelayedCB);
628630

629631
/// Return true if had load error
630632
bool
631-
parsePartialModulesAndLibraryFiles(const ImplicitImports &implicitImports);
633+
parsePartialModulesAndLibraryFiles(const ImplicitImports &implicitImports,
634+
DelayedParsingCallbacks *DelayedCB);
632635

633636
OptionSet<TypeCheckingFlags> computeTypeCheckingOptions();
634637

635638
void forEachFileToTypeCheck(llvm::function_ref<void(SourceFile &)> fn);
636639

637640
void parseAndTypeCheckMainFileUpTo(SourceFile::ASTStage_t LimitStage,
641+
DelayedParsingCallbacks *DelayedParseCB,
638642
OptionSet<TypeCheckingFlags> TypeCheckOptions);
639643

640644
void finishTypeChecking(OptionSet<TypeCheckingFlags> TypeCheckOptions);

branches/master-rebranch/include/swift/LLVMPasses/Passes.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,8 @@ namespace swift {
3030
const llvm::PreservedAnalyses &) { return false; }
3131

3232
using AAResultBase::getModRefInfo;
33-
llvm::ModRefInfo getModRefInfo(const llvm::CallBase *Call,
34-
const llvm::MemoryLocation &Loc) {
35-
llvm::AAQueryInfo AAQI;
36-
return getModRefInfo(Call, Loc, AAQI);
37-
}
38-
llvm::ModRefInfo getModRefInfo(const llvm::CallBase *Call,
39-
const llvm::MemoryLocation &Loc,
40-
llvm::AAQueryInfo &AAQI);
33+
llvm::ModRefInfo getModRefInfo(llvm::ImmutableCallSite CS,
34+
const llvm::MemoryLocation &Loc);
4135
};
4236

4337
class SwiftAAWrapperPass : public llvm::ImmutablePass {

0 commit comments

Comments
 (0)