Skip to content

Commit f89a986

Browse files
authored
[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.
1 parent 6b5bde6 commit f89a986

File tree

1 file changed

+12
-0
lines changed
  • mlir/include/mlir/Dialect/EmitC/IR

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,6 +1289,18 @@ def EmitC_VerbatimOp : EmitC_Op<"verbatim"> {
12891289
`%dest` became `b` in the C code.
12901290
`{{` in the format string is interpreted as a single `{` and doesn't introduce
12911291
a placeholder.
1292+
1293+
Example:
1294+
1295+
```mlir
1296+
emitc.verbatim "typedef float f32;"
1297+
emitc.verbatim "#pragma my var={} property" args %arg : f32
1298+
```
1299+
```c++
1300+
// Code emitted for the operation above.
1301+
typedef float f32;
1302+
#pragma my var=v1 property
1303+
```
12921304
}];
12931305

12941306
let extraClassDeclaration = [{

0 commit comments

Comments
 (0)