diff options
author | Kiran Chandramohan <kiran.chandramohan@arm.com> | 2025-01-21 07:57:44 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-21 07:57:44 +0000 |
commit | ce32625966a922fe96aababe0ed975ada004901f (patch) | |
tree | 60e0b2d55c6ad39163adc94087bc4a1abe63a3f4 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 385f776b639097503eb43b124a3f68570c8c6beb (diff) | |
download | llvm-ce32625966a922fe96aababe0ed975ada004901f.zip llvm-ce32625966a922fe96aababe0ed975ada004901f.tar.gz llvm-ce32625966a922fe96aababe0ed975ada004901f.tar.bz2 |
Reland "[Flang][Driver] Add a flag to control zero initialization" (#123606)
Reverts llvm/llvm-project#123330
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | flang/lib/Frontend/CompilerInvocation.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 15b1e1e..3c6da46 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -1377,6 +1377,14 @@ bool CompilerInvocation::createFromArgs( invoc.loweringOpts.setNoPPCNativeVecElemOrder(true); } + // -f[no-]init-global-zero + if (args.hasFlag(clang::driver::options::OPT_finit_global_zero, + clang::driver::options::OPT_fno_init_global_zero, + /*default=*/true)) + invoc.loweringOpts.setInitGlobalZero(true); + else + invoc.loweringOpts.setInitGlobalZero(false); + // Preserve all the remark options requested, i.e. -Rpass, -Rpass-missed or // -Rpass-analysis. This will be used later when processing and outputting the // remarks generated by LLVM in ExecuteCompilerInvocation.cpp. |