Skip to content

Commit 0c4a4e1

Browse files
tools/heir-translate: register --mlir-to-cpp (EmitC -> C++)
Register the upstream EmitC-to-C++ translation in heir-translate so the cheddar backend's final stage (and the emitter's compile/ guard test) work. Previously this lived in the LWEToCheddar/MNIST commit above the emitter in the stack, so the emitter branch's compile test could not run standalone.
1 parent 3e022c1 commit 0c4a4e1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tools/heir-translate.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@
1212
#include "lib/Target/TfheRustHL/TfheRustHLEmitter.h"
1313
#include "lib/Target/Verilog/VerilogEmitter.h"
1414
#include "llvm/include/llvm/Support/LogicalResult.h" // from @llvm-project
15+
#include "mlir/include/mlir/InitAllTranslations.h" // from @llvm-project
1516
#include "mlir/include/mlir/Tools/mlir-translate/MlirTranslateMain.h" // from @llvm-project
1617

1718
int main(int argc, char** argv) {
19+
// MLIR-to-C++ via the EmitC dialect: used as the final stage of the CHEDDAR
20+
// backend (`scheme-to-cheddar | --cheddar-to-emitc | heir-translate
21+
// --mlir-to-cpp`), and available standalone for any EmitC IR.
22+
mlir::registerToCppTranslation();
1823
// Verilog output
1924
mlir::heir::registerToVerilogTranslation();
2025
mlir::heir::registerMetadataEmitter();

0 commit comments

Comments
 (0)