[clang] [clang-format] Option to ignore macro definitions (PR #70338)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 27 04:30:15 PST 2023


owenca wrote:

> > After giving more thoughts to this, I think what we really want is `SkipMacroDefinitionBody`, which would format the code below:
> > (...)
> > That is, only the body (except comments) of a macro definition is not formatted.
> 
> I understand that:
> 
> * we do want to align the macros (respect IndentPPDirectives)
> * we do want to remove extra whitespaces before, within and right after the first token (#define)

We want to format e.g. `#define FOO` and `#define BAR(x, y)`.

> * we do NOT want to touch the body
> * we do NOT want to break lines

We don't want to change line splicing (if any) within the body.

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


More information about the cfe-commits mailing list