Skip to content

Commit cfe8592

Browse files
authored
---
yaml --- r: 344303 b: refs/heads/master-rebranch c: 64bad16 h: refs/heads/master i: 344301: e399d7a 344299: 0336ce4 344295: 7b90c2d 344287: 4dd84d4
1 parent 0fb68b9 commit cfe8592

File tree

96 files changed

+594
-754
lines changed

Some content is hidden

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

96 files changed

+594
-754
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: 12aa95ac1e101a0266d4bc887e6cd232878ee1b6
1458+
refs/heads/master-rebranch: 64bad1606a82323449c0b81f380c35e1da6e91e9
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/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
|**[Ubuntu 16.04 ](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/aarch64_ubuntu_16.04.json)** | AArch64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-aarch64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-aarch64)|
1919
|**[Android](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04_LTS_android.json)** | ARMv7 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android)|
2020
|**[Android](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04_LTS_android.json)** | AArch64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android-arm64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android-arm64)|
21-
|**[Debian 9.5](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_debian_9.5.json)** | x86_64 | [![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-debian-9_5/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-debian-9_5)|
2221
|**[Windows 2019](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_windows_2019.json)** | x86_64 | [![Build Status](https://ci-external.swift.org/job/oss-swift-windows-x86_64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-windows-x86_64)|
2322

2423
**Swift TensorFlow Community-Hosted CI Platforms**

branches/master-rebranch/cmake/modules/SwiftHandleGybSources.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ 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"
121122
"${SWIFT_SOURCE_DIR}/utils/gyb_syntax_support/DeclNodes.py"
122123
"${SWIFT_SOURCE_DIR}/utils/gyb_syntax_support/ExprNodes.py"
123124
"${SWIFT_SOURCE_DIR}/utils/gyb_syntax_support/GenericNodes.py"

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ 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+
8993
def verify : Flag<["-"], "verify">,
9094
HelpText<"Verify diagnostics against expected-{error|warning|note} "
9195
"annotations">;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ class ASTGen {
9797
const SourceLoc Loc);
9898
TypeRepr *generate(const syntax::ImplicitlyUnwrappedOptionalTypeSyntax &Type,
9999
const SourceLoc Loc);
100+
TypeRepr *generate(const syntax::CodeCompletionTypeSyntax &Type,
101+
const SourceLoc Loc);
100102
TypeRepr *generate(const syntax::UnknownTypeSyntax &Type,
101103
const SourceLoc Loc);
102104

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

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

43+
TypeLoc ParsedTypeLoc;
44+
4345
/// True if code completion is done inside a raw value expression of an enum
4446
/// case.
4547
bool InEnumElementRawValue = false;
@@ -76,6 +78,10 @@ class CodeCompletionCallbacks {
7678
ParsedDecl = D;
7779
}
7880

81+
void setParsedTypeLoc(TypeLoc TyLoc) {
82+
ParsedTypeLoc = TyLoc;
83+
}
84+
7985
void setLeadingSequenceExprs(ArrayRef<Expr *> exprs) {
8086
leadingSequenceExprs.assign(exprs.begin(), exprs.end());
8187
}
@@ -159,10 +165,10 @@ class CodeCompletionCallbacks {
159165
virtual void completeTypeSimpleBeginning() {};
160166

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

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

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

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 + SILONLY_NODES:
33+
% for node in SYNTAX_NODES + PARSEONLY_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 + SILONLY_NODES:
31+
% for node in SYNTAX_NODES + PARSEONLY_NODES:
3232
% if not node.is_syntax_collection():
3333
class Parsed${node.name};
3434
% end
3535
% end
3636

37-
% for node in SYNTAX_NODES + SILONLY_NODES:
37+
% for node in SYNTAX_NODES + PARSEONLY_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 + SILONLY_NODES:
44+
% for node in SYNTAX_NODES + PARSEONLY_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 + SILONLY_NODES:
34+
% for node in SYNTAX_NODES + PARSEONLY_NODES:
3535
% if node.children:
3636
% child_params = []
3737
% for child in node.children:

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

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

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

88-
StringRef getFieldName(uintptr_t Offset, uintptr_t Low,
89-
uintptr_t High) const {
90-
uintptr_t nameAddr = (uintptr_t)FieldName.get() + Offset;
87+
StringRef getFieldName(uintptr_t Low, uintptr_t High) const {
88+
uintptr_t nameAddr = (uintptr_t)FieldName.get();
9189
if (nameAddr < Low || nameAddr > High)
9290
return "";
9391
return (const char *)nameAddr;
@@ -216,18 +214,16 @@ class FieldDescriptor {
216214
return MangledTypeName;
217215
}
218216

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

224221
bool hasSuperclass() const {
225222
return Superclass;
226223
}
227224

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

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

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

278-
StringRef getMangledSubstitutedTypeName(uintptr_t Offset) const {
274+
StringRef getMangledSubstitutedTypeName() const {
279275
return Demangle::makeSymbolicMangledNameStringRef(
280-
(const char*)((uintptr_t)SubstitutedTypeName.get() + Offset));
276+
SubstitutedTypeName.get());
281277
}
282278
};
283279

@@ -352,14 +348,12 @@ struct AssociatedTypeDescriptor {
352348
return const_iterator { End, End };
353349
}
354350

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

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

@@ -425,9 +419,8 @@ class BuiltinTypeDescriptor {
425419
return TypeName;
426420
}
427421

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

@@ -473,9 +466,8 @@ class CaptureTypeRecord {
473466
return MangledTypeName;
474467
}
475468

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

@@ -520,18 +512,17 @@ class MetadataSourceRecord {
520512
return MangledTypeName;
521513
}
522514

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

528519
bool hasMangledMetadataSource() const {
529520
return MangledMetadataSource;
530521
}
531522

532-
StringRef getMangledMetadataSource(uintptr_t Offset) const {
523+
StringRef getMangledMetadataSource() const {
533524
return Demangle::makeSymbolicMangledNameStringRef(
534-
(const char*)((uintptr_t)MangledMetadataSource.get() + Offset));
525+
MangledMetadataSource.get());
535526
}
536527
};
537528

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

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,12 @@ class ReflectionContext
241241
auto RemoteStartAddress = static_cast<uint64_t>(RangeStart);
242242

243243
ReflectionInfo info = {
244-
{{FieldMdSec.first, FieldMdSec.second}, 0},
245-
{{AssocTySec.first, AssocTySec.second}, 0},
246-
{{BuiltinTySec.first, BuiltinTySec.second}, 0},
247-
{{CaptureSec.first, CaptureSec.second}, 0},
248-
{{TypeRefMdSec.first, TypeRefMdSec.second}, 0},
249-
{{ReflStrMdSec.first, ReflStrMdSec.second}, 0},
244+
{FieldMdSec.first, FieldMdSec.second},
245+
{AssocTySec.first, AssocTySec.second},
246+
{BuiltinTySec.first, BuiltinTySec.second},
247+
{CaptureSec.first, CaptureSec.second},
248+
{TypeRefMdSec.first, TypeRefMdSec.second},
249+
{ReflStrMdSec.first, ReflStrMdSec.second},
250250
LocalStartAddress,
251251
RemoteStartAddress};
252252

@@ -355,12 +355,12 @@ class ReflectionContext
355355
static_cast<uintptr_t>(ImageStart.getAddressData());
356356

357357
ReflectionInfo Info = {
358-
{{FieldMdSec.first, FieldMdSec.second}, 0},
359-
{{AssocTySec.first, AssocTySec.second}, 0},
360-
{{BuiltinTySec.first, BuiltinTySec.second}, 0},
361-
{{CaptureSec.first, CaptureSec.second}, 0},
362-
{{TypeRefMdSec.first, TypeRefMdSec.second}, 0},
363-
{{ReflStrMdSec.first, ReflStrMdSec.second}, 0},
358+
{FieldMdSec.first, FieldMdSec.second},
359+
{AssocTySec.first, AssocTySec.second},
360+
{BuiltinTySec.first, BuiltinTySec.second},
361+
{CaptureSec.first, CaptureSec.second},
362+
{TypeRefMdSec.first, TypeRefMdSec.second},
363+
{ReflStrMdSec.first, ReflStrMdSec.second},
364364
LocalStartAddress,
365365
RemoteStartAddress};
366366
this->addReflectionInfo(Info);
@@ -473,12 +473,12 @@ class ReflectionContext
473473
static_cast<uint64_t>(ImageStart.getAddressData());
474474

475475
ReflectionInfo info = {
476-
{{FieldMdSec.first, FieldMdSec.second}, 0},
477-
{{AssocTySec.first, AssocTySec.second}, 0},
478-
{{BuiltinTySec.first, BuiltinTySec.second}, 0},
479-
{{CaptureSec.first, CaptureSec.second}, 0},
480-
{{TypeRefMdSec.first, TypeRefMdSec.second}, 0},
481-
{{ReflStrMdSec.first, ReflStrMdSec.second}, 0},
476+
{FieldMdSec.first, FieldMdSec.second},
477+
{AssocTySec.first, AssocTySec.second},
478+
{BuiltinTySec.first, BuiltinTySec.second},
479+
{CaptureSec.first, CaptureSec.second},
480+
{TypeRefMdSec.first, TypeRefMdSec.second},
481+
{ReflStrMdSec.first, ReflStrMdSec.second},
482482
LocalStartAddress,
483483
RemoteStartAddress};
484484

@@ -638,7 +638,7 @@ class ReflectionContext
638638
if (CD == nullptr)
639639
return nullptr;
640640

641-
auto Info = getBuilder().getClosureContextInfo(*CD, 0);
641+
auto Info = getBuilder().getClosureContextInfo(*CD);
642642

643643
return getClosureContextInfo(ObjectAddress, Info);
644644
}

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

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -80,35 +80,12 @@ using CaptureSection = ReflectionSection<CaptureDescriptorIterator>;
8080
using GenericSection = ReflectionSection<const void *>;
8181

8282
struct ReflectionInfo {
83-
struct {
84-
FieldSection Metadata;
85-
uint64_t SectionOffset;
86-
} Field;
87-
88-
struct {
89-
AssociatedTypeSection Metadata;
90-
uint64_t SectionOffset;
91-
} AssociatedType;
92-
93-
struct {
94-
BuiltinTypeSection Metadata;
95-
uint64_t SectionOffset;
96-
} Builtin;
97-
98-
struct {
99-
CaptureSection Metadata;
100-
uint64_t SectionOffset;
101-
} Capture;
102-
103-
struct {
104-
GenericSection Metadata;
105-
uint64_t SectionOffset;
106-
} TypeReference;
107-
108-
struct {
109-
GenericSection Metadata;
110-
uint64_t SectionOffset;
111-
} ReflectionString;
83+
FieldSection Field;
84+
AssociatedTypeSection AssociatedType;
85+
BuiltinTypeSection Builtin;
86+
CaptureSection Capture;
87+
GenericSection TypeReference;
88+
GenericSection ReflectionString;
11289

11390
uint64_t LocalStartAddress;
11491
uint64_t RemoteStartAddress;
@@ -580,8 +557,7 @@ class TypeRefBuilder {
580557
const CaptureDescriptor *getCaptureDescriptor(uint64_t RemoteAddress);
581558

582559
/// Get the unsubstituted capture types for a closure context.
583-
ClosureContextInfo getClosureContextInfo(const CaptureDescriptor &CD,
584-
uint64_t Offset);
560+
ClosureContextInfo getClosureContextInfo(const CaptureDescriptor &CD);
585561

586562
///
587563
/// Dumping typerefs, field declarations, associated types

branches/master-rebranch/include/swift/Remote/MetadataReader.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ class RemoteRef {
9595
uint64_t resolveRelativeAddressData() const {
9696
int32_t offset;
9797
memcpy(&offset, LocalBuffer, sizeof(int32_t));
98+
if (offset == 0)
99+
return 0;
98100
return Address + (int64_t)offset;
99101
}
100102

0 commit comments

Comments
 (0)