diff options
author | Bruno Ricci <riccibrun@gmail.com> | 2018-10-27 19:21:19 +0000 |
---|---|---|
committer | Bruno Ricci <riccibrun@gmail.com> | 2018-10-27 19:21:19 +0000 |
commit | ff8ea9d01ccee4ebdead717d6c2d8ae893000d1f (patch) | |
tree | 0d5cead0f607095cb821b843666e327d7963d1c7 /clang-tidy/bugprone | |
parent | 9ce7d24dfa1ea15f9077ba3be3c9c57ad063fc22 (diff) |
[AST] Refactor PredefinedExpr
Make the following changes to PredefinedExpr:
1. Move PredefinedExpr below StringLiteral so that it can use its definition.
2. Rename IdentType to IdentKind to be more in line with clang's conventions,
and propagate the change to its users.
3. Move the location and the IdentKind into the newly available space of
the bit-fields of Stmt.
4. Only store the function name when needed. When parsing all of Boost,
of the 1357 PredefinedExpr 919 have no function name.
Differential Revision: https://reviews.llvm.org/D53605
Reviewed By: rjmccall
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@345460 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clang-tidy/bugprone')
-rw-r--r-- | clang-tidy/bugprone/LambdaFunctionNameCheck.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp b/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp index 55dbe8bf..bdb769dc 100644 --- a/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp +++ b/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp @@ -73,8 +73,8 @@ void LambdaFunctionNameCheck::registerPPCallbacks(CompilerInstance &Compiler) { void LambdaFunctionNameCheck::check(const MatchFinder::MatchResult &Result) { const auto *E = Result.Nodes.getNodeAs<PredefinedExpr>("E"); - if (E->getIdentType() != PredefinedExpr::Func && - E->getIdentType() != PredefinedExpr::Function) { + if (E->getIdentKind() != PredefinedExpr::Func && + E->getIdentKind() != PredefinedExpr::Function) { // We don't care about other PredefinedExprs. return; } @@ -91,7 +91,7 @@ void LambdaFunctionNameCheck::check(const MatchFinder::MatchResult &Result) { "inside a lambda, '%0' expands to the name of the function call " "operator; consider capturing the name of the enclosing function " "explicitly") - << PredefinedExpr::getIdentTypeName(E->getIdentType()); + << PredefinedExpr::getIdentKindName(E->getIdentKind()); } } // namespace bugprone |