• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3Visual Studio Native Debugging Visualizers for LLVM
4
5For Visual Studio 2013 only, put this file into
6"%USERPROFILE%\Documents\Visual Studio 2013\Visualizers" or create a symbolic link so it updates automatically.
7
8For later versions of Visual Studio, no setup is required.
9-->
10<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
11  <!-- VS2013 -->
12  <Type Name="llvm::SmallVectorImpl&lt;*&gt;" Priority="MediumLow">
13    <DisplayString Condition="(($T1*)EndX - ($T1*)BeginX) == 0">empty</DisplayString>
14    <DisplayString Condition="(($T1*)EndX - ($T1*)BeginX) != 0">{{ size={($T1*)EndX - ($T1*)BeginX} }}</DisplayString>
15    <Expand>
16      <Item Name="[size]">($T1*)EndX - ($T1*)BeginX</Item>
17      <Item Name="[capacity]">($T1*)CapacityX - ($T1*)BeginX</Item>
18      <ArrayItems>
19        <Size>($T1*)EndX - ($T1*)BeginX</Size>
20        <ValuePointer>($T1*)BeginX</ValuePointer>
21      </ArrayItems>
22    </Expand>
23  </Type>
24  <!-- VS2015 and up -->
25  <Type Name="llvm::SmallVectorImpl&lt;*&gt;">
26    <DisplayString IncludeView ="elt0" Condition="(($T1*)EndX - ($T1*)BeginX) == 0"></DisplayString>
27    <DisplayString IncludeView ="elt0">{(($T1*)BeginX)[0]}{*this,view(elt1)}</DisplayString>
28    <DisplayString IncludeView ="elt1" Condition="(($T1*)EndX - ($T1*)BeginX) == 1"></DisplayString>
29    <DisplayString IncludeView ="elt1">, {(($T1*)BeginX)[1]}{*this,view(elt2)}</DisplayString>
30    <DisplayString IncludeView ="elt2" Condition="(($T1*)EndX - ($T1*)BeginX) == 2"></DisplayString>
31    <DisplayString IncludeView ="elt2">, {(($T1*)BeginX)[2]}{*this,view(elt3)}</DisplayString>
32    <DisplayString IncludeView ="elt3" Condition="(($T1*)EndX - ($T1*)BeginX) == 3"></DisplayString>
33    <DisplayString IncludeView ="elt3">, {(($T1*)BeginX)[2]}{*this,view(elt4)}</DisplayString>
34    <DisplayString IncludeView ="elt4" Condition="(($T1*)EndX - ($T1*)BeginX) == 4"></DisplayString>
35    <DisplayString IncludeView ="elt4">, /* {(($T1*)EndX - ($T1*)BeginX) - 4} more*/ </DisplayString>
36    <DisplayString Condition="(($T1*)EndX - ($T1*)BeginX) == 0">empty</DisplayString>
37    <DisplayString Condition="(($T1*)EndX - ($T1*)BeginX) != 0">{{{*this,view(elt0)}}}</DisplayString>
38    <Expand>
39      <Item Name="[size]">($T1*)EndX - ($T1*)BeginX</Item>
40      <Item Name="[capacity]">($T1*)CapacityX - ($T1*)BeginX</Item>
41      <ArrayItems>
42        <Size>($T1*)EndX - ($T1*)BeginX</Size>
43        <ValuePointer>($T1*)BeginX</ValuePointer>
44      </ArrayItems>
45    </Expand>
46  </Type>
47  <Type Name="llvm::ArrayRef&lt;*&gt;">
48    <DisplayString Condition="Length == 0">empty</DisplayString>
49    <DisplayString Condition="Length != 0">{{ size={Length} }}</DisplayString>
50    <Expand>
51      <Item Name="[size]">Length</Item>
52      <ArrayItems>
53        <Size>Length</Size>
54        <ValuePointer>Data</ValuePointer>
55      </ArrayItems>
56    </Expand>
57  </Type>
58  <Type Name="llvm::SmallString&lt;*&gt;">
59    <DisplayString>{BeginX,s}</DisplayString>
60    <StringView>BeginX,s</StringView>
61    <Expand>
62      <Item Name="[size]">(char*)EndX - (char*)BeginX</Item>
63      <Item Name="[capacity]">(char*)CapacityX - (char*)BeginX</Item>
64      <ArrayItems>
65        <Size>(char*)EndX - (char*)BeginX</Size>
66        <ValuePointer>(char*)BeginX</ValuePointer>
67      </ArrayItems>
68    </Expand>
69  </Type>
70
71  <Type Name="llvm::StringRef">
72    <DisplayString>{Data,[Length]s}</DisplayString>
73    <StringView>Data,[Length]s</StringView>
74    <Expand>
75      <Item Name="[size]">Length</Item>
76      <ArrayItems>
77        <Size>Length</Size>
78        <ValuePointer>Data</ValuePointer>
79      </ArrayItems>
80    </Expand>
81  </Type>
82
83  <Type Name="llvm::PointerIntPair&lt;*,*,*,*&gt;">
84    <DisplayString>{IntMask}: {($T1)(Value &amp; PointerBitMask)} [{($T3)((Value &gt;&gt; IntShift) &amp; IntMask)}]</DisplayString>
85    <Expand>
86      <Item Name="[ptr]">($T1)(Value &amp; PointerBitMask)</Item>
87      <Item Name="[int]">($T3)((Value &gt;&gt; IntShift) &amp; IntMask)</Item>
88    </Expand>
89  </Type>
90
91  <Type Name="llvm::PointerUnion&lt;*,*&gt;">
92    <DisplayString Condition="((Val.Value &gt;&gt; Val.IntShift) &amp; Val.IntMask) == 0">{"$T1", s8b}: {($T1)(Val.Value &amp; Val.PointerBitMask)}</DisplayString>
93    <DisplayString Condition="((Val.Value &gt;&gt; Val.IntShift) &amp; Val.IntMask) != 0">{"$T2", s8b}: {($T2)(Val.Value &amp; Val.PointerBitMask)}</DisplayString>
94    <Expand>
95      <ExpandedItem Condition="((Val.Value &gt;&gt; Val.IntShift) &amp; Val.IntMask) == 0">($T1)(Val.Value &amp; Val.PointerBitMask)</ExpandedItem>
96      <ExpandedItem Condition="((Val.Value &gt;&gt; Val.IntShift) &amp; Val.IntMask) != 0">($T2)(Val.Value &amp; Val.PointerBitMask)</ExpandedItem>
97    </Expand>
98  </Type>
99
100  <Type Name="llvm::PointerUnion3&lt;*,*,*&gt;">
101    <DisplayString Condition="(Val.Val.Value &amp; 2) != 2 &amp;&amp; (Val.Val.Value &amp; 1) != 1">{"$T1", s8b}: {($T1)((Val.Val.Value &gt;&gt; 2) &lt;&lt; 2)}</DisplayString>
102    <DisplayString Condition="(Val.Val.Value &amp; 2) == 2">{"$T2", s8b}: {($T2)((Val.Val.Value &gt;&gt; 2) &lt;&lt; 2)}</DisplayString>
103    <DisplayString Condition="(Val.Val.Value &amp; 1) == 1">{"$T3", s8b}: {($T3)((Val.Val.Value &gt;&gt; 2) &lt;&lt; 2)}</DisplayString>
104    <Expand>
105      <ExpandedItem Condition="(Val.Val.Value &amp; 2) != 2 &amp;&amp; (Val.Val.Value &amp; 1) != 1">($T1)((Val.Val.Value &gt;&gt; 2) &lt;&lt; 2)</ExpandedItem>
106      <ExpandedItem Condition="(Val.Val.Value &amp; 2) == 2">($T2)((Val.Val.Value &gt;&gt; 2) &lt;&lt; 2)</ExpandedItem>
107      <ExpandedItem Condition="(Val.Val.Value &amp; 1) == 1">($T3)((Val.Val.Value &gt;&gt; 2) &lt;&lt; 2)</ExpandedItem>
108    </Expand>
109  </Type>
110
111  <Type Name="llvm::PointerUnion4&lt;*,*,*,*&gt;">
112    <DisplayString Condition="(Val.Val.Value &amp; 3) != 3 &amp;&amp; (Val.Val.Value &amp; 2) != 2 &amp;&amp; (Val.Val.Value &amp; 1) != 1">{"$T1", s8b}: {($T1)((Val.Val.Value &gt;&gt; 2) &lt;&lt; 2)}</DisplayString>
113    <DisplayString Condition="(Val.Val.Value &amp; 3) != 3 &amp;&amp; (Val.Val.Value &amp; 2) == 2">{"$T2", s8b}: {($T2)((Val.Val.Value &gt;&gt; 2) &lt;&lt; 2)}</DisplayString>
114    <DisplayString Condition="(Val.Val.Value &amp; 3) != 3 &amp;&amp; (Val.Val.Value &amp; 1) == 1">{"$T3", s8b}: {($T3)((Val.Val.Value &gt;&gt; 2) &lt;&lt; 2)}</DisplayString>
115    <DisplayString Condition="(Val.Val.Value &amp; 3) == 3">{"$T4", s8b}: {($T4)((Val.Val.Value &gt;&gt; 2) &lt;&lt; 2)}</DisplayString>
116    <Expand>
117      <ExpandedItem Condition="(Val.Val.Value &amp; 3) != 3 &amp;&amp; (Val.Val.Value &amp; 2) != 2 &amp;&amp; (Val.Val.Value &amp; 1) != 1">($T1)((Val.Val.Value &gt;&gt; 2) &lt;&lt; 2)</ExpandedItem>
118      <ExpandedItem Condition="(Val.Val.Value &amp; 3) != 3 &amp;&amp; (Val.Val.Value &amp; 2) == 2">($T2)((Val.Val.Value &gt;&gt; 2) &lt;&lt; 2)</ExpandedItem>
119      <ExpandedItem Condition="(Val.Val.Value &amp; 3) != 3 &amp;&amp; (Val.Val.Value &amp; 1) == 1">($T3)((Val.Val.Value &gt;&gt; 2) &lt;&lt; 2)</ExpandedItem>
120      <ExpandedItem Condition="(Val.Val.Value &amp; 3) == 3">($T4)((Val.Val.Value &gt;&gt; 2) &lt;&lt; 2)</ExpandedItem>
121    </Expand>
122  </Type>
123
124  <Type Name="llvm::iplist&lt;*,*&gt;">
125    <DisplayString Condition="Head == 0">{{ empty }}</DisplayString>
126    <DisplayString Condition="Head != 0">{{ head={Head} }}</DisplayString>
127    <Expand>
128      <LinkedListItems>
129        <HeadPointer>Head</HeadPointer>
130        <NextPointer>Next</NextPointer>
131        <ValueNode>this</ValueNode>
132      </LinkedListItems>
133    </Expand>
134  </Type>
135
136  <Type Name="llvm::IntrusiveRefCntPtr&lt;*&gt;">
137    <DisplayString Condition="Obj == 0">empty</DisplayString>
138    <DisplayString Condition="(Obj != 0) &amp;&amp; (Obj-&gt;ref_cnt == 1)">RefPtr [1 ref] {*Obj}</DisplayString>
139    <DisplayString Condition="(Obj != 0) &amp;&amp; (Obj-&gt;ref_cnt != 1)">RefPtr [{Obj-&gt;ref_cnt} refs] {*Obj}</DisplayString>
140    <Expand>
141      <Item Condition="Obj != 0" Name="[refs]">Obj-&gt;ref_cnt</Item>
142      <ExpandedItem Condition="Obj != 0">Obj</ExpandedItem>
143    </Expand>
144  </Type>
145
146  <Type Name="llvm::SmallPtrSet&lt;*,*&gt;">
147    <DisplayString Condition="CurArray == SmallArray">{{ [Small Mode] size={NumElements}, capacity={CurArraySize} }}</DisplayString>
148    <DisplayString Condition="CurArray != SmallArray">{{ [Big Mode] size={NumElements}, capacity={CurArraySize} }}</DisplayString>
149    <Expand>
150      <Item Name="[size]">NumElements</Item>
151      <Item Name="[capacity]">CurArraySize</Item>
152      <ArrayItems>
153        <Size>CurArraySize</Size>
154        <ValuePointer>($T1*)CurArray</ValuePointer>
155      </ArrayItems>
156    </Expand>
157  </Type>
158
159  <Type Name="llvm::DenseMap&lt;*,*,*&gt;">
160    <DisplayString Condition="NumEntries == 0">empty</DisplayString>
161    <DisplayString Condition="NumEntries != 0">{{ size={NumEntries}, buckets={NumBuckets} }}</DisplayString>
162    <Expand>
163      <Item Name="[size]">NumEntries</Item>
164      <Item Name="[buckets]">NumBuckets</Item>
165      <ArrayItems>
166        <Size>NumBuckets</Size>
167        <ValuePointer>Buckets</ValuePointer>
168      </ArrayItems>
169    </Expand>
170  </Type>
171
172  <Type Name="llvm::StringMap&lt;*,*&gt;">
173    <DisplayString>{{ size={NumItems}, buckets={NumBuckets} }}</DisplayString>
174    <Expand>
175      <Item Name="[size]">NumItems</Item>
176      <Item Name="[buckets]">NumBuckets</Item>
177      <ArrayItems>
178        <Size>NumBuckets</Size>
179        <ValuePointer>(MapEntryTy**)TheTable</ValuePointer>
180      </ArrayItems>
181    </Expand>
182  </Type>
183
184  <Type Name="llvm::StringMapEntry&lt;*&gt;">
185    <DisplayString Condition="StrLen == 0">empty</DisplayString>
186    <DisplayString Condition="StrLen != 0">({this+1,s}, {second})</DisplayString>
187    <Expand>
188      <Item Name="[key]">this+1,s</Item>
189      <Item Name="[value]" Condition="StrLen != 0">second</Item>
190    </Expand>
191  </Type>
192
193  <Type Name="llvm::Triple">
194    <DisplayString>{Data}</DisplayString>
195  </Type>
196
197  <Type Name="llvm::Optional&lt;*&gt;">
198    <DisplayString Condition="!hasVal">empty</DisplayString>
199    <DisplayString Condition="hasVal">{*(($T1 *)(unsigned char *)storage.buffer)}</DisplayString>
200    <Expand>
201      <Item Name="[underlying]" Condition="hasVal">*(($T1 *)(unsigned char *)storage.buffer)</Item>
202    </Expand>
203  </Type>
204
205
206  <!-- Since we're in MSVC, we can assume that the system is little endian.  Therefore
207       the little and native cases just require a cast.  Handle this easy case first. Use
208       a wildcard for the second template argument (the endianness), but we will use a
209       specific value of 0 later on for the big endian to give it priority for being a
210       better match.  -->
211  <Type Name="llvm::support::detail::packed_endian_specific_integral&lt;*,*,1&gt;">
212    <DisplayString>{{little endian value = {*(($T1*)(unsigned char *)Value.buffer)} }}</DisplayString>
213    <Expand>
214      <Item Name="[Raw Bytes]" Condition="sizeof($T1)==1">(unsigned char *)Value.buffer,1</Item>
215      <Item Name="[Raw Bytes]" Condition="sizeof($T1)==2">(unsigned char *)Value.buffer,2</Item>
216      <Item Name="[Raw Bytes]" Condition="sizeof($T1)==4">(unsigned char *)Value.buffer,4</Item>
217      <Item Name="[Raw Bytes]" Condition="sizeof($T1)==8">(unsigned char *)Value.buffer,8</Item>
218    </Expand>
219  </Type>
220
221  <!-- Now handle the hard case of big endian.  We need to do the swizzling here, but
222       we need to specialize it based on the size of the value type. -->
223  <Type Name="llvm::support::detail::packed_endian_specific_integral&lt;*,0,1&gt;">
224    <DisplayString Condition="sizeof($T1)==1">{{ big endian value = {*(unsigned char *)Value.buffer} }}</DisplayString>
225    <DisplayString Condition="sizeof($T1)==2">{{ big endian value = {(($T1)(*(unsigned char *)Value.buffer) &lt;&lt; 8)
226                                                                    | ($T1)(*((unsigned char *)Value.buffer+1))} }}</DisplayString>
227    <DisplayString Condition="sizeof($T1)==4">{{ big endian value = {(($T1)(*(unsigned char *)Value.buffer) &lt;&lt; 24)
228                                                                    | (($T1)(*((unsigned char *)Value.buffer+1)) &lt;&lt; 16)
229                                                                    | (($T1)(*((unsigned char *)Value.buffer+2)) &lt;&lt; 8)
230                                                                    |  ($T1)(*((unsigned char *)Value.buffer+3))} }}</DisplayString>
231    <DisplayString Condition="sizeof($T1)==8">{{ big endian value = {(($T1)(*(unsigned char *)Value.buffer) &lt;&lt; 56)
232                                                                    | (($T1)(*((unsigned char *)Value.buffer+1)) &lt;&lt; 48)
233                                                                    | (($T1)(*((unsigned char *)Value.buffer+2)) &lt;&lt; 40)
234                                                                    | (($T1)(*((unsigned char *)Value.buffer+3)) &lt;&lt; 32)
235                                                                    | (($T1)(*((unsigned char *)Value.buffer+4)) &lt;&lt; 24)
236                                                                    | (($T1)(*((unsigned char *)Value.buffer+5)) &lt;&lt; 16)
237                                                                    | (($T1)(*((unsigned char *)Value.buffer+6)) &lt;&lt; 8)
238                                                                    |  ($T1)(*((unsigned char *)Value.buffer+7))} }}</DisplayString>
239    <Expand>
240      <Item Name="[Raw Bytes]" Condition="sizeof($T1)==1">(unsigned char *)Value.buffer,1</Item>
241      <Item Name="[Raw Bytes]" Condition="sizeof($T1)==2">(unsigned char *)Value.buffer,2</Item>
242      <Item Name="[Raw Bytes]" Condition="sizeof($T1)==4">(unsigned char *)Value.buffer,4</Item>
243      <Item Name="[Raw Bytes]" Condition="sizeof($T1)==8">(unsigned char *)Value.buffer,8</Item>
244    </Expand>
245  </Type>
246</AutoVisualizer>
247