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

Function get_value_name

crates/rustc_codegen_nvvm/src/llvm.rs:134–140  ·  view source on GitHub ↗

Safe wrapper for `LLVMGetValueName2` into a byte slice

(value: &Value)

Source from the content-addressed store, hash-verified

132
133/// Safe wrapper for `LLVMGetValueName2` into a byte slice
134pub(crate) fn get_value_name(value: &Value) -> &[u8] {
135 unsafe {
136 let mut len = 0;
137 let data = LLVMGetValueName2(value, &mut len);
138 std::slice::from_raw_parts(data.cast(), len)
139 }
140}
141
142/// Safe wrapper for `LLVMSetValueName2` from a byte slice
143pub(crate) fn set_value_name(value: &Value, name: &[u8]) {

Callers 2

codegen_staticMethod · 0.85
set_var_nameMethod · 0.85

Calls 2

from_raw_partsFunction · 0.50
castMethod · 0.45

Tested by

no test coverage detected