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

Alexander Shaposhnikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 6 15:37:51 PDT 2023


alexander-shaposhnikov updated this revision to Diff 511551.
alexander-shaposhnikov added a comment.

Address comments


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147744/new/

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,19 @@
     }
     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.


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


More information about the cfe-commits mailing list