[LLVMdev] lld coding style

Renato Golin renato.golin at linaro.org
Sun Oct 5 09:37:49 PDT 2014

On 5 October 2014 07:19, Saleem Abdulrasool <compnerd at compnerd.org> wrote:
> So with that in mind, I would like to ask, would it be possible to consider
> switching to LLVM style for lld?

We don't usually enforce code styles on side projects because it
doesn't make sense to do so. There are too many conflicts between
developers, external source code, style-oriented commits that break
the time-line of the project, that it's just not worth worrying about
it. Not to mention that style is fashion, some like it this way, some
like it that way.

Code style changes with time. If the majority of lld developers agree
with you that the current style is bad and needs to be changed (to a
more LLVM-ish style), than future commits should move lld's style
towards that. Not by adding new styles to one line inside an old
function, but by deprecating style when you deprecate code, and
creating style when you create code.

It's also very likely that, by the time you have converted all old
code with new style, the preferred style will have changed, and you'll
want to do it all over again. To avoid that pointless race against
nothing, we tend to keep the style that was in the original
file/function and not mind much.

Code style is like keyboard layout. Your first reaction is "what the
f**?", then you get used to it, than you can switch between all
keyboard styles (except AZERTY) without a problem.


More information about the llvm-dev mailing list