aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-02-17 14:29:51 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-02-17 21:30:11 +0100
commitcb936887bffc662e866f4e9594cdea8d1213a444 (patch)
tree922943dedb25542fcfd68e9176f457d46b8fc10d /sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
parent6922108cb8f8faa6a92c371c71b65441b8b334cb (diff)
shiboken6: Move C++ access specifiers into a global enum
Extract the AcessPolicy enum from the code model into a global enum and remove the access specifiers from AbstractMetaAttributes. AbstractMetaField and AbstractMetaEnum get access()/setAccess() functions and no longer need to inherit AbstractMetaAttributes which removes the attributes that do not apply to them. AbstractMetaFunction gets access()/setAccess() functions, too, and handling for remembering the original access before modifications. AbstractMetaAttributes::originalAttributes can then be removed since it is not used otherwise. Simplify the code accordingly. Change-Id: Ie4529fc753f127975b5c56ee07b27419802361d6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp')
-rw-r--r--sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
index 72e90c5be..2970507ec 100644
--- a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
+++ b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
@@ -100,15 +100,15 @@ static inline bool insertTemplateParameterIntoClassName(const QString &parmName,
return result;
}
-static inline CodeModel::AccessPolicy accessPolicy(CX_CXXAccessSpecifier access)
+static inline Access accessPolicy(CX_CXXAccessSpecifier access)
{
- CodeModel::AccessPolicy result = CodeModel::Public;
+ Access result = Access::Public;
switch (access) {
case CX_CXXProtected:
- result = CodeModel::Protected;
+ result = Access::Protected;
break;
case CX_CXXPrivate:
- result = CodeModel::Private;
+ result = Access::Private;
break;
default:
break;
@@ -716,7 +716,7 @@ void BuilderPrivate::addBaseClass(const CXCursor &cursor)
baseClassName = getTypeName(decl.type);
auto it = m_cursorClassHash.constFind(decl.declaration);
- const CodeModel::AccessPolicy access = accessPolicy(clang_getCXXAccessSpecifier(cursor));
+ const Access access = accessPolicy(clang_getCXXAccessSpecifier(cursor));
if (it == m_cursorClassHash.constEnd()) {
// Set unqualified name. This happens in cases like "class X : public std::list<...>"
// "template<class T> class Foo : public T" and standard types like true_type, false_type.