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

Alexander Shaposhnikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 7 12:37:29 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf799901c06c0: [Clang][Sema] Add MultiLevelTemplateArgumentList::dump (authored by alexander-shaposhnikov).

Changed prior to commit:
  https://reviews.llvm.org/D147744?vs=511551&id=511775#toc

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,23 @@
     }
     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.511775.patch
Type: text/x-patch
Size: 1026 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230407/96baf749/attachment.bin>


More information about the cfe-commits mailing list