aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/abstractmetalang.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-12-18 19:16:59 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-12-20 17:40:48 +0100
commite99ac18b134469854dff05fd3bb61158f9d9ccf9 (patch)
tree09d8a34c4945187b1eacf8e22bff68f2bd87e208 /sources/shiboken6/ApiExtractor/abstractmetalang.h
parent3139c8dddf9dfb0e935cd03b3d539541fdf0edf0 (diff)
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 <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/abstractmetalang.h')
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetalang.h8
1 files changed, 6 insertions, 2 deletions
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 <class Function>
void invisibleNamespaceRecursion(Function f) const;