VOOZH about

URL: https://www.phoronix.com/news/Flang-Tidy

⇱ Flang-Tidy Cleaning/Correcting Fortran Code In "Sort Of Opinionated Fashion" - Phoronix


👁 Phoronix

Flang-Tidy Cleaning/Correcting Fortran Code In "Sort Of Opinionated Fashion"

Written by Michael Larabel in LLVM on 7 August 2025 at 06:53 AM EDT. 1 Comment
Similar to Clang-Tidy for tidying up C/C++ code using LLVM/Clang components, Flang-Tidy is in development as a tool for Fortran static analysis built upon LLVM's modern Flang compiler code. Flang-Tidy may be upstreamed in the future to LLVM while for now it's developed by TU Munich and Max Planck Computing.

A request for comments was issued last week around Flang-Tidy that is being developed out of Bavaria for improving Fortran code as a framework of checks that apply to many existing Fortran codebases. The developers hope Flang-Tidy will be eventually accepted into upstream LLVM for helping to bolster its Fortran language support for scientific computing.

Flang-Tidy is self described as:
"Just like clang-tidy, the checks that we implement in flang-tidy go beyond regular compiler warnings, in that they flag formally correct code in a sort of opinionated fashion. Right now, flang-tidy implements over 20 checks, dealing with various aspects of Fortran programming, such as flagging of deprecated constructs, consistency checks of declarations, and hardening for C/Fortran interoperability.

Currently, flang-tidy is developed in-tree and we are very interested in upstreaming this effort so that others can also easily use flang-tidy on their codebases and in the hope of attracting more experts to contribute checks for all the various Fortran gotchas that we frequently run into."

There is this LLVM pull request with the initial Flang-Tidy code.

Fortran developers wanting to learn more about the proposed Flang-Tidy can do so via this RFC thread via LLVM Discourse.

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.