@@ -32,9 +32,10 @@ impl Builder {
32
32
Builder :: new ( builder)
33
33
}
34
34
35
- // REVIEW: Would probably make this API a bit simpler by taking Into<Option<& BasicValue>>
36
- // So that you could just do build_return(& value) or build_return(None)
35
+ // REVIEW: Would probably make this API a bit simpler by taking Into<Option<impl BasicValue>>
36
+ // So that you could just do build_return(value) or build_return(None)
37
37
// Is that frowned upon?
38
+ // TODO: Option<impl BasicValue>
38
39
pub fn build_return ( & self , value : Option < & BasicValue > ) -> InstructionValue {
39
40
// let value = unsafe {
40
41
// value.map_or(LLVMBuildRetVoid(self.builder), |value| LLVMBuildRet(self.builder, value.value))
@@ -93,7 +94,7 @@ impl Builder {
93
94
}
94
95
95
96
// REVIEW: Doesn't GEP work on array too?
96
- pub fn build_gep ( & self , ptr : & PointerValue , ordered_indexes : & [ & IntValue ] , name : & str ) -> PointerValue {
97
+ pub fn build_gep ( & self , ptr : & PointerValue , ordered_indexes : & [ IntValue ] , name : & str ) -> PointerValue {
97
98
let c_string = CString :: new ( name) . expect ( "Conversion to CString failed unexpectedly" ) ;
98
99
99
100
let mut index_values: Vec < LLVMValueRef > = ordered_indexes. iter ( )
@@ -107,7 +108,7 @@ impl Builder {
107
108
}
108
109
109
110
// REVIEW: Doesn't GEP work on array too?
110
- pub fn build_in_bounds_gep ( & self , ptr : & PointerValue , ordered_indexes : & [ & IntValue ] , name : & str ) -> PointerValue {
111
+ pub fn build_in_bounds_gep ( & self , ptr : & PointerValue , ordered_indexes : & [ IntValue ] , name : & str ) -> PointerValue {
111
112
let c_string = CString :: new ( name) . expect ( "Conversion to CString failed unexpectedly" ) ;
112
113
113
114
let mut index_values: Vec < LLVMValueRef > = ordered_indexes. iter ( )
0 commit comments