================
@@ -2253,6 +2253,14 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions
&Opts, ArgList &Args,
Opts.getDebugInfo() == llvm::codegenoptions::NoDebugInfo)
Opts.setDebugInfo(llvm::codegenoptions::LocTrackingOnly);
+ // Debug mode for inlining chain diagnostics requires at least
+ // -gline-directives-only to track inlining locations via DILocation.
+ if (Opts.getInliningChain() == CodeGenOptions::Inlining_Debug &&
+ Opts.getDebugInfo() < llvm::codegenoptions::DebugDirectivesOnly) {
+ Diags.Report(diag::warn_fe_inlining_debug_requires_g);
+ Opts.setInliningChain(CodeGenOptions::Inlining_Heuristic);
+ }
----------------
nickdesaulniers wrote:
> it can get a bit noisy when there are multiple diagnostics.
I'm ok with that. If your code emits multiple instances of _any_ diagnostic
that additionally has a note attached, clang generally doesn't dedup the notes
IIRC, so that's in line with the status quo.
https://github.com/llvm/llvm-project/pull/174892
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits