aWsm icon indicating copy to clipboard operation
aWsm copied to clipboard

Adding data layout meta

Open Jacarte opened this issue 4 years ago • 1 comments

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

Jacarte avatar Jan 25 '21 12:01 Jacarte

Any context for what you're using the data layout for? Generally more debugging information would be quite useful.

gparmer avatar Jan 28 '21 20:01 gparmer