Skip to content

Commit d578dbf

Browse files
EtoAndruwamarbre
andauthored
[mlir][emitc][NFC] Add type clarification to the description for the emitc.global op (#127997)
Co-authored-by: Marius Brehler <marius.brehler@gmail.com>
1 parent d2b3912 commit d578dbf

File tree

1 file changed

+4
-2
lines changed
  • mlir/include/mlir/Dialect/EmitC/IR

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,8 +1172,8 @@ def EmitC_GlobalOp : EmitC_Op<"global", [Symbol]> {
11721172
let summary = "A global variable";
11731173
let description = [{
11741174
The `emitc.global` operation declares or defines a named global variable.
1175-
The backing memory for the variable is allocated statically and is
1176-
described by the type of the variable.
1175+
The backing memory for the variable is allocated statically and described by
1176+
the variable's type, which must be an EmitC type.
11771177
Optionally, an `initial_value` can be provided.
11781178
Internal linkage can be specified using the `static_specifier` unit attribute
11791179
and external linkage can be specified using the `extern_specifier` unit attribute.
@@ -1193,6 +1193,8 @@ def EmitC_GlobalOp : EmitC_Op<"global", [Symbol]> {
11931193
emitc.global @x : !emitc.array<2xf32> = dense<0.0>
11941194
// Global variable with an initial values.
11951195
emitc.global @x : !emitc.array<3xi32> = dense<[0, 1, 2]>
1196+
// Global variable with an opaque initial value.
1197+
emitc.global @x : !emitc.opaque<"char"> = #emitc.opaque<"CHAR_MIN">
11961198
// External global variable
11971199
emitc.global extern @x : !emitc.array<2xf32>
11981200
// Constant global variable with internal linkage

0 commit comments

Comments
 (0)