[compiler-rt] [sanitizer_common][NFC] Fix sanitizer_platform_limits_posix.cpp formatting (PR #180823)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 19:47:16 PDT 2026


vitalybuka wrote:

for 

> > Please make "Check code formatting" green.
> 
> Making the "check code formatting" green breaks the semantically preferred ordering discussed here: [#180823 (comment)](https://github.com/llvm/llvm-project/pull/180823#discussion_r2790951923)
> 
> In particular, there is a school of thought that "local" headers should be included after non-local headers in order to increase the likelihood that such a local header has sufficient includes (instead of relying on an including file to have already included another header).

We don't want to apply those which can brake stuff.
This one has tricky includes, maybe it worth of disable format in include block or figure out if it supports some "sections".

> 
> I have general questions about "blindly following" the automation because, especially with the sanitizer code, it seems the code formatter is not happy with the status quo (and following it leads to mixed styles). Part of the problem seems to be that the sanitizer code is configured to use Google-style formatting (as opposed to LLVM-style formatting).

There is a local .clang-format and they are configured to match Google style. In general they agree.
https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/sanitizer_common/.clang-format

Maybe issue "IndentPPDirectives: AfterHash". A few years ago, if I remember correctly @MaskRay, proposed this rule, and I don't mind.

So we suppose incrementally update for this one when needed. But there are few large files like this which no one want to touch :)

@jakeegan I guess it's safe to land this one if we don't reorder includes. But don't bother if you have better things to do.


https://github.com/llvm/llvm-project/pull/180823


More information about the llvm-commits mailing list