Skip to content

nir: clang-format

Faith Ekstrand requested to merge gfxstrand/mesa:nir/clang-format into main

This MR adds .clang-format to NIR. The last patch is a clang-format of nir.h to show how it changes things. It's all still a work-in-progress. I'm posting it now mostly to give folks the heads up that this is coming and gather feedback from relevant parties. @alyssa has a big refactor coming up which will rename such core things as nir_ssa_def and the only way to keep NIR from turning into a total disaster is if we clang-format before and after.

I do not want anyone adding a clang-format lint to CI at this time and I will NAK any attempts to do so. Instead, here is how I intend clang-format to be used:

  1. Once this is ready to go, I will clang-format the entirety of src/compiler/nir.
  2. I may periodically run it again just to clean things up a bit.
    • Unless you're me or one of the other NIR maintainers, please do not submit MRs to re-clang-format everything. It's not helpful.
  3. If you're going to do a major refactor of a file, feel free to clang-format that one file before hand as a pre-patch and then ensure your patches clang-format.

Merge request reports