Skip to content

Commit 87b7597

Browse files
committed
---
yaml --- r: 343643 b: refs/heads/master-rebranch c: d434188 h: refs/heads/master i: 343641: 48e84d0 343639: 7329cc1
1 parent a52c9d5 commit 87b7597

File tree

130 files changed

+1189
-1325
lines changed

Some content is hidden

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

130 files changed

+1189
-1325
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: aa7fa85a3734a7d52b622efd5f6efee828061ce9
1458+
refs/heads/master-rebranch: d434188157fbe3e9cb94b46bdb5b5370dcd89177
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/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/ASTTypeIDZone.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,3 @@ SWIFT_TYPEID_NAMED(GenericSignature *, GenericSignature)
3535
SWIFT_TYPEID_NAMED(GenericTypeParamType *, GenericTypeParamType)
3636
SWIFT_TYPEID(Requirement)
3737
SWIFT_TYPEID_NAMED(IterableDeclContext *, IterableDeclContext)
38-
SWIFT_TYPEID_NAMED(GenericParamList *, GenericParamList)

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ namespace swift {
2323

2424
class CustomAttr;
2525
class Decl;
26-
class GenericParamList;
2726
class GenericSignature;
2827
class GenericTypeParamType;
2928
class IterableDeclContext;

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

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ class alignas(RequirementRepr) TrailingWhereClause final :
14961496
class alignas(8) _GenericContext {
14971497
// Not really public. See GenericContext.
14981498
public:
1499-
llvm::PointerIntPair<GenericParamList *, 1, bool> GenericParamsAndBit;
1499+
GenericParamList *GenericParams = nullptr;
15001500

15011501
/// The trailing where clause.
15021502
///
@@ -1509,16 +1509,16 @@ class alignas(8) _GenericContext {
15091509
};
15101510

15111511
class GenericContext : private _GenericContext, public DeclContext {
1512-
friend class GenericParamListRequest;
1513-
15141512
protected:
1515-
GenericContext(DeclContextKind Kind, DeclContext *Parent,
1516-
GenericParamList *Params);
1513+
GenericContext(DeclContextKind Kind, DeclContext *Parent)
1514+
: _GenericContext(), DeclContext(Kind, Parent) { }
15171515

15181516
public:
15191517
/// Retrieve the set of parameters to a generic context, or null if
15201518
/// this context is not generic.
1521-
GenericParamList *getGenericParams() const;
1519+
GenericParamList *getGenericParams() const { return GenericParams; }
1520+
1521+
void setGenericParams(GenericParamList *GenericParams);
15221522

15231523
/// Determine whether this context has generic parameters
15241524
/// of its own.
@@ -1533,7 +1533,7 @@ class GenericContext : private _GenericContext, public DeclContext {
15331533
/// func p() // isGeneric == false
15341534
/// }
15351535
/// \endcode
1536-
bool isGeneric() const { return getGenericParams() != nullptr; }
1536+
bool isGeneric() const { return GenericParams != nullptr; }
15371537

15381538
/// Retrieve the trailing where clause for this extension, if any.
15391539
TrailingWhereClause *getTrailingWhereClause() const {
@@ -1771,6 +1771,8 @@ class ExtensionDecl final : public GenericContext, public Decl,
17711771
return getValidationState() > ValidationState::CheckingWithValidSignature;
17721772
}
17731773

1774+
void createGenericParamsIfMissing(NominalTypeDecl *nominal);
1775+
17741776
bool hasDefaultAccessLevel() const {
17751777
return Bits.ExtensionDecl.DefaultAndMaxAccessLevel != 0;
17761778
}
@@ -3326,6 +3328,7 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
33263328
GenericTypeDecl(K, DC, name, NameLoc, inherited, GenericParams),
33273329
IterableDeclContext(IterableDeclContextKind::NominalTypeDecl)
33283330
{
3331+
setGenericParams(GenericParams);
33293332
Bits.NominalTypeDecl.AddedImplicitInitializers = false;
33303333
ExtensionGeneration = 0;
33313334
Bits.NominalTypeDecl.HasLazyConformances = false;
@@ -4341,6 +4344,10 @@ class ProtocolDecl final : public NominalTypeDecl {
43414344
/// with the Objective-C runtime.
43424345
StringRef getObjCRuntimeName(llvm::SmallVectorImpl<char> &buffer) const;
43434346

4347+
/// Create the generic parameters of this protocol if they haven't been
4348+
/// created yet.
4349+
void createGenericParamsIfMissing();
4350+
43444351
/// Retrieve the requirements that describe this protocol.
43454352
///
43464353
/// These are the requirements including any inherited protocols
@@ -4788,7 +4795,7 @@ class VarDecl : public AbstractStorageDecl {
47884795
};
47894796

47904797
protected:
4791-
PointerUnion<PatternBindingDecl *, Stmt *, VarDecl *> Parent;
4798+
PointerUnion3<PatternBindingDecl *, Stmt *, VarDecl *> Parent;
47924799

47934800
VarDecl(DeclKind kind, bool isStatic, Introducer introducer,
47944801
bool issCaptureList, SourceLoc nameLoc, Identifier name,
@@ -5430,7 +5437,7 @@ class SubscriptDecl : public GenericContext, public AbstractStorageDecl {
54305437
SourceLoc SubscriptLoc, ParameterList *Indices,
54315438
SourceLoc ArrowLoc, TypeLoc ElementTy, DeclContext *Parent,
54325439
GenericParamList *GenericParams)
5433-
: GenericContext(DeclContextKind::SubscriptDecl, Parent, GenericParams),
5440+
: GenericContext(DeclContextKind::SubscriptDecl, Parent),
54345441
AbstractStorageDecl(DeclKind::Subscript,
54355442
StaticSpelling != StaticSpellingKind::None,
54365443
Parent, Name, SubscriptLoc,
@@ -5439,6 +5446,7 @@ class SubscriptDecl : public GenericContext, public AbstractStorageDecl {
54395446
Indices(nullptr), ElementTy(ElementTy) {
54405447
Bits.SubscriptDecl.StaticSpelling = static_cast<unsigned>(StaticSpelling);
54415448
setIndices(Indices);
5449+
setGenericParams(GenericParams);
54425450
}
54435451

54445452
/// \returns the way 'static'/'class' was spelled in the source.
@@ -5603,10 +5611,11 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
56035611
SourceLoc NameLoc, bool Throws, SourceLoc ThrowsLoc,
56045612
bool HasImplicitSelfDecl,
56055613
GenericParamList *GenericParams)
5606-
: GenericContext(DeclContextKind::AbstractFunctionDecl, Parent, GenericParams),
5614+
: GenericContext(DeclContextKind::AbstractFunctionDecl, Parent),
56075615
ValueDecl(Kind, Parent, Name, NameLoc),
56085616
Body(nullptr), ThrowsLoc(ThrowsLoc) {
56095617
setBodyKind(BodyKind::None);
5618+
setGenericParams(GenericParams);
56105619
Bits.AbstractFunctionDecl.HasImplicitSelfDecl = HasImplicitSelfDecl;
56115620
Bits.AbstractFunctionDecl.Overridden = false;
56125621
Bits.AbstractFunctionDecl.Throws = Throws;
@@ -7258,16 +7267,6 @@ inline void simple_display(llvm::raw_ostream &out,
72587267
simple_display(out, static_cast<const Decl *>(decl));
72597268
}
72607269

7261-
/// Display GenericContext.
7262-
///
7263-
/// The template keeps this sorted down in the overload set relative to the
7264-
/// more concrete overloads with Decl pointers thereby breaking a potential ambiguity.
7265-
template <typename T>
7266-
inline typename std::enable_if<std::is_same<T, GenericContext>::value>::type
7267-
simple_display(llvm::raw_ostream &out, const T *GC) {
7268-
simple_display(out, GC->getAsDecl());
7269-
}
7270-
72717270
/// Display GenericParamList.
72727271
void simple_display(llvm::raw_ostream &out, const GenericParamList *GPL);
72737272

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

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ namespace swift {
2525

2626
class ClassDecl;
2727
class DestructorDecl;
28-
class GenericContext;
29-
class GenericParamList;
3028
class TypeAliasDecl;
3129
class TypeDecl;
3230

@@ -252,27 +250,6 @@ class GetDestructorRequest :
252250
void cacheResult(DestructorDecl *value) const;
253251
};
254252

255-
class GenericParamListRequest :
256-
public SimpleRequest<GenericParamListRequest,
257-
GenericParamList *(GenericContext *),
258-
CacheKind::SeparatelyCached> {
259-
public:
260-
using SimpleRequest::SimpleRequest;
261-
262-
private:
263-
friend SimpleRequest;
264-
265-
// Evaluation.
266-
llvm::Expected<GenericParamList *>
267-
evaluate(Evaluator &evaluator, GenericContext *value) const;
268-
269-
public:
270-
// Separate caching.
271-
bool isCached() const { return true; }
272-
Optional<GenericParamList *> getCachedResult() const;
273-
void cacheResult(GenericParamList *value) const;
274-
};
275-
276253
#define SWIFT_TYPEID_ZONE NameLookup
277254
#define SWIFT_TYPEID_HEADER "swift/AST/NameLookupTypeIDZone.def"
278255
#include "swift/Basic/DefineTypeIDZone.h"

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ SWIFT_REQUEST(NameLookup, CustomAttrNominalRequest,
2121
SWIFT_REQUEST(NameLookup, ExtendedNominalRequest,
2222
NominalTypeDecl *(ExtensionDecl *), SeparatelyCached,
2323
NoLocationInfo)
24-
SWIFT_REQUEST(NameLookup, GenericParamListRequest,
25-
GenericParamList *(GenericContext *), SeparatelyCached,
26-
NoLocationInfo)
2724
SWIFT_REQUEST(NameLookup, GetDestructorRequest, DestructorDecl *(ClassDecl *),
2825
SeparatelyCached, NoLocationInfo)
2926
SWIFT_REQUEST(NameLookup, InheritedDeclsReferencedRequest,

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

Lines changed: 1 addition & 1 deletion
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

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4193,10 +4193,6 @@ class SILBoxType final : public TypeBase, public llvm::FoldingSetNode
41934193
SILLayout *getLayout() const { return Layout; }
41944194
SubstitutionMap getSubstitutions() const { return Substitutions; }
41954195

4196-
// In SILType.h:
4197-
CanType getFieldLoweredType(SILModule &M, unsigned index) const;
4198-
SILType getFieldType(SILModule &M, unsigned index) const;
4199-
42004196
// TODO: SILBoxTypes should be explicitly constructed in terms of specific
42014197
// layouts. As a staging mechanism, we expose the old single-boxed-type
42024198
// interface.

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.

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

branches/master-rebranch/include/swift/Parse/Parser.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#include "llvm/ADT/SetVector.h"
4141

4242
namespace llvm {
43-
template <typename... PTs> class PointerUnion;
43+
template <typename PT1, typename PT2, typename PT3> class PointerUnion3;
4444
}
4545

4646
namespace swift {
@@ -1589,7 +1589,7 @@ class Parser {
15891589
AssociatedType
15901590
};
15911591
ParserStatus
1592-
parseFreestandingGenericWhereClause(GenericParamList *GPList,
1592+
parseFreestandingGenericWhereClause(GenericParamList *&GPList,
15931593
WhereClauseKind kind=WhereClauseKind::Declaration);
15941594

15951595
ParserStatus parseGenericWhereClause(

branches/master-rebranch/include/swift/SIL/Projection.h

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -292,30 +292,7 @@ class Projection {
292292
///
293293
/// WARNING: This is not a constant time operation because it is implemented
294294
/// in terms of getVarDecl, which requests all BaseType's stored properties.
295-
SILType getType(SILType BaseType, SILModule &M) const {
296-
assert(isValid());
297-
switch (getKind()) {
298-
case ProjectionKind::Struct:
299-
case ProjectionKind::Class:
300-
return BaseType.getFieldType(getVarDecl(BaseType), M);
301-
case ProjectionKind::Enum:
302-
return BaseType.getEnumElementType(getEnumElementDecl(BaseType), M);
303-
case ProjectionKind::Box:
304-
return BaseType.castTo<SILBoxType>()->getFieldType(M, getIndex());
305-
case ProjectionKind::Tuple:
306-
return BaseType.getTupleElementType(getIndex());
307-
case ProjectionKind::Upcast:
308-
case ProjectionKind::RefCast:
309-
case ProjectionKind::BitwiseCast:
310-
case ProjectionKind::TailElems:
311-
return getCastType(BaseType);
312-
case ProjectionKind::Index:
313-
// Index types do not change the underlying type.
314-
return BaseType;
315-
}
316-
317-
llvm_unreachable("Unhandled ProjectionKind in switch.");
318-
}
295+
SILType getType(SILType BaseType, SILModule &M) const;
319296

320297
VarDecl *getVarDecl(SILType BaseType) const {
321298
assert(isValid());

0 commit comments

Comments
 (0)