aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4ssa.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-07-31 14:32:12 +0200
committerLaszlo Agocs <laszlo.agocs@digia.com>2014-08-04 10:09:08 +0200
commita1dd62ce929a605febff8b7b5f0e29064555681b (patch)
tree3c0387594d349e2eeb37508d50dee7967923c307 /src/qml/compiler/qv4ssa.cpp
parent2b3493c1b216d1d2ce1cbac974db1a9ee449e01f (diff)
Make ssa compile on Android with gcc 4.6
Avoid errors like compiler/qv4ssa.cpp:660:59: error: no matching function for call to 'sort(QVector<QV4::IR::BasicBlock*>::iterator, QVector<QV4::IR::BasicBlock*>::iterator, (anonymous namespace)::DominatorTree::calculateDFNodeIterOrder() const::Cmp)' Change-Id: I4189bd621f1cef5e00b06f5b6b6dd430fefe653f Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4ssa.cpp')
-rw-r--r--src/qml/compiler/qv4ssa.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp
index 8488d6eb2b..662b7054e9 100644
--- a/src/qml/compiler/qv4ssa.cpp
+++ b/src/qml/compiler/qv4ssa.cpp
@@ -619,6 +619,21 @@ public:
return dominates(dominator->index(), dominated->index());
}
+ struct Cmp {
+ std::vector<int> *nodeDepths;
+ Cmp(std::vector<int> *nodeDepths)
+ : nodeDepths(nodeDepths)
+ { Q_ASSERT(nodeDepths); }
+ bool operator()(BasicBlock *one, BasicBlock *two) const
+ {
+ if (one->isRemoved())
+ return false;
+ if (two->isRemoved())
+ return true;
+ return nodeDepths->at(one->index()) > nodeDepths->at(two->index());
+ }
+ };
+
// Calculate a depth-first iteration order on the nodes of the dominator tree.
//
// The order of the nodes in the vector is not the same as one where a recursive depth-first
@@ -641,20 +656,6 @@ public:
QVector<BasicBlock *> calculateDFNodeIterOrder() const
{
std::vector<int> depths = calculateNodeDepths();
- struct Cmp {
- std::vector<int> *nodeDepths;
- Cmp(std::vector<int> *nodeDepths)
- : nodeDepths(nodeDepths)
- { Q_ASSERT(nodeDepths); }
- bool operator()(BasicBlock *one, BasicBlock *two) const
- {
- if (one->isRemoved())
- return false;
- if (two->isRemoved())
- return true;
- return nodeDepths->at(one->index()) > nodeDepths->at(two->index());
- }
- };
QVector<BasicBlock *> order = function->basicBlocks();
std::sort(order.begin(), order.end(), Cmp(&depths));
for (int i = 0; i < order.size(); ) {