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

Function get_param

crates/rustc_codegen_nvvm/src/llvm.rs:110–120  ·  view source on GitHub ↗

Safe wrapper around `LLVMGetParam`, because segfaults are no fun.

(llfn: &Value, index: c_uint)

Source from the content-addressed store, hash-verified

108
109/// Safe wrapper around `LLVMGetParam`, because segfaults are no fun.
110pub(crate) fn get_param(llfn: &Value, index: c_uint) -> &Value {
111 unsafe {
112 assert!(
113 index < LLVMCountParams(llfn),
114 "out of bounds argument access: {} out of {} arguments",
115 index,
116 LLVMCountParams(llfn)
117 );
118 LLVMGetParam(llfn, index)
119 }
120}
121
122/// Safe wrapper around `LLVMGetParams`.
123pub(crate) fn get_params(llfn: &Value) -> Vec<&Value> {

Callers 2

get_paramMethod · 0.85
store_fn_argMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected