[Mlir-commits] [mlir] 0aaa2a4 - Remove mlir-c/Core.h which is superseded by the new API in mlir-c/IR.h

Mehdi Amini llvmlistbot at llvm.org
Tue Nov 3 03:15:53 PST 2020


Author: Mehdi Amini
Date: 2020-11-03T11:15:32Z
New Revision: 0aaa2a4cb114a72735a10a0d6901b4dbe2bacb09

URL: https://github.com/llvm/llvm-project/commit/0aaa2a4cb114a72735a10a0d6901b4dbe2bacb09
DIFF: https://github.com/llvm/llvm-project/commit/0aaa2a4cb114a72735a10a0d6901b4dbe2bacb09.diff

LOG: Remove mlir-c/Core.h which is superseded by the new API in mlir-c/IR.h

This header was an initial early attempt at a crude C API for bindings,
but it isn't used and redundant with the new API. At this point it only
contributes to more confusion.

Differential Revision: https://reviews.llvm.org/D90643

Added: 
    

Modified: 
    

Removed: 
    mlir/include/mlir-c/Core.h


################################################################################
diff  --git a/mlir/include/mlir-c/Core.h b/mlir/include/mlir-c/Core.h
deleted file mode 100644
index 4c0666f56c28..000000000000
--- a/mlir/include/mlir-c/Core.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*===-- mlir-c/Core.h - Core Library C Interface ------------------*- C -*-===*\
-|*                                                                            *|
-|* Part of the LLVM Project, under the Apache License v2.0 with LLVM          *|
-|* Exceptions.                                                                *|
-|* See https://llvm.org/LICENSE.txt for license information.                  *|
-|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception                    *|
-|*                                                                            *|
-|*===----------------------------------------------------------------------===*|
-|*                                                                            *|
-|* This header declares the C interface to MLIR.                              *|
-|*                                                                            *|
-\*===----------------------------------------------------------------------===*/
-#ifndef MLIR_C_CORE_H
-#define MLIR_C_CORE_H
-
-#ifdef __cplusplus
-#include <cstdint>
-extern "C" {
-#else
-#include <stdint.h>
-#endif
-
-/// Opaque MLIR types.
-/// Opaque C type for mlir::MLIRContext*.
-typedef void *mlir_context_t;
-/// Opaque C type for mlir::Type.
-typedef const void *mlir_type_t;
-/// Opaque C type for mlir::FuncOp.
-typedef void *mlir_func_t;
-/// Opaque C type for mlir::Attribute.
-typedef const void *mlir_attr_t;
-
-/// Simple C lists for non-owning mlir Opaque C types.
-/// Recommended usage is construction from the `data()` and `size()` of a scoped
-/// owning SmallVectorImpl<...> and passing to one of the C functions declared
-/// later in this file.
-/// Once the function returns and the proper EDSC has been constructed,
-/// resources are freed by exiting the scope.
-typedef struct {
-  int64_t *values;
-  uint64_t n;
-} int64_list_t;
-
-typedef struct {
-  mlir_type_t *types;
-  uint64_t n;
-} mlir_type_list_t;
-
-typedef struct {
-  const char *name;
-  mlir_attr_t value;
-} mlir_named_attr_t;
-
-typedef struct {
-  mlir_named_attr_t *list;
-  uint64_t n;
-} mlir_named_attr_list_t;
-
-/// Minimal C API for exposing EDSCs to Swift, Python and other languages.
-
-/// Returns an `mlir::MemRefType` of the element type `elemType` and shape
-/// `sizes`.
-mlir_type_t makeMemRefType(mlir_context_t context, mlir_type_t elemType,
-                           int64_list_t sizes);
-
-/// Returns an `mlir::FunctionType` of the element type `elemType` and shape
-/// `sizes`.
-mlir_type_t makeFunctionType(mlir_context_t context, mlir_type_list_t inputs,
-                             mlir_type_list_t outputs);
-
-/// Returns an `mlir::IndexType`.
-mlir_type_t makeIndexType(mlir_context_t context);
-
-/// Returns an `mlir::IntegerAttr` of the specified type that contains the given
-/// value.
-mlir_attr_t makeIntegerAttr(mlir_type_t type, int64_t value);
-
-/// Returns an `mlir::BoolAttr` with the given value.
-mlir_attr_t makeBoolAttr(mlir_context_t context, bool value);
-
-/// Returns an `mlir::FloatAttr` with the given value.
-mlir_attr_t makeFloatAttr(mlir_context_t context, float value);
-
-/// Returns an `mlir::StringAttr` with the given value.
-mlir_attr_t makeStringAttr(mlir_context_t context, const char *value);
-
-/// Parses an MLIR type from the string `type` in the given context. Returns a
-/// NULL type on error. If non-NULL, `charsRead` will contain the number of
-/// characters that were processed by the parser.
-mlir_type_t mlirParseType(const char *type, mlir_context_t context,
-                          uint64_t *charsRead);
-
-/// Returns the arity of `function`.
-unsigned getFunctionArity(mlir_func_t function);
-
-/// Returns the rank of the `function` argument at position `pos`.
-/// If the argument is of MemRefType, this returns the rank of the MemRef.
-/// Otherwise returns `0`.
-/// TODO: support more than MemRefType and scalar Type.
-unsigned getRankOfFunctionArgument(mlir_func_t function, unsigned pos);
-
-/// Returns an opaque mlir::Type of the `function` argument at position `pos`.
-mlir_type_t getTypeOfFunctionArgument(mlir_func_t function, unsigned pos);
-
-#ifdef __cplusplus
-} // end extern "C"
-#endif
-
-#endif // MLIR_C_CORE_H


        


More information about the Mlir-commits mailing list