14 #include "llvm/Support/CommandLine.h"
25 static llvm::cl::opt<bool> declareVariablesAtTop(
26 "declare-variables-at-top",
27 llvm::cl::desc(
"Declare variables at top when emitting C/C++"),
28 llvm::cl::init(
false));
30 static llvm::cl::opt<std::string> fileId(
31 "file-id", llvm::cl::desc(
"Emit emitc.file ops with matching id"),
35 "mlir-to-cpp",
"translate from mlir to cpp",
39 declareVariablesAtTop,
44 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()