annotate gcc/ada/switch-m.ads @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
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 -- S W I T C H - M --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
9 -- Copyright (C) 2001-2019, 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 -- This package scans make switches. Note that the body of Usage must be
kono
parents:
diff changeset
27 -- coordinated with the switches that are recognized by this package.
kono
parents:
diff changeset
28 -- The Usage package also acts as the official documentation for the
kono
parents:
diff changeset
29 -- switches that are recognized. In addition, package Debug documents
kono
parents:
diff changeset
30 -- the otherwise undocumented debug switches that are also recognized.
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 pragma Warnings (Off);
kono
parents:
diff changeset
33 -- This package is used also by gnatcoll
kono
parents:
diff changeset
34 with System.OS_Lib; use System.OS_Lib;
kono
parents:
diff changeset
35 pragma Warnings (On);
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 package Switch.M is
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 Subdirs : String_Ptr := null;
kono
parents:
diff changeset
40 -- The value after the equal sign in switch --subdirs=...
kono
parents:
diff changeset
41 -- Contains the relative subdirectory.
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 procedure Scan_Make_Switches
kono
parents:
diff changeset
44 (Switch_Chars : String;
kono
parents:
diff changeset
45 Success : out Boolean);
kono
parents:
diff changeset
46 -- Scan a gnatmake switch and act accordingly. For switches that are
kono
parents:
diff changeset
47 -- recognized, Success is set to True. A switch that is not recognized and
kono
parents:
diff changeset
48 -- consists of one small letter causes a fatal error exit and control does
kono
parents:
diff changeset
49 -- not return. For all other not recognized switches, Success is set to
kono
parents:
diff changeset
50 -- False, so that the switch may be passed to the compiler.
kono
parents:
diff changeset
51 --
kono
parents:
diff changeset
52 -- Project_Node_Tree is used to store tree-specific parameters like the
kono
parents:
diff changeset
53 -- project path.
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 procedure Normalize_Compiler_Switches
kono
parents:
diff changeset
56 (Switch_Chars : String;
kono
parents:
diff changeset
57 Switches : in out Argument_List_Access;
kono
parents:
diff changeset
58 Last : out Natural);
kono
parents:
diff changeset
59 -- Takes a compiler switch which potentially is equivalent to more
kono
parents:
diff changeset
60 -- that one simple switches and returns the equivalent list of simple
kono
parents:
diff changeset
61 -- switches that are stored in an ALI file. Switches will be extended
kono
parents:
diff changeset
62 -- if initially null or too short. Last indicates the index in Switches
kono
parents:
diff changeset
63 -- of the last simple switch. Last is equal to zero, if it has been
kono
parents:
diff changeset
64 -- determined that Switch_Chars is ill-formed or does not contain any
kono
parents:
diff changeset
65 -- switch that should be stored in an ALI file. Otherwise, the list of
kono
parents:
diff changeset
66 -- simple switches is Switches (Switches'First .. Last).
kono
parents:
diff changeset
67 --
kono
parents:
diff changeset
68 -- Example: if Switch_Chars is equal to "-gnatAwue", then the list of
kono
parents:
diff changeset
69 -- simple switches will have 3 components: -gnatA, -gnatwu, -gnatwe.
kono
parents:
diff changeset
70 --
kono
parents:
diff changeset
71 -- The String_Access components of Switches should not be deallocated:
kono
parents:
diff changeset
72 -- they are shallow copies of components in a table in the body.
kono
parents:
diff changeset
73
kono
parents:
diff changeset
74 function Normalize_Compiler_Switches
kono
parents:
diff changeset
75 (Switch_Chars : String) return Argument_List;
kono
parents:
diff changeset
76 -- Similar to the previous procedure. The return value is the list of
kono
parents:
diff changeset
77 -- simple switches. It may be an empty array if it has been determined
kono
parents:
diff changeset
78 -- that Switch_Chars is ill-formed or does not contain any switch that
kono
parents:
diff changeset
79 -- should be stored in an ALI file. The String_Access components of the
kono
parents:
diff changeset
80 -- returned value should not be deallocated.
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82 end Switch.M;