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

Simon Tatham via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 1 02:43:20 PST 2023


================
@@ -138,10 +164,34 @@ static const VersionTuple MultilibVersionCurrent(1, 0);
 struct MultilibSerialization {
   std::string Dir;
   std::vector<std::string> Flags;
+  std::string Group;
+};
+
+struct MultilibGroupSerialization {
+  /*
+   * Future directions:
+   *
+   * If it's needed in future, we could introduce additional group types by
+   * permitting Type to contain strings other than "Exclusive". Another
+   * possibility is a group of library directories that are mutually
+   * _dependent_ rather than mutually exclusive: if you include one you must
+   * include them all.
+   *
+   * It might also be useful to allow groups to be members of other groups, so
+   * that a mutually exclusive group could contain a mutually dependent set of
+   * library directories, or vice versa.
+   *
+   * These additional features would need changes in the implementation, but
+   * the YAML schema is set up so they can be added without requiring changes
+   * in existing users' multilib.yaml files.
+   */
+  std::string Name;
+  std::string Type;
----------------
statham-arm wrote:

Yes, apparently we can. I hadn't found that part of the `llvm::yaml` API yet, but defining a `ScalarEnumerationTraits` for the enum type seems to be the way to make it Just Work during decoding. Thanks.

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


More information about the cfe-commits mailing list