This repository has been archived by the owner on Nov 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
mutator_module.cpp
42 lines (37 loc) · 2.04 KB
/
mutator_module.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "checks/and_to_or.h"
#include "checks/eq_to_neq.h"
#include "checks/false_to_true.h"
#include "checks/greater_eq_to_less_eq.h"
#include "checks/greater_to_less.h"
#include "checks/less_eq_to_greater_eq.h"
#include "checks/less_to_greater.h"
#include "checks/neq_to_eq.h"
#include "checks/or_to_and.h"
#include "checks/true_to_false.h"
#include "../clang-tidy/ClangTidy.h"
#include "clang-tidy/ClangTidyModule.h"
#include "clang-tidy/ClangTidyModuleRegistry.h"
namespace clang::tidy {
namespace mutator {
class MutatorModule : public ClangTidyModule {
public:
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
CheckFactories.registerCheck<MutatorAndToOr>("mutator-and-to-or");
CheckFactories.registerCheck<MutatorOrToAnd>("mutator-or-to-and");
CheckFactories.registerCheck<MutatorEqToNeq>("mutator-eq-to-neq");
CheckFactories.registerCheck<MutatorNeqToEq>("mutator-neq-to-eq");
CheckFactories.registerCheck<MutatorTrueToFalse>("mutator-true-to-false");
CheckFactories.registerCheck<MutatorFalseToTrue>("mutator-false-to-true");
CheckFactories.registerCheck<MutatorGreaterToLess>("mutator-greater-to-less");
CheckFactories.registerCheck<MutatorLessToGreater>("mutator-less-to-greater");
CheckFactories.registerCheck<MutatorGreaterEqToLessEq>("mutator-greater-eq-to-less-eq");
CheckFactories.registerCheck<MutatorLessEqToGreaterEq>("mutator-less-eq-to-greater-eq");
}
};
// Register the ReadabilityModule using this statically initialized variable.
static ClangTidyModuleRegistry::Add<MutatorModule> X("mutator-module", "Adds mutators.");
} // namespace mutator
// This anchor is used to force the linker to link in the generated object file
// and thus register the ReadabilityModule.
volatile int MutatorModuleAnchorSource = 0;
} // namespace clang::tidy