[clang] [llvm] [Driver][DirectX] Add `/Qembed_debug` and `/Fd` flags (PR #204166)

Ilia Kuklin via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 18 15:08:56 PDT 2026


================
@@ -227,6 +230,18 @@ class EmbedDXILPass : public llvm::ModulePass {
     legalizeLifetimeIntrinsics(M);
 
     bool HasDebugInfo = !M.debug_compile_units().empty();
+
+    // Enable EmbedDebug if there is debug info, but it is not being written
+    // to a PDB file.
+    if (HasDebugInfo && !EmbedDebug && PdbDebugPath.empty())
+      EmbedDebug = true;
+    if (!HasDebugInfo && EmbedDebug)
+      reportFatalUsageError(
+          "Missing debug info for embedding into the container");
+    // TODO: move this check to DXContainerPDB.cpp when /Zs is implemented.
+    if (!HasDebugInfo && !PdbDebugPath.empty())
+      reportFatalUsageError("Missing debug info for writing to the PDB file");
----------------
kuilpd wrote:

We wanted to have separate backed flags so the functionality could be tested from `llc` as well.

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


More information about the cfe-commits mailing list