[PATCH] D18270: Typesafe visualization of PointerIntPairs in Visual Studio

Mike Spertus via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 18 10:02:56 PDT 2016


mspertus created this revision.
mspertus added reviewers: aaron.ballman, zturner, aemerson.
mspertus added a subscriber: cfe-commits.

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.

Note to Reviewers: I will continue to make frequent changes to the MSVC visualizers. While these are worthwhile, I don't want to overwhelm the reviewers. Is it OK for me to request review after commit in the future when I judge that it is appropriate to do so (E.g., this diff)?

http://reviews.llvm.org/D18270

Files:
  llvm.natvis

Index: llvm.natvis
===================================================================
--- llvm.natvis
+++ llvm.natvis
@@ -46,9 +46,9 @@
   </Type>
 
   <Type Name="llvm::PointerIntPair<*,*,*,*>">
-    <DisplayString>{(void*)(Value & PointerBitMask)} [{($T3)((Value >> IntShift) & IntMask)}]</DisplayString>
+    <DisplayString>{IntMask}: {($T1)(Value & PointerBitMask)} [{($T3)((Value >> IntShift) & IntMask)}]</DisplayString>
     <Expand>
-      <Item Name="[ptr]">($T1*)(Value & PointerBitMask)</Item>
+      <Item Name="[ptr]">($T1)(Value & PointerBitMask)</Item>
       <Item Name="[int]">($T3)((Value >> IntShift) & IntMask)</Item>
     </Expand>
   </Type>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18270.51035.patch
Type: text/x-patch
Size: 717 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160318/5165afb5/attachment-0001.bin>


More information about the cfe-commits mailing list