aWsm
aWsm copied to clipboard
Adding data layout meta
Hi @geky
In my use of case the data-layout metadata is needed. Taking a look at the llvm-alt crate, it seems that there is no way using the wrapper. However, calling directly to the llvm-sys underlying crate seems to work.
if let Some(ref layout) = opt.layout {
unsafe {
let c_target = std::ffi::CString::new(layout.to_string()).unwrap();
llvm::ffi::core::LLVMSetDataLayout(llvm_module.into(), c_target.as_ptr());
}
}
WDYT? Thanks in advance
Any context for what you're using the data layout for? Generally more debugging information would be quite useful.