[PATCH] D95460: [flang][driver] Add forced form flags and -ffixed-line-length

Andrzej Warzynski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 19 05:26:42 PDT 2021


awarzynski added a comment.

Thank you for you reply Joachim,

I see 3 options here:

**OPTION 1:** make Clang accept these options
This would be as simple as removing the `FlangOnlyOption` from the corresponding TableGen definitions in Options.td. However, since we added help texts to their definitions, these options would be displayed together with other options when using `clang --help`. Given that these options are _not supported_ by `clang`, I think that we should avoid this upstream. However, this could be a quick and easy fix for you downstream. More on `clang -help` in this RFC <https://lists.llvm.org/pipermail/cfe-dev/2020-October/066953.html>.

**OPTION 2:** tweak the driver
>From your description, it seems like it would make more sense to tweak the driver so that it can work in .e.g _linker_ mode. In such a mode, it would skip the compilation phase and ignore the compilation flags altogether. IMHO this would be the most sound approach here, but it may require a bit of work. I would start by asking on cfe-dev - it's likely that more projects use `clang` as a linker driver. Perhaps it's already possible?

**OPTION 3:** tweak ` -Wno-unknown-argument`
I would expect ` -Wno-unknown-argument` to work here as you initially suggested. I'm not familiar with its semantics or e.g. DiagnosticDriverKinds.td <https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Basic/DiagnosticDriverKinds.td> (there's a lot in there!). But sometimes you can tweak these things with a one-line change and then stuff auto-magically works. I can take a look at some point next week. It might be a low hanging fruit or a dead end.

What are you thoughts?

Best,
Andrzej


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95460/new/

https://reviews.llvm.org/D95460



More information about the cfe-commits mailing list