]> granicus.if.org Git - clang/commitdiff
Visual Studio visualizers associated with LookupResults
authorMike Spertus <mike@spertus.com>
Sat, 11 Jun 2016 03:02:33 +0000 (03:02 +0000)
committerMike Spertus <mike@spertus.com>
Sat, 11 Jun 2016 03:02:33 +0000 (03:02 +0000)
Visualizers for DeclAccessPair, UnresolvedSet, and LookupResult. For example,
when combined with LLVM diff D21256 (currently in review), a Lookup set will
show much more naturally in the Locals window something like

  Found: {public typename ...Ts}

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

utils/ClangVisualizers/clang.natvis

index 72ecc6a4b23c445e185c95b44b53e71464830f27..62cea41950ac7d0821e42f373e4cf7f2ce55db25 100644 (file)
@@ -481,4 +481,22 @@ For later versions of Visual Studio, no setup is required-->
   <Type Name="clang::Expr">\r
     <DisplayString>Expression of class {(clang::Stmt::StmtClass)StmtBits.sClass,en} and type {TR,view(cpp)}</DisplayString>\r
   </Type>\r
+  <Type Name="clang::DeclAccessPair">\r
+    <DisplayString IncludeView="access" Condition="(Ptr&amp;Mask) == clang::AS_public">public</DisplayString>\r
+    <DisplayString IncludeView="access" Condition="(Ptr&amp;Mask) == clang::AS_protected">protected</DisplayString>\r
+    <DisplayString IncludeView="access" Condition="(Ptr&amp;Mask) == clang::AS_private">private</DisplayString>\r
+    <DisplayString IncludeView="access" Condition="(Ptr&amp;Mask) == clang::AS_none">b</DisplayString>\r
+    <DisplayString IncludeView="decl">{*(clang::NamedDecl *)(Ptr&amp;~Mask)}</DisplayString>\r
+    <DisplayString>{*this,view(access)} {*this,view(decl)}</DisplayString>\r
+  </Type>\r
+  <Type Name="clang::UnresolvedSet&lt;*&gt;">\r
+    <DisplayString>{Decls}</DisplayString>\r
+    <Expand>\r
+      <ExpandedItem>Decls</ExpandedItem>\r
+    </Expand>\r
+  </Type>\r
+  <Type Name="clang::LookupResult">\r
+    <DisplayString Condition="ResultKind == clang::LookupResult::Ambiguous">{Ambiguity,en}: {Decls}</DisplayString>\r
+    <DisplayString>{ResultKind,en}: {Decls}</DisplayString>\r
+  </Type>\r
 </AutoVisualizer>\r