MLIR 23.0.0git
ExportSMTLIB.cpp
Go to the documentation of this file.
1//===- ExportSMTLIB.cpp - C Interface to ExportSMTLIB ---------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM
4// Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9//
10// Implements a C Interface for export SMTLIB.
11//
12//===----------------------------------------------------------------------===//
13
15#include "mlir/CAPI/IR.h"
16#include "mlir/CAPI/Support.h"
17#include "mlir/CAPI/Utils.h"
19
20using namespace mlir;
21
23 MlirOperation module, MlirStringCallback callback, void *userData,
24 bool inlineSingleUseValues, bool indentLetBody, bool emitReset) {
25 mlir::detail::CallbackOstream stream(callback, userData);
27 options.inlineSingleUseValues = inlineSingleUseValues;
28 options.indentLetBody = indentLetBody;
29 options.emitReset = emitReset;
30 return wrap(smt::exportSMTLIB(unwrap(module), stream, options));
31}
32
35 void *userData, bool inlineSingleUseValues,
36 bool indentLetBody, bool emitReset) {
38 mlirModuleGetOperation(module), callback, userData, inlineSingleUseValues,
39 indentLetBody, emitReset);
40}
MlirLogicalResult mlirTranslateOperationToSMTLIB(MlirOperation module, MlirStringCallback callback, void *userData, bool inlineSingleUseValues, bool indentLetBody, bool emitReset)
MlirLogicalResult mlirTranslateModuleToSMTLIB(MlirModule module, MlirStringCallback callback, void *userData, bool inlineSingleUseValues, bool indentLetBody, bool emitReset)
Emits SMTLIB for the specified module using the provided callback and user data.
MlirOperation mlirModuleGetOperation(MlirModule module)
Definition IR.cpp:459
static llvm::ManagedStatic< PassManagerOptions > options
A simple raw ostream subclass that forwards write_impl calls to the user-supplied callback together w...
Definition Utils.h:30
MlirDiagnostic wrap(mlir::Diagnostic &diagnostic)
Definition Diagnostics.h:24
mlir::Diagnostic & unwrap(MlirDiagnostic diagnostic)
Definition Diagnostics.h:19
void(* MlirStringCallback)(MlirStringRef, void *)
A callback for returning string references.
Definition Support.h:110
LogicalResult exportSMTLIB(Operation *module, llvm::raw_ostream &os, const SMTEmissionOptions &options=SMTEmissionOptions())
Run the ExportSMTLIB pass.
Include the generated interface declarations.
A logical result value, essentially a boolean with named states.
Definition Support.h:121
Emission options for the ExportSMTLIB pass.