emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Correct byte compiler error/warning positions. The solution!


From: Alan Mackenzie
Subject: Re: Correct byte compiler error/warning positions. The solution!
Date: Tue, 14 Dec 2021 14:29:31 +0000

Hello, Andrea.

On Sat, Dec 04, 2021 at 19:22:02 +0000, Andrea Corallo wrote:
> Alan Mackenzie <acm@muc.de> writes:

[ .... ]

> Hi Alan,

> > For extending emit_EQ, I've got the following embryonic scheme:

> > 1/- Import the C variable symbols_with_pos_enabled:

> >  gcc_jit_lvalue *syms_with_pos_enabled =
> >                gcc_jit_context_new_global
> >                  (comp.ctxt, NULL,
> >                   GCC_JIT_GLOBAL_IMPORTED,
> >                   gcc_jit_get_type (comp.ctxt, GCC_JIT_TYPE_BOOL),
> >                   "symbols_with_pos_enabled");

> Yep something like.  PS We already have 'comp.bool_type' to use.

[ .... ]

> > Can you let me know what you think of this approach, please?  That is,
> > before I put a lot of work into it.  Is it broadly a good way of doing
> > the job?

> I think it could be a good idea but I believe there's no need to use
> macros here, we could have just functions return rvalues no?

Yes, no macros needed.  :-)

> I'm not a big fan of C macros and I try not to use them whem possible.

[ .... ]

I have a problem at the moment, which could be a big problem.  How do I
refer to a Lisp variable from jit generated code?

In particular, I need read-access to symbols-with-pos-enabled, or more
precisely to globals.f_symbols_with_pos_enabled.

The gcc jit product seems to go out of its way to make such access as
difficult as possible.  There is a way to get an integer out of "C space"
into the jit mechanism, but this cannot be cast to a pointer type, and
there is no similar mechanism to get a pointer out of C space.  In fact,
gcc jit seems to restrict the language it supports to the equivalent of
Pascal, and makes pointer arithmetic impossible.

I tried declaring "globals" as a global variable to be imported into jit
space, but the loader doesn't know about "globals".

So, how can I get access to globals.f_symbols_with_pos_enabled?

Thanks in advance!

> Best Regards

>   Andrea

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]