[clang-tools-extra] [clang-tidy] [NFC] Move comment scanning to `LexerUtils` and add tests (PR #180371)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 9 06:39:56 PST 2026


================
@@ -14,13 +14,20 @@
 #include "clang/Lex/Lexer.h"
 #include <optional>
 #include <utility>
+#include <vector>
 
 namespace clang {
 
 class Stmt;
 
 namespace tidy::utils::lexer {
 
+// Represents a comment token and its source location in the original file.
+struct CommentToken {
+  SourceLocation Loc;
+  StringRef Text;
+};
+
----------------
vbvictor wrote:

Can we put this right above `getTrailingCommentsInRange` declaration for tight coupling of entities that are used together.

https://github.com/llvm/llvm-project/pull/180371


More information about the cfe-commits mailing list