HomePhabricator

clang-format: Add new style option AlignConsecutiveMacros

Authored by sammccall on Jul 2 2019, 8:53 AM.

Description

clang-format: Add new style option AlignConsecutiveMacros

This option behaves similarly to AlignConsecutiveDeclarations and
AlignConsecutiveAssignments, aligning the assignment of C/C++
preprocessor macros on consecutive lines.

I've worked in many projects (embedded, mostly) where header files full
of large, well-aligned "#define" blocks are a common pattern. We
normally avoid using clang-format on these files, since it ruins any
existing alignment in said blocks. This style option will align "simple"
PP macros (no parameters) and PP macros with parameter lists on
consecutive lines.

Related Bugzilla entry (thanks mcuddie):
https://llvm.org/bugs/show_bug.cgi?id=20637

Patch by Nick Renieris (VelocityRa)!

Differential Revision: https://reviews.llvm.org/D28462

llvm-svn: 364938

Details

Committed
sammccallJul 2 2019, 8:53 AM
Differential Revision
D28462: clang-format: Add new style option AlignConsecutiveMacros
Parents
rG4137aeb4bf3a: Provide basic Full LTO extension points
Branches
Unknown
Tags
Unknown