[cfe-dev] Need some assistance while adding a Style rule for NetBSD

Manikishan Ghantasala via cfe-dev cfe-dev at lists.llvm.org
Thu Jun 6 14:25:30 PDT 2019


Hi everyone,
I am currently working on modifying clang-format to handle some missing
NetBSD style rules,
I have added a new rule "LineupBitfieldDeclarations" which set to "true":
should
format the input to the output format as shown below,
*Input:*

unsigned int baz : 1,  fuz : 5, zap : 2;

*Output: *

unsigned int baz : 1,

   fuz : 5,

   zap : 2;


I have got so near but am facing two issues,
1. ColmmLimit overrides while breaking the bitfield declarations in one
line while the State Column is less than column limit.
2. The indentation after the break is different from variable declarations:

Can I get some help to fix these issues?
For 1st issue I guess I could stop when the Bitfields occur in the
following line:
https://github.com/llvm-mirror/clang/blob/master/lib/Format/ContinuationIndenter.cpp#L1704
But didn't get it to work, Is there somewhere else I should be looking at?
---
Regards,
Manikishan Ghantasala
B.tech CSE
foss at amrita <http://foss.amrita.ac.in/accounts/104/>
twitter <https://twitter.com/ManikishanG> | GitHub
<https://github.com/sh4nnu> | Hackerrank
<https://www.hackerrank.com/manikishanghant1>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190607/1605780f/attachment.html>


More information about the cfe-dev mailing list