]> granicus.if.org Git - llvm/commitdiff
Clean up MSVC visualization of LLVM pointer types
authorMike Spertus <mike@spertus.com>
Sun, 30 Jun 2019 21:54:34 +0000 (21:54 +0000)
committerMike Spertus <mike@spertus.com>
Sun, 30 Jun 2019 21:54:34 +0000 (21:54 +0000)
Create separate natvis ptr and int views for PointerIntPair.
These are convenient in watch Windows and will be used by
Clang visualizers to be checked in shortly

Also, removed deref views as the MSVC na format has
done the same thing natively since MSVC2013.

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

utils/LLVMVisualizers/llvm.natvis

index f4ed0787689f23c0ea2af52e5c72fdde059b4b6c..0000519ce05abac507f8d4516859e324315e088f 100644 (file)
@@ -76,37 +76,28 @@ For later versions of Visual Studio, no setup is required.
     </Expand>\r
   </Type>\r
 \r
+  <!-- PointerIntPair. In addition to the regular view, it is possible to view just the pointer or just the int\r
+    The same code is duplicated from the regular viewer to improve the performance of the common case -->\r
   <Type Name="llvm::PointerIntPair&lt;*&gt;">\r
+    <DisplayString IncludeView="ptr">{($T1)(Value &amp; $T5::PointerBitMask)}</DisplayString>\r
+    <DisplayString IncludeView="int">{($T3)((Value &gt;&gt; $T5::IntShift) &amp; $T5::IntMask)}</DisplayString>\r
     <DisplayString>{$T5::IntMask}: {($T1)(Value &amp; $T5::PointerBitMask)} [{($T3)((Value &gt;&gt; $T5::IntShift) &amp; $T5::IntMask)}]</DisplayString>\r
     <Expand>\r
       <Item Name="[ptr]">($T1)(Value &amp; $T5::PointerBitMask)</Item>\r
       <Item Name="[int]">($T3)((Value &gt;&gt; $T5::IntShift) &amp; $T5::IntMask)</Item>\r
     </Expand>\r
   </Type>\r
-  <!-- PointerUnion types - In addition to the regular view, which displays the pointer, there is a "deref" view that\r
-       displays the pointed to object, which is often needed by other visualizers -->\r
+  <!-- PointerUnion types -->\r
   <Type Name="llvm::pointer_union_detail::PointerUnionMembers&lt;*&gt;">\r
-    <DisplayString Optional="true" IncludeView="deref" Condition="((Val.Value&gt;&gt;$T2::InfoTy::IntShift) &amp; $T2::InfoTy::IntMask) == 0">\r
-      {*($T4)(Val.Value &amp; $T2::InfoTy::PointerBitMask)}\r
-    </DisplayString>\r
     <DisplayString Optional="true" Condition="((Val.Value&gt;&gt;$T2::InfoTy::IntShift) &amp; $T2::InfoTy::IntMask) == 0">\r
       {($T4)(Val.Value &amp; $T2::InfoTy::PointerBitMask)}\r
     </DisplayString>\r
-    <DisplayString Optional="true" IncludeView="deref" Condition="((Val.Value&gt;&gt;$T2::InfoTy::IntShift) &amp; $T2::InfoTy::IntMask) == 1">\r
-      {*($T5)(Val.Value &amp; $T2::InfoTy::PointerBitMask)}\r
-    </DisplayString>\r
     <DisplayString Optional="true" Condition="((Val.Value&gt;&gt;$T2::InfoTy::IntShift) &amp; $T2::InfoTy::IntMask) == 1">\r
       {($T5)(Val.Value &amp; $T2::InfoTy::PointerBitMask)}\r
     </DisplayString>\r
-    <DisplayString Optional="true" IncludeView="deref" Condition="((Val.Value&gt;&gt;$T2::InfoTy::IntShift) &amp; $T2::InfoTy::IntMask) == 2">\r
-      {*($T6)(Val.Value &amp; $T2::InfoTy::PointerBitMask)}\r
-    </DisplayString>\r
     <DisplayString Optional="true" Condition="((Val.Value&gt;&gt;$T2::InfoTy::IntShift) &amp; $T2::InfoTy::IntMask) == 2">\r
       {($T6)(Val.Value &amp; $T2::InfoTy::PointerBitMask)}\r
     </DisplayString>\r
-    <DisplayString Optional="true" IncludeView="deref" Condition="((Val.Value&gt;&gt;$T2::InfoTy::IntShift) &amp; $T2::InfoTy::IntMask) == 3">\r
-      {*($T7)(Val.Value &amp; $T2::InfoTy::PointerBitMask)}\r
-    </DisplayString>\r
     <DisplayString Optional="true" Condition="((Val.Value&gt;&gt;$T2::InfoTy::IntShift) &amp; $T2::InfoTy::IntMask) == 3">\r
       {($T7)(Val.Value &amp; $T2::InfoTy::PointerBitMask)}\r
     </DisplayString>\r