[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:14 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) {
+    if (const Arg *A = Args.getLastArg(options::OPT_driver_mode)) {
+      if (std::string_view(A->getValue()) == "flang") {
----------------
tarunprabhu wrote:

Do we really need to create a `string_view` here in order to compare against a string literal?

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


More information about the flang-commits mailing list