Add an example of accessing the impl storage to the 'DefiningAttributesAndTypes...
authorRiver Riddle <riverriddle@google.com>
Wed, 29 May 2019 20:23:47 +0000 (13:23 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Sun, 2 Jun 2019 03:07:51 +0000 (20:07 -0700)
--

PiperOrigin-RevId: 250553898

mlir/g3doc/DefiningAttributesAndTypes.md

index 22dec18..82399e3 100644 (file)
@@ -232,6 +232,18 @@ public:
     }
     return success();
   }
+
+  /// Return the parameter value.
+  unsigned getParameter() {
+    // 'getImpl' returns a pointer to our internal storage instance.
+    return getImpl()->nonZeroParam;
+  }
+
+  /// Return the integer parameter type.
+  IntegerType getParameterType() {
+    // 'getImpl' returns a pointer to our internal storage instance.
+    return getImpl()->integerType;
+  }
 };
 ```