[PATCH] D59673: [Driver] Allow setting the DWO name DWARF attribute separately

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 15 14:40:30 PDT 2019


dblaikie added a comment.

In D59673#1465975 <https://reviews.llvm.org/D59673#1465975>, @aaronpuchert wrote:

> In D59673#1461983 <https://reviews.llvm.org/D59673#1461983>, @dblaikie wrote:
>
> > Sure, I think the naming's a bit weird (but hard to come up with good names for any of this)
>
>
> Agreed, `-split-dwarf-output` is pretty clear, but `-split-dwarf-file` could be both the actual filename or the attribute.
>
> There is `test/CodeGen/split-debug-filename.c` checking that we emit `!DICompileUnit({{.*}}, splitDebugFilename: "foo.dwo"` into the IR under some circumstances, but I'm not sure why. It seems to be ignored by `llc`.


For implicit modular debug info I think it probably isn't ignored. See DwarfDebug.cpp:~630.

> What's the intended use for this? Your commit message in rC301063 <https://reviews.llvm.org/rC301063> suggests that this is needed for implicit modules. How does this work? I'm asking of course because I'm not sure whether we might need to emit both file names there.

So implicit modules can use a sort of pseudo-split DWARF. The .pcm (module file) itself is an object file in this mode - with the split DWARF and a section containing the AST bitcode. Then in the normal source files that use the .pcm, they get the usual non-split DWARF, plus skeleton CUs that reference the .pcm file (& contain some other attributes for regenerating it in case it's been cleaned up from the module cache). This is why the file name can be (& has to be) passed down through the IR - it /can/ be, because this compilation isn't choosing tnhe file name (so there's no issue with the .dwo file name changing between IR generation and object generation (as there is with LTO - where the compilation doesn't know the final object name, only the linker knows that)) and it /must/ be done this way due to multiple skeleton CUs if the main CU references multiple .pcm debug info.


Repository:
  rC Clang

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

https://reviews.llvm.org/D59673





More information about the cfe-commits mailing list