Refactor building of reverse adapters in ObjCExportCodeGenerator

* Make it more understandable and reliable: don't predict which reverse
  adapters are inherited, reuse information from generating super types
  instead.
* Drop usages of obsolete "IrDeclaration.descriptor"
This commit is contained in:
Svyatoslav Scherbina
2021-02-01 12:42:46 +03:00
committed by Vasily Levchenko
parent 39ef940a7b
commit 61d3ae1477
2 changed files with 50 additions and 7 deletions
@@ -902,6 +902,8 @@ static const TypeInfo* createTypeInfo(Class clazz, const TypeInfo* superType, co
}
};
// Compiler relies on using reverse adapters here from all supertypes
// in [ObjCExportCodeGenerator.createReverseAdapters].
for (const TypeInfo* t : supers) {
const ObjCTypeAdapter* typeAdapter = getTypeAdapter(t);
if (typeAdapter == nullptr) continue;
@@ -921,6 +923,8 @@ static const TypeInfo* createTypeInfo(Class clazz, const TypeInfo* superType, co
}
}
// Compiler relies on using reverse adapters here from all supertypes
// in [ObjCExportCodeGenerator.createReverseAdapters].
for (const TypeInfo* typeInfo : addedInterfaces) {
const ObjCTypeAdapter* typeAdapter = getTypeAdapter(typeInfo);