mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
remove unused extradata from QMetaObject
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
11f4c6fe5d
commit
fe0d2e6215
12 changed files with 7 additions and 100 deletions
|
@ -8,7 +8,7 @@ rm -rf "$cwd/../minsize"
|
||||||
mkdir -p "$cwd/../minsize"
|
mkdir -p "$cwd/../minsize"
|
||||||
cd "$cwd/../minsize"
|
cd "$cwd/../minsize"
|
||||||
|
|
||||||
export CFLAGS="$CFLAGS -flto" CXXFLAGS="$CXXFLAGS -flto"
|
# export CFLAGS="$CFLAGS -flto" CXXFLAGS="$CXXFLAGS -flto"
|
||||||
|
|
||||||
cmake ../ -DCMAKE_BUILD_TYPE=MinSizeRel \
|
cmake ../ -DCMAKE_BUILD_TYPE=MinSizeRel \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
|
|
|
@ -54,7 +54,7 @@ class QByteArray;
|
||||||
class QString;
|
class QString;
|
||||||
|
|
||||||
#ifndef Q_MOC_OUTPUT_REVISION
|
#ifndef Q_MOC_OUTPUT_REVISION
|
||||||
#define Q_MOC_OUTPUT_REVISION 65
|
#define Q_MOC_OUTPUT_REVISION 66
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// The following macros are our "extensions" to C++
|
// The following macros are our "extensions" to C++
|
||||||
|
@ -445,7 +445,6 @@ struct Q_CORE_EXPORT QMetaObject
|
||||||
#else
|
#else
|
||||||
const QMetaObject **relatedMetaObjects;
|
const QMetaObject **relatedMetaObjects;
|
||||||
#endif
|
#endif
|
||||||
void *extradata; //reserved for future use
|
|
||||||
} d;
|
} d;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -375,7 +375,7 @@ void QDBusAdaptorConnector::qt_static_metacall(QObject *_o, QMetaObject::Call _c
|
||||||
|
|
||||||
const QMetaObject QDBusAdaptorConnector::staticMetaObject = {
|
const QMetaObject QDBusAdaptorConnector::staticMetaObject = {
|
||||||
{ &QObject::staticMetaObject, qt_meta_stringdata_QDBusAdaptorConnector,
|
{ &QObject::staticMetaObject, qt_meta_stringdata_QDBusAdaptorConnector,
|
||||||
qt_meta_data_QDBusAdaptorConnector, qt_static_metacall, Q_NULLPTR, Q_NULLPTR }
|
qt_meta_data_QDBusAdaptorConnector, qt_static_metacall, Q_NULLPTR }
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef Q_NO_DATA_RELOCATION
|
#ifdef Q_NO_DATA_RELOCATION
|
||||||
|
|
|
@ -499,7 +499,6 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj)
|
||||||
obj->d.data = uint_data;
|
obj->d.data = uint_data;
|
||||||
obj->d.relatedMetaObjects = 0;
|
obj->d.relatedMetaObjects = 0;
|
||||||
obj->d.static_metacall = 0;
|
obj->d.static_metacall = 0;
|
||||||
obj->d.extradata = 0;
|
|
||||||
obj->d.stringdata = string_data;
|
obj->d.stringdata = string_data;
|
||||||
obj->d.superdata = &QDBusAbstractInterface::staticMetaObject;
|
obj->d.superdata = &QDBusAbstractInterface::staticMetaObject;
|
||||||
}
|
}
|
||||||
|
@ -523,7 +522,6 @@ void QDBusMetaObjectGenerator::writeWithoutXml(const QString &interface)
|
||||||
d.data = reinterpret_cast<uint*>(header);
|
d.data = reinterpret_cast<uint*>(header);
|
||||||
d.relatedMetaObjects = 0;
|
d.relatedMetaObjects = 0;
|
||||||
d.static_metacall = 0;
|
d.static_metacall = 0;
|
||||||
d.extradata = 0;
|
|
||||||
d.stringdata = stringdata;
|
d.stringdata = stringdata;
|
||||||
d.superdata = &QDBusAbstractInterface::staticMetaObject;
|
d.superdata = &QDBusAbstractInterface::staticMetaObject;
|
||||||
cached = false;
|
cached = false;
|
||||||
|
|
|
@ -71,7 +71,6 @@ QDeclarativeParser::Object::Object()
|
||||||
extObject.d.superdata = 0;
|
extObject.d.superdata = 0;
|
||||||
extObject.d.stringdata = 0;
|
extObject.d.stringdata = 0;
|
||||||
extObject.d.data = 0;
|
extObject.d.data = 0;
|
||||||
extObject.d.extradata = 0;
|
|
||||||
extObject.d.relatedMetaObjects = 0;
|
extObject.d.relatedMetaObjects = 0;
|
||||||
extObject.d.static_metacall = 0;
|
extObject.d.static_metacall = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1133,7 +1133,6 @@ static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf,
|
||||||
if (buf) {
|
if (buf) {
|
||||||
if (!relocatable) meta->d.superdata = d->superClass;
|
if (!relocatable) meta->d.superdata = d->superClass;
|
||||||
meta->d.relatedMetaObjects = 0;
|
meta->d.relatedMetaObjects = 0;
|
||||||
meta->d.extradata = 0;
|
|
||||||
meta->d.static_metacall = d->staticMetacallFunction;
|
meta->d.static_metacall = d->staticMetacallFunction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1437,7 +1436,6 @@ void QMetaObjectBuilder::fromRelocatableData(QMetaObject *output,
|
||||||
output->d.superdata = superclass;
|
output->d.superdata = superclass;
|
||||||
output->d.stringdata = buf + stringdataOffset;
|
output->d.stringdata = buf + stringdataOffset;
|
||||||
output->d.data = reinterpret_cast<const uint *>(buf + dataOffset);
|
output->d.data = reinterpret_cast<const uint *>(buf + dataOffset);
|
||||||
output->d.extradata = 0;
|
|
||||||
output->d.relatedMetaObjects = 0;
|
output->d.relatedMetaObjects = 0;
|
||||||
output->d.static_metacall = 0;
|
output->d.static_metacall = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2106,7 +2106,7 @@ void QScript::QObjectConnectionManager::qt_static_metacall(QObject *_o, QMetaObj
|
||||||
|
|
||||||
const QMetaObject QScript::QObjectConnectionManager::staticMetaObject = {
|
const QMetaObject QScript::QObjectConnectionManager::staticMetaObject = {
|
||||||
{ &QObject::staticMetaObject, qt_meta_stringdata_QScript__QObjectConnectionManager,
|
{ &QObject::staticMetaObject, qt_meta_stringdata_QScript__QObjectConnectionManager,
|
||||||
qt_meta_data_QScript__QObjectConnectionManager, qt_static_metacall, 0, 0 }
|
qt_meta_data_QScript__QObjectConnectionManager, qt_static_metacall, Q_NULLPTR }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,6 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "generator.h"
|
#include "generator.h"
|
||||||
#include "outputrevision.h"
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include <QtCore/qmetatype.h>
|
#include <QtCore/qmetatype.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -289,37 +288,6 @@ void Generator::generateCode()
|
||||||
if (cdef->hasQObject && !isQt)
|
if (cdef->hasQObject && !isQt)
|
||||||
generateStaticMetacall();
|
generateStaticMetacall();
|
||||||
|
|
||||||
//
|
|
||||||
// Build extra array
|
|
||||||
//
|
|
||||||
QList<QByteArray> extraList;
|
|
||||||
for (int i = 0; i < cdef->propertyList.count(); ++i) {
|
|
||||||
const PropertyDef &p = cdef->propertyList.at(i);
|
|
||||||
if (!isVariantType(p.type.constData()) && !metaTypes.contains(p.type) && !p.type.contains('*') &&
|
|
||||||
!p.type.contains('<') && !p.type.contains('>')) {
|
|
||||||
int s = p.type.lastIndexOf("::");
|
|
||||||
if (s > 0) {
|
|
||||||
QByteArray scope = p.type.left(s);
|
|
||||||
if (scope != "Qt" && scope != cdef->classname && !extraList.contains(scope))
|
|
||||||
extraList += scope;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!extraList.isEmpty()) {
|
|
||||||
fprintf(out, "#ifdef Q_NO_DATA_RELOCATION\n");
|
|
||||||
fprintf(out, "static const QMetaObjectAccessor qt_meta_extradata_%s[] = {\n ", qualifiedClassNameIdentifier.constData());
|
|
||||||
for (int i = 0; i < extraList.count(); ++i) {
|
|
||||||
fprintf(out, " %s::getStaticMetaObject,\n", extraList.at(i).constData());
|
|
||||||
}
|
|
||||||
fprintf(out, "#else\n");
|
|
||||||
fprintf(out, "static const QMetaObject *qt_meta_extradata_%s[] = {\n ", qualifiedClassNameIdentifier.constData());
|
|
||||||
for (int i = 0; i < extraList.count(); ++i) {
|
|
||||||
fprintf(out, " &%s::staticMetaObject,\n", extraList.at(i).constData());
|
|
||||||
}
|
|
||||||
fprintf(out, "#endif //Q_NO_DATA_RELOCATION\n");
|
|
||||||
fprintf(out, " Q_NULLPTR\n};\n\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Finally create and initialize the static meta object
|
// Finally create and initialize the static meta object
|
||||||
//
|
//
|
||||||
|
@ -341,10 +309,6 @@ void Generator::generateCode()
|
||||||
else
|
else
|
||||||
fprintf(out, " Q_NULLPTR, ");
|
fprintf(out, " Q_NULLPTR, ");
|
||||||
|
|
||||||
if (extraList.isEmpty())
|
|
||||||
fprintf(out, "Q_NULLPTR, ");
|
|
||||||
else
|
|
||||||
fprintf(out, "qt_meta_extradata_%s, ", qualifiedClassNameIdentifier.constData());
|
|
||||||
fprintf(out, "Q_NULLPTR}\n};\n\n");
|
fprintf(out, "Q_NULLPTR}\n};\n\n");
|
||||||
|
|
||||||
if(isQt)
|
if(isQt)
|
||||||
|
|
|
@ -43,7 +43,6 @@
|
||||||
#include "generator.h"
|
#include "generator.h"
|
||||||
#include "qdatetime.h"
|
#include "qdatetime.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "outputrevision.h"
|
|
||||||
|
|
||||||
// for normalizeTypeInternal
|
// for normalizeTypeInternal
|
||||||
#include <qmetaobject_p.h>
|
#include <qmetaobject_p.h>
|
||||||
|
@ -780,7 +779,7 @@ void Moc::generate(FILE *out)
|
||||||
fn = filename.mid(i);
|
fn = filename.mid(i);
|
||||||
fprintf(out, "/****************************************************************************\n"
|
fprintf(out, "/****************************************************************************\n"
|
||||||
"** Meta object code from reading C++ file '%s'\n**\n" , fn.constData());
|
"** Meta object code from reading C++ file '%s'\n**\n" , fn.constData());
|
||||||
fprintf(out, "** Created by: The Qt Meta Object Compiler version %d (Qt %s)\n**\n" , mocOutputRevision, QT_VERSION_STR);
|
fprintf(out, "** Created by: The Qt Meta Object Compiler version %d (Qt %s)\n**\n" , Q_MOC_OUTPUT_REVISION, QT_VERSION_STR);
|
||||||
fprintf(out, "** WARNING! All changes made in this file will be lost!\n"
|
fprintf(out, "** WARNING! All changes made in this file will be lost!\n"
|
||||||
"*****************************************************************************/\n\n");
|
"*****************************************************************************/\n\n");
|
||||||
|
|
||||||
|
@ -806,7 +805,7 @@ void Moc::generate(FILE *out)
|
||||||
|
|
||||||
fprintf(out, "#if !defined(Q_MOC_OUTPUT_REVISION)\n"
|
fprintf(out, "#if !defined(Q_MOC_OUTPUT_REVISION)\n"
|
||||||
"#error \"The header file '%s' doesn't include <QObject>.\"\n", fn.constData());
|
"#error \"The header file '%s' doesn't include <QObject>.\"\n", fn.constData());
|
||||||
fprintf(out, "#elif Q_MOC_OUTPUT_REVISION != %d\n", mocOutputRevision);
|
fprintf(out, "#elif Q_MOC_OUTPUT_REVISION != %d\n", Q_MOC_OUTPUT_REVISION);
|
||||||
fprintf(out, "#error \"This file was generated using the moc from %s."
|
fprintf(out, "#error \"This file was generated using the moc from %s."
|
||||||
" It\"\n#error \"cannot be used with the include files from"
|
" It\"\n#error \"cannot be used with the include files from"
|
||||||
" this version of Qt.\"\n#error \"(The moc has changed too"
|
" this version of Qt.\"\n#error \"(The moc has changed too"
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
|
|
||||||
#include "preprocessor.h"
|
#include "preprocessor.h"
|
||||||
#include "moc.h"
|
#include "moc.h"
|
||||||
#include "outputrevision.h"
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
@ -302,7 +301,7 @@ int runMoc(int _argc, char **_argv)
|
||||||
if (more && opt != "version")
|
if (more && opt != "version")
|
||||||
error();
|
error();
|
||||||
fprintf(stderr, "Qt Meta Object Compiler version %d (Qt %s)\n",
|
fprintf(stderr, "Qt Meta Object Compiler version %d (Qt %s)\n",
|
||||||
mocOutputRevision, QT_VERSION_STR);
|
Q_MOC_OUTPUT_REVISION, QT_VERSION_STR);
|
||||||
return 1;
|
return 1;
|
||||||
case 'n': // don't display warnings
|
case 'n': // don't display warnings
|
||||||
if (ignoreConflictingOptions)
|
if (ignoreConflictingOptions)
|
||||||
|
|
|
@ -1,48 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2015 The Qt Company Ltd.
|
|
||||||
** Contact: http://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of the tools applications of the Qt Toolkit.
|
|
||||||
**
|
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see http://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at http://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
||||||
** General Public License version 2.1 or version 3 as published by the Free
|
|
||||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
||||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
||||||
** following information to ensure the GNU Lesser General Public License
|
|
||||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
||||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** As a special exception, The Qt Company gives you certain additional
|
|
||||||
** rights. These rights are described in The Qt Company LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3.0 as published by the Free Software
|
|
||||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
|
||||||
** packaging of this file. Please review the following information to
|
|
||||||
** ensure the GNU General Public License version 3.0 requirements will be
|
|
||||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef OUTPUTREVISION_H
|
|
||||||
#define OUTPUTREVISION_H
|
|
||||||
|
|
||||||
// if the output revision changes, you MUST change it in qobjectdefs.h too
|
|
||||||
enum { mocOutputRevision = 65 }; // moc format output revision
|
|
||||||
|
|
||||||
#endif // OUTPUTREVISION_H
|
|
|
@ -270,7 +270,6 @@ void MocParser::parse(const char *fname, QIODevice *io, int lineNum)
|
||||||
mo.d.superdata = &QObject::staticMetaObject;
|
mo.d.superdata = &QObject::staticMetaObject;
|
||||||
mo.d.stringdata = stringdata;
|
mo.d.stringdata = stringdata;
|
||||||
mo.d.data = data;
|
mo.d.data = data;
|
||||||
mo.d.extradata = 0;
|
|
||||||
objects.append(mo);
|
objects.append(mo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue