@@ -122,7 +122,10 @@ class ReflectionContext
122
122
using super::readMetadata;
123
123
using super::readObjCClassName;
124
124
using super::readResolvedPointerValue;
125
- llvm::DenseMap<typename super::StoredPointer, const RecordTypeInfo *> Cache;
125
+ llvm::DenseMap<std::pair<typename super::StoredPointer,
126
+ remote::TypeInfoProvider::IdType>,
127
+ const RecordTypeInfo *>
128
+ Cache;
126
129
127
130
// / All buffers we need to keep around long term. This will automatically free them
128
131
// / when this object is destroyed.
@@ -892,7 +895,8 @@ class ReflectionContext
892
895
getMetadataTypeInfo (StoredPointer MetadataAddress,
893
896
remote::TypeInfoProvider *ExternalTypeInfo) {
894
897
// See if we cached the layout already
895
- auto found = Cache.find (MetadataAddress);
898
+ auto ExternalTypeInfoId = ExternalTypeInfo ? ExternalTypeInfo->getId () : 0 ;
899
+ auto found = Cache.find ({MetadataAddress, ExternalTypeInfoId});
896
900
if (found != Cache.end ())
897
901
return found->second ;
898
902
@@ -922,7 +926,7 @@ class ReflectionContext
922
926
}
923
927
924
928
// Cache the result for future lookups
925
- Cache[MetadataAddress] = TI;
929
+ Cache[{ MetadataAddress, ExternalTypeInfoId} ] = TI;
926
930
return TI;
927
931
}
928
932
0 commit comments