From 17ec7ab722aaa3c98b33b489866b8bc830a93acc Mon Sep 17 00:00:00 2001 From: Jacques Pienaar Date: Mon, 19 Dec 2022 13:05:07 -0800 Subject: [PATCH] Set error message for where to report bugs (#11602) Avoids recommending filing bugs with LLVM project for IREE project tooling. --- .../src/iree/compiler/API2/Internal/IREEOptToolEntryPoint.cpp | 3 +++ compiler/src/iree/compiler/API2/Internal/LLDToolEntryPoint.cpp | 3 +++ compiler/src/iree/compiler/Tools/iree_compile_lib.cc | 3 +++ .../tensorflow/iree_tf_compiler/iree-import-tf-main.cpp | 3 +++ .../tensorflow/iree_tf_compiler/iree-import-tflite-main.cpp | 3 +++ .../tensorflow/iree_tf_compiler/iree-import-xla-main.cpp | 3 +++ .../tensorflow/iree_tf_compiler/iree-opt-tflite-main.cpp | 3 +++ integrations/tensorflow/iree_tf_compiler/iree-tf-opt-main.cpp | 3 +++ tools/iree-run-mlir-main.cc | 3 +++ 9 files changed, 27 insertions(+) diff --git a/compiler/src/iree/compiler/API2/Internal/IREEOptToolEntryPoint.cpp b/compiler/src/iree/compiler/API2/Internal/IREEOptToolEntryPoint.cpp index 1d4602dd12dc..2c3a06c2f7dd 100644 --- a/compiler/src/iree/compiler/API2/Internal/IREEOptToolEntryPoint.cpp +++ b/compiler/src/iree/compiler/API2/Internal/IREEOptToolEntryPoint.cpp @@ -18,6 +18,9 @@ #include "mlir/Tools/mlir-opt/MlirOptMain.h" int ireeOptRunMain(int argc, char **argv) { + llvm::setBugReportMsg( + "Please report issues to https://github.com/iree-org/iree/issues and " + "include the crash backtrace.\n"); llvm::InitLLVM y(argc, argv); mlir::DialectRegistry registry; diff --git a/compiler/src/iree/compiler/API2/Internal/LLDToolEntryPoint.cpp b/compiler/src/iree/compiler/API2/Internal/LLDToolEntryPoint.cpp index 37521ab115f9..4e5b645bbd2a 100644 --- a/compiler/src/iree/compiler/API2/Internal/LLDToolEntryPoint.cpp +++ b/compiler/src/iree/compiler/API2/Internal/LLDToolEntryPoint.cpp @@ -69,6 +69,9 @@ static Flavor parseFlavor(std::vector &v) { } int ireeCompilerRunLldMain(int argc, char **argv) { + llvm::setBugReportMsg( + "Please report issues to https://github.com/iree-org/iree/issues and " + "include the crash backtrace.\n"); InitLLVM x(argc, argv); sys::Process::UseANSIEscapeCodes(true); bool exitEarly = true; diff --git a/compiler/src/iree/compiler/Tools/iree_compile_lib.cc b/compiler/src/iree/compiler/Tools/iree_compile_lib.cc index 37884b3f1a13..220ae7afd171 100644 --- a/compiler/src/iree/compiler/Tools/iree_compile_lib.cc +++ b/compiler/src/iree/compiler/Tools/iree_compile_lib.cc @@ -49,6 +49,9 @@ enum class CompileMode { } // namespace mlir int mlir::iree_compiler::runIreecMain(int argc, char **argv) { + llvm::setBugReportMsg( + "Please report issues to https://github.com/iree-org/iree/issues and " + "include the crash backtrace.\n"); llvm::InitLLVM y(argc, argv); static llvm::cl::OptionCategory mainOptions("IREE Main Options"); ireeCompilerGlobalInitialize(/*initializeCommandLine=*/true); diff --git a/integrations/tensorflow/iree_tf_compiler/iree-import-tf-main.cpp b/integrations/tensorflow/iree_tf_compiler/iree-import-tf-main.cpp index 6962815df958..235a1e4585a9 100644 --- a/integrations/tensorflow/iree_tf_compiler/iree-import-tf-main.cpp +++ b/integrations/tensorflow/iree_tf_compiler/iree-import-tf-main.cpp @@ -129,6 +129,9 @@ static OwningOpRef importSavedModelV1( int main(int argc, char **argv) { tensorflow::InitMlir y(&argc, &argv); + llvm::setBugReportMsg( + "Please report issues to https://github.com/iree-org/iree/issues and " + "include the crash backtrace.\n"); static cl::opt inputPath( cl::Positional, cl::desc(""), cl::Required); diff --git a/integrations/tensorflow/iree_tf_compiler/iree-import-tflite-main.cpp b/integrations/tensorflow/iree_tf_compiler/iree-import-tflite-main.cpp index 664cf3796954..a17238a0c61b 100644 --- a/integrations/tensorflow/iree_tf_compiler/iree-import-tflite-main.cpp +++ b/integrations/tensorflow/iree_tf_compiler/iree-import-tflite-main.cpp @@ -36,6 +36,9 @@ enum class OutputFormat { }; int main(int argc, char **argv) { + llvm::setBugReportMsg( + "Please report issues to https://github.com/iree-org/iree/issues and " + "include the crash backtrace.\n"); llvm::InitLLVM y(argc, argv); static cl::opt inputPath( diff --git a/integrations/tensorflow/iree_tf_compiler/iree-import-xla-main.cpp b/integrations/tensorflow/iree_tf_compiler/iree-import-xla-main.cpp index a7da555946f5..5f57245c0eff 100644 --- a/integrations/tensorflow/iree_tf_compiler/iree-import-xla-main.cpp +++ b/integrations/tensorflow/iree_tf_compiler/iree-import-xla-main.cpp @@ -103,6 +103,9 @@ LogicalResult ReadHloTextFormatFromStream(std::istream *in, } // namespace int main(int argc, char **argv) { + llvm::setBugReportMsg( + "Please report issues to https://github.com/iree-org/iree/issues and " + "include the crash backtrace.\n"); llvm::InitLLVM y(argc, argv); static cl::opt inputPath( diff --git a/integrations/tensorflow/iree_tf_compiler/iree-opt-tflite-main.cpp b/integrations/tensorflow/iree_tf_compiler/iree-opt-tflite-main.cpp index 044ebdbcfb8c..d1248b4f1f6d 100644 --- a/integrations/tensorflow/iree_tf_compiler/iree-opt-tflite-main.cpp +++ b/integrations/tensorflow/iree_tf_compiler/iree-opt-tflite-main.cpp @@ -23,6 +23,9 @@ #include "tensorflow/compiler/mlir/tosa/transforms/passes.h" int main(int argc, char **argv) { + llvm::setBugReportMsg( + "Please report issues to https://github.com/iree-org/iree/issues and " + "include the crash backtrace.\n"); llvm::InitLLVM y(argc, argv); mlir::DialectRegistry registry; diff --git a/integrations/tensorflow/iree_tf_compiler/iree-tf-opt-main.cpp b/integrations/tensorflow/iree_tf_compiler/iree-tf-opt-main.cpp index 5fd5a042d22d..5da1227f9088 100644 --- a/integrations/tensorflow/iree_tf_compiler/iree-tf-opt-main.cpp +++ b/integrations/tensorflow/iree_tf_compiler/iree-tf-opt-main.cpp @@ -27,6 +27,9 @@ #include "tensorflow/compiler/mlir/tosa/transforms/passes.h" int main(int argc, char **argv) { + llvm::setBugReportMsg( + "Please report issues to https://github.com/iree-org/iree/issues and " + "include the crash backtrace.\n"); llvm::InitLLVM y(argc, argv); mlir::DialectRegistry registry; diff --git a/tools/iree-run-mlir-main.cc b/tools/iree-run-mlir-main.cc index bc46dd904580..ba7ffee3d735 100644 --- a/tools/iree-run-mlir-main.cc +++ b/tools/iree-run-mlir-main.cc @@ -573,6 +573,9 @@ extern "C" int main(int argc_llvm, char** argv_llvm) { // On Windows InitLLVM re-queries the command line from Windows directly and // totally messes up the array. + llvm::setBugReportMsg( + "Please report issues to https://github.com/iree-org/iree/issues and " + "include the crash backtrace.\n"); llvm::InitLLVM init_llvm(argc_llvm, argv_llvm); llvm::cl::ParseCommandLineOptions(argc_llvm, argv_llvm);