This is an archive of the discontinued LLVM Phabricator instance.

[WIP][llvm-driver] Accept -cc1 and friends as tools meaning clang
AbandonedPublic

Authored by abrachet on Oct 27 2022, 3:41 PM.

Details

Summary

This is a possible alternative to D135108, the downside here is that some tests expect clang -### output to start with clang and those need to be fixed up more often here because in D135108 "clang" is still present as the 1st arg not the executable name. It is much cleaner in terms of amount of code that needs to be changed.

Diff Detail

Event Timeline

abrachet created this revision.Oct 27 2022, 3:41 PM
Herald added a project: Restricted Project. · View Herald Transcript
abrachet requested review of this revision.Oct 27 2022, 3:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2022, 3:42 PM
phosek added inline comments.Oct 27 2022, 6:42 PM
llvm/tools/llvm-driver/llvm-driver.cpp
65–71

Could you instead include -cc1, -cc1as and -cc1gen-reproducer as an alias for clang by appending them to LLVM_DRIVER_TOOL_ALIASES_clang?

abrachet marked an inline comment as done.Oct 27 2022, 7:41 PM
abrachet added inline comments.
llvm/tools/llvm-driver/llvm-driver.cpp
65–71

Unfortunately not because these are the 1st argument and not the executable name so we would end up invoking clang with argv[0] as "-cc1" and that arg would get skipped.

abrachet abandoned this revision.Jul 11 2023, 4:48 AM
abrachet marked an inline comment as done.