Skip to content

DXC emits DW_LANG_C_plus_plus instead of DW_LANG_HLSL for HLSL #9087

Open

Description

@chaocNV

Description

In the tested DXC build, this appears to affect virtually any HLSL shader compiled with debug information: the emitted DICompileUnit identifies the source language as DW_LANG_C_plus_plus. The issue is independent of specific shader constructs; the compile-unit language selection in CGDebugInfo::CreateCompileUnit() uses the C++ language option without separately handling HLSL. The compile unit should identify the source language as DW_LANG_HLSL, so debug consumers can correctly identify HLSL shaders and downstream DWARF generators can preserve the correct DW_AT_language.

Steps to Reproduce

  1. Compile any valid HLSL shader with -Zi -Qembed_debug and emit a textual DXIL listing with -Fc. Use the shader's usual entry point, target profile, include paths, and defines. For example, for a compute shader with entry point main:

    dxc -T cs_6_0 -E main -Zi -Qembed_debug -Od -Fo shader.dxil -Fc shader.ll shader.hlsl
  2. Inspect the compile-unit metadata in the generated listing:

    findstr /C:"!DICompileUnit(" shader.ll

No particular shader source is required. The issue is visible directly in DXC's output; no GPU execution is needed.

Actual Behavior

The observed compilation succeeds with exit code 0 and no diagnostics. For example, the tested build emits:

!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, ......)

Expected: language: DW_LANG_HLSL for this HLSL compilation unit.

Environment

  • Just an offline DXC compiler

Activity

  1. added
    bug
    needs-triage
    on Oct 30, 2026
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

    bugneeds-triage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions