annotate gcc/ada/back_end.ads @ 138:fc828634a951

merge
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 08 Nov 2018 14:17:14 +0900
parents 84e7813d76e9
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT COMPILER COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- B A C K _ E N D --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
9 -- Copyright (C) 1992-2018, Free Software Foundation, Inc. --
111
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- GNAT is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
12 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
kono
parents:
diff changeset
17 -- for more details. You should have received a copy of the GNU General --
kono
parents:
diff changeset
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
kono
parents:
diff changeset
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
kono
parents:
diff changeset
20 -- --
kono
parents:
diff changeset
21 -- GNAT was originally developed by the GNAT team at New York University. --
kono
parents:
diff changeset
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
kono
parents:
diff changeset
23 -- --
kono
parents:
diff changeset
24 ------------------------------------------------------------------------------
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 -- Call the back end with all the information needed
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 -- Note: there are multiple bodies/variants of this package, so do not
kono
parents:
diff changeset
29 -- modify this spec without coordination.
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 package Back_End is
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 type Back_End_Mode_Type is (
kono
parents:
diff changeset
34 Generate_Object,
kono
parents:
diff changeset
35 -- Full back end operation with object file generation
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 Declarations_Only,
kono
parents:
diff changeset
38 -- Partial back end operation with no object file generation. In this
kono
parents:
diff changeset
39 -- mode the only useful action performed by gigi is to process all
kono
parents:
diff changeset
40 -- declarations issuing any error messages (in particular those to
kono
parents:
diff changeset
41 -- do with rep clauses), and to back annotate representation info.
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 Skip);
kono
parents:
diff changeset
44 -- Back end call is skipped (syntax only, or errors found)
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 pragma Convention (C, Back_End_Mode_Type);
kono
parents:
diff changeset
47 for Back_End_Mode_Type use (0, 1, 2);
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 procedure Call_Back_End (Mode : Back_End_Mode_Type);
kono
parents:
diff changeset
50 -- Call back end, i.e. make call to driver traversing the tree and
kono
parents:
diff changeset
51 -- outputting code. This call is made with all tables locked. The back
kono
parents:
diff changeset
52 -- end is responsible for unlocking any tables it may need to change,
kono
parents:
diff changeset
53 -- and locking them again before returning.
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 procedure Scan_Compiler_Arguments;
kono
parents:
diff changeset
56 -- Acquires command-line parameters passed to the compiler and processes
kono
parents:
diff changeset
57 -- them. Calls Scan_Front_End_Switches for any front-end switches found.
kono
parents:
diff changeset
58 --
kono
parents:
diff changeset
59 -- The processing of arguments is private to the back end, since the way
kono
parents:
diff changeset
60 -- of acquiring the arguments as well as the set of allowable back end
kono
parents:
diff changeset
61 -- switches is different depending on the particular back end being used.
kono
parents:
diff changeset
62 --
kono
parents:
diff changeset
63 -- Any processed switches that influence the result of a compilation must
kono
parents:
diff changeset
64 -- be added to the Compilation_Arguments table.
kono
parents:
diff changeset
65 --
kono
parents:
diff changeset
66 -- This routine is expected to set the following to True if necessary (the
kono
parents:
diff changeset
67 -- default for all of these in Opt is False).
kono
parents:
diff changeset
68 --
kono
parents:
diff changeset
69 -- Opt.Disable_FE_Inline
kono
parents:
diff changeset
70 -- Opt.Disable_FE_Inline_Always
kono
parents:
diff changeset
71 -- Opt.Suppress_Control_Float_Optimizations
kono
parents:
diff changeset
72 -- Opt.Generate_SCO
kono
parents:
diff changeset
73 -- Opt.Generate_SCO_Instance_Table
kono
parents:
diff changeset
74 -- Opt.Stack_Checking_Enabled
kono
parents:
diff changeset
75 -- Opt.No_Stdinc
kono
parents:
diff changeset
76 -- Opt.No_Stdlib
kono
parents:
diff changeset
77
kono
parents:
diff changeset
78 procedure Gen_Or_Update_Object_File;
kono
parents:
diff changeset
79 -- Is used to generate the object file (if generated directly by gnat1), or
kono
parents:
diff changeset
80 -- update it if it has already been generated by the call to Call_Back_End,
kono
parents:
diff changeset
81 -- so that its timestamp is updated by the call.
kono
parents:
diff changeset
82 --
kono
parents:
diff changeset
83 -- This is a no-op with the gcc back-end (the object file is generated by
kono
parents:
diff changeset
84 -- the assembler afterwards), but is needed for back-ends that directly
kono
parents:
diff changeset
85 -- generate the final object file so that the object file's timestamp is
kono
parents:
diff changeset
86 -- correct when compared with the corresponding ali file by gnatmake.
kono
parents:
diff changeset
87
kono
parents:
diff changeset
88 end Back_End;