Skip to content

[mlir][emitc][NFC] Add type clarification to the description for the emitc.global op #127997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
Original file line number Diff line number Diff line change
Expand Up @@ -1126,8 +1126,8 @@ def EmitC_GlobalOp : EmitC_Op<"global", [Symbol]> {
let summary = "A global variable";
let description = [{
The `emitc.global` operation declares or defines a named global variable.
The backing memory for the variable is allocated statically and is
described by the type of the variable.
The backing memory for the variable is allocated statically and described by
the variable's type, which must be an EmitC type.
Optionally, an `initial_value` can be provided.
Internal linkage can be specified using the `static_specifier` unit attribute
and external linkage can be specified using the `extern_specifier` unit attribute.
Expand All @@ -1147,6 +1147,8 @@ def EmitC_GlobalOp : EmitC_Op<"global", [Symbol]> {
emitc.global @x : !emitc.array<2xf32> = dense<0.0>
// Global variable with an initial values.
emitc.global @x : !emitc.array<3xi32> = dense<[0, 1, 2]>
// Global variable with an opaque initial value.
emitc.global @x : !emitc.opaque<"char"> = #emitc.opaque<"CHAR_MIN">
// External global variable
emitc.global extern @x : !emitc.array<2xf32>
// Constant global variable with internal linkage
Expand Down
Loading