[PATCH] D137800: [llvm-driver] Reinvoke clang as described by llvm driver extra args
Alex Brachet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 26 18:26:44 PST 2023
abrachet marked 2 inline comments as done.
abrachet added inline comments.
================
Comment at: clang/include/clang/Driver/Driver.h:295
+ /// "clang" as it's first argument.
+ const char *LLVMDriverPrependArg;
+
----------------
phosek wrote:
> phosek wrote:
> > I'd call it just `PrependArg` since it might have uses outside of LLVM driver.
> This wasn't addressed yet.
Whoops, sorry about that.
================
Comment at: llvm/tools/llvm-driver/llvm-driver.cpp:68
+ return {Argv0, ToolName.data(), true};
+ return {Argv0, sys::path::filename(Argv0).data(), false};
+ };
----------------
phosek wrote:
> 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`.
It's necessary to support `-canonical-prefixes`, such that when it finds the realpath of the current executable, it can correctly invoke the `llvm` binary with the PrependArg
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137800/new/
https://reviews.llvm.org/D137800
More information about the llvm-commits
mailing list