Skip to content

Commit b919d62

Browse files
authored
[MLIR][Python] Forward the name of MLIR types to Python side (#174700)
In this PR, I added a C API for each (upstream) MLIR type to retrieve its type name (for example, `IntegerType` -> `mlirIntegerTypeGetName()` -> `"builtin.integer"`), and exposed a corresponding `type_name` class attribute in the Python bindings (e.g., `IntegerType.type_name` -> `"builtin.integer"`). This can be used in various places to avoid hard-coded strings, such as eliminating the manual string in `irdl.base("!builtin.integer")`. Note that parts of this PR (mainly mechanical changes) were produced via GitHub Copilot and GPT-5.2. I have manually reviewed the changes and verified them with tests to ensure correctness.
1 parent eb13822 commit b919d62

31 files changed

Lines changed: 451 additions & 0 deletions

mlir/include/mlir-c/BuiltinTypes.h

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAInteger(MlirType type);
3333
MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeGet(MlirContext ctx,
3434
unsigned bitwidth);
3535

36+
MLIR_CAPI_EXPORTED MlirStringRef mlirIntegerTypeGetName(void);
37+
3638
/// Creates a signed integer type of the given bitwidth in the context. The type
3739
/// is owned by the context.
3840
MLIR_CAPI_EXPORTED MlirType mlirIntegerTypeSignedGet(MlirContext ctx,
@@ -69,6 +71,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAIndex(MlirType type);
6971
/// context.
7072
MLIR_CAPI_EXPORTED MlirType mlirIndexTypeGet(MlirContext ctx);
7173

74+
MLIR_CAPI_EXPORTED MlirStringRef mlirIndexTypeGetName(void);
75+
7276
//===----------------------------------------------------------------------===//
7377
// Floating-point types.
7478
//===----------------------------------------------------------------------===//
@@ -89,6 +93,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat4E2M1FN(MlirType type);
8993
/// context.
9094
MLIR_CAPI_EXPORTED MlirType mlirFloat4E2M1FNTypeGet(MlirContext ctx);
9195

96+
MLIR_CAPI_EXPORTED MlirStringRef mlirFloat4E2M1FNTypeGetName(void);
97+
9298
/// Returns the typeID of an Float6E2M3FN type.
9399
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat6E2M3FNTypeGetTypeID(void);
94100

@@ -99,6 +105,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat6E2M3FN(MlirType type);
99105
/// context.
100106
MLIR_CAPI_EXPORTED MlirType mlirFloat6E2M3FNTypeGet(MlirContext ctx);
101107

108+
MLIR_CAPI_EXPORTED MlirStringRef mlirFloat6E2M3FNTypeGetName(void);
109+
102110
/// Returns the typeID of an Float6E3M2FN type.
103111
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat6E3M2FNTypeGetTypeID(void);
104112

@@ -109,6 +117,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat6E3M2FN(MlirType type);
109117
/// context.
110118
MLIR_CAPI_EXPORTED MlirType mlirFloat6E3M2FNTypeGet(MlirContext ctx);
111119

120+
MLIR_CAPI_EXPORTED MlirStringRef mlirFloat6E3M2FNTypeGetName(void);
121+
112122
/// Returns the typeID of an Float8E5M2 type.
113123
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E5M2TypeGetTypeID(void);
114124

@@ -119,6 +129,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E5M2(MlirType type);
119129
/// context.
120130
MLIR_CAPI_EXPORTED MlirType mlirFloat8E5M2TypeGet(MlirContext ctx);
121131

132+
MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E5M2TypeGetName(void);
133+
122134
/// Returns the typeID of an Float8E4M3 type.
123135
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3TypeGetTypeID(void);
124136

@@ -129,6 +141,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E4M3(MlirType type);
129141
/// context.
130142
MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3TypeGet(MlirContext ctx);
131143

144+
MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E4M3TypeGetName(void);
145+
132146
/// Returns the typeID of an Float8E4M3FN type.
133147
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3FNTypeGetTypeID(void);
134148

@@ -139,6 +153,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E4M3FN(MlirType type);
139153
/// context.
140154
MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3FNTypeGet(MlirContext ctx);
141155

156+
MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E4M3FNTypeGetName(void);
157+
142158
/// Returns the typeID of an Float8E5M2FNUZ type.
143159
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E5M2FNUZTypeGetTypeID(void);
144160

@@ -149,6 +165,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E5M2FNUZ(MlirType type);
149165
/// context.
150166
MLIR_CAPI_EXPORTED MlirType mlirFloat8E5M2FNUZTypeGet(MlirContext ctx);
151167

168+
MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E5M2FNUZTypeGetName(void);
169+
152170
/// Returns the typeID of an Float8E4M3FNUZ type.
153171
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3FNUZTypeGetTypeID(void);
154172

@@ -159,6 +177,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E4M3FNUZ(MlirType type);
159177
/// context.
160178
MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3FNUZTypeGet(MlirContext ctx);
161179

180+
MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E4M3FNUZTypeGetName(void);
181+
162182
/// Returns the typeID of an Float8E4M3B11FNUZ type.
163183
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E4M3B11FNUZTypeGetTypeID(void);
164184

@@ -169,6 +189,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E4M3B11FNUZ(MlirType type);
169189
/// context.
170190
MLIR_CAPI_EXPORTED MlirType mlirFloat8E4M3B11FNUZTypeGet(MlirContext ctx);
171191

192+
MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E4M3B11FNUZTypeGetName(void);
193+
172194
/// Returns the typeID of an Float8E3M4 type.
173195
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E3M4TypeGetTypeID(void);
174196

@@ -179,6 +201,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E3M4(MlirType type);
179201
/// context.
180202
MLIR_CAPI_EXPORTED MlirType mlirFloat8E3M4TypeGet(MlirContext ctx);
181203

204+
MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E3M4TypeGetName(void);
205+
182206
/// Returns the typeID of an Float8E8M0FNU type.
183207
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat8E8M0FNUTypeGetTypeID(void);
184208

@@ -189,6 +213,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAFloat8E8M0FNU(MlirType type);
189213
/// context.
190214
MLIR_CAPI_EXPORTED MlirType mlirFloat8E8M0FNUTypeGet(MlirContext ctx);
191215

216+
MLIR_CAPI_EXPORTED MlirStringRef mlirFloat8E8M0FNUTypeGetName(void);
217+
192218
/// Returns the typeID of an BFloat16 type.
193219
MLIR_CAPI_EXPORTED MlirTypeID mlirBFloat16TypeGetTypeID(void);
194220

@@ -199,6 +225,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsABF16(MlirType type);
199225
/// context.
200226
MLIR_CAPI_EXPORTED MlirType mlirBF16TypeGet(MlirContext ctx);
201227

228+
MLIR_CAPI_EXPORTED MlirStringRef mlirBF16TypeGetName(void);
229+
202230
/// Returns the typeID of an Float16 type.
203231
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat16TypeGetTypeID(void);
204232

@@ -209,6 +237,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAF16(MlirType type);
209237
/// context.
210238
MLIR_CAPI_EXPORTED MlirType mlirF16TypeGet(MlirContext ctx);
211239

240+
MLIR_CAPI_EXPORTED MlirStringRef mlirF16TypeGetName(void);
241+
212242
/// Returns the typeID of an Float32 type.
213243
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat32TypeGetTypeID(void);
214244

@@ -219,6 +249,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAF32(MlirType type);
219249
/// context.
220250
MLIR_CAPI_EXPORTED MlirType mlirF32TypeGet(MlirContext ctx);
221251

252+
MLIR_CAPI_EXPORTED MlirStringRef mlirF32TypeGetName(void);
253+
222254
/// Returns the typeID of an Float64 type.
223255
MLIR_CAPI_EXPORTED MlirTypeID mlirFloat64TypeGetTypeID(void);
224256

@@ -229,6 +261,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAF64(MlirType type);
229261
/// context.
230262
MLIR_CAPI_EXPORTED MlirType mlirF64TypeGet(MlirContext ctx);
231263

264+
MLIR_CAPI_EXPORTED MlirStringRef mlirF64TypeGetName(void);
265+
232266
/// Returns the typeID of a TF32 type.
233267
MLIR_CAPI_EXPORTED MlirTypeID mlirFloatTF32TypeGetTypeID(void);
234268

@@ -239,6 +273,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsATF32(MlirType type);
239273
/// context.
240274
MLIR_CAPI_EXPORTED MlirType mlirTF32TypeGet(MlirContext ctx);
241275

276+
MLIR_CAPI_EXPORTED MlirStringRef mlirTF32TypeGetName(void);
277+
242278
//===----------------------------------------------------------------------===//
243279
// None type.
244280
//===----------------------------------------------------------------------===//
@@ -253,6 +289,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsANone(MlirType type);
253289
/// context.
254290
MLIR_CAPI_EXPORTED MlirType mlirNoneTypeGet(MlirContext ctx);
255291

292+
MLIR_CAPI_EXPORTED MlirStringRef mlirNoneTypeGetName(void);
293+
256294
//===----------------------------------------------------------------------===//
257295
// Complex type.
258296
//===----------------------------------------------------------------------===//
@@ -267,6 +305,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAComplex(MlirType type);
267305
/// the element type. The type is owned by the context.
268306
MLIR_CAPI_EXPORTED MlirType mlirComplexTypeGet(MlirType elementType);
269307

308+
MLIR_CAPI_EXPORTED MlirStringRef mlirComplexTypeGetName(void);
309+
270310
/// Returns the element type of the given complex type.
271311
MLIR_CAPI_EXPORTED MlirType mlirComplexTypeGetElementType(MlirType type);
272312

@@ -341,6 +381,8 @@ MLIR_CAPI_EXPORTED MlirType mlirVectorTypeGet(intptr_t rank,
341381
const int64_t *shape,
342382
MlirType elementType);
343383

384+
MLIR_CAPI_EXPORTED MlirStringRef mlirVectorTypeGetName(void);
385+
344386
/// Same as "mlirVectorTypeGet" but returns a nullptr wrapping MlirType on
345387
/// illegal arguments, emitting appropriate diagnostics.
346388
MLIR_CAPI_EXPORTED MlirType mlirVectorTypeGetChecked(MlirLocation loc,
@@ -402,6 +444,8 @@ MLIR_CAPI_EXPORTED MlirType mlirRankedTensorTypeGet(intptr_t rank,
402444
MlirType elementType,
403445
MlirAttribute encoding);
404446

447+
MLIR_CAPI_EXPORTED MlirStringRef mlirRankedTensorTypeGetName(void);
448+
405449
/// Same as "mlirRankedTensorTypeGet" but returns a nullptr wrapping MlirType on
406450
/// illegal arguments, emitting appropriate diagnostics.
407451
MLIR_CAPI_EXPORTED MlirType mlirRankedTensorTypeGetChecked(
@@ -416,6 +460,8 @@ MLIR_CAPI_EXPORTED MlirAttribute mlirRankedTensorTypeGetEncoding(MlirType type);
416460
/// context as the element type. The type is owned by the context.
417461
MLIR_CAPI_EXPORTED MlirType mlirUnrankedTensorTypeGet(MlirType elementType);
418462

463+
MLIR_CAPI_EXPORTED MlirStringRef mlirUnrankedTensorTypeGetName(void);
464+
419465
/// Same as "mlirUnrankedTensorTypeGet" but returns a nullptr wrapping MlirType
420466
/// on illegal arguments, emitting appropriate diagnostics.
421467
MLIR_CAPI_EXPORTED MlirType
@@ -446,6 +492,8 @@ MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeGet(MlirType elementType,
446492
MlirAttribute layout,
447493
MlirAttribute memorySpace);
448494

495+
MLIR_CAPI_EXPORTED MlirStringRef mlirMemRefTypeGetName(void);
496+
449497
/// Same as "mlirMemRefTypeGet" but returns a nullptr-wrapping MlirType o
450498
/// illegal arguments, emitting appropriate diagnostics.
451499
MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeGetChecked(
@@ -471,6 +519,8 @@ MLIR_CAPI_EXPORTED MlirType mlirMemRefTypeContiguousGetChecked(
471519
MLIR_CAPI_EXPORTED MlirType
472520
mlirUnrankedMemRefTypeGet(MlirType elementType, MlirAttribute memorySpace);
473521

522+
MLIR_CAPI_EXPORTED MlirStringRef mlirUnrankedMemRefTypeGetName(void);
523+
474524
/// Same as "mlirUnrankedMemRefTypeGet" but returns a nullptr wrapping
475525
/// MlirType on illegal arguments, emitting appropriate diagnostics.
476526
MLIR_CAPI_EXPORTED MlirType mlirUnrankedMemRefTypeGetChecked(
@@ -511,6 +561,8 @@ MLIR_CAPI_EXPORTED MlirType mlirTupleTypeGet(MlirContext ctx,
511561
intptr_t numElements,
512562
MlirType const *elements);
513563

564+
MLIR_CAPI_EXPORTED MlirStringRef mlirTupleTypeGetName(void);
565+
514566
/// Returns the number of types contained in a tuple.
515567
MLIR_CAPI_EXPORTED intptr_t mlirTupleTypeGetNumTypes(MlirType type);
516568

@@ -534,6 +586,8 @@ MLIR_CAPI_EXPORTED MlirType mlirFunctionTypeGet(MlirContext ctx,
534586
intptr_t numResults,
535587
MlirType const *results);
536588

589+
MLIR_CAPI_EXPORTED MlirStringRef mlirFunctionTypeGetName(void);
590+
537591
/// Returns the number of input types.
538592
MLIR_CAPI_EXPORTED intptr_t mlirFunctionTypeGetNumInputs(MlirType type);
539593

@@ -565,6 +619,8 @@ MLIR_CAPI_EXPORTED MlirType mlirOpaqueTypeGet(MlirContext ctx,
565619
MlirStringRef dialectNamespace,
566620
MlirStringRef typeData);
567621

622+
MLIR_CAPI_EXPORTED MlirStringRef mlirOpaqueTypeGetName(void);
623+
568624
/// Returns the namespace of the dialect with which the given opaque type
569625
/// is associated. The namespace string is owned by the context.
570626
MLIR_CAPI_EXPORTED MlirStringRef

mlir/include/mlir-c/Dialect/AMDGPU.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ MLIR_CAPI_EXPORTED MlirTypeID mlirAMDGPUTDMBaseTypeGetTypeID();
2929
MLIR_CAPI_EXPORTED MlirType mlirAMDGPUTDMBaseTypeGet(MlirContext ctx,
3030
MlirType elementType);
3131

32+
MLIR_CAPI_EXPORTED MlirStringRef mlirAMDGPUTDMBaseTypeGetName(void);
33+
3234
//===---------------------------------------------------------------------===//
3335
// TDMDescriptorType
3436
//===---------------------------------------------------------------------===//
@@ -39,6 +41,8 @@ MLIR_CAPI_EXPORTED MlirTypeID mlirAMDGPUTDMDescriptorTypeGetTypeID();
3941

4042
MLIR_CAPI_EXPORTED MlirType mlirAMDGPUTDMDescriptorTypeGet(MlirContext ctx);
4143

44+
MLIR_CAPI_EXPORTED MlirStringRef mlirAMDGPUTDMDescriptorTypeGetName(void);
45+
4246
//===---------------------------------------------------------------------===//
4347
// TDMGatherBaseType
4448
//===---------------------------------------------------------------------===//
@@ -51,6 +55,8 @@ MLIR_CAPI_EXPORTED MlirType mlirAMDGPUTDMGatherBaseTypeGet(MlirContext ctx,
5155
MlirType elementType,
5256
MlirType indexType);
5357

58+
MLIR_CAPI_EXPORTED MlirStringRef mlirAMDGPUTDMGatherBaseTypeGetName(void);
59+
5460
#ifdef __cplusplus
5561
}
5662
#endif

mlir/include/mlir-c/Dialect/EmitC.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ MLIR_CAPI_EXPORTED MlirType mlirEmitCArrayTypeGet(intptr_t nDims,
4141
int64_t *shape,
4242
MlirType elementType);
4343

44+
MLIR_CAPI_EXPORTED MlirStringRef mlirEmitCArrayTypeGetName(void);
45+
4446
//===---------------------------------------------------------------------===//
4547
// LValueType
4648
//===---------------------------------------------------------------------===//
@@ -51,6 +53,8 @@ MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCLValueTypeGetTypeID(void);
5153

5254
MLIR_CAPI_EXPORTED MlirType mlirEmitCLValueTypeGet(MlirType valueType);
5355

56+
MLIR_CAPI_EXPORTED MlirStringRef mlirEmitCLValueTypeGetName(void);
57+
5458
//===---------------------------------------------------------------------===//
5559
// OpaqueType
5660
//===---------------------------------------------------------------------===//
@@ -62,6 +66,8 @@ MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCOpaqueTypeGetTypeID(void);
6266
MLIR_CAPI_EXPORTED MlirType mlirEmitCOpaqueTypeGet(MlirContext ctx,
6367
MlirStringRef value);
6468

69+
MLIR_CAPI_EXPORTED MlirStringRef mlirEmitCOpaqueTypeGetName(void);
70+
6571
//===---------------------------------------------------------------------===//
6672
// PointerType
6773
//===---------------------------------------------------------------------===//
@@ -72,6 +78,8 @@ MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCPointerTypeGetTypeID(void);
7278

7379
MLIR_CAPI_EXPORTED MlirType mlirEmitCPointerTypeGet(MlirType pointee);
7480

81+
MLIR_CAPI_EXPORTED MlirStringRef mlirEmitCPointerTypeGetName(void);
82+
7583
//===---------------------------------------------------------------------===//
7684
// PtrDiffTType
7785
//===---------------------------------------------------------------------===//
@@ -82,6 +90,8 @@ MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCPtrDiffTTypeGetTypeID(void);
8290

8391
MLIR_CAPI_EXPORTED MlirType mlirEmitCPtrDiffTTypeGet(MlirContext ctx);
8492

93+
MLIR_CAPI_EXPORTED MlirStringRef mlirEmitCPtrDiffTTypeGetName(void);
94+
8595
//===---------------------------------------------------------------------===//
8696
// SignedSizeTType
8797
//===---------------------------------------------------------------------===//
@@ -92,6 +102,8 @@ MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCSignedSizeTTypeGetTypeID(void);
92102

93103
MLIR_CAPI_EXPORTED MlirType mlirEmitCSignedSizeTTypeGet(MlirContext ctx);
94104

105+
MLIR_CAPI_EXPORTED MlirStringRef mlirEmitCSignedSizeTTypeGetName(void);
106+
95107
//===---------------------------------------------------------------------===//
96108
// SizeTType
97109
//===---------------------------------------------------------------------===//
@@ -102,6 +114,8 @@ MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCSizeTTypeGetTypeID(void);
102114

103115
MLIR_CAPI_EXPORTED MlirType mlirEmitCSizeTTypeGet(MlirContext ctx);
104116

117+
MLIR_CAPI_EXPORTED MlirStringRef mlirEmitCSizeTTypeGetName(void);
118+
105119
//===----------------------------------------------------------------------===//
106120
// CmpPredicate attribute.
107121
//===----------------------------------------------------------------------===//

mlir/include/mlir-c/Dialect/GPU.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsAGPUAsyncTokenType(MlirType type);
2727

2828
MLIR_CAPI_EXPORTED MlirType mlirGPUAsyncTokenTypeGet(MlirContext ctx);
2929

30+
MLIR_CAPI_EXPORTED MlirStringRef mlirGPUAsyncTokenTypeGetName(void);
31+
3032
//===---------------------------------------------------------------------===//
3133
// ObjectAttr
3234
//===---------------------------------------------------------------------===//

mlir/include/mlir-c/Dialect/LLVM.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(LLVM, llvm);
2323
MLIR_CAPI_EXPORTED MlirType mlirLLVMPointerTypeGet(MlirContext ctx,
2424
unsigned addressSpace);
2525

26+
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMPointerTypeGetName(void);
27+
2628
MLIR_CAPI_EXPORTED MlirTypeID mlirLLVMPointerTypeGetTypeID(void);
2729

2830
/// Returns `true` if the type is an LLVM dialect pointer type.
@@ -35,10 +37,14 @@ mlirLLVMPointerTypeGetAddressSpace(MlirType pointerType);
3537
/// Creates an llmv.void type.
3638
MLIR_CAPI_EXPORTED MlirType mlirLLVMVoidTypeGet(MlirContext ctx);
3739

40+
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMVoidTypeGetName(void);
41+
3842
/// Creates an llvm.array type.
3943
MLIR_CAPI_EXPORTED MlirType mlirLLVMArrayTypeGet(MlirType elementType,
4044
unsigned numElements);
4145

46+
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMArrayTypeGetName(void);
47+
4248
/// Returns the element type of the llvm.array type.
4349
MLIR_CAPI_EXPORTED MlirType mlirLLVMArrayTypeGetElementType(MlirType type);
4450

@@ -47,6 +53,8 @@ MLIR_CAPI_EXPORTED MlirType
4753
mlirLLVMFunctionTypeGet(MlirType resultType, intptr_t nArgumentTypes,
4854
MlirType const *argumentTypes, bool isVarArg);
4955

56+
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMFunctionTypeGetName(void);
57+
5058
/// Returns the number of input types.
5159
MLIR_CAPI_EXPORTED intptr_t mlirLLVMFunctionTypeGetNumInputs(MlirType type);
5260

@@ -62,6 +70,8 @@ MLIR_CAPI_EXPORTED bool mlirTypeIsALLVMStructType(MlirType type);
6270

6371
MLIR_CAPI_EXPORTED MlirTypeID mlirLLVMStructTypeGetTypeID(void);
6472

73+
MLIR_CAPI_EXPORTED MlirStringRef mlirLLVMStructTypeGetName(void);
74+
6575
/// Returns `true` if the type is a literal (unnamed) LLVM struct type.
6676
MLIR_CAPI_EXPORTED bool mlirLLVMStructTypeIsLiteral(MlirType type);
6777

0 commit comments

Comments
 (0)