Skip to content

Commit 4a1febb

Browse files
committed
Implement apply_datalayout! for LLVM 13
1 parent 8ef5f78 commit 4a1febb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/executionengine/lljit.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,18 @@ function triple(lljit::LLJIT)
7373
Base.unsafe_string(cstr)
7474
end
7575

76+
if version() < v"13"
7677
function apply_datalayout!(lljit::LLJIT, mod::LLVM.Module)
7778
LLVM.API.LLVMOrcLLJITApplyDataLayout(lljit, mod)
7879
end
80+
else
81+
function datalayout(lljit::LLJIT)
82+
Base.unsafe_string(API.LLVMOrcLLJITGetDataLayoutStr(lljit))
83+
end
84+
function apply_datalayout!(lljit::LLJIT, mod::LLVM.Module)
85+
datalayout!(mod, datalayout(lljit))
86+
end
87+
end
7988

8089
function get_prefix(lljit::LLJIT)
8190
return API.LLVMOrcLLJITGetGlobalPrefix(lljit)

0 commit comments

Comments
 (0)