16 #include "llvm/Support/CommandLine.h"
27 static llvm::cl::opt<bool> declareVariablesAtTop(
28 "declare-variables-at-top",
29 llvm::cl::desc(
"Declare variables at top when emitting C/C++"),
30 llvm::cl::init(
false));
32 static llvm::cl::opt<std::string> fileId(
33 "file-id", llvm::cl::desc(
"Emit emitc.file ops with matching id"),
37 "mlir-to-cpp",
"translate from mlir to cpp",
41 declareVariablesAtTop,
46 registry.insert<cf::ControlFlowDialect,
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
Operation is the basic unit of execution within MLIR.
LogicalResult translateToCpp(Operation *op, raw_ostream &os, bool declareVariablesAtTop=false, StringRef fileId={})
Translates the given operation to C++ code.
Include the generated interface declarations.
void registerToCppTranslation()