Repository navigation
[SPIRV] Generate debug info from original source - #9024
Open
Steve Urquhart (SteveUrquhart) wants to merge 2 commits into
Open
Steve Urquhart (SteveUrquhart) wants to merge 2 commits into
Steve Urquhart (SteveUrquhart) wants to merge 2 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The user-visible compiler bug fix needs release-note coverage.
1 open finding
What changed in this PR
Updates SPIR-V debug generation to reference original HLSL source locations.
Changes:
- Removes preprocessing before SPIR-V debug compilation.
- Discovers included files through
SourceManager. - Adds coverage for comments, macros, columns, and guarded includes.
| File | Description |
|---|---|
tools/clang/tools/dxcompiler/dxcompilerobj.cpp |
Preserves original in-memory source without preprocessing. |
tools/clang/lib/SPIRV/SpirvEmitter.cpp |
Collects unique source files from source-manager entries. |
tools/clang/test/CodeGenSPIRV/spirv.debug.columns.hlsl |
Tests original-source columns and include deduplication. |
tools/clang/test/CodeGenSPIRV/spirv.debug.columns.include.hlsli |
Supplies guarded macro definitions for testing. |
tools/clang/test/CodeGenSPIRV/rich.debug.cbuffer.hlsl |
Updates expected original-source columns. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Debug info should reflect the original source. The only reason for -P was that the line table tells us our included files. Obtains the included list from SourceManager instead, allowing use of original source. Update rich.debug.cbuffer.hlsl, whose expected columns came from the preprocessed text, and add spirv.debug.columns.hlsl to cover columns after comments and macros and a guarded include with no code. Fixes microsoft#9022
Steve Urquhart (SteveUrquhart)
force-pushed
the
spirv-debug-no-preprocess
branch
from
October 12, 2026 17:48
06f3db8 to
cb62023
Compare
Diego Novillo (dnovillo)
suggested changes
Oct 16, 2026
Diego Novillo (dnovillo)
approved these changes
Oct 16, 2026
Diego Novillo (dnovillo)
left a comment
Collaborator
There was a problem hiding this comment.
Thanks! LGTM.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Debug info should reflect the original source. The only reason for -P was that the line table tells us our included files. Obtain the included list from SourceManager instead, allowing use of original source.
Update rich.debug.cbuffer.hlsl, whose expected columns came from the preprocessed text, and add spirv.debug.columns.hlsl to cover columns after comments and macros.
Fixes 9022