From a7acba29c19ac67c77ed282ec9432602ae21268d Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 28 Nov 2019 13:50:35 +0900 Subject: [PATCH] Use InitLLVM in clang-tidy Update clang-tidy to use InitLLVM, like several other llvm tools that were previously updated. On Windows, this allows clang-tidy to operate on arguments containing characters which cannot be represented in the system's ANSI code page such as filenames with Unicode characters. Fixes bugzilla bug 43751. Patch by Tristan Labelle. Differential Revision: https://reviews.llvm.org/D70694 --- clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp b/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp index df83de8..ad6182d 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 BaseFS( -- 2.7.4