Skip to content

Commit 15f0077

Browse files
authored
Add dwarf_version (#490)
so that targets can choose their own dwarf versions, (cuda needs v2)
1 parent 06e6706 commit 15f0077

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/interface.jl

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ end
4545

4646
have_fma(@nospecialize(target::AbstractCompilerTarget), T::Type) = false
4747

48+
dwarf_version(target::AbstractCompilerTarget) = Int32(4) # It seems every target supports v4 bar cuda
4849

4950
## params
5051

src/jlgen.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ function compile_method_instance(@nospecialize(job::CompilerJob))
608608
datalayout!(mod, julia_datalayout(job.config.target))
609609
end
610610
flags(mod)["Dwarf Version", LLVM.API.LLVMModuleFlagBehaviorWarning] =
611-
Metadata(ConstantInt(Int32(4)))
611+
Metadata(ConstantInt(dwarf_version(job.config.target)))
612612
flags(mod)["Debug Info Version", LLVM.API.LLVMModuleFlagBehaviorWarning] =
613613
Metadata(ConstantInt(DEBUG_METADATA_VERSION()))
614614
end

src/ptx.jl

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ llvm_datalayout(target::PTXCompilerTarget) =
7070

7171
have_fma(@nospecialize(target::PTXCompilerTarget), T::Type) = true
7272

73+
dwarf_version(target::PTXCompilerTarget) = Int32(2) # Cuda only supports dwarfv2
7374

7475
## job
7576

0 commit comments

Comments
 (0)