================
@@ -601,32 +610,105 @@ mlirTypeConverterAddConversion(MlirTypeConverter 
typeConverter,
                                MlirTypeConverterConversionCallback convertType,
                                void *userData);
 
-/// Convert the given type using the given TypeConverter.
+/// Opaque accumulator for the result types of a 1:N type conversion. It is
+/// passed to a MlirTypeConverter1ToNConversionCallback, which appends 
converted
+/// types to it via mlirTypeConverterConversionResultsAppend.
+typedef struct MlirTypeConverterConversionResults {
+  void *ptr;
+} MlirTypeConverterConversionResults;
+
+/// Append a converted result type to the given 1:N conversion result
+/// accumulator.
+MLIR_CAPI_EXPORTED void mlirTypeConverterConversionResultsAppend(
+    MlirTypeConverterConversionResults results, MlirType type);
+
+/// Outcome of a 1:N type conversion callback
+/// (MlirTypeConverter1ToNConversionCallback). Mirrors the three states of the
+/// underlying C++ `std::optional<LogicalResult>` return.
+typedef enum MlirTypeConverterConversionStatus {
+  /// The type was converted; the types appended to the results accumulator 
make
+  /// up the conversion (appending none erases the type).
+  MlirTypeConverterConversionStatusSuccess = 0,
+  /// The conversion failed hard; no further conversion function will be tried.
+  /// Any types appended before returning failure are discarded.
----------------
jpienaar wrote:

Appended where? I'm wondering if these should be comments on the function below 
rather than the enum.

https://github.com/llvm/llvm-project/pull/208935
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to