Skip to content

Commit

Permalink
Set error message for where to report bugs (#11602)
Browse files Browse the repository at this point in the history
Avoids recommending filing bugs with LLVM project for IREE project tooling.
  • Loading branch information
jpienaar authored Dec 19, 2022
1 parent 742cf6a commit 17ec7ab
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ static Flavor parseFlavor(std::vector<const char *> &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;
Expand Down
3 changes: 3 additions & 0 deletions compiler/src/iree/compiler/Tools/iree_compile_lib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ static OwningOpRef<mlir::ModuleOp> 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<std::string> inputPath(
cl::Positional, cl::desc("<saved model directory>"), cl::Required);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> inputPath(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> inputPath(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions integrations/tensorflow/iree_tf_compiler/iree-tf-opt-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions tools/iree-run-mlir-main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 17ec7ab

Please sign in to comment.