[Mlir-commits] [mlir] [mlir][emitc] Add EmitC index types (PR #93155)
Simon Camphausen
llvmlistbot at llvm.org
Mon Jun 17 02:29:56 PDT 2024
================
@@ -10,11 +10,18 @@ The following convention is followed:
`emitc.call_opaque` operation, C++11 is required.
* If floating-point type template arguments are passed to an `emitc.call_opaque`
operation, C++20 is required.
+* If `ssize_t` is used, then the code requires the POSIX header `sys/types.h`
+ or any of the C++ headers in which the type is defined.
* Else the generated code is compatible with C99.
These restrictions are neither inherent to the EmitC dialect itself nor to the
Cpp emitter and therefore need to be considered while implementing conversions.
+Type conversions are provided for the MLIR type `index` into the unsigned `size_t`
+type and its signed counterpart `ptrdiff_t`. Conversions between these two types
+are only valid if the `index`-typed values are within
+`[-PTRDIFF_MAX, PTRDIFF_MAX]`.
----------------
simon-camp wrote:
Should this be
```suggestion
`[PTRDIFF_MIN, PTRDIFF_MAX]`.
```
https://github.com/llvm/llvm-project/pull/93155
More information about the Mlir-commits
mailing list