[PATCH] D137800: [llvm-driver] Reinvoke clang as described by llvm driver extra args

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 00:40:39 PST 2023


phosek added inline comments.


================
Comment at: clang/include/clang/Driver/Driver.h:295
+  /// "clang" as it's first argument.
+  const char *LLVMDriverPrependArg;
+
----------------
phosek wrote:
> I'd call it just `PrependArg` since it might have uses outside of LLVM driver.
This wasn't addressed yet.


================
Comment at: llvm/tools/llvm-driver/llvm-driver.cpp:68
+      return {Argv0, ToolName.data(), true};
+    return {Argv0, sys::path::filename(Argv0).data(), false};
+  };
----------------
Can we set `PrependArg` to `nullptr` in this case? It seems like we only ever use `PrependArg` if `NeedsPrependArg` is `true` in which case we may not even need `NeedsPrependArg` and could just check if `PrependArg != null`.


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

https://reviews.llvm.org/D137800



More information about the llvm-commits mailing list