[clang-tools-extra] [clang-reorder-fields] Move trailing comments. (PR #122918)
Alexander Shaposhnikov via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 14 19:48:16 PST 2025
================
@@ -116,26 +118,78 @@ findMembersUsedInInitExpr(const CXXCtorInitializer *Initializer,
return Results;
}
-/// Returns the full source range for the field declaration up to (not
-/// including) the trailing semicolumn, including potential macro invocations,
-/// e.g. `int a GUARDED_BY(mu);`.
+/// Returns the next token after `Loc` (including comment tokens).
+static std::optional<Token> getTokenAfter(SourceLocation Loc,
----------------
alexander-shaposhnikov wrote:
[follow-up idea] it looks like in clang-tidy there is a somewhat similar helper function findNextTokenIncludingComments
(in LexerUtils.h). Perhaps, if they could be unified / moved to a common place - this would be wonderful.
https://github.com/llvm/llvm-project/pull/122918
More information about the cfe-commits
mailing list