@@ -20,13 +20,12 @@ namespace utils {
20
20
namespace {
21
21
using namespace ::clang::ast_matchers;
22
22
23
- using tooling::change;
24
- using tooling::IncludeFormat;
25
- using tooling::node;
26
- using tooling::RewriteRule;
27
- using tooling::statement;
28
- using tooling::text;
29
- using tooling::stencil::cat;
23
+ using transformer::cat;
24
+ using transformer::change;
25
+ using transformer::IncludeFormat;
26
+ using transformer::node;
27
+ using transformer::RewriteRule;
28
+ using transformer::statement;
30
29
31
30
// Invert the code of an if-statement, while maintaining its semantics.
32
31
RewriteRule invertIf () {
@@ -37,7 +36,7 @@ RewriteRule invertIf() {
37
36
change (
38
37
statement (RewriteRule::RootID),
39
38
cat (" if(!(" , node (C), " )) " , statement (E), " else " , statement (T))),
40
- text (" negate condition and reverse `then` and `else` branches" ));
39
+ cat (" negate condition and reverse `then` and `else` branches" ));
41
40
return Rule;
42
41
}
43
42
@@ -71,8 +70,8 @@ class IntLitCheck : public TransformerClangTidyCheck {
71
70
public:
72
71
IntLitCheck (StringRef Name, ClangTidyContext *Context)
73
72
: TransformerClangTidyCheck(tooling::makeRule(integerLiteral(),
74
- change (text (" LIT" )),
75
- text (" no message" )),
73
+ change (cat (" LIT" )),
74
+ cat (" no message" )),
76
75
Name, Context) {}
77
76
};
78
77
@@ -97,7 +96,7 @@ class BinOpCheck : public TransformerClangTidyCheck {
97
96
: TransformerClangTidyCheck(
98
97
tooling::makeRule (
99
98
binaryOperator (hasOperatorName(" +" ), hasRHS(expr().bind(" r" ))),
100
- change(node(" r" ), text (" RIGHT" )), text (" no message" )),
99
+ change(node(" r" ), cat (" RIGHT" )), cat (" no message" )),
101
100
Name, Context) {}
102
101
};
103
102
@@ -123,7 +122,7 @@ Optional<RewriteRule> needsObjC(const LangOptions &LangOpts,
123
122
if (!LangOpts.ObjC )
124
123
return None;
125
124
return tooling::makeRule (clang::ast_matchers::functionDecl (),
126
- change (cat (" void changed() {}" )), text (" no message" ));
125
+ change (cat (" void changed() {}" )), cat (" no message" ));
127
126
}
128
127
129
128
class NeedsObjCCheck : public TransformerClangTidyCheck {
@@ -148,7 +147,7 @@ Optional<RewriteRule> noSkip(const LangOptions &LangOpts,
148
147
if (Options.get (" Skip" , " false" ) == " true" )
149
148
return None;
150
149
return tooling::makeRule (clang::ast_matchers::functionDecl (),
151
- change (cat (" void nothing()" )), text (" no message" ));
150
+ change (cat (" void nothing()" )), cat (" no message" ));
152
151
}
153
152
154
153
class ConfigurableCheck : public TransformerClangTidyCheck {
@@ -176,7 +175,7 @@ RewriteRule replaceCall(IncludeFormat Format) {
176
175
using namespace ::clang::ast_matchers;
177
176
RewriteRule Rule =
178
177
tooling::makeRule (callExpr (callee (functionDecl (hasName (" f" )))),
179
- change (text (" other()" )), text (" no message" ));
178
+ change (cat (" other()" )), cat (" no message" ));
180
179
addInclude (Rule, " clang/OtherLib.h" , Format);
181
180
return Rule;
182
181
}
0 commit comments