[clang] [llvm] [DirectX] Add `--dx-embed-debug` and `--dx-pdb-path` flags (PR #204166)

Jessica Clarke via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 18 08:00:36 PDT 2026


jrtc27 wrote:

> > Please revert this patch. The use of PdbDebugPath in DXILBitWriter/DXILWriterPass.cpp is a layering violation. It is defined in DXContainerGlobals.cpp, part of DirectXCodeGen, which depends on DXILBitWriter, not the other way round. This breaks enabling BUILD_SHARED_LIBS and, unlike typical breakages of that build that I've fixed over the years by adding missing dependencies to CMakeLists.txt (see [8763a68](https://github.com/llvm/llvm-project/commit/8763a68723b0dbd1ef2e7cc0ac61b2635ceef000), [acdb0c1](https://github.com/llvm/llvm-project/commit/acdb0c1f99a50ef357ac75ae1151991ca40aba10), [59b6c1b](https://github.com/llvm/llvm-project/commit/59b6c1b2d5290c40f59d2820b5144e2dec731635), [c92bf6b](https://github.com/llvm/llvm-project/commit/c92bf6b689a1b6c662f3fb30318c67257dbca864), [9f87bfe](https://github.com/llvm/llvm-project/commit/9f87bfe8bf2a3bd9b761e61c3cea3ccfec0553ec)), cannot be fixed that way.
> 
> If I define `PdbDebugPath` in DXILBitWriter/DXILWriterPass.cpp, and then use `extern PdbDebugPath` in DXContainerGlobals.cpp, will this fix the issue?

If that makes sense then yes that would seem ok. It's only used by those two places. Of course, if anywhere else starts to need it this may need reconsidering.

> There is also `extern EmbedDebug` in DXILBitWriter/DXILWriterPass.cpp, which is defined in lib/MC/MCDXContainerWriter.cpp, is this dependency fine?

Yes, that's fine, DXILWriter/CMakeLists.txt already lists MC under LINK_COMPONENTS.

https://github.com/llvm/llvm-project/pull/204166


More information about the cfe-commits mailing list