Skip to content

Commit 5cce9e0

Browse files
committed
Always remove debug info.
1 parent e208922 commit 5cce9e0

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/spirv.jl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ end
6464

6565
@unlocked function mcgen(job::CompilerJob{SPIRVCompilerTarget}, mod::LLVM.Module,
6666
format=LLVM.API.LLVMAssemblyFile)
67+
# The SPIRV Tools don't handle Julia's debug info, rejecting DW_LANG_Julia...
68+
strip_debuginfo!(mod)
69+
6770
# write the bitcode to a temporary file (the SPIRV Translator library doesn't have a C API)
6871
mktemp() do input, input_io
6972
write(input_io, mod)
@@ -92,14 +95,6 @@ end
9295

9396
# reimplementation that uses `spirv-dis`, giving much more pleasant output
9497
function code_native(io::IO, job::CompilerJob{SPIRVCompilerTarget}; raw::Bool=false, dump_module::Bool=false)
95-
if raw
96-
# The SPIRV Tools don't handle Julia's debug info, rejecting DW_LANG_Julia...
97-
# so just return what LLVM gives us in that case (which is also more faithful).
98-
asm, _ = codegen(:asm, job; strip=false, only_entry=!dump_module, validate=false)
99-
print(io, asm)
100-
return
101-
end
102-
10398
obj, _ = codegen(:obj, job; strip=!raw, only_entry=!dump_module, validate=false)
10499
mktemp() do input_path, input_io
105100
write(input_io, obj)

0 commit comments

Comments
 (0)