Safe wrapper around `LLVMGetParams`.
(llfn: &Value)
| 121 | |
| 122 | /// Safe wrapper around `LLVMGetParams`. |
| 123 | pub(crate) fn get_params(llfn: &Value) -> Vec<&Value> { |
| 124 | unsafe { |
| 125 | let count = LLVMCountParams(llfn) as usize; |
| 126 | let mut params = Vec::with_capacity(count); |
| 127 | LLVMGetParams(llfn, params.as_mut_ptr()); |
| 128 | params.set_len(count); |
| 129 | params |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | /// Safe wrapper for `LLVMGetValueName2` into a byte slice |
| 134 | pub(crate) fn get_value_name(value: &Value) -> &[u8] { |
no test coverage detected