mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include "llvm/Support/CommandLine.h"
|
|
#include "llvm/Support/Signals.h"
|
|
|
|
#include "mlir/Dialect/LLVMIR/Transforms/Passes.h"
|
|
#include "mlir/Tools/mlir-opt/MlirOptMain.h"
|
|
#include "mlir/Transforms/Passes.h"
|
|
|
|
#include "revng/Clift/Clift.h"
|
|
#include "revng/CliftTransforms/Passes.h"
|
|
#include "revng/Support/Assert.h"
|
|
#include "revng/Support/InitRevng.h"
|
|
|
|
using namespace llvm::cl;
|
|
|
|
static constexpr char ToolName[] = "Standalone optimizer driver\n";
|
|
|
|
static void initializeCliftDialect(mlir::MLIRContext *Context,
|
|
clift::CliftDialect *Dialect) {
|
|
Dialect->setDefaultDataModel(CDataModel::getDefaultDataModel(8));
|
|
}
|
|
|
|
int main(int Argc, char *Argv[]) {
|
|
mlir::DialectRegistry Registry;
|
|
|
|
Registry.insert<clift::CliftDialect>();
|
|
Registry.addExtension(initializeCliftDialect);
|
|
|
|
mlir::registerTransformsPasses();
|
|
clift::registerCliftPasses();
|
|
|
|
using mlir::asMainReturnCode;
|
|
using mlir::MlirOptMain;
|
|
|
|
return asMainReturnCode(MlirOptMain(Argc, Argv, ToolName, Registry));
|
|
}
|