1 //===- fir-opt.cpp - FIR Optimizer Driver -----------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This is to be like LLVM's opt program, only for FIR.  Such a program is
10 // required for roundtrip testing, etc.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "mlir/Support/MlirOptMain.h"
15 #include "flang/Optimizer/Support/InitFIR.h"
16 
17 using namespace mlir;
18 
19 int main(int argc, char **argv) {
20   fir::support::registerFIRPasses();
21   DialectRegistry registry;
22   fir::support::registerDialects(registry);
23   return failed(MlirOptMain(argc, argv, "FIR modular optimizer driver\n",
24       registry, /*preloadDialectsInContext*/ false));
25 }
26