r212591 - clang-format: Revamp function declaration/definition indentation.

Chandler Carruth chandlerc at google.com
Wed Jul 9 04:18:05 PDT 2014

On Wed, Jul 9, 2014 at 4:01 AM, Tobias Grosser <tobias at grosser.es> wrote:

> Also, in http://llvm.org/PR16157 the very same bug was "solved" already
> and Manual especially introduced the option that you just removed to
> address the cl::opt changes that now show up.

I'm pretty sure this bug and the subsequent patch dealt almost exclusively
with the case of function declarations and definitions. The follow-up
examples are all those and the tests for the change are those. Unfortunate,
but I don't think it was ever really targeted at global variables.

> Here is another open bug that talks about inconsistent formatting between
> different lines: http://llvm.org/PR15169

Ok, hadn't seen this bug any more than you had seen mine. Sorry about that.
=/ The bugs should probably have been dup'ed.

> Formatting is mostly about taking decisions and sticking to them, so I
> think having a discussion once might avoid bike-shedding and clang-format
> noise afterwards.

But I don't think we ever made a conscious decision about global variables.
They just went along for the ride with the very clear decision about
function definitions and declarations previously.

I think the history here is more that global variables got lumped in with
function declarations because we didn't have a good way to separate them
not out of any specific desire for one formatting. Then in this commit
Daniel added a way to separate them, and picked the default based on a
somewhat arbitrary choice rooted in logic rather than data or widespread
opinion of developers. So no decision has really been made or even
considered. You seem to disagree with the current default selected, so
argue for a change (with a fresh thread to llvmdev maybe). The whole reason
I don't like checking every single revision is because it creates a false
urgency to change clang-format's defaults the moment they disagree with
whatever happens to be have come before and happens to have been widely
applied to Polly's codebase. If consensus is that we want to format globals
in this other way, I doubt the intervening time where clang-format worked
differently will cause any harm at all.

A separate reason why I think a revert is a bad way to respond to this is
because it conflates a policy decision with adding the mechanism to
implement the policy. We should absolutely not revert functionality from
clang-format because of a discussion and disagreement about one policy flag
in LLVM's style... That makes it incredibly hard to make progress.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140709/22a026ec/attachment.html>

More information about the cfe-commits mailing list