[mlir][NFC] Move MlirOptMain to the Tools/ directory

MlirOptMain is currently awkwardly shoved into mlir/Support. This commit
moves it to the Tools/ directory, which is intended for libraries used to
implement tools.

Differential Revision: https://reviews.llvm.org/D121025
This commit is contained in:
River Riddle 2022-03-04 13:49:30 -08:00
parent 9eaff42360
commit 6b7d211a1b
8 changed files with 19 additions and 20 deletions

View file

@ -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"

View file

@ -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"

View file

@ -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 @@ inline int asMainReturnCode(LogicalResult r) {
} // namespace mlir
#endif // MLIR_SUPPORT_MLIROPTMAIN_H
#endif // MLIR_TOOLS_MLIROPT_MLIROPTMAIN_H

View file

@ -3,7 +3,6 @@ set(LLVM_OPTIONAL_SOURCES
FileUtilities.cpp
IndentedOstream.cpp
InterfaceSupport.cpp
MlirOptMain.cpp
StorageUniquer.cpp
Timing.cpp
ToolUtilities.cpp
@ -24,18 +23,6 @@ add_mlir_library(MLIRSupport
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

View file

@ -1,3 +1,4 @@
add_subdirectory(mlir-lsp-server)
add_subdirectory(mlir-opt)
add_subdirectory(mlir-reduce)
add_subdirectory(PDLL)

View file

@ -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
)

View file

@ -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"

View file

@ -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"