Print stack trace for clang-move tool.
authorEric Liu <ioeric@google.com>
Thu, 13 Oct 2016 19:04:19 +0000 (19:04 +0000)
committerEric Liu <ioeric@google.com>
Thu, 13 Oct 2016 19:04:19 +0000 (19:04 +0000)
llvm-svn: 284148

clang-tools-extra/clang-move/tool/ClangMoveMain.cpp

index 91677d7..3787e94 100644 (file)
 #include "clang/Tooling/Tooling.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Path.h"
 #include "llvm/Support/Process.h"
+#include "llvm/Support/Signals.h"
 #include "llvm/Support/YAMLTraits.h"
-#include "llvm/Support/Path.h"
 #include <set>
 #include <string>
 
@@ -72,6 +73,7 @@ cl::opt<bool> Dump("dump_result",
 } // namespace
 
 int main(int argc, const char **argv) {
+  llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);
   // Add "-fparse-all-comments" compile option to make clang parse all comments,
   // otherwise, ordinary comments like "//" and "/*" won't get parsed (This is
   // a bit of hacky).