aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/parser/codemodel.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-05-30 08:26:47 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-05-30 11:57:29 +0000
commit50dd4ae202d7afb3556335c056db003f5ef50532 (patch)
treef228d0714160bd8e31f068d10ab32b7c744058ec /sources/shiboken2/ApiExtractor/parser/codemodel.cpp
parent3be012086ed261ae41547b454189f6806fa9e375 (diff)
shiboken: Streamline the type parsing code
- Remove bool *ok-parameter from AbstractMetaBuilderPrivate::translateType() It was only used to handle the special case of void return values of functions where translateType() returned nullptr/ok = true. Add a check TypeInfo::isVoid for this purpose and move this handling to traverseFunction instead. For all other cases, translateType() returning nullptr means failure. - Remove the code triggered by the bool resolveScope parameter of AbstractMetaBuilderPrivate::translateType(). It has been observed to not find any matches, likely due to the types being fully qualified by Clang. - Remove function AbstractMetaBuilderPrivate::decideUsagePattern() which was a one-liner calling AbstractMetaType::decideUsagePattern() Task-number: PYSIDE-672 Change-Id: I0336896917cb914d4d622eefa0a21e6e319efa0f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/parser/codemodel.cpp')
-rw-r--r--sources/shiboken2/ApiExtractor/parser/codemodel.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp
index a06f56434..0af4905f4 100644
--- a/sources/shiboken2/ApiExtractor/parser/codemodel.cpp
+++ b/sources/shiboken2/ApiExtractor/parser/codemodel.cpp
@@ -146,6 +146,14 @@ TypeInfo TypeInfo::combine(const TypeInfo &__lhs, const TypeInfo &__rhs)
return __result;
}
+bool TypeInfo::isVoid() const
+{
+ return m_indirections == 0 && m_referenceType == NoReference
+ && m_arguments.isEmpty() && m_arrayElements.isEmpty()
+ && m_qualifiedName.size() == 1
+ && m_qualifiedName.constFirst() == QLatin1String("void");
+}
+
TypeInfo TypeInfo::resolveType(TypeInfo const &__type, CodeModelItem __scope)
{
CodeModel *__model = __scope->model();