Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix WASM datalayout for top-of-tree LLVM #6339

Merged
merged 2 commits into from
Oct 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/LLVM_Runtime_Linker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,19 @@ llvm::DataLayout get_data_layout_for_target(Target target) {
"e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8"
"-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048");
} else if (target.arch == Target::WebAssembly) {
#if LLVM_VERSION >= 140
if (target.bits == 32) {
return llvm::DataLayout("e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20");
} else {
return llvm::DataLayout("e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20");
}
#else
if (target.bits == 32) {
return llvm::DataLayout("e-m:e-p:32:32-i64:64-n32:64-S128");
} else {
return llvm::DataLayout("e-m:e-p:64:64-i64:64-n32:64-S128");
}
#endif
} else if (target.arch == Target::RISCV) {
// TODO: Valdidate this data layout is correct for RISCV. Assumption is it is like MIPS.
if (target.bits == 32) {
Expand Down