News: 0001567348

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

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

([LLVM] 5 Hours Ago Flang-Tidy)


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 [1]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 [2]this RFC thread via LLVM Discourse.



[1] https://github.com/llvm/llvm-project/pull/143883

[2] https://discourse.llvm.org/t/rfc-flang-flang-tidy-a-new-tool-for-fortran-static-analysis/87579



phoronix

YOW!! I'm in a very clever and adorable INSANE ASYLUM!!