[all-commits] [llvm/llvm-project] 45cd40: [flang] Add clang-tidy check for braces around if

Diana via All-commits all-commits at lists.llvm.org
Wed Jun 16 02:14:22 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 45cd405dc07bbc259ea251c8f5f5e2bca7a6112c
      https://github.com/llvm/llvm-project/commit/45cd405dc07bbc259ea251c8f5f5e2bca7a6112c
  Author: Diana Picus <diana.picus at linaro.org>
  Date:   2021-06-16 (Wed, 16 Jun 2021)

  Changed paths:
    M flang/.clang-tidy
    M flang/docs/C++style.md
    M flang/include/flang/Lower/.clang-tidy
    M flang/include/flang/Optimizer/.clang-tidy
    M flang/lib/Lower/.clang-tidy
    M flang/lib/Optimizer/.clang-tidy
    M flang/lib/Semantics/canonicalize-acc.cpp
    M flang/lib/Semantics/check-acc-structure.cpp
    M flang/lib/Semantics/check-omp-structure.cpp
    M flang/lib/Semantics/resolve-directives.cpp
    M flang/runtime/ISO_Fortran_binding.cpp
    A flang/tools/.clang-tidy
    M flang/unittests/RuntimeGTest/CrashHandlerFixture.cpp

  Log Message:
  -----------
  [flang] Add clang-tidy check for braces around if

Flang diverges from the llvm coding style in that it requires braces
around the bodies of if/while/etc statements, even when the body is
a single statement.

This commit adds the readability-braces-around-statements check to
flang's clang-tidy config file. Hopefully the premerge bots will pick it
up and report violations in Phabricator.

We also explicitly disable the check in the directories corresponding to
the Lower and Optimizer libraries, which rely heavily on mlir and llvm
and therefore follow their coding style. Likewise for the tools
directory.

We also fix any outstanding violations in the runtime and in
lib/Semantics.

Differential Revision: https://reviews.llvm.org/D104100




More information about the All-commits mailing list