summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2019-11-26 10:15:47 +0900
committerRui Ueyama <ruiu@google.com>2019-11-26 10:56:10 +0900
commit3f76260dc0674cc0acb25f550a0f0c594cf537ea (patch)
treec85ddc69df1991d41efed7219820b7a1e47a085d /clang-tools-extra/clang-tidy
parent06d1110584c516e774cad7637ce8eadfcc06e233 (diff)
downloadbcm5719-llvm-3f76260dc0674cc0acb25f550a0f0c594cf537ea.tar.gz
bcm5719-llvm-3f76260dc0674cc0acb25f550a0f0c594cf537ea.zip
Use InitLLVM to setup a pretty stack printer
InitLLVM does not only save a few lines from main() but also makes the commands do the right thing for multibyte character pathnames on Windows (i.e. canonicalize argv's to UTF-8) because of the code we have in this file: https://github.com/llvm/llvm-project/blob/master/llvm/lib/Support/InitLLVM.cpp#L32 For many LLVM commands, we already have calls of InitLLVM, but there are still remainings. Differential Revision: https://reviews.llvm.org/D70702
Diffstat (limited to 'clang-tools-extra/clang-tidy')
-rw-r--r--clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
index df83de85623..ad6182def20 100644
--- a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
+++ b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
@@ -18,6 +18,7 @@
#include "../ClangTidyForceLinker.h"
#include "../GlobList.h"
#include "clang/Tooling/CommonOptionsParser.h"
+#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/TargetSelect.h"
@@ -327,7 +328,7 @@ getVfsFromFile(const std::string &OverlayFile,
}
static int clangTidyMain(int argc, const char **argv) {
- llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);
+ llvm::InitLLVM X(argc, argv);
CommonOptionsParser OptionsParser(argc, argv, ClangTidyCategory,
cl::ZeroOrMore);
llvm::IntrusiveRefCntPtr<vfs::OverlayFileSystem> BaseFS(
OpenPOWER on IntegriCloud