backes wrote: Thanks for the review! I pushed a follow-up that significantly simplifies the implementation and trims the diff (production diff is now +80/-26):
- **No loop reordering**: Instead of moving `updateParameterCount` or the `CanBeExpression` reset past `parseParens()` in `TokenAnnotator`, both now inspect the previous token (`TT_TrailingCommaVaOptRParen`) in place, leaving all non-`__VA_OPT__` control flow in `parseAngle`, `parseParens`, and `parseBrace` untouched. - **Trimmed speculative/marginal hunks**: Dropped several untested or out-of-scope branches (e.g., `ExpressionParser` ternary/operator tweaks, `ContinuationIndenter` heuristics, and the dead `HasMultipleParametersOnALine` check inside `#define`) and tightened the tests to focus on the exercised code paths. - **Edge-case fixes found during review**: - Guarded `setType` calls against overwriting finalized `TT_TrailingCommaVaOptRParen` (and skipped classifying `__VA_OPT__` when already finalized via `AttributeMacros`), preventing assertion crashes in ObjC/operator/`AttributeMacros` edge cases. - Preserved idempotency in `UnwrappedLineParser` when a statement starts with a trailing-comma `__VA_OPT__`. - Avoided breaking before an outer `)` under `BinPackParameters: AlwaysOnePerLine` when a trailing-comma `__VA_OPT__` is the last parameter. Turns out if you push AI to try hard to simplify, it can actually produce much smaller and more self-contained code. Ready for another look! https://github.com/llvm/llvm-project/pull/240902 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
