@@ -116,7 +116,8 @@ mlirApiObjectToCapsule(nanobind::handle apiObject) {
116
116
// / Casts object <-> MlirAffineMap.
117
117
template <>
118
118
struct type_caster <MlirAffineMap> {
119
- NB_TYPE_CASTER (MlirAffineMap, const_name(" MlirAffineMap" ))
119
+ NB_TYPE_CASTER (MlirAffineMap,
120
+ const_name (MAKE_MLIR_PYTHON_QUALNAME(" ir.AffineMap" )))
120
121
bool from_python(handle src, uint8_t flags, cleanup_list *cleanup) noexcept {
121
122
if (auto capsule = mlirApiObjectToCapsule (src)) {
122
123
value = mlirPythonCapsuleToAffineMap (capsule->ptr ());
@@ -138,7 +139,8 @@ struct type_caster<MlirAffineMap> {
138
139
// / Casts object <-> MlirAttribute.
139
140
template <>
140
141
struct type_caster <MlirAttribute> {
141
- NB_TYPE_CASTER (MlirAttribute, const_name(" MlirAttribute" ))
142
+ NB_TYPE_CASTER (MlirAttribute,
143
+ const_name (MAKE_MLIR_PYTHON_QUALNAME(" ir.Attribute" )))
142
144
bool from_python(handle src, uint8_t flags, cleanup_list *cleanup) noexcept {
143
145
if (auto capsule = mlirApiObjectToCapsule (src)) {
144
146
value = mlirPythonCapsuleToAttribute (capsule->ptr ());
@@ -161,7 +163,7 @@ struct type_caster<MlirAttribute> {
161
163
// / Casts object -> MlirBlock.
162
164
template <>
163
165
struct type_caster <MlirBlock> {
164
- NB_TYPE_CASTER (MlirBlock, const_name(" MlirBlock " ))
166
+ NB_TYPE_CASTER (MlirBlock, const_name(MAKE_MLIR_PYTHON_QUALNAME( " ir.Block " ) ))
165
167
bool from_python (handle src, uint8_t flags, cleanup_list *cleanup) noexcept {
166
168
if (auto capsule = mlirApiObjectToCapsule (src)) {
167
169
value = mlirPythonCapsuleToBlock (capsule->ptr ());
@@ -174,7 +176,8 @@ struct type_caster<MlirBlock> {
174
176
// / Casts object -> MlirContext.
175
177
template <>
176
178
struct type_caster <MlirContext> {
177
- NB_TYPE_CASTER (MlirContext, const_name(" MlirContext" ))
179
+ NB_TYPE_CASTER (MlirContext,
180
+ const_name (MAKE_MLIR_PYTHON_QUALNAME(" ir.Context" )))
178
181
bool from_python(handle src, uint8_t flags, cleanup_list *cleanup) noexcept {
179
182
if (src.is_none ()) {
180
183
// Gets the current thread-bound context.
@@ -192,7 +195,8 @@ struct type_caster<MlirContext> {
192
195
// / Casts object <-> MlirDialectRegistry.
193
196
template <>
194
197
struct type_caster <MlirDialectRegistry> {
195
- NB_TYPE_CASTER (MlirDialectRegistry, const_name(" MlirDialectRegistry" ))
198
+ NB_TYPE_CASTER (MlirDialectRegistry,
199
+ const_name (MAKE_MLIR_PYTHON_QUALNAME(" ir.DialectRegistry" )))
196
200
bool from_python(handle src, uint8_t flags, cleanup_list *cleanup) noexcept {
197
201
if (auto capsule = mlirApiObjectToCapsule (src)) {
198
202
value = mlirPythonCapsuleToDialectRegistry (capsule->ptr ());
@@ -214,7 +218,8 @@ struct type_caster<MlirDialectRegistry> {
214
218
// / Casts object <-> MlirLocation.
215
219
template <>
216
220
struct type_caster <MlirLocation> {
217
- NB_TYPE_CASTER (MlirLocation, const_name(" MlirLocation" ))
221
+ NB_TYPE_CASTER (MlirLocation,
222
+ const_name (MAKE_MLIR_PYTHON_QUALNAME(" ir.Location" )))
218
223
bool from_python(handle src, uint8_t flags, cleanup_list *cleanup) noexcept {
219
224
if (src.is_none ()) {
220
225
// Gets the current thread-bound context.
@@ -240,7 +245,7 @@ struct type_caster<MlirLocation> {
240
245
// / Casts object <-> MlirModule.
241
246
template <>
242
247
struct type_caster <MlirModule> {
243
- NB_TYPE_CASTER (MlirModule, const_name(" MlirModule " ))
248
+ NB_TYPE_CASTER (MlirModule, const_name(MAKE_MLIR_PYTHON_QUALNAME( " ir.Module " ) ))
244
249
bool from_python (handle src, uint8_t flags, cleanup_list *cleanup) noexcept {
245
250
if (auto capsule = mlirApiObjectToCapsule (src)) {
246
251
value = mlirPythonCapsuleToModule (capsule->ptr ());
@@ -262,8 +267,9 @@ struct type_caster<MlirModule> {
262
267
// / Casts object <-> MlirFrozenRewritePatternSet.
263
268
template <>
264
269
struct type_caster <MlirFrozenRewritePatternSet> {
265
- NB_TYPE_CASTER (MlirFrozenRewritePatternSet,
266
- const_name (" MlirFrozenRewritePatternSet" ))
270
+ NB_TYPE_CASTER (
271
+ MlirFrozenRewritePatternSet,
272
+ const_name (MAKE_MLIR_PYTHON_QUALNAME(" rewrite.FrozenRewritePatternSet" )))
267
273
bool from_python(handle src, uint8_t flags, cleanup_list *cleanup) noexcept {
268
274
if (auto capsule = mlirApiObjectToCapsule (src)) {
269
275
value = mlirPythonCapsuleToFrozenRewritePatternSet (capsule->ptr ());
@@ -285,7 +291,8 @@ struct type_caster<MlirFrozenRewritePatternSet> {
285
291
// / Casts object <-> MlirOperation.
286
292
template <>
287
293
struct type_caster <MlirOperation> {
288
- NB_TYPE_CASTER (MlirOperation, const_name(" MlirOperation" ))
294
+ NB_TYPE_CASTER (MlirOperation,
295
+ const_name (MAKE_MLIR_PYTHON_QUALNAME(" ir.Operation" )))
289
296
bool from_python(handle src, uint8_t flags, cleanup_list *cleanup) noexcept {
290
297
if (auto capsule = mlirApiObjectToCapsule (src)) {
291
298
value = mlirPythonCapsuleToOperation (capsule->ptr ());
@@ -309,7 +316,7 @@ struct type_caster<MlirOperation> {
309
316
// / Casts object <-> MlirValue.
310
317
template <>
311
318
struct type_caster <MlirValue> {
312
- NB_TYPE_CASTER (MlirValue, const_name(" MlirValue " ))
319
+ NB_TYPE_CASTER (MlirValue, const_name(MAKE_MLIR_PYTHON_QUALNAME( " ir.Value " ) ))
313
320
bool from_python (handle src, uint8_t flags, cleanup_list *cleanup) noexcept {
314
321
if (auto capsule = mlirApiObjectToCapsule (src)) {
315
322
value = mlirPythonCapsuleToValue (capsule->ptr ());
@@ -334,7 +341,8 @@ struct type_caster<MlirValue> {
334
341
// / Casts object -> MlirPassManager.
335
342
template <>
336
343
struct type_caster <MlirPassManager> {
337
- NB_TYPE_CASTER (MlirPassManager, const_name(" MlirPassManager" ))
344
+ NB_TYPE_CASTER (MlirPassManager, const_name(MAKE_MLIR_PYTHON_QUALNAME(
345
+ " passmanager.PassManager" )))
338
346
bool from_python (handle src, uint8_t flags, cleanup_list *cleanup) noexcept {
339
347
if (auto capsule = mlirApiObjectToCapsule (src)) {
340
348
value = mlirPythonCapsuleToPassManager (capsule->ptr ());
@@ -347,7 +355,7 @@ struct type_caster<MlirPassManager> {
347
355
// / Casts object <-> MlirTypeID.
348
356
template <>
349
357
struct type_caster <MlirTypeID> {
350
- NB_TYPE_CASTER (MlirTypeID, const_name(" MlirTypeID " ))
358
+ NB_TYPE_CASTER (MlirTypeID, const_name(MAKE_MLIR_PYTHON_QUALNAME( " ir.TypeID " ) ))
351
359
bool from_python (handle src, uint8_t flags, cleanup_list *cleanup) noexcept {
352
360
if (auto capsule = mlirApiObjectToCapsule (src)) {
353
361
value = mlirPythonCapsuleToTypeID (capsule->ptr ());
@@ -371,7 +379,7 @@ struct type_caster<MlirTypeID> {
371
379
// / Casts object <-> MlirType.
372
380
template <>
373
381
struct type_caster <MlirType> {
374
- NB_TYPE_CASTER (MlirType, const_name(" MlirType " ))
382
+ NB_TYPE_CASTER (MlirType, const_name(MAKE_MLIR_PYTHON_QUALNAME( " ir.Type " ) ))
375
383
bool from_python (handle src, uint8_t flags, cleanup_list *cleanup) noexcept {
376
384
if (auto capsule = mlirApiObjectToCapsule (src)) {
377
385
value = mlirPythonCapsuleToType (capsule->ptr ());
@@ -394,7 +402,7 @@ struct type_caster<MlirType> {
394
402
// / Casts MlirStringRef -> object.
395
403
template <>
396
404
struct type_caster <MlirStringRef> {
397
- NB_TYPE_CASTER (MlirStringRef, const_name(" MlirStringRef " ))
405
+ NB_TYPE_CASTER (MlirStringRef, const_name(" str " ))
398
406
static handle from_cpp (MlirStringRef s, rv_policy,
399
407
cleanup_list *cleanup) noexcept {
400
408
return nanobind::str (s.data , s.length ).release ();
0 commit comments