Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set error message for where to report bugs #11602

Merged
merged 3 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
8 changes: 7 additions & 1 deletion tools/iree-opt-main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,11 @@
// Based on mlir-opt but registers the passes and dialects we care about.

#include "iree/compiler/API2/ToolEntryPoints.h"
#include "llvm/Support/PrettyStackTrace.h"

int main(int argc, char **argv) { return ireeOptRunMain(argc, argv); }
int main(int argc, char **argv) {
llvm::setBugReportMsg(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this calls the method in IREEOptToolEntryPoint.cpp so it shouldn't be needed here

"Please report issues to https://github.com/iree-org/iree/issues and "
"include the crash backtrace.\n");
return ireeOptRunMain(argc, argv);
}
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