Add a mlir natvis file for debugging with Visual Studio
authorKirsten Lee <kile@microsoft.com>
Fri, 23 Oct 2020 21:14:53 +0000 (14:14 -0700)
committerAaron Smith <aaron.smith@microsoft.com>
Fri, 23 Oct 2020 21:15:01 +0000 (14:15 -0700)
Differential Revision: https://reviews.llvm.org/D89601

mlir/utils/MLIRVisualizers/mlir.natvis [new file with mode: 0644]

diff --git a/mlir/utils/MLIRVisualizers/mlir.natvis b/mlir/utils/MLIRVisualizers/mlir.natvis
new file mode 100644 (file)
index 0000000..49332f3
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
+  <Type Name="mlir::detail::StorageUserBase&lt;*&gt;">
+    <!--handles mlir::Type-->
+    <DisplayString>{"$T3"}</DisplayString>
+    <Expand>
+      <ExpandedItem>($T3*)impl</ExpandedItem>
+    </Expand>
+  </Type>
+
+  <Type Name="mlir::Value">
+    <DisplayString>{ownerAndKind}</DisplayString>
+    <Expand>
+      <Item Name="OpResult" Condition=
+            "((ownerAndKind.Value &gt;&gt; ImplType::InfoTy::IntShift) &amp; ImplType::InfoTy::IntMask) &lt; mlir::Value::Kind::TrailingOpResult">
+        (Operation*)(ImplType::InfoTy::PointerBitMask &amp; ownerAndKind.Value)
+      </Item>
+      <Item Name="TrailingOpResult" Condition=
+            "((ownerAndKind.Value &gt;&gt; ImplType::InfoTy::IntShift) &amp; ImplType::InfoTy::IntMask) == mlir::Value::Kind::TrailingOpResult">
+        (detail::TrailingOpResult*)(ImplType::InfoTy::PointerBitMask &amp; ownerAndKind.Value)
+      </Item>
+      <Item Name="BlockArgument" Condition=
+            "((ownerAndKind.Value &gt;&gt; ImplType::InfoTy::IntShift) &amp; ImplType::InfoTy::IntMask) == mlir::Value::Kind::BlockArgument">
+        (detail::BlockArgumentImpl*)(ImplType::InfoTy::PointerBitMask &amp; ownerAndKind.Value)
+      </Item>
+      <Item Name="ownerAndKind">ownerAndKind</Item>
+    </Expand>
+  </Type>
+
+  <Type Name="mlir::Location">
+    <Expand>
+      <ExpandedItem >(LocationAttr)impl</ExpandedItem>
+    </Expand>
+  </Type>
+</AutoVisualizer>
+