[clang] [flang] [mlir] [flang] Add support for -mrecip[=<list>] (PR #142172)
Tarun Prabhu via cfe-commits
cfe-commits at lists.llvm.org
Sat May 31 18:04:46 PDT 2025
tarunprabhu wrote:
> > LGTM, though, I think we'd better reuse the code from `Clang.cpp`. `flangFrontend` already depends on `clangDriver`, so we just need to export `ParseMRecip` and `getRefinementStep` from `clangDriver` (and probably replace their `Driver` argument with a `DiagnosticEngine` argument, so that it works for both clang and flang).
>
> This seems reasonable. I'll look into whether it's possible to do.
>
> > (and probably replace their `Driver` argument with a `DiagnosticEngine` argument, so that it works for both clang and flang)
>
> It will be interesting to see if Clang allows us to change this without changing it everywhere. Changing it everywhere seems like a heavy lift.
If this option should be handled exactly the way it is in clang, the approach we have been using is to share the code between the two by copying it into `clang/lib/Driver/ToolChains/CommonArgs.cpp`. See for instance, [this](https://github.com/llvm/llvm-project/commit/8ea2b417419344182053c0726cfff184d7917498)
https://github.com/llvm/llvm-project/pull/142172
More information about the cfe-commits
mailing list