[clang] [clang-format] Recognize TableGen paste operator on separate line (PR #133722)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 4 07:30:34 PDT 2025
================
@@ -4853,9 +4853,16 @@ void UnwrappedLineParser::readToken(int LevelDifference) {
PreviousWasComment = FormatTok->is(tok::comment);
while (!Line->InPPDirective && FormatTok->is(tok::hash) &&
- (!Style.isVerilog() ||
- Keywords.isVerilogPPDirective(*Tokens->peekNextToken())) &&
FirstNonCommentOnLine) {
+ // In Verilog, the backtick is used for macro invocations. In TableGen,
+ // the single hash is used for the paste operator.
+ const FormatToken *Next = Tokens->peekNextToken();
+ assert(Next); // There is an EOF token at the end.
----------------
sstwcw wrote:
I thought that asserts were for things that never happen. So I added one. Is this something that should happen even less so that asserts are no good?
https://github.com/llvm/llvm-project/pull/133722
More information about the cfe-commits
mailing list