//===- MlirQueryMain.cpp - MLIR Query main --------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file implements the general framework of the MLIR query tool. It // parses the command line arguments, parses the MLIR file and outputs the query // results. // //===----------------------------------------------------------------------===// #include "mlir/Tools/mlir-query/MlirQueryMain.h" #include "mlir/IR/BuiltinOps.h" #include "mlir/Parser/Parser.h" #include "mlir/Query/Query.h" #include "mlir/Query/QuerySession.h" #include "mlir/Support/FileUtilities.h" #include "llvm/LineEditor/LineEditor.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/InitLLVM.h" #include "llvm/Support/SourceMgr.h" //===----------------------------------------------------------------------===// // Query Parser //===----------------------------------------------------------------------===// llvm::LogicalResult mlir::mlirQueryMain(int argc, char **argv, MLIRContext &context, const mlir::query::matcher::Registry &matcherRegistry) { … }