Never show raw addresses in output.
authorMilian Wolff <mail@milianw.de>
Sun, 22 Jan 2017 11:59:08 +0000 (12:59 +0100)
committerMilian Wolff <mail@milianw.de>
Sun, 22 Jan 2017 11:59:08 +0000 (12:59 +0100)
This information is pretty useless, imho. Always returning a shared
<unresolved function> string as function name instead of the
stringified adress speeds up the code significantly and reduces
memory as more stack branches can get merged.

src/analyze/gui/parser.cpp

index 293f357..cd3d9c5 100644 (file)
@@ -37,24 +37,13 @@ namespace {
 // TODO: use QString directly
 struct StringCache
 {
-    StringCache()
-    {
-        m_ipAddresses.reserve(16384);
-    }
-
     QString func(const InstructionPointer& ip) const
     {
         if (ip.functionIndex) {
             // TODO: support removal of template arguments
             return stringify(ip.functionIndex);
-        } else if (diffMode) {
-            return i18n("<unresolved function>");
         } else {
-            auto& ipAddr = m_ipAddresses[ip.instructionPointer];
-            if (ipAddr.isEmpty()) {
-                ipAddr = QLatin1String("0x") + QString::number(ip.instructionPointer, 16);
-            }
-            return ipAddr;
+            return i18n("<unresolved function>");
         }
     }
 
@@ -110,7 +99,6 @@ struct StringCache
     }
 
     vector<QString> m_strings;
-    mutable QHash<uint64_t, QString> m_ipAddresses;
     mutable vector<LocationData::Ptr> m_locations;
     mutable QHash<IpIndex, LocationData::Ptr> m_locationsMap;