aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorKiran Chandramohan <kiran.chandramohan@arm.com>2025-01-17 12:14:20 +0000
committerGitHub <noreply@github.com>2025-01-17 12:14:20 +0000
commit8c63648117f1e1705943903b149f36ab8a4df1e5 (patch)
tree799f9a27be517455223a7c1f07446c3d714c959c /flang/lib/Frontend/CompilerInvocation.cpp
parenta90b5b1885cc9587d7d65edbe3e0d94c4e2f4459 (diff)
downloadllvm-8c63648117f1e1705943903b149f36ab8a4df1e5.zip
llvm-8c63648117f1e1705943903b149f36ab8a4df1e5.tar.gz
llvm-8c63648117f1e1705943903b149f36ab8a4df1e5.tar.bz2
Revert "Revert "[Flang][Driver] Add a flag to control zero initializa… (#123097)
…tion of global v…" (#123067)" This reverts commit 44ba43aa2b740878d83a9d6f1d52a333c0d48c22. Adds the flag to bbc as well.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp8
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.