From f799901c06c015cc30cf123a8f0c01f8b107669e Mon Sep 17 00:00:00 2001 From: Alexander Shaposhnikov Date: Fri, 7 Apr 2023 19:34:52 +0000 Subject: [PATCH] [Clang][Sema] Add MultiLevelTemplateArgumentList::dump Add MultiLevelTemplateArgumentList::dump (similarly to TemplateArgument::dump). Differential revision: https://reviews.llvm.org/D147744 --- clang/include/clang/Sema/Template.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/clang/include/clang/Sema/Template.h b/clang/include/clang/Sema/Template.h index 9083894..48e8b78 100644 --- a/clang/include/clang/Sema/Template.h +++ b/clang/include/clang/Sema/Template.h @@ -261,6 +261,23 @@ enum class TemplateSubstitutionKind : char { } ArgListsIterator end() { return TemplateArgumentLists.end(); } ConstArgListsIterator end() const { return TemplateArgumentLists.end(); } + + LLVM_DUMP_METHOD void dump() const { + LangOptions LO; + LO.CPlusPlus = true; + LO.Bool = true; + PrintingPolicy PP(LO); + llvm::errs() << "NumRetainedOuterLevels: " << NumRetainedOuterLevels + << "\n"; + for (unsigned Depth = NumRetainedOuterLevels; Depth < getNumLevels(); + ++Depth) { + llvm::errs() << Depth << ": "; + printTemplateArgumentList( + llvm::errs(), + TemplateArgumentLists[getNumLevels() - Depth - 1].Args, PP); + llvm::errs() << "\n"; + } + } }; /// The context in which partial ordering of function templates occurs. -- 2.7.4