>    #define PARROT_str_local(d)        \
>       STRING * d = NULL;              \
>       frame frame_##d;                \
>       int dummy_##d = (               \
>         (frame_##d.ptr = &d),         \
>         (frame_##d.next = stack_top), \
>         (stack_top = &frame_##d),     \
>         0);

This triggers the perl5 macro-iitis alarm.  

Please don't do this :)

If you need to do things like that, then maybe we need to develop our
own function inliner -- there will still be debugging issues with the
optimizer, but less, if it looks like this:

 
   STRING * concat (STRING* a, STRING* b, STRING* c) {
     PARROT_str_local_2(d, e);

     foo;
   } 

Expands into:
 
#line sourcefile.pmc 50
  STRING * concat (STRING* a, STRING* b, STRING* c) {
#line macros.h 50
       STRING * d = NULL;              
       frame frame_d;                
       frame_d.ptr = &d;
       frame_d.next = stack_top;
       stack_top = &frame_d;     
#line sourcefile.pmc 52


BUT--

    We've got enough complicated preprocessor issues right now - I'm
    not sure we want to add another one.  Defining perl5ish macros
    will cause too many troubles down the road.

    Or... since C99 supports C function inlining (iirc) - we could
    just rely on a C99 compiler....

-R


 

Reply via email to