summaryrefslogtreecommitdiffstats
path: root/qmake/library
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-05-02 18:51:57 +0200
committerMarc Mutz <marc.mutz@kdab.com>2019-05-13 19:18:59 +0000
commit7cba2acd2cc4b68b5a4de2251ab555adb09bf7e8 (patch)
treee4f6453417becfd6df89f6c21bfae549db850cde /qmake/library
parentac4cf6e2b2dfc6ee37b0c64e1dd201e2b2452c31 (diff)
qmake: replace QLinkedList with std::list
This is in preparation of deprecating QLinkedList. There is but one substantial change: Instead of copying the linked list, we move it now, and instead of copying items between these two lists, we use std::list::splice(), which just relinks nodes. It is a bit surprising that the comment on the ProValueMapStack suggests references into the container must remain stable, and then some code changes addresses by making copies of the elements. This was probably a bug waiting to manifest itself. Since nothing else in qmake is using QLinkedList now, remove qlinkedlist.o from the qmake build. Change-Id: I08a5b0661466bf50ad8f9f8abf58bc801aef4ddc Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'qmake/library')
-rw-r--r--qmake/library/qmakeevaluator.cpp10
-rw-r--r--qmake/library/qmakeevaluator.h7
2 files changed, 10 insertions, 7 deletions
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp
index d7ff4ede39..c9dc7bd80b 100644
--- a/qmake/library/qmakeevaluator.cpp
+++ b/qmake/library/qmakeevaluator.cpp
@@ -601,14 +601,16 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProBlock(
case TokBypassNesting:
blockLen = getBlockLen(tokPtr);
if ((m_cumulative || okey != or_op) && blockLen) {
- ProValueMapStack savedValuemapStack = m_valuemapStack;
+ ProValueMapStack savedValuemapStack = std::move(m_valuemapStack);
m_valuemapStack.clear();
- m_valuemapStack.append(savedValuemapStack.takeFirst());
+ m_valuemapStack.splice(m_valuemapStack.end(),
+ savedValuemapStack, savedValuemapStack.begin());
traceMsg("visiting nesting-bypassing block");
ret = visitProBlock(tokPtr);
traceMsg("visited nesting-bypassing block");
- savedValuemapStack.prepend(m_valuemapStack.first());
- m_valuemapStack = savedValuemapStack;
+ savedValuemapStack.splice(savedValuemapStack.begin(),
+ m_valuemapStack, m_valuemapStack.begin());
+ m_valuemapStack = std::move(savedValuemapStack);
} else {
traceMsg("skipped nesting-bypassing block");
ret = ReturnTrue;
diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h
index 2aebb825ea..9f702b9182 100644
--- a/qmake/library/qmakeevaluator.h
+++ b/qmake/library/qmakeevaluator.h
@@ -38,7 +38,6 @@
#include "ioutils.h"
#include <qlist.h>
-#include <qlinkedlist.h>
#include <qmap.h>
#include <qset.h>
#include <qstack.h>
@@ -54,6 +53,8 @@
# include <qmutex.h>
#endif
+#include <list>
+
QT_BEGIN_NAMESPACE
class QMakeGlobals;
@@ -94,9 +95,9 @@ public:
#endif
};
-// We use a QLinkedList based stack instead of a QVector based one (QStack), so that
+// We use a list-based stack instead of a vector-based one, so that
// the addresses of value maps stay constant. The qmake generators rely on that.
-class QMAKE_EXPORT ProValueMapStack : public QLinkedList<ProValueMap>
+class QMAKE_EXPORT ProValueMapStack : public std::list<ProValueMap>
{
public:
inline void push(const ProValueMap &t) { push_back(t); }