@@ -31,18 +31,18 @@ TypeRefBuilder::getRemoteAddrOfTypeRefPointer(const void *pointer) {
31
31
// Find what type ref section the pointer resides in, if any.
32
32
const ReflectionInfo *containingInfo = nullptr ;
33
33
for (auto &info : ReflectionInfos) {
34
- auto start = (uintptr_t )info.TypeReference .Metadata .startAddress ();
35
- auto size = (uintptr_t )info.TypeReference .Metadata .size ();
36
- if (start <= (uintptr_t )pointer && (uintptr_t )pointer < start + size) {
34
+ auto start = (uint64_t )info.TypeReference .Metadata .startAddress ();
35
+ auto size = (uint64_t )info.TypeReference .Metadata .size ();
36
+ if (start <= (uint64_t )pointer && (uint64_t )pointer < start + size) {
37
37
containingInfo = &info;
38
38
break ;
39
39
}
40
40
}
41
41
42
42
if (!containingInfo)
43
43
return 0 ;
44
-
45
- return (uintptr_t )pointer
44
+
45
+ return (uint64_t )pointer
46
46
+ containingInfo->RemoteStartAddress
47
47
- containingInfo->LocalStartAddress
48
48
+ containingInfo->TypeReference .SectionOffset ;
@@ -86,10 +86,10 @@ lookupTypeWitness(const std::string &MangledTypeName,
86
86
// Cache missed - we need to look through all of the assocty sections
87
87
// for all images that we've been notified about.
88
88
for (auto &Info : ReflectionInfos) {
89
- uintptr_t TypeRefOffset = Info.AssociatedType .SectionOffset
90
- - Info.TypeReference .SectionOffset ;
91
- uintptr_t NameOffset = Info.AssociatedType .SectionOffset
92
- - Info.ReflectionString .SectionOffset ;
89
+ uint64_t TypeRefOffset = Info.AssociatedType .SectionOffset
90
+ - Info.TypeReference .SectionOffset ;
91
+ uint64_t NameOffset = Info.AssociatedType .SectionOffset
92
+ - Info.ReflectionString .SectionOffset ;
93
93
for (const auto &AssocTyDescriptor : Info.AssociatedType .Metadata ) {
94
94
if (!reflectionNameMatches (Dem,
95
95
AssocTyDescriptor.getMangledConformingTypeName (TypeRefOffset),
@@ -158,8 +158,8 @@ TypeRefBuilder::getFieldTypeInfo(const TypeRef *TR) {
158
158
// On failure, fill out the cache with everything we know about.
159
159
std::vector<std::pair<std::string, const TypeRef *>> Fields;
160
160
for (auto &Info : ReflectionInfos) {
161
- uintptr_t TypeRefOffset = Info.Field .SectionOffset
162
- - Info.TypeReference .SectionOffset ;
161
+ uint64_t TypeRefOffset = Info.Field .SectionOffset
162
+ - Info.TypeReference .SectionOffset ;
163
163
for (auto &FD : Info.Field .Metadata ) {
164
164
if (!FD.hasMangledTypeName ())
165
165
continue ;
@@ -232,8 +232,8 @@ TypeRefBuilder::getBuiltinTypeInfo(const TypeRef *TR) {
232
232
return nullptr ;
233
233
234
234
for (auto Info : ReflectionInfos) {
235
- uintptr_t TypeRefOffset = Info.Builtin .SectionOffset
236
- - Info.TypeReference .SectionOffset ;
235
+ uint64_t TypeRefOffset = Info.Builtin .SectionOffset
236
+ - Info.TypeReference .SectionOffset ;
237
237
for (auto &BuiltinTypeDescriptor : Info.Builtin .Metadata ) {
238
238
assert (BuiltinTypeDescriptor.Size > 0 );
239
239
assert (BuiltinTypeDescriptor.getAlignment () > 0 );
@@ -252,10 +252,10 @@ TypeRefBuilder::getBuiltinTypeInfo(const TypeRef *TR) {
252
252
}
253
253
254
254
const CaptureDescriptor *
255
- TypeRefBuilder::getCaptureDescriptor (uintptr_t RemoteAddress) {
255
+ TypeRefBuilder::getCaptureDescriptor (uint64_t RemoteAddress) {
256
256
for (auto Info : ReflectionInfos) {
257
257
for (auto &CD : Info.Capture .Metadata ) {
258
- auto OtherAddr = (reinterpret_cast <uintptr_t >(&CD) -
258
+ auto OtherAddr = (reinterpret_cast <uint64_t >(&CD) -
259
259
Info.LocalStartAddress + Info.RemoteStartAddress );
260
260
if (OtherAddr == RemoteAddress)
261
261
return &CD;
@@ -268,7 +268,7 @@ TypeRefBuilder::getCaptureDescriptor(uintptr_t RemoteAddress) {
268
268
// / Get the unsubstituted capture types for a closure context.
269
269
ClosureContextInfo
270
270
TypeRefBuilder::getClosureContextInfo (const CaptureDescriptor &CD,
271
- uintptr_t TypeRefOffset) {
271
+ uint64_t TypeRefOffset) {
272
272
ClosureContextInfo Info;
273
273
274
274
for (auto i = CD.capture_begin (), e = CD.capture_end (); i != e; ++i) {
@@ -326,10 +326,10 @@ TypeRefBuilder::dumpTypeRef(StringRef MangledName,
326
326
327
327
void TypeRefBuilder::dumpFieldSection (std::ostream &OS) {
328
328
for (const auto §ions : ReflectionInfos) {
329
- uintptr_t TypeRefOffset = sections.Field .SectionOffset
330
- - sections.TypeReference .SectionOffset ;
331
- uintptr_t NameOffset = sections.Field .SectionOffset
332
- - sections.ReflectionString .SectionOffset ;
329
+ uint64_t TypeRefOffset = sections.Field .SectionOffset
330
+ - sections.TypeReference .SectionOffset ;
331
+ uint64_t NameOffset = sections.Field .SectionOffset
332
+ - sections.ReflectionString .SectionOffset ;
333
333
for (const auto &descriptor : sections.Field .Metadata ) {
334
334
auto TypeDemangling = Dem.demangleType (
335
335
dropSwiftManglingPrefix (descriptor.getMangledTypeName (TypeRefOffset)));
@@ -354,10 +354,10 @@ void TypeRefBuilder::dumpFieldSection(std::ostream &OS) {
354
354
355
355
void TypeRefBuilder::dumpAssociatedTypeSection (std::ostream &OS) {
356
356
for (const auto §ions : ReflectionInfos) {
357
- uintptr_t TypeRefOffset = sections.AssociatedType .SectionOffset
358
- - sections.TypeReference .SectionOffset ;
359
- uintptr_t NameOffset = sections.AssociatedType .SectionOffset
360
- - sections.ReflectionString .SectionOffset ;
357
+ uint64_t TypeRefOffset = sections.AssociatedType .SectionOffset
358
+ - sections.TypeReference .SectionOffset ;
359
+ uint64_t NameOffset = sections.AssociatedType .SectionOffset
360
+ - sections.ReflectionString .SectionOffset ;
361
361
for (const auto &descriptor : sections.AssociatedType .Metadata ) {
362
362
auto conformingTypeNode = Dem.demangleType (
363
363
descriptor.getMangledConformingTypeName (TypeRefOffset));
@@ -381,8 +381,8 @@ void TypeRefBuilder::dumpAssociatedTypeSection(std::ostream &OS) {
381
381
382
382
void TypeRefBuilder::dumpBuiltinTypeSection (std::ostream &OS) {
383
383
for (const auto §ions : ReflectionInfos) {
384
- uintptr_t TypeRefOffset = sections.Builtin .SectionOffset
385
- - sections.TypeReference .SectionOffset ;
384
+ uint64_t TypeRefOffset = sections.Builtin .SectionOffset
385
+ - sections.TypeReference .SectionOffset ;
386
386
for (const auto &descriptor : sections.Builtin .Metadata ) {
387
387
auto typeName =
388
388
Demangle::demangleTypeAsString (
@@ -426,8 +426,8 @@ void ClosureContextInfo::dump(std::ostream &OS) const {
426
426
427
427
void TypeRefBuilder::dumpCaptureSection (std::ostream &OS) {
428
428
for (const auto §ions : ReflectionInfos) {
429
- uintptr_t TypeRefOffset = sections.Capture .SectionOffset
430
- - sections.TypeReference .SectionOffset ;
429
+ uint64_t TypeRefOffset = sections.Capture .SectionOffset
430
+ - sections.TypeReference .SectionOffset ;
431
431
for (const auto &descriptor : sections.Capture .Metadata ) {
432
432
auto info = getClosureContextInfo (descriptor, TypeRefOffset);
433
433
info.dump (OS);
0 commit comments