[clang] [Driver] Add ExclusiveGroup feature to multilib.yaml. (PR #69447)

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 13 22:23:52 PST 2023


petrhosek wrote:

I'm fine with the feature, my only concern is to make sure we don't unintentionally make it harder to integrate potential future extensions such as the mutually dependent groups.

The only alternative I could come up with is representing groups as first class concept with properties, such as being mutually exclusive. To give a concrete example:

```
Groups:
- Name: actually_exclude_something
  Exclusive: True

Variants:
- Dir: testdir1_non_exclusive
  Flags: [--target=thumbv7m-none-unknown-eabi]

- Dir: testdir2_non_exclusive
  Flags: [--target=thumbv7em-none-unknown-eabi]

- Dir: testdir1_exclusive
  Flags: [--target=thumbv7m-none-unknown-eabi]
  Group: actually_exclude_something

- Dir: testdir2_exclusive
  Flags: [--target=thumbv7em-none-unknown-eabi]
  Group: actually_exclude_something
```

This makes it possible to extend the group concept in the future but it's a little more verbose since you need to define the group first, although that may not necessarily be a bad thing since you could also warn if someone accidentally tries to use a group that wasn't previously defined (e.g. when making a typo).

https://github.com/llvm/llvm-project/pull/69447


More information about the cfe-commits mailing list