forked from qt-creator/qt-creator
QmlProfiler: Avoid structs with default values
gcc 4.9 and msvc 2015 choke when creating those from initializer lists. Change-Id: I85936fe33418d5d9ffeb3c910392ad43fbb9a9bb Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
committed by
Ulf Hermann
parent
1155601da5
commit
c637c66ebb
@@ -370,7 +370,7 @@ void QmlProfilerStatisticsRelativesModel::loadEvent(RangeType type, const QmlEve
|
|||||||
|
|
||||||
switch (event.rangeStage()) {
|
switch (event.rangeStage()) {
|
||||||
case RangeStart:
|
case RangeStart:
|
||||||
stack.push({event.timestamp(), event.typeIndex()});
|
stack.push(Frame(event.timestamp(), event.typeIndex()));
|
||||||
break;
|
break;
|
||||||
case RangeEnd: {
|
case RangeEnd: {
|
||||||
int callerTypeIndex = stack.count() > 1 ? stack[stack.count() - 2].typeId : -1;
|
int callerTypeIndex = stack.count() > 1 ? stack[stack.count() - 2].typeId : -1;
|
||||||
@@ -386,12 +386,8 @@ void QmlProfilerStatisticsRelativesModel::loadEvent(RangeType type, const QmlEve
|
|||||||
it->duration += event.timestamp() - stack.top().startTime;
|
it->duration += event.timestamp() - stack.top().startTime;
|
||||||
it->isRecursive = isRecursive || it->isRecursive;
|
it->isRecursive = isRecursive || it->isRecursive;
|
||||||
} else {
|
} else {
|
||||||
QmlStatisticsRelativesData relative = {
|
relativesMap.insert(relativeTypeIndex, QmlStatisticsRelativesData(
|
||||||
event.timestamp() - stack.top().startTime,
|
event.timestamp() - stack.top().startTime, 1, isRecursive));
|
||||||
1,
|
|
||||||
isRecursive
|
|
||||||
};
|
|
||||||
relativesMap.insert(relativeTypeIndex, relative);
|
|
||||||
}
|
}
|
||||||
stack.pop();
|
stack.pop();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -113,9 +113,11 @@ class QmlProfilerStatisticsRelativesModel : public QObject
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
struct QmlStatisticsRelativesData {
|
struct QmlStatisticsRelativesData {
|
||||||
qint64 duration = 0;
|
QmlStatisticsRelativesData(qint64 duration = 0, qint64 calls = 0, bool isRecursive = false)
|
||||||
qint64 calls = 0;
|
: duration(duration), calls(calls), isRecursive(isRecursive) {}
|
||||||
bool isRecursive = false;
|
qint64 duration;
|
||||||
|
qint64 calls;
|
||||||
|
bool isRecursive;
|
||||||
};
|
};
|
||||||
typedef QHash <int, QmlStatisticsRelativesData> QmlStatisticsRelativesMap;
|
typedef QHash <int, QmlStatisticsRelativesData> QmlStatisticsRelativesMap;
|
||||||
|
|
||||||
@@ -141,8 +143,9 @@ protected:
|
|||||||
QPointer<QmlProfilerModelManager> m_modelManager;
|
QPointer<QmlProfilerModelManager> m_modelManager;
|
||||||
|
|
||||||
struct Frame {
|
struct Frame {
|
||||||
qint64 startTime = 0;
|
Frame(qint64 startTime = 0, int typeId = -1) : startTime(startTime), typeId(typeId) {}
|
||||||
int typeId = -1;
|
qint64 startTime;
|
||||||
|
int typeId;
|
||||||
};
|
};
|
||||||
QStack<Frame> m_callStack;
|
QStack<Frame> m_callStack;
|
||||||
QStack<Frame> m_compileStack;
|
QStack<Frame> m_compileStack;
|
||||||
|
|||||||
Reference in New Issue
Block a user