[all-commits] [llvm/llvm-project] 46ec02: [clang][cli] NFC: Move prefix to the front of Bool...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Mon Jan 25 00:16:21 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 46ec0254a97dcf35a0f9f023ea7632e7ee72a1ee
      https://github.com/llvm/llvm-project/commit/46ec0254a97dcf35a0f9f023ea7632e7ee72a1ee
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2021-01-25 (Mon, 25 Jan 2021)

  Changed paths:
    M clang/include/clang/Driver/Options.td

  Log Message:
  -----------
  [clang][cli] NFC: Move prefix to the front of BoolOption

The prefix used to be the last (optional) argument to BoolOption. This decision was made with the expectation that only few command line options would need to pass it explicitly instead of using Bool{F,G}Option. It turns out that a considerable number of options don't conform to Bool{F,G}Option and need to provide the prefix anyways. This sometimes requires to explicitly pass `BothFlags<[]>`.

This patch makes prefix the first parameter, so it now directly precedes the spelling base string. Now 8 options dropped `BothFlags<[]>` and only two options (`pthread` and `emit_llvm_uselists`) need to pass an empty prefix.

Reviewed By: dexonsmith

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


  Commit: 209f4618891365f5f655214581ab4edd27cacde4
      https://github.com/llvm/llvm-project/commit/209f4618891365f5f655214581ab4edd27cacde4
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2021-01-25 (Mon, 25 Jan 2021)

  Changed paths:
    M clang/include/clang/Driver/Options.td

  Log Message:
  -----------
  [clang][cli] NFC: Pass CC1Option explicitly to BoolOption

When `Bool{F,G}Option` were introduced, they were designed after the existing `Opt{In,Out}FFlag` in that they implied `CC1Option` for the `ChangedBy` flag.

This means less typing, but can be misleading in situations when the `ResetBy` has explicit `CC1Option` and `ChangedBy` doesn't.

This patch stops implicitly putting `CC1Option` to `ChangedBy` flag.

Reviewed By: dexonsmith

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


Compare: https://github.com/llvm/llvm-project/compare/8fbc1437c605...209f46188913


More information about the All-commits mailing list