[Mlir-commits] [mlir] [mlir][emitc][NFC] Add an example to the description of the emitc.verbatim operation (PR #128004)

Andrey Timonin llvmlistbot at llvm.org
Thu Feb 20 05:02:09 PST 2025


https://github.com/EtoAndruwa created https://github.com/llvm/llvm-project/pull/128004

The official page provides an explanation of the **new** functionality of `emitc.verbatim`, but a classic example in the `.td` file for this operation is still missing.

>From cabdac5e57034fed8f88aa890435b00728b7ee19 Mon Sep 17 00:00:00 2001
From: EtoAndruwa <timonina1909 at gmail.com>
Date: Thu, 20 Feb 2025 15:47:02 +0300
Subject: [PATCH] [mlir][emitc][NFC] Add an example to the description of the
 emitc.verbatim operation

---
 mlir/include/mlir/Dialect/EmitC/IR/EmitC.td | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
index 4fbce995ce5b8..d0627992d0c7b 100644
--- a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
+++ b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
@@ -1222,6 +1222,13 @@ def EmitC_VerbatimOp : EmitC_Op<"verbatim"> {
     }
     #endif
     ```
+
+    Example:
+
+    ```mlir
+    emitc.verbatim "typedef float f32;"
+    emitc.verbatim "#pragma my var={} property" args %arg : f32
+    ```
   }];
 
   let arguments = (ins StrAttr:$value);



More information about the Mlir-commits mailing list