[all-commits] [llvm/llvm-project] b706f5: [lldb] Automatically unwrap parameter packs in te...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Tue Aug 16 18:10:29 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b706f56133a77f9d7c55270ac24ff59e6fce3fa4
      https://github.com/llvm/llvm-project/commit/b706f56133a77f9d7c55270ac24ff59e6fce3fa4
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2022-08-16 (Tue, 16 Aug 2022)

  Changed paths:
    M lldb/include/lldb/API/SBType.h
    M lldb/include/lldb/Symbol/CompilerType.h
    M lldb/include/lldb/Symbol/TypeSystem.h
    M lldb/source/API/SBType.cpp
    M lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
    M lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
    M lldb/source/Symbol/CompilerType.cpp
    M lldb/source/Symbol/TypeSystem.cpp
    A lldb/test/API/lang/cpp/class-template-parameter-pack/TestTemplatePackArgs.py
    M lldb/test/API/lang/cpp/class-template-parameter-pack/main.cpp
    M lldb/unittests/Symbol/TestTypeSystemClang.cpp

  Log Message:
  -----------
  [lldb]  Automatically unwrap parameter packs in template argument accessors

When looking at template arguments in LLDB, we usually care about what
the user passed in his code, not whether some of those arguments where
passed as a variadic parameter pack.

This patch extends all the C++ APIs to look at template parameters to
take an additional 'expand_pack' boolean that automatically unwraps the
potential argument packs. The equivalent SBAPI calls have been changed
to pass true for this parameter.

A byproduct of the patch is to also fix the support for template type
that have only a parameter pack as argument (like the OnlyPack type in
the test). Those were not recognized as template instanciations before.

The added test verifies that the SBAPI is able to iterate over the
arguments of a variadic template.

The original patch was written by Fred Riss almost 4 years ago.

Differential revision: https://reviews.llvm.org/D51387




More information about the All-commits mailing list