MCPcopy Create free account
hub / github.com/Rust-GPU/rust-cuda / parse_module

Function parse_module

crates/rustc_codegen_nvvm/src/lto.rs:168–182  ·  view source on GitHub ↗
(
    cx: &'a llvm::Context,
    name: &CStr,
    data: &[u8],
    diag_handler: &Handler,
)

Source from the content-addressed store, hash-verified

166}
167
168pub(crate) fn parse_module<'a>(
169 cx: &'a llvm::Context,
170 name: &CStr,
171 data: &[u8],
172 diag_handler: &Handler,
173) -> Result<&'a llvm::Module, FatalError> {
174 unsafe {
175 llvm::LLVMRustParseBitcodeForLTO(cx, data.as_ptr(), data.len(), name.as_ptr()).ok_or_else(
176 || {
177 let msg = "failed to parse bitcode for LTO module";
178 crate::back::llvm_err(diag_handler, msg)
179 },
180 )
181 }
182}

Callers 1

optimize_thinFunction · 0.85

Calls 4

llvm_errFunction · 0.85
as_ptrMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected