[clang] [flang] [Flang] [Options] To be compatible with classic flang, add the -Mextend compilation option (PR #173833)

Tom Eccles via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 5 08:18:49 PST 2026


https://github.com/tblah commented:

Thank you for contributing this.

The way we usually do this sort of thing would be to normalise arguments in the compiler driver ("flang": clang/lib/Driver...) and then only support the normalised arguments in the frontend driver ("flang -fc1": flang/lib/Frontend...).

So in this case I would replace -Mextend with -ffixed-line-length=132 in clang/lib/Driver/ToolChains/Flang.cpp and not support -Mextend at all as a flang -fc1 option. There are slightly more convenient APIs for manipulating arguments inside of clang/lib/Driver. The frontend driver is intended to be much more minimal.

Please also add tests to flang/test/Driver. If this is implemented in flag forwarding from the compiler driver to the frontend driver as I recommend above, a good way to test this would be something like

! RUN: flang -### -Mextend %s | FileCheck %s
! CHECK: flang -fc1
! CHECK-SAME: -ffixed-line-length=132

https://github.com/llvm/llvm-project/pull/173833


More information about the cfe-commits mailing list