[llvm-dev] Codifying our Brace rules-

David Greene via llvm-dev llvm-dev at lists.llvm.org
Mon Jun 29 08:05:05 PDT 2020


Chris Lattner via llvm-dev <llvm-dev at lists.llvm.org> writes:

> For those who don’t like it, is the currently documented policy broken
> enough to be important to changing?

I believe it is, simply for safety reasons.  Adding a statement to a
single-statement block can introduce bugs.  Mandating braces everywhere
prevents that.

> I assume you wouldn’t recommend a massive rewrite of the codebase, so
> we’re going to be with this for quite some time.

Sure, that's unavoidable.  But as code changes we can add braces where
they're missing and reviews should catch cases where we forget.

                  -David


More information about the llvm-dev mailing list