From dbfdd3499f234bf39c358b71f2f001fad51961e8 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 4 Dec 2017 09:56:33 +0100 Subject: shiboken/AbstractMetaBuilder: Remove create* functions There are no classes deriving from AbstractMetaBuilder, so there is no need to have virtual creation functions. Change-Id: I2d4c494ac6b0a17ceea71939a1f07a49a369df73 Reviewed-by: Alexandru Croitor --- .../shiboken2/ApiExtractor/abstractmetabuilder.cpp | 65 +++++----------------- 1 file changed, 15 insertions(+), 50 deletions(-) (limited to 'sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp') diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp index b7b99bb0a..5cb6ac342 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp @@ -247,41 +247,6 @@ AbstractMetaClass *AbstractMetaBuilderPrivate::argumentToClass(ArgumentModelItem return returned; } -AbstractMetaClass *AbstractMetaBuilder::createMetaClass() -{ - return new AbstractMetaClass(); -} - -AbstractMetaEnum *AbstractMetaBuilder::createMetaEnum() -{ - return new AbstractMetaEnum(); -} - -AbstractMetaEnumValue *AbstractMetaBuilder::createMetaEnumValue() -{ - return new AbstractMetaEnumValue(); -} - -AbstractMetaField *AbstractMetaBuilder::createMetaField() -{ - return new AbstractMetaField(); -} - -AbstractMetaFunction *AbstractMetaBuilder::createMetaFunction() -{ - return new AbstractMetaFunction(); -} - -AbstractMetaArgument *AbstractMetaBuilder::createMetaArgument() -{ - return new AbstractMetaArgument(); -} - -AbstractMetaType *AbstractMetaBuilder::createMetaType() -{ - return new AbstractMetaType(); -} - /** * Checks the argument of a hash function and flags the type if it is a complex type */ @@ -808,7 +773,7 @@ AbstractMetaClass *AbstractMetaBuilderPrivate::traverseNamespace(const FileModel return 0; } - AbstractMetaClass* metaClass = q->createMetaClass(); + AbstractMetaClass* metaClass = new AbstractMetaClass; metaClass->setTypeEntry(type); *metaClass += AbstractMetaAttributes::Public; @@ -1122,7 +1087,7 @@ AbstractMetaEnum *AbstractMetaBuilderPrivate::traverseEnum(EnumModelItem enumIte return 0; } - AbstractMetaEnum *metaEnum = q->createMetaEnum(); + AbstractMetaEnum *metaEnum = new AbstractMetaEnum; if (enumsDeclarations.contains(qualifiedName) || enumsDeclarations.contains(enumName)) { metaEnum->setHasQEnumsDeclaration(true); @@ -1150,7 +1115,7 @@ AbstractMetaEnum *AbstractMetaBuilderPrivate::traverseEnum(EnumModelItem enumIte const EnumeratorList &enums = enumItem->enumerators(); for (const EnumeratorModelItem &value : enums) { - AbstractMetaEnumValue *metaEnumValue = q->createMetaEnumValue(); + AbstractMetaEnumValue *metaEnumValue = new AbstractMetaEnumValue; metaEnumValue->setName(value->name()); // Deciding the enum value... @@ -1224,7 +1189,7 @@ AbstractMetaClass* AbstractMetaBuilderPrivate::traverseTypeDef(const FileModelIt if (type->isObject()) static_cast(type)->setQObject(isQObject(dom, stripTemplateArgs(typeDef->type().qualifiedName().join(colonColon())))); - AbstractMetaClass *metaClass = q->createMetaClass(); + AbstractMetaClass *metaClass = new AbstractMetaClass; metaClass->setTypeDef(true); metaClass->setTypeEntry(type); metaClass->setBaseClassNames(QStringList() << typeDef->type().qualifiedName().join(colonColon())); @@ -1283,7 +1248,7 @@ AbstractMetaClass *AbstractMetaBuilderPrivate::traverseClass(const FileModelItem if (type->isObject()) ((ObjectTypeEntry*)type)->setQObject(isQObject(dom, fullClassName)); - AbstractMetaClass *metaClass = q->createMetaClass(); + AbstractMetaClass *metaClass = new AbstractMetaClass; metaClass->setTypeEntry(type); if (classItem->isFinal()) @@ -1459,7 +1424,7 @@ AbstractMetaField *AbstractMetaBuilderPrivate::traverseField(VariableModelItem f } - AbstractMetaField *metaField = q->createMetaField(); + AbstractMetaField *metaField = new AbstractMetaField; metaField->setName(fieldName); metaField->setEnclosingClass(cls); @@ -1547,7 +1512,7 @@ void AbstractMetaBuilderPrivate::fixReturnTypeOfConversionOperator(AbstractMetaF if (!retType) return; - AbstractMetaType* metaType = q->createMetaType(); + AbstractMetaType* metaType = new AbstractMetaType; metaType->setTypeEntry(retType); metaFunction->replaceType(metaType); } @@ -1954,7 +1919,7 @@ AbstractMetaFunction* AbstractMetaBuilderPrivate::traverseFunction(const AddedFu AbstractMetaFunction* AbstractMetaBuilderPrivate::traverseFunction(const AddedFunction& addedFunc, AbstractMetaClass *metaClass) { - AbstractMetaFunction *metaFunction = q->createMetaFunction(); + AbstractMetaFunction *metaFunction = new AbstractMetaFunction; metaFunction->setConstant(addedFunc.isConstant()); metaFunction->setName(addedFunc.name()); metaFunction->setOriginalName(addedFunc.name()); @@ -1973,7 +1938,7 @@ AbstractMetaFunction* AbstractMetaBuilderPrivate::traverseFunction(const AddedFu for (int i = 0; i < args.count(); ++i) { AddedFunction::TypeInfo& typeInfo = args[i]; - AbstractMetaArgument *metaArg = q->createMetaArgument(); + AbstractMetaArgument *metaArg = new AbstractMetaArgument; AbstractMetaType* type = translateType(addedFunc.version(), typeInfo); decideUsagePattern(type); metaArg->setType(type); @@ -2216,7 +2181,7 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(FunctionModel if (functionItem->isFriend()) return 0; - AbstractMetaFunction *metaFunction = q->createMetaFunction(); + AbstractMetaFunction *metaFunction = new AbstractMetaFunction; // Additional check for assignment/move assignment down below metaFunction->setFunctionType(functionTypeFromCodeModel(functionItem->functionType())); metaFunction->setConstant(functionItem->isConstant()); @@ -2338,7 +2303,7 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(FunctionModel return nullptr; } - AbstractMetaArgument *metaArgument = q->createMetaArgument(); + AbstractMetaArgument *metaArgument = new AbstractMetaArgument; metaArgument->setType(metaType); metaArgument->setName(arg->name()); @@ -2482,7 +2447,7 @@ AbstractMetaType *AbstractMetaBuilderPrivate::translateType(double vr, qFatal(qPrintable(msg), NULL); } - AbstractMetaType *metaType = q->createMetaType(); + AbstractMetaType *metaType = new AbstractMetaType; metaType->setTypeEntry(type); metaType->setIndirections(typeInfo.indirections); if (typeInfo.isReference) @@ -2595,7 +2560,7 @@ AbstractMetaType *AbstractMetaBuilderPrivate::translateType(const TypeInfo &_typ return 0; for (int i = typeInfo.arrays.size() - 1; i >= 0; --i) { - AbstractMetaType *arrayType = q->createMetaType(); + AbstractMetaType *arrayType = new AbstractMetaType; arrayType->setArrayElementType(elementType); if (!typeInfo.arrays.at(i).isEmpty()) { bool _ok; @@ -2706,7 +2671,7 @@ AbstractMetaType *AbstractMetaBuilderPrivate::translateType(const TypeInfo &_typ // These are only implicit and should not appear in code... Q_ASSERT(!type->isInterface()); - AbstractMetaType *metaType = q->createMetaType(); + AbstractMetaType *metaType = new AbstractMetaType; metaType->setTypeEntry(type); metaType->setIndirections(typeInfo.indirections); metaType->setReferenceType(typeInfo.referenceType); @@ -3079,7 +3044,7 @@ bool AbstractMetaBuilderPrivate::inheritTemplate(AbstractMetaClass *subclass, } if (t) { - AbstractMetaType *temporaryType = q->createMetaType(); + AbstractMetaType *temporaryType = new AbstractMetaType; temporaryType->setTypeEntry(t); temporaryType->setConstant(i.is_constant); temporaryType->setReferenceType(i.referenceType); -- cgit v1.2.3