[PATCH] D94655: [Driver] -gsplit-dwarf: Produce .dwo regardless of -gN for IR input

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 14 09:10:06 PST 2021


MaskRay added a comment.

In D94655#2498504 <https://reviews.llvm.org/D94655#2498504>, @dblaikie wrote:

> Is there any way to condition this on the type of the output, rather than the input? (or, more specifically, on whether machine code is being generated)
>
> Or maybe we could always pass the split-dwarf-file down through LLVM and not need to conditionalize it at all? It'd be a no-op if there's no DWARF in the IR anyway?

I tried replacing `if (IRInput || Args.hasArg(options::OPT_g_Group)) {` with `if (1)`, -gsplit-dwarf may produce .dwo for regular non-g .c compile.

Since we already have the

  // For -g0 or -gline-tables-only, drop -gsplit-dwarf. This gets a bit more
  // complicated if you've disabled inline info in the skeleton CUs
  // (SplitDWARFInlining) - then there's value in composing split-dwarf and
  // line-tables-only, so let those compose naturally in that case.

logic, I think altering `DwarfFission` in the driver is fine. If not, I'd hope the backend to process `DwarfFission` ...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94655/new/

https://reviews.llvm.org/D94655



More information about the cfe-commits mailing list