diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/comp.c b/src/comp.c index e407c079b63..c97fe404cad 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -212,7 +212,7 @@ retrive_block (Lisp_Object symbol) | |||
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | static void | 214 | static void |
| 215 | declare_block (char *block_name) | 215 | declare_block (const char * block_name) |
| 216 | { | 216 | { |
| 217 | gcc_jit_block *block = gcc_jit_function_new_block (comp.func, block_name); | 217 | gcc_jit_block *block = gcc_jit_function_new_block (comp.func, block_name); |
| 218 | Lisp_Object key = make_string (block_name, strlen (block_name)); | 218 | Lisp_Object key = make_string (block_name, strlen (block_name)); |
| @@ -1977,7 +1977,7 @@ DEFUN ("comp-add-func-to-ctxt", Fcomp_add_func_to_ctxt, Scomp_add_func_to_ctxt, | |||
| 1977 | Lisp_Object args = FUNCALL1 (comp-func-args, func); | 1977 | Lisp_Object args = FUNCALL1 (comp-func-args, func); |
| 1978 | EMACS_INT frame_size = XFIXNUM (FUNCALL1 (comp-func-frame-size, func)); | 1978 | EMACS_INT frame_size = XFIXNUM (FUNCALL1 (comp-func-frame-size, func)); |
| 1979 | EMACS_INT min_args = XFIXNUM (FUNCALL1 (comp-args-min, args)); | 1979 | EMACS_INT min_args = XFIXNUM (FUNCALL1 (comp-args-min, args)); |
| 1980 | EMACS_INT max_args = XFIXNUM (FUNCALL1 (comp-args-max, args)); | 1980 | /* EMACS_INT max_args = XFIXNUM (FUNCALL1 (comp-args-max, args)); */ |
| 1981 | bool ncall = !NILP (FUNCALL1 (comp-args-ncall-conv, args)); | 1981 | bool ncall = !NILP (FUNCALL1 (comp-args-ncall-conv, args)); |
| 1982 | 1982 | ||
| 1983 | if (!ncall) | 1983 | if (!ncall) |
| @@ -2015,8 +2015,19 @@ DEFUN ("comp-add-func-to-ctxt", Fcomp_add_func_to_ctxt, Scomp_add_func_to_ctxt, | |||
| 2015 | 2015 | ||
| 2016 | comp.func_blocks = CALLN (Fmake_hash_table, QCtest, Qequal, QCweakness, Qt); | 2016 | comp.func_blocks = CALLN (Fmake_hash_table, QCtest, Qequal, QCweakness, Qt); |
| 2017 | 2017 | ||
| 2018 | /* Pre declare all basic blocks. */ | 2018 | /* Pre declare all basic blocks to gcc. |
| 2019 | The "entry" block must be declared as first. */ | ||
| 2020 | declare_block ("entry"); | ||
| 2019 | Lisp_Object blocks = FUNCALL1 (comp-func-blocks, func); | 2021 | Lisp_Object blocks = FUNCALL1 (comp-func-blocks, func); |
| 2022 | Lisp_Object entry_block = Fgethash (intern ("entry"), blocks, Qnil); | ||
| 2023 | struct Lisp_Hash_Table *ht = XHASH_TABLE (blocks); | ||
| 2024 | for (ptrdiff_t i = 0; i < ht->count; i++) | ||
| 2025 | { | ||
| 2026 | Lisp_Object block = HASH_VALUE (ht, i); | ||
| 2027 | if (!EQ (block, entry_block)) | ||
| 2028 | declare_block ((char *) SDATA (SYMBOL_NAME (HASH_KEY (ht, i)))); | ||
| 2029 | } | ||
| 2030 | |||
| 2020 | while (CONSP (blocks)) | 2031 | while (CONSP (blocks)) |
| 2021 | { | 2032 | { |
| 2022 | char *block_name = (char *) SDATA (SYMBOL_NAME (XCAR (blocks))); | 2033 | char *block_name = (char *) SDATA (SYMBOL_NAME (XCAR (blocks))); |