@@ -75,9 +75,9 @@ def EmitC_ArrayType : EmitC_Type<"Array", "array", [ShapedTypeInterface]> {
7575 Type elementType) const;
7676
7777 static bool isValidElementType(Type type) {
78- return type.isIntOrIndexOrFloat( ) ||
79- emitc::isAnySizeTType (type) ||
80- llvm::isa<PointerType, OpaqueType >(type);
78+ return emitc::isSupportedFloatType(type ) ||
79+ emitc::isIntegerIndexOrOpaqueType (type) ||
80+ llvm::isa<PointerType>(type);
8181 }
8282 }];
8383 let genVerifyDecl = 1;
@@ -133,10 +133,29 @@ def EmitC_PointerType : EmitC_Type<"Pointer", "ptr"> {
133133
134134def EmitC_SignedSizeT : EmitC_Type<"SignedSizeT", "ssize_t"> {
135135 let summary = "EmitC signed size type";
136+ let description = [{
137+ Data type representing all values of `emitc.size_t`, plus -1.
138+ It corresponds to `ssize_t` found in `<sys/types.h>`.
139+
140+ Use of this type causes the code to be non-C99 compliant.
141+ }];
142+ }
143+
144+ def EmitC_PtrDiffT : EmitC_Type<"PtrDiffT", "ptrdiff_t"> {
145+ let summary = "EmitC signed pointer diff type";
146+ let description = [{
147+ Signed data type as wide as platform-specific pointer types.
148+ In particular, it is as wide as `emitc.size_t`.
149+ It corresponds to `ptrdiff_t` found in `<stddef.h>`.
150+ }];
136151}
137152
138153def EmitC_SizeT : EmitC_Type<"SizeT", "size_t"> {
139154 let summary = "EmitC unsigned size type";
155+ let description = [{
156+ Unsigned data type as wide as platform-specific pointer types.
157+ It corresponds to `size_t` found in `<stddef.h>`.
158+ }];
140159}
141160
142161#endif // MLIR_DIALECT_EMITC_IR_EMITCTYPES
0 commit comments