-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to clang-format 19 #8543
Conversation
2bd7353
to
b308a0e
Compare
src/IRMatch.h
Outdated
base.template match<bound | bindings<Vec>::mask>(v.slice_begin(), state) && | ||
stride.template match<bound | bindings<Vec>::mask | bindings<Base>::mask>(v.slice_stride(), state) && | ||
lanes.template match<bound | bindings<Vec>::mask | bindings<Base>::mask | bindings<Stride>::mask>(v.type.lanes(), state); | ||
base.template match < bound | bindings<Vec>::mask > (v.slice_begin(), state) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine I guess, but I'm wondering if some parens would work, just in case it's something about bitwise or having lower precedence than a comparison like <
base.template match<(bound | bindings<Vec>::mask)>(v.slice_begin(), state)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does like the parentheses better, and so do I
src/runtime/HalideBuffer.h
Outdated
HALIDE_ALWAYS_INLINE | ||
storage_T * | ||
address_of(Args... args) const { | ||
HALIDE_ALWAYS_INLINE storage_T * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo if this is now two lines, it would be better with the return type on the second line instead of the first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wouldn't let me break there, but it seems happy with everything on one line, which is fine in this case. If I put a //
break after HALIDE_ALWAYS_INLINE
, it still insists on breaking after storage_T *
.
Ready to land? |
Upgrade to clang-format 19 and apply the tool to the codebase. There are three main groups of changes:
IRMatch.h
I updated the
.clang-format
file to replace deprecated options with their supported counterparts. I also removed penalty tweaks that didn't do anything.Clang format 19 is more willing to remove line breaks with
ColumnLimit: 0
than before. It does a particularly bad job with lambda arguments (as can be seen in the Python bindings). I found it necessary to add a trailing comment to the last line of each lambda.