[PATCH] D147744: [clang][Sema] Add MultiLevelTemplateArgumentList::dump()

Alexander Shaposhnikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 6 14:49:39 PDT 2023


alexander-shaposhnikov created this revision.
alexander-shaposhnikov added reviewers: erichkeane, rsmith.
alexander-shaposhnikov created this object with visibility "All Users".
Herald added a project: All.
alexander-shaposhnikov requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Add MultiLevelTemplateArgumentList::dump() (similarly to TemplateArgument::dump). NFC.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147744

Files:
  clang/include/clang/Sema/Template.h


Index: clang/include/clang/Sema/Template.h
===================================================================
--- clang/include/clang/Sema/Template.h
+++ clang/include/clang/Sema/Template.h
@@ -261,6 +261,17 @@
     }
     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);
+      for (const ArgumentListLevel &ArgListLevel : TemplateArgumentLists) {
+        printTemplateArgumentList(llvm::errs(), ArgListLevel.Args, PP);
+        llvm::errs() << "\n";
+      }
+    }
   };
 
   /// The context in which partial ordering of function templates occurs.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147744.511534.patch
Type: text/x-patch
Size: 794 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230406/bf012842/attachment.bin>


More information about the cfe-commits mailing list