Skip to content

Commit

Permalink
Add dwarf_version (#490)
Browse files Browse the repository at this point in the history
so that targets can choose their own
dwarf versions, (cuda needs v2)
  • Loading branch information
gbaraldi authored Aug 10, 2023
1 parent 06e6706 commit 15f0077
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ end

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

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

## params

Expand Down
2 changes: 1 addition & 1 deletion src/jlgen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ function compile_method_instance(@nospecialize(job::CompilerJob))
datalayout!(mod, julia_datalayout(job.config.target))
end
flags(mod)["Dwarf Version", LLVM.API.LLVMModuleFlagBehaviorWarning] =
Metadata(ConstantInt(Int32(4)))
Metadata(ConstantInt(dwarf_version(job.config.target)))
flags(mod)["Debug Info Version", LLVM.API.LLVMModuleFlagBehaviorWarning] =
Metadata(ConstantInt(DEBUG_METADATA_VERSION()))
end
Expand Down
1 change: 1 addition & 0 deletions src/ptx.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ llvm_datalayout(target::PTXCompilerTarget) =

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

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

## job

Expand Down

0 comments on commit 15f0077

Please sign in to comment.