aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp
diff options
context:
space:
mode:
authorNathan James <n.james93@hotmail.co.uk>2020-03-03 16:39:32 +0000
committerNathan James <n.james93@hotmail.co.uk>2020-03-03 16:43:45 +0000
commite40a742a5008c5a4cf647c0ea805486498786393 (patch)
treee22cb5a7fa2803b5a75d40469d6519d7de6568f6 /clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp
parentb4b9fa5e11abab38e4f5dcd65b57c0226a0aee15 (diff)
downloadllvm-e40a742a5008c5a4cf647c0ea805486498786393.zip
llvm-e40a742a5008c5a4cf647c0ea805486498786393.tar.gz
llvm-e40a742a5008c5a4cf647c0ea805486498786393.tar.bz2
[clang-tidy] Change checks to use new isLanguageVersionSupported restriction
Summary: Modifies all checks that are language version dependent to use `isLanguageVersionSupported` Reviewers: jdoerfert, lebedev.ri, aaron.ballman, gribozavr2, Eugene.Zelenko Reviewed By: gribozavr2 Subscribers: wuzish, nemanjai, xazax.hun, hiraditya, kbarton, steven_wu, dexonsmith, arphaman, lebedev.ri, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D75340
Diffstat (limited to 'clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp10
1 files changed, 0 insertions, 10 deletions
diff --git a/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp b/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp
index a7a78ec..99f1380 100644
--- a/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cert/SetLongJmpCheck.cpp
@@ -44,22 +44,12 @@ public:
void SetLongJmpCheck::registerPPCallbacks(const SourceManager &SM,
Preprocessor *PP,
Preprocessor *ModuleExpanderPP) {
- // This checker only applies to C++, where exception handling is a superior
- // solution to setjmp/longjmp calls.
- if (!getLangOpts().CPlusPlus)
- return;
-
// Per [headers]p5, setjmp must be exposed as a macro instead of a function,
// despite the allowance in C for setjmp to also be an extern function.
PP->addPPCallbacks(std::make_unique<SetJmpMacroCallbacks>(*this));
}
void SetLongJmpCheck::registerMatchers(MatchFinder *Finder) {
- // This checker only applies to C++, where exception handling is a superior
- // solution to setjmp/longjmp calls.
- if (!getLangOpts().CPlusPlus)
- return;
-
// In case there is an implementation that happens to define setjmp as a
// function instead of a macro, this will also catch use of it. However, we
// are primarily searching for uses of longjmp.