[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / flang / tools / fir-opt / fir-opt.cpp
blob92af79e50fa4e10461f364ae48e3c29cfa182958
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.
12 //===----------------------------------------------------------------------===//
14 #include "mlir/Tools/mlir-opt/MlirOptMain.h"
15 #include "flang/Optimizer/CodeGen/CodeGen.h"
16 #include "flang/Optimizer/HLFIR/Passes.h"
17 #include "flang/Optimizer/Support/InitFIR.h"
18 #include "flang/Optimizer/Transforms/Passes.h"
20 using namespace mlir;
21 namespace fir {
22 namespace test {
23 void registerTestFIRAliasAnalysisPass();
24 } // namespace test
25 } // namespace fir
27 // Defined in mlir/test, no pulic header.
28 namespace mlir {
29 void registerSideEffectTestPasses();
32 int main(int argc, char **argv) {
33 fir::support::registerMLIRPassesForFortranTools();
34 fir::registerOptCodeGenPasses();
35 fir::registerOptTransformPasses();
36 hlfir::registerHLFIRPasses();
37 #ifdef FLANG_INCLUDE_TESTS
38 fir::test::registerTestFIRAliasAnalysisPass();
39 mlir::registerSideEffectTestPasses();
40 #endif
41 DialectRegistry registry;
42 fir::support::registerDialects(registry);
43 return failed(MlirOptMain(argc, argv, "FIR modular optimizer driver\n",
44 registry));