Skip to content

Commit ec87ccf

Browse files
authored
---
yaml --- r: 326382 b: refs/heads/master-next c: 439b911 h: refs/heads/master
1 parent 5fdef29 commit ec87ccf

File tree

16 files changed

+190
-196
lines changed

16 files changed

+190
-196
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: e052da7d8886fa0439677852e8f7830b20c2e1da
3-
refs/heads/master-next: 1a9b6d0dbfe16b277a6c6aa2f478b817ad753b3a
3+
refs/heads/master-next: 439b9111b76b5c6ab4455ffc19083c0f2c07be02
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/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-next/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-next/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-next/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-next/lib/IDE/CodeCompletion.cpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ calculateTypeRelationForDecl(const Decl *D, Type ExpectedType,
868868
bool UseFuncResultType = true) {
869869
auto VD = dyn_cast<ValueDecl>(D);
870870
auto DC = D->getDeclContext();
871-
if (!VD || !VD->hasInterfaceType())
871+
if (!VD || !VD->getInterfaceType())
872872
return CodeCompletionResult::ExpectedTypeRelation::Unrelated;
873873

874874
if (auto FD = dyn_cast<AbstractFunctionDecl>(VD)) {
@@ -2430,7 +2430,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
24302430
addTypeAnnotation(Builder, AFT->getResult());
24312431
};
24322432

2433-
if (!AFD || !AFD->hasInterfaceType() ||
2433+
if (!AFD || !AFD->getInterfaceType() ||
24342434
!AFD->getInterfaceType()->is<AnyFunctionType>()) {
24352435
// Probably, calling closure type expression.
24362436
foundFunction(AFT);
@@ -2791,8 +2791,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
27912791
setClangDeclKeywords(TAD, Pairs, Builder);
27922792
addLeadingDot(Builder);
27932793
Builder.addTextChunk(TAD->getName().str());
2794-
if (TAD->hasInterfaceType()) {
2795-
auto underlyingType = TAD->getUnderlyingType();
2794+
if (auto underlyingType = TAD->getUnderlyingType()) {
27962795
if (underlyingType->hasError()) {
27972796
Type parentType;
27982797
if (auto nominal = TAD->getDeclContext()->getSelfNominalTypeDecl()) {
@@ -3142,9 +3141,6 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
31423141

31433142
bool handleEnumElement(ValueDecl *D, DeclVisibilityKind Reason,
31443143
DynamicLookupInfo dynamicLookupInfo) {
3145-
// FIXME(InterfaceTypeRequest): Remove this.
3146-
(void)D->getInterfaceType();
3147-
31483144
if (auto *EED = dyn_cast<EnumElementDecl>(D)) {
31493145
addEnumElementRef(EED, Reason, dynamicLookupInfo,
31503146
/*HasTypeContext=*/true);
@@ -3153,8 +3149,6 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
31533149
llvm::DenseSet<EnumElementDecl *> Elements;
31543150
ED->getAllElements(Elements);
31553151
for (auto *Ele : Elements) {
3156-
// FIXME(InterfaceTypeRequest): Remove this.
3157-
(void)Ele->getInterfaceType();
31583152
addEnumElementRef(Ele, Reason, dynamicLookupInfo,
31593153
/*HasTypeContext=*/true);
31603154
}
@@ -4328,9 +4322,6 @@ class CompletionOverrideLookup : public swift::VisibleDeclConsumer {
43284322
(D->isStatic() && D->getAttrs().hasAttribute<HasInitialValueAttr>()))
43294323
return;
43304324

4331-
// FIXME(InterfaceTypeRequest): Remove this.
4332-
(void)D->getInterfaceType();
4333-
43344325
bool hasIntroducer = hasFuncIntroducer ||
43354326
hasVarIntroducer ||
43364327
hasTypealiasIntroducer;

branches/master-next/lib/Sema/CSApply.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,9 +1740,6 @@ namespace {
17401740
return nullptr;
17411741
}
17421742

1743-
// FIXME(InterfaceTypeRequest): Remove this.
1744-
(void)fn->getInterfaceType();
1745-
17461743
// Form a reference to the function. The bridging operations are generic,
17471744
// so we need to form substitutions and compute the resulting type.
17481745
auto genericSig = fn->getGenericSignature();
@@ -1921,14 +1918,12 @@ namespace {
19211918
auto maxFloatTypeDecl = tc.Context.get_MaxBuiltinFloatTypeDecl();
19221919

19231920
if (!maxFloatTypeDecl ||
1924-
!maxFloatTypeDecl->hasInterfaceType() ||
1921+
!maxFloatTypeDecl->getInterfaceType() ||
19251922
!maxFloatTypeDecl->getDeclaredInterfaceType()->is<BuiltinFloatType>()) {
19261923
tc.diagnose(expr->getLoc(), diag::no_MaxBuiltinFloatType_found);
19271924
return nullptr;
19281925
}
19291926

1930-
// FIXME(InterfaceTypeRequest): Remove this.
1931-
(void)maxFloatTypeDecl->getInterfaceType();
19321927
auto maxType = maxFloatTypeDecl->getUnderlyingType();
19331928

19341929
DeclName initName(tc.Context, DeclBaseName::createConstructor(),
@@ -4118,8 +4113,6 @@ namespace {
41184113
assert(method && "Didn't find a method?");
41194114

41204115
// The declaration we found must be exposed to Objective-C.
4121-
// FIXME(InterfaceTypeRequest): Remove this.
4122-
(void)method->getInterfaceType();
41234116
if (!method->isObjC()) {
41244117
// If the method declaration lies in a protocol and we're providing
41254118
// a default implementation of the method through a protocol extension

branches/master-next/lib/Sema/DerivedConformanceRawRepresentable.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,6 @@ static bool canSynthesizeRawRepresentable(DerivedConformance &derived) {
465465
auto enumDecl = cast<EnumDecl>(derived.Nominal);
466466
auto &tc = derived.TC;
467467

468-
// Validate the enum and its raw type.
469-
// FIXME(InterfaceTypeRequest): Remove this.
470-
(void)enumDecl->getInterfaceType();
471-
472-
// It must have a valid raw type.
473468
Type rawType = enumDecl->getRawType();
474469
if (!rawType)
475470
return false;

0 commit comments

Comments
 (0)