OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gnat.dg/] [tail_call_p.adb] - Blame information for rev 700

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 696 jeremybenn
package body Tail_Call_P is
2
 
3
  function Start_Side (Element : T) return Index is
4
  begin
5
    if Element = 1 then
6
      raise Program_Error;
7
    end if;
8
    if Element = 0 then
9
      return Second;
10
    else
11
      return First;
12
    end if;
13
  end;
14
 
15
  function Segment (Element : T) return T is
16
  begin
17
    if Element /= 0 then
18
      raise Program_Error;
19
    end if;
20
    return 1;
21
  end;
22
 
23
  procedure Really_Insert (Into : T; Element : T; Value : T) is
24
  begin
25
    if Into /= 0 then
26
      raise Program_Error;
27
    end if;
28
  end;
29
 
30
  procedure Insert (Into : A; Element : T; Value : T) is
31
  begin
32
    Really_Insert (Into (Start_Side (Element)), Segment (Element), Value);
33
  end Insert;
34
 
35
end Tail_Call_P;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.