This is an archive of the discontinued LLVM Phabricator instance.

Store only argv[0] in Config
ClosedPublic

Authored by espindola on Feb 6 2018, 10:48 AM.

Details

Reviewers
ruiu
grimar
Summary

Having it there seems in conflict with the desire to part all command
line options in the Driver.

Diff Detail

Event Timeline

espindola created this revision.Feb 6 2018, 10:48 AM
ruiu added a comment.Feb 6 2018, 10:54 AM

Actually I prefer making argv accessible globally just like the environment variable, perhaps due to the influence of Go in which command line arguments are accessible from anywhere as os.args. At least I think we want to keep Argv[0] globally accessible to produce error messages containing the command name.

espindola retitled this revision from Don't store the full Argv in Config to Store only argv[0] in Config.

Having just the program name in Config might be the sweet spot. It is easy to access and we are sure that the rest of argv cannot be used outside of the driver.

ruiu accepted this revision.Feb 6 2018, 2:20 PM

LGTM

ELF/Driver.cpp
88–93

Could you keep this at the beginning of the function? make shouldn't report an error, but it is easy to add more code before this code if we don't have this at the beginning.

This revision is now accepted and ready to land.Feb 6 2018, 2:20 PM