Mark more classes & structs as Q_MOVABLE_TYPE/Q_PRIMITIVE_TYPE
ClosedPublic

Authored by kossebau on Dec 4 2017, 3:09 AM.

Details

Summary

Classes and structs used in Qt containers can get optimized handling if their
typeinfo is known. This patch adds the typeinfo to many types which are used
in Qt containers and where I understood the member types.

Test Plan

No issues seen in two days usage.
Tests run as before.

Diff Detail

Repository
R32 KDevelop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Dec 4 2017, 3:09 AM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptDec 4 2017, 3:09 AM
kossebau requested review of this revision.Dec 4 2017, 3:09 AM
mwolff added a subscriber: mwolff.Dec 5 2017, 10:48 AM

which types didn't you understand? Also, if in doubt, you can use QTypeInfoMerger: https://code.woboq.org/qt5/qtbase/src/corelib/global/qtypeinfo.h.html#133

which types didn't you understand? Also, if in doubt, you can use QTypeInfoMerger: https://code.woboq.org/qt5/qtbase/src/corelib/global/qtypeinfo.h.html#133

There are some types in duchain IIRC (sadly dropped any lists I had created manually only) which involve lots of other templated types, and I could not easily track down the involved types to check if there are any self-referencing ones involved (i.e. with pointers to its own internal data structures) which would prevent marking them movable.

The missing-typeinfo check from clazy has had far fewer hits than I found manually (possibly because it avoids being too clever when it comes to unknown types which could keep pointers to itself)?

So while the list of types in this patch is list is long, it sadly is incomplete as the patch was created manually based on some grep over the sources for types used with qlist/qvector/qmap and investigating each type manually.

Is there some more proper way for doing this? :)

kfunk accepted this revision.Dec 13 2017, 6:04 PM
kfunk added a subscriber: kfunk.

Minor issues, rest LGTM.

kdevplatform/project/projectbuildsetmodel.h
93

This one doesn't really make sense, no? ProjectBuildSetModel is a pointer based type and is not meant to be used as container value type.

This revision is now accepted and ready to land.Dec 13 2017, 6:04 PM
kossebau marked an inline comment as done.Dec 13 2017, 6:46 PM

Thanks for review @kfunk

kdevplatform/project/projectbuildsetmodel.h
93

Uhoh... no idea anymore why that slipped into the list of types tagged, good catch.
Would agree, so will drop from the patch.

This revision was automatically updated to reflect the committed changes.
kossebau marked an inline comment as done.