[all-commits] [llvm/llvm-project] da1fc3: [Driver][NFC] Simplify handling of flags in Option...

Emil Kieri via All-commits all-commits at lists.llvm.org
Thu Apr 7 11:41:36 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: da1fc3ae955da47dc43d8d2e8f4d5a52deac7cf9
      https://github.com/llvm/llvm-project/commit/da1fc3ae955da47dc43d8d2e8f4d5a52deac7cf9
  Author: Emil Kieri <j.emil.kieri at gmail.com>
  Date:   2022-04-07 (Thu, 07 Apr 2022)

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

  Log Message:
  -----------
  [Driver][NFC] Simplify handling of flags in Options.td

We aim at improving the readability and maintainability of Options.td,
and in particular its handling of 'Flags', by
 - limiting the extent of 'let Flags = [...] in {'s, and
 - adding closing comments to matching '}'s.
 - being more consistent about empty lines around 'let Flags' and '}'.

More concretely,
 - we do not let a 'let Flags' span across several headline comments.
   When all 'def's in two consecutive headlines share the same flags,
   we stil close and start a new 'let Flags' at the intermediate
   headline.
 - when a 'let Flags' span just one or two 'def's, set 'Flags' within
   the 'def's instead.
 - we remove nested 'let Flags'.

Note that nested 'let Flags' can be quite confusing, especially when
the outer was started long before the inner. Moving a 'def' out of the
inner 'let Flags' and setting 'Flags' within the 'def' will not have the
intended effect, as those flags will be overridden by the outer
'let Flags'.

Reviewed By: awarzynski, jansvoboda11, hans

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




More information about the All-commits mailing list