1 <?xml version=
"1.0" encoding=
"utf-8"?>
3 Visual Studio Native Debugging Visualizers for LLVM
5 For Visual Studio 2013 only, put this file into
6 "%USERPROFILE%\Documents\Visual Studio 2013\Visualizers" or create a symbolic link so it updates automatically.
8 For later versions of Visual Studio, no setup is required.
10 <AutoVisualizer xmlns=
"http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
12 <Type Name=
"llvm::SmallVectorImpl<*>" Priority=
"MediumLow">
13 <DisplayString Condition=
"Size == 0">empty
</DisplayString>
14 <DisplayString Condition=
"Size != 0">{{ size={Size} }}
</DisplayString>
16 <Item Name=
"[size]">Size
</Item>
17 <Item Name=
"[capacity]">Capacity
</Item>
20 <ValuePointer>($T1*)BeginX
</ValuePointer>
24 <!-- VS2015 and up -->
25 <Type Name=
"llvm::SmallVectorImpl<*>">
26 <DisplayString IncludeView =
"elt0" Condition=
"Size == 0"></DisplayString>
27 <DisplayString IncludeView =
"elt0">{(($T1*)BeginX)[
0]}{*this,view(elt1)}
</DisplayString>
28 <DisplayString IncludeView =
"elt1" Condition=
"Size == 1"></DisplayString>
29 <DisplayString IncludeView =
"elt1">, {(($T1*)BeginX)[
1]}{*this,view(elt2)}
</DisplayString>
30 <DisplayString IncludeView =
"elt2" Condition=
"Size == 2"></DisplayString>
31 <DisplayString IncludeView =
"elt2">, {(($T1*)BeginX)[
2]}{*this,view(elt3)}
</DisplayString>
32 <DisplayString IncludeView =
"elt3" Condition=
"Size == 3"></DisplayString>
33 <DisplayString IncludeView =
"elt3">, {(($T1*)BeginX)[
3]}{*this,view(elt4)}
</DisplayString>
34 <DisplayString IncludeView =
"elt4" Condition=
"Size == 4"></DisplayString>
35 <DisplayString IncludeView =
"elt4">, /* {Size -
4} more*/
</DisplayString>
36 <DisplayString Condition=
"Size == 0">empty
</DisplayString>
37 <DisplayString Condition=
"Size != 0">{{{*this,view(elt0)}}}
</DisplayString>
39 <Item Name=
"[size]">Size
</Item>
40 <Item Name=
"[capacity]">Capacity
</Item>
43 <ValuePointer>($T1*)BeginX
</ValuePointer>
47 <Type Name=
"llvm::ArrayRef<*>">
48 <DisplayString Condition=
"Length == 0">empty
</DisplayString>
49 <DisplayString Condition=
"Length != 0">{{ size={Length} }}
</DisplayString>
51 <Item Name=
"[size]">Length
</Item>
54 <ValuePointer>Data
</ValuePointer>
58 <Type Name=
"llvm::SmallString<*>">
59 <DisplayString>{(const char*)BeginX,[Size] na}
</DisplayString>
60 <StringView>(const char*)BeginX,[Size]
</StringView>
62 <Item Name=
"[size]">Size
</Item>
63 <Item Name=
"[capacity]">Capacity
</Item>
66 <ValuePointer>(char*)BeginX
</ValuePointer>
71 <Type Name=
"StringView">
72 <DisplayString>{First,[Last - First]s}
</DisplayString>
75 <Type Name=
"llvm::StringRef">
76 <DisplayString>{Data,[Length]s}
</DisplayString>
77 <StringView>Data,[Length]s
</StringView>
79 <Item Name=
"[size]">Length
</Item>
82 <ValuePointer>Data
</ValuePointer>
87 <Type Name=
"llvm::PointerIntPair<*,*,*,*>">
88 <DisplayString>{IntMask}: {($T1)(Value
& PointerBitMask)} [{($T3)((Value
>> IntShift)
& IntMask)}]
</DisplayString>
90 <Item Name=
"[ptr]">($T1)(Value
& PointerBitMask)
</Item>
91 <Item Name=
"[int]">($T3)((Value
>> IntShift)
& IntMask)
</Item>
95 <Type Name=
"llvm::PointerUnion<*,*>">
96 <DisplayString Condition=
"((Val.Value >> Val.IntShift) & Val.IntMask) == 0">{
"$T1", s8b}: {($T1)(Val.Value
& Val.PointerBitMask)}
</DisplayString>
97 <DisplayString Condition=
"((Val.Value >> Val.IntShift) & Val.IntMask) != 0">{
"$T2", s8b}: {($T2)(Val.Value
& Val.PointerBitMask)}
</DisplayString>
99 <ExpandedItem Condition=
"((Val.Value >> Val.IntShift) & Val.IntMask) == 0">($T1)(Val.Value
& Val.PointerBitMask)
</ExpandedItem>
100 <ExpandedItem Condition=
"((Val.Value >> Val.IntShift) & Val.IntMask) != 0">($T2)(Val.Value
& Val.PointerBitMask)
</ExpandedItem>
104 <Type Name=
"llvm::PointerUnion3<*,*,*>">
105 <DisplayString Condition=
"(Val.Val.Value & 2) != 2 && (Val.Val.Value & 1) != 1">{
"$T1", s8b}: {($T1)((Val.Val.Value
>> 2)
<< 2)}
</DisplayString>
106 <DisplayString Condition=
"(Val.Val.Value & 2) == 2">{
"$T2", s8b}: {($T2)((Val.Val.Value
>> 2)
<< 2)}
</DisplayString>
107 <DisplayString Condition=
"(Val.Val.Value & 1) == 1">{
"$T3", s8b}: {($T3)((Val.Val.Value
>> 2)
<< 2)}
</DisplayString>
109 <ExpandedItem Condition=
"(Val.Val.Value & 2) != 2 && (Val.Val.Value & 1) != 1">($T1)((Val.Val.Value
>> 2)
<< 2)
</ExpandedItem>
110 <ExpandedItem Condition=
"(Val.Val.Value & 2) == 2">($T2)((Val.Val.Value
>> 2)
<< 2)
</ExpandedItem>
111 <ExpandedItem Condition=
"(Val.Val.Value & 1) == 1">($T3)((Val.Val.Value
>> 2)
<< 2)
</ExpandedItem>
115 <Type Name=
"llvm::PointerUnion4<*,*,*,*>">
116 <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>
117 <DisplayString Condition=
"(Val.Val.Value & 3) != 3 && (Val.Val.Value & 2) == 2">{
"$T2", s8b}: {($T2)((Val.Val.Value
>> 2)
<< 2)}
</DisplayString>
118 <DisplayString Condition=
"(Val.Val.Value & 3) != 3 && (Val.Val.Value & 1) == 1">{
"$T3", s8b}: {($T3)((Val.Val.Value
>> 2)
<< 2)}
</DisplayString>
119 <DisplayString Condition=
"(Val.Val.Value & 3) == 3">{
"$T4", s8b}: {($T4)((Val.Val.Value
>> 2)
<< 2)}
</DisplayString>
121 <ExpandedItem Condition=
"(Val.Val.Value & 3) != 3 && (Val.Val.Value & 2) != 2 && (Val.Val.Value & 1) != 1">($T1)((Val.Val.Value
>> 2)
<< 2)
</ExpandedItem>
122 <ExpandedItem Condition=
"(Val.Val.Value & 3) != 3 && (Val.Val.Value & 2) == 2">($T2)((Val.Val.Value
>> 2)
<< 2)
</ExpandedItem>
123 <ExpandedItem Condition=
"(Val.Val.Value & 3) != 3 && (Val.Val.Value & 1) == 1">($T3)((Val.Val.Value
>> 2)
<< 2)
</ExpandedItem>
124 <ExpandedItem Condition=
"(Val.Val.Value & 3) == 3">($T4)((Val.Val.Value
>> 2)
<< 2)
</ExpandedItem>
128 <Type Name=
"llvm::iplist<*,*>">
129 <DisplayString Condition=
"Head == 0">{{ empty }}
</DisplayString>
130 <DisplayString Condition=
"Head != 0">{{ head={Head} }}
</DisplayString>
133 <HeadPointer>Head
</HeadPointer>
134 <NextPointer>Next
</NextPointer>
135 <ValueNode>this
</ValueNode>
140 <Type Name=
"llvm::IntrusiveRefCntPtr<*>">
141 <DisplayString Condition=
"Obj == 0">empty
</DisplayString>
142 <DisplayString Condition=
"(Obj != 0) && (Obj->ref_cnt == 1)">RefPtr [
1 ref] {*Obj}
</DisplayString>
143 <DisplayString Condition=
"(Obj != 0) && (Obj->ref_cnt != 1)">RefPtr [{Obj-
>ref_cnt} refs] {*Obj}
</DisplayString>
145 <Item Condition=
"Obj != 0" Name=
"[refs]">Obj-
>ref_cnt
</Item>
146 <ExpandedItem Condition=
"Obj != 0">Obj
</ExpandedItem>
150 <Type Name=
"llvm::SmallPtrSet<*,*>">
151 <DisplayString Condition=
"CurArray == SmallArray">{{ [Small Mode] size={NumElements}, capacity={CurArraySize} }}
</DisplayString>
152 <DisplayString Condition=
"CurArray != SmallArray">{{ [Big Mode] size={NumElements}, capacity={CurArraySize} }}
</DisplayString>
154 <Item Name=
"[size]">NumElements
</Item>
155 <Item Name=
"[capacity]">CurArraySize
</Item>
157 <Size>CurArraySize
</Size>
158 <ValuePointer>($T1*)CurArray
</ValuePointer>
163 <Type Name=
"llvm::DenseMap<*,*,*>">
164 <DisplayString Condition=
"NumEntries == 0">empty
</DisplayString>
165 <DisplayString Condition=
"NumEntries != 0">{{ size={NumEntries}, buckets={NumBuckets} }}
</DisplayString>
167 <Item Name=
"[size]">NumEntries
</Item>
168 <Item Name=
"[buckets]">NumBuckets
</Item>
170 <Size>NumBuckets
</Size>
171 <ValuePointer>Buckets
</ValuePointer>
176 <Type Name=
"llvm::StringMap<*,*>">
177 <DisplayString>{{ size={NumItems}, buckets={NumBuckets} }}
</DisplayString>
179 <Item Name=
"[size]">NumItems
</Item>
180 <Item Name=
"[buckets]">NumBuckets
</Item>
182 <Size>NumBuckets
</Size>
183 <ValuePointer>(MapEntryTy**)TheTable
</ValuePointer>
188 <Type Name=
"llvm::StringMapEntry<*>">
189 <DisplayString Condition=
"StrLen == 0">empty
</DisplayString>
190 <DisplayString Condition=
"StrLen != 0">({this+
1,s}, {second})
</DisplayString>
192 <Item Name=
"[key]">this+
1,s
</Item>
193 <Item Name=
"[value]" Condition=
"StrLen != 0">second
</Item>
197 <Type Name=
"llvm::Triple">
198 <DisplayString>{Data}
</DisplayString>
201 <Type Name=
"llvm::Optional<*>">
202 <DisplayString Condition=
"!Storage.hasVal">None
</DisplayString>
203 <DisplayString Condition=
"Storage.hasVal">{*(($T1 *)(unsigned char *)Storage.storage.buffer)}
</DisplayString>
205 <Item Name=
"[underlying]" Condition=
"Storage.hasVal">*(($T1 *)(unsigned char *)Storage.storage.buffer)
</Item>
209 <Type Name=
"llvm::Expected<*>">
210 <DisplayString Condition=
"HasError">Error
</DisplayString>
211 <DisplayString Condition=
"!HasError">{*((storage_type *)TStorage.buffer)}
</DisplayString>
213 <Item Name=
"[value]" Condition=
"!HasError">*((storage_type *)TStorage.buffer)
</Item>
214 <Item Name=
"[error]" Condition=
"HasError">*((error_type *)ErrorStorage.buffer)
</Item>
219 <!-- Since we're in MSVC, we can assume that the system is little endian. Therefore
220 the little and native cases just require a cast. Handle this easy case first. Use
221 a wildcard for the second template argument (the endianness), but we will use a
222 specific value of 0 later on for the big endian to give it priority for being a
224 <Type Name=
"llvm::support::detail::packed_endian_specific_integral<*,*,1>">
225 <DisplayString>{{little endian value = {*(($T1*)(unsigned char *)Value.buffer)} }}
</DisplayString>
227 <Item Name=
"[Raw Bytes]" Condition=
"sizeof($T1)==1">(unsigned char *)Value.buffer,
1</Item>
228 <Item Name=
"[Raw Bytes]" Condition=
"sizeof($T1)==2">(unsigned char *)Value.buffer,
2</Item>
229 <Item Name=
"[Raw Bytes]" Condition=
"sizeof($T1)==4">(unsigned char *)Value.buffer,
4</Item>
230 <Item Name=
"[Raw Bytes]" Condition=
"sizeof($T1)==8">(unsigned char *)Value.buffer,
8</Item>
234 <!-- Now handle the hard case of big endian. We need to do the swizzling here, but
235 we need to specialize it based on the size of the value type. -->
236 <Type Name=
"llvm::support::detail::packed_endian_specific_integral<*,0,1>">
237 <DisplayString Condition=
"sizeof($T1)==1">{{ big endian value = {*(unsigned char *)Value.buffer} }}
</DisplayString>
238 <DisplayString Condition=
"sizeof($T1)==2">{{ big endian value = {(($T1)(*(unsigned char *)Value.buffer)
<< 8)
239 | ($T1)(*((unsigned char *)Value.buffer+
1))} }}
</DisplayString>
240 <DisplayString Condition=
"sizeof($T1)==4">{{ big endian value = {(($T1)(*(unsigned char *)Value.buffer)
<< 24)
241 | (($T1)(*((unsigned char *)Value.buffer+
1))
<< 16)
242 | (($T1)(*((unsigned char *)Value.buffer+
2))
<< 8)
243 | ($T1)(*((unsigned char *)Value.buffer+
3))} }}
</DisplayString>
244 <DisplayString Condition=
"sizeof($T1)==8">{{ big endian value = {(($T1)(*(unsigned char *)Value.buffer)
<< 56)
245 | (($T1)(*((unsigned char *)Value.buffer+
1))
<< 48)
246 | (($T1)(*((unsigned char *)Value.buffer+
2))
<< 40)
247 | (($T1)(*((unsigned char *)Value.buffer+
3))
<< 32)
248 | (($T1)(*((unsigned char *)Value.buffer+
4))
<< 24)
249 | (($T1)(*((unsigned char *)Value.buffer+
5))
<< 16)
250 | (($T1)(*((unsigned char *)Value.buffer+
6))
<< 8)
251 | ($T1)(*((unsigned char *)Value.buffer+
7))} }}
</DisplayString>
253 <Item Name=
"[Raw Bytes]" Condition=
"sizeof($T1)==1">(unsigned char *)Value.buffer,
1</Item>
254 <Item Name=
"[Raw Bytes]" Condition=
"sizeof($T1)==2">(unsigned char *)Value.buffer,
2</Item>
255 <Item Name=
"[Raw Bytes]" Condition=
"sizeof($T1)==4">(unsigned char *)Value.buffer,
4</Item>
256 <Item Name=
"[Raw Bytes]" Condition=
"sizeof($T1)==8">(unsigned char *)Value.buffer,
8</Item>