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

Tom Praschan via All-commits all-commits at lists.llvm.org
Tue Oct 25 00:38:36 PDT 2022


  Branch: refs/heads/release/15.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 2d5c43ad484482cd23794b8b056a9b13ee920369
      https://github.com/llvm/llvm-project/commit/2d5c43ad484482cd23794b8b056a9b13ee920369
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2022-10-25 (Tue, 25 Oct 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

(cherry picked from commit b706f56133a77f9d7c55270ac24ff59e6fce3fa4)


  Commit: db68723804fd30d5e7da1fb2ad2aab409ef58d29
      https://github.com/llvm/llvm-project/commit/db68723804fd30d5e7da1fb2ad2aab409ef58d29
  Author: Tom Praschan <13141438+tom-anders at users.noreply.github.com>
  Date:   2022-10-25 (Tue, 25 Oct 2022)

  Changed paths:
    M clang-tools-extra/clangd/CodeComplete.cpp
    M clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp

  Log Message:
  -----------
  [clangd] Return earlier when snippet is empty

Fixes github.com/clangd/clangd/issues/1216

If the Snippet string is empty, Snippet.front() would trigger a crash.
Move the Snippet->empty() check up a few lines to avoid this. Should not
break any existing behavior.

Differential Revision: https://reviews.llvm.org/D134137

(cherry picked from commit 60528c690a4c334d2a3a2c22eb97af9e67d7a91d)


Compare: https://github.com/llvm/llvm-project/compare/1e1c5204c259...db68723804fd


More information about the All-commits mailing list