[PATCH] D18076: Improve Visual Studio visualizations of llvm::PointerUnion by increasing type correctness

Mike Spertus via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 11 07:39:04 PST 2016


mspertus updated this revision to Diff 50432.
mspertus added a comment.

Applying same logic to PointerUnion3 and PointerUnion4 as suggested by Aaron


http://reviews.llvm.org/D18076

Files:
  llvm.natvis

Index: llvm.natvis
===================================================================
--- llvm.natvis
+++ llvm.natvis
@@ -54,30 +54,30 @@
   </Type>
 
   <Type Name="llvm::PointerUnion<*,*>">
-    <DisplayString Condition="((Val.Value >> Val.IntShift) & Val.IntMask) == 0">{"$T1", s8b} {(void*)(Val.Value & Val.PointerBitMask)}</DisplayString>
-    <DisplayString Condition="((Val.Value >> Val.IntShift) & Val.IntMask) != 0">{"$T2", s8b} {(void*)(Val.Value & Val.PointerBitMask)}</DisplayString>
+    <DisplayString Condition="((Val.Value >> Val.IntShift) & Val.IntMask) == 0">{"$T1", s8b}: {($T1)(Val.Value & Val.PointerBitMask)}</DisplayString>
+    <DisplayString Condition="((Val.Value >> Val.IntShift) & Val.IntMask) != 0">{"$T2", s8b}: {($T2)(Val.Value & Val.PointerBitMask)}</DisplayString>
     <Expand>
       <ExpandedItem Condition="((Val.Value >> Val.IntShift) & Val.IntMask) == 0">($T1)(Val.Value & Val.PointerBitMask)</ExpandedItem>
       <ExpandedItem Condition="((Val.Value >> Val.IntShift) & Val.IntMask) != 0">($T2)(Val.Value & Val.PointerBitMask)</ExpandedItem>
     </Expand>
   </Type>
 
   <Type Name="llvm::PointerUnion3<*,*,*>">
-    <DisplayString Condition="(Val.Val.Value & 2) != 2 && (Val.Val.Value & 1) != 1">{"$T1", s8b} {(void*)((Val.Val.Value >> 2) << 2)}</DisplayString>
-    <DisplayString Condition="(Val.Val.Value & 2) == 2">{"$T2", s8b} {(void*)((Val.Val.Value >> 2) << 2)}</DisplayString>
-    <DisplayString Condition="(Val.Val.Value & 1) == 1">{"$T3", s8b} {(void*)((Val.Val.Value >> 2) << 2)}</DisplayString>
+    <DisplayString Condition="(Val.Val.Value & 2) != 2 && (Val.Val.Value & 1) != 1">{"$T1", s8b}: {($T1)((Val.Val.Value >> 2) << 2)}</DisplayString>
+    <DisplayString Condition="(Val.Val.Value & 2) == 2">{"$T2", s8b}: {($T2)((Val.Val.Value >> 2) << 2)}</DisplayString>
+    <DisplayString Condition="(Val.Val.Value & 1) == 1">{"$T3", s8b}: {($T3)((Val.Val.Value >> 2) << 2)}</DisplayString>
     <Expand>
       <ExpandedItem Condition="(Val.Val.Value & 2) != 2 && (Val.Val.Value & 1) != 1">($T1)((Val.Val.Value >> 2) << 2)</ExpandedItem>
       <ExpandedItem Condition="(Val.Val.Value & 2) == 2">($T2)((Val.Val.Value >> 2) << 2)</ExpandedItem>
       <ExpandedItem Condition="(Val.Val.Value & 1) == 1">($T3)((Val.Val.Value >> 2) << 2)</ExpandedItem>
     </Expand>
   </Type>
 
   <Type Name="llvm::PointerUnion4<*,*,*,*>">
-    <DisplayString Condition="(Val.Val.Value & 3) != 3 && (Val.Val.Value & 2) != 2 && (Val.Val.Value & 1) != 1">{"$T1", s8b} {(void*)((Val.Val.Value >> 2) << 2)}</DisplayString>
-    <DisplayString Condition="(Val.Val.Value & 3) != 3 && (Val.Val.Value & 2) == 2">{"$T2", s8b} {(void*)((Val.Val.Value >> 2) << 2)}</DisplayString>
-    <DisplayString Condition="(Val.Val.Value & 3) != 3 && (Val.Val.Value & 1) == 1">{"$T3", s8b} {(void*)((Val.Val.Value >> 2) << 2)}</DisplayString>
-    <DisplayString Condition="(Val.Val.Value & 3) == 3">{"$T4", s8b} {(void*)((Val.Val.Value >> 2) << 2)}</DisplayString>
+    <DisplayString Condition="(Val.Val.Value & 3) != 3 && (Val.Val.Value & 2) != 2 && (Val.Val.Value & 1) != 1">{"$T1", s8b}: {($T1)((Val.Val.Value >> 2) << 2)}</DisplayString>
+    <DisplayString Condition="(Val.Val.Value & 3) != 3 && (Val.Val.Value & 2) == 2">{"$T2", s8b}: {($T2)((Val.Val.Value >> 2) << 2)}</DisplayString>
+    <DisplayString Condition="(Val.Val.Value & 3) != 3 && (Val.Val.Value & 1) == 1">{"$T3", s8b}: {($T3)((Val.Val.Value >> 2) << 2)}</DisplayString>
+    <DisplayString Condition="(Val.Val.Value & 3) == 3">{"$T4", s8b}: {($T4)((Val.Val.Value >> 2) << 2)}</DisplayString>
     <Expand>
       <ExpandedItem Condition="(Val.Val.Value & 3) != 3 && (Val.Val.Value & 2) != 2 && (Val.Val.Value & 1) != 1">($T1)((Val.Val.Value >> 2) << 2)</ExpandedItem>
       <ExpandedItem Condition="(Val.Val.Value & 3) != 3 && (Val.Val.Value & 2) == 2">($T2)((Val.Val.Value >> 2) << 2)</ExpandedItem>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18076.50432.patch
Type: text/x-patch
Size: 4468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160311/cf3b5ac1/attachment-0001.bin>


More information about the cfe-commits mailing list