Kazu Hirata
ba007a60d0
[clang-tidy] Remove unused includes (NFC) ( #141420 )
...
These are identified by misc-include-cleaner. I've filtered out those
that break builds. Also, I'm staying away from llvm-config.h,
config.h, and Compiler.h, which likely cause platform- or
compiler-specific build failures.
2025-05-25 10:55:36 -07:00
Piotr Zegar
11a411a49b
Revert "[clang-tidy][NFC] Remove duplicated code"
...
This reverts commit b6f6be4b500ff64c23a5103ac3311cb74519542f.
2024-03-31 15:06:49 +00:00
Piotr Zegar
b6f6be4b50
[clang-tidy][NFC] Remove duplicated code
...
Remove duplicated matchers by moving some of them to
utils/Matchers.h. Add some anonymous namespaces and
renamed some code to avoid ODR issues.
2024-03-31 14:58:27 +00:00
Carlos Galvez
7d2ea6c422
[clang-tidy][NFC] Use C++17 nested namespaces in the clang-tidy folder
...
Fix applied by running:
run-clang-tidy.py -checks=-*,modernize-concat-nested-namespaces
Differential Revision: https://reviews.llvm.org/D141770
2023-01-14 18:51:39 +00:00
Kazu Hirata
f71ffd3b73
[clang-tools-extra] Use std::optional instead of llvm::Optional (NFC)
...
This patch replaces (llvm::|)Optional< with std::optional<. I'll post
a separate patch to clean up the "using" declarations, #include
"llvm/ADT/Optional.h", etc.
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2023-01-07 20:19:42 -08:00
Kazu Hirata
71f557355d
[clang-tools-extra] Add #include <optional> (NFC)
...
This patch adds #include <optional> to those files containing
llvm::Optional<...> or Optional<...>.
I'll post a separate patch to actually replace llvm::Optional with
std::optional.
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2023-01-07 20:02:20 -08:00
Alexander Kornienko
ab2d3ce47d
[clang-tidy] Applied clang-tidy fixes. NFC
...
Applied fixes enabled by the LLVM's .clang-tidy configs. Reverted files where
fixes introduced compile errors:
clang-tools-extra/clang-tidy/hicpp/NoAssemblerCheck.cpp
clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp
$ clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -fix clang-tools-extra/clang-tidy/
Enabled checks:
llvm-else-after-return
llvm-header-guard
llvm-include-order
llvm-namespace-comment
llvm-prefer-isa-or-dyn-cast-in-conditionals
llvm-prefer-register-over-unsigned
llvm-qualified-auto
llvm-twine-local
misc-definitions-in-headers
misc-misplaced-const
misc-new-delete-overloads
misc-no-recursion
misc-non-copyable-objects
misc-redundant-expression
misc-static-assert
misc-throw-by-value-catch-by-reference
misc-unconventional-assign-operator
misc-uniqueptr-reset-release
misc-unused-alias-decls
misc-unused-using-decls
readability-identifier-naming
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D95614
2021-01-29 01:01:19 +01:00
Nathan James
860aefd078
[clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files
...
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D82661
2020-06-29 16:05:52 +01:00
Kazuaki Ishizaki
dd5571d51a
[clang-tools-extra] NFC: Fix trivial typo in documents and comments
...
Differential Revision: https://reviews.llvm.org/D77458
2020-04-05 15:28:40 +09:00
Benjamin Kramer
4e3f4f03f3
[ASTMatchers] StringRef'ify hasName
...
This was just inconvenient, and we make a copy anyways.
2020-01-29 10:53:08 +01: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
Kazuaki Ishizaki
b7ecf1c1c3
NFC: Fix trivial typos in comments
2020-01-04 10:28:41 -05:00
Dmitri Gribenko
0030306555
[clang-tidy] Fixed abseil-time-subtraction to work on C++17
...
Summary: Fixed abseil-time-subtraction to work on C++17
Reviewers: hokein, gribozavr
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63261
Patch by Johan Vikström.
llvm-svn: 363272
2019-06-13 15:11:02 +00:00
Hyrum Wright
c526e02668
[clang-tidy] Add the abseil-time-subtraction check
...
Differential Revision: https://reviews.llvm.org/D58137
llvm-svn: 355024
2019-02-27 20:08:50 +00:00