@@ -2739,7 +2739,7 @@ struct TargetProtocolConformanceDescriptor final
27392739 }
27402740
27412741 constexpr inline auto
2742- getTypeDescriptorOffset () const -> typename Runtime::StoredSize {
2742+ getTypeRefDescriptorOffset () const -> typename Runtime::StoredSize {
27432743 return offsetof (typename std::remove_reference<decltype (*this )>::type, TypeRef);
27442744 }
27452745
@@ -2918,6 +2918,11 @@ struct TargetContextDescriptor {
29182918 : 0 ;
29192919 }
29202920
2921+ constexpr inline auto
2922+ getParentOffset () const -> typename Runtime::StoredSize {
2923+ return offsetof (typename std::remove_reference<decltype (*this )>::type, Parent);
2924+ }
2925+
29212926#ifndef NDEBUG
29222927 LLVM_ATTRIBUTE_DEPRECATED (void dump () const ,
29232928 "only for use in the debugger");
@@ -2957,13 +2962,26 @@ struct TargetModuleContextDescriptor final : TargetContextDescriptor<Runtime> {
29572962 return isCImportedModuleName (Name.get ());
29582963 }
29592964
2965+ constexpr inline auto
2966+ getNameOffset () const -> typename Runtime::StoredSize {
2967+ return offsetof (typename std::remove_reference<decltype (*this )>::type, Name);
2968+ }
2969+
29602970 static bool classof (const TargetContextDescriptor<Runtime> *cd) {
29612971 return cd->getKind () == ContextDescriptorKind::Module;
29622972 }
29632973};
29642974
29652975using ModuleContextDescriptor = TargetModuleContextDescriptor<InProcess>;
29662976
2977+ template <unsigned PointerSize>
2978+ using ExternalModuleContextDescriptor
2979+ #if SWIFT_OBJC_INTEROP
2980+ = TargetModuleContextDescriptor<External<WithObjCInterop<RuntimeTarget<PointerSize>>>>;
2981+ #else
2982+ = TargetModuleContextDescriptor<External<NoObjCInterop<RuntimeTarget<PointerSize>>>>;
2983+ #endif
2984+
29672985template <typename Runtime>
29682986inline bool TargetContextDescriptor<Runtime>::isCImportedContext() const {
29692987 return getModuleContext ()->isCImportedContext ();
0 commit comments