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

Function optimize_thin

crates/rustc_codegen_nvvm/src/lto.rs:149–166  ·  view source on GitHub ↗
(
    cgcx: &CodegenContext<NvvmCodegenBackend>,
    thin_module: &mut ThinModule<NvvmCodegenBackend>,
)

Source from the content-addressed store, hash-verified

147}
148
149pub(crate) unsafe fn optimize_thin(
150 cgcx: &CodegenContext<NvvmCodegenBackend>,
151 thin_module: &mut ThinModule<NvvmCodegenBackend>,
152) -> Result<ModuleCodegen<LlvmMod>, FatalError> {
153 // essentially does nothing
154 let diag_handler = cgcx.create_diag_handler();
155 let module_name = &thin_module.shared.module_names[thin_module.idx];
156
157 let llcx = llvm::LLVMRustContextCreate(cgcx.fewer_names);
158 let llmod = parse_module(llcx, module_name, thin_module.data(), &diag_handler)? as *const _;
159
160 let module = ModuleCodegen {
161 module_llvm: LlvmMod { llmod, llcx },
162 name: thin_module.name().to_string(),
163 kind: ModuleKind::Regular,
164 };
165 Ok(module)
166}
167
168pub(crate) fn parse_module<'a>(
169 cx: &'a llvm::Context,

Callers 1

optimize_thinMethod · 0.85

Calls 4

LLVMRustContextCreateFunction · 0.85
parse_moduleFunction · 0.85
dataMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected