[PATCH] D85076: [clang][Tooling] Fix addTargetAndModeForProgramName to use correct flag names

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 1 10:01:32 PDT 2020


kadircet created this revision.
kadircet added a reviewer: hokein.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
kadircet requested review of this revision.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85076

Files:
  clang/lib/Tooling/Tooling.cpp
  clang/unittests/Tooling/ToolingTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85076.282404.patch
Type: text/x-patch
Size: 4828 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200801/c3f620a3/attachment.bin>


More information about the cfe-commits mailing list