diff --git a/flang/tools/fir-opt/fir-opt.cpp b/flang/tools/fir-opt/fir-opt.cpp --- a/flang/tools/fir-opt/fir-opt.cpp +++ b/flang/tools/fir-opt/fir-opt.cpp @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "mlir/Support/MlirOptMain.h" +#include "mlir/Tools/mlir-opt/MlirOptMain.h" #include "flang/Optimizer/CodeGen/CodeGen.h" #include "flang/Optimizer/Support/InitFIR.h" #include "flang/Optimizer/Transforms/Passes.h" diff --git a/mlir/examples/standalone/standalone-opt/standalone-opt.cpp b/mlir/examples/standalone/standalone-opt/standalone-opt.cpp --- a/mlir/examples/standalone/standalone-opt/standalone-opt.cpp +++ b/mlir/examples/standalone/standalone-opt/standalone-opt.cpp @@ -14,7 +14,7 @@ #include "mlir/Pass/Pass.h" #include "mlir/Pass/PassManager.h" #include "mlir/Support/FileUtilities.h" -#include "mlir/Support/MlirOptMain.h" +#include "mlir/Tools/mlir-opt/MlirOptMain.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/InitLLVM.h" #include "llvm/Support/SourceMgr.h" diff --git a/mlir/include/mlir/Support/MlirOptMain.h b/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h rename from mlir/include/mlir/Support/MlirOptMain.h rename to mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h --- a/mlir/include/mlir/Support/MlirOptMain.h +++ b/mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h @@ -10,8 +10,8 @@ // //===----------------------------------------------------------------------===// -#ifndef MLIR_SUPPORT_MLIROPTMAIN_H -#define MLIR_SUPPORT_MLIROPTMAIN_H +#ifndef MLIR_TOOLS_MLIROPT_MLIROPTMAIN_H +#define MLIR_TOOLS_MLIROPT_MLIROPTMAIN_H #include "mlir/Support/LogicalResult.h" #include "llvm/ADT/StringRef.h" @@ -95,4 +95,4 @@ } // namespace mlir -#endif // MLIR_SUPPORT_MLIROPTMAIN_H +#endif // MLIR_TOOLS_MLIROPT_MLIROPTMAIN_H diff --git a/mlir/lib/Support/CMakeLists.txt b/mlir/lib/Support/CMakeLists.txt --- a/mlir/lib/Support/CMakeLists.txt +++ b/mlir/lib/Support/CMakeLists.txt @@ -3,7 +3,6 @@ FileUtilities.cpp IndentedOstream.cpp InterfaceSupport.cpp - MlirOptMain.cpp StorageUniquer.cpp Timing.cpp ToolUtilities.cpp @@ -24,18 +23,6 @@ LINK_LIBS PUBLIC ${LLVM_PTHREAD_LIB}) -add_mlir_library(MLIROptLib - MlirOptMain.cpp - - ADDITIONAL_HEADER_DIRS - ${MLIR_MAIN_INCLUDE_DIR}/mlir/Support - - LINK_LIBS PUBLIC - MLIRPass - MLIRParser - MLIRSupport - ) - # This doesn't use add_mlir_library as it is used in mlir-tblgen and else # mlir-tblgen ends up depending on mlir-generic-headers. add_llvm_library(MLIRSupportIndentedOstream diff --git a/mlir/lib/Tools/CMakeLists.txt b/mlir/lib/Tools/CMakeLists.txt --- a/mlir/lib/Tools/CMakeLists.txt +++ b/mlir/lib/Tools/CMakeLists.txt @@ -1,3 +1,4 @@ add_subdirectory(mlir-lsp-server) +add_subdirectory(mlir-opt) add_subdirectory(mlir-reduce) add_subdirectory(PDLL) diff --git a/mlir/lib/Tools/mlir-opt/CMakeLists.txt b/mlir/lib/Tools/mlir-opt/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/mlir/lib/Tools/mlir-opt/CMakeLists.txt @@ -0,0 +1,11 @@ +add_mlir_library(MLIROptLib + MlirOptMain.cpp + + ADDITIONAL_HEADER_DIRS + ${MLIR_MAIN_INCLUDE_DIR}/mlir/Tools/mlir-opt + + LINK_LIBS PUBLIC + MLIRPass + MLIRParser + MLIRSupport + ) diff --git a/mlir/lib/Support/MlirOptMain.cpp b/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp rename from mlir/lib/Support/MlirOptMain.cpp rename to mlir/lib/Tools/mlir-opt/MlirOptMain.cpp --- a/mlir/lib/Support/MlirOptMain.cpp +++ b/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "mlir/Support/MlirOptMain.h" +#include "mlir/Tools/mlir-opt/MlirOptMain.h" #include "mlir/IR/AsmState.h" #include "mlir/IR/Attributes.h" #include "mlir/IR/BuiltinOps.h" diff --git a/mlir/tools/mlir-opt/mlir-opt.cpp b/mlir/tools/mlir-opt/mlir-opt.cpp --- a/mlir/tools/mlir-opt/mlir-opt.cpp +++ b/mlir/tools/mlir-opt/mlir-opt.cpp @@ -18,7 +18,7 @@ #include "mlir/Pass/Pass.h" #include "mlir/Pass/PassManager.h" #include "mlir/Support/FileUtilities.h" -#include "mlir/Support/MlirOptMain.h" +#include "mlir/Tools/mlir-opt/MlirOptMain.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/InitLLVM.h" #include "llvm/Support/SourceMgr.h"