This is an archive of the discontinued LLVM Phabricator instance.

Allow -profile-guided-section-prefix more than once
ClosedPublic

Authored by marksantaniello on Jun 14 2017, 1:12 PM.

Details

Summary

At present, -profile-guided-section-prefix is a cl::Optional option, which means it demands to be passed exactly zero or one times. Our build system makes it pretty tricky to guarantee this. We often accidentally pass the flag more than once (but always with the same "false" value) which results in an error, after which compilation fails:

clang (LLVM option parsing): for the -profile-guided-section-prefix option: may only occur zero or one times!

While we work on improving our build system, it also seems reasonable just to allow -profile-guided-section-prefix to be passed more than once, by to cl::ZeroOrMore. Quoting the documentation:

The cl::ZeroOrMore modifier ... indicates that your program will allow the option to be specified zero or more times.
...
If an option is specified multiple times for an option of the cl::opt class, only the last value will be retained.

Diff Detail

Repository
rL LLVM

Event Timeline

danielcdh accepted this revision.Jun 14 2017, 1:16 PM
This revision is now accepted and ready to land.Jun 14 2017, 1:16 PM
This revision was automatically updated to reflect the committed changes.