]> granicus.if.org Git - clang/commitdiff
Visual Studio native visualizer for ParsedTemplateArgument
authorMike Spertus <mike@spertus.com>
Sun, 12 Jun 2016 22:21:56 +0000 (22:21 +0000)
committerMike Spertus <mike@spertus.com>
Sun, 12 Jun 2016 22:21:56 +0000 (22:21 +0000)
Does a good job with type and non-type template arguments
and lays the groundwork for template template arguments to
visualize well once there is a TemplateName visualizer.
Also fixed what looks like an incorrect comment in the
header for ParsedTemplate.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272521 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Sema/ParsedTemplate.h
utils/ClangVisualizers/clang.natvis

index 93bc7a2f0a0e449ed09de609f64324187e328580..03de9ff6ae44fb2bfe43c4bd7dfb1f96318431bf 100644 (file)
@@ -121,8 +121,8 @@ namespace clang {
     KindType Kind;
     
     /// \brief The actual template argument representation, which may be
-    /// an \c ActionBase::TypeTy* (for a type), an Expr* (for an
-    /// expression), or an ActionBase::TemplateTy (for a template).
+    /// an \c Sema::TypeTy* (for a type), an Expr* (for an
+    /// expression), or an Sema::TemplateTy (for a template).
     void *Arg;
 
     /// \brief The nested-name-specifier that can accompany a template template
index ff0dbe1ddbc6849f7d55d0ac94bf0349a118a5e0..e2948749150fea24e97f14f306fdb28627eecdde 100644 (file)
@@ -309,6 +309,17 @@ For later versions of Visual Studio, no setup is required-->
       <Item Name="TemplateList">TemplateArgumentLists</Item>\r
     </Expand>\r
   </Type>\r
+  <Type Name="clang::ParsedTemplateArgument">\r
+    <DisplayString Condition="Kind==clang::ParsedTemplateArgument::Type">Type template argument: {*(clang::QualType *)Arg}</DisplayString>\r
+    <DisplayString Condition="Kind==clang::ParsedTemplateArgument::NonType">Non-type template argument: {*(clang::Expr *)Arg}</DisplayString>\r
+    <DisplayString Condition="Kind==clang::ParsedTemplateArgument::Template">Template template argument: {*(clang::TemplateName *)Arg</DisplayString>\r
+    <Expand>\r
+      <Item Name="Kind">Kind,en</Item>\r
+      <Item Name="Arg" Condition="Kind==clang::ParsedTemplateArgument::Type">(clang::QualType *)Arg</Item>\r
+      <Item Name="Arg" Condition="Kind==clang::ParsedTemplateArgument::NonType">(clang::Expr *)Arg</Item>\r
+      <Item Name="Arg" Condition="Kind==clang::ParsedTemplateArgument::Template">(clang::TemplateName *)Arg</Item>\r
+    </Expand>\r
+  </Type>\r
   <!-- Builtin types that have C++ keywords are manually displayed as that keyword. Otherwise, just use the enum name -->\r
   <Type Name="clang::BuiltinType">\r
     <DisplayString Condition="BuiltinTypeBits.Kind==clang::BuiltinType::Void">void</DisplayString>\r