Skip to content

Commit 42ef442

Browse files
authored
Merge pull request #37 from zedar/add_is_float
add Type::is_float()
2 parents be7ca8d + 4f03269 commit 42ef442

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

gccjit_sys/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ extern {
553553
pub fn gcc_jit_type_dyncast_array(typ: *mut gcc_jit_type) -> *mut gcc_jit_type;
554554
pub fn gcc_jit_type_is_bool(typ: *mut gcc_jit_type) -> c_int;
555555
pub fn gcc_jit_type_is_integral(typ: *mut gcc_jit_type) -> c_int;
556+
pub fn gcc_jit_type_is_floating_point(typ: *mut gcc_jit_type) -> c_int;
556557
pub fn gcc_jit_type_unqualified(typ: *mut gcc_jit_type) -> *mut gcc_jit_type;
557558
pub fn gcc_jit_type_is_pointer(typ: *mut gcc_jit_type) -> *mut gcc_jit_type;
558559
pub fn gcc_jit_type_dyncast_function_ptr_type(typ: *mut gcc_jit_type) -> *mut gcc_jit_function_type;

src/types.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ impl<'ctx> Type<'ctx> {
172172
}
173173
}
174174

175+
pub fn is_floating_point(self) -> bool {
176+
unsafe {
177+
gccjit_sys::gcc_jit_type_is_floating_point(self.ptr) != 0
178+
}
179+
}
180+
175181
pub fn dyncast_vector(self) -> Option<VectorType<'ctx>> {
176182
unsafe {
177183
let vector_type = gccjit_sys::gcc_jit_type_dyncast_vector(self.ptr);

0 commit comments

Comments
 (0)