tint: update natvis
Change-Id: Icf31f70c3c6bf09611938847a8fb537d3fdad7c0 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105660 Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
parent
c1e8622fdd
commit
840e42477d
|
@ -16,6 +16,11 @@
|
|||
-->
|
||||
|
||||
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
|
||||
|
||||
<!--=================================================================-->
|
||||
<!-- utils -->
|
||||
<!--=================================================================-->
|
||||
|
||||
<Type Name="tint::utils::Slice<*>">
|
||||
<DisplayString>{{ length={len}, capacity={cap} }}</DisplayString>
|
||||
<Expand>
|
||||
|
@ -29,10 +34,15 @@
|
|||
</Type>
|
||||
|
||||
<Type Name="tint::utils::Vector<*,*>">
|
||||
<Intrinsic Name="Length" Expression="(size_t)(impl_.slice.len)" />
|
||||
<Expand>
|
||||
<Item Name="[heap]">impl_.slice.cap > (int)$T2</Item>
|
||||
<ExpandedItem>impl_.slice</ExpandedItem>
|
||||
<!--<ExpandedItem>impl_.slice</ExpandedItem>-->
|
||||
<!--<Item Name="[slice]">impl_.slice</Item>-->
|
||||
<ArrayItems>
|
||||
<Size>Length()</Size>
|
||||
<ValuePointer>impl_.slice.data</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
|
@ -49,6 +59,10 @@
|
|||
<DisplayString Optional="true">{debug_name_,sb}</DisplayString>
|
||||
</Type>
|
||||
|
||||
<!--=================================================================-->
|
||||
<!-- ast -->
|
||||
<!--=================================================================-->
|
||||
|
||||
<Type Name="tint::ast::AssignmentStatement">
|
||||
<DisplayString>{*lhs} = {*rhs};</DisplayString>
|
||||
<Expand>
|
||||
|
@ -58,11 +72,8 @@
|
|||
</Type>
|
||||
|
||||
<Type Name="tint::ast::IfStatement">
|
||||
<DisplayString Condition="else_statements.size() == 0">if ({*condition}) {*body}</DisplayString>
|
||||
<DisplayString Condition="else_statements.size() == 1">if ({*condition}) {*body} {*else_statements[0]} </DisplayString>
|
||||
<DisplayString Condition="else_statements.size() == 2">if ({*condition}) {*body} {*else_statements[0]} {*else_statements[1]} </DisplayString>
|
||||
<DisplayString Condition="else_statements.size() == 3">if ({*condition}) {*body} {*else_statements[0]} {*else_statements[1]} {*else_statements[2]}</DisplayString>
|
||||
<DisplayString Condition="else_statements.size() > 3">if ({*condition}) {*body} {*else_statements[0]} {*else_statements[1]} {*else_statements[2]} else {else_statements.size()-3} more...</DisplayString>
|
||||
<DisplayString Condition="!else_statement">if ({*condition}) {*body}</DisplayString>
|
||||
<DisplayString Condition="else_statement">if ({*condition}) {*body} else { *else_statement }</DisplayString>
|
||||
</Type>
|
||||
|
||||
<Type Name="tint::ast::ElseStatement">
|
||||
|
@ -71,10 +82,10 @@
|
|||
</Type>
|
||||
|
||||
<Type Name="tint::ast::BlockStatement">
|
||||
<DisplayString Condition="statements.size() == 1">{{ {*statements[0]} }} </DisplayString>
|
||||
<DisplayString Condition="statements.size() == 2">{{ {*statements[0]} {*statements[1]} }} </DisplayString>
|
||||
<DisplayString Condition="statements.size() == 3">{{ {*statements[0]} {*statements[1]} {*statements[2]} }} </DisplayString>
|
||||
<DisplayString Condition="statements.size() > 3">{{ {*statements[0]} {*statements[1]} {*statements[2]} {statements.size()-3} more... }} </DisplayString>
|
||||
<DisplayString Condition="statements.Length() == 1">{{ {*statements[0]} }} </DisplayString>
|
||||
<DisplayString Condition="statements.Length() == 2">{{ {*statements[0]} {*statements[1]} }} </DisplayString>
|
||||
<DisplayString Condition="statements.Length() == 3">{{ {*statements[0]} {*statements[1]} {*statements[2]} }} </DisplayString>
|
||||
<DisplayString Condition="statements.Length() > 3">{{ {*statements[0]} {*statements[1]} {*statements[2]} {statements.Length()-3} more... }} </DisplayString>
|
||||
</Type>
|
||||
|
||||
<Type Name="tint::ast::ReturnStatement">
|
||||
|
@ -114,15 +125,16 @@
|
|||
</Expand>
|
||||
</Type>
|
||||
|
||||
<Type Name="tint::ast::Variable">
|
||||
<!-- Hack: we can deduce that this variable is a parameter if it's const with a type but no constructor, which is illegal for a let -->
|
||||
<DisplayString Condition=" is_const & !!type & !constructor">{symbol} : {*type}</DisplayString>
|
||||
<Type Name="tint::ast::Let">
|
||||
<DisplayString Condition="!!type">let {symbol} : {*type} = {*constructor}</DisplayString>
|
||||
<DisplayString Condition=" !type">let {symbol} = {*constructor}</DisplayString>
|
||||
</Type>
|
||||
|
||||
<DisplayString Condition=" is_const & !!type & !!constructor">let {symbol} : {*type} = {*constructor}</DisplayString>
|
||||
<DisplayString Condition=" is_const & !type & !constructor">let {symbol} = {*constructor}</DisplayString>
|
||||
<DisplayString Condition="!is_const & !!type & !!constructor">var {symbol} : {*type} = {*constructor}</DisplayString>
|
||||
<DisplayString Condition="!is_const & !type & !!constructor">var {symbol} = {*constructor}</DisplayString>
|
||||
<DisplayString Condition="!is_const & !!type & !constructor">var {symbol}</DisplayString>
|
||||
<Type Name="tint::ast::Variable">
|
||||
<DisplayString Condition="!!type & !!constructor">var {symbol} : {*type} = {*constructor}</DisplayString>
|
||||
<DisplayString Condition="!!type & !constructor">var {symbol} : {*type}</DisplayString>
|
||||
<DisplayString Condition=" !type & !!constructor">var {symbol} = {*constructor}</DisplayString>
|
||||
<DisplayString Condition=" !type & !constructor">var {symbol}</DisplayString>
|
||||
</Type>
|
||||
|
||||
<Type Name="tint::ast::VariableDeclStatement">
|
||||
|
@ -142,11 +154,11 @@
|
|||
</Type>
|
||||
|
||||
<Type Name="tint::ast::UnaryOpExpression">
|
||||
<DisplayString Condition="op==tint::ast::UnaryOp::kAddressOf">&({expr})</DisplayString>
|
||||
<DisplayString Condition="op==tint::ast::UnaryOp::kComplement">~({expr})</DisplayString>
|
||||
<DisplayString Condition="op==tint::ast::UnaryOp::kIndirection">*({expr})</DisplayString>
|
||||
<DisplayString Condition="op==tint::ast::UnaryOp::kNegation">-({expr})</DisplayString>
|
||||
<DisplayString Condition="op==tint::ast::UnaryOp::kNot">!({expr})</DisplayString>
|
||||
<DisplayString Condition="op==tint::ast::UnaryOp::kAddressOf">&({*expr})</DisplayString>
|
||||
<DisplayString Condition="op==tint::ast::UnaryOp::kComplement">~({*expr})</DisplayString>
|
||||
<DisplayString Condition="op==tint::ast::UnaryOp::kIndirection">*({*expr})</DisplayString>
|
||||
<DisplayString Condition="op==tint::ast::UnaryOp::kNegation">-({*expr})</DisplayString>
|
||||
<DisplayString Condition="op==tint::ast::UnaryOp::kNot">!({*expr})</DisplayString>
|
||||
</Type>
|
||||
|
||||
<Type Name="tint::ast::BinaryExpression">
|
||||
|
@ -172,11 +184,12 @@
|
|||
</Type>
|
||||
|
||||
<Type Name="tint::ast::CallExpression">
|
||||
<DisplayString Condition="args.size() == 0">{target}()</DisplayString>
|
||||
<DisplayString Condition="args.size() == 1">{target}({*args[0]})</DisplayString>
|
||||
<DisplayString Condition="args.size() == 2">{target}({*args[0]}, {*args[1]})</DisplayString>
|
||||
<DisplayString Condition="args.size() == 3">{target}({*args[0]}, {*args[1]}, {*args[2]})</DisplayString>
|
||||
<DisplayString Condition="args.size() > 3">{target}({*args[0]}, {*args[1]}, {*args[2]}, {args.size()-3} more...)</DisplayString>
|
||||
<DisplayString Condition="args.Length() == 0">{target}()</DisplayString>
|
||||
<DisplayString Condition="args.Length() == 1">{target}({*args[0]})</DisplayString>
|
||||
<DisplayString Condition="args.Length() == 2">{target}({*args[0]}, {*args[1]})</DisplayString>
|
||||
<DisplayString Condition="args.Length() == 3">{target}({*args[0]}, {*args[1]}, {*args[2]})</DisplayString>
|
||||
<DisplayString Condition="args.Length() == 4">{target}({*args[0]}, {*args[1]}, {*args[2]}, {*args[3]})</DisplayString>
|
||||
<DisplayString Condition="args.Length() > 4">{target}({*args[0]}, {*args[1]}, {*args[2]}, {args.Length()-3} more...)</DisplayString>
|
||||
<!-- TODO: add more overloads -->
|
||||
</Type>
|
||||
|
||||
|
@ -190,6 +203,15 @@
|
|||
<DisplayString Condition="count == nullptr">array<{*type}></DisplayString>
|
||||
</Type>
|
||||
|
||||
<Type Name="tint::ast::Vector">
|
||||
<DisplayString Condition="width==2 & !type">vec2</DisplayString>
|
||||
<DisplayString Condition="width==3 & !type">vec3</DisplayString>
|
||||
<DisplayString Condition="width==4 & !type">vec4</DisplayString>
|
||||
<DisplayString Condition="width==2 & !!type">vec2<{*type}></DisplayString>
|
||||
<DisplayString Condition="width==3 & !!type">vec3<{*type}></DisplayString>
|
||||
<DisplayString Condition="width==4 & !!type">vec4<{*type}></DisplayString>
|
||||
</Type>
|
||||
|
||||
<Type Name="tint::ast::TypeName">
|
||||
<DisplayString>{name}</DisplayString>
|
||||
</Type>
|
||||
|
@ -210,4 +232,36 @@
|
|||
<DisplayString>f32</DisplayString>
|
||||
</Type>
|
||||
|
||||
<!--=================================================================-->
|
||||
<!-- sem -->
|
||||
<!--=================================================================-->
|
||||
|
||||
<Type Name="tint::sem::AbstractInt">
|
||||
<DisplayString>AbstractInt</DisplayString>
|
||||
</Type>
|
||||
|
||||
<Type Name="tint::sem::AbstractFloat">
|
||||
<DisplayString>AbstractFloat</DisplayString>
|
||||
</Type>
|
||||
|
||||
<Type Name="tint::sem::Bool">
|
||||
<DisplayString>bool</DisplayString>
|
||||
</Type>
|
||||
|
||||
<Type Name="tint::sem::F32">
|
||||
<DisplayString>f32</DisplayString>
|
||||
</Type>
|
||||
|
||||
<Type Name="tint::sem::Vector">
|
||||
<DisplayString>vec{width_}<{*subtype_}></DisplayString>
|
||||
</Type>
|
||||
|
||||
<Type Name="tint::sem::Constant">
|
||||
<DisplayString>Type={*Type()} Value={Value()}</DisplayString>
|
||||
</Type>
|
||||
|
||||
<Type Name="tint::sem::Expression">
|
||||
<DisplayString>Decl={*declaration_}</DisplayString>
|
||||
</Type>
|
||||
|
||||
</AutoVisualizer>
|
||||
|
|
Loading…
Reference in New Issue