Commit graph

11 commits

Author SHA1 Message Date
serge-sans-paille
d47ee525f9 [clang-tooling] Prevent llvm::fatal_error on invalid CLI option
Fail gracefully instead. Prevent further misuse by enforcing the factory builder
instead of the constructor.

Differential Revision: https://reviews.llvm.org/D94420
2021-01-29 10:15:06 +01:00
Eric Christopher
a1469914fd Update error to read a little better when an error occurs. 2020-06-19 23:34:30 -07:00
Eric Christopher
25ed42f05d [clang-change-namespace] As part of using inclusive language
within the llvm project, migrate away from the use of blacklist
and whitelist.
2020-06-19 23:01:42 -07:00
Johannes Doerfert
f9d558c871 [OpenMP] "UnFix" layering problem with FrontendOpenMP
This reverts commit 97aa593a83 as it
causes problems (PR45453) https://reviews.llvm.org/D77574#1966321.

This additionally adds an explicit reference to FrontendOpenMP to
clang-tidy where ASTMatchers is used.

This is hopefully just a temporary solution. The dependence on
`FrontendOpenMP` from `ASTMatchers` should be handled by CMake
implicitly, not us explicitly.

Reviewed By: aheejin

Differential Revision: https://reviews.llvm.org/D77666
2020-04-07 14:41:18 -05:00
Benjamin Kramer
adcd026838 Make llvm::StringRef to std::string conversions explicit.
This is how it should've been and brings it more in line with
std::string_view. There should be no functional change here.

This is mostly mechanical from a custom clang-tidy check, with a lot of
manual fixups. It uncovers a lot of minor inefficiencies.

This doesn't actually modify StringRef yet, I'll do that in a follow-up.
2020-01-28 23:25:25 +01:00
Nico Weber
6f773205cd Revert "Use InitLLVM to setup a pretty stack printer"
This reverts commit 3f76260dc0.
Breaks at least these tests on Windows:
    Clang :: Driver/clang-offload-bundler.c
    Clang :: Driver/clang-offload-wrapper.c
2019-11-25 21:06:56 -05:00
Rui Ueyama
3f76260dc0 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
2019-11-26 10:56:10 +09:00
Michal Gorny
0820041e1d [clang-tools-extra] [cmake] Link against libclang-cpp whenever possible
Use clang_target_link_libraries() in order to support linking against
libclang-cpp instead of static libraries.

Differential Revision: https://reviews.llvm.org/D68448

llvm-svn: 373786
2019-10-04 20:30:02 +00:00
Michal Gorny
cb46b69e3e [clang-tools-extra] [cmake] Use add_clang_tool() to install tools
Replace add_clang_executable() calls with add_clang_tool() that takes
care of creating correct, distribution-friendly install target.  While
at it, remove redundant install calls.

This change also causes clang-move and pp-trace to be installed.

Differential Revision: https://reviews.llvm.org/D68423

llvm-svn: 373694
2019-10-04 05:40:29 +00:00
Harlan Haskins
a02f85768d [clang-tools-extra] Adopt FileManager's error-returning APIs
The FileManager has been updated to return llvm::ErrorOr from getFile
and getDirectory, this commit updates all the callers of those APIs from
clang.

llvm-svn: 367617
2019-08-01 21:32:01 +00:00
Nico Weber
5f5a74582f Rename directory housing clang-change-namespace to be eponymous
Makes the name of this directory consistent with the names of the other
directories in clang-tools-extra.

Differential Revision: https://reviews.llvm.org/D59382

llvm-svn: 356254
2019-03-15 11:54:01 +00:00