[clang] 1187740 - [CIR][NFC] Clean up constant op comments (#162142)

via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 7 01:13:39 PDT 2025


Author: Henrich Lauko
Date: 2025-10-07T10:13:34+02:00
New Revision: 11877408c2e0e467ab3424bd970d5fb2f91d2174

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

LOG: [CIR][NFC] Clean up constant op comments (#162142)

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td
index d4ffcf3a75f50..addc37857bfcd 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIROps.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td
@@ -278,22 +278,22 @@ def CIR_PtrStrideOp : CIR_Op<"ptr_stride", [
 def CIR_ConstantOp : CIR_Op<"const", [
   ConstantLike, Pure, AllTypesMatch<["value", "res"]>
 ]> {
-  let summary = "Defines a CIR constant";
+  let summary = "Create a CIR constant from a literal attribute";
   let description = [{
     The `cir.const` operation turns a literal into an SSA value. The data is
     attached to the operation as an attribute.
 
     ```mlir
-      %0 = cir.const 42 : i32
-      %1 = cir.const 4.2 : f32
-      %2 = cir.const nullptr : !cir.ptr<i32>
+      %0 = cir.const #cir.int<4> : !u32i
+      %1 = cir.const #cir.fp<1.500000e+00> : !cir.float
+      %2 = cir.const #cir.ptr<null> : !cir.ptr<!void>
     ```
   }];
 
   let arguments = (ins TypedAttrInterface:$value);
   let results = (outs CIR_AnyType:$res);
 
-  let assemblyFormat = "attr-dict $value";
+  let assemblyFormat = "$value attr-dict";
 
   let hasVerifier = 1;
 


        


More information about the cfe-commits mailing list