Typesafe visualization of PointerIntPairs in Visual Studio
authorMike Spertus <mike@spertus.com>
Fri, 18 Mar 2016 20:06:16 +0000 (20:06 +0000)
committerMike Spertus <mike@spertus.com>
Fri, 18 Mar 2016 20:06:16 +0000 (20:06 +0000)
In the <DisplayString> of PointerIntPair , I cast the pointer to the actual type, so VS can leverage it while visualizing, not unlike the recent change to PointerUnion visualization.
In the expansion, the current code is casting to the incorrect type (wrong number of stars), so I fixed that as well.

llvm-svn: 263821

llvm/utils/llvm.natvis

index 5a528bb..275800d 100644 (file)
@@ -46,9 +46,9 @@ or create a symbolic link so it updates automatically.
   </Type>\r
 \r
   <Type Name="llvm::PointerIntPair&lt;*,*,*,*&gt;">\r
-    <DisplayString>{(void*)(Value &amp; PointerBitMask)} [{($T3)((Value &gt;&gt; IntShift) &amp; IntMask)}]</DisplayString>\r
+    <DisplayString>{IntMask}: {($T1)(Value &amp; PointerBitMask)} [{($T3)((Value &gt;&gt; IntShift) &amp; IntMask)}]</DisplayString>\r
     <Expand>\r
-      <Item Name="[ptr]">($T1*)(Value &amp; PointerBitMask)</Item>\r
+      <Item Name="[ptr]">($T1)(Value &amp; PointerBitMask)</Item>\r
       <Item Name="[int]">($T3)((Value &gt;&gt; IntShift) &amp; IntMask)</Item>\r
     </Expand>\r
   </Type>\r