microsoft / microsoft/DirectXShaderCompiler
User command line defines are duplicated in debug info and in preprocessor
@pow2clk is already working on this.
Since Jan 30, 2020.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
When invoking dxc with a -D option to define a macro, on the way down the pipe from command line to defines recognized by the preprocessor, they get duplicated in the argument list. This causes them to show up twice in the debug information. They are also applied twice to the preprocessor, but it treats them exactly as if the same define was set twice with the same value and accepts it without complaint.
This can be observed by compiling tools/clang/test/HLSLFileCheck/dxil/debug/misc/share_mem_dbg.hlsl with the dxc invocation stipulated by the RUN: command. The CHECK: like indicates that DefineA and DefineB should show up once. When invoked by the test infrastructure, which skips the initial compile operations found in dxc.cpp, that's what happens, but when invoked directly from the command line, both defines are duplicated:
!71 = !{!"DefineA=1", !"DefineB=0", !"DefineA=1", !"DefineB=0"}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.