From c455ecef22960f7a6d5a44917d86fb1733736f98 Mon Sep 17 00:00:00 2001 From: River Riddle Date: Wed, 29 May 2019 13:23:47 -0700 Subject: [PATCH] Add an example of accessing the impl storage to the 'DefiningAttributesAndTypes' document. -- PiperOrigin-RevId: 250553898 --- mlir/g3doc/DefiningAttributesAndTypes.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mlir/g3doc/DefiningAttributesAndTypes.md b/mlir/g3doc/DefiningAttributesAndTypes.md index 22dec18..82399e3 100644 --- a/mlir/g3doc/DefiningAttributesAndTypes.md +++ b/mlir/g3doc/DefiningAttributesAndTypes.md @@ -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; + } }; ``` -- 2.7.4