Skip to content

Commit 4b7aba7

Browse files
committed
Add set_allow_special_chars_in_func_names
1 parent e6109eb commit 4b7aba7

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

gccjit_sys/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ pub enum gcc_jit_bool_option {
5454
GCC_JIT_BOOL_OPTION_DUMP_EVERYTHING,
5555
GCC_JIT_BOOL_OPTION_SELFCHECK_GC,
5656
GCC_JIT_BOOL_OPTION_KEEP_INTERMEDIATES,
57+
GCC_JIT_BOOL_OPTION_SPECIAL_CHARS_IN_FUNC_NAMES,
5758
GCC_JIT_NUM_BOOL_OPTIONS
5859
}
5960

src/block.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ impl<'ctx> Block<'ctx> {
293293
gccjit_sys::gcc_jit_block_end_with_switch(self.ptr, loc_ptr, rvalue::get_ptr(&expr), block::get_ptr(&default_block),
294294
cases.len() as c_int, cases.as_ptr() as *mut *mut _);
295295
}
296+
#[cfg(debug_assertions)]
297+
if let Ok(Some(error)) = self.to_object().get_context().get_last_error() {
298+
panic!("{}", error);
299+
}
296300
}
297301

298302
pub fn add_extended_asm(&self, loc: Option<Location<'ctx>>, asm_template: &str) -> ExtendedAsm<'ctx> {

src/context.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,13 @@ impl<'ctx> Context<'ctx> {
202202
}
203203
}
204204

205+
#[cfg(feature="master")]
206+
pub fn set_allow_special_chars_in_func_names(&self, value: bool) {
207+
unsafe {
208+
gccjit_sys::gcc_jit_context_set_bool_option(self.ptr, GCC_JIT_BOOL_OPTION_SPECIAL_CHARS_IN_FUNC_NAMES, value as i32);
209+
}
210+
}
211+
205212
pub fn set_debug_info(&self, value: bool) {
206213
unsafe {
207214
gccjit_sys::gcc_jit_context_set_bool_option(self.ptr,

0 commit comments

Comments
 (0)