Skip to content

Commit

Permalink
InitLLVM already initializes PrettyStackTraceProgram
Browse files Browse the repository at this point in the history
Remove extra PrettyStackTraceProgram and use InitLLVM consistently.

PiperOrigin-RevId: 264041205
  • Loading branch information
jpienaar authored and tensorflower-gardener committed Aug 18, 2019
1 parent 437400d commit 750dd80
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 10 deletions.
2 changes: 0 additions & 2 deletions lib/Support/JitRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/StringSaver.h"
#include "llvm/Support/TargetSelect.h"
Expand Down Expand Up @@ -263,7 +262,6 @@ static Error compileAndExecuteSingleFloatReturnFunction(
int mlir::JitRunnerMain(
int argc, char **argv,
llvm::function_ref<LogicalResult(mlir::ModuleOp)> mlirTransformer) {
llvm::PrettyStackTraceProgram x(argc, argv);
llvm::InitLLVM y(argc, argv);

initializeLLVM();
Expand Down
2 changes: 0 additions & 2 deletions tools/mlir-opt/mlir-opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "mlir/Support/MlirOptMain.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/ToolOutputFile.h"

Expand Down Expand Up @@ -60,7 +59,6 @@ static cl::opt<bool>
static std::vector<const PassRegistryEntry *> *passList;

int main(int argc, char **argv) {
llvm::PrettyStackTraceProgram x(argc, argv);
InitLLVM y(argc, argv);

// Register any pass manager command line options.
Expand Down
6 changes: 2 additions & 4 deletions tools/mlir-tblgen/mlir-tblgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Signals.h"
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Main.h"
Expand Down Expand Up @@ -79,13 +79,11 @@ static bool MlirTableGenMain(raw_ostream &os, RecordKeeper &records) {
}

int main(int argc, char **argv) {
sys::PrintStackTraceOnErrorSignal(argv[0]);
PrettyStackTraceProgram X(argc, argv);
llvm::InitLLVM y(argc, argv);
llvm::cl::opt<const mlir::GenInfo *, false, mlir::GenNameParser> generator(
"", llvm::cl::desc("Generator to run"));
cl::ParseCommandLineOptions(argc, argv);
::generator = generator.getValue();

llvm_shutdown_obj Y;
return TableGenMain(argv[0], &MlirTableGenMain);
}
2 changes: 0 additions & 2 deletions tools/mlir-translate/mlir-translate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "mlir/Support/LogicalResult.h"
#include "mlir/Support/TranslateClParser.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/PrettyStackTrace.h"

using namespace mlir;

Expand All @@ -37,7 +36,6 @@ static llvm::cl::opt<std::string>
llvm::cl::value_desc("filename"), llvm::cl::init("-"));

int main(int argc, char **argv) {
llvm::PrettyStackTraceProgram x(argc, argv);
llvm::InitLLVM y(argc, argv);

// Add flags for all the registered translations.
Expand Down

0 comments on commit 750dd80

Please sign in to comment.