#endif
/// Returns an empty attribute.
-MLIR_CAPI_EXPORTED MlirAttribute mlirAttributeGetNull();
+MLIR_CAPI_EXPORTED MlirAttribute mlirAttributeGetNull(void);
//===----------------------------------------------------------------------===//
// Affine map attribute.
/// Returns the value indicating a dynamic size in a shaped type. Prefer
/// mlirShapedTypeIsDynamicSize to direct comparisons with this value.
-MLIR_CAPI_EXPORTED int64_t mlirShapedTypeGetDynamicSize();
+MLIR_CAPI_EXPORTED int64_t mlirShapedTypeGetDynamicSize(void);
/// Checks whether the given value is used as a placeholder for dynamic strides
/// and offsets in shaped types.
/// Returns the value indicating a dynamic stride or offset in a shaped type.
/// Prefer mlirShapedTypeGetDynamicStrideOrOffset to direct comparisons with
/// this value.
-MLIR_CAPI_EXPORTED int64_t mlirShapedTypeGetDynamicStrideOrOffset();
+MLIR_CAPI_EXPORTED int64_t mlirShapedTypeGetDynamicStrideOrOffset(void);
//===----------------------------------------------------------------------===//
// Vector type.
MLIR_CAPI_EXPORTED bool mlirTypeIsAQuantizedType(MlirType type);
/// Returns the bit flag used to indicate signedness of a quantized type.
-MLIR_CAPI_EXPORTED unsigned mlirQuantizedTypeGetSignedFlag();
+MLIR_CAPI_EXPORTED unsigned mlirQuantizedTypeGetSignedFlag(void);
/// Returns the minimum possible value stored by a quantized type.
MLIR_CAPI_EXPORTED int64_t mlirQuantizedTypeGetDefaultMinimumForInteger(
//===----------------------------------------------------------------------===//
/// Creates an MLIR context and transfers its ownership to the caller.
-MLIR_CAPI_EXPORTED MlirContext mlirContextCreate();
+MLIR_CAPI_EXPORTED MlirContext mlirContextCreate(void);
/// Checks if two contexts are equal.
MLIR_CAPI_EXPORTED bool mlirContextEqual(MlirContext ctx1, MlirContext ctx2);
typedef struct MlirDialectHandle MlirDialectHandle;
#define MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Name, Namespace) \
- MLIR_CAPI_EXPORTED MlirDialectHandle mlirGetDialectHandle__##Namespace##__()
+ MLIR_CAPI_EXPORTED MlirDialectHandle mlirGetDialectHandle__##Namespace##__( \
+ void)
/// Returns the namespace associated with the provided dialect handle.
MLIR_CAPI_EXPORTED
//===----------------------------------------------------------------------===//
/// Creates a dialect registry and transfers its ownership to the caller.
-MLIR_CAPI_EXPORTED MlirDialectRegistry mlirDialectRegistryCreate();
+MLIR_CAPI_EXPORTED MlirDialectRegistry mlirDialectRegistryCreate(void);
/// Checks if the dialect registry is null.
static inline bool mlirDialectRegistryIsNull(MlirDialectRegistry registry) {
/// Creates new printing flags with defaults, intended for customization.
/// Must be freed with a call to mlirOpPrintingFlagsDestroy().
-MLIR_CAPI_EXPORTED MlirOpPrintingFlags mlirOpPrintingFlagsCreate();
+MLIR_CAPI_EXPORTED MlirOpPrintingFlags mlirOpPrintingFlagsCreate(void);
/// Destroys printing flags created with mlirOpPrintingFlagsCreate.
MLIR_CAPI_EXPORTED void mlirOpPrintingFlagsDestroy(MlirOpPrintingFlags flags);
//===----------------------------------------------------------------------===//
/// Creates a new empty region and transfers ownership to the caller.
-MLIR_CAPI_EXPORTED MlirRegion mlirRegionCreate();
+MLIR_CAPI_EXPORTED MlirRegion mlirRegionCreate(void);
/// Takes a region owned by the caller and destroys it.
MLIR_CAPI_EXPORTED void mlirRegionDestroy(MlirRegion region);
/// Returns the name of the attribute used to store symbol names compatible with
/// symbol tables.
-MLIR_CAPI_EXPORTED MlirStringRef mlirSymbolTableGetSymbolAttributeName();
+MLIR_CAPI_EXPORTED MlirStringRef mlirSymbolTableGetSymbolAttributeName(void);
/// Returns the name of the attribute used to store symbol visibility.
-MLIR_CAPI_EXPORTED MlirStringRef mlirSymbolTableGetVisibilityAttributeName();
+MLIR_CAPI_EXPORTED MlirStringRef
+mlirSymbolTableGetVisibilityAttributeName(void);
/// Creates a symbol table for the given operation. If the operation does not
/// have the SymbolTable trait, returns a null symbol table.
MLIR_CAPI_EXPORTED void mlirRegisterAllLLVMTranslations(MlirContext context);
/// Register all compiler passes of MLIR.
-MLIR_CAPI_EXPORTED void mlirRegisterAllPasses();
+MLIR_CAPI_EXPORTED void mlirRegisterAllPasses(void);
#ifdef __cplusplus
}
}
/// Creates a logical result representing a success.
-inline static MlirLogicalResult mlirLogicalResultSuccess() {
+inline static MlirLogicalResult mlirLogicalResultSuccess(void) {
MlirLogicalResult res = {1};
return res;
}
/// Creates a logical result representing a failure.
-inline static MlirLogicalResult mlirLogicalResultFailure() {
+inline static MlirLogicalResult mlirLogicalResultFailure(void) {
MlirLogicalResult res = {0};
return res;
}
//===----------------------------------------------------------------------===//
/// Creates a type id allocator for dynamic type id creation
-MLIR_CAPI_EXPORTED MlirTypeIDAllocator mlirTypeIDAllocatorCreate();
+MLIR_CAPI_EXPORTED MlirTypeIDAllocator mlirTypeIDAllocatorCreate(void);
/// Deallocates the allocator and all allocated type ids
MLIR_CAPI_EXPORTED void
}
// CHECK-LABEL: Running test 'testSimpleExecution'
-void testSimpleExecution() {
+void testSimpleExecution(void) {
MlirContext ctx = mlirContextCreate();
registerAllUpstreamDialects(ctx);
mlirContextDestroy(ctx);
}
-int main() {
+int main(void) {
#define _STRINGIFY(x) #x
#define STRINGIFY(x) _STRINGIFY(x)
return 0;
}
-int registerOnlyStd() {
+int registerOnlyStd(void) {
MlirContext ctx = mlirContextCreate();
// The built-in dialect is always loaded.
if (mlirContextGetNumLoadedDialects(ctx) != 1)
}
/// Tests backreference APIs
-static int testBackreferences() {
+static int testBackreferences(void) {
fprintf(stderr, "@test_backreferences\n");
MlirContext ctx = mlirContextCreate();
}
/// Tests operand APIs.
-int testOperands() {
+int testOperands(void) {
fprintf(stderr, "@testOperands\n");
// CHECK-LABEL: @testOperands
}
/// Tests clone APIs.
-int testClone() {
+int testClone(void) {
fprintf(stderr, "@testClone\n");
// CHECK-LABEL: @testClone
return 0;
}
-int testDialectRegistry() {
+int testDialectRegistry(void) {
fprintf(stderr, "@testDialectRegistry\n");
MlirDialectRegistry registry = mlirDialectRegistryCreate();
return 0;
}
-void testDiagnostics() {
+void testDiagnostics(void) {
MlirContext ctx = mlirContextCreate();
MlirDiagnosticHandlerID id = mlirContextAttachDiagnosticHandler(
ctx, errorHandler, (void *)42, deleteUserData);
mlirContextDestroy(ctx);
}
-int main() {
+int main(void) {
MlirContext ctx = mlirContextCreate();
registerAllUpstreamDialects(ctx);
mlirContextGetOrLoadDialect(ctx, mlirStringRefCreateFromCString("func"));
mlirTypeEqual(i32_i64_s, i32_i64_s_ref));
}
-int main() {
+int main(void) {
MlirContext ctx = mlirContextCreate();
mlirDialectHandleRegisterDialect(mlirGetDialectHandle__llvm__(), ctx);
mlirContextGetOrLoadDialect(ctx, mlirStringRefCreateFromCString("llvm"));
mlirDialectRegistryDestroy(registry);
}
-void testRunPassOnModule() {
+void testRunPassOnModule(void) {
MlirContext ctx = mlirContextCreate();
registerAllUpstreamDialects(ctx);
mlirContextDestroy(ctx);
}
-void testRunPassOnNestedModule() {
+void testRunPassOnNestedModule(void) {
MlirContext ctx = mlirContextCreate();
registerAllUpstreamDialects(ctx);
(void)userData;
}
-void testPrintPassPipeline() {
+void testPrintPassPipeline(void) {
MlirContext ctx = mlirContextCreate();
MlirPassManager pm = mlirPassManagerCreateOnOperation(
ctx, mlirStringRefCreateFromCString("any"));
mlirContextDestroy(ctx);
}
-void testParsePassPipeline() {
+void testParsePassPipeline(void) {
MlirContext ctx = mlirContextCreate();
MlirPassManager pm = mlirPassManagerCreate(ctx);
// Try parse a pipeline.
mlirContextDestroy(ctx);
}
-void testParseErrorCapture() {
+void testParseErrorCapture(void) {
// CHECK-LABEL: testParseErrorCapture:
fprintf(stderr, "\nTEST: testParseErrorCapture:\n");
testCloneExternalPass, runPass};
}
-void testExternalPass() {
+void testExternalPass(void) {
MlirContext ctx = mlirContextCreate();
registerAllUpstreamDialects(ctx);
mlirContextDestroy(ctx);
}
-int main() {
+int main(void) {
testRunPassOnModule();
testRunPassOnNestedModule();
testPrintPassPipeline();
fprintf(stderr, "\n\n");
}
-int main() {
+int main(void) {
MlirContext ctx = mlirContextCreate();
mlirDialectHandleRegisterDialect(mlirGetDialectHandle__pdl__(), ctx);
testAttributeType(ctx);
fprintf(stderr, "\n\n");
}
-int main() {
+int main(void) {
MlirContext ctx = mlirContextCreate();
mlirDialectHandleRegisterDialect(mlirGetDialectHandle__quant__(), ctx);
testTypeHierarchy(ctx);
return 0;
}
-int main() {
+int main(void) {
MlirContext ctx = mlirContextCreate();
mlirDialectHandleRegisterDialect(mlirGetDialectHandle__sparse_tensor__(),
ctx);
const char *const passDecl = R"(
/* Create {0} Pass. */
-MLIR_CAPI_EXPORTED MlirPass mlirCreate{0}{1}();
-MLIR_CAPI_EXPORTED void mlirRegister{0}{1}();
+MLIR_CAPI_EXPORTED MlirPass mlirCreate{0}{1}(void);
+MLIR_CAPI_EXPORTED void mlirRegister{0}{1}(void);
)";
static bool emitCAPIHeader(const llvm::RecordKeeper &records, raw_ostream &os) {
os << fileHeader;
os << "// Registration for the entire group\n";
- os << "MLIR_CAPI_EXPORTED void mlirRegister" << groupName << "Passes();\n\n";
+ os << "MLIR_CAPI_EXPORTED void mlirRegister" << groupName
+ << "Passes(void);\n\n";
for (const auto *def : records.getAllDerivedDefinitions("PassBase")) {
Pass pass(def);
StringRef defName = pass.getDef()->getName();
}
const char *const passCreateDef = R"(
-MlirPass mlirCreate{0}{1}() {
+MlirPass mlirCreate{0}{1}(void) {
return wrap({2}.release());
}
-void mlirRegister{0}{1}() {
+void mlirRegister{0}{1}(void) {
register{1}();
}
// {0} Group Registration
//===----------------------------------------------------------------------===//
-void mlirRegister{0}Passes() {{
+void mlirRegister{0}Passes(void) {{
register{0}Passes();
}
)";