dzhidzhoev wrote:

> * For (1), this is very much like `-split-dwarf`. IMO, we should probably 
> generalize `MCTargetOptions::SplitDwarfFile` to `SplitDebugFile` and 
> implement `/Fd` generally. Doing this in a "this just forwards to a DirectX 
> target option" way is adding tech debt, and ignores the fact that this option 
> is much more general than just DirectX.

Re-using split-dwarf machinery was indeed considered when implementing DXBC PDB 
emission in llc. The thing with split dwarf is that the output file is created 
very early in llc, before IR pipeline begins. Therefore, for the scenario "user 
wants to create `<MD5 hash of ILDB>.pdb` in a given directory", we would need 
to do something like:
1. Emit PDB into a temporary file.
2. Extract and parse ILDN from it to determine the PDB destination filename.
3. Then move file to the target directory in llc (or in Clang, but then, when 
calling llc directly, user might end up having PDB file at a location different 
from what's in ILDN).

For me, it looked less straightforward than adding a pass to emit PDB right at 
the path where it should be placed. Maybe not with the DXC-mirroring `--dx-Fd` 
flag, but with distinct options that specify whether PDB should be emitted at a 
specific path, or into a specific folder (with <MD5>.pdb name)...

Do you think first approach is better?

> Supporting this improves MSVC compatibility and also helps with what to do 
> for things like HLSL targeting SPIR-V.

Hmm, I thought it was more of a design decision, to prefer linker do the job of 
merging debug info and emitting it into PDB. But I'm not sure about that.

https://github.com/llvm/llvm-project/pull/204166
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to