Skip to content

Commit 87ffe22

Browse files
committed
---
yaml --- r: 344315 b: refs/heads/master-rebranch c: 574a450 h: refs/heads/master i: 344313: 61060a8 344311: 7af9e2b
1 parent 639cc00 commit 87ffe22

File tree

75 files changed

+710
-1031
lines changed

Some content is hidden

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

75 files changed

+710
-1031
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: b88ee7a7adf452a484ae2c1f1c775fe478cb989d
1458+
refs/heads/master-rebranch: 574a450537294e802ceb684f349ad169e14f868a
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/cmake/modules/SwiftHandleGybSources.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ function(handle_gyb_sources dependency_out_var_name sources_var_name arch)
118118
"${SWIFT_SOURCE_DIR}/utils/gyb_syntax_support/AttributeNodes.py"
119119
"${SWIFT_SOURCE_DIR}/utils/gyb_syntax_support/AvailabilityNodes.py"
120120
"${SWIFT_SOURCE_DIR}/utils/gyb_syntax_support/CommonNodes.py"
121-
"${SWIFT_SOURCE_DIR}/utils/gyb_syntax_support/CompletionOnlyNodes.py"
122121
"${SWIFT_SOURCE_DIR}/utils/gyb_syntax_support/DeclNodes.py"
123122
"${SWIFT_SOURCE_DIR}/utils/gyb_syntax_support/ExprNodes.py"
124123
"${SWIFT_SOURCE_DIR}/utils/gyb_syntax_support/GenericNodes.py"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ class InferredGenericSignatureRequest :
10941094
public SimpleRequest<InferredGenericSignatureRequest,
10951095
GenericSignature *(ModuleDecl *,
10961096
GenericSignature *,
1097-
SmallVector<GenericParamList *, 2>,
1097+
GenericParamList *,
10981098
SmallVector<Requirement, 2>,
10991099
SmallVector<TypeLoc, 2>,
11001100
bool),
@@ -1110,7 +1110,7 @@ class InferredGenericSignatureRequest :
11101110
evaluate(Evaluator &evaluator,
11111111
ModuleDecl *module,
11121112
GenericSignature *baseSignature,
1113-
SmallVector<GenericParamList *, 2> addedParameters,
1113+
GenericParamList *gpl,
11141114
SmallVector<Requirement, 2> addedRequirements,
11151115
SmallVector<TypeLoc, 2> inferenceSources,
11161116
bool allowConcreteGenericParams) const;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ SWIFT_REQUEST(NameLookup, GenericSignatureRequest,
5454
SeparatelyCached, NoLocationInfo)
5555
SWIFT_REQUEST(TypeChecker, InferredGenericSignatureRequest,
5656
GenericSignature *(ModuleDecl *, GenericSignature *,
57-
SmallVector<GenericParamList *, 2>,
57+
GenericParamList *,
5858
SmallVector<Requirement, 2>,
5959
SmallVector<TypeLoc, 2>, bool),
6060
Cached, NoLocationInfo)

branches/master-rebranch/include/swift/Option/FrontendOptions.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ def tbd_compatibility_version
8686
def tbd_compatibility_version_EQ : Joined<["-"], "tbd-compatibility-version=">,
8787
Alias<tbd_compatibility_version>;
8888

