[PATCH] D156524: [flang][nfc] Simplify option forwarding
Andrzej Warzynski via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 28 07:24:35 PDT 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe88ff8a79b8b: [flang][nfc] Simplify option forwarding (authored by awarzynski).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156524/new/
https://reviews.llvm.org/D156524
Files:
clang/lib/Driver/ToolChains/Flang.cpp
flang/test/Driver/frontend-forwarding.f90
Index: flang/test/Driver/frontend-forwarding.f90
===================================================================
--- flang/test/Driver/frontend-forwarding.f90
+++ flang/test/Driver/frontend-forwarding.f90
@@ -17,6 +17,7 @@
! RUN: -fpass-plugin=Bye%pluginext \
! RUN: -fversion-loops-for-stride \
! RUN: -flang-experimental-polymorphism \
+! RUN: -flang-experimental-hlfir \
! RUN: -mllvm -print-before-all \
! RUN: -save-temps=obj \
! RUN: -P \
@@ -36,7 +37,8 @@
! CHECK: "-freciprocal-math"
! CHECK: "-fconvert=little-endian"
! CHECK: "-fpass-plugin=Bye
-! CHECK: "-flang-experimental-polymorphism"
! CHECK: "-fversion-loops-for-stride"
+! CHECK: "-flang-experimental-polymorphism"
+! CHECK: "-flang-experimental-hlfir"
! CHECK: "-mllvm" "-print-before-all"
! CHECK: "-save-temps=obj"
Index: clang/lib/Driver/ToolChains/Flang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Flang.cpp
+++ clang/lib/Driver/ToolChains/Flang.cpp
@@ -140,12 +140,11 @@
!stackArrays->getOption().matches(options::OPT_fno_stack_arrays))
CmdArgs.push_back("-fstack-arrays");
- if (Args.hasArg(options::OPT_flang_experimental_hlfir))
- CmdArgs.push_back("-flang-experimental-hlfir");
- if (Args.hasArg(options::OPT_flang_experimental_polymorphism))
- CmdArgs.push_back("-flang-experimental-polymorphism");
if (shouldLoopVersion(Args))
CmdArgs.push_back("-fversion-loops-for-stride");
+
+ Args.AddAllArgs(CmdArgs, {options::OPT_flang_experimental_hlfir,
+ options::OPT_flang_experimental_polymorphism});
}
void Flang::addPicOptions(const ArgList &Args, ArgStringList &CmdArgs) const {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156524.545155.patch
Type: text/x-patch
Size: 1722 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230728/d411e0dd/attachment.bin>
More information about the cfe-commits
mailing list