This is an archive of the discontinued LLVM Phabricator instance.

[llvm-rc] Respect the executable specified in the --preprocessor command
ClosedPublic

Authored by mstorsjo on Mar 24 2023, 3:25 AM.

Details

Summary

The arguments passed in this option were passed onto the child
process, but we still blindly the clang binary that we had found
to sys::ExecuteAndWait as the intended executable to run.

If the user hasn't specified any custom --preprocessor command,
Args[0] is equal to the variable Clang.

This doesn't affect any tests, since the tests only print the
arguments it would try to execute (but not the first parameter to
sys::ExecuteAndWait), but there's no testes for executing it
(and validating that it did execute the right thing).

Diff Detail

Event Timeline

mstorsjo created this revision.Mar 24 2023, 3:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2023, 3:25 AM
mstorsjo requested review of this revision.Mar 24 2023, 3:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2023, 3:25 AM
aganea accepted this revision.Mar 24 2023, 7:05 AM

Something was missing in the description:

The arguments passed in this option were passed onto the child
process, but we still blindly [used] the clang binary that we had found
to sys::ExecuteAndWait as the intended executable to run.

Looks good otherwise!

This revision is now accepted and ready to land.Mar 24 2023, 7:05 AM