LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
llzk-translate.cpp
Go to the documentation of this file.
1//===-- llzk-translate.cpp - LLZK translate tool ----------------*- C++ -*-===//
2//
3// Part of the LLZK Project, under the Apache License v2.0.
4// See LICENSE.txt for license information.
5// Copyright 2026 Project LLZK
6// SPDX-License-Identifier: Apache-2.0
7//
8//===----------------------------------------------------------------------===//
14//===----------------------------------------------------------------------===//
15
16#include "smt/Target/TranslateRegistration.h"
17#include "tools/config.h"
18#include "zklean/Target/TranslateRegistration.h"
19
20#include "llzk/Config/Config.h"
21
22#include <mlir/Dialect/Func/Extensions/InlinerExtension.h>
23#include <mlir/Dialect/Func/IR/FuncOps.h>
24#include <mlir/Dialect/SCF/IR/SCF.h>
25#include <mlir/IR/DialectRegistry.h>
26#include <mlir/InitAllTranslations.h>
27#include <mlir/Pass/PassManager.h>
28#include <mlir/Pass/PassRegistry.h>
29#include <mlir/Tools/mlir-translate/MlirTranslateMain.h>
30#include <mlir/Transforms/Passes.h>
31
32#include <llvm/ADT/StringRef.h>
33#include <llvm/Support/CommandLine.h>
34#include <llvm/Support/PrettyStackTrace.h>
35#include <llvm/Support/Signals.h>
36
37#if LLZK_WITH_PCL
38#include "pcl/Target/TranslateRegistration.h"
39#endif // LLZK_WITH_PCL
40
41using namespace llzk;
42
43int main(int argc, char **argv) {
44 llvm::sys::PrintStackTraceOnErrorSignal(llvm::StringRef());
45 llvm::setBugReportMsg(
46 "PLEASE submit a bug report to " BUG_REPORT_URL
47 " and include the crash backtrace, relevant LLZK files,"
48 " and associated run script(s).\n"
49 );
50 llvm::cl::AddExtraVersionPrinter([](llvm::raw_ostream &os) {
51 os << "\nLLZK (" LLZK_URL "):\n LLZK version " LLZK_VERSION_STRING "\n";
52 });
53
54 // Register all MLIR translations
55 mlir::registerAllTranslations();
56 smt::registerSmtTranslation();
57 zklean::registerZKLeanTranslation();
58#if LLZK_WITH_PCL
59 pcl::registerPclTranslation();
60#endif
61
62 // Run 'mlir-translate'
63 return failed(mlir::mlirTranslateMain(argc, argv, "LLZK Translation tool"));
64}
#define LLZK_VERSION_STRING
Definition Config.h:12
#define LLZK_URL
Definition Config.h:17
#define BUG_REPORT_URL
Definition config.h:15
int main(int argc, char **argv)