[flang-commits] [clang] [flang] [llvm] [polly] [Plugins] Pass arguments to a pass plugin with -plugin-arg (PR #226773)

Alexis Engelke via flang-commits flang-commits at lists.llvm.org
Tue Sep 29 05:39:07 PDT 2026


================
@@ -391,9 +392,21 @@ struct SimplifyCFGPass : public OptionalPassInfoMixin<SimplifyCFGPass> {
 };
 } // namespace
 
+static Error parseArguments(ArrayRef<const char *> Args) {
+  SmallVector<const char *, 0> Argv = {"SimplifyCFG"};
+  append_range(Argv, Args);
+  std::string Msg;
+  raw_string_ostream OS(Msg);
+  if (!cl::ParseCommandLineOptions(Argv.size(), Argv.data(), "", &OS))
+    return createStringError(StringRef(Msg).trim());
+  return Error::success();
----------------
aengelke wrote:

Instead of this logic, just check that Args has at most one option, which must be "v1", "v2" or "v3"? We can easily drop cl::opt here.

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


More information about the flang-commits mailing list