This is an archive of the discontinued LLVM Phabricator instance.

[llvm-driver] Pass extra arguments to tools
ClosedPublic

Authored by abrachet on Nov 10 2022, 12:58 PM.

Diff Detail

Event Timeline

abrachet created this revision.Nov 10 2022, 12:58 PM
abrachet requested review of this revision.Nov 10 2022, 12:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 10 2022, 12:58 PM
phosek added a subscriber: phosek.Nov 11 2022, 3:04 PM
phosek added inline comments.
llvm/cmake/modules/llvm-driver-template.cpp.in
11

Since we're no longer trying to match the signature of main, we could also consider other changes, for example passing args as a ArrayRef<const char *>, but that could be done in some future changes.

llvm/include/llvm/Support/LLVMDriver.h
14

Since this struct will contain more than just args, like IsDriver added in D137800, I'd probably call it something like LLVMDriverContext.

phosek added inline comments.Nov 11 2022, 3:19 PM
llvm/include/llvm/Support/LLVMDriver.h
14

Another option would be LLVMToolContext or even just ToolContext since this is already in the llvm namespace (we already have ToolOutputFile in Support).

abrachet updated this revision to Diff 475052.Nov 13 2022, 10:31 PM
abrachet marked 3 inline comments as done.
abrachet added inline comments.
llvm/cmake/modules/llvm-driver-template.cpp.in
11

but that could be done in some future changes.

I think I'll do that in the future because that would be a pretty involved change to the tools respective main functions.

phosek accepted this revision.Nov 30 2022, 9:28 AM

LGTM

This revision is now accepted and ready to land.Nov 30 2022, 9:28 AM
abrachet updated this revision to Diff 479500.Dec 1 2022, 6:43 PM
abrachet marked an inline comment as done.

Rebase

abrachet updated this revision to Diff 481161.Dec 7 2022, 11:50 PM
abrachet retitled this revision from [WIP][llvm-driver] Pass extra arguments to tools to [llvm-driver] Pass extra arguments to tools.

Rebase

This revision was landed with ongoing or failed builds.Feb 10 2023, 11:42 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 10 2023, 11:42 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
vpalatin added inline comments.
llvm/tools/dsymutil/CMakeLists.txt
44 ↗(On Diff #496572)

@abrachet
Why has this change commented out this line ?

It seems that on some platforms, we need to link dsymutil.cpp with libatomic.
Specifically as libatomic is not included in libgcc_s, if we build on riscv64 with RTLIB set to libgcc and gnu ld as the linker, it seems to now fail on this ?