89-
def tbd_is_installapi: Flag<["-"], "tbd-is-installapi">,
90-
HelpText<"If the TBD file should indicate it's being generated during "
91-
"InstallAPI">;
92-
9389
def verify : Flag<["-"], "verify">,
9490
HelpText<"Verify diagnostics against expected-{error|warning|note} "
9591
"annotations">;

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

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "swift/AST/ASTContext.h"
1717
#include "swift/AST/Decl.h"
1818
#include "swift/AST/Expr.h"
19-
#include "swift/AST/TypeRepr.h"
2019
#include "swift/Parse/PersistentParserState.h"
2120
#include "swift/Syntax/SyntaxNodes.h"
2221
#include "llvm/ADT/DenseMap.h"
@@ -44,30 +43,6 @@ class ASTGen {
4443

4544
SourceLoc generate(const syntax::TokenSyntax &Tok, const SourceLoc Loc);
4645

47-
SourceLoc generateIdentifierDeclName(const syntax::TokenSyntax &Tok,
48-
const SourceLoc, Identifier &Identifier);
49-
50-
public:
51-
//===--------------------------------------------------------------------===//
52-
// Decls.
53-
54-
Decl *generate(const syntax::DeclSyntax &Decl, const SourceLoc Loc);
55-
TypeDecl *generate(const syntax::AssociatedtypeDeclSyntax &Decl,
56-
const SourceLoc Loc);
57-
58-
TrailingWhereClause *generate(const syntax::GenericWhereClauseSyntax &syntax,
59-
const SourceLoc Loc);
60-
MutableArrayRef<TypeLoc>
61-
generate(const syntax::TypeInheritanceClauseSyntax &syntax,
62-
const SourceLoc Loc, bool allowClassRequirement);
63-
64-
private:
65-
DeclAttributes
66-
generateDeclAttributes(const syntax::DeclSyntax &D,
67-
const Optional<syntax::AttributeListSyntax> &attrs,
68-
const Optional<syntax::ModifierListSyntax> &modifiers,
69-
SourceLoc Loc, bool includeComments);
70-
7146
public:
7247
//===--------------------------------------------------------------------===//
7348
// Expressions.
@@ -122,10 +97,6 @@ class ASTGen {
12297
const SourceLoc Loc);
12398
TypeRepr *generate(const syntax::ImplicitlyUnwrappedOptionalTypeSyntax &Type,
12499
const SourceLoc Loc);
125-
TypeRepr *generate(const syntax::ClassRestrictionTypeSyntax &Type,
126-
const SourceLoc Loc);
127-
TypeRepr *generate(const syntax::CodeCompletionTypeSyntax &Type,
128-
const SourceLoc Loc);
129100
TypeRepr *generate(const syntax::UnknownTypeSyntax &Type,
130101
const SourceLoc Loc);
131102

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ class CodeCompletionCallbacks {
4040
/// completion. This declaration contained the code completion token.
4141
Decl *ParsedDecl = nullptr;
4242

43-
TypeLoc ParsedTypeLoc;
44-
4543
/// True if code completion is done inside a raw value expression of an enum
4644
/// case.
4745
bool InEnumElementRawValue = false;
@@ -78,10 +76,6 @@ class CodeCompletionCallbacks {
7876
ParsedDecl = D;
7977
}
8078

81-
void setParsedTypeLoc(TypeLoc TyLoc) {
82-
ParsedTypeLoc = TyLoc;
83-
}
84-
8579
void setLeadingSequenceExprs(ArrayRef<Expr *> exprs) {
8680
leadingSequenceExprs.assign(exprs.begin(), exprs.end());
8781
}
@@ -165,10 +159,10 @@ class CodeCompletionCallbacks {
165159
virtual void completeTypeSimpleBeginning() {};
166160

167161
/// Complete a given type-identifier after we have consumed the dot.
168-
virtual void completeTypeIdentifierWithDot() {};
162+
virtual void completeTypeIdentifierWithDot(IdentTypeRepr *ITR) {};
169163

170164
/// Complete a given type-identifier when there is no trailing dot.
171-
virtual void completeTypeIdentifierWithoutDot() {};
165+
virtual void completeTypeIdentifierWithoutDot(IdentTypeRepr *ITR) {};
172166

173167
/// Complete the beginning of a case statement at the top of switch stmt.
174168
virtual void completeCaseStmtKeyword() {};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class LibSyntaxGenerator {
3838
assert(Node.isDeferredToken());
3939

4040
auto Kind = Node.getTokenKind();
41-
auto Range = Node.getDeferredTokenRange();
41+
auto Range = Node.getDeferredTokenRangeWithTrivia();
4242
auto LeadingTriviaPieces = Node.getDeferredLeadingTriviaPieces();
4343
auto TrailingTriviaPieces = Node.getDeferredTrailingTriviaPieces();
4444

branches/master-rebranch/include/swift/Parse/ParsedSyntaxBuilders.h.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace swift {
3030
class ParsedRawSyntaxRecorder;
3131
class SyntaxParsingContext;
3232

33-
% for node in SYNTAX_NODES + PARSEONLY_NODES:
33+
% for node in SYNTAX_NODES + SILONLY_NODES:
3434
% if node.is_buildable():
3535
% child_count = len(node.children)
3636
class Parsed${node.name}Builder {

branches/master-rebranch/include/swift/Parse/ParsedSyntaxNodes.h.gyb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ namespace swift {
2828
% # Emit the non-collection classes first, then emit the collection classes
2929
% # that reference these classes.
3030

31-
% for node in SYNTAX_NODES + PARSEONLY_NODES:
31+
% for node in SYNTAX_NODES + SILONLY_NODES:
3232
% if not node.is_syntax_collection():
3333
class Parsed${node.name};
3434
% end
3535
% end
3636

37-
% for node in SYNTAX_NODES + PARSEONLY_NODES:
37+
% for node in SYNTAX_NODES + SILONLY_NODES:
3838
% if node.is_syntax_collection():
3939
using Parsed${node.name} =
4040
ParsedSyntaxCollection<syntax::SyntaxKind::${node.syntax_kind}>;
4141
% end
4242
% end
4343

44-
% for node in SYNTAX_NODES + PARSEONLY_NODES:
44+
% for node in SYNTAX_NODES + SILONLY_NODES:
4545
% if not node.is_syntax_collection():
4646
% qualifier = "" if node.is_base() else "final"
4747
% for line in dedented_lines(node.description):

branches/master-rebranch/include/swift/Parse/ParsedSyntaxRecorder.h.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class SyntaxParsingContext;
3131

3232
struct ParsedSyntaxRecorder {
3333

34-
% for node in SYNTAX_NODES + PARSEONLY_NODES:
34+
% for node in SYNTAX_NODES + SILONLY_NODES:
3535
% if node.children:
3636
% child_params = []
3737
% for child in node.children:

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

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,23 +1004,12 @@ class Parser {
10041004
bool delayParsingDeclList(SourceLoc LBLoc, SourceLoc &RBLoc,
10051005
IterableDeclContext *IDC);
10061006

1007-
ParsedSyntaxResult<ParsedTypeInheritanceClauseSyntax>
1008-
parseTypeInheritanceClauseSyntax(bool allowClassRequirement,
1009-
bool allowAnyObject);
1010-
1011-
ParsedSyntaxResult<ParsedDeclSyntax>
1012-
parseDeclAssociatedTypeSyntax(ParseDeclOptions flags,
1013-
Optional<ParsedAttributeListSyntax> attrs,
1014-
Optional<ParsedModifierListSyntax> modifiers);
1015-
10161007
ParserResult<TypeDecl> parseDeclTypeAlias(ParseDeclOptions Flags,
1017-
DeclAttributes &Attributes,
1018-
SourceLoc leadingLoc);
1008+
DeclAttributes &Attributes);
10191009

10201010
ParserResult<TypeDecl> parseDeclAssociatedType(ParseDeclOptions Flags,
1021-
DeclAttributes &Attributes,
1022-
SourceLoc leadingLoc);
1023-
1011+
DeclAttributes &Attributes);
1012+
10241013
/// Parse a #if ... #endif directive.
10251014
/// Delegate callback function to parse elements in the blocks.
10261015
ParserResult<IfConfigDecl> parseIfConfig(
@@ -1102,7 +1091,7 @@ class Parser {
11021091

11031092
ParserResult<ImportDecl> parseDeclImport(ParseDeclOptions Flags,
11041093
DeclAttributes &Attributes);
1105-
ParserStatus parseInheritance(MutableArrayRef<TypeLoc> &Inherited,
1094+
ParserStatus parseInheritance(SmallVectorImpl<TypeLoc> &Inherited,
11061095
bool allowClassRequirement,
11071096
bool allowAnyObject);
11081097
ParserStatus parseDeclItem(bool &PreviousHadSemi,

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

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,17 @@ class alignas(1 << SyntaxAlignInBits) SyntaxParsingContext {
279279
}
280280

281281
/// Returns the topmost Syntax node.
282-
template <typename SyntaxNode> SyntaxNode topNode();
282+
template <typename SyntaxNode> SyntaxNode topNode() {
283+
ParsedRawSyntaxNode &TopNode = getStorage().back();
284+
if (TopNode.isRecorded()) {
285+
OpaqueSyntaxNode OpaqueNode = TopNode.getOpaqueNode();
286+
return getSyntaxCreator().getLibSyntaxNodeFor<SyntaxNode>(OpaqueNode);
287+
}
288+
return getSyntaxCreator().createNode<SyntaxNode>(TopNode.copyDeferred());
289+
}
283290

284-
template <typename SyntaxNode> llvm::Optional<SyntaxNode> popIf() {
291+
template <typename SyntaxNode>
292+
llvm::Optional<SyntaxNode> popIf() {
285293
auto &Storage = getStorage();
286294
if (Storage.size() <= Offset)
287295
return llvm::None;
@@ -368,24 +376,5 @@ class alignas(1 << SyntaxAlignInBits) SyntaxParsingContext {
368376
"Only meant for use in the debugger");
369377
};
370378

371-
template <typename SyntaxNode>
372-
inline SyntaxNode SyntaxParsingContext::topNode() {
373-
ParsedRawSyntaxNode &TopNode = getStorage().back();
374-
if (TopNode.isRecorded()) {
375-
OpaqueSyntaxNode OpaqueNode = TopNode.getOpaqueNode();
376-
return getSyntaxCreator().getLibSyntaxNodeFor<SyntaxNode>(OpaqueNode);
377-
}
378-
return getSyntaxCreator().createNode<SyntaxNode>(TopNode.copyDeferred());
379-
}
380-
381-
template <> inline TokenSyntax SyntaxParsingContext::topNode<TokenSyntax>() {
382-
ParsedRawSyntaxNode &TopNode = getStorage().back();
383-
if (TopNode.isRecorded()) {
384-
OpaqueSyntaxNode OpaqueNode = TopNode.getOpaqueNode();
385-
return getSyntaxCreator().getLibSyntaxNodeFor<TokenSyntax>(OpaqueNode);
386-
}
387-
return getSyntaxCreator().createToken(TopNode.copyDeferred());
388-
}
389-
390379
} // namespace swift
391380
#endif // SWIFT_SYNTAX_PARSING_CONTEXT_H

branches/master-rebranch/include/swift/Reflection/Records.h

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,14 @@ class FieldRecord {
8080
return MangledTypeName;
8181
}
8282

83-
StringRef getMangledTypeName() const {
84-
return Demangle::makeSymbolicMangledNameStringRef(MangledTypeName.get());
83+
StringRef getMangledTypeName(uintptr_t Offset) const {
84+
return Demangle::makeSymbolicMangledNameStringRef(
85+
(const char *)((uintptr_t)MangledTypeName.get() + Offset));
8586
}
8687

87-
StringRef getFieldName(uintptr_t Low, uintptr_t High) const {
88-
uintptr_t nameAddr = (uintptr_t)FieldName.get();
88+
StringRef getFieldName(uintptr_t Offset, uintptr_t Low,
89+
uintptr_t High) const {
90+
uintptr_t nameAddr = (uintptr_t)FieldName.get() + Offset;
8991
if (nameAddr < Low || nameAddr > High)
9092
return "";
9193
return (const char *)nameAddr;
@@ -214,16 +216,18 @@ class FieldDescriptor {
214216
return MangledTypeName;
215217
}
216218

217-
StringRef getMangledTypeName() const {
218-
return Demangle::makeSymbolicMangledNameStringRef(MangledTypeName.get());
219+
StringRef getMangledTypeName(uintptr_t Offset) const {
220+
return Demangle::makeSymbolicMangledNameStringRef(
221+
(const char *)((uintptr_t)MangledTypeName.get() + Offset));
219222
}
220223

221224
bool hasSuperclass() const {
222225
return Superclass;
223226
}
224227

225-
StringRef getSuperclass() const {
226-
return Demangle::makeSymbolicMangledNameStringRef(Superclass.get());
228+
StringRef getSuperclass(uintptr_t Offset) const {
229+
return Demangle::makeSymbolicMangledNameStringRef(
230+
(const char*)((uintptr_t)Superclass.get() + Offset));
227231
}
228232
};
229233

@@ -267,13 +271,13 @@ class AssociatedTypeRecord {
267271
const RelativeDirectPointer<const char> SubstitutedTypeName;
268272

269273
public:
270-
StringRef getName() const {
271-
return Name.get();
274+
StringRef getName(uintptr_t Offset) const {
275+
return (const char*)((uintptr_t)Name.get() + Offset);
272276
}
273277

274-
StringRef getMangledSubstitutedTypeName() const {
278+
StringRef getMangledSubstitutedTypeName(uintptr_t Offset) const {
275279
return Demangle::makeSymbolicMangledNameStringRef(
276-
SubstitutedTypeName.get());
280+
(const char*)((uintptr_t)SubstitutedTypeName.get() + Offset));
277281
}
278282
};
279283

@@ -348,12 +352,14 @@ struct AssociatedTypeDescriptor {
348352
return const_iterator { End, End };
349353
}
350354

351-
StringRef getMangledProtocolTypeName() const {
352-
return Demangle::makeSymbolicMangledNameStringRef(ProtocolTypeName.get());
355+
StringRef getMangledProtocolTypeName(uintptr_t Offset) const {
356+
return Demangle::makeSymbolicMangledNameStringRef(
357+
(const char*)((uintptr_t)ProtocolTypeName.get() + Offset));
353358
}
354359

355-
StringRef getMangledConformingTypeName() const {
356-
return Demangle::makeSymbolicMangledNameStringRef(ConformingTypeName.get());
360+
StringRef getMangledConformingTypeName(uintptr_t Offset) const {
361+
return Demangle::makeSymbolicMangledNameStringRef(
362+
(const char*)((uintptr_t)ConformingTypeName.get() + Offset));
357363
}
358364
};
359365

@@ -419,8 +425,9 @@ class BuiltinTypeDescriptor {
419425
return TypeName;
420426
}
421427

422-
StringRef getMangledTypeName() const {
423-
return Demangle::makeSymbolicMangledNameStringRef(TypeName.get());
428+
StringRef getMangledTypeName(uintptr_t Offset) const {
429+
return Demangle::makeSymbolicMangledNameStringRef(
430+
(const char*)((uintptr_t)TypeName.get() + Offset));
424431
}
425432
};
426433

@@ -466,8 +473,9 @@ class CaptureTypeRecord {
466473
return MangledTypeName;
467474
}
468475

469-
StringRef getMangledTypeName() const {
470-
return Demangle::makeSymbolicMangledNameStringRef(MangledTypeName.get());
476+
StringRef getMangledTypeName(uintptr_t Offset) const {
477+
return Demangle::makeSymbolicMangledNameStringRef(
478+
(const char*)((uintptr_t)MangledTypeName.get() + Offset));
471479
}
472480
};
473481

@@ -512,17 +520,18 @@ class MetadataSourceRecord {
512520
return MangledTypeName;
513521
}
514522

515-
StringRef getMangledTypeName() const {
516-
return Demangle::makeSymbolicMangledNameStringRef(MangledTypeName.get());
523+
StringRef getMangledTypeName(uintptr_t Offset) const {
524+
return Demangle::makeSymbolicMangledNameStringRef(
525+
(const char*)((uintptr_t)MangledTypeName.get() + Offset));
517526
}
518527

519528
bool hasMangledMetadataSource() const {
520529
return MangledMetadataSource;
521530
}
522531

523-
StringRef getMangledMetadataSource() const {
532+
StringRef getMangledMetadataSource(uintptr_t Offset) const {
524533
return Demangle::makeSymbolicMangledNameStringRef(
525-
MangledMetadataSource.get());
534+
(const char*)((uintptr_t)MangledMetadataSource.get() + Offset));
526535
}
527536
};
528537

0 commit comments

Comments
 (0)