File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -662,4 +662,7 @@ extern {
662
662
pub fn gcc_jit_version_major ( ) -> c_int ;
663
663
pub fn gcc_jit_version_minor ( ) -> c_int ;
664
664
pub fn gcc_jit_version_patchlevel ( ) -> c_int ;
665
+
666
+ #[ cfg( feature="master" ) ]
667
+ pub fn gcc_jit_function_new_temp ( func : * mut gcc_jit_function , loc : * mut gcc_jit_location , ty : * mut gcc_jit_type ) -> * mut gcc_jit_lvalue ;
665
668
}
Original file line number Diff line number Diff line change @@ -213,6 +213,22 @@ impl<'ctx> Function<'ctx> {
213
213
}
214
214
}
215
215
216
+ #[ cfg( feature="master" ) ]
217
+ pub fn new_temp ( & self , loc : Option < Location < ' ctx > > , ty : Type < ' ctx > ) -> LValue < ' ctx > {
218
+ unsafe {
219
+ let loc_ptr = match loc {
220
+ Some ( loc) => location:: get_ptr ( & loc) ,
221
+ None => ptr:: null_mut ( )
222
+ } ;
223
+ let ptr = gccjit_sys:: gcc_jit_function_new_temp ( self . ptr , loc_ptr, types:: get_ptr ( & ty) ) ;
224
+ #[ cfg( debug_assertions) ]
225
+ if let Ok ( Some ( error) ) = self . to_object ( ) . get_context ( ) . get_last_error ( ) {
226
+ panic ! ( "{} ({:?})" , error, self ) ;
227
+ }
228
+ lvalue:: from_ptr ( ptr)
229
+ }
230
+ }
231
+
216
232
#[ cfg( feature="master" ) ]
217
233
pub fn add_attribute < ' a > ( & self , attribute : FnAttribute < ' a > ) {
218
234
let value = attribute. get_value ( ) ;
You can’t perform that action at this time.
0 commit comments