summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2022-12-04 21:21:20 +0100
committerMilian Wolff <milian.wolff@kdab.com>2022-12-05 10:13:05 +0000
commitbba344882d1244bcb745263e1280a918258b9e09 (patch)
tree20ae0ddbc6cfe56d866f0751cfc0ae02f56c1ae6
parent1447985e6ed52198ac92d98cfbd42bcd6a40df8c (diff)
Use std::vector instead of QVector in prependScopeNames
We don't need COW here, and this also fixes a clazy warning that we are missing a Q_DECLARE_TYPEINFO for this struct. Change-Id: Ic4abe670f323f469a29d89ed2a9a0b0e60d5a897 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--app/perfdwarfdiecache.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/perfdwarfdiecache.cpp b/app/perfdwarfdiecache.cpp
index 5046cff..10e432e 100644
--- a/app/perfdwarfdiecache.cpp
+++ b/app/perfdwarfdiecache.cpp
@@ -24,6 +24,8 @@
#include <dwarf.h>
+#include <vector>
+
#include "demangler.h"
namespace {
@@ -152,7 +154,7 @@ void prependScopeNames(QByteArray &name, Dwarf_Die *die, QHash<Dwarf_Off, QByteA
Dwarf_Off offset;
int trailing;
};
- QVector<ScopesToCache> cacheOps;
+ std::vector<ScopesToCache> cacheOps;
// skip scope for the die itself at the start and the compile unit DIE at end
for (int i = 1; i < nscopes - 1; ++i) {
@@ -174,7 +176,7 @@ void prependScopeNames(QByteArray &name, Dwarf_Die *die, QHash<Dwarf_Off, QByteA
if (auto scopeLinkageName = linkageName(scope)) {
// prepend the fully qualified linkage name
name.prepend("::");
- cacheOps.append({scopeOffset, int(name.size())});
+ cacheOps.push_back({scopeOffset, int(name.size())});
// we have to demangle the scope linkage name, otherwise we get a
// mish-mash of mangled and non-mangled names
name.prepend(demangle(scopeLinkageName));
@@ -185,15 +187,15 @@ void prependScopeNames(QByteArray &name, Dwarf_Die *die, QHash<Dwarf_Off, QByteA
if (auto scopeName = dwarf_diename(scope)) {
// prepend this scope's name, e.g. the class or namespace name
name.prepend("::");
- cacheOps.append({scopeOffset, int(name.size())});
+ cacheOps.push_back({scopeOffset, int(name.size())});
name.prepend(scopeName);
}
if (auto specification = specificationDie(scope, &dieMem)) {
eu_compat_free(scopes);
scopes = nullptr;
- cacheOps.append({scopeOffset, int(name.size())});
- cacheOps.append({dwarf_dieoffset(specification), int(name.size())});
+ cacheOps.push_back({scopeOffset, int(name.size())});
+ cacheOps.push_back({dwarf_dieoffset(specification), int(name.size())});
// follow the scope's specification DIE instead
prependScopeNames(name, specification, cache);
break;