r265104 - Visual Studio native visualizers for clang::TemplateSpecializationType

Mike Spertus via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 31 20:31:43 PDT 2016


Author: mps
Date: Thu Mar 31 22:31:43 2016
New Revision: 265104

URL: http://llvm.org/viewvc/llvm-project?rev=265104&view=rev
Log:
Visual Studio native visualizers for clang::TemplateSpecializationType

Displays a template specialization as, say, A<int, double>. Does not
yet handle UncommonTemplateNameStorage, QualifiedTemplateName, or
DependentTemplateName, but still more than worthwhile

Modified:
    cfe/trunk/utils/ClangVisualizers/clang.natvis

Modified: cfe/trunk/utils/ClangVisualizers/clang.natvis
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/ClangVisualizers/clang.natvis?rev=265104&r1=265103&r2=265104&view=diff
==============================================================================
--- cfe/trunk/utils/ClangVisualizers/clang.natvis (original)
+++ cfe/trunk/utils/ClangVisualizers/clang.natvis Thu Mar 31 22:31:43 2016
@@ -229,6 +229,7 @@ For later versions of Visual Studio, no
     </Expand>
   </Type>
   <Type Name="clang::TemplateArgument">
+    <DisplayString IncludeView="cpp">{*(clang::QualType *)&TypeOrValue.V,view(cpp)}</DisplayString>
     <DisplayString>{(clang::TemplateArgument::ArgKind)TypeOrValue.Kind,en} template parameter: {*(clang::QualType *)&TypeOrValue.V}</DisplayString>
     <Expand>
       <Item Name="QualType" Condition="Integer.Kind == clang::TemplateArgument::ArgKind::Type">*(clang::QualType *)&TypeOrValue.V</Item>
@@ -269,8 +270,22 @@ For later versions of Visual Studio, no
   </Type>
 
   <Type Name="clang::TemplateSpecializationType">
-    <DisplayString Condition="(Template.Storage.Val.Val.Value & 3) != 3 && (Template.Storage.Val.Val.Value & 2) != 2 && (Template.Storage.Val.Val.Value & 1) != 1">{(clang::TemplateDecl *)((Template.Storage.Val.Val.Value >> 2) << 2)}</DisplayString>
-    <DisplayString>{Template.Storage}</DisplayString>
+    <DisplayString IncludeView="arg0" Condition="NumArgs==0"></DisplayString>
+    <DisplayString IncludeView="arg0">{((clang::TemplateArgument *)(this+1))[0],view(cpp)}{*this,view(arg1)}</DisplayString>
+    <DisplayString IncludeView="arg1" Condition="NumArgs==1"></DisplayString>
+    <DisplayString IncludeView="arg1">, {((clang::TemplateArgument *)(this+1))[1],view(cpp)}{*this,view(arg2)}</DisplayString>
+    <DisplayString IncludeView="arg2" Condition="NumArgs==2"></DisplayString>
+    <DisplayString IncludeView="arg2">, {((clang::TemplateArgument *)(this+1))[2],view(cpp)}{*this,view(arg3)}</DisplayString>
+    <DisplayString Condition="(Template.Storage.Val.Val.Value & 3) == 0">
+      {*((clang::TemplateDecl *)((Template.Storage.Val.Val.Value >> 2) << 2))->TemplatedDecl,view(cpp)}<{*this,view(arg0)}>
+    </DisplayString>
+    <Expand>
+      <Item Name="Template">Template.Storage</Item>
+      <ArrayItems>
+        <Size>NumArgs</Size>
+        <ValuePointer>(clang::TemplateArgument *)(this+1)</ValuePointer>
+      </ArrayItems>
+    </Expand>
   </Type>
   <Type Name="clang::IdentifierInfo">
     <DisplayString Condition="Entry != 0">{((llvm::StringMapEntry<clang::IdentifierInfo *>*)Entry)+1,sb}</DisplayString>




More information about the cfe-commits mailing list