================ @@ -1541,6 +1541,22 @@ bool CompilerInvocation::createFromArgs( else invoc.loweringOpts.setInitGlobalZero(false); + // -finit-logical + if (const auto *arg = + args.getLastArg(clang::driver::options::OPT_finit_logical_EQ)) { + llvm::StringRef argValue = llvm::StringRef(arg->getValue()); + if (argValue.lower() == "true") + invoc.loweringOpts.setLogicalInit(1); + else if (argValue.lower() == "false") + invoc.loweringOpts.setLogicalInit(0); + else { + const unsigned diagID = diags.getCustomDiagID( ---------------- tarunprabhu wrote:
Could we use an existing clang driver diagnostic here instead of creating custom id? For instance ``` diags.Report(clang::diag::err_drv_invalid_value_with_suggestion) << arg->getAsString(args) << arg->getValue() << "false true"; ``` https://github.com/llvm/llvm-project/pull/150939 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits