| 1 | //===- ExportSMTLIB.h - SMT-LIB Exporter ------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // Defines the interface to the SMT-LIB emitter. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| 13 | #ifndef MLIR_TARGET_EXPORTSMTLIB_H |
| 14 | #define MLIR_TARGET_EXPORTSMTLIB_H |
| 15 | |
| 16 | #include "mlir/Support/LLVM.h" |
| 17 | |
| 18 | namespace mlir { |
| 19 | class Operation; |
| 20 | namespace smt { |
| 21 | |
| 22 | /// Emission options for the ExportSMTLIB pass. Allows controlling the emitted |
| 23 | /// format and overall behavior. |
| 24 | struct SMTEmissionOptions { |
| 25 | // Don't produce 'let' expressions to bind expressions that are only used |
| 26 | // once, but inline them directly at the use-site. |
| 27 | bool inlineSingleUseValues = false; |
| 28 | // Increase indentation for each 'let' expression body. |
| 29 | bool indentLetBody = false; |
| 30 | // Emit a '(reset)' command at the end of each solver scope. |
| 31 | bool emitReset = true; |
| 32 | }; |
| 33 | |
| 34 | /// Run the ExportSMTLIB pass. |
| 35 | LogicalResult |
| 36 | exportSMTLIB(Operation *module, llvm::raw_ostream &os, |
| 37 | const SMTEmissionOptions &options = SMTEmissionOptions()); |
| 38 | |
| 39 | /// Register the ExportSMTLIB pass. |
| 40 | void registerExportSMTLIBTranslation(); |
| 41 | |
| 42 | } // namespace smt |
| 43 | } // namespace mlir |
| 44 | |
| 45 | #endif // MLIR_TARGET_EXPORTSMTLIB_H |
| 46 | |