Skip to content

Commit 48e4a98

Browse files
committed
Added LValue type to CAPI
1 parent 05b20c8 commit 48e4a98

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCArrayTypeGetTypeID(void);
3030
MLIR_CAPI_EXPORTED MlirType mlirEmitCArrayTypeGet(intptr_t nDims,
3131
int64_t *shape,
3232
MlirType elementType);
33+
34+
//===---------------------------------------------------------------------===//
35+
// LValueType
36+
//===---------------------------------------------------------------------===//
37+
38+
MLIR_CAPI_EXPORTED bool mlirTypeIsAEmitCLValueType(MlirType type);
39+
40+
MLIR_CAPI_EXPORTED MlirTypeID mlirEmitCLValueTypeGetTypeID(void);
41+
42+
MLIR_CAPI_EXPORTED MlirType mlirEmitCLValueTypeGet(MlirType valueType);
43+
3344
//===---------------------------------------------------------------------===//
3445
// OpaqueType
3546
//===---------------------------------------------------------------------===//

mlir/lib/CAPI/Dialect/EmitC.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@ MlirType mlirEmitCArrayTypeGet(intptr_t nDims, int64_t *shape,
3232
emitc::ArrayType::get(llvm::ArrayRef(shape, nDims), unwrap(elementType)));
3333
}
3434

35+
//===---------------------------------------------------------------------===//
36+
// LValueType
37+
//===---------------------------------------------------------------------===//
38+
39+
bool mlirTypeIsAEmitCLValueType(MlirType type) {
40+
return isa<emitc::LValueType>(unwrap(type));
41+
}
42+
43+
MlirTypeID mlirEmitCLValueTypeGetTypeID(void) {
44+
return wrap(emitc::LValueType::getTypeID());
45+
}
46+
47+
MlirType mlirEmitCLValueTypeGet(MlirType valueType) {
48+
return wrap(emitc::LValueType::get(unwrap(valueType)));
49+
}
50+
3551
//===---------------------------------------------------------------------===//
3652
// OpaqueType
3753
//===---------------------------------------------------------------------===//

0 commit comments

Comments
 (0)