[PATCH] D123070: [Driver][NFC] Simplify handling of flags in Options.td

Emil Kieri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 4 13:10:05 PDT 2022

ekieri created this revision.
ekieri added reviewers: awarzynski, thakis.
Herald added a reviewer: sscalpone.
Herald added a project: All.
ekieri requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: cfe-commits, sstefan1.
Herald added a project: clang.

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.

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'.

  rG LLVM Github Monorepo



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123070.420288.patch
Type: text/x-patch
Size: 12848 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220404/f5c7a959/attachment-0001.bin>

More information about the cfe-commits mailing list