[all-commits] [llvm/llvm-project] e772a2: [Clang] Emit DW_TAG_template_alias for template al...

Orlando Cazalet-Hyams via All-commits all-commits at lists.llvm.org
Thu Apr 18 13:08:53 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e772a268ef75332b72dd9b9ca0341a6af8b0db72
      https://github.com/llvm/llvm-project/commit/e772a268ef75332b72dd9b9ca0341a6af8b0db72
  Author: Orlando Cazalet-Hyams <orlando.hyams at sony.com>
  Date:   2024-04-18 (Thu, 18 Apr 2024)

  Changed paths:
    M clang/include/clang/Basic/DebugOptions.def
    M clang/include/clang/Driver/Options.td
    M clang/lib/CodeGen/CGDebugInfo.cpp
    M clang/lib/CodeGen/CGDebugInfo.h
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    M clang/test/CodeGenCXX/debug-info-alias.cpp
    A clang/test/CodeGenCXX/defaulted-template-alias.cpp
    A clang/test/CodeGenCXX/template-alias.cpp
    A clang/test/CodeGenCXX/variadic-template-alias.cpp
    M clang/test/Driver/debug-options.c

  Log Message:
  -----------
  [Clang] Emit DW_TAG_template_alias for template aliases (#87623)

Fix issue https://github.com/llvm/llvm-project/issues/54624

Add front end flags -gtemplate-alias (also a cc1 flag) and -gno-template-alias
to enable/disable usage of the feature. It's enabled by default in the front
end for SCE debugger tuning only.

GCC emits DW_TAG_typedef for template aliases (as does Clang with this feature
disabled), and GDB and LLDB appear not to support DW_TAG_template_alias.

The -Xclang option -gsimple-template-names=mangled is treated the same as
=full, which is not a regression from current behaviour for template
aliases.

The current implementation omits defaulted arguments and as a consequence
also omits empty parameter packs that come after defaulted arguments. Again,
this isn't a regression as the DW_TAG_typedef name doesn't contain defaulted
arguments.

LLVM support added in https://github.com/llvm/llvm-project/pull/88943

Added template-alias.cpp - Check the metadata construction & interaction with
      -gsimple-template-names.
Added variadic-template-alias.cpp - Check template parameter packs work.
Added defaulted-template-alias.cpp - Check defaulted args (don't) work.
Modified debug-options.c - Check Clang generates correct cc1 flags.



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