Skip to content

[SPIR-V] Compile the original source with -fspv-debug instead of the -P output #9022

Open

Description

With -fspv-debug, dxcompilerobj.cpp compiles the output of a -P pass.

Line numbers map back through #line markers, but debug columns are positions in the preprocessed line, so they are wrong on any line that contains a macro expansion or a removed comment. spirv-val now rejects the module when a column is past the end of the original line (#8543).

I'm testing a fix for #8543 that clamps the columns and leaves them approximate.

The -P pass is also how SpirvEmitter::HandleTranslationUnit finds the included files. It lists them from the #line table the pass writes (#6935, for #6907).

Steve Urquhart (@SteveUrquhart), do you think that the include list can come from somewhere other than the #line table, for example the SourceManager file entries?

Activity

  1. SteveUrquhart commented on Oct 9, 2026

    @SteveUrquhart
    Contributor

    Hi Diego Novillo (@dnovillo) , that would be a lot cleaner. I can push a branch for that if you would like, or PR it.

  2. SteveUrquhart commented on Oct 9, 2026

    @SteveUrquhart
    Contributor

    I opened #9024

  3. dnovillo commented on Oct 9, 2026

    @dnovillo
    CollaboratorAuthor

    5. I opened #9024

    Thank you!

  4. added a commit that references this issue on Oct 12, 2026
    cb62023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    debug infoRelated to debug info generationspirvWork related to SPIR-V

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions