[llvm] r350280 - Fix MSVC visualizer for PointerUnion4
Mike Spertus via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 2 16:52:54 PST 2019
Author: mps
Date: Wed Jan 2 16:52:54 2019
New Revision: 350280
URL: http://llvm.org/viewvc/llvm-project?rev=350280&view=rev
Log:
Fix MSVC visualizer for PointerUnion4
Calculate which item is being held and then display it with the appropriate type. We also
optimize the display of PointerUnion3 to take advantage of our knowing that the IntMask is
always 1 in PointerUnion types
Modified:
llvm/trunk/utils/LLVMVisualizers/llvm.natvis
Modified: llvm/trunk/utils/LLVMVisualizers/llvm.natvis
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/LLVMVisualizers/llvm.natvis?rev=350280&r1=350279&r2=350280&view=diff
==============================================================================
--- llvm/trunk/utils/LLVMVisualizers/llvm.natvis (original)
+++ llvm/trunk/utils/LLVMVisualizers/llvm.natvis Wed Jan 2 16:52:54 2019
@@ -105,25 +105,53 @@ For later versions of Visual Studio, no
</Type>
<Type Name="llvm::PointerUnion3<*,*,*>">
- <DisplayString Condition="(Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & ValTy::ValTy::InfoTy::IntMask">{"$T3", s8b}: {($T3)(Val.Val.Value & ValTy::ValTy::InfoTy::PointerBitMask)}</DisplayString>
+ <DisplayString Condition="(Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1">{"$T3", s8b}: {($T3)(Val.Val.Value & ValTy::ValTy::InfoTy::PointerBitMask)}</DisplayString>
<DisplayString>{*(InnerUnion*)&Val.Val.Value}</DisplayString>
<Expand>
- <Item Name="[Holds]" Condition="(Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & ValTy::ValTy::InfoTy::IntMask">"$T3", s8b</Item>
- <Item Name="[Ptr]" Condition="(Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & ValTy::ValTy::InfoTy::IntMask">($T3)(Val.Val.Value & ValTy::ValTy::InfoTy::PointerBitMask)</Item>
- <ExpandedItem Condition="!((Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & ValTy::ValTy::InfoTy::IntMask)">*(InnerUnion*)&Val.Val.Value</ExpandedItem>
+ <Item Name="[Holds]" Condition="(Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1">"$T3", s8b</Item>
+ <Item Name="[Ptr]" Condition="(Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1">($T3)(Val.Val.Value & ValTy::ValTy::InfoTy::PointerBitMask)</Item>
+ <ExpandedItem Condition="!((Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1)">*(InnerUnion*)&Val.Val.Value</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}: {($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>
+ <DisplayString Condition="((Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1) == 0 && ((Val.Val.Value >> InnerUnion1::ValTy::InfoTy::IntShift) & 1) == 0">
+ {"$T1", s8b}: {($T1)(Val.Val.Value & InnerUnion1::ValTy::InfoTy::PointerBitMask)}
+ </DisplayString>
+ <DisplayString Condition="((Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1) == 0 && ((Val.Val.Value >> InnerUnion1::ValTy::InfoTy::IntShift) & 1) == 1">
+ {"$T2", s8b}: {($T2)(Val.Val.Value & InnerUnion1::ValTy::InfoTy::PointerBitMask)}
+ </DisplayString>
+ <DisplayString Condition="((Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1) == 1 && ((Val.Val.Value >> InnerUnion2::ValTy::InfoTy::IntShift) & 1) == 0">
+ {"$T3", s8b}: {($T3)(Val.Val.Value & InnerUnion2::ValTy::InfoTy::PointerBitMask)}
+ </DisplayString>
+ <DisplayString Condition="((Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1) == 1 && ((Val.Val.Value >> InnerUnion2::ValTy::InfoTy::IntShift) & 1) == 1">
+ {"$T4", s8b}: {($T4)(Val.Val.Value & InnerUnion2::ValTy::InfoTy::PointerBitMask)}
+ </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>
- <ExpandedItem Condition="(Val.Val.Value & 3) != 3 && (Val.Val.Value & 1) == 1">($T3)((Val.Val.Value >> 2) << 2)</ExpandedItem>
- <ExpandedItem Condition="(Val.Val.Value & 3) == 3">($T4)((Val.Val.Value >> 2) << 2)</ExpandedItem>
+ <Item Name="[Holds]" Condition="((Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1) == 0 && ((Val.Val.Value >> InnerUnion1::ValTy::InfoTy::IntShift) & 1) == 0">
+ "$T1", s8b
+ </Item>
+ <Item Name="[Ptr]" Condition="((Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1) == 0 && ((Val.Val.Value >> InnerUnion1::ValTy::InfoTy::IntShift) & 1) == 0">
+ ($T1)(Val.Val.Value & InnerUnion1::ValTy::InfoTy::PointerBitMask)
+ </Item>
+ <Item Name="[Holds]" Condition="((Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1) == 0 && ((Val.Val.Value >> InnerUnion1::ValTy::InfoTy::IntShift) & 1) == 1">
+ "$T2", s8b
+ </Item>
+ <Item Name="[Ptr]" Condition="((Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1) == 0 && ((Val.Val.Value >> InnerUnion1::ValTy::InfoTy::IntShift) & 1) == 1">
+ ($T2)(Val.Val.Value & InnerUnion1::ValTy::InfoTy::PointerBitMask)
+ </Item>
+ <Item Name="[Holds]" Condition="((Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1) == 1 && ((Val.Val.Value >> InnerUnion2::ValTy::InfoTy::IntShift) & 1) == 0">
+ "$T3", s8b
+ </Item>
+ <Item Name="[Ptr]" Condition="((Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1) == 1 && ((Val.Val.Value >> InnerUnion2::ValTy::InfoTy::IntShift) & 1) == 0">
+ ($T3)(Val.Val.Value & InnerUnion1::ValTy::InfoTy::PointerBitMask)
+ </Item>
+ <Item Name="[Holds]" Condition="((Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1) == 1 && ((Val.Val.Value >> InnerUnion2::ValTy::InfoTy::IntShift) & 1) == 1">
+ "$T4", s8b
+ </Item>
+ <Item Name="[Ptr]" Condition="((Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1) == 1 && ((Val.Val.Value >> InnerUnion2::ValTy::InfoTy::IntShift) & 1) == 1">
+ ($T4)(Val.Val.Value & InnerUnion1::ValTy::InfoTy::PointerBitMask)
+ </Item>
</Expand>
</Type>
More information about the llvm-commits
mailing list