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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun Feb 23 23:37:10 PST 2025


Author: Andrey Timonin
Date: 2025-02-24T08:37:06+01:00
New Revision: f89a986153a5907468f8f1f1e7f9f9bccfa4bb93

URL: https://github.com/llvm/llvm-project/commit/f89a986153a5907468f8f1f1e7f9f9bccfa4bb93
DIFF: https://github.com/llvm/llvm-project/commit/f89a986153a5907468f8f1f1e7f9f9bccfa4bb93.diff

LOG: [mlir][emitc][NFC] Add an example to the description of the emitc.verbatim operation (#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.

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/EmitC/IR/EmitC.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
index f58dd4125003a..a518e7425956c 100644
--- a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
+++ b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
@@ -1289,6 +1289,18 @@ def EmitC_VerbatimOp : EmitC_Op<"verbatim"> {
     `%dest` became `b` in the C code.
     `{{` in the format string is interpreted as a single `{` and doesn't introduce
     a placeholder.
+
+    Example:
+
+    ```mlir
+    emitc.verbatim "typedef float f32;"
+    emitc.verbatim "#pragma my var={} property" args %arg : f32
+    ```
+    ```c++
+    // Code emitted for the operation above.
+    typedef float f32;
+    #pragma my var=v1 property
+    ```
   }];
 
   let extraClassDeclaration = [{


        


More information about the Mlir-commits mailing list