@@ -54,6 +54,23 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
54
54
self . u128_type
55
55
}
56
56
57
+ pub fn type_ptr_to ( & self , ty : Type < ' gcc > ) -> Type < ' gcc > {
58
+ ty. make_pointer ( )
59
+ }
60
+
61
+ pub fn type_ptr_to_ext ( & self , ty : Type < ' gcc > , _address_space : AddressSpace ) -> Type < ' gcc > {
62
+ // TODO(antoyo): use address_space, perhaps with TYPE_ADDR_SPACE?
63
+ ty. make_pointer ( )
64
+ }
65
+
66
+ pub fn type_i8p ( & self ) -> Type < ' gcc > {
67
+ self . type_ptr_to ( self . type_i8 ( ) )
68
+ }
69
+
70
+ pub fn type_i8p_ext ( & self , address_space : AddressSpace ) -> Type < ' gcc > {
71
+ self . type_ptr_to_ext ( self . type_i8 ( ) , address_space)
72
+ }
73
+
57
74
pub fn type_pointee_for_align ( & self , align : Align ) -> Type < ' gcc > {
58
75
// FIXME(eddyb) We could find a better approximation if ity.align < align.
59
76
let ity = Integer :: approximate_align ( self , align) ;
@@ -149,13 +166,12 @@ impl<'gcc, 'tcx> BaseTypeMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
149
166
}
150
167
}
151
168
152
- fn type_ptr_to ( & self , ty : Type < ' gcc > ) -> Type < ' gcc > {
153
- ty . make_pointer ( )
169
+ fn type_ptr ( & self ) -> Type < ' gcc > {
170
+ self . type_ptr_to ( self . type_void ( ) )
154
171
}
155
172
156
- fn type_ptr_to_ext ( & self , ty : Type < ' gcc > , _address_space : AddressSpace ) -> Type < ' gcc > {
157
- // TODO(antoyo): use address_space, perhaps with TYPE_ADDR_SPACE?
158
- ty. make_pointer ( )
173
+ fn type_ptr_ext ( & self , address_space : AddressSpace ) -> Type < ' gcc > {
174
+ self . type_ptr_to_ext ( self . type_void ( ) , address_space)
159
175
}
160
176
161
177
fn element_type ( & self , ty : Type < ' gcc > ) -> Type < ' gcc > {
0 commit comments