llvm-project/clang-tools-extra/clang-tidy
Nathan James 8a548bc203
[clang-tidy] modernize-loop-convert reverse iteration support
Enables support for transforming loops of the form
```
for (auto I = Cont.rbegin(), E = Cont.rend(); I != E;++I)
```

This is done automatically in C++20 mode using `std::ranges::reverse_view` but there are options to specify a different function to reverse iterator over a container.
This is the first step, down the line I'd like to possibly extend this support for array based loops
```
for (unsigned I = Arr.size() - 1;I >=0;--I) Arr[I]...
```

Currently if you pass a reversing function with no header in the options it will just assume that the function exists, however as we have the ASTContext it may be as wise to check before applying, or at least lower the confidence level if we can't find it.

Reviewed By: alexfh

Differential Revision: https://reviews.llvm.org/D82089
2020-10-16 14:16:30 +01:00
..
abseil [clang-tidy] IncludeInserter: allow <> in header name 2020-09-28 15:14:04 +02:00
altera [clang-tidy] Fix linking for FrontendOpenMP 2020-09-08 09:22:22 -07:00
android Allow to specify macro names for android-comparison-in-temp-failure-retry 2020-10-01 10:09:26 -07:00
boost
bugprone clang-{tools,unittests}: Stop using SourceManager::getBuffer, NFC 2020-10-15 00:35:16 -04:00
cert
cppcoreguidelines [clang-tidy] IncludeInserter: allow <> in header name 2020-09-28 15:14:04 +02:00
darwin
fuchsia
google [clang-tidy] Remove obsolete checker google-runtime-references 2020-10-06 14:03:55 +02:00
hicpp
linuxkernel
llvm
llvmlibc
misc clang-{tools,unittests}: Stop using SourceManager::getBuffer, NFC 2020-10-15 00:35:16 -04:00
modernize [clang-tidy] modernize-loop-convert reverse iteration support 2020-10-16 14:16:30 +01:00
mpi
objc
openmp
performance [clang-tidy] IncludeInserter: allow <> in header name 2020-09-28 15:14:04 +02:00
plugin
portability
readability clang-{tools,unittests}: Stop using SourceManager::getBuffer, NFC 2020-10-15 00:35:16 -04:00
tool
utils Support ObjC in IncludeInserter 2020-10-16 04:12:32 +02:00
zircon
CMakeLists.txt Add an explicit toggle for the static analyzer in clang-tidy 2020-09-10 10:48:17 -04:00
ClangTidy.cpp Add an explicit toggle for the static analyzer in clang-tidy 2020-09-10 10:48:17 -04:00
ClangTidy.h
ClangTidyCheck.cpp
ClangTidyCheck.h
ClangTidyDiagnosticConsumer.cpp clang/Basic: Replace ContentCache::getBuffer with Optional semantics 2020-10-14 15:55:18 -04:00
ClangTidyDiagnosticConsumer.h
ClangTidyForceLinker.h Add an explicit toggle for the static analyzer in clang-tidy 2020-09-10 10:48:17 -04:00
ClangTidyModule.cpp
ClangTidyModule.h
ClangTidyModuleRegistry.h
ClangTidyOptions.cpp
ClangTidyOptions.h
ClangTidyProfiling.cpp
ClangTidyProfiling.h
ExpandModularHeadersPPCallbacks.cpp
ExpandModularHeadersPPCallbacks.h
GlobList.cpp
GlobList.h
add_new_check.py
clang-tidy-config.h.cmake Add an explicit toggle for the static analyzer in clang-tidy 2020-09-10 10:48:17 -04:00
rename_check.py