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

Justin Bogner via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 18 12:48:15 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");
----------------
bogner wrote:

If we consolidate the logic for dealing with the debug flags into the frontend and a target option, I think all of these checks become unnecessary.

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


More information about the cfe-commits mailing list