mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
chasing GNU style
This commit is contained in:
parent
7c9a3556e3
commit
009089f0d6
2 changed files with 38 additions and 37 deletions
|
|
@ -1428,7 +1428,7 @@ PRE-LAMBDA and POST-LAMBDA are called in pre or post-order if non nil."
|
|||
for e in (comp-block-in-edges b)
|
||||
for b = (comp-edge-src e)
|
||||
for in-frame = (comp-block-final-frame b)
|
||||
collect (aref in-frame slot-n))) ))
|
||||
collect (aref in-frame slot-n)))))
|
||||
|
||||
(cl-loop for b being each hash-value of (comp-func-blocks comp-func)
|
||||
do (cl-loop for (op . args) in (comp-block-insns b)
|
||||
|
|
|
|||
41
src/comp.c
41
src/comp.c
|
|
@ -57,11 +57,11 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
|
|||
|
||||
/* Like call1 but stringify and intern. */
|
||||
#define CALL1I(fun, arg) \
|
||||
CALLN (Ffuncall, intern_c_string (STR(fun)), arg)
|
||||
CALLN (Ffuncall, intern_c_string (STR (fun)), arg)
|
||||
|
||||
#define DECL_BLOCK(name, func) \
|
||||
gcc_jit_block *(name) = \
|
||||
gcc_jit_function_new_block ((func), STR(name))
|
||||
gcc_jit_function_new_block ((func), STR (name))
|
||||
|
||||
#ifdef HAVE__SETJMP
|
||||
#define SETJMP _setjmp
|
||||
|
|
@ -343,7 +343,7 @@ declare_imported_func (Lisp_Object subr_sym, gcc_jit_type *ret_type,
|
|||
/* String containing the function ptr name. */
|
||||
Lisp_Object f_ptr_name =
|
||||
CALLN (Ffuncall, intern_c_string (STR (comp-c-func-name)),
|
||||
subr_sym, make_string("R", 1));
|
||||
subr_sym, make_string ("R", 1));
|
||||
|
||||
gcc_jit_type *f_ptr_type =
|
||||
gcc_jit_context_new_function_ptr_type (comp.ctxt,
|
||||
|
|
@ -381,7 +381,8 @@ emit_call (Lisp_Object subr_sym, gcc_jit_type *ret_type, unsigned nargs,
|
|||
xmint_pointer (func),
|
||||
nargs,
|
||||
args);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
gcc_jit_lvalue *f_ptr =
|
||||
gcc_jit_lvalue_access_field (comp.func_relocs,
|
||||
NULL,
|
||||
|
|
@ -402,7 +403,7 @@ emit_call_ref (Lisp_Object subr_sym, unsigned nargs,
|
|||
gcc_jit_lvalue *base_arg, bool direct)
|
||||
{
|
||||
gcc_jit_rvalue *args[] =
|
||||
{ gcc_jit_context_new_rvalue_from_int(comp.ctxt,
|
||||
{ gcc_jit_context_new_rvalue_from_int (comp.ctxt,
|
||||
comp.ptrdiff_type,
|
||||
nargs),
|
||||
gcc_jit_lvalue_get_address (base_arg, NULL) };
|
||||
|
|
@ -757,7 +758,7 @@ emit_NUMBERP (gcc_jit_rvalue *obj)
|
|||
NULL,
|
||||
GCC_JIT_BINARY_OP_LOGICAL_OR,
|
||||
comp.bool_type,
|
||||
emit_INTEGERP(obj),
|
||||
emit_INTEGERP (obj),
|
||||
emit_cast (comp.bool_type,
|
||||
emit_FLOATP (obj)));
|
||||
}
|
||||
|
|
@ -962,7 +963,7 @@ emit_XSETCAR (gcc_jit_rvalue *c, gcc_jit_rvalue *n)
|
|||
{
|
||||
emit_comment ("XSETCAR");
|
||||
|
||||
gcc_jit_block_add_assignment(
|
||||
gcc_jit_block_add_assignment (
|
||||
comp.block,
|
||||
NULL,
|
||||
gcc_jit_rvalue_dereference (
|
||||
|
|
@ -976,7 +977,7 @@ emit_XSETCDR (gcc_jit_rvalue *c, gcc_jit_rvalue *n)
|
|||
{
|
||||
emit_comment ("XSETCDR");
|
||||
|
||||
gcc_jit_block_add_assignment(
|
||||
gcc_jit_block_add_assignment (
|
||||
comp.block,
|
||||
NULL,
|
||||
gcc_jit_rvalue_dereference (
|
||||
|
|
@ -1033,7 +1034,7 @@ emit_mvar_val (Lisp_Object mvar)
|
|||
(read fixnums). */
|
||||
emit_comment (SSDATA (Fprin1_to_string (constant, Qnil)));
|
||||
gcc_jit_rvalue *word =
|
||||
gcc_jit_context_new_rvalue_from_ptr(comp.ctxt,
|
||||
gcc_jit_context_new_rvalue_from_ptr (comp.ctxt,
|
||||
comp.void_ptr_type,
|
||||
constant);
|
||||
return emit_cast (comp.lisp_obj_type, word);
|
||||
|
|
@ -1266,7 +1267,7 @@ emit_limple_insn (Lisp_Object insn)
|
|||
NULL,
|
||||
comp.m_handlerlist);
|
||||
|
||||
gcc_jit_block_add_assignment(
|
||||
gcc_jit_block_add_assignment (
|
||||
comp.block,
|
||||
NULL,
|
||||
m_handlerlist,
|
||||
|
|
@ -1294,14 +1295,14 @@ emit_limple_insn (Lisp_Object insn)
|
|||
comp.block,
|
||||
NULL,
|
||||
m_handlerlist,
|
||||
gcc_jit_lvalue_as_rvalue(
|
||||
gcc_jit_lvalue_as_rvalue (
|
||||
gcc_jit_rvalue_dereference_field (
|
||||
gcc_jit_lvalue_as_rvalue (comp.loc_handler),
|
||||
NULL,
|
||||
comp.handler_next_field)));
|
||||
emit_frame_assignment (
|
||||
arg[0],
|
||||
gcc_jit_lvalue_as_rvalue(
|
||||
gcc_jit_lvalue_as_rvalue (
|
||||
gcc_jit_rvalue_dereference_field (
|
||||
gcc_jit_lvalue_as_rvalue (comp.loc_handler),
|
||||
NULL,
|
||||
|
|
@ -1760,7 +1761,7 @@ emit_ctxt_code (void)
|
|||
d_reloc = Fvconcat (1, &d_reloc);
|
||||
|
||||
comp.data_relocs =
|
||||
gcc_jit_lvalue_as_rvalue(
|
||||
gcc_jit_lvalue_as_rvalue (
|
||||
gcc_jit_context_new_global (
|
||||
comp.ctxt,
|
||||
NULL,
|
||||
|
|
@ -1805,7 +1806,7 @@ emit_ctxt_code (void)
|
|||
FIXNUMP (maxarg) ? XFIXNUM (maxarg) :
|
||||
EQ (maxarg, Qmany) ? MANY : UNEVALLED,
|
||||
NULL);
|
||||
fields [n_frelocs++] = field;
|
||||
fields[n_frelocs++] = field;
|
||||
f_reloc_list = Fcons (subr_sym, f_reloc_list);
|
||||
}
|
||||
}
|
||||
|
|
@ -2261,7 +2262,7 @@ define_CAR_CDR (void)
|
|||
gcc_jit_context_new_function (comp.ctxt, NULL,
|
||||
GCC_JIT_FUNCTION_INTERNAL,
|
||||
comp.lisp_obj_type,
|
||||
f_name [i],
|
||||
f_name[i],
|
||||
2, param, 0);
|
||||
|
||||
gcc_jit_rvalue *c = gcc_jit_param_as_rvalue (param[0]);
|
||||
|
|
@ -2890,7 +2891,7 @@ DEFUN ("comp--init-ctxt", Fcomp__init_ctxt, Scomp__init_ctxt,
|
|||
register_emitter (Qintegerp, emit_integerp);
|
||||
}
|
||||
|
||||
comp.ctxt = gcc_jit_context_acquire();
|
||||
comp.ctxt = gcc_jit_context_acquire ();
|
||||
|
||||
if (COMP_DEBUG)
|
||||
{
|
||||
|
|
@ -3016,7 +3017,7 @@ DEFUN ("comp--release-ctxt", Fcomp__release_ctxt, Scomp__release_ctxt,
|
|||
(void)
|
||||
{
|
||||
if (comp.ctxt)
|
||||
gcc_jit_context_release(comp.ctxt);
|
||||
gcc_jit_context_release (comp.ctxt);
|
||||
|
||||
if (logfile)
|
||||
fclose (logfile);
|
||||
|
|
@ -3049,7 +3050,7 @@ DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file,
|
|||
emit_ctxt_code ();
|
||||
|
||||
/* Define inline functions. */
|
||||
define_CAR_CDR();
|
||||
define_CAR_CDR ();
|
||||
define_PSEUDOVECTORP ();
|
||||
define_CHECK_TYPE ();
|
||||
define_CHECK_IMPURE ();
|
||||
|
|
@ -3165,7 +3166,7 @@ load_static_obj (dynlib_handle_ptr handle, const char *name)
|
|||
{
|
||||
static_obj_t *(*f)(void) = dynlib_sym (handle, name);
|
||||
eassert (f);
|
||||
static_obj_t *res = f();
|
||||
static_obj_t *res = f ();
|
||||
return Fread (make_string (res->data, res->len));
|
||||
}
|
||||
|
||||
|
|
@ -3284,7 +3285,7 @@ DEFUN ("comp--register-subr", Fcomp__register_subr,
|
|||
x->s.max_args = FIXNUMP (maxarg) ? XFIXNUM (maxarg) : MANY;
|
||||
x->s.symbol_name = SSDATA (Fsymbol_name (name));
|
||||
x->s.native_elisp = true;
|
||||
defsubr(x);
|
||||
defsubr (x);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue