[PATCH] D142905: [Driver] Change multilib selection algorithm

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 23 00:49:31 PST 2023


phosek added inline comments.


================
Comment at: clang/include/clang/Driver/Multilib.h:41
+  flag_set Flags;
+  arg_list PrintArgs;
 
----------------
This is just a suggestion, but GCC documentation refers to these as either "options" or "switches", not "args" so I think it might be helpful to use the same nomenclature. This would also avoid confusion since the term "args" is used extensively throughout the driver but refers to input arguments.


================
Comment at: clang/lib/Driver/MultilibBuilder.cpp:90-93
+  for (StringRef Flag : Flags) {
+    if (Flag.front() == '+')
+      Args.push_back(("-" + Flag.substr(1)).str());
+  }
----------------
If I understand this correctly, we might end up with duplicate arguments in the case when `Flags` contains duplicate elements. Is that desirable? Wouldn't it be better to construct the list of arguments from the set of fags inside `Multilib`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142905/new/

https://reviews.llvm.org/D142905



More information about the cfe-commits mailing list