[PATCH] D59923: [Driver] Simplify -g level computation and its interaction with -gsplit-dwarf

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 10 14:03:31 PDT 2019


dblaikie added a comment.

In D59923#1460696 <https://reviews.llvm.org/D59923#1460696>, @MaskRay wrote:

> > is that to imply that the first block all do not use split DWARF?
>
> The first block do not use split DWARF.


That doesn't sound like what I'd expect (& would represent a change in behavior as well). The first block reads:

-gsplit-dwarf -g0 => 0
-gsplit-dwarf -gline-directives-only => DebugDirectivesOnly
-gsplit-dwarf -gmlt -fsplit-dwarf-inlining => 1
-gsplit-dwarf -gmlt -fno-split-dwarf-inlining => 1

This last one currently produces split-dwarf (if there's any DWARF worth splitting - if there are any subprogram descriptions, etc, otherwise it saves the indirection and produces an empty .dwo file).

>> In a previous message I think you said that the only change was "-gmlt -gsplit-dwarf -fno-split-dwarf-inlining => 1 (before) 2 (after)" - which I'm not sure is an improvement.
> 
> Yes, this is the only behavioral change.
> 
>> You mentioned that the inconsistency between "-g0 -gsplit-dwarf" and "-gmlt -gsplit-dwarf -fno-split-dwarf-inlining" was confusing. But still there will be an inconsistency between "-gsplit-dwarf -g0" and "-gsplit-dwarf -gmlt -fno-split-dwarf-inlining", yes?
> 
> The debug info level will be consistent after this patch:  the last of `-gsplit-dwarf -g0 -g1 -g2 -g3 -ggdb[0-3] -gdwarf-*` will decide the debug info level (`-gsplit-dwarf -gdwarf-*` have level 2). Next, a separate rule decides if the `-gsplit-dwarf` takes effect (not if `DebugInfoKind == codegenoptions::NoDebugInfo || DebugInfoKind == codegenoptions::DebugDirectivesOnly || (DebugInfoKind == codegenoptions::DebugLineTablesOnly && SplitDWARFInlining)`)
> 
>> I think that under -fno-split-dwarf-inlining, -gmlt and -gsplit-dwarf should be order independent and compositional rather than overriding. Having them compose in one order but not the other seems confusing to me.
> 
> The existence of `-fno-split-dwarf-inlining` changing the position dependence makes me confused:
> 
> - Without it, the latter of `-gmlt` and `-gsplit-dwarf` decides the debug info level
> - With it, `-gmlt` decides the debug info level

Seems there's going to be confusion either way, though - either the presence/absence of -fno-split-dwarf-inlining changes whether -gsplit-dwarf is respected/ignored (in the presence of -gmlt), or changes whethe -gmlt composes with -gsplit-dwarf or overrides it? Seems these are both a bit confusing, no?


Repository:
  rC Clang

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

https://reviews.llvm.org/D59923





More information about the cfe-commits mailing list