[PATCH] D156524: [flang][nfc] Simplify option forwarding

Andrzej Warzynski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 28 07:22:47 PDT 2023


awarzynski added a comment.

Thanks for taking a look!



================
Comment at: clang/lib/Driver/ToolChains/Flang.cpp:146-147
+
+  Args.AddAllArgs(CmdArgs, {options::OPT_flang_experimental_hlfir,
+                            options::OPT_flang_experimental_polymorphism});
 }
----------------
kiranchandramohan wrote:
> Is the order changing in the tests below (poly before hlfir) expected?
Yes. `AddAllArgs` will consume `-flang-experimental-polymorphism` first because:
* it satisfies the condition specified here (i.e. either `-flang-experimental-hlfir` or `-flang-experimental-polymorphism` ), and
* that's the first option it encounters (i.e. it is specified before `-flang-experimental-hlfir` in the test file).



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156524



More information about the cfe-commits mailing list