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

Method get_declared_value

crates/rustc_codegen_nvvm/src/context.rs:358–366  ·  view source on GitHub ↗

Gets declared value by name.

(&self, name: &str)

Source from the content-addressed store, hash-verified

356
357 /// Gets declared value by name.
358 pub fn get_declared_value(&self, name: &str) -> Option<&'ll Value> {
359 // NVVM doesnt allow `.` inside of globals, this should be sound, at worst it should result in an llvm/nvvm error if something goes wrong.
360 let name = sanitize_global_ident(name);
361 trace!("Retrieving value with name `{}`...", name);
362 let res =
363 unsafe { llvm::LLVMRustGetNamedValue(self.llmod, name.as_ptr().cast(), name.len()) };
364 trace!("...Retrieved value: `{:?}`", res);
365 res
366 }
367
368 /// Gets defined or externally defined (AvailableExternally linkage) value by
369 /// name.

Callers 3

get_staticMethod · 0.80
get_defined_valueMethod · 0.80
get_fnMethod · 0.80

Calls 5

sanitize_global_identFunction · 0.85
LLVMRustGetNamedValueFunction · 0.85
as_ptrMethod · 0.80
castMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected