Skip to content

Commit 7b90c2d

Browse files
authored
---
yaml --- r: 344295 b: refs/heads/master-rebranch c: 108a462 h: refs/heads/master i: 344293: 97987ee 344291: 5d9b159 344287: 4dd84d4
1 parent 0740eba commit 7b90c2d

File tree

16 files changed

+151
-167
lines changed

16 files changed

+151
-167
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: 4c1fc19bd79e6343a4d60c084a0c5ed76bd1a0cc
1458+
refs/heads/master-rebranch: 108a462d0de4c750565c498ee9ffff3423b0e98f
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/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/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

branches/master-rebranch/include/swift/SwiftRemoteMirror/SwiftRemoteMirrorTypes.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,32 +53,32 @@ typedef struct swift_reflection_section {
5353
typedef struct swift_reflection_info {
5454
struct {
5555
swift_reflection_section_t section;
56-
swift_reflection_ptr_t offset;
56+
swift_reflection_ptr_t offset; ///< DEPRECATED. Must be zero
5757
} field;
5858

5959
struct {
6060
swift_reflection_section_t section;
61-
swift_reflection_ptr_t offset;
61+
swift_reflection_ptr_t offset; ///< DEPRECATED. Must be zero
6262
} associated_types;
6363

6464
struct {
6565
swift_reflection_section_t section;
66-
swift_reflection_ptr_t offset;
66+
swift_reflection_ptr_t offset; ///< DEPRECATED. Must be zero
6767
} builtin_types;
6868

6969
struct {
7070
swift_reflection_section_t section;
71-
swift_reflection_ptr_t offset;
71+
swift_reflection_ptr_t offset; ///< DEPRECATED. Must be zero
7272
} capture;
7373

7474
struct {
7575
swift_reflection_section_t section;
76-
swift_reflection_ptr_t offset;
76+
swift_reflection_ptr_t offset; ///< DEPRECATED. Must be zero
7777
} type_references;
7878

7979
struct {
8080
swift_reflection_section_t section;
81-
swift_reflection_ptr_t offset;
81+
swift_reflection_ptr_t offset; ///< DEPRECATED. Must be zero
8282
} reflection_strings;
8383

8484
// Start address in local and remote address spaces.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ struct TBDGenOptions {
3333
/// Whether this compilation has multiple IRGen instances.
3434
bool HasMultipleIGMs;
3535

36+
/// Whether this compilation is producing a TBD for InstallAPI.
37+
bool IsInstallAPI;
38+
3639
/// The install_name to use in the TBD file.
3740
std::string InstallName;
3841

branches/master-rebranch/lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,8 @@ static bool ParseTBDGenArgs(TBDGenOptions &Opts, ArgList &Args,
940940
Opts.InstallName = A->getValue();
941941
}
942942

943+
Opts.IsInstallAPI = Args.hasArg(OPT_tbd_is_installapi);
944+
943945
if (const Arg *A = Args.getLastArg(OPT_tbd_compatibility_version)) {
944946
if (auto vers = version::Version::parseVersionString(
945947
A->getValue(), SourceLoc(), &Diags)) {

branches/master-rebranch/lib/TBDGen/TBDGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ static void enumeratePublicSymbolsAndWrite(ModuleDecl *M, FileUnit *singleFile,
613613
file.setPlatform(tapi::internal::mapToSinglePlatform(target));
614614
auto arch = tapi::internal::getArchType(target.getArchName());
615615
file.setArch(arch);
616-
file.setInstallAPI();
616+
file.setInstallAPI(opts.IsInstallAPI);
617617

618618
TBDGenVisitor visitor(file, arch, symbols, linkInfo, M, opts);
619619

branches/master-rebranch/stdlib/public/Reflection/TypeLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ BuiltinTypeInfo::BuiltinTypeInfo(const BuiltinTypeDescriptor *descriptor)
198198
descriptor->Stride,
199199
descriptor->NumExtraInhabitants,
200200
descriptor->isBitwiseTakable()),
201-
Name(descriptor->getMangledTypeName(0)) {}
201+
Name(descriptor->getMangledTypeName()) {}
202202

203203
/// Utility class for building values that contain witness tables.
204204
class ExistentialTypeInfoBuilder {

0 commit comments

Comments
 (0)