<div dir="ltr">I was trying to implemented type lookup for qualified names (e.g. in namespaces), and I noticed we have this code in Module.cpp:<div><br></div><div><div>  if (Type::GetTypeScopeAndBasename(type_name_cstr, type_scope, type_basename,</div><div>                                    type_class)) {</div><div>    // Check if "name" starts with "::" which means the qualified type starts</div><div>    // from the root namespace and implies and exact match. The typenames we</div><div>    // get back from clang do not start with "::" so we need to strip this off</div><div>    // in order to get the qualified names to match</div><div>    exact_match = type_scope.consume_front("::");</div><div><br></div><div>    ConstString type_basename_const_str(type_basename);</div><div>    if (FindTypes_Impl(sc, type_basename_const_str, nullptr, append,</div><div>                       max_matches, searched_symbol_files, typesmap)) {</div><div>      typesmap.RemoveMismatchedTypes(type_scope, type_basename, type_class,</div><div>                                     exact_match);</div><div>      num_matches = typesmap.GetSize();</div><div>    }</div><div>  } else {</div></div><div><br></div><div><br></div><div>Basically we are stripping the namespace and scope, and only passing the basename to the SymbolVendor.  I guess then the SymbolFile will find any types which match the basename, which could be anything, and the RemoveMismatchedTypes will filter this down to only the ones that are in the namespace.</div><div><br></div><div>I don't know what this is like in DWARF-land, but for PDB this is *precisely* what we do not want to do.  Types are indexed in an internal hash table by fully qualified name, so we need the fully scoped name in the SymbolFile plugin otherwise we basically have to do the equivalent of a full table scan for what could be an O(1) operation.</div><div><br></div><div>If I change this to pass the fully scoped name, is this going to break SymbolFileDWARF?</div></div>