Commit Graph

9 Commits

Author SHA1 Message Date
Alex Richardson
71167bd597 clang-format: Avoid breaking after the opening paren of function definitions
This depends on https://reviews.llvm.org/D90246 to have any effect, but once
that has landed clang-format will no longer format code like this:

```
int
myfunction(
    int param1, int param2, int param2)
{
   ...
}
```

and instead create the following:

```
int
myfunction(int param1, int param2,
    int param2)
{
   ...
}
```

Reviewed By:	emaste, cem
Differential Revision: https://reviews.freebsd.org/D26978
2020-10-28 11:54:00 +00:00
Alex Richardson
453d775b34 clang-format: place sys/systm.h immediately after sys/param.h
Should fix one of the objections to r366993.
See also https://reviews.freebsd.org/D26981.

Reviewed By:	emaste
Differential Revision: https://reviews.freebsd.org/D26979
2020-10-28 11:53:55 +00:00
D Scott Phillips
ab041f713a Move vm_page_dump bitset array definition to MI code
These definitions were repeated by all architectures, with small
variations. Consolidate the common definitons in machine
independent code and use bitset(9) macros for manipulation. Many
opportunities for deduplication remain in the machine dependent
minidump logic. The only intended functional change is increasing
the bit index type to vm_pindex_t, allowing the indexing of pages
with address of 8 TiB and greater.

Reviewed by:	kib, markj
Approved by:	scottl (implicit)
MFC after:	1 week
Sponsored by:	Ampere Computing, Inc.
Differential Revision:	https://reviews.freebsd.org/D26129
2020-09-21 22:20:37 +00:00
Alex Richardson
22a39a8912 Set AlignTrailingComments in the clang-format config
This seems to be fairly common in existing code and often looks better when
adding trailing comments to e.g. enumerators or array initializers.
See D26340 for more context.

Reviewed By:	emaste
Differential Revision: https://reviews.freebsd.org/D26391
2020-09-10 14:11:29 +00:00
Alex Richardson
8efceeb6ac Use the correct config names for some .clang-format entries
Those values are enum entries and should use "Never" instead of "false".
clang-format currently accepts false, but it's better to use the correct
syntax in case that changes in the future.
2020-09-10 14:11:24 +00:00
Conrad Meyer
a8caa6392e Clang-format: Avoid hardcoded LLVM include-order style
Reported by:	emaste
2020-06-24 23:22:36 +00:00
Conrad Meyer
9e8fd9d8c4 Update .clang-format type and foreach macros lists
No functional change.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D25429
2020-06-24 22:42:46 +00:00
Conrad Meyer
e59d5d14d7 Update .clang-format with style(9) header-sorting
Thanks to work done in the NetBSD clang-format project.  No functional change.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D25428
2020-06-24 18:40:43 +00:00
Alex Richardson
b0f20f11fc Add a basic clang-format configuration file
This gets reasonably close to the existing format in sys/kern but will
probably require some changes to upstream clang-format before it can be
used as the default formatting tool.

I tried formatting a few files in sys/kern and the result is pretty close to
the existing code. However, this configuration file is not ready to be used
without manually checking the output.

Reviewed By:	emaste
Differential Revision: https://reviews.freebsd.org/D20533
2019-06-07 15:23:52 +00:00