Skip to content

clang-format: be consistent with the return type between function declarations and definitions

See https://clang.llvm.org/docs/ClangFormatStyleOptions.html#alwaysbreakafterreturntype

With TopLevelDefinitions we get this:

static agx_block *emit_cf_list(agx_context *ctx, struct exec_list *list);

static agx_block *
emit_cf_list(agx_context *ctx, struct exec_list *list)
{
}

Functions declarations and definitions are formatted using different rules.

With TopLevel we get this:

static agx_block *
emit_cf_list(agx_context *ctx, struct exec_list *list);

static agx_block *
emit_cf_list(agx_context *ctx, struct exec_list *list)
{
}

Which is more consistent, and what some other, currently non-formatting-enforced parts of Mesa do (such as EGL).

The difference between TopLevel and All is the former ignores the rule in C++ classes, while the latter applies it consistently regardless of where the function is.
I can easily be convinced to change that to TopLevel though, is someone working on C++ code prefers that.

Merge request reports