annotate gcc/ada/fmap.ads @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
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 -- F M A P --
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) 2001-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 -- This package keeps two mappings: from unit names to file names,
kono
parents:
diff changeset
27 -- and from file names to path names.
kono
parents:
diff changeset
28 --
kono
parents:
diff changeset
29 -- This mapping is used to communicate between the builder (gnatmake or
kono
parents:
diff changeset
30 -- gprbuild) and the compiler. The format of this mapping file is the
kono
parents:
diff changeset
31 -- following:
kono
parents:
diff changeset
32 -- For each source file, there are three lines in the mapping file:
kono
parents:
diff changeset
33 -- Unit name with %b or %s added depending on whether it is a body or a spec
kono
parents:
diff changeset
34 -- This line is omitted for file-based languages
kono
parents:
diff changeset
35 -- File name
kono
parents:
diff changeset
36 -- Path name (set to '/' if the file should be ignored in fact, ie for
kono
parents:
diff changeset
37 -- a Locally_Removed_File in a project)
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 with Namet; use Namet;
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 package Fmap is
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 procedure Initialize (File_Name : String);
kono
parents:
diff changeset
44 -- Initialize the mappings from the mapping file File_Name.
kono
parents:
diff changeset
45 -- If the mapping file is incorrect (nonexistent file, truncated file,
kono
parents:
diff changeset
46 -- duplicate entries), output a warning and do not initialize the mappings.
kono
parents:
diff changeset
47 -- Record the state of the mapping tables in case Update is called
kono
parents:
diff changeset
48 -- later on.
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 function Mapped_Path_Name (File : File_Name_Type) return File_Name_Type;
kono
parents:
diff changeset
51 -- Return the path name mapped to the file name File.
kono
parents:
diff changeset
52 -- Return No_File if File is not mapped.
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 function Mapped_File_Name (Unit : Unit_Name_Type) return File_Name_Type;
kono
parents:
diff changeset
55 -- Return the file name mapped to the unit name Unit.
kono
parents:
diff changeset
56 -- Return No_File if Unit is not mapped.
kono
parents:
diff changeset
57 -- Return Error_Name if it is forbidden.
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 procedure Add_To_File_Map
kono
parents:
diff changeset
60 (Unit_Name : Unit_Name_Type;
kono
parents:
diff changeset
61 File_Name : File_Name_Type;
kono
parents:
diff changeset
62 Path_Name : File_Name_Type);
kono
parents:
diff changeset
63 -- Add mapping of Unit_Name to File_Name and of File_Name to Path_Name
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 procedure Update_Mapping_File (File_Name : String);
kono
parents:
diff changeset
66 -- If Add_To_File_Map has been called (after Initialize or any time
kono
parents:
diff changeset
67 -- if Initialize has not been called), append the new entries to the
kono
parents:
diff changeset
68 -- mapping file whose file name is File_Name.
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 procedure Reset_Tables;
kono
parents:
diff changeset
71 -- Initialize all the internal data structures. This procedure is used
kono
parents:
diff changeset
72 -- when several compilations are performed by the same process (by GNSA
kono
parents:
diff changeset
73 -- for ASIS, for example) to remove any existing mappings from a previous
kono
parents:
diff changeset
74 -- compilation.
kono
parents:
diff changeset
75
kono
parents:
diff changeset
76 procedure Add_Forbidden_File_Name (Name : File_Name_Type);
kono
parents:
diff changeset
77 -- Indicate that a source file name is forbidden. This is used when there
kono
parents:
diff changeset
78 -- are excluded sources in projects (attributes Excluded_Source_Files or
kono
parents:
diff changeset
79 -- Locally_Removed_Files).
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 end Fmap;