================ @@ -1834,6 +1834,14 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.setInlining(CodeGenOptions::NormalInlining); } + // If we have specified -Og and have not explicitly set -fno-extend-lifetimes, + // then default to -fextend-lifetimes. + if (Arg *A = Args.getLastArg(options::OPT_O_Group); + A && A->containsValue("g")) { ---------------- SLTozer wrote:
I've moved this behaviour to the driver now. Also regarding the first request to use `A->getValue() == "g"` - if just `-O` is passed then `A->getValue()` will crash, as there are no values. An alternative would be to change the check to `A->getNumValues() && A->getValue() == "g"`, but I think `containsValue` is more concise. https://github.com/llvm/llvm-project/pull/118026 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits