KhronosGroup / SPIRV-LLVM-Translator

A tool and a library for bi-directional translation between SPIR-V and LLVM IR
Other
479 stars 213 forks source link

DebugInfo Source Language representation #1098

Open svenvh opened 3 years ago

svenvh commented 3 years ago

This might not be an issue in the translator, but starting the discussion here.

PR 1074 highlights an issue with the representation of source languages that are not in the Source Language section of the core SPIR-V specification. We currently cannot represent the "Fortran" source language in a SPIR-V DebugCompilationUnit, which matters for the LLVM IR Verifier that has different rules for verifying DISubrange depending on the language. This might not be a problem specific to Fortran: SPIR-V's Source Language enum currently has only a few languages.

StuartDBrady commented 3 years ago

It's unclear to me, at least, whether LLVM is correct in insisting that a source language be specified.

asudarsa commented 2 years ago

Hi @svenvh Thanks for starting this thread. I have just started to actively get involved in SPIR-V Translator work. I am interested to know how easy/difficult it will be to add 'Fortran' as one of the source languages that can be represented in SPIRV DebugCompilationUnit?

svenvh commented 2 years ago

@asudarsa if you're just interested in adding "Fortran" as a valid source language, I'd suggest to try to get it added as a valid Source Language enum value in the SPIR-V spec through Khronos.

I can't say how easy/difficult a more generic solution beyond just adding Fortran would be.