@@ -18,7 +18,7 @@ namespace {
1818
1919class IfPreprocessorCallbacks final : public PPCallbacks {
2020public:
21- IfPreprocessorCallbacks (ClangTidyCheck &Check, Preprocessor &PP)
21+ IfPreprocessorCallbacks (ClangTidyCheck &Check, const Preprocessor &PP)
2222 : Check(Check), PP(PP) {}
2323
2424 void If (SourceLocation Loc, SourceRange ConditionRange,
@@ -36,7 +36,7 @@ class IfPreprocessorCallbacks final : public PPCallbacks {
3636private:
3737 void impl (SourceLocation DirectiveLoc, SourceRange ConditionRange,
3838 const llvm::StringLiteral (&Replacements)[2]) {
39- StringRef Condition =
39+ const StringRef Condition =
4040 Lexer::getSourceText (CharSourceRange::getTokenRange (ConditionRange),
4141 PP.getSourceManager (), PP.getLangOpts ());
4242 Lexer Lex (DirectiveLoc, PP.getLangOpts (), Condition.data (),
@@ -73,7 +73,7 @@ class IfPreprocessorCallbacks final : public PPCallbacks {
7373
7474 if (Tok.isNot (tok::TokenKind::raw_identifier))
7575 return ;
76- StringRef Macro = Tok.getRawIdentifier ();
76+ const StringRef Macro = Tok.getRawIdentifier ();
7777
7878 while (!NoMoreTokens) {
7979 NoMoreTokens = Lex.LexFromRawLexer (Tok);
0 commit comments