[Lldb-commits] [PATCH] D51387: Allow Template argument accessors to automatically unwrap parameter packs

Frederic Riss via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 28 15:47:52 PDT 2018


friss created this revision.
friss added reviewers: jingham, clayborg.
Herald added a subscriber: JDevlieghere.

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.


https://reviews.llvm.org/D51387

Files:
  include/lldb/Symbol/ClangASTContext.h
  include/lldb/Symbol/CompilerType.h
  include/lldb/Symbol/GoASTContext.h
  include/lldb/Symbol/JavaASTContext.h
  include/lldb/Symbol/OCamlASTContext.h
  include/lldb/Symbol/TypeSystem.h
  packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestTemplatePackArgs.py
  packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/main.cpp
  source/API/SBType.cpp
  source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  source/Symbol/ClangASTContext.cpp
  source/Symbol/CompilerType.cpp
  source/Symbol/JavaASTContext.cpp
  source/Symbol/TypeSystem.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51387.162973.patch
Type: text/x-patch
Size: 19697 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180828/24bd8b9e/attachment-0001.bin>


More information about the lldb-commits mailing list