From e99ac18b134469854dff05fd3bb61158f9d9ccf9 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 18 Dec 2020 19:16:59 +0100 Subject: shiboken6: Refactor base class retrieval AbstractMetaClass has a list of base class names and a list of AbstractMetaClass* base instances. AbstractMetaBuilder populates the instance list from the names in setupInheritance() and sets a flag. In a few places in AbstractMetaBuilder, the base class instances are needed before this has been completed. For this purpose, the helper AbstractMetaBuilder::getBaseClasses() is needed. Replace the set of classes m_setupInheritanceDone by a flag on AbstractMetaClass. This allows for adding an assert to AbstractMetaClass::baseClasses() ensuring setupInheritance() has been called and taking a shortcut in AbstractMetaBuilder::getBaseClasses(). In addition, classesTopologicalSorted() can use AbstractMetaClass::baseClasses() instead of searching with AbstractMetaBuilder::getBaseClasses() and can thus be made static. Pick-to: 6.0 Change-Id: Iaf8209b6f6534ad91a96970a56c1e86cce054922 Reviewed-by: Christian Tismer --- sources/shiboken6/ApiExtractor/abstractmetalang.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sources/shiboken6/ApiExtractor/abstractmetalang.h') diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang.h b/sources/shiboken6/ApiExtractor/abstractmetalang.h index 2100f0eaa..61b5a092c 100644 --- a/sources/shiboken6/ApiExtractor/abstractmetalang.h +++ b/sources/shiboken6/ApiExtractor/abstractmetalang.h @@ -58,8 +58,6 @@ public: AbstractMetaClass(); ~AbstractMetaClass(); - void fixFunctions(); - const AbstractMetaFunctionCList &functions() const; void setFunctions(const AbstractMetaFunctionCList &functions); void addFunction(const AbstractMetaFunctionCPtr &function); @@ -305,6 +303,12 @@ public: SourceLocation sourceLocation() const; void setSourceLocation(const SourceLocation &sourceLocation); + // For AbstractMetaBuilder + void fixFunctions(); + bool needsInheritanceSetup() const; + void setInheritanceDone(bool b); + bool inheritanceDone() const; + template void invisibleNamespaceRecursion(Function f) const; -- cgit v1.2.3