[Ada] Macro-ize a couple of wrappers

Eric Botcazou ebotcazou@adacore.com
Sat Apr 19 01:08:00 GMT 2008


> Interestingly:
>
> -- p.ads
> package P is
>    function F (A, B, C : Integer) return Integer;
>    Pragma Inline (F);
> end P;
> -- p.adb
> package body P is
>    function External (A, B : Integer) return Integer;
>    pragma Import (Ada, External);
>
>    function F (A, B, C : Integer) return Integer is
>    begin
>       return External (C, A);
>    end F;
>
> end P;
> -- q.adb
> with P;
> procedure Q is
>    R : Integer;
> begin
>    R := P.F (1, 2, 3);
> end Q;
> -- end source
>
> gcc -S -g -O1 -gnatn q.adb
>
> with 4.3.0 generates for the P.F call:
>
>         movl    $1, %esi
>         movl    $3, %edi
>         call    external

Yes, but you're cheating since you're using -gnatn. :-)

-- 
Eric Botcazou



More information about the Gcc-patches mailing list