[flang-commits] [clang] [flang] [flang] Do not hardcode "flang" in the driver (PR #200438)

Tarun Prabhu via flang-commits flang-commits at lists.llvm.org
Fri Jun 12 08:48:15 PDT 2026


================
@@ -1320,7 +1320,18 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA,
       Input.getInputArg().renderAsInput(Args, CmdArgs);
   }
 
-  const char *Exec = Args.MakeArgString(D.GetProgramPath("flang", TC));
+  // Handle "clang --driver-mode=flang" case
+  bool isClangDriverWithFlangMode = false;
+  if (D.Name.find("clang") != std::string_view::npos) {
----------------
tarunprabhu wrote:

I think this will also match, for instance, `clang-cl`. I assume that this intended to allow using any of the clang-derived frontends with `--driver-mode=flang`. It seems strange to do so. Is this only for compatibility with the other clang frontends? Would `flang --driver-mode=clang` also work? 
```
$ flang --driver-mode=clang input.cpp
```
Is the command above expected to do the right thing and compile C++ code?

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


More information about the flang-commits mailing list