blob: 462c097c12e64f79e7514d132bfaf5f954659e9d [file] [log] [blame]
Aaron Ballman948d0bd2013-01-25 23:37:25 +00001<?xml version="1.0" encoding="utf-8"?>
2<!--
Mike Spertus0b96a2e2016-03-28 17:58:38 +00003Visual Studio Native Debugging Visualizers for LLVM
Aaron Ballman948d0bd2013-01-25 23:37:25 +00004
Mike Spertus0b96a2e2016-03-28 17:58:38 +00005For 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.
Aaron Ballman948d0bd2013-01-25 23:37:25 +00009-->
10<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
Mike Spertus292e5112016-06-13 01:43:14 +000011 <!-- VS2013 -->
12 <Type Name="llvm::SmallVectorImpl&lt;*&gt;" Priority="MediumLow">
Zachary Turner3d5a6dd2018-07-21 15:38:47 +000013 <DisplayString Condition="Size == 0">empty</DisplayString>
14 <DisplayString Condition="Size != 0">{{ size={Size} }}</DisplayString>
Aaron Ballman948d0bd2013-01-25 23:37:25 +000015 <Expand>
Zachary Turner3d5a6dd2018-07-21 15:38:47 +000016 <Item Name="[size]">Size</Item>
17 <Item Name="[capacity]">Capacity</Item>
Aaron Ballman948d0bd2013-01-25 23:37:25 +000018 <ArrayItems>
Zachary Turner3d5a6dd2018-07-21 15:38:47 +000019 <Size>Size</Size>
Aaron Ballman948d0bd2013-01-25 23:37:25 +000020 <ValuePointer>($T1*)BeginX</ValuePointer>
21 </ArrayItems>
22 </Expand>
23 </Type>
Mike Spertus292e5112016-06-13 01:43:14 +000024 <!-- VS2015 and up -->
25 <Type Name="llvm::SmallVectorImpl&lt;*&gt;">
Zachary Turner3d5a6dd2018-07-21 15:38:47 +000026 <DisplayString IncludeView ="elt0" Condition="Size == 0"></DisplayString>
Mike Spertus292e5112016-06-13 01:43:14 +000027 <DisplayString IncludeView ="elt0">{(($T1*)BeginX)[0]}{*this,view(elt1)}</DisplayString>
Zachary Turner3d5a6dd2018-07-21 15:38:47 +000028 <DisplayString IncludeView ="elt1" Condition="Size == 1"></DisplayString>
Mike Spertus292e5112016-06-13 01:43:14 +000029 <DisplayString IncludeView ="elt1">, {(($T1*)BeginX)[1]}{*this,view(elt2)}</DisplayString>
Zachary Turner3d5a6dd2018-07-21 15:38:47 +000030 <DisplayString IncludeView ="elt2" Condition="Size == 2"></DisplayString>
Mike Spertus292e5112016-06-13 01:43:14 +000031 <DisplayString IncludeView ="elt2">, {(($T1*)BeginX)[2]}{*this,view(elt3)}</DisplayString>
Zachary Turner3d5a6dd2018-07-21 15:38:47 +000032 <DisplayString IncludeView ="elt3" Condition="Size == 3"></DisplayString>
Daniil Fukalov0d3b0f42018-08-06 16:47:24 +000033 <DisplayString IncludeView ="elt3">, {(($T1*)BeginX)[3]}{*this,view(elt4)}</DisplayString>
Zachary Turner3d5a6dd2018-07-21 15:38:47 +000034 <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>
Mike Spertus8cfefb52019-01-02 19:26:50 +000038 <DisplayString>Uninitialized</DisplayString>
Mike Spertus292e5112016-06-13 01:43:14 +000039 <Expand>
Zachary Turner3d5a6dd2018-07-21 15:38:47 +000040 <Item Name="[size]">Size</Item>
41 <Item Name="[capacity]">Capacity</Item>
Mike Spertus292e5112016-06-13 01:43:14 +000042 <ArrayItems>
Zachary Turner3d5a6dd2018-07-21 15:38:47 +000043 <Size>Size</Size>
Mike Spertus292e5112016-06-13 01:43:14 +000044 <ValuePointer>($T1*)BeginX</ValuePointer>
45 </ArrayItems>
46 </Expand>
47 </Type>
Mike Spertus3e45d772016-06-05 18:34:02 +000048 <Type Name="llvm::ArrayRef&lt;*&gt;">
49 <DisplayString Condition="Length == 0">empty</DisplayString>
50 <DisplayString Condition="Length != 0">{{ size={Length} }}</DisplayString>
51 <Expand>
52 <Item Name="[size]">Length</Item>
53 <ArrayItems>
54 <Size>Length</Size>
55 <ValuePointer>Data</ValuePointer>
56 </ArrayItems>
57 </Expand>
58 </Type>
Aaron Ballman948d0bd2013-01-25 23:37:25 +000059 <Type Name="llvm::SmallString&lt;*&gt;">
Zachary Turner3d5a6dd2018-07-21 15:38:47 +000060 <DisplayString>{(const char*)BeginX,[Size] na}</DisplayString>
61 <StringView>(const char*)BeginX,[Size]</StringView>
Aaron Ballman948d0bd2013-01-25 23:37:25 +000062 <Expand>
Zachary Turner3d5a6dd2018-07-21 15:38:47 +000063 <Item Name="[size]">Size</Item>
64 <Item Name="[capacity]">Capacity</Item>
Aaron Ballman948d0bd2013-01-25 23:37:25 +000065 <ArrayItems>
Zachary Turner3d5a6dd2018-07-21 15:38:47 +000066 <Size>Size</Size>
Aaron Ballman948d0bd2013-01-25 23:37:25 +000067 <ValuePointer>(char*)BeginX</ValuePointer>
68 </ArrayItems>
69 </Expand>
70 </Type>
71
Zachary Turnerfea073f2018-07-28 17:25:42 +000072 <Type Name="StringView">
73 <DisplayString>{First,[Last - First]s}</DisplayString>
74 </Type>
75
Aaron Ballman948d0bd2013-01-25 23:37:25 +000076 <Type Name="llvm::StringRef">
Nikola Smiljanic958dbe12014-02-07 22:57:20 +000077 <DisplayString>{Data,[Length]s}</DisplayString>
78 <StringView>Data,[Length]s</StringView>
Aaron Ballman948d0bd2013-01-25 23:37:25 +000079 <Expand>
Nikola Smiljanic958dbe12014-02-07 22:57:20 +000080 <Item Name="[size]">Length</Item>
Aaron Ballman948d0bd2013-01-25 23:37:25 +000081 <ArrayItems>
82 <Size>Length</Size>
83 <ValuePointer>Data</ValuePointer>
84 </ArrayItems>
85 </Expand>
86 </Type>
87
88 <Type Name="llvm::PointerIntPair&lt;*,*,*,*&gt;">
Zachary Turnercd3306c2018-12-14 18:20:21 +000089 <DisplayString>{$T5::IntMask}: {($T1)(Value &amp; $T5::PointerBitMask)} [{($T3)((Value &gt;&gt; $T5::IntShift) &amp; $T5::IntMask)}]</DisplayString>
Aaron Ballman948d0bd2013-01-25 23:37:25 +000090 <Expand>
Zachary Turnercd3306c2018-12-14 18:20:21 +000091 <Item Name="[ptr]">($T1)(Value &amp; $T5::PointerBitMask)</Item>
92 <Item Name="[int]">($T3)((Value &gt;&gt; $T5::IntShift) &amp; $T5::IntMask)</Item>
Aaron Ballman948d0bd2013-01-25 23:37:25 +000093 </Expand>
94 </Type>
95
96 <Type Name="llvm::PointerUnion&lt;*,*&gt;">
Mike Spertus8cfefb52019-01-02 19:26:50 +000097 <DisplayString Condition="((Val.Value &gt;&gt; ValTy::InfoTy::IntShift) &amp; ValTy::InfoTy::IntMask) == 0">{"$T1", s8b}: {($T1)(Val.Value &amp; ValTy::InfoTy::PointerBitMask)}</DisplayString>
98 <DisplayString Condition="((Val.Value &gt;&gt; ValTy::InfoTy::IntShift) &amp; ValTy::InfoTy::IntMask) != 0">{"$T2", s8b}: {($T2)(Val.Value &amp; ValTy::InfoTy::PointerBitMask)}</DisplayString>
Aaron Ballman948d0bd2013-01-25 23:37:25 +000099 <Expand>
Mike Spertus8cfefb52019-01-02 19:26:50 +0000100 <Item Name="[Holds]" Condition="((Val.Value &gt;&gt; ValTy::InfoTy::IntShift) &amp; ValTy::InfoTy::IntMask) == 0">"$T1", s8b</Item>
101 <Item Name="[Ptr]" Condition="((Val.Value &gt;&gt; ValTy::InfoTy::IntShift) &amp; ValTy::InfoTy::IntMask) == 0">($T1)(Val.Value &amp; ValTy::InfoTy::PointerBitMask)</Item>
102 <Item Name="[Holds]" Condition="((Val.Value &gt;&gt; ValTy::InfoTy::IntShift) &amp; ValTy::InfoTy::IntMask) != 0">"$T2", s8b</Item>
103 <Item Name="[Ptr]" Condition="((Val.Value &gt;&gt; ValTy::InfoTy::IntShift) &amp; ValTy::InfoTy::IntMask) != 0">($T2)(Val.Value &amp; ValTy::InfoTy::PointerBitMask)</Item>
Aaron Ballman948d0bd2013-01-25 23:37:25 +0000104 </Expand>
105 </Type>
106
107 <Type Name="llvm::PointerUnion3&lt;*,*,*&gt;">
Mike Spertuse59da0b2019-01-02 23:46:59 +0000108 <DisplayString Condition="(Val.Val.Value &gt;&gt; ValTy::ValTy::InfoTy::IntShift) &amp; ValTy::ValTy::InfoTy::IntMask">{"$T3", s8b}: {($T3)(Val.Val.Value &amp; ValTy::ValTy::InfoTy::PointerBitMask)}</DisplayString>
109 <DisplayString>{*(InnerUnion*)&amp;Val.Val.Value}</DisplayString>
Aaron Ballman948d0bd2013-01-25 23:37:25 +0000110 <Expand>
Mike Spertuse59da0b2019-01-02 23:46:59 +0000111 <Item Name="[Holds]" Condition="(Val.Val.Value &gt;&gt; ValTy::ValTy::InfoTy::IntShift) &amp; ValTy::ValTy::InfoTy::IntMask">"$T3", s8b</Item>
112 <Item Name="[Ptr]" Condition="(Val.Val.Value &gt;&gt; ValTy::ValTy::InfoTy::IntShift) &amp; ValTy::ValTy::InfoTy::IntMask">($T3)(Val.Val.Value &amp; ValTy::ValTy::InfoTy::PointerBitMask)</Item>
113 <ExpandedItem Condition="!((Val.Val.Value &gt;&gt; ValTy::ValTy::InfoTy::IntShift) &amp; ValTy::ValTy::InfoTy::IntMask)">*(InnerUnion*)&amp;Val.Val.Value</ExpandedItem>
Aaron Ballman948d0bd2013-01-25 23:37:25 +0000114 </Expand>
115 </Type>
116
117 <Type Name="llvm::PointerUnion4&lt;*,*,*,*&gt;">
Mike Spertusbced68c2016-03-11 18:26:47 +0000118 <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>
119 <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>
120 <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>
121 <DisplayString Condition="(Val.Val.Value &amp; 3) == 3">{"$T4", s8b}: {($T4)((Val.Val.Value &gt;&gt; 2) &lt;&lt; 2)}</DisplayString>
Aaron Ballman948d0bd2013-01-25 23:37:25 +0000122 <Expand>
Nikola Smiljanic958dbe12014-02-07 22:57:20 +0000123 <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>
124 <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>
125 <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>
126 <ExpandedItem Condition="(Val.Val.Value &amp; 3) == 3">($T4)((Val.Val.Value &gt;&gt; 2) &lt;&lt; 2)</ExpandedItem>
Aaron Ballman948d0bd2013-01-25 23:37:25 +0000127 </Expand>
128 </Type>
129
130 <Type Name="llvm::iplist&lt;*,*&gt;">
131 <DisplayString Condition="Head == 0">{{ empty }}</DisplayString>
132 <DisplayString Condition="Head != 0">{{ head={Head} }}</DisplayString>
133 <Expand>
134 <LinkedListItems>
135 <HeadPointer>Head</HeadPointer>
136 <NextPointer>Next</NextPointer>
137 <ValueNode>this</ValueNode>
138 </LinkedListItems>
139 </Expand>
140 </Type>
141
142 <Type Name="llvm::IntrusiveRefCntPtr&lt;*&gt;">
143 <DisplayString Condition="Obj == 0">empty</DisplayString>
144 <DisplayString Condition="(Obj != 0) &amp;&amp; (Obj-&gt;ref_cnt == 1)">RefPtr [1 ref] {*Obj}</DisplayString>
145 <DisplayString Condition="(Obj != 0) &amp;&amp; (Obj-&gt;ref_cnt != 1)">RefPtr [{Obj-&gt;ref_cnt} refs] {*Obj}</DisplayString>
146 <Expand>
147 <Item Condition="Obj != 0" Name="[refs]">Obj-&gt;ref_cnt</Item>
Nikola Smiljanic958dbe12014-02-07 22:57:20 +0000148 <ExpandedItem Condition="Obj != 0">Obj</ExpandedItem>
Aaron Ballman948d0bd2013-01-25 23:37:25 +0000149 </Expand>
150 </Type>
151
Aaron Ballman948d0bd2013-01-25 23:37:25 +0000152 <Type Name="llvm::SmallPtrSet&lt;*,*&gt;">
Nikola Smiljanic958dbe12014-02-07 22:57:20 +0000153 <DisplayString Condition="CurArray == SmallArray">{{ [Small Mode] size={NumElements}, capacity={CurArraySize} }}</DisplayString>
154 <DisplayString Condition="CurArray != SmallArray">{{ [Big Mode] size={NumElements}, capacity={CurArraySize} }}</DisplayString>
Aaron Ballman948d0bd2013-01-25 23:37:25 +0000155 <Expand>
Nikola Smiljanic958dbe12014-02-07 22:57:20 +0000156 <Item Name="[size]">NumElements</Item>
157 <Item Name="[capacity]">CurArraySize</Item>
158 <ArrayItems>
159 <Size>CurArraySize</Size>
160 <ValuePointer>($T1*)CurArray</ValuePointer>
161 </ArrayItems>
Aaron Ballman948d0bd2013-01-25 23:37:25 +0000162 </Expand>
163 </Type>
164
165 <Type Name="llvm::DenseMap&lt;*,*,*&gt;">
166 <DisplayString Condition="NumEntries == 0">empty</DisplayString>
Nikola Smiljanic958dbe12014-02-07 22:57:20 +0000167 <DisplayString Condition="NumEntries != 0">{{ size={NumEntries}, buckets={NumBuckets} }}</DisplayString>
Aaron Ballman948d0bd2013-01-25 23:37:25 +0000168 <Expand>
Nikola Smiljanic958dbe12014-02-07 22:57:20 +0000169 <Item Name="[size]">NumEntries</Item>
170 <Item Name="[buckets]">NumBuckets</Item>
Aaron Ballman948d0bd2013-01-25 23:37:25 +0000171 <ArrayItems>
172 <Size>NumBuckets</Size>
173 <ValuePointer>Buckets</ValuePointer>
174 </ArrayItems>
175 </Expand>
176 </Type>
177
178 <Type Name="llvm::StringMap&lt;*,*&gt;">
Nikola Smiljanic9fa54442014-07-09 05:34:24 +0000179 <DisplayString>{{ size={NumItems}, buckets={NumBuckets} }}</DisplayString>
Aaron Ballman948d0bd2013-01-25 23:37:25 +0000180 <Expand>
Nikola Smiljanic9fa54442014-07-09 05:34:24 +0000181 <Item Name="[size]">NumItems</Item>
Nikola Smiljanic958dbe12014-02-07 22:57:20 +0000182 <Item Name="[buckets]">NumBuckets</Item>
183 <ArrayItems>
Aaron Ballman948d0bd2013-01-25 23:37:25 +0000184 <Size>NumBuckets</Size>
Nikola Smiljanic958dbe12014-02-07 22:57:20 +0000185 <ValuePointer>(MapEntryTy**)TheTable</ValuePointer>
186 </ArrayItems>
Aaron Ballman948d0bd2013-01-25 23:37:25 +0000187 </Expand>
188 </Type>
189
190 <Type Name="llvm::StringMapEntry&lt;*&gt;">
191 <DisplayString Condition="StrLen == 0">empty</DisplayString>
Nikola Smiljanic958dbe12014-02-07 22:57:20 +0000192 <DisplayString Condition="StrLen != 0">({this+1,s}, {second})</DisplayString>
Aaron Ballman948d0bd2013-01-25 23:37:25 +0000193 <Expand>
Nikola Smiljanic958dbe12014-02-07 22:57:20 +0000194 <Item Name="[key]">this+1,s</Item>
Aaron Ballman948d0bd2013-01-25 23:37:25 +0000195 <Item Name="[value]" Condition="StrLen != 0">second</Item>
196 </Expand>
197 </Type>
198
199 <Type Name="llvm::Triple">
200 <DisplayString>{Data}</DisplayString>
201 </Type>
Aaron Ballmanf72eeaa2014-03-03 21:15:07 +0000202
203 <Type Name="llvm::Optional&lt;*&gt;">
Zachary Turner148e86f2018-06-28 17:55:54 +0000204 <DisplayString Condition="!Storage.hasVal">None</DisplayString>
205 <DisplayString Condition="Storage.hasVal">{*(($T1 *)(unsigned char *)Storage.storage.buffer)}</DisplayString>
Aaron Ballmanf72eeaa2014-03-03 21:15:07 +0000206 <Expand>
Zachary Turner148e86f2018-06-28 17:55:54 +0000207 <Item Name="[underlying]" Condition="Storage.hasVal">*(($T1 *)(unsigned char *)Storage.storage.buffer)</Item>
208 </Expand>
209 </Type>
210
211 <Type Name="llvm::Expected&lt;*&gt;">
212 <DisplayString Condition="HasError">Error</DisplayString>
213 <DisplayString Condition="!HasError">{*((storage_type *)TStorage.buffer)}</DisplayString>
214 <Expand>
215 <Item Name="[value]" Condition="!HasError">*((storage_type *)TStorage.buffer)</Item>
216 <Item Name="[error]" Condition="HasError">*((error_type *)ErrorStorage.buffer)</Item>
Aaron Ballmanf72eeaa2014-03-03 21:15:07 +0000217 </Expand>
218 </Type>
Zachary Turnerba2d1c02016-04-21 20:58:41 +0000219
Mike Spertus3e45d772016-06-05 18:34:02 +0000220
Zachary Turnerba2d1c02016-04-21 20:58:41 +0000221 <!-- Since we're in MSVC, we can assume that the system is little endian. Therefore
222 the little and native cases just require a cast. Handle this easy case first. Use
223 a wildcard for the second template argument (the endianness), but we will use a
224 specific value of 0 later on for the big endian to give it priority for being a
225 better match. -->
226 <Type Name="llvm::support::detail::packed_endian_specific_integral&lt;*,*,1&gt;">
227 <DisplayString>{{little endian value = {*(($T1*)(unsigned char *)Value.buffer)} }}</DisplayString>
228 <Expand>
229 <Item Name="[Raw Bytes]" Condition="sizeof($T1)==1">(unsigned char *)Value.buffer,1</Item>
230 <Item Name="[Raw Bytes]" Condition="sizeof($T1)==2">(unsigned char *)Value.buffer,2</Item>
231 <Item Name="[Raw Bytes]" Condition="sizeof($T1)==4">(unsigned char *)Value.buffer,4</Item>
232 <Item Name="[Raw Bytes]" Condition="sizeof($T1)==8">(unsigned char *)Value.buffer,8</Item>
233 </Expand>
234 </Type>
235
236 <!-- Now handle the hard case of big endian. We need to do the swizzling here, but
237 we need to specialize it based on the size of the value type. -->
238 <Type Name="llvm::support::detail::packed_endian_specific_integral&lt;*,0,1&gt;">
239 <DisplayString Condition="sizeof($T1)==1">{{ big endian value = {*(unsigned char *)Value.buffer} }}</DisplayString>
240 <DisplayString Condition="sizeof($T1)==2">{{ big endian value = {(($T1)(*(unsigned char *)Value.buffer) &lt;&lt; 8)
241 | ($T1)(*((unsigned char *)Value.buffer+1))} }}</DisplayString>
242 <DisplayString Condition="sizeof($T1)==4">{{ big endian value = {(($T1)(*(unsigned char *)Value.buffer) &lt;&lt; 24)
243 | (($T1)(*((unsigned char *)Value.buffer+1)) &lt;&lt; 16)
244 | (($T1)(*((unsigned char *)Value.buffer+2)) &lt;&lt; 8)
245 | ($T1)(*((unsigned char *)Value.buffer+3))} }}</DisplayString>
246 <DisplayString Condition="sizeof($T1)==8">{{ big endian value = {(($T1)(*(unsigned char *)Value.buffer) &lt;&lt; 56)
247 | (($T1)(*((unsigned char *)Value.buffer+1)) &lt;&lt; 48)
248 | (($T1)(*((unsigned char *)Value.buffer+2)) &lt;&lt; 40)
249 | (($T1)(*((unsigned char *)Value.buffer+3)) &lt;&lt; 32)
250 | (($T1)(*((unsigned char *)Value.buffer+4)) &lt;&lt; 24)
251 | (($T1)(*((unsigned char *)Value.buffer+5)) &lt;&lt; 16)
252 | (($T1)(*((unsigned char *)Value.buffer+6)) &lt;&lt; 8)
253 | ($T1)(*((unsigned char *)Value.buffer+7))} }}</DisplayString>
254 <Expand>
255 <Item Name="[Raw Bytes]" Condition="sizeof($T1)==1">(unsigned char *)Value.buffer,1</Item>
256 <Item Name="[Raw Bytes]" Condition="sizeof($T1)==2">(unsigned char *)Value.buffer,2</Item>
257 <Item Name="[Raw Bytes]" Condition="sizeof($T1)==4">(unsigned char *)Value.buffer,4</Item>
258 <Item Name="[Raw Bytes]" Condition="sizeof($T1)==8">(unsigned char *)Value.buffer,8</Item>
259 </Expand>
260 </Type>
Aaron Ballman948d0bd2013-01-25 23:37:25 +0000261</AutoVisualizer>