[llvm] r362345 - Update MSVC Visualizer to reflect new variadic PointerUnion
Mike Spertus via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 2 16:33:32 PDT 2019
Author: mps
Date: Sun Jun 2 16:33:32 2019
New Revision: 362345
URL: http://llvm.org/viewvc/llvm-project?rev=362345&view=rev
Log:
Update MSVC Visualizer to reflect new variadic PointerUnion
This changed updates the MSVC Visualizer to work with the recent change
of PointerUnion into a variadic template. As an extra bonus, we
fix some bit rot in the SmallPtrSet visualizer as well
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=362345&r1=362344&r2=362345&view=diff
==============================================================================
--- llvm/trunk/utils/LLVMVisualizers/llvm.natvis (original)
+++ llvm/trunk/utils/LLVMVisualizers/llvm.natvis Sun Jun 2 16:33:32 2019
@@ -85,98 +85,61 @@ For later versions of Visual Studio, no
</Expand>
</Type>
- <Type Name="llvm::PointerIntPair<*,*,*,*>">
+ <Type Name="llvm::PointerIntPair<*>">
<DisplayString>{$T5::IntMask}: {($T1)(Value & $T5::PointerBitMask)} [{($T3)((Value >> $T5::IntShift) & $T5::IntMask)}]</DisplayString>
<Expand>
<Item Name="[ptr]">($T1)(Value & $T5::PointerBitMask)</Item>
<Item Name="[int]">($T3)((Value >> $T5::IntShift) & $T5::IntMask)</Item>
</Expand>
</Type>
-
<!-- PointerUnion types - In addition to the regular view, which displays the pointer, there is a "deref" view that
displays the pointed to object, which is often needed by other visualizers -->
- <Type Name="llvm::PointerUnion<*,*>">
- <DisplayString Optional="true" IncludeView="deref" Condition="((Val.Value >> ValTy::InfoTy::IntShift) & ValTy::InfoTy::IntMask) == 0">{*($T1)(Val.Value & ValTy::InfoTy::PointerBitMask)}</DisplayString>
- <DisplayString Optional="true" IncludeView="deref" Condition="((Val.Value >> ValTy::InfoTy::IntShift) & ValTy::InfoTy::IntMask) != 0">{*($T2)(Val.Value & ValTy::InfoTy::PointerBitMask)}</DisplayString>
- <DisplayString Optional="true" Condition="((Val.Value >> ValTy::InfoTy::IntShift) & ValTy::InfoTy::IntMask) == 0">{"$T1", s8b}: {($T1)(Val.Value & ValTy::InfoTy::PointerBitMask)}</DisplayString>
- <DisplayString Optional="true" Condition="((Val.Value >> ValTy::InfoTy::IntShift) & ValTy::InfoTy::IntMask) != 0">{"$T2", s8b}: {($T2)(Val.Value & ValTy::InfoTy::PointerBitMask)}</DisplayString>
- <Expand>
- <Item Name="[Holds]" Condition="((Val.Value >> ValTy::InfoTy::IntShift) & ValTy::InfoTy::IntMask) == 0">"$T1", s8b</Item>
- <Item Name="[Ptr]" Optional="true" Condition="((Val.Value >> ValTy::InfoTy::IntShift) & ValTy::InfoTy::IntMask) == 0">($T1)(Val.Value & ValTy::InfoTy::PointerBitMask)</Item>
- <Item Name="[Holds]" Condition="((Val.Value >> ValTy::InfoTy::IntShift) & ValTy::InfoTy::IntMask) != 0">"$T2", s8b</Item>
- <Item Name="[Ptr]" Optional="true" Condition="((Val.Value >> ValTy::InfoTy::IntShift) & ValTy::InfoTy::IntMask) != 0">($T2)(Val.Value & ValTy::InfoTy::PointerBitMask)</Item>
- </Expand>
- </Type>
-
- <Type Name="llvm::PointerUnion3<*,*,*>">
- <DisplayString Optional="true" IncludeView="deref" Condition="(Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1">{Val,view(deref)}</DisplayString>
- <DisplayString Optional="true" IncludeView="deref">{*(InnerUnion*)&Val.Val.Value,view(deref)}</DisplayString>
- <DisplayString Condition="(Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1">{Val}</DisplayString>
- <DisplayString>{*(InnerUnion*)&Val.Val.Value}</DisplayString>
- <Expand>
- <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 Optional="true" IncludeView="deref"
- 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)}
- </DisplayString>
- <DisplayString Optional="true" IncludeView="deref"
- 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)}
- </DisplayString>
- <DisplayString Optional="true" IncludeView="deref"
- Condition="((Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1) == 1 && ((Val.Val.Value >> InnerUnion2::ValTy::InfoTy::IntShift) & 1) == 0">
- {*($T3)(Val.Val.Value & InnerUnion2::ValTy::InfoTy::PointerBitMask)}
- </DisplayString>
- <DisplayString Optional="true" IncludeView="deref"
- Condition="((Val.Val.Value >> ValTy::ValTy::InfoTy::IntShift) & 1) == 1 && ((Val.Val.Value >> InnerUnion2::ValTy::InfoTy::IntShift) & 1) == 1">
- {*($T4)(Val.Val.Value & InnerUnion2::ValTy::InfoTy::PointerBitMask)}
- </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)}
+ <Type Name="llvm::pointer_union_detail::PointerUnionMembers<*>">
+ <DisplayString Optional="true" IncludeView="deref" Condition="((Val.Value>>$T2::InfoTy::IntShift) & $T2::InfoTy::IntMask) == 0">
+ {*($T4)(Val.Value & $T2::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 Optional="true" Condition="((Val.Value>>$T2::InfoTy::IntShift) & $T2::InfoTy::IntMask) == 0">
+ {($T4)(Val.Value & $T2::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 Optional="true" IncludeView="deref" Condition="((Val.Value>>$T2::InfoTy::IntShift) & $T2::InfoTy::IntMask) == 1">
+ {*($T5)(Val.Value & $T2::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 Optional="true" Condition="((Val.Value>>$T2::InfoTy::IntShift) & $T2::InfoTy::IntMask) == 1">
+ {($T5)(Val.Value & $T2::InfoTy::PointerBitMask)}
</DisplayString>
+ <DisplayString Optional="true" IncludeView="deref" Condition="((Val.Value>>$T2::InfoTy::IntShift) & $T2::InfoTy::IntMask) == 2">
+ {*($T6)(Val.Value & $T2::InfoTy::PointerBitMask)}
+ </DisplayString>
+ <DisplayString Optional="true" Condition="((Val.Value>>$T2::InfoTy::IntShift) & $T2::InfoTy::IntMask) == 2">
+ {($T6)(Val.Value & $T2::InfoTy::PointerBitMask)}
+ </DisplayString>
+ <DisplayString Optional="true" IncludeView="deref" Condition="((Val.Value>>$T2::InfoTy::IntShift) & $T2::InfoTy::IntMask) == 3">
+ {*($T7)(Val.Value & $T2::InfoTy::PointerBitMask)}
+ </DisplayString>
+ <DisplayString Optional="true" Condition="((Val.Value>>$T2::InfoTy::IntShift) & $T2::InfoTy::IntMask) == 3">
+ {($T7)(Val.Value & $T2::InfoTy::PointerBitMask)}
+ </DisplayString>
+ <DisplayString>Unexpected index in PointerUnion: {(Val.Value>>$T2::InfoTy::IntShift) & $T2::InfoTy::IntMask}</DisplayString>
<Expand>
- <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 Name="[Holds]" Condition="((Val.Value>>$T2::InfoTy::IntShift) & $T2::InfoTy::IntMask) == 0">"$T4",s8b</Item>
+ <Item Name="[Ptr]" Optional="true" Condition="((Val.Value>>$T2::InfoTy::IntShift) & $T2::InfoTy::IntMask) == 0">
+ ($T4)(Val.Value & $T2::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 Name="[Holds]" Condition="((Val.Value>>$T2::InfoTy::IntShift) & $T2::InfoTy::IntMask) == 1">"$T5",s8b</Item>
+ <Item Name="[Ptr]" Optional="true" Condition="((Val.Value>>$T2::InfoTy::IntShift) & $T2::InfoTy::IntMask) == 1">
+ ($T5)(Val.Value & $T2::InfoTy::PointerBitMask)
</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 Name="[Holds]" Condition="((Val.Value>>$T2::InfoTy::IntShift) & $T2::InfoTy::IntMask) == 2">"$T6",s8b</Item>
+ <Item Name="[Ptr]" Optional="true" Condition="((Val.Value>>$T2::InfoTy::IntShift) & $T2::InfoTy::IntMask) == 2">
+ ($T6)(Val.Value & $T2::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 Name="[Holds]" Condition="((Val.Value>>$T2::InfoTy::IntShift) & $T2::InfoTy::IntMask) == 3">"$T6",s8b</Item>
+ <Item Name="[Ptr]" Optional="true" Condition="((Val.Value>>$T2::InfoTy::IntShift) & $T2::InfoTy::IntMask) == 3">
+ ($T7)(Val.Value & $T2::InfoTy::PointerBitMask)
</Item>
</Expand>
</Type>
-
+
<Type Name="llvm::iplist<*,*>">
<DisplayString Condition="Head == 0">{{ empty }}</DisplayString>
<DisplayString Condition="Head != 0">{{ head={Head} }}</DisplayString>
@@ -200,13 +163,13 @@ For later versions of Visual Studio, no
</Type>
<Type Name="llvm::SmallPtrSet<*,*>">
- <DisplayString Condition="CurArray == SmallArray">{{ [Small Mode] size={NumElements}, capacity={CurArraySize} }}</DisplayString>
- <DisplayString Condition="CurArray != SmallArray">{{ [Big Mode] size={NumElements}, capacity={CurArraySize} }}</DisplayString>
+ <DisplayString Condition="CurArray == SmallArray">{{ [Small Mode] size={NumNonEmpty}, capacity={CurArraySize} }}</DisplayString>
+ <DisplayString Condition="CurArray != SmallArray">{{ [Big Mode] size={NumNonEmpty}, capacity={CurArraySize} }}</DisplayString>
<Expand>
- <Item Name="[size]">NumElements</Item>
+ <Item Name="[size]">NumNonEmpty</Item>
<Item Name="[capacity]">CurArraySize</Item>
<ArrayItems>
- <Size>CurArraySize</Size>
+ <Size>NumNonEmpty</Size>
<ValuePointer>($T1*)CurArray</ValuePointer>
</ArrayItems>
</Expand>
More information about the llvm-commits
mailing list