This is an archive of the discontinued LLVM Phabricator instance.

[clang][Tooling] Fix addTargetAndModeForProgramName to use correct flag names
ClosedPublic

Authored by kadircet on Aug 1 2020, 10:01 AM.

Details

Summary

The logic was using incorrect flag versions. For example:

  • -target= can't be a prefix, it must be --target=.
  • --driver-mode can't appear on its own, value must be attached to it.

While fixing those, also changes the append logic to make use of new
--target=X format instead of the legacy -target X version.

In addition to that makes use of the OPTTable instead of hardcoded strings to
make sure helper also gets updated if clang's options are modified.

Diff Detail

Event Timeline

kadircet created this revision.Aug 1 2020, 10:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2020, 10:01 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
kadircet requested review of this revision.Aug 1 2020, 10:01 AM
hokein accepted this revision.Aug 3 2020, 12:13 AM
This revision is now accepted and ready to land.Aug 3 2020, 12:13 AM