[all-commits] [llvm/llvm-project] 87de54: [clang][Tooling] Fix addTargetAndModeForProgramNam...

kadir çetinkaya via All-commits all-commits at lists.llvm.org
Mon Aug 3 02:47:22 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 87de54dbb6efa0fc5e304f94b350a39066bc2759
      https://github.com/llvm/llvm-project/commit/87de54dbb6efa0fc5e304f94b350a39066bc2759
  Author: Kadir Cetinkaya <kadircet at google.com>
  Date:   2020-08-03 (Mon, 03 Aug 2020)

  Changed paths:
    M clang/lib/Tooling/Tooling.cpp
    M clang/unittests/Tooling/ToolingTest.cpp

  Log Message:
  -----------
  [clang][Tooling] Fix addTargetAndModeForProgramName to use correct flag names

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.

Differential Revision: https://reviews.llvm.org/D85076




More information about the All-commits mailing list