mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-04 17:58:22 +00:00
Improve existing visualizers by:
- Properly displaying non null terminated StringRef. - Auto expanding pointer types. - Displaying real type names for PointerUnions. - Using "size" and "capacity" across all containers. - Simplifying code where possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201004 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
42802218b0
commit
40bb66bc3a
@ -6,22 +6,10 @@ Put this file into "%USERPROFILE%\Documents\Visual Studio 2012\Visualizers"
|
||||
or create a symbolic link so it updates automatically.
|
||||
-->
|
||||
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
|
||||
<Type Name="llvm::SmallVector<*,*>">
|
||||
<DisplayString Condition="(($T1*)EndX - ($T1*)BeginX) == 0">empty</DisplayString>
|
||||
<DisplayString Condition="(($T1*)EndX - ($T1*)BeginX) != 0">{{ size={($T1*)EndX - ($T1*)BeginX} }}</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[size]">($T1*)EndX - ($T1*)BeginX</Item>
|
||||
<Item Name="[capacity]">($T1*)CapacityX - ($T1*)BeginX</Item>
|
||||
<ArrayItems>
|
||||
<Size>($T1*)EndX - ($T1*)BeginX</Size>
|
||||
<ValuePointer>($T1*)BeginX</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="llvm::SmallVectorImpl<*>">
|
||||
<DisplayString Condition="(($T1*)EndX - ($T1*)BeginX) == 0">empty</DisplayString>
|
||||
<DisplayString Condition="(($T1*)EndX - ($T1*)BeginX) != 0">[{($T1*)EndX - ($T1*)BeginX}]</DisplayString>
|
||||
<DisplayString Condition="(($T1*)EndX - ($T1*)BeginX) != 0">{{ size={($T1*)EndX - ($T1*)BeginX} }}</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[size]">($T1*)EndX - ($T1*)BeginX</Item>
|
||||
<Item Name="[capacity]">($T1*)CapacityX - ($T1*)BeginX</Item>
|
||||
@ -46,10 +34,10 @@ or create a symbolic link so it updates automatically.
|
||||
</Type>
|
||||
|
||||
<Type Name="llvm::StringRef">
|
||||
<DisplayString>[{Length}] {Data,s}</DisplayString>
|
||||
<StringView>Data,s</StringView>
|
||||
<DisplayString>{Data,[Length]s}</DisplayString>
|
||||
<StringView>Data,[Length]s</StringView>
|
||||
<Expand>
|
||||
<Item Name="[length]">Length</Item>
|
||||
<Item Name="[size]">Length</Item>
|
||||
<ArrayItems>
|
||||
<Size>Length</Size>
|
||||
<ValuePointer>Data</ValuePointer>
|
||||
@ -58,43 +46,43 @@ or create a symbolic link so it updates automatically.
|
||||
</Type>
|
||||
|
||||
<Type Name="llvm::PointerIntPair<*,*,*,*>">
|
||||
<DisplayString>{Value & PointerBitMask} [{(Value >> IntShift) & IntMask}]</DisplayString>
|
||||
<DisplayString>{(void*)(Value & PointerBitMask)} [{($T3)((Value >> IntShift) & IntMask)}]</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[ptr]">Value & PointerBitMask</Item>
|
||||
<Item Name="[int]">(Value >> IntShift) & IntMask</Item>
|
||||
<Item Name="[ptr]">($T1*)(Value & PointerBitMask)</Item>
|
||||
<Item Name="[int]">($T3)((Value >> IntShift) & IntMask)</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="llvm::PointerUnion<*,*>">
|
||||
<DisplayString Condition="((Val.Value >> Val.IntShift) & Val.IntMask) == 0">[P1] {($T1)(Val.Value & Val.PointerBitMask)}</DisplayString>
|
||||
<DisplayString Condition="((Val.Value >> Val.IntShift) & Val.IntMask) != 0">[P2] {($T2)(Val.Value & Val.PointerBitMask)}</DisplayString>
|
||||
<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>
|
||||
<Expand>
|
||||
<Item Name="[ptr]" Condition="((Val.Value >> Val.IntShift) & Val.IntMask) == 0">($T1)(Val.Value & Val.PointerBitMask)</Item>
|
||||
<Item Name="[ptr]" Condition="((Val.Value >> Val.IntShift) & Val.IntMask) != 0">($T2)(Val.Value & Val.PointerBitMask)</Item>
|
||||
<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">[P1] {($T1)((Val.Val.Value >> 2) << 2)}</DisplayString>
|
||||
<DisplayString Condition="(Val.Val.Value & 2) == 2">[P2] {($T2)((Val.Val.Value >> 2) << 2)}</DisplayString>
|
||||
<DisplayString Condition="(Val.Val.Value & 1) == 1">[P3] {($T3)((Val.Val.Value >> 2) << 2)}</DisplayString>
|
||||
<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>
|
||||
<Expand>
|
||||
<Item Name="[ptr]" Condition="(Val.Val.Value & 2) != 2 && (Val.Val.Value & 1) != 1">($T1)((Val.Val.Value >> 2) << 2)</Item>
|
||||
<Item Name="[ptr]" Condition="(Val.Val.Value & 2) == 2">($T2)((Val.Val.Value >> 2) << 2)</Item>
|
||||
<Item Name="[ptr]" Condition="(Val.Val.Value & 1) == 1">($T3)((Val.Val.Value >> 2) << 2)</Item>
|
||||
<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">[P1] {($T1)((Val.Val.Value >> 2) << 2)}</DisplayString>
|
||||
<DisplayString Condition="(Val.Val.Value & 3) != 3 && (Val.Val.Value & 2) == 2">[P2] {($T2)((Val.Val.Value >> 2) << 2)}</DisplayString>
|
||||
<DisplayString Condition="(Val.Val.Value & 3) != 3 && (Val.Val.Value & 1) == 1">[P3] {($T3)((Val.Val.Value >> 2) << 2)}</DisplayString>
|
||||
<DisplayString Condition="(Val.Val.Value & 3) == 3">[P4] {($T4)((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} {(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>
|
||||
<Expand>
|
||||
<Item Name="[ptr]" Condition="(Val.Val.Value & 3) != 3 && (Val.Val.Value & 2) != 2 && (Val.Val.Value & 1) != 1">($T1)((Val.Val.Value >> 2) << 2)</Item>
|
||||
<Item Name="[ptr]" Condition="(Val.Val.Value & 3) != 3 && (Val.Val.Value & 2) == 2">($T2)((Val.Val.Value >> 2) << 2)</Item>
|
||||
<Item Name="[ptr]" Condition="(Val.Val.Value & 3) != 3 && (Val.Val.Value & 1) == 1">($T3)((Val.Val.Value >> 2) << 2)</Item>
|
||||
<Item Name="[ptr]" Condition="(Val.Val.Value & 3) == 3">($T4)((Val.Val.Value >> 2) << 2)</Item>
|
||||
<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>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
@ -116,7 +104,7 @@ or create a symbolic link so it updates automatically.
|
||||
<DisplayString Condition="(Obj != 0) && (Obj->ref_cnt != 1)">RefPtr [{Obj->ref_cnt} refs] {*Obj}</DisplayString>
|
||||
<Expand>
|
||||
<Item Condition="Obj != 0" Name="[refs]">Obj->ref_cnt</Item>
|
||||
<Item Condition="Obj != 0" Name="[ptr]">Obj</Item>
|
||||
<ExpandedItem Condition="Obj != 0">Obj</ExpandedItem>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
@ -124,29 +112,29 @@ or create a symbolic link so it updates automatically.
|
||||
<DisplayString Condition="Ptr == 0">empty</DisplayString>
|
||||
<DisplayString Condition="Ptr != 0">OwningPtr {*Ptr}</DisplayString>
|
||||
<Expand>
|
||||
<Item Condition="Ptr != 0" Name="[ptr]">Ptr</Item>
|
||||
<ExpandedItem Condition="Ptr != 0">Ptr</ExpandedItem>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="llvm::SmallPtrSet<*,*>">
|
||||
<DisplayString Condition="CurArray == SmallArray">{{ [Small Mode] elements={NumElements}, arraySize={CurArraySize} }}</DisplayString>
|
||||
<DisplayString Condition="CurArray != SmallArray">{{ [Big Mode] elements={NumElements}, arraySize={CurArraySize} }}</DisplayString>
|
||||
<DisplayString Condition="CurArray == SmallArray">{{ [Small Mode] size={NumElements}, capacity={CurArraySize} }}</DisplayString>
|
||||
<DisplayString Condition="CurArray != SmallArray">{{ [Big Mode] size={NumElements}, capacity={CurArraySize} }}</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[NumElements]">NumElements</Item>
|
||||
<Item Name="[CurArraySize]">CurArraySize</Item>
|
||||
<IndexListItems>
|
||||
<Size>CurArraySize + 1</Size>
|
||||
<ValueNode>($T1*)&CurArray[$i]</ValueNode>
|
||||
</IndexListItems>
|
||||
<Item Name="[size]">NumElements</Item>
|
||||
<Item Name="[capacity]">CurArraySize</Item>
|
||||
<ArrayItems>
|
||||
<Size>CurArraySize</Size>
|
||||
<ValuePointer>($T1*)CurArray</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="llvm::DenseMap<*,*,*>">
|
||||
<DisplayString Condition="NumEntries == 0">empty</DisplayString>
|
||||
<DisplayString Condition="NumEntries != 0">{{ entries={NumEntries}, buckets={NumBuckets} }}</DisplayString>
|
||||
<DisplayString Condition="NumEntries != 0">{{ size={NumEntries}, buckets={NumBuckets} }}</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[NumEntries]">NumEntries</Item>
|
||||
<Item Name="[NumBuckets]">NumBuckets</Item>
|
||||
<Item Name="[size]">NumEntries</Item>
|
||||
<Item Name="[buckets]">NumBuckets</Item>
|
||||
<ArrayItems>
|
||||
<Size>NumBuckets</Size>
|
||||
<ValuePointer>Buckets</ValuePointer>
|
||||
@ -155,22 +143,22 @@ or create a symbolic link so it updates automatically.
|
||||
</Type>
|
||||
|
||||
<Type Name="llvm::StringMap<*,*>">
|
||||
<DisplayString>{{ NumBuckets={NumBuckets}, ItemSize={ItemSize} }}</DisplayString>
|
||||
<DisplayString>{{ size={ItemSize}, buckets={NumBuckets} }}</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[NumBuckets]">NumBuckets</Item>
|
||||
<Item Name="[ItemSize]">ItemSize</Item>
|
||||
<IndexListItems>
|
||||
<Item Name="[size]">ItemSize</Item>
|
||||
<Item Name="[buckets]">NumBuckets</Item>
|
||||
<ArrayItems>
|
||||
<Size>NumBuckets</Size>
|
||||
<ValueNode>(llvm::StringMapEntry<$T1>*)TheTable[$i]</ValueNode>
|
||||
</IndexListItems>
|
||||
<ValuePointer>(MapEntryTy**)TheTable</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="llvm::StringMapEntry<*>">
|
||||
<DisplayString Condition="StrLen == 0">empty</DisplayString>
|
||||
<DisplayString Condition="StrLen != 0">({((llvm::StringMapEntry<$T1>*)this)+1,s}, {second})</DisplayString>
|
||||
<DisplayString Condition="StrLen != 0">({this+1,s}, {second})</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[key]">((llvm::StringMapEntry<$T1>*)this)+1,s</Item>
|
||||
<Item Name="[key]">this+1,s</Item>
|
||||
<Item Name="[value]" Condition="StrLen != 0">second</Item>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
Loading…
Reference in New Issue
Block a user