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

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 26 21:20:54 PDT 2023


================
@@ -96,13 +97,39 @@ bool MultilibSet::select(const Multilib::flags_list &Flags,
                          llvm::SmallVector<Multilib> &Selected) const {
   llvm::StringSet<> FlagSet(expandFlags(Flags));
   Selected.clear();
-  llvm::copy_if(Multilibs, std::back_inserter(Selected),
-                [&FlagSet](const Multilib &M) {
-                  for (const std::string &F : M.flags())
-                    if (!FlagSet.contains(F))
-                      return false;
-                  return true;
-                });
+
+  // Decide which multilibs we're going to select at all
+  std::vector<bool> IsSelected(Multilibs.size(), false);
+  std::map<std::string, size_t> ExclusiveGroupMembers;
+  for (size_t i = 0, e = Multilibs.size(); i < e; ++i) {
+    const Multilib &M = Multilibs[i];
+
+    // If this multilib doesn't match all our flags, don't select it
----------------
MaskRay wrote:

End complete sentences with a period. https://llvm.org/docs/CodingStandards.html#commenting

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


More information about the cfe-commits mailing list