Safe wrapper around `LLVMGetParam`, because segfaults are no fun.
(llfn: &Value, index: c_uint)
| 108 | |
| 109 | /// Safe wrapper around `LLVMGetParam`, because segfaults are no fun. |
| 110 | pub(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`. |
| 123 | pub(crate) fn get_params(llfn: &Value) -> Vec<&Value> { |
no outgoing calls
no test coverage detected