SymGetTypeInfo_ftype *fSymGetTypeInfo;
DWORD64 addr;
DWORD64 max_addr;
+ std::vector<type *> cache;
};
return pli->objfile->intern (name.get ());
}
-static type *get_pdb_type (pdb_line_info *pli, DWORD type_index)
+static type *get_pdb_type (pdb_line_info *pli, DWORD type_index);
+
+static type *get_pdb_type_cached (pdb_line_info *pli, DWORD type_index)
{
const struct objfile_type *ot = objfile_type (pli->objfile);
type *t = alloc_type (pli->objfile);
INIT_CPLUS_SPECIFIC (t);
+ pli->cache[type_index] = t;
+
t->set_name (wchar_to_objfile (pli, nameW));
if (udtkind == UdtUnion)
return ot->builtin_void;
}
+static type *get_pdb_type (pdb_line_info *pli, DWORD type_index)
+{
+ if (type_index >= pli->cache.size ())
+ pli->cache.resize (type_index + 1, nullptr);
+ else if (pli->cache[type_index] != nullptr)
+ return pli->cache[type_index];
+
+ type *t = get_pdb_type_cached (pli, type_index);
+ pli->cache[type_index] = t;
+
+ return t;
+}
+
static BOOL CALLBACK symbol_callback(PSYMBOL_INFO si,
ULONG /*SymbolSize*/, PVOID UserContext)
{