[llvm] d89537d - [DirectX] Fix `--dx-embed-debug` flag dependency (#210513)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 18 12:06:35 PDT 2026


Author: Ilia Kuklin
Date: 2026-07-19T00:06:30+05:00
New Revision: d89537dd93f6fba07864e3583e11996c91a794b8

URL: https://github.com/llvm/llvm-project/commit/d89537dd93f6fba07864e3583e11996c91a794b8
DIFF: https://github.com/llvm/llvm-project/commit/d89537dd93f6fba07864e3583e11996c91a794b8.diff

LOG: [DirectX] Fix `--dx-embed-debug` flag dependency (#210513)

This patch moves the definition of `cl::opt<std::string> PdbDebugPath`
from `DXContainerGlobals.cpp` to `DXILWriter/DXILWriterPass.cpp`,
reversing the dependency.
Fixes the layering violation in #204166.

Added: 
    

Modified: 
    llvm/lib/Target/DirectX/DXContainerGlobals.cpp
    llvm/lib/Target/DirectX/DXILWriter/DXILWriterPass.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/DirectX/DXContainerGlobals.cpp b/llvm/lib/Target/DirectX/DXContainerGlobals.cpp
index 7b033c3249008..f9cf43e67f1fb 100644
--- a/llvm/lib/Target/DirectX/DXContainerGlobals.cpp
+++ b/llvm/lib/Target/DirectX/DXContainerGlobals.cpp
@@ -41,11 +41,7 @@ using namespace llvm::mcdxbc;
 
 static cl::opt<bool> ShaderHashDependsOnSource(
     "dx-Zss", cl::desc("Compute Shader Hash considering source information"));
-cl::opt<std::string> PdbDebugPath(
-    "dx-pdb-path",
-    cl::desc("Write debug information to the given file, or automatically "
-             "named file in directory when ending in '/'"),
-    cl::value_desc("filename"));
+extern cl::opt<std::string> PdbDebugPath;
 extern cl::opt<bool> SourceInDebugModule;
 
 namespace {

diff  --git a/llvm/lib/Target/DirectX/DXILWriter/DXILWriterPass.cpp b/llvm/lib/Target/DirectX/DXILWriter/DXILWriterPass.cpp
index 9c61e4c1acb93..442ea1131beb9 100644
--- a/llvm/lib/Target/DirectX/DXILWriter/DXILWriterPass.cpp
+++ b/llvm/lib/Target/DirectX/DXILWriter/DXILWriterPass.cpp
@@ -38,7 +38,11 @@ using namespace llvm::dxil;
 
 extern cl::opt<bool> EmbedDebug;
 extern cl::opt<bool> StripDebug;
-extern cl::opt<std::string> PdbDebugPath;
+cl::opt<std::string> PdbDebugPath(
+    "dx-pdb-path",
+    cl::desc("Write debug information to the given file, or automatically "
+             "named file in directory when ending in '/'"),
+    cl::value_desc("filename"));
 cl::opt<bool> SourceInDebugModule(
     "dx-source-in-debug-module",
     cl::desc("Embed source code into debug module on DirectX target"),


        


More information about the llvm-commits mailing list