Allowed vectors to be passed to build_pointer_cast
@@ -783,14 +783,14 @@ impl Builder {
}
// SubType: <F, T>(&self, from: &PointerValue<F>, to: &PointerType<T>, name: &str) -> PointerValue<T> {
- pub fn build_pointer_cast(&self, from: &PointerValue, to: &PointerType, name: &str) -> PointerValue {
+ pub fn build_pointer_cast<T: PointerMathValue>(&self, from: &T, to: &T::BaseType, name: &str) -> T {
let c_string = CString::new(name).expect("Conversion to CString failed unexpectedly");
let value = unsafe {
LLVMBuildPointerCast(self.builder, from.as_value_ref(), to.as_type_ref(), c_string.as_ptr())
};
- PointerValue::new(value)
+ T::new(value)
}
// SubType: <I>(&self, op, lhs: &IntValue<I>, rhs: &IntValue<I>, name) -> IntValue<bool> { ?
