OSDN Git Service

2009-08-28 Sebastian Pop <sebastian.pop@amd.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / switch-m.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                             S W I T C H - M                              --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --          Copyright (C) 2001-2009, Free Software Foundation, Inc.         --
10 --                                                                          --
11 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
12 -- terms of the  GNU General Public License as published  by the Free Soft- --
13 -- ware  Foundation;  either version 3,  or (at your option) any later ver- --
14 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
17 -- for  more details.  You should have  received  a copy of the GNU General --
18 -- Public License  distributed with GNAT; see file COPYING3.  If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license.          --
20 --                                                                          --
21 -- GNAT was originally developed  by the GNAT team at  New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
23 --                                                                          --
24 ------------------------------------------------------------------------------
25
26 --  This package scans make switches. Note that the body of Usage must be
27 --  coordinated with the switches that are recognized by this package.
28 --  The Usage package also acts as the official documentation for the
29 --  switches that are recognized. In addition, package Debug documents
30 --  the otherwise undocumented debug switches that are also recognized.
31
32 with System.OS_Lib; use System.OS_Lib;
33
34 package Switch.M is
35
36    procedure Scan_Make_Switches
37      (Switch_Chars : String;
38       Success      : out Boolean);
39    --  Scan a gnatmake switch and act accordingly. For switches that are
40    --  recognized, Success is set to True. A switch that is not recognized and
41    --  consists of one small letter causes a fatal error exit and control does
42    --  not return. For all other not recognized switches, Success is set to
43    --  False, so that the switch may be passed to the compiler.
44
45    procedure Normalize_Compiler_Switches
46      (Switch_Chars : String;
47       Switches     : in out Argument_List_Access;
48       Last         : out Natural);
49    --  Takes a compiler switch which potentially is equivalent to more
50    --  that one simple switches and returns the equivalent list of simple
51    --  switches that are stored in an ALI file. Switches will be extended
52    --  if initially null or too short. Last indicates the index in Switches
53    --  of the last simple switch. Last is equal to zero, if it has been
54    --  determined that Switch_Chars is ill-formed or does not contain any
55    --  switch that should be stored in an ALI file. Otherwise, the list of
56    --  simple switches is Switches (Switches'First .. Last).
57    --
58    --    Example: if Switch_Chars is equal to "-gnatAwue", then the list of
59    --    simple switches will have 3 components: -gnatA, -gnatwu, -gnatwe.
60    --
61    --  The String_Access components of Switches should not be deallocated:
62    --  they are shallow copies of components in a table in the body.
63
64    function Normalize_Compiler_Switches
65      (Switch_Chars : String) return Argument_List;
66    --  Similar to the previous procedure. The return value is the list of
67    --  simple switches. It may be an empty array if it has been determined
68    --  that Switch_Chars is ill-formed or does not contain any switch that
69    --  should be stored in an ALI file. The String_Access components of the
70    --  returned value should not be deallocated.
71
72 end Switch.M;