[clang] 5c683d9 - [clang][NFC] Remove redundant annotation check in AvoidConcat (#238661)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 4 20:58:15 PST 2026
Author: Chen Miao
Date: 2026-11-05T12:58:10+08:00
New Revision: 5c683d9f97c5b41f8199260da627a53f2415bd9f
URL: https://github.com/llvm/llvm-project/commit/5c683d9f97c5b41f8199260da627a53f2415bd9f
DIFF: https://github.com/llvm/llvm-project/commit/5c683d9f97c5b41f8199260da627a53f2415bd9f.diff
LOG: [clang][NFC] Remove redundant annotation check in AvoidConcat (#238661)
Annotation tokens already return early in AvoidConcat, so PrevTok cannot
be an annotation when getIdentifierInfo() is reached. Remove the
redundant check.
Added:
Modified:
clang/lib/Lex/TokenConcatenation.cpp
Removed:
################################################################################
diff --git a/clang/lib/Lex/TokenConcatenation.cpp b/clang/lib/Lex/TokenConcatenation.cpp
index 2507fa4358893..0c7b70456a9ba 100644
--- a/clang/lib/Lex/TokenConcatenation.cpp
+++ b/clang/lib/Lex/TokenConcatenation.cpp
@@ -180,7 +180,7 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevPrevTok,
return false;
tok::TokenKind PrevKind = PrevTok.getKind();
- if (!PrevTok.isAnnotation() && PrevTok.getIdentifierInfo())
+ if (PrevTok.getIdentifierInfo())
PrevKind = tok::identifier; // Language keyword or named operator.
// Look up information on when we should avoid concatenation with prevtok.
More information about the cfe-commits
mailing list