[all-commits] [llvm/llvm-project] 7e00e3: [lldb] Fix lookup of types in anonymous namespaces...

Pavel Labath via All-commits all-commits at lists.llvm.org
Thu Jan 16 01:50:13 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7e00e3ae6dd4ba215dad27d1729df533cbb37795
      https://github.com/llvm/llvm-project/commit/7e00e3ae6dd4ba215dad27d1729df533cbb37795
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2025-01-16 (Thu, 16 Jan 2025)

  Changed paths:
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    M lldb/test/API/lang/cpp/nested-template/TestNestedTemplate.py
    M lldb/test/API/lang/cpp/nested-template/main.cpp

  Log Message:
  -----------
  [lldb] Fix lookup of types in anonymous namespaces with -gsimple-template-names (#123054)

Anonymous namespaces are supposed to be optional when looking up types.
This was not working in combination with -gsimple-template-names,
because the way it was constructing the complete (with template args)
name scope (i.e., by generating thescope as a string and then reparsing
it) did not preserve the information about the scope kinds.

Essentially what the code wants here is to call `GetTypeLookupContext`
(that's the function used to get the context in the "regular" code
path), but to embelish each name with the template arguments (if they
don't have them already). This PR implements exactly that by adding an
argument to control which kind of names are we interested in. This
should also make the lookup faster as it avoids parsing of the long
string, but I haven't attempted to benchmark that.

I believe this function can also be used in some other places where
we're manually appending template names, but I'm leaving that for
another patch.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list