Skip to content

Commit 01d4495

Browse files
committed
[CIR][NFC] Clean up constant op comments
1 parent c1df45c commit 01d4495

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

clang/include/clang/CIR/Dialect/IR/CIROps.td

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -473,28 +473,23 @@ def CIR_PtrStrideOp : CIR_Op<"ptr_stride",[
473473
def CIR_ConstantOp : CIR_Op<"const",[
474474
ConstantLike, Pure, AllTypesMatch<["value", "res"]>
475475
]> {
476-
// FIXME: Use SameOperandsAndResultType or similar and prevent eye bleeding
477-
// type repetition in the assembly form.
478-
479-
let summary = "Defines a CIR constant";
476+
let summary = "Create a CIR constant from a literal attribute";
480477
let description = [{
481478
The `cir.const` operation turns a literal into an SSA value. The data is
482479
attached to the operation as an attribute.
483480

484481
```mlir
485-
%0 = cir.const 42 : i32
486-
%1 = cir.const 4.2 : f32
487-
%2 = cir.const nullptr : !cir.ptr<i32>
482+
%0 = cir.const #cir.int<4> : !u32i
483+
%1 = cir.const #cir.fp<1.500000e+00> : !cir.float
484+
%2 = cir.const #cir.ptr<null> : !cir.ptr<!void>
488485
```
489486
}];
490487

491-
// The constant operation takes an attribute as the only input.
492488
let arguments = (ins TypedAttrInterface:$value);
493489

494-
// The constant operation returns a single value of CIR_AnyType.
495490
let results = (outs CIR_AnyType:$res);
496491

497-
let assemblyFormat = "attr-dict $value";
492+
let assemblyFormat = "$value attr-dict";
498493

499494
let hasVerifier = 1;
500495

0 commit comments

Comments
 (0)