hexsha
stringlengths
40
40
size
int64
3
1.05M
ext
stringclasses
163 values
lang
stringclasses
53 values
max_stars_repo_path
stringlengths
3
945
max_stars_repo_name
stringlengths
4
112
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
sequencelengths
1
10
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
945
max_issues_repo_name
stringlengths
4
113
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
sequencelengths
1
10
max_issues_count
float64
1
116k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
945
max_forks_repo_name
stringlengths
4
113
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
sequencelengths
1
10
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
3
1.05M
avg_line_length
float64
1
966k
max_line_length
int64
1
977k
alphanum_fraction
float64
0
1
1a8d0e0fb96d480a73bf74d3df975fe81c0efe23
298
adb
Ada
source/tasking/machine-w64-mingw32/s-intnum.adb
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
33
2015-04-04T09:19:36.000Z
2021-11-10T05:33:34.000Z
source/tasking/machine-w64-mingw32/s-intnum.adb
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
8
2017-11-14T13:05:07.000Z
2018-08-09T15:28:49.000Z
source/tasking/machine-w64-mingw32/s-intnum.adb
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
9
2015-02-03T17:09:53.000Z
2021-11-12T01:16:05.000Z
package body System.Interrupt_Numbers is function Is_Reserved (Interrupt : C.signed_int) return Boolean is begin return Interrupt not in First_Interrupt_Id .. Last_Interrupt_Id; -- SIGKILL and SIGSTOP are not declared in mingw end Is_Reserved; end System.Interrupt_Numbers;
29.8
70
0.765101
4b28a6db333fb54b2df66964af29b50eb2ac4250
2,277
ads
Ada
gcc-gcc-7_3_0-release/gcc/ada/a-disedf.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/ada/a-disedf.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/a-disedf.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . D I S P A T C H I N G . E D F -- -- -- -- S p e c -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. In accordance with the copyright of that document, you can freely -- -- copy and modify this specification, provided that if you redistribute a -- -- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ -- This unit is not implemented in typical GNAT implementations that lie on -- top of operating systems, because it is infeasible to implement in such -- environments. -- If a target environment provides appropriate support for this package, -- then the Unimplemented_Unit pragma should be removed from this spec and -- an appropriate body provided. with Ada.Real_Time; with Ada.Task_Identification; package Ada.Dispatching.EDF is pragma Preelaborate; pragma Unimplemented_Unit; subtype Deadline is Ada.Real_Time.Time; Default_Deadline : constant Deadline := Ada.Real_Time.Time_Last; procedure Set_Deadline (D : Deadline; T : Ada.Task_Identification.Task_Id := Ada.Task_Identification.Current_Task); procedure Delay_Until_And_Set_Deadline (Delay_Until_Time : Ada.Real_Time.Time; Deadline_Offset : Ada.Real_Time.Time_Span); function Get_Deadline (T : Ada.Task_Identification.Task_Id := Ada.Task_Identification.Current_Task) return Deadline with SPARK_Mode, Volatile_Function, Global => Ada.Task_Identification.Tasking_State; end Ada.Dispatching.EDF;
41.4
78
0.501976
049fd8f0b527af45e20ca785ebb52855ecb69ec0
7,285
adb
Ada
src/steamsky.adb
thindil/steamsky
d5d7fea622f7994c91017c4cd7ba5e188153556c
[ "TCL", "MIT" ]
80
2017-04-08T23:14:07.000Z
2022-02-10T22:30:51.000Z
src/steamsky.adb
thindil/steamsky
d5d7fea622f7994c91017c4cd7ba5e188153556c
[ "TCL", "MIT" ]
89
2017-06-24T08:18:26.000Z
2021-11-12T04:37:36.000Z
src/steamsky.adb
thindil/steamsky
d5d7fea622f7994c91017c4cd7ba5e188153556c
[ "TCL", "MIT" ]
9
2018-04-14T16:37:25.000Z
2020-03-21T14:33:49.000Z
-- Copyright 2016-2021 Bartek thindil Jasicki -- -- This file is part of Steam Sky. -- -- Steam Sky is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- Steam Sky is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with Steam Sky. If not, see <http://www.gnu.org/licenses/>. with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Command_Line; use Ada.Command_Line; with Ada.Directories; use Ada.Directories; with Ada.Environment_Variables; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_IO; use Ada.Text_IO; with Interfaces.C; with GNAT.Directory_Operations; use GNAT.Directory_Operations; with CArgv; with Tcl; use Tcl; with Tcl.Ada; with Tcl.Tk.Ada; use Tcl.Tk.Ada; with Tcl.Tklib.Ada.Autoscroll; use Tcl.Tklib.Ada.Autoscroll; with Tcl.Tklib.Ada.Tooltip; use Tcl.Tklib.Ada.Tooltip; with Config; use Config; with ErrorDialog; use ErrorDialog; with Game; use Game; with HallOfFame; use HallOfFame; with Log; use Log; with MainMenu; use MainMenu; with Themes; use Themes; procedure Steamsky is use type Interfaces.C.int; Argc: CArgv.CNatural := 0; Argv: CArgv.Chars_Ptr_Ptr; Interp: Tcl.Tcl_Interp := Null_Interp; function Update_Path (Path: in out Unbounded_String; Path_Name: String) return Boolean is begin if Element(Source => Path, Index => Length(Source => Path)) /= Dir_Separator then Append(Source => Path, New_Item => Dir_Separator); end if; if not Exists(Name => To_String(Source => Path)) and then Path_Name not in "Save" | "Modifications" | "Themes" then Put_Line (Item => "Directory " & To_String(Source => Path) & " does not exist. You must use an existing directory as " & To_Lower(Item => Path_Name) & " directory."); return False; end if; return True; end Update_Path; begin Set_Directory(Directory => Dir_Name(Path => Command_Name)); -- Command line arguments Command_Line_Loop : for I in 1 .. Argument_Count loop if Argument(Number => I)'Length > 8 then if Argument(Number => I)(1 .. 8) = "--debug=" then Set_Debug_Mode_Loop : for J in Debug_Types loop if To_Upper (Item => Argument(Number => I)(9 .. Argument(Number => I)'Last)) = Debug_Types'Image(J) then Debug_Mode := J; exit Set_Debug_Mode_Loop; end if; end loop Set_Debug_Mode_Loop; elsif Argument(Number => I)(1 .. 8) = "--datadi" then Data_Directory := To_Unbounded_String (Source => Argument(Number => I)(11 .. Argument(Number => I)'Last)); if not Update_Path (Path => Data_Directory, Path_Name => "Data") then return; end if; elsif Argument(Number => I)(1 .. 8) = "--savedi" then Save_Directory := To_Unbounded_String (Source => Argument(Number => I)(11 .. Argument(Number => I)'Last)); if not Update_Path (Path => Save_Directory, Path_Name => "Save") then return; end if; elsif Argument(Number => I)(1 .. 8) = "--docdir" then Doc_Directory := To_Unbounded_String (Source => Argument(Number => I)(10 .. Argument(Number => I)'Last)); if not Update_Path (Path => Doc_Directory, Path_Name => "Documentation") then return; end if; elsif Argument(Number => I)(1 .. 8) = "--modsdi" then Mods_Directory := To_Unbounded_String (Source => Argument(Number => I)(11 .. Argument(Number => I)'Last)); if not Update_Path (Path => Mods_Directory, Path_Name => "Modifications") then return; end if; elsif Argument(Number => I)(1 .. 8) = "--themes" then Themes_Directory := To_Unbounded_String (Source => Argument(Number => I)(13 .. Argument(Number => I)'Last)); if not Update_Path (Path => Themes_Directory, Path_Name => "Themes") then return; end if; end if; end if; end loop Command_Line_Loop; Create_Path(New_Directory => To_String(Source => Save_Directory)); Create_Path(New_Directory => To_String(Source => Mods_Directory)); Create_Path(New_Directory => To_String(Source => Themes_Directory)); Start_Logging; Load_Config; Load_Hall_Of_Fame; Load_Themes; -- Start Tk Ada.Environment_Variables.Set (Name => "TCL_LIBRARY", Value => Current_Directory & Dir_Separator & "libs" & Dir_Separator & "tcl8.6"); -- Get command-line arguments and put them into C-style "argv" -------------------------------------------------------------- CArgv.Create(Argc => Argc, Argv => Argv); -- Tcl needs to know the path name of the executable -- otherwise Tcl.Tcl_Init below will fail. ---------------------------------------------------- Tcl.Tcl_FindExecutable(argv0 => Argv.all); -- Create one Tcl interpreter ----------------------------- Interp := Tcl.Tcl_CreateInterp; -- Initialize Tcl ----------------- if Tcl.Tcl_Init(interp => Interp) = Tcl.TCL_ERROR then Ada.Text_IO.Put_Line (Item => "Steam Sky: Tcl.Tcl_Init failed: " & Tcl.Ada.Tcl_GetStringResult(interp => Interp)); return; end if; -- Initialize Tk ---------------- if Tcl.Tk.Tk_Init(interp => Interp) = Tcl.TCL_ERROR then Ada.Text_IO.Put_Line (Item => "Steam Sky: Tcl.Tk.Tk_Init failed: " & Tcl.Ada.Tcl_GetStringResult(interp => Interp)); return; end if; -- Set the Tk context so that we may use shortcut Tk -- calls that require reference to the interpreter. ---------------------------------------------------- Set_Context(Interp => Interp); -- Load required Tcl packages Tooltip_Init(Interp => Interp); Tcl.Ada.Tcl_Eval(interp => Interp, strng => "package require tksvg"); Autoscroll_Init(Interp => Interp); -- Create and show the main game menu Create_Main_Menu; -- Loop inside Tk, waiting for commands to execute. -- When there are no windows left, Tcl.Tk.Tk_MainLoop returns and we exit. -------------------------------------------------------------------------- Tcl.Tk.Tk_MainLoop; End_Logging; exception when An_Exception : others => Save_Exception(An_Exception => An_Exception); end Steamsky;
35.364078
79
0.577763
c750023681728d2cbe794c9fbb90962480dde127
10,348
ads
Ada
src/gnat/prj-env.ads
Letractively/ada-gen
d06d03821057f9177f2350e32dd09e467df08612
[ "Apache-2.0" ]
null
null
null
src/gnat/prj-env.ads
Letractively/ada-gen
d06d03821057f9177f2350e32dd09e467df08612
[ "Apache-2.0" ]
null
null
null
src/gnat/prj-env.ads
Letractively/ada-gen
d06d03821057f9177f2350e32dd09e467df08612
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- P R J . E N V -- -- -- -- S p e c -- -- -- -- Copyright (C) 2001-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package implements services for Project-aware tools, mostly related -- to the environment (configuration pragma files, path files, mapping files). with GNAT.Dynamic_HTables; with GNAT.OS_Lib; package Prj.Env is procedure Initialize (In_Tree : Project_Tree_Ref); -- Initialize global components relative to environment variables procedure Print_Sources (In_Tree : Project_Tree_Ref); -- Output the list of sources, after Project files have been scanned procedure Create_Mapping (In_Tree : Project_Tree_Ref); -- Create in memory mapping from the sources of all the projects (in body -- of package Fmap), so that Osint.Find_File will find the correct path -- corresponding to a source. procedure Create_Temp_File (In_Tree : Project_Tree_Ref; Path_FD : out File_Descriptor; Path_Name : out Path_Name_Type; File_Use : String); -- Create temporary file, and fail with an error if it could not be created procedure Create_Mapping_File (Project : Project_Id; Language : Name_Id; In_Tree : Project_Tree_Ref; Name : out Path_Name_Type); -- Create a temporary mapping file for project Project. For each source or -- template of Language in the Project, put the mapping of its file -- name and path name in this file. -- -- Implementation note: we pass a language name, not a language_index here, -- since the latter would have to match exactly the index of that language -- for the specified project, and that is not information available in -- buildgpr.adb. -- -- See fmap for a description of the format of the mapping file procedure Create_Config_Pragmas_File (For_Project : Project_Id; In_Tree : Project_Tree_Ref); -- If there needs to have SFN pragmas, either for non standard naming -- schemes or for individual units. procedure Create_New_Path_File (In_Tree : Project_Tree_Ref; Path_FD : out File_Descriptor; Path_Name : out Path_Name_Type); -- Create a new temporary path file. Get the file name in Path_Name. function Ada_Include_Path (Project : Project_Id; In_Tree : Project_Tree_Ref; Recursive : Boolean := False) return String; -- Get the source search path of a Project file. If Recursive it True, get -- all the source directories of the imported and modified project files -- (recursively). If Recursive is False, just get the path for the source -- directories of Project. Note: the resulting String may be empty if there -- is no source directory in the project file. function Ada_Objects_Path (Project : Project_Id; Including_Libraries : Boolean := True) return String_Access; -- Get the ADA_OBJECTS_PATH of a Project file. For the first call, compute -- it and cache it. When Including_Libraries is False, do not include the -- object directories of the library projects, and do not cache the result. procedure Set_Ada_Paths (Project : Project_Id; In_Tree : Project_Tree_Ref; Including_Libraries : Boolean; Include_Path : Boolean := True; Objects_Path : Boolean := True); -- Set the environment variables for additional project path files, after -- creating the path files if necessary. function File_Name_Of_Library_Unit_Body (Name : String; Project : Project_Id; In_Tree : Project_Tree_Ref; Main_Project_Only : Boolean := True; Full_Path : Boolean := False) return String; -- Returns the file name of a library unit, in canonical case. Name may or -- may not have an extension (corresponding to the naming scheme of the -- project). If there is no body with this name, but there is a spec, the -- name of the spec is returned. -- -- If Full_Path is False (the default), the simple file name is returned. -- -- If Full_Path is True, the absolute path name is returned. -- -- If neither a body nor a spec can be found, an empty string is returned. -- If Main_Project_Only is True, the unit must be an immediate source of -- Project. If it is False, it may be a source of one of its imported -- projects. function Project_Of (Name : String; Main_Project : Project_Id; In_Tree : Project_Tree_Ref) return Project_Id; -- Get the project of a source. The source file name may be truncated -- (".adb" or ".ads" may be missing). If the source is in a project being -- extended, return the ultimate extending project. If it is not a source -- of any project, return No_Project. procedure Get_Reference (Source_File_Name : String; In_Tree : Project_Tree_Ref; Project : out Project_Id; Path : out Path_Name_Type); -- Returns the project of a source and its path in displayable form generic with procedure Action (Path : String); procedure For_All_Source_Dirs (Project : Project_Id; In_Tree : Project_Tree_Ref); -- Iterate through all the source directories of a project, including those -- of imported or modified projects. Only returns those directories that -- potentially contain Ada sources (ie ignore projects that have no Ada -- sources generic with procedure Action (Path : String); procedure For_All_Object_Dirs (Project : Project_Id); -- Iterate through all the object directories of a project, including -- those of imported or modified projects. ------------------ -- Project Path -- ------------------ type Project_Search_Path is private; -- An abstraction of the project path. This object provides subprograms to -- search for projects on the path (and caches the results for more -- efficiency). procedure Free (Self : in out Project_Search_Path); -- Free the memory used by Self procedure Add_Directories (Self : in out Project_Search_Path; Path : String); -- Add one or more directories to the path. Directories added with this -- procedure are added in order after the current directory and before the -- path given by the environment variable GPR_PROJECT_PATH. A value of "-" -- will remove the default project directory from the project path. -- -- Calls to this subprogram must be performed before the first call to -- Find_Project below, or PATH will be added at the end of the search -- path. procedure Get_Path (Self : in out Project_Search_Path; Path : out String_Access); -- Return the current value of the project path, either the value set -- during elaboration of the package or, if procedure Set_Project_Path has -- been called, the value set by the last call to Set_Project_Path. -- The returned value must not be modified. procedure Set_Path (Self : in out Project_Search_Path; Path : String); -- Override the value of the project path. -- This also removes the implicit default search directories procedure Find_Project (Self : in out Project_Search_Path; Project_File_Name : String; Directory : String; Path : out Namet.Path_Name_Type); -- Search for a project with the given name either in Directory (which -- often will be the directory contain the project we are currently parsing -- and which we found a reference to another project), or in the project -- path. Extra_Project_Path contains additional directories to search. -- -- Project_File_Name can optionally contain directories, and the extension -- (.gpr) for the file name is optional. -- -- Returns No_Name if no such project was found private package Projects_Paths is new GNAT.Dynamic_HTables.Simple_HTable (Header_Num => Header_Num, Element => Path_Name_Type, No_Element => No_Path, Key => Name_Id, Hash => Hash, Equal => "="); type Project_Search_Path is record Path : GNAT.OS_Lib.String_Access; -- As a special case, if the first character is '#:" or this variable is -- unset, this means that the PATH has not been fully initialized yet -- (although subprograms above will properly take care of that). Cache : Projects_Paths.Instance; end record; end Prj.Env;
45.385965
79
0.624372
2e9481c2a219cd6e07ca60a237b0c3a47efe74cf
14,069
adb
Ada
tests/lsc_internal_test_aes.adb
Componolit/libsparkcrypto
8531a07b6e9f5eb33eae0fa32759b4cbd3509d95
[ "OpenSSL", "Unlicense" ]
30
2018-05-18T09:11:50.000Z
2021-05-18T16:29:14.000Z
tests/lsc_internal_test_aes.adb
Componolit/libsparkcrypto
8531a07b6e9f5eb33eae0fa32759b4cbd3509d95
[ "OpenSSL", "Unlicense" ]
15
2018-12-13T07:53:36.000Z
2019-09-24T19:43:35.000Z
tests/lsc_internal_test_aes.adb
Componolit/libsparkcrypto
8531a07b6e9f5eb33eae0fa32759b4cbd3509d95
[ "OpenSSL", "Unlicense" ]
3
2019-04-04T17:41:29.000Z
2021-05-07T22:28:46.000Z
------------------------------------------------------------------------------- -- This file is part of libsparkcrypto. -- -- Copyright (C) 2018 Componolit GmbH -- Copyright (C) 2010, Alexander Senier -- Copyright (C) 2010, secunet Security Networks AG -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- -- * Neither the name of the nor the names of its contributors may be used -- to endorse or promote products derived from this software without -- specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS -- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- with AUnit.Assertions; use AUnit.Assertions; with LSC.Internal.AES; with OpenSSL; pragma Style_Checks ("-s"); pragma Warnings (Off, "formal parameter ""T"" is not referenced"); package body LSC_Internal_Test_AES is --------------------------------------------------------------------------- procedure Test_AES128_Decrypt (T : in out Test_Cases.Test_Case'Class) is subtype Message_Index is Natural range 1 .. 1000; type Message_Type is array (Message_Index) of LSC.Internal.AES.Block_Type; Plain1, Plain2, Cipher : Message_Type; Key128 : LSC.Internal.AES.AES128_Key_Type; Context1 : OpenSSL.AES_Dec_Context_Type; Context2 : LSC.Internal.AES.AES_Dec_Context; begin Cipher := Message_Type' (others => LSC.Internal.AES.Block_Type'(16#33221100#, 16#77665544#, 16#bbaa9988#, 16#ffeeddcc#)); Key128 := LSC.Internal.AES.AES128_Key_Type'(16#03020100#, 16#07060504#, 16#0b0a0908#, 16#1f1e1d1c#); Context1 := OpenSSL.Create_AES128_Dec_Context (Key128); for k in Natural range 1 .. 20 loop for I in Message_Index loop Plain1 (I) := OpenSSL.Decrypt (Context1, Cipher (I)); end loop; end loop; Context2 := LSC.Internal.AES.Create_AES128_Dec_Context (Key128); for k in Natural range 1 .. 20 loop for I in Message_Index loop Plain2 (I) := LSC.Internal.AES.Decrypt (Context2, Cipher (I)); end loop; end loop; Assert (Plain1 = Plain2, "Plaintext differs"); end Test_AES128_Decrypt; --------------------------------------------------------------------------- procedure Test_AES128_Encrypt (T : in out Test_Cases.Test_Case'Class) is subtype Message_Index is Natural range 1 .. 1000; type Message_Type is array (Message_Index) of LSC.Internal.AES.Block_Type; Plain, Cipher1, Cipher2 : Message_Type; Key128 : LSC.Internal.AES.AES128_Key_Type; Context1 : OpenSSL.AES_Enc_Context_Type; Context2 : LSC.Internal.AES.AES_Enc_Context; begin Plain := Message_Type' (others => LSC.Internal.AES.Block_Type'(16#33221100#, 16#77665544#, 16#bbaa9988#, 16#ffeeddcc#)); Key128 := LSC.Internal.AES.AES128_Key_Type'(16#03020100#, 16#07060504#, 16#0b0a0908#, 16#0f0e0d0c#); Context1 := OpenSSL.Create_AES128_Enc_Context (Key128); for k in Natural range 1 .. 20 loop for I in Message_Index loop Cipher1 (I) := OpenSSL.Encrypt (Context1, Plain (I)); end loop; end loop; Context2 := LSC.Internal.AES.Create_AES128_Enc_Context (Key128); for k in Natural range 1 .. 20 loop for I in Message_Index loop Cipher2 (I) := LSC.Internal.AES.Encrypt (Context2, Plain (I)); end loop; end loop; Assert (Cipher1 = Cipher2, "Ciphertext differs"); end Test_AES128_Encrypt; --------------------------------------------------------------------------- procedure Test_AES192_Decrypt (T : in out Test_Cases.Test_Case'Class) is subtype Message_Index is Natural range 1 .. 1000; type Message_Type is array (Message_Index) of LSC.Internal.AES.Block_Type; Plain1, Plain2, Cipher : Message_Type; Key192 : LSC.Internal.AES.AES192_Key_Type; Context1 : OpenSSL.AES_Dec_Context_Type; Context2 : LSC.Internal.AES.AES_Dec_Context; begin Cipher := Message_Type' (others => LSC.Internal.AES.Block_Type'(16#33221100#, 16#77665544#, 16#bbaa9988#, 16#ffeeddcc#)); Key192 := LSC.Internal.AES.AES192_Key_Type'(16#03020100#, 16#07060504#, 16#13121110#, 16#17161514#, 16#1b1a1918#, 16#1f1e1d1c#); Context1 := OpenSSL.Create_AES192_Dec_Context (Key192); for k in Natural range 1 .. 20 loop for I in Message_Index loop Plain1 (I) := OpenSSL.Decrypt (Context1, Cipher (I)); end loop; end loop; Context2 := LSC.Internal.AES.Create_AES192_Dec_Context (Key192); for k in Natural range 1 .. 20 loop for I in Message_Index loop Plain2 (I) := LSC.Internal.AES.Decrypt (Context2, Cipher (I)); end loop; end loop; Assert (Plain1 = Plain2, "Plaintext differs"); end Test_AES192_Decrypt; --------------------------------------------------------------------------- procedure Test_AES192_Encrypt (T : in out Test_Cases.Test_Case'Class) is subtype Message_Index is Natural range 1 .. 1000; type Message_Type is array (Message_Index) of LSC.Internal.AES.Block_Type; Plain, Cipher1, Cipher2 : Message_Type; Key192 : LSC.Internal.AES.AES192_Key_Type; Context1 : OpenSSL.AES_Enc_Context_Type; Context2 : LSC.Internal.AES.AES_Enc_Context; begin Plain := Message_Type' (others => LSC.Internal.AES.Block_Type'(16#33221100#, 16#77665544#, 16#bbaa9988#, 16#ffeeddcc#)); Key192 := LSC.Internal.AES.AES192_Key_Type'(16#03020100#, 16#07060504#, 16#07060504#, 16#0b0a0908#, 16#0b0a0908#, 16#0f0e0d0c#); Context1 := OpenSSL.Create_AES192_Enc_Context (Key192); for k in Natural range 1 .. 20 loop for I in Message_Index loop Cipher1 (I) := OpenSSL.Encrypt (Context1, Plain (I)); end loop; end loop; Context2 := LSC.Internal.AES.Create_AES192_Enc_Context (Key192); for k in Natural range 1 .. 20 loop for I in Message_Index loop Cipher2 (I) := LSC.Internal.AES.Encrypt (Context2, Plain (I)); end loop; end loop; Assert (Cipher1 = Cipher2, "Ciphertext differs"); end Test_AES192_Encrypt; --------------------------------------------------------------------------- procedure Test_AES256_Decrypt (T : in out Test_Cases.Test_Case'Class) is subtype Message_Index is Natural range 1 .. 1000; type Message_Type is array (Message_Index) of LSC.Internal.AES.Block_Type; Plain1, Plain2, Cipher : Message_Type; Key256 : LSC.Internal.AES.AES256_Key_Type; Context1 : OpenSSL.AES_Dec_Context_Type; Context2 : LSC.Internal.AES.AES_Dec_Context; begin Cipher := Message_Type' (others => LSC.Internal.AES.Block_Type'(16#33221100#, 16#77665544#, 16#bbaa9988#, 16#ffeeddcc#)); Key256 := LSC.Internal.AES.AES256_Key_Type'(16#03020100#, 16#07060504#, 16#0b0a0908#, 16#0f0e0d0c#, 16#13121110#, 16#17161514#, 16#1b1a1918#, 16#1f1e1d1c#); Context1 := OpenSSL.Create_AES256_Dec_Context (Key256); for k in Natural range 1 .. 20 loop for I in Message_Index loop Plain1 (I) := OpenSSL.Decrypt (Context1, Cipher (I)); end loop; end loop; Context2 := LSC.Internal.AES.Create_AES256_Dec_Context (Key256); for k in Natural range 1 .. 20 loop for I in Message_Index loop Plain2 (I) := LSC.Internal.AES.Decrypt (Context2, Cipher (I)); end loop; end loop; Assert (Plain1 = Plain2, "Plaintext differs"); end Test_AES256_Decrypt; --------------------------------------------------------------------------- procedure Test_AES256_Encrypt (T : in out Test_Cases.Test_Case'Class) is subtype Message_Index is Natural range 1 .. 1000; type Message_Type is array (Message_Index) of LSC.Internal.AES.Block_Type; Plain, Cipher1, Cipher2 : Message_Type; Key256 : LSC.Internal.AES.AES256_Key_Type; Context1 : OpenSSL.AES_Enc_Context_Type; Context2 : LSC.Internal.AES.AES_Enc_Context; begin Plain := Message_Type' (others => LSC.Internal.AES.Block_Type'(16#33221100#, 16#77665544#, 16#bbaa9988#, 16#ffeeddcc#)); Key256 := LSC.Internal.AES.AES256_Key_Type'(16#03020100#, 16#07060504#, 16#0b0a0908#, 16#0f0e0d0c#, 16#13121110#, 16#17161514#, 16#1b1a1918#, 16#1f1e1d1c#); Context1 := OpenSSL.Create_AES256_Enc_Context (Key256); for k in Natural range 1 .. 20 loop for I in Message_Index loop Cipher1 (I) := OpenSSL.Encrypt (Context1, Plain (I)); end loop; end loop; Context2 := LSC.Internal.AES.Create_AES256_Enc_Context (Key256); for k in Natural range 1 .. 20 loop for I in Message_Index loop Cipher2 (I) := LSC.Internal.AES.Encrypt (Context2, Plain (I)); end loop; end loop; Assert (Cipher1 = Cipher2, "Plaintext differs"); end Test_AES256_Encrypt; --------------------------------------------------------------------------- procedure Register_Tests (T : in out Test_Case) is use AUnit.Test_Cases.Registration; begin Register_Routine (T, Test_AES128_Decrypt'Access, "AES-128 decryption"); Register_Routine (T, Test_AES128_Encrypt'Access, "AES-128 encryption"); Register_Routine (T, Test_AES192_Decrypt'Access, "AES-192 decryption"); Register_Routine (T, Test_AES192_Encrypt'Access, "AES-192 encryption"); Register_Routine (T, Test_AES256_Decrypt'Access, "AES-256 decryption"); Register_Routine (T, Test_AES256_Encrypt'Access, "AES-256 encryption"); end Register_Tests; --------------------------------------------------------------------------- function Name (T : Test_Case) return Test_String is begin return Format ("AES"); end Name; end LSC_Internal_Test_AES;
39.630986
80
0.502239
410d88e72396e8bdfadad1aba55952cf72330c3a
2,093
adb
Ada
PFactorial/pfactorial.adb
mlurbe97/ABench2020
10f2b7fdf784dcb0e7a27c562bd625a71b9410ee
[ "MIT" ]
null
null
null
PFactorial/pfactorial.adb
mlurbe97/ABench2020
10f2b7fdf784dcb0e7a27c562bd625a71b9410ee
[ "MIT" ]
null
null
null
PFactorial/pfactorial.adb
mlurbe97/ABench2020
10f2b7fdf784dcb0e7a27c562bd625a71b9410ee
[ "MIT" ]
null
null
null
-- -- ABench2020 Benchmark Suite -- -- Parallel Factorial Program -- -- Licensed under the MIT License. See LICENSE file in the ABench root -- directory for license information. -- -- Uncomment the line below to print the result. -- with Ada.Text_IO; use Ada.Text_IO; with Ada.Command_Line; use Ada.Command_Line; procedure PFactorial is function Calculate_Factorial (Start_Value : Long_Integer; End_Value : Long_Integer) return Long_Integer is Result : Long_Integer := 1; begin for I in Long_Integer range Start_Value .. End_Value loop Result := Result * I; end loop; return Result; end; task type Factorial_Task is entry Start (Start_Value : in Long_Integer; End_Value : in Long_Integer); entry Report (Result_Value : out Long_Integer); end Factorial_Task; task body Factorial_Task is Local_Start_Value : Long_Integer; Local_End_Value : Long_Integer; Local_Result_Value : Long_Integer; begin accept Start (Start_Value : in Long_Integer; End_Value : in Long_Integer) do Local_Start_Value := Start_Value; Local_End_Value := End_Value; end Start; Local_Result_Value := Calculate_Factorial (Local_Start_Value, Local_End_Value); accept Report (Result_Value : out Long_Integer) do Result_Value := Local_Result_Value; end Report; end; Task1 : Factorial_Task; Task2 : Factorial_Task; External_Value : Long_Integer := Long_Integer'Value (Ada.Command_Line.Argument (1)); Factorial_Value : Long_Integer := 1; Thread1_Value : Long_Integer := 1; Thread2_Value : Long_Integer := 1; begin -- loop Task1.Start (1, External_Value / 2); Task2.Start (External_Value / 2 + 1 , External_Value); Task1.Report (Thread1_Value); Task2.Report (Thread2_Value); Factorial_Value := Thread1_Value * Thread2_Value; -- end loop; -- Uncomment the line below to print the result. -- Put_Line (Long_Integer'Image (Factorial_Value)); end;
28.671233
110
0.675108
133078bc24693b13224e72459ec417da25def0da
20,855
ads
Ada
llvm-gcc-4.2-2.9/gcc/ada/s-osinte-lynxos.ads
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
1
2016-04-09T02:58:13.000Z
2016-04-09T02:58:13.000Z
llvm-gcc-4.2-2.9/gcc/ada/s-osinte-lynxos.ads
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
llvm-gcc-4.2-2.9/gcc/ada/s-osinte-lynxos.ads
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . O S _ I N T E R F A C E -- -- -- -- S p e c -- -- -- -- Copyright (C) 1991-1994, Florida State University -- -- Copyright (C) 1995-2006, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNARL; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This is a LynxOS (POSIX Threads) version of this package -- This package encapsulates all direct interfaces to OS services -- that are needed by children of System. -- PLEASE DO NOT add any with-clauses to this package or remove the pragma -- Preelaborate. This package is designed to be a bottom-level (leaf) package. with Interfaces.C; with Unchecked_Conversion; package System.OS_Interface is pragma Preelaborate; pragma Linker_Options ("-mthreads"); -- Selects the POSIX 1.c runtime, rather than the non-threading runtime -- or the deprecated legacy threads library. The -mthreads flag is -- defined in patch.LynxOS and matches the definition for Lynx's gcc. subtype int is Interfaces.C.int; subtype short is Interfaces.C.short; subtype long is Interfaces.C.long; subtype unsigned is Interfaces.C.unsigned; subtype unsigned_short is Interfaces.C.unsigned_short; subtype unsigned_long is Interfaces.C.unsigned_long; subtype unsigned_char is Interfaces.C.unsigned_char; subtype plain_char is Interfaces.C.plain_char; subtype size_t is Interfaces.C.size_t; ----------- -- Errno -- ----------- function errno return int; pragma Import (C, errno, "__get_errno"); EAGAIN : constant := 11; EINTR : constant := 4; EINVAL : constant := 22; ENOMEM : constant := 12; ETIMEDOUT : constant := 60; ------------- -- Signals -- ------------- Max_Interrupt : constant := 63; -- Max_Interrupt is the number of OS signals, as defined in: -- -- /usr/include/sys/signal.h -- -- -- The lowest numbered signal is 1, but 0 is a valid argument to some -- library functions, eg. kill(2). However, 0 is not just another -- signal: For instance 'I in Signal' and similar should be used with -- caution. type Signal is new int range 0 .. Max_Interrupt; for Signal'Size use int'Size; SIGHUP : constant := 1; -- hangup SIGINT : constant := 2; -- interrupt (rubout) SIGQUIT : constant := 3; -- quit (ASCD FS) SIGILL : constant := 4; -- illegal instruction (not reset) SIGTRAP : constant := 5; -- trace trap (not reset) SIGBRK : constant := 6; -- break SIGIOT : constant := 6; -- IOT instruction SIGABRT : constant := 6; -- used by abort, replace SIGIOT in future SIGCORE : constant := 7; -- kill with core dump SIGEMT : constant := 7; -- EMT instruction SIGFPE : constant := 8; -- floating point exception SIGKILL : constant := 9; -- kill (cannot be caught or ignored) SIGBUS : constant := 10; -- bus error SIGSEGV : constant := 11; -- segmentation violation SIGSYS : constant := 12; -- bad argument to system call SIGPIPE : constant := 13; -- write on a pipe with no one to read it SIGALRM : constant := 14; -- alarm clock SIGTERM : constant := 15; -- software termination signal from kill SIGURG : constant := 16; -- urgent condition on IO channel SIGSTOP : constant := 17; -- stop (cannot be caught or ignored) SIGTSTP : constant := 18; -- user stop requested from tty SIGCONT : constant := 19; -- stopped process has been continued SIGCLD : constant := 20; -- alias for SIGCHLD SIGCHLD : constant := 20; -- child status change SIGTTIN : constant := 21; -- background tty read attempted SIGTTOU : constant := 22; -- background tty write attempted SIGIO : constant := 23; -- I/O possible (Solaris SIGPOLL alias) SIGPOLL : constant := 23; -- pollable event occurred SIGTHREADKILL : constant := 24; -- Reserved by LynxOS runtime SIGXCPU : constant := 24; -- CPU time limit exceeded SIGXFSZ : constant := 25; -- filesize limit exceeded SIGVTALRM : constant := 26; -- virtual timer expired SIGPROF : constant := 27; -- profiling timer expired SIGWINCH : constant := 28; -- window size change SIGLOST : constant := 29; -- SUN 4.1 compatibility SIGUSR1 : constant := 30; -- user defined signal 1 SIGUSR2 : constant := 31; -- user defined signal 2 SIGPRIO : constant := 32; -- sent to a process with its priority or group is changed SIGADAABORT : constant := SIGABRT; -- Change this if you want to use another signal for task abort. -- SIGTERM might be a good one. type Signal_Set is array (Natural range <>) of Signal; Unmasked : constant Signal_Set := (SIGTRAP, SIGTTIN, SIGTTOU, SIGTSTP, SIGPROF, SIGTHREADKILL); Reserved : constant Signal_Set := (SIGABRT, SIGKILL, SIGSTOP, SIGPRIO); type sigset_t is private; function sigaddset (set : access sigset_t; sig : Signal) return int; pragma Import (C, sigaddset, "sigaddset"); function sigdelset (set : access sigset_t; sig : Signal) return int; pragma Import (C, sigdelset, "sigdelset"); function sigfillset (set : access sigset_t) return int; pragma Import (C, sigfillset, "sigfillset"); function sigismember (set : access sigset_t; sig : Signal) return int; pragma Import (C, sigismember, "sigismember"); function sigemptyset (set : access sigset_t) return int; pragma Import (C, sigemptyset, "sigemptyset"); type struct_sigaction is record sa_handler : System.Address; sa_mask : sigset_t; sa_flags : int; end record; pragma Convention (C, struct_sigaction); type struct_sigaction_ptr is access all struct_sigaction; SA_SIGINFO : constant := 16#80#; SIG_BLOCK : constant := 0; SIG_UNBLOCK : constant := 1; SIG_SETMASK : constant := 2; SIG_DFL : constant := 0; SIG_IGN : constant := 1; function sigaction (sig : Signal; act : struct_sigaction_ptr; oact : struct_sigaction_ptr) return int; pragma Import (C, sigaction, "sigaction"); ---------- -- Time -- ---------- Time_Slice_Supported : constant Boolean := True; -- Indicates whether time slicing is supported type timespec is private; type clockid_t is private; CLOCK_REALTIME : constant clockid_t; function clock_gettime (clock_id : clockid_t; tp : access timespec) return int; pragma Import (C, clock_gettime, "clock_gettime"); function clock_getres (clock_id : clockid_t; res : access timespec) return int; pragma Import (C, clock_getres, "clock_getres"); function To_Duration (TS : timespec) return Duration; pragma Inline (To_Duration); function To_Timespec (D : Duration) return timespec; pragma Inline (To_Timespec); type struct_timezone is record tz_minuteswest : int; tz_dsttime : int; end record; pragma Convention (C, struct_timezone); type struct_timezone_ptr is access all struct_timezone; type struct_timeval is private; -- This is needed on systems that do not have clock_gettime() -- but do have gettimeofday(). function To_Duration (TV : struct_timeval) return Duration; pragma Inline (To_Duration); function To_Timeval (D : Duration) return struct_timeval; pragma Inline (To_Timeval); ------------------------- -- Priority Scheduling -- ------------------------- SCHED_FIFO : constant := 16#200000#; SCHED_RR : constant := 16#100000#; SCHED_OTHER : constant := 16#400000#; ------------- -- Process -- ------------- type pid_t is private; function kill (pid : pid_t; sig : Signal) return int; pragma Import (C, kill, "kill"); function getpid return pid_t; pragma Import (C, getpid, "getpid"); --------- -- LWP -- --------- function lwp_self return System.Address; pragma Import (C, lwp_self, "pthread_self"); ------------- -- Threads -- ------------- type Thread_Body is access function (arg : System.Address) return System.Address; function Thread_Body_Access is new Unchecked_Conversion (System.Address, Thread_Body); type pthread_t is private; subtype Thread_Id is pthread_t; type pthread_mutex_t is limited private; type pthread_cond_t is limited private; type pthread_attr_t is limited private; type pthread_mutexattr_t is limited private; type pthread_condattr_t is limited private; type pthread_key_t is private; PTHREAD_CREATE_DETACHED : constant := 1; PTHREAD_CREATE_JOINABLE : constant := 0; ----------- -- Stack -- ----------- Stack_Base_Available : constant Boolean := False; -- Indicates whether the stack base is available on this target. function Get_Stack_Base (thread : pthread_t) return Address; pragma Inline (Get_Stack_Base); -- Returns the stack base of the specified thread. -- Only call this function when Stack_Base_Available is True. function Get_Page_Size return size_t; function Get_Page_Size return Address; pragma Import (C, Get_Page_Size, "getpagesize"); -- Returns the size of a page, or 0 if this is not relevant on this -- target PROT_NONE : constant := 1; PROT_READ : constant := 2; PROT_WRITE : constant := 4; PROT_EXEC : constant := 8; PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC; PROT_ON : constant := PROT_READ; PROT_OFF : constant := PROT_ALL; function mprotect (addr : Address; len : size_t; prot : int) return int; pragma Import (C, mprotect); --------------------------------------- -- Nonstandard Thread Initialization -- --------------------------------------- procedure pthread_init; -- This is a dummy procedure to share some GNULLI files ------------------------- -- POSIX.1c Section 3 -- ------------------------- function sigwait (set : access sigset_t; sig : access Signal) return int; pragma Inline (sigwait); -- LynxOS has non standard sigwait function pthread_kill (thread : pthread_t; sig : Signal) return int; pragma Import (C, pthread_kill, "pthread_kill"); function pthread_sigmask (how : int; set : access sigset_t; oset : access sigset_t) return int; pragma Import (C, pthread_sigmask, "pthread_sigmask"); -- The behavior of pthread_sigmask on LynxOS requires -- further investigation. ---------------------------- -- POSIX.1c Section 11 -- ---------------------------- function pthread_mutexattr_init (attr : access pthread_mutexattr_t) return int; pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init"); function pthread_mutexattr_destroy (attr : access pthread_mutexattr_t) return int; pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy"); function pthread_mutex_init (mutex : access pthread_mutex_t; attr : access pthread_mutexattr_t) return int; pragma Import (C, pthread_mutex_init, "pthread_mutex_init"); function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int; pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy"); function pthread_mutex_lock (mutex : access pthread_mutex_t) return int; pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock"); function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int; pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock"); function pthread_condattr_init (attr : access pthread_condattr_t) return int; pragma Import (C, pthread_condattr_init, "pthread_condattr_init"); function pthread_condattr_destroy (attr : access pthread_condattr_t) return int; pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy"); function pthread_cond_init (cond : access pthread_cond_t; attr : access pthread_condattr_t) return int; pragma Import (C, pthread_cond_init, "pthread_cond_init"); function pthread_cond_destroy (cond : access pthread_cond_t) return int; pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy"); function pthread_cond_signal (cond : access pthread_cond_t) return int; pragma Import (C, pthread_cond_signal, "pthread_cond_signal"); function pthread_cond_wait (cond : access pthread_cond_t; mutex : access pthread_mutex_t) return int; pragma Import (C, pthread_cond_wait, "pthread_cond_wait"); function pthread_cond_timedwait (cond : access pthread_cond_t; mutex : access pthread_mutex_t; abstime : access timespec) return int; pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); Relative_Timed_Wait : constant Boolean := False; -- pthread_cond_timedwait requires an absolute delay time -------------------------- -- POSIX.1c Section 13 -- -------------------------- PTHREAD_PRIO_NONE : constant := 0; PTHREAD_PRIO_INHERIT : constant := 1; PTHREAD_PRIO_PROTECT : constant := 2; function pthread_mutexattr_setprotocol (attr : access pthread_mutexattr_t; protocol : int) return int; pragma Import (C, pthread_mutexattr_setprotocol); function pthread_mutexattr_setprioceiling (attr : access pthread_mutexattr_t; prioceiling : int) return int; pragma Import (C, pthread_mutexattr_setprioceiling); type struct_sched_param is record sched_priority : int; end record; function pthread_setschedparam (thread : pthread_t; policy : int; param : access struct_sched_param) return int; pragma Import (C, pthread_setschedparam, "pthread_setschedparam"); function pthread_attr_setscope (attr : access pthread_attr_t; contentionscope : int) return int; pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope"); function pthread_attr_setinheritsched (attr : access pthread_attr_t; inheritsched : int) return int; pragma Import (C, pthread_attr_setinheritsched); function pthread_attr_setschedpolicy (attr : access pthread_attr_t; policy : int) return int; pragma Import (C, pthread_attr_setschedpolicy); function sched_yield return int; pragma Import (C, sched_yield, "sched_yield"); -------------------------- -- P1003.1c Section 16 -- -------------------------- function pthread_attr_init (attributes : access pthread_attr_t) return int; pragma Import (C, pthread_attr_init, "pthread_attr_init"); function pthread_attr_destroy (attributes : access pthread_attr_t) return int; pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy"); function pthread_attr_setdetachstate (attr : access pthread_attr_t; detachstate : int) return int; pragma Import (C, pthread_attr_setdetachstate); function pthread_attr_setstacksize (attr : access pthread_attr_t; stacksize : size_t) return int; pragma Import (C, pthread_attr_setstacksize); function pthread_create (thread : access pthread_t; attributes : access pthread_attr_t; start_routine : Thread_Body; arg : System.Address) return int; pragma Import (C, pthread_create, "pthread_create"); procedure pthread_exit (status : System.Address); pragma Import (C, pthread_exit, "pthread_exit"); function pthread_self return pthread_t; pragma Import (C, pthread_self, "pthread_self"); -------------------------- -- POSIX.1c Section 17 -- -------------------------- function st_setspecific (key : pthread_key_t; value : System.Address) return int; pragma Import (C, st_setspecific, "st_setspecific"); function st_getspecific (key : pthread_key_t; retval : System.Address) return int; pragma Import (C, st_getspecific, "st_getspecific"); type destructor_pointer is access procedure (arg : System.Address); function st_keycreate (destructor : destructor_pointer; key : access pthread_key_t) return int; pragma Import (C, st_keycreate, "st_keycreate"); private type sigset_t is record X1, X2 : long; end record; pragma Convention (C, sigset_t); type pid_t is new long; type time_t is new long; type timespec is record tv_sec : time_t; tv_nsec : long; end record; pragma Convention (C, timespec); type clockid_t is new unsigned_char; CLOCK_REALTIME : constant clockid_t := 0; type struct_timeval is record tv_sec : time_t; tv_usec : time_t; end record; pragma Convention (C, struct_timeval); type st_attr_t is record stksize : int; prio : int; inheritsched : int; state : int; sched : int; detachstate : int; guardsize : int; end record; pragma Convention (C, st_attr_t); type pthread_attr_t is record pthread_attr_magic : unsigned; st : st_attr_t; pthread_attr_scope : int; end record; pragma Convention (C, pthread_attr_t); type pthread_condattr_t is record cv_magic : unsigned; cv_pshared : unsigned; end record; pragma Convention (C, pthread_condattr_t); type pthread_mutexattr_t is record m_flags : unsigned; m_prio_c : int; m_pshared : int; end record; pragma Convention (C, pthread_mutexattr_t); type tid_t is new short; type pthread_t is new tid_t; type block_obj_t is new System.Address; -- typedef struct _block_obj_s { -- struct st_entry *b_head; -- } block_obj_t; type pthread_mutex_t is record m_flags : unsigned; m_owner : tid_t; m_wait : block_obj_t; m_prio_c : int; m_oldprio : int; m_count : int; m_referenced : int; end record; pragma Convention (C, pthread_mutex_t); type pthread_mutex_t_ptr is access all pthread_mutex_t; type pthread_cond_t is record cv_magic : unsigned; cv_wait : block_obj_t; cv_mutex : pthread_mutex_t_ptr; cv_refcnt : int; end record; pragma Convention (C, pthread_cond_t); type pthread_key_t is new int; end System.OS_Interface;
35.287648
79
0.622537
04accd2f4c89da8ea0e4a28e9845f408127c6e71
2,993
adb
Ada
src/latin_utils/latin_utils-inflections_package-stem_type_io.adb
finleyexp/whitakers-words
9c07fe7e96ac15dc3262b82a37f6ea69947f458b
[ "FTL" ]
204
2015-06-12T21:22:55.000Z
2022-03-28T10:50:16.000Z
src/latin_utils/latin_utils-inflections_package-stem_type_io.adb
finleyexp/whitakers-words
9c07fe7e96ac15dc3262b82a37f6ea69947f458b
[ "FTL" ]
98
2015-06-15T22:17:04.000Z
2021-10-01T18:17:55.000Z
src/latin_utils/latin_utils-inflections_package-stem_type_io.adb
finleyexp/whitakers-words
9c07fe7e96ac15dc3262b82a37f6ea69947f458b
[ "FTL" ]
50
2015-06-16T22:42:24.000Z
2021-12-29T16:53:08.000Z
-- WORDS, a Latin dictionary, by Colonel William Whitaker (USAF, Retired) -- -- Copyright William A. Whitaker (1936–2010) -- -- This is a free program, which means it is proper to copy it and pass -- it on to your friends. Consider it a developmental item for which -- there is no charge. However, just for form, it is Copyrighted -- (c). Permission is hereby freely given for any and all use of program -- and data. You can sell it as your own, but at least tell me. -- -- This version is distributed without obligation, but the developer -- would appreciate comments and suggestions. -- -- All parts of the WORDS system, source code and data files, are made freely -- available to anyone who wishes to use them, for whatever purpose. separate (Latin_Utils.Inflections_Package) package body Stem_Type_IO is --------------------------------------------------------------------------- procedure Get (File : in File_Type; Item : out Stem_Type) is C : Character := ' '; begin Item := Null_Stem_Type; for K in 1 .. Stem_Type_IO.Default_Width loop Get (File, C); if (C not in 'A' .. 'Z') and (C not in 'a' .. 'z') then exit; else Item (K) := C; end if; end loop; end Get; --------------------------------------------------------------------------- procedure Get (Item : out Stem_Type) is C : Character := ' '; begin Item := Null_Stem_Type; for K in 1 .. Stem_Type_IO.Default_Width loop Ada.Text_IO.Get (C); if (C not in 'A' .. 'Z') and (C not in 'a' .. 'z') then exit; else Item (K) := C; end if; end loop; end Get; --------------------------------------------------------------------------- procedure Put (File : in File_Type; Item : in Stem_Type) is begin Ada.Text_IO.Put (File, Item); end Put; --------------------------------------------------------------------------- procedure Put (Item : in Stem_Type) is begin Ada.Text_IO.Put (Item); end Put; --------------------------------------------------------------------------- procedure Get (Source : in String; Target : out Stem_Type; Last : out Integer ) is C : Character; begin Target := Null_Stem_Type; Last := 0; for K in 1 .. Stem_Type_IO.Default_Width loop C := Source (K); if (C not in 'A' .. 'Z') and (C not in 'a' .. 'z') then exit; else Target (K) := C; Last := K; end if; end loop; end Get; --------------------------------------------------------------------------- procedure Put (Target : out String; Item : in Stem_Type) is begin Target (Target'First .. Target'First + Stem_Type_IO.Default_Width - 1) := Item; end Put; --------------------------------------------------------------------------- end Stem_Type_IO;
29.93
79
0.476779
4bf00c61cbdba21836b29693baddfdcb4daff62e
56,112
adb
Ada
gcc-gcc-7_3_0-release/gcc/ada/a-ciormu.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/ada/a-ciormu.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/a-ciormu.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ADA.CONTAINERS.INDEFINITE_ORDERED_MULTISETS -- -- -- -- B o d y -- -- -- -- Copyright (C) 2004-2015, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; with Ada.Containers.Red_Black_Trees.Generic_Operations; pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Operations); with Ada.Containers.Red_Black_Trees.Generic_Keys; pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Keys); with Ada.Containers.Red_Black_Trees.Generic_Set_Operations; pragma Elaborate_All (Ada.Containers.Red_Black_Trees.Generic_Set_Operations); with System; use type System.Address; package body Ada.Containers.Indefinite_Ordered_Multisets is pragma Warnings (Off, "variable ""Busy*"" is not referenced"); pragma Warnings (Off, "variable ""Lock*"" is not referenced"); -- See comment in Ada.Containers.Helpers ----------------------------- -- Node Access Subprograms -- ----------------------------- -- These subprograms provide a functional interface to access fields -- of a node, and a procedural interface for modifying these values. function Color (Node : Node_Access) return Color_Type; pragma Inline (Color); function Left (Node : Node_Access) return Node_Access; pragma Inline (Left); function Parent (Node : Node_Access) return Node_Access; pragma Inline (Parent); function Right (Node : Node_Access) return Node_Access; pragma Inline (Right); procedure Set_Parent (Node : Node_Access; Parent : Node_Access); pragma Inline (Set_Parent); procedure Set_Left (Node : Node_Access; Left : Node_Access); pragma Inline (Set_Left); procedure Set_Right (Node : Node_Access; Right : Node_Access); pragma Inline (Set_Right); procedure Set_Color (Node : Node_Access; Color : Color_Type); pragma Inline (Set_Color); ----------------------- -- Local Subprograms -- ----------------------- function Copy_Node (Source : Node_Access) return Node_Access; pragma Inline (Copy_Node); procedure Free (X : in out Node_Access); procedure Insert_Sans_Hint (Tree : in out Tree_Type; New_Item : Element_Type; Node : out Node_Access); procedure Insert_With_Hint (Dst_Tree : in out Tree_Type; Dst_Hint : Node_Access; Src_Node : Node_Access; Dst_Node : out Node_Access); function Is_Equal_Node_Node (L, R : Node_Access) return Boolean; pragma Inline (Is_Equal_Node_Node); function Is_Greater_Element_Node (Left : Element_Type; Right : Node_Access) return Boolean; pragma Inline (Is_Greater_Element_Node); function Is_Less_Element_Node (Left : Element_Type; Right : Node_Access) return Boolean; pragma Inline (Is_Less_Element_Node); function Is_Less_Node_Node (L, R : Node_Access) return Boolean; pragma Inline (Is_Less_Node_Node); procedure Replace_Element (Tree : in out Tree_Type; Node : Node_Access; Item : Element_Type); -------------------------- -- Local Instantiations -- -------------------------- package Tree_Operations is new Red_Black_Trees.Generic_Operations (Tree_Types); procedure Delete_Tree is new Tree_Operations.Generic_Delete_Tree (Free); function Copy_Tree is new Tree_Operations.Generic_Copy_Tree (Copy_Node, Delete_Tree); use Tree_Operations; procedure Free_Element is new Ada.Unchecked_Deallocation (Element_Type, Element_Access); function Is_Equal is new Tree_Operations.Generic_Equal (Is_Equal_Node_Node); package Set_Ops is new Generic_Set_Operations (Tree_Operations => Tree_Operations, Insert_With_Hint => Insert_With_Hint, Copy_Tree => Copy_Tree, Delete_Tree => Delete_Tree, Is_Less => Is_Less_Node_Node, Free => Free); package Element_Keys is new Red_Black_Trees.Generic_Keys (Tree_Operations => Tree_Operations, Key_Type => Element_Type, Is_Less_Key_Node => Is_Less_Element_Node, Is_Greater_Key_Node => Is_Greater_Element_Node); --------- -- "<" -- --------- function "<" (Left, Right : Cursor) return Boolean is begin if Left.Node = null then raise Constraint_Error with "Left cursor equals No_Element"; end if; if Right.Node = null then raise Constraint_Error with "Right cursor equals No_Element"; end if; if Left.Node.Element = null then raise Program_Error with "Left cursor is bad"; end if; if Right.Node.Element = null then raise Program_Error with "Right cursor is bad"; end if; pragma Assert (Vet (Left.Container.Tree, Left.Node), "bad Left cursor in ""<"""); pragma Assert (Vet (Right.Container.Tree, Right.Node), "bad Right cursor in ""<"""); return Left.Node.Element.all < Right.Node.Element.all; end "<"; function "<" (Left : Cursor; Right : Element_Type) return Boolean is begin if Left.Node = null then raise Constraint_Error with "Left cursor equals No_Element"; end if; if Left.Node.Element = null then raise Program_Error with "Left cursor is bad"; end if; pragma Assert (Vet (Left.Container.Tree, Left.Node), "bad Left cursor in ""<"""); return Left.Node.Element.all < Right; end "<"; function "<" (Left : Element_Type; Right : Cursor) return Boolean is begin if Right.Node = null then raise Constraint_Error with "Right cursor equals No_Element"; end if; if Right.Node.Element = null then raise Program_Error with "Right cursor is bad"; end if; pragma Assert (Vet (Right.Container.Tree, Right.Node), "bad Right cursor in ""<"""); return Left < Right.Node.Element.all; end "<"; --------- -- "=" -- --------- function "=" (Left, Right : Set) return Boolean is begin return Is_Equal (Left.Tree, Right.Tree); end "="; --------- -- ">" -- --------- function ">" (Left, Right : Cursor) return Boolean is begin if Left.Node = null then raise Constraint_Error with "Left cursor equals No_Element"; end if; if Right.Node = null then raise Constraint_Error with "Right cursor equals No_Element"; end if; if Left.Node.Element = null then raise Program_Error with "Left cursor is bad"; end if; if Right.Node.Element = null then raise Program_Error with "Right cursor is bad"; end if; pragma Assert (Vet (Left.Container.Tree, Left.Node), "bad Left cursor in "">"""); pragma Assert (Vet (Right.Container.Tree, Right.Node), "bad Right cursor in "">"""); -- L > R same as R < L return Right.Node.Element.all < Left.Node.Element.all; end ">"; function ">" (Left : Cursor; Right : Element_Type) return Boolean is begin if Left.Node = null then raise Constraint_Error with "Left cursor equals No_Element"; end if; if Left.Node.Element = null then raise Program_Error with "Left cursor is bad"; end if; pragma Assert (Vet (Left.Container.Tree, Left.Node), "bad Left cursor in "">"""); return Right < Left.Node.Element.all; end ">"; function ">" (Left : Element_Type; Right : Cursor) return Boolean is begin if Right.Node = null then raise Constraint_Error with "Right cursor equals No_Element"; end if; if Right.Node.Element = null then raise Program_Error with "Right cursor is bad"; end if; pragma Assert (Vet (Right.Container.Tree, Right.Node), "bad Right cursor in "">"""); return Right.Node.Element.all < Left; end ">"; ------------ -- Adjust -- ------------ procedure Adjust is new Tree_Operations.Generic_Adjust (Copy_Tree); procedure Adjust (Container : in out Set) is begin Adjust (Container.Tree); end Adjust; ------------ -- Assign -- ------------ procedure Assign (Target : in out Set; Source : Set) is begin if Target'Address = Source'Address then return; end if; Target.Clear; Target.Union (Source); end Assign; ------------- -- Ceiling -- ------------- function Ceiling (Container : Set; Item : Element_Type) return Cursor is Node : constant Node_Access := Element_Keys.Ceiling (Container.Tree, Item); begin if Node = null then return No_Element; end if; return Cursor'(Container'Unrestricted_Access, Node); end Ceiling; ----------- -- Clear -- ----------- procedure Clear is new Tree_Operations.Generic_Clear (Delete_Tree); procedure Clear (Container : in out Set) is begin Clear (Container.Tree); end Clear; ----------- -- Color -- ----------- function Color (Node : Node_Access) return Color_Type is begin return Node.Color; end Color; ------------------------ -- Constant_Reference -- ------------------------ function Constant_Reference (Container : aliased Set; Position : Cursor) return Constant_Reference_Type is begin if Position.Container = null then raise Constraint_Error with "Position cursor has no element"; end if; if Position.Container /= Container'Unrestricted_Access then raise Program_Error with "Position cursor designates wrong container"; end if; pragma Assert (Vet (Position.Container.Tree, Position.Node), "bad cursor in Constant_Reference"); -- Note: in predefined container units, the creation of a reference -- increments the busy bit of the container, and its finalization -- decrements it. In the absence of control machinery, this tampering -- protection is missing. declare T : Tree_Type renames Container.Tree'Unrestricted_Access.all; pragma Unreferenced (T); begin return R : constant Constant_Reference_Type := (Element => Position.Node.Element, Control => (Container => Container'Unrestricted_Access)) do null; end return; end; end Constant_Reference; -------------- -- Contains -- -------------- function Contains (Container : Set; Item : Element_Type) return Boolean is begin return Find (Container, Item) /= No_Element; end Contains; ---------- -- Copy -- ---------- function Copy (Source : Set) return Set is begin return Target : Set do Target.Assign (Source); end return; end Copy; --------------- -- Copy_Node -- --------------- function Copy_Node (Source : Node_Access) return Node_Access is X : Element_Access := new Element_Type'(Source.Element.all); begin return new Node_Type'(Parent => null, Left => null, Right => null, Color => Source.Color, Element => X); exception when others => Free_Element (X); raise; end Copy_Node; ------------ -- Delete -- ------------ procedure Delete (Container : in out Set; Item : Element_Type) is Tree : Tree_Type renames Container.Tree; Node : Node_Access := Element_Keys.Ceiling (Tree, Item); Done : constant Node_Access := Element_Keys.Upper_Bound (Tree, Item); X : Node_Access; begin if Node = Done then raise Constraint_Error with "attempt to delete element not in set"; end if; loop X := Node; Node := Tree_Operations.Next (Node); Tree_Operations.Delete_Node_Sans_Free (Tree, X); Free (X); exit when Node = Done; end loop; end Delete; procedure Delete (Container : in out Set; Position : in out Cursor) is begin if Position.Node = null then raise Constraint_Error with "Position cursor equals No_Element"; end if; if Position.Node.Element = null then raise Program_Error with "Position cursor is bad"; end if; if Position.Container /= Container'Unrestricted_Access then raise Program_Error with "Position cursor designates wrong set"; end if; pragma Assert (Vet (Container.Tree, Position.Node), "bad cursor in Delete"); Tree_Operations.Delete_Node_Sans_Free (Container.Tree, Position.Node); Free (Position.Node); Position.Container := null; end Delete; ------------------ -- Delete_First -- ------------------ procedure Delete_First (Container : in out Set) is Tree : Tree_Type renames Container.Tree; X : Node_Access := Tree.First; begin if X = null then return; end if; Tree_Operations.Delete_Node_Sans_Free (Tree, X); Free (X); end Delete_First; ----------------- -- Delete_Last -- ----------------- procedure Delete_Last (Container : in out Set) is Tree : Tree_Type renames Container.Tree; X : Node_Access := Tree.Last; begin if X = null then return; end if; Tree_Operations.Delete_Node_Sans_Free (Tree, X); Free (X); end Delete_Last; ---------------- -- Difference -- ---------------- procedure Difference (Target : in out Set; Source : Set) is begin Set_Ops.Difference (Target.Tree, Source.Tree); end Difference; function Difference (Left, Right : Set) return Set is Tree : constant Tree_Type := Set_Ops.Difference (Left.Tree, Right.Tree); begin return Set'(Controlled with Tree); end Difference; ------------- -- Element -- ------------- function Element (Position : Cursor) return Element_Type is begin if Position.Node = null then raise Constraint_Error with "Position cursor equals No_Element"; end if; if Position.Node.Element = null then raise Program_Error with "Position cursor is bad"; end if; pragma Assert (Vet (Position.Container.Tree, Position.Node), "bad cursor in Element"); return Position.Node.Element.all; end Element; ------------------------- -- Equivalent_Elements -- ------------------------- function Equivalent_Elements (Left, Right : Element_Type) return Boolean is begin if Left < Right or else Right < Left then return False; else return True; end if; end Equivalent_Elements; --------------------- -- Equivalent_Sets -- --------------------- function Equivalent_Sets (Left, Right : Set) return Boolean is function Is_Equivalent_Node_Node (L, R : Node_Access) return Boolean; pragma Inline (Is_Equivalent_Node_Node); function Is_Equivalent is new Tree_Operations.Generic_Equal (Is_Equivalent_Node_Node); ----------------------------- -- Is_Equivalent_Node_Node -- ----------------------------- function Is_Equivalent_Node_Node (L, R : Node_Access) return Boolean is begin if L.Element.all < R.Element.all then return False; elsif R.Element.all < L.Element.all then return False; else return True; end if; end Is_Equivalent_Node_Node; -- Start of processing for Equivalent_Sets begin return Is_Equivalent (Left.Tree, Right.Tree); end Equivalent_Sets; ------------- -- Exclude -- ------------- procedure Exclude (Container : in out Set; Item : Element_Type) is Tree : Tree_Type renames Container.Tree; Node : Node_Access := Element_Keys.Ceiling (Tree, Item); Done : constant Node_Access := Element_Keys.Upper_Bound (Tree, Item); X : Node_Access; begin while Node /= Done loop X := Node; Node := Tree_Operations.Next (Node); Tree_Operations.Delete_Node_Sans_Free (Tree, X); Free (X); end loop; end Exclude; ---------- -- Find -- ---------- function Find (Container : Set; Item : Element_Type) return Cursor is Node : constant Node_Access := Element_Keys.Find (Container.Tree, Item); begin if Node = null then return No_Element; end if; return Cursor'(Container'Unrestricted_Access, Node); end Find; -------------- -- Finalize -- -------------- procedure Finalize (Object : in out Iterator) is begin Unbusy (Object.Container.Tree.TC); end Finalize; ----------- -- First -- ----------- function First (Container : Set) return Cursor is begin if Container.Tree.First = null then return No_Element; end if; return Cursor'(Container'Unrestricted_Access, Container.Tree.First); end First; function First (Object : Iterator) return Cursor is begin -- The value of the iterator object's Node component influences the -- behavior of the First (and Last) selector function. -- When the Node component is null, this means the iterator object was -- constructed without a start expression, in which case the (forward) -- iteration starts from the (logical) beginning of the entire sequence -- of items (corresponding to Container.First, for a forward iterator). -- Otherwise, this is iteration over a partial sequence of items. When -- the Node component is non-null, the iterator object was constructed -- with a start expression, that specifies the position from which the -- (forward) partial iteration begins. if Object.Node = null then return Object.Container.First; else return Cursor'(Object.Container, Object.Node); end if; end First; ------------------- -- First_Element -- ------------------- function First_Element (Container : Set) return Element_Type is begin if Container.Tree.First = null then raise Constraint_Error with "set is empty"; end if; pragma Assert (Container.Tree.First.Element /= null); return Container.Tree.First.Element.all; end First_Element; ----------- -- Floor -- ----------- function Floor (Container : Set; Item : Element_Type) return Cursor is Node : constant Node_Access := Element_Keys.Floor (Container.Tree, Item); begin if Node = null then return No_Element; end if; return Cursor'(Container'Unrestricted_Access, Node); end Floor; ---------- -- Free -- ---------- procedure Free (X : in out Node_Access) is procedure Deallocate is new Ada.Unchecked_Deallocation (Node_Type, Node_Access); begin if X = null then return; end if; X.Parent := X; X.Left := X; X.Right := X; begin Free_Element (X.Element); exception when others => X.Element := null; Deallocate (X); raise; end; Deallocate (X); end Free; ------------------ -- Generic_Keys -- ------------------ package body Generic_Keys is ----------------------- -- Local Subprograms -- ----------------------- function Is_Less_Key_Node (Left : Key_Type; Right : Node_Access) return Boolean; pragma Inline (Is_Less_Key_Node); function Is_Greater_Key_Node (Left : Key_Type; Right : Node_Access) return Boolean; pragma Inline (Is_Greater_Key_Node); -------------------------- -- Local Instantiations -- -------------------------- package Key_Keys is new Red_Black_Trees.Generic_Keys (Tree_Operations => Tree_Operations, Key_Type => Key_Type, Is_Less_Key_Node => Is_Less_Key_Node, Is_Greater_Key_Node => Is_Greater_Key_Node); ------------- -- Ceiling -- ------------- function Ceiling (Container : Set; Key : Key_Type) return Cursor is Node : constant Node_Access := Key_Keys.Ceiling (Container.Tree, Key); begin if Node = null then return No_Element; end if; return Cursor'(Container'Unrestricted_Access, Node); end Ceiling; -------------- -- Contains -- -------------- function Contains (Container : Set; Key : Key_Type) return Boolean is begin return Find (Container, Key) /= No_Element; end Contains; ------------ -- Delete -- ------------ procedure Delete (Container : in out Set; Key : Key_Type) is Tree : Tree_Type renames Container.Tree; Node : Node_Access := Key_Keys.Ceiling (Tree, Key); Done : constant Node_Access := Key_Keys.Upper_Bound (Tree, Key); X : Node_Access; begin if Node = Done then raise Constraint_Error with "attempt to delete key not in set"; end if; loop X := Node; Node := Tree_Operations.Next (Node); Tree_Operations.Delete_Node_Sans_Free (Tree, X); Free (X); exit when Node = Done; end loop; end Delete; ------------- -- Element -- ------------- function Element (Container : Set; Key : Key_Type) return Element_Type is Node : constant Node_Access := Key_Keys.Find (Container.Tree, Key); begin if Node = null then raise Constraint_Error with "key not in set"; end if; return Node.Element.all; end Element; --------------------- -- Equivalent_Keys -- --------------------- function Equivalent_Keys (Left, Right : Key_Type) return Boolean is begin if Left < Right or else Right < Left then return False; else return True; end if; end Equivalent_Keys; ------------- -- Exclude -- ------------- procedure Exclude (Container : in out Set; Key : Key_Type) is Tree : Tree_Type renames Container.Tree; Node : Node_Access := Key_Keys.Ceiling (Tree, Key); Done : constant Node_Access := Key_Keys.Upper_Bound (Tree, Key); X : Node_Access; begin while Node /= Done loop X := Node; Node := Tree_Operations.Next (Node); Tree_Operations.Delete_Node_Sans_Free (Tree, X); Free (X); end loop; end Exclude; ---------- -- Find -- ---------- function Find (Container : Set; Key : Key_Type) return Cursor is Node : constant Node_Access := Key_Keys.Find (Container.Tree, Key); begin if Node = null then return No_Element; end if; return Cursor'(Container'Unrestricted_Access, Node); end Find; ----------- -- Floor -- ----------- function Floor (Container : Set; Key : Key_Type) return Cursor is Node : constant Node_Access := Key_Keys.Floor (Container.Tree, Key); begin if Node = null then return No_Element; end if; return Cursor'(Container'Unrestricted_Access, Node); end Floor; ------------------------- -- Is_Greater_Key_Node -- ------------------------- function Is_Greater_Key_Node (Left : Key_Type; Right : Node_Access) return Boolean is begin return Key (Right.Element.all) < Left; end Is_Greater_Key_Node; ---------------------- -- Is_Less_Key_Node -- ---------------------- function Is_Less_Key_Node (Left : Key_Type; Right : Node_Access) return Boolean is begin return Left < Key (Right.Element.all); end Is_Less_Key_Node; ------------- -- Iterate -- ------------- procedure Iterate (Container : Set; Key : Key_Type; Process : not null access procedure (Position : Cursor)) is procedure Process_Node (Node : Node_Access); pragma Inline (Process_Node); procedure Local_Iterate is new Key_Keys.Generic_Iteration (Process_Node); ------------------ -- Process_Node -- ------------------ procedure Process_Node (Node : Node_Access) is begin Process (Cursor'(Container'Unrestricted_Access, Node)); end Process_Node; T : Tree_Type renames Container.Tree'Unrestricted_Access.all; Busy : With_Busy (T.TC'Unrestricted_Access); -- Start of processing for Iterate begin Local_Iterate (T, Key); end Iterate; --------- -- Key -- --------- function Key (Position : Cursor) return Key_Type is begin if Position.Node = null then raise Constraint_Error with "Position cursor equals No_Element"; end if; if Position.Node.Element = null then raise Program_Error with "Position cursor is bad"; end if; pragma Assert (Vet (Position.Container.Tree, Position.Node), "bad cursor in Key"); return Key (Position.Node.Element.all); end Key; --------------------- -- Reverse_Iterate -- --------------------- procedure Reverse_Iterate (Container : Set; Key : Key_Type; Process : not null access procedure (Position : Cursor)) is procedure Process_Node (Node : Node_Access); pragma Inline (Process_Node); ------------- -- Iterate -- ------------- procedure Local_Reverse_Iterate is new Key_Keys.Generic_Reverse_Iteration (Process_Node); ------------------ -- Process_Node -- ------------------ procedure Process_Node (Node : Node_Access) is begin Process (Cursor'(Container'Unrestricted_Access, Node)); end Process_Node; T : Tree_Type renames Container.Tree'Unrestricted_Access.all; Busy : With_Busy (T.TC'Unrestricted_Access); -- Start of processing for Reverse_Iterate begin Local_Reverse_Iterate (T, Key); end Reverse_Iterate; -------------------- -- Update_Element -- -------------------- procedure Update_Element (Container : in out Set; Position : Cursor; Process : not null access procedure (Element : in out Element_Type)) is Tree : Tree_Type renames Container.Tree; Node : constant Node_Access := Position.Node; begin if Node = null then raise Constraint_Error with "Position cursor equals No_Element"; end if; if Node.Element = null then raise Program_Error with "Position cursor is bad"; end if; if Position.Container /= Container'Unrestricted_Access then raise Program_Error with "Position cursor designates wrong set"; end if; pragma Assert (Vet (Tree, Node), "bad cursor in Update_Element"); declare E : Element_Type renames Node.Element.all; K : constant Key_Type := Key (E); Lock : With_Lock (Tree.TC'Unrestricted_Access); begin Process (E); if Equivalent_Keys (Left => K, Right => Key (E)) then return; end if; end; -- Delete_Node checks busy-bit Tree_Operations.Delete_Node_Sans_Free (Tree, Node); Insert_New_Item : declare function New_Node return Node_Access; pragma Inline (New_Node); procedure Insert_Post is new Element_Keys.Generic_Insert_Post (New_Node); procedure Unconditional_Insert is new Element_Keys.Generic_Unconditional_Insert (Insert_Post); -------------- -- New_Node -- -------------- function New_Node return Node_Access is begin Node.Color := Red_Black_Trees.Red; Node.Parent := null; Node.Left := null; Node.Right := null; return Node; end New_Node; Result : Node_Access; -- Start of processing for Insert_New_Item begin Unconditional_Insert (Tree => Tree, Key => Node.Element.all, Node => Result); pragma Assert (Result = Node); end Insert_New_Item; end Update_Element; end Generic_Keys; ----------------- -- Has_Element -- ----------------- function Has_Element (Position : Cursor) return Boolean is begin return Position /= No_Element; end Has_Element; ------------ -- Insert -- ------------ procedure Insert (Container : in out Set; New_Item : Element_Type) is Position : Cursor; pragma Unreferenced (Position); begin Insert (Container, New_Item, Position); end Insert; procedure Insert (Container : in out Set; New_Item : Element_Type; Position : out Cursor) is begin Insert_Sans_Hint (Container.Tree, New_Item, Position.Node); Position.Container := Container'Unrestricted_Access; end Insert; ---------------------- -- Insert_Sans_Hint -- ---------------------- procedure Insert_Sans_Hint (Tree : in out Tree_Type; New_Item : Element_Type; Node : out Node_Access) is function New_Node return Node_Access; pragma Inline (New_Node); procedure Insert_Post is new Element_Keys.Generic_Insert_Post (New_Node); procedure Unconditional_Insert is new Element_Keys.Generic_Unconditional_Insert (Insert_Post); -------------- -- New_Node -- -------------- function New_Node return Node_Access is -- The element allocator may need an accessibility check in the case -- the actual type is class-wide or has access discriminants (see -- RM 4.8(10.1) and AI12-0035). pragma Unsuppress (Accessibility_Check); Element : Element_Access := new Element_Type'(New_Item); begin return new Node_Type'(Parent => null, Left => null, Right => null, Color => Red_Black_Trees.Red, Element => Element); exception when others => Free_Element (Element); raise; end New_Node; -- Start of processing for Insert_Sans_Hint begin Unconditional_Insert (Tree, New_Item, Node); end Insert_Sans_Hint; ---------------------- -- Insert_With_Hint -- ---------------------- procedure Insert_With_Hint (Dst_Tree : in out Tree_Type; Dst_Hint : Node_Access; Src_Node : Node_Access; Dst_Node : out Node_Access) is function New_Node return Node_Access; pragma Inline (New_Node); procedure Insert_Post is new Element_Keys.Generic_Insert_Post (New_Node); procedure Insert_Sans_Hint is new Element_Keys.Generic_Unconditional_Insert (Insert_Post); procedure Local_Insert_With_Hint is new Element_Keys.Generic_Unconditional_Insert_With_Hint (Insert_Post, Insert_Sans_Hint); -------------- -- New_Node -- -------------- function New_Node return Node_Access is X : Element_Access := new Element_Type'(Src_Node.Element.all); begin return new Node_Type'(Parent => null, Left => null, Right => null, Color => Red, Element => X); exception when others => Free_Element (X); raise; end New_Node; -- Start of processing for Insert_With_Hint begin Local_Insert_With_Hint (Dst_Tree, Dst_Hint, Src_Node.Element.all, Dst_Node); end Insert_With_Hint; ------------------ -- Intersection -- ------------------ procedure Intersection (Target : in out Set; Source : Set) is begin Set_Ops.Intersection (Target.Tree, Source.Tree); end Intersection; function Intersection (Left, Right : Set) return Set is Tree : constant Tree_Type := Set_Ops.Intersection (Left.Tree, Right.Tree); begin return Set'(Controlled with Tree); end Intersection; -------------- -- Is_Empty -- -------------- function Is_Empty (Container : Set) return Boolean is begin return Container.Tree.Length = 0; end Is_Empty; ------------------------ -- Is_Equal_Node_Node -- ------------------------ function Is_Equal_Node_Node (L, R : Node_Access) return Boolean is begin return L.Element.all = R.Element.all; end Is_Equal_Node_Node; ----------------------------- -- Is_Greater_Element_Node -- ----------------------------- function Is_Greater_Element_Node (Left : Element_Type; Right : Node_Access) return Boolean is begin -- e > node same as node < e return Right.Element.all < Left; end Is_Greater_Element_Node; -------------------------- -- Is_Less_Element_Node -- -------------------------- function Is_Less_Element_Node (Left : Element_Type; Right : Node_Access) return Boolean is begin return Left < Right.Element.all; end Is_Less_Element_Node; ----------------------- -- Is_Less_Node_Node -- ----------------------- function Is_Less_Node_Node (L, R : Node_Access) return Boolean is begin return L.Element.all < R.Element.all; end Is_Less_Node_Node; --------------- -- Is_Subset -- --------------- function Is_Subset (Subset : Set; Of_Set : Set) return Boolean is begin return Set_Ops.Is_Subset (Subset => Subset.Tree, Of_Set => Of_Set.Tree); end Is_Subset; ------------- -- Iterate -- ------------- procedure Iterate (Container : Set; Item : Element_Type; Process : not null access procedure (Position : Cursor)) is procedure Process_Node (Node : Node_Access); pragma Inline (Process_Node); procedure Local_Iterate is new Element_Keys.Generic_Iteration (Process_Node); ------------------ -- Process_Node -- ------------------ procedure Process_Node (Node : Node_Access) is begin Process (Cursor'(Container'Unrestricted_Access, Node)); end Process_Node; T : Tree_Type renames Container.Tree'Unrestricted_Access.all; Busy : With_Busy (T.TC'Unrestricted_Access); -- Start of processing for Iterate begin Local_Iterate (T, Item); end Iterate; procedure Iterate (Container : Set; Process : not null access procedure (Position : Cursor)) is procedure Process_Node (Node : Node_Access); pragma Inline (Process_Node); procedure Local_Iterate is new Tree_Operations.Generic_Iteration (Process_Node); ------------------ -- Process_Node -- ------------------ procedure Process_Node (Node : Node_Access) is begin Process (Cursor'(Container'Unrestricted_Access, Node)); end Process_Node; T : Tree_Type renames Container.Tree'Unrestricted_Access.all; Busy : With_Busy (T.TC'Unrestricted_Access); -- Start of processing for Iterate begin Local_Iterate (T); end Iterate; function Iterate (Container : Set) return Set_Iterator_Interfaces.Reversible_Iterator'Class is S : constant Set_Access := Container'Unrestricted_Access; begin -- The value of the Node component influences the behavior of the First -- and Last selector functions of the iterator object. When the Node -- component is null (as is the case here), this means the iterator -- object was constructed without a start expression. This is a complete -- iterator, meaning that the iteration starts from the (logical) -- beginning of the sequence of items. -- Note: For a forward iterator, Container.First is the beginning, and -- for a reverse iterator, Container.Last is the beginning. return It : constant Iterator := (Limited_Controlled with S, null) do Busy (S.Tree.TC); end return; end Iterate; function Iterate (Container : Set; Start : Cursor) return Set_Iterator_Interfaces.Reversible_Iterator'Class is S : constant Set_Access := Container'Unrestricted_Access; begin -- It was formerly the case that when Start = No_Element, the partial -- iterator was defined to behave the same as for a complete iterator, -- and iterate over the entire sequence of items. However, those -- semantics were unintuitive and arguably error-prone (it is too easy -- to accidentally create an endless loop), and so they were changed, -- per the ARG meeting in Denver on 2011/11. However, there was no -- consensus about what positive meaning this corner case should have, -- and so it was decided to simply raise an exception. This does imply, -- however, that it is not possible to use a partial iterator to specify -- an empty sequence of items. if Start = No_Element then raise Constraint_Error with "Start position for iterator equals No_Element"; end if; if Start.Container /= Container'Unrestricted_Access then raise Program_Error with "Start cursor of Iterate designates wrong set"; end if; pragma Assert (Vet (Container.Tree, Start.Node), "Start cursor of Iterate is bad"); -- The value of the Node component influences the behavior of the First -- and Last selector functions of the iterator object. When the Node -- component is non-null (as is the case here), it means that this is a -- partial iteration, over a subset of the complete sequence of -- items. The iterator object was constructed with a start expression, -- indicating the position from which the iteration begins. Note that -- the start position has the same value irrespective of whether this is -- a forward or reverse iteration. return It : constant Iterator := (Limited_Controlled with S, Start.Node) do Busy (S.Tree.TC); end return; end Iterate; ---------- -- Last -- ---------- function Last (Container : Set) return Cursor is begin if Container.Tree.Last = null then return No_Element; end if; return Cursor'(Container'Unrestricted_Access, Container.Tree.Last); end Last; function Last (Object : Iterator) return Cursor is begin -- The value of the iterator object's Node component influences the -- behavior of the Last (and First) selector function. -- When the Node component is null, this means the iterator object was -- constructed without a start expression, in which case the (reverse) -- iteration starts from the (logical) beginning of the entire sequence -- (corresponding to Container.Last, for a reverse iterator). -- Otherwise, this is iteration over a partial sequence of items. When -- the Node component is non-null, the iterator object was constructed -- with a start expression, that specifies the position from which the -- (reverse) partial iteration begins. if Object.Node = null then return Object.Container.Last; else return Cursor'(Object.Container, Object.Node); end if; end Last; ------------------ -- Last_Element -- ------------------ function Last_Element (Container : Set) return Element_Type is begin if Container.Tree.Last = null then raise Constraint_Error with "set is empty"; end if; pragma Assert (Container.Tree.Last.Element /= null); return Container.Tree.Last.Element.all; end Last_Element; ---------- -- Left -- ---------- function Left (Node : Node_Access) return Node_Access is begin return Node.Left; end Left; ------------ -- Length -- ------------ function Length (Container : Set) return Count_Type is begin return Container.Tree.Length; end Length; ---------- -- Move -- ---------- procedure Move is new Tree_Operations.Generic_Move (Clear); procedure Move (Target : in out Set; Source : in out Set) is begin Move (Target => Target.Tree, Source => Source.Tree); end Move; ---------- -- Next -- ---------- function Next (Position : Cursor) return Cursor is begin if Position = No_Element then return No_Element; end if; pragma Assert (Vet (Position.Container.Tree, Position.Node), "bad cursor in Next"); declare Node : constant Node_Access := Tree_Operations.Next (Position.Node); begin if Node = null then return No_Element; end if; return Cursor'(Position.Container, Node); end; end Next; procedure Next (Position : in out Cursor) is begin Position := Next (Position); end Next; function Next (Object : Iterator; Position : Cursor) return Cursor is begin if Position.Container = null then return No_Element; end if; if Position.Container /= Object.Container then raise Program_Error with "Position cursor of Next designates wrong set"; end if; return Next (Position); end Next; ------------- -- Overlap -- ------------- function Overlap (Left, Right : Set) return Boolean is begin return Set_Ops.Overlap (Left.Tree, Right.Tree); end Overlap; ------------ -- Parent -- ------------ function Parent (Node : Node_Access) return Node_Access is begin return Node.Parent; end Parent; -------------- -- Previous -- -------------- function Previous (Position : Cursor) return Cursor is begin if Position = No_Element then return No_Element; end if; pragma Assert (Vet (Position.Container.Tree, Position.Node), "bad cursor in Previous"); declare Node : constant Node_Access := Tree_Operations.Previous (Position.Node); begin if Node = null then return No_Element; end if; return Cursor'(Position.Container, Node); end; end Previous; procedure Previous (Position : in out Cursor) is begin Position := Previous (Position); end Previous; function Previous (Object : Iterator; Position : Cursor) return Cursor is begin if Position.Container = null then return No_Element; end if; if Position.Container /= Object.Container then raise Program_Error with "Position cursor of Previous designates wrong set"; end if; return Previous (Position); end Previous; ------------------- -- Query_Element -- ------------------- procedure Query_Element (Position : Cursor; Process : not null access procedure (Element : Element_Type)) is begin if Position.Node = null then raise Constraint_Error with "Position cursor equals No_Element"; end if; if Position.Node.Element = null then raise Program_Error with "Position cursor is bad"; end if; pragma Assert (Vet (Position.Container.Tree, Position.Node), "bad cursor in Query_Element"); declare T : Tree_Type renames Position.Container.Tree; Lock : With_Lock (T.TC'Unrestricted_Access); begin Process (Position.Node.Element.all); end; end Query_Element; ---------- -- Read -- ---------- procedure Read (Stream : not null access Root_Stream_Type'Class; Container : out Set) is function Read_Node (Stream : not null access Root_Stream_Type'Class) return Node_Access; pragma Inline (Read_Node); procedure Read is new Tree_Operations.Generic_Read (Clear, Read_Node); --------------- -- Read_Node -- --------------- function Read_Node (Stream : not null access Root_Stream_Type'Class) return Node_Access is Node : Node_Access := new Node_Type; begin Node.Element := new Element_Type'(Element_Type'Input (Stream)); return Node; exception when others => Free (Node); -- Note that Free deallocates elem too raise; end Read_Node; -- Start of processing for Read begin Read (Stream, Container.Tree); end Read; procedure Read (Stream : not null access Root_Stream_Type'Class; Item : out Cursor) is begin raise Program_Error with "attempt to stream set cursor"; end Read; procedure Read (Stream : not null access Root_Stream_Type'Class; Item : out Constant_Reference_Type) is begin raise Program_Error with "attempt to stream reference"; end Read; --------------------- -- Replace_Element -- --------------------- procedure Replace_Element (Tree : in out Tree_Type; Node : Node_Access; Item : Element_Type) is begin if Item < Node.Element.all or else Node.Element.all < Item then null; else TE_Check (Tree.TC); declare X : Element_Access := Node.Element; -- The element allocator may need an accessibility check in the -- case the actual type is class-wide or has access discriminants -- (see RM 4.8(10.1) and AI12-0035). pragma Unsuppress (Accessibility_Check); begin Node.Element := new Element_Type'(Item); Free_Element (X); end; return; end if; Tree_Operations.Delete_Node_Sans_Free (Tree, Node); -- Checks busy-bit Insert_New_Item : declare function New_Node return Node_Access; pragma Inline (New_Node); procedure Insert_Post is new Element_Keys.Generic_Insert_Post (New_Node); procedure Unconditional_Insert is new Element_Keys.Generic_Unconditional_Insert (Insert_Post); -------------- -- New_Node -- -------------- function New_Node return Node_Access is -- The element allocator may need an accessibility check in the -- case the actual type is class-wide or has access discriminants -- (see RM 4.8(10.1) and AI12-0035). pragma Unsuppress (Accessibility_Check); begin Node.Element := new Element_Type'(Item); -- OK if fails Node.Color := Red_Black_Trees.Red; Node.Parent := null; Node.Left := null; Node.Right := null; return Node; end New_Node; Result : Node_Access; X : Element_Access := Node.Element; -- Start of processing for Insert_New_Item begin Unconditional_Insert (Tree => Tree, Key => Item, Node => Result); pragma Assert (Result = Node); Free_Element (X); -- OK if fails end Insert_New_Item; end Replace_Element; procedure Replace_Element (Container : in out Set; Position : Cursor; New_Item : Element_Type) is begin if Position.Node = null then raise Constraint_Error with "Position cursor equals No_Element"; end if; if Position.Node.Element = null then raise Program_Error with "Position cursor is bad"; end if; if Position.Container /= Container'Unrestricted_Access then raise Program_Error with "Position cursor designates wrong set"; end if; pragma Assert (Vet (Container.Tree, Position.Node), "bad cursor in Replace_Element"); Replace_Element (Container.Tree, Position.Node, New_Item); end Replace_Element; --------------------- -- Reverse_Iterate -- --------------------- procedure Reverse_Iterate (Container : Set; Item : Element_Type; Process : not null access procedure (Position : Cursor)) is procedure Process_Node (Node : Node_Access); pragma Inline (Process_Node); procedure Local_Reverse_Iterate is new Element_Keys.Generic_Reverse_Iteration (Process_Node); ------------------ -- Process_Node -- ------------------ procedure Process_Node (Node : Node_Access) is begin Process (Cursor'(Container'Unrestricted_Access, Node)); end Process_Node; T : Tree_Type renames Container.Tree'Unrestricted_Access.all; Busy : With_Busy (T.TC'Unrestricted_Access); -- Start of processing for Reverse_Iterate begin Local_Reverse_Iterate (T, Item); end Reverse_Iterate; procedure Reverse_Iterate (Container : Set; Process : not null access procedure (Position : Cursor)) is procedure Process_Node (Node : Node_Access); pragma Inline (Process_Node); procedure Local_Reverse_Iterate is new Tree_Operations.Generic_Reverse_Iteration (Process_Node); ------------------ -- Process_Node -- ------------------ procedure Process_Node (Node : Node_Access) is begin Process (Cursor'(Container'Unrestricted_Access, Node)); end Process_Node; T : Tree_Type renames Container.Tree'Unrestricted_Access.all; Busy : With_Busy (T.TC'Unrestricted_Access); -- Start of processing for Reverse_Iterate begin Local_Reverse_Iterate (T); end Reverse_Iterate; ----------- -- Right -- ----------- function Right (Node : Node_Access) return Node_Access is begin return Node.Right; end Right; --------------- -- Set_Color -- --------------- procedure Set_Color (Node : Node_Access; Color : Color_Type) is begin Node.Color := Color; end Set_Color; -------------- -- Set_Left -- -------------- procedure Set_Left (Node : Node_Access; Left : Node_Access) is begin Node.Left := Left; end Set_Left; ---------------- -- Set_Parent -- ---------------- procedure Set_Parent (Node : Node_Access; Parent : Node_Access) is begin Node.Parent := Parent; end Set_Parent; --------------- -- Set_Right -- --------------- procedure Set_Right (Node : Node_Access; Right : Node_Access) is begin Node.Right := Right; end Set_Right; -------------------------- -- Symmetric_Difference -- -------------------------- procedure Symmetric_Difference (Target : in out Set; Source : Set) is begin Set_Ops.Symmetric_Difference (Target.Tree, Source.Tree); end Symmetric_Difference; function Symmetric_Difference (Left, Right : Set) return Set is Tree : constant Tree_Type := Set_Ops.Symmetric_Difference (Left.Tree, Right.Tree); begin return Set'(Controlled with Tree); end Symmetric_Difference; ------------ -- To_Set -- ------------ function To_Set (New_Item : Element_Type) return Set is Tree : Tree_Type; Node : Node_Access; pragma Unreferenced (Node); begin Insert_Sans_Hint (Tree, New_Item, Node); return Set'(Controlled with Tree); end To_Set; ----------- -- Union -- ----------- procedure Union (Target : in out Set; Source : Set) is begin Set_Ops.Union (Target.Tree, Source.Tree); end Union; function Union (Left, Right : Set) return Set is Tree : constant Tree_Type := Set_Ops.Union (Left.Tree, Right.Tree); begin return Set'(Controlled with Tree); end Union; ----------- -- Write -- ----------- procedure Write (Stream : not null access Root_Stream_Type'Class; Container : Set) is procedure Write_Node (Stream : not null access Root_Stream_Type'Class; Node : Node_Access); pragma Inline (Write_Node); procedure Write is new Tree_Operations.Generic_Write (Write_Node); ---------------- -- Write_Node -- ---------------- procedure Write_Node (Stream : not null access Root_Stream_Type'Class; Node : Node_Access) is begin Element_Type'Output (Stream, Node.Element.all); end Write_Node; -- Start of processing for Write begin Write (Stream, Container.Tree); end Write; procedure Write (Stream : not null access Root_Stream_Type'Class; Item : Cursor) is begin raise Program_Error with "attempt to stream set cursor"; end Write; procedure Write (Stream : not null access Root_Stream_Type'Class; Item : Constant_Reference_Type) is begin raise Program_Error with "attempt to stream reference"; end Write; end Ada.Containers.Indefinite_Ordered_Multisets;
27.860973
79
0.572141
2257b9565e0412d3af65f3f22b36e2a8c4ff8c41
370
adb
Ada
icasrc/tasks.adb
bhayward93/Ada-Traffic-Light-Sim
046bdc537a1365191aea142f31d36db53adf6e30
[ "MIT" ]
null
null
null
icasrc/tasks.adb
bhayward93/Ada-Traffic-Light-Sim
046bdc537a1365191aea142f31d36db53adf6e30
[ "MIT" ]
null
null
null
icasrc/tasks.adb
bhayward93/Ada-Traffic-Light-Sim
046bdc537a1365191aea142f31d36db53adf6e30
[ "MIT" ]
null
null
null
--with HWIF; package body Tasks is --Pressed Button Task task ButtonPressed (this: in Direction) is end ButtonPressed; task body ButtonPressed is (this: in Direction) begin Traffic_Light(this) := 4; delay 1.0; Traffic_Light(this) := 2; delay 1.0; Traffic_Light(this) := 1; end ButtonPressed; end Tasks;
15.416667
45
0.616216
ad39b519988e4ac667b2dd0e9bb6556b4a1131cb
3,063
ads
Ada
kv-avm-executable_lists.ads
davidkristola/vole
aa8e19d9deff2efe98fcd4dc0028c2895d624693
[ "Unlicense" ]
4
2015-02-02T12:11:41.000Z
2020-12-19T02:14:21.000Z
kv-avm-executable_lists.ads
davidkristola/vole
aa8e19d9deff2efe98fcd4dc0028c2895d624693
[ "Unlicense" ]
null
null
null
kv-avm-executable_lists.ads
davidkristola/vole
aa8e19d9deff2efe98fcd4dc0028c2895d624693
[ "Unlicense" ]
3
2017-02-22T10:44:02.000Z
2021-05-16T09:34:39.000Z
with kv.avm.Control; with kv.avm.Executables; with kv.avm.Actor_References; package kv.avm.Executable_Lists is type Cursor_Type is new Natural; subtype Index_Type is Cursor_Type range 1 .. Cursor_Type'LAST; type Executable_Handle_Type is tagged private; type Executable_Handle_Access is access Executable_Handle_Type; function Get_List(Self : Executable_Handle_Type) return kv.avm.Control.Status_Type; function Get_Cursor(Self : Executable_Handle_Type) return Cursor_Type; function Get_Reference(Self : Executable_Handle_Type) return kv.avm.Actor_References.Actor_Reference_Type; function Get_Executable(Self : Executable_Handle_Type) return kv.avm.Executables.Executable_Access; type Executable_Holder_Type is tagged private; procedure Initialize (Self : in out Executable_Holder_Type; Kind : in kv.avm.Control.Status_Type); procedure Add (Self : in out Executable_Holder_Type; This : in kv.avm.Executables.Executable_Access; Ref : in kv.avm.Actor_References.Actor_Reference_Type); function Find(Self : Executable_Holder_Type; Executable : kv.avm.Executables.Executable_Access) return Cursor_Type; function Is_In(Self : Executable_Holder_Type; Executable : kv.avm.Executables.Executable_Access) return Boolean; function Get(Self : Executable_Holder_Type; Position : Cursor_Type) return kv.avm.Executables.Executable_Access; procedure Delete -- deallocate the handle (Self : in out Executable_Holder_Type; This : in Cursor_Type); procedure Drop -- just remove the handle from the list (Self : in out Executable_Holder_Type; This : in Cursor_Type); procedure Drop (Self : in out Executable_Holder_Type; This : in kv.avm.Executables.Executable_Access); procedure Acquire_From (Self : in out Executable_Holder_Type; Place : in Cursor_Type; From : in out Executable_Holder_Type); function Get_Handle (Self : Executable_Holder_Type; Position : Cursor_Type) return Executable_Handle_Access; function Get_Last (Self : Executable_Holder_Type) return Cursor_Type; private type Executable_Handle_Type is tagged record Executable : kv.avm.Executables.Executable_Access; Reference : kv.avm.Actor_References.Actor_Reference_Type; Status : kv.avm.Control.Status_Type; -- This is also the list that holds the executable Position : Cursor_Type; -- Zero means that this executable isn't in a list end record; type Executable_Array_Type is array (Index_Type range <>) of Executable_Handle_Access; type Executable_Array_Access is access Executable_Array_Type; type Executable_Holder_Type is tagged record List : Executable_Array_Access; Count : Cursor_Type; Kind : kv.avm.Control.Status_Type; end record; procedure Add (Self : in out Executable_Holder_Type; This : in Executable_Handle_Access); end kv.avm.Executable_Lists;
35.616279
118
0.732942
4bebb65228a464fa7b8a44a2b3e2e837f6a8a972
3,949
adb
Ada
tools-src/gnu/gcc/gcc/ada/s-imgllu.adb
modern-tomato/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
80
2015-01-02T10:14:04.000Z
2021-06-07T06:29:49.000Z
tools-src/gnu/gcc/gcc/ada/s-imgllu.adb
modern-tomato/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
9
2015-05-14T11:03:12.000Z
2018-01-04T07:12:58.000Z
tools-src/gnu/gcc/gcc/ada/s-imgllu.adb
modern-tomato/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
69
2015-01-02T10:45:56.000Z
2021-09-06T07:52:13.000Z
------------------------------------------------------------------------------ -- -- -- GNAT RUNTIME COMPONENTS -- -- -- -- S Y S T E M . I M G _ L L U -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992,1993,1994 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with System.Unsigned_Types; use System.Unsigned_Types; package body System.Img_LLU is ------------------------------ -- Image_Long_Long_Unsigned -- ------------------------------ function Image_Long_Long_Unsigned (V : Long_Long_Unsigned) return String is P : Natural; S : String (1 .. Long_Long_Unsigned'Width); begin P := 1; S (P) := ' '; Set_Image_Long_Long_Unsigned (V, S, P); return S (1 .. P); end Image_Long_Long_Unsigned; ----------------------- -- Set_Image_Long_Long_Unsigned -- ----------------------- procedure Set_Image_Long_Long_Unsigned (V : Long_Long_Unsigned; S : out String; P : in out Natural) is procedure Set_Digits (T : Long_Long_Unsigned); -- Set digits of absolute value of T procedure Set_Digits (T : Long_Long_Unsigned) is begin if T >= 10 then Set_Digits (T / 10); P := P + 1; S (P) := Character'Val (48 + (T rem 10)); else P := P + 1; S (P) := Character'Val (48 + T); end if; end Set_Digits; -- Start of processing for Set_Image_Long_Long_Unsigned begin Set_Digits (V); end Set_Image_Long_Long_Unsigned; end System.Img_LLU;
43.395604
78
0.439099
4bb3b078804e22da1f049ff188172af4fcf79195
6,896
ads
Ada
bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/s-regexp.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/s-regexp.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/s-regexp.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . R E G E X P -- -- -- -- S p e c -- -- -- -- Copyright (C) 1998-2021, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Simple Regular expression matching -- This package provides a simple implementation of a regular expression -- pattern matching algorithm, using a subset of the syntax of regular -- expressions copied from familiar Unix style utilities. -- Note: this package is in the System hierarchy so that it can be directly -- be used by other predefined packages. User access to this package is via -- a renaming of this package in GNAT.Regexp (file g-regexp.ads). with Ada.Finalization; package System.Regexp is -- The regular expression must first be compiled, using the Compile -- function, which creates a finite state matching table, allowing -- very fast matching once the expression has been compiled. -- The following is the form of a regular expression, expressed in Ada -- reference manual style BNF is as follows -- regexp ::= term -- regexp ::= term | term -- alternation (term or term ...) -- term ::= item -- term ::= item item ... -- concatenation (item then item) -- item ::= elmt -- match elmt -- item ::= elmt * -- zero or more elmt's -- item ::= elmt + -- one or more elmt's -- item ::= elmt ? -- matches elmt or nothing -- elmt ::= nchr -- matches given character -- elmt ::= [nchr nchr ...] -- matches any character listed -- elmt ::= [^ nchr nchr ...] -- matches any character not listed -- elmt ::= [char - char] -- matches chars in given range -- elmt ::= . -- matches any single character -- elmt ::= ( regexp ) -- parens used for grouping -- char ::= any character, including special characters -- nchr ::= any character except \()[].*+?^ or \char to match char -- ... is used to indication repetition (one or more terms) -- See also regexp(1) man page on Unix systems for further details -- A second kind of regular expressions is provided. This one is more -- like the wildcard patterns used in file names by the Unix shell (or -- DOS prompt) command lines. The grammar is the following: -- regexp ::= term -- term ::= elmt -- term ::= seq -- term ::= {seq, seq, ...} -- alternation (matches any of seq) -- seq ::= elmt elmt ... -- concatenation (sequence of elmts) -- elmt ::= * -- any string of 0 or more characters -- elmt ::= ? -- matches any character -- elmt ::= char -- elmt ::= [^ char char ...] -- matches any character not listed -- elmt ::= [char char ...] -- matches any character listed -- elmt ::= [char - char] -- matches any character in given range -- \char is also supported by this grammar. -- Important note : This package was mainly intended to match regular -- expressions against file names. The whole string has to match the -- regular expression. If only a substring matches, then the function -- Match will return False. type Regexp is private; -- Private type used to represent a regular expression Error_In_Regexp : exception; -- Exception raised when an error is found in the regular expression function Compile (Pattern : String; Glob : Boolean := False; Case_Sensitive : Boolean := True) return Regexp; -- Compiles a regular expression S. If the syntax of the given -- expression is invalid (does not match above grammar), Error_In_Regexp -- is raised. If Glob is True, the pattern is considered as a 'globbing -- pattern', that is a pattern as given by the second grammar above. -- As a special case, if Pattern is the empty string it will always -- match. function Match (S : String; R : Regexp) return Boolean; -- True if S matches R, otherwise False. Raises Constraint_Error if -- R is an uninitialized regular expression value. private type Regexp_Value; type Regexp_Access is access Regexp_Value; type Regexp is new Ada.Finalization.Controlled with record R : Regexp_Access := null; end record; pragma Finalize_Storage_Only (Regexp); procedure Finalize (R : in out Regexp); -- Free the memory occupied by R procedure Adjust (R : in out Regexp); -- Called after an assignment (do a copy of the Regexp_Access.all) end System.Regexp;
47.888889
78
0.503045
9a7bc02ef5a9efcafdff34a33bfbe3e43f23f2a4
2,260
adb
Ada
src/asf-security.adb
jquorning/ada-asf
ddc697c5dfa4e22c57c6958f4cff27e14d02ce98
[ "Apache-2.0" ]
12
2015-01-18T23:02:20.000Z
2022-03-25T15:30:30.000Z
src/asf-security.adb
jquorning/ada-asf
ddc697c5dfa4e22c57c6958f4cff27e14d02ce98
[ "Apache-2.0" ]
3
2021-01-06T09:44:02.000Z
2022-02-04T20:20:53.000Z
src/asf-security.adb
jquorning/ada-asf
ddc697c5dfa4e22c57c6958f4cff27e14d02ce98
[ "Apache-2.0" ]
4
2016-04-12T05:29:00.000Z
2022-01-24T23:53:59.000Z
----------------------------------------------------------------------- -- asf-security -- ASF Security -- Copyright (C) 2012 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Beans.Objects; with Security.Contexts; use Security; package body ASF.Security is function Has_Permission (Value : in Util.Beans.Objects.Object) return Util.Beans.Objects.Object; -- ------------------------------ -- EL function to check if the given permission name is granted by the current -- security context. -- ------------------------------ function Has_Permission (Value : in Util.Beans.Objects.Object) return Util.Beans.Objects.Object is Name : constant String := Util.Beans.Objects.To_String (Value); begin if Contexts.Has_Permission (Name) then return Util.Beans.Objects.To_Object (True); else return Util.Beans.Objects.To_Object (False); end if; end Has_Permission; -- ------------------------------ -- Register a set of functions in the namespace -- xmlns:fn="http://code.google.com/p/ada-asf/auth" -- Functions: -- hasPermission(NAME) -- Returns True if the permission NAME is granted -- ------------------------------ procedure Set_Functions (Mapper : in out EL.Functions.Function_Mapper'Class) is begin Mapper.Set_Function (Name => HAS_PERMISSION_FN, Namespace => AUTH_NAMESPACE_URI, Func => Has_Permission'Access); end Set_Functions; end ASF.Security;
41.851852
82
0.589823
4bdfbd69d8209631d2f869225bd49fbf534e20f4
2,061
ads
Ada
opengl-vertex.ads
io7m/coreland-opengl-ada
31760853a42fcba1e37513e0521548592817c7f2
[ "0BSD" ]
1
2017-10-07T05:53:51.000Z
2017-10-07T05:53:51.000Z
opengl-vertex.ads
io7m/coreland-opengl-ada
31760853a42fcba1e37513e0521548592817c7f2
[ "0BSD" ]
null
null
null
opengl-vertex.ads
io7m/coreland-opengl-ada
31760853a42fcba1e37513e0521548592817c7f2
[ "0BSD" ]
null
null
null
with OpenGL.Thin; with OpenGL.Types; package OpenGL.Vertex is type Primitive_Type_t is (Points, Line_Strip, Line_Loop, Lines, Triangle_Strip, Triangle_Fan, Triangles, Quad_Strip, Quads, Polygon); -- -- Immediate mode. Begin/End. -- -- proc_map : glBegin procedure GL_Begin (Mode : in Primitive_Type_t); -- proc_map : glEnd procedure GL_End renames Thin.GL_End; -- proc_map : glVertex4f procedure Vertex_4f (X : in Types.Float_t; Y : in Types.Float_t; Z : in Types.Float_t; W : in Types.Float_t) renames Thin.Vertex_4f; -- proc_map : glVertex3f procedure Vertex_3f (X : in Types.Float_t; Y : in Types.Float_t; Z : in Types.Float_t) renames Thin.Vertex_3f; -- proc_map : glVertex2f procedure Vertex_2f (X : in Types.Float_t; Y : in Types.Float_t) renames Thin.Vertex_2f; -- proc_map : glVertex4d procedure Vertex_4d (X : in Types.Double_t; Y : in Types.Double_t; Z : in Types.Double_t; W : in Types.Double_t) renames Thin.Vertex_4d; -- proc_map : glVertex3d procedure Vertex_3d (X : in Types.Double_t; Y : in Types.Double_t; Z : in Types.Double_t) renames Thin.Vertex_3d; -- proc_map : glVertex2d procedure Vertex_2d (X : in Types.Double_t; Y : in Types.Double_t) renames Thin.Vertex_2d; -- proc_map : glVertex4i procedure Vertex_4i (X : in Types.Integer_t; Y : in Types.Integer_t; Z : in Types.Integer_t; W : in Types.Integer_t) renames Thin.Vertex_4i; -- proc_map : glVertex3i procedure Vertex_3i (X : in Types.Integer_t; Y : in Types.Integer_t; Z : in Types.Integer_t) renames Thin.Vertex_3i; -- proc_map : glVertex2i procedure Vertex_2i (X : in Types.Integer_t; Y : in Types.Integer_t) renames Thin.Vertex_2i; -- -- Map primitive types to enumerations. -- function Primitive_Type_To_Constant (Mode : in Primitive_Type_t) return Thin.Enumeration_t; end OpenGL.Vertex;
20.818182
59
0.65017
4b084d93397d1fb8239d7c4e660aed6150b88914
63,137
ads
Ada
source/asis/asis-expressions.ads
faelys/gela-asis
48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253
[ "BSD-3-Clause" ]
4
2016-02-05T15:51:56.000Z
2022-03-25T20:38:32.000Z
source/asis/asis-expressions.ads
faelys/gela-asis
48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253
[ "BSD-3-Clause" ]
null
null
null
source/asis/asis-expressions.ads
faelys/gela-asis
48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- 17 package Asis.Expressions ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- package Asis.Expressions is -- pragma Preelaborate; ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- Asis.Expressions encapsulates a set of queries that operate on -- An_Expression and An_Association elements. ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- 17.1 function Corresponding_Expression_Type ------------------------------------------------------------------------------- function Corresponding_Expression_Type (Expression : in Asis.Expression) return Asis.Declaration; ------------------------------------------------------------------------------- -- Expression - Specifies the expression to query -- -- Returns the type declaration for the type or subtype of the expression. -- This query does not "unwind" subtypes or derived types to get to the -- Corresponding_First_Subtype or Corresponding_Parent_Subtype declarations. -- For example, for the following program text: -- -- type Int is range -5_000 .. 5_000; -- type My_Int is new Int; -- type Good_Int is new My_Int; -- Var: Good_Int; -- -- The type declaration for Good_Int should be returned. The "unwinding" -- should not occur. The type declaration for either My_Int or Int should -- not be returned. -- -- Returns a Nil_Element if the argument Expression does not represent an Ada -- expression having an Ada type, including the following classes: -- -- - Naming expressions that name packages, subprograms, tasks, etc. These -- expressions do have a Corresponding_Name_Definition and a -- Corresponding_Name_Declaration. Although task objects do have -- a type, this query is limited, on purpose. Thus, when a naming -- expression is given to this query (for packages, subprograms, -- tasks, etc.), this query will return Nil_Element. As the -- Application Note below indicates, if any further information -- is needed, the element should be queried by -- Corresponding_Name_Definition or Corresponding_Name_Declaration, -- which should eventually return an A_Task_Type_Declaration element. -- -- - When An_Identifier Element representing an attribute designator is -- passed as the actual to this query. -- -- - The Actual_Parameter Expression from A_Pragma_Argument_Association for -- a Pragma may or may not have a Corresponding_Expression_Type. -- -- - An_Attribute_Reference Element also may or may not have a -- Corresponding_Expression_Type; -- -- - An enumeration_aggregate which is a part of -- enumeration_representation_clause. -- -- - A_Box_Expression returned by Component_Expression applied to an -- unnormalized record association. -- -- AASIS Note: This is necessary as the <> of an unnnormalized record -- association may represent several components of different types. If the -- record association is normalized, it has a single component and the type -- of A_Box_Expression is that of the component. Similarly, the type of -- A_Box_Expression for an array association is that of the component type. -- -- Returns a Nil_Element, if the statically determinable type of Expression -- is a class-wide type, or the Expression corresponds to an inner -- sub-aggregate in multi-dimensional array aggregates. -- -- |AN Application Note: -- |AN -- |AN If the returned declaration is Nil, an application should make its own -- |AN analysis based on Corresponding_Name_Definition or -- |AN Corresponding_Name_Declaration to get more information about the -- |AN argument, including the static type resolution for class-wide -- |AN expressions, if needed. Use Enclosing_Element to determine if -- |AN Expression is from pragma argument association. If for such an -- |AN expression, Corresponding_Name_Definition raises ASIS_Failed (with a -- |AN Status of Value_Error), this An_Expression element does not represent -- |AN a normal Ada expression at all and does not follow normal Ada semantic -- |AN rules. -- |AN For example, "pragma Private_Part (Open => Yes);", the "Yes" expression -- |AN may simply be a "keyword" that is specially recognized by the -- |AN implementor's compilation system and may not refer to any -- |AN declared object. -- -- Appropriate Element_Kinds: -- An_Expression -- -- Returns Element_Kinds: -- Not_An_Element -- A_Declaration -- -- |ER An_Integer_Literal - 2.4 - No child elements -- |ER A_Real_Literal - 2.4 - No child elements -- |ER A_String_Literal - 2.6 - No child elements -- |ER -- |ER A string image returned by: -- |ER function Value_Image -- ------------------------------------------------------------------------------- -- 17.2 function Value_Image ------------------------------------------------------------------------------- function Value_Image (Expression : in Asis.Expression) return Wide_String; ------------------------------------------------------------------------------- -- Expression - Specifies the expression to query -- -- Returns the string image of the value of the string, integer, or real -- literal. -- -- For string literals, Value will return the quotes around the string -- literal, these quotes are doubled, just as any quote appearing embedded in -- the string literal in the program text. -- -- The form of numbers returned by this query may vary between implementors. -- Implementors are encouraged, but not required, to return numeric literals -- using the same based or exponent form used in the original compilation -- text. -- -- Appropriate Expression_Kinds: -- An_Integer_Literal -- A_Real_Literal -- A_String_Literal -- ------------------------------------------------------------------------------- -- |ER An_Identifier - 4.1 - No child elements -- |ER An_Operator_Symbol - 4.1 - No child elements -- |ER A_Character_Literal - 4.1 - No child elements -- |ER An_Enumeration_Literal - 4.1 - No child elements -- |ER -- |ER A string image returned by: -- |ER function Name_Image -- |ER -- |ER Semantic elements returned by: -- |ER function Corresponding_Name_Definition -- |ER function Corresponding_Name_Definition_List -- |ER function Corresponding_Name_Declaration -- ------------------------------------------------------------------------------- -- 17.3 function Name_Image ------------------------------------------------------------------------------- function Name_Image (Expression : in Asis.Expression) return Program_Text; ------------------------------------------------------------------------------- -- Name - Specifies the name to query -- -- Returns the program text image of the name. -- -- An_Operator_Symbol elements have names with embedded quotes """abs""" -- (function "abs"). -- -- A_Character_Literal elements have names with embedded apostrophes "'x'" -- (literal 'x'). -- -- An_Enumeration_Literal and An_Identifier elements have identifier names -- "Blue" (literal Blue) "Abc" (identifier Abc). -- -- Note: Implicit subtypes that can be encountered while traversing the -- semantic information embedded in implicit inherited subprogram declarations -- (Reference Manual 3.4 (17-22)) could have names that are unique in a -- particular scope. This is because these subtypes are Is_Part_Of_Implicit -- declarations that do not form part of the physical text of the original -- compilation units. Some applications may wish to carefully separate the -- names of declarations from the names of Is_Part_Of_Implicit declaration -- when creating symbol tables and other name-specific lookup mechanisms. -- -- The case of names returned by this query may vary between implementors. -- Implementors are encouraged, but not required, to return names in the -- same case as was used in the original compilation text. -- -- Appropriate Expression_Kinds: -- An_Identifier -- An_Operator_Symbol -- A_Character_Literal -- An_Enumeration_Literal -- ------------------------------------------------------------------------------- -- 17.4 function References ------------------------------------------------------------------------------- function References (Name : in Asis.Element; Within_Element : in Asis.Element; Implicitly : in Boolean := False) return Asis.Name_List; ------------------------------------------------------------------------------- -- Name - Specifies the entity to query -- Within_Element - Specifies the limits for the query which is limited -- to the Element and its children. -- -- If the Implicitly argument is True: -- Returns all usage references of the given entity made by both explicit -- and implicit elements within the given limits. -- -- If the Implicitly argument is False: -- Returns all usage references of the given entity made only by explicit -- elements within the given limits. -- -- Returned references are in their order of appearance. -- -- Appropriate Element_Kinds: -- A_Defining_Name -- Returns Element_Kinds: -- An_Expression -- -- May raise ASIS_Failed with a Status of Obsolete_Reference_Error if the -- argument is part of an inconsistent compilation unit. -- ------------------------------------------------------------------------------- -- 17.5 function Is_Referenced ------------------------------------------------------------------------------- function Is_Referenced (Name : in Asis.Element; Within_Element : in Asis.Element; Implicitly : in Boolean := False) return Boolean; ------------------------------------------------------------------------------- -- Name - Specifies the entity to query -- Within_Element - Specifies the limits for the query which is limited -- to the Element and its children. -- -- If the Implicitly argument is True: -- Returns True if the Name is referenced by either implicit or explicit -- elements within the given limits. -- -- If the Implicitly argument is False: -- Returns True only if the Name is referenced by explicit elements. -- -- Returns False for any unexpected Element. -- -- Expected Element_Kinds: -- A_Defining_Name -- -- May raise ASIS_Failed with a Status of Obsolete_Reference_Error if the -- argument is part of an inconsistent compilation unit. -- ------------------------------------------------------------------------------- -- 17.6 function Corresponding_Name_Definition ------------------------------------------------------------------------------- function Corresponding_Name_Definition (Reference : in Asis.Expression) return Asis.Defining_Name; ------------------------------------------------------------------------------- -- Reference - Specifies an expression to query -- -- Returns the defining_identifier, defining_character_literal, -- defining_operator_symbol, or defining_program_unit_name from the -- declaration of the referenced entity. -- -- - Record component references return the defining name of the -- record discriminant or component_declaration. For references to inherited -- declarations of derived types, the Corresponding_Name_Definition returns -- the defining name of the implicit inherited declaration. -- -- - References to implicit operators and inherited subprograms will return -- an Is_Part_Of_Implicit defining name for the operation. The -- Enclosing_Element of the name is an implicit declaration for the -- operation. The Enclosing_Element of the declaration is the associated -- derived_type_definition. -- -- - References to formal parameters given in calls to inherited subprograms -- will return an Is_Part_Of_Implicit defining name for the -- Parameter_Specification from the inherited subprogram specification. -- -- - References to visible components of instantiated generic packages will -- return a name from the expanded generic specification instance. -- -- - References, within expanded generic instances, that refer to other -- components of the same, or an enclosing, expanded generic instance, -- return a name from the appropriate expanded specification or body -- instance. -- -- In case of renaming, the function returns the new name for the entity. -- -- Returns a Nil_Element if the reference is to an implicitly declared -- element for which the implementation does not provide declarations and -- defining name elements. -- -- Returns a Nil_Element if the argument is a dispatching call. -- -- The Enclosing_Element of a non-Nil result is either a Declaration or a -- Statement. -- -- Appropriate Expression_Kinds: -- An_Identifier -- An_Operator_Symbol -- A_Character_Literal -- An_Enumeration_Literal -- -- Returns Element_Kinds: -- Not_An_Element -- A_Defining_Name -- -- |IP Implementation Permissions: -- |IP -- |IP An implementation may choose to return any part of multi-part -- |IP declarations and definitions. Multi-part declaration/definitions -- |IP can occur for: -- |IP -- |IP - Subprogram specification in package specification, package body, -- |IP and subunits (is separate); -- |IP -- |IP - Entries in package specification, package body, and subunits (is -- |IP separate); -- |IP -- |IP - Private type and full type declarations; -- |IP -- |IP - Incomplete type and full type declarations; and -- |IP -- |IP - Deferred constant and full constant declarations. -- |IP -- |IP No guarantee is made that the element will be the first part or -- |IP that the determination will be made due to any visibility rules. -- |IP An application should make its own analysis for each case based -- |IP on which part is returned. -- |IP -- |IP Some implementations do not represent all forms of implicit -- |IP declarations such that elements representing them can be easily -- |IP provided. An implementation can choose whether or not to construct -- |IP and provide artificial declarations for implicitly declared elements. -- -- |IR Implementation Requirements: -- |IR -- |IR Raises ASIS_Inappropriate_Element, with a Status of Value_Error, if -- |IR passed a reference that does not have a declaration: -- |IR -- |IR - a reference to an attribute_designator. Attributes are defined, but -- |IR have no implicit or explicit declarations; -- |IR -- |IR - an identifier which syntactically is placed before "=>" in a -- |IR pragma_argument_association which has the form of a named -- |IR association; such an identifier can never have a declaration; -- |IR -- |IR - an identifier specific to a pragma (Reference Manual, 2.8(10)); -- |IR -- |IR pragma Should_I_Check ( Really => Yes ); -- |IR -- |IR In this example, both the names Really and Yes have no declaration. -- |IR -- |IR Raises ASIS_Inappropriate_Element, with a Status of Value_Error, if -- |IR passed a portion of a pragma that was "ignored" by the compiler and -- |IR which does not have (sufficient) semantic information for a proper -- |IR return result to be computed. For example, -- |IR -- |IR pragma I_Am_Ignored (Foof); -- |IR -- |IR The "Foof" expression is An_Identifier but raises this exception -- |IR if passed to Corresponding_Name_Definition if the pragma was ignored -- |IR or unprocessed. -- |IR -- |IR Raises ASIS_Inappropriate_Element, with a Status of Value_Error, if -- |IR passed a portion of a pragma that is an ambiguous reference to more -- |IR than one entity. For example, -- |IR -- |IR pragma Inline ("+"); -- Inlines all "+" operators -- |IR -- |IR The "+" expression is An_Operator_Symbol but raises this -- |IR exception if it referenced more than one "+" operator. In this -- |IR case, the Corresponding_Name_Definition_List query can be used to -- |IR obtain a list of referenced entities. -- ------------------------------------------------------------------------------- -- 17.7 function Corresponding_Name_Definition_List ------------------------------------------------------------------------------- function Corresponding_Name_Definition_List (Reference : in Asis.Element) return Asis.Defining_Name_List; ------------------------------------------------------------------------------- -- Reference - Specifies an entity reference to query -- -- Exactly like Corresponding_Name_Definition except it returns a list. -- The list will almost always have a length of one. The exception to this -- is the case where an expression in a pragma is ambiguous and reference -- more than one entity. For example, -- -- pragma Inline ("+"); -- Inlines all "+" operators -- -- The "+" expression is An_Operator_Symbol but could reference more than one -- "+" operator. In this case, the resulting list includes all referenced -- entities. -- -- Appropriate Expression_Kinds: -- An_Identifier -- An_Operator_Symbol -- A_Character_Literal -- An_Enumeration_Literal -- -- Returns Element_Kinds: -- A_Defining_Name -- ------------------------------------------------------------------------------- -- 17.8 function Corresponding_Name_Declaration ------------------------------------------------------------------------------- function Corresponding_Name_Declaration (Reference : in Asis.Expression) return Asis.Element; ------------------------------------------------------------------------------- -- Reference - Specifies the entity reference to query -- -- Returns the declaration that declared the entity named by the given -- reference. The result is exactly the same as: -- -- Result := Corresponding_Name_Definition (Reference); -- if not Is_Nil (Result) then -- Result := Enclosing_Element (Result); -- end if; -- return Result; -- -- See the comments for Corresponding_Name_Definition for details. -- The result is either a Declaration or a Statement. Statements result -- from references to statement labels, loop identifiers, and block -- identifiers. -- -- Appropriate Element_Kinds: -- An_Expression -- -- Appropriate Expression_Kinds: -- An_Identifier -- An_Operator_Symbol -- A_Character_Literal -- An_Enumeration_Literal -- -- Returns Element_Kinds: -- A_Declaration -- A_Statement -- -- Predefined types, exceptions, operators in package Standard can be -- checked by testing that the enclosing Compilation_Unit is standard. -- -- |ER------------------------------------------------------------------------ -- |ER An_Explicit_Dereference - 4.1 -- |CR -- |CR Child elements returned by: function Prefix -- ------------------------------------------------------------------------------- -- 17.9 function Prefix ------------------------------------------------------------------------------- function Prefix (Expression : in Asis.Expression) return Asis.Expression; ------------------------------------------------------------------------------- -- Expression - Specifies the name expression to query -- -- Returns the prefix (the construct to the left of: the rightmost unnested -- left parenthesis in function_call elements and indexed_component elements -- or slice elements, the rightmost 'dot' for selected_component elements, -- or the rightmost tick for attribute_reference elements). -- -- Returns the operator_symbol for infix operator function calls. The infix -- form A + B is equivalent to the prefix form "+"(A, B). -- -- Appropriate Expression_Kinds: -- An_Explicit_Dereference P.ALL -- An_Attribute_Reference Priv'Base'First -- A_Function_Call Abc(...) or Integer'Image(...) -- An_Indexed_Component An_Array(3) -- A_Selected_Component A.B.C -- A_Slice An_Array(3 .. 5) -- -- Returns Expression_Kinds: -- An_Expression -- -- |ER------------------------------------------------------------------------ -- |ER An_Indexed_Component - 4.1.1 -- |ER -- |CR -- |CR Child elements returned by: -- |CR function Prefix -- |CR function Index_Expressions -- |CR -- ------------------------------------------------------------------------------- -- 17.10 function Index_Expressions ------------------------------------------------------------------------------- function Index_Expressions (Expression : in Asis.Expression) return Asis.Expression_List; ------------------------------------------------------------------------------- -- Expression - Specifies an indexed_component to query -- -- Returns the list of expressions (possibly only one) within the parenthesis, -- in their order of appearance. -- -- Appropriate Expression_Kinds: -- An_Indexed_Component -- -- Returns Element_Kinds: -- An_Expression -- -- |ER------------------------------------------------------------------------ -- |ER A_Slice - 4.1.2 -- |CR -- |CR Child elements returned by: -- |CR function Prefix -- |CR function Slice_Range -- |CR -- ------------------------------------------------------------------------------- -- 17.11 function Slice_Range ------------------------------------------------------------------------------- function Slice_Range (Expression : in Asis.Expression) return Asis.Discrete_Range; ------------------------------------------------------------------------------- -- Expression - Specifies the slice to query -- -- Returns the discrete range of the slice. -- -- Appropriate Expression_Kinds: -- A_Slice -- -- Returns Definition_Kinds: -- A_Discrete_Range -- ------------------------------------------------------------------------------- -- 17.12 function Selector ------------------------------------------------------------------------------- function Selector (Expression : in Asis.Expression) return Asis.Expression; ------------------------------------------------------------------------------- -- Expression - Specifies the selected_component to query -- -- Returns the selector (the construct to the right of the rightmost 'dot' in -- the selected_component). -- -- Appropriate Expression_Kinds: -- A_Selected_Component -- -- Returns Expression_Kinds: -- An_Identifier -- An_Operator_Symbol -- A_Character_Literal -- An_Enumeration_Literal -- ------------------------------------------------------------------------------- -- 17.13 function Attribute_Designator_Identifier ------------------------------------------------------------------------------- function Attribute_Designator_Identifier (Expression : in Asis.Expression) return Asis.Expression; ------------------------------------------------------------------------------- -- Expression - Specifies an attribute_reference expression to query -- -- Returns the identifier of the attribute_designator (the construct to the -- right of the rightmost tick of the attribute_reference). The Prefix of -- the attribute_reference can itself be an attribute_reference as in -- T'BASE'FIRST where the prefix is T'BASE and the attribute_designator name -- is FIRST. -- -- Attribute_designator reserved words "access", "delta", and "digits" are -- treated as An_Identifier. -- -- Appropriate Expression_Kinds: -- An_Attribute_Reference -- -- Returns Expression_Kinds: -- An_Identifier -- ------------------------------------------------------------------------------- -- 17.14 function Attribute_Designator_Expressions ------------------------------------------------------------------------------- function Attribute_Designator_Expressions (Expression : in Asis.Expression) return Asis.Expression_List; ------------------------------------------------------------------------------- -- Expression - Specifies an attribute expression to query -- -- Returns the static expressions associated with the optional argument of -- the attribute_designator. Expected predefined attributes are A'First(N), -- A'Last(N), A'Length(N), and A'Range(N). -- -- Returns a Nil_Element_List if there are no arguments. -- -- Appropriate Expression_Kinds: -- An_Attribute_Reference -- Appropriate Attribute_Kinds: -- A_First_Attribute -- A_Last_Attribute -- A_Length_Attribute -- A_Range_Attribute -- An_Implementation_Defined_Attribute -- An_Unknown_Attribute -- -- Returns Element_Kinds: -- An_Expression -- -- |IP Implementation Permissions: -- |IP -- |IP This query returns a list to support implementation-defined attributes -- |IP that may have more than one static_expression. -- ------------------------------------------------------------------------------- -- 17.15 function Record_Component_Associations ------------------------------------------------------------------------------- function Record_Component_Associations (Expression : in Asis.Expression; Normalized : in Boolean := False) return Asis.Association_List; ------------------------------------------------------------------------------- -- Expression - Specifies an aggregate expression to query -- Normalized - Specifies whether the normalized form is desired -- -- Returns a list of the record_component_association elements of a -- record_aggregate or an extension_aggregate. -- -- Returns a Nil_Element_List if the aggregate is of the form (null record). -- -- An unnormalized list contains all needed associations ordered as they -- appear in the program text. Each unnormalized association has an optional -- list of discriminant_selector_name elements, and an explicit expression. -- -- A normalized list contains artificial associations representing all -- needed components in an order matching the declaration order of the -- needed components. -- -- Each normalized association represents a one on one mapping of a -- component to the explicit expression. A normalized association has one -- A_Defining_Name component that denotes the discriminant_specification or -- component_declaration, and one An_Expression component that is the -- expression. -- -- Appropriate Expression_Kinds: -- A_Record_Aggregate -- An_Extension_Aggregate -- -- Returns Association_Kinds: -- A_Record_Component_Association -- -- |IR Implementation Requirements: -- |IR -- |IR Normalized associations are Is_Normalized and Is_Part_Of_Implicit. -- |IR Normalized associations are never Is_Equal to unnormalized -- |IR associations. -- -- |IP Implementation Permissions: -- |IP -- |IP An implementation may choose to normalize its internal representation -- |IP to use the defining_identifier element instead of the -- |IP component_selector_name element. -- |IP -- |IP If so, this query will return Is_Normalized associations even if -- |IP Normalized is False, and the query -- |IP Record_Component_Associations_Normalized will return True. -- ------------------------------------------------------------------------------- -- 17.16 function Extension_Aggregate_Expression ------------------------------------------------------------------------------- function Extension_Aggregate_Expression (Expression : in Asis.Expression) return Asis.Expression; ------------------------------------------------------------------------------- -- Expression - Specifies an extension_aggregate expression to query -- -- Returns the ancestor_part expression preceding the reserved word with in -- the extension_aggregate. -- -- Appropriate Expression_Kinds: -- An_Extension_Aggregate -- -- Returns Element_Kinds: -- An_Expression -- ------------------------------------------------------------------------------- -- 17.17 function Array_Component_Associations ------------------------------------------------------------------------------- function Array_Component_Associations (Expression : in Asis.Expression) return Asis.Association_List; ------------------------------------------------------------------------------- -- Expression - Specifies an array aggregate expression to query -- -- Returns a list of the Array_Component_Associations in an array aggregate. -- -- Appropriate Expression_Kinds: -- A_Positional_Array_Aggregate -- A_Named_Array_Aggregate -- -- Returns Association_Kinds: -- An_Array_Component_Association -- -- |AN Application Note: -- |AN -- |AN While positional_array_aggregate elements do not have -- |AN array_component_association elements defined by Ada syntax, ASIS treats -- |AN A_Positional_Array_Aggregate as if it were A_Named_Array_Aggregate. -- |AN The An_Array_Component_Association elements returned will have -- |AN Array_Component_Choices that are a Nil_Element_List for all positional -- |AN expressions except an others choice. -- ------------------------------------------------------------------------------- -- 17.18 function Array_Component_Choices ------------------------------------------------------------------------------- function Array_Component_Choices (Association : in Asis.Association) return Asis.Expression_List; ------------------------------------------------------------------------------- -- Association - Specifies the component association to query -- -- If the Association is from a named_array_aggregate: -- -- - Returns the discrete_choice_list order of appearance. The choices are -- either An_Expression or A_Discrete_Range elements, or a single -- An_Others_Choice element. -- -- If the Association is from a positional_array_aggregate: -- -- - Returns a single An_Others_Choice if the association is an others -- choice (others => expression). -- -- - Returns a Nil_Element_List otherwise. -- -- Appropriate Association_Kinds: -- An_Array_Component_Association -- -- Returns Element_Kinds: -- A_Definition -- An_Expression -- -- Returns Definition_Kinds: -- A_Discrete_Range -- An_Others_Choice -- ------------------------------------------------------------------------------- -- 17.19 function Record_Component_Choices ------------------------------------------------------------------------------- function Record_Component_Choices (Association : in Asis.Association) return Asis.Expression_List; ------------------------------------------------------------------------------- -- Association - Specifies the component association to query -- -- If the Association argument is from an unnormalized list: -- -- - If the Association is a named component association: -- -- o Returns the component_choice_list order of appearance. The choices are -- either An_Identifier elements representing component_selector_name -- elements, or a single An_Others_Choice element. -- -- o The Enclosing_Element of the choices is the Association argument. -- -- - If the Association is a positional component association: -- -- o Returns a Nil_Element_List. -- -- If the Association argument is from a Normalized list: -- -- - Returns a list containing a single choice: -- -- o A_Defining_Name element representing the defining_identifier of -- the component_declaration. -- -- o The Enclosing_Element of the A_Defining_Name is the -- component_declaration. -- -- Normalized lists contain artificial ASIS An_Association elements that -- provide one formal A_Defining_Name => An_Expression pair per -- association. These artificial associations are Is_Normalized. Their -- component A_Defining_Name is not Is_Normalized. -- -- Appropriate Association_Kinds: -- A_Record_Component_Association -- -- Returns Element_Kinds: -- A_Defining_Name -- Is_Normalized(Association) -- An_Expression -- not Is_Normalized(Association) -- Returns Expression_Kinds: -- An_Identifier -- A_Definition -- Returns Definition_Kinds: -- An_Others_Choice -- ------------------------------------------------------------------------------- -- 17.20 function Component_Expression ------------------------------------------------------------------------------- function Component_Expression (Association : in Asis.Association) return Asis.Expression; ------------------------------------------------------------------------------- -- Association - Specifies the component association to query -- -- Returns the expression of the record_component_association or -- array_component_association. -- -- The Enclosing_Element of the expression is the Association argument. -- -- Normalized lists contain artificial ASIS An_Association elements that -- provide one formal A_Defining_Name => An_Expression pair per -- association. These artificial associations are Is_Normalized. Their -- component An_Expression elements are not Is_Normalized. -- -- For An_Array_Component_Association and non-normalized -- A_Record_Component_Association where the association contains a -- box expression, Asis.Expressions.Component_Expression -- returns A_Box_Expression. -- -- For a normalized A_Record_Component_Association, where the association -- contains a a box expression, if the corresponding record type that -- contains this component contains a default expression, -- Asis.Expressions.Component_Expression returns this default -- expression, otherwise Asis.Expressions.Component_Expression -- returns A_Box_Expression. -- -- Appropriate Association_Kinds: -- A_Record_Component_Association -- An_Array_Component_Association -- A_Box_Expression -- -- Returns Element_Kinds: -- An_Expression -- ------------------------------------------------------------------------------- -- 17.21 function Formal_Parameter ------------------------------------------------------------------------------- function Formal_Parameter (Association : in Asis.Association) return Asis.Element; ------------------------------------------------------------------------------- -- Association - Specifies the association to query -- -- If the Association argument is from an unnormalized list: -- -- - If the Association is given in named notation: -- -- Returns An_Identifier representing the formal_parameter_selector_name, -- generic_formal_parameter_selector_name, or pragma_argument_identifier. -- -- The Enclosing_Element of the An_Identifier element is the Association -- argument. -- -- - If the Association is given in positional notation: -- -- Returns a Nil_Element. -- -- - May return An_Others_Choice for A_Generic_Association argument -- -- If the Association argument is from a Normalized list: -- -- - Returns A_Defining_Name representing the defining_identifier of the -- parameter_specification or generic_formal_parameter_declaration. -- Pragma_argument_association elements are not available in normalized -- form. -- -- - The Enclosing_Element of the A_Defining_Name is the -- parameter_specification or generic_formal_parameter_declaration element. -- -- Normalized lists contain artificial ASIS An_Association elements that -- provide one formal A_Defining_Name => An_Expression pair per -- association. These artificial associations are Is_Normalized. Their -- component A_Defining_Name elements are not Is_Normalized. -- -- Appropriate Association_Kinds: -- A_Parameter_Association -- A_Generic_Association -- A_Pragma_Argument_Association -- -- Returns Element_Kinds: -- Not_An_Element -- An_Operator_Symbol -- A_Defining_Name -- Is_Normalized(Association) -- An_Expression -- not Is_Normalized(Association) -- Returns Expression_Kinds: -- An_Identifier -- Definition_Kinds -- Added by Gela for SI99-0014-1 -- Returns Definition_Kinds: -- An_Others_Choice -- ------------------------------------------------------------------------------- -- 17.22 function Actual_Parameter ------------------------------------------------------------------------------- function Actual_Parameter (Association : in Asis.Association) return Asis.Expression; ------------------------------------------------------------------------------- -- Association - Specifies the association to query -- -- If the Association argument is from an unnormalized list: -- -- - Returns An_Expression representing: -- -- o the explicit_actual_parameter of a parameter_association. -- -- o the explicit_generic_actual_parameter of a generic_association. -- -- o the name or expression of a pragma_argument_association. -- -- - The Enclosing_Element of An_Expression is the Association argument. -- -- If the Association argument is from a Normalized list: -- -- - If the Association is given explicitly: -- -- o Returns An_Expression representing: -- -- + the explicit_actual_parameter of a parameter_association. -- -- + the explicit_generic_actual_parameter of a generic_association. -- -- o The Enclosing_Element of An_Expression is the Association argument. -- -- - If the Association is given by default: -- -- o Returns An_Expression representing: -- -- + the corresponding default_expression of the Is_Normalized -- A_Parameter_Association. -- -- + the corresponding default_expression or default_name of the -- Is_Normalized A_Generic_Association. -- -- o The Enclosing_Element of the An_Expression element is the -- parameter_specification or generic_formal_parameter_declaration that -- contains the default_expression or default_name, except for the case -- when this An_Expression element is an implicit naming expression -- representing the actual subprogram selected at the place of the -- instantiation for A_Box_Default. In the latter case, the -- Enclosing_Element for such An_Expression is the instantiation. -- -- o Normalized lists contain artificial ASIS An_Association elements that -- provide one formal A_Defining_Name => An_Expression pair per -- association. These artificial associations are Is_Normalized. -- Artificial associations of default associations are -- Is_Defaulted_Association. Their component An_Expression elements are -- not Is_Normalized and are not Is_Defaulted_Association. -- -- If the argument is A_Pragma_Argument_Association, then this function may -- return any expression to support implementation-defined pragmas. -- -- Appropriate Association_Kinds: -- A_Parameter_Association -- A_Generic_Association -- A_Pragma_Argument_Association -- -- Returns Element_Kinds: -- An_Expression -- ------------------------------------------------------------------------------- -- 17.23 function Discriminant_Selector_Names ------------------------------------------------------------------------------- function Discriminant_Selector_Names (Association : in Asis.Discriminant_Association) return Asis.Expression_List; ------------------------------------------------------------------------------- -- Association - Specifies the discriminant association to query -- -- If the Association argument is from an unnormalized list: -- -- - If the Association is a named discriminant_association: -- -- o Returns a list of the An_Identifier discriminant_selector_name elements -- in order of appearance. -- -- o The Enclosing_Element of the names is the Association argument. -- -- - If the Association is a positional discriminant_association: -- -- o Returns a Nil_Element_List. -- -- If the Association argument is from a Normalized list: -- -- - Returns a list containing a single A_Defining_Name element representing -- the defining_identifier of the discriminant_specification. -- -- - The Enclosing_Element of the A_Defining_Name is the -- discriminant_specification. -- -- - Normalized lists contain artificial ASIS An_Association elements that -- provide one formal A_Defining_Name => An_Expression pair per -- association. These artificial associations are Is_Normalized. Their -- component A_Defining_Name elements are not Is_Normalized. -- -- Appropriate Association_Kinds: -- A_Discriminant_Association -- -- Returns Element_Kinds: -- A_Defining_Name -- Is_Normalized(Association) -- An_Expression -- not Is_Normalized(Association) -- Returns Expression_Kinds: -- An_Identifier -- ------------------------------------------------------------------------------- -- 17.24 function Discriminant_Expression ------------------------------------------------------------------------------- function Discriminant_Expression (Association : in Asis.Discriminant_Association) return Asis.Expression; ------------------------------------------------------------------------------- -- Association - Specifies the discriminant_association to query -- -- If the Association argument is from an unnormalized list: -- -- - Returns An_Expression representing the expression of the -- discriminant_association. -- -- - The Enclosing_Element of An_Expression is the Association argument. -- -- If the Association argument is from a Normalized list: -- -- - If the Association is given explicitly: -- -- o Returns An_Expression representing the expression of the -- discriminant_association. -- -- o The Enclosing_Element of An_Expression is the Association argument. -- -- - If the Association is given by default: -- -- o Returns An_Expression representing: -- -- + the corresponding default_expression of the Is_Normalized -- A_Discriminant_Association. -- -- o The Enclosing_Element of the An_Expression element is the -- discriminant_specification that contains the default_expression. -- -- - Normalized lists contain artificial ASIS An_Association elements that -- provide one formal A_Defining_Name => An_Expression pair per -- association. These artificial associations are Is_Normalized. -- Artificial associations of default associations are -- Is_Defaulted_Association. Their component An_Expression elements are -- not Is_Normalized and are not Is_Defaulted_Association. -- -- Appropriate Association_Kinds: -- A_Discriminant_Association -- -- Returns Element_Kinds: -- An_Expression -- ------------------------------------------------------------------------------- -- 17.25 function Is_Normalized ------------------------------------------------------------------------------- function Is_Normalized (Association : in Asis.Association) return Boolean; ------------------------------------------------------------------------------- -- Association - Specifies the association to query -- -- Returns True if the association is a normalized, artificially created -- association returned by the queries Discriminant_Associations, -- Generic_Actual_Part, Call_Statement_Parameters, -- Record_Component_Associations, or Function_Call_Parameters where -- Normalized => True (or the operation returns Is_Normalized associations -- even if Normalized => False). See the Implementation Permissions for -- these queries. -- -- Returns False for any unexpected Element. -- -- Expected Association_Kinds: -- A_Discriminant_Association -- A_Record_Component_Association -- A_Parameter_Association -- A_Generic_Association -- ------------------------------------------------------------------------------- -- 17.26 function Is_Defaulted_Association ------------------------------------------------------------------------------- function Is_Defaulted_Association (Association : in Asis.Association) return Boolean; ------------------------------------------------------------------------------- -- Association - Specifies the association to query -- -- Returns True if the association is a normalized, artificially created -- association returned by the queries Discriminant_Associations, -- Generic_Actual_Part, Record_Component_Associations, -- Call_Statement_Parameters, or Function_Call_Parameters where -- Normalized => True (or the operation returns default associations even if -- Normalized => False) and the association contains a default expression. -- A default expression is one that is implicitly supplied by the language -- semantics and that was not explicitly supplied (typed) by the user. -- -- Returns False for any unexpected Element. -- -- Expected Association_Kinds: -- A_Parameter_Association -- A_Generic_Association -- -- |AN Application Note: -- |AN -- |AN Always returns False for discriminant associations. Defaulted -- |AN discriminant associations occur only when the discriminant constraint -- |AN is completely missing from a subtype indication. Consequently, it is -- |AN not possible to obtain a (normalized) discriminant constraint list for -- |AN such subtype indications. Always returns False for component -- |AN associations. Aggregates cannot have defaulted components. -- ------------------------------------------------------------------------------- -- 17.27 function Expression_Parenthesized ------------------------------------------------------------------------------- function Expression_Parenthesized (Expression : in Asis.Expression) return Asis.Expression; ------------------------------------------------------------------------------- -- Expression - Specifies the parenthesized expression to query -- -- Returns the expression within the parenthesis. This operation unwinds -- only one set of parenthesis at a time, so the result may itself be -- A_Parenthesized_Expression. -- -- A_Parenthesized_Expression kind corresponds only to the (expression) -- alternative in the syntax notion of primary in Reference Manual 4.4. For -- example, an expression of a type_conversion is A_Parenthesized_Expression -- only if it is similar to the form subtype_mark((expression)) where it has -- at least one set of its own parenthesis. -- -- Appropriate Expression_Kinds: -- A_Parenthesized_Expression -- -- Returns Element_Kinds: -- An_Expression -- ------------------------------------------------------------------------------- -- 17.28 function Is_Prefix_Call ------------------------------------------------------------------------------- function Is_Prefix_Call (Expression : in Asis.Expression) return Boolean; ------------------------------------------------------------------------------- -- Expression - Specifies the function call expression to query -- -- Returns True if the function call is in prefix form. -- -- Returns False for any unexpected Element. -- -- For example, -- -- Foo (A, B); -- Returns TRUE -- "<" (A, B); -- Returns TRUE -- ... A < B ... -- Returns FALSE -- -- Expected Expression_Kinds: -- A_Function_Call -- ------------------------------------------------------------------------------- -- 17.29 function Corresponding_Called_Function ------------------------------------------------------------------------------- function Corresponding_Called_Function (Expression : in Asis.Expression) return Asis.Declaration; ------------------------------------------------------------------------------- -- Expression - Specifies the function_call to query -- -- Returns the declaration of the called function. -- -- Returns a Nil_Element if the: -- -- - function_prefix denotes a predefined operator for which the -- implementation does not provide an artificial function declaration, -- -- - prefix of the call denotes an access to a function implicit or explicit -- dereference, -- -- - argument is a dispatching call. -- -- If function_prefix denotes an attribute_reference, and if the corresponding -- attribute is (re)defined by an attribute definition clause, an -- implementation is encouraged, but not required, to return the definition -- of the corresponding subprogram whose name is used after "use" in this -- attribute definition clause. If an implementation cannot return such a -- subprogram definition, a Nil_Element should be returned. For an attribute -- reference which is not (re)defined by an attribute definition clause, -- a Nil_Element should be returned. -- -- Appropriate Expression_Kinds: -- A_Function_Call -- -- Returns Declaration_Kinds: -- Not_A_Declaration -- A_Function_Declaration -- A_Function_Body_Declaration -- A_Function_Body_Stub -- A_Function_Renaming_Declaration -- A_Function_Instantiation -- A_Formal_Function_Declaration -- A_Generic_Function_Declaration -- -- |IP Implementation Permissions: -- |IP -- |IP An implementation may choose to return any part of multi-part -- |IP declarations and definitions. Multi-part declaration/definitions can -- |IP occur for: -- |IP -- |IP - Subprogram specification in package specification, package body, -- |IP and subunits (is separate); -- |IP - Entries in package specification, package body, and subunits -- |IP (is separate); -- |IP - Private type and full type declarations; -- |IP - Incomplete type and full type declarations; and -- |IP - Deferred constant and full constant declarations. -- |IP -- |IP No guarantee is made that the element will be the first part or -- |IP that the determination will be made due to any visibility rules. -- |IP An application should make its own analysis for each case based -- |IP on which part is returned. -- |IP -- |IP An implementation can choose whether or not to construct and provide -- |IP artificial implicit declarations for predefined operators. -- ------------------------------------------------------------------------------- -- 17.30 function Function_Call_Parameters ------------------------------------------------------------------------------- function Function_Call_Parameters (Expression : in Asis.Expression; Normalized : in Boolean := False) return Asis.Association_List; ------------------------------------------------------------------------------- -- Expression - Specifies the function call expression to query -- Normalized - Specifies whether the normalized form is desired -- -- Returns a list of parameter_association elements of the call. -- -- Returns a Nil_Element_List if there are no parameter_association elements. -- -- An unnormalized list contains only explicit associations ordered as they -- appear in the program text. Each unnormalized association has an optional -- formal_parameter_selector_name and an explicit_actual_parameter component. -- -- A normalized list contains artificial associations representing all -- explicit and default associations. It has a length equal to the number of -- parameter_specification elements of the formal_part of the -- parameter_and_result_profile. The order of normalized associations matches -- the order of parameter_specification elements. -- -- Each normalized association represents a one on one mapping of a -- parameter_specification elements to the explicit or default expression. -- A normalized association has one A_Defining_Name component that denotes -- the parameter_specification, and one An_Expression component that is -- either the explicit_actual_parameter or a default_expression. -- -- If the prefix of the call denotes an access to a function implicit or -- explicit deference, normalized associations are constructed on the basis -- of the formal_part of the parameter_and_result_profile from the -- corresponding access_to_subprogram definition. -- Returns Nil_Element for normalized associations in the case where -- the called function can be determined only dynamically (dispatching -- calls). ASIS cannot produce any meaningful result in this case. -- The exception ASIS_Inappropriate_Element is raised when the function -- call is an attribute reference and Is_Normalized is True. -- -- Appropriate Expression_Kinds: -- A_Function_Call -- -- Returns Element_Kinds: -- A_Parameter_Association -- -- |IR Implementation Requirements: -- |IR -- |IR Normalized associations are Is_Normalized and Is_Part_Of_Implicit. -- |IR Normalized associations provided by default are -- |IR Is_Defaulted_Association. -- |IR Normalized associations are never Is_Equal to unnormalized -- |IR associations. -- -- |IP Implementation Permissions: -- |IP -- |IP An implementation may choose to always include default parameters in -- |IP its internal representation. -- |IP -- |IP An implementation may also choose to normalize its representation -- |IP to use defining_identifier elements rather than -- |IP formal_parameter_selector_name elements. -- |IP -- |IP In either case, this query will return Is_Normalized associations even -- |IP if Normalized is False, and the query -- |IP Function_Call_Parameters_Normalized will return True. -- ------------------------------------------------------------------------------- -- 17.31 function Short_Circuit_Operation_Left_Expression ------------------------------------------------------------------------------- function Short_Circuit_Operation_Left_Expression (Expression : in Asis.Expression) return Asis.Expression; ------------------------------------------------------------------------------- -- Expression - Specifies the short circuit operation to query -- -- Returns the expression preceding the reserved words "and then" or -- "or else" in the short circuit expression. -- -- Appropriate Expression_Kinds: -- An_And_Then_Short_Circuit -- An_Or_Else_Short_Circuit -- -- Returns Element_Kinds: -- An_Expression -- ------------------------------------------------------------------------------- -- 17.32 function Short_Circuit_Operation_Right_Expression ------------------------------------------------------------------------------- function Short_Circuit_Operation_Right_Expression (Expression : in Asis.Expression) return Asis.Expression; ------------------------------------------------------------------------------- -- Expression - Specifies the short circuit operation to query -- -- Returns the expression following the reserved words "or else" or -- "and then" in the short circuit expression. -- -- Appropriate Expression_Kinds: -- An_And_Then_Short_Circuit -- An_Or_Else_Short_Circuit -- -- Returns Element_Kinds: -- An_Expression -- ------------------------------------------------------------------------------- -- 17.33 function Membership_Test_Expression ------------------------------------------------------------------------------- function Membership_Test_Expression (Expression : in Asis.Expression) return Asis.Expression; ------------------------------------------------------------------------------- -- Expression - Specifies the membership test operation to query -- -- Returns the expression on the left hand side of the membership test. -- -- Appropriate Expression_Kinds: -- An_In_Range_Membership_Test -- A_Not_In_Range_Membership_Test -- An_In_Type_Membership_Test -- A_Not_In_Type_Membership_Test -- -- Returns Element_Kinds: -- An_Expression -- ------------------------------------------------------------------------------- -- 17.34 function Membership_Test_Range ------------------------------------------------------------------------------- function Membership_Test_Range (Expression : in Asis.Expression) return Asis.Range_Constraint; ------------------------------------------------------------------------------- -- Expression - Specifies the membership test operation to query -- -- Returns the range following the reserved words "in" or "not in" from the -- membership test. -- -- Appropriate Expression_Kinds: -- An_In_Range_Membership_Test -- A_Not_In_Range_Membership_Test -- -- Returns Constraint_Kinds: -- A_Range_Attribute_Reference -- A_Simple_Expression_Range -- ------------------------------------------------------------------------------- -- 17.35 function Membership_Test_Subtype_Mark ------------------------------------------------------------------------------- function Membership_Test_Subtype_Mark (Expression : in Asis.Expression) return Asis.Expression; ------------------------------------------------------------------------------- -- Expression - Specifies the membership test operation to query -- -- Returns the subtype_mark expression following the reserved words "in" or -- "not in" from the membership test. -- -- Appropriate Expression_Kinds: -- An_In_Type_Membership_Test -- A_Not_In_Type_Membership_Test -- -- Returns Expression_Kinds: -- An_Identifier -- A_Selected_Component -- An_Attribute_Reference -- ------------------------------------------------------------------------------- -- 17.36 function Converted_Or_Qualified_Subtype_Mark ------------------------------------------------------------------------------- function Converted_Or_Qualified_Subtype_Mark (Expression : in Asis.Expression) return Asis.Expression; ------------------------------------------------------------------------------- -- Expression - Specifies the type conversion or qualified expression to -- query. -- -- Returns the subtype_mark expression that converts or qualifies the -- expression. -- -- Appropriate Expression_Kinds: -- A_Type_Conversion -- A_Qualified_Expression -- -- Returns Expression_Kinds: -- An_Identifier -- A_Selected_Component -- An_Attribute_Reference -- ------------------------------------------------------------------------------- -- 17.37 function Converted_Or_Qualified_Expression ------------------------------------------------------------------------------- function Converted_Or_Qualified_Expression (Expression : in Asis.Expression) return Asis.Expression; ------------------------------------------------------------------------------- -- Expression - Specifies the type conversion or qualified expression to -- query -- -- Returns the expression being converted or qualified. -- -- Appropriate Expression_Kinds: -- A_Type_Conversion -- A_Qualified_Expression -- -- Returns Element_Kinds: -- An_Expression -- ------------------------------------------------------------------------------- -- 17.38 function Allocator_Subtype_Indication ------------------------------------------------------------------------------- function Allocator_Subtype_Indication (Expression : in Asis.Expression) return Asis.Subtype_Indication; ------------------------------------------------------------------------------- -- Expression - Specifies the allocator expression to query -- -- Returns the subtype indication for the object being allocated. -- -- Appropriate Expression_Kinds: -- An_Allocation_From_Subtype -- -- Returns Definition_Kinds: -- A_Subtype_Indication -- ------------------------------------------------------------------------------- -- 17.39 function Allocator_Qualified_Expression ------------------------------------------------------------------------------- function Allocator_Qualified_Expression (Expression : in Asis.Expression) return Asis.Expression; ------------------------------------------------------------------------------- -- Expression - Specifies the allocator expression to query -- -- Returns the qualified expression for the object being allocated. -- -- Appropriate Expression_Kinds: -- An_Allocation_From_Qualified_Expression -- -- Returns Expression_Kinds: -- A_Qualified_Expression -- ------------------------------------------------------------------------------- end Asis.Expressions; ------------------------------------------------------------------------------ -- Copyright (c) 2006-2013, Maxim Reznik -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * Neither the name of the Maxim Reznik, IE nor the names of its -- contributors may be used to endorse or promote products derived from -- this software without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------
40.733548
79
0.603228
4b44f89afb5d8b50068c37e9bf924cbb0031a781
6,629
adb
Ada
source/league/league-holders-generic_integers.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/league/league-holders-generic_integers.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/league/league-holders-generic_integers.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
4
2017-07-18T07:11:05.000Z
2020-06-21T03:02:25.000Z
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2009-2011, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ package body League.Holders.Generic_Integers is ----------------- -- Constructor -- ----------------- overriding function Constructor (Is_Empty : not null access Boolean) return Integer_Container is pragma Assert (Is_Empty.all); begin return (Counter => <>, Is_Empty => Is_Empty.all, Value => <>); end Constructor; ------------- -- Element -- ------------- function Element (Self : Holder) return Num is begin if Self.Data.all not in Integer_Container and Self.Data.all not in Universal_Integer_Container then raise Constraint_Error with "invalid type of value"; end if; if Self.Data.Is_Empty then raise Constraint_Error with "value is empty"; end if; if Self.Data.all in Universal_Integer_Container then return Num (Universal_Integer_Container'Class (Self.Data.all).Value); else return Integer_Container'Class (Self.Data.all).Value; end if; end Element; ----------- -- First -- ----------- overriding function First (Self : not null access constant Integer_Container) return Universal_Integer is pragma Unreferenced (Self); begin return Universal_Integer (Num'First); end First; --------- -- Get -- --------- overriding function Get (Self : not null access constant Integer_Container) return Universal_Integer is begin return Universal_Integer (Self.Value); end Get; ---------- -- Last -- ---------- overriding function Last (Self : not null access constant Integer_Container) return Universal_Integer is pragma Unreferenced (Self); begin return Universal_Integer (Num'Last); end Last; --------------------- -- Replace_Element -- --------------------- procedure Replace_Element (Self : in out Holder; To : Num) is begin if Self.Data.all not in Integer_Container and Self.Data.all not in Universal_Integer_Container then raise Constraint_Error with "invalid type of value"; end if; -- XXX This subprogram can be improved to reuse shared segment when -- possible. if Self.Data.all in Universal_Integer_Container then Dereference (Self.Data); Self.Data := new Universal_Integer_Container' (Counter => <>, Is_Empty => False, Value => Universal_Integer (To)); else Dereference (Self.Data); Self.Data := new Integer_Container' (Counter => <>, Is_Empty => False, Value => To); end if; end Replace_Element; --------- -- Set -- --------- overriding procedure Set (Self : not null access Integer_Container; To : Universal_Integer) is begin Self.Is_Empty := False; Self.Value := Num (To); end Set; --------------- -- To_Holder -- --------------- function To_Holder (Item : Num) return Holder is begin return (Ada.Finalization.Controlled with new Integer_Container' (Counter => <>, Is_Empty => False, Value => Item)); end To_Holder; end League.Holders.Generic_Integers;
36.624309
78
0.485443
040f74d3410b0c92038358361bce0c3f46c0318f
1,625
ads
Ada
tier-1/xcb/source/thin/xcb-xcb_lookup_color_request_t.ads
charlie5/cBound
741be08197a61ad9c72553e3302f3b669902216d
[ "0BSD" ]
2
2015-11-12T11:16:20.000Z
2021-08-24T22:32:04.000Z
tier-1/xcb/source/thin/xcb-xcb_lookup_color_request_t.ads
charlie5/cBound
741be08197a61ad9c72553e3302f3b669902216d
[ "0BSD" ]
1
2018-06-05T05:19:35.000Z
2021-11-20T01:13:23.000Z
tier-1/xcb/source/thin/xcb-xcb_lookup_color_request_t.ads
charlie5/cBound
741be08197a61ad9c72553e3302f3b669902216d
[ "0BSD" ]
null
null
null
-- This file is generated by SWIG. Please do not modify by hand. -- with Interfaces; with swig; with Interfaces.C; with Interfaces.C.Pointers; package xcb.xcb_lookup_color_request_t is -- Item -- type Item is record major_opcode : aliased Interfaces.Unsigned_8; pad0 : aliased Interfaces.Unsigned_8; length : aliased Interfaces.Unsigned_16; cmap : aliased xcb.xcb_colormap_t; name_len : aliased Interfaces.Unsigned_16; pad1 : aliased swig.int8_t_Array (0 .. 1); end record; -- Item_Array -- type Item_Array is array (Interfaces.C.size_t range <>) of aliased xcb.xcb_lookup_color_request_t .Item; -- Pointer -- package C_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_lookup_color_request_t.Item, Element_Array => xcb.xcb_lookup_color_request_t.Item_Array, Default_Terminator => (others => <>)); subtype Pointer is C_Pointers.Pointer; -- Pointer_Array -- type Pointer_Array is array (Interfaces.C.size_t range <>) of aliased xcb.xcb_lookup_color_request_t .Pointer; -- Pointer_Pointer -- package C_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_lookup_color_request_t.Pointer, Element_Array => xcb.xcb_lookup_color_request_t.Pointer_Array, Default_Terminator => null); subtype Pointer_Pointer is C_Pointer_Pointers.Pointer; end xcb.xcb_lookup_color_request_t;
28.508772
79
0.662769
2979b1d1c331a917af8dc99ec548448c29ff6335
3,393
ads
Ada
tools/scitools/conf/understand/ada/ada05/s-thread.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
1
2020-01-20T21:26:46.000Z
2020-01-20T21:26:46.000Z
tools/scitools/conf/understand/ada/ada05/s-thread.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
tools/scitools/conf/understand/ada/ada05/s-thread.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . T H R E A D S -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- -- -- -- -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides facilities to register a thread to the runtime, -- and allocate its task specific datas. -- This package is currently implemented for: -- VxWorks AE653 rts-cert -- VxWorks AE653 rts-full (not rts-kernel) with Ada.Exceptions; -- used for Exception_Occurrence with System.Soft_Links; -- used for TSD with Unchecked_Conversion; package System.Threads is type ATSD is limited private; -- Type of the Ada thread specific data. It contains datas needed -- by the GNAT runtime. type ATSD_Access is access ATSD; function From_Address is new Unchecked_Conversion (Address, ATSD_Access); -------------------------- -- Thread Body Handling -- -------------------------- -- The subprograms in this section are called from the process body -- wrapper in the APEX process registration package. procedure Thread_Body_Enter (Sec_Stack_Address : System.Address; Sec_Stack_Size : Natural; Process_ATSD_Address : System.Address); -- Enter thread body, see above for details procedure Thread_Body_Leave; -- Leave thread body (normally), see above for details procedure Thread_Body_Exceptional_Exit (EO : Ada.Exceptions.Exception_Occurrence); -- Leave thread body (abnormally on exception), see above for details private type ATSD is new System.Soft_Links.TSD; end System.Threads;
40.879518
78
0.501916
4bafc5810b8b6f8017f7c463b38147951ec8b8c8
33,130
adb
Ada
2-low/collada/source/collada-document.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
20
2015-11-04T09:23:59.000Z
2022-01-14T10:21:42.000Z
2-low/collada/source/collada-document.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
2
2015-11-04T17:05:56.000Z
2015-12-08T03:16:13.000Z
2-low/collada/source/collada-document.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
1
2015-12-07T12:53:52.000Z
2015-12-07T12:53:52.000Z
with collada.Library.geometries, collada.Library.controllers, collada.Library.animations, collada.Library.visual_scenes, XML, ada.Calendar.formatting, ada.Strings.fixed, ada.Characters.latin_1; package body collada.Document is use ada.Strings.unbounded; ------------ -- Utilities -- function "+" (From : in String) return unbounded_String renames to_unbounded_String; function to_Time (From : in String) return ada.Calendar.Time is Pad : String := From; Index : constant Natural := ada.Strings.fixed.Index (Pad, "T"); begin if Index /= 0 then Pad (Index) := ' '; end if; return ada.Calendar.formatting.Value (Pad); exception when constraint_Error => return ada.Calendar.Clock; -- TODO: Temporary debug measure to handle unknown date formats. end to_Time; function to_int_Array (From : in String) return int_Array is use ada.Strings.fixed; the_Array : int_Array (1 .. 40_000); Count : math.Index := 0; Start : Natural := 1; Cursor : Natural := Index (From, " "); begin if Cursor = 0 then return (1 => Integer'Value (From)); end if; loop if From (Start .. Cursor-1) /= "" and then From (Start .. Cursor-1) /= "" & ada.Characters.latin_1.LF then Count := Count + 1; the_Array (Count) := Integer'Value (From (Start .. Cursor-1)); end if; Start := Cursor + 1; Cursor := Index (From, " ", Start); exit when Cursor = 0; end loop; if Start <= From'Last then Count := Count + 1; the_Array (Count) := Integer'Value (From (Start .. From'Last)); end if; return the_Array (1 .. Count); end to_int_Array; function to_float_Array (From : in String) return float_Array is begin if From = "" then return float_Array' (1 .. 0 => <>); end if; declare use ada.Strings.fixed; the_Array : float_Array (1 .. 40_000); Count : math.Index := 0; Start : Integer := 1; Cursor : Integer := Index (From, " "); begin if Cursor = 0 then return (1 => math.Real'Value (From)); end if; loop if From (Start .. Cursor-1) /= "" and then From (Start .. Cursor-1) /= "" & ada.Characters.latin_1.LF then Count := Count + 1; the_Array (Count) := math.Real'Value (From (Start .. Cursor-1)); end if; Start := Cursor + 1; Cursor := Index (From, " ", Start); exit when Cursor = 0; end loop; if From (Start .. From'Last) /= "" then Count := Count + 1; the_Array (Count) := math.Real'Value (From (Start .. From'Last)); end if; return the_Array (1 .. Count); end; end to_float_Array; function to_Text_array (From : in String) return Text_array is begin if From = "" then return Text_array' (1 .. 0 => <>); end if; declare use ada.Strings.fixed; the_Array : Text_array (1 .. 40_000); Count : math.Index := 0; Start : Integer := 1; Cursor : Integer := Index (From, " "); begin if Cursor = 0 then return (1 => +From); end if; loop if From (Start .. Cursor-1) /= "" and then From (Start .. Cursor-1) /= "" & ada.Characters.latin_1.LF then Count := Count + 1; the_Array (Count) := +From (Start .. Cursor-1); end if; Start := Cursor + 1; Cursor := Index (From, " ", Start); exit when Cursor = 0; end loop; if From (Start .. From'Last) /= "" then Count := Count + 1; the_Array (Count) := +From (Start .. From'Last); end if; return the_Array (1 .. Count); end; end to_Text_array; function to_Matrix (From : in String) return Matrix_4x4 is the_Floats : constant math.Vector_16 := math.Vector_16 (to_float_Array (From)); begin return math.to_Matrix_4x4 (the_Floats); end to_Matrix; function to_Source (From : in xml.Element) return collada.Library.Source is the_xml_Id : constant access xml.Attribute_t := From.Attribute ("id"); the_xml_float_Array : constant access xml.Element := From.Child ("float_array"); the_xml_text_Array : constant access xml.Element := From.Child ("Name_array"); the_array_Length : Natural; the_Source : Library.source; begin the_Source.Id := +the_xml_Id.Value; if the_xml_float_Array /= null then the_Source.array_Id := +the_xml_float_Array.Attribute ("id").Value; the_array_Length := Natural'Value (the_xml_float_Array.Attribute ("count").Value); the_Source.Floats := new float_Array' (to_float_Array (the_xml_float_Array.Data)); elsif the_xml_text_Array /= null then the_Source.array_Id := +the_xml_text_Array.Attribute ("id").Value; the_array_Length := Natural'Value (the_xml_text_Array.Attribute ("count").Value); the_Source.Texts := new Text_array' (to_Text_array (the_xml_text_Array.Data)); end if; return the_Source; end to_Source; function to_Input (From : in xml.Element) return collada.Library.Input_t is use collada.Library; the_xml_Semantic : constant access xml.Attribute_t := From.Attribute ("semantic"); the_xml_Source : constant access xml.Attribute_t := From.Attribute ("source"); the_xml_Offset : constant access xml.Attribute_t := From.Attribute ("offset"); the_Input : Input_t; begin the_Input.Semantic := Semantic'Value (the_xml_Semantic.Value); the_Input.Source := +the_xml_Source .Value; if the_xml_Offset /= null then the_Input.Offset := Natural'Value (the_xml_Offset.Value); end if; return the_Input; end to_Input; function to_Vertices (From : in xml.Element) return collada.Library.geometries.Vertices is use collada.Library, collada.Library.geometries; the_xml_Id : constant access xml.Attribute_t := From.Attribute ("id"); the_xml_Inputs : constant xml.Elements := From.Children ("input"); the_Vertices : geometries.Vertices; begin the_Vertices.Id := +the_xml_Id.Value; the_Vertices.Inputs := new Inputs (the_xml_Inputs'Range); for i in the_xml_Inputs'Range loop the_Vertices.Inputs (i) := to_Input (the_xml_Inputs (i).all); end loop; return the_Vertices; end to_Vertices; function to_Polylist (From : in xml.Element) return collada.Library.geometries.Primitive is use collada.Library, collada.Library.geometries; the_xml_Count : constant access xml.Attribute_t := From.Attribute ("count"); the_xml_Material : constant access xml.Attribute_t := From.Attribute ("material"); the_xml_Inputs : constant xml.Elements := From.Children ("input"); the_xml_vCount : constant access xml.Element := From.Child ("vcount"); the_xml_P : constant access xml.Element := From.Child ("p"); the_Polylist : geometries.Primitive (polyList); begin the_Polylist.Count := Natural'Value (the_xml_Count.Value); if the_xml_Material /= null then the_Polylist.Material := +the_xml_Material.Value; end if; the_Polylist.Inputs := new Inputs (the_xml_Inputs'Range); for i in the_xml_Inputs'Range loop the_Polylist.Inputs (i) := to_Input (the_xml_Inputs (i).all); end loop; the_Polylist.vCount := new int_Array' (to_int_Array (the_xml_vCount.Data)); the_Polylist.P_List := new int_array_List' (1 => new int_Array' (to_int_Array (the_xml_P.Data))); return the_Polylist; end to_Polylist; function to_Polygon (From : in xml.Element) return collada.Library.geometries.Primitive is use collada.Library, collada.Library.geometries; the_xml_Count : constant access xml.Attribute_t := From.Attribute ("count"); the_xml_Material : constant access xml.Attribute_t := From.Attribute ("material"); the_xml_Inputs : constant xml.Elements := From.Children ("input"); the_xml_Ps : constant xml.Elements := From.Children ("p"); the_Polygons : geometries.Primitive (Polygons); begin the_Polygons.Count := Natural'Value (the_xml_Count.Value); if the_xml_Material /= null then the_Polygons.Material := +the_xml_Material.Value; end if; -- Do inputs. -- the_Polygons.Inputs := new Inputs (the_xml_Inputs'Range); for i in the_xml_Inputs'Range loop the_Polygons.Inputs (i) := to_Input (the_xml_Inputs (i).all); end loop; -- Do P list. -- the_Polygons.P_List := new int_array_List (1 .. the_xml_Ps'Length); for i in the_Polygons.P_List'Range loop the_Polygons.P_List (i) := new int_Array' (to_int_Array (the_xml_Ps (i).Data)); end loop; return the_Polygons; end to_Polygon; function to_Joints (From : in xml.Element) return collada.Library.controllers.Joints is use collada.Library, collada.Library.controllers; the_xml_Inputs : constant xml.Elements := From.Children ("input"); the_Joints : controllers.Joints; begin the_Joints.Inputs := new Inputs (the_xml_Inputs'Range); for i in the_xml_Inputs'Range loop the_Joints.Inputs (i) := to_Input (the_xml_Inputs (i).all); end loop; return the_Joints; end to_Joints; function to_vertex_Weights (From : in xml.Element) return collada.Library.controllers.vertex_Weights is use collada.Library, collada.Library.controllers; the_xml_Count : constant access xml.Attribute_t := From.Attribute ("count"); the_xml_Inputs : constant xml.Elements := From.Children ("input"); the_xml_vCount : constant access xml.Element := From.Child ("vcount"); the_xml_V : constant access xml.Element := From.Child ("v"); the_Weights : controllers.vertex_Weights; begin the_Weights.Count := Natural'Value (the_xml_Count.Value); the_Weights.Inputs := new Inputs (the_xml_Inputs'Range); for i in the_xml_Inputs'Range loop the_Weights.Inputs (i) := to_Input (the_xml_Inputs (i).all); end loop; the_Weights.v_Count := new int_Array' (to_int_Array (the_xml_vCount.Data)); the_Weights.V := new int_array' (to_int_Array (the_xml_V.Data)); return the_Weights; end to_vertex_Weights; function to_Sampler (From : in xml.Element) return collada.Library.animations.Sampler is use collada.Library, collada.Library.animations; the_xml_Id : constant access xml.Attribute_t := From.Attribute ("id"); the_xml_Inputs : constant xml.Elements := From.Children ("input"); the_Sampler : animations.Sampler; begin the_Sampler.Id := +the_xml_Id.Value; the_Sampler.Inputs := new Inputs (the_xml_Inputs'Range); for i in the_xml_Inputs'Range loop the_Sampler.Inputs (i) := to_Input (the_xml_Inputs (i).all); end loop; return the_Sampler; end to_Sampler; function to_Channel (From : in xml.Element) return collada.Library.animations.Channel is use collada.Library, collada.Library.animations; the_xml_Source : constant access xml.Attribute_t := From.Attribute ("source"); the_xml_Target : constant access xml.Attribute_t := From.Attribute ("target"); the_Channel : animations.Channel; begin the_Channel.Source := +the_xml_Source.Value; the_Channel.Target := +the_xml_Target.Value; return the_Channel; end to_Channel; --------------- -- Construction -- function to_Document (Filename : in String) return Item is use XML; the_xml_Tree : constant xml.Element := xml.to_XML (Filename); the_collada_Tree : constant access xml.Element := the_xml_Tree.Child (named => "COLLADA"); the_Document : Document.item; begin parse_the_asset_Element: declare the_Asset : constant access xml.Element := the_collada_Tree.Child (named => "asset"); the_Contributor : constant access xml.Element := the_Asset.Child (named => "contributor"); the_creation_Date : constant access xml.Element := the_Asset.Child (named => "created"); the_modification_Date : constant access xml.Element := the_Asset.Child (named => "modified"); the_Unit : constant access xml.Element := the_Asset.Child (named => "unit"); the_up_Axis : constant access xml.Element := the_Asset.Child (named => "up_axis"); begin -- Parse the 'contributor' element. -- if the_Contributor /= null then declare the_Author : constant access xml.Element := the_Contributor .Child (named => "author"); the_authoring_Tool : constant access xml.Element := the_Contributor .Child (named => "authoring_tool"); begin if the_Author /= null then the_Document.Asset.Contributor.Author := +the_Author.Data; end if; if the_authoring_Tool /= null then the_document.asset.contributor.authoring_Tool := +the_authoring_Tool.Data; end if; end; end if; -- Parse the creation and modification dates. -- if the_creation_Date /= null then the_document.asset.Created := to_Time (the_creation_Date.Data); end if; if the_modification_Date /= null then the_document.asset.Modified := to_Time (the_modification_Date.Data); end if; -- Parse the 'unit' element. -- if the_Unit /= null then the_document.asset.Unit.Name := +the_Unit.Attribute (named => "name") .Value; the_document.asset.Unit.Meter := Float'Value (the_Unit.Attribute (named => "meter").Value); end if; -- Parse the 'up_axis' element. -- if the_up_Axis /= null then the_document.asset.up_Axis := collada.asset.up_Direction'Value (the_up_Axis.Data); end if; end parse_the_asset_Element; --------------------------------- --- Parse the 'library' elements. -- parse_the_geometries_Library: declare the_Library : constant access xml.Element := the_collada_Tree.Child (named => "library_geometries"); begin if the_Library /= null then declare use collada.Library.geometries; the_Geometries : constant xml.Elements := the_Library.Children (named => "geometry"); begin the_document.Libraries.Geometries.Contents := new Geometry_array (the_Geometries'Range); for Each in the_Geometries'Range loop declare the_xml_Geometry : access xml.Element renames the_Geometries (Each); the_Geometry : Geometry renames the_Document.Libraries.Geometries.Contents (Each); the_xml_Id : constant access xml.Attribute_t'Class := the_xml_Geometry.Attribute ("id"); the_xml_Name : constant access xml.Attribute_t'Class := the_xml_Geometry.Attribute ("name"); begin the_Geometry.Id := +the_xml_Id.Value; if the_xml_Name /= null then the_Geometry.Name := +the_xml_Name.Value; end if; parse_Mesh: declare the_xml_Mesh : access xml.Element renames the_xml_Geometry.Child ("mesh"); the_xml_Vertices : constant access xml.Element := the_xml_Mesh .Child ("vertices"); the_xml_Sources : constant xml.Elements := the_xml_Mesh.Children ("source"); begin the_Geometry.Mesh.Sources := new library.Sources (the_xml_Sources'Range); -- Parse sources. -- for i in the_xml_Sources'Range loop the_Geometry.Mesh.Sources (i) := to_Source (the_xml_Sources (i).all); end loop; -- Parse vertices. -- the_Geometry.Mesh.Vertices := to_Vertices (the_xml_Vertices.all); -- Parse primitives. -- declare the_xml_Polylists : constant xml.Elements := the_xml_Mesh.Children (named => "polylist"); the_xml_Polygons : constant xml.Elements := the_xml_Mesh.Children (named => "polygons"); primitive_Count : Natural := 0; primitive_Total : constant Natural := the_xml_Polylists'Length + the_xml_Polygons 'Length; begin the_Geometry.Mesh.Primitives := new Primitives (1 .. primitive_Total); -- polylists -- for i in the_xml_Polylists'Range loop primitive_Count := primitive_Count + 1; the_Geometry.Mesh.Primitives (primitive_Count) := to_Polylist (the_xml_Polylists (i).all); end loop; -- polygons -- for i in the_xml_Polygons'Range loop primitive_Count := primitive_Count + 1; the_Geometry.Mesh.Primitives (primitive_Count) := to_Polygon (the_xml_Polygons (i).all); end loop; end; end parse_Mesh; end; end loop; end; end if; end parse_the_geometries_Library; -- Parse the controllers library. -- declare the_Library : constant access xml.Element := the_collada_Tree.Child (named => "library_controllers"); begin if the_Library /= null then declare use collada.Library.controllers; the_Controllers : constant xml.Elements := the_Library.Children (named => "controller"); begin the_Document.Libraries.controllers.Contents := new Controller_array (the_Controllers'Range); for Each in the_Controllers'Range loop declare the_xml_Controller : access xml.Element renames the_Controllers (Each); the_Controller : Controller renames the_Document.Libraries.controllers.Contents (Each); the_xml_Id : constant access xml.Attribute_t'Class := the_xml_Controller.Attribute ("id"); the_xml_Name : constant access xml.Attribute_t'Class := the_xml_Controller.Attribute ("name"); begin the_Controller.Id := +the_xml_Id.Value; if the_xml_Name /= null then the_Controller.Name := +the_xml_Name.Value; end if; parse_Skin: declare the_xml_Skin : access xml.Element renames the_xml_Controller.Child ("skin"); the_xml_Sources : constant xml.Elements := the_xml_Skin.Children ("source"); the_xml_Matrix : constant access xml.Element := the_xml_Skin.Child ("bind_shape_matrix"); the_xml_Joints : constant access xml.Element := the_xml_Skin.Child ("joints"); the_xml_Weights : constant access xml.Element := the_xml_Skin.Child ("vertex_weights"); begin the_Controller.Skin.main_Source := +the_xml_Skin.Attribute ("source").Value; the_Controller.Skin.bind_shape_Matrix := to_float_Array (the_xml_Matrix.Data); -- Parse sources. -- the_Controller.Skin.Sources := new library.Sources (the_xml_Sources'Range); for i in the_xml_Sources'Range loop the_Controller.Skin.Sources (i) := to_Source (the_xml_Sources (i).all); end loop; the_Controller.Skin.Joints := to_Joints (the_xml_Joints.all); the_Controller.Skin.vertex_Weights := to_vertex_Weights (the_xml_Weights.all); end parse_Skin; end; end loop; end; end if; end; -- Parse the visual_Scenes library. -- declare the_Library : constant access xml.Element := the_collada_Tree.Child (named => "library_visual_scenes"); begin if the_Library /= null then declare use collada.Library.visual_scenes; the_visual_Scenes : constant xml.Elements := the_Library.Children (named => "visual_scene"); begin the_Document.Libraries.visual_Scenes.Contents := new visual_Scene_array (the_visual_Scenes'Range); for Each in the_visual_Scenes'Range loop declare the_visual_Scene : visual_Scene renames the_document.Libraries.visual_Scenes.Contents (Each); the_xml_Scene : access xml.Element renames the_visual_Scenes (Each); the_xml_Id : constant access xml.Attribute_t'Class := the_xml_Scene.Attribute ("id"); the_xml_Name : constant access xml.Attribute_t'Class := the_xml_Scene.Attribute ("name"); begin the_visual_Scene.Id := +the_xml_Id.Value; if the_xml_Name /= null then the_visual_Scene.Name := +the_xml_Name.Value; end if; parse_Nodes: declare the_xml_root_Node : constant access xml.Element := the_xml_Scene.Child ("node"); function to_Node (the_XML : access xml.Element; Parent : in Library.visual_scenes.Node_view) return Library.visual_scenes.Node_view is the_xml_Sid : constant access xml.Attribute_t'Class := the_xml.Attribute ("sid"); the_xml_Id : constant access xml.Attribute_t'Class := the_xml.Attribute ("id"); the_xml_Name : constant access xml.Attribute_t'Class := the_xml.Attribute ("name"); the_xml_Type : access xml.Attribute_t'Class := the_xml.Attribute ("type"); the_xml_Translate : access xml.Element := the_xml.Child ("translate"); the_xml_Scale : access xml.Element := the_xml.Child ("scale"); the_xml_Rotates : xml.Elements := the_xml.Children ("rotate"); the_xml_Children : xml.Elements := the_xml.Children ("node"); the_Node : constant Library.visual_scenes.Node_view := new Library.visual_scenes.Node; begin if the_xml_Id /= null then the_Node.Id_is (+the_xml_Id.Value); end if; if the_xml_Sid /= null then the_Node.Sid_is (+the_xml_Sid.Value); end if; if the_xml_Name /= null then the_Node.Name_is (+the_xml_Name.Value); end if; the_Node.Parent_is (Parent); -- Parse children. -- declare the_xml_Children : constant xml.Elements := the_XML.Children; the_Child : access xml.Element; begin for i in the_xml_Children'Range loop the_Child := the_xml_Children (i); if the_Child.Name = "translate" then the_Node.add (Transform' (Kind => Translate, Sid => to_Text (the_Child.Attribute ("sid").Value), Vector => Vector_3 (to_Float_array (the_Child.Data)))); elsif the_Child.Name = "rotate" then declare use collada.Math; the_Data : constant Vector_4 := Vector_4 (to_Float_array (the_Child.Data)); begin the_Node.add (Transform' (Kind => Rotate, Sid => to_Text (the_Child.Attribute ("sid").Value), Axis => Vector_3 (the_Data (1 .. 3)), Angle => to_Radians (math.Degrees (the_Data (4))))); end; elsif the_Child.Name = "scale" then the_Node.add (Transform' (Kind => Scale, Sid => to_Text (the_Child.Attribute ("sid").Value), Scale => Vector_3 (to_Float_array (the_Child.Data)))); elsif the_Child.Name = "matrix" then declare the_Data : constant Matrix_4x4 := to_Matrix (the_Child.Data); -- Will be column vectors. the_child_Sid : constant access xml.Attribute_t'Class := the_Child.Attribute ("sid"); the_sid_Text : Text; begin if the_child_Sid = null then the_sid_Text := to_Text (""); else the_sid_Text := to_Text (the_child_Sid.Value); end if; the_Node.add (Transform' (Kind => full_Transform, Sid => the_sid_Text, Matrix => the_Data)); end; elsif the_Child.Name = "node" then the_Node.add (the_Child => to_Node (the_Child, Parent => the_Node)); -- Recurse. elsif the_Child.Name = "instance_controller" then declare the_skeleton_Child : constant access xml.Element := the_Child.Child ("skeleton"); begin the_Document.Libraries.visual_Scenes.skeletal_Root := +the_skeleton_Child.Data (2 .. the_skeleton_Child.Data'Last); end; elsif the_Child.Name = "instance_geometry" then raise collada.Error with "TODO: Handle instance_geometry."; else raise collada.Error with "Unhandled collada 'visual scene element' found: " & the_Child.Name & "."; end if; end loop; end; return the_Node; end to_Node; begin the_visual_Scene.root_Node := to_Node (the_xml_root_Node, Parent => null); end parse_Nodes; end; end loop; end; end if; end; -- Parse the animations library. -- declare the_Library : constant access xml.Element := the_collada_Tree.Child (named => "library_animations"); begin if the_Library /= null then declare use collada.Library.animations; the_Animations : constant xml.Elements := the_Library.Children (named => "animation"); begin the_document.Libraries.animations.Contents := new Animation_array (the_Animations'Range); for Each in the_Animations'Range loop declare the_Animation : Animation renames the_document.Libraries.animations.Contents (Each); the_xml_Animation : access xml.Element renames the_Animations (Each); the_xml_Id : constant access xml.Attribute_t'Class := the_xml_Animation.Attribute ("id"); the_xml_Name : constant access xml.Attribute_t'Class := the_xml_Animation.Attribute ("name"); begin the_Animation.Id := +the_xml_Id.Value; if the_xml_Name /= null then the_Animation.Name := +the_xml_Name.Value; end if; the_Animation.Sampler := to_Sampler (the_xml_Animation.Child ("sampler").all); the_Animation.Channel := to_Channel (the_xml_Animation.Child ("channel").all); parse_Sources: declare the_xml_Sources : constant xml.Elements := the_xml_Animation.Children ("source"); begin the_Animation.Sources := new library.Sources (the_xml_Sources'Range); for i in the_xml_Sources'Range loop the_Animation.Sources (i) := to_Source (the_xml_Sources (i).all); end loop; end parse_Sources; end; end loop; end; end if; end; --- Parse the 'scene' element. -- -- TODO return the_Document; end to_Document; function Asset (Self : in Item) return collada.Asset.item is begin return Self.Asset; end Asset; function Libraries (Self : in Item) return collada.Libraries.item is begin return Self.Libraries; end Libraries; end collada.Document;
36.852058
154
0.514549
13eb87b21fbffb6c10245e51fc52885478d26a41
808
ads
Ada
tests/bases-cargo-test_data-tests.ads
thindil/steamsky
d5d7fea622f7994c91017c4cd7ba5e188153556c
[ "TCL", "MIT" ]
80
2017-04-08T23:14:07.000Z
2022-02-10T22:30:51.000Z
tests/bases-cargo-test_data-tests.ads
thindil/steamsky
d5d7fea622f7994c91017c4cd7ba5e188153556c
[ "TCL", "MIT" ]
89
2017-06-24T08:18:26.000Z
2021-11-12T04:37:36.000Z
tests/bases-cargo-test_data-tests.ads
thindil/steamsky
d5d7fea622f7994c91017c4cd7ba5e188153556c
[ "TCL", "MIT" ]
9
2018-04-14T16:37:25.000Z
2020-03-21T14:33:49.000Z
-- This package has been generated automatically by GNATtest. -- Do not edit any part of it, see GNATtest documentation for more details. -- begin read only with Gnattest_Generated; package Bases.Cargo.Test_Data.Tests is type Test is new GNATtest_Generated.GNATtest_Standard.Bases.Cargo.Test_Data .Test with null record; procedure Test_Generate_Cargo_bedd31_021eea(Gnattest_T: in out Test); -- bases-cargo.ads:29:4:Generate_Cargo:Test_GenerateCargo procedure Test_Update_Base_Cargo_0621ee_1e1787(Gnattest_T: in out Test); -- bases-cargo.ads:43:4:Update_Base_Cargo:Test_UpdateBaseCargo procedure Test_Find_Base_Cargo_7b1190_f9e132(Gnattest_T: in out Test); -- bases-cargo.ads:59:4:Find_Base_Cargo:Test_FindBaseCargo end Bases.Cargo.Test_Data.Tests; -- end read only
33.666667
78
0.787129
add99803f8de25cadb035d76dd9e36b17529e781
20,404
adb
Ada
release/src-rt-6.x.4708/router/samba-3.5.8/lib/zlib/contrib/ada/zlib.adb
ghsecuritylab/tomato-arm
a577df43e55d2a0ae3ae06ed73e02ca68d5a3903
[ "FSFAP" ]
4
2017-05-17T11:27:04.000Z
2020-05-24T07:23:26.000Z
release/src-rt-6.x.4708/router/samba-3.5.8/lib/zlib/contrib/ada/zlib.adb
ghsecuritylab/tomato-arm
a577df43e55d2a0ae3ae06ed73e02ca68d5a3903
[ "FSFAP" ]
1
2018-08-21T03:43:09.000Z
2018-08-21T03:43:09.000Z
release/src-rt-6.x.4708/router/samba-3.5.8/lib/zlib/contrib/ada/zlib.adb
ghsecuritylab/tomato-arm
a577df43e55d2a0ae3ae06ed73e02ca68d5a3903
[ "FSFAP" ]
5
2017-10-11T08:09:11.000Z
2020-10-14T04:10:13.000Z
---------------------------------------------------------------- -- ZLib for Ada thick binding. -- -- -- -- Copyright (C) 2002-2004 Dmitriy Anisimkov -- -- -- -- Open source license information is in the zlib.ads file. -- ---------------------------------------------------------------- -- $Id: zlib.adb,v 1.1.1.1 2011/06/10 09:34:40 andrew Exp $ with Ada.Exceptions; with Ada.Unchecked_Conversion; with Ada.Unchecked_Deallocation; with Interfaces.C.Strings; with ZLib.Thin; package body ZLib is use type Thin.Int; type Z_Stream is new Thin.Z_Stream; type Return_Code_Enum is (OK, STREAM_END, NEED_DICT, ERRNO, STREAM_ERROR, DATA_ERROR, MEM_ERROR, BUF_ERROR, VERSION_ERROR); type Flate_Step_Function is access function (Strm : in Thin.Z_Streamp; Flush : in Thin.Int) return Thin.Int; pragma Convention (C, Flate_Step_Function); type Flate_End_Function is access function (Ctrm : in Thin.Z_Streamp) return Thin.Int; pragma Convention (C, Flate_End_Function); type Flate_Type is record Step : Flate_Step_Function; Done : Flate_End_Function; end record; subtype Footer_Array is Stream_Element_Array (1 .. 8); Simple_GZip_Header : constant Stream_Element_Array (1 .. 10) := (16#1f#, 16#8b#, -- Magic header 16#08#, -- Z_DEFLATED 16#00#, -- Flags 16#00#, 16#00#, 16#00#, 16#00#, -- Time 16#00#, -- XFlags 16#03# -- OS code ); -- The simplest gzip header is not for informational, but just for -- gzip format compatibility. -- Note that some code below is using assumption -- Simple_GZip_Header'Last > Footer_Array'Last, so do not make -- Simple_GZip_Header'Last <= Footer_Array'Last. Return_Code : constant array (Thin.Int range <>) of Return_Code_Enum := (0 => OK, 1 => STREAM_END, 2 => NEED_DICT, -1 => ERRNO, -2 => STREAM_ERROR, -3 => DATA_ERROR, -4 => MEM_ERROR, -5 => BUF_ERROR, -6 => VERSION_ERROR); Flate : constant array (Boolean) of Flate_Type := (True => (Step => Thin.Deflate'Access, Done => Thin.DeflateEnd'Access), False => (Step => Thin.Inflate'Access, Done => Thin.InflateEnd'Access)); Flush_Finish : constant array (Boolean) of Flush_Mode := (True => Finish, False => No_Flush); procedure Raise_Error (Stream : in Z_Stream); pragma Inline (Raise_Error); procedure Raise_Error (Message : in String); pragma Inline (Raise_Error); procedure Check_Error (Stream : in Z_Stream; Code : in Thin.Int); procedure Free is new Ada.Unchecked_Deallocation (Z_Stream, Z_Stream_Access); function To_Thin_Access is new Ada.Unchecked_Conversion (Z_Stream_Access, Thin.Z_Streamp); procedure Translate_GZip (Filter : in out Filter_Type; In_Data : in Ada.Streams.Stream_Element_Array; In_Last : out Ada.Streams.Stream_Element_Offset; Out_Data : out Ada.Streams.Stream_Element_Array; Out_Last : out Ada.Streams.Stream_Element_Offset; Flush : in Flush_Mode); -- Separate translate routine for make gzip header. procedure Translate_Auto (Filter : in out Filter_Type; In_Data : in Ada.Streams.Stream_Element_Array; In_Last : out Ada.Streams.Stream_Element_Offset; Out_Data : out Ada.Streams.Stream_Element_Array; Out_Last : out Ada.Streams.Stream_Element_Offset; Flush : in Flush_Mode); -- translate routine without additional headers. ----------------- -- Check_Error -- ----------------- procedure Check_Error (Stream : in Z_Stream; Code : in Thin.Int) is use type Thin.Int; begin if Code /= Thin.Z_OK then Raise_Error (Return_Code_Enum'Image (Return_Code (Code)) & ": " & Last_Error_Message (Stream)); end if; end Check_Error; ----------- -- Close -- ----------- procedure Close (Filter : in out Filter_Type; Ignore_Error : in Boolean := False) is Code : Thin.Int; begin if not Ignore_Error and then not Is_Open (Filter) then raise Status_Error; end if; Code := Flate (Filter.Compression).Done (To_Thin_Access (Filter.Strm)); if Ignore_Error or else Code = Thin.Z_OK then Free (Filter.Strm); else declare Error_Message : constant String := Last_Error_Message (Filter.Strm.all); begin Free (Filter.Strm); Ada.Exceptions.Raise_Exception (ZLib_Error'Identity, Return_Code_Enum'Image (Return_Code (Code)) & ": " & Error_Message); end; end if; end Close; ----------- -- CRC32 -- ----------- function CRC32 (CRC : in Unsigned_32; Data : in Ada.Streams.Stream_Element_Array) return Unsigned_32 is use Thin; begin return Unsigned_32 (crc32 (ULong (CRC), Data'Address, Data'Length)); end CRC32; procedure CRC32 (CRC : in out Unsigned_32; Data : in Ada.Streams.Stream_Element_Array) is begin CRC := CRC32 (CRC, Data); end CRC32; ------------------ -- Deflate_Init -- ------------------ procedure Deflate_Init (Filter : in out Filter_Type; Level : in Compression_Level := Default_Compression; Strategy : in Strategy_Type := Default_Strategy; Method : in Compression_Method := Deflated; Window_Bits : in Window_Bits_Type := Default_Window_Bits; Memory_Level : in Memory_Level_Type := Default_Memory_Level; Header : in Header_Type := Default) is use type Thin.Int; Win_Bits : Thin.Int := Thin.Int (Window_Bits); begin if Is_Open (Filter) then raise Status_Error; end if; -- We allow ZLib to make header only in case of default header type. -- Otherwise we would either do header by ourselfs, or do not do -- header at all. if Header = None or else Header = GZip then Win_Bits := -Win_Bits; end if; -- For the GZip CRC calculation and make headers. if Header = GZip then Filter.CRC := 0; Filter.Offset := Simple_GZip_Header'First; else Filter.Offset := Simple_GZip_Header'Last + 1; end if; Filter.Strm := new Z_Stream; Filter.Compression := True; Filter.Stream_End := False; Filter.Header := Header; if Thin.Deflate_Init (To_Thin_Access (Filter.Strm), Level => Thin.Int (Level), method => Thin.Int (Method), windowBits => Win_Bits, memLevel => Thin.Int (Memory_Level), strategy => Thin.Int (Strategy)) /= Thin.Z_OK then Raise_Error (Filter.Strm.all); end if; end Deflate_Init; ----------- -- Flush -- ----------- procedure Flush (Filter : in out Filter_Type; Out_Data : out Ada.Streams.Stream_Element_Array; Out_Last : out Ada.Streams.Stream_Element_Offset; Flush : in Flush_Mode) is No_Data : Stream_Element_Array := (1 .. 0 => 0); Last : Stream_Element_Offset; begin Translate (Filter, No_Data, Last, Out_Data, Out_Last, Flush); end Flush; ----------------------- -- Generic_Translate -- ----------------------- procedure Generic_Translate (Filter : in out ZLib.Filter_Type; In_Buffer_Size : in Integer := Default_Buffer_Size; Out_Buffer_Size : in Integer := Default_Buffer_Size) is In_Buffer : Stream_Element_Array (1 .. Stream_Element_Offset (In_Buffer_Size)); Out_Buffer : Stream_Element_Array (1 .. Stream_Element_Offset (Out_Buffer_Size)); Last : Stream_Element_Offset; In_Last : Stream_Element_Offset; In_First : Stream_Element_Offset; Out_Last : Stream_Element_Offset; begin Main : loop Data_In (In_Buffer, Last); In_First := In_Buffer'First; loop Translate (Filter => Filter, In_Data => In_Buffer (In_First .. Last), In_Last => In_Last, Out_Data => Out_Buffer, Out_Last => Out_Last, Flush => Flush_Finish (Last < In_Buffer'First)); if Out_Buffer'First <= Out_Last then Data_Out (Out_Buffer (Out_Buffer'First .. Out_Last)); end if; exit Main when Stream_End (Filter); -- The end of in buffer. exit when In_Last = Last; In_First := In_Last + 1; end loop; end loop Main; end Generic_Translate; ------------------ -- Inflate_Init -- ------------------ procedure Inflate_Init (Filter : in out Filter_Type; Window_Bits : in Window_Bits_Type := Default_Window_Bits; Header : in Header_Type := Default) is use type Thin.Int; Win_Bits : Thin.Int := Thin.Int (Window_Bits); procedure Check_Version; -- Check the latest header types compatibility. procedure Check_Version is begin if Version <= "1.1.4" then Raise_Error ("Inflate header type " & Header_Type'Image (Header) & " incompatible with ZLib version " & Version); end if; end Check_Version; begin if Is_Open (Filter) then raise Status_Error; end if; case Header is when None => Check_Version; -- Inflate data without headers determined -- by negative Win_Bits. Win_Bits := -Win_Bits; when GZip => Check_Version; -- Inflate gzip data defined by flag 16. Win_Bits := Win_Bits + 16; when Auto => Check_Version; -- Inflate with automatic detection -- of gzip or native header defined by flag 32. Win_Bits := Win_Bits + 32; when Default => null; end case; Filter.Strm := new Z_Stream; Filter.Compression := False; Filter.Stream_End := False; Filter.Header := Header; if Thin.Inflate_Init (To_Thin_Access (Filter.Strm), Win_Bits) /= Thin.Z_OK then Raise_Error (Filter.Strm.all); end if; end Inflate_Init; ------------- -- Is_Open -- ------------- function Is_Open (Filter : in Filter_Type) return Boolean is begin return Filter.Strm /= null; end Is_Open; ----------------- -- Raise_Error -- ----------------- procedure Raise_Error (Message : in String) is begin Ada.Exceptions.Raise_Exception (ZLib_Error'Identity, Message); end Raise_Error; procedure Raise_Error (Stream : in Z_Stream) is begin Raise_Error (Last_Error_Message (Stream)); end Raise_Error; ---------- -- Read -- ---------- procedure Read (Filter : in out Filter_Type; Item : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset; Flush : in Flush_Mode := No_Flush) is In_Last : Stream_Element_Offset; Item_First : Ada.Streams.Stream_Element_Offset := Item'First; V_Flush : Flush_Mode := Flush; begin pragma Assert (Rest_First in Buffer'First .. Buffer'Last + 1); pragma Assert (Rest_Last in Buffer'First - 1 .. Buffer'Last); loop if Rest_Last = Buffer'First - 1 then V_Flush := Finish; elsif Rest_First > Rest_Last then Read (Buffer, Rest_Last); Rest_First := Buffer'First; if Rest_Last < Buffer'First then V_Flush := Finish; end if; end if; Translate (Filter => Filter, In_Data => Buffer (Rest_First .. Rest_Last), In_Last => In_Last, Out_Data => Item (Item_First .. Item'Last), Out_Last => Last, Flush => V_Flush); Rest_First := In_Last + 1; exit when Stream_End (Filter) or else Last = Item'Last or else (Last >= Item'First and then Allow_Read_Some); Item_First := Last + 1; end loop; end Read; ---------------- -- Stream_End -- ---------------- function Stream_End (Filter : in Filter_Type) return Boolean is begin if Filter.Header = GZip and Filter.Compression then return Filter.Stream_End and then Filter.Offset = Footer_Array'Last + 1; else return Filter.Stream_End; end if; end Stream_End; -------------- -- Total_In -- -------------- function Total_In (Filter : in Filter_Type) return Count is begin return Count (Thin.Total_In (To_Thin_Access (Filter.Strm).all)); end Total_In; --------------- -- Total_Out -- --------------- function Total_Out (Filter : in Filter_Type) return Count is begin return Count (Thin.Total_Out (To_Thin_Access (Filter.Strm).all)); end Total_Out; --------------- -- Translate -- --------------- procedure Translate (Filter : in out Filter_Type; In_Data : in Ada.Streams.Stream_Element_Array; In_Last : out Ada.Streams.Stream_Element_Offset; Out_Data : out Ada.Streams.Stream_Element_Array; Out_Last : out Ada.Streams.Stream_Element_Offset; Flush : in Flush_Mode) is begin if Filter.Header = GZip and then Filter.Compression then Translate_GZip (Filter => Filter, In_Data => In_Data, In_Last => In_Last, Out_Data => Out_Data, Out_Last => Out_Last, Flush => Flush); else Translate_Auto (Filter => Filter, In_Data => In_Data, In_Last => In_Last, Out_Data => Out_Data, Out_Last => Out_Last, Flush => Flush); end if; end Translate; -------------------- -- Translate_Auto -- -------------------- procedure Translate_Auto (Filter : in out Filter_Type; In_Data : in Ada.Streams.Stream_Element_Array; In_Last : out Ada.Streams.Stream_Element_Offset; Out_Data : out Ada.Streams.Stream_Element_Array; Out_Last : out Ada.Streams.Stream_Element_Offset; Flush : in Flush_Mode) is use type Thin.Int; Code : Thin.Int; begin if not Is_Open (Filter) then raise Status_Error; end if; if Out_Data'Length = 0 and then In_Data'Length = 0 then raise Constraint_Error; end if; Set_Out (Filter.Strm.all, Out_Data'Address, Out_Data'Length); Set_In (Filter.Strm.all, In_Data'Address, In_Data'Length); Code := Flate (Filter.Compression).Step (To_Thin_Access (Filter.Strm), Thin.Int (Flush)); if Code = Thin.Z_STREAM_END then Filter.Stream_End := True; else Check_Error (Filter.Strm.all, Code); end if; In_Last := In_Data'Last - Stream_Element_Offset (Avail_In (Filter.Strm.all)); Out_Last := Out_Data'Last - Stream_Element_Offset (Avail_Out (Filter.Strm.all)); end Translate_Auto; -------------------- -- Translate_GZip -- -------------------- procedure Translate_GZip (Filter : in out Filter_Type; In_Data : in Ada.Streams.Stream_Element_Array; In_Last : out Ada.Streams.Stream_Element_Offset; Out_Data : out Ada.Streams.Stream_Element_Array; Out_Last : out Ada.Streams.Stream_Element_Offset; Flush : in Flush_Mode) is Out_First : Stream_Element_Offset; procedure Add_Data (Data : in Stream_Element_Array); -- Add data to stream from the Filter.Offset till necessary, -- used for add gzip headr/footer. procedure Put_32 (Item : in out Stream_Element_Array; Data : in Unsigned_32); pragma Inline (Put_32); -------------- -- Add_Data -- -------------- procedure Add_Data (Data : in Stream_Element_Array) is Data_First : Stream_Element_Offset renames Filter.Offset; Data_Last : Stream_Element_Offset; Data_Len : Stream_Element_Offset; -- -1 Out_Len : Stream_Element_Offset; -- -1 begin Out_First := Out_Last + 1; if Data_First > Data'Last then return; end if; Data_Len := Data'Last - Data_First; Out_Len := Out_Data'Last - Out_First; if Data_Len <= Out_Len then Out_Last := Out_First + Data_Len; Data_Last := Data'Last; else Out_Last := Out_Data'Last; Data_Last := Data_First + Out_Len; end if; Out_Data (Out_First .. Out_Last) := Data (Data_First .. Data_Last); Data_First := Data_Last + 1; Out_First := Out_Last + 1; end Add_Data; ------------ -- Put_32 -- ------------ procedure Put_32 (Item : in out Stream_Element_Array; Data : in Unsigned_32) is D : Unsigned_32 := Data; begin for J in Item'First .. Item'First + 3 loop Item (J) := Stream_Element (D and 16#FF#); D := Shift_Right (D, 8); end loop; end Put_32; begin Out_Last := Out_Data'First - 1; if not Filter.Stream_End then Add_Data (Simple_GZip_Header); Translate_Auto (Filter => Filter, In_Data => In_Data, In_Last => In_Last, Out_Data => Out_Data (Out_First .. Out_Data'Last), Out_Last => Out_Last, Flush => Flush); CRC32 (Filter.CRC, In_Data (In_Data'First .. In_Last)); end if; if Filter.Stream_End and then Out_Last <= Out_Data'Last then -- This detection method would work only when -- Simple_GZip_Header'Last > Footer_Array'Last if Filter.Offset = Simple_GZip_Header'Last + 1 then Filter.Offset := Footer_Array'First; end if; declare Footer : Footer_Array; begin Put_32 (Footer, Filter.CRC); Put_32 (Footer (Footer'First + 4 .. Footer'Last), Unsigned_32 (Total_In (Filter))); Add_Data (Footer); end; end if; end Translate_GZip; ------------- -- Version -- ------------- function Version return String is begin return Interfaces.C.Strings.Value (Thin.zlibVersion); end Version; ----------- -- Write -- ----------- procedure Write (Filter : in out Filter_Type; Item : in Ada.Streams.Stream_Element_Array; Flush : in Flush_Mode := No_Flush) is Buffer : Stream_Element_Array (1 .. Buffer_Size); In_Last : Stream_Element_Offset; Out_Last : Stream_Element_Offset; In_First : Stream_Element_Offset := Item'First; begin if Item'Length = 0 and Flush = No_Flush then return; end if; loop Translate (Filter => Filter, In_Data => Item (In_First .. Item'Last), In_Last => In_Last, Out_Data => Buffer, Out_Last => Out_Last, Flush => Flush); if Out_Last >= Buffer'First then Write (Buffer (1 .. Out_Last)); end if; exit when In_Last = Item'Last or Stream_End (Filter); In_First := In_Last + 1; end loop; end Write; end ZLib;
29.065527
78
0.551215
c7a654f90a14eb4e0ca6fdd1887d57db38f08ce4
5,252
ads
Ada
project/adl/testsuite/utils/src/wire_simulation.ads
corentingay/adaboy
68f08afa246c8255a42897376d375edcb4e2efc2
[ "MIT" ]
2
2018-05-16T03:56:39.000Z
2019-07-31T13:53:56.000Z
testsuite/utils/src/wire_simulation.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
null
null
null
testsuite/utils/src/wire_simulation.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- This package provides a simulation of digital signals on an electric wire. -- It can be used to test algorithms using GPIO_Point like protocol bit -- banging. with HAL.GPIO; use HAL.GPIO; package Wire_Simulation is Unknown_State : exception; Invalid_Configuration : exception; type Virtual_Wire (Default_Pull : GPIO_Pull_Resistor; Max_Points : Positive) is tagged limited private; type Any_Virtual_Wire is access all Virtual_Wire'Class; function Point (This : in out Virtual_Wire; Id : Positive) return Any_GPIO_Point with Pre => Id <= This.Max_Points; -- Return the GPIO_Point coresponding to the Id private type Wire_State is (High, Low, Unknown); type Wire_Point is new HAL.GPIO.GPIO_Point with record Current_Mode : GPIO_Mode := Input; Current_Pull : GPIO_Pull_Resistor := Floating; Current_State : Boolean := False; Wire : Any_Virtual_Wire := null; end record; overriding function Mode (This : Wire_Point) return GPIO_Mode is (This.Current_Mode); overriding function Set_Mode (This : in out Wire_Point; Mode : GPIO_Config_Mode) return Boolean; -- Return False if the mode is not available overriding function Pull_Resistor (This : Wire_Point) return GPIO_Pull_Resistor is (This.Current_Pull); overriding function Set_Pull_Resistor (This : in out Wire_Point; Pull : GPIO_Pull_Resistor) return Boolean; overriding function Set (This : Wire_Point) return Boolean; overriding procedure Set (This : in out Wire_Point); overriding procedure Clear (This : in out Wire_Point); overriding procedure Toggle (This : in out Wire_Point); type Wire_Point_Array is array (Natural range <>) of aliased Wire_Point; type Virtual_Wire (Default_Pull : GPIO_Pull_Resistor; Max_Points : Positive) is tagged limited record State : Wire_State := (case Default_Pull is when Pull_Down => Low, when Pull_Up => High, when Floating => Unknown); Points : aliased Wire_Point_Array (1 .. Max_Points); end record; procedure Update_Wire_State (This : in out Virtual_Wire); function At_Least_One_Output (This : Virtual_Wire) return Boolean; -- Return True if at least one GPIO point is configured as output function At_Least_One_Pull_Up (This : Virtual_Wire) return Boolean; -- Return True if at least one GPIO point is configured as pull up function At_Least_One_Pull_Down (This : Virtual_Wire) return Boolean; -- Return True if at least one GPIO point is configured as pull down end Wire_Simulation;
43.404959
78
0.586062
4b771c49e96678e061d2ffe1a21cf4413f06e41b
2,134
ada
Ada
Task/Quaternion-type/Ada/quaternion-type-2.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:38.000Z
2018-11-09T22:08:38.000Z
Task/Quaternion-type/Ada/quaternion-type-2.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
null
null
null
Task/Quaternion-type/Ada/quaternion-type-2.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:40.000Z
2018-11-09T22:08:40.000Z
with Ada.Numerics.Generic_Elementary_Functions; package body Quaternions is package Elementary_Functions is new Ada.Numerics.Generic_Elementary_Functions (Real); use Elementary_Functions; function "abs" (Left : Quaternion) return Real is begin return Sqrt (Left.A**2 + Left.B**2 + Left.C**2 + Left.D**2); end "abs"; function Conj (Left : Quaternion) return Quaternion is begin return (A => Left.A, B => -Left.B, C => -Left.C, D => -Left.D); end Conj; function "-" (Left : Quaternion) return Quaternion is begin return (A => -Left.A, B => -Left.B, C => -Left.C, D => -Left.D); end "-"; function "+" (Left, Right : Quaternion) return Quaternion is begin return ( A => Left.A + Right.A, B => Left.B + Right.B, C => Left.C + Right.C, D => Left.D + Right.D ); end "+"; function "-" (Left, Right : Quaternion) return Quaternion is begin return ( A => Left.A - Right.A, B => Left.B - Right.B, C => Left.C - Right.C, D => Left.D - Right.D ); end "-"; function "*" (Left : Quaternion; Right : Real) return Quaternion is begin return ( A => Left.A * Right, B => Left.B * Right, C => Left.C * Right, D => Left.D * Right ); end "*"; function "*" (Left : Real; Right : Quaternion) return Quaternion is begin return Right * Left; end "*"; function "*" (Left, Right : Quaternion) return Quaternion is begin return ( A => Left.A * Right.A - Left.B * Right.B - Left.C * Right.C - Left.D * Right.D, B => Left.A * Right.B + Left.B * Right.A + Left.C * Right.D - Left.D * Right.C, C => Left.A * Right.C - Left.B * Right.D + Left.C * Right.A + Left.D * Right.B, D => Left.A * Right.D + Left.B * Right.C - Left.C * Right.B + Left.D * Right.A ); end "*"; function Image (Left : Quaternion) return String is begin return Real'Image (Left.A) & " +" & Real'Image (Left.B) & "i +" & Real'Image (Left.C) & "j +" & Real'Image (Left.D) & "k"; end Image; end Quaternions;
35.566667
88
0.551078
2e345ac22efe8b1ac43a5094af7eb9e5b2796abf
424,304
adb
Ada
final-project/repositories/Deep_Learning_Inference_Accelerator_with_CNNIOT/MSOC_final-main/finalwrapup_hls/solution1/.autopilot/db/load_cifm_data_pool.bind.adb
bol-edu/2020-fall-ntu
5e009875dec5a3bbcebd1b3fae327990371d1b6a
[ "MIT" ]
7
2021-02-10T17:59:48.000Z
2021-09-27T15:02:56.000Z
final-project/repositories/Deep_Learning_Inference_Accelerator_with_CNNIOT/MSOC_final-main/finalwrapup_hls/solution1/.autopilot/db/load_cifm_data_pool.bind.adb
bol-edu/2020-fall-ntu
5e009875dec5a3bbcebd1b3fae327990371d1b6a
[ "MIT" ]
null
null
null
final-project/repositories/Deep_Learning_Inference_Accelerator_with_CNNIOT/MSOC_final-main/finalwrapup_hls/solution1/.autopilot/db/load_cifm_data_pool.bind.adb
bol-edu/2020-fall-ntu
5e009875dec5a3bbcebd1b3fae327990371d1b6a
[ "MIT" ]
1
2022-03-22T01:46:01.000Z
2022-03-22T01:46:01.000Z
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization> <boost_serialization signature="serialization::archive" version="15"> <syndb class_id="0" tracking_level="0" version="0"> <userIPLatency>-1</userIPLatency> <userIPName></userIPName> <cdfg class_id="1" tracking_level="1" version="0" object_id="_0"> <name>load_cifm_data_pool</name> <ret_bitwidth>0</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>33</count> <item_version>0</item_version> <item class_id="3" tracking_level="1" version="0" object_id="_1"> <Value class_id="4" tracking_level="0" version="0"> <Obj class_id="5" tracking_level="0" version="0"> <type>1</type> <id>1</id> <name>cifm</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo class_id="6" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>cifm</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>512</bitwidth> </Value> <direction>0</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs class_id="7" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_2"> <Value> <Obj> <type>1</type> <id>2</id> <name>ifm_buff0_0</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff0[0]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_3"> <Value> <Obj> <type>1</type> <id>3</id> <name>ifm_buff0_1</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff0[1]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_4"> <Value> <Obj> <type>1</type> <id>4</id> <name>ifm_buff0_2</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff0[2]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_5"> <Value> <Obj> <type>1</type> <id>5</id> <name>ifm_buff0_3</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff0[3]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_6"> <Value> <Obj> <type>1</type> <id>6</id> <name>ifm_buff0_4</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff0[4]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_7"> <Value> <Obj> <type>1</type> <id>7</id> <name>ifm_buff0_5</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff0[5]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_8"> <Value> <Obj> <type>1</type> <id>8</id> <name>ifm_buff0_6</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff0[6]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_9"> <Value> <Obj> <type>1</type> <id>9</id> <name>ifm_buff0_7</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff0[7]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_10"> <Value> <Obj> <type>1</type> <id>10</id> <name>ifm_buff0_8</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff0[8]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_11"> <Value> <Obj> <type>1</type> <id>11</id> <name>ifm_buff0_9</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff0[9]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_12"> <Value> <Obj> <type>1</type> <id>12</id> <name>ifm_buff0_10</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff0[10]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_13"> <Value> <Obj> <type>1</type> <id>13</id> <name>ifm_buff0_11</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff0[11]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_14"> <Value> <Obj> <type>1</type> <id>14</id> <name>ifm_buff0_12</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff0[12]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_15"> <Value> <Obj> <type>1</type> <id>15</id> <name>ifm_buff0_13</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff0[13]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_16"> <Value> <Obj> <type>1</type> <id>16</id> <name>ifm_buff0_14</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff0[14]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_17"> <Value> <Obj> <type>1</type> <id>17</id> <name>ifm_buff0_15</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff0[15]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_18"> <Value> <Obj> <type>1</type> <id>18</id> <name>ifm_buff1_0</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff1[0]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_19"> <Value> <Obj> <type>1</type> <id>19</id> <name>ifm_buff1_1</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff1[1]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_20"> <Value> <Obj> <type>1</type> <id>20</id> <name>ifm_buff1_2</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff1[2]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_21"> <Value> <Obj> <type>1</type> <id>21</id> <name>ifm_buff1_3</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff1[3]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_22"> <Value> <Obj> <type>1</type> <id>22</id> <name>ifm_buff1_4</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff1[4]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_23"> <Value> <Obj> <type>1</type> <id>23</id> <name>ifm_buff1_5</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff1[5]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_24"> <Value> <Obj> <type>1</type> <id>24</id> <name>ifm_buff1_6</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff1[6]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_25"> <Value> <Obj> <type>1</type> <id>25</id> <name>ifm_buff1_7</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff1[7]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_26"> <Value> <Obj> <type>1</type> <id>26</id> <name>ifm_buff1_8</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff1[8]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_27"> <Value> <Obj> <type>1</type> <id>27</id> <name>ifm_buff1_9</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff1[9]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_28"> <Value> <Obj> <type>1</type> <id>28</id> <name>ifm_buff1_10</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff1[10]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_29"> <Value> <Obj> <type>1</type> <id>29</id> <name>ifm_buff1_11</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff1[11]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_30"> <Value> <Obj> <type>1</type> <id>30</id> <name>ifm_buff1_12</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff1[12]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_31"> <Value> <Obj> <type>1</type> <id>31</id> <name>ifm_buff1_13</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff1[13]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_32"> <Value> <Obj> <type>1</type> <id>32</id> <name>ifm_buff1_14</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff1[14]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_33"> <Value> <Obj> <type>1</type> <id>33</id> <name>ifm_buff1_15</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ifm_buff1[15]</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>58</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> </ports> <nodes class_id="8" tracking_level="0" version="0"> <count>145</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_34"> <Value> <Obj> <type>0</type> <id>35</id> <name>_ln10</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>10</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="10" tracking_level="0" version="0"> <first>D:\Course\mSOC\final</first> <second class_id="11" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="12" tracking_level="0" version="0"> <first class_id="13" tracking_level="0" version="0"> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>10</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>195</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.76</m_delay> <m_topoIndex>1</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_35"> <Value> <Obj> <type>0</type> <id>37</id> <name>cifm_counter_0</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>j</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>197</item> <item>198</item> <item>199</item> <item>200</item> </oprand_edges> <opcode>phi</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>2</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_36"> <Value> <Obj> <type>0</type> <id>38</id> <name>icmp_ln10</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>10</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>10</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>201</item> <item>203</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.42</m_delay> <m_topoIndex>3</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_37"> <Value> <Obj> <type>0</type> <id>40</id> <name>j</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>29</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>29</second> </item> </second> </item> </inlineStackInfo> <originalName>j</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>204</item> <item>206</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.82</m_delay> <m_topoIndex>4</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_38"> <Value> <Obj> <type>0</type> <id>41</id> <name>_ln10</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>10</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>10</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>207</item> <item>208</item> <item>209</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>5</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_39"> <Value> <Obj> <type>0</type> <id>45</id> <name>zext_ln13</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>13</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>13</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>211</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>6</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_40"> <Value> <Obj> <type>0</type> <id>46</id> <name>cifm_read</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>13</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>13</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>512</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>213</item> <item>214</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>7</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_41"> <Value> <Obj> <type>0</type> <id>47</id> <name>trunc_ln13</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>13</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>13</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>215</item> </oprand_edges> <opcode>trunc</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>8</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_42"> <Value> <Obj> <type>0</type> <id>48</id> <name>bitcast_ln13</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>13</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>13</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>216</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>9</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_43"> <Value> <Obj> <type>0</type> <id>49</id> <name>ifm_buff0_0_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>13</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>13</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>217</item> <item>219</item> <item>220</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>10</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_44"> <Value> <Obj> <type>0</type> <id>50</id> <name>ifm_buff0_0_addr_write_ln13</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>13</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>13</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>221</item> <item>222</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>11</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_45"> <Value> <Obj> <type>0</type> <id>51</id> <name>cifm_a1_load_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>14</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>14</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>224</item> <item>225</item> <item>227</item> <item>229</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>12</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_46"> <Value> <Obj> <type>0</type> <id>52</id> <name>bitcast_ln14</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>14</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>14</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>230</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>13</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_47"> <Value> <Obj> <type>0</type> <id>53</id> <name>ifm_buff0_1_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>14</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>14</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>231</item> <item>232</item> <item>233</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>14</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_48"> <Value> <Obj> <type>0</type> <id>54</id> <name>ifm_buff0_1_addr_write_ln14</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>14</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>14</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>234</item> <item>235</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>15</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_49"> <Value> <Obj> <type>0</type> <id>55</id> <name>cifm_a2_load_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>15</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>15</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>236</item> <item>237</item> <item>239</item> <item>241</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>16</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_50"> <Value> <Obj> <type>0</type> <id>56</id> <name>bitcast_ln15</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>15</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>15</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>242</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>17</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_51"> <Value> <Obj> <type>0</type> <id>57</id> <name>ifm_buff0_2_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>15</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>15</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>243</item> <item>244</item> <item>245</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>18</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_52"> <Value> <Obj> <type>0</type> <id>58</id> <name>ifm_buff0_2_addr_write_ln15</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>15</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>15</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>246</item> <item>247</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>19</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_53"> <Value> <Obj> <type>0</type> <id>59</id> <name>cifm_a3_load_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>248</item> <item>249</item> <item>251</item> <item>253</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>20</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_54"> <Value> <Obj> <type>0</type> <id>60</id> <name>bitcast_ln16</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>254</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>21</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_55"> <Value> <Obj> <type>0</type> <id>61</id> <name>ifm_buff0_3_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>255</item> <item>256</item> <item>257</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>22</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_56"> <Value> <Obj> <type>0</type> <id>62</id> <name>ifm_buff0_3_addr_write_ln16</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>258</item> <item>259</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>23</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_57"> <Value> <Obj> <type>0</type> <id>63</id> <name>cifm_a4_load_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>260</item> <item>261</item> <item>263</item> <item>265</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>24</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_58"> <Value> <Obj> <type>0</type> <id>64</id> <name>bitcast_ln17</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>266</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>25</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_59"> <Value> <Obj> <type>0</type> <id>65</id> <name>ifm_buff0_4_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>267</item> <item>268</item> <item>269</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>26</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_60"> <Value> <Obj> <type>0</type> <id>66</id> <name>ifm_buff0_4_addr_write_ln17</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>270</item> <item>271</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>27</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_61"> <Value> <Obj> <type>0</type> <id>67</id> <name>cifm_a5_load_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>18</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>18</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>272</item> <item>273</item> <item>275</item> <item>277</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>28</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_62"> <Value> <Obj> <type>0</type> <id>68</id> <name>bitcast_ln18</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>18</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>18</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>278</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>29</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_63"> <Value> <Obj> <type>0</type> <id>69</id> <name>ifm_buff0_5_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>18</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>18</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>279</item> <item>280</item> <item>281</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>30</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_64"> <Value> <Obj> <type>0</type> <id>70</id> <name>ifm_buff0_5_addr_write_ln18</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>18</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>18</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>282</item> <item>283</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>31</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_65"> <Value> <Obj> <type>0</type> <id>71</id> <name>cifm_a6_load_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>284</item> <item>285</item> <item>287</item> <item>289</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>32</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_66"> <Value> <Obj> <type>0</type> <id>72</id> <name>bitcast_ln19</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>290</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>33</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_67"> <Value> <Obj> <type>0</type> <id>73</id> <name>ifm_buff0_6_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>291</item> <item>292</item> <item>293</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>34</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_68"> <Value> <Obj> <type>0</type> <id>74</id> <name>ifm_buff0_6_addr_write_ln19</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>294</item> <item>295</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>35</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_69"> <Value> <Obj> <type>0</type> <id>75</id> <name>cifm_a7_load_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>20</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>20</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>296</item> <item>297</item> <item>299</item> <item>301</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>36</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_70"> <Value> <Obj> <type>0</type> <id>76</id> <name>bitcast_ln20</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>20</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>20</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>302</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>37</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_71"> <Value> <Obj> <type>0</type> <id>77</id> <name>ifm_buff0_7_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>20</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>20</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>303</item> <item>304</item> <item>305</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>38</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_72"> <Value> <Obj> <type>0</type> <id>78</id> <name>ifm_buff0_7_addr_write_ln20</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>20</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>20</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>306</item> <item>307</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>39</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_73"> <Value> <Obj> <type>0</type> <id>79</id> <name>cifm_a8_load_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>21</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>21</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>308</item> <item>309</item> <item>311</item> <item>313</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>40</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_74"> <Value> <Obj> <type>0</type> <id>80</id> <name>bitcast_ln21</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>21</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>21</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>314</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>41</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_75"> <Value> <Obj> <type>0</type> <id>81</id> <name>ifm_buff0_8_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>21</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>21</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>315</item> <item>316</item> <item>317</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>42</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_76"> <Value> <Obj> <type>0</type> <id>82</id> <name>ifm_buff0_8_addr_write_ln21</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>21</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>21</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>318</item> <item>319</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>43</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_77"> <Value> <Obj> <type>0</type> <id>83</id> <name>cifm_a9_load_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>22</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>22</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>320</item> <item>321</item> <item>323</item> <item>325</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>44</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_78"> <Value> <Obj> <type>0</type> <id>84</id> <name>bitcast_ln22</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>22</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>22</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>326</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>45</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_79"> <Value> <Obj> <type>0</type> <id>85</id> <name>ifm_buff0_9_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>22</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>22</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>327</item> <item>328</item> <item>329</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>46</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_80"> <Value> <Obj> <type>0</type> <id>86</id> <name>ifm_buff0_9_addr_write_ln22</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>22</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>22</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>330</item> <item>331</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>47</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_81"> <Value> <Obj> <type>0</type> <id>87</id> <name>cifm_a10_load_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>23</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>23</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>332</item> <item>333</item> <item>335</item> <item>337</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>48</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_82"> <Value> <Obj> <type>0</type> <id>88</id> <name>bitcast_ln23</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>23</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>23</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>338</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>49</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_83"> <Value> <Obj> <type>0</type> <id>89</id> <name>ifm_buff0_10_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>23</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>23</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>339</item> <item>340</item> <item>341</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>50</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_84"> <Value> <Obj> <type>0</type> <id>90</id> <name>ifm_buff0_10_addr_write_ln23</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>23</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>23</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>342</item> <item>343</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>51</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_85"> <Value> <Obj> <type>0</type> <id>91</id> <name>cifm_a11_load_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>24</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>24</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>344</item> <item>345</item> <item>347</item> <item>349</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>52</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_86"> <Value> <Obj> <type>0</type> <id>92</id> <name>bitcast_ln24</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>24</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>24</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>350</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>53</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_87"> <Value> <Obj> <type>0</type> <id>93</id> <name>ifm_buff0_11_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>24</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>24</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>351</item> <item>352</item> <item>353</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>54</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_88"> <Value> <Obj> <type>0</type> <id>94</id> <name>ifm_buff0_11_addr_write_ln24</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>24</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>24</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>354</item> <item>355</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>55</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_89"> <Value> <Obj> <type>0</type> <id>95</id> <name>cifm_a12_load_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>25</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>25</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>356</item> <item>357</item> <item>359</item> <item>361</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>56</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_90"> <Value> <Obj> <type>0</type> <id>96</id> <name>bitcast_ln25</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>25</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>25</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>362</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>57</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_91"> <Value> <Obj> <type>0</type> <id>97</id> <name>ifm_buff0_12_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>25</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>25</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>363</item> <item>364</item> <item>365</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>58</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_92"> <Value> <Obj> <type>0</type> <id>98</id> <name>ifm_buff0_12_addr_write_ln25</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>25</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>25</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>366</item> <item>367</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>59</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_93"> <Value> <Obj> <type>0</type> <id>99</id> <name>cifm_a13_load_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>26</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>26</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>368</item> <item>369</item> <item>371</item> <item>373</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>60</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_94"> <Value> <Obj> <type>0</type> <id>100</id> <name>bitcast_ln26</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>26</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>26</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>374</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>61</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_95"> <Value> <Obj> <type>0</type> <id>101</id> <name>ifm_buff0_13_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>26</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>26</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>375</item> <item>376</item> <item>377</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>62</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_96"> <Value> <Obj> <type>0</type> <id>102</id> <name>ifm_buff0_13_addr_write_ln26</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>26</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>26</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>378</item> <item>379</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>63</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_97"> <Value> <Obj> <type>0</type> <id>103</id> <name>cifm_a14_load_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>27</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>27</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>380</item> <item>381</item> <item>383</item> <item>385</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>64</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_98"> <Value> <Obj> <type>0</type> <id>104</id> <name>bitcast_ln27</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>27</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>27</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>386</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>65</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_99"> <Value> <Obj> <type>0</type> <id>105</id> <name>ifm_buff0_14_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>27</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>27</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>387</item> <item>388</item> <item>389</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>66</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_100"> <Value> <Obj> <type>0</type> <id>106</id> <name>ifm_buff0_14_addr_write_ln27</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>27</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>27</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>390</item> <item>391</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>67</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_101"> <Value> <Obj> <type>0</type> <id>107</id> <name>cifm_a15_load_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>28</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>28</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>392</item> <item>393</item> <item>395</item> <item>397</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>68</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_102"> <Value> <Obj> <type>0</type> <id>108</id> <name>bitcast_ln28</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>28</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>28</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>398</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>69</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_103"> <Value> <Obj> <type>0</type> <id>109</id> <name>ifm_buff0_15_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>28</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>28</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>399</item> <item>400</item> <item>401</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>70</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_104"> <Value> <Obj> <type>0</type> <id>110</id> <name>ifm_buff0_15_addr_write_ln28</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>28</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>28</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>402</item> <item>403</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>71</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_105"> <Value> <Obj> <type>0</type> <id>112</id> <name>_ln10</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>10</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>10</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>404</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>72</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_106"> <Value> <Obj> <type>0</type> <id>114</id> <name>_ln33</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>33</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>33</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>210</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.76</m_delay> <m_topoIndex>73</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_107"> <Value> <Obj> <type>0</type> <id>116</id> <name>j1_0</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>j</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>405</item> <item>406</item> <item>407</item> <item>408</item> </oprand_edges> <opcode>phi</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>74</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_108"> <Value> <Obj> <type>0</type> <id>117</id> <name>icmp_ln33</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>33</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>33</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>409</item> <item>410</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.42</m_delay> <m_topoIndex>75</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_109"> <Value> <Obj> <type>0</type> <id>119</id> <name>j_1</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>33</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>33</second> </item> </second> </item> </inlineStackInfo> <originalName>j</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>411</item> <item>412</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.82</m_delay> <m_topoIndex>76</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_110"> <Value> <Obj> <type>0</type> <id>120</id> <name>_ln33</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>33</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>33</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>413</item> <item>414</item> <item>415</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>77</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_111"> <Value> <Obj> <type>0</type> <id>124</id> <name>cifm_read_1</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>36</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>36</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>512</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>416</item> <item>417</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>78</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_112"> <Value> <Obj> <type>0</type> <id>125</id> <name>trunc_ln36</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>36</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>36</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>418</item> </oprand_edges> <opcode>trunc</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>79</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_113"> <Value> <Obj> <type>0</type> <id>126</id> <name>bitcast_ln36</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>36</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>36</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>419</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>80</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_114"> <Value> <Obj> <type>0</type> <id>127</id> <name>zext_ln36</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>36</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>36</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>420</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>81</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_115"> <Value> <Obj> <type>0</type> <id>128</id> <name>ifm_buff1_0_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>36</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>36</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>421</item> <item>422</item> <item>423</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>82</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_116"> <Value> <Obj> <type>0</type> <id>129</id> <name>ifm_buff1_0_addr_write_ln36</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>36</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>36</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>424</item> <item>425</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>83</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_117"> <Value> <Obj> <type>0</type> <id>130</id> <name>cifm_a1_load_1_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>37</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>37</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>426</item> <item>427</item> <item>428</item> <item>429</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>84</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_118"> <Value> <Obj> <type>0</type> <id>131</id> <name>bitcast_ln37</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>37</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>37</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>430</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>85</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_119"> <Value> <Obj> <type>0</type> <id>132</id> <name>ifm_buff1_1_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>37</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>37</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>431</item> <item>432</item> <item>433</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>86</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_120"> <Value> <Obj> <type>0</type> <id>133</id> <name>ifm_buff1_1_addr_write_ln37</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>37</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>37</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>434</item> <item>435</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>87</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_121"> <Value> <Obj> <type>0</type> <id>134</id> <name>cifm_a2_load_1_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>38</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>38</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>436</item> <item>437</item> <item>438</item> <item>439</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>88</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_122"> <Value> <Obj> <type>0</type> <id>135</id> <name>bitcast_ln38</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>38</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>38</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>440</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>89</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_123"> <Value> <Obj> <type>0</type> <id>136</id> <name>ifm_buff1_2_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>38</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>38</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>441</item> <item>442</item> <item>443</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>90</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_124"> <Value> <Obj> <type>0</type> <id>137</id> <name>ifm_buff1_2_addr_write_ln38</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>38</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>38</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>444</item> <item>445</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>91</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_125"> <Value> <Obj> <type>0</type> <id>138</id> <name>cifm_a3_load_1_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>39</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>39</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>446</item> <item>447</item> <item>448</item> <item>449</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>92</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_126"> <Value> <Obj> <type>0</type> <id>139</id> <name>bitcast_ln39</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>39</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>39</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>450</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>93</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_127"> <Value> <Obj> <type>0</type> <id>140</id> <name>ifm_buff1_3_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>39</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>39</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>451</item> <item>452</item> <item>453</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>94</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_128"> <Value> <Obj> <type>0</type> <id>141</id> <name>ifm_buff1_3_addr_write_ln39</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>39</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>39</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>454</item> <item>455</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>95</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_129"> <Value> <Obj> <type>0</type> <id>142</id> <name>cifm_a4_load_1_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>40</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>456</item> <item>457</item> <item>458</item> <item>459</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>96</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_130"> <Value> <Obj> <type>0</type> <id>143</id> <name>bitcast_ln40</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>40</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>460</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>97</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_131"> <Value> <Obj> <type>0</type> <id>144</id> <name>ifm_buff1_4_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>40</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>461</item> <item>462</item> <item>463</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>98</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_132"> <Value> <Obj> <type>0</type> <id>145</id> <name>ifm_buff1_4_addr_write_ln40</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>40</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>464</item> <item>465</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>99</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_133"> <Value> <Obj> <type>0</type> <id>146</id> <name>cifm_a5_load_1_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>41</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>41</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>466</item> <item>467</item> <item>468</item> <item>469</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>100</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_134"> <Value> <Obj> <type>0</type> <id>147</id> <name>bitcast_ln41</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>41</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>41</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>470</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>101</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_135"> <Value> <Obj> <type>0</type> <id>148</id> <name>ifm_buff1_5_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>41</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>41</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>471</item> <item>472</item> <item>473</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>102</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_136"> <Value> <Obj> <type>0</type> <id>149</id> <name>ifm_buff1_5_addr_write_ln41</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>41</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>41</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>474</item> <item>475</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>103</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_137"> <Value> <Obj> <type>0</type> <id>150</id> <name>cifm_a6_load_1_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>42</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>42</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>476</item> <item>477</item> <item>478</item> <item>479</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>104</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_138"> <Value> <Obj> <type>0</type> <id>151</id> <name>bitcast_ln42</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>42</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>42</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>480</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>105</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_139"> <Value> <Obj> <type>0</type> <id>152</id> <name>ifm_buff1_6_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>42</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>42</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>481</item> <item>482</item> <item>483</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>106</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_140"> <Value> <Obj> <type>0</type> <id>153</id> <name>ifm_buff1_6_addr_write_ln42</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>42</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>42</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>484</item> <item>485</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>107</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_141"> <Value> <Obj> <type>0</type> <id>154</id> <name>cifm_a7_load_1_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>43</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>43</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>486</item> <item>487</item> <item>488</item> <item>489</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>108</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_142"> <Value> <Obj> <type>0</type> <id>155</id> <name>bitcast_ln43</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>43</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>43</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>490</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>109</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_143"> <Value> <Obj> <type>0</type> <id>156</id> <name>ifm_buff1_7_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>43</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>43</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>491</item> <item>492</item> <item>493</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>110</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_144"> <Value> <Obj> <type>0</type> <id>157</id> <name>ifm_buff1_7_addr_write_ln43</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>43</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>43</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>494</item> <item>495</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>111</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_145"> <Value> <Obj> <type>0</type> <id>158</id> <name>cifm_a8_load_1_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>44</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>44</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>496</item> <item>497</item> <item>498</item> <item>499</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>112</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_146"> <Value> <Obj> <type>0</type> <id>159</id> <name>bitcast_ln44</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>44</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>44</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>500</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>113</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_147"> <Value> <Obj> <type>0</type> <id>160</id> <name>ifm_buff1_8_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>44</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>44</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>501</item> <item>502</item> <item>503</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>114</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_148"> <Value> <Obj> <type>0</type> <id>161</id> <name>ifm_buff1_8_addr_write_ln44</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>44</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>44</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>504</item> <item>505</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>115</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_149"> <Value> <Obj> <type>0</type> <id>162</id> <name>cifm_a9_load_1_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>45</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>45</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>506</item> <item>507</item> <item>508</item> <item>509</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>116</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_150"> <Value> <Obj> <type>0</type> <id>163</id> <name>bitcast_ln45</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>45</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>45</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>510</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>117</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_151"> <Value> <Obj> <type>0</type> <id>164</id> <name>ifm_buff1_9_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>45</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>45</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>511</item> <item>512</item> <item>513</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>118</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_152"> <Value> <Obj> <type>0</type> <id>165</id> <name>ifm_buff1_9_addr_write_ln45</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>45</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>45</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>514</item> <item>515</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>119</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_153"> <Value> <Obj> <type>0</type> <id>166</id> <name>cifm_a10_load_1_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>46</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>46</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>516</item> <item>517</item> <item>518</item> <item>519</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>120</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_154"> <Value> <Obj> <type>0</type> <id>167</id> <name>bitcast_ln46</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>46</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>46</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>520</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>121</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_155"> <Value> <Obj> <type>0</type> <id>168</id> <name>ifm_buff1_10_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>46</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>46</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>521</item> <item>522</item> <item>523</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>122</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_156"> <Value> <Obj> <type>0</type> <id>169</id> <name>ifm_buff1_10_addr_write_ln46</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>46</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>46</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>524</item> <item>525</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>123</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_157"> <Value> <Obj> <type>0</type> <id>170</id> <name>cifm_a11_load_1_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>47</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>47</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>526</item> <item>527</item> <item>528</item> <item>529</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>124</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_158"> <Value> <Obj> <type>0</type> <id>171</id> <name>bitcast_ln47</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>47</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>47</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>530</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>125</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_159"> <Value> <Obj> <type>0</type> <id>172</id> <name>ifm_buff1_11_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>47</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>47</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>531</item> <item>532</item> <item>533</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>126</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_160"> <Value> <Obj> <type>0</type> <id>173</id> <name>ifm_buff1_11_addr_write_ln47</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>47</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>47</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>534</item> <item>535</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>127</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_161"> <Value> <Obj> <type>0</type> <id>174</id> <name>cifm_a12_load_1_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>48</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>48</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>536</item> <item>537</item> <item>538</item> <item>539</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>128</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_162"> <Value> <Obj> <type>0</type> <id>175</id> <name>bitcast_ln48</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>48</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>48</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>540</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>129</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_163"> <Value> <Obj> <type>0</type> <id>176</id> <name>ifm_buff1_12_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>48</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>48</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>541</item> <item>542</item> <item>543</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>130</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_164"> <Value> <Obj> <type>0</type> <id>177</id> <name>ifm_buff1_12_addr_write_ln48</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>48</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>48</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>544</item> <item>545</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>131</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_165"> <Value> <Obj> <type>0</type> <id>178</id> <name>cifm_a13_load_1_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>49</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>49</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>546</item> <item>547</item> <item>548</item> <item>549</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>132</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_166"> <Value> <Obj> <type>0</type> <id>179</id> <name>bitcast_ln49</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>49</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>49</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>550</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>133</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_167"> <Value> <Obj> <type>0</type> <id>180</id> <name>ifm_buff1_13_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>49</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>49</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>551</item> <item>552</item> <item>553</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>134</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_168"> <Value> <Obj> <type>0</type> <id>181</id> <name>ifm_buff1_13_addr_write_ln49</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>49</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>49</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>554</item> <item>555</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>135</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_169"> <Value> <Obj> <type>0</type> <id>182</id> <name>cifm_a14_load_1_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>50</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>556</item> <item>557</item> <item>558</item> <item>559</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>136</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_170"> <Value> <Obj> <type>0</type> <id>183</id> <name>bitcast_ln50</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>50</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>560</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>137</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_171"> <Value> <Obj> <type>0</type> <id>184</id> <name>ifm_buff1_14_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>50</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>561</item> <item>562</item> <item>563</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>138</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_172"> <Value> <Obj> <type>0</type> <id>185</id> <name>ifm_buff1_14_addr_write_ln50</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>50</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>564</item> <item>565</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>139</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_173"> <Value> <Obj> <type>0</type> <id>186</id> <name>cifm_a15_load_1_new</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>51</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>51</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>566</item> <item>567</item> <item>568</item> <item>569</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>140</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_174"> <Value> <Obj> <type>0</type> <id>187</id> <name>bitcast_ln51</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>51</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>51</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>570</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>141</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_175"> <Value> <Obj> <type>0</type> <id>188</id> <name>ifm_buff1_15_addr</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>51</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>51</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>571</item> <item>572</item> <item>573</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>142</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_176"> <Value> <Obj> <type>0</type> <id>189</id> <name>ifm_buff1_15_addr_write_ln51</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>51</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>51</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>574</item> <item>575</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>143</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_177"> <Value> <Obj> <type>0</type> <id>191</id> <name>_ln33</name> <fileName>finalwrapup.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>33</lineNumber> <contextFuncName>load_cifm_data_pool</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalwrapup.cpp</first> <second>load_cifm_data_pool</second> </first> <second>33</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>576</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>144</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_178"> <Value> <Obj> <type>0</type> <id>193</id> <name>_ln0</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>0</count> <item_version>0</item_version> </oprand_edges> <opcode>ret</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>145</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>34</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_179"> <Value> <Obj> <type>2</type> <id>196</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_180"> <Value> <Obj> <type>2</type> <id>202</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <const_type>0</const_type> <content>58</content> </item> <item class_id_reference="16" object_id="_181"> <Value> <Obj> <type>2</type> <id>205</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_182"> <Value> <Obj> <type>2</type> <id>218</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_183"> <Value> <Obj> <type>2</type> <id>226</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>32</content> </item> <item class_id_reference="16" object_id="_184"> <Value> <Obj> <type>2</type> <id>228</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>63</content> </item> <item class_id_reference="16" object_id="_185"> <Value> <Obj> <type>2</type> <id>238</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>64</content> </item> <item class_id_reference="16" object_id="_186"> <Value> <Obj> <type>2</type> <id>240</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>95</content> </item> <item class_id_reference="16" object_id="_187"> <Value> <Obj> <type>2</type> <id>250</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>96</content> </item> <item class_id_reference="16" object_id="_188"> <Value> <Obj> <type>2</type> <id>252</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>127</content> </item> <item class_id_reference="16" object_id="_189"> <Value> <Obj> <type>2</type> <id>262</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>128</content> </item> <item class_id_reference="16" object_id="_190"> <Value> <Obj> <type>2</type> <id>264</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>159</content> </item> <item class_id_reference="16" object_id="_191"> <Value> <Obj> <type>2</type> <id>274</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>160</content> </item> <item class_id_reference="16" object_id="_192"> <Value> <Obj> <type>2</type> <id>276</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>191</content> </item> <item class_id_reference="16" object_id="_193"> <Value> <Obj> <type>2</type> <id>286</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>192</content> </item> <item class_id_reference="16" object_id="_194"> <Value> <Obj> <type>2</type> <id>288</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>223</content> </item> <item class_id_reference="16" object_id="_195"> <Value> <Obj> <type>2</type> <id>298</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>224</content> </item> <item class_id_reference="16" object_id="_196"> <Value> <Obj> <type>2</type> <id>300</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>255</content> </item> <item class_id_reference="16" object_id="_197"> <Value> <Obj> <type>2</type> <id>310</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>256</content> </item> <item class_id_reference="16" object_id="_198"> <Value> <Obj> <type>2</type> <id>312</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>287</content> </item> <item class_id_reference="16" object_id="_199"> <Value> <Obj> <type>2</type> <id>322</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>288</content> </item> <item class_id_reference="16" object_id="_200"> <Value> <Obj> <type>2</type> <id>324</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>319</content> </item> <item class_id_reference="16" object_id="_201"> <Value> <Obj> <type>2</type> <id>334</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>320</content> </item> <item class_id_reference="16" object_id="_202"> <Value> <Obj> <type>2</type> <id>336</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>351</content> </item> <item class_id_reference="16" object_id="_203"> <Value> <Obj> <type>2</type> <id>346</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>352</content> </item> <item class_id_reference="16" object_id="_204"> <Value> <Obj> <type>2</type> <id>348</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>383</content> </item> <item class_id_reference="16" object_id="_205"> <Value> <Obj> <type>2</type> <id>358</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>384</content> </item> <item class_id_reference="16" object_id="_206"> <Value> <Obj> <type>2</type> <id>360</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>415</content> </item> <item class_id_reference="16" object_id="_207"> <Value> <Obj> <type>2</type> <id>370</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>416</content> </item> <item class_id_reference="16" object_id="_208"> <Value> <Obj> <type>2</type> <id>372</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>447</content> </item> <item class_id_reference="16" object_id="_209"> <Value> <Obj> <type>2</type> <id>382</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>448</content> </item> <item class_id_reference="16" object_id="_210"> <Value> <Obj> <type>2</type> <id>384</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>479</content> </item> <item class_id_reference="16" object_id="_211"> <Value> <Obj> <type>2</type> <id>394</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>480</content> </item> <item class_id_reference="16" object_id="_212"> <Value> <Obj> <type>2</type> <id>396</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>511</content> </item> </consts> <blocks class_id="17" tracking_level="0" version="0"> <count>7</count> <item_version>0</item_version> <item class_id="18" tracking_level="1" version="0" object_id="_213"> <Obj> <type>3</type> <id>36</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>1</count> <item_version>0</item_version> <item>35</item> </node_objs> </item> <item class_id_reference="18" object_id="_214"> <Obj> <type>3</type> <id>42</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>4</count> <item_version>0</item_version> <item>37</item> <item>38</item> <item>40</item> <item>41</item> </node_objs> </item> <item class_id_reference="18" object_id="_215"> <Obj> <type>3</type> <id>113</id> <name>hls_label_0</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>67</count> <item_version>0</item_version> <item>45</item> <item>46</item> <item>47</item> <item>48</item> <item>49</item> <item>50</item> <item>51</item> <item>52</item> <item>53</item> <item>54</item> <item>55</item> <item>56</item> <item>57</item> <item>58</item> <item>59</item> <item>60</item> <item>61</item> <item>62</item> <item>63</item> <item>64</item> <item>65</item> <item>66</item> <item>67</item> <item>68</item> <item>69</item> <item>70</item> <item>71</item> <item>72</item> <item>73</item> <item>74</item> <item>75</item> <item>76</item> <item>77</item> <item>78</item> <item>79</item> <item>80</item> <item>81</item> <item>82</item> <item>83</item> <item>84</item> <item>85</item> <item>86</item> <item>87</item> <item>88</item> <item>89</item> <item>90</item> <item>91</item> <item>92</item> <item>93</item> <item>94</item> <item>95</item> <item>96</item> <item>97</item> <item>98</item> <item>99</item> <item>100</item> <item>101</item> <item>102</item> <item>103</item> <item>104</item> <item>105</item> <item>106</item> <item>107</item> <item>108</item> <item>109</item> <item>110</item> <item>112</item> </node_objs> </item> <item class_id_reference="18" object_id="_216"> <Obj> <type>3</type> <id>115</id> <name>.preheader.preheader</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>1</count> <item_version>0</item_version> <item>114</item> </node_objs> </item> <item class_id_reference="18" object_id="_217"> <Obj> <type>3</type> <id>121</id> <name>.preheader</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>4</count> <item_version>0</item_version> <item>116</item> <item>117</item> <item>119</item> <item>120</item> </node_objs> </item> <item class_id_reference="18" object_id="_218"> <Obj> <type>3</type> <id>192</id> <name>hls_label_1</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>67</count> <item_version>0</item_version> <item>124</item> <item>125</item> <item>126</item> <item>127</item> <item>128</item> <item>129</item> <item>130</item> <item>131</item> <item>132</item> <item>133</item> <item>134</item> <item>135</item> <item>136</item> <item>137</item> <item>138</item> <item>139</item> <item>140</item> <item>141</item> <item>142</item> <item>143</item> <item>144</item> <item>145</item> <item>146</item> <item>147</item> <item>148</item> <item>149</item> <item>150</item> <item>151</item> <item>152</item> <item>153</item> <item>154</item> <item>155</item> <item>156</item> <item>157</item> <item>158</item> <item>159</item> <item>160</item> <item>161</item> <item>162</item> <item>163</item> <item>164</item> <item>165</item> <item>166</item> <item>167</item> <item>168</item> <item>169</item> <item>170</item> <item>171</item> <item>172</item> <item>173</item> <item>174</item> <item>175</item> <item>176</item> <item>177</item> <item>178</item> <item>179</item> <item>180</item> <item>181</item> <item>182</item> <item>183</item> <item>184</item> <item>185</item> <item>186</item> <item>187</item> <item>188</item> <item>189</item> <item>191</item> </node_objs> </item> <item class_id_reference="18" object_id="_219"> <Obj> <type>3</type> <id>194</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>1</count> <item_version>0</item_version> <item>193</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>322</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_220"> <id>195</id> <edge_type>2</edge_type> <source_obj>42</source_obj> <sink_obj>35</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_221"> <id>197</id> <edge_type>1</edge_type> <source_obj>196</source_obj> <sink_obj>37</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_222"> <id>198</id> <edge_type>2</edge_type> <source_obj>36</source_obj> <sink_obj>37</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_223"> <id>199</id> <edge_type>1</edge_type> <source_obj>40</source_obj> <sink_obj>37</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_224"> <id>200</id> <edge_type>2</edge_type> <source_obj>113</source_obj> <sink_obj>37</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_225"> <id>201</id> <edge_type>1</edge_type> <source_obj>37</source_obj> <sink_obj>38</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_226"> <id>203</id> <edge_type>1</edge_type> <source_obj>202</source_obj> <sink_obj>38</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_227"> <id>204</id> <edge_type>1</edge_type> <source_obj>37</source_obj> <sink_obj>40</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_228"> <id>206</id> <edge_type>1</edge_type> <source_obj>205</source_obj> <sink_obj>40</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_229"> <id>207</id> <edge_type>1</edge_type> <source_obj>38</source_obj> <sink_obj>41</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_230"> <id>208</id> <edge_type>2</edge_type> <source_obj>113</source_obj> <sink_obj>41</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_231"> <id>209</id> <edge_type>2</edge_type> <source_obj>115</source_obj> <sink_obj>41</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_232"> <id>210</id> <edge_type>2</edge_type> <source_obj>121</source_obj> <sink_obj>114</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_233"> <id>211</id> <edge_type>1</edge_type> <source_obj>37</source_obj> <sink_obj>45</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_234"> <id>214</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>46</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_235"> <id>215</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>47</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_236"> <id>216</id> <edge_type>1</edge_type> <source_obj>47</source_obj> <sink_obj>48</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_237"> <id>217</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_238"> <id>219</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_239"> <id>220</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_240"> <id>221</id> <edge_type>1</edge_type> <source_obj>48</source_obj> <sink_obj>50</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_241"> <id>222</id> <edge_type>1</edge_type> <source_obj>49</source_obj> <sink_obj>50</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_242"> <id>225</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>51</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_243"> <id>227</id> <edge_type>1</edge_type> <source_obj>226</source_obj> <sink_obj>51</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_244"> <id>229</id> <edge_type>1</edge_type> <source_obj>228</source_obj> <sink_obj>51</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_245"> <id>230</id> <edge_type>1</edge_type> <source_obj>51</source_obj> <sink_obj>52</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_246"> <id>231</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>53</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_247"> <id>232</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>53</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_248"> <id>233</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>53</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_249"> <id>234</id> <edge_type>1</edge_type> <source_obj>52</source_obj> <sink_obj>54</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_250"> <id>235</id> <edge_type>1</edge_type> <source_obj>53</source_obj> <sink_obj>54</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_251"> <id>237</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>55</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_252"> <id>239</id> <edge_type>1</edge_type> <source_obj>238</source_obj> <sink_obj>55</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_253"> <id>241</id> <edge_type>1</edge_type> <source_obj>240</source_obj> <sink_obj>55</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_254"> <id>242</id> <edge_type>1</edge_type> <source_obj>55</source_obj> <sink_obj>56</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_255"> <id>243</id> <edge_type>1</edge_type> <source_obj>4</source_obj> <sink_obj>57</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_256"> <id>244</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>57</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_257"> <id>245</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>57</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_258"> <id>246</id> <edge_type>1</edge_type> <source_obj>56</source_obj> <sink_obj>58</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_259"> <id>247</id> <edge_type>1</edge_type> <source_obj>57</source_obj> <sink_obj>58</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_260"> <id>249</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>59</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_261"> <id>251</id> <edge_type>1</edge_type> <source_obj>250</source_obj> <sink_obj>59</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_262"> <id>253</id> <edge_type>1</edge_type> <source_obj>252</source_obj> <sink_obj>59</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_263"> <id>254</id> <edge_type>1</edge_type> <source_obj>59</source_obj> <sink_obj>60</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_264"> <id>255</id> <edge_type>1</edge_type> <source_obj>5</source_obj> <sink_obj>61</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_265"> <id>256</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>61</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_266"> <id>257</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>61</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_267"> <id>258</id> <edge_type>1</edge_type> <source_obj>60</source_obj> <sink_obj>62</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_268"> <id>259</id> <edge_type>1</edge_type> <source_obj>61</source_obj> <sink_obj>62</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_269"> <id>261</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>63</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_270"> <id>263</id> <edge_type>1</edge_type> <source_obj>262</source_obj> <sink_obj>63</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_271"> <id>265</id> <edge_type>1</edge_type> <source_obj>264</source_obj> <sink_obj>63</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_272"> <id>266</id> <edge_type>1</edge_type> <source_obj>63</source_obj> <sink_obj>64</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_273"> <id>267</id> <edge_type>1</edge_type> <source_obj>6</source_obj> <sink_obj>65</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_274"> <id>268</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>65</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_275"> <id>269</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>65</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_276"> <id>270</id> <edge_type>1</edge_type> <source_obj>64</source_obj> <sink_obj>66</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_277"> <id>271</id> <edge_type>1</edge_type> <source_obj>65</source_obj> <sink_obj>66</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_278"> <id>273</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>67</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_279"> <id>275</id> <edge_type>1</edge_type> <source_obj>274</source_obj> <sink_obj>67</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_280"> <id>277</id> <edge_type>1</edge_type> <source_obj>276</source_obj> <sink_obj>67</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_281"> <id>278</id> <edge_type>1</edge_type> <source_obj>67</source_obj> <sink_obj>68</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_282"> <id>279</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>69</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_283"> <id>280</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>69</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_284"> <id>281</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>69</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_285"> <id>282</id> <edge_type>1</edge_type> <source_obj>68</source_obj> <sink_obj>70</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_286"> <id>283</id> <edge_type>1</edge_type> <source_obj>69</source_obj> <sink_obj>70</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_287"> <id>285</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>71</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_288"> <id>287</id> <edge_type>1</edge_type> <source_obj>286</source_obj> <sink_obj>71</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_289"> <id>289</id> <edge_type>1</edge_type> <source_obj>288</source_obj> <sink_obj>71</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_290"> <id>290</id> <edge_type>1</edge_type> <source_obj>71</source_obj> <sink_obj>72</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_291"> <id>291</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>73</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_292"> <id>292</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>73</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_293"> <id>293</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>73</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_294"> <id>294</id> <edge_type>1</edge_type> <source_obj>72</source_obj> <sink_obj>74</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_295"> <id>295</id> <edge_type>1</edge_type> <source_obj>73</source_obj> <sink_obj>74</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_296"> <id>297</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>75</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_297"> <id>299</id> <edge_type>1</edge_type> <source_obj>298</source_obj> <sink_obj>75</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_298"> <id>301</id> <edge_type>1</edge_type> <source_obj>300</source_obj> <sink_obj>75</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_299"> <id>302</id> <edge_type>1</edge_type> <source_obj>75</source_obj> <sink_obj>76</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_300"> <id>303</id> <edge_type>1</edge_type> <source_obj>9</source_obj> <sink_obj>77</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_301"> <id>304</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>77</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_302"> <id>305</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>77</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_303"> <id>306</id> <edge_type>1</edge_type> <source_obj>76</source_obj> <sink_obj>78</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_304"> <id>307</id> <edge_type>1</edge_type> <source_obj>77</source_obj> <sink_obj>78</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_305"> <id>309</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>79</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_306"> <id>311</id> <edge_type>1</edge_type> <source_obj>310</source_obj> <sink_obj>79</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_307"> <id>313</id> <edge_type>1</edge_type> <source_obj>312</source_obj> <sink_obj>79</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_308"> <id>314</id> <edge_type>1</edge_type> <source_obj>79</source_obj> <sink_obj>80</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_309"> <id>315</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>81</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_310"> <id>316</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>81</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_311"> <id>317</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>81</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_312"> <id>318</id> <edge_type>1</edge_type> <source_obj>80</source_obj> <sink_obj>82</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_313"> <id>319</id> <edge_type>1</edge_type> <source_obj>81</source_obj> <sink_obj>82</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_314"> <id>321</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>83</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_315"> <id>323</id> <edge_type>1</edge_type> <source_obj>322</source_obj> <sink_obj>83</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_316"> <id>325</id> <edge_type>1</edge_type> <source_obj>324</source_obj> <sink_obj>83</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_317"> <id>326</id> <edge_type>1</edge_type> <source_obj>83</source_obj> <sink_obj>84</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_318"> <id>327</id> <edge_type>1</edge_type> <source_obj>11</source_obj> <sink_obj>85</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_319"> <id>328</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>85</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_320"> <id>329</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>85</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_321"> <id>330</id> <edge_type>1</edge_type> <source_obj>84</source_obj> <sink_obj>86</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_322"> <id>331</id> <edge_type>1</edge_type> <source_obj>85</source_obj> <sink_obj>86</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_323"> <id>333</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>87</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_324"> <id>335</id> <edge_type>1</edge_type> <source_obj>334</source_obj> <sink_obj>87</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_325"> <id>337</id> <edge_type>1</edge_type> <source_obj>336</source_obj> <sink_obj>87</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_326"> <id>338</id> <edge_type>1</edge_type> <source_obj>87</source_obj> <sink_obj>88</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_327"> <id>339</id> <edge_type>1</edge_type> <source_obj>12</source_obj> <sink_obj>89</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_328"> <id>340</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>89</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_329"> <id>341</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>89</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_330"> <id>342</id> <edge_type>1</edge_type> <source_obj>88</source_obj> <sink_obj>90</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_331"> <id>343</id> <edge_type>1</edge_type> <source_obj>89</source_obj> <sink_obj>90</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_332"> <id>345</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>91</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_333"> <id>347</id> <edge_type>1</edge_type> <source_obj>346</source_obj> <sink_obj>91</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_334"> <id>349</id> <edge_type>1</edge_type> <source_obj>348</source_obj> <sink_obj>91</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_335"> <id>350</id> <edge_type>1</edge_type> <source_obj>91</source_obj> <sink_obj>92</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_336"> <id>351</id> <edge_type>1</edge_type> <source_obj>13</source_obj> <sink_obj>93</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_337"> <id>352</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>93</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_338"> <id>353</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>93</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_339"> <id>354</id> <edge_type>1</edge_type> <source_obj>92</source_obj> <sink_obj>94</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_340"> <id>355</id> <edge_type>1</edge_type> <source_obj>93</source_obj> <sink_obj>94</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_341"> <id>357</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>95</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_342"> <id>359</id> <edge_type>1</edge_type> <source_obj>358</source_obj> <sink_obj>95</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_343"> <id>361</id> <edge_type>1</edge_type> <source_obj>360</source_obj> <sink_obj>95</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_344"> <id>362</id> <edge_type>1</edge_type> <source_obj>95</source_obj> <sink_obj>96</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_345"> <id>363</id> <edge_type>1</edge_type> <source_obj>14</source_obj> <sink_obj>97</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_346"> <id>364</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>97</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_347"> <id>365</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>97</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_348"> <id>366</id> <edge_type>1</edge_type> <source_obj>96</source_obj> <sink_obj>98</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_349"> <id>367</id> <edge_type>1</edge_type> <source_obj>97</source_obj> <sink_obj>98</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_350"> <id>369</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>99</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_351"> <id>371</id> <edge_type>1</edge_type> <source_obj>370</source_obj> <sink_obj>99</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_352"> <id>373</id> <edge_type>1</edge_type> <source_obj>372</source_obj> <sink_obj>99</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_353"> <id>374</id> <edge_type>1</edge_type> <source_obj>99</source_obj> <sink_obj>100</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_354"> <id>375</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>101</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_355"> <id>376</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>101</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_356"> <id>377</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>101</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_357"> <id>378</id> <edge_type>1</edge_type> <source_obj>100</source_obj> <sink_obj>102</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_358"> <id>379</id> <edge_type>1</edge_type> <source_obj>101</source_obj> <sink_obj>102</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_359"> <id>381</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>103</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_360"> <id>383</id> <edge_type>1</edge_type> <source_obj>382</source_obj> <sink_obj>103</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_361"> <id>385</id> <edge_type>1</edge_type> <source_obj>384</source_obj> <sink_obj>103</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_362"> <id>386</id> <edge_type>1</edge_type> <source_obj>103</source_obj> <sink_obj>104</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_363"> <id>387</id> <edge_type>1</edge_type> <source_obj>16</source_obj> <sink_obj>105</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_364"> <id>388</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>105</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_365"> <id>389</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>105</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_366"> <id>390</id> <edge_type>1</edge_type> <source_obj>104</source_obj> <sink_obj>106</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_367"> <id>391</id> <edge_type>1</edge_type> <source_obj>105</source_obj> <sink_obj>106</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_368"> <id>393</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>107</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_369"> <id>395</id> <edge_type>1</edge_type> <source_obj>394</source_obj> <sink_obj>107</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_370"> <id>397</id> <edge_type>1</edge_type> <source_obj>396</source_obj> <sink_obj>107</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_371"> <id>398</id> <edge_type>1</edge_type> <source_obj>107</source_obj> <sink_obj>108</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_372"> <id>399</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>109</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_373"> <id>400</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>109</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_374"> <id>401</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>109</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_375"> <id>402</id> <edge_type>1</edge_type> <source_obj>108</source_obj> <sink_obj>110</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_376"> <id>403</id> <edge_type>1</edge_type> <source_obj>109</source_obj> <sink_obj>110</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_377"> <id>404</id> <edge_type>2</edge_type> <source_obj>42</source_obj> <sink_obj>112</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_378"> <id>405</id> <edge_type>1</edge_type> <source_obj>119</source_obj> <sink_obj>116</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_379"> <id>406</id> <edge_type>2</edge_type> <source_obj>192</source_obj> <sink_obj>116</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_380"> <id>407</id> <edge_type>1</edge_type> <source_obj>196</source_obj> <sink_obj>116</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_381"> <id>408</id> <edge_type>2</edge_type> <source_obj>115</source_obj> <sink_obj>116</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_382"> <id>409</id> <edge_type>1</edge_type> <source_obj>116</source_obj> <sink_obj>117</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_383"> <id>410</id> <edge_type>1</edge_type> <source_obj>202</source_obj> <sink_obj>117</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_384"> <id>411</id> <edge_type>1</edge_type> <source_obj>116</source_obj> <sink_obj>119</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_385"> <id>412</id> <edge_type>1</edge_type> <source_obj>205</source_obj> <sink_obj>119</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_386"> <id>413</id> <edge_type>1</edge_type> <source_obj>117</source_obj> <sink_obj>120</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_387"> <id>414</id> <edge_type>2</edge_type> <source_obj>192</source_obj> <sink_obj>120</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_388"> <id>415</id> <edge_type>2</edge_type> <source_obj>194</source_obj> <sink_obj>120</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_389"> <id>417</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>124</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_390"> <id>418</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>125</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_391"> <id>419</id> <edge_type>1</edge_type> <source_obj>125</source_obj> <sink_obj>126</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_392"> <id>420</id> <edge_type>1</edge_type> <source_obj>116</source_obj> <sink_obj>127</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_393"> <id>421</id> <edge_type>1</edge_type> <source_obj>18</source_obj> <sink_obj>128</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_394"> <id>422</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>128</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_395"> <id>423</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>128</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_396"> <id>424</id> <edge_type>1</edge_type> <source_obj>126</source_obj> <sink_obj>129</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_397"> <id>425</id> <edge_type>1</edge_type> <source_obj>128</source_obj> <sink_obj>129</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_398"> <id>427</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>130</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_399"> <id>428</id> <edge_type>1</edge_type> <source_obj>226</source_obj> <sink_obj>130</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_400"> <id>429</id> <edge_type>1</edge_type> <source_obj>228</source_obj> <sink_obj>130</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_401"> <id>430</id> <edge_type>1</edge_type> <source_obj>130</source_obj> <sink_obj>131</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_402"> <id>431</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>132</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_403"> <id>432</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>132</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_404"> <id>433</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>132</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_405"> <id>434</id> <edge_type>1</edge_type> <source_obj>131</source_obj> <sink_obj>133</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_406"> <id>435</id> <edge_type>1</edge_type> <source_obj>132</source_obj> <sink_obj>133</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_407"> <id>437</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>134</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_408"> <id>438</id> <edge_type>1</edge_type> <source_obj>238</source_obj> <sink_obj>134</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_409"> <id>439</id> <edge_type>1</edge_type> <source_obj>240</source_obj> <sink_obj>134</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_410"> <id>440</id> <edge_type>1</edge_type> <source_obj>134</source_obj> <sink_obj>135</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_411"> <id>441</id> <edge_type>1</edge_type> <source_obj>20</source_obj> <sink_obj>136</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_412"> <id>442</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>136</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_413"> <id>443</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>136</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_414"> <id>444</id> <edge_type>1</edge_type> <source_obj>135</source_obj> <sink_obj>137</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_415"> <id>445</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>137</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_416"> <id>447</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>138</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_417"> <id>448</id> <edge_type>1</edge_type> <source_obj>250</source_obj> <sink_obj>138</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_418"> <id>449</id> <edge_type>1</edge_type> <source_obj>252</source_obj> <sink_obj>138</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_419"> <id>450</id> <edge_type>1</edge_type> <source_obj>138</source_obj> <sink_obj>139</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_420"> <id>451</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>140</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_421"> <id>452</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>140</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_422"> <id>453</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>140</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_423"> <id>454</id> <edge_type>1</edge_type> <source_obj>139</source_obj> <sink_obj>141</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_424"> <id>455</id> <edge_type>1</edge_type> <source_obj>140</source_obj> <sink_obj>141</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_425"> <id>457</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>142</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_426"> <id>458</id> <edge_type>1</edge_type> <source_obj>262</source_obj> <sink_obj>142</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_427"> <id>459</id> <edge_type>1</edge_type> <source_obj>264</source_obj> <sink_obj>142</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_428"> <id>460</id> <edge_type>1</edge_type> <source_obj>142</source_obj> <sink_obj>143</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_429"> <id>461</id> <edge_type>1</edge_type> <source_obj>22</source_obj> <sink_obj>144</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_430"> <id>462</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>144</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_431"> <id>463</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>144</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_432"> <id>464</id> <edge_type>1</edge_type> <source_obj>143</source_obj> <sink_obj>145</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_433"> <id>465</id> <edge_type>1</edge_type> <source_obj>144</source_obj> <sink_obj>145</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_434"> <id>467</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>146</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_435"> <id>468</id> <edge_type>1</edge_type> <source_obj>274</source_obj> <sink_obj>146</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_436"> <id>469</id> <edge_type>1</edge_type> <source_obj>276</source_obj> <sink_obj>146</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_437"> <id>470</id> <edge_type>1</edge_type> <source_obj>146</source_obj> <sink_obj>147</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_438"> <id>471</id> <edge_type>1</edge_type> <source_obj>23</source_obj> <sink_obj>148</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_439"> <id>472</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>148</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_440"> <id>473</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>148</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_441"> <id>474</id> <edge_type>1</edge_type> <source_obj>147</source_obj> <sink_obj>149</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_442"> <id>475</id> <edge_type>1</edge_type> <source_obj>148</source_obj> <sink_obj>149</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_443"> <id>477</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>150</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_444"> <id>478</id> <edge_type>1</edge_type> <source_obj>286</source_obj> <sink_obj>150</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_445"> <id>479</id> <edge_type>1</edge_type> <source_obj>288</source_obj> <sink_obj>150</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_446"> <id>480</id> <edge_type>1</edge_type> <source_obj>150</source_obj> <sink_obj>151</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_447"> <id>481</id> <edge_type>1</edge_type> <source_obj>24</source_obj> <sink_obj>152</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_448"> <id>482</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>152</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_449"> <id>483</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>152</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_450"> <id>484</id> <edge_type>1</edge_type> <source_obj>151</source_obj> <sink_obj>153</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_451"> <id>485</id> <edge_type>1</edge_type> <source_obj>152</source_obj> <sink_obj>153</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_452"> <id>487</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>154</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_453"> <id>488</id> <edge_type>1</edge_type> <source_obj>298</source_obj> <sink_obj>154</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_454"> <id>489</id> <edge_type>1</edge_type> <source_obj>300</source_obj> <sink_obj>154</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_455"> <id>490</id> <edge_type>1</edge_type> <source_obj>154</source_obj> <sink_obj>155</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_456"> <id>491</id> <edge_type>1</edge_type> <source_obj>25</source_obj> <sink_obj>156</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_457"> <id>492</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>156</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_458"> <id>493</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>156</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_459"> <id>494</id> <edge_type>1</edge_type> <source_obj>155</source_obj> <sink_obj>157</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_460"> <id>495</id> <edge_type>1</edge_type> <source_obj>156</source_obj> <sink_obj>157</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_461"> <id>497</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>158</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_462"> <id>498</id> <edge_type>1</edge_type> <source_obj>310</source_obj> <sink_obj>158</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_463"> <id>499</id> <edge_type>1</edge_type> <source_obj>312</source_obj> <sink_obj>158</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_464"> <id>500</id> <edge_type>1</edge_type> <source_obj>158</source_obj> <sink_obj>159</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_465"> <id>501</id> <edge_type>1</edge_type> <source_obj>26</source_obj> <sink_obj>160</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_466"> <id>502</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>160</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_467"> <id>503</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>160</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_468"> <id>504</id> <edge_type>1</edge_type> <source_obj>159</source_obj> <sink_obj>161</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_469"> <id>505</id> <edge_type>1</edge_type> <source_obj>160</source_obj> <sink_obj>161</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_470"> <id>507</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>162</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_471"> <id>508</id> <edge_type>1</edge_type> <source_obj>322</source_obj> <sink_obj>162</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_472"> <id>509</id> <edge_type>1</edge_type> <source_obj>324</source_obj> <sink_obj>162</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_473"> <id>510</id> <edge_type>1</edge_type> <source_obj>162</source_obj> <sink_obj>163</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_474"> <id>511</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>164</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_475"> <id>512</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>164</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_476"> <id>513</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>164</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_477"> <id>514</id> <edge_type>1</edge_type> <source_obj>163</source_obj> <sink_obj>165</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_478"> <id>515</id> <edge_type>1</edge_type> <source_obj>164</source_obj> <sink_obj>165</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_479"> <id>517</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>166</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_480"> <id>518</id> <edge_type>1</edge_type> <source_obj>334</source_obj> <sink_obj>166</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_481"> <id>519</id> <edge_type>1</edge_type> <source_obj>336</source_obj> <sink_obj>166</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_482"> <id>520</id> <edge_type>1</edge_type> <source_obj>166</source_obj> <sink_obj>167</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_483"> <id>521</id> <edge_type>1</edge_type> <source_obj>28</source_obj> <sink_obj>168</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_484"> <id>522</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>168</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_485"> <id>523</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>168</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_486"> <id>524</id> <edge_type>1</edge_type> <source_obj>167</source_obj> <sink_obj>169</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_487"> <id>525</id> <edge_type>1</edge_type> <source_obj>168</source_obj> <sink_obj>169</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_488"> <id>527</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>170</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_489"> <id>528</id> <edge_type>1</edge_type> <source_obj>346</source_obj> <sink_obj>170</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_490"> <id>529</id> <edge_type>1</edge_type> <source_obj>348</source_obj> <sink_obj>170</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_491"> <id>530</id> <edge_type>1</edge_type> <source_obj>170</source_obj> <sink_obj>171</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_492"> <id>531</id> <edge_type>1</edge_type> <source_obj>29</source_obj> <sink_obj>172</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_493"> <id>532</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>172</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_494"> <id>533</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>172</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_495"> <id>534</id> <edge_type>1</edge_type> <source_obj>171</source_obj> <sink_obj>173</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_496"> <id>535</id> <edge_type>1</edge_type> <source_obj>172</source_obj> <sink_obj>173</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_497"> <id>537</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>174</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_498"> <id>538</id> <edge_type>1</edge_type> <source_obj>358</source_obj> <sink_obj>174</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_499"> <id>539</id> <edge_type>1</edge_type> <source_obj>360</source_obj> <sink_obj>174</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_500"> <id>540</id> <edge_type>1</edge_type> <source_obj>174</source_obj> <sink_obj>175</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_501"> <id>541</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>176</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_502"> <id>542</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>176</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_503"> <id>543</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>176</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_504"> <id>544</id> <edge_type>1</edge_type> <source_obj>175</source_obj> <sink_obj>177</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_505"> <id>545</id> <edge_type>1</edge_type> <source_obj>176</source_obj> <sink_obj>177</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_506"> <id>547</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>178</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_507"> <id>548</id> <edge_type>1</edge_type> <source_obj>370</source_obj> <sink_obj>178</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_508"> <id>549</id> <edge_type>1</edge_type> <source_obj>372</source_obj> <sink_obj>178</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_509"> <id>550</id> <edge_type>1</edge_type> <source_obj>178</source_obj> <sink_obj>179</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_510"> <id>551</id> <edge_type>1</edge_type> <source_obj>31</source_obj> <sink_obj>180</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_511"> <id>552</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>180</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_512"> <id>553</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>180</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_513"> <id>554</id> <edge_type>1</edge_type> <source_obj>179</source_obj> <sink_obj>181</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_514"> <id>555</id> <edge_type>1</edge_type> <source_obj>180</source_obj> <sink_obj>181</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_515"> <id>557</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>182</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_516"> <id>558</id> <edge_type>1</edge_type> <source_obj>382</source_obj> <sink_obj>182</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_517"> <id>559</id> <edge_type>1</edge_type> <source_obj>384</source_obj> <sink_obj>182</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_518"> <id>560</id> <edge_type>1</edge_type> <source_obj>182</source_obj> <sink_obj>183</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_519"> <id>561</id> <edge_type>1</edge_type> <source_obj>32</source_obj> <sink_obj>184</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_520"> <id>562</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>184</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_521"> <id>563</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>184</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_522"> <id>564</id> <edge_type>1</edge_type> <source_obj>183</source_obj> <sink_obj>185</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_523"> <id>565</id> <edge_type>1</edge_type> <source_obj>184</source_obj> <sink_obj>185</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_524"> <id>567</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>186</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_525"> <id>568</id> <edge_type>1</edge_type> <source_obj>394</source_obj> <sink_obj>186</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_526"> <id>569</id> <edge_type>1</edge_type> <source_obj>396</source_obj> <sink_obj>186</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_527"> <id>570</id> <edge_type>1</edge_type> <source_obj>186</source_obj> <sink_obj>187</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_528"> <id>571</id> <edge_type>1</edge_type> <source_obj>33</source_obj> <sink_obj>188</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_529"> <id>572</id> <edge_type>1</edge_type> <source_obj>218</source_obj> <sink_obj>188</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_530"> <id>573</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>188</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_531"> <id>574</id> <edge_type>1</edge_type> <source_obj>187</source_obj> <sink_obj>189</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_532"> <id>575</id> <edge_type>1</edge_type> <source_obj>188</source_obj> <sink_obj>189</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_533"> <id>576</id> <edge_type>2</edge_type> <source_obj>121</source_obj> <sink_obj>191</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_534"> <id>643</id> <edge_type>2</edge_type> <source_obj>36</source_obj> <sink_obj>42</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_535"> <id>644</id> <edge_type>2</edge_type> <source_obj>42</source_obj> <sink_obj>115</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_536"> <id>645</id> <edge_type>2</edge_type> <source_obj>42</source_obj> <sink_obj>113</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_537"> <id>646</id> <edge_type>2</edge_type> <source_obj>113</source_obj> <sink_obj>42</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_538"> <id>647</id> <edge_type>2</edge_type> <source_obj>115</source_obj> <sink_obj>121</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_539"> <id>648</id> <edge_type>2</edge_type> <source_obj>121</source_obj> <sink_obj>194</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_540"> <id>649</id> <edge_type>2</edge_type> <source_obj>121</source_obj> <sink_obj>192</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_541"> <id>650</id> <edge_type>2</edge_type> <source_obj>192</source_obj> <sink_obj>121</sink_obj> <is_back_edge>1</is_back_edge> </item> </edges> </cdfg> <cdfg_regions class_id="21" tracking_level="0" version="0"> <count>6</count> <item_version>0</item_version> <item class_id="22" tracking_level="1" version="0" object_id="_542"> <mId>1</mId> <mTag>load_cifm_data_pool</mTag> <mType>0</mType> <sub_regions> <count>5</count> <item_version>0</item_version> <item>2</item> <item>3</item> <item>4</item> <item>5</item> <item>6</item> </sub_regions> <basic_blocks> <count>0</count> <item_version>0</item_version> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>120</mMinLatency> <mMaxLatency>120</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_543"> <mId>2</mId> <mTag>Entry</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>36</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>0</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_544"> <mId>3</mId> <mTag>Loop 1</mTag> <mType>1</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>42</item> <item>113</item> </basic_blocks> <mII>1</mII> <mDepth>1</mDepth> <mMinTripCount>58</mMinTripCount> <mMaxTripCount>58</mMaxTripCount> <mMinLatency>58</mMinLatency> <mMaxLatency>58</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_545"> <mId>4</mId> <mTag>Region 1</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>115</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>0</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_546"> <mId>5</mId> <mTag>Loop 2</mTag> <mType>1</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>121</item> <item>192</item> </basic_blocks> <mII>1</mII> <mDepth>1</mDepth> <mMinTripCount>58</mMinTripCount> <mMaxTripCount>58</mMaxTripCount> <mMinLatency>58</mMinLatency> <mMaxLatency>58</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_547"> <mId>6</mId> <mTag>Return</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>194</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>0</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> </cdfg_regions> <fsm class_id="24" tracking_level="1" version="0" object_id="_548"> <states class_id="25" tracking_level="0" version="0"> <count>5</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_549"> <id>1</id> <operations class_id="27" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_550"> <id>34</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_551"> <id>35</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_552"> <id>2</id> <operations> <count>75</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_553"> <id>37</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_554"> <id>38</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_555"> <id>39</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_556"> <id>40</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_557"> <id>41</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_558"> <id>43</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_559"> <id>44</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_560"> <id>45</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_561"> <id>46</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_562"> <id>47</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_563"> <id>48</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_564"> <id>49</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_565"> <id>50</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_566"> <id>51</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_567"> <id>52</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_568"> <id>53</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_569"> <id>54</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_570"> <id>55</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_571"> <id>56</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_572"> <id>57</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_573"> <id>58</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_574"> <id>59</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_575"> <id>60</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_576"> <id>61</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_577"> <id>62</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_578"> <id>63</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_579"> <id>64</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_580"> <id>65</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_581"> <id>66</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_582"> <id>67</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_583"> <id>68</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_584"> <id>69</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_585"> <id>70</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_586"> <id>71</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_587"> <id>72</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_588"> <id>73</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_589"> <id>74</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_590"> <id>75</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_591"> <id>76</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_592"> <id>77</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_593"> <id>78</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_594"> <id>79</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_595"> <id>80</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_596"> <id>81</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_597"> <id>82</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_598"> <id>83</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_599"> <id>84</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_600"> <id>85</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_601"> <id>86</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_602"> <id>87</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_603"> <id>88</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_604"> <id>89</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_605"> <id>90</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_606"> <id>91</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_607"> <id>92</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_608"> <id>93</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_609"> <id>94</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_610"> <id>95</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_611"> <id>96</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_612"> <id>97</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_613"> <id>98</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_614"> <id>99</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_615"> <id>100</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_616"> <id>101</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_617"> <id>102</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_618"> <id>103</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_619"> <id>104</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_620"> <id>105</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_621"> <id>106</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_622"> <id>107</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_623"> <id>108</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_624"> <id>109</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_625"> <id>110</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_626"> <id>111</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_627"> <id>112</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_628"> <id>3</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_629"> <id>114</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_630"> <id>4</id> <operations> <count>75</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_631"> <id>116</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_632"> <id>117</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_633"> <id>118</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_634"> <id>119</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_635"> <id>120</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_636"> <id>122</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_637"> <id>123</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_638"> <id>124</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_639"> <id>125</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_640"> <id>126</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_641"> <id>127</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_642"> <id>128</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_643"> <id>129</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_644"> <id>130</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_645"> <id>131</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_646"> <id>132</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_647"> <id>133</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_648"> <id>134</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_649"> <id>135</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_650"> <id>136</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_651"> <id>137</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_652"> <id>138</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_653"> <id>139</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_654"> <id>140</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_655"> <id>141</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_656"> <id>142</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_657"> <id>143</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_658"> <id>144</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_659"> <id>145</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_660"> <id>146</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_661"> <id>147</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_662"> <id>148</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_663"> <id>149</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_664"> <id>150</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_665"> <id>151</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_666"> <id>152</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_667"> <id>153</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_668"> <id>154</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_669"> <id>155</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_670"> <id>156</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_671"> <id>157</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_672"> <id>158</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_673"> <id>159</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_674"> <id>160</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_675"> <id>161</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_676"> <id>162</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_677"> <id>163</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_678"> <id>164</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_679"> <id>165</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_680"> <id>166</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_681"> <id>167</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_682"> <id>168</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_683"> <id>169</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_684"> <id>170</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_685"> <id>171</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_686"> <id>172</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_687"> <id>173</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_688"> <id>174</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_689"> <id>175</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_690"> <id>176</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_691"> <id>177</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_692"> <id>178</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_693"> <id>179</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_694"> <id>180</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_695"> <id>181</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_696"> <id>182</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_697"> <id>183</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_698"> <id>184</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_699"> <id>185</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_700"> <id>186</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_701"> <id>187</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_702"> <id>188</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_703"> <id>189</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_704"> <id>190</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_705"> <id>191</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_706"> <id>5</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_707"> <id>193</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="29" tracking_level="0" version="0"> <count>6</count> <item_version>0</item_version> <item class_id="30" tracking_level="1" version="0" object_id="_708"> <inState>1</inState> <outState>2</outState> <condition class_id="31" tracking_level="0" version="0"> <id>-1</id> <sop class_id="32" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="33" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_709"> <inState>3</inState> <outState>4</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_710"> <inState>2</inState> <outState>3</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item class_id="34" tracking_level="0" version="0"> <first class_id="35" tracking_level="0" version="0"> <first>38</first> <second>0</second> </first> <second>0</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_711"> <inState>2</inState> <outState>2</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item> <first> <first>38</first> <second>0</second> </first> <second>1</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_712"> <inState>4</inState> <outState>5</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item> <first> <first>117</first> <second>0</second> </first> <second>0</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_713"> <inState>4</inState> <outState>4</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item> <first> <first>117</first> <second>0</second> </first> <second>1</second> </item> </item> </sop> </condition> </item> </transitions> </fsm> <res class_id="-1"></res> <node_label_latency class_id="37" tracking_level="0" version="0"> <count>145</count> <item_version>0</item_version> <item class_id="38" tracking_level="0" version="0"> <first>35</first> <second class_id="39" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>37</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>38</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>40</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>41</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>45</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>46</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>47</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>48</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>49</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>50</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>51</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>52</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>53</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>54</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>55</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>56</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>57</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>58</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>59</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>60</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>61</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>62</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>63</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>64</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>65</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>66</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>67</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>68</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>69</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>70</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>71</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>72</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>73</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>74</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>75</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>76</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>77</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>78</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>79</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>80</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>81</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>82</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>83</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>84</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>85</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>86</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>87</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>88</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>89</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>90</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>91</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>92</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>93</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>94</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>95</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>96</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>97</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>98</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>99</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>100</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>101</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>102</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>103</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>104</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>105</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>106</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>107</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>108</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>109</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>110</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>112</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>114</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>116</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>117</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>119</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>120</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>124</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>125</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>126</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>127</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>128</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>129</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>130</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>131</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>132</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>133</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>134</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>135</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>136</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>137</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>138</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>139</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>140</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>141</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>142</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>143</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>144</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>145</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>146</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>147</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>148</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>149</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>150</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>151</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>152</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>153</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>154</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>155</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>156</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>157</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>158</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>159</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>160</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>161</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>162</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>163</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>164</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>165</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>166</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>167</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>168</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>169</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>170</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>171</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>172</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>173</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>174</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>175</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>176</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>177</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>178</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>179</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>180</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>181</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>182</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>183</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>184</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>185</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>186</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>187</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>188</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>189</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>191</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>193</first> <second> <first>4</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="40" tracking_level="0" version="0"> <count>7</count> <item_version>0</item_version> <item class_id="41" tracking_level="0" version="0"> <first>36</first> <second class_id="42" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>42</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>113</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>115</first> <second> <first>2</first> <second>2</second> </second> </item> <item> <first>121</first> <second> <first>3</first> <second>3</second> </second> </item> <item> <first>192</first> <second> <first>3</first> <second>3</second> </second> </item> <item> <first>194</first> <second> <first>4</first> <second>4</second> </second> </item> </bblk_ent_exit> <regions class_id="43" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="44" tracking_level="1" version="0" object_id="_714"> <region_name>Loop 1</region_name> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>42</item> <item>113</item> </basic_blocks> <nodes> <count>0</count> <item_version>0</item_version> </nodes> <anchor_node>-1</anchor_node> <region_type>8</region_type> <interval>1</interval> <pipe_depth>1</pipe_depth> </item> <item class_id_reference="44" object_id="_715"> <region_name>Loop 2</region_name> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>121</item> <item>192</item> </basic_blocks> <nodes> <count>0</count> <item_version>0</item_version> </nodes> <anchor_node>-1</anchor_node> <region_type>8</region_type> <interval>1</interval> <pipe_depth>1</pipe_depth> </item> </regions> <dp_fu_nodes class_id="45" tracking_level="0" version="0"> <count>122</count> <item_version>0</item_version> <item class_id="46" tracking_level="0" version="0"> <first>166</first> <second> <count>2</count> <item_version>0</item_version> <item>46</item> <item>124</item> </second> </item> <item> <first>172</first> <second> <count>1</count> <item_version>0</item_version> <item>49</item> </second> </item> <item> <first>179</first> <second> <count>1</count> <item_version>0</item_version> <item>50</item> </second> </item> <item> <first>185</first> <second> <count>1</count> <item_version>0</item_version> <item>53</item> </second> </item> <item> <first>192</first> <second> <count>1</count> <item_version>0</item_version> <item>54</item> </second> </item> <item> <first>198</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> <item> <first>205</first> <second> <count>1</count> <item_version>0</item_version> <item>58</item> </second> </item> <item> <first>211</first> <second> <count>1</count> <item_version>0</item_version> <item>61</item> </second> </item> <item> <first>218</first> <second> <count>1</count> <item_version>0</item_version> <item>62</item> </second> </item> <item> <first>224</first> <second> <count>1</count> <item_version>0</item_version> <item>65</item> </second> </item> <item> <first>231</first> <second> <count>1</count> <item_version>0</item_version> <item>66</item> </second> </item> <item> <first>237</first> <second> <count>1</count> <item_version>0</item_version> <item>69</item> </second> </item> <item> <first>244</first> <second> <count>1</count> <item_version>0</item_version> <item>70</item> </second> </item> <item> <first>250</first> <second> <count>1</count> <item_version>0</item_version> <item>73</item> </second> </item> <item> <first>257</first> <second> <count>1</count> <item_version>0</item_version> <item>74</item> </second> </item> <item> <first>263</first> <second> <count>1</count> <item_version>0</item_version> <item>77</item> </second> </item> <item> <first>270</first> <second> <count>1</count> <item_version>0</item_version> <item>78</item> </second> </item> <item> <first>276</first> <second> <count>1</count> <item_version>0</item_version> <item>81</item> </second> </item> <item> <first>283</first> <second> <count>1</count> <item_version>0</item_version> <item>82</item> </second> </item> <item> <first>289</first> <second> <count>1</count> <item_version>0</item_version> <item>85</item> </second> </item> <item> <first>296</first> <second> <count>1</count> <item_version>0</item_version> <item>86</item> </second> </item> <item> <first>302</first> <second> <count>1</count> <item_version>0</item_version> <item>89</item> </second> </item> <item> <first>309</first> <second> <count>1</count> <item_version>0</item_version> <item>90</item> </second> </item> <item> <first>315</first> <second> <count>1</count> <item_version>0</item_version> <item>93</item> </second> </item> <item> <first>322</first> <second> <count>1</count> <item_version>0</item_version> <item>94</item> </second> </item> <item> <first>328</first> <second> <count>1</count> <item_version>0</item_version> <item>97</item> </second> </item> <item> <first>335</first> <second> <count>1</count> <item_version>0</item_version> <item>98</item> </second> </item> <item> <first>341</first> <second> <count>1</count> <item_version>0</item_version> <item>101</item> </second> </item> <item> <first>348</first> <second> <count>1</count> <item_version>0</item_version> <item>102</item> </second> </item> <item> <first>354</first> <second> <count>1</count> <item_version>0</item_version> <item>105</item> </second> </item> <item> <first>361</first> <second> <count>1</count> <item_version>0</item_version> <item>106</item> </second> </item> <item> <first>367</first> <second> <count>1</count> <item_version>0</item_version> <item>109</item> </second> </item> <item> <first>374</first> <second> <count>1</count> <item_version>0</item_version> <item>110</item> </second> </item> <item> <first>380</first> <second> <count>1</count> <item_version>0</item_version> <item>128</item> </second> </item> <item> <first>387</first> <second> <count>1</count> <item_version>0</item_version> <item>129</item> </second> </item> <item> <first>393</first> <second> <count>1</count> <item_version>0</item_version> <item>132</item> </second> </item> <item> <first>400</first> <second> <count>1</count> <item_version>0</item_version> <item>133</item> </second> </item> <item> <first>406</first> <second> <count>1</count> <item_version>0</item_version> <item>136</item> </second> </item> <item> <first>413</first> <second> <count>1</count> <item_version>0</item_version> <item>137</item> </second> </item> <item> <first>419</first> <second> <count>1</count> <item_version>0</item_version> <item>140</item> </second> </item> <item> <first>426</first> <second> <count>1</count> <item_version>0</item_version> <item>141</item> </second> </item> <item> <first>432</first> <second> <count>1</count> <item_version>0</item_version> <item>144</item> </second> </item> <item> <first>439</first> <second> <count>1</count> <item_version>0</item_version> <item>145</item> </second> </item> <item> <first>445</first> <second> <count>1</count> <item_version>0</item_version> <item>148</item> </second> </item> <item> <first>452</first> <second> <count>1</count> <item_version>0</item_version> <item>149</item> </second> </item> <item> <first>458</first> <second> <count>1</count> <item_version>0</item_version> <item>152</item> </second> </item> <item> <first>465</first> <second> <count>1</count> <item_version>0</item_version> <item>153</item> </second> </item> <item> <first>471</first> <second> <count>1</count> <item_version>0</item_version> <item>156</item> </second> </item> <item> <first>478</first> <second> <count>1</count> <item_version>0</item_version> <item>157</item> </second> </item> <item> <first>484</first> <second> <count>1</count> <item_version>0</item_version> <item>160</item> </second> </item> <item> <first>491</first> <second> <count>1</count> <item_version>0</item_version> <item>161</item> </second> </item> <item> <first>497</first> <second> <count>1</count> <item_version>0</item_version> <item>164</item> </second> </item> <item> <first>504</first> <second> <count>1</count> <item_version>0</item_version> <item>165</item> </second> </item> <item> <first>510</first> <second> <count>1</count> <item_version>0</item_version> <item>168</item> </second> </item> <item> <first>517</first> <second> <count>1</count> <item_version>0</item_version> <item>169</item> </second> </item> <item> <first>523</first> <second> <count>1</count> <item_version>0</item_version> <item>172</item> </second> </item> <item> <first>530</first> <second> <count>1</count> <item_version>0</item_version> <item>173</item> </second> </item> <item> <first>536</first> <second> <count>1</count> <item_version>0</item_version> <item>176</item> </second> </item> <item> <first>543</first> <second> <count>1</count> <item_version>0</item_version> <item>177</item> </second> </item> <item> <first>549</first> <second> <count>1</count> <item_version>0</item_version> <item>180</item> </second> </item> <item> <first>556</first> <second> <count>1</count> <item_version>0</item_version> <item>181</item> </second> </item> <item> <first>562</first> <second> <count>1</count> <item_version>0</item_version> <item>184</item> </second> </item> <item> <first>569</first> <second> <count>1</count> <item_version>0</item_version> <item>185</item> </second> </item> <item> <first>575</first> <second> <count>1</count> <item_version>0</item_version> <item>188</item> </second> </item> <item> <first>582</first> <second> <count>1</count> <item_version>0</item_version> <item>189</item> </second> </item> <item> <first>592</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>603</first> <second> <count>1</count> <item_version>0</item_version> <item>116</item> </second> </item> <item> <first>610</first> <second> <count>2</count> <item_version>0</item_version> <item>51</item> <item>130</item> </second> </item> <item> <first>620</first> <second> <count>2</count> <item_version>0</item_version> <item>55</item> <item>134</item> </second> </item> <item> <first>630</first> <second> <count>2</count> <item_version>0</item_version> <item>59</item> <item>138</item> </second> </item> <item> <first>640</first> <second> <count>2</count> <item_version>0</item_version> <item>63</item> <item>142</item> </second> </item> <item> <first>650</first> <second> <count>2</count> <item_version>0</item_version> <item>67</item> <item>146</item> </second> </item> <item> <first>660</first> <second> <count>2</count> <item_version>0</item_version> <item>71</item> <item>150</item> </second> </item> <item> <first>670</first> <second> <count>2</count> <item_version>0</item_version> <item>75</item> <item>154</item> </second> </item> <item> <first>680</first> <second> <count>2</count> <item_version>0</item_version> <item>79</item> <item>158</item> </second> </item> <item> <first>690</first> <second> <count>2</count> <item_version>0</item_version> <item>83</item> <item>162</item> </second> </item> <item> <first>700</first> <second> <count>2</count> <item_version>0</item_version> <item>87</item> <item>166</item> </second> </item> <item> <first>710</first> <second> <count>2</count> <item_version>0</item_version> <item>91</item> <item>170</item> </second> </item> <item> <first>720</first> <second> <count>2</count> <item_version>0</item_version> <item>95</item> <item>174</item> </second> </item> <item> <first>730</first> <second> <count>2</count> <item_version>0</item_version> <item>99</item> <item>178</item> </second> </item> <item> <first>740</first> <second> <count>2</count> <item_version>0</item_version> <item>103</item> <item>182</item> </second> </item> <item> <first>750</first> <second> <count>2</count> <item_version>0</item_version> <item>107</item> <item>186</item> </second> </item> <item> <first>760</first> <second> <count>1</count> <item_version>0</item_version> <item>38</item> </second> </item> <item> <first>766</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>772</first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>792</first> <second> <count>1</count> <item_version>0</item_version> <item>47</item> </second> </item> <item> <first>796</first> <second> <count>1</count> <item_version>0</item_version> <item>48</item> </second> </item> <item> <first>801</first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first>806</first> <second> <count>1</count> <item_version>0</item_version> <item>56</item> </second> </item> <item> <first>811</first> <second> <count>1</count> <item_version>0</item_version> <item>60</item> </second> </item> <item> <first>816</first> <second> <count>1</count> <item_version>0</item_version> <item>64</item> </second> </item> <item> <first>821</first> <second> <count>1</count> <item_version>0</item_version> <item>68</item> </second> </item> <item> <first>826</first> <second> <count>1</count> <item_version>0</item_version> <item>72</item> </second> </item> <item> <first>831</first> <second> <count>1</count> <item_version>0</item_version> <item>76</item> </second> </item> <item> <first>836</first> <second> <count>1</count> <item_version>0</item_version> <item>80</item> </second> </item> <item> <first>841</first> <second> <count>1</count> <item_version>0</item_version> <item>84</item> </second> </item> <item> <first>846</first> <second> <count>1</count> <item_version>0</item_version> <item>88</item> </second> </item> <item> <first>851</first> <second> <count>1</count> <item_version>0</item_version> <item>92</item> </second> </item> <item> <first>856</first> <second> <count>1</count> <item_version>0</item_version> <item>96</item> </second> </item> <item> <first>861</first> <second> <count>1</count> <item_version>0</item_version> <item>100</item> </second> </item> <item> <first>866</first> <second> <count>1</count> <item_version>0</item_version> <item>104</item> </second> </item> <item> <first>871</first> <second> <count>1</count> <item_version>0</item_version> <item>108</item> </second> </item> <item> <first>876</first> <second> <count>1</count> <item_version>0</item_version> <item>117</item> </second> </item> <item> <first>882</first> <second> <count>1</count> <item_version>0</item_version> <item>119</item> </second> </item> <item> <first>888</first> <second> <count>1</count> <item_version>0</item_version> <item>125</item> </second> </item> <item> <first>892</first> <second> <count>1</count> <item_version>0</item_version> <item>126</item> </second> </item> <item> <first>897</first> <second> <count>1</count> <item_version>0</item_version> <item>127</item> </second> </item> <item> <first>917</first> <second> <count>1</count> <item_version>0</item_version> <item>131</item> </second> </item> <item> <first>922</first> <second> <count>1</count> <item_version>0</item_version> <item>135</item> </second> </item> <item> <first>927</first> <second> <count>1</count> <item_version>0</item_version> <item>139</item> </second> </item> <item> <first>932</first> <second> <count>1</count> <item_version>0</item_version> <item>143</item> </second> </item> <item> <first>937</first> <second> <count>1</count> <item_version>0</item_version> <item>147</item> </second> </item> <item> <first>942</first> <second> <count>1</count> <item_version>0</item_version> <item>151</item> </second> </item> <item> <first>947</first> <second> <count>1</count> <item_version>0</item_version> <item>155</item> </second> </item> <item> <first>952</first> <second> <count>1</count> <item_version>0</item_version> <item>159</item> </second> </item> <item> <first>957</first> <second> <count>1</count> <item_version>0</item_version> <item>163</item> </second> </item> <item> <first>962</first> <second> <count>1</count> <item_version>0</item_version> <item>167</item> </second> </item> <item> <first>967</first> <second> <count>1</count> <item_version>0</item_version> <item>171</item> </second> </item> <item> <first>972</first> <second> <count>1</count> <item_version>0</item_version> <item>175</item> </second> </item> <item> <first>977</first> <second> <count>1</count> <item_version>0</item_version> <item>179</item> </second> </item> <item> <first>982</first> <second> <count>1</count> <item_version>0</item_version> <item>183</item> </second> </item> <item> <first>987</first> <second> <count>1</count> <item_version>0</item_version> <item>187</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="48" tracking_level="0" version="0"> <count>89</count> <item_version>0</item_version> <item class_id="49" tracking_level="0" version="0"> <first>bitcast_ln13_fu_796</first> <second> <count>1</count> <item_version>0</item_version> <item>48</item> </second> </item> <item> <first>bitcast_ln14_fu_801</first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first>bitcast_ln15_fu_806</first> <second> <count>1</count> <item_version>0</item_version> <item>56</item> </second> </item> <item> <first>bitcast_ln16_fu_811</first> <second> <count>1</count> <item_version>0</item_version> <item>60</item> </second> </item> <item> <first>bitcast_ln17_fu_816</first> <second> <count>1</count> <item_version>0</item_version> <item>64</item> </second> </item> <item> <first>bitcast_ln18_fu_821</first> <second> <count>1</count> <item_version>0</item_version> <item>68</item> </second> </item> <item> <first>bitcast_ln19_fu_826</first> <second> <count>1</count> <item_version>0</item_version> <item>72</item> </second> </item> <item> <first>bitcast_ln20_fu_831</first> <second> <count>1</count> <item_version>0</item_version> <item>76</item> </second> </item> <item> <first>bitcast_ln21_fu_836</first> <second> <count>1</count> <item_version>0</item_version> <item>80</item> </second> </item> <item> <first>bitcast_ln22_fu_841</first> <second> <count>1</count> <item_version>0</item_version> <item>84</item> </second> </item> <item> <first>bitcast_ln23_fu_846</first> <second> <count>1</count> <item_version>0</item_version> <item>88</item> </second> </item> <item> <first>bitcast_ln24_fu_851</first> <second> <count>1</count> <item_version>0</item_version> <item>92</item> </second> </item> <item> <first>bitcast_ln25_fu_856</first> <second> <count>1</count> <item_version>0</item_version> <item>96</item> </second> </item> <item> <first>bitcast_ln26_fu_861</first> <second> <count>1</count> <item_version>0</item_version> <item>100</item> </second> </item> <item> <first>bitcast_ln27_fu_866</first> <second> <count>1</count> <item_version>0</item_version> <item>104</item> </second> </item> <item> <first>bitcast_ln28_fu_871</first> <second> <count>1</count> <item_version>0</item_version> <item>108</item> </second> </item> <item> <first>bitcast_ln36_fu_892</first> <second> <count>1</count> <item_version>0</item_version> <item>126</item> </second> </item> <item> <first>bitcast_ln37_fu_917</first> <second> <count>1</count> <item_version>0</item_version> <item>131</item> </second> </item> <item> <first>bitcast_ln38_fu_922</first> <second> <count>1</count> <item_version>0</item_version> <item>135</item> </second> </item> <item> <first>bitcast_ln39_fu_927</first> <second> <count>1</count> <item_version>0</item_version> <item>139</item> </second> </item> <item> <first>bitcast_ln40_fu_932</first> <second> <count>1</count> <item_version>0</item_version> <item>143</item> </second> </item> <item> <first>bitcast_ln41_fu_937</first> <second> <count>1</count> <item_version>0</item_version> <item>147</item> </second> </item> <item> <first>bitcast_ln42_fu_942</first> <second> <count>1</count> <item_version>0</item_version> <item>151</item> </second> </item> <item> <first>bitcast_ln43_fu_947</first> <second> <count>1</count> <item_version>0</item_version> <item>155</item> </second> </item> <item> <first>bitcast_ln44_fu_952</first> <second> <count>1</count> <item_version>0</item_version> <item>159</item> </second> </item> <item> <first>bitcast_ln45_fu_957</first> <second> <count>1</count> <item_version>0</item_version> <item>163</item> </second> </item> <item> <first>bitcast_ln46_fu_962</first> <second> <count>1</count> <item_version>0</item_version> <item>167</item> </second> </item> <item> <first>bitcast_ln47_fu_967</first> <second> <count>1</count> <item_version>0</item_version> <item>171</item> </second> </item> <item> <first>bitcast_ln48_fu_972</first> <second> <count>1</count> <item_version>0</item_version> <item>175</item> </second> </item> <item> <first>bitcast_ln49_fu_977</first> <second> <count>1</count> <item_version>0</item_version> <item>179</item> </second> </item> <item> <first>bitcast_ln50_fu_982</first> <second> <count>1</count> <item_version>0</item_version> <item>183</item> </second> </item> <item> <first>bitcast_ln51_fu_987</first> <second> <count>1</count> <item_version>0</item_version> <item>187</item> </second> </item> <item> <first>cifm_counter_0_phi_fu_592</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>grp_fu_610</first> <second> <count>2</count> <item_version>0</item_version> <item>51</item> <item>130</item> </second> </item> <item> <first>grp_fu_620</first> <second> <count>2</count> <item_version>0</item_version> <item>55</item> <item>134</item> </second> </item> <item> <first>grp_fu_630</first> <second> <count>2</count> <item_version>0</item_version> <item>59</item> <item>138</item> </second> </item> <item> <first>grp_fu_640</first> <second> <count>2</count> <item_version>0</item_version> <item>63</item> <item>142</item> </second> </item> <item> <first>grp_fu_650</first> <second> <count>2</count> <item_version>0</item_version> <item>67</item> <item>146</item> </second> </item> <item> <first>grp_fu_660</first> <second> <count>2</count> <item_version>0</item_version> <item>71</item> <item>150</item> </second> </item> <item> <first>grp_fu_670</first> <second> <count>2</count> <item_version>0</item_version> <item>75</item> <item>154</item> </second> </item> <item> <first>grp_fu_680</first> <second> <count>2</count> <item_version>0</item_version> <item>79</item> <item>158</item> </second> </item> <item> <first>grp_fu_690</first> <second> <count>2</count> <item_version>0</item_version> <item>83</item> <item>162</item> </second> </item> <item> <first>grp_fu_700</first> <second> <count>2</count> <item_version>0</item_version> <item>87</item> <item>166</item> </second> </item> <item> <first>grp_fu_710</first> <second> <count>2</count> <item_version>0</item_version> <item>91</item> <item>170</item> </second> </item> <item> <first>grp_fu_720</first> <second> <count>2</count> <item_version>0</item_version> <item>95</item> <item>174</item> </second> </item> <item> <first>grp_fu_730</first> <second> <count>2</count> <item_version>0</item_version> <item>99</item> <item>178</item> </second> </item> <item> <first>grp_fu_740</first> <second> <count>2</count> <item_version>0</item_version> <item>103</item> <item>182</item> </second> </item> <item> <first>grp_fu_750</first> <second> <count>2</count> <item_version>0</item_version> <item>107</item> <item>186</item> </second> </item> <item> <first>icmp_ln10_fu_760</first> <second> <count>1</count> <item_version>0</item_version> <item>38</item> </second> </item> <item> <first>icmp_ln33_fu_876</first> <second> <count>1</count> <item_version>0</item_version> <item>117</item> </second> </item> <item> <first>ifm_buff0_0_addr_gep_fu_172</first> <second> <count>1</count> <item_version>0</item_version> <item>49</item> </second> </item> <item> <first>ifm_buff0_10_addr_gep_fu_302</first> <second> <count>1</count> <item_version>0</item_version> <item>89</item> </second> </item> <item> <first>ifm_buff0_11_addr_gep_fu_315</first> <second> <count>1</count> <item_version>0</item_version> <item>93</item> </second> </item> <item> <first>ifm_buff0_12_addr_gep_fu_328</first> <second> <count>1</count> <item_version>0</item_version> <item>97</item> </second> </item> <item> <first>ifm_buff0_13_addr_gep_fu_341</first> <second> <count>1</count> <item_version>0</item_version> <item>101</item> </second> </item> <item> <first>ifm_buff0_14_addr_gep_fu_354</first> <second> <count>1</count> <item_version>0</item_version> <item>105</item> </second> </item> <item> <first>ifm_buff0_15_addr_gep_fu_367</first> <second> <count>1</count> <item_version>0</item_version> <item>109</item> </second> </item> <item> <first>ifm_buff0_1_addr_gep_fu_185</first> <second> <count>1</count> <item_version>0</item_version> <item>53</item> </second> </item> <item> <first>ifm_buff0_2_addr_gep_fu_198</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> <item> <first>ifm_buff0_3_addr_gep_fu_211</first> <second> <count>1</count> <item_version>0</item_version> <item>61</item> </second> </item> <item> <first>ifm_buff0_4_addr_gep_fu_224</first> <second> <count>1</count> <item_version>0</item_version> <item>65</item> </second> </item> <item> <first>ifm_buff0_5_addr_gep_fu_237</first> <second> <count>1</count> <item_version>0</item_version> <item>69</item> </second> </item> <item> <first>ifm_buff0_6_addr_gep_fu_250</first> <second> <count>1</count> <item_version>0</item_version> <item>73</item> </second> </item> <item> <first>ifm_buff0_7_addr_gep_fu_263</first> <second> <count>1</count> <item_version>0</item_version> <item>77</item> </second> </item> <item> <first>ifm_buff0_8_addr_gep_fu_276</first> <second> <count>1</count> <item_version>0</item_version> <item>81</item> </second> </item> <item> <first>ifm_buff0_9_addr_gep_fu_289</first> <second> <count>1</count> <item_version>0</item_version> <item>85</item> </second> </item> <item> <first>ifm_buff1_0_addr_gep_fu_380</first> <second> <count>1</count> <item_version>0</item_version> <item>128</item> </second> </item> <item> <first>ifm_buff1_10_addr_gep_fu_510</first> <second> <count>1</count> <item_version>0</item_version> <item>168</item> </second> </item> <item> <first>ifm_buff1_11_addr_gep_fu_523</first> <second> <count>1</count> <item_version>0</item_version> <item>172</item> </second> </item> <item> <first>ifm_buff1_12_addr_gep_fu_536</first> <second> <count>1</count> <item_version>0</item_version> <item>176</item> </second> </item> <item> <first>ifm_buff1_13_addr_gep_fu_549</first> <second> <count>1</count> <item_version>0</item_version> <item>180</item> </second> </item> <item> <first>ifm_buff1_14_addr_gep_fu_562</first> <second> <count>1</count> <item_version>0</item_version> <item>184</item> </second> </item> <item> <first>ifm_buff1_15_addr_gep_fu_575</first> <second> <count>1</count> <item_version>0</item_version> <item>188</item> </second> </item> <item> <first>ifm_buff1_1_addr_gep_fu_393</first> <second> <count>1</count> <item_version>0</item_version> <item>132</item> </second> </item> <item> <first>ifm_buff1_2_addr_gep_fu_406</first> <second> <count>1</count> <item_version>0</item_version> <item>136</item> </second> </item> <item> <first>ifm_buff1_3_addr_gep_fu_419</first> <second> <count>1</count> <item_version>0</item_version> <item>140</item> </second> </item> <item> <first>ifm_buff1_4_addr_gep_fu_432</first> <second> <count>1</count> <item_version>0</item_version> <item>144</item> </second> </item> <item> <first>ifm_buff1_5_addr_gep_fu_445</first> <second> <count>1</count> <item_version>0</item_version> <item>148</item> </second> </item> <item> <first>ifm_buff1_6_addr_gep_fu_458</first> <second> <count>1</count> <item_version>0</item_version> <item>152</item> </second> </item> <item> <first>ifm_buff1_7_addr_gep_fu_471</first> <second> <count>1</count> <item_version>0</item_version> <item>156</item> </second> </item> <item> <first>ifm_buff1_8_addr_gep_fu_484</first> <second> <count>1</count> <item_version>0</item_version> <item>160</item> </second> </item> <item> <first>ifm_buff1_9_addr_gep_fu_497</first> <second> <count>1</count> <item_version>0</item_version> <item>164</item> </second> </item> <item> <first>j1_0_phi_fu_603</first> <second> <count>1</count> <item_version>0</item_version> <item>116</item> </second> </item> <item> <first>j_1_fu_882</first> <second> <count>1</count> <item_version>0</item_version> <item>119</item> </second> </item> <item> <first>j_fu_766</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>trunc_ln13_fu_792</first> <second> <count>1</count> <item_version>0</item_version> <item>47</item> </second> </item> <item> <first>trunc_ln36_fu_888</first> <second> <count>1</count> <item_version>0</item_version> <item>125</item> </second> </item> <item> <first>zext_ln13_fu_772</first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>zext_ln36_fu_897</first> <second> <count>1</count> <item_version>0</item_version> <item>127</item> </second> </item> </dp_fu_nodes_expression> <dp_fu_nodes_module> <count>0</count> <item_version>0</item_version> </dp_fu_nodes_module> <dp_fu_nodes_io> <count>1</count> <item_version>0</item_version> <item> <first>grp_read_fu_166</first> <second> <count>2</count> <item_version>0</item_version> <item>46</item> <item>124</item> </second> </item> </dp_fu_nodes_io> <return_ports> <count>0</count> <item_version>0</item_version> </return_ports> <dp_mem_port_nodes class_id="50" tracking_level="0" version="0"> <count>32</count> <item_version>0</item_version> <item class_id="51" tracking_level="0" version="0"> <first class_id="52" tracking_level="0" version="0"> <first>ifm_buff0_0</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>50</item> </second> </item> <item> <first> <first>ifm_buff0_1</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>54</item> </second> </item> <item> <first> <first>ifm_buff0_10</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>90</item> </second> </item> <item> <first> <first>ifm_buff0_11</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>94</item> </second> </item> <item> <first> <first>ifm_buff0_12</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>98</item> </second> </item> <item> <first> <first>ifm_buff0_13</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>102</item> </second> </item> <item> <first> <first>ifm_buff0_14</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>106</item> </second> </item> <item> <first> <first>ifm_buff0_15</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>110</item> </second> </item> <item> <first> <first>ifm_buff0_2</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>58</item> </second> </item> <item> <first> <first>ifm_buff0_3</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>62</item> </second> </item> <item> <first> <first>ifm_buff0_4</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>66</item> </second> </item> <item> <first> <first>ifm_buff0_5</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>70</item> </second> </item> <item> <first> <first>ifm_buff0_6</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>74</item> </second> </item> <item> <first> <first>ifm_buff0_7</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>78</item> </second> </item> <item> <first> <first>ifm_buff0_8</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>82</item> </second> </item> <item> <first> <first>ifm_buff0_9</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>86</item> </second> </item> <item> <first> <first>ifm_buff1_0</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>129</item> </second> </item> <item> <first> <first>ifm_buff1_1</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>133</item> </second> </item> <item> <first> <first>ifm_buff1_10</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>169</item> </second> </item> <item> <first> <first>ifm_buff1_11</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>173</item> </second> </item> <item> <first> <first>ifm_buff1_12</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>177</item> </second> </item> <item> <first> <first>ifm_buff1_13</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>181</item> </second> </item> <item> <first> <first>ifm_buff1_14</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>185</item> </second> </item> <item> <first> <first>ifm_buff1_15</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>189</item> </second> </item> <item> <first> <first>ifm_buff1_2</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>137</item> </second> </item> <item> <first> <first>ifm_buff1_3</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>141</item> </second> </item> <item> <first> <first>ifm_buff1_4</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>145</item> </second> </item> <item> <first> <first>ifm_buff1_5</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>149</item> </second> </item> <item> <first> <first>ifm_buff1_6</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>153</item> </second> </item> <item> <first> <first>ifm_buff1_7</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>157</item> </second> </item> <item> <first> <first>ifm_buff1_8</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>161</item> </second> </item> <item> <first> <first>ifm_buff1_9</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>165</item> </second> </item> </dp_mem_port_nodes> <dp_reg_nodes> <count>4</count> <item_version>0</item_version> <item> <first>588</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>599</first> <second> <count>1</count> <item_version>0</item_version> <item>116</item> </second> </item> <item> <first>995</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>1003</first> <second> <count>1</count> <item_version>0</item_version> <item>119</item> </second> </item> </dp_reg_nodes> <dp_regname_nodes> <count>4</count> <item_version>0</item_version> <item> <first>cifm_counter_0_reg_588</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>j1_0_reg_599</first> <second> <count>1</count> <item_version>0</item_version> <item>116</item> </second> </item> <item> <first>j_1_reg_1003</first> <second> <count>1</count> <item_version>0</item_version> <item>119</item> </second> </item> <item> <first>j_reg_995</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> </dp_regname_nodes> <dp_reg_phi> <count>2</count> <item_version>0</item_version> <item> <first>588</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>599</first> <second> <count>1</count> <item_version>0</item_version> <item>116</item> </second> </item> </dp_reg_phi> <dp_regname_phi> <count>2</count> <item_version>0</item_version> <item> <first>cifm_counter_0_reg_588</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>j1_0_reg_599</first> <second> <count>1</count> <item_version>0</item_version> <item>116</item> </second> </item> </dp_regname_phi> <dp_port_io_nodes class_id="53" tracking_level="0" version="0"> <count>33</count> <item_version>0</item_version> <item class_id="54" tracking_level="0" version="0"> <first>cifm</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>read</first> <second> <count>2</count> <item_version>0</item_version> <item>46</item> <item>124</item> </second> </item> </second> </item> <item> <first>ifm_buff0_0(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>50</item> </second> </item> </second> </item> <item> <first>ifm_buff0_1(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>54</item> </second> </item> </second> </item> <item> <first>ifm_buff0_10(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>90</item> </second> </item> </second> </item> <item> <first>ifm_buff0_11(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>94</item> </second> </item> </second> </item> <item> <first>ifm_buff0_12(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>98</item> </second> </item> </second> </item> <item> <first>ifm_buff0_13(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>102</item> </second> </item> </second> </item> <item> <first>ifm_buff0_14(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>106</item> </second> </item> </second> </item> <item> <first>ifm_buff0_15(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>110</item> </second> </item> </second> </item> <item> <first>ifm_buff0_2(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>58</item> </second> </item> </second> </item> <item> <first>ifm_buff0_3(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>62</item> </second> </item> </second> </item> <item> <first>ifm_buff0_4(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>66</item> </second> </item> </second> </item> <item> <first>ifm_buff0_5(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>70</item> </second> </item> </second> </item> <item> <first>ifm_buff0_6(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>74</item> </second> </item> </second> </item> <item> <first>ifm_buff0_7(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>78</item> </second> </item> </second> </item> <item> <first>ifm_buff0_8(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>82</item> </second> </item> </second> </item> <item> <first>ifm_buff0_9(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>86</item> </second> </item> </second> </item> <item> <first>ifm_buff1_0(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>129</item> </second> </item> </second> </item> <item> <first>ifm_buff1_1(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>133</item> </second> </item> </second> </item> <item> <first>ifm_buff1_10(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>169</item> </second> </item> </second> </item> <item> <first>ifm_buff1_11(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>173</item> </second> </item> </second> </item> <item> <first>ifm_buff1_12(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>177</item> </second> </item> </second> </item> <item> <first>ifm_buff1_13(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>181</item> </second> </item> </second> </item> <item> <first>ifm_buff1_14(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>185</item> </second> </item> </second> </item> <item> <first>ifm_buff1_15(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>189</item> </second> </item> </second> </item> <item> <first>ifm_buff1_2(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>137</item> </second> </item> </second> </item> <item> <first>ifm_buff1_3(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>141</item> </second> </item> </second> </item> <item> <first>ifm_buff1_4(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>145</item> </second> </item> </second> </item> <item> <first>ifm_buff1_5(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>149</item> </second> </item> </second> </item> <item> <first>ifm_buff1_6(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>153</item> </second> </item> </second> </item> <item> <first>ifm_buff1_7(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>157</item> </second> </item> </second> </item> <item> <first>ifm_buff1_8(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>161</item> </second> </item> </second> </item> <item> <first>ifm_buff1_9(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>165</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core class_id="55" tracking_level="0" version="0"> <count>32</count> <item_version>0</item_version> <item class_id="56" tracking_level="0" version="0"> <first>2</first> <second>RAM</second> </item> <item> <first>3</first> <second>RAM</second> </item> <item> <first>4</first> <second>RAM</second> </item> <item> <first>5</first> <second>RAM</second> </item> <item> <first>6</first> <second>RAM</second> </item> <item> <first>7</first> <second>RAM</second> </item> <item> <first>8</first> <second>RAM</second> </item> <item> <first>9</first> <second>RAM</second> </item> <item> <first>10</first> <second>RAM</second> </item> <item> <first>11</first> <second>RAM</second> </item> <item> <first>12</first> <second>RAM</second> </item> <item> <first>13</first> <second>RAM</second> </item> <item> <first>14</first> <second>RAM</second> </item> <item> <first>15</first> <second>RAM</second> </item> <item> <first>16</first> <second>RAM</second> </item> <item> <first>17</first> <second>RAM</second> </item> <item> <first>18</first> <second>RAM</second> </item> <item> <first>19</first> <second>RAM</second> </item> <item> <first>20</first> <second>RAM</second> </item> <item> <first>21</first> <second>RAM</second> </item> <item> <first>22</first> <second>RAM</second> </item> <item> <first>23</first> <second>RAM</second> </item> <item> <first>24</first> <second>RAM</second> </item> <item> <first>25</first> <second>RAM</second> </item> <item> <first>26</first> <second>RAM</second> </item> <item> <first>27</first> <second>RAM</second> </item> <item> <first>28</first> <second>RAM</second> </item> <item> <first>29</first> <second>RAM</second> </item> <item> <first>30</first> <second>RAM</second> </item> <item> <first>31</first> <second>RAM</second> </item> <item> <first>32</first> <second>RAM</second> </item> <item> <first>33</first> <second>RAM</second> </item> </port2core> <node2core> <count>0</count> <item_version>0</item_version> </node2core> </syndb> </boost_serialization>
25.793556
73
0.595681
0438757bb80fd029ca269066485f9d99eda78f12
3,160
ads
Ada
arch/ARM/Nordic/drivers/nrf51-adc.ads
WickedShell/Ada_Drivers_Library
391866ad37a599347df40a4dbb3bf0721bedabea
[ "BSD-3-Clause" ]
6
2017-05-28T04:37:11.000Z
2020-11-22T11:26:19.000Z
arch/ARM/Nordic/drivers/nrf51-adc.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
2
2019-08-30T10:57:40.000Z
2020-02-11T21:34:14.000Z
arch/ARM/Nordic/drivers/nrf51-adc.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
2
2017-02-07T19:42:02.000Z
2020-11-22T11:26:20.000Z
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with HAL; use HAL; package nRF51.ADC is type Bits_Resolution is range 8 .. 10; type Analog_Pin is range 0 .. 7; type Pin_Input_Selection is (Pin_Full, Pin_Two_Third, Pin_One_Third); type VDD_Input_Selection is (VDD_Two_Third, VDD_One_Third); type Reference_Selection is (Internal_1V2, External_AREF0, External_AREF1, VDD_Half, VDD_One_Third); procedure Start_Pin_Conversion (Pin : Analog_Pin; Input : Pin_Input_Selection; Ref : Reference_Selection; Res : Bits_Resolution); procedure Start_VDD_Conversion (Input : VDD_Input_Selection; Ref : Reference_Selection; Res : Bits_Resolution); function Busy return Boolean; function Wait_For_Result return UInt10; end nRF51.ADC;
50.967742
78
0.550316
13d22e15e25c950b43ccd9d7a1b39267e4197e59
1,905
adb
Ada
orka/src/orka/implementation/orka-rendering-fences.adb
onox/orka
9edf99559a16ffa96dfdb208322f4d18efbcbac6
[ "Apache-2.0" ]
52
2016-07-30T23:00:28.000Z
2022-02-05T11:54:55.000Z
orka/src/orka/implementation/orka-rendering-fences.adb
onox/orka
9edf99559a16ffa96dfdb208322f4d18efbcbac6
[ "Apache-2.0" ]
79
2016-08-01T18:36:48.000Z
2022-02-27T12:14:20.000Z
orka/src/orka/implementation/orka-rendering-fences.adb
onox/orka
9edf99559a16ffa96dfdb208322f4d18efbcbac6
[ "Apache-2.0" ]
4
2018-04-28T22:36:26.000Z
2020-11-14T23:00:29.000Z
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2017 onox <[email protected]> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. with GL.Debug; package body Orka.Rendering.Fences is use GL.Debug; package Messages is new GL.Debug.Messages (Third_Party, Performance); function Create_Buffer_Fence return Buffer_Fence is begin return Result : Buffer_Fence do Result.Index := Index_Type'First; end return; end Create_Buffer_Fence; procedure Prepare_Index (Object : in out Buffer_Fence; Status : out Fence_Status) is use GL.Fences; begin if not Object.Fences (Object.Index).Initialized then Status := Not_Initialized; return; end if; case Object.Fences (Object.Index).Client_Wait (Maximum_Wait) is when Condition_Satisfied => Messages.Log (Medium, "Fence not already signalled"); Status := Signaled; when Timeout_Expired | Wait_Failed => Messages.Log (High, "Fence timed out or failed"); Status := Not_Signaled; when Already_Signaled => Status := Signaled; end case; end Prepare_Index; procedure Advance_Index (Object : in out Buffer_Fence) is begin Object.Fences (Object.Index).Set_Fence; Object.Index := Object.Index + 1; end Advance_Index; end Orka.Rendering.Fences;
32.844828
87
0.682415
044eb6a84d2b8d3005e3c6373793cb465ef975c9
3,644
ads
Ada
source/amf/uml/amf-standard_profile_l2-services-hash.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/amf/uml/amf-standard_profile_l2-services-hash.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/amf/uml/amf-standard_profile_l2-services-hash.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
4
2017-07-18T07:11:05.000Z
2020-06-21T03:02:25.000Z
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Elements.Generic_Hash; function AMF.Standard_Profile_L2.Services.Hash is new AMF.Elements.Generic_Hash (Standard_Profile_L2_Service, Standard_Profile_L2_Service_Access);
72.88
98
0.407794
2ea38b3d01d269e01e0175315fdedf17c762d03b
152
ads
Ada
arch/ARM/NXP/drivers/nxp-inputmux.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
2
2018-05-16T03:56:39.000Z
2019-07-31T13:53:56.000Z
arch/ARM/NXP/drivers/nxp-inputmux.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
null
null
null
arch/ARM/NXP/drivers/nxp-inputmux.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
null
null
null
private with NXP_SVD.INPUTMUX; with HAL.GPIO; package NXP.InputMux is procedure Enable_InputMux; procedure Disable_InputMux; end NXP.InputMux;
15.2
30
0.789474
9aa6a286ecf058a1d26606cbfe2be581203b4eef
4,252
adb
Ada
src/ada/src/utils/unit_conversion_utilities.adb
VVCAS-Sean/OpenUxAS
dcd7be29d182d278a5387908f568d6f8a06b79ee
[ "NASA-1.3" ]
88
2017-08-24T07:02:01.000Z
2022-03-18T04:34:17.000Z
src/ada/src/utils/unit_conversion_utilities.adb
VVCAS-Sean/OpenUxAS
dcd7be29d182d278a5387908f568d6f8a06b79ee
[ "NASA-1.3" ]
46
2017-06-08T18:18:08.000Z
2022-03-15T18:24:43.000Z
src/ada/src/utils/unit_conversion_utilities.adb
VVCAS-Sean/OpenUxAS
dcd7be29d182d278a5387908f568d6f8a06b79ee
[ "NASA-1.3" ]
53
2017-06-22T14:48:05.000Z
2022-02-15T16:59:38.000Z
with Ada.Numerics.Generic_Elementary_Functions; package body Unit_Conversion_Utilities is package Real_Elementary_Fuctions is new Ada.Numerics.Generic_Elementary_Functions (Real); ---------------- -- Initialize -- ---------------- procedure Initialize (This : out Unit_Converter; LatitudeInit_Rad : Real; LongitudeInit_rad : Real) is dDenominatorMeridional : Real; dDenominatorTransverse : Real; use Real_Elementary_Fuctions; function Pow (Base, Exp : Real) return Real renames Real_Elementary_Fuctions."**"; begin -- if (!m_bInitialized) if not This.Initialized then -- //assumes that the conversions will all take place within the local area of the initial latitude/longitude. -- m_dLatitudeInitial_rad = dLatitudeInit_rad; This.m_dLatitudeInitial_rad := LatitudeInit_Rad; -- m_dLongitudeInitial_rad = dLongitudeInit_rad; This.m_dLongitudeInitial_rad := LongitudeInit_rad; -- double dDenominatorMeridional = std::pow((1.0 - (m_dEccentricitySquared * std::pow(std::sin(dLatitudeInit_rad), 2.0))), (3.0 / 2.0)); dDenominatorMeridional := Pow ((1.0 - (dEccentricitySquared * Pow (Sin (LatitudeInit_rad), 2.0))), (3.0 / 2.0)); -- assert(dDenominatorMeridional > 0.0); pragma Assert (dDenominatorMeridional> 0.0); -- m_dRadiusMeridional_m = (dDenominatorMeridional <= 0.0) ? (0.0) : (m_dRadiusEquatorial_m * (1.0 - m_dEccentricitySquared) / dDenominatorMeridional); This.m_dRadiusMeridional_m := (if dDenominatorMeridional <= 0.0 then 0.0 else (dRadiusEquatorial_m * (1.0 - dEccentricitySquared) / dDenominatorMeridional)); -- double dDenominatorTransverse = pow((1.0 - (m_dEccentricitySquared * std::pow(std::sin(dLatitudeInit_rad), 2.0))), 0.5); dDenominatorTransverse := Pow ((1.0 - (dEccentricitySquared * Pow (Sin (LatitudeInit_rad), 2.0))), 0.5); -- assert(dDenominatorTransverse > 0.0); pragma Assert (dDenominatorTransverse > 0.0); -- m_dRadiusTransverse_m = (dDenominatorTransverse <= 0.0) ? (0.0) : (m_dRadiusEquatorial_m / dDenominatorTransverse); This.m_dRadiusTransverse_m := (if dDenominatorTransverse <= 0.0 then 0.0 else (dRadiusEquatorial_m / dDenominatorTransverse)); -- m_dRadiusSmallCircleLatitude_m = m_dRadiusTransverse_m * cos(dLatitudeInit_rad); This.m_dRadiusSmallCircleLatitude_m := This.m_dRadiusTransverse_m * Cos (LatitudeInit_rad); -- m_bInitialized = true; This.Initialized := True; end if; end Initialize; ------------------------------------------------- -- Convert_LatLong_Degrees_To_NorthEast_Meters -- ------------------------------------------------- procedure Convert_LatLong_Degrees_To_NorthEast_Meters (This : in out Unit_Converter; Latitude_Deg : Real; Longitude_Deg : Real; North : out Real; East : out Real) is DegreesToRadians : constant := 180.0 / Ada.Numerics.Pi; -- double dLatitude_rad = dLatitude_deg * n_Const::c_Convert::dDegreesToRadians(); Latitude_rad : constant Real := Latitude_Deg * DegreesToRadians; -- double dLongitude_rad = dLongitude_deg * n_Const::c_Convert::dDegreesToRadians(); Longitude_rad : constant Real := Longitude_Deg * DegreesToRadians; begin -- //assumes that the conversions will all take place within the local area of the init longitude. -- if (!m_bInitialized) -- { -- Initialize(dLatitude_rad, dLongitude_rad); -- } if not This.Initialized then This.Initialize (LatitudeInit_Rad => Latitude_Rad, LongitudeInit_Rad => Longitude_Rad); end if; -- dNorth_m = m_dRadiusMeridional_m * (dLatitude_rad - m_dLatitudeInitial_rad); North := This.m_dRadiusMeridional_m * (Latitude_Rad - This.m_dLatitudeInitial_rad); -- dEast_m = m_dRadiusSmallCircleLatitude_m * (dLongitude_rad - m_dLongitudeInitial_rad); East := This.m_dRadiusSmallCircleLatitude_m * (Longitude_rad - This.m_dLongitudeInitial_rad); end Convert_LatLong_Degrees_To_NorthEast_Meters; end Unit_Conversion_Utilities;
50.023529
166
0.667451
4145c81cd77d7c0b8c38f5763301385f3b02f215
8,583
adb
Ada
source/amf/mof/cmof/amf-internals-cmof_package_imports.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/amf/mof/cmof/amf-internals-cmof_package_imports.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/amf/mof/cmof/amf-internals-cmof_package_imports.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
4
2017-07-18T07:11:05.000Z
2020-06-21T03:02:25.000Z
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with AMF.Internals.Helpers; with AMF.Internals.Tables.CMOF_Attributes; with AMF.Visitors.CMOF_Iterators; with AMF.Visitors.CMOF_Visitors; package body AMF.Internals.CMOF_Package_Imports is use AMF.Internals.Tables.CMOF_Attributes; ------------------- -- Enter_Element -- ------------------- overriding procedure Enter_Element (Self : not null access constant CMOF_Package_Import_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Visitor in AMF.Visitors.CMOF_Visitors.CMOF_Visitor'Class then AMF.Visitors.CMOF_Visitors.CMOF_Visitor'Class (Visitor).Enter_Package_Import (AMF.CMOF.Package_Imports.CMOF_Package_Import_Access (Self), Control); end if; end Enter_Element; ------------------- -- Leave_Element -- ------------------- overriding procedure Leave_Element (Self : not null access constant CMOF_Package_Import_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Visitor in AMF.Visitors.CMOF_Visitors.CMOF_Visitor'Class then AMF.Visitors.CMOF_Visitors.CMOF_Visitor'Class (Visitor).Leave_Package_Import (AMF.CMOF.Package_Imports.CMOF_Package_Import_Access (Self), Control); end if; end Leave_Element; ------------------- -- Visit_Element -- ------------------- overriding procedure Visit_Element (Self : not null access constant CMOF_Package_Import_Proxy; Iterator : in out AMF.Visitors.Abstract_Iterator'Class; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Iterator in AMF.Visitors.CMOF_Iterators.CMOF_Iterator'Class then AMF.Visitors.CMOF_Iterators.CMOF_Iterator'Class (Iterator).Visit_Package_Import (Visitor, AMF.CMOF.Package_Imports.CMOF_Package_Import_Access (Self), Control); end if; end Visit_Element; -------------------------- -- Get_Imported_Package -- -------------------------- overriding function Get_Imported_Package (Self : not null access constant CMOF_Package_Import_Proxy) return AMF.CMOF.Packages.CMOF_Package_Access is begin return AMF.CMOF.Packages.CMOF_Package_Access (AMF.Internals.Helpers.To_Element (Internal_Get_Imported_Package (Self.Element))); end Get_Imported_Package; ----------------------------- -- Get_Importing_Namespace -- ----------------------------- overriding function Get_Importing_Namespace (Self : not null access constant CMOF_Package_Import_Proxy) return AMF.CMOF.Namespaces.CMOF_Namespace_Access is begin return AMF.CMOF.Namespaces.CMOF_Namespace_Access (AMF.Internals.Helpers.To_Element (Internal_Get_Importing_Namespace (Self.Element))); end Get_Importing_Namespace; -------------------- -- Get_Visibility -- -------------------- overriding function Get_Visibility (Self : not null access constant CMOF_Package_Import_Proxy) return CMOF.CMOF_Visibility_Kind is begin return Internal_Get_Visibility (Self.Element); end Get_Visibility; ------------------------ -- All_Owned_Elements -- ------------------------ overriding function All_Owned_Elements (Self : not null access constant CMOF_Package_Import_Proxy) return AMF.CMOF.Elements.Collections.Set_Of_CMOF_Element is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "All_Owned_Elements unimplemented"); raise Program_Error; return All_Owned_Elements (Self); end All_Owned_Elements; -------------------- -- Set_Visibility -- -------------------- overriding procedure Set_Visibility (Self : not null access CMOF_Package_Import_Proxy; To : CMOF.CMOF_Visibility_Kind) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Visibility unimplemented"); raise Program_Error; end Set_Visibility; -------------------------- -- Set_Imported_Package -- -------------------------- overriding procedure Set_Imported_Package (Self : not null access CMOF_Package_Import_Proxy; To : AMF.CMOF.Packages.CMOF_Package_Access) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Imported_Package unimplemented"); raise Program_Error; end Set_Imported_Package; ----------------------------- -- Set_Importing_Namespace -- ----------------------------- overriding procedure Set_Importing_Namespace (Self : not null access CMOF_Package_Import_Proxy; To : AMF.CMOF.Namespaces.CMOF_Namespace_Access) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Importing_Namespace unimplemented"); raise Program_Error; end Set_Importing_Namespace; end AMF.Internals.CMOF_Package_Imports;
42.280788
91
0.549691
13e225a3e5a4b6606c31594011536f88555d7600
3,490
adb
Ada
src/linux/helios-monitor-disks.adb
stcarrez/helios
770055d87eaaa70a29a8a39190ecc8aa4e31b5be
[ "Apache-2.0" ]
1
2020-09-04T18:34:08.000Z
2020-09-04T18:34:08.000Z
src/linux/helios-monitor-disks.adb
stcarrez/helios
770055d87eaaa70a29a8a39190ecc8aa4e31b5be
[ "Apache-2.0" ]
null
null
null
src/linux/helios-monitor-disks.adb
stcarrez/helios
770055d87eaaa70a29a8a39190ecc8aa4e31b5be
[ "Apache-2.0" ]
null
null
null
----------------------------------------------------------------------- -- helios-monitor-disks -- Linux disks monitor -- Copyright (C) 2017 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Strings.Transforms; with Helios.Tools.Files; package body Helios.Monitor.Disks is use Util.Strings.Transforms; -- ------------------------------ -- Start the agent and build the definition tree. -- ------------------------------ overriding procedure Start (Agent : in out Agent_Type; Config : in Util.Properties.Manager) is Values : constant String := Config.Get ("values", "*"); Disks : constant String := Config.Get ("partitions", "*"); Line : Helios.Tools.Files.File_Extractor; begin Line.Open ("/proc/diskstats"); Line.Name_Pos := 3; loop Line.Read; exit when Line.Is_Eof; Make_Disk (Agent, Line.Get_Value (3), Disks, Values); end loop; end Start; -- ------------------------------ -- Collect the values in the snapshot. -- ------------------------------ overriding procedure Collect (Agent : in out Agent_Type; Values : in out Datas.Snapshot_Type) is use type Schemas.Definition_Type_Access; Line : Helios.Tools.Files.File_Extractor; Node : Schemas.Definition_Type_Access; Disk : Disk_Definition_Type_Access; begin Line.Open ("/proc/diskstats"); Line.Name_Pos := 3; loop Line.Read; exit when Line.Is_Eof; Node := Agent.Find_Definition (Line.Get_Value (3)); if Node /= null then Disk := Disk_Definition_Type'Class (Node.all)'Access; for I in Disk.Stats'Range loop Values.Set_Value (Disk.Stats (I), Line.Get_Value (4 + Stat_Type'Pos (I))); end loop; end if; end loop; end Collect; -- ------------------------------ -- Make a new disk definition for the given disk name. -- ------------------------------ procedure Make_Disk (Agent : in out Agent_Type; Name : in String; Disks : in String; Filter : in String) is Disk : Disk_Definition_Type_Access; begin if not Helios.Schemas.Is_Filter_Enable (Name, Disks) then return; end if; Disk := new Disk_Definition_Type (Len => Name'Length); Disk.Name := Name; Agent.Add_Definition (Disk.all'Access); for I in Disk.Stats'Range loop Disk.Stats (I) := Schemas.Create_Definition (Disk.all'Access, To_Lower_Case (Stat_Type'Image (I)), Filter); end loop; end Make_Disk; end Helios.Monitor.Disks;
37.526882
90
0.54957
047f284904ecc5f1b8c974e56c1161a7ebca0624
4,375
ads
Ada
bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/a-stream.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/a-stream.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/a-stream.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . S T R E A M S -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2021, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package Ada.Streams is pragma Pure; type Root_Stream_Type is abstract tagged limited private; pragma Preelaborable_Initialization (Root_Stream_Type); type Stream_Element is mod 2 ** Standard'Storage_Unit; type Stream_Element_Offset is new Long_Long_Integer; -- Stream_Element_Offset needs 64 bits to accommodate large stream files. -- However, rather than make this explicitly 64-bits we derive from -- Long_Long_Integer. In normal usage this will have the same effect. -- But in the case of CodePeer with a target configuration file with a -- maximum integer size of 32, it allows analysis of this unit. subtype Stream_Element_Count is Stream_Element_Offset range 0 .. Stream_Element_Offset'Last; type Stream_Element_Array is array (Stream_Element_Offset range <>) of aliased Stream_Element; procedure Read (Stream : in out Root_Stream_Type; Item : out Stream_Element_Array; Last : out Stream_Element_Offset) is abstract; procedure Write (Stream : in out Root_Stream_Type; Item : Stream_Element_Array) is abstract; private type Root_Stream_Type is abstract tagged limited null record; -- Stream attributes for Stream_Element_Array: trivially call the -- corresponding stream primitive for the whole array, instead of doing -- so element by element. procedure Read_SEA (S : access Root_Stream_Type'Class; V : out Stream_Element_Array); procedure Write_SEA (S : access Root_Stream_Type'Class; V : Stream_Element_Array); for Stream_Element_Array'Read use Read_SEA; for Stream_Element_Array'Write use Write_SEA; end Ada.Streams;
49.715909
78
0.485943
2969ba24755459d33b69f9246ce4678eeafba2a7
16,447
adb
Ada
llvm-gcc-4.2-2.9/gcc/ada/g-altcon.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
1
2016-04-09T02:58:13.000Z
2016-04-09T02:58:13.000Z
llvm-gcc-4.2-2.9/gcc/ada/g-altcon.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
llvm-gcc-4.2-2.9/gcc/ada/g-altcon.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G N A T . A L T I V E C . C O N V E R S I O N S -- -- -- -- B o d y -- -- -- -- Copyright (C) 2005, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Unchecked_Conversion; with System; use System; with GNAT.Altivec.Low_Level_Interface; use GNAT.Altivec.Low_Level_Interface; with GNAT.Altivec.Low_Level_Vectors; use GNAT.Altivec.Low_Level_Vectors; package body GNAT.Altivec.Conversions is function To_Varray_unsigned_char is new Ada.Unchecked_Conversion (Varray_signed_char, Varray_unsigned_char); function To_Varray_unsigned_char is new Ada.Unchecked_Conversion (Varray_bool_char, Varray_unsigned_char); function To_Varray_unsigned_short is new Ada.Unchecked_Conversion (Varray_signed_short, Varray_unsigned_short); function To_Varray_unsigned_short is new Ada.Unchecked_Conversion (Varray_bool_short, Varray_unsigned_short); function To_Varray_unsigned_short is new Ada.Unchecked_Conversion (Varray_pixel, Varray_unsigned_short); function To_Varray_unsigned_int is new Ada.Unchecked_Conversion (Varray_signed_int, Varray_unsigned_int); function To_Varray_unsigned_int is new Ada.Unchecked_Conversion (Varray_bool_int, Varray_unsigned_int); function To_Varray_unsigned_int is new Ada.Unchecked_Conversion (Varray_float, Varray_unsigned_int); function To_Varray_signed_char is new Ada.Unchecked_Conversion (Varray_unsigned_char, Varray_signed_char); function To_Varray_bool_char is new Ada.Unchecked_Conversion (Varray_unsigned_char, Varray_bool_char); function To_Varray_signed_short is new Ada.Unchecked_Conversion (Varray_unsigned_short, Varray_signed_short); function To_Varray_bool_short is new Ada.Unchecked_Conversion (Varray_unsigned_short, Varray_bool_short); function To_Varray_pixel is new Ada.Unchecked_Conversion (Varray_unsigned_short, Varray_pixel); function To_Varray_signed_int is new Ada.Unchecked_Conversion (Varray_unsigned_int, Varray_signed_int); function To_Varray_bool_int is new Ada.Unchecked_Conversion (Varray_unsigned_int, Varray_bool_int); function To_Varray_float is new Ada.Unchecked_Conversion (Varray_unsigned_int, Varray_float); function To_VUC is new Ada.Unchecked_Conversion (VUC_View, VUC); function To_VSC is new Ada.Unchecked_Conversion (VSC_View, VSC); function To_VBC is new Ada.Unchecked_Conversion (VBC_View, VBC); function To_VUS is new Ada.Unchecked_Conversion (VUS_View, VUS); function To_VSS is new Ada.Unchecked_Conversion (VSS_View, VSS); function To_VBS is new Ada.Unchecked_Conversion (VBS_View, VBS); function To_VUI is new Ada.Unchecked_Conversion (VUI_View, VUI); function To_VSI is new Ada.Unchecked_Conversion (VSI_View, VSI); function To_VBI is new Ada.Unchecked_Conversion (VBI_View, VBI); function To_VF is new Ada.Unchecked_Conversion (VF_View, VF); function To_VP is new Ada.Unchecked_Conversion (VP_View, VP); function To_VUC_View is new Ada.Unchecked_Conversion (VUC, VUC_View); function To_VSC_View is new Ada.Unchecked_Conversion (VSC, VSC_View); function To_VBC_View is new Ada.Unchecked_Conversion (VBC, VBC_View); function To_VUS_View is new Ada.Unchecked_Conversion (VUS, VUS_View); function To_VSS_View is new Ada.Unchecked_Conversion (VSS, VSS_View); function To_VBS_View is new Ada.Unchecked_Conversion (VBS, VBS_View); function To_VUI_View is new Ada.Unchecked_Conversion (VUI, VUI_View); function To_VSI_View is new Ada.Unchecked_Conversion (VSI, VSI_View); function To_VBI_View is new Ada.Unchecked_Conversion (VBI, VBI_View); function To_VF_View is new Ada.Unchecked_Conversion (VF, VF_View); function To_VP_View is new Ada.Unchecked_Conversion (VP, VP_View); pragma Warnings (Off, Default_Bit_Order); --------------- -- To_Vector -- --------------- function To_Vector (S : VSC_View) return VSC is begin if Default_Bit_Order = High_Order_First then return To_VSC (S); else declare Result : LL_VUC; VS : constant VUC_View := (Values => To_Varray_unsigned_char (S.Values)); begin Result := To_Vector (VS); return To_LL_VSC (Result); end; end if; end To_Vector; function To_Vector (S : VBC_View) return VBC is begin if Default_Bit_Order = High_Order_First then return To_VBC (S); else declare Result : LL_VUC; VS : constant VUC_View := (Values => To_Varray_unsigned_char (S.Values)); begin Result := To_Vector (VS); return To_LL_VBC (Result); end; end if; end To_Vector; function To_Vector (S : VSS_View) return VSS is begin if Default_Bit_Order = High_Order_First then return To_VSS (S); else declare Result : LL_VUS; VS : constant VUS_View := (Values => To_Varray_unsigned_short (S.Values)); begin Result := To_Vector (VS); return VSS (To_LL_VSS (Result)); end; end if; end To_Vector; function To_Vector (S : VBS_View) return VBS is begin if Default_Bit_Order = High_Order_First then return To_VBS (S); else declare Result : LL_VUS; VS : constant VUS_View := (Values => To_Varray_unsigned_short (S.Values)); begin Result := To_Vector (VS); return To_LL_VBS (Result); end; end if; end To_Vector; function To_Vector (S : VP_View) return VP is begin if Default_Bit_Order = High_Order_First then return To_VP (S); else declare Result : LL_VUS; VS : constant VUS_View := (Values => To_Varray_unsigned_short (S.Values)); begin Result := To_Vector (VS); return To_LL_VP (Result); end; end if; end To_Vector; function To_Vector (S : VSI_View) return VSI is begin if Default_Bit_Order = High_Order_First then return To_VSI (S); else declare Result : LL_VUI; VS : constant VUI_View := (Values => To_Varray_unsigned_int (S.Values)); begin Result := To_Vector (VS); return To_LL_VSI (Result); end; end if; end To_Vector; function To_Vector (S : VBI_View) return VBI is begin if Default_Bit_Order = High_Order_First then return To_VBI (S); else declare Result : LL_VUI; VS : constant VUI_View := (Values => To_Varray_unsigned_int (S.Values)); begin Result := To_Vector (VS); return To_LL_VBI (Result); end; end if; end To_Vector; function To_Vector (S : VF_View) return VF is begin if Default_Bit_Order = High_Order_First then return To_VF (S); else declare Result : LL_VUI; VS : constant VUI_View := (Values => To_Varray_unsigned_int (S.Values)); begin Result := To_Vector (VS); return To_LL_VF (Result); end; end if; end To_Vector; function To_Vector (S : VUC_View) return VUC is begin if Default_Bit_Order = High_Order_First then return To_VUC (S); else declare Result : VUC_View; begin for J in Vchar_Range'Range loop Result.Values (J) := S.Values (Vchar_Range'Last - J + Vchar_Range'First); end loop; return To_VUC (Result); end; end if; end To_Vector; function To_Vector (S : VUS_View) return VUS is begin if Default_Bit_Order = High_Order_First then return To_VUS (S); else declare Result : VUS_View; begin for J in Vshort_Range'Range loop Result.Values (J) := S.Values (Vshort_Range'Last - J + Vshort_Range'First); end loop; return To_VUS (Result); end; end if; end To_Vector; function To_Vector (S : VUI_View) return VUI is begin if Default_Bit_Order = High_Order_First then return To_VUI (S); else declare Result : VUI_View; begin for J in Vint_Range'Range loop Result.Values (J) := S.Values (Vint_Range'Last - J + Vint_Range'First); end loop; return To_VUI (Result); end; end if; end To_Vector; -------------- -- To_View -- -------------- function To_View (S : VSC) return VSC_View is begin if Default_Bit_Order = High_Order_First then return To_VSC_View (S); else declare Result : VUC_View; begin Result := To_View (To_LL_VUC (S)); return (Values => To_Varray_signed_char (Result.Values)); end; end if; end To_View; function To_View (S : VBC) return VBC_View is begin if Default_Bit_Order = High_Order_First then return To_VBC_View (S); else declare Result : VUC_View; begin Result := To_View (To_LL_VUC (S)); return (Values => To_Varray_bool_char (Result.Values)); end; end if; end To_View; function To_View (S : VSS) return VSS_View is begin if Default_Bit_Order = High_Order_First then return To_VSS_View (S); else declare Result : VUS_View; begin Result := To_View (To_LL_VUS (S)); return (Values => To_Varray_signed_short (Result.Values)); end; end if; end To_View; function To_View (S : VBS) return VBS_View is begin if Default_Bit_Order = High_Order_First then return To_VBS_View (S); else declare Result : VUS_View; begin Result := To_View (To_LL_VUS (S)); return (Values => To_Varray_bool_short (Result.Values)); end; end if; end To_View; function To_View (S : VP) return VP_View is begin if Default_Bit_Order = High_Order_First then return To_VP_View (S); else declare Result : VUS_View; begin Result := To_View (To_LL_VUS (S)); return (Values => To_Varray_pixel (Result.Values)); end; end if; end To_View; function To_View (S : VSI) return VSI_View is begin if Default_Bit_Order = High_Order_First then return To_VSI_View (S); else declare Result : VUI_View; begin Result := To_View (To_LL_VUI (S)); return (Values => To_Varray_signed_int (Result.Values)); end; end if; end To_View; function To_View (S : VBI) return VBI_View is begin if Default_Bit_Order = High_Order_First then return To_VBI_View (S); else declare Result : VUI_View; begin Result := To_View (To_LL_VUI (S)); return (Values => To_Varray_bool_int (Result.Values)); end; end if; end To_View; function To_View (S : VF) return VF_View is begin if Default_Bit_Order = High_Order_First then return To_VF_View (S); else declare Result : VUI_View; begin Result := To_View (To_LL_VUI (S)); return (Values => To_Varray_float (Result.Values)); end; end if; end To_View; function To_View (S : VUC) return VUC_View is begin if Default_Bit_Order = High_Order_First then return To_VUC_View (S); else declare VS : constant VUC_View := To_VUC_View (S); Result : VUC_View; begin for J in Vchar_Range'Range loop Result.Values (J) := VS.Values (Vchar_Range'Last - J + Vchar_Range'First); end loop; return Result; end; end if; end To_View; function To_View (S : VUS) return VUS_View is begin if Default_Bit_Order = High_Order_First then return To_VUS_View (S); else declare VS : constant VUS_View := To_VUS_View (S); Result : VUS_View; begin for J in Vshort_Range'Range loop Result.Values (J) := VS.Values (Vshort_Range'Last - J + Vshort_Range'First); end loop; return Result; end; end if; end To_View; function To_View (S : VUI) return VUI_View is begin if Default_Bit_Order = High_Order_First then return To_VUI_View (S); else declare VS : constant VUI_View := To_VUI_View (S); Result : VUI_View; begin for J in Vint_Range'Range loop Result.Values (J) := VS.Values (Vint_Range'Last - J + Vint_Range'First); end loop; return Result; end; end if; end To_View; end GNAT.Altivec.Conversions;
33.772074
78
0.554265
13cfdb35abcc76df810b89c8ac5a584dfe106e82
10,849
adb
Ada
3-mid/opengl/source/lean/model/opengl-model-terrain.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
20
2015-11-04T09:23:59.000Z
2022-01-14T10:21:42.000Z
3-mid/opengl/source/lean/model/opengl-model-terrain.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
2
2015-11-04T17:05:56.000Z
2015-12-08T03:16:13.000Z
3-mid/opengl/source/lean/model/opengl-model-terrain.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
1
2015-12-07T12:53:52.000Z
2015-12-07T12:53:52.000Z
with openGL.Geometry.lit_colored_textured, openGL.Primitive.indexed, openGL.Palette, openGL.Texture.Coordinates, openGL.IO, ada.unchecked_Deallocation; package body openGL.Model.terrain is use Texture; -------- -- Forge -- function new_Item (heights_Asset : in asset_Name; Row, Col : in Integer; Heights : in height_Map_view; color_Map : in asset_Name; Tiling : in texture_Transform_2d := (S => (0.0, 1.0), T => (0.0, 1.0))) return View is the_Model : constant View := new Item' (Model.item with heights_Asset => heights_Asset, Heights => Heights, Row => Row, Col => Col, color_Map => color_Map, tiling => Tiling); begin the_Model.set_Bounds; return the_Model; end new_Item; overriding procedure destroy (Self : in out Item) is procedure deallocate is new ada.unchecked_Deallocation (height_Map, height_Map_view); begin destroy (Model.Item (Self)); deallocate (Self.Heights); end destroy; ------------- -- Attributes -- type Geometry_view is access all Geometry.lit_colored_textured.item'Class; overriding function to_GL_Geometries (Self : access Item; Textures : access Texture.name_Map_of_texture'Class; Fonts : in Font.font_id_Map_of_font) return Geometry.views is pragma unreferenced (Textures, Fonts); use Geometry, Palette, Geometry.lit_colored_textured; Heights : height_Map_view renames Self.Heights; row_Count : constant Index_t := Heights'Length (1) - 1; col_Count : constant Index_t := Heights'Length (2) - 1; vertex_Count : constant Index_t := Heights'Length (1) * Heights'Length (2); indices_Count : constant long_Index_t := (2 * (long_Index_t (Heights'Length (2)) + 1)) * (long_Index_t (row_Count) - 1) + 2 * (long_Index_t (Heights'Length (2))); the_Sites : aliased Sites := (1 .. vertex_Count => <>); the_Bounds : openGL.Bounds := null_Bounds; the_Vertices : aliased Geometry.lit_colored_textured.Vertex_array := (1 .. vertex_Count => <>); the_Indices : aliased Indices := (1 .. indices_Count => <>); the_Geometry : constant Geometry_view := Geometry.lit_colored_textured.new_Geometry (texture_is_alpha => False); begin set_Sites: declare vert_Id : Index_t := 0; the_height_Range : constant Vector_2 := height_Extent (Heights.all); Middle : constant Real := (the_height_Range (1) + the_height_Range (2)) / 2.0; flipped_Row : Index_t; begin for Row in 1 .. row_Count + 1 loop for Col in 1 .. col_Count + 1 loop vert_Id := vert_Id + 1; flipped_Row := 2 + row_Count - Row; -- Flipping the row simplifies building the triangle strip below. the_Sites (vert_Id) := (Real (Col) - Real (col_Count) / 2.0 - 1.0, Heights (flipped_Row, Col) - Middle, Real (Row) - Real (row_Count) / 2.0 - 1.0); the_Bounds.Box.Lower (1) := Real'Min (the_Bounds.Box.Lower (1), the_Sites (vert_Id) (1)); the_Bounds.Box.Lower (2) := Real'Min (the_Bounds.Box.Lower (2), the_Sites (vert_Id) (2)); the_Bounds.Box.Lower (3) := Real'Min (the_Bounds.Box.Lower (3), the_Sites (vert_Id) (3)); the_Bounds.Box.Upper (1) := Real'Max (the_Bounds.Box.Upper (1), the_Sites (vert_Id) (1)); the_Bounds.Box.Upper (2) := Real'Max (the_Bounds.Box.Upper (2), the_Sites (vert_Id) (2)); the_Bounds.Box.Upper (3) := Real'Max (the_Bounds.Box.Upper (3), the_Sites (vert_Id) (3)); the_Bounds.Ball := Real'Max (the_Bounds.Ball, abs (the_Sites (vert_Id))); the_Vertices (vert_Id).Site := the_Sites (vert_Id); the_Vertices (vert_Id).Color := (Primary => White, Opacity => Opaque); end loop; end loop; the_Bounds.Ball := the_Bounds.Ball * 1.1; -- TODO: Why the '* 1.1' ? end set_Sites; set_Indices: declare Cursor : long_Index_t := 0; Start, Upper, Lower : Index_t; begin Start := 1; for Row in 1 .. row_Count loop Upper := Start; Lower := Start + col_Count + 1; for Col in 1 .. col_Count + 1 loop Cursor := Cursor + 1; the_Indices (Cursor) := Upper; Cursor := Cursor + 1; the_Indices (Cursor) := Lower; if Col /= col_Count + 1 then Upper := Upper + 1; Lower := Lower + 1; end if; end loop; if Row /= row_Count -- Not the last row. then -- Add 1st redundant triangle to allow for next strip. Cursor := Cursor + 1; the_Indices (Cursor) := Lower; -- Advance Start index. Start := Start + col_Count + 1; -- Add 2nd redundant triangle to allow for next strip. Cursor := Cursor + 1; the_Indices (Cursor) := Start; end if; end loop; end set_Indices; set_Normals: declare type Normals_view is access all Normals; the_Normals : Normals_view := Geometry.Normals_of (Primitive.triangle_Strip, the_Indices, the_Sites); procedure deallocate is new ada.unchecked_Deallocation (Normals, Normals_view); begin for i in the_Vertices'Range loop the_Vertices (i).Normal := the_Normals (i); end loop; deallocate (the_Normals); end set_Normals; if Self.color_Map /= null_Asset then set_texture_Coords: declare x_Length : constant Real := the_Bounds.Box.upper (1) - the_Bounds.Box.lower (1); x_Min : constant Real := the_Bounds.Box.lower (1); z_Length : constant Real := the_Bounds.Box.upper (3) - the_Bounds.Box.lower (3); z_Min : constant Real := the_Bounds.Box.lower (3); upper_Generator : constant Texture.Coordinates.xz_Generator := (Normalise => (S => (-x_Min, 1.0 / x_Length), T => (-z_Min, 1.0 / z_Length)), Tile => Self.Tiling); the_Coords : constant Coordinates_2D := upper_Generator.to_Coordinates (the_Sites'Access); begin for i in the_Coords'Range loop the_Vertices (i).Coords := the_Coords (i); end loop; end set_texture_Coords; set_Texture: declare the_Image : constant Image := IO.to_Image (Self.color_Map); the_Texture : constant Texture.object := Forge.to_Texture (the_Image); begin the_Geometry.Texture_is (the_Texture); end set_Texture; end if; the_Geometry.is_Transparent (False); the_Geometry.Vertices_are (the_Vertices); Self.Bounds := the_Bounds; declare the_Primitive : constant Primitive.indexed.view := Primitive.indexed.new_Primitive (Primitive.triangle_Strip, the_Indices); begin the_Geometry.add (Primitive.view (the_Primitive)); end; return (1 => Geometry.view (the_Geometry)); end to_GL_Geometries; overriding procedure set_Bounds (Self : in out Item) is Heights : height_Map_view renames Self.Heights; row_Count : constant Index_t := Heights'Length (1) - 1; col_Count : constant Index_t := Heights'Length (2) - 1; vertex_Count : constant Index_t := Heights'Length (1) * Heights'Length (2); the_Sites : aliased Sites := (1 .. vertex_Count => <>); the_Bounds : openGL.Bounds := null_Bounds; begin set_Sites: declare vert_Id : Index_t := 0; the_height_Range : constant Vector_2 := height_Extent (Heights.all); Middle : constant Real := (the_height_Range (1) + the_height_Range (2)) / 2.0; begin for Row in 1 .. row_Count + 1 loop for Col in 1 .. col_Count + 1 loop vert_Id := vert_Id + 1; the_Sites (vert_Id) := (Real (Col) - Real (col_Count) / 2.0 - 1.0, Heights (Row, Col) - Middle, Real (Row) - Real (row_Count) / 2.0 - 1.0); the_Bounds.Box.Lower (1) := Real'Min (the_Bounds.Box.Lower (1), the_Sites (vert_Id) (1)); the_Bounds.Box.Lower (2) := Real'Min (the_Bounds.Box.Lower (2), the_Sites (vert_Id) (2)); the_Bounds.Box.Lower (3) := Real'Min (the_Bounds.Box.Lower (3), the_Sites (vert_Id) (3)); the_Bounds.Box.Upper (1) := Real'Max (the_Bounds.Box.Upper (1), the_Sites (vert_Id) (1)); the_Bounds.Box.Upper (2) := Real'Max (the_Bounds.Box.Upper (2), the_Sites (vert_Id) (2)); the_Bounds.Box.Upper (3) := Real'Max (the_Bounds.Box.Upper (3), the_Sites (vert_Id) (3)); the_Bounds.Ball := Real'Max (the_Bounds.Ball, abs (the_Sites (vert_Id))); end loop; end loop; the_Bounds.Ball := the_Bounds.Ball * 1.1; -- TODO: Why the '* 1.1' ? end set_Sites; Self.Bounds := the_Bounds; end set_Bounds; end openGL.Model.terrain;
37.281787
127
0.501337
4bed84e31de9ca3c4a764f4b8f55649c2096ed81
3,626
ads
Ada
Software/FMCWSimulation/dg_radar_wrk/workspace.ads
oscaromeu/FMCW-Radar
1e96d583ef888cb8a2172d1d68b78193596b1eff
[ "MIT" ]
null
null
null
Software/FMCWSimulation/dg_radar_wrk/workspace.ads
oscaromeu/FMCW-Radar
1e96d583ef888cb8a2172d1d68b78193596b1eff
[ "MIT" ]
null
null
null
Software/FMCWSimulation/dg_radar_wrk/workspace.ads
oscaromeu/FMCW-Radar
1e96d583ef888cb8a2172d1d68b78193596b1eff
[ "MIT" ]
null
null
null
<ADSWorkspace Revision="13" Version="100"> <Workspace Name=""> <Library Name="ads_sources" /> <Library Name="ads_tlines" /> <Library Name="ads_bondwires" /> <Library Name="ads_behavioral" /> <Library Name="ads_textfonts" /> <Library Name="ads_common_cmps" /> <Library Name="ads_designs" /> <Library Name="ads_standard_layers" /> <Library Name="adstechlib" /> <Library Name="ads_schematic_layers" /> <Library Name="empro_standard_layers" /> <Library Name="ads_rflib" /> <Library Name="ads_simulation" /> <Library Name="ads_datacmps" /> <Library Name="1xEV" /> <Library Name="3GPPFDD" /> <Library Name="3GPPFDD_10_99" /> <Library Name="Antennas_and_Propagation" /> <Library Name="CDMA" /> <Library Name="cdma2000" /> <Library Name="Circuit_Cosimulation" /> <Library Name="CMMB" /> <Library Name="Controllers" /> <Library Name="DTMB" /> <Library Name="DTV" /> <Library Name="EDGE" /> <Library Name="GSM" /> <Library Name="HDL_Blocks" /> <Library Name="HSDPA" /> <Library Name="HSUPA" /> <Library Name="Instruments" /> <Library Name="Interactive_Controls_and_Displays" /> <Library Name="LTE" /> <Library Name="Numeric" /> <Library Name="Obsolete" /> <Library Name="Signal_Converters" /> <Library Name="Simulation_Sequencing" /> <Library Name="Sinks" /> <Library Name="SystemVue_Cosimulation" /> <Library Name="TDSCDMA" /> <Library Name="Timed" /> <Library Name="UMB" /> <Library Name="UWB" /> <Library Name="WLAN" /> <Library Name="WLAN_11n" /> <Library Name="WMAN" /> <Library Name="WMAN_16e" /> <Library Name="dg_radar_lib" /> <Log Name="conversion_results.log" /> <Preferences Name="layout.prf" /> <Preferences Name="schematic.prf" /> <Text Name="contenttest.txt" /> <LibraryDefs Name="lib.defs" /> <ConfigFile Name="de_sim.cfg" /> <ConfigFile Name="hpeesofbrowser.cfg" /> <ConfigFile Name="hpeesofsim.cfg" /> <Log Name="search_history.log" /> <Folder Name="01_ReadMe"> <Cell Name="dg_radar_lib:ReadMe" /> </Folder> <Folder Name="02_Amplifiers"> <Cell Name="dg_radar_lib:Amplifier_Gain" /> <Cell Name="dg_radar_lib:Amplifier_LNA" /> <Cell Name="dg_radar_lib:Amplifier_Power" /> </Folder> <Folder Name="03_Antenna"> <Cell Name="dg_radar_lib:Antenna_RCV" /> <Cell Name="dg_radar_lib:Antenna_XMIT" /> </Folder> <Folder Name="03_Other Sub Ckts"> <Cell Name="dg_radar_lib:Coupler" /> <Cell Name="dg_radar_lib:DownConvertor" /> <Cell Name="dg_radar_lib:Source_CW" /> <Cell Name="dg_radar_lib:Target" /> <Cell Name="dg_radar_lib:Test_Point_A" /> <Cell Name="dg_radar_lib:Test_Point_B" /> <Cell Name="dg_radar_lib:Test_Point_C" /> </Folder> <Folder Name="04_Doppler Radar System"> <Cell Name="dg_radar_lib:Doppler_Radar" /> <Data_Display Name="Doppler_Radar.dds" /> </Folder> <Log Name="netlist.log" /> <Dataset Name="Doppler_Radar.ds" /> <ConfigFile Name="dds.cfg" /> </Workspace> </ADSWorkspace>
40.288889
61
0.552124
4bc6dede06e3dcb025ea19181a97dfe264a25c80
21,097
adb
Ada
generated-sources/ada-server/mojang-api/src/model/com-github-asyncmc-mojang-api-ada-server-model-models.adb
AsyncMC/Mojang-API-Libs
b01bbd2bce44bfa2b9ed705a128cf4ecda077916
[ "Apache-2.0" ]
null
null
null
generated-sources/ada-server/mojang-api/src/model/com-github-asyncmc-mojang-api-ada-server-model-models.adb
AsyncMC/Mojang-API-Libs
b01bbd2bce44bfa2b9ed705a128cf4ecda077916
[ "Apache-2.0" ]
null
null
null
generated-sources/ada-server/mojang-api/src/model/com-github-asyncmc-mojang-api-ada-server-model-models.adb
AsyncMC/Mojang-API-Libs
b01bbd2bce44bfa2b9ed705a128cf4ecda077916
[ "Apache-2.0" ]
null
null
null
-- Mojang API -- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -- -- OpenAPI spec version: 2020_06_05 -- -- -- NOTE: This package is auto generated by the swagger code generator 3.3.4. -- https://openapi-generator.tech -- Do not edit the class manually. package body com.github.asyncmc.mojang.api.ada.server.model.Models is use Swagger.Streams; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SecurityQuestion_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("id", Value.Id); Into.Write_Entity ("question", Value.Question); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SecurityQuestion_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SecurityQuestion_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "id", Value.Id); Swagger.Streams.Deserialize (Object, "question", Value.Question); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SecurityQuestion_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : SecurityQuestion_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SecurityAnswerId_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("id", Value.Id); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SecurityAnswerId_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SecurityAnswerId_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "id", Value.Id); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SecurityAnswerId_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : SecurityAnswerId_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SecurityChallenge_Type) is begin Into.Start_Entity (Name); Serialize (Into, "question", Value.Question); Serialize (Into, "answer", Value.Answer); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SecurityChallenge_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SecurityChallenge_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Deserialize (Object, "question", Value.Question); Deserialize (Object, "answer", Value.Answer); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SecurityChallenge_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : SecurityChallenge_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Error_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("error", Value.Error); Into.Write_Entity ("errorMessage", Value.Error_Message); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Error_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Error_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "error", Value.Error); Swagger.Streams.Deserialize (Object, "errorMessage", Value.Error_Message); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Error_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : Error_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in CurrentPlayerIDs_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("id", Value.Id); Into.Write_Entity ("name", Value.Name); Into.Write_Entity ("legacy", Value.Legacy); Into.Write_Entity ("demo", Value.Demo); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in CurrentPlayerIDs_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out CurrentPlayerIDs_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "id", Value.Id); Swagger.Streams.Deserialize (Object, "name", Value.Name); Swagger.Streams.Deserialize (Object, "legacy", Value.Legacy); Swagger.Streams.Deserialize (Object, "demo", Value.Demo); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out CurrentPlayerIDs_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : CurrentPlayerIDs_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in NameChange_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("name", Value.Name); Serialize (Into, "changedToAt", Value.Changed_To_At); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in NameChange_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out NameChange_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "name", Value.Name); Swagger.Streams.Deserialize (Object, "changedToAt", Value.Changed_To_At); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out NameChange_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : NameChange_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SkinModel_Type) is begin Into.Start_Entity (Name); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SkinModel_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SkinModel_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SkinModel_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : SkinModel_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in ChangeSkinRequest_Type) is begin Into.Start_Entity (Name); Serialize (Into, "model", Value.Model); Into.Write_Entity ("url", Value.Url); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in ChangeSkinRequest_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out ChangeSkinRequest_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Deserialize (Object, "model", Value.Model); Swagger.Streams.Deserialize (Object, "url", Value.Url); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out ChangeSkinRequest_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : ChangeSkinRequest_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SecurityAnswer_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("id", Value.Id); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in SecurityAnswer_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SecurityAnswer_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "id", Value.Id); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out SecurityAnswer_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : SecurityAnswer_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in OrderStatisticsResponse_Type) is begin Into.Start_Entity (Name); Serialize (Into, "total", Value.Total); Serialize (Into, "last24h", Value.Last24h); Into.Write_Entity ("saleVelocityPerSeconds", Value.Sale_Velocity_Per_Seconds); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in OrderStatisticsResponse_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out OrderStatisticsResponse_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "total", Value.Total); Swagger.Streams.Deserialize (Object, "last24h", Value.Last24h); Swagger.Streams.Deserialize (Object, "saleVelocityPerSeconds", Value.Sale_Velocity_Per_Seconds); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out OrderStatisticsResponse_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : OrderStatisticsResponse_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in OrderStatistic_Type) is begin Into.Start_Entity (Name); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in OrderStatistic_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out OrderStatistic_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out OrderStatistic_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : OrderStatistic_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in OrderStatisticsRequest_Type) is begin Into.Start_Entity (Name); Serialize (Into, "metricKeys", Value.Metric_Keys); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in OrderStatisticsRequest_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out OrderStatisticsRequest_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Deserialize (Object, "metricKeys", Value.Metric_Keys); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out OrderStatisticsRequest_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : OrderStatisticsRequest_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in UploadSkinRequest_Type) is begin Into.Start_Entity (Name); Serialize (Into, "model", Value.Model); Serialize (Into, "file", Value.File); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in UploadSkinRequest_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out UploadSkinRequest_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Deserialize (Object, "model", Value.Model); Deserialize (Object, "file", Value.File); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out UploadSkinRequest_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : UploadSkinRequest_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; end com.github.asyncmc.mojang.api.ada.server.model.Models;
33.328594
110
0.593449
04f2157a305f07c128742df12f8a30d5ff50ba67
162,579
adb
Ada
Vivado_HLS_Tutorial/Design_Analysis/lab1/dct_prj/solution3/.autopilot/db/dct.bind.adb
williambong/Vivado
68efafbc44b65c0bb047dbafc0ff7f1b56ee36bb
[ "MIT" ]
null
null
null
Vivado_HLS_Tutorial/Design_Analysis/lab1/dct_prj/solution3/.autopilot/db/dct.bind.adb
williambong/Vivado
68efafbc44b65c0bb047dbafc0ff7f1b56ee36bb
[ "MIT" ]
null
null
null
Vivado_HLS_Tutorial/Design_Analysis/lab1/dct_prj/solution3/.autopilot/db/dct.bind.adb
williambong/Vivado
68efafbc44b65c0bb047dbafc0ff7f1b56ee36bb
[ "MIT" ]
null
null
null
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization> <boost_serialization signature="serialization::archive" version="11"> <syndb class_id="0" tracking_level="0" version="0"> <userIPLatency>-1</userIPLatency> <userIPName></userIPName> <cdfg class_id="1" tracking_level="1" version="0" object_id="_0"> <name>dct</name> <ret_bitwidth>0</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="3" tracking_level="1" version="0" object_id="_1"> <Value class_id="4" tracking_level="0" version="0"> <Obj class_id="5" tracking_level="0" version="0"> <type>1</type> <id>1</id> <name>input_r</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo class_id="6" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>input</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>16</bitwidth> </Value> <direction>0</direction> <if_type>1</if_type> <array_size>64</array_size> <bit_vecs class_id="7" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_2"> <Value> <Obj> <type>1</type> <id>2</id> <name>output_r</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>output</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>16</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>64</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> </ports> <nodes class_id="8" tracking_level="0" version="0"> <count>58</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_3"> <Value> <Obj> <type>0</type> <id>14</id> <name>buf_2d_in</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>124</lineNumber> <contextFuncName>dct</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="10" tracking_level="0" version="0"> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second class_id="11" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="12" tracking_level="0" version="0"> <first class_id="13" tracking_level="0" version="0"> <first>dct.cpp</first> <second>dct</second> </first> <second>124</second> </item> </second> </item> </inlineStackInfo> <originalName>buf_2d_in</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>92</item> </oprand_edges> <opcode>alloca</opcode> </item> <item class_id_reference="9" object_id="_4"> <Value> <Obj> <type>0</type> <id>15</id> <name>buf_2d_out</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>93</item> </oprand_edges> <opcode>alloca</opcode> </item> <item class_id_reference="9" object_id="_5"> <Value> <Obj> <type>0</type> <id>16</id> <name></name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>103</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>103</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>94</item> </oprand_edges> <opcode>br</opcode> </item> <item class_id_reference="9" object_id="_6"> <Value> <Obj> <type>0</type> <id>18</id> <name>indvar_flatten</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>96</item> <item>97</item> <item>98</item> <item>99</item> </oprand_edges> <opcode>phi</opcode> </item> <item class_id_reference="9" object_id="_7"> <Value> <Obj> <type>0</type> <id>19</id> <name>r_i</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>105</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>105</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>101</item> <item>102</item> <item>103</item> <item>104</item> </oprand_edges> <opcode>phi</opcode> </item> <item class_id_reference="9" object_id="_8"> <Value> <Obj> <type>0</type> <id>20</id> <name>c_i</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>c</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>105</item> <item>106</item> <item>107</item> <item>108</item> </oprand_edges> <opcode>phi</opcode> </item> <item class_id_reference="9" object_id="_9"> <Value> <Obj> <type>0</type> <id>21</id> <name>exitcond_flatten</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>109</item> <item>111</item> </oprand_edges> <opcode>icmp</opcode> </item> <item class_id_reference="9" object_id="_10"> <Value> <Obj> <type>0</type> <id>22</id> <name>indvar_flatten_next</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>112</item> <item>114</item> </oprand_edges> <opcode>add</opcode> </item> <item class_id_reference="9" object_id="_11"> <Value> <Obj> <type>0</type> <id>23</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>115</item> <item>116</item> <item>117</item> </oprand_edges> <opcode>br</opcode> </item> <item class_id_reference="9" object_id="_12"> <Value> <Obj> <type>0</type> <id>27</id> <name>exitcond_i</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>105</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>105</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>118</item> <item>120</item> </oprand_edges> <opcode>icmp</opcode> </item> <item class_id_reference="9" object_id="_13"> <Value> <Obj> <type>0</type> <id>28</id> <name>c_i_mid2</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>105</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>105</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>121</item> <item>122</item> <item>123</item> </oprand_edges> <opcode>select</opcode> </item> <item class_id_reference="9" object_id="_14"> <Value> <Obj> <type>0</type> <id>29</id> <name>r</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>103</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>103</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>125</item> <item>126</item> </oprand_edges> <opcode>add</opcode> </item> <item class_id_reference="9" object_id="_15"> <Value> <Obj> <type>0</type> <id>30</id> <name>r_i_mid2</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>105</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>105</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>127</item> <item>128</item> <item>129</item> </oprand_edges> <opcode>select</opcode> </item> <item class_id_reference="9" object_id="_16"> <Value> <Obj> <type>0</type> <id>31</id> <name>tmp</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>105</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>105</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>3</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>130</item> </oprand_edges> <opcode>trunc</opcode> </item> <item class_id_reference="9" object_id="_17"> <Value> <Obj> <type>0</type> <id>32</id> <name>tmp_i</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>106</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>106</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>132</item> <item>133</item> <item>135</item> </oprand_edges> <opcode>bitconcatenate</opcode> </item> <item class_id_reference="9" object_id="_18"> <Value> <Obj> <type>0</type> <id>33</id> <name>c_i_cast6</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>105</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>105</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>136</item> </oprand_edges> <opcode>zext</opcode> </item> <item class_id_reference="9" object_id="_19"> <Value> <Obj> <type>0</type> <id>37</id> <name>tmp_5_i</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>106</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>106</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>137</item> <item>138</item> </oprand_edges> <opcode>add</opcode> </item> <item class_id_reference="9" object_id="_20"> <Value> <Obj> <type>0</type> <id>38</id> <name>tmp_6_i</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>106</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>106</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>139</item> </oprand_edges> <opcode>zext</opcode> </item> <item class_id_reference="9" object_id="_21"> <Value> <Obj> <type>0</type> <id>39</id> <name>input_addr</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>106</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>106</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>140</item> <item>142</item> <item>143</item> </oprand_edges> <opcode>getelementptr</opcode> </item> <item class_id_reference="9" object_id="_22"> <Value> <Obj> <type>0</type> <id>40</id> <name>input_load</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>106</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>106</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>144</item> </oprand_edges> <opcode>load</opcode> </item> <item class_id_reference="9" object_id="_23"> <Value> <Obj> <type>0</type> <id>41</id> <name>tmp_7_i_trn_cast</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>105</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>105</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>145</item> </oprand_edges> <opcode>zext</opcode> </item> <item class_id_reference="9" object_id="_24"> <Value> <Obj> <type>0</type> <id>42</id> <name>tmp_1</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>105</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>105</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>147</item> <item>148</item> <item>149</item> </oprand_edges> <opcode>bitconcatenate</opcode> </item> <item class_id_reference="9" object_id="_25"> <Value> <Obj> <type>0</type> <id>43</id> <name>p_addr_cast</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>106</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>106</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>150</item> </oprand_edges> <opcode>zext</opcode> </item> <item class_id_reference="9" object_id="_26"> <Value> <Obj> <type>0</type> <id>44</id> <name>p_addr1</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>106</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>106</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>151</item> <item>152</item> </oprand_edges> <opcode>add</opcode> </item> <item class_id_reference="9" object_id="_27"> <Value> <Obj> <type>0</type> <id>45</id> <name>tmp_2</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>106</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>106</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>153</item> </oprand_edges> <opcode>zext</opcode> </item> <item class_id_reference="9" object_id="_28"> <Value> <Obj> <type>0</type> <id>46</id> <name>buf_2d_in_addr</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>106</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>106</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>154</item> <item>155</item> <item>156</item> </oprand_edges> <opcode>getelementptr</opcode> </item> <item class_id_reference="9" object_id="_29"> <Value> <Obj> <type>0</type> <id>47</id> <name></name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>106</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>106</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>157</item> <item>158</item> </oprand_edges> <opcode>store</opcode> </item> <item class_id_reference="9" object_id="_30"> <Value> <Obj> <type>0</type> <id>49</id> <name>c</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>105</lineNumber> <contextFuncName>read_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>128</second> </item> <item> <first> <first>dct.cpp</first> <second>read_data</second> </first> <second>105</second> </item> </second> </item> </inlineStackInfo> <originalName>c</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>159</item> <item>160</item> </oprand_edges> <opcode>add</opcode> </item> <item class_id_reference="9" object_id="_31"> <Value> <Obj> <type>0</type> <id>50</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>161</item> </oprand_edges> <opcode>br</opcode> </item> <item class_id_reference="9" object_id="_32"> <Value> <Obj> <type>0</type> <id>52</id> <name></name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>130</lineNumber> <contextFuncName>dct</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>130</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>11</count> <item_version>0</item_version> <item>163</item> <item>164</item> <item>165</item> <item>224</item> <item>225</item> <item>226</item> <item>227</item> <item>228</item> <item>229</item> <item>230</item> <item>231</item> </oprand_edges> <opcode>call</opcode> </item> <item class_id_reference="9" object_id="_33"> <Value> <Obj> <type>0</type> <id>53</id> <name></name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>115</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>115</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>166</item> </oprand_edges> <opcode>br</opcode> </item> <item class_id_reference="9" object_id="_34"> <Value> <Obj> <type>0</type> <id>55</id> <name>indvar_flatten1</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>167</item> <item>168</item> <item>169</item> <item>170</item> </oprand_edges> <opcode>phi</opcode> </item> <item class_id_reference="9" object_id="_35"> <Value> <Obj> <type>0</type> <id>56</id> <name>r_i2</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>117</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>117</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>171</item> <item>172</item> <item>173</item> <item>174</item> </oprand_edges> <opcode>phi</opcode> </item> <item class_id_reference="9" object_id="_36"> <Value> <Obj> <type>0</type> <id>57</id> <name>c_i6</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>c</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>175</item> <item>176</item> <item>177</item> <item>178</item> </oprand_edges> <opcode>phi</opcode> </item> <item class_id_reference="9" object_id="_37"> <Value> <Obj> <type>0</type> <id>58</id> <name>exitcond_flatten1</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>179</item> <item>180</item> </oprand_edges> <opcode>icmp</opcode> </item> <item class_id_reference="9" object_id="_38"> <Value> <Obj> <type>0</type> <id>59</id> <name>indvar_flatten_next1</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>181</item> <item>182</item> </oprand_edges> <opcode>add</opcode> </item> <item class_id_reference="9" object_id="_39"> <Value> <Obj> <type>0</type> <id>60</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>183</item> <item>184</item> <item>185</item> </oprand_edges> <opcode>br</opcode> </item> <item class_id_reference="9" object_id="_40"> <Value> <Obj> <type>0</type> <id>64</id> <name>exitcond_i1</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>117</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>117</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>186</item> <item>187</item> </oprand_edges> <opcode>icmp</opcode> </item> <item class_id_reference="9" object_id="_41"> <Value> <Obj> <type>0</type> <id>65</id> <name>c_i6_mid2</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>117</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>117</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>188</item> <item>189</item> <item>190</item> </oprand_edges> <opcode>select</opcode> </item> <item class_id_reference="9" object_id="_42"> <Value> <Obj> <type>0</type> <id>66</id> <name>r_s</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>115</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>115</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>191</item> <item>192</item> </oprand_edges> <opcode>add</opcode> </item> <item class_id_reference="9" object_id="_43"> <Value> <Obj> <type>0</type> <id>67</id> <name>r_i2_mid2</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>117</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>117</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>193</item> <item>194</item> <item>195</item> </oprand_edges> <opcode>select</opcode> </item> <item class_id_reference="9" object_id="_44"> <Value> <Obj> <type>0</type> <id>68</id> <name>tmp_3</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>117</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>117</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>3</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>196</item> </oprand_edges> <opcode>trunc</opcode> </item> <item class_id_reference="9" object_id="_45"> <Value> <Obj> <type>0</type> <id>69</id> <name>tmp_i5</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>197</item> <item>198</item> <item>199</item> </oprand_edges> <opcode>bitconcatenate</opcode> </item> <item class_id_reference="9" object_id="_46"> <Value> <Obj> <type>0</type> <id>70</id> <name>c_i6_cast2</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>117</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>117</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>200</item> </oprand_edges> <opcode>zext</opcode> </item> <item class_id_reference="9" object_id="_47"> <Value> <Obj> <type>0</type> <id>74</id> <name>tmp_8_i_trn_cast</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>117</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>117</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>201</item> </oprand_edges> <opcode>zext</opcode> </item> <item class_id_reference="9" object_id="_48"> <Value> <Obj> <type>0</type> <id>75</id> <name>tmp_4</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>117</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>117</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>202</item> <item>203</item> <item>204</item> </oprand_edges> <opcode>bitconcatenate</opcode> </item> <item class_id_reference="9" object_id="_49"> <Value> <Obj> <type>0</type> <id>76</id> <name>p_addr2_cast</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>205</item> </oprand_edges> <opcode>zext</opcode> </item> <item class_id_reference="9" object_id="_50"> <Value> <Obj> <type>0</type> <id>77</id> <name>p_addr3</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>206</item> <item>207</item> </oprand_edges> <opcode>add</opcode> </item> <item class_id_reference="9" object_id="_51"> <Value> <Obj> <type>0</type> <id>78</id> <name>tmp_5</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>208</item> </oprand_edges> <opcode>zext</opcode> </item> <item class_id_reference="9" object_id="_52"> <Value> <Obj> <type>0</type> <id>79</id> <name>buf_2d_out_addr</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>209</item> <item>210</item> <item>211</item> </oprand_edges> <opcode>getelementptr</opcode> </item> <item class_id_reference="9" object_id="_53"> <Value> <Obj> <type>0</type> <id>80</id> <name>buf_2d_out_load</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>212</item> </oprand_edges> <opcode>load</opcode> </item> <item class_id_reference="9" object_id="_54"> <Value> <Obj> <type>0</type> <id>81</id> <name>tmp_9_i</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>213</item> <item>214</item> </oprand_edges> <opcode>add</opcode> </item> <item class_id_reference="9" object_id="_55"> <Value> <Obj> <type>0</type> <id>82</id> <name>tmp_3_i</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>215</item> </oprand_edges> <opcode>zext</opcode> </item> <item class_id_reference="9" object_id="_56"> <Value> <Obj> <type>0</type> <id>83</id> <name>output_addr</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>216</item> <item>217</item> <item>218</item> </oprand_edges> <opcode>getelementptr</opcode> </item> <item class_id_reference="9" object_id="_57"> <Value> <Obj> <type>0</type> <id>84</id> <name></name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>219</item> <item>220</item> </oprand_edges> <opcode>store</opcode> </item> <item class_id_reference="9" object_id="_58"> <Value> <Obj> <type>0</type> <id>86</id> <name>c_1</name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>117</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>133</second> </item> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>117</second> </item> </second> </item> </inlineStackInfo> <originalName>c</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>221</item> <item>222</item> </oprand_edges> <opcode>add</opcode> </item> <item class_id_reference="9" object_id="_59"> <Value> <Obj> <type>0</type> <id>87</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>223</item> </oprand_edges> <opcode>br</opcode> </item> <item class_id_reference="9" object_id="_60"> <Value> <Obj> <type>0</type> <id>89</id> <name></name> <fileName>dct.cpp</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</fileDirectory> <lineNumber>134</lineNumber> <contextFuncName>dct</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>dct</second> </first> <second>134</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>0</count> <item_version>0</item_version> </oprand_edges> <opcode>ret</opcode> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>10</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_61"> <Value> <Obj> <type>2</type> <id>91</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_62"> <Value> <Obj> <type>2</type> <id>95</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>7</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_63"> <Value> <Obj> <type>2</type> <id>100</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_64"> <Value> <Obj> <type>2</type> <id>110</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>7</bitwidth> </Value> <const_type>0</const_type> <content>64</content> </item> <item class_id_reference="16" object_id="_65"> <Value> <Obj> <type>2</type> <id>113</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>7</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_66"> <Value> <Obj> <type>2</type> <id>119</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <const_type>0</const_type> <content>8</content> </item> <item class_id_reference="16" object_id="_67"> <Value> <Obj> <type>2</type> <id>124</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_68"> <Value> <Obj> <type>2</type> <id>134</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>3</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_69"> <Value> <Obj> <type>2</type> <id>141</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_70"> <Value> <Obj> <type>2</type> <id>162</id> <name>dct_dct_2d</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <const_type>6</const_type> <content>&lt;constant:dct_dct_2d&gt;</content> </item> </consts> <blocks class_id="17" tracking_level="0" version="0"> <count>7</count> <item_version>0</item_version> <item class_id="18" tracking_level="1" version="0" object_id="_71"> <Obj> <type>3</type> <id>17</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>3</count> <item_version>0</item_version> <item>14</item> <item>15</item> <item>16</item> </node_objs> </item> <item class_id_reference="18" object_id="_72"> <Obj> <type>3</type> <id>24</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>6</count> <item_version>0</item_version> <item>18</item> <item>19</item> <item>20</item> <item>21</item> <item>22</item> <item>23</item> </node_objs> </item> <item class_id_reference="18" object_id="_73"> <Obj> <type>3</type> <id>51</id> <name>.reset</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>20</count> <item_version>0</item_version> <item>27</item> <item>28</item> <item>29</item> <item>30</item> <item>31</item> <item>32</item> <item>33</item> <item>37</item> <item>38</item> <item>39</item> <item>40</item> <item>41</item> <item>42</item> <item>43</item> <item>44</item> <item>45</item> <item>46</item> <item>47</item> <item>49</item> <item>50</item> </node_objs> </item> <item class_id_reference="18" object_id="_74"> <Obj> <type>3</type> <id>54</id> <name>read_data.exit</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>2</count> <item_version>0</item_version> <item>52</item> <item>53</item> </node_objs> </item> <item class_id_reference="18" object_id="_75"> <Obj> <type>3</type> <id>61</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>6</count> <item_version>0</item_version> <item>55</item> <item>56</item> <item>57</item> <item>58</item> <item>59</item> <item>60</item> </node_objs> </item> <item class_id_reference="18" object_id="_76"> <Obj> <type>3</type> <id>88</id> <name>.reset10</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>20</count> <item_version>0</item_version> <item>64</item> <item>65</item> <item>66</item> <item>67</item> <item>68</item> <item>69</item> <item>70</item> <item>74</item> <item>75</item> <item>76</item> <item>77</item> <item>78</item> <item>79</item> <item>80</item> <item>81</item> <item>82</item> <item>83</item> <item>84</item> <item>86</item> <item>87</item> </node_objs> </item> <item class_id_reference="18" object_id="_77"> <Obj> <type>3</type> <id>90</id> <name>write_data.exit</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>1</count> <item_version>0</item_version> <item>89</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>133</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_78"> <id>92</id> <edge_type>1</edge_type> <source_obj>91</source_obj> <sink_obj>14</sink_obj> </item> <item class_id_reference="20" object_id="_79"> <id>93</id> <edge_type>1</edge_type> <source_obj>91</source_obj> <sink_obj>15</sink_obj> </item> <item class_id_reference="20" object_id="_80"> <id>94</id> <edge_type>2</edge_type> <source_obj>24</source_obj> <sink_obj>16</sink_obj> </item> <item class_id_reference="20" object_id="_81"> <id>96</id> <edge_type>1</edge_type> <source_obj>95</source_obj> <sink_obj>18</sink_obj> </item> <item class_id_reference="20" object_id="_82"> <id>97</id> <edge_type>2</edge_type> <source_obj>17</source_obj> <sink_obj>18</sink_obj> </item> <item class_id_reference="20" object_id="_83"> <id>98</id> <edge_type>1</edge_type> <source_obj>22</source_obj> <sink_obj>18</sink_obj> </item> <item class_id_reference="20" object_id="_84"> <id>99</id> <edge_type>2</edge_type> <source_obj>51</source_obj> <sink_obj>18</sink_obj> </item> <item class_id_reference="20" object_id="_85"> <id>101</id> <edge_type>1</edge_type> <source_obj>100</source_obj> <sink_obj>19</sink_obj> </item> <item class_id_reference="20" object_id="_86"> <id>102</id> <edge_type>2</edge_type> <source_obj>17</source_obj> <sink_obj>19</sink_obj> </item> <item class_id_reference="20" object_id="_87"> <id>103</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>19</sink_obj> </item> <item class_id_reference="20" object_id="_88"> <id>104</id> <edge_type>2</edge_type> <source_obj>51</source_obj> <sink_obj>19</sink_obj> </item> <item class_id_reference="20" object_id="_89"> <id>105</id> <edge_type>1</edge_type> <source_obj>100</source_obj> <sink_obj>20</sink_obj> </item> <item class_id_reference="20" object_id="_90"> <id>106</id> <edge_type>2</edge_type> <source_obj>17</source_obj> <sink_obj>20</sink_obj> </item> <item class_id_reference="20" object_id="_91"> <id>107</id> <edge_type>1</edge_type> <source_obj>49</source_obj> <sink_obj>20</sink_obj> </item> <item class_id_reference="20" object_id="_92"> <id>108</id> <edge_type>2</edge_type> <source_obj>51</source_obj> <sink_obj>20</sink_obj> </item> <item class_id_reference="20" object_id="_93"> <id>109</id> <edge_type>1</edge_type> <source_obj>18</source_obj> <sink_obj>21</sink_obj> </item> <item class_id_reference="20" object_id="_94"> <id>111</id> <edge_type>1</edge_type> <source_obj>110</source_obj> <sink_obj>21</sink_obj> </item> <item class_id_reference="20" object_id="_95"> <id>112</id> <edge_type>1</edge_type> <source_obj>18</source_obj> <sink_obj>22</sink_obj> </item> <item class_id_reference="20" object_id="_96"> <id>114</id> <edge_type>1</edge_type> <source_obj>113</source_obj> <sink_obj>22</sink_obj> </item> <item class_id_reference="20" object_id="_97"> <id>115</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>23</sink_obj> </item> <item class_id_reference="20" object_id="_98"> <id>116</id> <edge_type>2</edge_type> <source_obj>51</source_obj> <sink_obj>23</sink_obj> </item> <item class_id_reference="20" object_id="_99"> <id>117</id> <edge_type>2</edge_type> <source_obj>54</source_obj> <sink_obj>23</sink_obj> </item> <item class_id_reference="20" object_id="_100"> <id>118</id> <edge_type>1</edge_type> <source_obj>20</source_obj> <sink_obj>27</sink_obj> </item> <item class_id_reference="20" object_id="_101"> <id>120</id> <edge_type>1</edge_type> <source_obj>119</source_obj> <sink_obj>27</sink_obj> </item> <item class_id_reference="20" object_id="_102"> <id>121</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>28</sink_obj> </item> <item class_id_reference="20" object_id="_103"> <id>122</id> <edge_type>1</edge_type> <source_obj>100</source_obj> <sink_obj>28</sink_obj> </item> <item class_id_reference="20" object_id="_104"> <id>123</id> <edge_type>1</edge_type> <source_obj>20</source_obj> <sink_obj>28</sink_obj> </item> <item class_id_reference="20" object_id="_105"> <id>125</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>29</sink_obj> </item> <item class_id_reference="20" object_id="_106"> <id>126</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>29</sink_obj> </item> <item class_id_reference="20" object_id="_107"> <id>127</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>30</sink_obj> </item> <item class_id_reference="20" object_id="_108"> <id>128</id> <edge_type>1</edge_type> <source_obj>29</source_obj> <sink_obj>30</sink_obj> </item> <item class_id_reference="20" object_id="_109"> <id>129</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>30</sink_obj> </item> <item class_id_reference="20" object_id="_110"> <id>130</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>31</sink_obj> </item> <item class_id_reference="20" object_id="_111"> <id>133</id> <edge_type>1</edge_type> <source_obj>31</source_obj> <sink_obj>32</sink_obj> </item> <item class_id_reference="20" object_id="_112"> <id>135</id> <edge_type>1</edge_type> <source_obj>134</source_obj> <sink_obj>32</sink_obj> </item> <item class_id_reference="20" object_id="_113"> <id>136</id> <edge_type>1</edge_type> <source_obj>28</source_obj> <sink_obj>33</sink_obj> </item> <item class_id_reference="20" object_id="_114"> <id>137</id> <edge_type>1</edge_type> <source_obj>33</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_115"> <id>138</id> <edge_type>1</edge_type> <source_obj>32</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_116"> <id>139</id> <edge_type>1</edge_type> <source_obj>37</source_obj> <sink_obj>38</sink_obj> </item> <item class_id_reference="20" object_id="_117"> <id>140</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>39</sink_obj> </item> <item class_id_reference="20" object_id="_118"> <id>142</id> <edge_type>1</edge_type> <source_obj>141</source_obj> <sink_obj>39</sink_obj> </item> <item class_id_reference="20" object_id="_119"> <id>143</id> <edge_type>1</edge_type> <source_obj>38</source_obj> <sink_obj>39</sink_obj> </item> <item class_id_reference="20" object_id="_120"> <id>144</id> <edge_type>1</edge_type> <source_obj>39</source_obj> <sink_obj>40</sink_obj> </item> <item class_id_reference="20" object_id="_121"> <id>145</id> <edge_type>1</edge_type> <source_obj>28</source_obj> <sink_obj>41</sink_obj> </item> <item class_id_reference="20" object_id="_122"> <id>148</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>42</sink_obj> </item> <item class_id_reference="20" object_id="_123"> <id>149</id> <edge_type>1</edge_type> <source_obj>134</source_obj> <sink_obj>42</sink_obj> </item> <item class_id_reference="20" object_id="_124"> <id>150</id> <edge_type>1</edge_type> <source_obj>42</source_obj> <sink_obj>43</sink_obj> </item> <item class_id_reference="20" object_id="_125"> <id>151</id> <edge_type>1</edge_type> <source_obj>43</source_obj> <sink_obj>44</sink_obj> </item> <item class_id_reference="20" object_id="_126"> <id>152</id> <edge_type>1</edge_type> <source_obj>41</source_obj> <sink_obj>44</sink_obj> </item> <item class_id_reference="20" object_id="_127"> <id>153</id> <edge_type>1</edge_type> <source_obj>44</source_obj> <sink_obj>45</sink_obj> </item> <item class_id_reference="20" object_id="_128"> <id>154</id> <edge_type>1</edge_type> <source_obj>14</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_129"> <id>155</id> <edge_type>1</edge_type> <source_obj>141</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_130"> <id>156</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_131"> <id>157</id> <edge_type>1</edge_type> <source_obj>40</source_obj> <sink_obj>47</sink_obj> </item> <item class_id_reference="20" object_id="_132"> <id>158</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>47</sink_obj> </item> <item class_id_reference="20" object_id="_133"> <id>159</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>49</sink_obj> </item> <item class_id_reference="20" object_id="_134"> <id>160</id> <edge_type>1</edge_type> <source_obj>28</source_obj> <sink_obj>49</sink_obj> </item> <item class_id_reference="20" object_id="_135"> <id>161</id> <edge_type>2</edge_type> <source_obj>24</source_obj> <sink_obj>50</sink_obj> </item> <item class_id_reference="20" object_id="_136"> <id>163</id> <edge_type>1</edge_type> <source_obj>162</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_137"> <id>164</id> <edge_type>1</edge_type> <source_obj>14</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_138"> <id>165</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_139"> <id>166</id> <edge_type>2</edge_type> <source_obj>61</source_obj> <sink_obj>53</sink_obj> </item> <item class_id_reference="20" object_id="_140"> <id>167</id> <edge_type>1</edge_type> <source_obj>95</source_obj> <sink_obj>55</sink_obj> </item> <item class_id_reference="20" object_id="_141"> <id>168</id> <edge_type>2</edge_type> <source_obj>54</source_obj> <sink_obj>55</sink_obj> </item> <item class_id_reference="20" object_id="_142"> <id>169</id> <edge_type>1</edge_type> <source_obj>59</source_obj> <sink_obj>55</sink_obj> </item> <item class_id_reference="20" object_id="_143"> <id>170</id> <edge_type>2</edge_type> <source_obj>88</source_obj> <sink_obj>55</sink_obj> </item> <item class_id_reference="20" object_id="_144"> <id>171</id> <edge_type>1</edge_type> <source_obj>100</source_obj> <sink_obj>56</sink_obj> </item> <item class_id_reference="20" object_id="_145"> <id>172</id> <edge_type>2</edge_type> <source_obj>54</source_obj> <sink_obj>56</sink_obj> </item> <item class_id_reference="20" object_id="_146"> <id>173</id> <edge_type>1</edge_type> <source_obj>67</source_obj> <sink_obj>56</sink_obj> </item> <item class_id_reference="20" object_id="_147"> <id>174</id> <edge_type>2</edge_type> <source_obj>88</source_obj> <sink_obj>56</sink_obj> </item> <item class_id_reference="20" object_id="_148"> <id>175</id> <edge_type>1</edge_type> <source_obj>100</source_obj> <sink_obj>57</sink_obj> </item> <item class_id_reference="20" object_id="_149"> <id>176</id> <edge_type>2</edge_type> <source_obj>54</source_obj> <sink_obj>57</sink_obj> </item> <item class_id_reference="20" object_id="_150"> <id>177</id> <edge_type>1</edge_type> <source_obj>86</source_obj> <sink_obj>57</sink_obj> </item> <item class_id_reference="20" object_id="_151"> <id>178</id> <edge_type>2</edge_type> <source_obj>88</source_obj> <sink_obj>57</sink_obj> </item> <item class_id_reference="20" object_id="_152"> <id>179</id> <edge_type>1</edge_type> <source_obj>55</source_obj> <sink_obj>58</sink_obj> </item> <item class_id_reference="20" object_id="_153"> <id>180</id> <edge_type>1</edge_type> <source_obj>110</source_obj> <sink_obj>58</sink_obj> </item> <item class_id_reference="20" object_id="_154"> <id>181</id> <edge_type>1</edge_type> <source_obj>55</source_obj> <sink_obj>59</sink_obj> </item> <item class_id_reference="20" object_id="_155"> <id>182</id> <edge_type>1</edge_type> <source_obj>113</source_obj> <sink_obj>59</sink_obj> </item> <item class_id_reference="20" object_id="_156"> <id>183</id> <edge_type>1</edge_type> <source_obj>58</source_obj> <sink_obj>60</sink_obj> </item> <item class_id_reference="20" object_id="_157"> <id>184</id> <edge_type>2</edge_type> <source_obj>88</source_obj> <sink_obj>60</sink_obj> </item> <item class_id_reference="20" object_id="_158"> <id>185</id> <edge_type>2</edge_type> <source_obj>90</source_obj> <sink_obj>60</sink_obj> </item> <item class_id_reference="20" object_id="_159"> <id>186</id> <edge_type>1</edge_type> <source_obj>57</source_obj> <sink_obj>64</sink_obj> </item> <item class_id_reference="20" object_id="_160"> <id>187</id> <edge_type>1</edge_type> <source_obj>119</source_obj> <sink_obj>64</sink_obj> </item> <item class_id_reference="20" object_id="_161"> <id>188</id> <edge_type>1</edge_type> <source_obj>64</source_obj> <sink_obj>65</sink_obj> </item> <item class_id_reference="20" object_id="_162"> <id>189</id> <edge_type>1</edge_type> <source_obj>100</source_obj> <sink_obj>65</sink_obj> </item> <item class_id_reference="20" object_id="_163"> <id>190</id> <edge_type>1</edge_type> <source_obj>57</source_obj> <sink_obj>65</sink_obj> </item> <item class_id_reference="20" object_id="_164"> <id>191</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>66</sink_obj> </item> <item class_id_reference="20" object_id="_165"> <id>192</id> <edge_type>1</edge_type> <source_obj>56</source_obj> <sink_obj>66</sink_obj> </item> <item class_id_reference="20" object_id="_166"> <id>193</id> <edge_type>1</edge_type> <source_obj>64</source_obj> <sink_obj>67</sink_obj> </item> <item class_id_reference="20" object_id="_167"> <id>194</id> <edge_type>1</edge_type> <source_obj>66</source_obj> <sink_obj>67</sink_obj> </item> <item class_id_reference="20" object_id="_168"> <id>195</id> <edge_type>1</edge_type> <source_obj>56</source_obj> <sink_obj>67</sink_obj> </item> <item class_id_reference="20" object_id="_169"> <id>196</id> <edge_type>1</edge_type> <source_obj>67</source_obj> <sink_obj>68</sink_obj> </item> <item class_id_reference="20" object_id="_170"> <id>198</id> <edge_type>1</edge_type> <source_obj>68</source_obj> <sink_obj>69</sink_obj> </item> <item class_id_reference="20" object_id="_171"> <id>199</id> <edge_type>1</edge_type> <source_obj>134</source_obj> <sink_obj>69</sink_obj> </item> <item class_id_reference="20" object_id="_172"> <id>200</id> <edge_type>1</edge_type> <source_obj>65</source_obj> <sink_obj>70</sink_obj> </item> <item class_id_reference="20" object_id="_173"> <id>201</id> <edge_type>1</edge_type> <source_obj>65</source_obj> <sink_obj>74</sink_obj> </item> <item class_id_reference="20" object_id="_174"> <id>203</id> <edge_type>1</edge_type> <source_obj>67</source_obj> <sink_obj>75</sink_obj> </item> <item class_id_reference="20" object_id="_175"> <id>204</id> <edge_type>1</edge_type> <source_obj>134</source_obj> <sink_obj>75</sink_obj> </item> <item class_id_reference="20" object_id="_176"> <id>205</id> <edge_type>1</edge_type> <source_obj>75</source_obj> <sink_obj>76</sink_obj> </item> <item class_id_reference="20" object_id="_177"> <id>206</id> <edge_type>1</edge_type> <source_obj>76</source_obj> <sink_obj>77</sink_obj> </item> <item class_id_reference="20" object_id="_178"> <id>207</id> <edge_type>1</edge_type> <source_obj>74</source_obj> <sink_obj>77</sink_obj> </item> <item class_id_reference="20" object_id="_179"> <id>208</id> <edge_type>1</edge_type> <source_obj>77</source_obj> <sink_obj>78</sink_obj> </item> <item class_id_reference="20" object_id="_180"> <id>209</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>79</sink_obj> </item> <item class_id_reference="20" object_id="_181"> <id>210</id> <edge_type>1</edge_type> <source_obj>141</source_obj> <sink_obj>79</sink_obj> </item> <item class_id_reference="20" object_id="_182"> <id>211</id> <edge_type>1</edge_type> <source_obj>78</source_obj> <sink_obj>79</sink_obj> </item> <item class_id_reference="20" object_id="_183"> <id>212</id> <edge_type>1</edge_type> <source_obj>79</source_obj> <sink_obj>80</sink_obj> </item> <item class_id_reference="20" object_id="_184"> <id>213</id> <edge_type>1</edge_type> <source_obj>70</source_obj> <sink_obj>81</sink_obj> </item> <item class_id_reference="20" object_id="_185"> <id>214</id> <edge_type>1</edge_type> <source_obj>69</source_obj> <sink_obj>81</sink_obj> </item> <item class_id_reference="20" object_id="_186"> <id>215</id> <edge_type>1</edge_type> <source_obj>81</source_obj> <sink_obj>82</sink_obj> </item> <item class_id_reference="20" object_id="_187"> <id>216</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>83</sink_obj> </item> <item class_id_reference="20" object_id="_188"> <id>217</id> <edge_type>1</edge_type> <source_obj>141</source_obj> <sink_obj>83</sink_obj> </item> <item class_id_reference="20" object_id="_189"> <id>218</id> <edge_type>1</edge_type> <source_obj>82</source_obj> <sink_obj>83</sink_obj> </item> <item class_id_reference="20" object_id="_190"> <id>219</id> <edge_type>1</edge_type> <source_obj>80</source_obj> <sink_obj>84</sink_obj> </item> <item class_id_reference="20" object_id="_191"> <id>220</id> <edge_type>1</edge_type> <source_obj>83</source_obj> <sink_obj>84</sink_obj> </item> <item class_id_reference="20" object_id="_192"> <id>221</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>86</sink_obj> </item> <item class_id_reference="20" object_id="_193"> <id>222</id> <edge_type>1</edge_type> <source_obj>65</source_obj> <sink_obj>86</sink_obj> </item> <item class_id_reference="20" object_id="_194"> <id>223</id> <edge_type>2</edge_type> <source_obj>61</source_obj> <sink_obj>87</sink_obj> </item> <item class_id_reference="20" object_id="_195"> <id>224</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_196"> <id>225</id> <edge_type>1</edge_type> <source_obj>4</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_197"> <id>226</id> <edge_type>1</edge_type> <source_obj>5</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_198"> <id>227</id> <edge_type>1</edge_type> <source_obj>6</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_199"> <id>228</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_200"> <id>229</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_201"> <id>230</id> <edge_type>1</edge_type> <source_obj>9</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_202"> <id>231</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_203"> <id>292</id> <edge_type>2</edge_type> <source_obj>17</source_obj> <sink_obj>24</sink_obj> </item> <item class_id_reference="20" object_id="_204"> <id>293</id> <edge_type>2</edge_type> <source_obj>24</source_obj> <sink_obj>54</sink_obj> </item> <item class_id_reference="20" object_id="_205"> <id>294</id> <edge_type>2</edge_type> <source_obj>24</source_obj> <sink_obj>51</sink_obj> </item> <item class_id_reference="20" object_id="_206"> <id>295</id> <edge_type>2</edge_type> <source_obj>51</source_obj> <sink_obj>24</sink_obj> </item> <item class_id_reference="20" object_id="_207"> <id>296</id> <edge_type>2</edge_type> <source_obj>54</source_obj> <sink_obj>61</sink_obj> </item> <item class_id_reference="20" object_id="_208"> <id>297</id> <edge_type>2</edge_type> <source_obj>61</source_obj> <sink_obj>90</sink_obj> </item> <item class_id_reference="20" object_id="_209"> <id>298</id> <edge_type>2</edge_type> <source_obj>61</source_obj> <sink_obj>88</sink_obj> </item> <item class_id_reference="20" object_id="_210"> <id>299</id> <edge_type>2</edge_type> <source_obj>88</source_obj> <sink_obj>61</sink_obj> </item> </edges> </cdfg> <cdfg_regions class_id="21" tracking_level="0" version="0"> <count>6</count> <item_version>0</item_version> <item class_id="22" tracking_level="1" version="0" object_id="_211"> <mId>1</mId> <mTag>dct</mTag> <mType>0</mType> <sub_regions> <count>5</count> <item_version>0</item_version> <item>2</item> <item>3</item> <item>4</item> <item>5</item> <item>6</item> </sub_regions> <basic_blocks> <count>0</count> <item_version>0</item_version> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>890</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_212"> <mId>2</mId> <mTag>Entry</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>17</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_213"> <mId>3</mId> <mTag>RD_Loop_Row_RD_Loop_Col</mTag> <mType>1</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>24</item> <item>51</item> </basic_blocks> <mII>1</mII> <mDepth>2</mDepth> <mMinTripCount>64</mMinTripCount> <mMaxTripCount>64</mMaxTripCount> <mMinLatency>64</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_214"> <mId>4</mId> <mTag>Region 1</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>54</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>758</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_215"> <mId>5</mId> <mTag>WR_Loop_Row_WR_Loop_Col</mTag> <mType>1</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>61</item> <item>88</item> </basic_blocks> <mII>1</mII> <mDepth>2</mDepth> <mMinTripCount>64</mMinTripCount> <mMaxTripCount>64</mMaxTripCount> <mMinLatency>64</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_216"> <mId>6</mId> <mTag>Return</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>90</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> </cdfg_regions> <fsm class_id="24" tracking_level="1" version="0" object_id="_217"> <states class_id="25" tracking_level="0" version="0"> <count>8</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_218"> <id>1</id> <operations class_id="27" tracking_level="0" version="0"> <count>6</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_219"> <id>11</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_220"> <id>12</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_221"> <id>13</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_222"> <id>14</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_223"> <id>15</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_224"> <id>16</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_225"> <id>2</id> <operations> <count>18</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_226"> <id>18</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_227"> <id>19</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_228"> <id>20</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_229"> <id>21</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_230"> <id>22</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_231"> <id>23</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_232"> <id>27</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_233"> <id>28</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_234"> <id>29</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_235"> <id>30</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_236"> <id>31</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_237"> <id>32</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_238"> <id>33</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_239"> <id>37</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_240"> <id>38</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_241"> <id>39</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_242"> <id>40</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_243"> <id>49</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_244"> <id>3</id> <operations> <count>15</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_245"> <id>25</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_246"> <id>26</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_247"> <id>34</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_248"> <id>35</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_249"> <id>36</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_250"> <id>40</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_251"> <id>41</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_252"> <id>42</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_253"> <id>43</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_254"> <id>44</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_255"> <id>45</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_256"> <id>46</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_257"> <id>47</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_258"> <id>48</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_259"> <id>50</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_260"> <id>4</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_261"> <id>52</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_262"> <id>5</id> <operations> <count>2</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_263"> <id>52</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_264"> <id>53</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_265"> <id>6</id> <operations> <count>22</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_266"> <id>55</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_267"> <id>56</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_268"> <id>57</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_269"> <id>58</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_270"> <id>59</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_271"> <id>60</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_272"> <id>64</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_273"> <id>65</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_274"> <id>66</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_275"> <id>67</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_276"> <id>68</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_277"> <id>69</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_278"> <id>70</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_279"> <id>74</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_280"> <id>75</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_281"> <id>76</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_282"> <id>77</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_283"> <id>78</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_284"> <id>79</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_285"> <id>80</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_286"> <id>81</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_287"> <id>86</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_288"> <id>7</id> <operations> <count>11</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_289"> <id>62</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_290"> <id>63</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_291"> <id>71</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_292"> <id>72</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_293"> <id>73</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_294"> <id>80</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_295"> <id>82</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_296"> <id>83</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_297"> <id>84</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_298"> <id>85</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_299"> <id>87</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_300"> <id>8</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_301"> <id>89</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="29" tracking_level="0" version="0"> <count>9</count> <item_version>0</item_version> <item class_id="30" tracking_level="1" version="0" object_id="_302"> <inState>1</inState> <outState>2</outState> <condition class_id="31" tracking_level="0" version="0"> <id>45</id> <sop class_id="32" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="33" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_303"> <inState>4</inState> <outState>5</outState> <condition> <id>52</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_304"> <inState>5</inState> <outState>6</outState> <condition> <id>54</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_305"> <inState>3</inState> <outState>2</outState> <condition> <id>62</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_306"> <inState>2</inState> <outState>4</outState> <condition> <id>61</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item class_id="34" tracking_level="0" version="0"> <first class_id="35" tracking_level="0" version="0"> <first>21</first> <second>0</second> </first> <second>0</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_307"> <inState>2</inState> <outState>3</outState> <condition> <id>63</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item> <first> <first>21</first> <second>0</second> </first> <second>1</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_308"> <inState>7</inState> <outState>6</outState> <condition> <id>65</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_309"> <inState>6</inState> <outState>8</outState> <condition> <id>64</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item> <first> <first>58</first> <second>0</second> </first> <second>0</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_310"> <inState>6</inState> <outState>7</outState> <condition> <id>66</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item> <first> <first>58</first> <second>0</second> </first> <second>1</second> </item> </item> </sop> </condition> </item> </transitions> </fsm> <res class_id="36" tracking_level="1" version="0" object_id="_311"> <dp_component_resource class_id="37" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_component_resource> <dp_expression_resource> <count>0</count> <item_version>0</item_version> </dp_expression_resource> <dp_fifo_resource> <count>0</count> <item_version>0</item_version> </dp_fifo_resource> <dp_memory_resource> <count>0</count> <item_version>0</item_version> </dp_memory_resource> <dp_multiplexer_resource> <count>0</count> <item_version>0</item_version> </dp_multiplexer_resource> <dp_register_resource> <count>0</count> <item_version>0</item_version> </dp_register_resource> <dp_component_map class_id="38" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_component_map> <dp_expression_map> <count>0</count> <item_version>0</item_version> </dp_expression_map> <dp_fifo_map> <count>0</count> <item_version>0</item_version> </dp_fifo_map> <dp_memory_map> <count>0</count> <item_version>0</item_version> </dp_memory_map> </res> <node_label_latency class_id="39" tracking_level="0" version="0"> <count>58</count> <item_version>0</item_version> <item class_id="40" tracking_level="0" version="0"> <first>14</first> <second class_id="41" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>15</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>16</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>18</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>19</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>20</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>21</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>22</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>23</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>27</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>28</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>29</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>30</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>31</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>32</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>33</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>37</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>38</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>39</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>40</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>41</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>42</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>43</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>44</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>45</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>46</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>47</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>49</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>50</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>52</first> <second> <first>2</first> <second>1</second> </second> </item> <item> <first>53</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>55</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>56</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>57</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>58</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>59</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>60</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>64</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>65</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>66</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>67</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>68</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>69</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>70</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>74</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>75</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>76</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>77</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>78</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>79</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>80</first> <second> <first>4</first> <second>1</second> </second> </item> <item> <first>81</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>82</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>83</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>84</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>86</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>87</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>89</first> <second> <first>5</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="42" tracking_level="0" version="0"> <count>7</count> <item_version>0</item_version> <item class_id="43" tracking_level="0" version="0"> <first>17</first> <second class_id="44" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>24</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>51</first> <second> <first>1</first> <second>2</second> </second> </item> <item> <first>54</first> <second> <first>2</first> <second>3</second> </second> </item> <item> <first>61</first> <second> <first>4</first> <second>4</second> </second> </item> <item> <first>88</first> <second> <first>4</first> <second>5</second> </second> </item> <item> <first>90</first> <second> <first>5</first> <second>5</second> </second> </item> </bblk_ent_exit> <regions class_id="45" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="46" tracking_level="1" version="0" object_id="_312"> <region_name>RD_Loop_Row_RD_Loop_Col</region_name> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>24</item> <item>51</item> </basic_blocks> <nodes> <count>0</count> <item_version>0</item_version> </nodes> <anchor_node>-1</anchor_node> <region_type>8</region_type> <interval>1</interval> <pipe_depth>2</pipe_depth> </item> <item class_id_reference="46" object_id="_313"> <region_name>WR_Loop_Row_WR_Loop_Col</region_name> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>61</item> <item>88</item> </basic_blocks> <nodes> <count>0</count> <item_version>0</item_version> </nodes> <anchor_node>-1</anchor_node> <region_type>8</region_type> <interval>1</interval> <pipe_depth>2</pipe_depth> </item> </regions> <dp_fu_nodes class_id="47" tracking_level="0" version="0"> <count>51</count> <item_version>0</item_version> <item class_id="48" tracking_level="0" version="0"> <first>76</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>80</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> <item> <first>84</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> <item> <first>91</first> <second> <count>2</count> <item_version>0</item_version> <item>40</item> <item>40</item> </second> </item> <item> <first>96</first> <second> <count>1</count> <item_version>0</item_version> <item>46</item> </second> </item> <item> <first>102</first> <second> <count>1</count> <item_version>0</item_version> <item>47</item> </second> </item> <item> <first>108</first> <second> <count>1</count> <item_version>0</item_version> <item>79</item> </second> </item> <item> <first>114</first> <second> <count>2</count> <item_version>0</item_version> <item>80</item> <item>80</item> </second> </item> <item> <first>119</first> <second> <count>1</count> <item_version>0</item_version> <item>83</item> </second> </item> <item> <first>126</first> <second> <count>1</count> <item_version>0</item_version> <item>84</item> </second> </item> <item> <first>136</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>147</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>158</first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> <item> <first>169</first> <second> <count>1</count> <item_version>0</item_version> <item>55</item> </second> </item> <item> <first>180</first> <second> <count>1</count> <item_version>0</item_version> <item>56</item> </second> </item> <item> <first>191</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> <item> <first>198</first> <second> <count>2</count> <item_version>0</item_version> <item>52</item> <item>52</item> </second> </item> <item> <first>220</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>226</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>232</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>238</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>246</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>252</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>260</first> <second> <count>1</count> <item_version>0</item_version> <item>31</item> </second> </item> <item> <first>264</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>272</first> <second> <count>1</count> <item_version>0</item_version> <item>33</item> </second> </item> <item> <first>276</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>282</first> <second> <count>1</count> <item_version>0</item_version> <item>38</item> </second> </item> <item> <first>287</first> <second> <count>1</count> <item_version>0</item_version> <item>49</item> </second> </item> <item> <first>293</first> <second> <count>1</count> <item_version>0</item_version> <item>41</item> </second> </item> <item> <first>296</first> <second> <count>1</count> <item_version>0</item_version> <item>42</item> </second> </item> <item> <first>303</first> <second> <count>1</count> <item_version>0</item_version> <item>43</item> </second> </item> <item> <first>307</first> <second> <count>1</count> <item_version>0</item_version> <item>44</item> </second> </item> <item> <first>313</first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>318</first> <second> <count>1</count> <item_version>0</item_version> <item>58</item> </second> </item> <item> <first>324</first> <second> <count>1</count> <item_version>0</item_version> <item>59</item> </second> </item> <item> <first>330</first> <second> <count>1</count> <item_version>0</item_version> <item>64</item> </second> </item> <item> <first>336</first> <second> <count>1</count> <item_version>0</item_version> <item>65</item> </second> </item> <item> <first>344</first> <second> <count>1</count> <item_version>0</item_version> <item>66</item> </second> </item> <item> <first>350</first> <second> <count>1</count> <item_version>0</item_version> <item>67</item> </second> </item> <item> <first>358</first> <second> <count>1</count> <item_version>0</item_version> <item>68</item> </second> </item> <item> <first>362</first> <second> <count>1</count> <item_version>0</item_version> <item>69</item> </second> </item> <item> <first>370</first> <second> <count>1</count> <item_version>0</item_version> <item>70</item> </second> </item> <item> <first>374</first> <second> <count>1</count> <item_version>0</item_version> <item>74</item> </second> </item> <item> <first>378</first> <second> <count>1</count> <item_version>0</item_version> <item>75</item> </second> </item> <item> <first>386</first> <second> <count>1</count> <item_version>0</item_version> <item>76</item> </second> </item> <item> <first>390</first> <second> <count>1</count> <item_version>0</item_version> <item>77</item> </second> </item> <item> <first>396</first> <second> <count>1</count> <item_version>0</item_version> <item>78</item> </second> </item> <item> <first>401</first> <second> <count>1</count> <item_version>0</item_version> <item>81</item> </second> </item> <item> <first>407</first> <second> <count>1</count> <item_version>0</item_version> <item>86</item> </second> </item> <item> <first>413</first> <second> <count>1</count> <item_version>0</item_version> <item>82</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="50" tracking_level="0" version="0"> <count>46</count> <item_version>0</item_version> <item class_id="51" tracking_level="0" version="0"> <first>buf_2d_in_addr_gep_fu_96</first> <second> <count>1</count> <item_version>0</item_version> <item>46</item> </second> </item> <item> <first>buf_2d_in_alloca_fu_76</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>buf_2d_out_addr_gep_fu_108</first> <second> <count>1</count> <item_version>0</item_version> <item>79</item> </second> </item> <item> <first>buf_2d_out_alloca_fu_80</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> <item> <first>c_1_fu_407</first> <second> <count>1</count> <item_version>0</item_version> <item>86</item> </second> </item> <item> <first>c_fu_287</first> <second> <count>1</count> <item_version>0</item_version> <item>49</item> </second> </item> <item> <first>c_i6_cast2_fu_370</first> <second> <count>1</count> <item_version>0</item_version> <item>70</item> </second> </item> <item> <first>c_i6_mid2_fu_336</first> <second> <count>1</count> <item_version>0</item_version> <item>65</item> </second> </item> <item> <first>c_i6_phi_fu_191</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> <item> <first>c_i_cast6_fu_272</first> <second> <count>1</count> <item_version>0</item_version> <item>33</item> </second> </item> <item> <first>c_i_mid2_fu_238</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>c_i_phi_fu_158</first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> <item> <first>exitcond_flatten1_fu_318</first> <second> <count>1</count> <item_version>0</item_version> <item>58</item> </second> </item> <item> <first>exitcond_flatten_fu_220</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>exitcond_i1_fu_330</first> <second> <count>1</count> <item_version>0</item_version> <item>64</item> </second> </item> <item> <first>exitcond_i_fu_232</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>indvar_flatten1_phi_fu_169</first> <second> <count>1</count> <item_version>0</item_version> <item>55</item> </second> </item> <item> <first>indvar_flatten_next1_fu_324</first> <second> <count>1</count> <item_version>0</item_version> <item>59</item> </second> </item> <item> <first>indvar_flatten_next_fu_226</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>indvar_flatten_phi_fu_136</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>input_addr_gep_fu_84</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> <item> <first>output_addr_gep_fu_119</first> <second> <count>1</count> <item_version>0</item_version> <item>83</item> </second> </item> <item> <first>p_addr1_fu_307</first> <second> <count>1</count> <item_version>0</item_version> <item>44</item> </second> </item> <item> <first>p_addr2_cast_fu_386</first> <second> <count>1</count> <item_version>0</item_version> <item>76</item> </second> </item> <item> <first>p_addr3_fu_390</first> <second> <count>1</count> <item_version>0</item_version> <item>77</item> </second> </item> <item> <first>p_addr_cast_fu_303</first> <second> <count>1</count> <item_version>0</item_version> <item>43</item> </second> </item> <item> <first>r_fu_246</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>r_i2_mid2_fu_350</first> <second> <count>1</count> <item_version>0</item_version> <item>67</item> </second> </item> <item> <first>r_i2_phi_fu_180</first> <second> <count>1</count> <item_version>0</item_version> <item>56</item> </second> </item> <item> <first>r_i_mid2_fu_252</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>r_i_phi_fu_147</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>r_s_fu_344</first> <second> <count>1</count> <item_version>0</item_version> <item>66</item> </second> </item> <item> <first>tmp_1_fu_296</first> <second> <count>1</count> <item_version>0</item_version> <item>42</item> </second> </item> <item> <first>tmp_2_fu_313</first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>tmp_3_fu_358</first> <second> <count>1</count> <item_version>0</item_version> <item>68</item> </second> </item> <item> <first>tmp_3_i_fu_413</first> <second> <count>1</count> <item_version>0</item_version> <item>82</item> </second> </item> <item> <first>tmp_4_fu_378</first> <second> <count>1</count> <item_version>0</item_version> <item>75</item> </second> </item> <item> <first>tmp_5_fu_396</first> <second> <count>1</count> <item_version>0</item_version> <item>78</item> </second> </item> <item> <first>tmp_5_i_fu_276</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>tmp_6_i_fu_282</first> <second> <count>1</count> <item_version>0</item_version> <item>38</item> </second> </item> <item> <first>tmp_7_i_trn_cast_fu_293</first> <second> <count>1</count> <item_version>0</item_version> <item>41</item> </second> </item> <item> <first>tmp_8_i_trn_cast_fu_374</first> <second> <count>1</count> <item_version>0</item_version> <item>74</item> </second> </item> <item> <first>tmp_9_i_fu_401</first> <second> <count>1</count> <item_version>0</item_version> <item>81</item> </second> </item> <item> <first>tmp_fu_260</first> <second> <count>1</count> <item_version>0</item_version> <item>31</item> </second> </item> <item> <first>tmp_i5_fu_362</first> <second> <count>1</count> <item_version>0</item_version> <item>69</item> </second> </item> <item> <first>tmp_i_fu_264</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> </dp_fu_nodes_expression> <dp_fu_nodes_module> <count>1</count> <item_version>0</item_version> <item> <first>grp_dct_dct_2d_fu_198</first> <second> <count>2</count> <item_version>0</item_version> <item>52</item> <item>52</item> </second> </item> </dp_fu_nodes_module> <dp_fu_nodes_io> <count>0</count> <item_version>0</item_version> </dp_fu_nodes_io> <return_ports> <count>0</count> <item_version>0</item_version> </return_ports> <dp_mem_port_nodes class_id="52" tracking_level="0" version="0"> <count>14</count> <item_version>0</item_version> <item class_id="53" tracking_level="0" version="0"> <first class_id="54" tracking_level="0" version="0"> <first>buf_2d_in</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>47</item> </second> </item> <item> <first> <first>buf_2d_in</first> <second>100</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first> <first>buf_2d_out</first> <second>0</second> </first> <second> <count>2</count> <item_version>0</item_version> <item>80</item> <item>80</item> </second> </item> <item> <first> <first>buf_2d_out</first> <second>100</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first> <first>dct_coeff_table_0</first> <second>100</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first> <first>dct_coeff_table_1</first> <second>100</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first> <first>dct_coeff_table_2</first> <second>100</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first> <first>dct_coeff_table_3</first> <second>100</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first> <first>dct_coeff_table_4</first> <second>100</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first> <first>dct_coeff_table_5</first> <second>100</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first> <first>dct_coeff_table_6</first> <second>100</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first> <first>dct_coeff_table_7</first> <second>100</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first> <first>input_r</first> <second>0</second> </first> <second> <count>2</count> <item_version>0</item_version> <item>40</item> <item>40</item> </second> </item> <item> <first> <first>output_r</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>84</item> </second> </item> </dp_mem_port_nodes> <dp_reg_nodes> <count>18</count> <item_version>0</item_version> <item> <first>132</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>143</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>154</first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> <item> <first>165</first> <second> <count>1</count> <item_version>0</item_version> <item>55</item> </second> </item> <item> <first>176</first> <second> <count>1</count> <item_version>0</item_version> <item>56</item> </second> </item> <item> <first>187</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> <item> <first>417</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>421</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>426</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>431</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>437</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> <item> <first>442</first> <second> <count>1</count> <item_version>0</item_version> <item>49</item> </second> </item> <item> <first>447</first> <second> <count>1</count> <item_version>0</item_version> <item>58</item> </second> </item> <item> <first>451</first> <second> <count>1</count> <item_version>0</item_version> <item>59</item> </second> </item> <item> <first>456</first> <second> <count>1</count> <item_version>0</item_version> <item>67</item> </second> </item> <item> <first>461</first> <second> <count>1</count> <item_version>0</item_version> <item>79</item> </second> </item> <item> <first>466</first> <second> <count>1</count> <item_version>0</item_version> <item>81</item> </second> </item> <item> <first>471</first> <second> <count>1</count> <item_version>0</item_version> <item>86</item> </second> </item> </dp_reg_nodes> <dp_regname_nodes> <count>18</count> <item_version>0</item_version> <item> <first>buf_2d_out_addr_reg_461</first> <second> <count>1</count> <item_version>0</item_version> <item>79</item> </second> </item> <item> <first>c_1_reg_471</first> <second> <count>1</count> <item_version>0</item_version> <item>86</item> </second> </item> <item> <first>c_i6_reg_187</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> <item> <first>c_i_mid2_reg_426</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>c_i_reg_154</first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> <item> <first>c_reg_442</first> <second> <count>1</count> <item_version>0</item_version> <item>49</item> </second> </item> <item> <first>exitcond_flatten1_reg_447</first> <second> <count>1</count> <item_version>0</item_version> <item>58</item> </second> </item> <item> <first>exitcond_flatten_reg_417</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>indvar_flatten1_reg_165</first> <second> <count>1</count> <item_version>0</item_version> <item>55</item> </second> </item> <item> <first>indvar_flatten_next1_reg_451</first> <second> <count>1</count> <item_version>0</item_version> <item>59</item> </second> </item> <item> <first>indvar_flatten_next_reg_421</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>indvar_flatten_reg_132</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>input_addr_reg_437</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> <item> <first>r_i2_mid2_reg_456</first> <second> <count>1</count> <item_version>0</item_version> <item>67</item> </second> </item> <item> <first>r_i2_reg_176</first> <second> <count>1</count> <item_version>0</item_version> <item>56</item> </second> </item> <item> <first>r_i_mid2_reg_431</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>r_i_reg_143</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>tmp_9_i_reg_466</first> <second> <count>1</count> <item_version>0</item_version> <item>81</item> </second> </item> </dp_regname_nodes> <dp_reg_phi> <count>6</count> <item_version>0</item_version> <item> <first>132</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>143</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>154</first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> <item> <first>165</first> <second> <count>1</count> <item_version>0</item_version> <item>55</item> </second> </item> <item> <first>176</first> <second> <count>1</count> <item_version>0</item_version> <item>56</item> </second> </item> <item> <first>187</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> </dp_reg_phi> <dp_regname_phi> <count>6</count> <item_version>0</item_version> <item> <first>c_i6_reg_187</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> <item> <first>c_i_reg_154</first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> <item> <first>indvar_flatten1_reg_165</first> <second> <count>1</count> <item_version>0</item_version> <item>55</item> </second> </item> <item> <first>indvar_flatten_reg_132</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>r_i2_reg_176</first> <second> <count>1</count> <item_version>0</item_version> <item>56</item> </second> </item> <item> <first>r_i_reg_143</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> </dp_regname_phi> <dp_port_io_nodes class_id="55" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="56" tracking_level="0" version="0"> <first>input_r(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>load</first> <second> <count>2</count> <item_version>0</item_version> <item>40</item> <item>40</item> </second> </item> </second> </item> <item> <first>output_r(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>84</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core class_id="57" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="58" tracking_level="0" version="0"> <first>1</first> <second>RAM</second> </item> <item> <first>2</first> <second>RAM</second> </item> </port2core> <node2core> <count>2</count> <item_version>0</item_version> <item> <first>14</first> <second>RAM</second> </item> <item> <first>15</first> <second>RAM</second> </item> </node2core> </syndb> </boost_serialization>
24.588475
98
0.576157
2201c128a586342b47f1bb6625e82eab1bf77367
1,030
ads
Ada
gnu/src/gdb/gdb/testsuite/gdb.ada/char_param/pck.ads
ghsecuritylab/ellcc-mirror
b03a4afac74d50cf0987554b8c0cd8209bcb92a2
[ "BSD-2-Clause" ]
null
null
null
gnu/src/gdb/gdb/testsuite/gdb.ada/char_param/pck.ads
ghsecuritylab/ellcc-mirror
b03a4afac74d50cf0987554b8c0cd8209bcb92a2
[ "BSD-2-Clause" ]
null
null
null
gnu/src/gdb/gdb/testsuite/gdb.ada/char_param/pck.ads
ghsecuritylab/ellcc-mirror
b03a4afac74d50cf0987554b8c0cd8209bcb92a2
[ "BSD-2-Clause" ]
null
null
null
-- Copyright 2007-2015 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. package Pck is Procedure_Result : Character := ' '; procedure Same (C : Character); -- Set Procedure_Result to C. procedure Next (C : in out Character); -- Increment C (if C is the last character, then set C to the first -- character). Set Procedure_Result to the new value of C. end Pck;
36.785714
73
0.715534
22fe0fc8715586390f1c96c1698748eaded9cf7b
1,083
ads
Ada
chat_procedures.ads
cborao/Ada-P4-chat
233f350bb99671d62e940911643d3904540a9dd3
[ "MIT" ]
null
null
null
chat_procedures.ads
cborao/Ada-P4-chat
233f350bb99671d62e940911643d3904540a9dd3
[ "MIT" ]
null
null
null
chat_procedures.ads
cborao/Ada-P4-chat
233f350bb99671d62e940911643d3904540a9dd3
[ "MIT" ]
null
null
null
--PRÁCTICA 4: CÉSAR BORAO MORATINOS (Chat_Procedures.ads) with Ada.Text_IO; with Hash_Maps_G; with Ada.Calendar; with Ordered_Maps_G; with Lower_Layer_UDP; with Ada.Command_Line; with Ada.Strings.Unbounded; package Chat_Procedures is package ATI renames Ada.Text_IO; package LLU renames Lower_Layer_UDP; package ACL renames Ada.Command_Line; package ASU renames Ada.Strings.Unbounded; use type ASU.Unbounded_String; type Data is record Client_EP: LLU.End_Point_Type; Time: Ada.Calendar.Time; end record; type Old_Data is record Nick: ASU.Unbounded_String; Time: Ada.Calendar.Time; end record; function Max_Valid (Max_Clients: Natural) return Boolean; procedure Print_Active_Map; procedure Print_Old_Map; procedure Case_Init (I_Buffer: access LLU.Buffer_Type; O_Buffer: access LLU.Buffer_Type); procedure Case_Writer (I_Buffer: access LLU.Buffer_Type; O_Buffer: access LLU.Buffer_Type); procedure Case_Logout (I_Buffer: access LLU.Buffer_Type; O_Buffer: access LLU.Buffer_Type); end Chat_Procedures;
22.102041
58
0.762696
0469ecc7eae1bbfad891bc31b9a20836fea81978
9,664
adb
Ada
3-mid/impact/source/2d/dynamics/joints/impact-d2-joint-distance.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
20
2015-11-04T09:23:59.000Z
2022-01-14T10:21:42.000Z
3-mid/impact/source/2d/dynamics/joints/impact-d2-joint-distance.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
2
2015-11-04T17:05:56.000Z
2015-12-08T03:16:13.000Z
3-mid/impact/source/2d/dynamics/joints/impact-d2-joint-distance.adb
charlie5/lace
e9b7dc751d500ff3f559617a6fc3089ace9dc134
[ "0BSD" ]
1
2015-12-07T12:53:52.000Z
2015-12-07T12:53:52.000Z
with impact.d2.Solid; package body impact.d2.Joint.distance -- -- 1-D constrained system -- m (v2 - v1) = lambda -- v2 + (beta/h) * x1 + gamma * lambda = 0, gamma has units of inverse mass. -- x2 = x1 + h * v2 -- -- 1-D mass-damper-spring system -- m (v2 - v1) + h * d * v2 + h * k * -- -- C = norm(p2 - p1) - L -- u = (p2 - p1) / norm(p2 - p1) -- Cdot = dot(u, v2 + cross(w2, r2) - v1 - cross(w1, r1)) -- J = [-u -cross(r1, u) u cross(r2, u)] -- K = J * invM * JT -- = invMass1 + invI1 * cross(r1, u)^2 + invMass2 + invI2 * cross(r2, u)^2 -- is function to_b2DistanceJointDef return b2DistanceJointDef is Self : b2DistanceJointDef; begin Self.kind := e_distanceJoint; Self.localAnchorA := (0.0, 0.0); Self.localAnchorB := (0.0, 0.0); Self.length := 1.0; Self.frequencyHz := 0.0; Self.dampingRatio := 0.0; return Self; end to_b2DistanceJointDef; -- Initialize the bodies, anchors, and length using the world anchors. -- procedure initialize (Self : in out b2DistanceJointDef; bodyA, bodyB : Solid_view; anchorA, anchorB : in b2Vec2) is use impact.d2.Solid; -- use -- impact.d2.orbs.Solid, -- impact.d2.Solid; d : b2Vec2; begin Self.bodyA := bodyA; Self.bodyB := bodyB; Self.localAnchorA := Self.bodyA.GetLocalPoint (anchorA); Self.localAnchorB := Self.bodyB.GetLocalPoint (anchorB); d := anchorB - anchorA; Self.length := Length (d); end initialize; function GetLength (Self : in b2DistanceJoint) return float32 is begin return Self.m_length; end GetLength; procedure SetLength (Self : in out b2DistanceJoint; length : in float32) is begin self.m_length := length; end SetLength; function GetFrequency (Self : in b2DistanceJoint) return float32 is begin return Self.m_frequencyHz; end GetFrequency; procedure SetFrequency (Self : in out b2DistanceJoint; hz : in float32) is begin self.m_frequencyHz := hz; end SetFrequency; function GetDampingRatio (Self : in b2DistanceJoint) return float32 is begin return Self.m_dampingRatio; end GetDampingRatio; procedure SetDampingRatio (Self : in out b2DistanceJoint; ratio : in float32) is begin self.m_dampingRatio := ratio; end SetDampingRatio; function to_b2DistanceJoint (def : in b2DistanceJointDef'Class) return b2DistanceJoint is Self : b2DistanceJoint; begin define (b2Joint (Self), def); Self.m_localAnchor1 := def.localAnchorA; Self.m_localAnchor2 := def.localAnchorB; Self.m_length := def.length; Self.m_frequencyHz := def.frequencyHz; Self.m_dampingRatio := def.dampingRatio; Self.m_impulse := 0.0; Self.m_gamma := 0.0; Self.m_bias := 0.0; return Self; end to_b2DistanceJoint; overriding procedure InitVelocityConstraints (Self : in out b2DistanceJoint; step : in b2TimeStep) is b1 : Solid_view renames Self.m_bodyA; b2 : Solid_view renames Self.m_bodyB; r1, r2 : b2Vec2; length : float32; cr1u, cr2u : float32; invMass : float32; P : b2Vec2; begin -- Compute the effective mass matrix. r1 := b2Mul (b1.GetTransform.R, Self.m_localAnchor1 - b1.GetLocalCenter); r2 := b2Mul (b2.GetTransform.R, Self.m_localAnchor2 - b2.GetLocalCenter); Self.m_u := b2.m_sweep.c + r2 - b1.m_sweep.c - r1; -- Handle singularity. length := math.Length (Self.m_u); if length > b2_linearSlop then Self.m_u := Self.m_u * (1.0 / length); else Self.m_u := (0.0, 0.0); end if; cr1u := b2Cross (r1, Self.m_u); cr2u := b2Cross (r2, Self.m_u); invMass := b1.m_invMass.all + b1.m_invI.all * cr1u * cr1u + b2.m_invMass.all + b2.m_invI.all * cr2u * cr2u; if invMass /= 0.0 then Self.m_mass := 1.0 / invMass; else Self.m_mass := 0.0; end if; if Self.m_frequencyHz > 0.0 then declare C : constant float32 := length - Self.m_length; omega : constant float32 := 2.0 * b2_pi * Self.m_frequencyHz; -- Frequency d : constant float32 := 2.0 * Self.m_mass * Self.m_dampingRatio * omega; -- Damping coefficient k : constant float32 := Self.m_mass * omega * omega; -- Spring stiffness begin -- magic formulas Self.m_gamma := step.dt * (d + step.dt * k); if Self.m_gamma /= 0.0 then Self.m_gamma := 1.0 / Self.m_gamma; else Self.m_gamma := 0.0; end if; Self.m_bias := C * step.dt * k * Self.m_gamma; Self.m_mass := invMass + Self.m_gamma; if Self.m_mass /= 0.0 then Self.m_mass := 1.0 / Self.m_mass; else Self.m_mass := 0.0; end if; end; end if; if step.warmStarting then -- Scale the impulse to support a variable time step. Self.m_impulse := Self.m_impulse * step.dtRatio; P := Self.m_impulse * Self.m_u; b1.m_linearVelocity.all := b1.m_linearVelocity.all - b1.m_invMass.all * P; b1.m_angularVelocity.all := b1.m_angularVelocity.all - b1.m_invI.all * b2Cross (r1, P); b2.m_linearVelocity.all := b2.m_linearVelocity.all + b2.m_invMass.all * P; b2.m_angularVelocity.all := b2.m_angularVelocity.all + b2.m_invI.all * b2Cross (r2, P); else Self.m_impulse := 0.0; end if; end InitVelocityConstraints; overriding procedure SolveVelocityConstraints (Self : in out b2DistanceJoint; step : in b2TimeStep) is pragma Unreferenced (step); b1 : Solid_view renames Self.m_bodyA; b2 : Solid_view renames Self.m_bodyB; r1 : constant b2Vec2 := b2Mul (b1.GetTransform.R, Self.m_localAnchor1 - b1.GetLocalCenter); r2 : constant b2Vec2 := b2Mul (b2.GetTransform.R, Self.m_localAnchor2 - b2.GetLocalCenter); -- Cdot = dot(u, v + cross(w, r)) -- v1 : constant b2Vec2 := b1.m_linearVelocity.all + b2Cross (b1.m_angularVelocity.all, r1); v2 : constant b2Vec2 := b2.m_linearVelocity.all + b2Cross (b2.m_angularVelocity.all, r2); Cdot : constant float32 := b2Dot (Self.m_u, v2 - v1); impulse : constant float32 := -Self.m_mass * (Cdot + Self.m_bias + Self.m_gamma * Self.m_impulse); P : b2Vec2; begin Self.m_impulse := Self.m_impulse + impulse; P := impulse * Self.m_u; b1.m_linearVelocity.all := b1.m_linearVelocity.all - b1.m_invMass.all * P; b1.m_angularVelocity.all := b1.m_angularVelocity.all - b1.m_invI.all * b2Cross (r1, P); b2.m_linearVelocity.all := b2.m_linearVelocity.all + b2.m_invMass.all * P; b2.m_angularVelocity.all := b2.m_angularVelocity.all + b2.m_invI.all * b2Cross (r2, P); end SolveVelocityConstraints; overriding function SolvePositionConstraints (Self : access b2DistanceJoint; baumgarte : in float32) return Boolean is pragma Unreferenced (baumgarte); b1 : Solid_view renames Self.m_bodyA; b2 : Solid_view renames Self.m_bodyB; begin if Self.m_frequencyHz > 0.0 then return True; -- There is no position correction for soft distance constraints. end if; declare r1 : constant b2Vec2 := b2Mul (b1.GetTransform.R, Self.m_localAnchor1 - b1.GetLocalCenter); r2 : constant b2Vec2 := b2Mul (b2.GetTransform.R, Self.m_localAnchor2 - b2.GetLocalCenter); d : aliased b2Vec2 := b2.m_sweep.c + r2 - b1.m_sweep.c - r1; length : constant float32 := Normalize (d'Access); C : float32 := length - Self.m_length; impulse : float32; P : b2Vec2; begin C := b2Clamp (C, -b2_maxLinearCorrection, b2_maxLinearCorrection); impulse := -Self.m_mass * C; Self.m_u := d; P := impulse * Self.m_u; b1.m_sweep.c := b1.m_sweep.c - b1.m_invMass.all * P; b1.m_sweep.a := b1.m_sweep.a - b1.m_invI.all * b2Cross (r1, P); b2.m_sweep.c := b2.m_sweep.c + b2.m_invMass.all * P; b2.m_sweep.a := b2.m_sweep.a + b2.m_invI.all * b2Cross (r2, P); b1.SynchronizeTransform; b2.SynchronizeTransform; return abs (C) < b2_linearSlop; end; end SolvePositionConstraints; overriding function GetAnchorA (Self : in b2DistanceJoint) return b2Vec2 is begin return Self.m_bodyA.GetWorldPoint (Self.m_localAnchor1); end GetAnchorA; overriding function GetAnchorB (Self : in b2DistanceJoint) return b2Vec2 is begin return Self.m_bodyB.GetWorldPoint (Self.m_localAnchor2); end GetAnchorB; overriding function GetReactionForce (Self : in b2DistanceJoint; inv_dt : in float32) return b2Vec2 is begin return (inv_dt * Self.m_impulse) * Self.m_u; end GetReactionForce; overriding function GetReactionTorque (Self : in b2DistanceJoint; inv_dt : in float32) return float32 is pragma Unreferenced (inv_dt, Self); begin return 0.0; end GetReactionTorque; end impact.d2.Joint.distance;
29.021021
121
0.59344
1a953b60f2c552bfb6434c7d5de2deb2a74d5cb5
5,282
ads
Ada
gcc-gcc-7_3_0-release/gcc/ada/sem_ch9.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/ada/sem_ch9.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/sem_ch9.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S E M _ C H 9 -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Table; with Types; use Types; package Sem_Ch9 is procedure Analyze_Abort_Statement (N : Node_Id); procedure Analyze_Accept_Alternative (N : Node_Id); procedure Analyze_Accept_Statement (N : Node_Id); procedure Analyze_Asynchronous_Select (N : Node_Id); procedure Analyze_Conditional_Entry_Call (N : Node_Id); procedure Analyze_Delay_Alternative (N : Node_Id); procedure Analyze_Delay_Relative (N : Node_Id); procedure Analyze_Delay_Until (N : Node_Id); procedure Analyze_Entry_Body (N : Node_Id); procedure Analyze_Entry_Body_Formal_Part (N : Node_Id); procedure Analyze_Entry_Call_Alternative (N : Node_Id); procedure Analyze_Entry_Declaration (N : Node_Id); procedure Analyze_Entry_Index_Specification (N : Node_Id); procedure Analyze_Protected_Body (N : Node_Id); procedure Analyze_Protected_Definition (N : Node_Id); procedure Analyze_Protected_Type_Declaration (N : Node_Id); procedure Analyze_Requeue (N : Node_Id); procedure Analyze_Selective_Accept (N : Node_Id); procedure Analyze_Single_Protected_Declaration (N : Node_Id); procedure Analyze_Single_Task_Declaration (N : Node_Id); procedure Analyze_Task_Body (N : Node_Id); procedure Analyze_Task_Definition (N : Node_Id); procedure Analyze_Task_Type_Declaration (N : Node_Id); procedure Analyze_Terminate_Alternative (N : Node_Id); procedure Analyze_Timed_Entry_Call (N : Node_Id); procedure Analyze_Triggering_Alternative (N : Node_Id); procedure Install_Declarations (Spec : Entity_Id); -- Make visible in corresponding body the entities defined in a task, -- protected type declaration, or entry declaration. ------------------------------ -- Lock Free Data Structure -- ------------------------------ -- A lock-free subprogram is a protected routine which references a unique -- protected scalar component and does not contain statements that cause -- side effects. Due to this restricted behavior, all references to shared -- data from within the subprogram can be synchronized through the use of -- atomic operations rather than relying on locks. type Lock_Free_Subprogram is record Sub_Body : Node_Id; -- Reference to the body of a protected subprogram which meets the lock- -- free requirements. Comp_Id : Entity_Id; -- Reference to the scalar component referenced from within Sub_Body end record; -- This table establishes a relation between a protected subprogram body -- and a unique component it references. The table is used when building -- the lock-free versions of a protected subprogram body. package Lock_Free_Subprogram_Table is new Table.Table ( Table_Component_Type => Lock_Free_Subprogram, Table_Index_Type => Nat, Table_Low_Bound => 1, Table_Initial => 5, Table_Increment => 5, Table_Name => "Lock_Free_Subprogram_Table"); end Sem_Ch9;
57.413043
79
0.539758
06cf683d2e9f3f8b9cd025191fa805f924af202c
2,792
ads
Ada
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/g-soccon.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/g-soccon.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/g-soccon.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G N A T . S O C K E T S . C O N S T A N T S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2000-2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides a temporary compatibility renaming for deprecated -- internal package GNAT.Sockets.Constants. -- This package should not be directly used by an applications program. -- It is a compatibility artefact to help building legacy code with newer -- compilers, and will be removed at some point in the future. with System.OS_Constants; package GNAT.Sockets.Constants renames System.OS_Constants;
68.097561
78
0.432307
3d62b204ef3c2f84a1de22a43024a2f8c3eb41a4
902
adb
Ada
src/executor_service.adb
egilhh/Futures-in-Ada
f1c71ad6d7774e98dc44a98c9252bf0ead34a69e
[ "MIT" ]
1
2015-11-25T19:57:53.000Z
2015-11-25T19:57:53.000Z
src/executor_service.adb
egilhh/Futures-in-Ada
f1c71ad6d7774e98dc44a98c9252bf0ead34a69e
[ "MIT" ]
null
null
null
src/executor_service.adb
egilhh/Futures-in-Ada
f1c71ad6d7774e98dc44a98c9252bf0ead34a69e
[ "MIT" ]
null
null
null
with Ada.Exceptions; with Ada.Text_IO; with Ada.Unchecked_Deallocation; package body Executor_Service is procedure Execute (Self : in out Object; Callback : Callable_Ptr) is begin Self.Executor.Run(Callback); -- should probably be put on a queue end Execute; task body Thread is Execute_Later : Callable_Ptr; begin loop select accept Run(Callback : in Callable_Ptr) do Execute_Later := Callback; end Run; Execute_Later.Call; -- don't use Execute_Later beyond this point, as it (may) have been -- deallocated elsewhere Execute_Later := null; or terminate; end select; end loop; exception when e : others => Ada.Text_IO.Put_Line("ERROR: " & Ada.Exceptions.Exception_Information(e)); end Thread; end Executor_Service;
23.736842
83
0.620843
4b9b42995a66934426508f6a4b72ea3467be4404
6,819
adb
Ada
source/amf/utp/amf-internals-utp_validation_actions.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/amf/utp/amf-internals-utp_validation_actions.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/amf/utp/amf-internals-utp_validation_actions.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
4
2017-07-18T07:11:05.000Z
2020-06-21T03:02:25.000Z
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Elements; with AMF.Internals.Helpers; with AMF.Internals.Tables.Utp_Attributes; with AMF.UML.Call_Operation_Actions; with AMF.Visitors.Utp_Iterators; with AMF.Visitors.Utp_Visitors; package body AMF.Internals.Utp_Validation_Actions is ------------------------------------ -- Get_Base_Call_Operation_Action -- ------------------------------------ overriding function Get_Base_Call_Operation_Action (Self : not null access constant Utp_Validation_Action_Proxy) return AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access is begin return AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.Utp_Attributes.Internal_Get_Base_Call_Operation_Action (Self.Element))); end Get_Base_Call_Operation_Action; ------------------------------------ -- Set_Base_Call_Operation_Action -- ------------------------------------ overriding procedure Set_Base_Call_Operation_Action (Self : not null access Utp_Validation_Action_Proxy; To : AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access) is begin AMF.Internals.Tables.Utp_Attributes.Internal_Set_Base_Call_Operation_Action (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_Base_Call_Operation_Action; ------------------- -- Enter_Element -- ------------------- overriding procedure Enter_Element (Self : not null access constant Utp_Validation_Action_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Visitor in AMF.Visitors.Utp_Visitors.Utp_Visitor'Class then AMF.Visitors.Utp_Visitors.Utp_Visitor'Class (Visitor).Enter_Validation_Action (AMF.Utp.Validation_Actions.Utp_Validation_Action_Access (Self), Control); end if; end Enter_Element; ------------------- -- Leave_Element -- ------------------- overriding procedure Leave_Element (Self : not null access constant Utp_Validation_Action_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Visitor in AMF.Visitors.Utp_Visitors.Utp_Visitor'Class then AMF.Visitors.Utp_Visitors.Utp_Visitor'Class (Visitor).Leave_Validation_Action (AMF.Utp.Validation_Actions.Utp_Validation_Action_Access (Self), Control); end if; end Leave_Element; ------------------- -- Visit_Element -- ------------------- overriding procedure Visit_Element (Self : not null access constant Utp_Validation_Action_Proxy; Iterator : in out AMF.Visitors.Abstract_Iterator'Class; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Iterator in AMF.Visitors.Utp_Iterators.Utp_Iterator'Class then AMF.Visitors.Utp_Iterators.Utp_Iterator'Class (Iterator).Visit_Validation_Action (Visitor, AMF.Utp.Validation_Actions.Utp_Validation_Action_Access (Self), Control); end if; end Visit_Element; end AMF.Internals.Utp_Validation_Actions;
49.413043
87
0.525884
58fcb83cd98d88a6655fc7646d787288bfa5fc94
4,227
ads
Ada
tools/scitools/conf/understand/ada/ada05/a-colire.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
1
2020-01-20T21:26:46.000Z
2020-01-20T21:26:46.000Z
tools/scitools/conf/understand/ada/ada05/a-colire.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
tools/scitools/conf/understand/ada/ada05/a-colire.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . C O M M A N D _ L I N E . R E M O V E -- -- -- -- S p e c -- -- -- -- Copyright (C) 1999-2006, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- -- -- -- -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package is intended to be used in conjunction with its parent unit, -- Ada.Command_Line. It provides facilities for logically removing arguments -- from the command line, so that subsequent calls to Argument_Count and -- Argument will reflect the removals. -- For example, if the original command line has three arguments A B C, so -- that Argument_Count is initially three, then after removing B, the second -- argument, Argument_Count will be 2, and Argument (2) will return C. package Ada.Command_Line.Remove is pragma Preelaborate; procedure Remove_Argument (Number : Positive); -- Removes the argument identified by Number, which must be in the -- range 1 .. Argument_Count (i.e. an in range argument number which -- reflects removals). If Number is out of range Constraint_Error -- will be raised. -- -- Note: the numbering of arguments greater than Number is affected -- by the call. If you need a loop through the arguments, removing -- some as you go, run the loop in reverse to avoid confusion from -- this renumbering: -- -- for J in reverse 1 .. Argument_Count loop -- if Should_Remove (Arguments (J)) then -- Remove_Argument (J); -- end if; -- end loop; -- -- Reversing the loop in this manner avoids the confusion. procedure Remove_Arguments (From : Positive; To : Natural); -- Removes arguments in the given From..To range. From must be in the -- range 1 .. Argument_Count and To in the range 0 .. Argument_Count. -- Constraint_Error is raised if either argument is out of range. If -- To is less than From, then the call has no effect. procedure Remove_Argument (Argument : String); -- Removes the argument which matches the given string Argument. Has -- no effect if no argument matches the string. If more than one -- argument matches the string, all are removed. procedure Remove_Arguments (Argument_Prefix : String); -- Removes all arguments whose prefix matches Argument_Prefix. Has -- no effect if no argument matches the string. For example a call -- to Remove_Arguments ("--") removes all arguments starting with --. end Ada.Command_Line.Remove;
51.54878
78
0.54625
9ab5b6e423b662a79c4ade5184e51c9095dcaf01
3,380
adb
Ada
gcc-gcc-7_3_0-release/gcc/ada/s-strhas.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/ada/s-strhas.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/s-strhas.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . S T R I N G _ H A S H -- -- -- -- S p e c -- -- -- -- Copyright (C) 2009-2016, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ pragma Compiler_Unit_Warning; package body System.String_Hash is -- Compute a hash value for a key. The approach here follows the algorithm -- introduced in the ndbm substitute SDBM by Ozan Yigit and then reused in -- GNU Awk (where they are implemented as a Duff's device). ---------- -- Hash -- ---------- function Hash (Key : Key_Type) return Hash_Type is pragma Compile_Time_Error (Hash_Type'Modulus /= 2 ** 32 or else Hash_Type'First /= 0 or else Hash_Type'Last /= 2 ** 32 - 1, "Hash_Type must be 32-bit modular with range 0 .. 2**32-1"); function Shift_Left (Value : Hash_Type; Amount : Natural) return Hash_Type; pragma Import (Intrinsic, Shift_Left); H : Hash_Type; begin H := 0; for J in Key'Range loop H := Char_Type'Pos (Key (J)) + Shift_Left (H, 6) + Shift_Left (H, 16) - H; end loop; return H; end Hash; end System.String_Hash;
48.285714
78
0.43432
130c070b01bc868b11f5cb20f6a5eb372a4e6eb6
4,763
adb
Ada
source/amf/mof/amf-internals-collections-elements-proxies.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/amf/mof/amf-internals-collections-elements-proxies.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/amf/mof/amf-internals-collections-elements-proxies.adb
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
4
2017-07-18T07:11:05.000Z
2020-06-21T03:02:25.000Z
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2010-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with AMF.Internals.Element_Collections; with AMF.Internals.Elements; with AMF.Internals.Helpers; package body AMF.Internals.Collections.Elements.Proxies is --------- -- Add -- --------- overriding procedure Add (Self : not null access Shared_Element_Collection_Proxy; Item : not null AMF.Elements.Element_Access) is begin AMF.Internals.Element_Collections.Add (Self.Collection, AMF.Internals.Elements.Element_Base'Class (Item.all).Element); end Add; ----------- -- Clear -- ----------- overriding procedure Clear (Self : not null access Shared_Element_Collection_Proxy) is begin raise Program_Error with "Not yet implemented"; end Clear; ------------- -- Element -- ------------- overriding function Element (Self : not null access constant Shared_Element_Collection_Proxy; Index : Positive) return not null AMF.Elements.Element_Access is begin return AMF.Internals.Helpers.To_Element (AMF.Internals.Element_Collections.Element (Self.Collection, Index)); end Element; ------------ -- Length -- ------------ overriding function Length (Self : not null access constant Shared_Element_Collection_Proxy) return Natural is begin return AMF.Internals.Element_Collections.Length (Self.Collection); end Length; end AMF.Internals.Collections.Elements.Proxies;
48.602041
78
0.471342
9a9262650c3a500784beffd6a8896beff63fbd11
25,957
ads
Ada
arch/ARM/STM32/drivers/dma/stm32-dma.ads
shakram02/Ada_Drivers_Library
a407ca7ddbc2d9756647016c2f8fd8ef24a239ff
[ "BSD-3-Clause" ]
192
2016-06-01T18:32:04.000Z
2022-03-26T22:52:31.000Z
arch/ARM/STM32/drivers/dma/stm32-dma.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
239
2016-05-26T20:02:01.000Z
2022-03-31T09:46:56.000Z
arch/ARM/STM32/drivers/dma/stm32-dma.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
142
2016-06-05T08:12:20.000Z
2022-03-24T17:37:17.000Z
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of STMicroelectronics nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- -- -- -- This file is based on: -- -- -- -- @file stm32f4xx_hal_dma.h -- -- @author MCD Application Team -- -- @version V1.1.0 -- -- @date 19-June-2014 -- -- @brief Header file of DMA HAL module. -- -- -- -- COPYRIGHT(c) 2014 STMicroelectronics -- ------------------------------------------------------------------------------ -- This file provides definitions for the DMA controllers on the STM32F4 (ARM -- Cortex M4F) microcontrollers from ST Microelectronics. -- See Application Note AN4031: "Using the STM32F2 and STM32F4 DMA controller" -- and Reference Manual RM0090: "STM32F405xx/07xx, STM32F415xx/17xx, -- STM32F42xxx and STM32F43xxx advanced ARM-based 32-bit MCUs" In the -- application note, see especially section four, titled "Tips and -- warnings while programming the DMA controller" -- The basic call sequence, given a Controller and a Stream, is as follows: -- 1) Configure -- Configures the Controller and Stream per application requirements. This -- is the primary setup call, specifying the static characteristics of all -- the transfers to be performed on the stream, such as the direction, the -- channel, and so forth. The Controller is disabled after the call. -- 2) Configure_Data_Flow -- Sets the dynamic parameters of a given transfer, i.e., the source and -- destination addresses and the number of data items to transfer. -- 3) Enable -- Enables transfers on the Controller and Stream. Transfers will begin -- immediately unless programmed otherwise. -- You can enable some or all DMA interrupts prior to the call to Enable, if -- required by your usage. -- Ensure all the status flags are cleared prior to the call to Enable, since -- a transfer will then begin. This can be accomplished by relying on the fact -- that the board has just powered-up, by a call to Reset, or by a call to -- Clear_All_Status. -- Note that there are convenience routines that do steps two and three: -- Start_Transfer -- Start_Transfer_with_Interrupts pragma Restrictions (No_Elaboration_Code); with System; use System; with Ada.Real_Time; use Ada.Real_Time; private with STM32_SVD.DMA; package STM32.DMA with SPARK_Mode => Off is type DMA_Controller is limited private; -- Do not change the order of the enumerals in the types in this package. -- The underlying canonical representation values are required. type DMA_Stream_Selector is (Stream_0, Stream_1, Stream_2, Stream_3, Stream_4, Stream_5, Stream_6, Stream_7); procedure Enable (This : DMA_Controller; Stream : DMA_Stream_Selector) with Inline; -- Before enabling a stream to start a new transfer, the event status flags -- corresponding to the stream must be cleared. Note that the unit may not -- be enabled by the time the call returns. procedure Disable (This : DMA_Controller; Stream : DMA_Stream_Selector) with Post => not Enabled (This, Stream), Inline; function Enabled (This : DMA_Controller; Stream : DMA_Stream_Selector) return Boolean with Inline; procedure Reset (This : in out DMA_Controller; Stream : DMA_Stream_Selector) with Post => not Enabled (This, Stream) and Operating_Mode (This, Stream) = Normal_Mode and Current_NDT (This, Stream) = 0 and Selected_Channel (This, Stream) = Channel_0 and Transfer_Direction (This, Stream) = Peripheral_To_Memory and not Double_Buffered (This, Stream) and not Circular_Mode (This, Stream) and Memory_Data_Width (This, Stream) = Bytes and Peripheral_Data_Width (This, Stream) = Bytes and Priority (This, Stream) = Priority_Low and Current_Memory_Buffer (This, Stream) = Memory_Buffer_0 and (for all Flag in DMA_Status_Flag => not Status (This, Stream, Flag)) and (for all Interrupt in DMA_Interrupt => not Interrupt_Enabled (This, Stream, Interrupt)); -- In addition, -- M_Burst = Memory_Burst_Single and -- P_Burst = Peripheral_Burst_Single and -- P_Inc_Offset_Size = 0 and -- M_Inc_Mode = False and -- P_Inc_Mode = False -- Also clears the FIFO control register bits except sets bits to show FIFO -- is empty, and to set the FIFO filling threshold selection to 1/2 full. procedure Configure_Data_Flow (This : DMA_Controller; Stream : DMA_Stream_Selector; Source : Address; Destination : Address; Data_Count : UInt16) with Pre => not Enabled (This, Stream) and Valid_Addresses (Source, Destination) and Compatible_Alignments (This, Stream, Source, Destination); -- Sets the source and destination arguments within the specified stream, -- based on the direction previously specified by a call to procedure -- Configure. -- -- Sets the number of data items to be transferred (from 0 to 65535) on -- the specified stream in the next transfer. This is the volume of data to -- be transferred from source to destination. The number specified depends -- only on the peripheral data format, as specified by the record component -- Peripheral_Data_Format passed to a call to Configure. The value to be -- specified is computed as follows: -- -- If the peripheral data format is in units of bytes, the value is -- equal to the total number of bytes contained in the data to be sent. -- -- If the peripheral data format is in units of half-words, the value is -- 1/2 the total number of bytes contained in the data to be sent. -- -- If the peripheral data format is in units of words, the value is -- 1/4 the total number of bytes contained in the data to be sent. -- -- For example, to send a sequence of characters to a USART, the USART -- peripheral format will be in units of bytes so the Data_Count argument -- will be the number of characters (bytes) in the string to be sent. -- In contrast, on a memory-to-memory transfer the most efficient approach -- is to work in units of words. One would therefore specify word units for -- the source and destination formats and then specify 1/4 the total number -- of bytes involved (assuming a four-UInt8 word). procedure Start_Transfer (This : DMA_Controller; Stream : DMA_Stream_Selector; Source : Address; Destination : Address; Data_Count : UInt16) with Pre => Valid_Addresses (Source, Destination) and Compatible_Alignments (This, Stream, Source, Destination) and (for all Flag in DMA_Status_Flag => (not Status (This, Stream, Flag))); -- Convenience routine: disables the stream, calls Configure_Data_Flow, -- and then enables the stream to start the transfer. DMA interrupts are -- not enabled by this routine, but could be enabled prior to the call. -- The requirement to clear the flags first is due to the fact that -- the transfer begins immediately at the end of this routine. The -- value specified for Data_Count is as described for procedure -- Configure_Data_Flow. type DMA_Interrupt is (Direct_Mode_Error_Interrupt, Transfer_Error_Interrupt, Half_Transfer_Complete_Interrupt, Transfer_Complete_Interrupt, FIFO_Error_Interrupt); type Interrupt_Selections is array (DMA_Interrupt) of Boolean; procedure Start_Transfer_with_Interrupts (This : DMA_Controller; Stream : DMA_Stream_Selector; Source : Address; Destination : Address; Data_Count : UInt16; Enabled_Interrupts : Interrupt_Selections := (others => True)) with Pre => Valid_Addresses (Source, Destination) and Compatible_Alignments (This, Stream, Source, Destination) and (for all Flag in DMA_Status_Flag => (not Status (This, Stream, Flag))); -- Convenience routine: disables the stream, calls Configure_Data_Flow, -- enables the selected DMA interrupts (by default, all of them), and -- then enables the stream to start the transfer. All the selected DMA -- interrupts are enabled, all the others are left unchanged. Interrupts -- are selected for enablement by having a True value in the array at their -- index location. The requirement to clear the flags first is due to the -- fact that the transfer begins immediately at the end of this routine. -- The value specified for Data_Count is as described for procedure -- Configure_Data_Flow. type DMA_Error_Code is (DMA_No_Error, DMA_Transfer_Error, DMA_FIFO_Error, DMA_Direct_Mode_Error, DMA_Timeout_Error, DMA_Device_Error); procedure Abort_Transfer (This : DMA_Controller; Stream : DMA_Stream_Selector; Result : out DMA_Error_Code) with Post => not Enabled (This, Stream); -- Disables the specified stream and then waits until the request is -- effective. If a stream is disabled while a data transfer is ongoing, the -- current datum will be transferred and the stream will be disabled only -- after the transfer of this single datum completes. type DMA_Transfer_Level is (Full_Transfer, Half_Transfer); procedure Poll_For_Completion (This : in out DMA_Controller; Stream : DMA_Stream_Selector; Expected_Level : DMA_Transfer_Level; Timeout : Time_Span; Result : out DMA_Error_Code); procedure Set_NDT (This : DMA_Controller; Stream : DMA_Stream_Selector; Data_Count : UInt16) with Pre => not Enabled (This, Stream), Post => Current_NDT (This, Stream) = Data_Count, Inline; -- Sets the number of data items to be transferred on the stream. -- The Data_Count parameter specifies the number of data items to be -- transferred (from 0 to 65535) on the next transfer. The value is -- as described for procedure Configure_Data_Flow. function Items_Transferred (This : DMA_Controller; Stream : DMA_Stream_Selector) return UInt16; -- returns the number of items transfetred function Current_NDT (This : DMA_Controller; Stream : DMA_Stream_Selector) return UInt16 with Inline; -- Returns the value of the NDT register. Should not be used directly, -- as the meaning changes depending on transfer mode. rather use -- Items_Transferred() function Circular_Mode (This : DMA_Controller; Stream : DMA_Stream_Selector) return Boolean with Inline; procedure Enable_Interrupt (This : DMA_Controller; Stream : DMA_Stream_Selector; Source : DMA_Interrupt) with Post => Interrupt_Enabled (This, Stream, Source); -- The postcondition should not be relied upon completely because it is -- possible, under just the wrong conditions, for the interrupt to be -- disabled immediately, prior to return from this routine procedure Disable_Interrupt (This : DMA_Controller; Stream : DMA_Stream_Selector; Source : DMA_Interrupt) with Post => not Interrupt_Enabled (This, Stream, Source); function Interrupt_Enabled (This : DMA_Controller; Stream : DMA_Stream_Selector; Source : DMA_Interrupt) return Boolean with Inline; type DMA_Status_Flag is (FIFO_Error_Indicated, Direct_Mode_Error_Indicated, Transfer_Error_Indicated, Half_Transfer_Complete_Indicated, Transfer_Complete_Indicated); procedure Clear_Status (This : in out DMA_Controller; Stream : DMA_Stream_Selector; Flag : DMA_Status_Flag) with Post => not Status (This, Stream, Flag), Inline; procedure Clear_All_Status (This : in out DMA_Controller; Stream : DMA_Stream_Selector) with Post => (for all Indicated in DMA_Status_Flag => not Status (This, Stream, Indicated)); function Status (This : DMA_Controller; Stream : DMA_Stream_Selector; Flag : DMA_Status_Flag) return Boolean with Inline; -- Returns whether the specified status flag is indicated type DMA_Channel_Selector is (Channel_0, Channel_1, Channel_2, Channel_3, Channel_4, Channel_5, Channel_6, Channel_7); function Selected_Channel (This : DMA_Controller; Stream : DMA_Stream_Selector) return DMA_Channel_Selector with Inline; type DMA_Data_Transfer_Direction is (Peripheral_To_Memory, Memory_To_Peripheral, Memory_To_Memory); -- Note that only DMA_2 is able to do Memory_To_Memory transfers, and that -- in this direction the circular mode is not allowed and the internal FIFO -- must be enabled. function Transfer_Direction (This : DMA_Controller; Stream : DMA_Stream_Selector) return DMA_Data_Transfer_Direction with Inline; type DMA_Data_Transfer_Widths is (Bytes, HalfWords, Words); function Peripheral_Data_Width (This : DMA_Controller; Stream : DMA_Stream_Selector) return DMA_Data_Transfer_Widths with Inline; function Memory_Data_Width (This : DMA_Controller; Stream : DMA_Stream_Selector) return DMA_Data_Transfer_Widths with Inline; type DMA_Mode is (Normal_Mode, Peripheral_Flow_Control_Mode, Circular_Mode); function Operating_Mode (This : DMA_Controller; Stream : DMA_Stream_Selector) return DMA_Mode with Inline; type DMA_Priority_Level is (Priority_Low, Priority_Medium, Priority_High, Priority_Very_High); function Priority (This : DMA_Controller; Stream : DMA_Stream_Selector) return DMA_Priority_Level with Inline; type Memory_Buffer_Target is (Memory_Buffer_0, Memory_Buffer_1); function Current_Memory_Buffer (This : DMA_Controller; Stream : DMA_Stream_Selector) return Memory_Buffer_Target with Inline; procedure Select_Current_Memory_Buffer (This : DMA_Controller; Stream : DMA_Stream_Selector; Buffer : Memory_Buffer_Target) with Inline; procedure Set_Memory_Buffer (This : DMA_Controller; Stream : DMA_Stream_Selector; Buffer : Memory_Buffer_Target; To : System.Address) with Inline; procedure Configure_Double_Buffered_Mode (This : DMA_Controller; Stream : DMA_Stream_Selector; Buffer_0_Value : Address; Buffer_1_Value : Address; First_Buffer_Used : Memory_Buffer_Target) with Pre => not Enabled (This, Stream), Post => not Enabled (This, Stream) and Current_Memory_Buffer (This, Stream) = First_Buffer_Used; -- A convenience routine that in effect calls Set_Memory_Buffer -- once each for Buffer_1_Value and Buffer_2_Value, and then calls -- Select_Current_Memory_Buffer so that First_Buffer_Used is the -- buffer used first when the stream is enabled. procedure Enable_Double_Buffered_Mode (This : DMA_Controller; Stream : DMA_Stream_Selector) with Pre => Circular_Mode (This, Stream) and Transfer_Direction (This, Stream) /= Memory_To_Memory, Post => Double_Buffered (This, Stream); procedure Disable_Double_Buffered_Mode (This : DMA_Controller; Stream : DMA_Stream_Selector) with Post => not Double_Buffered (This, Stream); function Double_Buffered (This : DMA_Controller; Stream : DMA_Stream_Selector) return Boolean with Inline; type DMA_FIFO_Threshold_Level is (FIFO_Threshold_1_Quart_Full_Configuration, FIFO_Threshold_Half_Full_Configuration, FIFO_Threshold_3_Quarts_Full_Configuration, FIFO_Threshold_Full_Configuration); type DMA_FIFO_Filling_State is (FIFO_Less1QuarterFull, -- less than 1 quarter full but not empty FIFO_1QuarterFull, -- more than 1 quarter full FIFO_HalfFull, -- more than 1 half full FIFO_3QuartersFull, -- more than 3 quarters full FIFO_Empty, FIFO_Full); type DMA_Memory_Burst is (Memory_Burst_Single, Memory_Burst_Inc4, Memory_Burst_Inc8, Memory_Burst_Inc16); type DMA_Peripheral_Burst is (Peripheral_Burst_Single, Peripheral_Burst_Inc4, Peripheral_Burst_Inc8, Peripheral_Burst_Inc16); type DMA_Stream_Configuration is record -- These are the static, non-varying properties of the transactions -- occurring on the streams to which they are applied (by a call to -- Configure). Other, varying, properties are specified procedurally. -- -- You are not required to specify a value for every component because -- some are only referenced depending on the values for others. Note, -- however, that the default values specified do not represent a valid -- configuration as a whole. Channel : DMA_Channel_Selector := DMA_Channel_Selector'First; -- The channel in the multiplexed connections of controllers, streams, -- and peripherals. It is vital to note that not all peripherals can -- be connected to all streams. The possibilities are organized by -- channels, per controller, as specified by the ST Micro Reference -- Manual in the "DMA Request Mapping" tables. Direction : DMA_Data_Transfer_Direction := DMA_Data_Transfer_Direction'First; Increment_Peripheral_Address : Boolean := False; -- Whether the peripheral address value should be incremented -- automatically after each transfer Increment_Memory_Address : Boolean := False; -- Whether the memory address value should be incremented automatically -- after each transfer Peripheral_Data_Format : DMA_Data_Transfer_Widths := DMA_Data_Transfer_Widths'First; -- The units of data (the format) in which the peripheral side of the -- transaction is expressed. For example, a USART would work in terms -- of bytes. See the description in Configure_Data_Flow. Memory_Data_Format : DMA_Data_Transfer_Widths := DMA_Data_Transfer_Widths'First; -- The units of data (the format) in which the memory side of the -- transaction is expressed. See the description in Configure_Data_Flow. Operation_Mode : DMA_Mode := DMA_Mode'First; -- Note that the circular buffer mode cannot be used if memory-to-memory -- data transfer is configured on the selected Stream Priority : DMA_Priority_Level := DMA_Priority_Level'First; -- The relative priority of the given stream to all other streams FIFO_Enabled : Boolean := False; -- Specifies whether the internal FIFO will be used for the transactions -- occurring on the specified stream. By default the FIFO is disabled by -- the hardware, and so the unit works in the so-called "direct mode" -- instead. Per the Application Note, enabling the FIFO is highly -- advantageous. Note that the direct mode cannot be used if -- memory-to-memory data transfer is configured. The threshold and -- burst sizes are only considered if the FIFO is enabled, and the -- corresponding values are highly dependent upon one another! FIFO_Threshold : DMA_FIFO_Threshold_Level := DMA_FIFO_Threshold_Level'First; -- The threshold at which the FIFO is refilled. It is vital that the -- threshold and burst sizes, if specified, are compatible. See the -- Reference Manual and especially the Application Note. Memory_Burst_Size : DMA_Memory_Burst := DMA_Memory_Burst'First; -- Specifies the amount of data to be transferred in a single non- -- interruptible transaction. Note: The burst mode is possible only if -- the address increment mode is enabled. Peripheral_Burst_Size : DMA_Peripheral_Burst := DMA_Peripheral_Burst'First; -- Specifies the the amount of data to be transferred in -- a single non-interruptible transaction. Note: The burst mode is -- possible only if the address increment mode is enabled. end record; procedure Configure (This : DMA_Controller; Stream : DMA_Stream_Selector; Config : DMA_Stream_Configuration) with Post => not Enabled (This, Stream); -- This is the primary stream configuration facility. All the static -- properties of the transfers for the given stream are specified here, -- and in some cases, nowhere else (such as the channel). The required -- relationships between the parameters specified in the record are -- not checked, other than by the hardware itself. -- -- Note that not all required properties are specified here. In particular, -- because they can vary per transfer, the source and destination -- addresses, as well as the number of data items to be transferred, -- are specified procedurally via calls to Configure_Data_Flow. function Valid_Addresses (Source, Destination : Address) return Boolean is (Source /= Null_Address and Destination /= Null_Address and Source /= Destination); -- Basic sanity checking for the values function Aligned (This : Address; Width : DMA_Data_Transfer_Widths) return Boolean with Inline; -- Returns whether the address is aligned on a word, half-word, or UInt8 -- boundary function Compatible_Alignments (This : DMA_Controller; Stream : DMA_Stream_Selector; Source : Address; Destination : Address) return Boolean is (case Transfer_Direction (This, Stream) is when Peripheral_To_Memory | Memory_To_Memory => Aligned (Source, Peripheral_Data_Width (This, Stream)) and Aligned (Destination, Memory_Data_Width (This, Stream)), when Memory_To_Peripheral => Aligned (Source, Memory_Data_Width (This, Stream)) and Aligned (Destination, Peripheral_Data_Width (This, Stream))); -- Based on Ref Manual Table 44 and associated text, checks the alignments -- of the addresses against the Peripheral_Data_Format (P_Data_Size) and -- Memory_Data_Format (M_Data_Size) values for the given stream. We use an -- expression function because the semantics are meant to be part of the -- spec of the package, visible as a precondition. private type DMA_Controller is new STM32_SVD.DMA.DMA_Peripheral; end STM32.DMA;
41.332803
90
0.652965
04b04ee935634ed12f8885b62705e499715f45a9
600
adb
Ada
tests/ships-repairs-test_data.adb
thindil/steamsky
d5d7fea622f7994c91017c4cd7ba5e188153556c
[ "TCL", "MIT" ]
80
2017-04-08T23:14:07.000Z
2022-02-10T22:30:51.000Z
tests/ships-repairs-test_data.adb
thindil/steamsky
d5d7fea622f7994c91017c4cd7ba5e188153556c
[ "TCL", "MIT" ]
89
2017-06-24T08:18:26.000Z
2021-11-12T04:37:36.000Z
tests/ships-repairs-test_data.adb
thindil/steamsky
d5d7fea622f7994c91017c4cd7ba5e188153556c
[ "TCL", "MIT" ]
9
2018-04-14T16:37:25.000Z
2020-03-21T14:33:49.000Z
-- This package is intended to set up and tear down the test environment. -- Once created by GNATtest, this package will never be overwritten -- automatically. Contents of this package can be modified in any way -- except for sections surrounded by a 'read only' marker. package body Ships.Repairs.Test_Data is procedure Set_Up(Gnattest_T: in out Test) is pragma Unreferenced(Gnattest_T); begin null; end Set_Up; procedure Tear_Down(Gnattest_T: in out Test) is pragma Unreferenced(Gnattest_T); begin null; end Tear_Down; end Ships.Repairs.Test_Data;
30
75
0.73
410b6ca59426175172b0394c9f7e5fda8e4e8b3e
43,311
adb
Ada
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/g-graphs.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/g-graphs.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/g-graphs.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- G N A T . G R A P H S -- -- -- -- B o d y -- -- -- -- Copyright (C) 2018-2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; package body GNAT.Graphs is ----------------------- -- Local subprograms -- ----------------------- function Sequence_Next_Component return Component_Id; -- Produce the next handle for a component. The handle is guaranteed to be -- unique across all graphs. -------------------- -- Directed_Graph -- -------------------- package body Directed_Graphs is ----------------------- -- Local subprograms -- ----------------------- procedure Add_Component (G : Directed_Graph; Comp : Component_Id; Vertices : Vertex_List.Doubly_Linked_List); pragma Inline (Add_Component); -- Add component Comp which houses vertices Vertices to graph G procedure Ensure_Created (G : Directed_Graph); pragma Inline (Ensure_Created); -- Verify that graph G is created. Raise Not_Created if this is not the -- case. procedure Ensure_Not_Present (G : Directed_Graph; E : Edge_Id); pragma Inline (Ensure_Not_Present); -- Verify that graph G lacks edge E. Raise Duplicate_Edge if this is not -- the case. procedure Ensure_Not_Present (G : Directed_Graph; V : Vertex_Id); pragma Inline (Ensure_Not_Present); -- Verify that graph G lacks vertex V. Raise Duplicate_Vertex if this is -- not the case. procedure Ensure_Present (G : Directed_Graph; Comp : Component_Id); pragma Inline (Ensure_Present); -- Verify that component Comp exists in graph G. Raise Missing_Component -- if this is not the case. procedure Ensure_Present (G : Directed_Graph; E : Edge_Id); pragma Inline (Ensure_Present); -- Verify that edge E is present in graph G. Raise Missing_Edge if this -- is not the case. procedure Ensure_Present (G : Directed_Graph; V : Vertex_Id); pragma Inline (Ensure_Present); -- Verify that vertex V is present in graph G. Raise Missing_Vertex if -- this is not the case. procedure Free is new Ada.Unchecked_Deallocation (Directed_Graph_Attributes, Directed_Graph); function Get_Component_Attributes (G : Directed_Graph; Comp : Component_Id) return Component_Attributes; pragma Inline (Get_Component_Attributes); -- Obtain the attributes of component Comp of graph G function Get_Edge_Attributes (G : Directed_Graph; E : Edge_Id) return Edge_Attributes; pragma Inline (Get_Edge_Attributes); -- Obtain the attributes of edge E of graph G function Get_Vertex_Attributes (G : Directed_Graph; V : Vertex_Id) return Vertex_Attributes; pragma Inline (Get_Vertex_Attributes); -- Obtain the attributes of vertex V of graph G function Get_Outgoing_Edges (G : Directed_Graph; V : Vertex_Id) return Edge_Set.Membership_Set; pragma Inline (Get_Outgoing_Edges); -- Obtain the Outgoing_Edges attribute of vertex V of graph G function Get_Vertices (G : Directed_Graph; Comp : Component_Id) return Vertex_List.Doubly_Linked_List; pragma Inline (Get_Vertices); -- Obtain the Vertices attribute of component Comp of graph G procedure Set_Component (G : Directed_Graph; V : Vertex_Id; Val : Component_Id); pragma Inline (Set_Component); -- Set attribute Component of vertex V of graph G to value Val procedure Set_Outgoing_Edges (G : Directed_Graph; V : Vertex_Id; Val : Edge_Set.Membership_Set); pragma Inline (Set_Outgoing_Edges); -- Set attribute Outgoing_Edges of vertex V of graph G to value Val procedure Set_Vertex_Attributes (G : Directed_Graph; V : Vertex_Id; Val : Vertex_Attributes); pragma Inline (Set_Vertex_Attributes); -- Set the attributes of vertex V of graph G to value Val ------------------- -- Add_Component -- ------------------- procedure Add_Component (G : Directed_Graph; Comp : Component_Id; Vertices : Vertex_List.Doubly_Linked_List) is begin pragma Assert (Present (G)); -- Add the component to the set of all components in the graph Component_Map.Put (T => G.Components, Key => Comp, Value => (Vertices => Vertices)); end Add_Component; -------------- -- Add_Edge -- -------------- procedure Add_Edge (G : Directed_Graph; E : Edge_Id; Source : Vertex_Id; Destination : Vertex_Id) is begin Ensure_Created (G); Ensure_Not_Present (G, E); Ensure_Present (G, Source); Ensure_Present (G, Destination); -- Add the edge to the set of all edges in the graph Edge_Map.Put (T => G.All_Edges, Key => E, Value => (Destination => Destination, Source => Source)); -- Associate the edge with its source vertex which effectively "owns" -- the edge. Edge_Set.Insert (S => Get_Outgoing_Edges (G, Source), Elem => E); end Add_Edge; ---------------- -- Add_Vertex -- ---------------- procedure Add_Vertex (G : Directed_Graph; V : Vertex_Id) is begin Ensure_Created (G); Ensure_Not_Present (G, V); -- Add the vertex to the set of all vertices in the graph Vertex_Map.Put (T => G.All_Vertices, Key => V, Value => (Component => No_Component, Outgoing_Edges => Edge_Set.Nil)); -- It is assumed that the vertex will have at least one outgoing -- edge. It is important not to create the set of edges above as -- the call to Put may fail in case the vertices are iterated. -- This would lead to a memory leak because the set would not be -- reclaimed. Set_Outgoing_Edges (G, V, Edge_Set.Create (1)); end Add_Vertex; --------------- -- Component -- --------------- function Component (G : Directed_Graph; V : Vertex_Id) return Component_Id is begin Ensure_Created (G); Ensure_Present (G, V); return Get_Vertex_Attributes (G, V).Component; end Component; ------------------------ -- Contains_Component -- ------------------------ function Contains_Component (G : Directed_Graph; Comp : Component_Id) return Boolean is begin Ensure_Created (G); return Component_Map.Contains (G.Components, Comp); end Contains_Component; ------------------- -- Contains_Edge -- ------------------- function Contains_Edge (G : Directed_Graph; E : Edge_Id) return Boolean is begin Ensure_Created (G); return Edge_Map.Contains (G.All_Edges, E); end Contains_Edge; --------------------- -- Contains_Vertex -- --------------------- function Contains_Vertex (G : Directed_Graph; V : Vertex_Id) return Boolean is begin Ensure_Created (G); return Vertex_Map.Contains (G.All_Vertices, V); end Contains_Vertex; ------------ -- Create -- ------------ function Create (Initial_Vertices : Positive; Initial_Edges : Positive) return Directed_Graph is G : constant Directed_Graph := new Directed_Graph_Attributes; begin G.All_Edges := Edge_Map.Create (Initial_Edges); G.All_Vertices := Vertex_Map.Create (Initial_Vertices); G.Components := Component_Map.Create (Initial_Vertices); return G; end Create; ----------------- -- Delete_Edge -- ----------------- procedure Delete_Edge (G : Directed_Graph; E : Edge_Id) is Source : Vertex_Id; begin Ensure_Created (G); Ensure_Present (G, E); Source := Source_Vertex (G, E); Ensure_Present (G, Source); -- Delete the edge from its source vertex which effectively "owns" -- the edge. Edge_Set.Delete (Get_Outgoing_Edges (G, Source), E); -- Delete the edge from the set of all edges Edge_Map.Delete (G.All_Edges, E); end Delete_Edge; ------------------------ -- Destination_Vertex -- ------------------------ function Destination_Vertex (G : Directed_Graph; E : Edge_Id) return Vertex_Id is begin Ensure_Created (G); Ensure_Present (G, E); return Get_Edge_Attributes (G, E).Destination; end Destination_Vertex; ------------- -- Destroy -- ------------- procedure Destroy (G : in out Directed_Graph) is begin Ensure_Created (G); Edge_Map.Destroy (G.All_Edges); Vertex_Map.Destroy (G.All_Vertices); Component_Map.Destroy (G.Components); Free (G); end Destroy; ---------------------------------- -- Destroy_Component_Attributes -- ---------------------------------- procedure Destroy_Component_Attributes (Attrs : in out Component_Attributes) is begin Vertex_List.Destroy (Attrs.Vertices); end Destroy_Component_Attributes; ----------------------------- -- Destroy_Edge_Attributes -- ----------------------------- procedure Destroy_Edge_Attributes (Attrs : in out Edge_Attributes) is pragma Unreferenced (Attrs); begin null; end Destroy_Edge_Attributes; -------------------- -- Destroy_Vertex -- -------------------- procedure Destroy_Vertex (V : in out Vertex_Id) is pragma Unreferenced (V); begin null; end Destroy_Vertex; ------------------------------- -- Destroy_Vertex_Attributes -- ------------------------------- procedure Destroy_Vertex_Attributes (Attrs : in out Vertex_Attributes) is begin Edge_Set.Destroy (Attrs.Outgoing_Edges); end Destroy_Vertex_Attributes; -------------------- -- Ensure_Created -- -------------------- procedure Ensure_Created (G : Directed_Graph) is begin if not Present (G) then raise Not_Created; end if; end Ensure_Created; ------------------------ -- Ensure_Not_Present -- ------------------------ procedure Ensure_Not_Present (G : Directed_Graph; E : Edge_Id) is begin if Contains_Edge (G, E) then raise Duplicate_Edge; end if; end Ensure_Not_Present; ------------------------ -- Ensure_Not_Present -- ------------------------ procedure Ensure_Not_Present (G : Directed_Graph; V : Vertex_Id) is begin if Contains_Vertex (G, V) then raise Duplicate_Vertex; end if; end Ensure_Not_Present; -------------------- -- Ensure_Present -- -------------------- procedure Ensure_Present (G : Directed_Graph; Comp : Component_Id) is begin if not Contains_Component (G, Comp) then raise Missing_Component; end if; end Ensure_Present; -------------------- -- Ensure_Present -- -------------------- procedure Ensure_Present (G : Directed_Graph; E : Edge_Id) is begin if not Contains_Edge (G, E) then raise Missing_Edge; end if; end Ensure_Present; -------------------- -- Ensure_Present -- -------------------- procedure Ensure_Present (G : Directed_Graph; V : Vertex_Id) is begin if not Contains_Vertex (G, V) then raise Missing_Vertex; end if; end Ensure_Present; --------------------- -- Find_Components -- --------------------- procedure Find_Components (G : Directed_Graph) is -- The components of graph G are discovered using Tarjan's strongly -- connected component algorithm. Do not modify this code unless you -- intimately understand the algorithm. ---------------- -- Tarjan_Map -- ---------------- type Visitation_Number is new Natural; No_Visitation_Number : constant Visitation_Number := Visitation_Number'First; First_Visitation_Number : constant Visitation_Number := No_Visitation_Number + 1; type Tarjan_Attributes is record Index : Visitation_Number := No_Visitation_Number; -- Visitation number Low_Link : Visitation_Number := No_Visitation_Number; -- Lowest visitation number On_Stack : Boolean := False; -- Set when the corresponding vertex appears on the Stack end record; No_Tarjan_Attributes : constant Tarjan_Attributes := (Index => No_Visitation_Number, Low_Link => No_Visitation_Number, On_Stack => False); procedure Destroy_Tarjan_Attributes (Attrs : in out Tarjan_Attributes); -- Destroy the contents of attributes Attrs package Tarjan_Map is new Dynamic_Hash_Tables (Key_Type => Vertex_Id, Value_Type => Tarjan_Attributes, No_Value => No_Tarjan_Attributes, Expansion_Threshold => 1.5, Expansion_Factor => 2, Compression_Threshold => 0.3, Compression_Factor => 2, "=" => Same_Vertex, Destroy_Value => Destroy_Tarjan_Attributes, Hash => Hash_Vertex); ------------------ -- Tarjan_Stack -- ------------------ package Tarjan_Stack is new Doubly_Linked_Lists (Element_Type => Vertex_Id, "=" => Same_Vertex, Destroy_Element => Destroy_Vertex); ----------------- -- Global data -- ----------------- Attrs : Tarjan_Map.Dynamic_Hash_Table := Tarjan_Map.Nil; Stack : Tarjan_Stack.Doubly_Linked_List := Tarjan_Stack.Nil; ----------------------- -- Local subprograms -- ----------------------- procedure Associate_All_Vertices; pragma Inline (Associate_All_Vertices); -- Associate all vertices in the graph with the corresponding -- components that house them. procedure Associate_Vertices (Comp : Component_Id); pragma Inline (Associate_Vertices); -- Associate all vertices of component Comp with the component procedure Create_Component (V : Vertex_Id); pragma Inline (Create_Component); -- Create a new component with root vertex V function Get_Tarjan_Attributes (V : Vertex_Id) return Tarjan_Attributes; pragma Inline (Get_Tarjan_Attributes); -- Obtain the Tarjan attributes of vertex V function Index (V : Vertex_Id) return Visitation_Number; pragma Inline (Index); -- Obtain the Index attribute of vertex V procedure Initialize_Components; pragma Inline (Initialize_Components); -- Initialize or reinitialize the components of the graph function Is_Visited (V : Vertex_Id) return Boolean; pragma Inline (Is_Visited); -- Determine whether vertex V has been visited function Low_Link (V : Vertex_Id) return Visitation_Number; pragma Inline (Low_Link); -- Obtain the Low_Link attribute of vertex V function On_Stack (V : Vertex_Id) return Boolean; pragma Inline (On_Stack); -- Obtain the On_Stack attribute of vertex V function Pop return Vertex_Id; pragma Inline (Pop); -- Pop a vertex off Stack procedure Push (V : Vertex_Id); pragma Inline (Push); -- Push vertex V on Stack procedure Record_Visit (V : Vertex_Id); pragma Inline (Record_Visit); -- Save the visitation of vertex V by setting relevant attributes function Sequence_Next_Index return Visitation_Number; pragma Inline (Sequence_Next_Index); -- Procedure the next visitation number of the DFS traversal procedure Set_Index (V : Vertex_Id; Val : Visitation_Number); pragma Inline (Set_Index); -- Set attribute Index of vertex V to value Val procedure Set_Low_Link (V : Vertex_Id; Val : Visitation_Number); pragma Inline (Set_Low_Link); -- Set attribute Low_Link of vertex V to value Val procedure Set_On_Stack (V : Vertex_Id; Val : Boolean); pragma Inline (Set_On_Stack); -- Set attribute On_Stack of vertex V to value Val procedure Set_Tarjan_Attributes (V : Vertex_Id; Val : Tarjan_Attributes); pragma Inline (Set_Tarjan_Attributes); -- Set the attributes of vertex V to value Val procedure Visit_Successors (V : Vertex_Id); pragma Inline (Visit_Successors); -- Visit the successors of vertex V procedure Visit_Vertex (V : Vertex_Id); pragma Inline (Visit_Vertex); -- Visit single vertex V procedure Visit_Vertices; pragma Inline (Visit_Vertices); -- Visit all vertices in the graph ---------------------------- -- Associate_All_Vertices -- ---------------------------- procedure Associate_All_Vertices is Comp : Component_Id; Iter : Component_Iterator; begin Iter := Iterate_Components (G); while Has_Next (Iter) loop Next (Iter, Comp); Associate_Vertices (Comp); end loop; end Associate_All_Vertices; ------------------------ -- Associate_Vertices -- ------------------------ procedure Associate_Vertices (Comp : Component_Id) is Iter : Component_Vertex_Iterator; V : Vertex_Id; begin Iter := Iterate_Component_Vertices (G, Comp); while Has_Next (Iter) loop Next (Iter, V); Set_Component (G, V, Comp); end loop; end Associate_Vertices; ---------------------- -- Create_Component -- ---------------------- procedure Create_Component (V : Vertex_Id) is Curr_V : Vertex_Id; Vertices : Vertex_List.Doubly_Linked_List; begin Vertices := Vertex_List.Create; -- Collect all vertices that comprise the current component by -- popping the stack until reaching the root vertex V. loop Curr_V := Pop; Vertex_List.Append (Vertices, Curr_V); exit when Same_Vertex (Curr_V, V); end loop; Add_Component (G => G, Comp => Sequence_Next_Component, Vertices => Vertices); end Create_Component; ------------------------------- -- Destroy_Tarjan_Attributes -- ------------------------------- procedure Destroy_Tarjan_Attributes (Attrs : in out Tarjan_Attributes) is pragma Unreferenced (Attrs); begin null; end Destroy_Tarjan_Attributes; --------------------------- -- Get_Tarjan_Attributes -- --------------------------- function Get_Tarjan_Attributes (V : Vertex_Id) return Tarjan_Attributes is begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); return Tarjan_Map.Get (Attrs, V); end Get_Tarjan_Attributes; ----------- -- Index -- ----------- function Index (V : Vertex_Id) return Visitation_Number is begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); return Get_Tarjan_Attributes (V).Index; end Index; --------------------------- -- Initialize_Components -- --------------------------- procedure Initialize_Components is begin pragma Assert (Present (G)); -- The graph already contains a set of components. Reinitialize -- them in order to accommodate the new set of components about to -- be computed. if Number_Of_Components (G) > 0 then Component_Map.Destroy (G.Components); G.Components := Component_Map.Create (Number_Of_Vertices (G)); end if; end Initialize_Components; ---------------- -- Is_Visited -- ---------------- function Is_Visited (V : Vertex_Id) return Boolean is begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); return Index (V) /= No_Visitation_Number; end Is_Visited; -------------- -- Low_Link -- -------------- function Low_Link (V : Vertex_Id) return Visitation_Number is begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); return Get_Tarjan_Attributes (V).Low_Link; end Low_Link; -------------- -- On_Stack -- -------------- function On_Stack (V : Vertex_Id) return Boolean is begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); return Get_Tarjan_Attributes (V).On_Stack; end On_Stack; --------- -- Pop -- --------- function Pop return Vertex_Id is V : Vertex_Id; begin V := Tarjan_Stack.Last (Stack); Tarjan_Stack.Delete_Last (Stack); Set_On_Stack (V, False); pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); return V; end Pop; ---------- -- Push -- ---------- procedure Push (V : Vertex_Id) is begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); Tarjan_Stack.Append (Stack, V); Set_On_Stack (V, True); end Push; ------------------ -- Record_Visit -- ------------------ procedure Record_Visit (V : Vertex_Id) is Index : constant Visitation_Number := Sequence_Next_Index; begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); Set_Index (V, Index); Set_Low_Link (V, Index); end Record_Visit; ------------------------- -- Sequence_Next_Index -- ------------------------- Index_Sequencer : Visitation_Number := First_Visitation_Number; -- The counter for visitation numbers. Do not directly manipulate its -- value because this will destroy the Index and Low_Link invariants -- of the algorithm. function Sequence_Next_Index return Visitation_Number is Index : constant Visitation_Number := Index_Sequencer; begin Index_Sequencer := Index_Sequencer + 1; return Index; end Sequence_Next_Index; --------------- -- Set_Index -- --------------- procedure Set_Index (V : Vertex_Id; Val : Visitation_Number) is TA : Tarjan_Attributes; begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); TA := Get_Tarjan_Attributes (V); TA.Index := Val; Set_Tarjan_Attributes (V, TA); end Set_Index; ------------------ -- Set_Low_Link -- ------------------ procedure Set_Low_Link (V : Vertex_Id; Val : Visitation_Number) is TA : Tarjan_Attributes; begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); TA := Get_Tarjan_Attributes (V); TA.Low_Link := Val; Set_Tarjan_Attributes (V, TA); end Set_Low_Link; ------------------ -- Set_On_Stack -- ------------------ procedure Set_On_Stack (V : Vertex_Id; Val : Boolean) is TA : Tarjan_Attributes; begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); TA := Get_Tarjan_Attributes (V); TA.On_Stack := Val; Set_Tarjan_Attributes (V, TA); end Set_On_Stack; --------------------------- -- Set_Tarjan_Attributes -- --------------------------- procedure Set_Tarjan_Attributes (V : Vertex_Id; Val : Tarjan_Attributes) is begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); Tarjan_Map.Put (Attrs, V, Val); end Set_Tarjan_Attributes; ---------------------- -- Visit_Successors -- ---------------------- procedure Visit_Successors (V : Vertex_Id) is E : Edge_Id; Iter : Outgoing_Edge_Iterator; Succ : Vertex_Id; begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); Iter := Iterate_Outgoing_Edges (G, V); while Has_Next (Iter) loop Next (Iter, E); Succ := Destination_Vertex (G, E); pragma Assert (Contains_Vertex (G, Succ)); -- The current successor has not been visited yet. Extend the -- DFS traversal into it. if not Is_Visited (Succ) then Visit_Vertex (Succ); Set_Low_Link (V, Visitation_Number'Min (Low_Link (V), Low_Link (Succ))); -- The current successor has been visited, and still remains on -- the stack which indicates that it does not participate in a -- component yet. elsif On_Stack (Succ) then Set_Low_Link (V, Visitation_Number'Min (Low_Link (V), Index (Succ))); end if; end loop; end Visit_Successors; ------------------ -- Visit_Vertex -- ------------------ procedure Visit_Vertex (V : Vertex_Id) is begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); if not Is_Visited (V) then Record_Visit (V); Push (V); Visit_Successors (V); -- The current vertex is the root of a component if Low_Link (V) = Index (V) then Create_Component (V); end if; end if; end Visit_Vertex; -------------------- -- Visit_Vertices -- -------------------- procedure Visit_Vertices is Iter : All_Vertex_Iterator; V : Vertex_Id; begin Iter := Iterate_All_Vertices (G); while Has_Next (Iter) loop Next (Iter, V); Visit_Vertex (V); end loop; end Visit_Vertices; -- Start of processing for Find_Components begin -- Initialize or reinitialize the components of the graph Initialize_Components; -- Prepare the extra attributes needed for each vertex, global -- visitation number, and the stack where examined vertices are -- placed. Attrs := Tarjan_Map.Create (Number_Of_Vertices (G)); Stack := Tarjan_Stack.Create; -- Start the DFS traversal of Tarjan's SCC algorithm Visit_Vertices; Tarjan_Map.Destroy (Attrs); Tarjan_Stack.Destroy (Stack); -- Associate each vertex with the component it belongs to Associate_All_Vertices; end Find_Components; ------------------------------ -- Get_Component_Attributes -- ------------------------------ function Get_Component_Attributes (G : Directed_Graph; Comp : Component_Id) return Component_Attributes is begin pragma Assert (Present (G)); pragma Assert (Contains_Component (G, Comp)); return Component_Map.Get (G.Components, Comp); end Get_Component_Attributes; ------------------------- -- Get_Edge_Attributes -- ------------------------- function Get_Edge_Attributes (G : Directed_Graph; E : Edge_Id) return Edge_Attributes is begin pragma Assert (Present (G)); pragma Assert (Contains_Edge (G, E)); return Edge_Map.Get (G.All_Edges, E); end Get_Edge_Attributes; --------------------------- -- Get_Vertex_Attributes -- --------------------------- function Get_Vertex_Attributes (G : Directed_Graph; V : Vertex_Id) return Vertex_Attributes is begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); return Vertex_Map.Get (G.All_Vertices, V); end Get_Vertex_Attributes; ------------------------ -- Get_Outgoing_Edges -- ------------------------ function Get_Outgoing_Edges (G : Directed_Graph; V : Vertex_Id) return Edge_Set.Membership_Set is begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); return Get_Vertex_Attributes (G, V).Outgoing_Edges; end Get_Outgoing_Edges; ------------------ -- Get_Vertices -- ------------------ function Get_Vertices (G : Directed_Graph; Comp : Component_Id) return Vertex_List.Doubly_Linked_List is begin pragma Assert (Present (G)); pragma Assert (Contains_Component (G, Comp)); return Get_Component_Attributes (G, Comp).Vertices; end Get_Vertices; -------------- -- Has_Next -- -------------- function Has_Next (Iter : All_Edge_Iterator) return Boolean is begin return Edge_Map.Has_Next (Edge_Map.Iterator (Iter)); end Has_Next; -------------- -- Has_Next -- -------------- function Has_Next (Iter : All_Vertex_Iterator) return Boolean is begin return Vertex_Map.Has_Next (Vertex_Map.Iterator (Iter)); end Has_Next; -------------- -- Has_Next -- -------------- function Has_Next (Iter : Component_Iterator) return Boolean is begin return Component_Map.Has_Next (Component_Map.Iterator (Iter)); end Has_Next; -------------- -- Has_Next -- -------------- function Has_Next (Iter : Component_Vertex_Iterator) return Boolean is begin return Vertex_List.Has_Next (Vertex_List.Iterator (Iter)); end Has_Next; -------------- -- Has_Next -- -------------- function Has_Next (Iter : Outgoing_Edge_Iterator) return Boolean is begin return Edge_Set.Has_Next (Edge_Set.Iterator (Iter)); end Has_Next; -------------- -- Is_Empty -- -------------- function Is_Empty (G : Directed_Graph) return Boolean is begin Ensure_Created (G); return Edge_Map.Is_Empty (G.All_Edges) and then Vertex_Map.Is_Empty (G.All_Vertices); end Is_Empty; ----------------------- -- Iterate_All_Edges -- ----------------------- function Iterate_All_Edges (G : Directed_Graph) return All_Edge_Iterator is begin Ensure_Created (G); return All_Edge_Iterator (Edge_Map.Iterate (G.All_Edges)); end Iterate_All_Edges; -------------------------- -- Iterate_All_Vertices -- -------------------------- function Iterate_All_Vertices (G : Directed_Graph) return All_Vertex_Iterator is begin Ensure_Created (G); return All_Vertex_Iterator (Vertex_Map.Iterate (G.All_Vertices)); end Iterate_All_Vertices; ------------------------ -- Iterate_Components -- ------------------------ function Iterate_Components (G : Directed_Graph) return Component_Iterator is begin Ensure_Created (G); return Component_Iterator (Component_Map.Iterate (G.Components)); end Iterate_Components; -------------------------------- -- Iterate_Component_Vertices -- -------------------------------- function Iterate_Component_Vertices (G : Directed_Graph; Comp : Component_Id) return Component_Vertex_Iterator is begin Ensure_Created (G); Ensure_Present (G, Comp); return Component_Vertex_Iterator (Vertex_List.Iterate (Get_Vertices (G, Comp))); end Iterate_Component_Vertices; ---------------------------- -- Iterate_Outgoing_Edges -- ---------------------------- function Iterate_Outgoing_Edges (G : Directed_Graph; V : Vertex_Id) return Outgoing_Edge_Iterator is begin Ensure_Created (G); Ensure_Present (G, V); return Outgoing_Edge_Iterator (Edge_Set.Iterate (Get_Outgoing_Edges (G, V))); end Iterate_Outgoing_Edges; ---------- -- Next -- ---------- procedure Next (Iter : in out All_Edge_Iterator; E : out Edge_Id) is begin Edge_Map.Next (Edge_Map.Iterator (Iter), E); end Next; ---------- -- Next -- ---------- procedure Next (Iter : in out All_Vertex_Iterator; V : out Vertex_Id) is begin Vertex_Map.Next (Vertex_Map.Iterator (Iter), V); end Next; ---------- -- Next -- ---------- procedure Next (Iter : in out Component_Iterator; Comp : out Component_Id) is begin Component_Map.Next (Component_Map.Iterator (Iter), Comp); end Next; ---------- -- Next -- ---------- procedure Next (Iter : in out Component_Vertex_Iterator; V : out Vertex_Id) is begin Vertex_List.Next (Vertex_List.Iterator (Iter), V); end Next; ---------- -- Next -- ---------- procedure Next (Iter : in out Outgoing_Edge_Iterator; E : out Edge_Id) is begin Edge_Set.Next (Edge_Set.Iterator (Iter), E); end Next; ---------------------------------- -- Number_Of_Component_Vertices -- ---------------------------------- function Number_Of_Component_Vertices (G : Directed_Graph; Comp : Component_Id) return Natural is begin Ensure_Created (G); Ensure_Present (G, Comp); return Vertex_List.Size (Get_Vertices (G, Comp)); end Number_Of_Component_Vertices; -------------------------- -- Number_Of_Components -- -------------------------- function Number_Of_Components (G : Directed_Graph) return Natural is begin Ensure_Created (G); return Component_Map.Size (G.Components); end Number_Of_Components; --------------------- -- Number_Of_Edges -- --------------------- function Number_Of_Edges (G : Directed_Graph) return Natural is begin Ensure_Created (G); return Edge_Map.Size (G.All_Edges); end Number_Of_Edges; ------------------------------ -- Number_Of_Outgoing_Edges -- ------------------------------ function Number_Of_Outgoing_Edges (G : Directed_Graph; V : Vertex_Id) return Natural is begin Ensure_Created (G); Ensure_Present (G, V); return Edge_Set.Size (Get_Outgoing_Edges (G, V)); end Number_Of_Outgoing_Edges; ------------------------ -- Number_Of_Vertices -- ------------------------ function Number_Of_Vertices (G : Directed_Graph) return Natural is begin Ensure_Created (G); return Vertex_Map.Size (G.All_Vertices); end Number_Of_Vertices; ------------- -- Present -- ------------- function Present (G : Directed_Graph) return Boolean is begin return G /= Nil; end Present; ------------------- -- Set_Component -- ------------------- procedure Set_Component (G : Directed_Graph; V : Vertex_Id; Val : Component_Id) is VA : Vertex_Attributes; begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); VA := Get_Vertex_Attributes (G, V); VA.Component := Val; Set_Vertex_Attributes (G, V, VA); end Set_Component; ------------------------ -- Set_Outgoing_Edges -- ------------------------ procedure Set_Outgoing_Edges (G : Directed_Graph; V : Vertex_Id; Val : Edge_Set.Membership_Set) is VA : Vertex_Attributes; begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); VA := Get_Vertex_Attributes (G, V); VA.Outgoing_Edges := Val; Set_Vertex_Attributes (G, V, VA); end Set_Outgoing_Edges; --------------------------- -- Set_Vertex_Attributes -- --------------------------- procedure Set_Vertex_Attributes (G : Directed_Graph; V : Vertex_Id; Val : Vertex_Attributes) is begin pragma Assert (Present (G)); pragma Assert (Contains_Vertex (G, V)); Vertex_Map.Put (G.All_Vertices, V, Val); end Set_Vertex_Attributes; ------------------- -- Source_Vertex -- ------------------- function Source_Vertex (G : Directed_Graph; E : Edge_Id) return Vertex_Id is begin Ensure_Created (G); Ensure_Present (G, E); return Get_Edge_Attributes (G, E).Source; end Source_Vertex; end Directed_Graphs; -------------------- -- Hash_Component -- -------------------- function Hash_Component (Comp : Component_Id) return Bucket_Range_Type is begin return Bucket_Range_Type (Comp); end Hash_Component; ------------- -- Present -- ------------- function Present (Comp : Component_Id) return Boolean is begin return Comp /= No_Component; end Present; ----------------------------- -- Sequence_Next_Component -- ----------------------------- Component_Sequencer : Component_Id := First_Component; -- The counter for component handles. Do not directly manipulate its value -- because this will destroy the invariant of the handles. function Sequence_Next_Component return Component_Id is Component : constant Component_Id := Component_Sequencer; begin Component_Sequencer := Component_Sequencer + 1; return Component; end Sequence_Next_Component; end GNAT.Graphs;
29.02882
79
0.507007
138218db5ef87a9fb79f94ffa0367ed1914432e1
774
adb
Ada
Erathostenes-III/src/main.adb
Maxelweb/adacore-sandbox
a2576a33660327079f64d32e4b79d5a139cc3631
[ "Unlicense" ]
null
null
null
Erathostenes-III/src/main.adb
Maxelweb/adacore-sandbox
a2576a33660327079f64d32e4b79d5a139cc3631
[ "Unlicense" ]
null
null
null
Erathostenes-III/src/main.adb
Maxelweb/adacore-sandbox
a2576a33660327079f64d32e4b79d5a139cc3631
[ "Unlicense" ]
null
null
null
with System; with SoE; with Ada.Text_IO, Ada.Integer_Text_IO; with Ada.Exceptions; procedure Main is use Ada.Text_IO, Ada.Integer_Text_IO; pragma Priority (System.Priority'First); User_Limit : Integer; begin -- process Odd is activated at this point --+ -- the main unit may take the range limit from user input -- and pass it on, by rendezvous, to Odd Put ("Insert range limit: "); Get (User_Limit); SoE.Odd.Set_Limit (User_Limit); -- at this point the main unit has nothing other to do -- than wait for its dependent processes (Odd and all instances of Sieve) -- to terminate exception when E : others => Put_Line ("Exception " & Ada.Exceptions.Exception_Name (E)); end Main;
29.769231
78
0.657623
adfd9ec5545f3f3453d4c2e81e9681a3eb8ddafb
3,348
ads
Ada
tools/scitools/conf/understand/ada/ada12/s-gloloc.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
1
2020-01-20T21:26:46.000Z
2020-01-20T21:26:46.000Z
tools/scitools/conf/understand/ada/ada12/s-gloloc.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
tools/scitools/conf/understand/ada/ada12/s-gloloc.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . G L O B A L _ L O C K S -- -- -- -- S p e c -- -- -- -- Copyright (C) 1999-2009, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package contains the necessary routines to provide -- reliable system wide locking capability. package System.Global_Locks is Lock_Error : exception; -- Exception raised if a request cannot be executed on a lock type Lock_Type is private; -- Such a lock is a global lock between partitions. This lock is -- uniquely defined between the partitions because of its name. Null_Lock : constant Lock_Type; -- This needs comments ??? procedure Create_Lock (Lock : out Lock_Type; Name : String); -- Create or retrieve a global lock for the current partition using -- its Name. procedure Acquire_Lock (Lock : in out Lock_Type); -- If the lock cannot be acquired because someone already owns it, this -- procedure is supposed to wait and retry forever. procedure Release_Lock (Lock : in out Lock_Type); private type Lock_Type is new Natural; Null_Lock : constant Lock_Type := 0; end System.Global_Locks;
52.3125
78
0.420251
0485053048f240152ceceb42e029a8eae5c31d91
3,629
ads
Ada
source/amf/uml/amf-uml-behavioral_features-hash.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/amf/uml/amf-uml-behavioral_features-hash.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/amf/uml/amf-uml-behavioral_features-hash.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
4
2017-07-18T07:11:05.000Z
2020-06-21T03:02:25.000Z
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Elements.Generic_Hash; function AMF.UML.Behavioral_Features.Hash is new AMF.Elements.Generic_Hash (UML_Behavioral_Feature, UML_Behavioral_Feature_Access);
72.58
88
0.405346
2ffbe0821ce505832f075ebceba0effcf3930c83
14,710
ads
Ada
tools/scitools/conf/understand/ada/ada95/a-witeio.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
1
2020-01-20T21:26:46.000Z
2020-01-20T21:26:46.000Z
tools/scitools/conf/understand/ada/ada95/a-witeio.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
tools/scitools/conf/understand/ada/ada95/a-witeio.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUNTIME COMPONENTS -- -- -- -- A D A . W I D E _ T E X T _ I O -- -- -- -- S p e c -- -- -- -- $Revision: 2 $ -- -- -- -- This specification is adapted from the Ada Reference Manual for use with -- -- GNAT. In accordance with the copyright of that document, you can freely -- -- copy and modify this specification, provided that if you redistribute a -- -- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ with Ada.IO_Exceptions; with System; with System.Parameters; package Ada.Wide_Text_IO is type File_Type is limited private; type File_Mode is (In_File, Out_File, Append_File); type Count is range 0 .. System.Parameters.Count_Max; subtype Positive_Count is Count range 1 .. Count'Last; Unbounded : constant Count := 0; -- Line and page length subtype Field is Integer range 0 .. System.Parameters.Field_Max; subtype Number_Base is Integer range 2 .. 16; type Type_Set is (Lower_Case, Upper_Case); --------------------- -- File Management -- --------------------- procedure Create (File : in out File_Type; Mode : in File_Mode := Out_File; Name : in String := ""; Form : in String := ""); procedure Open (File : in out File_Type; Mode : in File_Mode; Name : in String; Form : in String := ""); procedure Close (File : in out File_Type); procedure Delete (File : in out File_Type); procedure Reset (File : in out File_Type; Mode : in File_Mode); procedure Reset (File : in out File_Type); function Mode (File : in File_Type) return File_Mode; function Name (File : in File_Type) return String; function Form (File : in File_Type) return String; function Is_Open (File : in File_Type) return Boolean; ------------------------------------------------------ -- Control of default input, output and error files -- ------------------------------------------------------ procedure Set_Input (File : in File_Type); procedure Set_Output (File : in File_Type); procedure Set_Error (File : in File_Type); function Standard_Input return File_Type; function Standard_Output return File_Type; function Standard_Error return File_Type; function Current_Input return File_Type; function Current_Output return File_Type; function Current_Error return File_Type; type File_Access is access constant File_Type; function Standard_Input return File_Access; function Standard_Output return File_Access; function Standard_Error return File_Access; function Current_Input return File_Access; function Current_Output return File_Access; function Current_Error return File_Access; -------------------- -- Buffer control -- -------------------- procedure Flush (File : in out File_Type); procedure Flush; -------------------------------------------- -- Specification of line and page lengths -- -------------------------------------------- procedure Set_Line_Length (File : in File_Type; To : in Count); procedure Set_Line_Length (To : in Count); procedure Set_Page_Length (File : in File_Type; To : in Count); procedure Set_Page_Length (To : in Count); function Line_Length (File : in File_Type) return Count; function Line_Length return Count; function Page_Length (File : in File_Type) return Count; function Page_Length return Count; ------------------------------------ -- Column, Line, and Page Control -- ------------------------------------ procedure New_Line (File : in File_Type; Spacing : in Positive_Count := 1); procedure New_Line (Spacing : in Positive_Count := 1); procedure Skip_Line (File : in File_Type; Spacing : in Positive_Count := 1); procedure Skip_Line (Spacing : in Positive_Count := 1); function End_Of_Line (File : in File_Type) return Boolean; function End_Of_Line return Boolean; procedure New_Page (File : in File_Type); procedure New_Page; procedure Skip_Page (File : in File_Type); procedure Skip_Page; function End_Of_Page (File : in File_Type) return Boolean; function End_Of_Page return Boolean; function End_Of_File (File : in File_Type) return Boolean; function End_Of_File return Boolean; procedure Set_Col (File : in File_Type; To : in Positive_Count); procedure Set_Col (To : in Positive_Count); procedure Set_Line (File : in File_Type; To : in Positive_Count); procedure Set_Line (To : in Positive_Count); function Col (File : in File_Type) return Positive_Count; function Col return Positive_Count; function Line (File : in File_Type) return Positive_Count; function Line return Positive_Count; function Page (File : in File_Type) return Positive_Count; function Page return Positive_Count; ----------------------------- -- Characters Input-Output -- ----------------------------- procedure Get (File : in File_Type; Item : out Wide_Character); procedure Get (Item : out Wide_Character); procedure Put (File : in File_Type; Item : in Wide_Character); procedure Put (Item : in Wide_Character); procedure Look_Ahead (File : in File_Type; Item : out Wide_Character; End_Of_Line : out Boolean); procedure Look_Ahead (Item : out Wide_Character; End_of_Line : out Boolean); procedure Get_Immediate (File : in File_Type; Item : out Wide_Character); procedure Get_Immediate (Item : out Wide_Character); procedure Get_Immediate (File : in File_Type; Item : out Wide_Character; Available : out Boolean); procedure Get_Immediate (Item : out Wide_Character; Available : out Boolean); -------------------------- -- Strings Input-Output -- -------------------------- procedure Get (File : in File_Type; Item : out Wide_String); procedure Get (Item : out Wide_String); procedure Put (File : in File_Type; Item : in Wide_String); procedure Put (Item : in Wide_String); procedure Get_Line (File : in File_Type; Item : out Wide_String; Last : out Natural); procedure Get_Line (Item : out Wide_String; Last : out Natural); procedure Put_Line (File : in File_Type; Item : in Wide_String); procedure Put_Line (Item : in Wide_String); -------------------------------------------------------- -- Generic packages for Input-Output of Integer Types -- -------------------------------------------------------- generic type Num is range <>; package Integer_Io is Default_Width : Field := Num'Width; Default_Base : Number_Base := 10; procedure Get (File : in File_Type; Item : out Num; Width : in Field := 0); procedure Get (Item : out Num; Width : in Field := 0); procedure Put (File : in File_Type; Item : in Num; Width : in Field := Default_Width; Base : in Number_Base := Default_Base); procedure Put (Item : in Num; Width : in Field := Default_Width; Base : in Number_Base := Default_Base); procedure Get (From : in Wide_String; Item : out Num; Last : out Positive); procedure Put (To : out Wide_String; Item : in Num; Base : in Number_Base := Default_Base); end Integer_Io; ----------------------------------- -- Input-Output of Modular Types -- ----------------------------------- generic type Num is mod <>; package Modular_IO is Default_Width : Field := Num'Width; Default_Base : Number_Base := 10; procedure Get (File : in File_Type; Item : out Num; Width : in Field := 0); procedure Get (Item : out Num; Width : in Field := 0); procedure Put (File : in File_Type; Item : in Num; Width : in Field := Default_Width; Base : in Number_Base := Default_Base); procedure Put (Item : in Num; Width : in Field := Default_Width; Base : in Number_Base := Default_Base); procedure Get (From : in Wide_String; Item : out Num; Last : out Positive); procedure Put (To : out Wide_String; Item : in Num; Base : in Number_Base := Default_Base); end Modular_IO; -------------------------------- -- Input-Output of Real Types -- -------------------------------- generic type Num is digits <>; package Float_Io is Default_Fore : Field := 2; Default_Aft : Field := Num'Digits - 1; Default_Exp : Field := 3; procedure Get (File : in File_Type; Item : out Num; Width : in Field := 0); procedure Get (Item : out Num; Width : in Field := 0); procedure Put (File : in File_Type; Item : in Num; Fore : in Field := Default_Fore; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp); procedure Put (Item : in Num; Fore : in Field := Default_Fore; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp); procedure Get (From : in Wide_String; Item : out Num; Last : out Positive); procedure Put (To : out Wide_String; Item : in Num; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp); end Float_Io; generic type Num is delta <>; package Fixed_Io is Default_Fore : Field := Num'Fore; Default_Aft : Field := Num'Aft; Default_Exp : Field := 0; procedure Get (File : in File_Type; Item : out Num; Width : in Field := 0); procedure Get (Item : out Num; Width : in Field := 0); procedure Put (File : in File_Type; Item : in Num; Fore : in Field := Default_Fore; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp); procedure Put (Item : in Num; Fore : in Field := Default_Fore; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp); procedure Get (From : in Wide_String; Item : out Num; Last : out Positive); procedure Put (To : out Wide_String; Item : in Num; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp); end Fixed_Io; -- generic -- type Num is delta <> digits <>; -- package Decimal_IO is -- -- Default_Fore : Field := Num'Fore; -- Default_Aft : Field := Num'Aft; -- Default_Exp : Field := 0; -- procedure Get -- (File : in File_Type; -- Item : out Num; -- Width : in Field := 0); -- procedure Get -- (Item : out Num; -- Width : in Field := 0); -- procedure Put -- (File : in File_Type; -- Item : in Num; -- Fore : in Field := Default_Fore; -- Aft : in Field := Default_Aft; -- Exp : in Field := Default_Exp); -- procedure Put -- (Item : in Num; -- Fore : in Field := Default_Fore; -- Aft : in Field := Default_Aft; -- Exp : in Field := Default_Exp); -- procedure Get -- (From : in Wide_String; -- Item : out Num; -- Last : out Positive); -- procedure Put -- (To : out Wide_String; -- Item : in Num; -- Aft : in Field := Default_Aft; -- Exp : in Field := Default_Exp); -- -- end Decimal_IO; --------------------------------------- -- Input-Output of Enumeration Types -- --------------------------------------- generic type Enum is (<>); package Enumeration_Io is Default_Width : Field := 0; Default_Setting : Type_Set := Upper_Case; procedure Get (File : in File_Type; Item : out Enum); procedure Get (Item : out Enum); procedure Put (File : in File_Type; Item : in Enum; Width : in Field := Default_Width; Set : in Type_Set := Default_Setting); procedure Put (Item : in Enum; Width : in Field := Default_Width; Set : in Type_Set := Default_Setting); procedure Get (From : in Wide_String; Item : out Enum; Last : out positive); procedure Put (To : out Wide_String; Item : in Enum; Set : in Type_Set := Default_Setting); end Enumeration_Io; -- Exceptions Status_Error : exception renames IO_Exceptions.Status_Error; Mode_Error : exception renames IO_Exceptions.Mode_Error; Name_Error : exception renames IO_Exceptions.Name_Error; Use_Error : exception renames IO_Exceptions.Use_Error; Device_Error : exception renames IO_Exceptions.Device_Error; End_Error : exception renames IO_Exceptions.End_Error; Data_Error : exception renames IO_Exceptions.Data_Error; Layout_Error : exception renames IO_Exceptions.Layout_Error; private type File_Ptr is new System.Address; type Pstring is access String; -- Ada File Control Block type AFCB is record AFCB_In_Use : Boolean; Desc : File_Ptr; Name : Pstring; Form : Pstring; Mode : File_Mode; Page : Count; Line : Count; Col : Positive_Count; Line_Length : Count; Page_Length : Count; Count : Integer; Is_Keyboard : Boolean; Look_Ahead : String (1 .. 3); end record; type File_Type is access AFCB; end Ada.Wide_Text_IO;
28.674464
79
0.536098
a1e26cd7b69adec559d9abaf56f32b398a1bfda6
2,667
ads
Ada
src/dnscatcher/dns/client/dnscatcher-dns-client.ads
DNSCatcher/DNSCatcher
e3865fde5ae4bd5f833210150a9d30668a051d40
[ "MIT" ]
4
2019-09-23T23:55:34.000Z
2020-05-02T07:25:32.000Z
src/dnscatcher/dns/client/dnscatcher-dns-client.ads
DNSCatcher/DNSCatcher
e3865fde5ae4bd5f833210150a9d30668a051d40
[ "MIT" ]
null
null
null
src/dnscatcher/dns/client/dnscatcher-dns-client.ads
DNSCatcher/DNSCatcher
e3865fde5ae4bd5f833210150a9d30668a051d40
[ "MIT" ]
null
null
null
-- Copyright 2019 Michael Casadevall <[email protected]> -- -- Permission is hereby granted, free of charge, to any person obtaining a copy -- of this software and associated documentation files (the "Software"), to -- deal in the Software without restriction, including without limitation the -- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -- sell copies of the Software, and to permit persons to whom the Software is -- furnished to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be included in -- all copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -- DEALINGS IN THE SOFTWARE. with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with DNSCatcher.DNS.Processor.Packet; use DNSCatcher.DNS.Processor.Packet; with DNSCatcher.Config; use DNSCatcher.Config; with DNSCatcher.DNS; use DNSCatcher.DNS; with DNSCatcher.Types; use DNSCatcher.Types; -- Creates and handles making DNS client requests package DNSCatcher.DNS.Client is -- DNS Client object type Client is tagged private; type Client_Access is access all Client'Class; -- Populates the header field for a given DNS request -- -- @value This the DNS Client object procedure Create_Header (This : in out Client); --!pp off -- Adds a question to the DNS request -- -- @value This the DNS Client object -- @value QName DNS name to query -- @value QType The RRType to query -- @value QClass DNS Class to query --!pp on procedure Add_Query (This : in out Client; QName : Unbounded_String; QType : RR_Types; QClass : Classes); --!pp off -- Creates a DNS packet out of a client request (should be private) -- -- @value This the DNS Client object -- @value Config to the DNSCatcher configuration --!pp on function Create_Packet (This : in out Client; Config : Configuration) return Raw_Packet_Record_Ptr; private type Client is tagged record Header : DNS_Packet_Header; Questions : Question_Vector.Vector; end record; end DNSCatcher.DNS.Client;
37.56338
79
0.708286
1a2f523f7e5ed4207761277d92dc2dc342e6aebe
2,428
ads
Ada
tools/scitools/conf/understand/ada/ada05/s-errrep.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
1
2020-01-20T21:26:46.000Z
2020-01-20T21:26:46.000Z
tools/scitools/conf/understand/ada/ada05/s-errrep.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
tools/scitools/conf/understand/ada/ada05/s-errrep.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . E R R O R _ R E P O R T I N G -- -- -- -- S p e c -- -- -- -- Copyright (C) 1995-2006, AdaCore -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNARL; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- -- -- -- -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This package must not depend on anything else, since it may be -- called during elaboration of other packages. package System.Error_Reporting is pragma Preelaborate; function Shutdown (M : String) return Boolean; -- Perform emergency shutdown of the entire program. Msg is an error -- message to be printed to the console. This is to be used only for -- nonrecoverable errors. end System.Error_Reporting;
52.782609
78
0.429984
9aaca2c9443a0742cef7f1456ac94839392f4669
125,481
adb
Ada
src/portscan-operations.adb
jrmarino/ravenadm
51f618e43e8d84c1c8a582b45e8c84f9561b5695
[ "0BSD" ]
18
2017-02-28T08:43:17.000Z
2022-03-22T21:55:56.000Z
src/portscan-operations.adb
jrmarino/ravenadm
51f618e43e8d84c1c8a582b45e8c84f9561b5695
[ "0BSD" ]
49
2017-10-28T11:18:05.000Z
2022-01-16T16:23:32.000Z
src/portscan-operations.adb
jrmarino/ravenadm
51f618e43e8d84c1c8a582b45e8c84f9561b5695
[ "0BSD" ]
5
2017-09-06T14:47:57.000Z
2021-11-25T08:31:10.000Z
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../License.txt -- To enable ncurses support, use sed to change Options_Dialog_Console => Options_Dialog -- Also change Display.Console => Display.Curses with Unix; with Signals; with Replicant; with Ada.Exceptions; with Ada.Directories; with Ada.Characters.Latin_1; with PortScan.Log; with PortScan.Buildcycle; with Specification_Parser; with Port_Specification.Makefile; with Port_Specification.Transform; with INI_File_Manager; with Options_Dialog_Console; with Display.Console; package body PortScan.Operations is package EX renames Ada.Exceptions; package DIR renames Ada.Directories; package LAT renames Ada.Characters.Latin_1; package LOG renames PortScan.Log; package CYC renames PortScan.Buildcycle; package REP renames Replicant; package PAR renames Specification_Parser; package PSM renames Port_Specification.Makefile; package PST renames Port_Specification.Transform; package IFM renames INI_File_Manager; package DLG renames Options_Dialog_Console; package DPY renames Display; package DPC renames Display.Console; -------------------------------------------------------------------------------------------- -- parallel_bulk_run -------------------------------------------------------------------------------------------- procedure parallel_bulk_run (num_builders : builders; sysrootver : sysroot_characteristics) is subtype cycle_count is Natural range 1 .. 9; subtype refresh_count is Natural range 1 .. 4; subtype www_count is Natural range 1 .. 3; subtype alert_count is Natural range 1 .. 200; procedure text_display (builder : builders; info : String); procedure common_display (flavor : count_type; info : String); procedure slave_display (flavor : count_type; builder : builders; info : String); function slave_name (slave : builders) return String; function slave_bucket (slave : builders) return String; instructions : dim_instruction := (others => port_match_failed); builder_states : dim_builder_state := (others => idle); cntcycle : cycle_count := cycle_count'First; cntrefresh : refresh_count := refresh_count'First; cntalert : alert_count := alert_count'First; cntwww : www_count := www_count'First; run_complete : Boolean := False; available : Positive := Integer (num_builders); target : port_id; all_idle : Boolean; cntskip : Natural; sumdata : DPY.summary_rec; procedure text_display (builder : builders; info : String) is begin TIO.Put_Line (LOG.elapsed_now & " => [" & HT.zeropad (Integer (builder), 2) & "] " & info); end text_display; procedure slave_display (flavor : count_type; builder : builders; info : String) is slavid : constant String := HT.zeropad (Integer (builder), 2); begin LOG.scribe (flavor, LOG.elapsed_now & " [" & slavid & "] => " & info, False); end slave_display; procedure common_display (flavor : count_type; info : String) is begin LOG.scribe (flavor, LOG.elapsed_now & " " & info, False); end common_display; function slave_name (slave : builders) return String is begin return get_port_variant (instructions (slave)); end slave_name; function slave_bucket (slave : builders) return String is begin return get_bucket (instructions (slave)); end slave_bucket; task type build (builder : builders); task body build is build_result : Boolean; need_procfs : Boolean; begin if builder <= num_builders then if not curses_support then text_display (builder, "Builder launched"); end if; loop exit when builder_states (builder) = shutdown; if builder_states (builder) = tasked then builder_states (builder) := busy; need_procfs := all_ports (instructions (builder)).use_procfs; begin REP.launch_slave (builder, need_procfs); build_result := build_subpackages (builder, instructions (builder), sysrootver); exception when tremor : others => build_result := False; LOG.scribe (total, LOG.elapsed_now & " TASK" & builder'Img & " EXCEPTION: " & EX.Exception_Information (tremor), False); end; REP.destroy_slave (builder, need_procfs); if build_result then builder_states (builder) := done_success; else builder_states (builder) := done_failure; end if; else -- idle or done-(failure|success), just wait a bit delay 0.1; end if; end loop; if not curses_support then text_display (builder, " Shutting down"); end if; end if; exception when earthquake : others => LOG.scribe (total, LOG.elapsed_now & " UNHANDLED TASK" & builder'Img & " EXCEPTION: " & EX.Exception_Information (earthquake), False); Signals.initiate_shutdown; end build; builder_01 : build (builder => 1); builder_02 : build (builder => 2); builder_03 : build (builder => 3); builder_04 : build (builder => 4); builder_05 : build (builder => 5); builder_06 : build (builder => 6); builder_07 : build (builder => 7); builder_08 : build (builder => 8); builder_09 : build (builder => 9); builder_10 : build (builder => 10); builder_11 : build (builder => 11); builder_12 : build (builder => 12); builder_13 : build (builder => 13); builder_14 : build (builder => 14); builder_15 : build (builder => 15); builder_16 : build (builder => 16); builder_17 : build (builder => 17); builder_18 : build (builder => 18); builder_19 : build (builder => 19); builder_20 : build (builder => 20); builder_21 : build (builder => 21); builder_22 : build (builder => 22); builder_23 : build (builder => 23); builder_24 : build (builder => 24); builder_25 : build (builder => 25); builder_26 : build (builder => 26); builder_27 : build (builder => 27); builder_28 : build (builder => 28); builder_29 : build (builder => 29); builder_30 : build (builder => 30); builder_31 : build (builder => 31); builder_32 : build (builder => 32); builder_33 : build (builder => 33); builder_34 : build (builder => 34); builder_35 : build (builder => 35); builder_36 : build (builder => 36); builder_37 : build (builder => 37); builder_38 : build (builder => 38); builder_39 : build (builder => 39); builder_40 : build (builder => 40); builder_41 : build (builder => 41); builder_42 : build (builder => 42); builder_43 : build (builder => 43); builder_44 : build (builder => 44); builder_45 : build (builder => 45); builder_46 : build (builder => 46); builder_47 : build (builder => 47); builder_48 : build (builder => 48); builder_49 : build (builder => 49); builder_50 : build (builder => 50); builder_51 : build (builder => 51); builder_52 : build (builder => 52); builder_53 : build (builder => 53); builder_54 : build (builder => 54); builder_55 : build (builder => 55); builder_56 : build (builder => 56); builder_57 : build (builder => 57); builder_58 : build (builder => 58); builder_59 : build (builder => 59); builder_60 : build (builder => 60); builder_61 : build (builder => 61); builder_62 : build (builder => 62); builder_63 : build (builder => 63); builder_64 : build (builder => 64); -- Expansion of cpu_range from 32 to 64 means 128 possible builders builder_65 : build (builder => 65); builder_66 : build (builder => 66); builder_67 : build (builder => 67); builder_68 : build (builder => 68); builder_69 : build (builder => 69); builder_70 : build (builder => 70); builder_71 : build (builder => 71); builder_72 : build (builder => 72); builder_73 : build (builder => 73); builder_74 : build (builder => 74); builder_75 : build (builder => 75); builder_76 : build (builder => 76); builder_77 : build (builder => 77); builder_78 : build (builder => 78); builder_79 : build (builder => 79); builder_80 : build (builder => 80); builder_81 : build (builder => 81); builder_82 : build (builder => 82); builder_83 : build (builder => 83); builder_84 : build (builder => 84); builder_85 : build (builder => 85); builder_86 : build (builder => 86); builder_87 : build (builder => 87); builder_88 : build (builder => 88); builder_89 : build (builder => 89); builder_90 : build (builder => 90); builder_91 : build (builder => 91); builder_92 : build (builder => 92); builder_93 : build (builder => 93); builder_94 : build (builder => 94); builder_95 : build (builder => 95); builder_96 : build (builder => 96); builder_97 : build (builder => 97); builder_98 : build (builder => 98); builder_99 : build (builder => 99); builder_100 : build (builder => 100); builder_101 : build (builder => 101); builder_102 : build (builder => 102); builder_103 : build (builder => 103); builder_104 : build (builder => 104); builder_105 : build (builder => 105); builder_106 : build (builder => 106); builder_107 : build (builder => 107); builder_108 : build (builder => 108); builder_109 : build (builder => 109); builder_110 : build (builder => 110); builder_111 : build (builder => 111); builder_112 : build (builder => 112); builder_113 : build (builder => 113); builder_114 : build (builder => 114); builder_115 : build (builder => 115); builder_116 : build (builder => 116); builder_117 : build (builder => 117); builder_118 : build (builder => 118); builder_119 : build (builder => 119); builder_120 : build (builder => 120); builder_121 : build (builder => 121); builder_122 : build (builder => 122); builder_123 : build (builder => 123); builder_124 : build (builder => 124); builder_125 : build (builder => 125); builder_126 : build (builder => 126); builder_127 : build (builder => 127); builder_128 : build (builder => 128); begin loop all_idle := True; for slave in 1 .. num_builders loop begin case builder_states (slave) is when busy | tasked => all_idle := False; when shutdown => null; when idle => if run_complete then builder_states (slave) := shutdown; else target := top_buildable_port; if target = port_match_failed then if Signals.graceful_shutdown_requested or else nothing_left (num_builders) then run_complete := True; builder_states (slave) := shutdown; if curses_support then DPY.insert_history (CYC.assemble_history_record (slave, 0, DPY.action_shutdown)); end if; else if shutdown_recommended (available) then builder_states (slave) := shutdown; if curses_support then DPY.insert_history (CYC.assemble_history_record (slave, 0, DPY.action_shutdown)); end if; available := available - 1; end if; end if; else lock_package (target); instructions (slave) := target; builder_states (slave) := tasked; slave_display (total, slave, slave_name (slave)); if not curses_support then text_display (slave, " Kickoff " & slave_name (slave)); end if; end if; end if; when done_success | done_failure => all_idle := False; if builder_states (slave) = done_success then if curses_support then DPY.insert_history (CYC.assemble_history_record (slave, instructions (slave), DPY.action_success)); else text_display (slave, CYC.elapsed_build (slave) & " Success " & slave_name (slave)); end if; record_history_built (elapsed => LOG.elapsed_now, slave_id => slave, bucket => slave_bucket (slave), origin => slave_name (slave), duration => CYC.elapsed_build (slave)); run_package_hook (pkg_success, instructions (slave)); cascade_successful_build (instructions (slave)); LOG.increment_build_counter (success); common_display (success, slave_name (slave)); common_display (total, slave_name (slave) & " success"); else common_display (total, slave_name (slave) & " FAILED!"); cascade_failed_build (instructions (slave), cntskip); LOG.increment_build_counter (skipped, cntskip); LOG.increment_build_counter (failure); common_display (total, slave_name (slave) & " failure skips:" & cntskip'Img); common_display (failure, slave_name (slave) & " (skipped" & cntskip'Img & ")"); if curses_support then DPY.insert_history (CYC.assemble_history_record (slave, instructions (slave), DPY.action_failure)); else text_display (slave, CYC.elapsed_build (slave) & " Failure " & slave_name (slave)); end if; record_history_failed (elapsed => LOG.elapsed_now, slave_id => slave, bucket => slave_bucket (slave), origin => slave_name (slave), duration => CYC.elapsed_build (slave), die_phase => CYC.last_build_phase (slave), skips => cntskip); run_package_hook (pkg_failure, instructions (slave)); end if; instructions (slave) := port_match_failed; if run_complete then builder_states (slave) := shutdown; if curses_support then DPY.insert_history (CYC.assemble_history_record (slave, 0, DPY.action_shutdown)); end if; else builder_states (slave) := idle; end if; end case; exception when earthquake : others => LOG.scribe (total, LOG.elapsed_now & " UNHANDLED SLAVE LOOP EXCEPTION: " & EX.Exception_Information (earthquake), False); Signals.initiate_shutdown; end; end loop; exit when run_complete and all_idle; begin if cntcycle = cycle_count'Last then cntcycle := cycle_count'First; LOG.flush_log (success); LOG.flush_log (failure); LOG.flush_log (skipped); LOG.flush_log (total); if curses_support then if cntrefresh = refresh_count'Last then cntrefresh := refresh_count'First; DPC.set_full_redraw_next_update; else cntrefresh := cntrefresh + 1; end if; sumdata.Initially := LOG.port_counter_value (total); sumdata.Built := LOG.port_counter_value (success); sumdata.Failed := LOG.port_counter_value (failure); sumdata.Ignored := LOG.port_counter_value (ignored); sumdata.Skipped := LOG.port_counter_value (skipped); sumdata.elapsed := LOG.elapsed_now; sumdata.swap := get_swap_status; sumdata.load := CYC.load_core (True); sumdata.pkg_hour := LOG.hourly_build_rate; sumdata.impulse := LOG.impulse_rate; DPC.summarize (sumdata); for b in builders'First .. num_builders loop if builder_states (b) = shutdown then DPC.update_builder (CYC.builder_status (b, True, False)); elsif builder_states (b) = idle then DPC.update_builder (CYC.builder_status (b, False, True)); else CYC.set_log_lines (b); DPC.update_builder (CYC.builder_status (b)); end if; end loop; DPC.refresh_builder_window; DPC.refresh_history_window; else -- text mode support, periodic status reports if cntalert = alert_count'Last then cntalert := alert_count'First; TIO.Put_Line (LOG.elapsed_now & " => " & " Left:" & LOG.ports_remaining_to_build'Img & " Succ:" & LOG.port_counter_value (success)'Img & " Fail:" & LOG.port_counter_value (failure)'Img & " Skip:" & LOG.port_counter_value (skipped)'Img & " Ign:" & LOG.port_counter_value (ignored)'Img); else cntalert := cntalert + 1; end if; -- Update log lines every 4 seconds for the watchdog if cntrefresh = refresh_count'Last then cntrefresh := refresh_count'First; for b in builders'First .. num_builders loop if builder_states (b) /= shutdown and then builder_states (b) /= idle then CYC.set_log_lines (b); end if; end loop; else cntrefresh := cntrefresh + 1; end if; end if; -- Generate latest history file every 3 seconds. -- With a poll period of 6 seconds, we need twice that frequency to avoid aliasing -- Note that in text mode, the logs are updated every 4 seconds, so in this mode -- the log lines will often be identical for a cycle. if cntwww = www_count'Last then cntwww := www_count'First; write_history_json; write_summary_json (active => True, states => builder_states, num_builders => num_builders, num_history_files => history.segment); else cntwww := cntwww + 1; end if; else cntcycle := cntcycle + 1; end if; delay 0.10; exception when earthquake : others => LOG.scribe (total, LOG.elapsed_now & " UNHANDLED BULK RUN EXCEPTION: " & EX.Exception_Information (earthquake), False); exit; end; end loop; if PM.configuration.avec_ncurses and then curses_support then DPC.terminate_monitor; end if; write_history_json; write_summary_json (active => False, states => builder_states, num_builders => num_builders, num_history_files => history.segment); run_hook (run_end, "PORTS_BUILT=" & HT.int2str (LOG.port_counter_value (success)) & " PORTS_FAILED=" & HT.int2str (LOG.port_counter_value (failure)) & " PORTS_IGNORED=" & HT.int2str (LOG.port_counter_value (ignored)) & " PORTS_SKIPPED=" & HT.int2str (LOG.port_counter_value (skipped))); end parallel_bulk_run; -------------------------------------------------------------------------------------------- -- initialize_hooks -------------------------------------------------------------------------------------------- procedure initialize_hooks is begin for hook in hook_type'Range loop declare script : constant String := HT.USS (hook_location (hook)); begin active_hook (hook) := DIR.Exists (script) and then file_is_executable (script); end; end loop; end initialize_hooks; -------------------------------------------------------------------------------------------- -- run_hook -------------------------------------------------------------------------------------------- procedure run_hook (hook : hook_type; envvar_list : String) is function nvpair (name : String; value : HT.Text) return String; function nvpair (name : String; value : HT.Text) return String is begin return name & LAT.Equals_Sign & HT.replace_char (HT.USS (value), LAT.Space, "\ ") & LAT.Space; end nvpair; common_env : constant String := nvpair ("PROFILE", PM.configuration.profile) & nvpair ("DIR_PACKAGES", PM.configuration.dir_packages) & nvpair ("DIR_LOCALBASE", PM.configuration.dir_localbase) & nvpair ("DIR_CONSPIRACY", PM.configuration.dir_conspiracy) & nvpair ("DIR_CUSTOM_PORTS", PM.configuration.dir_unkindness) & nvpair ("DIR_DISTFILES", PM.configuration.dir_distfiles) & nvpair ("DIR_LOGS", PM.configuration.dir_logs) & nvpair ("DIR_BUILDBASE", PM.configuration.dir_buildbase); -- The follow command works on every platform command : constant String := "/usr/bin/env -i " & common_env & envvar_list & " " & HT.USS (hook_location (hook)); begin if not active_hook (hook) then return; end if; if Unix.external_command (command) then null; end if; end run_hook; -------------------------------------------------------------------------------------------- -- run_start_hook -------------------------------------------------------------------------------------------- procedure run_start_hook is begin run_hook (run_start, "PORTS_QUEUED=" & HT.int2str (queue_length) & " "); end run_start_hook; -------------------------------------------------------------------------------------------- -- run_hook_after_build -------------------------------------------------------------------------------------------- procedure run_hook_after_build (built : Boolean; id : port_id) is begin if built then run_package_hook (pkg_success, id); else run_package_hook (pkg_failure, id); end if; end run_hook_after_build; -------------------------------------------------------------------------------------------- -- run_package_hook -------------------------------------------------------------------------------------------- procedure run_package_hook (hook : hook_type; id : port_id) is tail : String := " ORIGIN=" & get_port_variant (id); begin case hook is when pkg_success => run_hook (hook, "RESULT=success" & tail); when pkg_failure => run_hook (hook, "RESULT=failure" & tail); when pkg_ignored => run_hook (hook, "RESULT=ignored" & tail); when pkg_skipped => run_hook (hook, "RESULT=skipped" & tail); when others => null; end case; end run_package_hook; -------------------------------------------------------------------------------------------- -- file_is_executable -------------------------------------------------------------------------------------------- function file_is_executable (filename : String) return Boolean is status : Integer; sysroot : constant String := HT.USS (PM.configuration.dir_sysroot); command : constant String := sysroot & "/usr/bin/file -m " & sysroot & "/usr/share/file/magic.mgc -b " & filename; cmdout : String := HT.USS (Unix.piped_command (command, status)); begin if status = 0 then return HT.contains (cmdout, "executable"); else return False; end if; end file_is_executable; -------------------------------------------------------------------------------------------- -- delete_existing_web_history_files -------------------------------------------------------------------------------------------- procedure delete_existing_web_history_files is search : DIR.Search_Type; dirent : DIR.Directory_Entry_Type; pattern : constant String := "*_history.json"; filter : constant DIR.Filter_Type := (DIR.Ordinary_File => True, others => False); reportdir : constant String := HT.USS (PM.configuration.dir_logs); begin if not DIR.Exists (reportdir) then return; end if; DIR.Start_Search (Search => search, Directory => reportdir, Pattern => pattern, Filter => filter); while DIR.More_Entries (search) loop DIR.Get_Next_Entry (search, dirent); DIR.Delete_File (reportdir & "/" & DIR.Simple_Name (dirent)); end loop; DIR.End_Search (search); exception when DIR.Name_Error => null; end delete_existing_web_history_files; -------------------------------------------------------------------------------------------- -- delete_existing_packages_of_ports_list -------------------------------------------------------------------------------------------- procedure delete_existing_packages_of_ports_list is procedure force_delete (plcursor : string_crate.Cursor); compkey : HT.Text := HT.SUS (default_compiler & LAT.Colon & variant_standard); compiler : constant port_index := ports_keys.Element (compkey); binutils : constant port_index := ports_keys.Element (HT.SUS (default_binutils)); procedure force_delete (plcursor : string_crate.Cursor) is procedure delete_subpackage (position : subpackage_crate.Cursor); origin : HT.Text := string_crate.Element (plcursor); pndx : constant port_index := ports_keys.Element (origin); repo : constant String := HT.USS (PM.configuration.dir_repository) & "/"; procedure delete_subpackage (position : subpackage_crate.Cursor) is rec : subpackage_record renames subpackage_crate.Element (position); subpackage : constant String := HT.USS (rec.subpackage); tball : constant String := repo & PortScan.calculate_package_name (pndx, subpackage) & arc_ext; begin -- Never delete the port binutils or compiler's packages if pndx /= compiler and then pndx /= binutils then if DIR.Exists (tball) then DIR.Delete_File (tball); end if; end if; end delete_subpackage; begin all_ports (pndx).subpackages.Iterate (delete_subpackage'Access); end force_delete; begin portlist.Iterate (Process => force_delete'Access); end delete_existing_packages_of_ports_list; -------------------------------------------------------------------------------------------- -- list_subpackages_of_queued_ports -------------------------------------------------------------------------------------------- procedure list_subpackages_of_queued_ports is procedure list (plcursor : string_crate.Cursor); procedure list (plcursor : string_crate.Cursor) is procedure name (position : subpackage_crate.Cursor); origin : HT.Text renames string_crate.Element (plcursor); pndx : constant port_index := ports_keys.Element (origin); procedure name (position : subpackage_crate.Cursor) is rec : subpackage_record renames subpackage_crate.Element (position); subpackage : constant String := HT.USS (rec.subpackage); begin TIO.Put (" " & subpackage); end name; begin TIO.Put (HT.USS (origin) & " subpackages:"); all_ports (pndx).subpackages.Iterate (name'Access); TIO.Put_Line (""); end list; begin portlist.Iterate (list'Access); end list_subpackages_of_queued_ports; -------------------------------------------------------------------------------------------- -- next_ignored_port -------------------------------------------------------------------------------------------- function next_ignored_port return port_id is list_len : constant Integer := Integer (rank_queue.Length); cursor : ranking_crate.Cursor; QR : queue_record; result : port_id := port_match_failed; begin if list_len = 0 then return result; end if; cursor := rank_queue.First; for k in 1 .. list_len loop QR := ranking_crate.Element (Position => cursor); if all_ports (QR.ap_index).ignored then result := QR.ap_index; DPY.insert_history (CYC.assemble_history_record (1, QR.ap_index, DPY.action_ignored)); run_package_hook (pkg_ignored, QR.ap_index); exit; end if; cursor := ranking_crate.Next (Position => cursor); end loop; return result; end next_ignored_port; -------------------------------------------------------------------------------------------- -- assimulate_substring -------------------------------------------------------------------------------------------- procedure assimulate_substring (history : in out progress_history; substring : String) is first : constant Positive := history.last_index + 1; last : constant Positive := history.last_index + substring'Length; begin -- silently fail (this shouldn't be practically possible) if last < kfile_content'Last then history.content (first .. last) := substring; end if; history.last_index := last; end assimulate_substring; -------------------------------------------------------------------------------------------- -- nv #1 -------------------------------------------------------------------------------------------- function nv (name, value : String) return String is begin return LAT.Quotation & name & LAT.Quotation & LAT.Colon & LAT.Quotation & value & LAT.Quotation; end nv; -------------------------------------------------------------------------------------------- -- nv #2 -------------------------------------------------------------------------------------------- function nv (name : String; value : Integer) return String is begin return LAT.Quotation & name & LAT.Quotation & LAT.Colon & HT.int2str (value); end nv; -------------------------------------------------------------------------------------------- -- handle_first_history_entry -------------------------------------------------------------------------------------------- procedure handle_first_history_entry is begin if history.segment_count = 1 then assimulate_substring (history, "[" & LAT.LF & " {" & LAT.LF); else assimulate_substring (history, " ,{" & LAT.LF); end if; end handle_first_history_entry; -------------------------------------------------------------------------------------------- -- write_history_json -------------------------------------------------------------------------------------------- procedure write_history_json is jsonfile : TIO.File_Type; filename : constant String := HT.USS (PM.configuration.dir_logs) & "/" & HT.zeropad (history.segment, 2) & "_history.json"; begin if history.segment_count = 0 then return; end if; if history.last_written = history.last_index then return; end if; TIO.Create (File => jsonfile, Mode => TIO.Out_File, Name => filename); TIO.Put (jsonfile, history.content (1 .. history.last_index)); TIO.Put (jsonfile, "]"); TIO.Close (jsonfile); history.last_written := history.last_index; exception when others => if TIO.Is_Open (jsonfile) then TIO.Close (jsonfile); end if; end write_history_json; -------------------------------------------------------------------------------------------- -- check_history_segment_capacity -------------------------------------------------------------------------------------------- procedure check_history_segment_capacity is begin if history.segment_count = 1 then history.segment := history.segment + 1; return; end if; if history.segment_count < kfile_units_limit then return; end if; write_history_json; history.last_index := 0; history.last_written := 0; history.segment_count := 0; end check_history_segment_capacity; -------------------------------------------------------------------------------------------- -- record_history_ignored -------------------------------------------------------------------------------------------- procedure record_history_ignored (elapsed : String; bucket : String; origin : String; reason : String; skips : Natural) is cleantxt : constant String := HT.strip_control (reason); info : constant String := HT.replace_char (HT.replace_char (cleantxt, LAT.Quotation, "&nbsp;"), LAT.Reverse_Solidus, "&#92;") & ":|:" & HT.int2str (skips); begin history.log_entry := history.log_entry + 1; history.segment_count := history.segment_count + 1; handle_first_history_entry; assimulate_substring (history, " " & nv ("entry", history.log_entry) & LAT.LF); assimulate_substring (history, " ," & nv ("elapsed", elapsed) & LAT.LF); assimulate_substring (history, " ," & nv ("ID", "--") & LAT.LF); assimulate_substring (history, " ," & nv ("result", "ignored") & LAT.LF); assimulate_substring (history, " ," & nv ("bucket", bucket) & LAT.LF); assimulate_substring (history, " ," & nv ("origin", origin) & LAT.LF); assimulate_substring (history, " ," & nv ("info", info) & LAT.LF); assimulate_substring (history, " ," & nv ("duration", "--:--:--") & LAT.LF); assimulate_substring (history, " }" & LAT.LF); check_history_segment_capacity; end record_history_ignored; -------------------------------------------------------------------------------------------- -- record_history_skipped -------------------------------------------------------------------------------------------- procedure record_history_skipped (elapsed : String; bucket : String; origin : String; reason : String) is begin history.log_entry := history.log_entry + 1; history.segment_count := history.segment_count + 1; handle_first_history_entry; assimulate_substring (history, " " & nv ("entry", history.log_entry) & LAT.LF); assimulate_substring (history, " ," & nv ("elapsed", elapsed) & LAT.LF); assimulate_substring (history, " ," & nv ("ID", "--") & LAT.LF); assimulate_substring (history, " ," & nv ("result", "skipped") & LAT.LF); assimulate_substring (history, " ," & nv ("bucket", bucket) & LAT.LF); assimulate_substring (history, " ," & nv ("origin", origin) & LAT.LF); assimulate_substring (history, " ," & nv ("info", reason) & LAT.LF); assimulate_substring (history, " ," & nv ("duration", "--:--:--") & LAT.LF); assimulate_substring (history, " }" & LAT.LF); check_history_segment_capacity; end record_history_skipped; -------------------------------------------------------------------------------------------- -- record_history_built -------------------------------------------------------------------------------------------- procedure record_history_built (elapsed : String; slave_id : builders; bucket : String; origin : String; duration : String) is ID : constant String := HT.zeropad (Integer (slave_id), 2); begin history.log_entry := history.log_entry + 1; history.segment_count := history.segment_count + 1; handle_first_history_entry; assimulate_substring (history, " " & nv ("entry", history.log_entry) & LAT.LF); assimulate_substring (history, " ," & nv ("elapsed", elapsed) & LAT.LF); assimulate_substring (history, " ," & nv ("ID", ID) & LAT.LF); assimulate_substring (history, " ," & nv ("result", "built") & LAT.LF); assimulate_substring (history, " ," & nv ("bucket", bucket) & LAT.LF); assimulate_substring (history, " ," & nv ("origin", origin) & LAT.LF); assimulate_substring (history, " ," & nv ("info", "") & LAT.LF); assimulate_substring (history, " ," & nv ("duration", duration) & LAT.LF); assimulate_substring (history, " }" & LAT.LF); check_history_segment_capacity; end record_history_built; -------------------------------------------------------------------------------------------- -- record_history_built -------------------------------------------------------------------------------------------- procedure record_history_failed (elapsed : String; slave_id : builders; bucket : String; origin : String; duration : String; die_phase : String; skips : Natural) is info : constant String := die_phase & ":" & HT.int2str (skips); ID : constant String := HT.zeropad (Integer (slave_id), 2); begin history.log_entry := history.log_entry + 1; history.segment_count := history.segment_count + 1; handle_first_history_entry; assimulate_substring (history, " " & nv ("entry", history.log_entry) & LAT.LF); assimulate_substring (history, " ," & nv ("elapsed", elapsed) & LAT.LF); assimulate_substring (history, " ," & nv ("ID", ID) & LAT.LF); assimulate_substring (history, " ," & nv ("result", "failed") & LAT.LF); assimulate_substring (history, " ," & nv ("bucket", bucket) & LAT.LF); assimulate_substring (history, " ," & nv ("origin", origin) & LAT.LF); assimulate_substring (history, " ," & nv ("info", info) & LAT.LF); assimulate_substring (history, " ," & nv ("duration", duration) & LAT.LF); assimulate_substring (history, " }" & LAT.LF); check_history_segment_capacity; end record_history_failed; -------------------------------------------------------------------------------------------- -- skip_verified -------------------------------------------------------------------------------------------- function skip_verified (id : port_id) return Boolean is begin if id = port_match_failed then return False; end if; return not all_ports (id).unlist_failed; end skip_verified; -------------------------------------------------------------------------------------------- -- delete_rank -------------------------------------------------------------------------------------------- procedure delete_rank (id : port_id) is rank_cursor : ranking_crate.Cursor := rank_arrow (id); use type ranking_crate.Cursor; begin if rank_cursor /= ranking_crate.No_Element then rank_queue.Delete (Position => rank_cursor); end if; end delete_rank; -------------------------------------------------------------------------------------------- -- still_ranked -------------------------------------------------------------------------------------------- function still_ranked (id : port_id) return Boolean is rank_cursor : ranking_crate.Cursor := rank_arrow (id); use type ranking_crate.Cursor; begin return rank_cursor /= ranking_crate.No_Element; end still_ranked; -------------------------------------------------------------------------------------------- -- unlist_first_port -------------------------------------------------------------------------------------------- function unlist_first_port return port_id is origin : HT.Text := string_crate.Element (portlist.First); id : port_id; begin if ports_keys.Contains (origin) then id := ports_keys.Element (origin); else return port_match_failed; end if; if id = port_match_failed then return port_match_failed; end if; delete_rank (id); return id; end unlist_first_port; -------------------------------------------------------------------------------------------- -- unlist_port -------------------------------------------------------------------------------------------- procedure unlist_port (id : port_id) is begin if id = port_match_failed then return; end if; if still_ranked (id) then delete_rank (id); else -- don't raise exception. Since we don't prune all_reverse as -- we go, there's no guarantee the reverse dependency hasn't already -- been removed (e.g. when it is a common reverse dep) all_ports (id).unlist_failed := True; end if; end unlist_port; -------------------------------------------------------------------------------------------- -- rank_arrow -------------------------------------------------------------------------------------------- function rank_arrow (id : port_id) return ranking_crate.Cursor is rscore : constant port_index := all_ports (id).reverse_score; seek_target : constant queue_record := (ap_index => id, reverse_score => rscore); begin return rank_queue.Find (seek_target); end rank_arrow; -------------------------------------------------------------------------------------------- -- skip_next_reverse_dependency -------------------------------------------------------------------------------------------- function skip_next_reverse_dependency (pinnacle : port_id) return port_id is rev_cursor : block_crate.Cursor; next_dep : port_index; begin if all_ports (pinnacle).all_reverse.Is_Empty then return port_match_failed; end if; rev_cursor := all_ports (pinnacle).all_reverse.First; next_dep := block_crate.Element (rev_cursor); unlist_port (id => next_dep); all_ports (pinnacle).all_reverse.Delete (rev_cursor); return next_dep; end skip_next_reverse_dependency; -------------------------------------------------------------------------------------------- -- cascade_failed_build -------------------------------------------------------------------------------------------- procedure cascade_failed_build (id : port_id; numskipped : out Natural) is purged : PortScan.port_id; culprit : constant String := get_port_variant (id); begin numskipped := 0; loop purged := skip_next_reverse_dependency (id); exit when purged = port_match_failed; if skip_verified (purged) then numskipped := numskipped + 1; LOG.scribe (PortScan.total, " Skipped: " & get_port_variant (purged), False); LOG.scribe (PortScan.skipped, get_port_variant (purged) & " by " & culprit, False); DPY.insert_history (CYC.assemble_history_record (1, purged, DPY.action_skipped)); record_history_skipped (elapsed => LOG.elapsed_now, bucket => get_bucket (purged), origin => get_port_variant (purged), reason => culprit); run_package_hook (pkg_skipped, purged); end if; end loop; unlist_port (id); end cascade_failed_build; -------------------------------------------------------------------------------------------- -- cascade_successful_build -------------------------------------------------------------------------------------------- procedure cascade_successful_build (id : port_id) is procedure cycle (cursor : block_crate.Cursor); procedure cycle (cursor : block_crate.Cursor) is target : port_index renames block_crate.Element (cursor); begin if all_ports (target).blocked_by.Contains (id) then all_ports (target).blocked_by.Delete (id); else raise seek_failure with get_port_variant (target) & " was expected to be blocked by " & get_port_variant (id); end if; end cycle; begin all_ports (id).blocks.Iterate (cycle'Access); delete_rank (id); end cascade_successful_build; -------------------------------------------------------------------------------------------- -- integrity_intact -------------------------------------------------------------------------------------------- function integrity_intact return Boolean is procedure check_dep (cursor : block_crate.Cursor); procedure check_rank (cursor : ranking_crate.Cursor); intact : Boolean := True; procedure check_dep (cursor : block_crate.Cursor) is did : constant port_index := block_crate.Element (cursor); begin if not still_ranked (did) then intact := False; end if; end check_dep; procedure check_rank (cursor : ranking_crate.Cursor) is QR : constant queue_record := ranking_crate.Element (cursor); begin if intact then all_ports (QR.ap_index).blocked_by.Iterate (check_dep'Access); end if; end check_rank; begin rank_queue.Iterate (check_rank'Access); return intact; end integrity_intact; -------------------------------------------------------------------------------------------- -- located_external_repository -------------------------------------------------------------------------------------------- function located_external_repository return Boolean is command : constant String := host_pkg8 & " -vv"; found : Boolean := False; inspect : Boolean := False; status : Integer; begin declare dump : String := HT.USS (Unix.piped_command (command, status)); markers : HT.Line_Markers; linenum : Natural := 0; begin if status /= 0 then return False; end if; HT.initialize_markers (dump, markers); loop exit when not HT.next_line_present (dump, markers); declare line : constant String := HT.extract_line (dump, markers); len : constant Natural := line'Length; begin if inspect then if len > 7 and then line (line'First .. line'First + 1) = " " and then line (line'Last - 3 .. line'Last) = ": { " and then line (line'First + 2 .. line'Last - 4) /= "ravenadm" then found := True; external_repository := HT.SUS (line (line'First + 2 .. line'Last - 4)); exit; end if; else if line = "Repositories:" then inspect := True; end if; end if; end; end loop; end; return found; end located_external_repository; -------------------------------------------------------------------------------------------- -- top_external_repository -------------------------------------------------------------------------------------------- function top_external_repository return String is begin return HT.USS (external_repository); end top_external_repository; -------------------------------------------------------------------------------------------- -- isolate_arch_from_file_type -------------------------------------------------------------------------------------------- function isolate_arch_from_file_type (fileinfo : String) return filearch is -- DF: ELF 64-bit LSB executable, x86-64 -- FB: ELF 64-bit LSB executable, x86-64 -- FB: ELF 32-bit LSB executable, Intel 80386 -- NB: ELF 64-bit LSB executable, x86-64 -- L: ELF 64-bit LSB executable, x86-64 -- NATIVE Solaris (we use our own file) -- /usr/bin/sh: ELF 64-bit LSB executable AMD64 Version 1 fragment : constant String := HT.trim (HT.specific_field (fileinfo, 2, ",")); answer : filearch := (others => ' '); begin if fragment'Length > filearch'Length then answer := fragment (fragment'First .. fragment'First + filearch'Length - 1); else answer (answer'First .. answer'First + fragment'Length - 1) := fragment; end if; return answer; end isolate_arch_from_file_type; -------------------------------------------------------------------------------------------- -- isolate_arch_from_macho_file -------------------------------------------------------------------------------------------- function isolate_arch_from_macho_file (fileinfo : String) return filearch is -- Mac: Mach-O 64-bit executable x86_64 fragment : constant String := HT.trim (HT.specific_field (fileinfo, 4)); answer : filearch := (others => ' '); begin if fragment'Length > filearch'Length then answer := fragment (fragment'First .. fragment'First + filearch'Length - 1); else answer (answer'First .. answer'First + fragment'Length - 1) := fragment; end if; return answer; end isolate_arch_from_macho_file; -------------------------------------------------------------------------------------------- -- establish_package_architecture -------------------------------------------------------------------------------------------- procedure establish_package_architecture (release : String; architecture : supported_arch) is function newsuffix return String; function suffix return String; function get_version (fileinfo : String; OS : String) return String; procedure craft_common_endings (release : String); function suffix return String is begin case architecture is when x86_64 => return "x86:64"; when i386 => return "x86:32"; when aarch64 => return "aarch64:64"; end case; end suffix; function newsuffix return String is begin case architecture is when x86_64 => return "amd64"; when i386 => return "i386"; when aarch64 => return "arm64"; end case; end newsuffix; procedure craft_common_endings (release : String) is begin HT.SU.Append (abi_formats.calculated_abi, release & ":"); HT.SU.Append (abi_formats.calculated_alt_abi, release & ":"); abi_formats.calc_abi_noarch := abi_formats.calculated_abi; abi_formats.calc_alt_abi_noarch := abi_formats.calculated_alt_abi; HT.SU.Append (abi_formats.calculated_abi, newsuffix); HT.SU.Append (abi_formats.calculated_alt_abi, suffix); HT.SU.Append (abi_formats.calc_abi_noarch, "*"); HT.SU.Append (abi_formats.calc_alt_abi_noarch, "*"); end craft_common_endings; function get_version (fileinfo : String; OS : String) return String is -- GNU/Linux 2.6.32, BuildID[sha1]=03d7a9de009544a1fe82313544a3c36e249858cc, stripped rest : constant String := HT.part_2 (fileinfo, OS); begin return HT.part_1 (rest, ","); end get_version; begin case platform_type is when dragonfly => declare dfly : constant String := "dragonfly:"; begin abi_formats.calculated_abi := HT.SUS (dfly); HT.SU.Append (abi_formats.calculated_abi, release & ":"); abi_formats.calc_abi_noarch := abi_formats.calculated_abi; HT.SU.Append (abi_formats.calculated_abi, suffix); HT.SU.Append (abi_formats.calc_abi_noarch, "*"); abi_formats.calculated_alt_abi := abi_formats.calculated_abi; abi_formats.calc_alt_abi_noarch := abi_formats.calc_abi_noarch; end; when freebsd => declare fbsd1 : constant String := "FreeBSD:"; fbsd2 : constant String := "freebsd:"; begin abi_formats.calculated_abi := HT.SUS (fbsd1); abi_formats.calculated_alt_abi := HT.SUS (fbsd2); craft_common_endings (release); end; when netbsd => declare net1 : constant String := "NetBSD:"; net2 : constant String := "netbsd:"; begin abi_formats.calculated_abi := HT.SUS (net1); abi_formats.calculated_alt_abi := HT.SUS (net2); craft_common_endings (release); end; when openbsd => declare open1 : constant String := "OpenBSD:"; open2 : constant String := "openbsd:"; begin abi_formats.calculated_abi := HT.SUS (open1); abi_formats.calculated_alt_abi := HT.SUS (open2); craft_common_endings (release); end; when sunos => declare sol1 : constant String := "Solaris:"; sol2 : constant String := "solaris:"; solrel : constant String := "10"; -- hardcoded in pkg(8), release=5.10 begin abi_formats.calculated_abi := HT.SUS (sol1); abi_formats.calculated_alt_abi := HT.SUS (sol2); craft_common_endings (solrel); end; when macos => -- Hardcode i386 for now until pkg(8) fixed to provide correct arch abi_formats.calculated_abi := HT.SUS ("Darwin:" & release & ":"); abi_formats.calculated_alt_abi := HT.SUS ("darwin:" & release & ":"); abi_formats.calc_abi_noarch := abi_formats.calculated_abi; abi_formats.calc_alt_abi_noarch := abi_formats.calculated_alt_abi; HT.SU.Append (abi_formats.calculated_abi, "i386"); HT.SU.Append (abi_formats.calculated_alt_abi, "i386:32"); HT.SU.Append (abi_formats.calc_abi_noarch, "*"); HT.SU.Append (abi_formats.calc_alt_abi_noarch, "*"); when linux => declare sysroot : constant String := HT.USS (PM.configuration.dir_sysroot); command : constant String := sysroot & "/usr/bin/file -m " & sysroot & "/usr/share/file/magic.mgc -b " & sysroot & "/bin/sh"; status : Integer; UN : HT.Text; begin UN := Unix.piped_command (command, status); declare gnu1 : constant String := "Linux:"; gnu2 : constant String := "linux:"; gnurel : constant String := get_version (HT.USS (UN), "GNU/Linux "); begin abi_formats.calculated_abi := HT.SUS (gnu1); abi_formats.calculated_alt_abi := HT.SUS (gnu2); craft_common_endings (gnurel); end; end; end case; end establish_package_architecture; -------------------------------------------------------------------------------------------- -- limited_sanity_check -------------------------------------------------------------------------------------------- procedure limited_sanity_check (repository : String; dry_run : Boolean; rebuild_compiler : Boolean; rebuild_binutils : Boolean; suppress_remote : Boolean; major_release : String; architecture : supported_arch) is procedure prune_packages (cursor : ranking_crate.Cursor); procedure check_package (cursor : ranking_crate.Cursor); procedure determine_fully_built (cursor : subpackage_queue.Cursor); procedure prune_queue (cursor : subqueue.Cursor); procedure print (cursor : subpackage_queue.Cursor); procedure fetch (cursor : subpackage_queue.Cursor); procedure check (cursor : subpackage_queue.Cursor); procedure set_delete (Element : in out subpackage_record); procedure kill_remote (Element : in out subpackage_record); compkey : HT.Text := HT.SUS (default_compiler & LAT.Colon & variant_standard); bukey : HT.Text := HT.SUS (default_binutils); compiler : constant port_index := ports_keys.Element (compkey); binutils : constant port_index := ports_keys.Element (bukey); already_built : subpackage_queue.Vector; fetch_list : subpackage_queue.Vector; prune_list : subqueue.Vector; fetch_fail : Boolean := False; clean_pass : Boolean := False; listlog : TIO.File_Type; goodlog : Boolean; using_screen : constant Boolean := Unix.screen_attached; filename : constant String := "/tmp/ravenadm_prefetch_list.txt"; package_list : HT.Text := HT.blank; procedure set_delete (Element : in out subpackage_record) is begin Element.deletion_due := True; end set_delete; procedure kill_remote (Element : in out subpackage_record) is begin Element.remote_pkg := False; end kill_remote; procedure check_package (cursor : ranking_crate.Cursor) is procedure check_subpackage (position : subpackage_crate.Cursor); target : port_id := ranking_crate.Element (cursor).ap_index; procedure check_subpackage (position : subpackage_crate.Cursor) is rec : subpackage_record renames subpackage_crate.Element (position); subpackage : constant String := HT.USS (rec.subpackage); pkgname : constant String := calculate_package_name (target, subpackage); available : constant Boolean := (rec.remote_pkg or else rec.pkg_present) and then not rec.deletion_due; newrec : subpackage_identifier := (target, rec.subpackage); begin if not available then return; end if; if passed_dependency_check (subpackage => subpackage, query_result => rec.pkg_dep_query, id => target) then if not ( (rebuild_binutils and then target = binutils) or else (rebuild_compiler and then target = compiler) ) then already_built.Append (New_Item => newrec); if rec.remote_pkg then fetch_list.Append (New_Item => newrec); end if; end if; else if rec.remote_pkg then -- silently fail, remote packages are a bonus anyway all_ports (target).subpackages.Update_Element (Position => position, Process => kill_remote'Access); else TIO.Put_Line (pkgname & " failed dependency check."); all_ports (target).subpackages.Update_Element (Position => position, Process => set_delete'Access); end if; clean_pass := False; end if; end check_subpackage; begin all_ports (target).subpackages.Iterate (check_subpackage'Access); end check_package; procedure prune_queue (cursor : subqueue.Cursor) is id : constant port_index := subqueue.Element (cursor); begin cascade_successful_build (id); end prune_queue; procedure prune_packages (cursor : ranking_crate.Cursor) is procedure check_subpackage (position : subpackage_crate.Cursor); target : port_id := ranking_crate.Element (cursor).ap_index; procedure check_subpackage (position : subpackage_crate.Cursor) is rec : subpackage_record renames subpackage_crate.Element (position); delete_it : Boolean := rec.deletion_due; begin if delete_it then declare subpackage : constant String := HT.USS (rec.subpackage); pkgname : constant String := calculate_package_name (target, subpackage); fullpath : constant String := repository & "/" & pkgname & arc_ext; begin DIR.Delete_File (fullpath); exception when others => null; end; end if; end check_subpackage; begin all_ports (target).subpackages.Iterate (check_subpackage'Access); end prune_packages; procedure print (cursor : subpackage_queue.Cursor) is id : constant port_index := subpackage_queue.Element (cursor).id; subpkg : constant String := HT.USS (subpackage_queue.Element (cursor).subpackage); pkgfile : constant String := calculate_package_name (id, subpkg) & arc_ext; begin TIO.Put_Line (" => " & pkgfile); if goodlog then TIO.Put_Line (listlog, pkgfile); end if; end print; procedure fetch (cursor : subpackage_queue.Cursor) is id : constant port_index := subpackage_queue.Element (cursor).id; subpkg : constant String := HT.USS (subpackage_queue.Element (cursor).subpackage); pkgbase : constant String := " " & calculate_package_name (id, subpkg); begin HT.SU.Append (package_list, pkgbase); end fetch; procedure check (cursor : subpackage_queue.Cursor) is id : constant port_index := subpackage_queue.Element (cursor).id; subpkg : constant String := HT.USS (subpackage_queue.Element (cursor).subpackage); pkgfile : constant String := calculate_package_name (id, subpkg) & arc_ext; loc : constant String := HT.USS (PM.configuration.dir_repository) & "/" & pkgfile; begin if not DIR.Exists (loc) then TIO.Put_Line ("Download failed: " & pkgfile); fetch_fail := True; end if; end check; procedure determine_fully_built (cursor : subpackage_queue.Cursor) is procedure check_subpackage (cursor : subpackage_crate.Cursor); glass_full : Boolean := True; target : port_id := subpackage_queue.Element (cursor).id; procedure check_subpackage (cursor : subpackage_crate.Cursor) is procedure check_already_built (position : subpackage_queue.Cursor); rec : subpackage_record renames subpackage_crate.Element (cursor); found : Boolean := False; procedure check_already_built (position : subpackage_queue.Cursor) is builtrec : subpackage_identifier renames subpackage_queue.Element (position); begin if not found then if HT.equivalent (builtrec.subpackage, rec.subpackage) then found := True; if rec.deletion_due or else not (rec.pkg_present or else rec.remote_pkg) then glass_full := False; end if; end if; end if; end check_already_built; begin if glass_full then already_built.Iterate (check_already_built'Access); end if; end check_subpackage; begin all_ports (target).subpackages.Iterate (check_subpackage'Access); if glass_full then if not prune_list.Contains (target) then prune_list.Append (target); end if; end if; end determine_fully_built; begin if Unix.env_variable_defined ("WHYFAIL") then activate_debugging_code; end if; establish_package_architecture (major_release, architecture); original_queue_len := rank_queue.Length; for m in scanners'Range loop mq_progress (m) := 0; end loop; LOG.start_obsolete_package_logging; parallel_package_scan (repository, False, using_screen); if Signals.graceful_shutdown_requested then LOG.stop_obsolete_package_logging; return; end if; while not clean_pass loop clean_pass := True; already_built.Clear; rank_queue.Iterate (check_package'Access); end loop; if not suppress_remote and then PM.configuration.defer_prebuilt then -- The defer_prebuilt options has been elected, so check all the -- missing and to-be-pruned ports for suitable prebuilt packages -- So we need to an incremental scan (skip valid, present packages) for m in scanners'Range loop mq_progress (m) := 0; end loop; parallel_package_scan (repository, True, using_screen); if Signals.graceful_shutdown_requested then LOG.stop_obsolete_package_logging; return; end if; clean_pass := False; while not clean_pass loop clean_pass := True; already_built.Clear; fetch_list.Clear; rank_queue.Iterate (check_package'Access); end loop; end if; LOG.stop_obsolete_package_logging; if Signals.graceful_shutdown_requested then return; end if; if dry_run then if not fetch_list.Is_Empty then begin TIO.Create (File => listlog, Mode => TIO.Out_File, Name => filename); goodlog := True; exception when others => goodlog := False; end; TIO.Put_Line ("These are the packages that would be fetched:"); fetch_list.Iterate (print'Access); TIO.Put_Line ("Total packages that would be fetched:" & fetch_list.Length'Img); if goodlog then TIO.Close (listlog); TIO.Put_Line ("The complete build list can also be found at:" & LAT.LF & filename); end if; else if PM.configuration.defer_prebuilt then TIO.Put_Line ("No packages qualify for prefetching from " & "official package repository."); end if; end if; else rank_queue.Iterate (prune_packages'Access); fetch_list.Iterate (fetch'Access); if not HT.equivalent (package_list, HT.blank) then declare cmd : constant String := host_pkg8 & " fetch -r " & HT.USS (external_repository) & " -U -y --output " & HT.USS (PM.configuration.dir_packages) & HT.USS (package_list); begin if Unix.external_command (cmd) then null; end if; end; fetch_list.Iterate (check'Access); end if; end if; if fetch_fail then TIO.Put_Line ("At least one package failed to fetch, aborting build!"); rank_queue.Clear; else -- All subpackages must be "already_built" before we can prune. -- we have iterate through the rank_queue, then subiterate through subpackages. -- If all subpackages are present, add port to prune queue. already_built.Iterate (determine_fully_built'Access); prune_list.Iterate (prune_queue'Access); end if; end limited_sanity_check; -------------------------------------------------------------------------------------------- -- result_of_dependency_query -------------------------------------------------------------------------------------------- function result_of_dependency_query (repository : String; id : port_id; subpackage : String) return HT.Text is rec : port_record renames all_ports (id); pkg_base : constant String := PortScan.calculate_package_name (id, subpackage); fullpath : constant String := repository & "/" & pkg_base & arc_ext; pkg8 : constant String := HT.USS (PM.configuration.sysroot_pkg8); command : constant String := pkg8 & " query -F " & fullpath & " %dn-%dv@%do"; remocmd : constant String := pkg8 & " rquery -r " & HT.USS (external_repository) & " -U %dn-%dv@%do " & pkg_base; status : Integer; comres : HT.Text; begin if repository = "" then comres := Unix.piped_command (remocmd, status); else comres := Unix.piped_command (command, status); end if; if status = 0 then return comres; else return HT.blank; end if; end result_of_dependency_query; -------------------------------------------------------------------------------------------- -- activate_debugging_code -------------------------------------------------------------------------------------------- procedure activate_debugging_code is begin debug_opt_check := True; debug_dep_check := True; end activate_debugging_code; -------------------------------------------------------------------------------------------- -- passed_dependency_check -------------------------------------------------------------------------------------------- function passed_dependency_check (subpackage : String; query_result : HT.Text; id : port_id) return Boolean is procedure get_rundeps (position : subpackage_crate.Cursor); procedure log_run_deps (position : subpackage_crate.Cursor); content : String := HT.USS (query_result); headport : constant String := HT.USS (all_ports (id).port_namebase) & LAT.Colon & subpackage & LAT.Colon & HT.USS (all_ports (id).port_variant); counter : Natural := 0; req_deps : Natural := 0; markers : HT.Line_Markers; pkgfound : Boolean := False; procedure get_rundeps (position : subpackage_crate.Cursor) is rec : subpackage_record renames subpackage_crate.Element (position); begin if not pkgfound then if HT.equivalent (rec.subpackage, subpackage) then req_deps := Natural (rec.spkg_run_deps.Length); pkgfound := True; end if; end if; end get_rundeps; procedure log_run_deps (position : subpackage_crate.Cursor) is procedure logme (logpos : spkg_id_crate.Cursor); rec : subpackage_record renames subpackage_crate.Element (position); procedure logme (logpos : spkg_id_crate.Cursor) is rec2 : PortScan.subpackage_identifier renames spkg_id_crate.Element (logpos); message : constant String := get_port_variant (rec2.port) & " (" & HT.USS (rec2.subpackage) & ")"; begin LOG.obsolete_notice (message, debug_dep_check); end logme; begin if HT.equivalent (rec.subpackage, subpackage) then LOG.obsolete_notice ("Port requirements:", debug_dep_check); rec.spkg_run_deps.Iterate (logme'Access); end if; end log_run_deps; begin all_ports (id).subpackages.Iterate (get_rundeps'Access); HT.initialize_markers (content, markers); loop exit when not HT.next_line_present (content, markers); declare line : constant String := HT.extract_line (content, markers); deppkg : constant String := HT.part_1 (line, "@"); origin : constant String := HT.part_2 (line, "@"); begin exit when line = ""; declare procedure set_available (position : subpackage_crate.Cursor); subpackage : String := subpackage_from_pkgname (deppkg); target_id : port_index := ports_keys.Element (HT.SUS (origin)); target_pkg : String := calculate_package_name (target_id, subpackage); available : Boolean; procedure set_available (position : subpackage_crate.Cursor) is rec : subpackage_record renames subpackage_crate.Element (position); begin if not pkgfound and then HT.equivalent (rec.subpackage, subpackage) then available := (rec.remote_pkg or else rec.pkg_present) and then not rec.deletion_due; pkgfound := True; end if; end set_available; begin if valid_port_id (target_id) then pkgfound := False; all_ports (target_id).subpackages.Iterate (set_available'Access); else -- package seems to have a dependency that has been removed from the conspiracy LOG.obsolete_notice (message => origin & " has been removed from Ravenports", write_to_screen => debug_dep_check); return False; end if; counter := counter + 1; if counter > req_deps then -- package has more dependencies than we are looking for LOG.obsolete_notice (write_to_screen => debug_dep_check, message => headport & " package has more dependencies than the " & "port requires (" & HT.int2str (req_deps) & ")" & LAT.LF & "Query: " & LAT.LF & HT.USS (query_result) & "Tripped on: " & line); all_ports (id).subpackages.Iterate (log_run_deps'Access); return False; end if; if deppkg /= target_pkg then -- The version that the package requires differs from the -- version that Ravenports will now produce declare -- If the target package is GCC7, let version mismatches slide. We are -- probably bootstrapping a new sysroot compiler nbase : constant String := HT.USS (all_ports (target_id).port_namebase); begin if nbase /= default_compiler and then not (nbase = "ravensys-binutils") then LOG.obsolete_notice (write_to_screen => debug_dep_check, message => "Current " & headport & " package depends on " & deppkg & ", but this is a different version than requirement of " & target_pkg & " (from " & origin & ")"); return False; else LOG.obsolete_notice (write_to_screen => debug_dep_check, message => "Ignored dependency check failure: " & "Current " & headport & " package depends on " & deppkg & ", but this is a different version than requirement of " & target_pkg & " (from " & origin & ")"); end if; end; end if; if not available then -- Even if all the versions are matching, we still need -- the package to be in repository. LOG.obsolete_notice (write_to_screen => debug_dep_check, message => headport & " package depends on " & target_pkg & " which doesn't exist or has been scheduled for deletion"); return False; end if; end; end; end loop; if counter < req_deps then -- The ports tree requires more dependencies than the existing package does LOG.obsolete_notice (write_to_screen => debug_dep_check, message => headport & " package has less dependencies than the port " & "requires (" & HT.int2str (req_deps) & ")" & LAT.LF & "Query: " & LAT.LF & HT.USS (query_result)); all_ports (id).subpackages.Iterate (log_run_deps'Access); return False; end if; -- If we get this far, the package dependencies match what the -- port tree requires exactly. This package passed sanity check. return True; exception when issue : others => LOG.obsolete_notice (write_to_screen => debug_dep_check, message => content & "Dependency check exception" & LAT.LF & EX.Exception_Message (issue)); return False; end passed_dependency_check; -------------------------------------------------------------------------------------------- -- package_scan_progress -------------------------------------------------------------------------------------------- function package_scan_progress return String is type percent is delta 0.01 digits 5; complete : port_index := 0; pc : percent; total : constant Float := Float (pkgscan_total); begin for k in scanners'Range loop complete := complete + pkgscan_progress (k); end loop; pc := percent (100.0 * Float (complete) / total); return " progress:" & pc'Img & "% " & LAT.CR; end package_scan_progress; -------------------------------------------------------------------------------------------- -- passed_abi_check -------------------------------------------------------------------------------------------- function passed_abi_check (repository : String; id : port_id; subpackage : String; skip_exist_check : Boolean := False) return Boolean is rec : port_record renames all_ports (id); pkg_base : constant String := PortScan.calculate_package_name (id, subpackage); fullpath : constant String := repository & "/" & pkg_base & arc_ext; pkg8 : constant String := HT.USS (PM.configuration.sysroot_pkg8); command : constant String := pkg8 & " query -F " & fullpath & " %q"; remocmd : constant String := pkg8 & " rquery -r " & HT.USS (external_repository) & " -U %q " & pkg_base; status : Integer; comres : HT.Text; begin if not skip_exist_check and then not DIR.Exists (Name => fullpath) then return False; end if; if repository = "" then comres := Unix.piped_command (remocmd, status); else comres := Unix.piped_command (command, status); end if; if status /= 0 then return False; end if; declare topline : String := HT.first_line (HT.USS (comres)); begin if HT.equivalent (abi_formats.calculated_abi, topline) or else HT.equivalent (abi_formats.calculated_alt_abi, topline) or else HT.equivalent (abi_formats.calc_abi_noarch, topline) or else HT.equivalent (abi_formats.calc_alt_abi_noarch, topline) then return True; end if; end; return False; end passed_abi_check; -------------------------------------------------------------------------------------------- -- passed_option_check -------------------------------------------------------------------------------------------- function passed_option_check (repository : String; id : port_id; subpackage : String; skip_exist_check : Boolean := False) return Boolean is rec : port_record renames all_ports (id); pkg_base : constant String := PortScan.calculate_package_name (id, subpackage); fullpath : constant String := repository & "/" & pkg_base & arc_ext; pkg8 : constant String := HT.USS (PM.configuration.sysroot_pkg8); command : constant String := pkg8 & " query -F " & fullpath & " %Ok:%Ov"; remocmd : constant String := pkg8 & " rquery -r " & HT.USS (external_repository) & " -U %Ok:%Ov " & pkg_base; status : Integer; comres : HT.Text; counter : Natural := 0; required : constant Natural := Natural (all_ports (id).options.Length); extquery : constant Boolean := (repository = ""); begin if id = port_match_failed or else not all_ports (id).scanned or else (not skip_exist_check and then not DIR.Exists (fullpath)) then LOG.obsolete_notice (write_to_screen => debug_opt_check, message => pkg_base & " => passed_option_check() failed sanity check."); return False; end if; if extquery then comres := Unix.piped_command (remocmd, status); else comres := Unix.piped_command (command, status); end if; if status /= 0 then if extquery then LOG.obsolete_notice (write_to_screen => debug_opt_check, message => pkg_base & " => failed to execute: " & remocmd); else LOG.obsolete_notice (write_to_screen => debug_opt_check, message => pkg_base & " => failed to execute: " & command); end if; LOG.obsolete_notice (write_to_screen => debug_opt_check, message => "output => " & HT.USS (comres)); return False; end if; declare command_result : constant String := HT.USS (comres); markers : HT.Line_Markers; begin HT.initialize_markers (command_result, markers); loop exit when not HT.next_line_present (command_result, markers); declare line : constant String := HT.extract_line (command_result, markers); namekey : constant String := HT.part_1 (line, ":"); knob : constant String := HT.part_2 (line, ":"); nametext : HT.Text := HT.SUS (namekey); knobval : Boolean; begin exit when line = ""; if HT.count_char (line, LAT.Colon) /= 1 then raise unknown_format with line; end if; if knob = "on" then knobval := True; elsif knob = "off" then knobval := False; else raise unknown_format with "knob=" & knob & "(" & line & ")"; end if; counter := counter + 1; if counter > required then -- package has more options than we are looking for LOG.obsolete_notice (write_to_screen => debug_opt_check, message => "options " & namekey & LAT.LF & pkg_base & " has more options than required (" & HT.int2str (required) & ")"); return False; end if; if all_ports (id).options.Contains (nametext) then if knobval /= all_ports (id).options.Element (nametext) then -- port option value doesn't match package option value if knobval then LOG.obsolete_notice (write_to_screen => debug_opt_check, message => pkg_base & " " & namekey & " is ON but specifcation says it must be OFF"); else LOG.obsolete_notice (write_to_screen => debug_opt_check, message => pkg_base & " " & namekey & " is OFF but specifcation says it must be ON"); end if; return False; end if; else -- Name of package option not found in port options LOG.obsolete_notice (write_to_screen => debug_opt_check, message => pkg_base & " option " & namekey & " is no longer present in the specification"); return False; end if; end; end loop; if counter < required then -- The ports tree has more options than the existing package LOG.obsolete_notice (write_to_screen => debug_opt_check, message => pkg_base & " has less options than required (" & HT.int2str (required) & ")"); return False; end if; -- If we get this far, the package options must match port options return True; end; exception when issue : others => LOG.obsolete_notice (write_to_screen => debug_opt_check, message => "option check exception" & LAT.LF & EX.Exception_Message (issue)); return False; end passed_option_check; -------------------------------------------------------------------------------------------- -- initial_package_scan -------------------------------------------------------------------------------------------- procedure initial_package_scan (repository : String; id : port_id; subpackage : String) is procedure set_position (position : subpackage_crate.Cursor); procedure set_delete (Element : in out subpackage_record); procedure set_present (Element : in out subpackage_record); procedure set_query (Element : in out subpackage_record); subpackage_position : subpackage_crate.Cursor := subpackage_crate.No_Element; query_result : HT.Text; procedure set_position (position : subpackage_crate.Cursor) is rec : subpackage_record renames subpackage_crate.Element (position); begin if HT.USS (rec.subpackage) = subpackage then subpackage_position := position; end if; end set_position; procedure set_delete (Element : in out subpackage_record) is begin Element.deletion_due := True; end set_delete; procedure set_present (Element : in out subpackage_record) is begin Element.pkg_present := True; end set_present; procedure set_query (Element : in out subpackage_record) is begin Element.pkg_dep_query := query_result; end set_query; use type subpackage_crate.Cursor; begin if id = port_match_failed or else not all_ports (id).scanned then return; end if; all_ports (id).subpackages.Iterate (set_position'Access); if subpackage_position = subpackage_crate.No_Element then return; end if; declare pkgname : constant String := calculate_package_name (id, subpackage); fullpath : constant String := repository & "/" & pkgname & arc_ext; msg_opt : constant String := pkgname & " failed option check."; msg_abi : constant String := pkgname & " failed architecture (ABI) check."; begin if DIR.Exists (fullpath) then all_ports (id).subpackages.Update_Element (subpackage_position, set_present'Access); else return; end if; if not passed_option_check (repository, id, subpackage, True) then LOG.obsolete_notice (msg_opt, True); all_ports (id).subpackages.Update_Element (subpackage_position, set_delete'Access); return; end if; if not passed_abi_check (repository, id, subpackage, True) then LOG.obsolete_notice (msg_abi, True); all_ports (id).subpackages.Update_Element (subpackage_position, set_delete'Access); return; end if; end; query_result := result_of_dependency_query (repository, id, subpackage); all_ports (id).subpackages.Update_Element (subpackage_position, set_query'Access); end initial_package_scan; -------------------------------------------------------------------------------------------- -- remote_package_scan -------------------------------------------------------------------------------------------- procedure remote_package_scan (id : port_id; subpackage : String) is procedure set_position (position : subpackage_crate.Cursor); procedure set_remote_on (Element : in out subpackage_record); procedure set_remote_off (Element : in out subpackage_record); procedure set_query (Element : in out subpackage_record); subpackage_position : subpackage_crate.Cursor := subpackage_crate.No_Element; query_result : HT.Text; procedure set_position (position : subpackage_crate.Cursor) is rec : subpackage_record renames subpackage_crate.Element (position); begin if HT.USS (rec.subpackage) = subpackage then subpackage_position := position; end if; end set_position; procedure set_remote_on (Element : in out subpackage_record) is begin Element.remote_pkg := True; end set_remote_on; procedure set_remote_off (Element : in out subpackage_record) is begin Element.remote_pkg := False; end set_remote_off; procedure set_query (Element : in out subpackage_record) is begin Element.pkg_dep_query := query_result; end set_query; use type subpackage_crate.Cursor; begin all_ports (id).subpackages.Iterate (set_position'Access); if subpackage_position = subpackage_crate.No_Element then return; end if; if passed_abi_check (repository => "", id => id, subpackage => subpackage, skip_exist_check => True) then all_ports (id).subpackages.Update_Element (subpackage_position, set_remote_on'Access); else return; end if; if not passed_option_check (repository => "", id => id, subpackage => subpackage, skip_exist_check => True) then all_ports (id).subpackages.Update_Element (subpackage_position, set_remote_off'Access); return; end if; query_result := result_of_dependency_query ("", id, subpackage); all_ports (id).subpackages.Update_Element (subpackage_position, set_query'Access); end remote_package_scan; -------------------------------------------------------------------------------------------- -- parallel_package_scan -------------------------------------------------------------------------------------------- procedure parallel_package_scan (repository : String; remote_scan : Boolean; show_progress : Boolean) is task type scan (lot : scanners); finished : array (scanners) of Boolean := (others => False); combined_wait : Boolean := True; label_shown : Boolean := False; aborted : Boolean := False; task body scan is procedure populate (cursor : subqueue.Cursor); procedure populate (cursor : subqueue.Cursor) is procedure check_subpackage (position : subpackage_crate.Cursor); target_port : port_index := subqueue.Element (cursor); important : constant Boolean := all_ports (target_port).scanned; procedure check_subpackage (position : subpackage_crate.Cursor) is rec : subpackage_record renames subpackage_crate.Element (position); subpackage : String := HT.USS (rec.subpackage); begin if not aborted and then important then if remote_scan and then not rec.never_remote then if not rec.pkg_present or else rec.deletion_due then remote_package_scan (target_port, subpackage); end if; else initial_package_scan (repository, target_port, subpackage); end if; end if; end check_subpackage; begin all_ports (target_port).subpackages.Iterate (check_subpackage'Access); mq_progress (lot) := mq_progress (lot) + 1; end populate; begin make_queue (lot).Iterate (populate'Access); finished (lot) := True; end scan; scan_01 : scan (lot => 1); scan_02 : scan (lot => 2); scan_03 : scan (lot => 3); scan_04 : scan (lot => 4); scan_05 : scan (lot => 5); scan_06 : scan (lot => 6); scan_07 : scan (lot => 7); scan_08 : scan (lot => 8); scan_09 : scan (lot => 9); scan_10 : scan (lot => 10); scan_11 : scan (lot => 11); scan_12 : scan (lot => 12); scan_13 : scan (lot => 13); scan_14 : scan (lot => 14); scan_15 : scan (lot => 15); scan_16 : scan (lot => 16); scan_17 : scan (lot => 17); scan_18 : scan (lot => 18); scan_19 : scan (lot => 19); scan_20 : scan (lot => 20); scan_21 : scan (lot => 21); scan_22 : scan (lot => 22); scan_23 : scan (lot => 23); scan_24 : scan (lot => 24); scan_25 : scan (lot => 25); scan_26 : scan (lot => 26); scan_27 : scan (lot => 27); scan_28 : scan (lot => 28); scan_29 : scan (lot => 29); scan_30 : scan (lot => 30); scan_31 : scan (lot => 31); scan_32 : scan (lot => 32); -- Expansion of cpu_range from 32 to 64 means 64 possible scanners scan_33 : scan (lot => 33); scan_34 : scan (lot => 34); scan_35 : scan (lot => 35); scan_36 : scan (lot => 36); scan_37 : scan (lot => 37); scan_38 : scan (lot => 38); scan_39 : scan (lot => 39); scan_40 : scan (lot => 40); scan_41 : scan (lot => 41); scan_42 : scan (lot => 42); scan_43 : scan (lot => 43); scan_44 : scan (lot => 44); scan_45 : scan (lot => 45); scan_46 : scan (lot => 46); scan_47 : scan (lot => 47); scan_48 : scan (lot => 48); scan_49 : scan (lot => 49); scan_50 : scan (lot => 50); scan_51 : scan (lot => 51); scan_52 : scan (lot => 52); scan_53 : scan (lot => 53); scan_54 : scan (lot => 54); scan_55 : scan (lot => 55); scan_56 : scan (lot => 56); scan_57 : scan (lot => 57); scan_58 : scan (lot => 58); scan_59 : scan (lot => 59); scan_60 : scan (lot => 60); scan_61 : scan (lot => 61); scan_62 : scan (lot => 62); scan_63 : scan (lot => 63); scan_64 : scan (lot => 64); begin while combined_wait loop delay 1.0; combined_wait := False; for j in scanners'Range loop if not finished (j) then combined_wait := True; exit; end if; end loop; if combined_wait then if not label_shown then label_shown := True; TIO.Put_Line ("Scanning existing packages."); end if; if show_progress then TIO.Put (scan_progress); end if; if Signals.graceful_shutdown_requested then aborted := True; end if; end if; end loop; end parallel_package_scan; -------------------------------------------------------------------------------------------- -- initialize_web_report -------------------------------------------------------------------------------------------- procedure initialize_web_report (num_builders : builders) is idle_slaves : constant dim_builder_state := (others => idle); reportdir : constant String := HT.USS (PM.configuration.dir_logs); sharedir : constant String := host_localbase & "/share/ravenadm"; ravenlogo : constant String := "/raven-project.png"; favicon : constant String := "/favicon.png"; webjs : constant String := "/progress.js"; webcss : constant String := "/progress.css"; begin DIR.Create_Path (reportdir); DIR.Copy_File (sharedir & ravenlogo, reportdir & ravenlogo); DIR.Copy_File (sharedir & favicon, reportdir & favicon); DIR.Copy_File (sharedir & webjs, reportdir & webjs); DIR.Copy_File (sharedir & webcss, reportdir & webcss); DIR.Copy_File (sharedir & "/progress.html", reportdir & "/index.html"); write_summary_json (active => True, states => idle_slaves, num_builders => num_builders, num_history_files => 0); end initialize_web_report; -------------------------------------------------------------------------------------------- -- write_summary_json -------------------------------------------------------------------------------------------- procedure write_summary_json (active : Boolean; states : dim_builder_state; num_builders : builders; num_history_files : Natural) is function TF (value : Boolean) return Natural; jsonfile : TIO.File_Type; filename : constant String := HT.USS (PM.configuration.dir_logs) & "/summary.json"; leftover : constant Integer := LOG.ports_remaining_to_build; slave : DPY.builder_rec; function TF (value : Boolean) return Natural is begin if value then return 1; else return 0; end if; end TF; begin TIO.Create (File => jsonfile, Mode => TIO.Out_File, Name => filename); TIO.Put (jsonfile, "{" & LAT.LF & " " & nv ("profile", HT.USS (PM.configuration.profile)) & LAT.LF); TIO.Put (jsonfile, " ," & nv ("kickoff", LOG.www_timestamp_start_time) & LAT.LF & " ," & nv ("kfiles", num_history_files) & LAT.LF & " ," & nv ("active", TF (active)) & LAT.LF & " ," & LAT.Quotation & "stats" & LAT.Quotation & LAT.Colon & "{" & LAT.LF); TIO.Put (jsonfile, " " & nv ("queued", LOG.port_counter_value (total)) & LAT.LF & " ," & nv ("built", LOG.port_counter_value (success)) & LAT.LF & " ," & nv ("failed", LOG.port_counter_value (failure)) & LAT.LF & " ," & nv ("ignored", LOG.port_counter_value (ignored)) & LAT.LF & " ," & nv ("skipped", LOG.port_counter_value (skipped)) & LAT.LF & " ," & nv ("remains", leftover) & LAT.LF & " ," & nv ("elapsed", LOG.elapsed_now) & LAT.LF & " ," & nv ("pkghour", LOG.hourly_build_rate) & LAT.LF & " ," & nv ("impulse", LOG.impulse_rate) & LAT.LF & " ," & nv ("swapinfo", DPY.fmtpc (get_swap_status, True)) & LAT.LF & " ," & nv ("load", DPY.fmtload (CYC.load_core (True))) & LAT.LF & " }" & LAT.LF & " ," & LAT.Quotation & "builders" & LAT.Quotation & LAT.Colon & "[" & LAT.LF); for b in builders'First .. num_builders loop if states (b) = shutdown then slave := CYC.builder_status (b, True, False); elsif states (b) = idle then slave := CYC.builder_status (b, False, True); else slave := CYC.builder_status (b); end if; if b = builders'First then TIO.Put (jsonfile, " {" & LAT.LF); else TIO.Put (jsonfile, " ,{" & LAT.LF); end if; TIO.Put (jsonfile, " " & nv ("ID", slave.slavid) & LAT.LF & " ," & nv ("elapsed", HT.trim (slave.Elapsed)) & LAT.LF & " ," & nv ("phase", HT.trim (slave.phase)) & LAT.LF & " ," & nv ("origin", HT.trim (slave.origin)) & LAT.LF & " ," & nv ("lines", HT.trim (slave.LLines)) & LAT.LF & " }" & LAT.LF); end loop; TIO.Put (jsonfile, " ]" & LAT.LF & "}" & LAT.LF); TIO.Close (jsonfile); exception when others => if TIO.Is_Open (jsonfile) then TIO.Close (jsonfile); end if; end write_summary_json; -------------------------------------------------------------------------------------------- -- swapinfo_command -------------------------------------------------------------------------------------------- function swapinfo_command return String is begin case platform_type is when dragonfly | freebsd => return "/usr/sbin/swapinfo -k"; when netbsd | openbsd => return "/sbin/swapctl -lk"; when linux => return "/sbin/swapon --bytes --show=NAME,SIZE,USED,PRIO"; when sunos => return "/usr/sbin/swap -l"; when macos => return "/usr/bin/vm_stat"; end case; end swapinfo_command; -------------------------------------------------------------------------------------------- -- get_swap_status -------------------------------------------------------------------------------------------- function get_swap_status return Float is type memtype is mod 2**64; command : String := swapinfo_command; status : Integer; comres : HT.Text; blocks_total : memtype := 0; blocks_used : memtype := 0; begin if platform_type = macos then -- MacOS has no limit, it will keep generating swapfiles as needed, so return 0.0 -- Anything divided by infinity is zero ... return 0.0; end if; comres := Unix.piped_command (command, status); if status /= 0 then return 200.0; -- [ERROR] Signal to set swap display to "N/A" end if; -- Throw first line away, e.g "Device 1K-blocks Used Avail ..." -- Distinguishes platforms though: -- Net/Free/Dragon start with "Device" -- Linux starts with "NAME" -- Solaris starts with "swapfile" -- On FreeBSD (DragonFly too?), when multiple swap used, ignore line starting "Total" declare command_result : String := HT.USS (comres); markers : HT.Line_Markers; line_present : Boolean; oneline_total : memtype; oneline_other : memtype; begin HT.initialize_markers (command_result, markers); -- Throw first line away (valid for all platforms line_present := HT.next_line_present (command_result, markers); if line_present then declare line : String := HT.extract_line (command_result, markers); begin null; end; else return 200.0; -- [ERROR] Signal to set swap display to "N/A" end if; case platform_type is when freebsd | dragonfly | netbsd | openbsd | linux | sunos => -- Normally 1 swap line, but there is no limit loop exit when not HT.next_line_present (command_result, markers); declare line : constant String := HT.strip_excessive_spaces (HT.extract_line (command_result, markers)); begin case platform_type is when freebsd | dragonfly | netbsd | openbsd => if HT.specific_field (line, 1) /= "Total" then blocks_total := blocks_total + memtype'Value (HT.specific_field (line, 2)); blocks_used := blocks_used + memtype'Value (HT.specific_field (line, 3)); end if; when sunos => oneline_total := memtype'Value (HT.specific_field (line, 4)); oneline_other := memtype'Value (HT.specific_field (line, 5)); blocks_total := blocks_total + oneline_total; blocks_used := blocks_used + (oneline_total - oneline_other); when linux => blocks_total := blocks_total + memtype'Value (HT.specific_field (line, 2)); blocks_used := blocks_used + memtype'Value (HT.specific_field (line, 3)); when macos => null; end case; exception when Constraint_Error => return 200.0; -- [ERROR] Signal to set swap display to "N/A" end; end loop; when macos => null; end case; end; if blocks_total = 0 then return 200.0; -- Signal to set swap display to "N/A" else return 100.0 * Float (blocks_used) / Float (blocks_total); end if; end get_swap_status; -------------------------------------------------------------------------------------------- -- initialize_display -------------------------------------------------------------------------------------------- procedure initialize_display (num_builders : builders) is begin if PM.configuration.avec_ncurses then curses_support := DPC.launch_monitor (num_builders); end if; end initialize_display; -------------------------------------------------------------------------------------------- -- nothing_left -------------------------------------------------------------------------------------------- function nothing_left (num_builders : builders) return Boolean is list_len : constant Integer := Integer (rank_queue.Length); begin return list_len = 0; end nothing_left; -------------------------------------------------------------------------------------------- -- shutdown_recommended -------------------------------------------------------------------------------------------- function shutdown_recommended (active_builders : Positive) return Boolean is list_len : constant Natural := Integer (rank_queue.Length); list_max : constant Positive := 2 * active_builders; num_wait : Natural := 0; cursor : ranking_crate.Cursor; QR : queue_record; begin if list_len = 0 or else list_len >= list_max then return False; end if; cursor := rank_queue.First; for k in 1 .. list_len loop QR := ranking_crate.Element (Position => cursor); if not all_ports (QR.ap_index).work_locked then num_wait := num_wait + 1; if num_wait >= active_builders then return False; end if; end if; cursor := ranking_crate.Next (Position => cursor); end loop; return True; end shutdown_recommended; -------------------------------------------------------------------------------------------- -- lock_package -------------------------------------------------------------------------------------------- procedure lock_package (id : port_id) is begin if id /= port_match_failed then all_ports (id).work_locked := True; end if; end lock_package; -------------------------------------------------------------------------------------------- -- top_buildable_port -------------------------------------------------------------------------------------------- function top_buildable_port return port_id is list_len : constant Integer := Integer (rank_queue.Length); cursor : ranking_crate.Cursor; QR : queue_record; result : port_id := port_match_failed; begin if list_len = 0 then return result; end if; cursor := rank_queue.First; for k in 1 .. list_len loop QR := ranking_crate.Element (Position => cursor); if not all_ports (QR.ap_index).work_locked and then all_ports (QR.ap_index).blocked_by.Is_Empty then result := QR.ap_index; exit; end if; cursor := ranking_crate.Next (Position => cursor); end loop; if Signals.graceful_shutdown_requested then return port_match_failed; end if; return result; end top_buildable_port; -------------------------------------------------------------------------------------------- -- parse_and_transform_buildsheet -------------------------------------------------------------------------------------------- procedure parse_and_transform_buildsheet (specification : in out Port_Specification.Portspecs; successful : out Boolean; buildsheet : String; variant : String; portloc : String; excl_targets : Boolean; avoid_dialog : Boolean; for_webpage : Boolean; sysrootver : sysroot_characteristics) is function read_option_file return Boolean; function launch_and_read (optfile, cookie : String) return Boolean; makefile : String := portloc & "/Makefile"; dir_opt : constant String := HT.USS (PM.configuration.dir_options); function read_option_file return Boolean is result : Boolean := True; required : Natural := specification.get_list_length (Port_Specification.sp_opts_standard); begin IFM.scan_file (directory => dir_opt, filename => specification.get_namebase); declare list : constant String := IFM.show_value (section => "parameters", name => "available"); num_opt : Natural := HT.count_char (list, LAT.Comma) + 1; begin if num_opt /= required then result := False; end if; for item in 1 .. num_opt loop declare setting : Boolean; good : Boolean := True; nv_name : String := HT.specific_field (list, item, ","); nv_value : String := IFM.show_value ("options", nv_name); begin if nv_value = "true" then setting := True; elsif nv_value = "false" then setting := False; else good := False; result := False; end if; if good then if specification.option_exists (nv_name) then PST.define_option_setting (specification, nv_name, setting); else result := False; end if; end if; end; end loop; end; return result; exception when others => return False; end read_option_file; function launch_and_read (optfile, cookie : String) return Boolean is begin PST.set_option_to_default_values (specification); if not avoid_dialog then if not DLG.launch_dialog (specification) then return False; end if; if DIR.Exists (cookie) then -- We keep the already-set standard option settings return True; end if; if not DIR.Exists (optfile) then TIO.Put_Line ("Saved option file and cookie missing after dialog executed. bug?"); return False; end if; if not read_option_file then TIO.Put_Line ("Saved option file invalid after dialog executed. bug?"); return False; end if; end if; return True; end launch_and_read; begin PAR.parse_specification_file (dossier => buildsheet, spec => specification, opsys_focus => platform_type, arch_focus => sysrootver.arch, success => successful, stop_at_targets => excl_targets, extraction_dir => portloc); if not successful then TIO.Put_Line ("Failed to parse " & buildsheet); TIO.Put_Line (specification.get_parse_error); return; end if; if not specification.variant_exists (variant) then TIO.Put_Line ("The specified variant '" & variant & "' is invalid."); TIO.Put_Line ("Try again with a valid variant"); successful := False; return; end if; PST.set_option_defaults (specs => specification, variant => variant, opsys => platform_type, arch_standard => sysrootver.arch, osrelease => HT.USS (sysrootver.release)); -- If no available options, skip (remember, if variants there are ALWAYS options -- otherwise -- if batch mode, ignore cookies. if no option file, use default values. -- if not batch mode: -- If option file, use it. -- if no option file: if cookie exists, used default values, otherwise show dialog declare optfile : constant String := dir_opt & "/" & specification.get_namebase; cookie : constant String := dir_opt & "/defconf_cookies/" & specification.get_namebase; begin if variant = variant_standard then if specification.standard_options_present then -- This port has at least one user-definable option if PM.configuration.batch_mode then -- In batch mode, option settings are optional. Use default values if not set if DIR.Exists (optfile) then if not read_option_file then TIO.Put_Line ("BATCH MODE ERROR: Invalid option configuration of " & specification.get_namebase & ":standard port"); TIO.Put_Line ("Run ravenadm set-options " & specification.get_namebase & " to rectify the issue"); TIO.Put_Line ("Alternatively, set configuration option '[Q] Assume " & "default options' to False"); successful := False; return; end if; else PST.set_option_to_default_values (specification); end if; else if DIR.Exists (optfile) then if not read_option_file then if not launch_and_read (optfile, cookie) then successful := False; return; end if; end if; else if DIR.Exists (cookie) then PST.set_option_to_default_values (specification); else if not launch_and_read (optfile, cookie) then successful := False; return; end if; end if; end if; end if; end if; else -- All defined options are dedicated to variant definition (nothing to configure) PST.set_option_to_default_values (specification); end if; end; if for_webpage then specification.do_not_apply_opsys_dependencies; end if; PST.apply_directives (specs => specification, variant => variant, arch_standard => sysrootver.arch, osmajor => HT.USS (sysrootver.major)); PST.set_outstanding_ignore (specs => specification, variant => variant, opsys => platform_type, arch_standard => sysrootver.arch, osrelease => HT.USS (sysrootver.release), osmajor => HT.USS (sysrootver.major)); if portloc /= "" then PST.shift_extra_patches (specs => specification, extract_dir => portloc); PSM.generator (specs => specification, variant => variant, opsys => platform_type, arch => sysrootver.arch, output_file => makefile); end if; end parse_and_transform_buildsheet; -------------------------------------------------------------------------------------------- -- build_subpackages -------------------------------------------------------------------------------------------- function build_subpackages (builder : builders; sequence_id : port_id; sysrootver : sysroot_characteristics; interactive : Boolean := False; enterafter : String := "") return Boolean is function get_buildsheet return String; namebase : String := HT.USS (all_ports (sequence_id).port_namebase); variant : String := HT.USS (all_ports (sequence_id).port_variant); bucket : String := all_ports (sequence_id).bucket; portloc : String := HT.USS (PM.configuration.dir_buildbase) & "/" & REP.slave_name (builder) & "/port"; function get_buildsheet return String is buckname : constant String := "/bucket_" & bucket & "/" & namebase; begin if all_ports (sequence_id).unkind_custom then return HT.USS (PM.configuration.dir_profile) & "/unkindness" & buckname; else return HT.USS (PM.configuration.dir_conspiracy) & buckname; end if; end get_buildsheet; buildsheet : constant String := get_buildsheet; specification : Port_Specification.Portspecs; successful : Boolean; begin parse_and_transform_buildsheet (specification => specification, successful => successful, buildsheet => buildsheet, variant => variant, portloc => portloc, excl_targets => False, avoid_dialog => True, for_webpage => False, sysrootver => sysrootver); if not successful then return False; end if; return CYC.build_package (id => builder, specification => specification, sequence_id => sequence_id, interactive => interactive, interphase => enterafter); end build_subpackages; -------------------------------------------------------------------------------------------- -- eliminate_obsolete_packages -------------------------------------------------------------------------------------------- procedure eliminate_obsolete_packages is procedure search (position : subpackage_crate.Cursor); procedure kill (position : string_crate.Cursor); id : port_index; counter : Natural := 0; repo : constant String := HT.USS (PM.configuration.dir_repository) & "/"; procedure search (position : subpackage_crate.Cursor) is rec : subpackage_record renames subpackage_crate.Element (position); subpackage : constant String := HT.USS (rec.subpackage); package_name : HT.Text := HT.SUS (calculate_package_name (id, subpackage) & arc_ext); begin if package_list.Contains (package_name) then package_list.Delete (package_list.Find_Index (package_name)); end if; end search; procedure kill (position : string_crate.Cursor) is package_name : constant String := HT.USS (string_crate.Element (position)); begin DIR.Delete_File (repo & package_name); counter := counter + 1; exception when others => TIO.Put (LAT.LF & "Failed to remove " & package_name); end kill; begin for index in port_index'First .. last_port loop id := index; all_ports (index).subpackages.Iterate (search'Access); end loop; TIO.Put ("Removing obsolete packages ... "); package_list.Iterate (kill'Access); TIO.Put_Line ("done! (packages deleted: " & HT.int2str (counter) & ")"); end eliminate_obsolete_packages; end PortScan.Operations;
41.646532
99
0.507631
9abaea2896c68a74c9c829d3cbc7a0c09c322df2
363
ads
Ada
source/hash/a-sgugha.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
33
2015-04-04T09:19:36.000Z
2021-11-10T05:33:34.000Z
source/hash/a-sgugha.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
8
2017-11-14T13:05:07.000Z
2018-08-09T15:28:49.000Z
source/hash/a-sgugha.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
9
2015-02-03T17:09:53.000Z
2021-11-12T01:16:05.000Z
pragma License (Unrestricted); -- generalized unit of Ada.Strings.Unbounded.Hash with Ada.Containers; generic with function Fixed_Hash (Key : String_Type) return Containers.Hash_Type; function Ada.Strings.Generic_Unbounded.Generic_Hash (Key : Unbounded_String) return Containers.Hash_Type; pragma Preelaborate (Ada.Strings.Generic_Unbounded.Generic_Hash);
40.333333
76
0.820937
1a7aba55531161105d06c8027cd439bce89753d3
8,107
ads
Ada
gcc-gcc-7_3_0-release/gcc/ada/s-excmac-gcc.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/ada/s-excmac-gcc.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/s-excmac-gcc.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . E X C E P T I O N S . M A C H I N E -- -- -- -- S p e c -- -- -- -- Copyright (C) 2013-2014, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Declaration of the machine exception and some associated facilities. The -- machine exception is the object that is propagated by low level routines -- and that contains the Ada exception occurrence. -- This is the version using the GCC EH mechanism with Ada.Unchecked_Conversion; with Ada.Exceptions; package System.Exceptions.Machine is pragma Preelaborate; ------------------------------------------------ -- Entities to interface with the GCC runtime -- ------------------------------------------------ -- These come from "C++ ABI for Itanium: Exception handling", which is -- the reference for GCC. -- Return codes from the GCC runtime functions used to propagate -- an exception. type Unwind_Reason_Code is (URC_NO_REASON, URC_FOREIGN_EXCEPTION_CAUGHT, URC_PHASE2_ERROR, URC_PHASE1_ERROR, URC_NORMAL_STOP, URC_END_OF_STACK, URC_HANDLER_FOUND, URC_INSTALL_CONTEXT, URC_CONTINUE_UNWIND); pragma Unreferenced (URC_NO_REASON, URC_FOREIGN_EXCEPTION_CAUGHT, URC_PHASE2_ERROR, URC_PHASE1_ERROR, URC_NORMAL_STOP, URC_END_OF_STACK, URC_HANDLER_FOUND, URC_INSTALL_CONTEXT, URC_CONTINUE_UNWIND); pragma Convention (C, Unwind_Reason_Code); -- Phase identifiers type Unwind_Action is new Integer; pragma Convention (C, Unwind_Action); UA_SEARCH_PHASE : constant Unwind_Action := 1; UA_CLEANUP_PHASE : constant Unwind_Action := 2; UA_HANDLER_FRAME : constant Unwind_Action := 4; UA_FORCE_UNWIND : constant Unwind_Action := 8; UA_END_OF_STACK : constant Unwind_Action := 16; -- GCC extension pragma Unreferenced (UA_SEARCH_PHASE, UA_CLEANUP_PHASE, UA_HANDLER_FRAME, UA_FORCE_UNWIND, UA_END_OF_STACK); -- Mandatory common header for any exception object handled by the -- GCC unwinding runtime. type Exception_Class is mod 2 ** 64; GNAT_Exception_Class : constant Exception_Class := 16#474e552d41646100#; -- "GNU-Ada\0" type Unwind_Word is mod 2 ** System.Word_Size; for Unwind_Word'Size use System.Word_Size; -- Map the corresponding C type used in Unwind_Exception below type Unwind_Exception is record Class : Exception_Class; Cleanup : System.Address; Private1 : Unwind_Word; Private2 : Unwind_Word; -- Usual exception structure has only two private fields, but the SEH -- one has six. To avoid making this file more complex, we use six -- fields on all platforms, wasting a few bytes on some. Private3 : Unwind_Word; Private4 : Unwind_Word; Private5 : Unwind_Word; Private6 : Unwind_Word; end record; pragma Convention (C, Unwind_Exception); -- Map the GCC struct used for exception handling for Unwind_Exception'Alignment use Standard'Maximum_Alignment; -- The C++ ABI mandates the common exception header to be at least -- doubleword aligned, and the libGCC implementation actually makes it -- maximally aligned (see unwind.h). See additional comments on the -- alignment below. -- There is a subtle issue with the common header alignment, since the C -- version is aligned on BIGGEST_ALIGNMENT, the Ada version is aligned on -- Standard'Maximum_Alignment, and those two values don't quite represent -- the same concepts and so may be decoupled someday. One typical reason -- is that BIGGEST_ALIGNMENT may be larger than what the underlying system -- allocator guarantees, and there are extra costs involved in allocating -- objects aligned to such factors. -- To deal with the potential alignment differences between the C and Ada -- representations, the Ada part of the whole structure is only accessed -- by the personality routine through accessors. Ada specific fields are -- thus always accessed through consistent layout, and we expect the -- actual alignment to always be large enough to avoid traps from the C -- accesses to the common header. Besides, accessors alleviate the need -- for a C struct whole counterpart, both painful and error-prone to -- maintain anyway. type GCC_Exception_Access is access all Unwind_Exception; -- Pointer to a GCC exception procedure Unwind_DeleteException (Excp : not null GCC_Exception_Access); pragma Import (C, Unwind_DeleteException, "_Unwind_DeleteException"); -- Procedure to free any GCC exception -------------------------------------------------------------- -- GNAT Specific Entities To Deal With The GCC EH Circuitry -- -------------------------------------------------------------- -- A GNAT exception object to be dealt with by the personality routine -- called by the GCC unwinding runtime. type GNAT_GCC_Exception is record Header : Unwind_Exception; -- ABI Exception header first Occurrence : aliased Ada.Exceptions.Exception_Occurrence; -- The Ada occurrence end record; pragma Convention (C, GNAT_GCC_Exception); type GNAT_GCC_Exception_Access is access all GNAT_GCC_Exception; function To_GCC_Exception is new Ada.Unchecked_Conversion (System.Address, GCC_Exception_Access); function To_GNAT_GCC_Exception is new Ada.Unchecked_Conversion (GCC_Exception_Access, GNAT_GCC_Exception_Access); function New_Occurrence return GNAT_GCC_Exception_Access is (new GNAT_GCC_Exception' (Header => (Class => GNAT_Exception_Class, Cleanup => Null_Address, others => 0), Occurrence => <>)); -- Allocate and initialize a machine occurrence end System.Exceptions.Machine;
42.445026
78
0.594301
4b0bb7c27aa1bd2ca6be21684046784ac9ad0426
5,364
ads
Ada
source/iconv-streams.ads
ytomino/iconv-ada
b1adc342a41887fae20b5bc1f1f3d08a5218a346
[ "Unlicense" ]
null
null
null
source/iconv-streams.ads
ytomino/iconv-ada
b1adc342a41887fae20b5bc1f1f3d08a5218a346
[ "Unlicense" ]
null
null
null
source/iconv-streams.ads
ytomino/iconv-ada
b1adc342a41887fae20b5bc1f1f3d08a5218a346
[ "Unlicense" ]
null
null
null
with Ada.Streams; package iconv.Streams is pragma Preelaborate; -- only reading type In_Type is limited private; -- subtype Open_In_Type is In_Type -- with -- Dynamic_Predicate => Is_Open (Open_In_Type), -- Predicate_Failure => raise Status_Error; -- management function Open ( Decoder : in out Converter; -- neither access nor aliased for derived types Stream : not null access Ada.Streams.Root_Stream_Type'Class) return In_Type; function Is_Open (Object : In_Type) return Boolean; pragma Inline (Is_Open); -- stream access function Stream ( Object : aliased in out In_Type) -- Open_In_Type return not null access Ada.Streams.Root_Stream_Type'Class; -- only writing type Out_Type is limited private; -- subtype Open_Out_Type is In_Type -- with -- Dynamic_Predicate => Is_Open (Open_Out_Type), -- Predicate_Failure => raise Status_Error; -- management function Open ( Encoder : in out Converter; -- same as above Stream : not null access Ada.Streams.Root_Stream_Type'Class) return Out_Type; function Is_Open (Object : Out_Type) return Boolean; pragma Inline (Is_Open); -- stream access function Stream ( Object : aliased in out Out_Type) -- Open_Out_Type return not null access Ada.Streams.Root_Stream_Type'Class; -- finish writing procedure Finish ( Object : in out Out_Type); -- Open_Out_Type -- bidirectional type Inout_Type is limited private; -- subtype Open_Inout_Type is In_Type -- with -- Dynamic_Predicate => Is_Open (Open_Inout_Type), -- Predicate_Failure => raise Status_Error; -- management function Open ( Internal : not null access constant String; External : not null access constant String; Stream : not null access Ada.Streams.Root_Stream_Type'Class) return Inout_Type; function Is_Open (Object : Inout_Type) return Boolean; pragma Inline (Is_Open); -- substitute (encoded as internal) function Substitute ( Object : Inout_Type) -- Open_Inout_Type return Ada.Streams.Stream_Element_Array; procedure Set_Substitute ( Object : in out Inout_Type; -- Open_Inout_Type Substitute : in Ada.Streams.Stream_Element_Array); -- stream access function Stream ( Object : aliased in out Inout_Type) -- Open_Inout_Type return not null access Ada.Streams.Root_Stream_Type'Class; -- finish writing procedure Finish ( Object : in out Inout_Type); -- Open_Inout_Type -- exceptions Mode_Error : exception renames Ada.IO_Exceptions.Mode_Error; End_Error : exception renames Ada.IO_Exceptions.End_Error; private use type Ada.Streams.Stream_Element_Offset; Half_Buffer_Length : constant := 64; subtype Buffer_Type is Ada.Streams.Stream_Element_Array (0 .. 2 * Half_Buffer_Length - 1); type Reading_Status_Type is (Continuing, Finishing, Ended); pragma Discard_Names (Reading_Status_Type); type Reading_Context_Type is record Buffer : Buffer_Type; First : Ada.Streams.Stream_Element_Offset; Last : Ada.Streams.Stream_Element_Offset; Converted_Buffer : Buffer_Type; Converted_First : Ada.Streams.Stream_Element_Offset; Converted_Last : Ada.Streams.Stream_Element_Offset; Status : Reading_Status_Type; end record; pragma Suppress_Initialization (Reading_Context_Type); type Writing_Context_Type is record Buffer : Buffer_Type; First : Ada.Streams.Stream_Element_Offset; Last : Ada.Streams.Stream_Element_Offset; end record; pragma Suppress_Initialization (Writing_Context_Type); -- only reading type In_Type is limited new Ada.Streams.Root_Stream_Type with record Stream : access Ada.Streams.Root_Stream_Type'Class; Reading_Converter : access Converter; Reading_Context : Reading_Context_Type; end record; overriding procedure Read ( Object : in out In_Type; Item : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset); overriding procedure Write ( Object : in out In_Type; Item : in Ada.Streams.Stream_Element_Array); -- only writing type Out_Type is limited new Ada.Streams.Root_Stream_Type with record Stream : access Ada.Streams.Root_Stream_Type'Class; Writing_Converter : access Converter; Writing_Context : Writing_Context_Type; end record; overriding procedure Read ( Object : in out Out_Type; Item : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset); overriding procedure Write ( Object : in out Out_Type; Item : in Ada.Streams.Stream_Element_Array); -- bidirectional type Inout_Type is limited new Ada.Streams.Root_Stream_Type with record Internal : access constant String; External : access constant String; Stream : access Ada.Streams.Root_Stream_Type'Class; -- substitute (encoded as internal) Substitute_Length : Ada.Streams.Stream_Element_Offset; Substitute : Ada.Streams.Stream_Element_Array (1 .. Max_Substitute_Length); -- reading Reading_Converter : Converter; Reading_Context : Reading_Context_Type; -- writing Writing_Converter : Converter; Writing_Context : Writing_Context_Type; end record; overriding procedure Read ( Object : in out Inout_Type; Item : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset); overriding procedure Write ( Object : in out Inout_Type; Item : in Ada.Streams.Stream_Element_Array); end iconv.Streams;
27.9375
78
0.756339
13a23a8c5ccccb8a48a47ad43574b9df2c47cd7a
8,212
adb
Ada
tools/akt-commands-edit.adb
My-Colaborations/ada-keystore
6ab222c2df81f32309c5a7b4f94a475214ef5ce3
[ "Apache-2.0" ]
null
null
null
tools/akt-commands-edit.adb
My-Colaborations/ada-keystore
6ab222c2df81f32309c5a7b4f94a475214ef5ce3
[ "Apache-2.0" ]
null
null
null
tools/akt-commands-edit.adb
My-Colaborations/ada-keystore
6ab222c2df81f32309c5a7b4f94a475214ef5ce3
[ "Apache-2.0" ]
null
null
null
----------------------------------------------------------------------- -- akt-commands-edit -- Edit content in keystore -- Copyright (C) 2019 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Directories; with Ada.Environment_Variables; with Ada.Command_Line; with Interfaces.C.Strings; with Util.Files; with Util.Processes; with Util.Systems.Os; with Util.Systems.Types; with Util.Streams.Raw; with Keystore.Random; package body AKT.Commands.Edit is use GNAT.Strings; procedure Export_Value (Context : in out Context_Type; Name : in String; Path : in String); procedure Import_Value (Context : in out Context_Type; Name : in String; Path : in String); procedure Make_Directory (Path : in String); -- ------------------------------ -- Export the named value from the wallet to the external file. -- The file is created and given read-write access to the current user only. -- ------------------------------ procedure Export_Value (Context : in out Context_Type; Name : in String; Path : in String) is use Util.Systems.Os; use type Interfaces.C.int; use type Util.Systems.Types.File_Type; Fd : Util.Systems.Os.File_Type; File : Util.Streams.Raw.Raw_Stream; P : Interfaces.C.Strings.chars_ptr := Interfaces.C.Strings.New_String (Path); begin Fd := Util.Systems.Os.Sys_Open (Path => P, Flags => O_CREAT + O_WRONLY + O_TRUNC, Mode => 8#600#); Interfaces.C.Strings.Free (P); if Fd < 0 then AKT.Commands.Log.Error (-("Cannot create file for the editor")); raise Error; end if; File.Initialize (Fd); if Context.Wallet.Contains (Name) then Context.Wallet.Get (Name, File); end if; end Export_Value; procedure Import_Value (Context : in out Context_Type; Name : in String; Path : in String) is use Util.Systems.Os; use type Util.Systems.Types.File_Type; Fd : Util.Systems.Os.File_Type; File : Util.Streams.Raw.Raw_Stream; P : Interfaces.C.Strings.chars_ptr := Interfaces.C.Strings.New_String (Path); begin Fd := Util.Systems.Os.Sys_Open (Path => P, Flags => O_RDONLY, Mode => 0); Interfaces.C.Strings.Free (P); if Fd < 0 then AKT.Commands.Log.Error (-("Cannot read the editor's output")); raise Error; end if; File.Initialize (Fd); Context.Wallet.Set (Name, Keystore.T_STRING, File); end Import_Value; -- ------------------------------ -- Get the editor command to launch. -- ------------------------------ function Get_Editor (Command : in Command_Type) return String is begin if Command.Editor /= null and then Command.Editor'Length > 0 then return Command.Editor.all; end if; -- Use the $EDITOR if the environment variable defines it. if Ada.Environment_Variables.Exists ("EDITOR") then return Ada.Environment_Variables.Value ("EDITOR"); end if; -- Use the editor which links to the default system-wide editor -- that can be configured on Ubuntu through /etc/alternatives. return "editor"; end Get_Editor; -- ------------------------------ -- Get the directory where the editor's file can be created. -- ------------------------------ function Get_Directory (Command : in Command_Type; Context : in out Context_Type) return String is pragma Unreferenced (Command, Context); Rand : Keystore.Random.Generator; Name : constant String := "akt-" & Rand.Generate (Bits => 32); begin return "/tmp/" & Name; end Get_Directory; procedure Make_Directory (Path : in String) is P : Interfaces.C.Strings.chars_ptr; Result : Integer; begin Ada.Directories.Create_Path (Path); P := Interfaces.C.Strings.New_String (Path); Result := Util.Systems.Os.Sys_Chmod (P, 8#0700#); Interfaces.C.Strings.Free (P); if Result /= 0 then AKT.Commands.Log.Error (-("Cannot set the permission of {0}"), Path); raise Error; end if; end Make_Directory; -- ------------------------------ -- Edit a value from the keystore by using an external editor. -- ------------------------------ overriding procedure Execute (Command : in out Command_Type; Name : in String; Args : in Argument_List'Class; Context : in out Context_Type) is begin Context.Open_Keystore (Args); if Args.Get_Count /= Context.First_Arg then AKT.Commands.Usage (Args, Context, Name); else declare Dir : constant String := Command.Get_Directory (Context); Path : constant String := Util.Files.Compose (Dir, "VALUE.txt"); Editor : constant String := Command.Get_Editor; Proc : Util.Processes.Process; procedure Cleanup; procedure Cleanup is begin if Ada.Directories.Exists (Path) then Ada.Directories.Delete_File (Path); end if; if Ada.Directories.Exists (Dir) then Ada.Directories.Delete_Tree (Dir); end if; end Cleanup; begin Make_Directory (Dir); Export_Value (Context, Args.Get_Argument (Context.First_Arg), Path); Util.Processes.Spawn (Proc, Editor & " " & Path); Util.Processes.Wait (Proc); if Util.Processes.Get_Exit_Status (Proc) /= 0 then AKT.Commands.Log.Error (-("Editor exited with status{0}"), Natural'Image (Util.Processes.Get_Exit_Status (Proc))); Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure); else Import_Value (Context, Args.Get_Argument (Context.First_Arg), Path); end if; Cleanup; exception when Util.Processes.Process_Error => AKT.Commands.Log.Error (-("Cannot execute editor '{0}'"), Editor); Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure); Cleanup; when others => Cleanup; raise; end; end if; end Execute; -- ------------------------------ -- Setup the command before parsing the arguments and executing it. -- ------------------------------ procedure Setup (Command : in out Command_Type; Config : in out GNAT.Command_Line.Command_Line_Configuration; Context : in out Context_Type) is package GC renames GNAT.Command_Line; begin Drivers.Command_Type (Command).Setup (Config, Context); GC.Define_Switch (Config => Config, Output => Command.Editor'Access, Switch => "-e:", Long_Switch => "--editor=", Argument => "EDITOR", Help => -("Define the editor command to use")); end Setup; end AKT.Commands.Edit;
37.843318
94
0.549318
9a0ba3113ecb229f0ac0521c70b21979a30f5b0b
33
ads
Ada
regression/symtab2gb/multiple_symtabs/library.ads
gsingh93/cbmc
f81c8c0c744b1c422fe9b4278764a22f8727724e
[ "BSD-4-Clause" ]
412
2016-04-02T01:14:27.000Z
2022-03-27T09:24:09.000Z
regression/symtab2gb/multiple_symtabs/library.ads
gsingh93/cbmc
f81c8c0c744b1c422fe9b4278764a22f8727724e
[ "BSD-4-Clause" ]
4,671
2016-02-25T13:52:16.000Z
2022-03-31T22:14:46.000Z
regression/symtab2gb/multiple_symtabs/library.ads
gsingh93/cbmc
f81c8c0c744b1c422fe9b4278764a22f8727724e
[ "BSD-4-Clause" ]
266
2016-02-23T12:48:00.000Z
2022-03-22T18:15:51.000Z
procedure Library (X : Integer);
16.5
32
0.727273
0b6d2846d04119da519364857876e5b8318a14de
344
ads
Ada
day16/opcode_helper.ads
thorstel/Advent-of-Code-2018
d67cb7ffeac9e68560af34ca1bc29928bad1d3b9
[ "BSD-3-Clause" ]
2
2019-09-15T04:52:09.000Z
2020-11-17T16:46:46.000Z
day16/opcode_helper.ads
thorstel/Advent-of-Code-2018
d67cb7ffeac9e68560af34ca1bc29928bad1d3b9
[ "BSD-3-Clause" ]
null
null
null
day16/opcode_helper.ads
thorstel/Advent-of-Code-2018
d67cb7ffeac9e68560af34ca1bc29928bad1d3b9
[ "BSD-3-Clause" ]
null
null
null
with Interfaces; use Interfaces; generic Register_Size : Natural := 4; package Opcode_Helper is type Registers is array (Natural range 0 .. Register_Size - 1) of Unsigned_64; function Execute_Instruction (Op : String; Reg : Registers; A, B, C : Unsigned_64) return Registers; end Opcode_Helper;
20.235294
65
0.665698
1325d114df3c4ee223b8318dd0b52bf8373d8d45
8,452
ads
Ada
src/numerics-sparse_matrices.ads
sciencylab/lagrangian-solver
0f77265c1105658a27a9fa316bf5f046ac233774
[ "MIT" ]
null
null
null
src/numerics-sparse_matrices.ads
sciencylab/lagrangian-solver
0f77265c1105658a27a9fa316bf5f046ac233774
[ "MIT" ]
null
null
null
src/numerics-sparse_matrices.ads
sciencylab/lagrangian-solver
0f77265c1105658a27a9fa316bf5f046ac233774
[ "MIT" ]
null
null
null
with Numerics; use Numerics; package Numerics.Sparse_Matrices is -------- Define Enumeration types -------------------------------- type Permute_By_Type is (Row, Column); type Sparse_Matrix_Format is (CSR, CSC, Triplet); package Sparse_Matrix_Format_IO is new Ada.Text_IO.Enumeration_IO (Sparse_Matrix_Format); ------- Define Matrix -------------------------------------------- type Sparse_Matrix is private; --- Print procedure ---------------------------------------------- procedure Print (Mat : in Sparse_Matrix); ------- Basic Getter Functions ----------------------------------- function Norm2 (Item : in Sparse_Matrix) return Real; function N_Row (Mat : in Sparse_Matrix) return Pos; function N_Col (Mat : in Sparse_Matrix) return Pos; function Number_Of_Elements (X : in Sparse_Matrix) return Integer; ------- Functions for Creating Sparse Matrices ------------------- function Add_Column (X : in Sparse_Matrix; V : in Sparse_Vector) return Sparse_Matrix; function As_Matrix (X : in Sparse_Vector) return Sparse_Matrix; function "and" (A, B : in Sparse_Vector) return Sparse_Matrix is (Add_Column (As_Matrix (A), B)); function "and" (X : in Sparse_Matrix; V : in Sparse_Vector) return Sparse_Matrix renames Add_Column; procedure Set_Diag (X : in out Sparse_Matrix; To : in Sparse_Vector) with Pre => Is_Square_Matrix (X) and N_Col (X) = Length (To); function Diag (X : in Sparse_Matrix) return Sparse_Vector with Pre => Is_Square_Matrix (X); function Diag (X : in Sparse_Vector) return Sparse_Matrix; function Sparse (X : in Real_Matrix; Tol : in Real := 10.0 * Real'Small) return Sparse_Matrix; function Triplet_To_Matrix (I : in Int_Array; J : in Int_Array; X : in Real_Vector; N_Row : in Pos := 0; N_Col : in Pos := 0; Format : in Sparse_Matrix_Format := CSC) return Sparse_Matrix with Pre => I'Length = J'Length and I'Length = X'Length; function Convert (Mat : in Sparse_Matrix) return Sparse_Matrix; procedure Add (Mat : in out Sparse_Matrix; I, J : in Nat; X : in Real) with Pre => I <= N_Row (Mat) and J <= N_Col (Mat); procedure Set (Mat : in out Sparse_Matrix; I, J : in Nat; X : in Real) with Pre => I <= N_Row (Mat) and J <= N_Col (Mat); procedure Dense (Sp : in Sparse_Matrix; A : out Real_Matrix) with Pre => A'Length (1) = N_Row (Sp) and A'Length (2) = N_Col (Sp); function Dense (Sp : in Sparse_Matrix) return Real_Matrix; ------------------------------------------------------------------ ------------------------------------------------------------------ ------- Testing Functions ---------------------------------------- function Is_Square_Matrix (A : in Sparse_Matrix) return Boolean; function Has_Same_Dimensions (Left, Right : in Sparse_Matrix) return Boolean; function Is_Valid (Mat : in Sparse_Matrix) return Boolean; ------------------------------------------------------------------ ------------------------------------------------------------------ ------- Matrix operations ---------------------------------------- function Eye (N : in Pos) return Sparse_Matrix; function Zero (N : in Pos) return Sparse_Matrix; function Omega (N : in Nat; M : in Pos := 0) return Sparse_Matrix; function Transpose (Mat : in Sparse_Matrix) return Sparse_Matrix; function Plus (Left : in Sparse_Matrix; Right : in Sparse_Matrix) return Sparse_Matrix with Pre => Has_Same_Dimensions (Left, Right); function Minus (Left : in Sparse_Matrix; Right : in Sparse_Matrix) return Sparse_Matrix with Pre => Has_Same_Dimensions (Left, Right); function Mult (Left, Right : in Sparse_Matrix) return Sparse_Matrix with Pre => N_Col (Left) = N_Row (Right); function Kronecker (A, B : in Sparse_Matrix) return Sparse_Matrix; function Direct_Sum (A, B : in Sparse_Matrix) return Sparse_Matrix; function Mult_M_SV (A : in Sparse_Matrix; X : in Sparse_Vector) return Sparse_Vector with Pre => N_Col (A) = Length (X); function Permute_By_Col (Mat : in Sparse_Matrix; P : in Int_Array) return Sparse_Matrix; function Permute (Mat : in Sparse_Matrix; P : in Int_Array; By : in Permute_By_Type := Column) return Sparse_Matrix; procedure Transposed (Mat : in out Sparse_Matrix); function "-" (X : in Sparse_Matrix) return Sparse_Matrix; ---------- In Binary Form ----------------------------------------------- function "*" (Left : in Real; Right : in Sparse_Matrix) return Sparse_Matrix; function "*" (Left : in Sparse_Matrix; Right : in Real) return Sparse_Matrix is (Right * Left); function "*" (Left, Right : in Sparse_Vector) return Sparse_Matrix; function "+" (Left, Right : in Sparse_Matrix) return Sparse_Matrix renames Plus; function "-" (Left, Right : in Sparse_Matrix) return Sparse_Matrix renames Minus; function "*" (Left, Right : in Sparse_Matrix) return Sparse_Matrix renames Mult; function "*" (A : in Sparse_Matrix; X : in Sparse_Vector) return Sparse_Vector renames Mult_M_SV; function "*" (A : in Sparse_Matrix; X : in Real_Vector) return Sparse_Vector; function "and" (Left, Right : in Sparse_Matrix) return Sparse_Matrix renames Kronecker; function "or" (Left, Right : in Sparse_Matrix) return Sparse_Matrix renames Direct_Sum; function "and" (Left : in Sparse_Matrix; Right : in Real_Matrix) return Sparse_Matrix is (Left and Sparse (Right)); function "and" (Left : in Real_Matrix; Right : in Sparse_Matrix) return Sparse_Matrix is (Sparse (Left) and Right); function "or" (Left : in Sparse_Matrix; Right : in Real_Matrix) return Sparse_Matrix is (Left or Sparse (Right)); function "or" (Left : in Real_Matrix; Right : in Sparse_Matrix) return Sparse_Matrix is (Sparse (Left) or Right); function Remove_1st_N (A : in Sparse_Matrix; N : in Pos) return Sparse_Matrix; ------- File Readers --------------------------------------------------- function Read_Sparse_Triplet (File_Name : in String; Offset : in Integer := 0) return Sparse_Matrix; procedure Testing_Stuff (A : in Sparse_Matrix); private -- function BiCGSTAB (A : in Sparse_Matrix; -- B : in RVector; -- X0 : in RVector; -- Err : out Real; -- Tol : in Real := 1.0e-10) return RVector; procedure Triplet_To_Matrix (Result : out Sparse_Matrix; I : in IVector; J : in IVector; X : in RVector; N_Row : in Pos := 0; N_Col : in Pos := 0); ------------------------------------------------------------------ ------------------------------------------------------------------ -------- Essential Tools ----------------------------------------- procedure Cumulative_Sum (Item : in out Int_Array); procedure Remove_Duplicates (Mat : in out Sparse_Matrix); procedure Compress (Mat : in out Sparse_Matrix); -- Convert : goes from CSR to CSC or the reverse procedure Convert (Mat : in out Sparse_Matrix); ---- Define Matrix type ----------------------------------------- -- type Sparse_Matrix is tagged -- record -- Format : Sparse_Matrix_Format := CSC; -- N_Row : Pos := 0; -- N_Col : Pos := 0; -- X : RVector; -- I : IVector; -- P : IVector; -- end record; procedure Scatter (A : in Sparse_Matrix; J : in Integer; β : in Real; W : in out Int_Array; X : in out Real_Vector; Mark : in Integer; C : in out Sparse_Matrix; Nz : in out Integer); procedure To_Triplet (A : in Sparse_Matrix; I : out IVector; J : out IVector; X : out RVector; N_Row : out Pos; N_Col : out Pos); type Sparse_Matrix is record Format : Sparse_Matrix_Format := CSC; N_Row : Pos := 0; N_Col : Pos := 0; X : RVector; I : IVector; P : IVector; end record; end Numerics.Sparse_Matrices;
40.440191
92
0.56318
1a293cc83ef525d0f9691a28fa6593a4f5edbb7c
7,231
ada
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c35a07d.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c35a07d.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c35a07d.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- C35A07D.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT FOR FIXED POINT TYPES THE FIRST AND LAST ATTRIBUTES YIELD -- CORRECT VALUES. -- CASE D: TYPES TYPICAL OF APPLICATIONS USING FIXED POINT ARITHMETIC. -- WRG 8/25/86 -- PWN 01/31/95 REMOVED INCONSISTENCIES WITH ADA 9X. WITH REPORT; USE REPORT; WITH SYSTEM; USE SYSTEM; PROCEDURE C35A07D IS PI : CONSTANT := 3.14159_26535_89793_23846; TWO_PI : CONSTANT := 2 * PI; HALF_PI : CONSTANT := PI / 2; MM : CONSTANT := MAX_MANTISSA; -- THE NAME OF EACH TYPE OR SUBTYPE ENDS WITH THAT TYPE'S -- 'MANTISSA VALUE. TYPE PIXEL_M10 IS DELTA 1.0 / 1024.0 RANGE 0.0 .. 1.0; TYPE RULER_M8 IS DELTA 1.0 / 16.0 RANGE 0.0 .. 12.0; TYPE HOURS_M16 IS DELTA 24.0 * 2.0 ** (-15) RANGE 0.0 .. 24.0; TYPE MILES_M16 IS DELTA 3000.0 * 2.0 ** (-15) RANGE 0.0 .. 3000.0; TYPE SYMMETRIC_DEGREES_M7 IS DELTA 2.0 RANGE -180.0 .. 180.0; TYPE NATURAL_DEGREES_M15 IS DELTA 2.0 ** (-6) RANGE 0.0 .. 360.0; TYPE SYMMETRIC_RADIANS_M16 IS DELTA PI * 2.0 ** (-15) RANGE -PI .. PI; -- 'SMALL = 2.0 ** (-14) = 0.00006_10351_5625. TYPE NATURAL_RADIANS_M8 IS DELTA TWO_PI * 2.0 ** ( -7) RANGE 0.0 .. TWO_PI; -- 'SMALL = 2.0 ** ( -5) = 0.03125. ------------------------------------------------------------------- SUBTYPE ST_MILES_M8 IS MILES_M16 DELTA 3000.0 * 2.0 ** (-15) RANGE 0.0 .. 10.0; SUBTYPE ST_NATURAL_DEGREES_M11 IS NATURAL_DEGREES_M15 DELTA 0.25 RANGE 0.0 .. 360.0; SUBTYPE ST_SYMMETRIC_RADIANS_M8 IS SYMMETRIC_RADIANS_M16 DELTA HALF_PI * 2.0 ** (-7) RANGE -HALF_PI .. HALF_PI; -- 'SMALL = 2.0 ** ( -7) = 0.00781_25. BEGIN TEST ("C35A07D", "CHECK THAT FOR FIXED POINT TYPES THE FIRST " & "AND LAST ATTRIBUTES YIELD CORRECT VALUES - " & "TYPICAL TYPES"); ------------------------------------------------------------------- IF PIXEL_M10'FIRST /= IDENT_INT (1) * 0.0 THEN FAILED ("PIXEL_M10'FIRST /= 0.0"); END IF; ------------------------------------------------------------------- IF RULER_M8'FIRST /= IDENT_INT (1) * 0.0 THEN FAILED ("RULER_M8'FIRST /= 0.0"); END IF; IF RULER_M8'LAST /= IDENT_INT (1) * 12.0 THEN FAILED ("RULER_M8'LAST /= 12.0"); END IF; ------------------------------------------------------------------- IF HOURS_M16'FIRST /= IDENT_INT (1) * 0.0 THEN FAILED ("HOURS_M16'FIRST /= 0.0"); END IF; IF HOURS_M16'LAST /= IDENT_INT (1) * 24.0 THEN FAILED ("HOURS_M16'LAST /= 24.0"); END IF; ------------------------------------------------------------------- IF MILES_M16'FIRST /= IDENT_INT (1) * 0.0 THEN FAILED ("MILES_M16'FIRST /= 0.0"); END IF; IF MILES_M16'LAST /= IDENT_INT (1) * 3000.0 THEN FAILED ("MILES_M16'LAST /= 3000.0"); END IF; ------------------------------------------------------------------- IF SYMMETRIC_DEGREES_M7'FIRST /= IDENT_INT (1) * (-180.0) THEN FAILED ("SYMMETRIC_DEGREES_M7'FIRST /= -180.0"); END IF; IF SYMMETRIC_DEGREES_M7'LAST /= IDENT_INT (1) * 180.0 THEN FAILED ("SYMMETRIC_DEGREES_M7'LAST /= 180.0"); END IF; ------------------------------------------------------------------- IF NATURAL_DEGREES_M15'FIRST /= IDENT_INT (1) * 0.0 THEN FAILED ("NATURAL_DEGREES_M15'FIRST /= 0.0"); END IF; IF NATURAL_DEGREES_M15'LAST /= IDENT_INT (1) * 360.0 THEN FAILED ("NATURAL_DEGREES_M15'LAST /= 360.0"); END IF; ------------------------------------------------------------------- -- PI IS IN 3.0 + 2319 * 'SMALL .. 3.0 + 2320 * 'SMALL. IF SYMMETRIC_RADIANS_M16'FIRST NOT IN -3.14160_15625 .. -3.14154_05273_4375 THEN FAILED ("SYMMETRIC_RADIANS_M16'FIRST NOT IN " & "-3.14160_15625 .. -3.14154_05273_4375"); END IF; IF SYMMETRIC_RADIANS_M16'LAST NOT IN 3.14154_05273_4375 .. 3.14160_15625 THEN FAILED ("SYMMETRIC_RADIANS_M16'LAST NOT IN " & "3.14154_05273_4375 .. 3.14160_15625"); END IF; ------------------------------------------------------------------- IF NATURAL_RADIANS_M8'FIRST /= IDENT_INT (1) * 0.0 THEN FAILED ("NATURAL_RADIANS_M8'FIRST /= 0.0"); END IF; -- TWO_PI IS IN 201 * 'SMALL .. 202 * 'SMALL. IF NATURAL_RADIANS_M8'LAST NOT IN 6.28125 .. 6.3125 THEN FAILED ("NATURAL_RADIANS_M8'LAST NOT IN 6.28125 .. 6.3125"); END IF; ------------------------------------------------------------------- IF ST_MILES_M8'FIRST /= IDENT_INT (1) * 0.0 THEN FAILED ("ST_MILES_M8'FIRST /= 0.0"); END IF; IF ST_MILES_M8'LAST /= IDENT_INT (1) * 10.0 THEN FAILED ("ST_MILES_M8'LAST /= 10.0"); END IF; ------------------------------------------------------------------- IF ST_NATURAL_DEGREES_M11'FIRST /= IDENT_INT (1) * 0.0 THEN FAILED ("ST_NATURAL_DEGREES_M11'FIRST /= 0.0"); END IF; IF ST_NATURAL_DEGREES_M11'LAST /= IDENT_INT (1) * 360.0 THEN FAILED ("ST_NATURAL_DEGREES_M11'LAST /= 360.0"); END IF; ------------------------------------------------------------------- -- HALF_PI IS IN 201 * 'SMALL .. 202 * 'SMALL. IF ST_SYMMETRIC_RADIANS_M8'FIRST NOT IN -1.57812_5 .. -1.57031_25 THEN FAILED ("ST_SYMMETRIC_RADIANS_M8'FIRST NOT IN " & "-1.57812_5 .. -1.57031_25"); END IF; IF ST_SYMMETRIC_RADIANS_M8'LAST NOT IN 1.57031_25 .. 1.57812_5 THEN FAILED ("ST_SYMMETRIC_RADIANS_M8'LAST NOT IN " & "1.57031_25 .. 1.57812_5"); END IF; ------------------------------------------------------------------- RESULT; END C35A07D;
37.661458
79
0.517218
2241acbfe6104105ef32898c2353227807c100e2
527
ada
Ada
Task/Function-composition/Ada/function-composition-1.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:38.000Z
2018-11-09T22:08:38.000Z
Task/Function-composition/Ada/function-composition-1.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
null
null
null
Task/Function-composition/Ada/function-composition-1.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:40.000Z
2018-11-09T22:08:40.000Z
generic type Argument is private; package Functions is type Primitive_Operation is not null access function (Value : Argument) return Argument; type Func (<>) is private; function "*" (Left : Func; Right : Argument) return Argument; function "*" (Left : Func; Right : Primitive_Operation) return Func; function "*" (Left, Right : Primitive_Operation) return Func; function "*" (Left, Right : Func) return Func; private type Func is array (Positive range <>) of Primitive_Operation; end Functions;
37.642857
71
0.709677
0429ed64af5445e2c1035e0c581ec0ce43b482ec
432
ads
Ada
source/streams/a-wttest.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
33
2015-04-04T09:19:36.000Z
2021-11-10T05:33:34.000Z
source/streams/a-wttest.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
8
2017-11-14T13:05:07.000Z
2018-08-09T15:28:49.000Z
source/streams/a-wttest.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
9
2015-02-03T17:09:53.000Z
2021-11-12T01:16:05.000Z
pragma License (Unrestricted); with Ada.Streams.Stream_IO; with Ada.Text_IO.Text_Streams; package Ada.Wide_Text_IO.Text_Streams is -- type Stream_Access is access all Streams.Root_Stream_Type'Class; subtype Stream_Access is Streams.Stream_IO.Stream_Access; function Stream ( File : File_Type) -- Open_File_Type return Stream_Access renames Text_IO.Text_Streams.Stream; end Ada.Wide_Text_IO.Text_Streams;
28.8
68
0.784722
9a1df46d3db02bf46ab4fb34c132ad9026cbfea8
3,201
ads
Ada
tools-src/gnu/gcc/gcc/ada/s-fatsfl.ads
modern-tomato/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
80
2015-01-02T10:14:04.000Z
2021-06-07T06:29:49.000Z
tools-src/gnu/gcc/gcc/ada/s-fatsfl.ads
modern-tomato/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
9
2015-05-14T11:03:12.000Z
2018-01-04T07:12:58.000Z
tools-src/gnu/gcc/gcc/ada/s-fatsfl.ads
modern-tomato/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
69
2015-01-02T10:45:56.000Z
2021-09-06T07:52:13.000Z
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . F A T _ S F L T -- -- -- -- S p e c -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992,1993,1994,1995,1996 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package contains an instantiation of the floating-point attribute -- runtime routines for the type Short_Float. with System.Fat_Gen; package System.Fat_SFlt is pragma Pure (Fat_SFlt); -- Note the only entity from this package that is accessed by Rtsfind -- is the name of the package instantiation. Entities within this package -- (i.e. the individual floating-point attribute routines) are accessed -- by name using selected notation. package Fat_Short_Float is new System.Fat_Gen (Short_Float); end System.Fat_SFlt;
61.557692
78
0.458607
9a3ae94bebff53088ad789573735a4fb2c3d2771
8,389
ads
Ada
source/nodes/program-nodes-entry_declarations.ads
optikos/oasis
9f64d46d26d964790d69f9db681c874cfb3bf96d
[ "MIT" ]
null
null
null
source/nodes/program-nodes-entry_declarations.ads
optikos/oasis
9f64d46d26d964790d69f9db681c874cfb3bf96d
[ "MIT" ]
null
null
null
source/nodes/program-nodes-entry_declarations.ads
optikos/oasis
9f64d46d26d964790d69f9db681c874cfb3bf96d
[ "MIT" ]
2
2019-09-14T23:18:50.000Z
2019-10-02T10:11:40.000Z
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Program.Lexical_Elements; with Program.Elements.Defining_Identifiers; with Program.Elements.Discrete_Ranges; with Program.Elements.Parameter_Specifications; with Program.Elements.Aspect_Specifications; with Program.Elements.Entry_Declarations; with Program.Element_Visitors; package Program.Nodes.Entry_Declarations is pragma Preelaborate; type Entry_Declaration is new Program.Nodes.Node and Program.Elements.Entry_Declarations.Entry_Declaration and Program.Elements.Entry_Declarations.Entry_Declaration_Text with private; function Create (Not_Token : Program.Lexical_Elements.Lexical_Element_Access; Overriding_Token : Program.Lexical_Elements.Lexical_Element_Access; Entry_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Name : not null Program.Elements.Defining_Identifiers .Defining_Identifier_Access; Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access; Entry_Family_Definition : Program.Elements.Discrete_Ranges .Discrete_Range_Access; Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access; Left_Bracket_Token_2 : Program.Lexical_Elements.Lexical_Element_Access; Parameters : Program.Elements.Parameter_Specifications .Parameter_Specification_Vector_Access; Right_Bracket_Token_2 : Program.Lexical_Elements.Lexical_Element_Access; With_Token : Program.Lexical_Elements.Lexical_Element_Access; Aspects : Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access; Semicolon_Token : not null Program.Lexical_Elements .Lexical_Element_Access) return Entry_Declaration; type Implicit_Entry_Declaration is new Program.Nodes.Node and Program.Elements.Entry_Declarations.Entry_Declaration with private; function Create (Name : not null Program.Elements.Defining_Identifiers .Defining_Identifier_Access; Entry_Family_Definition : Program.Elements.Discrete_Ranges .Discrete_Range_Access; Parameters : Program.Elements.Parameter_Specifications .Parameter_Specification_Vector_Access; Aspects : Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False; Has_Not : Boolean := False; Has_Overriding : Boolean := False) return Implicit_Entry_Declaration with Pre => Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance; private type Base_Entry_Declaration is abstract new Program.Nodes.Node and Program.Elements.Entry_Declarations.Entry_Declaration with record Name : not null Program.Elements .Defining_Identifiers.Defining_Identifier_Access; Entry_Family_Definition : Program.Elements.Discrete_Ranges .Discrete_Range_Access; Parameters : Program.Elements.Parameter_Specifications .Parameter_Specification_Vector_Access; Aspects : Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access; end record; procedure Initialize (Self : aliased in out Base_Entry_Declaration'Class); overriding procedure Visit (Self : not null access Base_Entry_Declaration; Visitor : in out Program.Element_Visitors.Element_Visitor'Class); overriding function Name (Self : Base_Entry_Declaration) return not null Program.Elements.Defining_Identifiers .Defining_Identifier_Access; overriding function Entry_Family_Definition (Self : Base_Entry_Declaration) return Program.Elements.Discrete_Ranges.Discrete_Range_Access; overriding function Parameters (Self : Base_Entry_Declaration) return Program.Elements.Parameter_Specifications .Parameter_Specification_Vector_Access; overriding function Aspects (Self : Base_Entry_Declaration) return Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access; overriding function Is_Entry_Declaration_Element (Self : Base_Entry_Declaration) return Boolean; overriding function Is_Declaration_Element (Self : Base_Entry_Declaration) return Boolean; type Entry_Declaration is new Base_Entry_Declaration and Program.Elements.Entry_Declarations.Entry_Declaration_Text with record Not_Token : Program.Lexical_Elements .Lexical_Element_Access; Overriding_Token : Program.Lexical_Elements .Lexical_Element_Access; Entry_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Left_Bracket_Token : Program.Lexical_Elements .Lexical_Element_Access; Right_Bracket_Token : Program.Lexical_Elements .Lexical_Element_Access; Left_Bracket_Token_2 : Program.Lexical_Elements .Lexical_Element_Access; Right_Bracket_Token_2 : Program.Lexical_Elements .Lexical_Element_Access; With_Token : Program.Lexical_Elements .Lexical_Element_Access; Semicolon_Token : not null Program.Lexical_Elements .Lexical_Element_Access; end record; overriding function To_Entry_Declaration_Text (Self : aliased in out Entry_Declaration) return Program.Elements.Entry_Declarations.Entry_Declaration_Text_Access; overriding function Not_Token (Self : Entry_Declaration) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Overriding_Token (Self : Entry_Declaration) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Entry_Token (Self : Entry_Declaration) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function Left_Bracket_Token (Self : Entry_Declaration) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Right_Bracket_Token (Self : Entry_Declaration) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Left_Bracket_Token_2 (Self : Entry_Declaration) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Right_Bracket_Token_2 (Self : Entry_Declaration) return Program.Lexical_Elements.Lexical_Element_Access; overriding function With_Token (Self : Entry_Declaration) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Semicolon_Token (Self : Entry_Declaration) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function Has_Not (Self : Entry_Declaration) return Boolean; overriding function Has_Overriding (Self : Entry_Declaration) return Boolean; type Implicit_Entry_Declaration is new Base_Entry_Declaration with record Is_Part_Of_Implicit : Boolean; Is_Part_Of_Inherited : Boolean; Is_Part_Of_Instance : Boolean; Has_Not : Boolean; Has_Overriding : Boolean; end record; overriding function To_Entry_Declaration_Text (Self : aliased in out Implicit_Entry_Declaration) return Program.Elements.Entry_Declarations.Entry_Declaration_Text_Access; overriding function Is_Part_Of_Implicit (Self : Implicit_Entry_Declaration) return Boolean; overriding function Is_Part_Of_Inherited (Self : Implicit_Entry_Declaration) return Boolean; overriding function Is_Part_Of_Instance (Self : Implicit_Entry_Declaration) return Boolean; overriding function Has_Not (Self : Implicit_Entry_Declaration) return Boolean; overriding function Has_Overriding (Self : Implicit_Entry_Declaration) return Boolean; end Program.Nodes.Entry_Declarations;
37.618834
79
0.728096
c7b6414c78f0f0061f596f107e6553a3f872c8c6
3,481
ada
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ce/ce2102n.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ce/ce2102n.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ce/ce2102n.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- CE2102N.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT USE_ERROR IS RAISED WHEN OPENING A FILE OF MODE -- IN_FILE, WHEN IN_FILE MODE IS NOT SUPPORTED FOR OPEN BY THE -- IMPLEMENTATION FOR SEQUENTIAL_IO. -- APPLICABILITY CRITERIA: -- THIS TEST IS ONLY APPLICABLE TO IMPLEMENTATIONS WHICH DO NOT -- SUPPORT OPEN WITH IN_FILE MODE FOR SEQUENTIAL FILES. -- HISTORY: -- TBN 07/23/87 CREATED ORIGINAL TEST. WITH REPORT; USE REPORT; WITH SEQUENTIAL_IO; PROCEDURE CE2102N IS BEGIN TEST ("CE2102N", "CHECK THAT USE_ERROR IS RAISED WHEN MODE " & "IN_FILE IS NOT SUPPORTED FOR THE OPERATION " & "OF OPEN FOR SEQUENTIAL FILES"); DECLARE PACKAGE SEQ IS NEW SEQUENTIAL_IO (BOOLEAN); USE SEQ; FILE1 : FILE_TYPE; INCOMPLETE : EXCEPTION; VAR1 : BOOLEAN := FALSE; BEGIN BEGIN CREATE (FILE1, OUT_FILE, LEGAL_FILE_NAME); EXCEPTION WHEN USE_ERROR => NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE FOR " & "OUT_FILE MODE"); RAISE INCOMPLETE; WHEN NAME_ERROR => NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE FOR " & "OUT_FILE MODE"); RAISE INCOMPLETE; WHEN OTHERS => FAILED ("UNEXPECTED EXCEPTION RAISED ON CREATE"); RAISE INCOMPLETE; END; WRITE (FILE1, VAR1); CLOSE (FILE1); BEGIN OPEN (FILE1, IN_FILE, LEGAL_FILE_NAME); NOT_APPLICABLE ("OPEN FOR IN_FILE MODE ALLOWED"); EXCEPTION WHEN USE_ERROR => NULL; WHEN OTHERS => FAILED ("UNEXPECTED EXCEPTION RAISED ON OPEN"); END; IF IS_OPEN (FILE1) THEN BEGIN DELETE (FILE1); EXCEPTION WHEN USE_ERROR => NULL; END; END IF; EXCEPTION WHEN INCOMPLETE => NULL; END; RESULT; END CE2102N;
35.161616
79
0.566217
2ebd35145b1a74a7e93455f53b84c8098504d2c9
37,009
adb
Ada
src/asis/a4g-span_beginning.adb
jquorning/dynamo
10d68571476c270b8e45a9c5ef585fa9139b0d05
[ "Apache-2.0" ]
15
2015-01-18T23:04:19.000Z
2022-03-01T20:27:08.000Z
src/asis/a4g-span_beginning.adb
jquorning/dynamo
10d68571476c270b8e45a9c5ef585fa9139b0d05
[ "Apache-2.0" ]
16
2018-06-10T07:09:30.000Z
2022-03-26T18:28:40.000Z
src/asis/a4g-span_beginning.adb
jquorning/dynamo
10d68571476c270b8e45a9c5ef585fa9139b0d05
[ "Apache-2.0" ]
3
2015-11-11T18:00:14.000Z
2022-01-30T23:08:45.000Z
------------------------------------------------------------------------------ -- -- -- ASIS-for-GNAT IMPLEMENTATION COMPONENTS -- -- -- -- A 4 G . S P A N _ B E G I N N I N G -- -- -- -- B o d y -- -- -- -- Copyright (C) 1995-2012, Free Software Foundation, Inc. -- -- -- -- ASIS-for-GNAT is free software; you can redistribute it and/or modify it -- -- under terms of the GNU General Public License as published by the Free -- -- Software Foundation; either version 2, or (at your option) any later -- -- version. ASIS-for-GNAT is distributed in the hope that it will be use- -- -- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- -- -- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- -- Public License for more details. You should have received a copy of the -- -- GNU General Public License distributed with ASIS-for-GNAT; see file -- -- COPYING. If not, write to the Free Software Foundation, 51 Franklin -- -- Street, Fifth Floor, Boston, MA 02110-1301, USA. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the -- -- Software Engineering Laboratory of the Swiss Federal Institute of -- -- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the -- -- Scientific Research Computer Center of Moscow State University (SRCC -- -- MSU), Russia, with funding partially provided by grants from the Swiss -- -- National Science Foundation and the Swiss Academy of Engineering -- -- Sciences. ASIS-for-GNAT is now maintained by AdaCore -- -- (http://www.adacore.com). -- -- -- ------------------------------------------------------------------------------ with Asis; use Asis; with Asis.Clauses; use Asis.Clauses; with Asis.Declarations; use Asis.Declarations; with Asis.Definitions; use Asis.Definitions; with Asis.Elements; use Asis.Elements; with Asis.Expressions; use Asis.Expressions; with Asis.Extensions; use Asis.Extensions; with Asis.Statements; use Asis.Statements; with Asis.Set_Get; use Asis.Set_Get; with A4G.A_Sinput; use A4G.A_Sinput; with A4G.A_Types; use A4G.A_Types; with A4G.Span_End; with Atree; use Atree; with Nlists; use Nlists; with Sinfo; use Sinfo; package body A4G.Span_Beginning is ----------------------- -- Local subprograms -- ----------------------- function First_Label_Beginning (E : Asis.Element) return Source_Ptr; -- If E is a statement element and if this statement has label(s), returns -- the location of the first '<' of the first label. Returns No_Location -- otherwise function Prev_Word_Beginning (E : Asis.Element) return Source_Ptr; -- Encapsulates the common case when Sloc (Node (E)) points to the second -- lexem in the element image ------------------------------------ -- Assignment_Statement_Beginning -- ------------------------------------ function Assignment_Statement_Beginning (E : Asis.Element) return Source_Ptr is El : constant Asis.Element := Assignment_Variable_Name (E); begin return Set_Image_Beginning (El); end Assignment_Statement_Beginning; --------------------------- -- Association_Beginning -- --------------------------- function Association_Beginning (E : Asis.Element) return Source_Ptr is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (E); Name : Asis.Element := Nil_Element; Expr : Asis.Element; begin case Arg_Kind is when A_Parameter_Association | A_Generic_Association | A_Pragma_Argument_Association => Name := Formal_Parameter (E); Expr := Actual_Parameter (E); when A_Discriminant_Association => if not Is_Nil (Discriminant_Selector_Names (E)) then Name := Discriminant_Selector_Names (E) (1); end if; Expr := Discriminant_Expression (E); when others => null; end case; if Is_Nil (Name) then return Set_Image_Beginning (Expr); else -- we have nothing to do: Sloc points to the first token of the -- formal parameter name in the given Named association return No_Search (E); end if; end Association_Beginning; --------------------------------- -- A_Then_Abort_Path_Beginning -- --------------------------------- function A_Then_Abort_Path_Beginning (E : Asis.Element) return Source_Ptr renames Prev_Word_Beginning; -- --|A2012 start --------------------------------------- -- An_Else_Expression_Path_Beginning -- --------------------------------------- function An_Else_Expression_Path_Beginning (E : Asis.Element) return Source_Ptr is S : Source_Ptr := Set_Image_Beginning (Dependent_Expression (E)); begin S := Search_Prev_Word (S); S := Search_Beginning_Of_Word (S); return S; end An_Else_Expression_Path_Beginning; -- --|A2012 end ------------------------------ -- Call_Statement_Beginning -- ------------------------------ function Call_Statement_Beginning (E : Asis.Element) return Source_Ptr is First_Comp : Asis.Element; begin if Is_Prefix_Notation (E) then First_Comp := Asis.Statements.Call_Statement_Parameters (E) (1); First_Comp := Asis.Expressions.Actual_Parameter (First_Comp); else First_Comp := Asis.Statements.Called_Name (E); end if; return Set_Image_Beginning (First_Comp); end Call_Statement_Beginning; -- --|A2012 start ------------------------------------ -- Case_Expression_Path_Beginning -- ------------------------------------ function Case_Expression_Path_Beginning (E : Asis.Element) return Source_Ptr renames Prev_Word_Beginning; -- --|A2012 end --------------------------------------------------- -- Component_And_Parameter_Declaration_Beginning -- --------------------------------------------------- function Component_And_Parameter_Declaration_Beginning (E : Asis.Element) return Source_Ptr is Ls : constant Asis.Element_List := Names (E); begin return Get_Location (Ls (Ls'First)); end Component_And_Parameter_Declaration_Beginning; ------------------------------------- -- Component_Association_Beginning -- ------------------------------------- function Component_Association_Beginning (E : Asis.Element) return Source_Ptr is First_Choice : Asis.Element := Asis.Nil_Element; begin if Int_Kind (E) = An_Array_Component_Association then declare Choices : constant Asis.Element_List := Array_Component_Choices (E); begin if not Is_Nil (Choices) then First_Choice := Choices (Choices'First); end if; end; else -- Int_Kind (E) = A_Record_Component_Association declare Choices : constant Asis.Element_List := Record_Component_Choices (E); begin if not Is_Nil (Choices) then First_Choice := Choices (Choices'First); end if; end; end if; if not Is_Nil (First_Choice) then return Set_Image_Beginning (First_Choice); else return Set_Image_Beginning (Component_Expression (E)); end if; end Component_Association_Beginning; -------------------------------- -- Component_Clause_Beginning -- -------------------------------- function Component_Clause_Beginning (E : Asis.Element) return Source_Ptr is El : constant Asis.Element := Representation_Clause_Name (E); begin return Set_Image_Beginning (El); end Component_Clause_Beginning; ------------------------------------ -- Component_Definition_Beginning -- ------------------------------------ function Component_Definition_Beginning (E : Asis.Element) return Source_Ptr is Arg_Node : constant Node_Id := Node (E); Arg_N_Kind : constant Node_Kind := Nkind (Arg_Node); S : Source_Ptr := Sloc (Arg_Node); -- S may be corrected Dummy : Asis.Element := E; -- I am not sure that using this Dummy element makes a good style... -- ??? begin -- first, we should set S pointing to the beginning of the subtype -- indication: case Arg_N_Kind is when N_Component_Definition => null; -- no need to adjust S when N_Expanded_Name | N_Attribute_Reference => -- S points to period and it should be processed as -- A_Selected_Component element here: Set_Int_Kind (Dummy, A_Selected_Component); -- ??? S := Search_Prefix_Beginning (Dummy); when others => -- We should never be here pragma Assert (False); null; end case; return S; end Component_Definition_Beginning; -- --|A2012 start ------------------------------------------- -- Conditional_Expression_Path_Beginning -- ------------------------------------------- function Conditional_Expression_Path_Beginning (E : Asis.Element) return Source_Ptr is S : Source_Ptr := Set_Image_Beginning (Condition_Expression (E)); -- ??? begin S := Search_Prev_Word (S); S := Search_Beginning_Of_Word (S); return S; end Conditional_Expression_Path_Beginning; -- --|A2012 end ----------------------------------- -- Defining_Identifier_Beginning -- ----------------------------------- function Defining_Identifier_Beginning (E : Asis.Element) return Source_Ptr is S : Source_Ptr := Get_Location (E); begin if Nkind (Node (E)) = N_Label then S := Search_Beginning_Of_Word (S + 2); end if; return S; end Defining_Identifier_Beginning; ---------------------------------- -- Derived_Definition_Beginning -- ---------------------------------- function Derived_Definition_Beginning (E : Asis.Element) return Source_Ptr is S : Source_Ptr := Get_Location (E); begin if Trait_Kind (E) = An_Abstract_Trait and then Int_Kind (E) /= A_Formal_Derived_Type_Definition then -- the second condition is just a patch, needed because of the -- tree rewriting... S := Search_Prev_Word (S); S := Search_Beginning_Of_Word (S); end if; return S; end Derived_Definition_Beginning; ------------------------- -- Else_Path_Beginning -- ------------------------- function Else_Path_Beginning (E : Asis.Element) return Source_Ptr is Ls : constant Asis.Element_List := Sequence_Of_Statements (Path => E, Include_Pragmas => True); S : Source_Ptr := Set_Image_Beginning (Ls (Ls'First)); begin S := Search_Prev_Word (S); S := Search_Beginning_Of_Word (S); return S; end Else_Path_Beginning; ------------------------------------- -- Exception_Declaration_Beginning -- ------------------------------------- function Exception_Declaration_Beginning (E : Asis.Element) return Source_Ptr is Ls : constant Asis.Element_List := Names (E); begin return Get_Location (Ls (Ls'First)); end Exception_Declaration_Beginning; ------------------------------------ -- Explicit_Dereference_Beginning -- ------------------------------------ function Explicit_Dereference_Beginning (E : Asis.Element) return Source_Ptr is begin return Set_Image_Beginning (Asis.Expressions.Prefix (E)); end Explicit_Dereference_Beginning; --------------------------- -- First_Label_Beginning -- --------------------------- function First_Label_Beginning (E : Asis.Element) return Source_Ptr is N, N1 : Node_Id; Result : Source_Ptr := No_Location; begin -- We use the direct tree traversing because of the performance -- reasons. The implementation is in fact a simplified version of the -- code of Asis.Statements.Label_Names if Int_Kind (E) in Internal_Statement_Kinds then N := Node (E); N1 := Parent (R_Node (E)); if Nkind (N1) = N_Loop_Statement and then Is_Rewrite_Substitution (N1) and then Nkind (Original_Node (N1)) = N_Goto_Statement and then N = First (Sinfo.Statements (N1)) then -- First, process a special case when an infinite loop is -- programmed as -- -- <<Target>> Stmt; -- ... -- goto Target; -- -- If Stmt has exactly one label attached to it, the front-end -- rewrites this construct as a subtree headed by N_Loop_Statement -- node N1 := Sinfo.Identifier (N1); Result := Sloc (N1); -- N1 is not N_Label node, so we have to get to the first '<' in -- '<<" Result := Search_Prev_Word (Result) - 1; elsif Nkind (N) = N_Goto_Statement and then Nkind (R_Node (E)) = N_Loop_Statement and then Is_Empty_List (Sinfo.Statements (R_Node (E))) then -- This is a pathological case of -- -- <<Target>> goto Target; N1 := Sinfo.Identifier (R_Node (E)); Result := Sloc (N1); -- Here N1 also is not N_Label node, so we have to get to the -- first '<' in '<<" Result := Search_Prev_Word (Result) - 1; elsif Is_List_Member (N) then N1 := Prev (N); while Nkind (N1) = N_Label loop N := N1; N1 := Prev (N1); end loop; if Nkind (N) = N_Label then Result := Sloc (N); end if; end if; end if; return Result; end First_Label_Beginning; ----------------------------------------- -- Formal_Object_Declaration_Beginning -- ----------------------------------------- function Formal_Object_Declaration_Beginning (E : Asis.Element) return Source_Ptr is N : constant Node_Id := Node (E); begin return Sloc (Sinfo.Defining_Identifier (N)); end Formal_Object_Declaration_Beginning; ---------------------------------- -- For_Loop_Statement_Beginning -- ---------------------------------- function For_Loop_Statement_Beginning (E : Asis.Element) return Source_Ptr is El : Asis.Element := Statement_Identifier (E); S : Source_Ptr; begin if not Is_Nil (El) then return Set_Image_Beginning (El); end if; El := For_Loop_Parameter_Specification (E); if not Is_Nil (El) then S := Set_Image_Beginning (El); S := Search_Prev_Word (S); S := Search_Beginning_Of_Word (S); return S; else return Get_Location (E); end if; end For_Loop_Statement_Beginning; ----------------------------- -- Function_Call_Beginning -- ----------------------------- function Function_Call_Beginning (E : Asis.Element) return Source_Ptr is Tmp : Asis.Element; Arg : Asis.Element := E; New_Arg : Asis.Element; begin -- The implementation uses iteration instead of recursive processing of -- the function call parameters to avoid getting into very deep -- recursive chains for the calls like: -- -- "aaaaaaaaaaaa" & -- "bbbbbbbbbbbb" & -- .......... -- "yyyyyyyyyyyy" & -- "zzzzzzzzzzzz" -- For the cases like this we parse arguments of the (nested!) calls -- to "&" in a loop, using the Arg variable to point to the leftmost -- parameter of the currently processed (nested) call. -- -- The recursion is used only for the cases that on practice can -- never result in very long recursive call chains. <<Next_Iteration>> if Is_Prefix_Call (Arg) then if Is_Prefix_Notation (Arg) then Tmp := Function_Call_Parameters (Arg) (1); Tmp := Actual_Parameter (Tmp); return Set_Image_Beginning (Tmp); else return Set_Image_Beginning (Asis.Expressions.Prefix (Arg)); end if; else declare Param : constant Asis.Element_List := Function_Call_Parameters (Arg); begin if Param'Length > 1 then New_Arg := Param (Param'First); -- We have an infix call, so New_Arg cannot be a named -- association! New_Arg := Actual_Parameter (New_Arg); if Expression_Kind (New_Arg) = A_Function_Call then Arg := New_Arg; goto Next_Iteration; end if; return Set_Image_Beginning (New_Arg); else return Set_Image_Beginning (Asis.Expressions.Prefix (Arg)); end if; end; end if; end Function_Call_Beginning; -- --|A2012 start ----------------------------- -- If_Expression_Beginning -- ----------------------------- function If_Expression_Beginning (E : Asis.Element) return Source_Ptr is S : constant Source_Ptr := Set_Image_Beginning (Expression_Paths (E) (1)); begin return S; end If_Expression_Beginning; -- --|A2012 end --------------------------------- -- Indexed_Component_Beginning -- --------------------------------- function Indexed_Component_Beginning (E : Asis.Element) return Source_Ptr is begin return Set_Image_Beginning (Asis.Expressions.Prefix (E)); end Indexed_Component_Beginning; -- --|A2005 start ------------------------------------ -- Interface_Definition_Beginning -- ------------------------------------ function Interface_Definition_Beginning (E : Asis.Element) return Source_Ptr is N : Node_Id := Node (E); S : Source_Ptr; begin -- We start from the defining name of the corresponding type N := Defining_Identifier (Parent (N)); S := Sloc (N); -- and skip this name and 'IS' keyword S := Search_End_Of_Word (S); S := Search_Next_Word (S); S := Search_End_Of_Word (S); S := Search_Next_Word (S); return S; end Interface_Definition_Beginning; -- --|A2005 end ------------------------------- -- Membership_Test_Beginning -- ------------------------------- function Membership_Test_Beginning (E : Asis.Element) return Source_Ptr is begin return Set_Image_Beginning (Membership_Test_Expression (E)); end Membership_Test_Beginning; ------------------------------- -- Named_Statement_Beginning -- ------------------------------- function Named_Statement_Beginning (E : Asis.Element) return Source_Ptr is El : constant Asis.Element := Statement_Identifier (E); begin if not Is_Nil (El) then return Set_Image_Beginning (El); else return Get_Location (E); end if; end Named_Statement_Beginning; --------------- -- No_Search -- --------------- function No_Search (E : Asis.Element) return Source_Ptr is S : constant Source_Ptr := Get_Location (E); begin return S; end No_Search; ------------------------------ -- Null_Component_Beginning -- ------------------------------ function Null_Component_Beginning (E : Asis.Element) return Source_Ptr is S : Source_Ptr := Get_Location (E); begin -- first, looking for ';' after "null" S := Search_Rightmost_Symbol (S, ';'); -- then, going to the left to this "null" itself: S := Search_Prev_Word (S); -- it can ne nothing except comments between this ';' and "null", so: S := S - 3; return S; end Null_Component_Beginning; ---------------------------------------- -- Parenthesized_Expression_Beginning -- ---------------------------------------- function Parenthesized_Expression_Beginning (E : Asis.Element) return Source_Ptr is El : constant Asis.Element := Expression_Parenthesized (E); S : constant Source_Ptr := Set_Image_Beginning (El); begin return Search_Left_Parenthesis (S); end Parenthesized_Expression_Beginning; -- --|A2005 start --------------------------------------- -- Possible_Null_Exclusion_Beginning -- --------------------------------------- function Possible_Null_Exclusion_Beginning (E : Asis.Element) return Source_Ptr is S : Source_Ptr := Get_Location (E); begin if Trait_Kind (E) = A_Null_Exclusion_Trait then S := Search_Prev_Word_Start (S); S := Search_Prev_Word_Start (S); end if; return S; end Possible_Null_Exclusion_Beginning; --------------------------------------------- -- Possible_Overriding_Indicator_Beginning -- --------------------------------------------- function Possible_Overriding_Indicator_Beginning (E : Asis.Element) return Source_Ptr is S : Source_Ptr := Get_Location (E); begin if Is_Overriding_Declaration (E) then S := Search_Prev_Word_Start (S); elsif Is_Not_Overriding_Declaration (E) then S := Search_Prev_Word_Start (S); S := Search_Prev_Word_Start (S); end if; return S; end Possible_Overriding_Indicator_Beginning; -- --|A2005 end ------------------------- -- Prev_Word_Beginning -- ------------------------- function Prev_Word_Beginning (E : Asis.Element) return Source_Ptr is Result : Source_Ptr := Sloc (Node (E)); begin Result := Search_Prev_Word_Start (Result); return Result; end Prev_Word_Beginning; -------------------------------------------- -- Private_Extension_Definition_Beginning -- -------------------------------------------- function Private_Extension_Definition_Beginning (E : Asis.Element) return Source_Ptr is D : constant Node_Id := Node (E); N : Node_Id := D; S : Source_Ptr; begin -- PRIVATE_EXTENSION_DECLARATION ::= -- type DEFINING_IDENTIFIER [DISCRIMINANT_PART] is -- [abstract] new ancestor_SUBTYPE_INDICATION with private; -- Note: private extension declarations are not allowed in Ada 83 mode -- N_Private_Extension_Declaration -- Sloc points to TYPE -- Defining_Identifier (Node1) -- Discriminant_Specifications (List4) (set to No_List if no -- discriminant part) -- Unknown_Discriminants_Present (Flag13) set if (<>) discriminant -- Abstract_Present (Flag4) -- Subtype_Indication (Node5) N := Sinfo.Subtype_Indication (N); while Nkind (N) = N_Expanded_Name loop N := Prefix (N); end loop; S := Sloc (N); -- S points to the first character of ancestor_SUBTYPE_INDICATION S := Search_Prev_Word_Start (S); -- "new" was skipped now if Abstract_Present (D) then -- skipping "abstract": S := Search_Prev_Word_Start (S); end if; return S; end Private_Extension_Definition_Beginning; --------------------------------------- -- Private_Type_Definition_Beginning -- --------------------------------------- function Private_Type_Definition_Beginning (E : Asis.Element) return Source_Ptr is N : constant Node_Id := Node (E); S : Source_Ptr := Sloc (N); begin -- PRIVATE_TYPE_DECLARATION ::= -- type DEFINING_IDENTIFIER [DISCRIMINANT_PART] -- is [[abstract] tagged] [limited] private; -- Note: TAGGED is not permitted in Ada 83 mode -- N_Private_Type_Declaration -- Sloc points to TYPE -- Defining_Identifier (Node1) -- Discriminant_Specifications (List4) (set to No_List if no -- discriminant part) -- Unknown_Discriminants_Present (Flag13) set if (<>) discriminant -- Abstract_Present (Flag4) -- Tagged_Present (Flag15) -- Limited_Present (Flag17) -- if the enclosing type declaration contains a discriminant part, we -- should skip it first if Nkind (N) = N_Private_Type_Declaration and then Present (Discriminant_Specifications (N)) then declare Discr_Part : constant Asis.Element_List := Discriminants (Discriminant_Part (Enclosing_Element (E))); Tmp : Asis.Element := Discr_Part (Discr_Part'Last); begin Tmp := Get_Last_Component (Tmp); S := A4G.Span_End.Set_Image_End (Tmp); end; S := Search_Rightmost_Symbol (S, ')'); end if; S := Search_Rightmost_Symbol (S, ';'); -- skipping "private" S := Search_Prev_Word_Start (S); if Tagged_Present (N) then -- skipping "tagged" S := Search_Prev_Word_Start (S); end if; -- skipping "abstract" if Abstract_Present (N) then S := Search_Prev_Word_Start (S); end if; -- skipping "limited" if Limited_Present (N) then S := Search_Prev_Word_Start (S); end if; return S; end Private_Type_Definition_Beginning; ---------------------------- -- Private_Unit_Beginning -- ---------------------------- function Private_Unit_Beginning (E : Asis.Element) return Source_Ptr is Result : Source_Ptr := Set_Image_Beginning (E); begin Result := Search_Prev_Word_Start (Result); return Result; end Private_Unit_Beginning; --------------------------------- -- Search_Identifier_Beginning -- --------------------------------- function Search_Identifier_Beginning (E : Asis.Element) return Source_Ptr is S : Source_Ptr := Get_Location (E); Tmp : Asis.Element; begin if Nkind (Node (E)) = N_Attribute_Definition_Clause then -- this is a case of the attribute designator in a -- pseudo-attribute-reference from an attribute definition clause. -- Note, that we can have more than one attribute here (see FA30-016) -- e.g. -- for Root'Class'Output use Class_Output; S := Sloc (Sinfo.Name (Node (E))); Tmp := Prefix (Enclosing_Element (E)); S := Search_Rightmost_Symbol (S, '''); S := Next_Identifier (S); if Expression_Kind (Tmp) = An_Attribute_Reference then S := Search_Rightmost_Symbol (S, '''); S := Next_Identifier (S); end if; elsif Special_Case (E) = Dummy_Class_Attribute_Designator then S := Search_Rightmost_Symbol (S, '''); S := Next_Identifier (S); elsif Nkind (Node (E)) = N_Attribute_Reference then S := Next_Identifier (S); end if; return S; end Search_Identifier_Beginning; ------------------------- -- Set_Image_Beginning -- ------------------------- function Set_Image_Beginning (E : Asis.Element) return Source_Ptr is Result : Source_Ptr := First_Label_Beginning (E); begin if Result = No_Location then Result := Switch (Int_Kind (E)) (E); end if; return Result; end Set_Image_Beginning; ----------------------------------- -- Search_Left_Parenthesis_After -- ----------------------------------- function Search_Left_Parenthesis_After (E : Asis.Element) return Source_Ptr is S : constant Source_Ptr := Get_Location (E); begin return Search_Rightmost_Symbol (S, '('); end Search_Left_Parenthesis_After; ----------------------------- -- Search_Prefix_Beginning -- ----------------------------- function Search_Prefix_Beginning (E : Asis.Element) return Source_Ptr is Prefix_To_Search : Asis.Element := E; E_Kind : constant Internal_Element_Kinds := Int_Kind (Prefix_To_Search); begin if E_Kind = A_Range_Attribute_Reference or else E_Kind = A_Discrete_Range_Attribute_Reference or else E_Kind = A_Discrete_Range_Attribute_Reference_As_Subtype_Definition then Prefix_To_Search := Asis.Definitions.Range_Attribute (Prefix_To_Search); elsif E_Kind = A_Qualified_Expression or else E_Kind = A_Type_Conversion then Prefix_To_Search := Asis.Expressions.Converted_Or_Qualified_Subtype_Mark (Prefix_To_Search); end if; if Int_Kind (Prefix_To_Search) = A_Defining_Expanded_Name then Prefix_To_Search := Asis.Declarations.Defining_Prefix (Prefix_To_Search); elsif Int_Kind (Prefix_To_Search) /= An_Identifier then Prefix_To_Search := Asis.Expressions.Prefix (Prefix_To_Search); end if; return Set_Image_Beginning (Prefix_To_Search); end Search_Prefix_Beginning; ----------------------------------------- -- Search_Subtype_Indication_Beginning -- ----------------------------------------- function Search_Subtype_Indication_Beginning (E : Asis.Element) return Source_Ptr is begin return Set_Image_Beginning (Asis.Definitions.Subtype_Mark (E)); end Search_Subtype_Indication_Beginning; ---------------------------------- -- Select_Alternative_Beginning -- ---------------------------------- function Select_Alternative_Beginning (E : Asis.Element) return Source_Ptr is Result : Source_Ptr; Tmp : constant Asis.Element := Guard (E); begin if Is_Nil (Tmp) then declare Stmts : constant Asis.Element_List := Sequence_Of_Statements (E, True); begin Result := Set_Image_Beginning (Stmts (Stmts'First)); end; else Result := Set_Image_Beginning (Tmp); Result := Search_Prev_Word (Result); Result := Search_Beginning_Of_Word (Result); end if; return Result; end Select_Alternative_Beginning; ----------------------------- -- Short_Circuit_Beginning -- ----------------------------- function Short_Circuit_Beginning (E : Asis.Element) return Source_Ptr is begin return Set_Image_Beginning (Short_Circuit_Operation_Left_Expression (E)); end Short_Circuit_Beginning; --------------------------------------- -- Simple_Expression_Range_Beginning -- --------------------------------------- function Simple_Expression_Range_Beginning (E : Asis.Element) return Source_Ptr is El : constant Asis.Element := Lower_Bound (E); begin return Set_Image_Beginning (El); end Simple_Expression_Range_Beginning; ------------------------------- -- Subprogram_Spec_Beginning -- ------------------------------- function Subprogram_Spec_Beginning (E : Asis.Element) return Source_Ptr is N : Node_Id := Node (E); Result : Source_Ptr; begin N := Specification (N); Result := Sloc (N); -- --|A2005 start if Is_Overriding_Declaration (E) then Result := Search_Prev_Word_Start (Result); elsif Is_Not_Overriding_Declaration (E) then Result := Search_Prev_Word_Start (Result); Result := Search_Prev_Word_Start (Result); end if; -- --|A2005 end return Result; end Subprogram_Spec_Beginning; ----------------------- -- Subunit_Beginning -- ----------------------- function Subunit_Beginning (E : Asis.Element) return Source_Ptr is Result : Source_Ptr := Set_Image_Beginning (E); begin Result := Search_Left_Parenthesis (Result); Result := Search_Prev_Word_Start (Result); return Result; end Subunit_Beginning; -------------------------------------- -- Tagged_Type_Definition_Beginning -- -------------------------------------- function Tagged_Type_Definition_Beginning (E : Asis.Element) return Source_Ptr is S : Source_Ptr := Get_Location (E); Tr : constant Asis.Trait_Kinds := Trait_Kind (E); begin -- S points either to RECORD or to NULL. Therefore, we have -- to go at least one word left to take into account the -- TAGGED keyword. Depending on the trait, we may have one -- ot two more words left S := Search_Prev_Word (S); S := Search_Beginning_Of_Word (S); if Tr = An_Abstract_Limited_Trait or else Tr = A_Limited_Trait or else Tr = An_Abstract_Limited_Private_Trait or else Tr = A_Limited_Private_Trait then S := Search_Prev_Word (S); S := Search_Beginning_Of_Word (S); end if; if Tr = An_Abstract_Limited_Trait or else Tr = An_Abstract_Trait or else Tr = An_Abstract_Limited_Private_Trait or else Tr = An_Abstract_Private_Trait then S := Search_Prev_Word (S); S := Search_Beginning_Of_Word (S); end if; return S; end Tagged_Type_Definition_Beginning; ------------------------------- -- Type_Definition_Beginning -- ------------------------------- function Type_Definition_Beginning (E : Asis.Element) return Source_Ptr is S : Source_Ptr := Get_Location (E); Tr : constant Asis.Trait_Kinds := Trait_Kind (E); begin if Tr = A_Limited_Trait or else Tr = A_Limited_Private_Trait then S := Search_Prev_Word (S); S := Search_Beginning_Of_Word (S); end if; return S; end Type_Definition_Beginning; ------------------------------------ -- While_Loop_Statement_Beginning -- ------------------------------------ function While_Loop_Statement_Beginning (E : Asis.Element) return Source_Ptr is El : Asis.Element := Statement_Identifier (E); S : Source_Ptr; begin if not Is_Nil (El) then return Set_Image_Beginning (El); end if; El := While_Condition (E); S := Set_Image_Beginning (El); S := Search_Prev_Word (S); S := Search_Beginning_Of_Word (S); return S; end While_Loop_Statement_Beginning; --------------------------- -- With_Clause_Beginning -- --------------------------- function With_Clause_Beginning (E : Asis.Element) return Source_Ptr is S : Source_Ptr := Get_Location (E); begin S := Search_Prev_Word (S); S := Search_Beginning_Of_Word (S); -- --|A2005 start case Trait_Kind (E) is when A_Limited_Trait | A_Private_Trait => S := Search_Prev_Word (S); S := Search_Beginning_Of_Word (S); when A_Limited_Private_Trait => S := Search_Prev_Word (S); S := Search_Beginning_Of_Word (S); S := Search_Prev_Word (S); S := Search_Beginning_Of_Word (S); when others => null; end case; -- --|A2005 end return S; end With_Clause_Beginning; end A4G.Span_Beginning;
30.310401
79
0.539031
2247078596b28d847c4ffb22a61fa75b4bafacb5
1,125
adb
Ada
mat/src/mat-readers.adb
stcarrez/mat
fb242feb5662b8130680cd06e50da7ef40b95bd7
[ "Apache-2.0" ]
7
2015-01-18T23:04:30.000Z
2021-04-06T14:07:56.000Z
mat/src/mat-readers.adb
stcarrez/mat
fb242feb5662b8130680cd06e50da7ef40b95bd7
[ "Apache-2.0" ]
null
null
null
mat/src/mat-readers.adb
stcarrez/mat
fb242feb5662b8130680cd06e50da7ef40b95bd7
[ "Apache-2.0" ]
null
null
null
----------------------------------------------------------------------- -- mat-readers -- Reader -- Copyright (C) 2015 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package body MAT.Readers is -- ------------------------------ -- Get the buffer endian format. -- ------------------------------ function Get_Endian (Msg : in Message_Type) return Endian_Type is begin return Msg.Buffer.Endian; end Get_Endian; end MAT.Readers;
37.5
76
0.584889
2e8a2604d64dd825ed65040ca00fed5a275caa98
21,325
adb
Ada
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/a-nbnbin__gmp.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/a-nbnbin__gmp.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/a-nbnbin__gmp.adb
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- ADA.NUMERICS.BIG_NUMBERS.BIG_INTEGERS -- -- -- -- B o d y -- -- -- -- Copyright (C) 2019-2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This is the GMP version of this package with Ada.Unchecked_Conversion; with Ada.Unchecked_Deallocation; with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; use Interfaces.C.Strings; with Ada.Strings.Text_Output.Utils; with Ada.Characters.Handling; use Ada.Characters.Handling; package body Ada.Numerics.Big_Numbers.Big_Integers is use System; pragma Linker_Options ("-lgmp"); type mpz_t is record mp_alloc : Integer; mp_size : Integer; mp_d : System.Address; end record; pragma Convention (C, mpz_t); type mpz_t_ptr is access all mpz_t; function To_Mpz is new Ada.Unchecked_Conversion (System.Address, mpz_t_ptr); function To_Address is new Ada.Unchecked_Conversion (mpz_t_ptr, System.Address); function Get_Mpz (Arg : Big_Integer) return mpz_t_ptr is (To_Mpz (Arg.Value.C)); -- Return the mpz_t value stored in Arg procedure Set_Mpz (Arg : in out Big_Integer; Value : mpz_t_ptr) with Inline; -- Set the mpz_t value stored in Arg to Value procedure Allocate (This : in out Big_Integer) with Inline; -- Allocate a Big_Integer, including the underlying mpz procedure mpz_init_set (ROP : access mpz_t; OP : access constant mpz_t); pragma Import (C, mpz_init_set, "__gmpz_init_set"); procedure mpz_set (ROP : access mpz_t; OP : access constant mpz_t); pragma Import (C, mpz_set, "__gmpz_set"); function mpz_cmp (OP1, OP2 : access constant mpz_t) return Integer; pragma Import (C, mpz_cmp, "__gmpz_cmp"); function mpz_cmp_ui (OP1 : access constant mpz_t; OP2 : unsigned_long) return Integer; pragma Import (C, mpz_cmp_ui, "__gmpz_cmp_ui"); procedure mpz_set_si (ROP : access mpz_t; OP : long); pragma Import (C, mpz_set_si, "__gmpz_set_si"); procedure mpz_set_ui (ROP : access mpz_t; OP : unsigned_long); pragma Import (C, mpz_set_ui, "__gmpz_set_ui"); function mpz_get_si (OP : access constant mpz_t) return long; pragma Import (C, mpz_get_si, "__gmpz_get_si"); function mpz_get_ui (OP : access constant mpz_t) return unsigned_long; pragma Import (C, mpz_get_ui, "__gmpz_get_ui"); procedure mpz_neg (ROP : access mpz_t; OP : access constant mpz_t); pragma Import (C, mpz_neg, "__gmpz_neg"); procedure mpz_sub (ROP : access mpz_t; OP1, OP2 : access constant mpz_t); pragma Import (C, mpz_sub, "__gmpz_sub"); ------------- -- Set_Mpz -- ------------- procedure Set_Mpz (Arg : in out Big_Integer; Value : mpz_t_ptr) is begin Arg.Value.C := To_Address (Value); end Set_Mpz; -------------- -- Is_Valid -- -------------- function Is_Valid (Arg : Big_Integer) return Boolean is (Arg.Value.C /= System.Null_Address); --------- -- "=" -- --------- function "=" (L, R : Valid_Big_Integer) return Boolean is begin return mpz_cmp (Get_Mpz (L), Get_Mpz (R)) = 0; end "="; --------- -- "<" -- --------- function "<" (L, R : Valid_Big_Integer) return Boolean is begin return mpz_cmp (Get_Mpz (L), Get_Mpz (R)) < 0; end "<"; ---------- -- "<=" -- ---------- function "<=" (L, R : Valid_Big_Integer) return Boolean is begin return mpz_cmp (Get_Mpz (L), Get_Mpz (R)) <= 0; end "<="; --------- -- ">" -- --------- function ">" (L, R : Valid_Big_Integer) return Boolean is begin return mpz_cmp (Get_Mpz (L), Get_Mpz (R)) > 0; end ">"; ---------- -- ">=" -- ---------- function ">=" (L, R : Valid_Big_Integer) return Boolean is begin return mpz_cmp (Get_Mpz (L), Get_Mpz (R)) >= 0; end ">="; -------------------- -- To_Big_Integer -- -------------------- function To_Big_Integer (Arg : Integer) return Valid_Big_Integer is Result : Big_Integer; begin Allocate (Result); mpz_set_si (Get_Mpz (Result), long (Arg)); return Result; end To_Big_Integer; ---------------- -- To_Integer -- ---------------- function To_Integer (Arg : Valid_Big_Integer) return Integer is begin return Integer (mpz_get_si (Get_Mpz (Arg))); end To_Integer; ------------------------ -- Signed_Conversions -- ------------------------ package body Signed_Conversions is -------------------- -- To_Big_Integer -- -------------------- function To_Big_Integer (Arg : Int) return Valid_Big_Integer is Result : Big_Integer; begin Allocate (Result); mpz_set_si (Get_Mpz (Result), long (Arg)); return Result; end To_Big_Integer; ---------------------- -- From_Big_Integer -- ---------------------- function From_Big_Integer (Arg : Valid_Big_Integer) return Int is begin return Int (mpz_get_si (Get_Mpz (Arg))); end From_Big_Integer; end Signed_Conversions; -------------------------- -- Unsigned_Conversions -- -------------------------- package body Unsigned_Conversions is -------------------- -- To_Big_Integer -- -------------------- function To_Big_Integer (Arg : Int) return Valid_Big_Integer is Result : Big_Integer; begin Allocate (Result); mpz_set_ui (Get_Mpz (Result), unsigned_long (Arg)); return Result; end To_Big_Integer; ---------------------- -- From_Big_Integer -- ---------------------- function From_Big_Integer (Arg : Valid_Big_Integer) return Int is begin return Int (mpz_get_ui (Get_Mpz (Arg))); end From_Big_Integer; end Unsigned_Conversions; --------------- -- To_String -- --------------- function To_String (Arg : Valid_Big_Integer; Width : Field := 0; Base : Number_Base := 10) return String is function mpz_get_str (STR : System.Address; BASE : Integer; OP : access constant mpz_t) return chars_ptr; pragma Import (C, mpz_get_str, "__gmpz_get_str"); function mpz_sizeinbase (this : access constant mpz_t; base : Integer) return size_t; pragma Import (C, mpz_sizeinbase, "__gmpz_sizeinbase"); function Add_Base (S : String) return String; -- Add base information if Base /= 10 function Leading_Padding (Str : String; Min_Length : Field; Char : Character := ' ') return String; -- Return padding of Char concatenated with Str so that the resulting -- string is at least Min_Length long. function Image (N : Natural) return String; -- Return image of N, with no leading space. -------------- -- Add_Base -- -------------- function Add_Base (S : String) return String is begin if Base = 10 then return S; else return Image (Base) & "#" & To_Upper (S) & "#"; end if; end Add_Base; ----------- -- Image -- ----------- function Image (N : Natural) return String is S : constant String := Natural'Image (N); begin return S (2 .. S'Last); end Image; --------------------- -- Leading_Padding -- --------------------- function Leading_Padding (Str : String; Min_Length : Field; Char : Character := ' ') return String is begin return (1 .. Integer'Max (Integer (Min_Length) - Str'Length, 0) => Char) & Str; end Leading_Padding; Number_Digits : constant Integer := Integer (mpz_sizeinbase (Get_Mpz (Arg), Integer (abs Base))); Buffer : aliased String (1 .. Number_Digits + 2); -- The correct number to allocate is 2 more than Number_Digits in order -- to handle a possible minus sign and the null-terminator. Result : constant chars_ptr := mpz_get_str (Buffer'Address, Integer (Base), Get_Mpz (Arg)); S : constant String := Value (Result); begin if S (1) = '-' then return Leading_Padding ("-" & Add_Base (S (2 .. S'Last)), Width); else return Leading_Padding (" " & Add_Base (S), Width); end if; end To_String; ----------------- -- From_String -- ----------------- function From_String (Arg : String) return Big_Integer is function mpz_set_str (this : access mpz_t; str : System.Address; base : Integer := 10) return Integer; pragma Import (C, mpz_set_str, "__gmpz_set_str"); Result : Big_Integer; First : Natural; Last : Natural; Base : Natural; begin Allocate (Result); if Arg (Arg'Last) /= '#' then -- Base 10 number First := Arg'First; Last := Arg'Last; Base := 10; else -- Compute the xx base in a xx#yyyyy# number if Arg'Length < 4 then raise Constraint_Error; end if; First := 0; Last := Arg'Last - 1; for J in Arg'First + 1 .. Last loop if Arg (J) = '#' then First := J; exit; end if; end loop; if First = 0 then raise Constraint_Error; end if; Base := Natural'Value (Arg (Arg'First .. First - 1)); First := First + 1; end if; declare Str : aliased String (1 .. Last - First + 2); Index : Natural := 0; begin -- Strip underscores for J in First .. Last loop if Arg (J) /= '_' then Index := Index + 1; Str (Index) := Arg (J); end if; end loop; Index := Index + 1; Str (Index) := ASCII.NUL; if mpz_set_str (Get_Mpz (Result), Str'Address, Base) /= 0 then raise Constraint_Error; end if; end; return Result; end From_String; --------------- -- Put_Image -- --------------- procedure Put_Image (S : in out Sink'Class; V : Big_Integer) is -- This is implemented in terms of To_String. It might be more elegant -- and more efficient to do it the other way around, but this is the -- most expedient implementation for now. begin Strings.Text_Output.Utils.Put_UTF_8 (S, To_String (V)); end Put_Image; --------- -- "+" -- --------- function "+" (L : Valid_Big_Integer) return Valid_Big_Integer is Result : Big_Integer; begin Set_Mpz (Result, new mpz_t); mpz_init_set (Get_Mpz (Result), Get_Mpz (L)); return Result; end "+"; --------- -- "-" -- --------- function "-" (L : Valid_Big_Integer) return Valid_Big_Integer is Result : Big_Integer; begin Allocate (Result); mpz_neg (Get_Mpz (Result), Get_Mpz (L)); return Result; end "-"; ----------- -- "abs" -- ----------- function "abs" (L : Valid_Big_Integer) return Valid_Big_Integer is procedure mpz_abs (ROP : access mpz_t; OP : access constant mpz_t); pragma Import (C, mpz_abs, "__gmpz_abs"); Result : Big_Integer; begin Allocate (Result); mpz_abs (Get_Mpz (Result), Get_Mpz (L)); return Result; end "abs"; --------- -- "+" -- --------- function "+" (L, R : Valid_Big_Integer) return Valid_Big_Integer is procedure mpz_add (ROP : access mpz_t; OP1, OP2 : access constant mpz_t); pragma Import (C, mpz_add, "__gmpz_add"); Result : Big_Integer; begin Allocate (Result); mpz_add (Get_Mpz (Result), Get_Mpz (L), Get_Mpz (R)); return Result; end "+"; --------- -- "-" -- --------- function "-" (L, R : Valid_Big_Integer) return Valid_Big_Integer is Result : Big_Integer; begin Allocate (Result); mpz_sub (Get_Mpz (Result), Get_Mpz (L), Get_Mpz (R)); return Result; end "-"; --------- -- "*" -- --------- function "*" (L, R : Valid_Big_Integer) return Valid_Big_Integer is procedure mpz_mul (ROP : access mpz_t; OP1, OP2 : access constant mpz_t); pragma Import (C, mpz_mul, "__gmpz_mul"); Result : Big_Integer; begin Allocate (Result); mpz_mul (Get_Mpz (Result), Get_Mpz (L), Get_Mpz (R)); return Result; end "*"; --------- -- "/" -- --------- function "/" (L, R : Valid_Big_Integer) return Valid_Big_Integer is procedure mpz_tdiv_q (Q : access mpz_t; N, D : access constant mpz_t); pragma Import (C, mpz_tdiv_q, "__gmpz_tdiv_q"); begin if mpz_cmp_ui (Get_Mpz (R), 0) = 0 then raise Constraint_Error; end if; declare Result : Big_Integer; begin Allocate (Result); mpz_tdiv_q (Get_Mpz (Result), Get_Mpz (L), Get_Mpz (R)); return Result; end; end "/"; ----------- -- "mod" -- ----------- function "mod" (L, R : Valid_Big_Integer) return Valid_Big_Integer is procedure mpz_mod (R : access mpz_t; N, D : access constant mpz_t); pragma Import (C, mpz_mod, "__gmpz_mod"); -- result is always non-negative L_Negative, R_Negative : Boolean; begin if mpz_cmp_ui (Get_Mpz (R), 0) = 0 then raise Constraint_Error; end if; declare Result : Big_Integer; begin Allocate (Result); L_Negative := mpz_cmp_ui (Get_Mpz (L), 0) < 0; R_Negative := mpz_cmp_ui (Get_Mpz (R), 0) < 0; if not (L_Negative or R_Negative) then mpz_mod (Get_Mpz (Result), Get_Mpz (L), Get_Mpz (R)); else -- The GMP library provides operators defined by C semantics, but -- the semantics of Ada's mod operator are not the same as C's -- when negative values are involved. We do the following to -- implement the required Ada semantics. declare Temp_Left : Big_Integer; Temp_Right : Big_Integer; Temp_Result : Big_Integer; begin Allocate (Temp_Result); Set_Mpz (Temp_Left, new mpz_t); Set_Mpz (Temp_Right, new mpz_t); mpz_init_set (Get_Mpz (Temp_Left), Get_Mpz (L)); mpz_init_set (Get_Mpz (Temp_Right), Get_Mpz (R)); if L_Negative then mpz_neg (Get_Mpz (Temp_Left), Get_Mpz (Temp_Left)); end if; if R_Negative then mpz_neg (Get_Mpz (Temp_Right), Get_Mpz (Temp_Right)); end if; -- now both Temp_Left and Temp_Right are nonnegative mpz_mod (Get_Mpz (Temp_Result), Get_Mpz (Temp_Left), Get_Mpz (Temp_Right)); if mpz_cmp_ui (Get_Mpz (Temp_Result), 0) = 0 then -- if Temp_Result is zero we are done mpz_set (Get_Mpz (Result), Get_Mpz (Temp_Result)); elsif L_Negative then if R_Negative then mpz_neg (Get_Mpz (Result), Get_Mpz (Temp_Result)); else -- L is negative but R is not mpz_sub (Get_Mpz (Result), Get_Mpz (Temp_Right), Get_Mpz (Temp_Result)); end if; else pragma Assert (R_Negative); mpz_sub (Get_Mpz (Result), Get_Mpz (Temp_Result), Get_Mpz (Temp_Right)); end if; end; end if; return Result; end; end "mod"; ----------- -- "rem" -- ----------- function "rem" (L, R : Valid_Big_Integer) return Valid_Big_Integer is procedure mpz_tdiv_r (R : access mpz_t; N, D : access constant mpz_t); pragma Import (C, mpz_tdiv_r, "__gmpz_tdiv_r"); -- R will have the same sign as N. begin if mpz_cmp_ui (Get_Mpz (R), 0) = 0 then raise Constraint_Error; end if; declare Result : Big_Integer; begin Allocate (Result); mpz_tdiv_r (R => Get_Mpz (Result), N => Get_Mpz (L), D => Get_Mpz (R)); -- the result takes the sign of N, as required by the RM return Result; end; end "rem"; ---------- -- "**" -- ---------- function "**" (L : Valid_Big_Integer; R : Natural) return Valid_Big_Integer is procedure mpz_pow_ui (ROP : access mpz_t; BASE : access constant mpz_t; EXP : unsigned_long); pragma Import (C, mpz_pow_ui, "__gmpz_pow_ui"); Result : Big_Integer; begin Allocate (Result); mpz_pow_ui (Get_Mpz (Result), Get_Mpz (L), unsigned_long (R)); return Result; end "**"; --------- -- Min -- --------- function Min (L, R : Valid_Big_Integer) return Valid_Big_Integer is (if L < R then L else R); --------- -- Max -- --------- function Max (L, R : Valid_Big_Integer) return Valid_Big_Integer is (if L > R then L else R); ----------------------------- -- Greatest_Common_Divisor -- ----------------------------- function Greatest_Common_Divisor (L, R : Valid_Big_Integer) return Big_Positive is procedure mpz_gcd (ROP : access mpz_t; Op1, Op2 : access constant mpz_t); pragma Import (C, mpz_gcd, "__gmpz_gcd"); Result : Big_Integer; begin Allocate (Result); mpz_gcd (Get_Mpz (Result), Get_Mpz (L), Get_Mpz (R)); return Result; end Greatest_Common_Divisor; -------------- -- Allocate -- -------------- procedure Allocate (This : in out Big_Integer) is procedure mpz_init (this : access mpz_t); pragma Import (C, mpz_init, "__gmpz_init"); begin Set_Mpz (This, new mpz_t); mpz_init (Get_Mpz (This)); end Allocate; ------------ -- Adjust -- ------------ procedure Adjust (This : in out Controlled_Bignum) is Value : constant mpz_t_ptr := To_Mpz (This.C); begin if Value /= null then This.C := To_Address (new mpz_t); mpz_init_set (To_Mpz (This.C), Value); end if; end Adjust; -------------- -- Finalize -- -------------- procedure Finalize (This : in out Controlled_Bignum) is procedure Free is new Ada.Unchecked_Deallocation (mpz_t, mpz_t_ptr); procedure mpz_clear (this : access mpz_t); pragma Import (C, mpz_clear, "__gmpz_clear"); Mpz : mpz_t_ptr; begin if This.C /= System.Null_Address then Mpz := To_Mpz (This.C); mpz_clear (Mpz); Free (Mpz); This.C := System.Null_Address; end if; end Finalize; end Ada.Numerics.Big_Numbers.Big_Integers;
29.252401
79
0.522673
1a6f8aadeb20386308790e1ab07d342d32a265c5
396
ads
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/specs/formal_type.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/specs/formal_type.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/specs/formal_type.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- { dg-do compile } with Ada.Strings.Bounded; package formal_type is generic with package BI is new Ada.Strings.Bounded.Generic_Bounded_Length (<>); type NB is new BI.Bounded_String; package G is end; package BI is new Ada.Strings.Bounded.Generic_Bounded_Length (30); type NB is new BI.Bounded_String; Thing : NB; package GI is new G (BI, NB); end;
26.4
69
0.674242
4b838e43dc7ffbe3b783a13dc23a2031aa523880
15,451
adb
Ada
src/glade3_generate.adb
Blady-Com/Gate3
ceb4e8dc1c25b5126b2d8c3331ef4c3fc5678a4a
[ "MIT" ]
1
2021-10-03T15:41:28.000Z
2021-10-03T15:41:28.000Z
src/glade3_generate.adb
Blady-Com/Gate3
ceb4e8dc1c25b5126b2d8c3331ef4c3fc5678a4a
[ "MIT" ]
null
null
null
src/glade3_generate.adb
Blady-Com/Gate3
ceb4e8dc1c25b5126b2d8c3331ef4c3fc5678a4a
[ "MIT" ]
null
null
null
with Ada.Directories; use Ada.Directories; with Ada.Text_IO; use Ada.Text_IO; with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Exceptions; use Ada.Exceptions; with Glib.Xml_Int; use Glib.Xml_Int; with Templates_Parser; use Templates_Parser; with Signal_Storage; use Signal_Storage; with Gate3_Glib; use Gate3_Glib; package body Glade3_Generate is package UBS renames Ada.Strings.Unbounded; Template_Dir : UBS.String_Access; ----------------------- -- Set_Template_Dir -- ----------------------- procedure Set_Template_Dir (Dir : in String) is begin if Template_Dir /= null then Free (Template_Dir); end if; Template_Dir := new String'(Dir); end Set_Template_Dir; procedure Scan_Project (Project : in Node_Ptr); -- Process the Xml tree Project to find windows and signal -- Results are stored in package Signal_Storage function Print_Header (File_Name : String) return String; -- Generates header using gate3_header.tmplt function Print_Main (Project_Name : String; Glade_Name : String) return String; -- Generates main Ada procedure using gate3_main.tmplt function Print_Spec (Window_Nbr : Object_Index) return String; -- Generates Ada specs for one callback package using gate3_spec.tmplt function Print_Body (Window_Nbr : Object_Index) return String; -- Generates Ada body for one callback package using gate3_body.tmplt -------------- -- Generate -- -------------- ----------------------- -- Generate a string -- ----------------------- function Process (File_Name : String; Main_Name : String := ""; Project_Tree : Node_Ptr) return String is -- Scan the XML tree and outputs the text Result : UBS.Unbounded_String; Window_Nbr : Object_Index := 0; begin -- Populate the object and signal store Scan_Project (Project_Tree); -- Do some checks for the validity Window_Nbr := Get_Object_Number; if Window_Nbr = 0 then -- something is wrong in the glade file Raise_Exception (Bad_Xml'Identity, "Gate3 Error : " & "Cannot find any window in your project."); end if; if Get_Signal_Number = 0 then -- there is no signal in project - program will hang. Raise_Exception (Bad_Xml'Identity, "Gate3 Error : " & "There is no signal in your project." & " You must have at least a destroy signal."); end if; -- The real processing is done here. Result := To_Unbounded_String (Print_Header (File_Name)); Append (Result, Print_Main (Main_Name, File_Name)); for I in 1 .. Window_Nbr loop if Object_Store (I).Signumber > 0 then Append (Result, Print_Spec (I)); Append (Result, Print_Body (I)); end if; end loop; return UBS.To_String (Result); exception when E : Signal_Storage.Bad_Identifier => Raise_Exception (Bad_Xml'Identity, Exception_Message (E)); end Process; ---------------------- -- Generate a file -- ---------------------- procedure Generate (Glade_File : in String; Project_Name : in String := ""; Output_Dir : in String := "") is Project : Node_Ptr; Output : File_Type; Output_Name : UBS.String_Access; Mainproc_Name : UBS.String_Access; begin if Project_Name = "" then Mainproc_Name := new String'(To_Ada (To_Lower (Base_Name (Glade_File)))); else Mainproc_Name := new String'(Project_Name); end if; if Output_Dir = "" then Output_Name := new String' (Compose (Containing_Directory (Glade_File), To_Lower (Base_Name (Glade_File)), "ada")); else begin if Exists (Output_Dir) and then Kind (Output_Dir) = Directory then Output_Name := new String'(Compose (Output_Dir, To_Lower (Base_Name (Glade_File)), "ada")); else Output_Name := new String' (Compose (Containing_Directory (Glade_File), To_Lower (Base_Name (Glade_File)), "ada")); end if; exception when Ada.Directories.Name_Error => Output_Name := new String'(Compose ("", To_Lower (Base_Name (Glade_File)), "ada")); end; end if; -- Do the XML parsing. Project := Glib.Xml_Int.Parse (Glade_File); if Project = null then Raise_Exception (Bad_Xml'Identity, "Gate3 Error : XML parsing with glib failed." & "Check your glade file."); end if; if Ada.Directories.Exists (Output_Name.all) then Ada.Directories.Delete_File (Output_Name.all); end if; Create (Output, Out_File, Output_Name.all); Ada.Text_IO.Put (Output, Process (Glade_File, Mainproc_Name.all, Project)); Close (Output); Put_Line ("Result file is : " & Output_Name.all); -- Garbage collection Free (Output_Name); Free (Mainproc_Name); Glib.Xml_Int.Free (Project); end Generate; ------------------ -- Scan_Project -- ------------------ procedure Scan_Object (N : Node_Ptr; Top_Window : Object_Index); procedure Scan_Project (Project : Node_Ptr) is P : Node_Ptr; Top_Widget_Nbr : Object_Index := 0; begin if Project.Tag.all /= "interface" then -- sanity check against old version of Glade Raise_Exception (Old_Version'Identity, "Gate3 Error : Old version. " & "The top tag must be [interface]"); end if; Initialize_Signals_Store; P := Project.Child; while P /= null loop if P.Tag.all = "object" then if Debug then Put ("Scanning root object id [" & Get_Attribute (P, "id")); Put_Line ("] ; class [" & Get_Attribute (P, "class") & "]."); end if; declare Class : constant String := Get_Attribute (P, "class"); begin -- scan only objects that can contain signals or shows if Class = "GtkAction" or Class = "GtkActionGroup" or Class = "GtkAboutDialog" or Class = "GtkDialog" or Class = "GtkWindow" then Top_Widget_Nbr := Top_Widget_Nbr + 1; Object_Store (Top_Widget_Nbr).Node := P; Inc_Object_Number; Scan_Object (P, Top_Widget_Nbr); end if; end; elsif P.Tag.all = "widget" then -- sanity check against old version of Glade files Raise_Exception (Old_Version'Identity, "Gate3 Error : : Old version. " & "Tag [widget] is obsolete and replaced by [object]"); else null; end if; P := P.Next; end loop; end Scan_Project; ------------------ -- Scan_Object -- ------------------ procedure Scan_Object (N : Node_Ptr; Top_Window : Object_Index) is P, Q : Node_Ptr; begin P := N.Child; while P /= null loop if P.Tag.all = "signal" then -- Looking for the root window Store_Signal_Node (P, Top_Window); if Debug then Put (" Registering signal name [" & Get_Attribute (P, "name")); Put ("]; handler [" & Get_Attribute (P, "handler")); Put_Line ("]; widget [" & Get_Attribute (N, "id") & "]"); Put_Line (" Top object is [" & Get_Attribute (Object_Store (Top_Window).Node, "id") & "]."); end if; elsif P.Tag.all = "child" then Q := P.Child; while Q /= null loop if Q.Tag.all = "object" then -- go into recursion Scan_Object (Q, Top_Window); end if; Q := Q.Next; end loop; else null; end if; P := P.Next; end loop; end Scan_Object; ------------------ -- Print_Header -- ------------------ function Print_Header (File_Name : String) return String is File_Tag : constant Templates_Parser.Tag := +File_Name; Translations : constant Templates_Parser.Translate_Table (1 .. 1) := (1 => Templates_Parser.Assoc ("FILE", File_Tag)); Header_Template : constant String := Compose (Template_Dir.all, "gate3_header", "tmplt"); begin return Templates_Parser.Parse (Header_Template, Translations); end Print_Header; ------------------ -- Print_Main -- ------------------ function Print_Main (Project_Name : String; Glade_Name : String) return String is Window_Nbr : constant Object_Index := Get_Object_Number; Signal_Number : constant Natural := Get_Signal_Number; Project_Tag : constant Templates_Parser.Tag := +Project_Name; Glade_Tag : constant Templates_Parser.Tag := +Glade_Name; Objects : Templates_Parser.Vector_Tag; Ada_Objects : Templates_Parser.Vector_Tag; Shows : Templates_Parser.Vector_Tag; Signals : Templates_Parser.Vector_Tag; Ada_Signals : Templates_Parser.Vector_Tag; Translations : Templates_Parser.Translate_Table (1 .. 7); Main_Template : constant String := Compose (Template_Dir.all, "gate3_main", "tmplt"); -- the template file is <gate3_main.tmplt> located in -- directory of gate3 begin for I in 1 .. Window_Nbr loop declare P : constant String := Get_Attribute (Object_Store (I).Node, "id"); Class : constant String := Get_Attribute (Object_Store (I).Node, "class"); begin Append (Objects, P); if Object_Store (I).Signumber > 0 then Append (Ada_Objects, To_Ada (P)); end if; if Class = "GtkAboutDialog" or Class = "GtkDialog" or Class = "GtkWindow" then Append (Shows, True); else Append (Shows, False); end if; end; end loop; for I in 1 .. Signal_Number loop declare Handler : constant String := Get_Attribute (Retrieve_Signal_Node (I).Signal, "handler"); Ada_Handler : constant String := To_Ada (Handler); begin Append (Signals, Handler); Append (Ada_Signals, Ada_Handler); end; end loop; Translations := (1 => Templates_Parser.Assoc ("PROJECT", Project_Tag), 2 => Templates_Parser.Assoc ("GLADE_NAME", Glade_Tag), 3 => Templates_Parser.Assoc ("OBJECT", Objects), 4 => Templates_Parser.Assoc ("ADA_OBJECT", Ada_Objects), 5 => Templates_Parser.Assoc ("SHOW", Shows), 6 => Templates_Parser.Assoc ("SIGNAL", Signals), 7 => Templates_Parser.Assoc ("ADA_SIGNAL", Ada_Signals)); return Templates_Parser.Parse (Main_Template, Translations); end Print_Main; ------------------ -- Print_Spec -- ------------------ function Print_Spec (Window_Nbr : Object_Index) return String is Window : constant Node_Ptr := Object_Store (Window_Nbr).Node; Pack_Name : constant String := To_Ada (Get_Attribute (Window, "id")); Signal : Signal_Rec; Signal_Number : constant Natural := Get_Signal_Number; Package_Tag : constant Templates_Parser.Tag := +To_Ada (Pack_Name); Ada_Handlers : Templates_Parser.Vector_Tag; Cb_Procedures : Templates_Parser.Vector_Tag; Translations : Templates_Parser.Translate_Table (1 .. 3); Spec_Template : constant String := Compose (Template_Dir.all, "gate3_spec", "tmplt"); -- the template file is <gate3_spec.tmplt> located in -- directory of gate3 begin -- Output signal handlers for I in 1 .. Signal_Number loop Signal := Retrieve_Signal_Node (I); if Signal.Top_Window = Window_Nbr then -- output only signals belonging to present window/object declare Ada_Handler : constant String := To_Ada (Get_Attribute (Signal.Signal, "handler")); begin Append (Ada_Handlers, Ada_Handler); if Signal.Callback = Proc then Append (Cb_Procedures, True); else Append (Cb_Procedures, False); end if; end; end if; end loop; Translations := (1 => Templates_Parser.Assoc ("PACKAGE", Package_Tag), 2 => Templates_Parser.Assoc ("ADA_HANDLER", Ada_Handlers), 3 => Templates_Parser.Assoc ("CB_PROC", Cb_Procedures)); return Templates_Parser.Parse (Spec_Template, Translations); end Print_Spec; ------------------ -- Print_Body -- ------------------ function Print_Body (Window_Nbr : Object_Index) return String is Window : constant Node_Ptr := Object_Store (Window_Nbr).Node; Signal : Signal_Rec; Signal_Number : constant Natural := Get_Signal_Number; Pack_Name : constant String := To_Ada (Get_Attribute (Window, "id")); Package_Tag : constant Templates_Parser.Tag := +To_Ada (Pack_Name); Ada_Handlers : Templates_Parser.Vector_Tag; Cb_Procedures : Templates_Parser.Vector_Tag; Has_Quit : Templates_Parser.Vector_Tag; Translations : Templates_Parser.Translate_Table (1 .. 4); Body_Template : constant String := Compose (Template_Dir.all, "gate3_body", "tmplt"); -- the template file is <gate3_body.tmplt> located in directory of gate3 begin -- Output signal handlers for I in 1 .. Signal_Number loop Signal := Retrieve_Signal_Node (I); if Signal.Top_Window = Window_Nbr then -- output only signals belonging to present window/object declare Ada_Handler : constant String := To_Ada (Get_Attribute (Signal.Signal, "handler")); begin Append (Ada_Handlers, Ada_Handler); if Signal.Callback = Proc then Append (Cb_Procedures, True); else Append (Cb_Procedures, False); end if; -- Add a call to Main.Main_Quit if handler name contains <quit> if Signal.Has_Quit then Append (Has_Quit, True); else Append (Has_Quit, False); end if; end; end if; end loop; Translations := (1 => Templates_Parser.Assoc ("PACKAGE", Package_Tag), 2 => Templates_Parser.Assoc ("ADA_HANDLER", Ada_Handlers), 3 => Templates_Parser.Assoc ("CB_PROC", Cb_Procedures), 4 => Templates_Parser.Assoc ("HAS_QUIT", Has_Quit)); return Templates_Parser.Parse (Body_Template, Translations); end Print_Body; end Glade3_Generate;
32.189583
98
0.569607
c7a2d371507be20f378cc368035ace69c43d8754
3,051
adb
Ada
source/runtime/generated/google-protobuf-any.adb
mgrojo/protobuf
ffc50782c0c5bbb60e8f1504fcfc5a5fbafdb7dd
[ "MIT" ]
12
2020-05-04T09:30:21.000Z
2022-02-08T21:47:32.000Z
source/runtime/generated/google-protobuf-any.adb
mgrojo/protobuf
ffc50782c0c5bbb60e8f1504fcfc5a5fbafdb7dd
[ "MIT" ]
6
2021-03-16T15:17:33.000Z
2022-03-31T21:32:47.000Z
source/runtime/generated/google-protobuf-any.adb
mgrojo/protobuf
ffc50782c0c5bbb60e8f1504fcfc5a5fbafdb7dd
[ "MIT" ]
1
2021-03-16T15:09:27.000Z
2021-03-16T15:09:27.000Z
with Ada.Unchecked_Deallocation; with PB_Support.IO; with PB_Support.Internal; package body Google.Protobuf.Any is function Length (Self : Any_Vector) return Natural is begin return Self.Length; end Length; procedure Clear (Self : in out Any_Vector) is begin Self.Length := 0; end Clear; procedure Free is new Ada.Unchecked_Deallocation (Any_Array, Any_Array_Access); procedure Append (Self : in out Any_Vector; V : Any) is Init_Length : constant Positive := Positive'Max (1, 256 / Any'Size); begin if Self.Length = 0 then Self.Data := new Any_Array (1 .. Init_Length); elsif Self.Length = Self.Data'Last then Self.Data := new Any_Array'(Self.Data.all & Any_Array'(1 .. Self.Length => <>)); end if; Self.Length := Self.Length + 1; Self.Data (Self.Length) := V; end Append; overriding procedure Adjust (Self : in out Any_Vector) is begin if Self.Length > 0 then Self.Data := new Any_Array'(Self.Data (1 .. Self.Length)); end if; end Adjust; overriding procedure Finalize (Self : in out Any_Vector) is begin if Self.Data /= null then Free (Self.Data); end if; end Finalize; not overriding function Get_Any_Variable_Reference (Self : aliased in out Any_Vector; Index : Positive) return Any_Variable_Reference is begin return (Element => Self.Data (Index)'Access); end Get_Any_Variable_Reference; not overriding function Get_Any_Constant_Reference (Self : aliased Any_Vector; Index : Positive) return Any_Constant_Reference is begin return (Element => Self.Data (Index)'Access); end Get_Any_Constant_Reference; procedure Read_Any (Stream : access Ada.Streams.Root_Stream_Type'Class; V : out Any) is Key : aliased PB_Support.IO.Key; begin while PB_Support.IO.Read_Key (Stream, Key'Access) loop case Key.Field is when 1 => PB_Support.IO.Read (Stream, Key.Encoding, V.Type_Url); when 2 => PB_Support.IO.Read (Stream, Key.Encoding, V.Value); when others => PB_Support.IO.Unknown_Field (Stream, Key.Encoding); end case; end loop; end Read_Any; procedure Write_Any (Stream : access Ada.Streams.Root_Stream_Type'Class; V : Any) is begin if Stream.all not in PB_Support.Internal.Stream then declare WS : aliased PB_Support.Internal.Stream (Stream); begin Write_Any (WS'Access, V); return; end; end if; declare WS : PB_Support.Internal.Stream renames PB_Support.Internal.Stream (Stream.all); begin WS.Start_Message; WS.Write_Option (1, V.Type_Url); WS.Write_Option (2, V.Value); if WS.End_Message then Write_Any (WS'Access, V); end if; end; end Write_Any; end Google.Protobuf.Any;
28.783019
78
0.62078
9a978dbc5d89ab170658d27c8733dd0e3b752749
8,559
adb
Ada
source/nodes/program-nodes-formal_derived_type_definitions.adb
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
null
null
null
source/nodes/program-nodes-formal_derived_type_definitions.adb
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
null
null
null
source/nodes/program-nodes-formal_derived_type_definitions.adb
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
1
2019-10-16T09:05:27.000Z
2019-10-16T09:05:27.000Z
-- SPDX-FileCopyrightText: 2019 Max Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- package body Program.Nodes.Formal_Derived_Type_Definitions is function Create (Abstract_Token : Program.Lexical_Elements.Lexical_Element_Access; Limited_Token : Program.Lexical_Elements.Lexical_Element_Access; Synchronized_Token : Program.Lexical_Elements.Lexical_Element_Access; New_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Subtype_Mark : not null Program.Elements.Expressions .Expression_Access; And_Token : Program.Lexical_Elements.Lexical_Element_Access; Progenitors : Program.Elements.Expressions .Expression_Vector_Access; With_Token : Program.Lexical_Elements.Lexical_Element_Access; Private_Token : Program.Lexical_Elements.Lexical_Element_Access) return Formal_Derived_Type_Definition is begin return Result : Formal_Derived_Type_Definition := (Abstract_Token => Abstract_Token, Limited_Token => Limited_Token, Synchronized_Token => Synchronized_Token, New_Token => New_Token, Subtype_Mark => Subtype_Mark, And_Token => And_Token, Progenitors => Progenitors, With_Token => With_Token, Private_Token => Private_Token, Enclosing_Element => null) do Initialize (Result); end return; end Create; function Create (Subtype_Mark : not null Program.Elements.Expressions .Expression_Access; Progenitors : Program.Elements.Expressions .Expression_Vector_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False; Has_Abstract : Boolean := False; Has_Limited : Boolean := False; Has_Synchronized : Boolean := False; Has_With_Private : Boolean := False) return Implicit_Formal_Derived_Type_Definition is begin return Result : Implicit_Formal_Derived_Type_Definition := (Subtype_Mark => Subtype_Mark, Progenitors => Progenitors, Is_Part_Of_Implicit => Is_Part_Of_Implicit, Is_Part_Of_Inherited => Is_Part_Of_Inherited, Is_Part_Of_Instance => Is_Part_Of_Instance, Has_Abstract => Has_Abstract, Has_Limited => Has_Limited, Has_Synchronized => Has_Synchronized, Has_With_Private => Has_With_Private, Enclosing_Element => null) do Initialize (Result); end return; end Create; overriding function Subtype_Mark (Self : Base_Formal_Derived_Type_Definition) return not null Program.Elements.Expressions.Expression_Access is begin return Self.Subtype_Mark; end Subtype_Mark; overriding function Progenitors (Self : Base_Formal_Derived_Type_Definition) return Program.Elements.Expressions.Expression_Vector_Access is begin return Self.Progenitors; end Progenitors; overriding function Abstract_Token (Self : Formal_Derived_Type_Definition) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Abstract_Token; end Abstract_Token; overriding function Limited_Token (Self : Formal_Derived_Type_Definition) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Limited_Token; end Limited_Token; overriding function Synchronized_Token (Self : Formal_Derived_Type_Definition) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Synchronized_Token; end Synchronized_Token; overriding function New_Token (Self : Formal_Derived_Type_Definition) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.New_Token; end New_Token; overriding function And_Token (Self : Formal_Derived_Type_Definition) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.And_Token; end And_Token; overriding function With_Token (Self : Formal_Derived_Type_Definition) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.With_Token; end With_Token; overriding function Private_Token (Self : Formal_Derived_Type_Definition) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Private_Token; end Private_Token; overriding function Has_Abstract (Self : Formal_Derived_Type_Definition) return Boolean is begin return Self.Abstract_Token.Assigned; end Has_Abstract; overriding function Has_Limited (Self : Formal_Derived_Type_Definition) return Boolean is begin return Self.Limited_Token.Assigned; end Has_Limited; overriding function Has_Synchronized (Self : Formal_Derived_Type_Definition) return Boolean is begin return Self.Synchronized_Token.Assigned; end Has_Synchronized; overriding function Has_With_Private (Self : Formal_Derived_Type_Definition) return Boolean is begin return Self.With_Token.Assigned; end Has_With_Private; overriding function Is_Part_Of_Implicit (Self : Implicit_Formal_Derived_Type_Definition) return Boolean is begin return Self.Is_Part_Of_Implicit; end Is_Part_Of_Implicit; overriding function Is_Part_Of_Inherited (Self : Implicit_Formal_Derived_Type_Definition) return Boolean is begin return Self.Is_Part_Of_Inherited; end Is_Part_Of_Inherited; overriding function Is_Part_Of_Instance (Self : Implicit_Formal_Derived_Type_Definition) return Boolean is begin return Self.Is_Part_Of_Instance; end Is_Part_Of_Instance; overriding function Has_Abstract (Self : Implicit_Formal_Derived_Type_Definition) return Boolean is begin return Self.Has_Abstract; end Has_Abstract; overriding function Has_Limited (Self : Implicit_Formal_Derived_Type_Definition) return Boolean is begin return Self.Has_Limited; end Has_Limited; overriding function Has_Synchronized (Self : Implicit_Formal_Derived_Type_Definition) return Boolean is begin return Self.Has_Synchronized; end Has_Synchronized; overriding function Has_With_Private (Self : Implicit_Formal_Derived_Type_Definition) return Boolean is begin return Self.Has_With_Private; end Has_With_Private; procedure Initialize (Self : in out Base_Formal_Derived_Type_Definition'Class) is begin Set_Enclosing_Element (Self.Subtype_Mark, Self'Unchecked_Access); for Item in Self.Progenitors.Each_Element loop Set_Enclosing_Element (Item.Element, Self'Unchecked_Access); end loop; null; end Initialize; overriding function Is_Formal_Derived_Type_Definition (Self : Base_Formal_Derived_Type_Definition) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Formal_Derived_Type_Definition; overriding function Is_Formal_Type_Definition (Self : Base_Formal_Derived_Type_Definition) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Formal_Type_Definition; overriding function Is_Definition (Self : Base_Formal_Derived_Type_Definition) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Definition; overriding procedure Visit (Self : not null access Base_Formal_Derived_Type_Definition; Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is begin Visitor.Formal_Derived_Type_Definition (Self); end Visit; overriding function To_Formal_Derived_Type_Definition_Text (Self : in out Formal_Derived_Type_Definition) return Program.Elements.Formal_Derived_Type_Definitions .Formal_Derived_Type_Definition_Text_Access is begin return Self'Unchecked_Access; end To_Formal_Derived_Type_Definition_Text; overriding function To_Formal_Derived_Type_Definition_Text (Self : in out Implicit_Formal_Derived_Type_Definition) return Program.Elements.Formal_Derived_Type_Definitions .Formal_Derived_Type_Definition_Text_Access is pragma Unreferenced (Self); begin return null; end To_Formal_Derived_Type_Definition_Text; end Program.Nodes.Formal_Derived_Type_Definitions;
32.919231
74
0.7356
9a5806157d4b8e6cf960f2f57e4b9131a7571573
246
ads
Ada
software/hal/boards/stm32_common/sdram/stm32-sdram.ads
TUM-EI-RCS/StratoX
5fdd04e01a25efef6052376f43ce85b5bc973392
[ "BSD-3-Clause" ]
12
2017-06-08T14:19:57.000Z
2022-03-09T02:48:59.000Z
software/hal/boards/stm32_common/sdram/stm32-sdram.ads
TUM-EI-RCS/StratoX
5fdd04e01a25efef6052376f43ce85b5bc973392
[ "BSD-3-Clause" ]
6
2017-06-08T13:13:50.000Z
2020-05-15T09:32:43.000Z
software/hal/boards/stm32_common/sdram/stm32-sdram.ads
TUM-EI-RCS/StratoX
5fdd04e01a25efef6052376f43ce85b5bc973392
[ "BSD-3-Clause" ]
3
2017-06-30T14:05:06.000Z
2022-02-17T12:20:45.000Z
with System; package STM32.SDRAM is procedure Initialize; function Base_Address return System.Address; function Reserve (Amount : Word; Align : Word := Standard'Maximum_Alignment) return System.Address; end STM32.SDRAM;
17.571429
73
0.723577
1a48b7fe3e13dcf81c80f1ca90c125bbc8651eb5
5,461
ads
Ada
src/shared/generic/lsc-internal-ops32.ads
Componolit/libsparkcrypto
8531a07b6e9f5eb33eae0fa32759b4cbd3509d95
[ "OpenSSL", "Unlicense" ]
30
2018-05-18T09:11:50.000Z
2021-05-18T16:29:14.000Z
src/shared/generic/lsc-internal-ops32.ads
Componolit/libsparkcrypto
8531a07b6e9f5eb33eae0fa32759b4cbd3509d95
[ "OpenSSL", "Unlicense" ]
15
2018-12-13T07:53:36.000Z
2019-09-24T19:43:35.000Z
src/shared/generic/lsc-internal-ops32.ads
Componolit/libsparkcrypto
8531a07b6e9f5eb33eae0fa32759b4cbd3509d95
[ "OpenSSL", "Unlicense" ]
3
2019-04-04T17:41:29.000Z
2021-05-07T22:28:46.000Z
------------------------------------------------------------------------------- -- This file is part of libsparkcrypto. -- -- Copyright (C) 2010, Alexander Senier -- Copyright (C) 2010, secunet Security Networks AG -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- -- * Neither the name of the nor the names of its contributors may be used -- to endorse or promote products derived from this software without -- specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS -- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- with LSC.Internal.Types; use type LSC.Internal.Types.Word32; use type LSC.Internal.Types.Index; ------------------------------------------------------------------------------- -- Operations over 32-bit words ------------------------------------------------------------------------------- package LSC.Internal.Ops32 is pragma Pure; -- Convert the four byte values @Byte0@, @Byte1@, @Byte2@ and @Byte3@ to a -- 32-bit word function Bytes_To_Word (Byte0 : Types.Byte; Byte1 : Types.Byte; Byte2 : Types.Byte; Byte3 : Types.Byte) return Types.Word32; pragma Inline (Bytes_To_Word); -- Return a byte at @Position@ of the 32-bit word @Value@ function ByteX (Value : Types.Word32; Position : Types.Byte_Array32_Index) return Types.Byte; pragma Inline (ByteX); -- Return the first byte of the 32-bit word @Value@ function Byte0 (Value : Types.Word32) return Types.Byte; pragma Inline (Byte0); -- Return the second byte of the 32-bit word @Value@ function Byte1 (Value : Types.Word32) return Types.Byte; pragma Inline (Byte1); -- Return the third byte of the 32-bit word @Value@ function Byte2 (Value : Types.Word32) return Types.Byte; pragma Inline (Byte2); -- Return the fourth byte of the 32-bit word @Value@ function Byte3 (Value : Types.Word32) return Types.Byte; pragma Inline (Byte3); -- Perform XOR on two 32-bit words @V0@ and @V1@ function XOR2 (V0, V1 : Types.Word32) return Types.Word32 with Post => XOR2'Result = (V0 xor V1); pragma Inline (XOR2); -- Perform XOR on three 32-bit words @V0@, @V1@ and @V2@ function XOR3 (V0, V1, V2 : Types.Word32) return Types.Word32 with Post => XOR3'Result = (V0 xor V1 xor V2); pragma Inline (XOR3); -- Perform XOR on four 32-bit words @V0@, @V1@, @V2@ and @V3@ function XOR4 (V0, V1, V2, V3 : Types.Word32) return Types.Word32 with Post => XOR4'Result = (V0 xor V1 xor V2 xor V3); pragma Inline (XOR4); -- Perform XOR on four 32-bit words @V0@, @V1@, @V2@, @V3@ and @V4@ function XOR5 (V0, V1, V2, V3, V4 : Types.Word32) return Types.Word32 with Post => XOR5'Result = (V0 xor V1 xor V2 xor V3 xor V4); pragma Inline (XOR5); -- Perform XOR on two arrays of 32-bit words -- -- @Left@ - First input array <br> -- @Right@ - Second input array <br> -- @Result@ - Result array <br> procedure Block_XOR (Left : in Types.Word32_Array_Type; Right : in Types.Word32_Array_Type; Result : out Types.Word32_Array_Type) with Depends => (Result =>+ (Left, Right)), Pre => Left'First = Right'First and Left'Last = Right'Last and Right'First = Result'First and Right'Last = Result'Last, Post => (for all I in Types.Index range Left'First .. Left'Last => (Result (I) = XOR2 (Left (I), Right (I)))); pragma Inline (Block_XOR); -- Copy all elements of @Source@ to @Dest@. Should @Source@ be shorter than -- @Dest@, remaining elements stay unchanged. procedure Block_Copy (Source : in Types.Word32_Array_Type; Dest : in out Types.Word32_Array_Type) with Depends => (Dest =>+ Source), Pre => Source'First = Dest'First and Source'Last <= Dest'Last, Post => (for all P in Types.Index range Source'First .. Source'Last => (Dest (P) = Source (P))); pragma Inline (Block_Copy); end LSC.Internal.Ops32;
40.451852
79
0.617469
2e2651122d7ec3a87c00f46c0a835cf528177a00
15,000
adb
Ada
Logging/src/logging-logger.adb
marcbejerano/ada-tools
49a7cc29100535e82d17d9d6f9878d1272ca6ec7
[ "BSD-3-Clause" ]
2
2015-08-05T07:02:49.000Z
2016-08-25T16:39:21.000Z
Logging/src/logging-logger.adb
marcbejerano/ada-tools
49a7cc29100535e82d17d9d6f9878d1272ca6ec7
[ "BSD-3-Clause" ]
null
null
null
Logging/src/logging-logger.adb
marcbejerano/ada-tools
49a7cc29100535e82d17d9d6f9878d1272ca6ec7
[ "BSD-3-Clause" ]
null
null
null
-- @(#)File: logging-logger.adb -- @(#)Last changed: June 12 2015 13:50:00 -- @(#)Purpose: Application and system logging -- @(#)Author: Marc Bejerano <[email protected]> -- @(#)Copyright: Copyright (C) 2015, Marc Bejerano, All Rights Reserved -- @(#)Product: None -- @(#)License: BSD3 -- -- Copyright (c) 2015, Marc Bejerano -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, this -- list of conditions and the following disclaimer. -- -- * Redistributions in binary form must reproduce the above copyright notice, -- this list of conditions and the following disclaimer in the documentation -- and/or other materials provided with the distribution. -- -- * Neither the name of ada-tools nor the names of its -- contributors may be used to endorse or promote products derived from -- this software without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. with Ada.Calendar; use Ada.Calendar; with Ada.Containers.Hashed_Maps; use Ada.Containers; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings.Unbounded.Hash; with GNAT.String_Split; with Properties; use Properties; package body Logging.Logger is -- -- Hash the given key into a Hash object. -- @param key Key to hash -- @return Hash object -- function Key_Hashed(key: in Unbounded_String) return Hash_Type is begin return Hash(key); end Key_Hashed; package Logger_Table is new Ada.Containers.Hashed_Maps (Key_Type => Unbounded_String, Element_Type => Logger_Ptr, Hash => Key_Hashed, Equivalent_Keys => "="); use type Logger_Table.Cursor; package Appender_Table is new Ada.Containers.Hashed_Maps (Key_Type => Unbounded_String, Element_Type => Appender.Appender_Class_Ptr, Hash => Key_Hashed, Equivalent_Keys => "="); use type Appender_Table.Cursor; Console : Appender_Class_Ptr; Console_Logger : Logger_Ptr; Loggers : Logger_Table.Map; Appenders : Appender_Table.Map; -- -- Class that describes a protected logger instance. -- protected body Logger is -- -- Set the minimum priority level that will be displayed when -- log messages are sent to this logger. -- @param aLevel Priorty level -- procedure Set_Level(aLevel: in Level.Level) is begin Min_Priority_Level := aLevel; end Set_Level; -- -- Add an output appender to this logger -- @param aAppender An appender -- procedure Add_Appender(aAppender: in Appender.Appender_Class_Ptr) is begin Appenders.Append(aAppender); end Add_Appender; -- -- Return the vector of Appenders contained in this logger. -- @return Vector of appenders -- function Get_Appenders return Appender.Appender_Vectors.Vector is begin return Appenders; end Get_Appenders; -- -- Send the given log message with the specified priority to the logger's -- output handlers. If the specified priority is below the current minimum -- threshold then the message will be ignored. -- @param aLevel Priority level of the given message -- @param aMessage Message to send to logger -- procedure Log(aLevel: in Level.Level; aMessage: in String) is event : Log_Event; begin event.File_Name := Null_Unbounded_String; event.Entity := Null_Unbounded_String; event.Line_Number := -1; event.Priority := aLevel; event.Message := To_Unbounded_String(aMessage); event.Timestamp := Clock; Log(aLevel, event); end log; -- -- Send the given Log_Event with the specified priority to the logger's -- output handlers. If the specified priority is below the current minimum -- threshold then the Log_Event will be ignored. -- @param aLevel Priority level of the given message -- @param aEvent Log_Event to send to the logger -- procedure Log(aLevel: in Level.Level; aEvent: in Log_Event) is tmpEvent : Log_Event := aEvent; begin if aLevel <= Min_Priority_Level then tmpEvent.Priority := aLevel; if Appenders.Is_Empty then Console.Put(tmpEvent); else declare aCursor: Appender_Vectors.Cursor := Appenders.First; aAppender: Appender.Appender_Class_Ptr; begin while Appender_Vectors.Has_Element(aCursor) loop aAppender := Appender_Vectors.Element(aCursor); aAppender.Put(tmpEvent); aCursor := Appender_Vectors.Next(aCursor); end loop; end; end if; end if; end log; -- -- Shortcut to the Log() function that will log an arbitrary message using -- the requested priority level. -- @param aMessage Message to log -- procedure Fatal(aMessage: in String) is begin Log(Level.FATAL, aMessage); end Fatal; procedure Error(aMessage: in String) is begin Log(Level.ERROR, aMessage); end Error; procedure Warn (aMessage: in String) is begin Log(Level.WARN, aMessage); end Warn; procedure Info (aMessage: in String) is begin Log(Level.INFO, aMessage); end Info; procedure Debug(aMessage: in String) is begin Log(Level.DEBUG, aMessage); end Debug; procedure Trace(aMessage: in String) is begin Log(Level.TRACE, aMessage); end Trace; -- -- Shortcut to the Log() function that will log a Log_Event using the -- requested priority level. -- @param aEvent Log event to send to the logger -- procedure Fatal(aEvent: in Log_Event) is begin Log(Level.FATAL, aEvent); end Fatal; procedure Error(aEvent: in Log_Event) is begin Log(Level.ERROR, aEvent); end Error; procedure Warn (aEvent: in Log_Event) is begin Log(Level.WARN, aEvent); end Warn; procedure Info (aEvent: in Log_Event) is begin Log(Level.INFO, aEvent); end Info; procedure Debug(aEvent: in Log_Event) is begin Log(Level.DEBUG, aEvent); end Debug; procedure Trace(aEvent: in Log_Event) is begin Log(Level.TRACE, aEvent); end Trace; end Logger; -- -- Get the named logger from the logging pool -- @param aLoggerName Name of the logger to use -- @return Logger object -- function Get_Logger(aLoggerName: in String) return Logger_Ptr is aLogger: Logger_Ptr := Console_Logger; aKey: constant Unbounded_String := To_Unbounded_String(aLoggerName); begin if Loggers.Find(aKey) /= Logger_Table.No_Element then aLogger := Loggers.Element(aKey); end if; return aLogger; end Get_Logger; function Starts_With(aString: in String; aFindString: in String) return Boolean is Result : Boolean := False; begin if aString'Length >= aFindString'Length and then aString(aString'First .. aString'First + aFindString'Length - 1) = aFindString then Result := True; end if; return Result; end Starts_With; -- -- Constants for the intialization function -- APPENDER_PREFIX: constant String := "appender."; type StrArray is array (Positive range <>) of Ada.Strings.Unbounded.Unbounded_String; function String_Split(aString: in String; aSeparator: in String := ",") return StrArray is Tokens : GNAT.String_Split.Slice_Set; begin GNAT.String_Split.Create (S => Tokens, From => aString, Separators => aSeparator, Mode => GNAT.String_Split.Single); declare Output : StrArray(1 .. Natural(GNAT.String_Split.Slice_Count(Tokens))); begin for I in Output'Range loop Output (I) := Ada.Strings.Unbounded.To_Unbounded_String (GNAT.String_Split.Slice (Tokens, GNAT.String_Split.Slice_Number (I))); end loop; return Output; end; end String_Split; -- -- Initialize the logging system with settings from the given -- properties file. -- @param aFile_Name Name of the properties file -- procedure Init_Logging(aFile_Name: in String) is aProps: Properties.Properties; aKeys: Properties.Key_Vector.Vector; begin Load(aProps, aFile_Name); aKeys := aProps.Property_Names; -- -- THIS NEEDS TO BE OPTIMIZED!! -- -- first pass: find all appenders and create them in an associative container for key_index in 0..Integer(aKeys.Length) - 1 loop declare aKeyString: constant String := To_String(aKeys(key_index)); begin -- check for an appender line if Starts_With(aKeyString, APPENDER_PREFIX) and then Count(aKeyString, ".") = 1 then declare aName: constant Unbounded_String := To_Unbounded_String(aKeyString(Index(aKeyString, ".") + 1 .. aKeyString'Last)); aValue: constant Unbounded_String := To_Unbounded_String(aProps.Get_Property(aKeyString)); aAppender: Appender.Appender_Class_Ptr := null; begin if aValue = "ConsoleAppender" then aAppender := new Console_Appender; elsif aValue = "FileAppender" then aAppender := new File_Appender; end if; if aAppender /= null then if Appenders.Find(aName) /= Appender_Table.No_Element then Appenders.Replace(Key => aName, New_Item => aAppender); else Appenders.Insert(Key => aName, New_Item => aAppender); end if; end if; end; end if; end; end loop; -- second pass: update the appenders with all of their properties for key_index in 0..Integer(aKeys.Length) - 1 loop declare aKeyString: constant String := To_String(aKeys(key_index)); begin if Starts_With(aKeyString, APPENDER_PREFIX) and then Count(aKeyString, ".") > 1 then declare aFirstDot: constant Natural := Index(aKeyString, "."); aSecondDot: constant Natural := Index(aKeyString, ".", aFirstDot + 1); aName: constant Unbounded_String := To_Unbounded_String(aKeyString(aFirstDot + 1 .. aSecondDot - 1)); aParam: constant Unbounded_String := To_Unbounded_String(aKeyString(aSecondDot + 1 .. aKeyString'Length)); aValue: constant Unbounded_String := To_Unbounded_String(aProps.Get_Property(aKeyString)); aAppender: Appender.Appender_Class_Ptr := null; begin if Appenders.Find(aName) /= Appender_Table.No_Element then aAppender := Appenders.Element(aName); if aParam = "layout" then aAppender.Set_Pattern(To_String(aValue)); elsif aParam = "filename" then Appender.File_Appender_Ptr(aAppender).Set_File_Name(To_String(aValue)); end if; end if; end; end if; end; end loop; -- third pass: create the loggers for key_index in 0..Integer(aKeys.Length) - 1 loop declare aKeyString: constant String := To_String(aKeys(key_index)); aValue: constant Unbounded_String := To_Unbounded_String(aProps.Get_Property(aKeyString)); aTokens: constant StrArray := String_Split(To_String(aValue)); begin if aKeyString'Length > 0 and not Starts_With(aKeyString, APPENDER_PREFIX) then declare aLogger: constant Logger_Ptr := new Logger; begin aLogger.Set_Level(Level.To_Level(To_String(aTokens(1)))); for adx in 2 .. aTokens'Length loop if Appenders.Find(aTokens(adx)) /= Appender_Table.No_Element then aLogger.Add_Appender(Appenders.Element(aTokens(adx))); end if; end loop; if Loggers.Find(To_Unbounded_String(aKeyString)) /= Logger_Table.No_Element then Loggers.Replace(Key => To_Unbounded_String(aKeyString), New_Item => aLogger); else Loggers.Insert(Key => To_Unbounded_String(aKeyString), New_Item => aLogger); end if; end; end if; end; end loop; end Init_Logging; begin Console := new Console_Appender; Console.Set_Pattern("%d{ISO8601} %m%n"); Console_Logger := new Logger; Console_Logger.Add_Appender(Console); Console_Logger.Set_Level(DEBUG); end Logging.Logger;
43.227666
139
0.586733
22b392697a64e978487673db4b57e4321e0b7ffc
5,717
ads
Ada
source/league/league-base_codecs.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/league/league-base_codecs.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/league/league-base_codecs.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
4
2017-07-18T07:11:05.000Z
2020-06-21T03:02:25.000Z
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012-2015, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This package provides implementation of codecs for 'baseXX' encoding -- according to RFC 4648. -- -- Supported encodings: -- - base64 -- - base64url ------------------------------------------------------------------------------ with League.Stream_Element_Vectors; with League.Strings; package League.Base_Codecs is pragma Preelaborate; ------------ -- base64 -- ------------ function To_Base_64 (Data : League.Stream_Element_Vectors.Stream_Element_Vector) return League.Strings.Universal_String; -- Converts binary data into base64 textual representation. It doesn't -- insert any line feeds. function From_Base_64 (Data : League.Strings.Universal_String) return League.Stream_Element_Vectors.Stream_Element_Vector; -- Converts base64 textual representation of data into original binary -- form. This subprogram doesn't handle line feed. Raises Constraint_Error -- when Data can't be converted. procedure From_Base_64 (Data : League.Strings.Universal_String; Value : in out League.Stream_Element_Vectors.Stream_Element_Vector; Success : out Boolean); -- Converts base64 textual representation of data into original binary -- form. This subprogram doesn't handle line feed. Sets Success to False -- when Data can't be converted. --------------- -- base64url -- --------------- function To_Base_64_URL (Data : League.Stream_Element_Vectors.Stream_Element_Vector) return League.Strings.Universal_String; -- Converts binary data into base64 textual representation. It doesn't -- insert any line feeds. function From_Base_64_URL (Data : League.Strings.Universal_String) return League.Stream_Element_Vectors.Stream_Element_Vector; -- Converts base64url textual representation of data into original binary -- form. This subprogram doesn't handle line feed. Raises Constraint_Error -- when Data can't be converted. procedure From_Base_64_URL (Data : League.Strings.Universal_String; Value : in out League.Stream_Element_Vectors.Stream_Element_Vector; Success : out Boolean); -- Converts base64url textual representation of data into original binary -- form. This subprogram doesn't handle line feed. Sets Success to False -- when Data can't be converted. end League.Base_Codecs;
52.449541
78
0.521777
1a0dad87553721cd9029da66e58a7b51196895a8
11,917
ads
Ada
include/sf-window-event.ads
danva994/ASFML-1.6
bd74ae700843338a15aef295f99297b866aa0c93
[ "Zlib" ]
1
2017-10-07T06:20:38.000Z
2017-10-07T06:20:38.000Z
include/sf-window-event.ads
danva994/ASFML-1.6
bd74ae700843338a15aef295f99297b866aa0c93
[ "Zlib" ]
3
2020-09-15T21:19:34.000Z
2022-03-02T23:13:46.000Z
include/sf-window-event.ads
danva994/ASFML-1.6
bd74ae700843338a15aef295f99297b866aa0c93
[ "Zlib" ]
2
2020-09-26T21:16:43.000Z
2022-01-16T19:36:48.000Z
-- //////////////////////////////////////////////////////////// -- // -- // SFML - Simple and Fast Multimedia Library -- // Copyright (C) 2007-2009 Laurent Gomila ([email protected]) -- // -- // This software is provided 'as-is', without any express or implied warranty. -- // In no event will the authors be held liable for any damages arising from the use of this software. -- // -- // Permission is granted to anyone to use this software for any purpose, -- // including commercial applications, and to alter it and redistribute it freely, -- // subject to the following restrictions: -- // -- // 1. The origin of this software must not be misrepresented; -- // you must not claim that you wrote the original software. -- // If you use this software in a product, an acknowledgment -- // in the product documentation would be appreciated but is not required. -- // -- // 2. Altered source versions must be plainly marked as such, -- // and must not be misrepresented as being the original software. -- // -- // 3. This notice may not be removed or altered from any source distribution. -- // -- //////////////////////////////////////////////////////////// -- //////////////////////////////////////////////////////////// -- // Headers -- //////////////////////////////////////////////////////////// with Sf.Config; package Sf.Window.Event is use Sf.Config; -- //////////////////////////////////////////////////////////// -- /// Definition of key codes for keyboard events -- //////////////////////////////////////////////////////////// subtype sfKeyCode is sfUint32; sfKeyA : constant sfKeyCode := 97; sfKeyB : constant sfKeyCode := 98; sfKeyC : constant sfKeyCode := 99; sfKeyD : constant sfKeyCode := 100; sfKeyE : constant sfKeyCode := 101; sfKeyF : constant sfKeyCode := 102; sfKeyG : constant sfKeyCode := 103; sfKeyH : constant sfKeyCode := 104; sfKeyI : constant sfKeyCode := 105; sfKeyJ : constant sfKeyCode := 106; sfKeyK : constant sfKeyCode := 107; sfKeyL : constant sfKeyCode := 108; sfKeyM : constant sfKeyCode := 109; sfKeyN : constant sfKeyCode := 110; sfKeyO : constant sfKeyCode := 111; sfKeyP : constant sfKeyCode := 112; sfKeyQ : constant sfKeyCode := 113; sfKeyR : constant sfKeyCode := 114; sfKeyS : constant sfKeyCode := 115; sfKeyT : constant sfKeyCode := 116; sfKeyU : constant sfKeyCode := 117; sfKeyV : constant sfKeyCode := 118; sfKeyW : constant sfKeyCode := 119; sfKeyX : constant sfKeyCode := 120; sfKeyY : constant sfKeyCode := 121; sfKeyZ : constant sfKeyCode := 122; sfKeyNum0 : constant sfKeyCode := 48; sfKeyNum1 : constant sfKeyCode := 49; sfKeyNum2 : constant sfKeyCode := 50; sfKeyNum3 : constant sfKeyCode := 51; sfKeyNum4 : constant sfKeyCode := 52; sfKeyNum5 : constant sfKeyCode := 53; sfKeyNum6 : constant sfKeyCode := 54; sfKeyNum7 : constant sfKeyCode := 55; sfKeyNum8 : constant sfKeyCode := 56; sfKeyNum9 : constant sfKeyCode := 57; sfKeyEscape : constant sfKeyCode := 256; sfKeyLControl : constant sfKeyCode := 257; sfKeyLShift : constant sfKeyCode := 258; sfKeyLAlt : constant sfKeyCode := 259; sfKeyLSystem : constant sfKeyCode := 260; sfKeyRControl : constant sfKeyCode := 261; sfKeyRShift : constant sfKeyCode := 262; sfKeyRAlt : constant sfKeyCode := 263; sfKeyRSystem : constant sfKeyCode := 264; sfKeyMenu : constant sfKeyCode := 265; sfKeyLBracket : constant sfKeyCode := 266; sfKeyRBracket : constant sfKeyCode := 267; sfKeySemiColon : constant sfKeyCode := 268; sfKeyComma : constant sfKeyCode := 269; sfKeyPeriod : constant sfKeyCode := 270; sfKeyQuote : constant sfKeyCode := 271; sfKeySlash : constant sfKeyCode := 272; sfKeyBackSlash : constant sfKeyCode := 273; sfKeyTilde : constant sfKeyCode := 274; sfKeyEqual : constant sfKeyCode := 275; sfKeyDash : constant sfKeyCode := 276; sfKeySpace : constant sfKeyCode := 277; sfKeyReturn : constant sfKeyCode := 278; sfKeyBack : constant sfKeyCode := 279; sfKeyTab : constant sfKeyCode := 280; sfKeyPageUp : constant sfKeyCode := 281; sfKeyPageDown : constant sfKeyCode := 282; sfKeyEnd : constant sfKeyCode := 283; sfKeyHome : constant sfKeyCode := 284; sfKeyInsert : constant sfKeyCode := 285; sfKeyDelete : constant sfKeyCode := 286; sfKeyAdd : constant sfKeyCode := 287; sfKeySubtract : constant sfKeyCode := 288; sfKeyMultiply : constant sfKeyCode := 289; sfKeyDivide : constant sfKeyCode := 290; sfKeyLeft : constant sfKeyCode := 291; sfKeyRight : constant sfKeyCode := 292; sfKeyUp : constant sfKeyCode := 293; sfKeyDown : constant sfKeyCode := 294; sfKeyNumpad0 : constant sfKeyCode := 295; sfKeyNumpad1 : constant sfKeyCode := 296; sfKeyNumpad2 : constant sfKeyCode := 297; sfKeyNumpad3 : constant sfKeyCode := 298; sfKeyNumpad4 : constant sfKeyCode := 299; sfKeyNumpad5 : constant sfKeyCode := 300; sfKeyNumpad6 : constant sfKeyCode := 301; sfKeyNumpad7 : constant sfKeyCode := 302; sfKeyNumpad8 : constant sfKeyCode := 303; sfKeyNumpad9 : constant sfKeyCode := 304; sfKeyF1 : constant sfKeyCode := 305; sfKeyF2 : constant sfKeyCode := 306; sfKeyF3 : constant sfKeyCode := 307; sfKeyF4 : constant sfKeyCode := 308; sfKeyF5 : constant sfKeyCode := 309; sfKeyF6 : constant sfKeyCode := 310; sfKeyF7 : constant sfKeyCode := 311; sfKeyF8 : constant sfKeyCode := 312; sfKeyF9 : constant sfKeyCode := 313; sfKeyF10 : constant sfKeyCode := 314; sfKeyF11 : constant sfKeyCode := 315; sfKeyF12 : constant sfKeyCode := 316; sfKeyF13 : constant sfKeyCode := 317; sfKeyF14 : constant sfKeyCode := 318; sfKeyF15 : constant sfKeyCode := 319; sfKeyPause : constant sfKeyCode := 320; sfKeyCount : constant sfKeyCode := 321; -- //////////////////////////////////////////////////////////// -- /// Definition of button codes for mouse events -- //////////////////////////////////////////////////////////// type sfMouseButton is (sfButtonLeft, sfButtonRight, sfButtonMiddle, sfButtonX1, sfButtonX2); -- //////////////////////////////////////////////////////////// -- /// Definition of joystick axis for joystick events -- //////////////////////////////////////////////////////////// type sfJoyAxis is ( sfJoyAxisX, sfJoyAxisY, sfJoyAxisZ, sfJoyAxisR, sfJoyAxisU, sfJoyAxisV, sfJoyAxisPOV); -- //////////////////////////////////////////////////////////// -- /// Definition of all the event types -- //////////////////////////////////////////////////////////// type sfEventType is ( sfEvtClosed, sfEvtResized, sfEvtLostFocus, sfEvtGainedFocus, sfEvtTextEntered, sfEvtKeyPressed, sfEvtKeyReleased, sfEvtMouseWheelMoved, sfEvtMouseButtonPressed, sfEvtMouseButtonReleased, sfEvtMouseMoved, sfEvtMouseEntered, sfEvtMouseLeft, sfEvtJoyButtonPressed, sfEvtJoyButtonReleased, sfEvtJoyMoved); -- //////////////////////////////////////////////////////////// -- /// Keyboard event parameters -- //////////////////////////////////////////////////////////// type sfKeyEvent is record Event_Type : aliased sfEventType; Code : aliased sfKeyCode; Alt : aliased sfBool; Control : aliased sfBool; Shift : aliased sfBool; end record; -- //////////////////////////////////////////////////////////// -- /// Text event parameters -- //////////////////////////////////////////////////////////// type sfTextEvent is record Event_Type : aliased sfEventType; Unicode : aliased sfUint32; end record; -- //////////////////////////////////////////////////////////// -- /// Mouse move event parameters -- //////////////////////////////////////////////////////////// type sfMouseMoveEvent is record Event_Type : aliased sfEventType; X : aliased Integer; Y : aliased Integer; end record; -- //////////////////////////////////////////////////////////// -- /// Mouse buttons events parameters -- //////////////////////////////////////////////////////////// type sfMouseButtonEvent is record Event_Type : aliased sfEventType; Button : aliased sfMouseButton; X : aliased Integer; Y : aliased Integer; end record; -- //////////////////////////////////////////////////////////// -- /// Mouse wheel events parameters -- //////////////////////////////////////////////////////////// type sfMouseWheelEvent is record Event_Type : aliased sfEventType; Delta_Value : aliased Integer; end record; -- //////////////////////////////////////////////////////////// -- /// Joystick axis move event parameters -- //////////////////////////////////////////////////////////// type sfJoyMoveEvent is record Event_Type : aliased sfEventType; JoystickId : aliased sfUint32; Axis : aliased sfJoyAxis; Position : aliased Float; end record; -- //////////////////////////////////////////////////////////// -- /// Joystick buttons events parameters -- //////////////////////////////////////////////////////////// type sfJoyButtonEvent is record Event_Type : aliased sfEventType; JoystickId : aliased sfUint32; Button : aliased sfUint32; end record; -- //////////////////////////////////////////////////////////// -- /// Size events parameters -- //////////////////////////////////////////////////////////// type sfSizeEvent is record Event_Type : aliased sfEventType; Width : aliased sfUint32; Height : aliased sfUint32; end record; -- //////////////////////////////////////////////////////////// -- /// sfEvent defines a system event and its parameters -- //////////////////////////////////////////////////////////// type sfEvent (Discr : sfUint32 := 0) is record case Discr is when 0 => Event_Type : aliased sfEventType; when 1 => Key : aliased sfKeyEvent; when 2 => Text : aliased sfTextEvent; when 3 => MouseMove : aliased sfMouseMoveEvent; when 4 => MouseButton : aliased sfMouseButtonEvent; when 5 => MouseWheel : aliased sfMouseWheelEvent; when 6 => JoyMove : aliased sfJoyMoveEvent; when 7 => JoyButton : aliased sfJoyButtonEvent; when others => Size : aliased sfSizeEvent; end case; end record; private pragma Convention (C, sfMouseButton); pragma Convention (C, sfJoyAxis); pragma Convention (C, sfEventType); pragma Convention (C_Pass_By_Copy, sfKeyEvent); pragma Convention (C_Pass_By_Copy, sfTextEvent); pragma Convention (C_Pass_By_Copy, sfMouseMoveEvent); pragma Convention (C_Pass_By_Copy, sfMouseButtonEvent); pragma Convention (C_Pass_By_Copy, sfMouseWheelEvent); pragma Convention (C_Pass_By_Copy, sfJoyMoveEvent); pragma Convention (C_Pass_By_Copy, sfJoyButtonEvent); pragma Convention (C_Pass_By_Copy, sfSizeEvent); pragma Convention (C_Pass_By_Copy, sfEvent); pragma Unchecked_Union (sfEvent); end Sf.Window.Event;
39.989933
104
0.532265
9a7a18512f035a26223d3b543146abb3d36fe332
785
ads
Ada
source/asis/spec/ada-numerics-elementary_functions.ads
faelys/gela-asis
48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253
[ "BSD-3-Clause" ]
4
2016-02-05T15:51:56.000Z
2022-03-25T20:38:32.000Z
source/asis/spec/ada-numerics-elementary_functions.ads
faelys/gela-asis
48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253
[ "BSD-3-Clause" ]
null
null
null
source/asis/spec/ada-numerics-elementary_functions.ads
faelys/gela-asis
48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------ -- A d a r u n - t i m e s p e c i f i c a t i o n -- -- ASIS implementation for Gela project, a portable Ada compiler -- -- http://gela.ada-ru.org -- -- - - - - - - - - - - - - - - - -- -- Read copyright and license at the end of ada.ads file -- ------------------------------------------------------------------------------ -- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $ with Ada.Numerics.Generic_Elementary_Functions; package Ada.Numerics.Elementary_Functions is new Ada.Numerics.Generic_Elementary_Functions (Float);
49.0625
78
0.393631
9a5ee70fad3793c6e70e5938f172fef0038f42e0
6,995
adb
Ada
source/environment/machine-apple-darwin/s-naenva.adb
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
33
2015-04-04T09:19:36.000Z
2021-11-10T05:33:34.000Z
source/environment/machine-apple-darwin/s-naenva.adb
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
8
2017-11-14T13:05:07.000Z
2018-08-09T15:28:49.000Z
source/environment/machine-apple-darwin/s-naenva.adb
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
9
2015-02-03T17:09:53.000Z
2021-11-12T01:16:05.000Z
with System.Address_To_Constant_Access_Conversions; with System.Address_To_Named_Access_Conversions; with System.Environment_Block; with System.Storage_Elements; with System.Zero_Terminated_Strings; with C.stdlib; package body System.Native_Environment_Variables is use type Storage_Elements.Storage_Offset; use type C.char_const_ptr; use type C.char_ptr; use type C.char_ptr_ptr; use type C.signed_int; use type C.ptrdiff_t; use type C.size_t; function strlen (s : not null access constant C.char) return C.size_t with Import, Convention => Intrinsic, External_Name => "__builtin_strlen"; function strchr ( s : not null access constant C.char; c : Standard.C.signed_int) return Standard.C.char_const_ptr with Import, Convention => Intrinsic, External_Name => "__builtin_strchr"; package char_const_ptr_Conv is new Address_To_Constant_Access_Conversions (C.char, C.char_const_ptr); package char_ptr_ptr_Conv is new Address_To_Named_Access_Conversions (C.char_ptr, C.char_ptr_ptr); function getenv (Name : String) return C.char_ptr; function getenv (Name : String) return C.char_ptr is C_Name : C.char_array ( 0 .. Name'Length * Zero_Terminated_Strings.Expanding); begin Zero_Terminated_Strings.To_C (Name, C_Name (0)'Access); return C.stdlib.getenv (C_Name (0)'Access); end getenv; procedure Do_Separate ( Item : not null C.char_const_ptr; Name_Length : out C.size_t; Value : out C.char_const_ptr); procedure Do_Separate ( Item : not null C.char_const_ptr; Name_Length : out C.size_t; Value : out C.char_const_ptr) is P : C.char_const_ptr; begin P := strchr (Item, C.char'Pos ('=')); if P /= null then Name_Length := C.size_t ( char_const_ptr_Conv.To_Address (P) - char_const_ptr_Conv.To_Address (Item)); Value := char_const_ptr_Conv.To_Pointer ( char_const_ptr_Conv.To_Address (P) + Storage_Elements.Storage_Offset'(1)); else Name_Length := strlen (Item); Value := char_const_ptr_Conv.To_Pointer ( char_const_ptr_Conv.To_Address (C.char_const_ptr (Item)) + Storage_Elements.Storage_Offset (Name_Length)); end if; end Do_Separate; -- implementation function Value (Name : String) return String is Result : C.char_ptr; begin Result := getenv (Name); if Result = null then raise Constraint_Error; else return Zero_Terminated_Strings.Value (Result); end if; end Value; function Value (Name : String; Default : String) return String is Result : C.char_ptr; begin Result := getenv (Name); if Result = null then return Default; else return Zero_Terminated_Strings.Value (Result); end if; end Value; function Exists (Name : String) return Boolean is Item : C.char_ptr; begin Item := getenv (Name); return Item /= null; end Exists; procedure Set (Name : String; Value : String) is C_Name : C.char_array ( 0 .. Name'Length * Zero_Terminated_Strings.Expanding); C_Value : C.char_array ( 0 .. Value'Length * Zero_Terminated_Strings.Expanding); begin Zero_Terminated_Strings.To_C (Name, C_Name (0)'Access); Zero_Terminated_Strings.To_C (Value, C_Value (0)'Access); if C.stdlib.setenv (C_Name (0)'Access, C_Value (0)'Access, 1) < 0 then raise Constraint_Error; end if; end Set; procedure Clear (Name : String) is C_Name : C.char_array ( 0 .. Name'Length * Zero_Terminated_Strings.Expanding); begin Zero_Terminated_Strings.To_C (Name, C_Name (0)'Access); if C.stdlib.unsetenv (C_Name (0)'Access) < 0 then raise Constraint_Error; end if; end Clear; procedure Clear is Block : constant C.char_ptr_ptr := Environment_Block; I : C.char_ptr_ptr := Block; begin while I.all /= null loop I := char_ptr_ptr_Conv.To_Pointer ( char_ptr_ptr_Conv.To_Address (I) + Storage_Elements.Storage_Offset'( C.char_ptr'Size / Standard'Storage_Unit)); end loop; while I /= Block loop I := char_ptr_ptr_Conv.To_Pointer ( char_ptr_ptr_Conv.To_Address (I) - Storage_Elements.Storage_Offset'( C.char_ptr'Size / Standard'Storage_Unit)); declare Item : constant C.char_const_ptr := C.char_const_ptr (I.all); Name_Length : C.size_t; Value : C.char_const_ptr; begin Do_Separate (Item, Name_Length, Value); declare Name : aliased C.char_array (0 .. Name_Length); begin declare Item_All : C.char_array (0 .. Name_Length - 1); for Item_All'Address use char_const_ptr_Conv.To_Address (Item); begin Name (0 .. Name_Length - 1) := Item_All; Name (Name_Length) := C.char'Val (0); end; if C.stdlib.unsetenv (Name (0)'Access) < 0 then raise Constraint_Error; end if; end; end; end loop; end Clear; function Has_Element (Position : Cursor) return Boolean is begin return char_ptr_ptr_Conv.To_Pointer (Address (Position)).all /= null; end Has_Element; function Name (Position : Cursor) return String is Item : constant C.char_const_ptr := C.char_const_ptr ( char_ptr_ptr_Conv.To_Pointer (Address (Position)).all); Name_Length : C.size_t; Value : C.char_const_ptr; begin Do_Separate (Item, Name_Length, Value); return Zero_Terminated_Strings.Value (Item, Name_Length); end Name; function Value (Position : Cursor) return String is Item : constant C.char_const_ptr := C.char_const_ptr ( char_ptr_ptr_Conv.To_Pointer (Address (Position)).all); Name_Length : C.size_t; Value : C.char_const_ptr; begin Do_Separate (Item, Name_Length, Value); return Zero_Terminated_Strings.Value (Value); end Value; function First (Block : Address) return Cursor is pragma Unreferenced (Block); begin return Cursor (char_ptr_ptr_Conv.To_Address (Environment_Block)); end First; function Next (Block : Address; Position : Cursor) return Cursor is pragma Unreferenced (Block); begin return Cursor ( Address (Position) + Storage_Elements.Storage_Offset'( C.char_ptr'Size / Standard'Storage_Unit)); end Next; end System.Native_Environment_Variables;
32.534884
76
0.620586
13a28a39e7ff2613f57e611a07312b7ae7ad8d18
3,436
ada
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c97305b.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c97305b.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c97305b.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- C97305B.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT IF THE RENDEZVOUS IS IMMEDIATELY POSSIBLE (FOR A -- TIMED ENTRY CALL), IT IS PERFORMED. -- CASE B: ENTRY FAMILY; THE CALLED TASK IS EXECUTING A SELECTIVE WAIT. -- WRG 7/13/86 -- PWN 09/11/94 REMOVED PRAGMA PRIORITY FOR ADA 9X. with Impdef; WITH REPORT; USE REPORT; WITH SYSTEM; USE SYSTEM; PROCEDURE C97305B IS RENDEZVOUS_OCCURRED : BOOLEAN := FALSE; STATEMENTS_AFTER_CALL_EXECUTED : BOOLEAN := FALSE; COUNT : POSITIVE := 1; ZERO : DURATION := 1.0; BEGIN TEST ("C97305B", "CHECK THAT IF THE RENDEZVOUS IS IMMEDIATELY " & "POSSIBLE (FOR A TIMED ENTRY CALL), IT " & "IS PERFORMED"); IF EQUAL (3, 3) THEN ZERO := 0.0; END IF; DECLARE TASK T IS ENTRY E (1..3) (B : IN OUT BOOLEAN); END T; TASK BODY T IS BEGIN SELECT ACCEPT E (2) (B : IN OUT BOOLEAN) DO B := IDENT_BOOL (TRUE); END E; OR ACCEPT E (3) (B : IN OUT BOOLEAN); FAILED ("NONEXISTENT ENTRY CALL ACCEPTED"); END SELECT; END T; BEGIN WHILE NOT STATEMENTS_AFTER_CALL_EXECUTED LOOP DELAY 1.0 * Impdef.One_Second; SELECT T.E (2) (RENDEZVOUS_OCCURRED); STATEMENTS_AFTER_CALL_EXECUTED := IDENT_BOOL (TRUE); OR DELAY ZERO; IF COUNT < 60 * 60 THEN COUNT := COUNT + 1; ELSE FAILED ("NO RENDEZVOUS AFTER AT LEAST ONE " & "HOUR ELAPSED"); EXIT; END IF; END SELECT; END LOOP; END; IF NOT RENDEZVOUS_OCCURRED THEN FAILED ("RENDEZVOUS DID NOT OCCUR"); END IF; IF COUNT > 1 THEN COMMENT ("DELAYED" & POSITIVE'IMAGE(COUNT) & " SECONDS"); END IF; RESULT; END C97305B;
32.72381
79
0.54482
1a7b6ab92af2efc03d13e709ef6ef95eb957f2d4
705,469
adb
Ada
gcc-gcc-7_3_0-release/gcc/ada/sem_util.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/ada/sem_util.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/sem_util.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S E M _ U T I L -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2016, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Treepr; -- ???For debugging code below with Aspects; use Aspects; with Atree; use Atree; with Casing; use Casing; with Checks; use Checks; with Debug; use Debug; with Elists; use Elists; with Errout; use Errout; with Exp_Ch11; use Exp_Ch11; with Exp_Disp; use Exp_Disp; with Exp_Util; use Exp_Util; with Fname; use Fname; with Freeze; use Freeze; with Lib; use Lib; with Lib.Xref; use Lib.Xref; with Namet.Sp; use Namet.Sp; with Nlists; use Nlists; with Nmake; use Nmake; with Output; use Output; with Restrict; use Restrict; with Rident; use Rident; with Rtsfind; use Rtsfind; with Sem; use Sem; with Sem_Aux; use Sem_Aux; with Sem_Attr; use Sem_Attr; with Sem_Ch6; use Sem_Ch6; with Sem_Ch8; use Sem_Ch8; with Sem_Disp; use Sem_Disp; with Sem_Eval; use Sem_Eval; with Sem_Prag; use Sem_Prag; with Sem_Res; use Sem_Res; with Sem_Warn; use Sem_Warn; with Sem_Type; use Sem_Type; with Sinfo; use Sinfo; with Sinput; use Sinput; with Stand; use Stand; with Style; with Stringt; use Stringt; with Targparm; use Targparm; with Tbuild; use Tbuild; with Ttypes; use Ttypes; with Uname; use Uname; with GNAT.HTable; use GNAT.HTable; package body Sem_Util is ----------------------- -- Local Subprograms -- ----------------------- function Build_Component_Subtype (C : List_Id; Loc : Source_Ptr; T : Entity_Id) return Node_Id; -- This function builds the subtype for Build_Actual_Subtype_Of_Component -- and Build_Discriminal_Subtype_Of_Component. C is a list of constraints, -- Loc is the source location, T is the original subtype. function Has_Enabled_Property (Item_Id : Entity_Id; Property : Name_Id) return Boolean; -- Subsidiary to routines Async_xxx_Enabled and Effective_xxx_Enabled. -- Determine whether an abstract state or a variable denoted by entity -- Item_Id has enabled property Property. function Has_Null_Extension (T : Entity_Id) return Boolean; -- T is a derived tagged type. Check whether the type extension is null. -- If the parent type is fully initialized, T can be treated as such. function Is_Fully_Initialized_Variant (Typ : Entity_Id) return Boolean; -- Subsidiary to Is_Fully_Initialized_Type. For an unconstrained type -- with discriminants whose default values are static, examine only the -- components in the selected variant to determine whether all of them -- have a default. function Old_Requires_Transient_Scope (Id : Entity_Id) return Boolean; function New_Requires_Transient_Scope (Id : Entity_Id) return Boolean; -- ???We retain the old and new algorithms for Requires_Transient_Scope for -- the time being. New_Requires_Transient_Scope is used by default; the -- debug switch -gnatdQ can be used to do Old_Requires_Transient_Scope -- instead. The intent is to use this temporarily to measure before/after -- efficiency. Note: when this temporary code is removed, the documentation -- of dQ in debug.adb should be removed. procedure Results_Differ (Id : Entity_Id; Old_Val : Boolean; New_Val : Boolean); -- ???Debugging code. Called when the Old_Val and New_Val differ. This -- routine will be removed eventially when New_Requires_Transient_Scope -- becomes Requires_Transient_Scope and Old_Requires_Transient_Scope is -- eliminated. ------------------------------ -- Abstract_Interface_List -- ------------------------------ function Abstract_Interface_List (Typ : Entity_Id) return List_Id is Nod : Node_Id; begin if Is_Concurrent_Type (Typ) then -- If we are dealing with a synchronized subtype, go to the base -- type, whose declaration has the interface list. -- Shouldn't this be Declaration_Node??? Nod := Parent (Base_Type (Typ)); if Nkind (Nod) = N_Full_Type_Declaration then return Empty_List; end if; elsif Ekind (Typ) = E_Record_Type_With_Private then if Nkind (Parent (Typ)) = N_Full_Type_Declaration then Nod := Type_Definition (Parent (Typ)); elsif Nkind (Parent (Typ)) = N_Private_Type_Declaration then if Present (Full_View (Typ)) and then Nkind (Parent (Full_View (Typ))) = N_Full_Type_Declaration then Nod := Type_Definition (Parent (Full_View (Typ))); -- If the full-view is not available we cannot do anything else -- here (the source has errors). else return Empty_List; end if; -- Support for generic formals with interfaces is still missing ??? elsif Nkind (Parent (Typ)) = N_Formal_Type_Declaration then return Empty_List; else pragma Assert (Nkind (Parent (Typ)) = N_Private_Extension_Declaration); Nod := Parent (Typ); end if; elsif Ekind (Typ) = E_Record_Subtype then Nod := Type_Definition (Parent (Etype (Typ))); elsif Ekind (Typ) = E_Record_Subtype_With_Private then -- Recurse, because parent may still be a private extension. Also -- note that the full view of the subtype or the full view of its -- base type may (both) be unavailable. return Abstract_Interface_List (Etype (Typ)); else pragma Assert ((Ekind (Typ)) = E_Record_Type); if Nkind (Parent (Typ)) = N_Formal_Type_Declaration then Nod := Formal_Type_Definition (Parent (Typ)); else Nod := Type_Definition (Parent (Typ)); end if; end if; return Interface_List (Nod); end Abstract_Interface_List; -------------------------------- -- Add_Access_Type_To_Process -- -------------------------------- procedure Add_Access_Type_To_Process (E : Entity_Id; A : Entity_Id) is L : Elist_Id; begin Ensure_Freeze_Node (E); L := Access_Types_To_Process (Freeze_Node (E)); if No (L) then L := New_Elmt_List; Set_Access_Types_To_Process (Freeze_Node (E), L); end if; Append_Elmt (A, L); end Add_Access_Type_To_Process; -------------------------- -- Add_Block_Identifier -- -------------------------- procedure Add_Block_Identifier (N : Node_Id; Id : out Entity_Id) is Loc : constant Source_Ptr := Sloc (N); begin pragma Assert (Nkind (N) = N_Block_Statement); -- The block already has a label, return its entity if Present (Identifier (N)) then Id := Entity (Identifier (N)); -- Create a new block label and set its attributes else Id := New_Internal_Entity (E_Block, Current_Scope, Loc, 'B'); Set_Etype (Id, Standard_Void_Type); Set_Parent (Id, N); Set_Identifier (N, New_Occurrence_Of (Id, Loc)); Set_Block_Node (Id, Identifier (N)); end if; end Add_Block_Identifier; ---------------------------- -- Add_Global_Declaration -- ---------------------------- procedure Add_Global_Declaration (N : Node_Id) is Aux_Node : constant Node_Id := Aux_Decls_Node (Cunit (Current_Sem_Unit)); begin if No (Declarations (Aux_Node)) then Set_Declarations (Aux_Node, New_List); end if; Append_To (Declarations (Aux_Node), N); Analyze (N); end Add_Global_Declaration; -------------------------------- -- Address_Integer_Convert_OK -- -------------------------------- function Address_Integer_Convert_OK (T1, T2 : Entity_Id) return Boolean is begin if Allow_Integer_Address and then ((Is_Descendant_Of_Address (T1) and then Is_Private_Type (T1) and then Is_Integer_Type (T2)) or else (Is_Descendant_Of_Address (T2) and then Is_Private_Type (T2) and then Is_Integer_Type (T1))) then return True; else return False; end if; end Address_Integer_Convert_OK; ------------------- -- Address_Value -- ------------------- function Address_Value (N : Node_Id) return Node_Id is Expr : Node_Id := N; begin loop -- For constant, get constant expression if Is_Entity_Name (Expr) and then Ekind (Entity (Expr)) = E_Constant then Expr := Constant_Value (Entity (Expr)); -- For unchecked conversion, get result to convert elsif Nkind (Expr) = N_Unchecked_Type_Conversion then Expr := Expression (Expr); -- For (common case) of To_Address call, get argument elsif Nkind (Expr) = N_Function_Call and then Is_Entity_Name (Name (Expr)) and then Is_RTE (Entity (Name (Expr)), RE_To_Address) then Expr := First (Parameter_Associations (Expr)); if Nkind (Expr) = N_Parameter_Association then Expr := Explicit_Actual_Parameter (Expr); end if; -- We finally have the real expression else exit; end if; end loop; return Expr; end Address_Value; ----------------- -- Addressable -- ----------------- -- For now, just 8/16/32/64 function Addressable (V : Uint) return Boolean is begin return V = Uint_8 or else V = Uint_16 or else V = Uint_32 or else V = Uint_64; end Addressable; function Addressable (V : Int) return Boolean is begin return V = 8 or else V = 16 or else V = 32 or else V = 64; end Addressable; --------------------------------- -- Aggregate_Constraint_Checks -- --------------------------------- procedure Aggregate_Constraint_Checks (Exp : Node_Id; Check_Typ : Entity_Id) is Exp_Typ : constant Entity_Id := Etype (Exp); begin if Raises_Constraint_Error (Exp) then return; end if; -- Ada 2005 (AI-230): Generate a conversion to an anonymous access -- component's type to force the appropriate accessibility checks. -- Ada 2005 (AI-231): Generate conversion to the null-excluding type to -- force the corresponding run-time check if Is_Access_Type (Check_Typ) and then Is_Local_Anonymous_Access (Check_Typ) then Rewrite (Exp, Convert_To (Check_Typ, Relocate_Node (Exp))); Analyze_And_Resolve (Exp, Check_Typ); Check_Unset_Reference (Exp); end if; -- What follows is really expansion activity, so check that expansion -- is on and is allowed. In GNATprove mode, we also want check flags to -- be added in the tree, so that the formal verification can rely on -- those to be present. In GNATprove mode for formal verification, some -- treatment typically only done during expansion needs to be performed -- on the tree, but it should not be applied inside generics. Otherwise, -- this breaks the name resolution mechanism for generic instances. if not Expander_Active and (Inside_A_Generic or not Full_Analysis or not GNATprove_Mode) then return; end if; if Is_Access_Type (Check_Typ) and then Can_Never_Be_Null (Check_Typ) and then not Can_Never_Be_Null (Exp_Typ) then Install_Null_Excluding_Check (Exp); end if; -- First check if we have to insert discriminant checks if Has_Discriminants (Exp_Typ) then Apply_Discriminant_Check (Exp, Check_Typ); -- Next emit length checks for array aggregates elsif Is_Array_Type (Exp_Typ) then Apply_Length_Check (Exp, Check_Typ); -- Finally emit scalar and string checks. If we are dealing with a -- scalar literal we need to check by hand because the Etype of -- literals is not necessarily correct. elsif Is_Scalar_Type (Exp_Typ) and then Compile_Time_Known_Value (Exp) then if Is_Out_Of_Range (Exp, Base_Type (Check_Typ)) then Apply_Compile_Time_Constraint_Error (Exp, "value not in range of}??", CE_Range_Check_Failed, Ent => Base_Type (Check_Typ), Typ => Base_Type (Check_Typ)); elsif Is_Out_Of_Range (Exp, Check_Typ) then Apply_Compile_Time_Constraint_Error (Exp, "value not in range of}??", CE_Range_Check_Failed, Ent => Check_Typ, Typ => Check_Typ); elsif not Range_Checks_Suppressed (Check_Typ) then Apply_Scalar_Range_Check (Exp, Check_Typ); end if; -- Verify that target type is also scalar, to prevent view anomalies -- in instantiations. elsif (Is_Scalar_Type (Exp_Typ) or else Nkind (Exp) = N_String_Literal) and then Is_Scalar_Type (Check_Typ) and then Exp_Typ /= Check_Typ then if Is_Entity_Name (Exp) and then Ekind (Entity (Exp)) = E_Constant then -- If expression is a constant, it is worthwhile checking whether -- it is a bound of the type. if (Is_Entity_Name (Type_Low_Bound (Check_Typ)) and then Entity (Exp) = Entity (Type_Low_Bound (Check_Typ))) or else (Is_Entity_Name (Type_High_Bound (Check_Typ)) and then Entity (Exp) = Entity (Type_High_Bound (Check_Typ))) then return; else Rewrite (Exp, Convert_To (Check_Typ, Relocate_Node (Exp))); Analyze_And_Resolve (Exp, Check_Typ); Check_Unset_Reference (Exp); end if; -- Could use a comment on this case ??? else Rewrite (Exp, Convert_To (Check_Typ, Relocate_Node (Exp))); Analyze_And_Resolve (Exp, Check_Typ); Check_Unset_Reference (Exp); end if; end if; end Aggregate_Constraint_Checks; ----------------------- -- Alignment_In_Bits -- ----------------------- function Alignment_In_Bits (E : Entity_Id) return Uint is begin return Alignment (E) * System_Storage_Unit; end Alignment_In_Bits; -------------------------------------- -- All_Composite_Constraints_Static -- -------------------------------------- function All_Composite_Constraints_Static (Constr : Node_Id) return Boolean is begin if No (Constr) or else Error_Posted (Constr) then return True; end if; case Nkind (Constr) is when N_Subexpr => if Nkind (Constr) in N_Has_Entity and then Present (Entity (Constr)) then if Is_Type (Entity (Constr)) then return not Is_Discrete_Type (Entity (Constr)) or else Is_OK_Static_Subtype (Entity (Constr)); end if; elsif Nkind (Constr) = N_Range then return Is_OK_Static_Expression (Low_Bound (Constr)) and then Is_OK_Static_Expression (High_Bound (Constr)); elsif Nkind (Constr) = N_Attribute_Reference and then Attribute_Name (Constr) = Name_Range then return Is_OK_Static_Expression (Type_Low_Bound (Etype (Prefix (Constr)))) and then Is_OK_Static_Expression (Type_High_Bound (Etype (Prefix (Constr)))); end if; return not Present (Etype (Constr)) -- previous error or else not Is_Discrete_Type (Etype (Constr)) or else Is_OK_Static_Expression (Constr); when N_Discriminant_Association => return All_Composite_Constraints_Static (Expression (Constr)); when N_Range_Constraint => return All_Composite_Constraints_Static (Range_Expression (Constr)); when N_Index_Or_Discriminant_Constraint => declare One_Cstr : Entity_Id; begin One_Cstr := First (Constraints (Constr)); while Present (One_Cstr) loop if not All_Composite_Constraints_Static (One_Cstr) then return False; end if; Next (One_Cstr); end loop; end; return True; when N_Subtype_Indication => return All_Composite_Constraints_Static (Subtype_Mark (Constr)) and then All_Composite_Constraints_Static (Constraint (Constr)); when others => raise Program_Error; end case; end All_Composite_Constraints_Static; --------------------------------- -- Append_Inherited_Subprogram -- --------------------------------- procedure Append_Inherited_Subprogram (S : Entity_Id) is Par : constant Entity_Id := Alias (S); -- The parent subprogram Scop : constant Entity_Id := Scope (Par); -- The scope of definition of the parent subprogram Typ : constant Entity_Id := Defining_Entity (Parent (S)); -- The derived type of which S is a primitive operation Decl : Node_Id; Next_E : Entity_Id; begin if Ekind (Current_Scope) = E_Package and then In_Private_Part (Current_Scope) and then Has_Private_Declaration (Typ) and then Is_Tagged_Type (Typ) and then Scop = Current_Scope then -- The inherited operation is available at the earliest place after -- the derived type declaration ( RM 7.3.1 (6/1)). This is only -- relevant for type extensions. If the parent operation appears -- after the type extension, the operation is not visible. Decl := First (Visible_Declarations (Package_Specification (Current_Scope))); while Present (Decl) loop if Nkind (Decl) = N_Private_Extension_Declaration and then Defining_Entity (Decl) = Typ then if Sloc (Decl) > Sloc (Par) then Next_E := Next_Entity (Par); Set_Next_Entity (Par, S); Set_Next_Entity (S, Next_E); return; else exit; end if; end if; Next (Decl); end loop; end if; -- If partial view is not a type extension, or it appears before the -- subprogram declaration, insert normally at end of entity list. Append_Entity (S, Current_Scope); end Append_Inherited_Subprogram; ----------------------------------------- -- Apply_Compile_Time_Constraint_Error -- ----------------------------------------- procedure Apply_Compile_Time_Constraint_Error (N : Node_Id; Msg : String; Reason : RT_Exception_Code; Ent : Entity_Id := Empty; Typ : Entity_Id := Empty; Loc : Source_Ptr := No_Location; Rep : Boolean := True; Warn : Boolean := False) is Stat : constant Boolean := Is_Static_Expression (N); R_Stat : constant Node_Id := Make_Raise_Constraint_Error (Sloc (N), Reason => Reason); Rtyp : Entity_Id; begin if No (Typ) then Rtyp := Etype (N); else Rtyp := Typ; end if; Discard_Node (Compile_Time_Constraint_Error (N, Msg, Ent, Loc, Warn => Warn)); -- In GNATprove mode, do not replace the node with an exception raised. -- In such a case, either the call to Compile_Time_Constraint_Error -- issues an error which stops analysis, or it issues a warning in -- a few cases where a suitable check flag is set for GNATprove to -- generate a check message. if not Rep or GNATprove_Mode then return; end if; -- Now we replace the node by an N_Raise_Constraint_Error node -- This does not need reanalyzing, so set it as analyzed now. Rewrite (N, R_Stat); Set_Analyzed (N, True); Set_Etype (N, Rtyp); Set_Raises_Constraint_Error (N); -- Now deal with possible local raise handling Possible_Local_Raise (N, Standard_Constraint_Error); -- If the original expression was marked as static, the result is -- still marked as static, but the Raises_Constraint_Error flag is -- always set so that further static evaluation is not attempted. if Stat then Set_Is_Static_Expression (N); end if; end Apply_Compile_Time_Constraint_Error; --------------------------- -- Async_Readers_Enabled -- --------------------------- function Async_Readers_Enabled (Id : Entity_Id) return Boolean is begin return Has_Enabled_Property (Id, Name_Async_Readers); end Async_Readers_Enabled; --------------------------- -- Async_Writers_Enabled -- --------------------------- function Async_Writers_Enabled (Id : Entity_Id) return Boolean is begin return Has_Enabled_Property (Id, Name_Async_Writers); end Async_Writers_Enabled; -------------------------------------- -- Available_Full_View_Of_Component -- -------------------------------------- function Available_Full_View_Of_Component (T : Entity_Id) return Boolean is ST : constant Entity_Id := Scope (T); SCT : constant Entity_Id := Scope (Component_Type (T)); begin return In_Open_Scopes (ST) and then In_Open_Scopes (SCT) and then Scope_Depth (ST) >= Scope_Depth (SCT); end Available_Full_View_Of_Component; ------------------- -- Bad_Attribute -- ------------------- procedure Bad_Attribute (N : Node_Id; Nam : Name_Id; Warn : Boolean := False) is begin Error_Msg_Warn := Warn; Error_Msg_N ("unrecognized attribute&<<", N); -- Check for possible misspelling Error_Msg_Name_1 := First_Attribute_Name; while Error_Msg_Name_1 <= Last_Attribute_Name loop if Is_Bad_Spelling_Of (Nam, Error_Msg_Name_1) then Error_Msg_N -- CODEFIX ("\possible misspelling of %<<", N); exit; end if; Error_Msg_Name_1 := Error_Msg_Name_1 + 1; end loop; end Bad_Attribute; -------------------------------- -- Bad_Predicated_Subtype_Use -- -------------------------------- procedure Bad_Predicated_Subtype_Use (Msg : String; N : Node_Id; Typ : Entity_Id; Suggest_Static : Boolean := False) is Gen : Entity_Id; begin -- Avoid cascaded errors if Error_Posted (N) then return; end if; if Inside_A_Generic then Gen := Current_Scope; while Present (Gen) and then Ekind (Gen) /= E_Generic_Package loop Gen := Scope (Gen); end loop; if No (Gen) then return; end if; if Is_Generic_Formal (Typ) and then Is_Discrete_Type (Typ) then Set_No_Predicate_On_Actual (Typ); end if; elsif Has_Predicates (Typ) then if Is_Generic_Actual_Type (Typ) then -- The restriction on loop parameters is only that the type -- should have no dynamic predicates. if Nkind (Parent (N)) = N_Loop_Parameter_Specification and then not Has_Dynamic_Predicate_Aspect (Typ) and then Is_OK_Static_Subtype (Typ) then return; end if; Gen := Current_Scope; while not Is_Generic_Instance (Gen) loop Gen := Scope (Gen); end loop; pragma Assert (Present (Gen)); if Ekind (Gen) = E_Package and then In_Package_Body (Gen) then Error_Msg_Warn := SPARK_Mode /= On; Error_Msg_FE (Msg & "<<", N, Typ); Error_Msg_F ("\Program_Error [<<", N); Insert_Action (N, Make_Raise_Program_Error (Sloc (N), Reason => PE_Bad_Predicated_Generic_Type)); else Error_Msg_FE (Msg & "<<", N, Typ); end if; else Error_Msg_FE (Msg, N, Typ); end if; -- Emit an optional suggestion on how to remedy the error if the -- context warrants it. if Suggest_Static and then Has_Static_Predicate (Typ) then Error_Msg_FE ("\predicate of & should be marked static", N, Typ); end if; end if; end Bad_Predicated_Subtype_Use; ----------------------------------------- -- Bad_Unordered_Enumeration_Reference -- ----------------------------------------- function Bad_Unordered_Enumeration_Reference (N : Node_Id; T : Entity_Id) return Boolean is begin return Is_Enumeration_Type (T) and then Warn_On_Unordered_Enumeration_Type and then not Is_Generic_Type (T) and then Comes_From_Source (N) and then not Has_Pragma_Ordered (T) and then not In_Same_Extended_Unit (N, T); end Bad_Unordered_Enumeration_Reference; -------------------------- -- Build_Actual_Subtype -- -------------------------- function Build_Actual_Subtype (T : Entity_Id; N : Node_Or_Entity_Id) return Node_Id is Loc : Source_Ptr; -- Normally Sloc (N), but may point to corresponding body in some cases Constraints : List_Id; Decl : Node_Id; Discr : Entity_Id; Hi : Node_Id; Lo : Node_Id; Subt : Entity_Id; Disc_Type : Entity_Id; Obj : Node_Id; begin Loc := Sloc (N); if Nkind (N) = N_Defining_Identifier then Obj := New_Occurrence_Of (N, Loc); -- If this is a formal parameter of a subprogram declaration, and -- we are compiling the body, we want the declaration for the -- actual subtype to carry the source position of the body, to -- prevent anomalies in gdb when stepping through the code. if Is_Formal (N) then declare Decl : constant Node_Id := Unit_Declaration_Node (Scope (N)); begin if Nkind (Decl) = N_Subprogram_Declaration and then Present (Corresponding_Body (Decl)) then Loc := Sloc (Corresponding_Body (Decl)); end if; end; end if; else Obj := N; end if; if Is_Array_Type (T) then Constraints := New_List; for J in 1 .. Number_Dimensions (T) loop -- Build an array subtype declaration with the nominal subtype and -- the bounds of the actual. Add the declaration in front of the -- local declarations for the subprogram, for analysis before any -- reference to the formal in the body. Lo := Make_Attribute_Reference (Loc, Prefix => Duplicate_Subexpr_No_Checks (Obj, Name_Req => True), Attribute_Name => Name_First, Expressions => New_List ( Make_Integer_Literal (Loc, J))); Hi := Make_Attribute_Reference (Loc, Prefix => Duplicate_Subexpr_No_Checks (Obj, Name_Req => True), Attribute_Name => Name_Last, Expressions => New_List ( Make_Integer_Literal (Loc, J))); Append (Make_Range (Loc, Lo, Hi), Constraints); end loop; -- If the type has unknown discriminants there is no constrained -- subtype to build. This is never called for a formal or for a -- lhs, so returning the type is ok ??? elsif Has_Unknown_Discriminants (T) then return T; else Constraints := New_List; -- Type T is a generic derived type, inherit the discriminants from -- the parent type. if Is_Private_Type (T) and then No (Full_View (T)) -- T was flagged as an error if it was declared as a formal -- derived type with known discriminants. In this case there -- is no need to look at the parent type since T already carries -- its own discriminants. and then not Error_Posted (T) then Disc_Type := Etype (Base_Type (T)); else Disc_Type := T; end if; Discr := First_Discriminant (Disc_Type); while Present (Discr) loop Append_To (Constraints, Make_Selected_Component (Loc, Prefix => Duplicate_Subexpr_No_Checks (Obj), Selector_Name => New_Occurrence_Of (Discr, Loc))); Next_Discriminant (Discr); end loop; end if; Subt := Make_Temporary (Loc, 'S', Related_Node => N); Set_Is_Internal (Subt); Decl := Make_Subtype_Declaration (Loc, Defining_Identifier => Subt, Subtype_Indication => Make_Subtype_Indication (Loc, Subtype_Mark => New_Occurrence_Of (T, Loc), Constraint => Make_Index_Or_Discriminant_Constraint (Loc, Constraints => Constraints))); Mark_Rewrite_Insertion (Decl); return Decl; end Build_Actual_Subtype; --------------------------------------- -- Build_Actual_Subtype_Of_Component -- --------------------------------------- function Build_Actual_Subtype_Of_Component (T : Entity_Id; N : Node_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (N); P : constant Node_Id := Prefix (N); D : Elmt_Id; Id : Node_Id; Index_Typ : Entity_Id; Desig_Typ : Entity_Id; -- This is either a copy of T, or if T is an access type, then it is -- the directly designated type of this access type. function Build_Actual_Array_Constraint return List_Id; -- If one or more of the bounds of the component depends on -- discriminants, build actual constraint using the discriminants -- of the prefix. function Build_Actual_Record_Constraint return List_Id; -- Similar to previous one, for discriminated components constrained -- by the discriminant of the enclosing object. ----------------------------------- -- Build_Actual_Array_Constraint -- ----------------------------------- function Build_Actual_Array_Constraint return List_Id is Constraints : constant List_Id := New_List; Indx : Node_Id; Hi : Node_Id; Lo : Node_Id; Old_Hi : Node_Id; Old_Lo : Node_Id; begin Indx := First_Index (Desig_Typ); while Present (Indx) loop Old_Lo := Type_Low_Bound (Etype (Indx)); Old_Hi := Type_High_Bound (Etype (Indx)); if Denotes_Discriminant (Old_Lo) then Lo := Make_Selected_Component (Loc, Prefix => New_Copy_Tree (P), Selector_Name => New_Occurrence_Of (Entity (Old_Lo), Loc)); else Lo := New_Copy_Tree (Old_Lo); -- The new bound will be reanalyzed in the enclosing -- declaration. For literal bounds that come from a type -- declaration, the type of the context must be imposed, so -- insure that analysis will take place. For non-universal -- types this is not strictly necessary. Set_Analyzed (Lo, False); end if; if Denotes_Discriminant (Old_Hi) then Hi := Make_Selected_Component (Loc, Prefix => New_Copy_Tree (P), Selector_Name => New_Occurrence_Of (Entity (Old_Hi), Loc)); else Hi := New_Copy_Tree (Old_Hi); Set_Analyzed (Hi, False); end if; Append (Make_Range (Loc, Lo, Hi), Constraints); Next_Index (Indx); end loop; return Constraints; end Build_Actual_Array_Constraint; ------------------------------------ -- Build_Actual_Record_Constraint -- ------------------------------------ function Build_Actual_Record_Constraint return List_Id is Constraints : constant List_Id := New_List; D : Elmt_Id; D_Val : Node_Id; begin D := First_Elmt (Discriminant_Constraint (Desig_Typ)); while Present (D) loop if Denotes_Discriminant (Node (D)) then D_Val := Make_Selected_Component (Loc, Prefix => New_Copy_Tree (P), Selector_Name => New_Occurrence_Of (Entity (Node (D)), Loc)); else D_Val := New_Copy_Tree (Node (D)); end if; Append (D_Val, Constraints); Next_Elmt (D); end loop; return Constraints; end Build_Actual_Record_Constraint; -- Start of processing for Build_Actual_Subtype_Of_Component begin -- Why the test for Spec_Expression mode here??? if In_Spec_Expression then return Empty; -- More comments for the rest of this body would be good ??? elsif Nkind (N) = N_Explicit_Dereference then if Is_Composite_Type (T) and then not Is_Constrained (T) and then not (Is_Class_Wide_Type (T) and then Is_Constrained (Root_Type (T))) and then not Has_Unknown_Discriminants (T) then -- If the type of the dereference is already constrained, it is an -- actual subtype. if Is_Array_Type (Etype (N)) and then Is_Constrained (Etype (N)) then return Empty; else Remove_Side_Effects (P); return Build_Actual_Subtype (T, N); end if; else return Empty; end if; end if; if Ekind (T) = E_Access_Subtype then Desig_Typ := Designated_Type (T); else Desig_Typ := T; end if; if Ekind (Desig_Typ) = E_Array_Subtype then Id := First_Index (Desig_Typ); while Present (Id) loop Index_Typ := Underlying_Type (Etype (Id)); if Denotes_Discriminant (Type_Low_Bound (Index_Typ)) or else Denotes_Discriminant (Type_High_Bound (Index_Typ)) then Remove_Side_Effects (P); return Build_Component_Subtype (Build_Actual_Array_Constraint, Loc, Base_Type (T)); end if; Next_Index (Id); end loop; elsif Is_Composite_Type (Desig_Typ) and then Has_Discriminants (Desig_Typ) and then not Has_Unknown_Discriminants (Desig_Typ) then if Is_Private_Type (Desig_Typ) and then No (Discriminant_Constraint (Desig_Typ)) then Desig_Typ := Full_View (Desig_Typ); end if; D := First_Elmt (Discriminant_Constraint (Desig_Typ)); while Present (D) loop if Denotes_Discriminant (Node (D)) then Remove_Side_Effects (P); return Build_Component_Subtype ( Build_Actual_Record_Constraint, Loc, Base_Type (T)); end if; Next_Elmt (D); end loop; end if; -- If none of the above, the actual and nominal subtypes are the same return Empty; end Build_Actual_Subtype_Of_Component; ----------------------------- -- Build_Component_Subtype -- ----------------------------- function Build_Component_Subtype (C : List_Id; Loc : Source_Ptr; T : Entity_Id) return Node_Id is Subt : Entity_Id; Decl : Node_Id; begin -- Unchecked_Union components do not require component subtypes if Is_Unchecked_Union (T) then return Empty; end if; Subt := Make_Temporary (Loc, 'S'); Set_Is_Internal (Subt); Decl := Make_Subtype_Declaration (Loc, Defining_Identifier => Subt, Subtype_Indication => Make_Subtype_Indication (Loc, Subtype_Mark => New_Occurrence_Of (Base_Type (T), Loc), Constraint => Make_Index_Or_Discriminant_Constraint (Loc, Constraints => C))); Mark_Rewrite_Insertion (Decl); return Decl; end Build_Component_Subtype; --------------------------- -- Build_Default_Subtype -- --------------------------- function Build_Default_Subtype (T : Entity_Id; N : Node_Id) return Entity_Id is Loc : constant Source_Ptr := Sloc (N); Disc : Entity_Id; Bas : Entity_Id; -- The base type that is to be constrained by the defaults begin if not Has_Discriminants (T) or else Is_Constrained (T) then return T; end if; Bas := Base_Type (T); -- If T is non-private but its base type is private, this is the -- completion of a subtype declaration whose parent type is private -- (see Complete_Private_Subtype in Sem_Ch3). The proper discriminants -- are to be found in the full view of the base. Check that the private -- status of T and its base differ. if Is_Private_Type (Bas) and then not Is_Private_Type (T) and then Present (Full_View (Bas)) then Bas := Full_View (Bas); end if; Disc := First_Discriminant (T); if No (Discriminant_Default_Value (Disc)) then return T; end if; declare Act : constant Entity_Id := Make_Temporary (Loc, 'S'); Constraints : constant List_Id := New_List; Decl : Node_Id; begin while Present (Disc) loop Append_To (Constraints, New_Copy_Tree (Discriminant_Default_Value (Disc))); Next_Discriminant (Disc); end loop; Decl := Make_Subtype_Declaration (Loc, Defining_Identifier => Act, Subtype_Indication => Make_Subtype_Indication (Loc, Subtype_Mark => New_Occurrence_Of (Bas, Loc), Constraint => Make_Index_Or_Discriminant_Constraint (Loc, Constraints => Constraints))); Insert_Action (N, Decl); -- If the context is a component declaration the subtype declaration -- will be analyzed when the enclosing type is frozen, otherwise do -- it now. if Ekind (Current_Scope) /= E_Record_Type then Analyze (Decl); end if; return Act; end; end Build_Default_Subtype; -------------------------------------------- -- Build_Discriminal_Subtype_Of_Component -- -------------------------------------------- function Build_Discriminal_Subtype_Of_Component (T : Entity_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (T); D : Elmt_Id; Id : Node_Id; function Build_Discriminal_Array_Constraint return List_Id; -- If one or more of the bounds of the component depends on -- discriminants, build actual constraint using the discriminants -- of the prefix. function Build_Discriminal_Record_Constraint return List_Id; -- Similar to previous one, for discriminated components constrained by -- the discriminant of the enclosing object. ---------------------------------------- -- Build_Discriminal_Array_Constraint -- ---------------------------------------- function Build_Discriminal_Array_Constraint return List_Id is Constraints : constant List_Id := New_List; Indx : Node_Id; Hi : Node_Id; Lo : Node_Id; Old_Hi : Node_Id; Old_Lo : Node_Id; begin Indx := First_Index (T); while Present (Indx) loop Old_Lo := Type_Low_Bound (Etype (Indx)); Old_Hi := Type_High_Bound (Etype (Indx)); if Denotes_Discriminant (Old_Lo) then Lo := New_Occurrence_Of (Discriminal (Entity (Old_Lo)), Loc); else Lo := New_Copy_Tree (Old_Lo); end if; if Denotes_Discriminant (Old_Hi) then Hi := New_Occurrence_Of (Discriminal (Entity (Old_Hi)), Loc); else Hi := New_Copy_Tree (Old_Hi); end if; Append (Make_Range (Loc, Lo, Hi), Constraints); Next_Index (Indx); end loop; return Constraints; end Build_Discriminal_Array_Constraint; ----------------------------------------- -- Build_Discriminal_Record_Constraint -- ----------------------------------------- function Build_Discriminal_Record_Constraint return List_Id is Constraints : constant List_Id := New_List; D : Elmt_Id; D_Val : Node_Id; begin D := First_Elmt (Discriminant_Constraint (T)); while Present (D) loop if Denotes_Discriminant (Node (D)) then D_Val := New_Occurrence_Of (Discriminal (Entity (Node (D))), Loc); else D_Val := New_Copy_Tree (Node (D)); end if; Append (D_Val, Constraints); Next_Elmt (D); end loop; return Constraints; end Build_Discriminal_Record_Constraint; -- Start of processing for Build_Discriminal_Subtype_Of_Component begin if Ekind (T) = E_Array_Subtype then Id := First_Index (T); while Present (Id) loop if Denotes_Discriminant (Type_Low_Bound (Etype (Id))) or else Denotes_Discriminant (Type_High_Bound (Etype (Id))) then return Build_Component_Subtype (Build_Discriminal_Array_Constraint, Loc, T); end if; Next_Index (Id); end loop; elsif Ekind (T) = E_Record_Subtype and then Has_Discriminants (T) and then not Has_Unknown_Discriminants (T) then D := First_Elmt (Discriminant_Constraint (T)); while Present (D) loop if Denotes_Discriminant (Node (D)) then return Build_Component_Subtype (Build_Discriminal_Record_Constraint, Loc, T); end if; Next_Elmt (D); end loop; end if; -- If none of the above, the actual and nominal subtypes are the same return Empty; end Build_Discriminal_Subtype_Of_Component; ------------------------------ -- Build_Elaboration_Entity -- ------------------------------ procedure Build_Elaboration_Entity (N : Node_Id; Spec_Id : Entity_Id) is Loc : constant Source_Ptr := Sloc (N); Decl : Node_Id; Elab_Ent : Entity_Id; procedure Set_Package_Name (Ent : Entity_Id); -- Given an entity, sets the fully qualified name of the entity in -- Name_Buffer, with components separated by double underscores. This -- is a recursive routine that climbs the scope chain to Standard. ---------------------- -- Set_Package_Name -- ---------------------- procedure Set_Package_Name (Ent : Entity_Id) is begin if Scope (Ent) /= Standard_Standard then Set_Package_Name (Scope (Ent)); declare Nam : constant String := Get_Name_String (Chars (Ent)); begin Name_Buffer (Name_Len + 1) := '_'; Name_Buffer (Name_Len + 2) := '_'; Name_Buffer (Name_Len + 3 .. Name_Len + Nam'Length + 2) := Nam; Name_Len := Name_Len + Nam'Length + 2; end; else Get_Name_String (Chars (Ent)); end if; end Set_Package_Name; -- Start of processing for Build_Elaboration_Entity begin -- Ignore call if already constructed if Present (Elaboration_Entity (Spec_Id)) then return; -- Ignore in ASIS mode, elaboration entity is not in source and plays -- no role in analysis. elsif ASIS_Mode then return; -- See if we need elaboration entity. -- We always need an elaboration entity when preserving control flow, as -- we want to remain explicit about the unit's elaboration order. elsif Opt.Suppress_Control_Flow_Optimizations then null; -- We always need an elaboration entity for the dynamic elaboration -- model, since it is needed to properly generate the PE exception for -- access before elaboration. elsif Dynamic_Elaboration_Checks then null; -- For the static model, we don't need the elaboration counter if this -- unit is sure to have no elaboration code, since that means there -- is no elaboration unit to be called. Note that we can't just decide -- after the fact by looking to see whether there was elaboration code, -- because that's too late to make this decision. elsif Restriction_Active (No_Elaboration_Code) then return; -- Similarly, for the static model, we can skip the elaboration counter -- if we have the No_Multiple_Elaboration restriction, since for the -- static model, that's the only purpose of the counter (to avoid -- multiple elaboration). elsif Restriction_Active (No_Multiple_Elaboration) then return; end if; -- Here we need the elaboration entity -- Construct name of elaboration entity as xxx_E, where xxx is the unit -- name with dots replaced by double underscore. We have to manually -- construct this name, since it will be elaborated in the outer scope, -- and thus will not have the unit name automatically prepended. Set_Package_Name (Spec_Id); Add_Str_To_Name_Buffer ("_E"); -- Create elaboration counter Elab_Ent := Make_Defining_Identifier (Loc, Chars => Name_Find); Set_Elaboration_Entity (Spec_Id, Elab_Ent); Decl := Make_Object_Declaration (Loc, Defining_Identifier => Elab_Ent, Object_Definition => New_Occurrence_Of (Standard_Short_Integer, Loc), Expression => Make_Integer_Literal (Loc, Uint_0)); Push_Scope (Standard_Standard); Add_Global_Declaration (Decl); Pop_Scope; -- Reset True_Constant indication, since we will indeed assign a value -- to the variable in the binder main. We also kill the Current_Value -- and Last_Assignment fields for the same reason. Set_Is_True_Constant (Elab_Ent, False); Set_Current_Value (Elab_Ent, Empty); Set_Last_Assignment (Elab_Ent, Empty); -- We do not want any further qualification of the name (if we did not -- do this, we would pick up the name of the generic package in the case -- of a library level generic instantiation). Set_Has_Qualified_Name (Elab_Ent); Set_Has_Fully_Qualified_Name (Elab_Ent); end Build_Elaboration_Entity; -------------------------------- -- Build_Explicit_Dereference -- -------------------------------- procedure Build_Explicit_Dereference (Expr : Node_Id; Disc : Entity_Id) is Loc : constant Source_Ptr := Sloc (Expr); I : Interp_Index; It : Interp; begin -- An entity of a type with a reference aspect is overloaded with -- both interpretations: with and without the dereference. Now that -- the dereference is made explicit, set the type of the node properly, -- to prevent anomalies in the backend. Same if the expression is an -- overloaded function call whose return type has a reference aspect. if Is_Entity_Name (Expr) then Set_Etype (Expr, Etype (Entity (Expr))); -- The designated entity will not be examined again when resolving -- the dereference, so generate a reference to it now. Generate_Reference (Entity (Expr), Expr); elsif Nkind (Expr) = N_Function_Call then -- If the name of the indexing function is overloaded, locate the one -- whose return type has an implicit dereference on the desired -- discriminant, and set entity and type of function call. if Is_Overloaded (Name (Expr)) then Get_First_Interp (Name (Expr), I, It); while Present (It.Nam) loop if Ekind ((It.Typ)) = E_Record_Type and then First_Entity ((It.Typ)) = Disc then Set_Entity (Name (Expr), It.Nam); Set_Etype (Name (Expr), Etype (It.Nam)); exit; end if; Get_Next_Interp (I, It); end loop; end if; -- Set type of call from resolved function name. Set_Etype (Expr, Etype (Name (Expr))); end if; Set_Is_Overloaded (Expr, False); -- The expression will often be a generalized indexing that yields a -- container element that is then dereferenced, in which case the -- generalized indexing call is also non-overloaded. if Nkind (Expr) = N_Indexed_Component and then Present (Generalized_Indexing (Expr)) then Set_Is_Overloaded (Generalized_Indexing (Expr), False); end if; Rewrite (Expr, Make_Explicit_Dereference (Loc, Prefix => Make_Selected_Component (Loc, Prefix => Relocate_Node (Expr), Selector_Name => New_Occurrence_Of (Disc, Loc)))); Set_Etype (Prefix (Expr), Etype (Disc)); Set_Etype (Expr, Designated_Type (Etype (Disc))); end Build_Explicit_Dereference; ----------------------------------- -- Cannot_Raise_Constraint_Error -- ----------------------------------- function Cannot_Raise_Constraint_Error (Expr : Node_Id) return Boolean is begin if Compile_Time_Known_Value (Expr) then return True; elsif Do_Range_Check (Expr) then return False; elsif Raises_Constraint_Error (Expr) then return False; else case Nkind (Expr) is when N_Identifier => return True; when N_Expanded_Name => return True; when N_Selected_Component => return not Do_Discriminant_Check (Expr); when N_Attribute_Reference => if Do_Overflow_Check (Expr) then return False; elsif No (Expressions (Expr)) then return True; else declare N : Node_Id; begin N := First (Expressions (Expr)); while Present (N) loop if Cannot_Raise_Constraint_Error (N) then Next (N); else return False; end if; end loop; return True; end; end if; when N_Type_Conversion => if Do_Overflow_Check (Expr) or else Do_Length_Check (Expr) or else Do_Tag_Check (Expr) then return False; else return Cannot_Raise_Constraint_Error (Expression (Expr)); end if; when N_Unchecked_Type_Conversion => return Cannot_Raise_Constraint_Error (Expression (Expr)); when N_Unary_Op => if Do_Overflow_Check (Expr) then return False; else return Cannot_Raise_Constraint_Error (Right_Opnd (Expr)); end if; when N_Op_Divide | N_Op_Mod | N_Op_Rem => if Do_Division_Check (Expr) or else Do_Overflow_Check (Expr) then return False; else return Cannot_Raise_Constraint_Error (Left_Opnd (Expr)) and then Cannot_Raise_Constraint_Error (Right_Opnd (Expr)); end if; when N_Op_Add | N_Op_And | N_Op_Concat | N_Op_Eq | N_Op_Expon | N_Op_Ge | N_Op_Gt | N_Op_Le | N_Op_Lt | N_Op_Multiply | N_Op_Ne | N_Op_Or | N_Op_Rotate_Left | N_Op_Rotate_Right | N_Op_Shift_Left | N_Op_Shift_Right | N_Op_Shift_Right_Arithmetic | N_Op_Subtract | N_Op_Xor => if Do_Overflow_Check (Expr) then return False; else return Cannot_Raise_Constraint_Error (Left_Opnd (Expr)) and then Cannot_Raise_Constraint_Error (Right_Opnd (Expr)); end if; when others => return False; end case; end if; end Cannot_Raise_Constraint_Error; ----------------------------- -- Check_Part_Of_Reference -- ----------------------------- procedure Check_Part_Of_Reference (Var_Id : Entity_Id; Ref : Node_Id) is Conc_Typ : constant Entity_Id := Encapsulating_State (Var_Id); Decl : Node_Id; OK_Use : Boolean := False; Par : Node_Id; Prag_Nam : Name_Id; Spec_Id : Entity_Id; begin -- Traverse the parent chain looking for a suitable context for the -- reference to the concurrent constituent. Par := Parent (Ref); while Present (Par) loop if Nkind (Par) = N_Pragma then Prag_Nam := Pragma_Name (Par); -- A concurrent constituent is allowed to appear in pragmas -- Initial_Condition and Initializes as this is part of the -- elaboration checks for the constituent (SPARK RM 9.3). if Nam_In (Prag_Nam, Name_Initial_Condition, Name_Initializes) then OK_Use := True; exit; -- When the reference appears within pragma Depends or Global, -- check whether the pragma applies to a single task type. Note -- that the pragma is not encapsulated by the type definition, -- but this is still a valid context. elsif Nam_In (Prag_Nam, Name_Depends, Name_Global) then Decl := Find_Related_Declaration_Or_Body (Par); if Nkind (Decl) = N_Object_Declaration and then Defining_Entity (Decl) = Conc_Typ then OK_Use := True; exit; end if; end if; -- The reference appears somewhere in the definition of the single -- protected/task type (SPARK RM 9.3). elsif Nkind_In (Par, N_Single_Protected_Declaration, N_Single_Task_Declaration) and then Defining_Entity (Par) = Conc_Typ then OK_Use := True; exit; -- The reference appears within the expanded declaration or the body -- of the single protected/task type (SPARK RM 9.3). elsif Nkind_In (Par, N_Protected_Body, N_Protected_Type_Declaration, N_Task_Body, N_Task_Type_Declaration) then Spec_Id := Unique_Defining_Entity (Par); if Present (Anonymous_Object (Spec_Id)) and then Anonymous_Object (Spec_Id) = Conc_Typ then OK_Use := True; exit; end if; -- The reference has been relocated within an internally generated -- package or subprogram. Assume that the reference is legal as the -- real check was already performed in the original context of the -- reference. elsif Nkind_In (Par, N_Package_Body, N_Package_Declaration, N_Subprogram_Body, N_Subprogram_Declaration) and then not Comes_From_Source (Par) then OK_Use := True; exit; -- The reference has been relocated to an inlined body for GNATprove. -- Assume that the reference is legal as the real check was already -- performed in the original context of the reference. elsif GNATprove_Mode and then Nkind (Par) = N_Subprogram_Body and then Chars (Defining_Entity (Par)) = Name_uParent then OK_Use := True; exit; end if; Par := Parent (Par); end loop; -- The reference is illegal as it appears outside the definition or -- body of the single protected/task type. if not OK_Use then Error_Msg_NE ("reference to variable & cannot appear in this context", Ref, Var_Id); Error_Msg_Name_1 := Chars (Var_Id); if Ekind (Conc_Typ) = E_Protected_Type then Error_Msg_NE ("\% is constituent of single protected type &", Ref, Conc_Typ); else Error_Msg_NE ("\% is constituent of single task type &", Ref, Conc_Typ); end if; end if; end Check_Part_Of_Reference; ----------------------------------------- -- Check_Dynamically_Tagged_Expression -- ----------------------------------------- procedure Check_Dynamically_Tagged_Expression (Expr : Node_Id; Typ : Entity_Id; Related_Nod : Node_Id) is begin pragma Assert (Is_Tagged_Type (Typ)); -- In order to avoid spurious errors when analyzing the expanded code, -- this check is done only for nodes that come from source and for -- actuals of generic instantiations. if (Comes_From_Source (Related_Nod) or else In_Generic_Actual (Expr)) and then (Is_Class_Wide_Type (Etype (Expr)) or else Is_Dynamically_Tagged (Expr)) and then Is_Tagged_Type (Typ) and then not Is_Class_Wide_Type (Typ) then Error_Msg_N ("dynamically tagged expression not allowed!", Expr); end if; end Check_Dynamically_Tagged_Expression; -------------------------- -- Check_Fully_Declared -- -------------------------- procedure Check_Fully_Declared (T : Entity_Id; N : Node_Id) is begin if Ekind (T) = E_Incomplete_Type then -- Ada 2005 (AI-50217): If the type is available through a limited -- with_clause, verify that its full view has been analyzed. if From_Limited_With (T) and then Present (Non_Limited_View (T)) and then Ekind (Non_Limited_View (T)) /= E_Incomplete_Type then -- The non-limited view is fully declared null; else Error_Msg_NE ("premature usage of incomplete}", N, First_Subtype (T)); end if; -- Need comments for these tests ??? elsif Has_Private_Component (T) and then not Is_Generic_Type (Root_Type (T)) and then not In_Spec_Expression then -- Special case: if T is the anonymous type created for a single -- task or protected object, use the name of the source object. if Is_Concurrent_Type (T) and then not Comes_From_Source (T) and then Nkind (N) = N_Object_Declaration then Error_Msg_NE ("type of& has incomplete component", N, Defining_Identifier (N)); else Error_Msg_NE ("premature usage of incomplete}", N, First_Subtype (T)); end if; end if; end Check_Fully_Declared; ------------------------------------------- -- Check_Function_With_Address_Parameter -- ------------------------------------------- procedure Check_Function_With_Address_Parameter (Subp_Id : Entity_Id) is F : Entity_Id; T : Entity_Id; begin F := First_Formal (Subp_Id); while Present (F) loop T := Etype (F); if Is_Private_Type (T) and then Present (Full_View (T)) then T := Full_View (T); end if; if Is_Descendant_Of_Address (T) or else Is_Limited_Type (T) then Set_Is_Pure (Subp_Id, False); exit; end if; Next_Formal (F); end loop; end Check_Function_With_Address_Parameter; ------------------------------------- -- Check_Function_Writable_Actuals -- ------------------------------------- procedure Check_Function_Writable_Actuals (N : Node_Id) is Writable_Actuals_List : Elist_Id := No_Elist; Identifiers_List : Elist_Id := No_Elist; Aggr_Error_Node : Node_Id := Empty; Error_Node : Node_Id := Empty; procedure Collect_Identifiers (N : Node_Id); -- In a single traversal of subtree N collect in Writable_Actuals_List -- all the actuals of functions with writable actuals, and in the list -- Identifiers_List collect all the identifiers that are not actuals of -- functions with writable actuals. If a writable actual is referenced -- twice as writable actual then Error_Node is set to reference its -- second occurrence, the error is reported, and the tree traversal -- is abandoned. function Get_Function_Id (Call : Node_Id) return Entity_Id; -- Return the entity associated with the function call procedure Preanalyze_Without_Errors (N : Node_Id); -- Preanalyze N without reporting errors. Very dubious, you can't just -- go analyzing things more than once??? ------------------------- -- Collect_Identifiers -- ------------------------- procedure Collect_Identifiers (N : Node_Id) is function Check_Node (N : Node_Id) return Traverse_Result; -- Process a single node during the tree traversal to collect the -- writable actuals of functions and all the identifiers which are -- not writable actuals of functions. function Contains (List : Elist_Id; N : Node_Id) return Boolean; -- Returns True if List has a node whose Entity is Entity (N) ---------------- -- Check_Node -- ---------------- function Check_Node (N : Node_Id) return Traverse_Result is Is_Writable_Actual : Boolean := False; Id : Entity_Id; begin if Nkind (N) = N_Identifier then -- No analysis possible if the entity is not decorated if No (Entity (N)) then return Skip; -- Don't collect identifiers of packages, called functions, etc elsif Ekind_In (Entity (N), E_Package, E_Function, E_Procedure, E_Entry) then return Skip; -- For rewritten nodes, continue the traversal in the original -- subtree. Needed to handle aggregates in original expressions -- extracted from the tree by Remove_Side_Effects. elsif Is_Rewrite_Substitution (N) then Collect_Identifiers (Original_Node (N)); return Skip; -- For now we skip aggregate discriminants, since they require -- performing the analysis in two phases to identify conflicts: -- first one analyzing discriminants and second one analyzing -- the rest of components (since at run time, discriminants are -- evaluated prior to components): too much computation cost -- to identify a corner case??? elsif Nkind (Parent (N)) = N_Component_Association and then Nkind_In (Parent (Parent (N)), N_Aggregate, N_Extension_Aggregate) then declare Choice : constant Node_Id := First (Choices (Parent (N))); begin if Ekind (Entity (N)) = E_Discriminant then return Skip; elsif Expression (Parent (N)) = N and then Nkind (Choice) = N_Identifier and then Ekind (Entity (Choice)) = E_Discriminant then return Skip; end if; end; -- Analyze if N is a writable actual of a function elsif Nkind (Parent (N)) = N_Function_Call then declare Call : constant Node_Id := Parent (N); Actual : Node_Id; Formal : Node_Id; begin Id := Get_Function_Id (Call); -- In case of previous error, no check is possible if No (Id) then return Abandon; end if; if Ekind_In (Id, E_Function, E_Generic_Function) and then Has_Out_Or_In_Out_Parameter (Id) then Formal := First_Formal (Id); Actual := First_Actual (Call); while Present (Actual) and then Present (Formal) loop if Actual = N then if Ekind_In (Formal, E_Out_Parameter, E_In_Out_Parameter) then Is_Writable_Actual := True; end if; exit; end if; Next_Formal (Formal); Next_Actual (Actual); end loop; end if; end; end if; if Is_Writable_Actual then -- Skip checking the error in non-elementary types since -- RM 6.4.1(6.15/3) is restricted to elementary types, but -- store this actual in Writable_Actuals_List since it is -- needed to perform checks on other constructs that have -- arbitrary order of evaluation (for example, aggregates). if not Is_Elementary_Type (Etype (N)) then if not Contains (Writable_Actuals_List, N) then Append_New_Elmt (N, To => Writable_Actuals_List); end if; -- Second occurrence of an elementary type writable actual elsif Contains (Writable_Actuals_List, N) then -- Report the error on the second occurrence of the -- identifier. We cannot assume that N is the second -- occurrence (according to their location in the -- sources), since Traverse_Func walks through Field2 -- last (see comment in the body of Traverse_Func). declare Elmt : Elmt_Id; begin Elmt := First_Elmt (Writable_Actuals_List); while Present (Elmt) and then Entity (Node (Elmt)) /= Entity (N) loop Next_Elmt (Elmt); end loop; if Sloc (N) > Sloc (Node (Elmt)) then Error_Node := N; else Error_Node := Node (Elmt); end if; Error_Msg_NE ("value may be affected by call to & " & "because order of evaluation is arbitrary", Error_Node, Id); return Abandon; end; -- First occurrence of a elementary type writable actual else Append_New_Elmt (N, To => Writable_Actuals_List); end if; else if Identifiers_List = No_Elist then Identifiers_List := New_Elmt_List; end if; Append_Unique_Elmt (N, Identifiers_List); end if; end if; return OK; end Check_Node; -------------- -- Contains -- -------------- function Contains (List : Elist_Id; N : Node_Id) return Boolean is pragma Assert (Nkind (N) in N_Has_Entity); Elmt : Elmt_Id; begin if List = No_Elist then return False; end if; Elmt := First_Elmt (List); while Present (Elmt) loop if Entity (Node (Elmt)) = Entity (N) then return True; else Next_Elmt (Elmt); end if; end loop; return False; end Contains; ------------------ -- Do_Traversal -- ------------------ procedure Do_Traversal is new Traverse_Proc (Check_Node); -- The traversal procedure -- Start of processing for Collect_Identifiers begin if Present (Error_Node) then return; end if; if Nkind (N) in N_Subexpr and then Is_OK_Static_Expression (N) then return; end if; Do_Traversal (N); end Collect_Identifiers; --------------------- -- Get_Function_Id -- --------------------- function Get_Function_Id (Call : Node_Id) return Entity_Id is Nam : constant Node_Id := Name (Call); Id : Entity_Id; begin if Nkind (Nam) = N_Explicit_Dereference then Id := Etype (Nam); pragma Assert (Ekind (Id) = E_Subprogram_Type); elsif Nkind (Nam) = N_Selected_Component then Id := Entity (Selector_Name (Nam)); elsif Nkind (Nam) = N_Indexed_Component then Id := Entity (Selector_Name (Prefix (Nam))); else Id := Entity (Nam); end if; return Id; end Get_Function_Id; ------------------------------- -- Preanalyze_Without_Errors -- ------------------------------- procedure Preanalyze_Without_Errors (N : Node_Id) is Status : constant Boolean := Get_Ignore_Errors; begin Set_Ignore_Errors (True); Preanalyze (N); Set_Ignore_Errors (Status); end Preanalyze_Without_Errors; -- Start of processing for Check_Function_Writable_Actuals begin -- The check only applies to Ada 2012 code on which Check_Actuals has -- been set, and only to constructs that have multiple constituents -- whose order of evaluation is not specified by the language. if Ada_Version < Ada_2012 or else not Check_Actuals (N) or else (not (Nkind (N) in N_Op) and then not (Nkind (N) in N_Membership_Test) and then not Nkind_In (N, N_Range, N_Aggregate, N_Extension_Aggregate, N_Full_Type_Declaration, N_Function_Call, N_Procedure_Call_Statement, N_Entry_Call_Statement)) or else (Nkind (N) = N_Full_Type_Declaration and then not Is_Record_Type (Defining_Identifier (N))) -- In addition, this check only applies to source code, not to code -- generated by constraint checks. or else not Comes_From_Source (N) then return; end if; -- If a construct C has two or more direct constituents that are names -- or expressions whose evaluation may occur in an arbitrary order, at -- least one of which contains a function call with an in out or out -- parameter, then the construct is legal only if: for each name N that -- is passed as a parameter of mode in out or out to some inner function -- call C2 (not including the construct C itself), there is no other -- name anywhere within a direct constituent of the construct C other -- than the one containing C2, that is known to refer to the same -- object (RM 6.4.1(6.17/3)). case Nkind (N) is when N_Range => Collect_Identifiers (Low_Bound (N)); Collect_Identifiers (High_Bound (N)); when N_Membership_Test | N_Op => declare Expr : Node_Id; begin Collect_Identifiers (Left_Opnd (N)); if Present (Right_Opnd (N)) then Collect_Identifiers (Right_Opnd (N)); end if; if Nkind_In (N, N_In, N_Not_In) and then Present (Alternatives (N)) then Expr := First (Alternatives (N)); while Present (Expr) loop Collect_Identifiers (Expr); Next (Expr); end loop; end if; end; when N_Full_Type_Declaration => declare function Get_Record_Part (N : Node_Id) return Node_Id; -- Return the record part of this record type definition function Get_Record_Part (N : Node_Id) return Node_Id is Type_Def : constant Node_Id := Type_Definition (N); begin if Nkind (Type_Def) = N_Derived_Type_Definition then return Record_Extension_Part (Type_Def); else return Type_Def; end if; end Get_Record_Part; Comp : Node_Id; Def_Id : Entity_Id := Defining_Identifier (N); Rec : Node_Id := Get_Record_Part (N); begin -- No need to perform any analysis if the record has no -- components if No (Rec) or else No (Component_List (Rec)) then return; end if; -- Collect the identifiers starting from the deepest -- derivation. Done to report the error in the deepest -- derivation. loop if Present (Component_List (Rec)) then Comp := First (Component_Items (Component_List (Rec))); while Present (Comp) loop if Nkind (Comp) = N_Component_Declaration and then Present (Expression (Comp)) then Collect_Identifiers (Expression (Comp)); end if; Next (Comp); end loop; end if; exit when No (Underlying_Type (Etype (Def_Id))) or else Base_Type (Underlying_Type (Etype (Def_Id))) = Def_Id; Def_Id := Base_Type (Underlying_Type (Etype (Def_Id))); Rec := Get_Record_Part (Parent (Def_Id)); end loop; end; when N_Entry_Call_Statement | N_Subprogram_Call => declare Id : constant Entity_Id := Get_Function_Id (N); Formal : Node_Id; Actual : Node_Id; begin Formal := First_Formal (Id); Actual := First_Actual (N); while Present (Actual) and then Present (Formal) loop if Ekind_In (Formal, E_Out_Parameter, E_In_Out_Parameter) then Collect_Identifiers (Actual); end if; Next_Formal (Formal); Next_Actual (Actual); end loop; end; when N_Aggregate | N_Extension_Aggregate => declare Assoc : Node_Id; Choice : Node_Id; Comp_Expr : Node_Id; begin -- Handle the N_Others_Choice of array aggregates with static -- bounds. There is no need to perform this analysis in -- aggregates without static bounds since we cannot evaluate -- if the N_Others_Choice covers several elements. There is -- no need to handle the N_Others choice of record aggregates -- since at this stage it has been already expanded by -- Resolve_Record_Aggregate. if Is_Array_Type (Etype (N)) and then Nkind (N) = N_Aggregate and then Present (Aggregate_Bounds (N)) and then Compile_Time_Known_Bounds (Etype (N)) and then Expr_Value (High_Bound (Aggregate_Bounds (N))) > Expr_Value (Low_Bound (Aggregate_Bounds (N))) then declare Count_Components : Uint := Uint_0; Num_Components : Uint; Others_Assoc : Node_Id; Others_Choice : Node_Id := Empty; Others_Box_Present : Boolean := False; begin -- Count positional associations if Present (Expressions (N)) then Comp_Expr := First (Expressions (N)); while Present (Comp_Expr) loop Count_Components := Count_Components + 1; Next (Comp_Expr); end loop; end if; -- Count the rest of elements and locate the N_Others -- choice (if any) Assoc := First (Component_Associations (N)); while Present (Assoc) loop Choice := First (Choices (Assoc)); while Present (Choice) loop if Nkind (Choice) = N_Others_Choice then Others_Assoc := Assoc; Others_Choice := Choice; Others_Box_Present := Box_Present (Assoc); -- Count several components elsif Nkind_In (Choice, N_Range, N_Subtype_Indication) or else (Is_Entity_Name (Choice) and then Is_Type (Entity (Choice))) then declare L, H : Node_Id; begin Get_Index_Bounds (Choice, L, H); pragma Assert (Compile_Time_Known_Value (L) and then Compile_Time_Known_Value (H)); Count_Components := Count_Components + Expr_Value (H) - Expr_Value (L) + 1; end; -- Count single component. No other case available -- since we are handling an aggregate with static -- bounds. else pragma Assert (Is_OK_Static_Expression (Choice) or else Nkind (Choice) = N_Identifier or else Nkind (Choice) = N_Integer_Literal); Count_Components := Count_Components + 1; end if; Next (Choice); end loop; Next (Assoc); end loop; Num_Components := Expr_Value (High_Bound (Aggregate_Bounds (N))) - Expr_Value (Low_Bound (Aggregate_Bounds (N))) + 1; pragma Assert (Count_Components <= Num_Components); -- Handle the N_Others choice if it covers several -- components if Present (Others_Choice) and then (Num_Components - Count_Components) > 1 then if not Others_Box_Present then -- At this stage, if expansion is active, the -- expression of the others choice has not been -- analyzed. Hence we generate a duplicate and -- we analyze it silently to have available the -- minimum decoration required to collect the -- identifiers. if not Expander_Active then Comp_Expr := Expression (Others_Assoc); else Comp_Expr := New_Copy_Tree (Expression (Others_Assoc)); Preanalyze_Without_Errors (Comp_Expr); end if; Collect_Identifiers (Comp_Expr); if Writable_Actuals_List /= No_Elist then -- As suggested by Robert, at current stage we -- report occurrences of this case as warnings. Error_Msg_N ("writable function parameter may affect " & "value in other component because order " & "of evaluation is unspecified??", Node (First_Elmt (Writable_Actuals_List))); end if; end if; end if; end; -- For an array aggregate, a discrete_choice_list that has -- a nonstatic range is considered as two or more separate -- occurrences of the expression (RM 6.4.1(20/3)). elsif Is_Array_Type (Etype (N)) and then Nkind (N) = N_Aggregate and then Present (Aggregate_Bounds (N)) and then not Compile_Time_Known_Bounds (Etype (N)) then -- Collect identifiers found in the dynamic bounds declare Count_Components : Natural := 0; Low, High : Node_Id; begin Assoc := First (Component_Associations (N)); while Present (Assoc) loop Choice := First (Choices (Assoc)); while Present (Choice) loop if Nkind_In (Choice, N_Range, N_Subtype_Indication) or else (Is_Entity_Name (Choice) and then Is_Type (Entity (Choice))) then Get_Index_Bounds (Choice, Low, High); if not Compile_Time_Known_Value (Low) then Collect_Identifiers (Low); if No (Aggr_Error_Node) then Aggr_Error_Node := Low; end if; end if; if not Compile_Time_Known_Value (High) then Collect_Identifiers (High); if No (Aggr_Error_Node) then Aggr_Error_Node := High; end if; end if; -- The RM rule is violated if there is more than -- a single choice in a component association. else Count_Components := Count_Components + 1; if No (Aggr_Error_Node) and then Count_Components > 1 then Aggr_Error_Node := Choice; end if; if not Compile_Time_Known_Value (Choice) then Collect_Identifiers (Choice); end if; end if; Next (Choice); end loop; Next (Assoc); end loop; end; end if; -- Handle ancestor part of extension aggregates if Nkind (N) = N_Extension_Aggregate then Collect_Identifiers (Ancestor_Part (N)); end if; -- Handle positional associations if Present (Expressions (N)) then Comp_Expr := First (Expressions (N)); while Present (Comp_Expr) loop if not Is_OK_Static_Expression (Comp_Expr) then Collect_Identifiers (Comp_Expr); end if; Next (Comp_Expr); end loop; end if; -- Handle discrete associations if Present (Component_Associations (N)) then Assoc := First (Component_Associations (N)); while Present (Assoc) loop if not Box_Present (Assoc) then Choice := First (Choices (Assoc)); while Present (Choice) loop -- For now we skip discriminants since it requires -- performing the analysis in two phases: first one -- analyzing discriminants and second one analyzing -- the rest of components since discriminants are -- evaluated prior to components: too much extra -- work to detect a corner case??? if Nkind (Choice) in N_Has_Entity and then Present (Entity (Choice)) and then Ekind (Entity (Choice)) = E_Discriminant then null; elsif Box_Present (Assoc) then null; else if not Analyzed (Expression (Assoc)) then Comp_Expr := New_Copy_Tree (Expression (Assoc)); Set_Parent (Comp_Expr, Parent (N)); Preanalyze_Without_Errors (Comp_Expr); else Comp_Expr := Expression (Assoc); end if; Collect_Identifiers (Comp_Expr); end if; Next (Choice); end loop; end if; Next (Assoc); end loop; end if; end; when others => return; end case; -- No further action needed if we already reported an error if Present (Error_Node) then return; end if; -- Check violation of RM 6.20/3 in aggregates if Present (Aggr_Error_Node) and then Writable_Actuals_List /= No_Elist then Error_Msg_N ("value may be affected by call in other component because they " & "are evaluated in unspecified order", Node (First_Elmt (Writable_Actuals_List))); return; end if; -- Check if some writable argument of a function is referenced if Writable_Actuals_List /= No_Elist and then Identifiers_List /= No_Elist then declare Elmt_1 : Elmt_Id; Elmt_2 : Elmt_Id; begin Elmt_1 := First_Elmt (Writable_Actuals_List); while Present (Elmt_1) loop Elmt_2 := First_Elmt (Identifiers_List); while Present (Elmt_2) loop if Entity (Node (Elmt_1)) = Entity (Node (Elmt_2)) then case Nkind (Parent (Node (Elmt_2))) is when N_Aggregate | N_Component_Association | N_Component_Declaration => Error_Msg_N ("value may be affected by call in other " & "component because they are evaluated " & "in unspecified order", Node (Elmt_2)); when N_In | N_Not_In => Error_Msg_N ("value may be affected by call in other " & "alternative because they are evaluated " & "in unspecified order", Node (Elmt_2)); when others => Error_Msg_N ("value of actual may be affected by call in " & "other actual because they are evaluated " & "in unspecified order", Node (Elmt_2)); end case; end if; Next_Elmt (Elmt_2); end loop; Next_Elmt (Elmt_1); end loop; end; end if; end Check_Function_Writable_Actuals; -------------------------------- -- Check_Implicit_Dereference -- -------------------------------- procedure Check_Implicit_Dereference (N : Node_Id; Typ : Entity_Id) is Disc : Entity_Id; Desig : Entity_Id; Nam : Node_Id; begin if Nkind (N) = N_Indexed_Component and then Present (Generalized_Indexing (N)) then Nam := Generalized_Indexing (N); else Nam := N; end if; if Ada_Version < Ada_2012 or else not Has_Implicit_Dereference (Base_Type (Typ)) then return; elsif not Comes_From_Source (N) and then Nkind (N) /= N_Indexed_Component then return; elsif Is_Entity_Name (Nam) and then Is_Type (Entity (Nam)) then null; else Disc := First_Discriminant (Typ); while Present (Disc) loop if Has_Implicit_Dereference (Disc) then Desig := Designated_Type (Etype (Disc)); Add_One_Interp (Nam, Disc, Desig); -- If the node is a generalized indexing, add interpretation -- to that node as well, for subsequent resolution. if Nkind (N) = N_Indexed_Component then Add_One_Interp (N, Disc, Desig); end if; -- If the operation comes from a generic unit and the context -- is a selected component, the selector name may be global -- and set in the instance already. Remove the entity to -- force resolution of the selected component, and the -- generation of an explicit dereference if needed. if In_Instance and then Nkind (Parent (Nam)) = N_Selected_Component then Set_Entity (Selector_Name (Parent (Nam)), Empty); end if; exit; end if; Next_Discriminant (Disc); end loop; end if; end Check_Implicit_Dereference; ---------------------------------- -- Check_Internal_Protected_Use -- ---------------------------------- procedure Check_Internal_Protected_Use (N : Node_Id; Nam : Entity_Id) is S : Entity_Id; Prot : Entity_Id; begin S := Current_Scope; while Present (S) loop if S = Standard_Standard then return; elsif Ekind (S) = E_Function and then Ekind (Scope (S)) = E_Protected_Type then Prot := Scope (S); exit; end if; S := Scope (S); end loop; if Scope (Nam) = Prot and then Ekind (Nam) /= E_Function then -- An indirect function call (e.g. a callback within a protected -- function body) is not statically illegal. If the access type is -- anonymous and is the type of an access parameter, the scope of Nam -- will be the protected type, but it is not a protected operation. if Ekind (Nam) = E_Subprogram_Type and then Nkind (Associated_Node_For_Itype (Nam)) = N_Function_Specification then null; elsif Nkind (N) = N_Subprogram_Renaming_Declaration then Error_Msg_N ("within protected function cannot use protected " & "procedure in renaming or as generic actual", N); elsif Nkind (N) = N_Attribute_Reference then Error_Msg_N ("within protected function cannot take access of " & " protected procedure", N); else Error_Msg_N ("within protected function, protected object is constant", N); Error_Msg_N ("\cannot call operation that may modify it", N); end if; end if; end Check_Internal_Protected_Use; --------------------------------------- -- Check_Later_Vs_Basic_Declarations -- --------------------------------------- procedure Check_Later_Vs_Basic_Declarations (Decls : List_Id; During_Parsing : Boolean) is Body_Sloc : Source_Ptr; Decl : Node_Id; function Is_Later_Declarative_Item (Decl : Node_Id) return Boolean; -- Return whether Decl is considered as a declarative item. -- When During_Parsing is True, the semantics of Ada 83 is followed. -- When During_Parsing is False, the semantics of SPARK is followed. ------------------------------- -- Is_Later_Declarative_Item -- ------------------------------- function Is_Later_Declarative_Item (Decl : Node_Id) return Boolean is begin if Nkind (Decl) in N_Later_Decl_Item then return True; elsif Nkind (Decl) = N_Pragma then return True; elsif During_Parsing then return False; -- In SPARK, a package declaration is not considered as a later -- declarative item. elsif Nkind (Decl) = N_Package_Declaration then return False; -- In SPARK, a renaming is considered as a later declarative item elsif Nkind (Decl) in N_Renaming_Declaration then return True; else return False; end if; end Is_Later_Declarative_Item; -- Start of processing for Check_Later_Vs_Basic_Declarations begin Decl := First (Decls); -- Loop through sequence of basic declarative items Outer : while Present (Decl) loop if not Nkind_In (Decl, N_Subprogram_Body, N_Package_Body, N_Task_Body) and then Nkind (Decl) not in N_Body_Stub then Next (Decl); -- Once a body is encountered, we only allow later declarative -- items. The inner loop checks the rest of the list. else Body_Sloc := Sloc (Decl); Inner : while Present (Decl) loop if not Is_Later_Declarative_Item (Decl) then if During_Parsing then if Ada_Version = Ada_83 then Error_Msg_Sloc := Body_Sloc; Error_Msg_N ("(Ada 83) decl cannot appear after body#", Decl); end if; else Error_Msg_Sloc := Body_Sloc; Check_SPARK_05_Restriction ("decl cannot appear after body#", Decl); end if; end if; Next (Decl); end loop Inner; end if; end loop Outer; end Check_Later_Vs_Basic_Declarations; --------------------------- -- Check_No_Hidden_State -- --------------------------- procedure Check_No_Hidden_State (Id : Entity_Id) is function Has_Null_Abstract_State (Pkg : Entity_Id) return Boolean; -- Determine whether the entity of a package denoted by Pkg has a null -- abstract state. ----------------------------- -- Has_Null_Abstract_State -- ----------------------------- function Has_Null_Abstract_State (Pkg : Entity_Id) return Boolean is States : constant Elist_Id := Abstract_States (Pkg); begin -- Check first available state of related package. A null abstract -- state always appears as the sole element of the state list. return Present (States) and then Is_Null_State (Node (First_Elmt (States))); end Has_Null_Abstract_State; -- Local variables Context : Entity_Id := Empty; Not_Visible : Boolean := False; Scop : Entity_Id; -- Start of processing for Check_No_Hidden_State begin pragma Assert (Ekind_In (Id, E_Abstract_State, E_Variable)); -- Find the proper context where the object or state appears Scop := Scope (Id); while Present (Scop) loop Context := Scop; -- Keep track of the context's visibility Not_Visible := Not_Visible or else In_Private_Part (Context); -- Prevent the search from going too far if Context = Standard_Standard then return; -- Objects and states that appear immediately within a subprogram or -- inside a construct nested within a subprogram do not introduce a -- hidden state. They behave as local variable declarations. elsif Is_Subprogram (Context) then return; -- When examining a package body, use the entity of the spec as it -- carries the abstract state declarations. elsif Ekind (Context) = E_Package_Body then Context := Spec_Entity (Context); end if; -- Stop the traversal when a package subject to a null abstract state -- has been found. if Ekind_In (Context, E_Generic_Package, E_Package) and then Has_Null_Abstract_State (Context) then exit; end if; Scop := Scope (Scop); end loop; -- At this point we know that there is at least one package with a null -- abstract state in visibility. Emit an error message unconditionally -- if the entity being processed is a state because the placement of the -- related package is irrelevant. This is not the case for objects as -- the intermediate context matters. if Present (Context) and then (Ekind (Id) = E_Abstract_State or else Not_Visible) then Error_Msg_N ("cannot introduce hidden state &", Id); Error_Msg_NE ("\package & has null abstract state", Id, Context); end if; end Check_No_Hidden_State; ---------------------------------------- -- Check_Nonvolatile_Function_Profile -- ---------------------------------------- procedure Check_Nonvolatile_Function_Profile (Func_Id : Entity_Id) is Formal : Entity_Id; begin -- Inspect all formal parameters Formal := First_Formal (Func_Id); while Present (Formal) loop if Is_Effectively_Volatile (Etype (Formal)) then Error_Msg_NE ("nonvolatile function & cannot have a volatile parameter", Formal, Func_Id); end if; Next_Formal (Formal); end loop; -- Inspect the return type if Is_Effectively_Volatile (Etype (Func_Id)) then Error_Msg_NE ("nonvolatile function & cannot have a volatile return type", Result_Definition (Parent (Func_Id)), Func_Id); end if; end Check_Nonvolatile_Function_Profile; ------------------------------------------ -- Check_Potentially_Blocking_Operation -- ------------------------------------------ procedure Check_Potentially_Blocking_Operation (N : Node_Id) is S : Entity_Id; begin -- N is one of the potentially blocking operations listed in 9.5.1(8). -- When pragma Detect_Blocking is active, the run time will raise -- Program_Error. Here we only issue a warning, since we generally -- support the use of potentially blocking operations in the absence -- of the pragma. -- Indirect blocking through a subprogram call cannot be diagnosed -- statically without interprocedural analysis, so we do not attempt -- to do it here. S := Scope (Current_Scope); while Present (S) and then S /= Standard_Standard loop if Is_Protected_Type (S) then Error_Msg_N ("potentially blocking operation in protected operation??", N); return; end if; S := Scope (S); end loop; end Check_Potentially_Blocking_Operation; --------------------------------- -- Check_Result_And_Post_State -- --------------------------------- procedure Check_Result_And_Post_State (Subp_Id : Entity_Id) is procedure Check_Result_And_Post_State_In_Pragma (Prag : Node_Id; Result_Seen : in out Boolean); -- Determine whether pragma Prag mentions attribute 'Result and whether -- the pragma contains an expression that evaluates differently in pre- -- and post-state. Prag is a [refined] postcondition or a contract-cases -- pragma. Result_Seen is set when the pragma mentions attribute 'Result function Has_In_Out_Parameter (Subp_Id : Entity_Id) return Boolean; -- Determine whether subprogram Subp_Id contains at least one IN OUT -- formal parameter. ------------------------------------------- -- Check_Result_And_Post_State_In_Pragma -- ------------------------------------------- procedure Check_Result_And_Post_State_In_Pragma (Prag : Node_Id; Result_Seen : in out Boolean) is procedure Check_Expression (Expr : Node_Id); -- Perform the 'Result and post-state checks on a given expression function Is_Function_Result (N : Node_Id) return Traverse_Result; -- Attempt to find attribute 'Result in a subtree denoted by N function Is_Trivial_Boolean (N : Node_Id) return Boolean; -- Determine whether source node N denotes "True" or "False" function Mentions_Post_State (N : Node_Id) return Boolean; -- Determine whether a subtree denoted by N mentions any construct -- that denotes a post-state. procedure Check_Function_Result is new Traverse_Proc (Is_Function_Result); ---------------------- -- Check_Expression -- ---------------------- procedure Check_Expression (Expr : Node_Id) is begin if not Is_Trivial_Boolean (Expr) then Check_Function_Result (Expr); if not Mentions_Post_State (Expr) then if Pragma_Name (Prag) = Name_Contract_Cases then Error_Msg_NE ("contract case does not check the outcome of calling " & "&?T?", Expr, Subp_Id); elsif Pragma_Name (Prag) = Name_Refined_Post then Error_Msg_NE ("refined postcondition does not check the outcome of " & "calling &?T?", Prag, Subp_Id); else Error_Msg_NE ("postcondition does not check the outcome of calling " & "&?T?", Prag, Subp_Id); end if; end if; end if; end Check_Expression; ------------------------ -- Is_Function_Result -- ------------------------ function Is_Function_Result (N : Node_Id) return Traverse_Result is begin if Is_Attribute_Result (N) then Result_Seen := True; return Abandon; -- Continue the traversal else return OK; end if; end Is_Function_Result; ------------------------ -- Is_Trivial_Boolean -- ------------------------ function Is_Trivial_Boolean (N : Node_Id) return Boolean is begin return Comes_From_Source (N) and then Is_Entity_Name (N) and then (Entity (N) = Standard_True or else Entity (N) = Standard_False); end Is_Trivial_Boolean; ------------------------- -- Mentions_Post_State -- ------------------------- function Mentions_Post_State (N : Node_Id) return Boolean is Post_State_Seen : Boolean := False; function Is_Post_State (N : Node_Id) return Traverse_Result; -- Attempt to find a construct that denotes a post-state. If this -- is the case, set flag Post_State_Seen. ------------------- -- Is_Post_State -- ------------------- function Is_Post_State (N : Node_Id) return Traverse_Result is Ent : Entity_Id; begin if Nkind_In (N, N_Explicit_Dereference, N_Function_Call) then Post_State_Seen := True; return Abandon; elsif Nkind_In (N, N_Expanded_Name, N_Identifier) then Ent := Entity (N); -- The entity may be modifiable through an implicit -- dereference. if No (Ent) or else Ekind (Ent) in Assignable_Kind or else (Is_Access_Type (Etype (Ent)) and then Nkind (Parent (N)) = N_Selected_Component) then Post_State_Seen := True; return Abandon; end if; elsif Nkind (N) = N_Attribute_Reference then if Attribute_Name (N) = Name_Old then return Skip; elsif Attribute_Name (N) = Name_Result then Post_State_Seen := True; return Abandon; end if; end if; return OK; end Is_Post_State; procedure Find_Post_State is new Traverse_Proc (Is_Post_State); -- Start of processing for Mentions_Post_State begin Find_Post_State (N); return Post_State_Seen; end Mentions_Post_State; -- Local variables Expr : constant Node_Id := Get_Pragma_Arg (First (Pragma_Argument_Associations (Prag))); Nam : constant Name_Id := Pragma_Name (Prag); CCase : Node_Id; -- Start of processing for Check_Result_And_Post_State_In_Pragma begin -- Examine all consequences if Nam = Name_Contract_Cases then CCase := First (Component_Associations (Expr)); while Present (CCase) loop Check_Expression (Expression (CCase)); Next (CCase); end loop; -- Examine the expression of a postcondition else pragma Assert (Nam_In (Nam, Name_Postcondition, Name_Refined_Post)); Check_Expression (Expr); end if; end Check_Result_And_Post_State_In_Pragma; -------------------------- -- Has_In_Out_Parameter -- -------------------------- function Has_In_Out_Parameter (Subp_Id : Entity_Id) return Boolean is Formal : Entity_Id; begin -- Traverse the formals looking for an IN OUT parameter Formal := First_Formal (Subp_Id); while Present (Formal) loop if Ekind (Formal) = E_In_Out_Parameter then return True; end if; Next_Formal (Formal); end loop; return False; end Has_In_Out_Parameter; -- Local variables Items : constant Node_Id := Contract (Subp_Id); Subp_Decl : constant Node_Id := Unit_Declaration_Node (Subp_Id); Case_Prag : Node_Id := Empty; Post_Prag : Node_Id := Empty; Prag : Node_Id; Seen_In_Case : Boolean := False; Seen_In_Post : Boolean := False; Spec_Id : Entity_Id; -- Start of processing for Check_Result_And_Post_State begin -- The lack of attribute 'Result or a post-state is classified as a -- suspicious contract. Do not perform the check if the corresponding -- swich is not set. if not Warn_On_Suspicious_Contract then return; -- Nothing to do if there is no contract elsif No (Items) then return; end if; -- Retrieve the entity of the subprogram spec (if any) if Nkind (Subp_Decl) = N_Subprogram_Body and then Present (Corresponding_Spec (Subp_Decl)) then Spec_Id := Corresponding_Spec (Subp_Decl); elsif Nkind (Subp_Decl) = N_Subprogram_Body_Stub and then Present (Corresponding_Spec_Of_Stub (Subp_Decl)) then Spec_Id := Corresponding_Spec_Of_Stub (Subp_Decl); else Spec_Id := Subp_Id; end if; -- Examine all postconditions for attribute 'Result and a post-state Prag := Pre_Post_Conditions (Items); while Present (Prag) loop if Nam_In (Pragma_Name_Unmapped (Prag), Name_Postcondition, Name_Refined_Post) and then not Error_Posted (Prag) then Post_Prag := Prag; Check_Result_And_Post_State_In_Pragma (Prag, Seen_In_Post); end if; Prag := Next_Pragma (Prag); end loop; -- Examine the contract cases of the subprogram for attribute 'Result -- and a post-state. Prag := Contract_Test_Cases (Items); while Present (Prag) loop if Pragma_Name (Prag) = Name_Contract_Cases and then not Error_Posted (Prag) then Case_Prag := Prag; Check_Result_And_Post_State_In_Pragma (Prag, Seen_In_Case); end if; Prag := Next_Pragma (Prag); end loop; -- Do not emit any errors if the subprogram is not a function if not Ekind_In (Spec_Id, E_Function, E_Generic_Function) then null; -- Regardless of whether the function has postconditions or contract -- cases, or whether they mention attribute 'Result, an IN OUT formal -- parameter is always treated as a result. elsif Has_In_Out_Parameter (Spec_Id) then null; -- The function has both a postcondition and contract cases and they do -- not mention attribute 'Result. elsif Present (Case_Prag) and then not Seen_In_Case and then Present (Post_Prag) and then not Seen_In_Post then Error_Msg_N ("neither postcondition nor contract cases mention function " & "result?T?", Post_Prag); -- The function has contract cases only and they do not mention -- attribute 'Result. elsif Present (Case_Prag) and then not Seen_In_Case then Error_Msg_N ("contract cases do not mention result?T?", Case_Prag); -- The function has postconditions only and they do not mention -- attribute 'Result. elsif Present (Post_Prag) and then not Seen_In_Post then Error_Msg_N ("postcondition does not mention function result?T?", Post_Prag); end if; end Check_Result_And_Post_State; ----------------------------- -- Check_State_Refinements -- ----------------------------- procedure Check_State_Refinements (Context : Node_Id; Is_Main_Unit : Boolean := False) is procedure Check_Package (Pack : Node_Id); -- Verify that all abstract states of a [generic] package denoted by its -- declarative node Pack have proper refinement. Recursively verify the -- visible and private declarations of the [generic] package for other -- nested packages. procedure Check_Packages_In (Decls : List_Id); -- Seek out [generic] package declarations within declarative list Decls -- and verify the status of their abstract state refinement. function SPARK_Mode_Is_Off (N : Node_Id) return Boolean; -- Determine whether construct N is subject to pragma SPARK_Mode Off ------------------- -- Check_Package -- ------------------- procedure Check_Package (Pack : Node_Id) is Body_Id : constant Entity_Id := Corresponding_Body (Pack); Spec : constant Node_Id := Specification (Pack); States : constant Elist_Id := Abstract_States (Defining_Entity (Pack)); State_Elmt : Elmt_Id; State_Id : Entity_Id; begin -- Do not verify proper state refinement when the package is subject -- to pragma SPARK_Mode Off because this disables the requirement for -- state refinement. if SPARK_Mode_Is_Off (Pack) then null; -- State refinement can only occur in a completing packge body. Do -- not verify proper state refinement when the body is subject to -- pragma SPARK_Mode Off because this disables the requirement for -- state refinement. elsif Present (Body_Id) and then SPARK_Mode_Is_Off (Unit_Declaration_Node (Body_Id)) then null; -- Do not verify proper state refinement when the package is an -- instance as this check was already performed in the generic. elsif Present (Generic_Parent (Spec)) then null; -- Otherwise examine the contents of the package else if Present (States) then State_Elmt := First_Elmt (States); while Present (State_Elmt) loop State_Id := Node (State_Elmt); -- Emit an error when a non-null state lacks any form of -- refinement. if not Is_Null_State (State_Id) and then not Has_Null_Refinement (State_Id) and then not Has_Non_Null_Refinement (State_Id) then Error_Msg_N ("state & requires refinement", State_Id); end if; Next_Elmt (State_Elmt); end loop; end if; Check_Packages_In (Visible_Declarations (Spec)); Check_Packages_In (Private_Declarations (Spec)); end if; end Check_Package; ----------------------- -- Check_Packages_In -- ----------------------- procedure Check_Packages_In (Decls : List_Id) is Decl : Node_Id; begin if Present (Decls) then Decl := First (Decls); while Present (Decl) loop if Nkind_In (Decl, N_Generic_Package_Declaration, N_Package_Declaration) then Check_Package (Decl); end if; Next (Decl); end loop; end if; end Check_Packages_In; ----------------------- -- SPARK_Mode_Is_Off -- ----------------------- function SPARK_Mode_Is_Off (N : Node_Id) return Boolean is Prag : constant Node_Id := SPARK_Pragma (Defining_Entity (N)); begin return Present (Prag) and then Get_SPARK_Mode_From_Annotation (Prag) = Off; end SPARK_Mode_Is_Off; -- Start of processing for Check_State_Refinements begin -- A block may declare a nested package if Nkind (Context) = N_Block_Statement then Check_Packages_In (Declarations (Context)); -- An entry, protected, subprogram, or task body may declare a nested -- package. elsif Nkind_In (Context, N_Entry_Body, N_Protected_Body, N_Subprogram_Body, N_Task_Body) then -- Do not verify proper state refinement when the body is subject to -- pragma SPARK_Mode Off because this disables the requirement for -- state refinement. if not SPARK_Mode_Is_Off (Context) then Check_Packages_In (Declarations (Context)); end if; -- A package body may declare a nested package elsif Nkind (Context) = N_Package_Body then Check_Package (Unit_Declaration_Node (Corresponding_Spec (Context))); -- Do not verify proper state refinement when the body is subject to -- pragma SPARK_Mode Off because this disables the requirement for -- state refinement. if not SPARK_Mode_Is_Off (Context) then Check_Packages_In (Declarations (Context)); end if; -- A library level [generic] package may declare a nested package elsif Nkind_In (Context, N_Generic_Package_Declaration, N_Package_Declaration) and then Is_Main_Unit then Check_Package (Context); end if; end Check_State_Refinements; ------------------------------ -- Check_Unprotected_Access -- ------------------------------ procedure Check_Unprotected_Access (Context : Node_Id; Expr : Node_Id) is Cont_Encl_Typ : Entity_Id; Pref_Encl_Typ : Entity_Id; function Enclosing_Protected_Type (Obj : Node_Id) return Entity_Id; -- Check whether Obj is a private component of a protected object. -- Return the protected type where the component resides, Empty -- otherwise. function Is_Public_Operation return Boolean; -- Verify that the enclosing operation is callable from outside the -- protected object, to minimize false positives. ------------------------------ -- Enclosing_Protected_Type -- ------------------------------ function Enclosing_Protected_Type (Obj : Node_Id) return Entity_Id is begin if Is_Entity_Name (Obj) then declare Ent : Entity_Id := Entity (Obj); begin -- The object can be a renaming of a private component, use -- the original record component. if Is_Prival (Ent) then Ent := Prival_Link (Ent); end if; if Is_Protected_Type (Scope (Ent)) then return Scope (Ent); end if; end; end if; -- For indexed and selected components, recursively check the prefix if Nkind_In (Obj, N_Indexed_Component, N_Selected_Component) then return Enclosing_Protected_Type (Prefix (Obj)); -- The object does not denote a protected component else return Empty; end if; end Enclosing_Protected_Type; ------------------------- -- Is_Public_Operation -- ------------------------- function Is_Public_Operation return Boolean is S : Entity_Id; E : Entity_Id; begin S := Current_Scope; while Present (S) and then S /= Pref_Encl_Typ loop if Scope (S) = Pref_Encl_Typ then E := First_Entity (Pref_Encl_Typ); while Present (E) and then E /= First_Private_Entity (Pref_Encl_Typ) loop if E = S then return True; end if; Next_Entity (E); end loop; end if; S := Scope (S); end loop; return False; end Is_Public_Operation; -- Start of processing for Check_Unprotected_Access begin if Nkind (Expr) = N_Attribute_Reference and then Attribute_Name (Expr) = Name_Unchecked_Access then Cont_Encl_Typ := Enclosing_Protected_Type (Context); Pref_Encl_Typ := Enclosing_Protected_Type (Prefix (Expr)); -- Check whether we are trying to export a protected component to a -- context with an equal or lower access level. if Present (Pref_Encl_Typ) and then No (Cont_Encl_Typ) and then Is_Public_Operation and then Scope_Depth (Pref_Encl_Typ) >= Object_Access_Level (Context) then Error_Msg_N ("??possible unprotected access to protected data", Expr); end if; end if; end Check_Unprotected_Access; ------------------------------ -- Check_Unused_Body_States -- ------------------------------ procedure Check_Unused_Body_States (Body_Id : Entity_Id) is procedure Process_Refinement_Clause (Clause : Node_Id; States : Elist_Id); -- Inspect all constituents of refinement clause Clause and remove any -- matches from body state list States. procedure Report_Unused_Body_States (States : Elist_Id); -- Emit errors for each abstract state or object found in list States ------------------------------- -- Process_Refinement_Clause -- ------------------------------- procedure Process_Refinement_Clause (Clause : Node_Id; States : Elist_Id) is procedure Process_Constituent (Constit : Node_Id); -- Remove constituent Constit from body state list States ------------------------- -- Process_Constituent -- ------------------------- procedure Process_Constituent (Constit : Node_Id) is Constit_Id : Entity_Id; begin -- Guard against illegal constituents. Only abstract states and -- objects can appear on the right hand side of a refinement. if Is_Entity_Name (Constit) then Constit_Id := Entity_Of (Constit); if Present (Constit_Id) and then Ekind_In (Constit_Id, E_Abstract_State, E_Constant, E_Variable) then Remove (States, Constit_Id); end if; end if; end Process_Constituent; -- Local variables Constit : Node_Id; -- Start of processing for Process_Refinement_Clause begin if Nkind (Clause) = N_Component_Association then Constit := Expression (Clause); -- Multiple constituents appear as an aggregate if Nkind (Constit) = N_Aggregate then Constit := First (Expressions (Constit)); while Present (Constit) loop Process_Constituent (Constit); Next (Constit); end loop; -- Various forms of a single constituent else Process_Constituent (Constit); end if; end if; end Process_Refinement_Clause; ------------------------------- -- Report_Unused_Body_States -- ------------------------------- procedure Report_Unused_Body_States (States : Elist_Id) is Posted : Boolean := False; State_Elmt : Elmt_Id; State_Id : Entity_Id; begin if Present (States) then State_Elmt := First_Elmt (States); while Present (State_Elmt) loop State_Id := Node (State_Elmt); -- Constants are part of the hidden state of a package, but the -- compiler cannot determine whether they have variable input -- (SPARK RM 7.1.1(2)) and cannot classify them properly as a -- hidden state. Do not emit an error when a constant does not -- participate in a state refinement, even though it acts as a -- hidden state. if Ekind (State_Id) = E_Constant then null; -- Generate an error message of the form: -- body of package ... has unused hidden states -- abstract state ... defined at ... -- variable ... defined at ... else if not Posted then Posted := True; SPARK_Msg_N ("body of package & has unused hidden states", Body_Id); end if; Error_Msg_Sloc := Sloc (State_Id); if Ekind (State_Id) = E_Abstract_State then SPARK_Msg_NE ("\abstract state & defined #", Body_Id, State_Id); else SPARK_Msg_NE ("\variable & defined #", Body_Id, State_Id); end if; end if; Next_Elmt (State_Elmt); end loop; end if; end Report_Unused_Body_States; -- Local variables Prag : constant Node_Id := Get_Pragma (Body_Id, Pragma_Refined_State); Spec_Id : constant Entity_Id := Spec_Entity (Body_Id); Clause : Node_Id; States : Elist_Id; -- Start of processing for Check_Unused_Body_States begin -- Inspect the clauses of pragma Refined_State and determine whether all -- visible states declared within the package body participate in the -- refinement. if Present (Prag) then Clause := Expression (Get_Argument (Prag, Spec_Id)); States := Collect_Body_States (Body_Id); -- Multiple non-null state refinements appear as an aggregate if Nkind (Clause) = N_Aggregate then Clause := First (Component_Associations (Clause)); while Present (Clause) loop Process_Refinement_Clause (Clause, States); Next (Clause); end loop; -- Various forms of a single state refinement else Process_Refinement_Clause (Clause, States); end if; -- Ensure that all abstract states and objects declared in the -- package body state space are utilized as constituents. Report_Unused_Body_States (States); end if; end Check_Unused_Body_States; ----------------- -- Choice_List -- ----------------- function Choice_List (N : Node_Id) return List_Id is begin if Nkind (N) = N_Iterated_Component_Association then return Discrete_Choices (N); else return Choices (N); end if; end Choice_List; ------------------------- -- Collect_Body_States -- ------------------------- function Collect_Body_States (Body_Id : Entity_Id) return Elist_Id is function Is_Visible_Object (Obj_Id : Entity_Id) return Boolean; -- Determine whether object Obj_Id is a suitable visible state of a -- package body. procedure Collect_Visible_States (Pack_Id : Entity_Id; States : in out Elist_Id); -- Gather the entities of all abstract states and objects declared in -- the visible state space of package Pack_Id. ---------------------------- -- Collect_Visible_States -- ---------------------------- procedure Collect_Visible_States (Pack_Id : Entity_Id; States : in out Elist_Id) is Item_Id : Entity_Id; begin -- Traverse the entity chain of the package and inspect all visible -- items. Item_Id := First_Entity (Pack_Id); while Present (Item_Id) and then not In_Private_Part (Item_Id) loop -- Do not consider internally generated items as those cannot be -- named and participate in refinement. if not Comes_From_Source (Item_Id) then null; elsif Ekind (Item_Id) = E_Abstract_State then Append_New_Elmt (Item_Id, States); elsif Ekind_In (Item_Id, E_Constant, E_Variable) and then Is_Visible_Object (Item_Id) then Append_New_Elmt (Item_Id, States); -- Recursively gather the visible states of a nested package elsif Ekind (Item_Id) = E_Package then Collect_Visible_States (Item_Id, States); end if; Next_Entity (Item_Id); end loop; end Collect_Visible_States; ----------------------- -- Is_Visible_Object -- ----------------------- function Is_Visible_Object (Obj_Id : Entity_Id) return Boolean is begin -- Objects that map generic formals to their actuals are not visible -- from outside the generic instantiation. if Present (Corresponding_Generic_Association (Declaration_Node (Obj_Id))) then return False; -- Constituents of a single protected/task type act as components of -- the type and are not visible from outside the type. elsif Ekind (Obj_Id) = E_Variable and then Present (Encapsulating_State (Obj_Id)) and then Is_Single_Concurrent_Object (Encapsulating_State (Obj_Id)) then return False; else return True; end if; end Is_Visible_Object; -- Local variables Body_Decl : constant Node_Id := Unit_Declaration_Node (Body_Id); Decl : Node_Id; Item_Id : Entity_Id; States : Elist_Id := No_Elist; -- Start of processing for Collect_Body_States begin -- Inspect the declarations of the body looking for source objects, -- packages and package instantiations. Note that even though this -- processing is very similar to Collect_Visible_States, a package -- body does not have a First/Next_Entity list. Decl := First (Declarations (Body_Decl)); while Present (Decl) loop -- Capture source objects as internally generated temporaries cannot -- be named and participate in refinement. if Nkind (Decl) = N_Object_Declaration then Item_Id := Defining_Entity (Decl); if Comes_From_Source (Item_Id) and then Is_Visible_Object (Item_Id) then Append_New_Elmt (Item_Id, States); end if; -- Capture the visible abstract states and objects of a source -- package [instantiation]. elsif Nkind (Decl) = N_Package_Declaration then Item_Id := Defining_Entity (Decl); if Comes_From_Source (Item_Id) then Collect_Visible_States (Item_Id, States); end if; end if; Next (Decl); end loop; return States; end Collect_Body_States; ------------------------ -- Collect_Interfaces -- ------------------------ procedure Collect_Interfaces (T : Entity_Id; Ifaces_List : out Elist_Id; Exclude_Parents : Boolean := False; Use_Full_View : Boolean := True) is procedure Collect (Typ : Entity_Id); -- Subsidiary subprogram used to traverse the whole list -- of directly and indirectly implemented interfaces ------------- -- Collect -- ------------- procedure Collect (Typ : Entity_Id) is Ancestor : Entity_Id; Full_T : Entity_Id; Id : Node_Id; Iface : Entity_Id; begin Full_T := Typ; -- Handle private types and subtypes if Use_Full_View and then Is_Private_Type (Typ) and then Present (Full_View (Typ)) then Full_T := Full_View (Typ); if Ekind (Full_T) = E_Record_Subtype then Full_T := Etype (Typ); if Present (Full_View (Full_T)) then Full_T := Full_View (Full_T); end if; end if; end if; -- Include the ancestor if we are generating the whole list of -- abstract interfaces. if Etype (Full_T) /= Typ -- Protect the frontend against wrong sources. For example: -- package P is -- type A is tagged null record; -- type B is new A with private; -- type C is new A with private; -- private -- type B is new C with null record; -- type C is new B with null record; -- end P; and then Etype (Full_T) /= T then Ancestor := Etype (Full_T); Collect (Ancestor); if Is_Interface (Ancestor) and then not Exclude_Parents then Append_Unique_Elmt (Ancestor, Ifaces_List); end if; end if; -- Traverse the graph of ancestor interfaces if Is_Non_Empty_List (Abstract_Interface_List (Full_T)) then Id := First (Abstract_Interface_List (Full_T)); while Present (Id) loop Iface := Etype (Id); -- Protect against wrong uses. For example: -- type I is interface; -- type O is tagged null record; -- type Wrong is new I and O with null record; -- ERROR if Is_Interface (Iface) then if Exclude_Parents and then Etype (T) /= T and then Interface_Present_In_Ancestor (Etype (T), Iface) then null; else Collect (Iface); Append_Unique_Elmt (Iface, Ifaces_List); end if; end if; Next (Id); end loop; end if; end Collect; -- Start of processing for Collect_Interfaces begin pragma Assert (Is_Tagged_Type (T) or else Is_Concurrent_Type (T)); Ifaces_List := New_Elmt_List; Collect (T); end Collect_Interfaces; ---------------------------------- -- Collect_Interface_Components -- ---------------------------------- procedure Collect_Interface_Components (Tagged_Type : Entity_Id; Components_List : out Elist_Id) is procedure Collect (Typ : Entity_Id); -- Subsidiary subprogram used to climb to the parents ------------- -- Collect -- ------------- procedure Collect (Typ : Entity_Id) is Tag_Comp : Entity_Id; Parent_Typ : Entity_Id; begin -- Handle private types if Present (Full_View (Etype (Typ))) then Parent_Typ := Full_View (Etype (Typ)); else Parent_Typ := Etype (Typ); end if; if Parent_Typ /= Typ -- Protect the frontend against wrong sources. For example: -- package P is -- type A is tagged null record; -- type B is new A with private; -- type C is new A with private; -- private -- type B is new C with null record; -- type C is new B with null record; -- end P; and then Parent_Typ /= Tagged_Type then Collect (Parent_Typ); end if; -- Collect the components containing tags of secondary dispatch -- tables. Tag_Comp := Next_Tag_Component (First_Tag_Component (Typ)); while Present (Tag_Comp) loop pragma Assert (Present (Related_Type (Tag_Comp))); Append_Elmt (Tag_Comp, Components_List); Tag_Comp := Next_Tag_Component (Tag_Comp); end loop; end Collect; -- Start of processing for Collect_Interface_Components begin pragma Assert (Ekind (Tagged_Type) = E_Record_Type and then Is_Tagged_Type (Tagged_Type)); Components_List := New_Elmt_List; Collect (Tagged_Type); end Collect_Interface_Components; ----------------------------- -- Collect_Interfaces_Info -- ----------------------------- procedure Collect_Interfaces_Info (T : Entity_Id; Ifaces_List : out Elist_Id; Components_List : out Elist_Id; Tags_List : out Elist_Id) is Comps_List : Elist_Id; Comp_Elmt : Elmt_Id; Comp_Iface : Entity_Id; Iface_Elmt : Elmt_Id; Iface : Entity_Id; function Search_Tag (Iface : Entity_Id) return Entity_Id; -- Search for the secondary tag associated with the interface type -- Iface that is implemented by T. ---------------- -- Search_Tag -- ---------------- function Search_Tag (Iface : Entity_Id) return Entity_Id is ADT : Elmt_Id; begin if not Is_CPP_Class (T) then ADT := Next_Elmt (Next_Elmt (First_Elmt (Access_Disp_Table (T)))); else ADT := Next_Elmt (First_Elmt (Access_Disp_Table (T))); end if; while Present (ADT) and then Is_Tag (Node (ADT)) and then Related_Type (Node (ADT)) /= Iface loop -- Skip secondary dispatch table referencing thunks to user -- defined primitives covered by this interface. pragma Assert (Has_Suffix (Node (ADT), 'P')); Next_Elmt (ADT); -- Skip secondary dispatch tables of Ada types if not Is_CPP_Class (T) then -- Skip secondary dispatch table referencing thunks to -- predefined primitives. pragma Assert (Has_Suffix (Node (ADT), 'Y')); Next_Elmt (ADT); -- Skip secondary dispatch table referencing user-defined -- primitives covered by this interface. pragma Assert (Has_Suffix (Node (ADT), 'D')); Next_Elmt (ADT); -- Skip secondary dispatch table referencing predefined -- primitives. pragma Assert (Has_Suffix (Node (ADT), 'Z')); Next_Elmt (ADT); end if; end loop; pragma Assert (Is_Tag (Node (ADT))); return Node (ADT); end Search_Tag; -- Start of processing for Collect_Interfaces_Info begin Collect_Interfaces (T, Ifaces_List); Collect_Interface_Components (T, Comps_List); -- Search for the record component and tag associated with each -- interface type of T. Components_List := New_Elmt_List; Tags_List := New_Elmt_List; Iface_Elmt := First_Elmt (Ifaces_List); while Present (Iface_Elmt) loop Iface := Node (Iface_Elmt); -- Associate the primary tag component and the primary dispatch table -- with all the interfaces that are parents of T if Is_Ancestor (Iface, T, Use_Full_View => True) then Append_Elmt (First_Tag_Component (T), Components_List); Append_Elmt (Node (First_Elmt (Access_Disp_Table (T))), Tags_List); -- Otherwise search for the tag component and secondary dispatch -- table of Iface else Comp_Elmt := First_Elmt (Comps_List); while Present (Comp_Elmt) loop Comp_Iface := Related_Type (Node (Comp_Elmt)); if Comp_Iface = Iface or else Is_Ancestor (Iface, Comp_Iface, Use_Full_View => True) then Append_Elmt (Node (Comp_Elmt), Components_List); Append_Elmt (Search_Tag (Comp_Iface), Tags_List); exit; end if; Next_Elmt (Comp_Elmt); end loop; pragma Assert (Present (Comp_Elmt)); end if; Next_Elmt (Iface_Elmt); end loop; end Collect_Interfaces_Info; --------------------- -- Collect_Parents -- --------------------- procedure Collect_Parents (T : Entity_Id; List : out Elist_Id; Use_Full_View : Boolean := True) is Current_Typ : Entity_Id := T; Parent_Typ : Entity_Id; begin List := New_Elmt_List; -- No action if the if the type has no parents if T = Etype (T) then return; end if; loop Parent_Typ := Etype (Current_Typ); if Is_Private_Type (Parent_Typ) and then Present (Full_View (Parent_Typ)) and then Use_Full_View then Parent_Typ := Full_View (Base_Type (Parent_Typ)); end if; Append_Elmt (Parent_Typ, List); exit when Parent_Typ = Current_Typ; Current_Typ := Parent_Typ; end loop; end Collect_Parents; ---------------------------------- -- Collect_Primitive_Operations -- ---------------------------------- function Collect_Primitive_Operations (T : Entity_Id) return Elist_Id is B_Type : constant Entity_Id := Base_Type (T); B_Decl : constant Node_Id := Original_Node (Parent (B_Type)); B_Scope : Entity_Id := Scope (B_Type); Op_List : Elist_Id; Formal : Entity_Id; Is_Prim : Boolean; Is_Type_In_Pkg : Boolean; Formal_Derived : Boolean := False; Id : Entity_Id; function Match (E : Entity_Id) return Boolean; -- True if E's base type is B_Type, or E is of an anonymous access type -- and the base type of its designated type is B_Type. ----------- -- Match -- ----------- function Match (E : Entity_Id) return Boolean is Etyp : Entity_Id := Etype (E); begin if Ekind (Etyp) = E_Anonymous_Access_Type then Etyp := Designated_Type (Etyp); end if; -- In Ada 2012 a primitive operation may have a formal of an -- incomplete view of the parent type. return Base_Type (Etyp) = B_Type or else (Ada_Version >= Ada_2012 and then Ekind (Etyp) = E_Incomplete_Type and then Full_View (Etyp) = B_Type); end Match; -- Start of processing for Collect_Primitive_Operations begin -- For tagged types, the primitive operations are collected as they -- are declared, and held in an explicit list which is simply returned. if Is_Tagged_Type (B_Type) then return Primitive_Operations (B_Type); -- An untagged generic type that is a derived type inherits the -- primitive operations of its parent type. Other formal types only -- have predefined operators, which are not explicitly represented. elsif Is_Generic_Type (B_Type) then if Nkind (B_Decl) = N_Formal_Type_Declaration and then Nkind (Formal_Type_Definition (B_Decl)) = N_Formal_Derived_Type_Definition then Formal_Derived := True; else return New_Elmt_List; end if; end if; Op_List := New_Elmt_List; if B_Scope = Standard_Standard then if B_Type = Standard_String then Append_Elmt (Standard_Op_Concat, Op_List); elsif B_Type = Standard_Wide_String then Append_Elmt (Standard_Op_Concatw, Op_List); else null; end if; -- Locate the primitive subprograms of the type else -- The primitive operations appear after the base type, except -- if the derivation happens within the private part of B_Scope -- and the type is a private type, in which case both the type -- and some primitive operations may appear before the base -- type, and the list of candidates starts after the type. if In_Open_Scopes (B_Scope) and then Scope (T) = B_Scope and then In_Private_Part (B_Scope) then Id := Next_Entity (T); -- In Ada 2012, If the type has an incomplete partial view, there -- may be primitive operations declared before the full view, so -- we need to start scanning from the incomplete view, which is -- earlier on the entity chain. elsif Nkind (Parent (B_Type)) = N_Full_Type_Declaration and then Present (Incomplete_View (Parent (B_Type))) then Id := Defining_Entity (Incomplete_View (Parent (B_Type))); -- If T is a derived from a type with an incomplete view declared -- elsewhere, that incomplete view is irrelevant, we want the -- operations in the scope of T. if Scope (Id) /= Scope (B_Type) then Id := Next_Entity (B_Type); end if; else Id := Next_Entity (B_Type); end if; -- Set flag if this is a type in a package spec Is_Type_In_Pkg := Is_Package_Or_Generic_Package (B_Scope) and then Nkind (Parent (Declaration_Node (First_Subtype (T)))) /= N_Package_Body; while Present (Id) loop -- Test whether the result type or any of the parameter types of -- each subprogram following the type match that type when the -- type is declared in a package spec, is a derived type, or the -- subprogram is marked as primitive. (The Is_Primitive test is -- needed to find primitives of nonderived types in declarative -- parts that happen to override the predefined "=" operator.) -- Note that generic formal subprograms are not considered to be -- primitive operations and thus are never inherited. if Is_Overloadable (Id) and then (Is_Type_In_Pkg or else Is_Derived_Type (B_Type) or else Is_Primitive (Id)) and then Nkind (Parent (Parent (Id))) not in N_Formal_Subprogram_Declaration then Is_Prim := False; if Match (Id) then Is_Prim := True; else Formal := First_Formal (Id); while Present (Formal) loop if Match (Formal) then Is_Prim := True; exit; end if; Next_Formal (Formal); end loop; end if; -- For a formal derived type, the only primitives are the ones -- inherited from the parent type. Operations appearing in the -- package declaration are not primitive for it. if Is_Prim and then (not Formal_Derived or else Present (Alias (Id))) then -- In the special case of an equality operator aliased to -- an overriding dispatching equality belonging to the same -- type, we don't include it in the list of primitives. -- This avoids inheriting multiple equality operators when -- deriving from untagged private types whose full type is -- tagged, which can otherwise cause ambiguities. Note that -- this should only happen for this kind of untagged parent -- type, since normally dispatching operations are inherited -- using the type's Primitive_Operations list. if Chars (Id) = Name_Op_Eq and then Is_Dispatching_Operation (Id) and then Present (Alias (Id)) and then Present (Overridden_Operation (Alias (Id))) and then Base_Type (Etype (First_Entity (Id))) = Base_Type (Etype (First_Entity (Alias (Id)))) then null; -- Include the subprogram in the list of primitives else Append_Elmt (Id, Op_List); end if; end if; end if; Next_Entity (Id); -- For a type declared in System, some of its operations may -- appear in the target-specific extension to System. if No (Id) and then B_Scope = RTU_Entity (System) and then Present_System_Aux then B_Scope := System_Aux_Id; Id := First_Entity (System_Aux_Id); end if; end loop; end if; return Op_List; end Collect_Primitive_Operations; ----------------------------------- -- Compile_Time_Constraint_Error -- ----------------------------------- function Compile_Time_Constraint_Error (N : Node_Id; Msg : String; Ent : Entity_Id := Empty; Loc : Source_Ptr := No_Location; Warn : Boolean := False) return Node_Id is Msgc : String (1 .. Msg'Length + 3); -- Copy of message, with room for possible ?? or << and ! at end Msgl : Natural; Wmsg : Boolean; Eloc : Source_Ptr; -- Start of processing for Compile_Time_Constraint_Error begin -- If this is a warning, convert it into an error if we are in code -- subject to SPARK_Mode being set On, unless Warn is True to force a -- warning. The rationale is that a compile-time constraint error should -- lead to an error instead of a warning when SPARK_Mode is On, but in -- a few cases we prefer to issue a warning and generate both a suitable -- run-time error in GNAT and a suitable check message in GNATprove. -- Those cases are those that likely correspond to deactivated SPARK -- code, so that this kind of code can be compiled and analyzed instead -- of being rejected. Error_Msg_Warn := Warn or SPARK_Mode /= On; -- A static constraint error in an instance body is not a fatal error. -- we choose to inhibit the message altogether, because there is no -- obvious node (for now) on which to post it. On the other hand the -- offending node must be replaced with a constraint_error in any case. -- No messages are generated if we already posted an error on this node if not Error_Posted (N) then if Loc /= No_Location then Eloc := Loc; else Eloc := Sloc (N); end if; -- Copy message to Msgc, converting any ? in the message into -- < instead, so that we have an error in GNATprove mode. Msgl := Msg'Length; for J in 1 .. Msgl loop if Msg (J) = '?' and then (J = 1 or else Msg (J - 1) /= ''') then Msgc (J) := '<'; else Msgc (J) := Msg (J); end if; end loop; -- Message is a warning, even in Ada 95 case if Msg (Msg'Last) = '?' or else Msg (Msg'Last) = '<' then Wmsg := True; -- In Ada 83, all messages are warnings. In the private part and -- the body of an instance, constraint_checks are only warnings. -- We also make this a warning if the Warn parameter is set. elsif Warn or else (Ada_Version = Ada_83 and then Comes_From_Source (N)) then Msgl := Msgl + 1; Msgc (Msgl) := '<'; Msgl := Msgl + 1; Msgc (Msgl) := '<'; Wmsg := True; elsif In_Instance_Not_Visible then Msgl := Msgl + 1; Msgc (Msgl) := '<'; Msgl := Msgl + 1; Msgc (Msgl) := '<'; Wmsg := True; -- Otherwise we have a real error message (Ada 95 static case) -- and we make this an unconditional message. Note that in the -- warning case we do not make the message unconditional, it seems -- quite reasonable to delete messages like this (about exceptions -- that will be raised) in dead code. else Wmsg := False; Msgl := Msgl + 1; Msgc (Msgl) := '!'; end if; -- One more test, skip the warning if the related expression is -- statically unevaluated, since we don't want to warn about what -- will happen when something is evaluated if it never will be -- evaluated. if not Is_Statically_Unevaluated (N) then if Present (Ent) then Error_Msg_NEL (Msgc (1 .. Msgl), N, Ent, Eloc); else Error_Msg_NEL (Msgc (1 .. Msgl), N, Etype (N), Eloc); end if; if Wmsg then -- Check whether the context is an Init_Proc if Inside_Init_Proc then declare Conc_Typ : constant Entity_Id := Corresponding_Concurrent_Type (Entity (Parameter_Type (First (Parameter_Specifications (Parent (Current_Scope)))))); begin -- Don't complain if the corresponding concurrent type -- doesn't come from source (i.e. a single task/protected -- object). if Present (Conc_Typ) and then not Comes_From_Source (Conc_Typ) then Error_Msg_NEL ("\& [<<", N, Standard_Constraint_Error, Eloc); else if GNATprove_Mode then Error_Msg_NEL ("\& would have been raised for objects of this " & "type", N, Standard_Constraint_Error, Eloc); else Error_Msg_NEL ("\& will be raised for objects of this type??", N, Standard_Constraint_Error, Eloc); end if; end if; end; else Error_Msg_NEL ("\& [<<", N, Standard_Constraint_Error, Eloc); end if; else Error_Msg ("\static expression fails Constraint_Check", Eloc); Set_Error_Posted (N); end if; end if; end if; return N; end Compile_Time_Constraint_Error; ----------------------- -- Conditional_Delay -- ----------------------- procedure Conditional_Delay (New_Ent, Old_Ent : Entity_Id) is begin if Has_Delayed_Freeze (Old_Ent) and then not Is_Frozen (Old_Ent) then Set_Has_Delayed_Freeze (New_Ent); end if; end Conditional_Delay; ---------------------------- -- Contains_Refined_State -- ---------------------------- function Contains_Refined_State (Prag : Node_Id) return Boolean is function Has_State_In_Dependency (List : Node_Id) return Boolean; -- Determine whether a dependency list mentions a state with a visible -- refinement. function Has_State_In_Global (List : Node_Id) return Boolean; -- Determine whether a global list mentions a state with a visible -- refinement. function Is_Refined_State (Item : Node_Id) return Boolean; -- Determine whether Item is a reference to an abstract state with a -- visible refinement. ----------------------------- -- Has_State_In_Dependency -- ----------------------------- function Has_State_In_Dependency (List : Node_Id) return Boolean is Clause : Node_Id; Output : Node_Id; begin -- A null dependency list does not mention any states if Nkind (List) = N_Null then return False; -- Dependency clauses appear as component associations of an -- aggregate. elsif Nkind (List) = N_Aggregate and then Present (Component_Associations (List)) then Clause := First (Component_Associations (List)); while Present (Clause) loop -- Inspect the outputs of a dependency clause Output := First (Choices (Clause)); while Present (Output) loop if Is_Refined_State (Output) then return True; end if; Next (Output); end loop; -- Inspect the outputs of a dependency clause if Is_Refined_State (Expression (Clause)) then return True; end if; Next (Clause); end loop; -- If we get here, then none of the dependency clauses mention a -- state with visible refinement. return False; -- An illegal pragma managed to sneak in else raise Program_Error; end if; end Has_State_In_Dependency; ------------------------- -- Has_State_In_Global -- ------------------------- function Has_State_In_Global (List : Node_Id) return Boolean is Item : Node_Id; begin -- A null global list does not mention any states if Nkind (List) = N_Null then return False; -- Simple global list or moded global list declaration elsif Nkind (List) = N_Aggregate then -- The declaration of a simple global list appear as a collection -- of expressions. if Present (Expressions (List)) then Item := First (Expressions (List)); while Present (Item) loop if Is_Refined_State (Item) then return True; end if; Next (Item); end loop; -- The declaration of a moded global list appears as a collection -- of component associations where individual choices denote -- modes. else Item := First (Component_Associations (List)); while Present (Item) loop if Has_State_In_Global (Expression (Item)) then return True; end if; Next (Item); end loop; end if; -- If we get here, then the simple/moded global list did not -- mention any states with a visible refinement. return False; -- Single global item declaration elsif Is_Entity_Name (List) then return Is_Refined_State (List); -- An illegal pragma managed to sneak in else raise Program_Error; end if; end Has_State_In_Global; ---------------------- -- Is_Refined_State -- ---------------------- function Is_Refined_State (Item : Node_Id) return Boolean is Elmt : Node_Id; Item_Id : Entity_Id; begin if Nkind (Item) = N_Null then return False; -- States cannot be subject to attribute 'Result. This case arises -- in dependency relations. elsif Nkind (Item) = N_Attribute_Reference and then Attribute_Name (Item) = Name_Result then return False; -- Multiple items appear as an aggregate. This case arises in -- dependency relations. elsif Nkind (Item) = N_Aggregate and then Present (Expressions (Item)) then Elmt := First (Expressions (Item)); while Present (Elmt) loop if Is_Refined_State (Elmt) then return True; end if; Next (Elmt); end loop; -- If we get here, then none of the inputs or outputs reference a -- state with visible refinement. return False; -- Single item else Item_Id := Entity_Of (Item); return Present (Item_Id) and then Ekind (Item_Id) = E_Abstract_State and then Has_Visible_Refinement (Item_Id); end if; end Is_Refined_State; -- Local variables Arg : constant Node_Id := Get_Pragma_Arg (First (Pragma_Argument_Associations (Prag))); Nam : constant Name_Id := Pragma_Name (Prag); -- Start of processing for Contains_Refined_State begin if Nam = Name_Depends then return Has_State_In_Dependency (Arg); else pragma Assert (Nam = Name_Global); return Has_State_In_Global (Arg); end if; end Contains_Refined_State; ------------------------- -- Copy_Component_List -- ------------------------- function Copy_Component_List (R_Typ : Entity_Id; Loc : Source_Ptr) return List_Id is Comp : Node_Id; Comps : constant List_Id := New_List; begin Comp := First_Component (Underlying_Type (R_Typ)); while Present (Comp) loop if Comes_From_Source (Comp) then declare Comp_Decl : constant Node_Id := Declaration_Node (Comp); begin Append_To (Comps, Make_Component_Declaration (Loc, Defining_Identifier => Make_Defining_Identifier (Loc, Chars (Comp)), Component_Definition => New_Copy_Tree (Component_Definition (Comp_Decl), New_Sloc => Loc))); end; end if; Next_Component (Comp); end loop; return Comps; end Copy_Component_List; ------------------------- -- Copy_Parameter_List -- ------------------------- function Copy_Parameter_List (Subp_Id : Entity_Id) return List_Id is Loc : constant Source_Ptr := Sloc (Subp_Id); Plist : List_Id; Formal : Entity_Id; begin if No (First_Formal (Subp_Id)) then return No_List; else Plist := New_List; Formal := First_Formal (Subp_Id); while Present (Formal) loop Append_To (Plist, Make_Parameter_Specification (Loc, Defining_Identifier => Make_Defining_Identifier (Sloc (Formal), Chars (Formal)), In_Present => In_Present (Parent (Formal)), Out_Present => Out_Present (Parent (Formal)), Parameter_Type => New_Occurrence_Of (Etype (Formal), Loc), Expression => New_Copy_Tree (Expression (Parent (Formal))))); Next_Formal (Formal); end loop; end if; return Plist; end Copy_Parameter_List; ---------------------------- -- Copy_SPARK_Mode_Aspect -- ---------------------------- procedure Copy_SPARK_Mode_Aspect (From : Node_Id; To : Node_Id) is pragma Assert (not Has_Aspects (To)); Asp : Node_Id; begin if Has_Aspects (From) then Asp := Find_Aspect (Defining_Entity (From), Aspect_SPARK_Mode); if Present (Asp) then Set_Aspect_Specifications (To, New_List (New_Copy_Tree (Asp))); Set_Has_Aspects (To, True); end if; end if; end Copy_SPARK_Mode_Aspect; -------------------------- -- Copy_Subprogram_Spec -- -------------------------- function Copy_Subprogram_Spec (Spec : Node_Id) return Node_Id is Def_Id : Node_Id; Formal_Spec : Node_Id; Result : Node_Id; begin -- The structure of the original tree must be replicated without any -- alterations. Use New_Copy_Tree for this purpose. Result := New_Copy_Tree (Spec); -- Create a new entity for the defining unit name Def_Id := Defining_Unit_Name (Result); Set_Defining_Unit_Name (Result, Make_Defining_Identifier (Sloc (Def_Id), Chars (Def_Id))); -- Create new entities for the formal parameters if Present (Parameter_Specifications (Result)) then Formal_Spec := First (Parameter_Specifications (Result)); while Present (Formal_Spec) loop Def_Id := Defining_Identifier (Formal_Spec); Set_Defining_Identifier (Formal_Spec, Make_Defining_Identifier (Sloc (Def_Id), Chars (Def_Id))); Next (Formal_Spec); end loop; end if; return Result; end Copy_Subprogram_Spec; -------------------------------- -- Corresponding_Generic_Type -- -------------------------------- function Corresponding_Generic_Type (T : Entity_Id) return Entity_Id is Inst : Entity_Id; Gen : Entity_Id; Typ : Entity_Id; begin if not Is_Generic_Actual_Type (T) then return Any_Type; -- If the actual is the actual of an enclosing instance, resolution -- was correct in the generic. elsif Nkind (Parent (T)) = N_Subtype_Declaration and then Is_Entity_Name (Subtype_Indication (Parent (T))) and then Is_Generic_Actual_Type (Entity (Subtype_Indication (Parent (T)))) then return Any_Type; else Inst := Scope (T); if Is_Wrapper_Package (Inst) then Inst := Related_Instance (Inst); end if; Gen := Generic_Parent (Specification (Unit_Declaration_Node (Inst))); -- Generic actual has the same name as the corresponding formal Typ := First_Entity (Gen); while Present (Typ) loop if Chars (Typ) = Chars (T) then return Typ; end if; Next_Entity (Typ); end loop; return Any_Type; end if; end Corresponding_Generic_Type; -------------------- -- Current_Entity -- -------------------- -- The currently visible definition for a given identifier is the -- one most chained at the start of the visibility chain, i.e. the -- one that is referenced by the Node_Id value of the name of the -- given identifier. function Current_Entity (N : Node_Id) return Entity_Id is begin return Get_Name_Entity_Id (Chars (N)); end Current_Entity; ----------------------------- -- Current_Entity_In_Scope -- ----------------------------- function Current_Entity_In_Scope (N : Node_Id) return Entity_Id is E : Entity_Id; CS : constant Entity_Id := Current_Scope; Transient_Case : constant Boolean := Scope_Is_Transient; begin E := Get_Name_Entity_Id (Chars (N)); while Present (E) and then Scope (E) /= CS and then (not Transient_Case or else Scope (E) /= Scope (CS)) loop E := Homonym (E); end loop; return E; end Current_Entity_In_Scope; ------------------- -- Current_Scope -- ------------------- function Current_Scope return Entity_Id is begin if Scope_Stack.Last = -1 then return Standard_Standard; else declare C : constant Entity_Id := Scope_Stack.Table (Scope_Stack.Last).Entity; begin if Present (C) then return C; else return Standard_Standard; end if; end; end if; end Current_Scope; ---------------------------- -- Current_Scope_No_Loops -- ---------------------------- function Current_Scope_No_Loops return Entity_Id is S : Entity_Id; begin -- Examine the scope stack starting from the current scope and skip any -- internally generated loops. S := Current_Scope; while Present (S) and then S /= Standard_Standard loop if Ekind (S) = E_Loop and then not Comes_From_Source (S) then S := Scope (S); else exit; end if; end loop; return S; end Current_Scope_No_Loops; ------------------------ -- Current_Subprogram -- ------------------------ function Current_Subprogram return Entity_Id is Scop : constant Entity_Id := Current_Scope; begin if Is_Subprogram_Or_Generic_Subprogram (Scop) then return Scop; else return Enclosing_Subprogram (Scop); end if; end Current_Subprogram; ---------------------------------- -- Deepest_Type_Access_Level -- ---------------------------------- function Deepest_Type_Access_Level (Typ : Entity_Id) return Uint is begin if Ekind (Typ) = E_Anonymous_Access_Type and then not Is_Local_Anonymous_Access (Typ) and then Nkind (Associated_Node_For_Itype (Typ)) = N_Object_Declaration then -- Typ is the type of an Ada 2012 stand-alone object of an anonymous -- access type. return Scope_Depth (Enclosing_Dynamic_Scope (Defining_Identifier (Associated_Node_For_Itype (Typ)))); -- For generic formal type, return Int'Last (infinite). -- See comment preceding Is_Generic_Type call in Type_Access_Level. elsif Is_Generic_Type (Root_Type (Typ)) then return UI_From_Int (Int'Last); else return Type_Access_Level (Typ); end if; end Deepest_Type_Access_Level; --------------------- -- Defining_Entity -- --------------------- function Defining_Entity (N : Node_Id; Empty_On_Errors : Boolean := False) return Entity_Id is Err : Entity_Id := Empty; begin case Nkind (N) is when N_Abstract_Subprogram_Declaration | N_Expression_Function | N_Formal_Subprogram_Declaration | N_Generic_Package_Declaration | N_Generic_Subprogram_Declaration | N_Package_Declaration | N_Subprogram_Body | N_Subprogram_Body_Stub | N_Subprogram_Declaration | N_Subprogram_Renaming_Declaration => return Defining_Entity (Specification (N)); when N_Component_Declaration | N_Defining_Program_Unit_Name | N_Discriminant_Specification | N_Entry_Body | N_Entry_Declaration | N_Entry_Index_Specification | N_Exception_Declaration | N_Exception_Renaming_Declaration | N_Formal_Object_Declaration | N_Formal_Package_Declaration | N_Formal_Type_Declaration | N_Full_Type_Declaration | N_Implicit_Label_Declaration | N_Incomplete_Type_Declaration | N_Iterator_Specification | N_Loop_Parameter_Specification | N_Number_Declaration | N_Object_Declaration | N_Object_Renaming_Declaration | N_Package_Body_Stub | N_Parameter_Specification | N_Private_Extension_Declaration | N_Private_Type_Declaration | N_Protected_Body | N_Protected_Body_Stub | N_Protected_Type_Declaration | N_Single_Protected_Declaration | N_Single_Task_Declaration | N_Subtype_Declaration | N_Task_Body | N_Task_Body_Stub | N_Task_Type_Declaration => return Defining_Identifier (N); when N_Subunit => return Defining_Entity (Proper_Body (N)); when N_Function_Instantiation | N_Function_Specification | N_Generic_Function_Renaming_Declaration | N_Generic_Package_Renaming_Declaration | N_Generic_Procedure_Renaming_Declaration | N_Package_Body | N_Package_Instantiation | N_Package_Renaming_Declaration | N_Package_Specification | N_Procedure_Instantiation | N_Procedure_Specification => declare Nam : constant Node_Id := Defining_Unit_Name (N); begin if Nkind (Nam) in N_Entity then return Nam; -- For Error, make up a name and attach to declaration so we -- can continue semantic analysis. elsif Nam = Error then if Empty_On_Errors then return Empty; else Err := Make_Temporary (Sloc (N), 'T'); Set_Defining_Unit_Name (N, Err); return Err; end if; -- If not an entity, get defining identifier else return Defining_Identifier (Nam); end if; end; when N_Block_Statement | N_Loop_Statement => return Entity (Identifier (N)); when others => if Empty_On_Errors then return Empty; else raise Program_Error; end if; end case; end Defining_Entity; -------------------------- -- Denotes_Discriminant -- -------------------------- function Denotes_Discriminant (N : Node_Id; Check_Concurrent : Boolean := False) return Boolean is E : Entity_Id; begin if not Is_Entity_Name (N) or else No (Entity (N)) then return False; else E := Entity (N); end if; -- If we are checking for a protected type, the discriminant may have -- been rewritten as the corresponding discriminal of the original type -- or of the corresponding concurrent record, depending on whether we -- are in the spec or body of the protected type. return Ekind (E) = E_Discriminant or else (Check_Concurrent and then Ekind (E) = E_In_Parameter and then Present (Discriminal_Link (E)) and then (Is_Concurrent_Type (Scope (Discriminal_Link (E))) or else Is_Concurrent_Record_Type (Scope (Discriminal_Link (E))))); end Denotes_Discriminant; ------------------------- -- Denotes_Same_Object -- ------------------------- function Denotes_Same_Object (A1, A2 : Node_Id) return Boolean is Obj1 : Node_Id := A1; Obj2 : Node_Id := A2; function Has_Prefix (N : Node_Id) return Boolean; -- Return True if N has attribute Prefix function Is_Renaming (N : Node_Id) return Boolean; -- Return true if N names a renaming entity function Is_Valid_Renaming (N : Node_Id) return Boolean; -- For renamings, return False if the prefix of any dereference within -- the renamed object_name is a variable, or any expression within the -- renamed object_name contains references to variables or calls on -- nonstatic functions; otherwise return True (RM 6.4.1(6.10/3)) ---------------- -- Has_Prefix -- ---------------- function Has_Prefix (N : Node_Id) return Boolean is begin return Nkind_In (N, N_Attribute_Reference, N_Expanded_Name, N_Explicit_Dereference, N_Indexed_Component, N_Reference, N_Selected_Component, N_Slice); end Has_Prefix; ----------------- -- Is_Renaming -- ----------------- function Is_Renaming (N : Node_Id) return Boolean is begin return Is_Entity_Name (N) and then Present (Renamed_Entity (Entity (N))); end Is_Renaming; ----------------------- -- Is_Valid_Renaming -- ----------------------- function Is_Valid_Renaming (N : Node_Id) return Boolean is function Check_Renaming (N : Node_Id) return Boolean; -- Recursive function used to traverse all the prefixes of N function Check_Renaming (N : Node_Id) return Boolean is begin if Is_Renaming (N) and then not Check_Renaming (Renamed_Entity (Entity (N))) then return False; end if; if Nkind (N) = N_Indexed_Component then declare Indx : Node_Id; begin Indx := First (Expressions (N)); while Present (Indx) loop if not Is_OK_Static_Expression (Indx) then return False; end if; Next_Index (Indx); end loop; end; end if; if Has_Prefix (N) then declare P : constant Node_Id := Prefix (N); begin if Nkind (N) = N_Explicit_Dereference and then Is_Variable (P) then return False; elsif Is_Entity_Name (P) and then Ekind (Entity (P)) = E_Function then return False; elsif Nkind (P) = N_Function_Call then return False; end if; -- Recursion to continue traversing the prefix of the -- renaming expression return Check_Renaming (P); end; end if; return True; end Check_Renaming; -- Start of processing for Is_Valid_Renaming begin return Check_Renaming (N); end Is_Valid_Renaming; -- Start of processing for Denotes_Same_Object begin -- Both names statically denote the same stand-alone object or parameter -- (RM 6.4.1(6.5/3)) if Is_Entity_Name (Obj1) and then Is_Entity_Name (Obj2) and then Entity (Obj1) = Entity (Obj2) then return True; end if; -- For renamings, the prefix of any dereference within the renamed -- object_name is not a variable, and any expression within the -- renamed object_name contains no references to variables nor -- calls on nonstatic functions (RM 6.4.1(6.10/3)). if Is_Renaming (Obj1) then if Is_Valid_Renaming (Obj1) then Obj1 := Renamed_Entity (Entity (Obj1)); else return False; end if; end if; if Is_Renaming (Obj2) then if Is_Valid_Renaming (Obj2) then Obj2 := Renamed_Entity (Entity (Obj2)); else return False; end if; end if; -- No match if not same node kind (such cases are handled by -- Denotes_Same_Prefix) if Nkind (Obj1) /= Nkind (Obj2) then return False; -- After handling valid renamings, one of the two names statically -- denoted a renaming declaration whose renamed object_name is known -- to denote the same object as the other (RM 6.4.1(6.10/3)) elsif Is_Entity_Name (Obj1) then if Is_Entity_Name (Obj2) then return Entity (Obj1) = Entity (Obj2); else return False; end if; -- Both names are selected_components, their prefixes are known to -- denote the same object, and their selector_names denote the same -- component (RM 6.4.1(6.6/3)). elsif Nkind (Obj1) = N_Selected_Component then return Denotes_Same_Object (Prefix (Obj1), Prefix (Obj2)) and then Entity (Selector_Name (Obj1)) = Entity (Selector_Name (Obj2)); -- Both names are dereferences and the dereferenced names are known to -- denote the same object (RM 6.4.1(6.7/3)) elsif Nkind (Obj1) = N_Explicit_Dereference then return Denotes_Same_Object (Prefix (Obj1), Prefix (Obj2)); -- Both names are indexed_components, their prefixes are known to denote -- the same object, and each of the pairs of corresponding index values -- are either both static expressions with the same static value or both -- names that are known to denote the same object (RM 6.4.1(6.8/3)) elsif Nkind (Obj1) = N_Indexed_Component then if not Denotes_Same_Object (Prefix (Obj1), Prefix (Obj2)) then return False; else declare Indx1 : Node_Id; Indx2 : Node_Id; begin Indx1 := First (Expressions (Obj1)); Indx2 := First (Expressions (Obj2)); while Present (Indx1) loop -- Indexes must denote the same static value or same object if Is_OK_Static_Expression (Indx1) then if not Is_OK_Static_Expression (Indx2) then return False; elsif Expr_Value (Indx1) /= Expr_Value (Indx2) then return False; end if; elsif not Denotes_Same_Object (Indx1, Indx2) then return False; end if; Next (Indx1); Next (Indx2); end loop; return True; end; end if; -- Both names are slices, their prefixes are known to denote the same -- object, and the two slices have statically matching index constraints -- (RM 6.4.1(6.9/3)) elsif Nkind (Obj1) = N_Slice and then Denotes_Same_Object (Prefix (Obj1), Prefix (Obj2)) then declare Lo1, Lo2, Hi1, Hi2 : Node_Id; begin Get_Index_Bounds (Etype (Obj1), Lo1, Hi1); Get_Index_Bounds (Etype (Obj2), Lo2, Hi2); -- Check whether bounds are statically identical. There is no -- attempt to detect partial overlap of slices. return Denotes_Same_Object (Lo1, Lo2) and then Denotes_Same_Object (Hi1, Hi2); end; -- In the recursion, literals appear as indexes elsif Nkind (Obj1) = N_Integer_Literal and then Nkind (Obj2) = N_Integer_Literal then return Intval (Obj1) = Intval (Obj2); else return False; end if; end Denotes_Same_Object; ------------------------- -- Denotes_Same_Prefix -- ------------------------- function Denotes_Same_Prefix (A1, A2 : Node_Id) return Boolean is begin if Is_Entity_Name (A1) then if Nkind_In (A2, N_Selected_Component, N_Indexed_Component) and then not Is_Access_Type (Etype (A1)) then return Denotes_Same_Object (A1, Prefix (A2)) or else Denotes_Same_Prefix (A1, Prefix (A2)); else return False; end if; elsif Is_Entity_Name (A2) then return Denotes_Same_Prefix (A1 => A2, A2 => A1); elsif Nkind_In (A1, N_Selected_Component, N_Indexed_Component, N_Slice) and then Nkind_In (A2, N_Selected_Component, N_Indexed_Component, N_Slice) then declare Root1, Root2 : Node_Id; Depth1, Depth2 : Nat := 0; begin Root1 := Prefix (A1); while not Is_Entity_Name (Root1) loop if not Nkind_In (Root1, N_Selected_Component, N_Indexed_Component) then return False; else Root1 := Prefix (Root1); end if; Depth1 := Depth1 + 1; end loop; Root2 := Prefix (A2); while not Is_Entity_Name (Root2) loop if not Nkind_In (Root2, N_Selected_Component, N_Indexed_Component) then return False; else Root2 := Prefix (Root2); end if; Depth2 := Depth2 + 1; end loop; -- If both have the same depth and they do not denote the same -- object, they are disjoint and no warning is needed. if Depth1 = Depth2 then return False; elsif Depth1 > Depth2 then Root1 := Prefix (A1); for J in 1 .. Depth1 - Depth2 - 1 loop Root1 := Prefix (Root1); end loop; return Denotes_Same_Object (Root1, A2); else Root2 := Prefix (A2); for J in 1 .. Depth2 - Depth1 - 1 loop Root2 := Prefix (Root2); end loop; return Denotes_Same_Object (A1, Root2); end if; end; else return False; end if; end Denotes_Same_Prefix; ---------------------- -- Denotes_Variable -- ---------------------- function Denotes_Variable (N : Node_Id) return Boolean is begin return Is_Variable (N) and then Paren_Count (N) = 0; end Denotes_Variable; ----------------------------- -- Depends_On_Discriminant -- ----------------------------- function Depends_On_Discriminant (N : Node_Id) return Boolean is L : Node_Id; H : Node_Id; begin Get_Index_Bounds (N, L, H); return Denotes_Discriminant (L) or else Denotes_Discriminant (H); end Depends_On_Discriminant; ------------------------- -- Designate_Same_Unit -- ------------------------- function Designate_Same_Unit (Name1 : Node_Id; Name2 : Node_Id) return Boolean is K1 : constant Node_Kind := Nkind (Name1); K2 : constant Node_Kind := Nkind (Name2); function Prefix_Node (N : Node_Id) return Node_Id; -- Returns the parent unit name node of a defining program unit name -- or the prefix if N is a selected component or an expanded name. function Select_Node (N : Node_Id) return Node_Id; -- Returns the defining identifier node of a defining program unit -- name or the selector node if N is a selected component or an -- expanded name. ----------------- -- Prefix_Node -- ----------------- function Prefix_Node (N : Node_Id) return Node_Id is begin if Nkind (N) = N_Defining_Program_Unit_Name then return Name (N); else return Prefix (N); end if; end Prefix_Node; ----------------- -- Select_Node -- ----------------- function Select_Node (N : Node_Id) return Node_Id is begin if Nkind (N) = N_Defining_Program_Unit_Name then return Defining_Identifier (N); else return Selector_Name (N); end if; end Select_Node; -- Start of processing for Designate_Same_Unit begin if Nkind_In (K1, N_Identifier, N_Defining_Identifier) and then Nkind_In (K2, N_Identifier, N_Defining_Identifier) then return Chars (Name1) = Chars (Name2); elsif Nkind_In (K1, N_Expanded_Name, N_Selected_Component, N_Defining_Program_Unit_Name) and then Nkind_In (K2, N_Expanded_Name, N_Selected_Component, N_Defining_Program_Unit_Name) then return (Chars (Select_Node (Name1)) = Chars (Select_Node (Name2))) and then Designate_Same_Unit (Prefix_Node (Name1), Prefix_Node (Name2)); else return False; end if; end Designate_Same_Unit; ------------------------------------------ -- function Dynamic_Accessibility_Level -- ------------------------------------------ function Dynamic_Accessibility_Level (Expr : Node_Id) return Node_Id is E : Entity_Id; Loc : constant Source_Ptr := Sloc (Expr); function Make_Level_Literal (Level : Uint) return Node_Id; -- Construct an integer literal representing an accessibility level -- with its type set to Natural. ------------------------ -- Make_Level_Literal -- ------------------------ function Make_Level_Literal (Level : Uint) return Node_Id is Result : constant Node_Id := Make_Integer_Literal (Loc, Level); begin Set_Etype (Result, Standard_Natural); return Result; end Make_Level_Literal; -- Start of processing for Dynamic_Accessibility_Level begin if Is_Entity_Name (Expr) then E := Entity (Expr); if Present (Renamed_Object (E)) then return Dynamic_Accessibility_Level (Renamed_Object (E)); end if; if Is_Formal (E) or else Ekind_In (E, E_Variable, E_Constant) then if Present (Extra_Accessibility (E)) then return New_Occurrence_Of (Extra_Accessibility (E), Loc); end if; end if; end if; -- Unimplemented: Ptr.all'Access, where Ptr has Extra_Accessibility ??? case Nkind (Expr) is -- For access discriminant, the level of the enclosing object when N_Selected_Component => if Ekind (Entity (Selector_Name (Expr))) = E_Discriminant and then Ekind (Etype (Entity (Selector_Name (Expr)))) = E_Anonymous_Access_Type then return Make_Level_Literal (Object_Access_Level (Expr)); end if; when N_Attribute_Reference => case Get_Attribute_Id (Attribute_Name (Expr)) is -- For X'Access, the level of the prefix X when Attribute_Access => return Make_Level_Literal (Object_Access_Level (Prefix (Expr))); -- Treat the unchecked attributes as library-level when Attribute_Unchecked_Access | Attribute_Unrestricted_Access => return Make_Level_Literal (Scope_Depth (Standard_Standard)); -- No other access-valued attributes when others => raise Program_Error; end case; when N_Allocator => -- Unimplemented: depends on context. As an actual parameter where -- formal type is anonymous, use -- Scope_Depth (Current_Scope) + 1. -- For other cases, see 3.10.2(14/3) and following. ??? null; when N_Type_Conversion => if not Is_Local_Anonymous_Access (Etype (Expr)) then -- Handle type conversions introduced for a rename of an -- Ada 2012 stand-alone object of an anonymous access type. return Dynamic_Accessibility_Level (Expression (Expr)); end if; when others => null; end case; return Make_Level_Literal (Type_Access_Level (Etype (Expr))); end Dynamic_Accessibility_Level; ----------------------------------- -- Effective_Extra_Accessibility -- ----------------------------------- function Effective_Extra_Accessibility (Id : Entity_Id) return Entity_Id is begin if Present (Renamed_Object (Id)) and then Is_Entity_Name (Renamed_Object (Id)) then return Effective_Extra_Accessibility (Entity (Renamed_Object (Id))); else return Extra_Accessibility (Id); end if; end Effective_Extra_Accessibility; ----------------------------- -- Effective_Reads_Enabled -- ----------------------------- function Effective_Reads_Enabled (Id : Entity_Id) return Boolean is begin return Has_Enabled_Property (Id, Name_Effective_Reads); end Effective_Reads_Enabled; ------------------------------ -- Effective_Writes_Enabled -- ------------------------------ function Effective_Writes_Enabled (Id : Entity_Id) return Boolean is begin return Has_Enabled_Property (Id, Name_Effective_Writes); end Effective_Writes_Enabled; ------------------------------ -- Enclosing_Comp_Unit_Node -- ------------------------------ function Enclosing_Comp_Unit_Node (N : Node_Id) return Node_Id is Current_Node : Node_Id; begin Current_Node := N; while Present (Current_Node) and then Nkind (Current_Node) /= N_Compilation_Unit loop Current_Node := Parent (Current_Node); end loop; if Nkind (Current_Node) /= N_Compilation_Unit then return Empty; else return Current_Node; end if; end Enclosing_Comp_Unit_Node; -------------------------- -- Enclosing_CPP_Parent -- -------------------------- function Enclosing_CPP_Parent (Typ : Entity_Id) return Entity_Id is Parent_Typ : Entity_Id := Typ; begin while not Is_CPP_Class (Parent_Typ) and then Etype (Parent_Typ) /= Parent_Typ loop Parent_Typ := Etype (Parent_Typ); if Is_Private_Type (Parent_Typ) then Parent_Typ := Full_View (Base_Type (Parent_Typ)); end if; end loop; pragma Assert (Is_CPP_Class (Parent_Typ)); return Parent_Typ; end Enclosing_CPP_Parent; --------------------------- -- Enclosing_Declaration -- --------------------------- function Enclosing_Declaration (N : Node_Id) return Node_Id is Decl : Node_Id := N; begin while Present (Decl) and then not (Nkind (Decl) in N_Declaration or else Nkind (Decl) in N_Later_Decl_Item) loop Decl := Parent (Decl); end loop; return Decl; end Enclosing_Declaration; ---------------------------- -- Enclosing_Generic_Body -- ---------------------------- function Enclosing_Generic_Body (N : Node_Id) return Node_Id is P : Node_Id; Decl : Node_Id; Spec : Node_Id; begin P := Parent (N); while Present (P) loop if Nkind (P) = N_Package_Body or else Nkind (P) = N_Subprogram_Body then Spec := Corresponding_Spec (P); if Present (Spec) then Decl := Unit_Declaration_Node (Spec); if Nkind (Decl) = N_Generic_Package_Declaration or else Nkind (Decl) = N_Generic_Subprogram_Declaration then return P; end if; end if; end if; P := Parent (P); end loop; return Empty; end Enclosing_Generic_Body; ---------------------------- -- Enclosing_Generic_Unit -- ---------------------------- function Enclosing_Generic_Unit (N : Node_Id) return Node_Id is P : Node_Id; Decl : Node_Id; Spec : Node_Id; begin P := Parent (N); while Present (P) loop if Nkind (P) = N_Generic_Package_Declaration or else Nkind (P) = N_Generic_Subprogram_Declaration then return P; elsif Nkind (P) = N_Package_Body or else Nkind (P) = N_Subprogram_Body then Spec := Corresponding_Spec (P); if Present (Spec) then Decl := Unit_Declaration_Node (Spec); if Nkind (Decl) = N_Generic_Package_Declaration or else Nkind (Decl) = N_Generic_Subprogram_Declaration then return Decl; end if; end if; end if; P := Parent (P); end loop; return Empty; end Enclosing_Generic_Unit; ------------------------------- -- Enclosing_Lib_Unit_Entity -- ------------------------------- function Enclosing_Lib_Unit_Entity (E : Entity_Id := Current_Scope) return Entity_Id is Unit_Entity : Entity_Id; begin -- Look for enclosing library unit entity by following scope links. -- Equivalent to, but faster than indexing through the scope stack. Unit_Entity := E; while (Present (Scope (Unit_Entity)) and then Scope (Unit_Entity) /= Standard_Standard) and not Is_Child_Unit (Unit_Entity) loop Unit_Entity := Scope (Unit_Entity); end loop; return Unit_Entity; end Enclosing_Lib_Unit_Entity; ----------------------------- -- Enclosing_Lib_Unit_Node -- ----------------------------- function Enclosing_Lib_Unit_Node (N : Node_Id) return Node_Id is Encl_Unit : Node_Id; begin Encl_Unit := Enclosing_Comp_Unit_Node (N); while Present (Encl_Unit) and then Nkind (Unit (Encl_Unit)) = N_Subunit loop Encl_Unit := Library_Unit (Encl_Unit); end loop; pragma Assert (Nkind (Encl_Unit) = N_Compilation_Unit); return Encl_Unit; end Enclosing_Lib_Unit_Node; ----------------------- -- Enclosing_Package -- ----------------------- function Enclosing_Package (E : Entity_Id) return Entity_Id is Dynamic_Scope : constant Entity_Id := Enclosing_Dynamic_Scope (E); begin if Dynamic_Scope = Standard_Standard then return Standard_Standard; elsif Dynamic_Scope = Empty then return Empty; elsif Ekind_In (Dynamic_Scope, E_Package, E_Package_Body, E_Generic_Package) then return Dynamic_Scope; else return Enclosing_Package (Dynamic_Scope); end if; end Enclosing_Package; ------------------------------------- -- Enclosing_Package_Or_Subprogram -- ------------------------------------- function Enclosing_Package_Or_Subprogram (E : Entity_Id) return Entity_Id is S : Entity_Id; begin S := Scope (E); while Present (S) loop if Is_Package_Or_Generic_Package (S) or else Ekind (S) = E_Package_Body then return S; elsif Is_Subprogram_Or_Generic_Subprogram (S) or else Ekind (S) = E_Subprogram_Body then return S; else S := Scope (S); end if; end loop; return Empty; end Enclosing_Package_Or_Subprogram; -------------------------- -- Enclosing_Subprogram -- -------------------------- function Enclosing_Subprogram (E : Entity_Id) return Entity_Id is Dynamic_Scope : constant Entity_Id := Enclosing_Dynamic_Scope (E); begin if Dynamic_Scope = Standard_Standard then return Empty; elsif Dynamic_Scope = Empty then return Empty; elsif Ekind (Dynamic_Scope) = E_Subprogram_Body then return Corresponding_Spec (Parent (Parent (Dynamic_Scope))); elsif Ekind (Dynamic_Scope) = E_Block or else Ekind (Dynamic_Scope) = E_Return_Statement then return Enclosing_Subprogram (Dynamic_Scope); elsif Ekind (Dynamic_Scope) = E_Task_Type then return Get_Task_Body_Procedure (Dynamic_Scope); elsif Ekind (Dynamic_Scope) = E_Limited_Private_Type and then Present (Full_View (Dynamic_Scope)) and then Ekind (Full_View (Dynamic_Scope)) = E_Task_Type then return Get_Task_Body_Procedure (Full_View (Dynamic_Scope)); -- No body is generated if the protected operation is eliminated elsif Convention (Dynamic_Scope) = Convention_Protected and then not Is_Eliminated (Dynamic_Scope) and then Present (Protected_Body_Subprogram (Dynamic_Scope)) then return Protected_Body_Subprogram (Dynamic_Scope); else return Dynamic_Scope; end if; end Enclosing_Subprogram; ------------------------ -- Ensure_Freeze_Node -- ------------------------ procedure Ensure_Freeze_Node (E : Entity_Id) is FN : Node_Id; begin if No (Freeze_Node (E)) then FN := Make_Freeze_Entity (Sloc (E)); Set_Has_Delayed_Freeze (E); Set_Freeze_Node (E, FN); Set_Access_Types_To_Process (FN, No_Elist); Set_TSS_Elist (FN, No_Elist); Set_Entity (FN, E); end if; end Ensure_Freeze_Node; ---------------- -- Enter_Name -- ---------------- procedure Enter_Name (Def_Id : Entity_Id) is C : constant Entity_Id := Current_Entity (Def_Id); E : constant Entity_Id := Current_Entity_In_Scope (Def_Id); S : constant Entity_Id := Current_Scope; begin Generate_Definition (Def_Id); -- Add new name to current scope declarations. Check for duplicate -- declaration, which may or may not be a genuine error. if Present (E) then -- Case of previous entity entered because of a missing declaration -- or else a bad subtype indication. Best is to use the new entity, -- and make the previous one invisible. if Etype (E) = Any_Type then Set_Is_Immediately_Visible (E, False); -- Case of renaming declaration constructed for package instances. -- if there is an explicit declaration with the same identifier, -- the renaming is not immediately visible any longer, but remains -- visible through selected component notation. elsif Nkind (Parent (E)) = N_Package_Renaming_Declaration and then not Comes_From_Source (E) then Set_Is_Immediately_Visible (E, False); -- The new entity may be the package renaming, which has the same -- same name as a generic formal which has been seen already. elsif Nkind (Parent (Def_Id)) = N_Package_Renaming_Declaration and then not Comes_From_Source (Def_Id) then Set_Is_Immediately_Visible (E, False); -- For a fat pointer corresponding to a remote access to subprogram, -- we use the same identifier as the RAS type, so that the proper -- name appears in the stub. This type is only retrieved through -- the RAS type and never by visibility, and is not added to the -- visibility list (see below). elsif Nkind (Parent (Def_Id)) = N_Full_Type_Declaration and then Ekind (Def_Id) = E_Record_Type and then Present (Corresponding_Remote_Type (Def_Id)) then null; -- Case of an implicit operation or derived literal. The new entity -- hides the implicit one, which is removed from all visibility, -- i.e. the entity list of its scope, and homonym chain of its name. elsif (Is_Overloadable (E) and then Is_Inherited_Operation (E)) or else Is_Internal (E) then declare Decl : constant Node_Id := Parent (E); Prev : Entity_Id; Prev_Vis : Entity_Id; begin -- If E is an implicit declaration, it cannot be the first -- entity in the scope. Prev := First_Entity (Current_Scope); while Present (Prev) and then Next_Entity (Prev) /= E loop Next_Entity (Prev); end loop; if No (Prev) then -- If E is not on the entity chain of the current scope, -- it is an implicit declaration in the generic formal -- part of a generic subprogram. When analyzing the body, -- the generic formals are visible but not on the entity -- chain of the subprogram. The new entity will become -- the visible one in the body. pragma Assert (Nkind (Parent (Decl)) = N_Generic_Subprogram_Declaration); null; else Set_Next_Entity (Prev, Next_Entity (E)); if No (Next_Entity (Prev)) then Set_Last_Entity (Current_Scope, Prev); end if; if E = Current_Entity (E) then Prev_Vis := Empty; else Prev_Vis := Current_Entity (E); while Homonym (Prev_Vis) /= E loop Prev_Vis := Homonym (Prev_Vis); end loop; end if; if Present (Prev_Vis) then -- Skip E in the visibility chain Set_Homonym (Prev_Vis, Homonym (E)); else Set_Name_Entity_Id (Chars (E), Homonym (E)); end if; end if; end; -- This section of code could use a comment ??? elsif Present (Etype (E)) and then Is_Concurrent_Type (Etype (E)) and then E = Def_Id then return; -- If the homograph is a protected component renaming, it should not -- be hiding the current entity. Such renamings are treated as weak -- declarations. elsif Is_Prival (E) then Set_Is_Immediately_Visible (E, False); -- In this case the current entity is a protected component renaming. -- Perform minimal decoration by setting the scope and return since -- the prival should not be hiding other visible entities. elsif Is_Prival (Def_Id) then Set_Scope (Def_Id, Current_Scope); return; -- Analogous to privals, the discriminal generated for an entry index -- parameter acts as a weak declaration. Perform minimal decoration -- to avoid bogus errors. elsif Is_Discriminal (Def_Id) and then Ekind (Discriminal_Link (Def_Id)) = E_Entry_Index_Parameter then Set_Scope (Def_Id, Current_Scope); return; -- In the body or private part of an instance, a type extension may -- introduce a component with the same name as that of an actual. The -- legality rule is not enforced, but the semantics of the full type -- with two components of same name are not clear at this point??? elsif In_Instance_Not_Visible then null; -- When compiling a package body, some child units may have become -- visible. They cannot conflict with local entities that hide them. elsif Is_Child_Unit (E) and then In_Open_Scopes (Scope (E)) and then not Is_Immediately_Visible (E) then null; -- Conversely, with front-end inlining we may compile the parent body -- first, and a child unit subsequently. The context is now the -- parent spec, and body entities are not visible. elsif Is_Child_Unit (Def_Id) and then Is_Package_Body_Entity (E) and then not In_Package_Body (Current_Scope) then null; -- Case of genuine duplicate declaration else Error_Msg_Sloc := Sloc (E); -- If the previous declaration is an incomplete type declaration -- this may be an attempt to complete it with a private type. The -- following avoids confusing cascaded errors. if Nkind (Parent (E)) = N_Incomplete_Type_Declaration and then Nkind (Parent (Def_Id)) = N_Private_Type_Declaration then Error_Msg_N ("incomplete type cannot be completed with a private " & "declaration", Parent (Def_Id)); Set_Is_Immediately_Visible (E, False); Set_Full_View (E, Def_Id); -- An inherited component of a record conflicts with a new -- discriminant. The discriminant is inserted first in the scope, -- but the error should be posted on it, not on the component. elsif Ekind (E) = E_Discriminant and then Present (Scope (Def_Id)) and then Scope (Def_Id) /= Current_Scope then Error_Msg_Sloc := Sloc (Def_Id); Error_Msg_N ("& conflicts with declaration#", E); return; -- If the name of the unit appears in its own context clause, a -- dummy package with the name has already been created, and the -- error emitted. Try to continue quietly. elsif Error_Posted (E) and then Sloc (E) = No_Location and then Nkind (Parent (E)) = N_Package_Specification and then Current_Scope = Standard_Standard then Set_Scope (Def_Id, Current_Scope); return; else Error_Msg_N ("& conflicts with declaration#", Def_Id); -- Avoid cascaded messages with duplicate components in -- derived types. if Ekind_In (E, E_Component, E_Discriminant) then return; end if; end if; if Nkind (Parent (Parent (Def_Id))) = N_Generic_Subprogram_Declaration and then Def_Id = Defining_Entity (Specification (Parent (Parent (Def_Id)))) then Error_Msg_N ("\generic units cannot be overloaded", Def_Id); end if; -- If entity is in standard, then we are in trouble, because it -- means that we have a library package with a duplicated name. -- That's hard to recover from, so abort. if S = Standard_Standard then raise Unrecoverable_Error; -- Otherwise we continue with the declaration. Having two -- identical declarations should not cause us too much trouble. else null; end if; end if; end if; -- If we fall through, declaration is OK, at least OK enough to continue -- If Def_Id is a discriminant or a record component we are in the midst -- of inheriting components in a derived record definition. Preserve -- their Ekind and Etype. if Ekind_In (Def_Id, E_Discriminant, E_Component) then null; -- If a type is already set, leave it alone (happens when a type -- declaration is reanalyzed following a call to the optimizer). elsif Present (Etype (Def_Id)) then null; -- Otherwise, the kind E_Void insures that premature uses of the entity -- will be detected. Any_Type insures that no cascaded errors will occur else Set_Ekind (Def_Id, E_Void); Set_Etype (Def_Id, Any_Type); end if; -- Inherited discriminants and components in derived record types are -- immediately visible. Itypes are not. -- Unless the Itype is for a record type with a corresponding remote -- type (what is that about, it was not commented ???) if Ekind_In (Def_Id, E_Discriminant, E_Component) or else ((not Is_Record_Type (Def_Id) or else No (Corresponding_Remote_Type (Def_Id))) and then not Is_Itype (Def_Id)) then Set_Is_Immediately_Visible (Def_Id); Set_Current_Entity (Def_Id); end if; Set_Homonym (Def_Id, C); Append_Entity (Def_Id, S); Set_Public_Status (Def_Id); -- Declaring a homonym is not allowed in SPARK ... if Present (C) and then Restriction_Check_Required (SPARK_05) then declare Enclosing_Subp : constant Node_Id := Enclosing_Subprogram (Def_Id); Enclosing_Pack : constant Node_Id := Enclosing_Package (Def_Id); Other_Scope : constant Node_Id := Enclosing_Dynamic_Scope (C); begin -- ... unless the new declaration is in a subprogram, and the -- visible declaration is a variable declaration or a parameter -- specification outside that subprogram. if Present (Enclosing_Subp) and then Nkind_In (Parent (C), N_Object_Declaration, N_Parameter_Specification) and then not Scope_Within_Or_Same (Other_Scope, Enclosing_Subp) then null; -- ... or the new declaration is in a package, and the visible -- declaration occurs outside that package. elsif Present (Enclosing_Pack) and then not Scope_Within_Or_Same (Other_Scope, Enclosing_Pack) then null; -- ... or the new declaration is a component declaration in a -- record type definition. elsif Nkind (Parent (Def_Id)) = N_Component_Declaration then null; -- Don't issue error for non-source entities elsif Comes_From_Source (Def_Id) and then Comes_From_Source (C) then Error_Msg_Sloc := Sloc (C); Check_SPARK_05_Restriction ("redeclaration of identifier &#", Def_Id); end if; end; end if; -- Warn if new entity hides an old one if Warn_On_Hiding and then Present (C) -- Don't warn for record components since they always have a well -- defined scope which does not confuse other uses. Note that in -- some cases, Ekind has not been set yet. and then Ekind (C) /= E_Component and then Ekind (C) /= E_Discriminant and then Nkind (Parent (C)) /= N_Component_Declaration and then Ekind (Def_Id) /= E_Component and then Ekind (Def_Id) /= E_Discriminant and then Nkind (Parent (Def_Id)) /= N_Component_Declaration -- Don't warn for one character variables. It is too common to use -- such variables as locals and will just cause too many false hits. and then Length_Of_Name (Chars (C)) /= 1 -- Don't warn for non-source entities and then Comes_From_Source (C) and then Comes_From_Source (Def_Id) -- Don't warn unless entity in question is in extended main source and then In_Extended_Main_Source_Unit (Def_Id) -- Finally, the hidden entity must be either immediately visible or -- use visible (i.e. from a used package). and then (Is_Immediately_Visible (C) or else Is_Potentially_Use_Visible (C)) then Error_Msg_Sloc := Sloc (C); Error_Msg_N ("declaration hides &#?h?", Def_Id); end if; end Enter_Name; --------------- -- Entity_Of -- --------------- function Entity_Of (N : Node_Id) return Entity_Id is Id : Entity_Id; begin Id := Empty; if Is_Entity_Name (N) then Id := Entity (N); -- Follow a possible chain of renamings to reach the root renamed -- object. while Present (Id) and then Is_Object (Id) and then Present (Renamed_Object (Id)) loop if Is_Entity_Name (Renamed_Object (Id)) then Id := Entity (Renamed_Object (Id)); else Id := Empty; exit; end if; end loop; end if; return Id; end Entity_Of; -------------------------- -- Explain_Limited_Type -- -------------------------- procedure Explain_Limited_Type (T : Entity_Id; N : Node_Id) is C : Entity_Id; begin -- For array, component type must be limited if Is_Array_Type (T) then Error_Msg_Node_2 := T; Error_Msg_NE ("\component type& of type& is limited", N, Component_Type (T)); Explain_Limited_Type (Component_Type (T), N); elsif Is_Record_Type (T) then -- No need for extra messages if explicit limited record if Is_Limited_Record (Base_Type (T)) then return; end if; -- Otherwise find a limited component. Check only components that -- come from source, or inherited components that appear in the -- source of the ancestor. C := First_Component (T); while Present (C) loop if Is_Limited_Type (Etype (C)) and then (Comes_From_Source (C) or else (Present (Original_Record_Component (C)) and then Comes_From_Source (Original_Record_Component (C)))) then Error_Msg_Node_2 := T; Error_Msg_NE ("\component& of type& has limited type", N, C); Explain_Limited_Type (Etype (C), N); return; end if; Next_Component (C); end loop; -- The type may be declared explicitly limited, even if no component -- of it is limited, in which case we fall out of the loop. return; end if; end Explain_Limited_Type; --------------------------------------- -- Expression_Of_Expression_Function -- --------------------------------------- function Expression_Of_Expression_Function (Subp : Entity_Id) return Node_Id is Expr_Func : Node_Id; begin pragma Assert (Is_Expression_Function_Or_Completion (Subp)); if Nkind (Original_Node (Subprogram_Spec (Subp))) = N_Expression_Function then Expr_Func := Original_Node (Subprogram_Spec (Subp)); elsif Nkind (Original_Node (Subprogram_Body (Subp))) = N_Expression_Function then Expr_Func := Original_Node (Subprogram_Body (Subp)); else pragma Assert (False); null; end if; return Original_Node (Expression (Expr_Func)); end Expression_Of_Expression_Function; ------------------------------- -- Extensions_Visible_Status -- ------------------------------- function Extensions_Visible_Status (Id : Entity_Id) return Extensions_Visible_Mode is Arg : Node_Id; Decl : Node_Id; Expr : Node_Id; Prag : Node_Id; Subp : Entity_Id; begin -- When a formal parameter is subject to Extensions_Visible, the pragma -- is stored in the contract of related subprogram. if Is_Formal (Id) then Subp := Scope (Id); elsif Is_Subprogram_Or_Generic_Subprogram (Id) then Subp := Id; -- No other construct carries this pragma else return Extensions_Visible_None; end if; Prag := Get_Pragma (Subp, Pragma_Extensions_Visible); -- In certain cases analysis may request the Extensions_Visible status -- of an expression function before the pragma has been analyzed yet. -- Inspect the declarative items after the expression function looking -- for the pragma (if any). if No (Prag) and then Is_Expression_Function (Subp) then Decl := Next (Unit_Declaration_Node (Subp)); while Present (Decl) loop if Nkind (Decl) = N_Pragma and then Pragma_Name (Decl) = Name_Extensions_Visible then Prag := Decl; exit; -- A source construct ends the region where Extensions_Visible may -- appear, stop the traversal. An expanded expression function is -- no longer a source construct, but it must still be recognized. elsif Comes_From_Source (Decl) or else (Nkind_In (Decl, N_Subprogram_Body, N_Subprogram_Declaration) and then Is_Expression_Function (Defining_Entity (Decl))) then exit; end if; Next (Decl); end loop; end if; -- Extract the value from the Boolean expression (if any) if Present (Prag) then Arg := First (Pragma_Argument_Associations (Prag)); if Present (Arg) then Expr := Get_Pragma_Arg (Arg); -- When the associated subprogram is an expression function, the -- argument of the pragma may not have been analyzed. if not Analyzed (Expr) then Preanalyze_And_Resolve (Expr, Standard_Boolean); end if; -- Guard against cascading errors when the argument of pragma -- Extensions_Visible is not a valid static Boolean expression. if Error_Posted (Expr) then return Extensions_Visible_None; elsif Is_True (Expr_Value (Expr)) then return Extensions_Visible_True; else return Extensions_Visible_False; end if; -- Otherwise the aspect or pragma defaults to True else return Extensions_Visible_True; end if; -- Otherwise aspect or pragma Extensions_Visible is not inherited or -- directly specified. In SPARK code, its value defaults to "False". elsif SPARK_Mode = On then return Extensions_Visible_False; -- In non-SPARK code, aspect or pragma Extensions_Visible defaults to -- "True". else return Extensions_Visible_True; end if; end Extensions_Visible_Status; ----------------- -- Find_Actual -- ----------------- procedure Find_Actual (N : Node_Id; Formal : out Entity_Id; Call : out Node_Id) is Context : constant Node_Id := Parent (N); Actual : Node_Id; Call_Nam : Node_Id; begin if Nkind_In (Context, N_Indexed_Component, N_Selected_Component) and then N = Prefix (Context) then Find_Actual (Context, Formal, Call); return; elsif Nkind (Context) = N_Parameter_Association and then N = Explicit_Actual_Parameter (Context) then Call := Parent (Context); elsif Nkind_In (Context, N_Entry_Call_Statement, N_Function_Call, N_Procedure_Call_Statement) then Call := Context; else Formal := Empty; Call := Empty; return; end if; -- If we have a call to a subprogram look for the parameter. Note that -- we exclude overloaded calls, since we don't know enough to be sure -- of giving the right answer in this case. if Nkind_In (Call, N_Entry_Call_Statement, N_Function_Call, N_Procedure_Call_Statement) then Call_Nam := Name (Call); -- A call to a protected or task entry appears as a selected -- component rather than an expanded name. if Nkind (Call_Nam) = N_Selected_Component then Call_Nam := Selector_Name (Call_Nam); end if; if Is_Entity_Name (Call_Nam) and then Present (Entity (Call_Nam)) and then Is_Overloadable (Entity (Call_Nam)) and then not Is_Overloaded (Call_Nam) then -- If node is name in call it is not an actual if N = Call_Nam then Formal := Empty; Call := Empty; return; end if; -- Fall here if we are definitely a parameter Actual := First_Actual (Call); Formal := First_Formal (Entity (Call_Nam)); while Present (Formal) and then Present (Actual) loop if Actual = N then return; -- An actual that is the prefix in a prefixed call may have -- been rewritten in the call, after the deferred reference -- was collected. Check if sloc and kinds and names match. elsif Sloc (Actual) = Sloc (N) and then Nkind (Actual) = N_Identifier and then Nkind (Actual) = Nkind (N) and then Chars (Actual) = Chars (N) then return; else Actual := Next_Actual (Actual); Formal := Next_Formal (Formal); end if; end loop; end if; end if; -- Fall through here if we did not find matching actual Formal := Empty; Call := Empty; end Find_Actual; --------------------------- -- Find_Body_Discriminal -- --------------------------- function Find_Body_Discriminal (Spec_Discriminant : Entity_Id) return Entity_Id is Tsk : Entity_Id; Disc : Entity_Id; begin -- If expansion is suppressed, then the scope can be the concurrent type -- itself rather than a corresponding concurrent record type. if Is_Concurrent_Type (Scope (Spec_Discriminant)) then Tsk := Scope (Spec_Discriminant); else pragma Assert (Is_Concurrent_Record_Type (Scope (Spec_Discriminant))); Tsk := Corresponding_Concurrent_Type (Scope (Spec_Discriminant)); end if; -- Find discriminant of original concurrent type, and use its current -- discriminal, which is the renaming within the task/protected body. Disc := First_Discriminant (Tsk); while Present (Disc) loop if Chars (Disc) = Chars (Spec_Discriminant) then return Discriminal (Disc); end if; Next_Discriminant (Disc); end loop; -- That loop should always succeed in finding a matching entry and -- returning. Fatal error if not. raise Program_Error; end Find_Body_Discriminal; ------------------------------------- -- Find_Corresponding_Discriminant -- ------------------------------------- function Find_Corresponding_Discriminant (Id : Node_Id; Typ : Entity_Id) return Entity_Id is Par_Disc : Entity_Id; Old_Disc : Entity_Id; New_Disc : Entity_Id; begin Par_Disc := Original_Record_Component (Original_Discriminant (Id)); -- The original type may currently be private, and the discriminant -- only appear on its full view. if Is_Private_Type (Scope (Par_Disc)) and then not Has_Discriminants (Scope (Par_Disc)) and then Present (Full_View (Scope (Par_Disc))) then Old_Disc := First_Discriminant (Full_View (Scope (Par_Disc))); else Old_Disc := First_Discriminant (Scope (Par_Disc)); end if; if Is_Class_Wide_Type (Typ) then New_Disc := First_Discriminant (Root_Type (Typ)); else New_Disc := First_Discriminant (Typ); end if; while Present (Old_Disc) and then Present (New_Disc) loop if Old_Disc = Par_Disc then return New_Disc; end if; Next_Discriminant (Old_Disc); Next_Discriminant (New_Disc); end loop; -- Should always find it raise Program_Error; end Find_Corresponding_Discriminant; ---------------------------------- -- Find_Enclosing_Iterator_Loop -- ---------------------------------- function Find_Enclosing_Iterator_Loop (Id : Entity_Id) return Entity_Id is Constr : Node_Id; S : Entity_Id; begin -- Traverse the scope chain looking for an iterator loop. Such loops are -- usually transformed into blocks, hence the use of Original_Node. S := Id; while Present (S) and then S /= Standard_Standard loop if Ekind (S) = E_Loop and then Nkind (Parent (S)) = N_Implicit_Label_Declaration then Constr := Original_Node (Label_Construct (Parent (S))); if Nkind (Constr) = N_Loop_Statement and then Present (Iteration_Scheme (Constr)) and then Nkind (Iterator_Specification (Iteration_Scheme (Constr))) = N_Iterator_Specification then return S; end if; end if; S := Scope (S); end loop; return Empty; end Find_Enclosing_Iterator_Loop; ------------------------------------ -- Find_Loop_In_Conditional_Block -- ------------------------------------ function Find_Loop_In_Conditional_Block (N : Node_Id) return Node_Id is Stmt : Node_Id; begin Stmt := N; if Nkind (Stmt) = N_If_Statement then Stmt := First (Then_Statements (Stmt)); end if; pragma Assert (Nkind (Stmt) = N_Block_Statement); -- Inspect the statements of the conditional block. In general the loop -- should be the first statement in the statement sequence of the block, -- but the finalization machinery may have introduced extra object -- declarations. Stmt := First (Statements (Handled_Statement_Sequence (Stmt))); while Present (Stmt) loop if Nkind (Stmt) = N_Loop_Statement then return Stmt; end if; Next (Stmt); end loop; -- The expansion of attribute 'Loop_Entry produced a malformed block raise Program_Error; end Find_Loop_In_Conditional_Block; -------------------------- -- Find_Overlaid_Entity -- -------------------------- procedure Find_Overlaid_Entity (N : Node_Id; Ent : out Entity_Id; Off : out Boolean) is Expr : Node_Id; begin -- We are looking for one of the two following forms: -- for X'Address use Y'Address -- or -- Const : constant Address := expr; -- ... -- for X'Address use Const; -- In the second case, the expr is either Y'Address, or recursively a -- constant that eventually references Y'Address. Ent := Empty; Off := False; if Nkind (N) = N_Attribute_Definition_Clause and then Chars (N) = Name_Address then Expr := Expression (N); -- This loop checks the form of the expression for Y'Address, -- using recursion to deal with intermediate constants. loop -- Check for Y'Address if Nkind (Expr) = N_Attribute_Reference and then Attribute_Name (Expr) = Name_Address then Expr := Prefix (Expr); exit; -- Check for Const where Const is a constant entity elsif Is_Entity_Name (Expr) and then Ekind (Entity (Expr)) = E_Constant then Expr := Constant_Value (Entity (Expr)); -- Anything else does not need checking else return; end if; end loop; -- This loop checks the form of the prefix for an entity, using -- recursion to deal with intermediate components. loop -- Check for Y where Y is an entity if Is_Entity_Name (Expr) then Ent := Entity (Expr); return; -- Check for components elsif Nkind_In (Expr, N_Selected_Component, N_Indexed_Component) then Expr := Prefix (Expr); Off := True; -- Anything else does not need checking else return; end if; end loop; end if; end Find_Overlaid_Entity; ------------------------- -- Find_Parameter_Type -- ------------------------- function Find_Parameter_Type (Param : Node_Id) return Entity_Id is begin if Nkind (Param) /= N_Parameter_Specification then return Empty; -- For an access parameter, obtain the type from the formal entity -- itself, because access to subprogram nodes do not carry a type. -- Shouldn't we always use the formal entity ??? elsif Nkind (Parameter_Type (Param)) = N_Access_Definition then return Etype (Defining_Identifier (Param)); else return Etype (Parameter_Type (Param)); end if; end Find_Parameter_Type; ----------------------------------- -- Find_Placement_In_State_Space -- ----------------------------------- procedure Find_Placement_In_State_Space (Item_Id : Entity_Id; Placement : out State_Space_Kind; Pack_Id : out Entity_Id) is Context : Entity_Id; begin -- Assume that the item does not appear in the state space of a package Placement := Not_In_Package; Pack_Id := Empty; -- Climb the scope stack and examine the enclosing context Context := Scope (Item_Id); while Present (Context) and then Context /= Standard_Standard loop if Ekind (Context) = E_Package then Pack_Id := Context; -- A package body is a cut off point for the traversal as the item -- cannot be visible to the outside from this point on. Note that -- this test must be done first as a body is also classified as a -- private part. if In_Package_Body (Context) then Placement := Body_State_Space; return; -- The private part of a package is a cut off point for the -- traversal as the item cannot be visible to the outside from -- this point on. elsif In_Private_Part (Context) then Placement := Private_State_Space; return; -- When the item appears in the visible state space of a package, -- continue to climb the scope stack as this may not be the final -- state space. else Placement := Visible_State_Space; -- The visible state space of a child unit acts as the proper -- placement of an item. if Is_Child_Unit (Context) then return; end if; end if; -- The item or its enclosing package appear in a construct that has -- no state space. else Placement := Not_In_Package; return; end if; Context := Scope (Context); end loop; end Find_Placement_In_State_Space; ------------------------ -- Find_Specific_Type -- ------------------------ function Find_Specific_Type (CW : Entity_Id) return Entity_Id is Typ : Entity_Id := Root_Type (CW); begin if Ekind (Typ) = E_Incomplete_Type then if From_Limited_With (Typ) then Typ := Non_Limited_View (Typ); else Typ := Full_View (Typ); end if; end if; if Is_Private_Type (Typ) and then not Is_Tagged_Type (Typ) and then Present (Full_View (Typ)) then return Full_View (Typ); else return Typ; end if; end Find_Specific_Type; ----------------------------- -- Find_Static_Alternative -- ----------------------------- function Find_Static_Alternative (N : Node_Id) return Node_Id is Expr : constant Node_Id := Expression (N); Val : constant Uint := Expr_Value (Expr); Alt : Node_Id; Choice : Node_Id; begin Alt := First (Alternatives (N)); Search : loop if Nkind (Alt) /= N_Pragma then Choice := First (Discrete_Choices (Alt)); while Present (Choice) loop -- Others choice, always matches if Nkind (Choice) = N_Others_Choice then exit Search; -- Range, check if value is in the range elsif Nkind (Choice) = N_Range then exit Search when Val >= Expr_Value (Low_Bound (Choice)) and then Val <= Expr_Value (High_Bound (Choice)); -- Choice is a subtype name. Note that we know it must -- be a static subtype, since otherwise it would have -- been diagnosed as illegal. elsif Is_Entity_Name (Choice) and then Is_Type (Entity (Choice)) then exit Search when Is_In_Range (Expr, Etype (Choice), Assume_Valid => False); -- Choice is a subtype indication elsif Nkind (Choice) = N_Subtype_Indication then declare C : constant Node_Id := Constraint (Choice); R : constant Node_Id := Range_Expression (C); begin exit Search when Val >= Expr_Value (Low_Bound (R)) and then Val <= Expr_Value (High_Bound (R)); end; -- Choice is a simple expression else exit Search when Val = Expr_Value (Choice); end if; Next (Choice); end loop; end if; Next (Alt); pragma Assert (Present (Alt)); end loop Search; -- The above loop *must* terminate by finding a match, since we know the -- case statement is valid, and the value of the expression is known at -- compile time. When we fall out of the loop, Alt points to the -- alternative that we know will be selected at run time. return Alt; end Find_Static_Alternative; ------------------ -- First_Actual -- ------------------ function First_Actual (Node : Node_Id) return Node_Id is N : Node_Id; begin if No (Parameter_Associations (Node)) then return Empty; end if; N := First (Parameter_Associations (Node)); if Nkind (N) = N_Parameter_Association then return First_Named_Actual (Node); else return N; end if; end First_Actual; ------------- -- Fix_Msg -- ------------- function Fix_Msg (Id : Entity_Id; Msg : String) return String is Is_Task : constant Boolean := Ekind_In (Id, E_Task_Body, E_Task_Type) or else Is_Single_Task_Object (Id); Msg_Last : constant Natural := Msg'Last; Msg_Index : Natural; Res : String (Msg'Range) := (others => ' '); Res_Index : Natural; begin -- Copy all characters from the input message Msg to result Res with -- suitable replacements. Msg_Index := Msg'First; Res_Index := Res'First; while Msg_Index <= Msg_Last loop -- Replace "subprogram" with a different word if Msg_Index <= Msg_Last - 10 and then Msg (Msg_Index .. Msg_Index + 9) = "subprogram" then if Ekind_In (Id, E_Entry, E_Entry_Family) then Res (Res_Index .. Res_Index + 4) := "entry"; Res_Index := Res_Index + 5; elsif Is_Task then Res (Res_Index .. Res_Index + 8) := "task type"; Res_Index := Res_Index + 9; else Res (Res_Index .. Res_Index + 9) := "subprogram"; Res_Index := Res_Index + 10; end if; Msg_Index := Msg_Index + 10; -- Replace "protected" with a different word elsif Msg_Index <= Msg_Last - 9 and then Msg (Msg_Index .. Msg_Index + 8) = "protected" and then Is_Task then Res (Res_Index .. Res_Index + 3) := "task"; Res_Index := Res_Index + 4; Msg_Index := Msg_Index + 9; -- Otherwise copy the character else Res (Res_Index) := Msg (Msg_Index); Msg_Index := Msg_Index + 1; Res_Index := Res_Index + 1; end if; end loop; return Res (Res'First .. Res_Index - 1); end Fix_Msg; ----------------------- -- Gather_Components -- ----------------------- procedure Gather_Components (Typ : Entity_Id; Comp_List : Node_Id; Governed_By : List_Id; Into : Elist_Id; Report_Errors : out Boolean) is Assoc : Node_Id; Variant : Node_Id; Discrete_Choice : Node_Id; Comp_Item : Node_Id; Discrim : Entity_Id; Discrim_Name : Node_Id; Discrim_Value : Node_Id; begin Report_Errors := False; if No (Comp_List) or else Null_Present (Comp_List) then return; elsif Present (Component_Items (Comp_List)) then Comp_Item := First (Component_Items (Comp_List)); else Comp_Item := Empty; end if; while Present (Comp_Item) loop -- Skip the tag of a tagged record, the interface tags, as well -- as all items that are not user components (anonymous types, -- rep clauses, Parent field, controller field). if Nkind (Comp_Item) = N_Component_Declaration then declare Comp : constant Entity_Id := Defining_Identifier (Comp_Item); begin if not Is_Tag (Comp) and then Chars (Comp) /= Name_uParent then Append_Elmt (Comp, Into); end if; end; end if; Next (Comp_Item); end loop; if No (Variant_Part (Comp_List)) then return; else Discrim_Name := Name (Variant_Part (Comp_List)); Variant := First_Non_Pragma (Variants (Variant_Part (Comp_List))); end if; -- Look for the discriminant that governs this variant part. -- The discriminant *must* be in the Governed_By List Assoc := First (Governed_By); Find_Constraint : loop Discrim := First (Choices (Assoc)); exit Find_Constraint when Chars (Discrim_Name) = Chars (Discrim) or else (Present (Corresponding_Discriminant (Entity (Discrim))) and then Chars (Corresponding_Discriminant (Entity (Discrim))) = Chars (Discrim_Name)) or else Chars (Original_Record_Component (Entity (Discrim))) = Chars (Discrim_Name); if No (Next (Assoc)) then if not Is_Constrained (Typ) and then Is_Derived_Type (Typ) and then Present (Stored_Constraint (Typ)) then -- If the type is a tagged type with inherited discriminants, -- use the stored constraint on the parent in order to find -- the values of discriminants that are otherwise hidden by an -- explicit constraint. Renamed discriminants are handled in -- the code above. -- If several parent discriminants are renamed by a single -- discriminant of the derived type, the call to obtain the -- Corresponding_Discriminant field only retrieves the last -- of them. We recover the constraint on the others from the -- Stored_Constraint as well. declare D : Entity_Id; C : Elmt_Id; begin D := First_Discriminant (Etype (Typ)); C := First_Elmt (Stored_Constraint (Typ)); while Present (D) and then Present (C) loop if Chars (Discrim_Name) = Chars (D) then if Is_Entity_Name (Node (C)) and then Entity (Node (C)) = Entity (Discrim) then -- D is renamed by Discrim, whose value is given in -- Assoc. null; else Assoc := Make_Component_Association (Sloc (Typ), New_List (New_Occurrence_Of (D, Sloc (Typ))), Duplicate_Subexpr_No_Checks (Node (C))); end if; exit Find_Constraint; end if; Next_Discriminant (D); Next_Elmt (C); end loop; end; end if; end if; if No (Next (Assoc)) then Error_Msg_NE (" missing value for discriminant&", First (Governed_By), Discrim_Name); Report_Errors := True; return; end if; Next (Assoc); end loop Find_Constraint; Discrim_Value := Expression (Assoc); if not Is_OK_Static_Expression (Discrim_Value) then -- If the variant part is governed by a discriminant of the type -- this is an error. If the variant part and the discriminant are -- inherited from an ancestor this is legal (AI05-120) unless the -- components are being gathered for an aggregate, in which case -- the caller must check Report_Errors. if Scope (Original_Record_Component ((Entity (First (Choices (Assoc)))))) = Typ then Error_Msg_FE ("value for discriminant & must be static!", Discrim_Value, Discrim); Why_Not_Static (Discrim_Value); end if; Report_Errors := True; return; end if; Search_For_Discriminant_Value : declare Low : Node_Id; High : Node_Id; UI_High : Uint; UI_Low : Uint; UI_Discrim_Value : constant Uint := Expr_Value (Discrim_Value); begin Find_Discrete_Value : while Present (Variant) loop Discrete_Choice := First (Discrete_Choices (Variant)); while Present (Discrete_Choice) loop exit Find_Discrete_Value when Nkind (Discrete_Choice) = N_Others_Choice; Get_Index_Bounds (Discrete_Choice, Low, High); UI_Low := Expr_Value (Low); UI_High := Expr_Value (High); exit Find_Discrete_Value when UI_Low <= UI_Discrim_Value and then UI_High >= UI_Discrim_Value; Next (Discrete_Choice); end loop; Next_Non_Pragma (Variant); end loop Find_Discrete_Value; end Search_For_Discriminant_Value; -- The case statement must include a variant that corresponds to the -- value of the discriminant, unless the discriminant type has a -- static predicate. In that case the absence of an others_choice that -- would cover this value becomes a run-time error (3.8,1 (21.1/2)). if No (Variant) and then not Has_Static_Predicate (Etype (Discrim_Name)) then Error_Msg_NE ("value of discriminant & is out of range", Discrim_Value, Discrim); Report_Errors := True; return; end if; -- If we have found the corresponding choice, recursively add its -- components to the Into list. The nested components are part of -- the same record type. if Present (Variant) then Gather_Components (Typ, Component_List (Variant), Governed_By, Into, Report_Errors); end if; end Gather_Components; ------------------------ -- Get_Actual_Subtype -- ------------------------ function Get_Actual_Subtype (N : Node_Id) return Entity_Id is Typ : constant Entity_Id := Etype (N); Utyp : Entity_Id := Underlying_Type (Typ); Decl : Node_Id; Atyp : Entity_Id; begin if No (Utyp) then Utyp := Typ; end if; -- If what we have is an identifier that references a subprogram -- formal, or a variable or constant object, then we get the actual -- subtype from the referenced entity if one has been built. if Nkind (N) = N_Identifier and then (Is_Formal (Entity (N)) or else Ekind (Entity (N)) = E_Constant or else Ekind (Entity (N)) = E_Variable) and then Present (Actual_Subtype (Entity (N))) then return Actual_Subtype (Entity (N)); -- Actual subtype of unchecked union is always itself. We never need -- the "real" actual subtype. If we did, we couldn't get it anyway -- because the discriminant is not available. The restrictions on -- Unchecked_Union are designed to make sure that this is OK. elsif Is_Unchecked_Union (Base_Type (Utyp)) then return Typ; -- Here for the unconstrained case, we must find actual subtype -- No actual subtype is available, so we must build it on the fly. -- Checking the type, not the underlying type, for constrainedness -- seems to be necessary. Maybe all the tests should be on the type??? elsif (not Is_Constrained (Typ)) and then (Is_Array_Type (Utyp) or else (Is_Record_Type (Utyp) and then Has_Discriminants (Utyp))) and then not Has_Unknown_Discriminants (Utyp) and then not (Ekind (Utyp) = E_String_Literal_Subtype) then -- Nothing to do if in spec expression (why not???) if In_Spec_Expression then return Typ; elsif Is_Private_Type (Typ) and then not Has_Discriminants (Typ) then -- If the type has no discriminants, there is no subtype to -- build, even if the underlying type is discriminated. return Typ; -- Else build the actual subtype else Decl := Build_Actual_Subtype (Typ, N); Atyp := Defining_Identifier (Decl); -- If Build_Actual_Subtype generated a new declaration then use it if Atyp /= Typ then -- The actual subtype is an Itype, so analyze the declaration, -- but do not attach it to the tree, to get the type defined. Set_Parent (Decl, N); Set_Is_Itype (Atyp); Analyze (Decl, Suppress => All_Checks); Set_Associated_Node_For_Itype (Atyp, N); Set_Has_Delayed_Freeze (Atyp, False); -- We need to freeze the actual subtype immediately. This is -- needed, because otherwise this Itype will not get frozen -- at all, and it is always safe to freeze on creation because -- any associated types must be frozen at this point. Freeze_Itype (Atyp, N); return Atyp; -- Otherwise we did not build a declaration, so return original else return Typ; end if; end if; -- For all remaining cases, the actual subtype is the same as -- the nominal type. else return Typ; end if; end Get_Actual_Subtype; ------------------------------------- -- Get_Actual_Subtype_If_Available -- ------------------------------------- function Get_Actual_Subtype_If_Available (N : Node_Id) return Entity_Id is Typ : constant Entity_Id := Etype (N); begin -- If what we have is an identifier that references a subprogram -- formal, or a variable or constant object, then we get the actual -- subtype from the referenced entity if one has been built. if Nkind (N) = N_Identifier and then (Is_Formal (Entity (N)) or else Ekind (Entity (N)) = E_Constant or else Ekind (Entity (N)) = E_Variable) and then Present (Actual_Subtype (Entity (N))) then return Actual_Subtype (Entity (N)); -- Otherwise the Etype of N is returned unchanged else return Typ; end if; end Get_Actual_Subtype_If_Available; ------------------------ -- Get_Body_From_Stub -- ------------------------ function Get_Body_From_Stub (N : Node_Id) return Node_Id is begin return Proper_Body (Unit (Library_Unit (N))); end Get_Body_From_Stub; --------------------- -- Get_Cursor_Type -- --------------------- function Get_Cursor_Type (Aspect : Node_Id; Typ : Entity_Id) return Entity_Id is Assoc : Node_Id; Func : Entity_Id; First_Op : Entity_Id; Cursor : Entity_Id; begin -- If error already detected, return if Error_Posted (Aspect) then return Any_Type; end if; -- The cursor type for an Iterable aspect is the return type of a -- non-overloaded First primitive operation. Locate association for -- First. Assoc := First (Component_Associations (Expression (Aspect))); First_Op := Any_Id; while Present (Assoc) loop if Chars (First (Choices (Assoc))) = Name_First then First_Op := Expression (Assoc); exit; end if; Next (Assoc); end loop; if First_Op = Any_Id then Error_Msg_N ("aspect Iterable must specify First operation", Aspect); return Any_Type; end if; Cursor := Any_Type; -- Locate function with desired name and profile in scope of type -- In the rare case where the type is an integer type, a base type -- is created for it, check that the base type of the first formal -- of First matches the base type of the domain. Func := First_Entity (Scope (Typ)); while Present (Func) loop if Chars (Func) = Chars (First_Op) and then Ekind (Func) = E_Function and then Present (First_Formal (Func)) and then Base_Type (Etype (First_Formal (Func))) = Base_Type (Typ) and then No (Next_Formal (First_Formal (Func))) then if Cursor /= Any_Type then Error_Msg_N ("Operation First for iterable type must be unique", Aspect); return Any_Type; else Cursor := Etype (Func); end if; end if; Next_Entity (Func); end loop; -- If not found, no way to resolve remaining primitives. if Cursor = Any_Type then Error_Msg_N ("No legal primitive operation First for Iterable type", Aspect); end if; return Cursor; end Get_Cursor_Type; function Get_Cursor_Type (Typ : Entity_Id) return Entity_Id is begin return Etype (Get_Iterable_Type_Primitive (Typ, Name_First)); end Get_Cursor_Type; ------------------------------- -- Get_Default_External_Name -- ------------------------------- function Get_Default_External_Name (E : Node_Or_Entity_Id) return Node_Id is begin Get_Decoded_Name_String (Chars (E)); if Opt.External_Name_Imp_Casing = Uppercase then Set_Casing (All_Upper_Case); else Set_Casing (All_Lower_Case); end if; return Make_String_Literal (Sloc (E), Strval => String_From_Name_Buffer); end Get_Default_External_Name; -------------------------- -- Get_Enclosing_Object -- -------------------------- function Get_Enclosing_Object (N : Node_Id) return Entity_Id is begin if Is_Entity_Name (N) then return Entity (N); else case Nkind (N) is when N_Indexed_Component | N_Selected_Component | N_Slice => -- If not generating code, a dereference may be left implicit. -- In thoses cases, return Empty. if Is_Access_Type (Etype (Prefix (N))) then return Empty; else return Get_Enclosing_Object (Prefix (N)); end if; when N_Type_Conversion => return Get_Enclosing_Object (Expression (N)); when others => return Empty; end case; end if; end Get_Enclosing_Object; --------------------------- -- Get_Enum_Lit_From_Pos -- --------------------------- function Get_Enum_Lit_From_Pos (T : Entity_Id; Pos : Uint; Loc : Source_Ptr) return Node_Id is Btyp : Entity_Id := Base_Type (T); Lit : Node_Id; LLoc : Source_Ptr; begin -- In the case where the literal is of type Character, Wide_Character -- or Wide_Wide_Character or of a type derived from them, there needs -- to be some special handling since there is no explicit chain of -- literals to search. Instead, an N_Character_Literal node is created -- with the appropriate Char_Code and Chars fields. if Is_Standard_Character_Type (T) then Set_Character_Literal_Name (UI_To_CC (Pos)); return Make_Character_Literal (Loc, Chars => Name_Find, Char_Literal_Value => Pos); -- For all other cases, we have a complete table of literals, and -- we simply iterate through the chain of literal until the one -- with the desired position value is found. else if Is_Private_Type (Btyp) and then Present (Full_View (Btyp)) then Btyp := Full_View (Btyp); end if; Lit := First_Literal (Btyp); for J in 1 .. UI_To_Int (Pos) loop Next_Literal (Lit); -- If Lit is Empty, Pos is not in range, so raise Constraint_Error -- inside the loop to avoid calling Next_Literal on Empty. if No (Lit) then raise Constraint_Error; end if; end loop; -- Create a new node from Lit, with source location provided by Loc -- if not equal to No_Location, or by copying the source location of -- Lit otherwise. LLoc := Loc; if LLoc = No_Location then LLoc := Sloc (Lit); end if; return New_Occurrence_Of (Lit, LLoc); end if; end Get_Enum_Lit_From_Pos; ------------------------ -- Get_Generic_Entity -- ------------------------ function Get_Generic_Entity (N : Node_Id) return Entity_Id is Ent : constant Entity_Id := Entity (Name (N)); begin if Present (Renamed_Object (Ent)) then return Renamed_Object (Ent); else return Ent; end if; end Get_Generic_Entity; ------------------------------------- -- Get_Incomplete_View_Of_Ancestor -- ------------------------------------- function Get_Incomplete_View_Of_Ancestor (E : Entity_Id) return Entity_Id is Cur_Unit : constant Entity_Id := Cunit_Entity (Current_Sem_Unit); Par_Scope : Entity_Id; Par_Type : Entity_Id; begin -- The incomplete view of an ancestor is only relevant for private -- derived types in child units. if not Is_Derived_Type (E) or else not Is_Child_Unit (Cur_Unit) then return Empty; else Par_Scope := Scope (Cur_Unit); if No (Par_Scope) then return Empty; end if; Par_Type := Etype (Base_Type (E)); -- Traverse list of ancestor types until we find one declared in -- a parent or grandparent unit (two levels seem sufficient). while Present (Par_Type) loop if Scope (Par_Type) = Par_Scope or else Scope (Par_Type) = Scope (Par_Scope) then return Par_Type; elsif not Is_Derived_Type (Par_Type) then return Empty; else Par_Type := Etype (Base_Type (Par_Type)); end if; end loop; -- If none found, there is no relevant ancestor type. return Empty; end if; end Get_Incomplete_View_Of_Ancestor; ---------------------- -- Get_Index_Bounds -- ---------------------- procedure Get_Index_Bounds (N : Node_Id; L : out Node_Id; H : out Node_Id; Use_Full_View : Boolean := False) is function Scalar_Range_Of_Type (Typ : Entity_Id) return Node_Id; -- Obtain the scalar range of type Typ. If flag Use_Full_View is set and -- Typ qualifies, the scalar range is obtained from the full view of the -- type. -------------------------- -- Scalar_Range_Of_Type -- -------------------------- function Scalar_Range_Of_Type (Typ : Entity_Id) return Node_Id is T : Entity_Id := Typ; begin if Use_Full_View and then Present (Full_View (T)) then T := Full_View (T); end if; return Scalar_Range (T); end Scalar_Range_Of_Type; -- Local variables Kind : constant Node_Kind := Nkind (N); Rng : Node_Id; -- Start of processing for Get_Index_Bounds begin if Kind = N_Range then L := Low_Bound (N); H := High_Bound (N); elsif Kind = N_Subtype_Indication then Rng := Range_Expression (Constraint (N)); if Rng = Error then L := Error; H := Error; return; else L := Low_Bound (Range_Expression (Constraint (N))); H := High_Bound (Range_Expression (Constraint (N))); end if; elsif Is_Entity_Name (N) and then Is_Type (Entity (N)) then Rng := Scalar_Range_Of_Type (Entity (N)); if Error_Posted (Rng) then L := Error; H := Error; elsif Nkind (Rng) = N_Subtype_Indication then Get_Index_Bounds (Rng, L, H); else L := Low_Bound (Rng); H := High_Bound (Rng); end if; else -- N is an expression, indicating a range with one value L := N; H := N; end if; end Get_Index_Bounds; --------------------------------- -- Get_Iterable_Type_Primitive -- --------------------------------- function Get_Iterable_Type_Primitive (Typ : Entity_Id; Nam : Name_Id) return Entity_Id is Funcs : constant Node_Id := Find_Value_Of_Aspect (Typ, Aspect_Iterable); Assoc : Node_Id; begin if No (Funcs) then return Empty; else Assoc := First (Component_Associations (Funcs)); while Present (Assoc) loop if Chars (First (Choices (Assoc))) = Nam then return Entity (Expression (Assoc)); end if; Assoc := Next (Assoc); end loop; return Empty; end if; end Get_Iterable_Type_Primitive; ---------------------------------- -- Get_Library_Unit_Name_string -- ---------------------------------- procedure Get_Library_Unit_Name_String (Decl_Node : Node_Id) is Unit_Name_Id : constant Unit_Name_Type := Get_Unit_Name (Decl_Node); begin Get_Unit_Name_String (Unit_Name_Id); -- Remove seven last character (" (spec)" or " (body)") Name_Len := Name_Len - 7; pragma Assert (Name_Buffer (Name_Len + 1) = ' '); end Get_Library_Unit_Name_String; -------------------------- -- Get_Max_Queue_Length -- -------------------------- function Get_Max_Queue_Length (Id : Entity_Id) return Uint is pragma Assert (Is_Entry (Id)); Prag : constant Entity_Id := Get_Pragma (Id, Pragma_Max_Queue_Length); begin -- A value of 0 represents no maximum specified, and entries and entry -- families with no Max_Queue_Length aspect or pragma default to it. if not Present (Prag) then return Uint_0; end if; return Intval (Expression (First (Pragma_Argument_Associations (Prag)))); end Get_Max_Queue_Length; ------------------------ -- Get_Name_Entity_Id -- ------------------------ function Get_Name_Entity_Id (Id : Name_Id) return Entity_Id is begin return Entity_Id (Get_Name_Table_Int (Id)); end Get_Name_Entity_Id; ------------------------------ -- Get_Name_From_CTC_Pragma -- ------------------------------ function Get_Name_From_CTC_Pragma (N : Node_Id) return String_Id is Arg : constant Node_Id := Get_Pragma_Arg (First (Pragma_Argument_Associations (N))); begin return Strval (Expr_Value_S (Arg)); end Get_Name_From_CTC_Pragma; ----------------------- -- Get_Parent_Entity -- ----------------------- function Get_Parent_Entity (Unit : Node_Id) return Entity_Id is begin if Nkind (Unit) = N_Package_Body and then Nkind (Original_Node (Unit)) = N_Package_Instantiation then return Defining_Entity (Specification (Instance_Spec (Original_Node (Unit)))); elsif Nkind (Unit) = N_Package_Instantiation then return Defining_Entity (Specification (Instance_Spec (Unit))); else return Defining_Entity (Unit); end if; end Get_Parent_Entity; ------------------- -- Get_Pragma_Id -- ------------------- function Get_Pragma_Id (N : Node_Id) return Pragma_Id is begin return Get_Pragma_Id (Pragma_Name_Unmapped (N)); end Get_Pragma_Id; ------------------------ -- Get_Qualified_Name -- ------------------------ function Get_Qualified_Name (Id : Entity_Id; Suffix : Entity_Id := Empty) return Name_Id is Suffix_Nam : Name_Id := No_Name; begin if Present (Suffix) then Suffix_Nam := Chars (Suffix); end if; return Get_Qualified_Name (Chars (Id), Suffix_Nam, Scope (Id)); end Get_Qualified_Name; function Get_Qualified_Name (Nam : Name_Id; Suffix : Name_Id := No_Name; Scop : Entity_Id := Current_Scope) return Name_Id is procedure Add_Scope (S : Entity_Id); -- Add the fully qualified form of scope S to the name buffer. The -- format is: -- s-1__s__ --------------- -- Add_Scope -- --------------- procedure Add_Scope (S : Entity_Id) is begin if S = Empty then null; elsif S = Standard_Standard then null; else Add_Scope (Scope (S)); Get_Name_String_And_Append (Chars (S)); Add_Str_To_Name_Buffer ("__"); end if; end Add_Scope; -- Start of processing for Get_Qualified_Name begin Name_Len := 0; Add_Scope (Scop); -- Append the base name after all scopes have been chained Get_Name_String_And_Append (Nam); -- Append the suffix (if present) if Suffix /= No_Name then Add_Str_To_Name_Buffer ("__"); Get_Name_String_And_Append (Suffix); end if; return Name_Find; end Get_Qualified_Name; ----------------------- -- Get_Reason_String -- ----------------------- procedure Get_Reason_String (N : Node_Id) is begin if Nkind (N) = N_String_Literal then Store_String_Chars (Strval (N)); elsif Nkind (N) = N_Op_Concat then Get_Reason_String (Left_Opnd (N)); Get_Reason_String (Right_Opnd (N)); -- If not of required form, error else Error_Msg_N ("Reason for pragma Warnings has wrong form", N); Error_Msg_N ("\must be string literal or concatenation of string literals", N); return; end if; end Get_Reason_String; -------------------------------- -- Get_Reference_Discriminant -- -------------------------------- function Get_Reference_Discriminant (Typ : Entity_Id) return Entity_Id is D : Entity_Id; begin D := First_Discriminant (Typ); while Present (D) loop if Has_Implicit_Dereference (D) then return D; end if; Next_Discriminant (D); end loop; return Empty; end Get_Reference_Discriminant; --------------------------- -- Get_Referenced_Object -- --------------------------- function Get_Referenced_Object (N : Node_Id) return Node_Id is R : Node_Id; begin R := N; while Is_Entity_Name (R) and then Present (Renamed_Object (Entity (R))) loop R := Renamed_Object (Entity (R)); end loop; return R; end Get_Referenced_Object; ------------------------ -- Get_Renamed_Entity -- ------------------------ function Get_Renamed_Entity (E : Entity_Id) return Entity_Id is R : Entity_Id; begin R := E; while Present (Renamed_Entity (R)) loop R := Renamed_Entity (R); end loop; return R; end Get_Renamed_Entity; ----------------------- -- Get_Return_Object -- ----------------------- function Get_Return_Object (N : Node_Id) return Entity_Id is Decl : Node_Id; begin Decl := First (Return_Object_Declarations (N)); while Present (Decl) loop exit when Nkind (Decl) = N_Object_Declaration and then Is_Return_Object (Defining_Identifier (Decl)); Next (Decl); end loop; pragma Assert (Present (Decl)); return Defining_Identifier (Decl); end Get_Return_Object; --------------------------- -- Get_Subprogram_Entity -- --------------------------- function Get_Subprogram_Entity (Nod : Node_Id) return Entity_Id is Subp : Node_Id; Subp_Id : Entity_Id; begin if Nkind (Nod) = N_Accept_Statement then Subp := Entry_Direct_Name (Nod); elsif Nkind (Nod) = N_Slice then Subp := Prefix (Nod); else Subp := Name (Nod); end if; -- Strip the subprogram call loop if Nkind_In (Subp, N_Explicit_Dereference, N_Indexed_Component, N_Selected_Component) then Subp := Prefix (Subp); elsif Nkind_In (Subp, N_Type_Conversion, N_Unchecked_Type_Conversion) then Subp := Expression (Subp); else exit; end if; end loop; -- Extract the entity of the subprogram call if Is_Entity_Name (Subp) then Subp_Id := Entity (Subp); if Ekind (Subp_Id) = E_Access_Subprogram_Type then Subp_Id := Directly_Designated_Type (Subp_Id); end if; if Is_Subprogram (Subp_Id) then return Subp_Id; else return Empty; end if; -- The search did not find a construct that denotes a subprogram else return Empty; end if; end Get_Subprogram_Entity; ----------------------------- -- Get_Task_Body_Procedure -- ----------------------------- function Get_Task_Body_Procedure (E : Entity_Id) return Node_Id is begin -- Note: A task type may be the completion of a private type with -- discriminants. When performing elaboration checks on a task -- declaration, the current view of the type may be the private one, -- and the procedure that holds the body of the task is held in its -- underlying type. -- This is an odd function, why not have Task_Body_Procedure do -- the following digging??? return Task_Body_Procedure (Underlying_Type (Root_Type (E))); end Get_Task_Body_Procedure; ------------------------- -- Get_User_Defined_Eq -- ------------------------- function Get_User_Defined_Eq (E : Entity_Id) return Entity_Id is Prim : Elmt_Id; Op : Entity_Id; begin Prim := First_Elmt (Collect_Primitive_Operations (E)); while Present (Prim) loop Op := Node (Prim); if Chars (Op) = Name_Op_Eq and then Etype (Op) = Standard_Boolean and then Etype (First_Formal (Op)) = E and then Etype (Next_Formal (First_Formal (Op))) = E then return Op; end if; Next_Elmt (Prim); end loop; return Empty; end Get_User_Defined_Eq; --------------- -- Get_Views -- --------------- procedure Get_Views (Typ : Entity_Id; Priv_Typ : out Entity_Id; Full_Typ : out Entity_Id; Full_Base : out Entity_Id; CRec_Typ : out Entity_Id) is IP_View : Entity_Id; begin -- Assume that none of the views can be recovered Priv_Typ := Empty; Full_Typ := Empty; Full_Base := Empty; CRec_Typ := Empty; -- The input type is the corresponding record type of a protected or a -- task type. if Ekind (Typ) = E_Record_Type and then Is_Concurrent_Record_Type (Typ) then CRec_Typ := Typ; Full_Typ := Corresponding_Concurrent_Type (CRec_Typ); Full_Base := Base_Type (Full_Typ); Priv_Typ := Incomplete_Or_Partial_View (Full_Typ); -- Otherwise the input type denotes an arbitrary type else IP_View := Incomplete_Or_Partial_View (Typ); -- The input type denotes the full view of a private type if Present (IP_View) then Priv_Typ := IP_View; Full_Typ := Typ; -- The input type is a private type elsif Is_Private_Type (Typ) then Priv_Typ := Typ; Full_Typ := Full_View (Priv_Typ); -- Otherwise the input type does not have any views else Full_Typ := Typ; end if; if Present (Full_Typ) then Full_Base := Base_Type (Full_Typ); if Ekind_In (Full_Typ, E_Protected_Type, E_Task_Type) then CRec_Typ := Corresponding_Record_Type (Full_Typ); end if; end if; end if; end Get_Views; ----------------------- -- Has_Access_Values -- ----------------------- function Has_Access_Values (T : Entity_Id) return Boolean is Typ : constant Entity_Id := Underlying_Type (T); begin -- Case of a private type which is not completed yet. This can only -- happen in the case of a generic format type appearing directly, or -- as a component of the type to which this function is being applied -- at the top level. Return False in this case, since we certainly do -- not know that the type contains access types. if No (Typ) then return False; elsif Is_Access_Type (Typ) then return True; elsif Is_Array_Type (Typ) then return Has_Access_Values (Component_Type (Typ)); elsif Is_Record_Type (Typ) then declare Comp : Entity_Id; begin -- Loop to Check components Comp := First_Component_Or_Discriminant (Typ); while Present (Comp) loop -- Check for access component, tag field does not count, even -- though it is implemented internally using an access type. if Has_Access_Values (Etype (Comp)) and then Chars (Comp) /= Name_uTag then return True; end if; Next_Component_Or_Discriminant (Comp); end loop; end; return False; else return False; end if; end Has_Access_Values; ------------------------------ -- Has_Compatible_Alignment -- ------------------------------ function Has_Compatible_Alignment (Obj : Entity_Id; Expr : Node_Id; Layout_Done : Boolean) return Alignment_Result is function Has_Compatible_Alignment_Internal (Obj : Entity_Id; Expr : Node_Id; Layout_Done : Boolean; Default : Alignment_Result) return Alignment_Result; -- This is the internal recursive function that actually does the work. -- There is one additional parameter, which says what the result should -- be if no alignment information is found, and there is no definite -- indication of compatible alignments. At the outer level, this is set -- to Unknown, but for internal recursive calls in the case where types -- are known to be correct, it is set to Known_Compatible. --------------------------------------- -- Has_Compatible_Alignment_Internal -- --------------------------------------- function Has_Compatible_Alignment_Internal (Obj : Entity_Id; Expr : Node_Id; Layout_Done : Boolean; Default : Alignment_Result) return Alignment_Result is Result : Alignment_Result := Known_Compatible; -- Holds the current status of the result. Note that once a value of -- Known_Incompatible is set, it is sticky and does not get changed -- to Unknown (the value in Result only gets worse as we go along, -- never better). Offs : Uint := No_Uint; -- Set to a factor of the offset from the base object when Expr is a -- selected or indexed component, based on Component_Bit_Offset and -- Component_Size respectively. A negative value is used to represent -- a value which is not known at compile time. procedure Check_Prefix; -- Checks the prefix recursively in the case where the expression -- is an indexed or selected component. procedure Set_Result (R : Alignment_Result); -- If R represents a worse outcome (unknown instead of known -- compatible, or known incompatible), then set Result to R. ------------------ -- Check_Prefix -- ------------------ procedure Check_Prefix is begin -- The subtlety here is that in doing a recursive call to check -- the prefix, we have to decide what to do in the case where we -- don't find any specific indication of an alignment problem. -- At the outer level, we normally set Unknown as the result in -- this case, since we can only set Known_Compatible if we really -- know that the alignment value is OK, but for the recursive -- call, in the case where the types match, and we have not -- specified a peculiar alignment for the object, we are only -- concerned about suspicious rep clauses, the default case does -- not affect us, since the compiler will, in the absence of such -- rep clauses, ensure that the alignment is correct. if Default = Known_Compatible or else (Etype (Obj) = Etype (Expr) and then (Unknown_Alignment (Obj) or else Alignment (Obj) = Alignment (Etype (Obj)))) then Set_Result (Has_Compatible_Alignment_Internal (Obj, Prefix (Expr), Layout_Done, Known_Compatible)); -- In all other cases, we need a full check on the prefix else Set_Result (Has_Compatible_Alignment_Internal (Obj, Prefix (Expr), Layout_Done, Unknown)); end if; end Check_Prefix; ---------------- -- Set_Result -- ---------------- procedure Set_Result (R : Alignment_Result) is begin if R > Result then Result := R; end if; end Set_Result; -- Start of processing for Has_Compatible_Alignment_Internal begin -- If Expr is a selected component, we must make sure there is no -- potentially troublesome component clause and that the record is -- not packed if the layout is not done. if Nkind (Expr) = N_Selected_Component then -- Packing generates unknown alignment if layout is not done if Is_Packed (Etype (Prefix (Expr))) and then not Layout_Done then Set_Result (Unknown); end if; -- Check prefix and component offset Check_Prefix; Offs := Component_Bit_Offset (Entity (Selector_Name (Expr))); -- If Expr is an indexed component, we must make sure there is no -- potentially troublesome Component_Size clause and that the array -- is not bit-packed if the layout is not done. elsif Nkind (Expr) = N_Indexed_Component then declare Typ : constant Entity_Id := Etype (Prefix (Expr)); begin -- Packing generates unknown alignment if layout is not done if Is_Bit_Packed_Array (Typ) and then not Layout_Done then Set_Result (Unknown); end if; -- Check prefix and component offset (or at least size) Check_Prefix; Offs := Indexed_Component_Bit_Offset (Expr); if Offs = No_Uint then Offs := Component_Size (Typ); end if; end; end if; -- If we have a null offset, the result is entirely determined by -- the base object and has already been computed recursively. if Offs = Uint_0 then null; -- Case where we know the alignment of the object elsif Known_Alignment (Obj) then declare ObjA : constant Uint := Alignment (Obj); ExpA : Uint := No_Uint; SizA : Uint := No_Uint; begin -- If alignment of Obj is 1, then we are always OK if ObjA = 1 then Set_Result (Known_Compatible); -- Alignment of Obj is greater than 1, so we need to check else -- If we have an offset, see if it is compatible if Offs /= No_Uint and Offs > Uint_0 then if Offs mod (System_Storage_Unit * ObjA) /= 0 then Set_Result (Known_Incompatible); end if; -- See if Expr is an object with known alignment elsif Is_Entity_Name (Expr) and then Known_Alignment (Entity (Expr)) then ExpA := Alignment (Entity (Expr)); -- Otherwise, we can use the alignment of the type of -- Expr given that we already checked for -- discombobulating rep clauses for the cases of indexed -- and selected components above. elsif Known_Alignment (Etype (Expr)) then ExpA := Alignment (Etype (Expr)); -- Otherwise the alignment is unknown else Set_Result (Default); end if; -- If we got an alignment, see if it is acceptable if ExpA /= No_Uint and then ExpA < ObjA then Set_Result (Known_Incompatible); end if; -- If Expr is not a piece of a larger object, see if size -- is given. If so, check that it is not too small for the -- required alignment. if Offs /= No_Uint then null; -- See if Expr is an object with known size elsif Is_Entity_Name (Expr) and then Known_Static_Esize (Entity (Expr)) then SizA := Esize (Entity (Expr)); -- Otherwise, we check the object size of the Expr type elsif Known_Static_Esize (Etype (Expr)) then SizA := Esize (Etype (Expr)); end if; -- If we got a size, see if it is a multiple of the Obj -- alignment, if not, then the alignment cannot be -- acceptable, since the size is always a multiple of the -- alignment. if SizA /= No_Uint then if SizA mod (ObjA * Ttypes.System_Storage_Unit) /= 0 then Set_Result (Known_Incompatible); end if; end if; end if; end; -- If we do not know required alignment, any non-zero offset is a -- potential problem (but certainly may be OK, so result is unknown). elsif Offs /= No_Uint then Set_Result (Unknown); -- If we can't find the result by direct comparison of alignment -- values, then there is still one case that we can determine known -- result, and that is when we can determine that the types are the -- same, and no alignments are specified. Then we known that the -- alignments are compatible, even if we don't know the alignment -- value in the front end. elsif Etype (Obj) = Etype (Expr) then -- Types are the same, but we have to check for possible size -- and alignments on the Expr object that may make the alignment -- different, even though the types are the same. if Is_Entity_Name (Expr) then -- First check alignment of the Expr object. Any alignment less -- than Maximum_Alignment is worrisome since this is the case -- where we do not know the alignment of Obj. if Known_Alignment (Entity (Expr)) and then UI_To_Int (Alignment (Entity (Expr))) < Ttypes.Maximum_Alignment then Set_Result (Unknown); -- Now check size of Expr object. Any size that is not an -- even multiple of Maximum_Alignment is also worrisome -- since it may cause the alignment of the object to be less -- than the alignment of the type. elsif Known_Static_Esize (Entity (Expr)) and then (UI_To_Int (Esize (Entity (Expr))) mod (Ttypes.Maximum_Alignment * Ttypes.System_Storage_Unit)) /= 0 then Set_Result (Unknown); -- Otherwise same type is decisive else Set_Result (Known_Compatible); end if; end if; -- Another case to deal with is when there is an explicit size or -- alignment clause when the types are not the same. If so, then the -- result is Unknown. We don't need to do this test if the Default is -- Unknown, since that result will be set in any case. elsif Default /= Unknown and then (Has_Size_Clause (Etype (Expr)) or else Has_Alignment_Clause (Etype (Expr))) then Set_Result (Unknown); -- If no indication found, set default else Set_Result (Default); end if; -- Return worst result found return Result; end Has_Compatible_Alignment_Internal; -- Start of processing for Has_Compatible_Alignment begin -- If Obj has no specified alignment, then set alignment from the type -- alignment. Perhaps we should always do this, but for sure we should -- do it when there is an address clause since we can do more if the -- alignment is known. if Unknown_Alignment (Obj) then Set_Alignment (Obj, Alignment (Etype (Obj))); end if; -- Now do the internal call that does all the work return Has_Compatible_Alignment_Internal (Obj, Expr, Layout_Done, Unknown); end Has_Compatible_Alignment; ---------------------- -- Has_Declarations -- ---------------------- function Has_Declarations (N : Node_Id) return Boolean is begin return Nkind_In (Nkind (N), N_Accept_Statement, N_Block_Statement, N_Compilation_Unit_Aux, N_Entry_Body, N_Package_Body, N_Protected_Body, N_Subprogram_Body, N_Task_Body, N_Package_Specification); end Has_Declarations; --------------------------------- -- Has_Defaulted_Discriminants -- --------------------------------- function Has_Defaulted_Discriminants (Typ : Entity_Id) return Boolean is begin return Has_Discriminants (Typ) and then Present (First_Discriminant (Typ)) and then Present (Discriminant_Default_Value (First_Discriminant (Typ))); end Has_Defaulted_Discriminants; ------------------- -- Has_Denormals -- ------------------- function Has_Denormals (E : Entity_Id) return Boolean is begin return Is_Floating_Point_Type (E) and then Denorm_On_Target; end Has_Denormals; ------------------------------------------- -- Has_Discriminant_Dependent_Constraint -- ------------------------------------------- function Has_Discriminant_Dependent_Constraint (Comp : Entity_Id) return Boolean is Comp_Decl : constant Node_Id := Parent (Comp); Subt_Indic : Node_Id; Constr : Node_Id; Assn : Node_Id; begin -- Discriminants can't depend on discriminants if Ekind (Comp) = E_Discriminant then return False; else Subt_Indic := Subtype_Indication (Component_Definition (Comp_Decl)); if Nkind (Subt_Indic) = N_Subtype_Indication then Constr := Constraint (Subt_Indic); if Nkind (Constr) = N_Index_Or_Discriminant_Constraint then Assn := First (Constraints (Constr)); while Present (Assn) loop case Nkind (Assn) is when N_Identifier | N_Range | N_Subtype_Indication => if Depends_On_Discriminant (Assn) then return True; end if; when N_Discriminant_Association => if Depends_On_Discriminant (Expression (Assn)) then return True; end if; when others => null; end case; Next (Assn); end loop; end if; end if; end if; return False; end Has_Discriminant_Dependent_Constraint; -------------------------------------- -- Has_Effectively_Volatile_Profile -- -------------------------------------- function Has_Effectively_Volatile_Profile (Subp_Id : Entity_Id) return Boolean is Formal : Entity_Id; begin -- Inspect the formal parameters looking for an effectively volatile -- type. Formal := First_Formal (Subp_Id); while Present (Formal) loop if Is_Effectively_Volatile (Etype (Formal)) then return True; end if; Next_Formal (Formal); end loop; -- Inspect the return type of functions if Ekind_In (Subp_Id, E_Function, E_Generic_Function) and then Is_Effectively_Volatile (Etype (Subp_Id)) then return True; end if; return False; end Has_Effectively_Volatile_Profile; -------------------------- -- Has_Enabled_Property -- -------------------------- function Has_Enabled_Property (Item_Id : Entity_Id; Property : Name_Id) return Boolean is function Protected_Object_Has_Enabled_Property return Boolean; -- Determine whether a protected object denoted by Item_Id has the -- property enabled. function State_Has_Enabled_Property return Boolean; -- Determine whether a state denoted by Item_Id has the property enabled function Variable_Has_Enabled_Property return Boolean; -- Determine whether a variable denoted by Item_Id has the property -- enabled. ------------------------------------------- -- Protected_Object_Has_Enabled_Property -- ------------------------------------------- function Protected_Object_Has_Enabled_Property return Boolean is Constits : constant Elist_Id := Part_Of_Constituents (Item_Id); Constit_Elmt : Elmt_Id; Constit_Id : Entity_Id; begin -- Protected objects always have the properties Async_Readers and -- Async_Writers (SPARK RM 7.1.2(16)). if Property = Name_Async_Readers or else Property = Name_Async_Writers then return True; -- Protected objects that have Part_Of components also inherit their -- properties Effective_Reads and Effective_Writes -- (SPARK RM 7.1.2(16)). elsif Present (Constits) then Constit_Elmt := First_Elmt (Constits); while Present (Constit_Elmt) loop Constit_Id := Node (Constit_Elmt); if Has_Enabled_Property (Constit_Id, Property) then return True; end if; Next_Elmt (Constit_Elmt); end loop; end if; return False; end Protected_Object_Has_Enabled_Property; -------------------------------- -- State_Has_Enabled_Property -- -------------------------------- function State_Has_Enabled_Property return Boolean is Decl : constant Node_Id := Parent (Item_Id); Opt : Node_Id; Opt_Nam : Node_Id; Prop : Node_Id; Prop_Nam : Node_Id; Props : Node_Id; begin -- The declaration of an external abstract state appears as an -- extension aggregate. If this is not the case, properties can never -- be set. if Nkind (Decl) /= N_Extension_Aggregate then return False; end if; -- When External appears as a simple option, it automatically enables -- all properties. Opt := First (Expressions (Decl)); while Present (Opt) loop if Nkind (Opt) = N_Identifier and then Chars (Opt) = Name_External then return True; end if; Next (Opt); end loop; -- When External specifies particular properties, inspect those and -- find the desired one (if any). Opt := First (Component_Associations (Decl)); while Present (Opt) loop Opt_Nam := First (Choices (Opt)); if Nkind (Opt_Nam) = N_Identifier and then Chars (Opt_Nam) = Name_External then Props := Expression (Opt); -- Multiple properties appear as an aggregate if Nkind (Props) = N_Aggregate then -- Simple property form Prop := First (Expressions (Props)); while Present (Prop) loop if Chars (Prop) = Property then return True; end if; Next (Prop); end loop; -- Property with expression form Prop := First (Component_Associations (Props)); while Present (Prop) loop Prop_Nam := First (Choices (Prop)); -- The property can be represented in two ways: -- others => <value> -- <property> => <value> if Nkind (Prop_Nam) = N_Others_Choice or else (Nkind (Prop_Nam) = N_Identifier and then Chars (Prop_Nam) = Property) then return Is_True (Expr_Value (Expression (Prop))); end if; Next (Prop); end loop; -- Single property else return Chars (Props) = Property; end if; end if; Next (Opt); end loop; return False; end State_Has_Enabled_Property; ----------------------------------- -- Variable_Has_Enabled_Property -- ----------------------------------- function Variable_Has_Enabled_Property return Boolean is function Is_Enabled (Prag : Node_Id) return Boolean; -- Determine whether property pragma Prag (if present) denotes an -- enabled property. ---------------- -- Is_Enabled -- ---------------- function Is_Enabled (Prag : Node_Id) return Boolean is Arg1 : Node_Id; begin if Present (Prag) then Arg1 := First (Pragma_Argument_Associations (Prag)); -- The pragma has an optional Boolean expression, the related -- property is enabled only when the expression evaluates to -- True. if Present (Arg1) then return Is_True (Expr_Value (Get_Pragma_Arg (Arg1))); -- Otherwise the lack of expression enables the property by -- default. else return True; end if; -- The property was never set in the first place else return False; end if; end Is_Enabled; -- Local variables AR : constant Node_Id := Get_Pragma (Item_Id, Pragma_Async_Readers); AW : constant Node_Id := Get_Pragma (Item_Id, Pragma_Async_Writers); ER : constant Node_Id := Get_Pragma (Item_Id, Pragma_Effective_Reads); EW : constant Node_Id := Get_Pragma (Item_Id, Pragma_Effective_Writes); -- Start of processing for Variable_Has_Enabled_Property begin -- A non-effectively volatile object can never possess external -- properties. if not Is_Effectively_Volatile (Item_Id) then return False; -- External properties related to variables come in two flavors - -- explicit and implicit. The explicit case is characterized by the -- presence of a property pragma with an optional Boolean flag. The -- property is enabled when the flag evaluates to True or the flag is -- missing altogether. elsif Property = Name_Async_Readers and then Is_Enabled (AR) then return True; elsif Property = Name_Async_Writers and then Is_Enabled (AW) then return True; elsif Property = Name_Effective_Reads and then Is_Enabled (ER) then return True; elsif Property = Name_Effective_Writes and then Is_Enabled (EW) then return True; -- The implicit case lacks all property pragmas elsif No (AR) and then No (AW) and then No (ER) and then No (EW) then if Is_Protected_Type (Etype (Item_Id)) then return Protected_Object_Has_Enabled_Property; else return True; end if; else return False; end if; end Variable_Has_Enabled_Property; -- Start of processing for Has_Enabled_Property begin -- Abstract states and variables have a flexible scheme of specifying -- external properties. if Ekind (Item_Id) = E_Abstract_State then return State_Has_Enabled_Property; elsif Ekind (Item_Id) = E_Variable then return Variable_Has_Enabled_Property; -- By default, protected objects only have the properties Async_Readers -- and Async_Writers. If they have Part_Of components, they also inherit -- their properties Effective_Reads and Effective_Writes -- (SPARK RM 7.1.2(16)). elsif Ekind (Item_Id) = E_Protected_Object then return Protected_Object_Has_Enabled_Property; -- Otherwise a property is enabled when the related item is effectively -- volatile. else return Is_Effectively_Volatile (Item_Id); end if; end Has_Enabled_Property; ------------------------------------- -- Has_Full_Default_Initialization -- ------------------------------------- function Has_Full_Default_Initialization (Typ : Entity_Id) return Boolean is Comp : Entity_Id; Prag : Node_Id; begin -- A type subject to pragma Default_Initial_Condition is fully default -- initialized when the pragma appears with a non-null argument. Since -- any type may act as the full view of a private type, this check must -- be performed prior to the specialized tests below. if Has_DIC (Typ) then Prag := Get_Pragma (Typ, Pragma_Default_Initial_Condition); pragma Assert (Present (Prag)); return Is_Verifiable_DIC_Pragma (Prag); end if; -- A scalar type is fully default initialized if it is subject to aspect -- Default_Value. if Is_Scalar_Type (Typ) then return Has_Default_Aspect (Typ); -- An array type is fully default initialized if its element type is -- scalar and the array type carries aspect Default_Component_Value or -- the element type is fully default initialized. elsif Is_Array_Type (Typ) then return Has_Default_Aspect (Typ) or else Has_Full_Default_Initialization (Component_Type (Typ)); -- A protected type, record type, or type extension is fully default -- initialized if all its components either carry an initialization -- expression or have a type that is fully default initialized. The -- parent type of a type extension must be fully default initialized. elsif Is_Record_Type (Typ) or else Is_Protected_Type (Typ) then -- Inspect all entities defined in the scope of the type, looking for -- uninitialized components. Comp := First_Entity (Typ); while Present (Comp) loop if Ekind (Comp) = E_Component and then Comes_From_Source (Comp) and then No (Expression (Parent (Comp))) and then not Has_Full_Default_Initialization (Etype (Comp)) then return False; end if; Next_Entity (Comp); end loop; -- Ensure that the parent type of a type extension is fully default -- initialized. if Etype (Typ) /= Typ and then not Has_Full_Default_Initialization (Etype (Typ)) then return False; end if; -- If we get here, then all components and parent portion are fully -- default initialized. return True; -- A task type is fully default initialized by default elsif Is_Task_Type (Typ) then return True; -- Otherwise the type is not fully default initialized else return False; end if; end Has_Full_Default_Initialization; -------------------- -- Has_Infinities -- -------------------- function Has_Infinities (E : Entity_Id) return Boolean is begin return Is_Floating_Point_Type (E) and then Nkind (Scalar_Range (E)) = N_Range and then Includes_Infinities (Scalar_Range (E)); end Has_Infinities; -------------------- -- Has_Interfaces -- -------------------- function Has_Interfaces (T : Entity_Id; Use_Full_View : Boolean := True) return Boolean is Typ : Entity_Id := Base_Type (T); begin -- Handle concurrent types if Is_Concurrent_Type (Typ) then Typ := Corresponding_Record_Type (Typ); end if; if not Present (Typ) or else not Is_Record_Type (Typ) or else not Is_Tagged_Type (Typ) then return False; end if; -- Handle private types if Use_Full_View and then Present (Full_View (Typ)) then Typ := Full_View (Typ); end if; -- Handle concurrent record types if Is_Concurrent_Record_Type (Typ) and then Is_Non_Empty_List (Abstract_Interface_List (Typ)) then return True; end if; loop if Is_Interface (Typ) or else (Is_Record_Type (Typ) and then Present (Interfaces (Typ)) and then not Is_Empty_Elmt_List (Interfaces (Typ))) then return True; end if; exit when Etype (Typ) = Typ -- Handle private types or else (Present (Full_View (Etype (Typ))) and then Full_View (Etype (Typ)) = Typ) -- Protect frontend against wrong sources with cyclic derivations or else Etype (Typ) = T; -- Climb to the ancestor type handling private types if Present (Full_View (Etype (Typ))) then Typ := Full_View (Etype (Typ)); else Typ := Etype (Typ); end if; end loop; return False; end Has_Interfaces; -------------------------- -- Has_Max_Queue_Length -- -------------------------- function Has_Max_Queue_Length (Id : Entity_Id) return Boolean is begin return Ekind (Id) = E_Entry and then Present (Get_Pragma (Id, Pragma_Max_Queue_Length)); end Has_Max_Queue_Length; --------------------------------- -- Has_No_Obvious_Side_Effects -- --------------------------------- function Has_No_Obvious_Side_Effects (N : Node_Id) return Boolean is begin -- For now handle literals, constants, and non-volatile variables and -- expressions combining these with operators or short circuit forms. if Nkind (N) in N_Numeric_Or_String_Literal then return True; elsif Nkind (N) = N_Character_Literal then return True; elsif Nkind (N) in N_Unary_Op then return Has_No_Obvious_Side_Effects (Right_Opnd (N)); elsif Nkind (N) in N_Binary_Op or else Nkind (N) in N_Short_Circuit then return Has_No_Obvious_Side_Effects (Left_Opnd (N)) and then Has_No_Obvious_Side_Effects (Right_Opnd (N)); elsif Nkind (N) = N_Expression_With_Actions and then Is_Empty_List (Actions (N)) then return Has_No_Obvious_Side_Effects (Expression (N)); elsif Nkind (N) in N_Has_Entity then return Present (Entity (N)) and then Ekind_In (Entity (N), E_Variable, E_Constant, E_Enumeration_Literal, E_In_Parameter, E_Out_Parameter, E_In_Out_Parameter) and then not Is_Volatile (Entity (N)); else return False; end if; end Has_No_Obvious_Side_Effects; ----------------------------- -- Has_Non_Null_Refinement -- ----------------------------- function Has_Non_Null_Refinement (Id : Entity_Id) return Boolean is Constits : Elist_Id; begin pragma Assert (Ekind (Id) = E_Abstract_State); Constits := Refinement_Constituents (Id); -- For a refinement to be non-null, the first constituent must be -- anything other than null. return Present (Constits) and then Nkind (Node (First_Elmt (Constits))) /= N_Null; end Has_Non_Null_Refinement; ------------------- -- Has_Null_Body -- ------------------- function Has_Null_Body (Proc_Id : Entity_Id) return Boolean is Body_Id : Entity_Id; Decl : Node_Id; Spec : Node_Id; Stmt1 : Node_Id; Stmt2 : Node_Id; begin Spec := Parent (Proc_Id); Decl := Parent (Spec); -- Retrieve the entity of the procedure body (e.g. invariant proc). if Nkind (Spec) = N_Procedure_Specification and then Nkind (Decl) = N_Subprogram_Declaration then Body_Id := Corresponding_Body (Decl); -- The body acts as a spec else Body_Id := Proc_Id; end if; -- The body will be generated later if No (Body_Id) then return False; end if; Spec := Parent (Body_Id); Decl := Parent (Spec); pragma Assert (Nkind (Spec) = N_Procedure_Specification and then Nkind (Decl) = N_Subprogram_Body); Stmt1 := First (Statements (Handled_Statement_Sequence (Decl))); -- Look for a null statement followed by an optional return -- statement. if Nkind (Stmt1) = N_Null_Statement then Stmt2 := Next (Stmt1); if Present (Stmt2) then return Nkind (Stmt2) = N_Simple_Return_Statement; else return True; end if; end if; return False; end Has_Null_Body; ------------------------ -- Has_Null_Exclusion -- ------------------------ function Has_Null_Exclusion (N : Node_Id) return Boolean is begin case Nkind (N) is when N_Access_Definition | N_Access_Function_Definition | N_Access_Procedure_Definition | N_Access_To_Object_Definition | N_Allocator | N_Derived_Type_Definition | N_Function_Specification | N_Subtype_Declaration => return Null_Exclusion_Present (N); when N_Component_Definition | N_Formal_Object_Declaration | N_Object_Renaming_Declaration => if Present (Subtype_Mark (N)) then return Null_Exclusion_Present (N); else pragma Assert (Present (Access_Definition (N))); return Null_Exclusion_Present (Access_Definition (N)); end if; when N_Discriminant_Specification => if Nkind (Discriminant_Type (N)) = N_Access_Definition then return Null_Exclusion_Present (Discriminant_Type (N)); else return Null_Exclusion_Present (N); end if; when N_Object_Declaration => if Nkind (Object_Definition (N)) = N_Access_Definition then return Null_Exclusion_Present (Object_Definition (N)); else return Null_Exclusion_Present (N); end if; when N_Parameter_Specification => if Nkind (Parameter_Type (N)) = N_Access_Definition then return Null_Exclusion_Present (Parameter_Type (N)); else return Null_Exclusion_Present (N); end if; when others => return False; end case; end Has_Null_Exclusion; ------------------------ -- Has_Null_Extension -- ------------------------ function Has_Null_Extension (T : Entity_Id) return Boolean is B : constant Entity_Id := Base_Type (T); Comps : Node_Id; Ext : Node_Id; begin if Nkind (Parent (B)) = N_Full_Type_Declaration and then Present (Record_Extension_Part (Type_Definition (Parent (B)))) then Ext := Record_Extension_Part (Type_Definition (Parent (B))); if Present (Ext) then if Null_Present (Ext) then return True; else Comps := Component_List (Ext); -- The null component list is rewritten during analysis to -- include the parent component. Any other component indicates -- that the extension was not originally null. return Null_Present (Comps) or else No (Next (First (Component_Items (Comps)))); end if; else return False; end if; else return False; end if; end Has_Null_Extension; ------------------------- -- Has_Null_Refinement -- ------------------------- function Has_Null_Refinement (Id : Entity_Id) return Boolean is Constits : Elist_Id; begin pragma Assert (Ekind (Id) = E_Abstract_State); Constits := Refinement_Constituents (Id); -- For a refinement to be null, the state's sole constituent must be a -- null. return Present (Constits) and then Nkind (Node (First_Elmt (Constits))) = N_Null; end Has_Null_Refinement; ------------------------------- -- Has_Overriding_Initialize -- ------------------------------- function Has_Overriding_Initialize (T : Entity_Id) return Boolean is BT : constant Entity_Id := Base_Type (T); P : Elmt_Id; begin if Is_Controlled (BT) then if Is_RTU (Scope (BT), Ada_Finalization) then return False; elsif Present (Primitive_Operations (BT)) then P := First_Elmt (Primitive_Operations (BT)); while Present (P) loop declare Init : constant Entity_Id := Node (P); Formal : constant Entity_Id := First_Formal (Init); begin if Ekind (Init) = E_Procedure and then Chars (Init) = Name_Initialize and then Comes_From_Source (Init) and then Present (Formal) and then Etype (Formal) = BT and then No (Next_Formal (Formal)) and then (Ada_Version < Ada_2012 or else not Null_Present (Parent (Init))) then return True; end if; end; Next_Elmt (P); end loop; end if; -- Here if type itself does not have a non-null Initialize operation: -- check immediate ancestor. if Is_Derived_Type (BT) and then Has_Overriding_Initialize (Etype (BT)) then return True; end if; end if; return False; end Has_Overriding_Initialize; -------------------------------------- -- Has_Preelaborable_Initialization -- -------------------------------------- function Has_Preelaborable_Initialization (E : Entity_Id) return Boolean is Has_PE : Boolean; procedure Check_Components (E : Entity_Id); -- Check component/discriminant chain, sets Has_PE False if a component -- or discriminant does not meet the preelaborable initialization rules. ---------------------- -- Check_Components -- ---------------------- procedure Check_Components (E : Entity_Id) is Ent : Entity_Id; Exp : Node_Id; function Is_Preelaborable_Expression (N : Node_Id) return Boolean; -- Returns True if and only if the expression denoted by N does not -- violate restrictions on preelaborable constructs (RM-10.2.1(5-9)). --------------------------------- -- Is_Preelaborable_Expression -- --------------------------------- function Is_Preelaborable_Expression (N : Node_Id) return Boolean is Exp : Node_Id; Assn : Node_Id; Choice : Node_Id; Comp_Type : Entity_Id; Is_Array_Aggr : Boolean; begin if Is_OK_Static_Expression (N) then return True; elsif Nkind (N) = N_Null then return True; -- Attributes are allowed in general, even if their prefix is a -- formal type. (It seems that certain attributes known not to be -- static might not be allowed, but there are no rules to prevent -- them.) elsif Nkind (N) = N_Attribute_Reference then return True; -- The name of a discriminant evaluated within its parent type is -- defined to be preelaborable (10.2.1(8)). Note that we test for -- names that denote discriminals as well as discriminants to -- catch references occurring within init procs. elsif Is_Entity_Name (N) and then (Ekind (Entity (N)) = E_Discriminant or else (Ekind_In (Entity (N), E_Constant, E_In_Parameter) and then Present (Discriminal_Link (Entity (N))))) then return True; elsif Nkind (N) = N_Qualified_Expression then return Is_Preelaborable_Expression (Expression (N)); -- For aggregates we have to check that each of the associations -- is preelaborable. elsif Nkind_In (N, N_Aggregate, N_Extension_Aggregate) then Is_Array_Aggr := Is_Array_Type (Etype (N)); if Is_Array_Aggr then Comp_Type := Component_Type (Etype (N)); end if; -- Check the ancestor part of extension aggregates, which must -- be either the name of a type that has preelaborable init or -- an expression that is preelaborable. if Nkind (N) = N_Extension_Aggregate then declare Anc_Part : constant Node_Id := Ancestor_Part (N); begin if Is_Entity_Name (Anc_Part) and then Is_Type (Entity (Anc_Part)) then if not Has_Preelaborable_Initialization (Entity (Anc_Part)) then return False; end if; elsif not Is_Preelaborable_Expression (Anc_Part) then return False; end if; end; end if; -- Check positional associations Exp := First (Expressions (N)); while Present (Exp) loop if not Is_Preelaborable_Expression (Exp) then return False; end if; Next (Exp); end loop; -- Check named associations Assn := First (Component_Associations (N)); while Present (Assn) loop Choice := First (Choices (Assn)); while Present (Choice) loop if Is_Array_Aggr then if Nkind (Choice) = N_Others_Choice then null; elsif Nkind (Choice) = N_Range then if not Is_OK_Static_Range (Choice) then return False; end if; elsif not Is_OK_Static_Expression (Choice) then return False; end if; else Comp_Type := Etype (Choice); end if; Next (Choice); end loop; -- If the association has a <> at this point, then we have -- to check whether the component's type has preelaborable -- initialization. Note that this only occurs when the -- association's corresponding component does not have a -- default expression, the latter case having already been -- expanded as an expression for the association. if Box_Present (Assn) then if not Has_Preelaborable_Initialization (Comp_Type) then return False; end if; -- In the expression case we check whether the expression -- is preelaborable. elsif not Is_Preelaborable_Expression (Expression (Assn)) then return False; end if; Next (Assn); end loop; -- If we get here then aggregate as a whole is preelaborable return True; -- All other cases are not preelaborable else return False; end if; end Is_Preelaborable_Expression; -- Start of processing for Check_Components begin -- Loop through entities of record or protected type Ent := E; while Present (Ent) loop -- We are interested only in components and discriminants Exp := Empty; case Ekind (Ent) is when E_Component => -- Get default expression if any. If there is no declaration -- node, it means we have an internal entity. The parent and -- tag fields are examples of such entities. For such cases, -- we just test the type of the entity. if Present (Declaration_Node (Ent)) then Exp := Expression (Declaration_Node (Ent)); end if; when E_Discriminant => -- Note: for a renamed discriminant, the Declaration_Node -- may point to the one from the ancestor, and have a -- different expression, so use the proper attribute to -- retrieve the expression from the derived constraint. Exp := Discriminant_Default_Value (Ent); when others => goto Check_Next_Entity; end case; -- A component has PI if it has no default expression and the -- component type has PI. if No (Exp) then if not Has_Preelaborable_Initialization (Etype (Ent)) then Has_PE := False; exit; end if; -- Require the default expression to be preelaborable elsif not Is_Preelaborable_Expression (Exp) then Has_PE := False; exit; end if; <<Check_Next_Entity>> Next_Entity (Ent); end loop; end Check_Components; -- Start of processing for Has_Preelaborable_Initialization begin -- Immediate return if already marked as known preelaborable init. This -- covers types for which this function has already been called once -- and returned True (in which case the result is cached), and also -- types to which a pragma Preelaborable_Initialization applies. if Known_To_Have_Preelab_Init (E) then return True; end if; -- If the type is a subtype representing a generic actual type, then -- test whether its base type has preelaborable initialization since -- the subtype representing the actual does not inherit this attribute -- from the actual or formal. (but maybe it should???) if Is_Generic_Actual_Type (E) then return Has_Preelaborable_Initialization (Base_Type (E)); end if; -- All elementary types have preelaborable initialization if Is_Elementary_Type (E) then Has_PE := True; -- Array types have PI if the component type has PI elsif Is_Array_Type (E) then Has_PE := Has_Preelaborable_Initialization (Component_Type (E)); -- A derived type has preelaborable initialization if its parent type -- has preelaborable initialization and (in the case of a derived record -- extension) if the non-inherited components all have preelaborable -- initialization. However, a user-defined controlled type with an -- overriding Initialize procedure does not have preelaborable -- initialization. elsif Is_Derived_Type (E) then -- If the derived type is a private extension then it doesn't have -- preelaborable initialization. if Ekind (Base_Type (E)) = E_Record_Type_With_Private then return False; end if; -- First check whether ancestor type has preelaborable initialization Has_PE := Has_Preelaborable_Initialization (Etype (Base_Type (E))); -- If OK, check extension components (if any) if Has_PE and then Is_Record_Type (E) then Check_Components (First_Entity (E)); end if; -- Check specifically for 10.2.1(11.4/2) exception: a controlled type -- with a user defined Initialize procedure does not have PI. If -- the type is untagged, the control primitives come from a component -- that has already been checked. if Has_PE and then Is_Controlled (E) and then Is_Tagged_Type (E) and then Has_Overriding_Initialize (E) then Has_PE := False; end if; -- Private types not derived from a type having preelaborable init and -- that are not marked with pragma Preelaborable_Initialization do not -- have preelaborable initialization. elsif Is_Private_Type (E) then return False; -- Record type has PI if it is non private and all components have PI elsif Is_Record_Type (E) then Has_PE := True; Check_Components (First_Entity (E)); -- Protected types must not have entries, and components must meet -- same set of rules as for record components. elsif Is_Protected_Type (E) then if Has_Entries (E) then Has_PE := False; else Has_PE := True; Check_Components (First_Entity (E)); Check_Components (First_Private_Entity (E)); end if; -- Type System.Address always has preelaborable initialization elsif Is_RTE (E, RE_Address) then Has_PE := True; -- In all other cases, type does not have preelaborable initialization else return False; end if; -- If type has preelaborable initialization, cache result if Has_PE then Set_Known_To_Have_Preelab_Init (E); end if; return Has_PE; end Has_Preelaborable_Initialization; --------------------------- -- Has_Private_Component -- --------------------------- function Has_Private_Component (Type_Id : Entity_Id) return Boolean is Btype : Entity_Id := Base_Type (Type_Id); Component : Entity_Id; begin if Error_Posted (Type_Id) or else Error_Posted (Btype) then return False; end if; if Is_Class_Wide_Type (Btype) then Btype := Root_Type (Btype); end if; if Is_Private_Type (Btype) then declare UT : constant Entity_Id := Underlying_Type (Btype); begin if No (UT) then if No (Full_View (Btype)) then return not Is_Generic_Type (Btype) and then not Is_Generic_Type (Root_Type (Btype)); else return not Is_Generic_Type (Root_Type (Full_View (Btype))); end if; else return not Is_Frozen (UT) and then Has_Private_Component (UT); end if; end; elsif Is_Array_Type (Btype) then return Has_Private_Component (Component_Type (Btype)); elsif Is_Record_Type (Btype) then Component := First_Component (Btype); while Present (Component) loop if Has_Private_Component (Etype (Component)) then return True; end if; Next_Component (Component); end loop; return False; elsif Is_Protected_Type (Btype) and then Present (Corresponding_Record_Type (Btype)) then return Has_Private_Component (Corresponding_Record_Type (Btype)); else return False; end if; end Has_Private_Component; ---------------------- -- Has_Signed_Zeros -- ---------------------- function Has_Signed_Zeros (E : Entity_Id) return Boolean is begin return Is_Floating_Point_Type (E) and then Signed_Zeros_On_Target; end Has_Signed_Zeros; ------------------------------ -- Has_Significant_Contract -- ------------------------------ function Has_Significant_Contract (Subp_Id : Entity_Id) return Boolean is Subp_Nam : constant Name_Id := Chars (Subp_Id); begin -- _Finalizer procedure if Subp_Nam = Name_uFinalizer then return False; -- _Postconditions procedure elsif Subp_Nam = Name_uPostconditions then return False; -- Predicate function elsif Ekind (Subp_Id) = E_Function and then Is_Predicate_Function (Subp_Id) then return False; -- TSS subprogram elsif Get_TSS_Name (Subp_Id) /= TSS_Null then return False; else return True; end if; end Has_Significant_Contract; ----------------------------- -- Has_Static_Array_Bounds -- ----------------------------- function Has_Static_Array_Bounds (Typ : Node_Id) return Boolean is Ndims : constant Nat := Number_Dimensions (Typ); Index : Node_Id; Low : Node_Id; High : Node_Id; begin -- Unconstrained types do not have static bounds if not Is_Constrained (Typ) then return False; end if; -- First treat string literals specially, as the lower bound and length -- of string literals are not stored like those of arrays. -- A string literal always has static bounds if Ekind (Typ) = E_String_Literal_Subtype then return True; end if; -- Treat all dimensions in turn Index := First_Index (Typ); for Indx in 1 .. Ndims loop -- In case of an illegal index which is not a discrete type, return -- that the type is not static. if not Is_Discrete_Type (Etype (Index)) or else Etype (Index) = Any_Type then return False; end if; Get_Index_Bounds (Index, Low, High); if Error_Posted (Low) or else Error_Posted (High) then return False; end if; if Is_OK_Static_Expression (Low) and then Is_OK_Static_Expression (High) then null; else return False; end if; Next (Index); end loop; -- If we fall through the loop, all indexes matched return True; end Has_Static_Array_Bounds; ---------------- -- Has_Stream -- ---------------- function Has_Stream (T : Entity_Id) return Boolean is E : Entity_Id; begin if No (T) then return False; elsif Is_RTE (Root_Type (T), RE_Root_Stream_Type) then return True; elsif Is_Array_Type (T) then return Has_Stream (Component_Type (T)); elsif Is_Record_Type (T) then E := First_Component (T); while Present (E) loop if Has_Stream (Etype (E)) then return True; else Next_Component (E); end if; end loop; return False; elsif Is_Private_Type (T) then return Has_Stream (Underlying_Type (T)); else return False; end if; end Has_Stream; ---------------- -- Has_Suffix -- ---------------- function Has_Suffix (E : Entity_Id; Suffix : Character) return Boolean is begin Get_Name_String (Chars (E)); return Name_Buffer (Name_Len) = Suffix; end Has_Suffix; ---------------- -- Add_Suffix -- ---------------- function Add_Suffix (E : Entity_Id; Suffix : Character) return Name_Id is begin Get_Name_String (Chars (E)); Add_Char_To_Name_Buffer (Suffix); return Name_Find; end Add_Suffix; ------------------- -- Remove_Suffix -- ------------------- function Remove_Suffix (E : Entity_Id; Suffix : Character) return Name_Id is begin pragma Assert (Has_Suffix (E, Suffix)); Get_Name_String (Chars (E)); Name_Len := Name_Len - 1; return Name_Find; end Remove_Suffix; ---------------------------------- -- Replace_Null_By_Null_Address -- ---------------------------------- procedure Replace_Null_By_Null_Address (N : Node_Id) is procedure Replace_Null_Operand (Op : Node_Id; Other_Op : Node_Id); -- Replace operand Op with a reference to Null_Address when the operand -- denotes a null Address. Other_Op denotes the other operand. -------------------------- -- Replace_Null_Operand -- -------------------------- procedure Replace_Null_Operand (Op : Node_Id; Other_Op : Node_Id) is begin -- Check the type of the complementary operand since the N_Null node -- has not been decorated yet. if Nkind (Op) = N_Null and then Is_Descendant_Of_Address (Etype (Other_Op)) then Rewrite (Op, New_Occurrence_Of (RTE (RE_Null_Address), Sloc (Op))); end if; end Replace_Null_Operand; -- Start of processing for Replace_Null_By_Null_Address begin pragma Assert (Relaxed_RM_Semantics); pragma Assert (Nkind_In (N, N_Null, N_Op_Eq, N_Op_Ge, N_Op_Gt, N_Op_Le, N_Op_Lt, N_Op_Ne)); if Nkind (N) = N_Null then Rewrite (N, New_Occurrence_Of (RTE (RE_Null_Address), Sloc (N))); else declare L : constant Node_Id := Left_Opnd (N); R : constant Node_Id := Right_Opnd (N); begin Replace_Null_Operand (L, Other_Op => R); Replace_Null_Operand (R, Other_Op => L); end; end if; end Replace_Null_By_Null_Address; -------------------------- -- Has_Tagged_Component -- -------------------------- function Has_Tagged_Component (Typ : Entity_Id) return Boolean is Comp : Entity_Id; begin if Is_Private_Type (Typ) and then Present (Underlying_Type (Typ)) then return Has_Tagged_Component (Underlying_Type (Typ)); elsif Is_Array_Type (Typ) then return Has_Tagged_Component (Component_Type (Typ)); elsif Is_Tagged_Type (Typ) then return True; elsif Is_Record_Type (Typ) then Comp := First_Component (Typ); while Present (Comp) loop if Has_Tagged_Component (Etype (Comp)) then return True; end if; Next_Component (Comp); end loop; return False; else return False; end if; end Has_Tagged_Component; ----------------------------- -- Has_Undefined_Reference -- ----------------------------- function Has_Undefined_Reference (Expr : Node_Id) return Boolean is Has_Undef_Ref : Boolean := False; -- Flag set when expression Expr contains at least one undefined -- reference. function Is_Undefined_Reference (N : Node_Id) return Traverse_Result; -- Determine whether N denotes a reference and if it does, whether it is -- undefined. ---------------------------- -- Is_Undefined_Reference -- ---------------------------- function Is_Undefined_Reference (N : Node_Id) return Traverse_Result is begin if Is_Entity_Name (N) and then Present (Entity (N)) and then Entity (N) = Any_Id then Has_Undef_Ref := True; return Abandon; end if; return OK; end Is_Undefined_Reference; procedure Find_Undefined_References is new Traverse_Proc (Is_Undefined_Reference); -- Start of processing for Has_Undefined_Reference begin Find_Undefined_References (Expr); return Has_Undef_Ref; end Has_Undefined_Reference; ---------------------------- -- Has_Volatile_Component -- ---------------------------- function Has_Volatile_Component (Typ : Entity_Id) return Boolean is Comp : Entity_Id; begin if Has_Volatile_Components (Typ) then return True; elsif Is_Array_Type (Typ) then return Is_Volatile (Component_Type (Typ)); elsif Is_Record_Type (Typ) then Comp := First_Component (Typ); while Present (Comp) loop if Is_Volatile_Object (Comp) then return True; end if; Comp := Next_Component (Comp); end loop; end if; return False; end Has_Volatile_Component; ------------------------- -- Implementation_Kind -- ------------------------- function Implementation_Kind (Subp : Entity_Id) return Name_Id is Impl_Prag : constant Node_Id := Get_Rep_Pragma (Subp, Name_Implemented); Arg : Node_Id; begin pragma Assert (Present (Impl_Prag)); Arg := Last (Pragma_Argument_Associations (Impl_Prag)); return Chars (Get_Pragma_Arg (Arg)); end Implementation_Kind; -------------------------- -- Implements_Interface -- -------------------------- function Implements_Interface (Typ_Ent : Entity_Id; Iface_Ent : Entity_Id; Exclude_Parents : Boolean := False) return Boolean is Ifaces_List : Elist_Id; Elmt : Elmt_Id; Iface : Entity_Id := Base_Type (Iface_Ent); Typ : Entity_Id := Base_Type (Typ_Ent); begin if Is_Class_Wide_Type (Typ) then Typ := Root_Type (Typ); end if; if not Has_Interfaces (Typ) then return False; end if; if Is_Class_Wide_Type (Iface) then Iface := Root_Type (Iface); end if; Collect_Interfaces (Typ, Ifaces_List); Elmt := First_Elmt (Ifaces_List); while Present (Elmt) loop if Is_Ancestor (Node (Elmt), Typ, Use_Full_View => True) and then Exclude_Parents then null; elsif Node (Elmt) = Iface then return True; end if; Next_Elmt (Elmt); end loop; return False; end Implements_Interface; ------------------------------------ -- In_Assertion_Expression_Pragma -- ------------------------------------ function In_Assertion_Expression_Pragma (N : Node_Id) return Boolean is Par : Node_Id; Prag : Node_Id := Empty; begin -- Climb the parent chain looking for an enclosing pragma Par := N; while Present (Par) loop if Nkind (Par) = N_Pragma then Prag := Par; exit; -- Precondition-like pragmas are expanded into if statements, check -- the original node instead. elsif Nkind (Original_Node (Par)) = N_Pragma then Prag := Original_Node (Par); exit; -- The expansion of attribute 'Old generates a constant to capture -- the result of the prefix. If the parent traversal reaches -- one of these constants, then the node technically came from a -- postcondition-like pragma. Note that the Ekind is not tested here -- because N may be the expression of an object declaration which is -- currently being analyzed. Such objects carry Ekind of E_Void. elsif Nkind (Par) = N_Object_Declaration and then Constant_Present (Par) and then Stores_Attribute_Old_Prefix (Defining_Entity (Par)) then return True; -- Prevent the search from going too far elsif Is_Body_Or_Package_Declaration (Par) then return False; end if; Par := Parent (Par); end loop; return Present (Prag) and then Assertion_Expression_Pragma (Get_Pragma_Id (Prag)); end In_Assertion_Expression_Pragma; ---------------------- -- In_Generic_Scope -- ---------------------- function In_Generic_Scope (E : Entity_Id) return Boolean is S : Entity_Id; begin S := Scope (E); while Present (S) and then S /= Standard_Standard loop if Is_Generic_Unit (S) then return True; end if; S := Scope (S); end loop; return False; end In_Generic_Scope; ----------------- -- In_Instance -- ----------------- function In_Instance return Boolean is Curr_Unit : constant Entity_Id := Cunit_Entity (Current_Sem_Unit); S : Entity_Id; begin S := Current_Scope; while Present (S) and then S /= Standard_Standard loop if Ekind_In (S, E_Function, E_Package, E_Procedure) and then Is_Generic_Instance (S) then -- A child instance is always compiled in the context of a parent -- instance. Nevertheless, the actuals are not analyzed in an -- instance context. We detect this case by examining the current -- compilation unit, which must be a child instance, and checking -- that it is not currently on the scope stack. if Is_Child_Unit (Curr_Unit) and then Nkind (Unit (Cunit (Current_Sem_Unit))) = N_Package_Instantiation and then not In_Open_Scopes (Curr_Unit) then return False; else return True; end if; end if; S := Scope (S); end loop; return False; end In_Instance; ---------------------- -- In_Instance_Body -- ---------------------- function In_Instance_Body return Boolean is S : Entity_Id; begin S := Current_Scope; while Present (S) and then S /= Standard_Standard loop if Ekind_In (S, E_Function, E_Procedure) and then Is_Generic_Instance (S) then return True; elsif Ekind (S) = E_Package and then In_Package_Body (S) and then Is_Generic_Instance (S) then return True; end if; S := Scope (S); end loop; return False; end In_Instance_Body; ----------------------------- -- In_Instance_Not_Visible -- ----------------------------- function In_Instance_Not_Visible return Boolean is S : Entity_Id; begin S := Current_Scope; while Present (S) and then S /= Standard_Standard loop if Ekind_In (S, E_Function, E_Procedure) and then Is_Generic_Instance (S) then return True; elsif Ekind (S) = E_Package and then (In_Package_Body (S) or else In_Private_Part (S)) and then Is_Generic_Instance (S) then return True; end if; S := Scope (S); end loop; return False; end In_Instance_Not_Visible; ------------------------------ -- In_Instance_Visible_Part -- ------------------------------ function In_Instance_Visible_Part return Boolean is S : Entity_Id; begin S := Current_Scope; while Present (S) and then S /= Standard_Standard loop if Ekind (S) = E_Package and then Is_Generic_Instance (S) and then not In_Package_Body (S) and then not In_Private_Part (S) then return True; end if; S := Scope (S); end loop; return False; end In_Instance_Visible_Part; --------------------- -- In_Package_Body -- --------------------- function In_Package_Body return Boolean is S : Entity_Id; begin S := Current_Scope; while Present (S) and then S /= Standard_Standard loop if Ekind (S) = E_Package and then In_Package_Body (S) then return True; else S := Scope (S); end if; end loop; return False; end In_Package_Body; -------------------------------- -- In_Parameter_Specification -- -------------------------------- function In_Parameter_Specification (N : Node_Id) return Boolean is PN : Node_Id; begin PN := Parent (N); while Present (PN) loop if Nkind (PN) = N_Parameter_Specification then return True; end if; PN := Parent (PN); end loop; return False; end In_Parameter_Specification; -------------------------- -- In_Pragma_Expression -- -------------------------- function In_Pragma_Expression (N : Node_Id; Nam : Name_Id) return Boolean is P : Node_Id; begin P := Parent (N); loop if No (P) then return False; elsif Nkind (P) = N_Pragma and then Pragma_Name (P) = Nam then return True; else P := Parent (P); end if; end loop; end In_Pragma_Expression; --------------------------- -- In_Pre_Post_Condition -- --------------------------- function In_Pre_Post_Condition (N : Node_Id) return Boolean is Par : Node_Id; Prag : Node_Id := Empty; Prag_Id : Pragma_Id; begin -- Climb the parent chain looking for an enclosing pragma Par := N; while Present (Par) loop if Nkind (Par) = N_Pragma then Prag := Par; exit; -- Prevent the search from going too far elsif Is_Body_Or_Package_Declaration (Par) then exit; end if; Par := Parent (Par); end loop; if Present (Prag) then Prag_Id := Get_Pragma_Id (Prag); return Prag_Id = Pragma_Post or else Prag_Id = Pragma_Post_Class or else Prag_Id = Pragma_Postcondition or else Prag_Id = Pragma_Pre or else Prag_Id = Pragma_Pre_Class or else Prag_Id = Pragma_Precondition; -- Otherwise the node is not enclosed by a pre/postcondition pragma else return False; end if; end In_Pre_Post_Condition; ------------------------------------- -- In_Reverse_Storage_Order_Object -- ------------------------------------- function In_Reverse_Storage_Order_Object (N : Node_Id) return Boolean is Pref : Node_Id; Btyp : Entity_Id := Empty; begin -- Climb up indexed components Pref := N; loop case Nkind (Pref) is when N_Selected_Component => Pref := Prefix (Pref); exit; when N_Indexed_Component => Pref := Prefix (Pref); when others => Pref := Empty; exit; end case; end loop; if Present (Pref) then Btyp := Base_Type (Etype (Pref)); end if; return Present (Btyp) and then (Is_Record_Type (Btyp) or else Is_Array_Type (Btyp)) and then Reverse_Storage_Order (Btyp); end In_Reverse_Storage_Order_Object; -------------------------------------- -- In_Subprogram_Or_Concurrent_Unit -- -------------------------------------- function In_Subprogram_Or_Concurrent_Unit return Boolean is E : Entity_Id; K : Entity_Kind; begin -- Use scope chain to check successively outer scopes E := Current_Scope; loop K := Ekind (E); if K in Subprogram_Kind or else K in Concurrent_Kind or else K in Generic_Subprogram_Kind then return True; elsif E = Standard_Standard then return False; end if; E := Scope (E); end loop; end In_Subprogram_Or_Concurrent_Unit; --------------------- -- In_Visible_Part -- --------------------- function In_Visible_Part (Scope_Id : Entity_Id) return Boolean is begin return Is_Package_Or_Generic_Package (Scope_Id) and then In_Open_Scopes (Scope_Id) and then not In_Package_Body (Scope_Id) and then not In_Private_Part (Scope_Id); end In_Visible_Part; -------------------------------- -- Incomplete_Or_Partial_View -- -------------------------------- function Incomplete_Or_Partial_View (Id : Entity_Id) return Entity_Id is function Inspect_Decls (Decls : List_Id; Taft : Boolean := False) return Entity_Id; -- Check whether a declarative region contains the incomplete or partial -- view of Id. ------------------- -- Inspect_Decls -- ------------------- function Inspect_Decls (Decls : List_Id; Taft : Boolean := False) return Entity_Id is Decl : Node_Id; Match : Node_Id; begin Decl := First (Decls); while Present (Decl) loop Match := Empty; -- The partial view of a Taft-amendment type is an incomplete -- type. if Taft then if Nkind (Decl) = N_Incomplete_Type_Declaration then Match := Defining_Identifier (Decl); end if; -- Otherwise look for a private type whose full view matches the -- input type. Note that this checks full_type_declaration nodes -- to account for derivations from a private type where the type -- declaration hold the partial view and the full view is an -- itype. elsif Nkind_In (Decl, N_Full_Type_Declaration, N_Private_Extension_Declaration, N_Private_Type_Declaration) then Match := Defining_Identifier (Decl); end if; -- Guard against unanalyzed entities if Present (Match) and then Is_Type (Match) and then Present (Full_View (Match)) and then Full_View (Match) = Id then return Match; end if; Next (Decl); end loop; return Empty; end Inspect_Decls; -- Local variables Prev : Entity_Id; -- Start of processing for Incomplete_Or_Partial_View begin -- Deferred constant or incomplete type case Prev := Current_Entity_In_Scope (Id); if Present (Prev) and then (Is_Incomplete_Type (Prev) or else Ekind (Prev) = E_Constant) and then Present (Full_View (Prev)) and then Full_View (Prev) = Id then return Prev; end if; -- Private or Taft amendment type case declare Pkg : constant Entity_Id := Scope (Id); Pkg_Decl : Node_Id := Pkg; begin if Present (Pkg) and then Ekind_In (Pkg, E_Generic_Package, E_Package) then while Nkind (Pkg_Decl) /= N_Package_Specification loop Pkg_Decl := Parent (Pkg_Decl); end loop; -- It is knows that Typ has a private view, look for it in the -- visible declarations of the enclosing scope. A special case -- of this is when the two views have been exchanged - the full -- appears earlier than the private. if Has_Private_Declaration (Id) then Prev := Inspect_Decls (Visible_Declarations (Pkg_Decl)); -- Exchanged view case, look in the private declarations if No (Prev) then Prev := Inspect_Decls (Private_Declarations (Pkg_Decl)); end if; return Prev; -- Otherwise if this is the package body, then Typ is a potential -- Taft amendment type. The incomplete view should be located in -- the private declarations of the enclosing scope. elsif In_Package_Body (Pkg) then return Inspect_Decls (Private_Declarations (Pkg_Decl), True); end if; end if; end; -- The type has no incomplete or private view return Empty; end Incomplete_Or_Partial_View; ---------------------------------- -- Indexed_Component_Bit_Offset -- ---------------------------------- function Indexed_Component_Bit_Offset (N : Node_Id) return Uint is Exp : constant Node_Id := First (Expressions (N)); Typ : constant Entity_Id := Etype (Prefix (N)); Off : constant Uint := Component_Size (Typ); Ind : Node_Id; begin -- Return early if the component size is not known or variable if Off = No_Uint or else Off < Uint_0 then return No_Uint; end if; -- Deal with the degenerate case of an empty component if Off = Uint_0 then return Off; end if; -- Check that both the index value and the low bound are known if not Compile_Time_Known_Value (Exp) then return No_Uint; end if; Ind := First_Index (Typ); if No (Ind) then return No_Uint; end if; if Nkind (Ind) = N_Subtype_Indication then Ind := Constraint (Ind); if Nkind (Ind) = N_Range_Constraint then Ind := Range_Expression (Ind); end if; end if; if Nkind (Ind) /= N_Range or else not Compile_Time_Known_Value (Low_Bound (Ind)) then return No_Uint; end if; -- Return the scaled offset return Off * (Expr_Value (Exp) - Expr_Value (Low_Bound ((Ind)))); end Indexed_Component_Bit_Offset; ---------------------------- -- Inherit_Rep_Item_Chain -- ---------------------------- procedure Inherit_Rep_Item_Chain (Typ : Entity_Id; From_Typ : Entity_Id) is Item : Node_Id; Next_Item : Node_Id; begin -- There are several inheritance scenarios to consider depending on -- whether both types have rep item chains and whether the destination -- type already inherits part of the source type's rep item chain. -- 1) The source type lacks a rep item chain -- From_Typ ---> Empty -- -- Typ --------> Item (or Empty) -- In this case inheritance cannot take place because there are no items -- to inherit. -- 2) The destination type lacks a rep item chain -- From_Typ ---> Item ---> ... -- -- Typ --------> Empty -- Inheritance takes place by setting the First_Rep_Item of the -- destination type to the First_Rep_Item of the source type. -- From_Typ ---> Item ---> ... -- ^ -- Typ -----------+ -- 3.1) Both source and destination types have at least one rep item. -- The destination type does NOT inherit a rep item from the source -- type. -- From_Typ ---> Item ---> Item -- -- Typ --------> Item ---> Item -- Inheritance takes place by setting the Next_Rep_Item of the last item -- of the destination type to the First_Rep_Item of the source type. -- From_Typ -------------------> Item ---> Item -- ^ -- Typ --------> Item ---> Item --+ -- 3.2) Both source and destination types have at least one rep item. -- The destination type DOES inherit part of the rep item chain of the -- source type. -- From_Typ ---> Item ---> Item ---> Item -- ^ -- Typ --------> Item ------+ -- This rare case arises when the full view of a private extension must -- inherit the rep item chain from the full view of its parent type and -- the full view of the parent type contains extra rep items. Currently -- only invariants may lead to such form of inheritance. -- type From_Typ is tagged private -- with Type_Invariant'Class => Item_2; -- type Typ is new From_Typ with private -- with Type_Invariant => Item_4; -- At this point the rep item chains contain the following items -- From_Typ -----------> Item_2 ---> Item_3 -- ^ -- Typ --------> Item_4 --+ -- The full views of both types may introduce extra invariants -- type From_Typ is tagged null record -- with Type_Invariant => Item_1; -- type Typ is new From_Typ with null record; -- The full view of Typ would have to inherit any new rep items added to -- the full view of From_Typ. -- From_Typ -----------> Item_1 ---> Item_2 ---> Item_3 -- ^ -- Typ --------> Item_4 --+ -- To achieve this form of inheritance, the destination type must first -- sever the link between its own rep chain and that of the source type, -- then inheritance 3.1 takes place. -- Case 1: The source type lacks a rep item chain if No (First_Rep_Item (From_Typ)) then return; -- Case 2: The destination type lacks a rep item chain elsif No (First_Rep_Item (Typ)) then Set_First_Rep_Item (Typ, First_Rep_Item (From_Typ)); -- Case 3: Both the source and destination types have at least one rep -- item. Traverse the rep item chain of the destination type to find the -- last rep item. else Item := Empty; Next_Item := First_Rep_Item (Typ); while Present (Next_Item) loop -- Detect a link between the destination type's rep chain and that -- of the source type. There are two possibilities: -- Variant 1 -- Next_Item -- V -- From_Typ ---> Item_1 ---> -- ^ -- Typ -----------+ -- -- Item is Empty -- Variant 2 -- Next_Item -- V -- From_Typ ---> Item_1 ---> Item_2 ---> -- ^ -- Typ --------> Item_3 ------+ -- ^ -- Item if Has_Rep_Item (From_Typ, Next_Item) then exit; end if; Item := Next_Item; Next_Item := Next_Rep_Item (Next_Item); end loop; -- Inherit the source type's rep item chain if Present (Item) then Set_Next_Rep_Item (Item, First_Rep_Item (From_Typ)); else Set_First_Rep_Item (Typ, First_Rep_Item (From_Typ)); end if; end if; end Inherit_Rep_Item_Chain; --------------------------------- -- Insert_Explicit_Dereference -- --------------------------------- procedure Insert_Explicit_Dereference (N : Node_Id) is New_Prefix : constant Node_Id := Relocate_Node (N); Ent : Entity_Id := Empty; Pref : Node_Id; I : Interp_Index; It : Interp; T : Entity_Id; begin Save_Interps (N, New_Prefix); Rewrite (N, Make_Explicit_Dereference (Sloc (Parent (N)), Prefix => New_Prefix)); Set_Etype (N, Designated_Type (Etype (New_Prefix))); if Is_Overloaded (New_Prefix) then -- The dereference is also overloaded, and its interpretations are -- the designated types of the interpretations of the original node. Set_Etype (N, Any_Type); Get_First_Interp (New_Prefix, I, It); while Present (It.Nam) loop T := It.Typ; if Is_Access_Type (T) then Add_One_Interp (N, Designated_Type (T), Designated_Type (T)); end if; Get_Next_Interp (I, It); end loop; End_Interp_List; else -- Prefix is unambiguous: mark the original prefix (which might -- Come_From_Source) as a reference, since the new (relocated) one -- won't be taken into account. if Is_Entity_Name (New_Prefix) then Ent := Entity (New_Prefix); Pref := New_Prefix; -- For a retrieval of a subcomponent of some composite object, -- retrieve the ultimate entity if there is one. elsif Nkind_In (New_Prefix, N_Selected_Component, N_Indexed_Component) then Pref := Prefix (New_Prefix); while Present (Pref) and then Nkind_In (Pref, N_Selected_Component, N_Indexed_Component) loop Pref := Prefix (Pref); end loop; if Present (Pref) and then Is_Entity_Name (Pref) then Ent := Entity (Pref); end if; end if; -- Place the reference on the entity node if Present (Ent) then Generate_Reference (Ent, Pref); end if; end if; end Insert_Explicit_Dereference; ------------------------------------------ -- Inspect_Deferred_Constant_Completion -- ------------------------------------------ procedure Inspect_Deferred_Constant_Completion (Decls : List_Id) is Decl : Node_Id; begin Decl := First (Decls); while Present (Decl) loop -- Deferred constant signature if Nkind (Decl) = N_Object_Declaration and then Constant_Present (Decl) and then No (Expression (Decl)) -- No need to check internally generated constants and then Comes_From_Source (Decl) -- The constant is not completed. A full object declaration or a -- pragma Import complete a deferred constant. and then not Has_Completion (Defining_Identifier (Decl)) then Error_Msg_N ("constant declaration requires initialization expression", Defining_Identifier (Decl)); end if; Decl := Next (Decl); end loop; end Inspect_Deferred_Constant_Completion; ----------------------------- -- Install_Generic_Formals -- ----------------------------- procedure Install_Generic_Formals (Subp_Id : Entity_Id) is E : Entity_Id; begin pragma Assert (Is_Generic_Subprogram (Subp_Id)); E := First_Entity (Subp_Id); while Present (E) loop Install_Entity (E); Next_Entity (E); end loop; end Install_Generic_Formals; ----------------------------- -- Is_Actual_Out_Parameter -- ----------------------------- function Is_Actual_Out_Parameter (N : Node_Id) return Boolean is Formal : Entity_Id; Call : Node_Id; begin Find_Actual (N, Formal, Call); return Present (Formal) and then Ekind (Formal) = E_Out_Parameter; end Is_Actual_Out_Parameter; ------------------------- -- Is_Actual_Parameter -- ------------------------- function Is_Actual_Parameter (N : Node_Id) return Boolean is PK : constant Node_Kind := Nkind (Parent (N)); begin case PK is when N_Parameter_Association => return N = Explicit_Actual_Parameter (Parent (N)); when N_Subprogram_Call => return Is_List_Member (N) and then List_Containing (N) = Parameter_Associations (Parent (N)); when others => return False; end case; end Is_Actual_Parameter; -------------------------------- -- Is_Actual_Tagged_Parameter -- -------------------------------- function Is_Actual_Tagged_Parameter (N : Node_Id) return Boolean is Formal : Entity_Id; Call : Node_Id; begin Find_Actual (N, Formal, Call); return Present (Formal) and then Is_Tagged_Type (Etype (Formal)); end Is_Actual_Tagged_Parameter; --------------------- -- Is_Aliased_View -- --------------------- function Is_Aliased_View (Obj : Node_Id) return Boolean is E : Entity_Id; begin if Is_Entity_Name (Obj) then E := Entity (Obj); return (Is_Object (E) and then (Is_Aliased (E) or else (Present (Renamed_Object (E)) and then Is_Aliased_View (Renamed_Object (E))))) or else ((Is_Formal (E) or else Ekind_In (E, E_Generic_In_Out_Parameter, E_Generic_In_Parameter)) and then Is_Tagged_Type (Etype (E))) or else (Is_Concurrent_Type (E) and then In_Open_Scopes (E)) -- Current instance of type, either directly or as rewritten -- reference to the current object. or else (Is_Entity_Name (Original_Node (Obj)) and then Present (Entity (Original_Node (Obj))) and then Is_Type (Entity (Original_Node (Obj)))) or else (Is_Type (E) and then E = Current_Scope) or else (Is_Incomplete_Or_Private_Type (E) and then Full_View (E) = Current_Scope) -- Ada 2012 AI05-0053: the return object of an extended return -- statement is aliased if its type is immutably limited. or else (Is_Return_Object (E) and then Is_Limited_View (Etype (E))); elsif Nkind (Obj) = N_Selected_Component then return Is_Aliased (Entity (Selector_Name (Obj))); elsif Nkind (Obj) = N_Indexed_Component then return Has_Aliased_Components (Etype (Prefix (Obj))) or else (Is_Access_Type (Etype (Prefix (Obj))) and then Has_Aliased_Components (Designated_Type (Etype (Prefix (Obj))))); elsif Nkind_In (Obj, N_Unchecked_Type_Conversion, N_Type_Conversion) then return Is_Tagged_Type (Etype (Obj)) and then Is_Aliased_View (Expression (Obj)); elsif Nkind (Obj) = N_Explicit_Dereference then return Nkind (Original_Node (Obj)) /= N_Function_Call; else return False; end if; end Is_Aliased_View; ------------------------- -- Is_Ancestor_Package -- ------------------------- function Is_Ancestor_Package (E1 : Entity_Id; E2 : Entity_Id) return Boolean is Par : Entity_Id; begin Par := E2; while Present (Par) and then Par /= Standard_Standard loop if Par = E1 then return True; end if; Par := Scope (Par); end loop; return False; end Is_Ancestor_Package; ---------------------- -- Is_Atomic_Object -- ---------------------- function Is_Atomic_Object (N : Node_Id) return Boolean is function Object_Has_Atomic_Components (N : Node_Id) return Boolean; -- Determines if given object has atomic components function Is_Atomic_Prefix (N : Node_Id) return Boolean; -- If prefix is an implicit dereference, examine designated type ---------------------- -- Is_Atomic_Prefix -- ---------------------- function Is_Atomic_Prefix (N : Node_Id) return Boolean is begin if Is_Access_Type (Etype (N)) then return Has_Atomic_Components (Designated_Type (Etype (N))); else return Object_Has_Atomic_Components (N); end if; end Is_Atomic_Prefix; ---------------------------------- -- Object_Has_Atomic_Components -- ---------------------------------- function Object_Has_Atomic_Components (N : Node_Id) return Boolean is begin if Has_Atomic_Components (Etype (N)) or else Is_Atomic (Etype (N)) then return True; elsif Is_Entity_Name (N) and then (Has_Atomic_Components (Entity (N)) or else Is_Atomic (Entity (N))) then return True; elsif Nkind (N) = N_Selected_Component and then Is_Atomic (Entity (Selector_Name (N))) then return True; elsif Nkind (N) = N_Indexed_Component or else Nkind (N) = N_Selected_Component then return Is_Atomic_Prefix (Prefix (N)); else return False; end if; end Object_Has_Atomic_Components; -- Start of processing for Is_Atomic_Object begin -- Predicate is not relevant to subprograms if Is_Entity_Name (N) and then Is_Overloadable (Entity (N)) then return False; elsif Is_Atomic (Etype (N)) or else (Is_Entity_Name (N) and then Is_Atomic (Entity (N))) then return True; elsif Nkind (N) = N_Selected_Component and then Is_Atomic (Entity (Selector_Name (N))) then return True; elsif Nkind (N) = N_Indexed_Component or else Nkind (N) = N_Selected_Component then return Is_Atomic_Prefix (Prefix (N)); else return False; end if; end Is_Atomic_Object; ----------------------------- -- Is_Atomic_Or_VFA_Object -- ----------------------------- function Is_Atomic_Or_VFA_Object (N : Node_Id) return Boolean is begin return Is_Atomic_Object (N) or else (Is_Object_Reference (N) and then Is_Entity_Name (N) and then (Is_Volatile_Full_Access (Entity (N)) or else Is_Volatile_Full_Access (Etype (Entity (N))))); end Is_Atomic_Or_VFA_Object; ------------------------- -- Is_Attribute_Result -- ------------------------- function Is_Attribute_Result (N : Node_Id) return Boolean is begin return Nkind (N) = N_Attribute_Reference and then Attribute_Name (N) = Name_Result; end Is_Attribute_Result; ------------------------- -- Is_Attribute_Update -- ------------------------- function Is_Attribute_Update (N : Node_Id) return Boolean is begin return Nkind (N) = N_Attribute_Reference and then Attribute_Name (N) = Name_Update; end Is_Attribute_Update; ------------------------------------ -- Is_Body_Or_Package_Declaration -- ------------------------------------ function Is_Body_Or_Package_Declaration (N : Node_Id) return Boolean is begin return Nkind_In (N, N_Entry_Body, N_Package_Body, N_Package_Declaration, N_Protected_Body, N_Subprogram_Body, N_Task_Body); end Is_Body_Or_Package_Declaration; ----------------------- -- Is_Bounded_String -- ----------------------- function Is_Bounded_String (T : Entity_Id) return Boolean is Under : constant Entity_Id := Underlying_Type (Root_Type (T)); begin -- Check whether T is ultimately derived from Ada.Strings.Superbounded. -- Super_String, or one of the [Wide_]Wide_ versions. This will -- be True for all the Bounded_String types in instances of the -- Generic_Bounded_Length generics, and for types derived from those. return Present (Under) and then (Is_RTE (Root_Type (Under), RO_SU_Super_String) or else Is_RTE (Root_Type (Under), RO_WI_Super_String) or else Is_RTE (Root_Type (Under), RO_WW_Super_String)); end Is_Bounded_String; ------------------------- -- Is_Child_Or_Sibling -- ------------------------- function Is_Child_Or_Sibling (Pack_1 : Entity_Id; Pack_2 : Entity_Id) return Boolean is function Distance_From_Standard (Pack : Entity_Id) return Nat; -- Given an arbitrary package, return the number of "climbs" necessary -- to reach scope Standard_Standard. procedure Equalize_Depths (Pack : in out Entity_Id; Depth : in out Nat; Depth_To_Reach : Nat); -- Given an arbitrary package, its depth and a target depth to reach, -- climb the scope chain until the said depth is reached. The pointer -- to the package and its depth a modified during the climb. ---------------------------- -- Distance_From_Standard -- ---------------------------- function Distance_From_Standard (Pack : Entity_Id) return Nat is Dist : Nat; Scop : Entity_Id; begin Dist := 0; Scop := Pack; while Present (Scop) and then Scop /= Standard_Standard loop Dist := Dist + 1; Scop := Scope (Scop); end loop; return Dist; end Distance_From_Standard; --------------------- -- Equalize_Depths -- --------------------- procedure Equalize_Depths (Pack : in out Entity_Id; Depth : in out Nat; Depth_To_Reach : Nat) is begin -- The package must be at a greater or equal depth if Depth < Depth_To_Reach then raise Program_Error; end if; -- Climb the scope chain until the desired depth is reached while Present (Pack) and then Depth /= Depth_To_Reach loop Pack := Scope (Pack); Depth := Depth - 1; end loop; end Equalize_Depths; -- Local variables P_1 : Entity_Id := Pack_1; P_1_Child : Boolean := False; P_1_Depth : Nat := Distance_From_Standard (P_1); P_2 : Entity_Id := Pack_2; P_2_Child : Boolean := False; P_2_Depth : Nat := Distance_From_Standard (P_2); -- Start of processing for Is_Child_Or_Sibling begin pragma Assert (Ekind (Pack_1) = E_Package and then Ekind (Pack_2) = E_Package); -- Both packages denote the same entity, therefore they cannot be -- children or siblings. if P_1 = P_2 then return False; -- One of the packages is at a deeper level than the other. Note that -- both may still come from differen hierarchies. -- (root) P_2 -- / \ : -- X P_2 or X -- : : -- P_1 P_1 elsif P_1_Depth > P_2_Depth then Equalize_Depths (Pack => P_1, Depth => P_1_Depth, Depth_To_Reach => P_2_Depth); P_1_Child := True; -- (root) P_1 -- / \ : -- P_1 X or X -- : : -- P_2 P_2 elsif P_2_Depth > P_1_Depth then Equalize_Depths (Pack => P_2, Depth => P_2_Depth, Depth_To_Reach => P_1_Depth); P_2_Child := True; end if; -- At this stage the package pointers have been elevated to the same -- depth. If the related entities are the same, then one package is a -- potential child of the other: -- P_1 -- : -- X became P_1 P_2 or vica versa -- : -- P_2 if P_1 = P_2 then if P_1_Child then return Is_Child_Unit (Pack_1); else pragma Assert (P_2_Child); return Is_Child_Unit (Pack_2); end if; -- The packages may come from the same package chain or from entirely -- different hierarcies. To determine this, climb the scope stack until -- a common root is found. -- (root) (root 1) (root 2) -- / \ | | -- P_1 P_2 P_1 P_2 else while Present (P_1) and then Present (P_2) loop -- The two packages may be siblings if P_1 = P_2 then return Is_Child_Unit (Pack_1) and then Is_Child_Unit (Pack_2); end if; P_1 := Scope (P_1); P_2 := Scope (P_2); end loop; end if; return False; end Is_Child_Or_Sibling; ----------------------------- -- Is_Concurrent_Interface -- ----------------------------- function Is_Concurrent_Interface (T : Entity_Id) return Boolean is begin return Is_Interface (T) and then (Is_Protected_Interface (T) or else Is_Synchronized_Interface (T) or else Is_Task_Interface (T)); end Is_Concurrent_Interface; ----------------------- -- Is_Constant_Bound -- ----------------------- function Is_Constant_Bound (Exp : Node_Id) return Boolean is begin if Compile_Time_Known_Value (Exp) then return True; elsif Is_Entity_Name (Exp) and then Present (Entity (Exp)) then return Is_Constant_Object (Entity (Exp)) or else Ekind (Entity (Exp)) = E_Enumeration_Literal; elsif Nkind (Exp) in N_Binary_Op then return Is_Constant_Bound (Left_Opnd (Exp)) and then Is_Constant_Bound (Right_Opnd (Exp)) and then Scope (Entity (Exp)) = Standard_Standard; else return False; end if; end Is_Constant_Bound; --------------------------- -- Is_Container_Element -- --------------------------- function Is_Container_Element (Exp : Node_Id) return Boolean is Loc : constant Source_Ptr := Sloc (Exp); Pref : constant Node_Id := Prefix (Exp); Call : Node_Id; -- Call to an indexing aspect Cont_Typ : Entity_Id; -- The type of the container being accessed Elem_Typ : Entity_Id; -- Its element type Indexing : Entity_Id; Is_Const : Boolean; -- Indicates that constant indexing is used, and the element is thus -- a constant. Ref_Typ : Entity_Id; -- The reference type returned by the indexing operation begin -- If C is a container, in a context that imposes the element type of -- that container, the indexing notation C (X) is rewritten as: -- Indexing (C, X).Discr.all -- where Indexing is one of the indexing aspects of the container. -- If the context does not require a reference, the construct can be -- rewritten as -- Element (C, X) -- First, verify that the construct has the proper form if not Expander_Active then return False; elsif Nkind (Pref) /= N_Selected_Component then return False; elsif Nkind (Prefix (Pref)) /= N_Function_Call then return False; else Call := Prefix (Pref); Ref_Typ := Etype (Call); end if; if not Has_Implicit_Dereference (Ref_Typ) or else No (First (Parameter_Associations (Call))) or else not Is_Entity_Name (Name (Call)) then return False; end if; -- Retrieve type of container object, and its iterator aspects Cont_Typ := Etype (First (Parameter_Associations (Call))); Indexing := Find_Value_Of_Aspect (Cont_Typ, Aspect_Constant_Indexing); Is_Const := False; if No (Indexing) then -- Container should have at least one indexing operation return False; elsif Entity (Name (Call)) /= Entity (Indexing) then -- This may be a variable indexing operation Indexing := Find_Value_Of_Aspect (Cont_Typ, Aspect_Variable_Indexing); if No (Indexing) or else Entity (Name (Call)) /= Entity (Indexing) then return False; end if; else Is_Const := True; end if; Elem_Typ := Find_Value_Of_Aspect (Cont_Typ, Aspect_Iterator_Element); if No (Elem_Typ) or else Entity (Elem_Typ) /= Etype (Exp) then return False; end if; -- Check that the expression is not the target of an assignment, in -- which case the rewriting is not possible. if not Is_Const then declare Par : Node_Id; begin Par := Exp; while Present (Par) loop if Nkind (Parent (Par)) = N_Assignment_Statement and then Par = Name (Parent (Par)) then return False; -- A renaming produces a reference, and the transformation -- does not apply. elsif Nkind (Parent (Par)) = N_Object_Renaming_Declaration then return False; elsif Nkind_In (Nkind (Parent (Par)), N_Function_Call, N_Procedure_Call_Statement, N_Entry_Call_Statement) then -- Check that the element is not part of an actual for an -- in-out parameter. declare F : Entity_Id; A : Node_Id; begin F := First_Formal (Entity (Name (Parent (Par)))); A := First (Parameter_Associations (Parent (Par))); while Present (F) loop if A = Par and then Ekind (F) /= E_In_Parameter then return False; end if; Next_Formal (F); Next (A); end loop; end; -- E_In_Parameter in a call: element is not modified. exit; end if; Par := Parent (Par); end loop; end; end if; -- The expression has the proper form and the context requires the -- element type. Retrieve the Element function of the container and -- rewrite the construct as a call to it. declare Op : Elmt_Id; begin Op := First_Elmt (Primitive_Operations (Cont_Typ)); while Present (Op) loop exit when Chars (Node (Op)) = Name_Element; Next_Elmt (Op); end loop; if No (Op) then return False; else Rewrite (Exp, Make_Function_Call (Loc, Name => New_Occurrence_Of (Node (Op), Loc), Parameter_Associations => Parameter_Associations (Call))); Analyze_And_Resolve (Exp, Entity (Elem_Typ)); return True; end if; end; end Is_Container_Element; ---------------------------- -- Is_Contract_Annotation -- ---------------------------- function Is_Contract_Annotation (Item : Node_Id) return Boolean is begin return Is_Package_Contract_Annotation (Item) or else Is_Subprogram_Contract_Annotation (Item); end Is_Contract_Annotation; -------------------------------------- -- Is_Controlling_Limited_Procedure -- -------------------------------------- function Is_Controlling_Limited_Procedure (Proc_Nam : Entity_Id) return Boolean is Param_Typ : Entity_Id := Empty; begin if Ekind (Proc_Nam) = E_Procedure and then Present (Parameter_Specifications (Parent (Proc_Nam))) then Param_Typ := Etype (Parameter_Type (First ( Parameter_Specifications (Parent (Proc_Nam))))); -- In this case where an Itype was created, the procedure call has been -- rewritten. elsif Present (Associated_Node_For_Itype (Proc_Nam)) and then Present (Original_Node (Associated_Node_For_Itype (Proc_Nam))) and then Present (Parameter_Associations (Associated_Node_For_Itype (Proc_Nam))) then Param_Typ := Etype (First (Parameter_Associations (Associated_Node_For_Itype (Proc_Nam)))); end if; if Present (Param_Typ) then return Is_Interface (Param_Typ) and then Is_Limited_Record (Param_Typ); end if; return False; end Is_Controlling_Limited_Procedure; ----------------------------- -- Is_CPP_Constructor_Call -- ----------------------------- function Is_CPP_Constructor_Call (N : Node_Id) return Boolean is begin return Nkind (N) = N_Function_Call and then Is_CPP_Class (Etype (Etype (N))) and then Is_Constructor (Entity (Name (N))) and then Is_Imported (Entity (Name (N))); end Is_CPP_Constructor_Call; ------------------------- -- Is_Current_Instance -- ------------------------- function Is_Current_Instance (N : Node_Id) return Boolean is Typ : constant Entity_Id := Entity (N); P : Node_Id; begin -- Simplest case: entity is a concurrent type and we are currently -- inside the body. This will eventually be expanded into a -- call to Self (for tasks) or _object (for protected objects). if Is_Concurrent_Type (Typ) and then In_Open_Scopes (Typ) then return True; else -- Check whether the context is a (sub)type declaration for the -- type entity. P := Parent (N); while Present (P) loop if Nkind_In (P, N_Full_Type_Declaration, N_Private_Type_Declaration, N_Subtype_Declaration) and then Comes_From_Source (P) and then Defining_Entity (P) = Typ then return True; -- A subtype name may appear in an aspect specification for a -- Predicate_Failure aspect, for which we do not construct a -- wrapper procedure. The subtype will be replaced by the -- expression being tested when the corresponding predicate -- check is expanded. elsif Nkind (P) = N_Aspect_Specification and then Nkind (Parent (P)) = N_Subtype_Declaration then return True; elsif Nkind (P) = N_Pragma and then Get_Pragma_Id (P) = Pragma_Predicate_Failure then return True; end if; P := Parent (P); end loop; end if; -- In any other context this is not a current occurrence return False; end Is_Current_Instance; -------------------- -- Is_Declaration -- -------------------- function Is_Declaration (N : Node_Id) return Boolean is begin return Is_Declaration_Other_Than_Renaming (N) or else Is_Renaming_Declaration (N); end Is_Declaration; ---------------------------------------- -- Is_Declaration_Other_Than_Renaming -- ---------------------------------------- function Is_Declaration_Other_Than_Renaming (N : Node_Id) return Boolean is begin case Nkind (N) is when N_Abstract_Subprogram_Declaration | N_Exception_Declaration | N_Expression_Function | N_Full_Type_Declaration | N_Generic_Package_Declaration | N_Generic_Subprogram_Declaration | N_Number_Declaration | N_Object_Declaration | N_Package_Declaration | N_Private_Extension_Declaration | N_Private_Type_Declaration | N_Subprogram_Declaration | N_Subtype_Declaration => return True; when others => return False; end case; end Is_Declaration_Other_Than_Renaming; -------------------------------- -- Is_Declared_Within_Variant -- -------------------------------- function Is_Declared_Within_Variant (Comp : Entity_Id) return Boolean is Comp_Decl : constant Node_Id := Parent (Comp); Comp_List : constant Node_Id := Parent (Comp_Decl); begin return Nkind (Parent (Comp_List)) = N_Variant; end Is_Declared_Within_Variant; ---------------------------------------------- -- Is_Dependent_Component_Of_Mutable_Object -- ---------------------------------------------- function Is_Dependent_Component_Of_Mutable_Object (Object : Node_Id) return Boolean is P : Node_Id; Prefix_Type : Entity_Id; P_Aliased : Boolean := False; Comp : Entity_Id; Deref : Node_Id := Object; -- Dereference node, in something like X.all.Y(2) -- Start of processing for Is_Dependent_Component_Of_Mutable_Object begin -- Find the dereference node if any while Nkind_In (Deref, N_Indexed_Component, N_Selected_Component, N_Slice) loop Deref := Prefix (Deref); end loop; -- Ada 2005: If we have a component or slice of a dereference, -- something like X.all.Y (2), and the type of X is access-to-constant, -- Is_Variable will return False, because it is indeed a constant -- view. But it might be a view of a variable object, so we want the -- following condition to be True in that case. if Is_Variable (Object) or else (Ada_Version >= Ada_2005 and then Nkind (Deref) = N_Explicit_Dereference) then if Nkind (Object) = N_Selected_Component then P := Prefix (Object); Prefix_Type := Etype (P); if Is_Entity_Name (P) then if Ekind (Entity (P)) = E_Generic_In_Out_Parameter then Prefix_Type := Base_Type (Prefix_Type); end if; if Is_Aliased (Entity (P)) then P_Aliased := True; end if; -- A discriminant check on a selected component may be expanded -- into a dereference when removing side-effects. Recover the -- original node and its type, which may be unconstrained. elsif Nkind (P) = N_Explicit_Dereference and then not (Comes_From_Source (P)) then P := Original_Node (P); Prefix_Type := Etype (P); else -- Check for prefix being an aliased component??? null; end if; -- A heap object is constrained by its initial value -- Ada 2005 (AI-363): Always assume the object could be mutable in -- the dereferenced case, since the access value might denote an -- unconstrained aliased object, whereas in Ada 95 the designated -- object is guaranteed to be constrained. A worst-case assumption -- has to apply in Ada 2005 because we can't tell at compile -- time whether the object is "constrained by its initial value" -- (despite the fact that 3.10.2(26/2) and 8.5.1(5/2) are semantic -- rules (these rules are acknowledged to need fixing). if Ada_Version < Ada_2005 then if Is_Access_Type (Prefix_Type) or else Nkind (P) = N_Explicit_Dereference then return False; end if; else pragma Assert (Ada_Version >= Ada_2005); if Is_Access_Type (Prefix_Type) then -- If the access type is pool-specific, and there is no -- constrained partial view of the designated type, then the -- designated object is known to be constrained. if Ekind (Prefix_Type) = E_Access_Type and then not Object_Type_Has_Constrained_Partial_View (Typ => Designated_Type (Prefix_Type), Scop => Current_Scope) then return False; -- Otherwise (general access type, or there is a constrained -- partial view of the designated type), we need to check -- based on the designated type. else Prefix_Type := Designated_Type (Prefix_Type); end if; end if; end if; Comp := Original_Record_Component (Entity (Selector_Name (Object))); -- As per AI-0017, the renaming is illegal in a generic body, even -- if the subtype is indefinite. -- Ada 2005 (AI-363): In Ada 2005 an aliased object can be mutable if not Is_Constrained (Prefix_Type) and then (Is_Definite_Subtype (Prefix_Type) or else (Is_Generic_Type (Prefix_Type) and then Ekind (Current_Scope) = E_Generic_Package and then In_Package_Body (Current_Scope))) and then (Is_Declared_Within_Variant (Comp) or else Has_Discriminant_Dependent_Constraint (Comp)) and then (not P_Aliased or else Ada_Version >= Ada_2005) then return True; -- If the prefix is of an access type at this point, then we want -- to return False, rather than calling this function recursively -- on the access object (which itself might be a discriminant- -- dependent component of some other object, but that isn't -- relevant to checking the object passed to us). This avoids -- issuing wrong errors when compiling with -gnatc, where there -- can be implicit dereferences that have not been expanded. elsif Is_Access_Type (Etype (Prefix (Object))) then return False; else return Is_Dependent_Component_Of_Mutable_Object (Prefix (Object)); end if; elsif Nkind (Object) = N_Indexed_Component or else Nkind (Object) = N_Slice then return Is_Dependent_Component_Of_Mutable_Object (Prefix (Object)); -- A type conversion that Is_Variable is a view conversion: -- go back to the denoted object. elsif Nkind (Object) = N_Type_Conversion then return Is_Dependent_Component_Of_Mutable_Object (Expression (Object)); end if; end if; return False; end Is_Dependent_Component_Of_Mutable_Object; --------------------- -- Is_Dereferenced -- --------------------- function Is_Dereferenced (N : Node_Id) return Boolean is P : constant Node_Id := Parent (N); begin return Nkind_In (P, N_Selected_Component, N_Explicit_Dereference, N_Indexed_Component, N_Slice) and then Prefix (P) = N; end Is_Dereferenced; ---------------------- -- Is_Descendant_Of -- ---------------------- function Is_Descendant_Of (T1 : Entity_Id; T2 : Entity_Id) return Boolean is T : Entity_Id; Etyp : Entity_Id; begin pragma Assert (Nkind (T1) in N_Entity); pragma Assert (Nkind (T2) in N_Entity); T := Base_Type (T1); -- Immediate return if the types match if T = T2 then return True; -- Comment needed here ??? elsif Ekind (T) = E_Class_Wide_Type then return Etype (T) = T2; -- All other cases else loop Etyp := Etype (T); -- Done if we found the type we are looking for if Etyp = T2 then return True; -- Done if no more derivations to check elsif T = T1 or else T = Etyp then return False; -- Following test catches error cases resulting from prev errors elsif No (Etyp) then return False; elsif Is_Private_Type (T) and then Etyp = Full_View (T) then return False; elsif Is_Private_Type (Etyp) and then Full_View (Etyp) = T then return False; end if; T := Base_Type (Etyp); end loop; end if; end Is_Descendant_Of; ---------------------------------------- -- Is_Descendant_Of_Suspension_Object -- ---------------------------------------- function Is_Descendant_Of_Suspension_Object (Typ : Entity_Id) return Boolean is Cur_Typ : Entity_Id; Par_Typ : Entity_Id; begin -- Climb the type derivation chain checking each parent type against -- Suspension_Object. Cur_Typ := Base_Type (Typ); while Present (Cur_Typ) loop Par_Typ := Etype (Cur_Typ); -- The current type is a match if Is_Suspension_Object (Cur_Typ) then return True; -- Stop the traversal once the root of the derivation chain has been -- reached. In that case the current type is its own base type. elsif Cur_Typ = Par_Typ then exit; end if; Cur_Typ := Base_Type (Par_Typ); end loop; return False; end Is_Descendant_Of_Suspension_Object; --------------------------------------------- -- Is_Double_Precision_Floating_Point_Type -- --------------------------------------------- function Is_Double_Precision_Floating_Point_Type (E : Entity_Id) return Boolean is begin return Is_Floating_Point_Type (E) and then Machine_Radix_Value (E) = Uint_2 and then Machine_Mantissa_Value (E) = UI_From_Int (53) and then Machine_Emax_Value (E) = Uint_2 ** Uint_10 and then Machine_Emin_Value (E) = Uint_3 - (Uint_2 ** Uint_10); end Is_Double_Precision_Floating_Point_Type; ----------------------------- -- Is_Effectively_Volatile -- ----------------------------- function Is_Effectively_Volatile (Id : Entity_Id) return Boolean is begin if Is_Type (Id) then -- An arbitrary type is effectively volatile when it is subject to -- pragma Atomic or Volatile. if Is_Volatile (Id) then return True; -- An array type is effectively volatile when it is subject to pragma -- Atomic_Components or Volatile_Components or its component type is -- effectively volatile. elsif Is_Array_Type (Id) then return Has_Volatile_Components (Id) or else Is_Effectively_Volatile (Component_Type (Base_Type (Id))); -- A protected type is always volatile elsif Is_Protected_Type (Id) then return True; -- A descendant of Ada.Synchronous_Task_Control.Suspension_Object is -- automatically volatile. elsif Is_Descendant_Of_Suspension_Object (Id) then return True; -- Otherwise the type is not effectively volatile else return False; end if; -- Otherwise Id denotes an object else return Is_Volatile (Id) or else Has_Volatile_Components (Id) or else Is_Effectively_Volatile (Etype (Id)); end if; end Is_Effectively_Volatile; ------------------------------------ -- Is_Effectively_Volatile_Object -- ------------------------------------ function Is_Effectively_Volatile_Object (N : Node_Id) return Boolean is begin if Is_Entity_Name (N) then return Is_Effectively_Volatile (Entity (N)); elsif Nkind (N) = N_Indexed_Component then return Is_Effectively_Volatile_Object (Prefix (N)); elsif Nkind (N) = N_Selected_Component then return Is_Effectively_Volatile_Object (Prefix (N)) or else Is_Effectively_Volatile_Object (Selector_Name (N)); else return False; end if; end Is_Effectively_Volatile_Object; ------------------- -- Is_Entry_Body -- ------------------- function Is_Entry_Body (Id : Entity_Id) return Boolean is begin return Ekind_In (Id, E_Entry, E_Entry_Family) and then Nkind (Unit_Declaration_Node (Id)) = N_Entry_Body; end Is_Entry_Body; -------------------------- -- Is_Entry_Declaration -- -------------------------- function Is_Entry_Declaration (Id : Entity_Id) return Boolean is begin return Ekind_In (Id, E_Entry, E_Entry_Family) and then Nkind (Unit_Declaration_Node (Id)) = N_Entry_Declaration; end Is_Entry_Declaration; ------------------------------------ -- Is_Expanded_Priority_Attribute -- ------------------------------------ function Is_Expanded_Priority_Attribute (E : Entity_Id) return Boolean is begin return Nkind (E) = N_Function_Call and then not Configurable_Run_Time_Mode and then (Entity (Name (E)) = RTE (RE_Get_Ceiling) or else Entity (Name (E)) = RTE (RO_PE_Get_Ceiling)); end Is_Expanded_Priority_Attribute; ---------------------------- -- Is_Expression_Function -- ---------------------------- function Is_Expression_Function (Subp : Entity_Id) return Boolean is begin if Ekind_In (Subp, E_Function, E_Subprogram_Body) then return Nkind (Original_Node (Unit_Declaration_Node (Subp))) = N_Expression_Function; else return False; end if; end Is_Expression_Function; ------------------------------------------ -- Is_Expression_Function_Or_Completion -- ------------------------------------------ function Is_Expression_Function_Or_Completion (Subp : Entity_Id) return Boolean is Subp_Decl : Node_Id; begin if Ekind (Subp) = E_Function then Subp_Decl := Unit_Declaration_Node (Subp); -- The function declaration is either an expression function or is -- completed by an expression function body. return Is_Expression_Function (Subp) or else (Nkind (Subp_Decl) = N_Subprogram_Declaration and then Present (Corresponding_Body (Subp_Decl)) and then Is_Expression_Function (Corresponding_Body (Subp_Decl))); elsif Ekind (Subp) = E_Subprogram_Body then return Is_Expression_Function (Subp); else return False; end if; end Is_Expression_Function_Or_Completion; ----------------------- -- Is_EVF_Expression -- ----------------------- function Is_EVF_Expression (N : Node_Id) return Boolean is Orig_N : constant Node_Id := Original_Node (N); Alt : Node_Id; Expr : Node_Id; Id : Entity_Id; begin -- Detect a reference to a formal parameter of a specific tagged type -- whose related subprogram is subject to pragma Expresions_Visible with -- value "False". if Is_Entity_Name (N) and then Present (Entity (N)) then Id := Entity (N); return Is_Formal (Id) and then Is_Specific_Tagged_Type (Etype (Id)) and then Extensions_Visible_Status (Id) = Extensions_Visible_False; -- A case expression is an EVF expression when it contains at least one -- EVF dependent_expression. Note that a case expression may have been -- expanded, hence the use of Original_Node. elsif Nkind (Orig_N) = N_Case_Expression then Alt := First (Alternatives (Orig_N)); while Present (Alt) loop if Is_EVF_Expression (Expression (Alt)) then return True; end if; Next (Alt); end loop; -- An if expression is an EVF expression when it contains at least one -- EVF dependent_expression. Note that an if expression may have been -- expanded, hence the use of Original_Node. elsif Nkind (Orig_N) = N_If_Expression then Expr := Next (First (Expressions (Orig_N))); while Present (Expr) loop if Is_EVF_Expression (Expr) then return True; end if; Next (Expr); end loop; -- A qualified expression or a type conversion is an EVF expression when -- its operand is an EVF expression. elsif Nkind_In (N, N_Qualified_Expression, N_Unchecked_Type_Conversion, N_Type_Conversion) then return Is_EVF_Expression (Expression (N)); -- Attributes 'Loop_Entry, 'Old, and 'Update are EVF expressions when -- their prefix denotes an EVF expression. elsif Nkind (N) = N_Attribute_Reference and then Nam_In (Attribute_Name (N), Name_Loop_Entry, Name_Old, Name_Update) then return Is_EVF_Expression (Prefix (N)); end if; return False; end Is_EVF_Expression; -------------- -- Is_False -- -------------- function Is_False (U : Uint) return Boolean is begin return (U = 0); end Is_False; --------------------------- -- Is_Fixed_Model_Number -- --------------------------- function Is_Fixed_Model_Number (U : Ureal; T : Entity_Id) return Boolean is S : constant Ureal := Small_Value (T); M : Urealp.Save_Mark; R : Boolean; begin M := Urealp.Mark; R := (U = UR_Trunc (U / S) * S); Urealp.Release (M); return R; end Is_Fixed_Model_Number; ------------------------------- -- Is_Fully_Initialized_Type -- ------------------------------- function Is_Fully_Initialized_Type (Typ : Entity_Id) return Boolean is begin -- Scalar types if Is_Scalar_Type (Typ) then -- A scalar type with an aspect Default_Value is fully initialized -- Note: Iniitalize/Normalize_Scalars also ensure full initialization -- of a scalar type, but we don't take that into account here, since -- we don't want these to affect warnings. return Has_Default_Aspect (Typ); elsif Is_Access_Type (Typ) then return True; elsif Is_Array_Type (Typ) then if Is_Fully_Initialized_Type (Component_Type (Typ)) or else (Ada_Version >= Ada_2012 and then Has_Default_Aspect (Typ)) then return True; end if; -- An interesting case, if we have a constrained type one of whose -- bounds is known to be null, then there are no elements to be -- initialized, so all the elements are initialized. if Is_Constrained (Typ) then declare Indx : Node_Id; Indx_Typ : Entity_Id; Lbd, Hbd : Node_Id; begin Indx := First_Index (Typ); while Present (Indx) loop if Etype (Indx) = Any_Type then return False; -- If index is a range, use directly elsif Nkind (Indx) = N_Range then Lbd := Low_Bound (Indx); Hbd := High_Bound (Indx); else Indx_Typ := Etype (Indx); if Is_Private_Type (Indx_Typ) then Indx_Typ := Full_View (Indx_Typ); end if; if No (Indx_Typ) or else Etype (Indx_Typ) = Any_Type then return False; else Lbd := Type_Low_Bound (Indx_Typ); Hbd := Type_High_Bound (Indx_Typ); end if; end if; if Compile_Time_Known_Value (Lbd) and then Compile_Time_Known_Value (Hbd) then if Expr_Value (Hbd) < Expr_Value (Lbd) then return True; end if; end if; Next_Index (Indx); end loop; end; end if; -- If no null indexes, then type is not fully initialized return False; -- Record types elsif Is_Record_Type (Typ) then if Has_Discriminants (Typ) and then Present (Discriminant_Default_Value (First_Discriminant (Typ))) and then Is_Fully_Initialized_Variant (Typ) then return True; end if; -- We consider bounded string types to be fully initialized, because -- otherwise we get false alarms when the Data component is not -- default-initialized. if Is_Bounded_String (Typ) then return True; end if; -- Controlled records are considered to be fully initialized if -- there is a user defined Initialize routine. This may not be -- entirely correct, but as the spec notes, we are guessing here -- what is best from the point of view of issuing warnings. if Is_Controlled (Typ) then declare Utyp : constant Entity_Id := Underlying_Type (Typ); begin if Present (Utyp) then declare Init : constant Entity_Id := (Find_Optional_Prim_Op (Underlying_Type (Typ), Name_Initialize)); begin if Present (Init) and then Comes_From_Source (Init) and then not Is_Predefined_File_Name (File_Name (Get_Source_File_Index (Sloc (Init)))) then return True; elsif Has_Null_Extension (Typ) and then Is_Fully_Initialized_Type (Etype (Base_Type (Typ))) then return True; end if; end; end if; end; end if; -- Otherwise see if all record components are initialized declare Ent : Entity_Id; begin Ent := First_Entity (Typ); while Present (Ent) loop if Ekind (Ent) = E_Component and then (No (Parent (Ent)) or else No (Expression (Parent (Ent)))) and then not Is_Fully_Initialized_Type (Etype (Ent)) -- Special VM case for tag components, which need to be -- defined in this case, but are never initialized as VMs -- are using other dispatching mechanisms. Ignore this -- uninitialized case. Note that this applies both to the -- uTag entry and the main vtable pointer (CPP_Class case). and then (Tagged_Type_Expansion or else not Is_Tag (Ent)) then return False; end if; Next_Entity (Ent); end loop; end; -- No uninitialized components, so type is fully initialized. -- Note that this catches the case of no components as well. return True; elsif Is_Concurrent_Type (Typ) then return True; elsif Is_Private_Type (Typ) then declare U : constant Entity_Id := Underlying_Type (Typ); begin if No (U) then return False; else return Is_Fully_Initialized_Type (U); end if; end; else return False; end if; end Is_Fully_Initialized_Type; ---------------------------------- -- Is_Fully_Initialized_Variant -- ---------------------------------- function Is_Fully_Initialized_Variant (Typ : Entity_Id) return Boolean is Loc : constant Source_Ptr := Sloc (Typ); Constraints : constant List_Id := New_List; Components : constant Elist_Id := New_Elmt_List; Comp_Elmt : Elmt_Id; Comp_Id : Node_Id; Comp_List : Node_Id; Discr : Entity_Id; Discr_Val : Node_Id; Report_Errors : Boolean; pragma Warnings (Off, Report_Errors); begin if Serious_Errors_Detected > 0 then return False; end if; if Is_Record_Type (Typ) and then Nkind (Parent (Typ)) = N_Full_Type_Declaration and then Nkind (Type_Definition (Parent (Typ))) = N_Record_Definition then Comp_List := Component_List (Type_Definition (Parent (Typ))); Discr := First_Discriminant (Typ); while Present (Discr) loop if Nkind (Parent (Discr)) = N_Discriminant_Specification then Discr_Val := Expression (Parent (Discr)); if Present (Discr_Val) and then Is_OK_Static_Expression (Discr_Val) then Append_To (Constraints, Make_Component_Association (Loc, Choices => New_List (New_Occurrence_Of (Discr, Loc)), Expression => New_Copy (Discr_Val))); else return False; end if; else return False; end if; Next_Discriminant (Discr); end loop; Gather_Components (Typ => Typ, Comp_List => Comp_List, Governed_By => Constraints, Into => Components, Report_Errors => Report_Errors); -- Check that each component present is fully initialized Comp_Elmt := First_Elmt (Components); while Present (Comp_Elmt) loop Comp_Id := Node (Comp_Elmt); if Ekind (Comp_Id) = E_Component and then (No (Parent (Comp_Id)) or else No (Expression (Parent (Comp_Id)))) and then not Is_Fully_Initialized_Type (Etype (Comp_Id)) then return False; end if; Next_Elmt (Comp_Elmt); end loop; return True; elsif Is_Private_Type (Typ) then declare U : constant Entity_Id := Underlying_Type (Typ); begin if No (U) then return False; else return Is_Fully_Initialized_Variant (U); end if; end; else return False; end if; end Is_Fully_Initialized_Variant; ------------------------------------ -- Is_Generic_Declaration_Or_Body -- ------------------------------------ function Is_Generic_Declaration_Or_Body (Decl : Node_Id) return Boolean is Spec_Decl : Node_Id; begin -- Package/subprogram body if Nkind_In (Decl, N_Package_Body, N_Subprogram_Body) and then Present (Corresponding_Spec (Decl)) then Spec_Decl := Unit_Declaration_Node (Corresponding_Spec (Decl)); -- Package/subprogram body stub elsif Nkind_In (Decl, N_Package_Body_Stub, N_Subprogram_Body_Stub) and then Present (Corresponding_Spec_Of_Stub (Decl)) then Spec_Decl := Unit_Declaration_Node (Corresponding_Spec_Of_Stub (Decl)); -- All other cases else Spec_Decl := Decl; end if; -- Rather than inspecting the defining entity of the spec declaration, -- look at its Nkind. This takes care of the case where the analysis of -- a generic body modifies the Ekind of its spec to allow for recursive -- calls. return Nkind_In (Spec_Decl, N_Generic_Package_Declaration, N_Generic_Subprogram_Declaration); end Is_Generic_Declaration_Or_Body; ---------------------------- -- Is_Inherited_Operation -- ---------------------------- function Is_Inherited_Operation (E : Entity_Id) return Boolean is pragma Assert (Is_Overloadable (E)); Kind : constant Node_Kind := Nkind (Parent (E)); begin return Kind = N_Full_Type_Declaration or else Kind = N_Private_Extension_Declaration or else Kind = N_Subtype_Declaration or else (Ekind (E) = E_Enumeration_Literal and then Is_Derived_Type (Etype (E))); end Is_Inherited_Operation; ------------------------------------- -- Is_Inherited_Operation_For_Type -- ------------------------------------- function Is_Inherited_Operation_For_Type (E : Entity_Id; Typ : Entity_Id) return Boolean is begin -- Check that the operation has been created by the type declaration return Is_Inherited_Operation (E) and then Defining_Identifier (Parent (E)) = Typ; end Is_Inherited_Operation_For_Type; -------------------------------------- -- Is_Inlinable_Expression_Function -- -------------------------------------- function Is_Inlinable_Expression_Function (Subp : Entity_Id) return Boolean is Return_Expr : Node_Id; begin if Is_Expression_Function_Or_Completion (Subp) and then Has_Pragma_Inline_Always (Subp) and then Needs_No_Actuals (Subp) and then No (Contract (Subp)) and then not Is_Dispatching_Operation (Subp) and then Needs_Finalization (Etype (Subp)) and then not Is_Class_Wide_Type (Etype (Subp)) and then not (Has_Invariants (Etype (Subp))) and then Present (Subprogram_Body (Subp)) and then Was_Expression_Function (Subprogram_Body (Subp)) then Return_Expr := Expression_Of_Expression_Function (Subp); -- The returned object must not have a qualified expression and its -- nominal subtype must be statically compatible with the result -- subtype of the expression function. return Nkind (Return_Expr) = N_Identifier and then Etype (Return_Expr) = Etype (Subp); end if; return False; end Is_Inlinable_Expression_Function; ----------------- -- Is_Iterator -- ----------------- function Is_Iterator (Typ : Entity_Id) return Boolean is function Denotes_Iterator (Iter_Typ : Entity_Id) return Boolean; -- Determine whether type Iter_Typ is a predefined forward or reversible -- iterator. ---------------------- -- Denotes_Iterator -- ---------------------- function Denotes_Iterator (Iter_Typ : Entity_Id) return Boolean is begin -- Check that the name matches, and that the ultimate ancestor is in -- a predefined unit, i.e the one that declares iterator interfaces. return Nam_In (Chars (Iter_Typ), Name_Forward_Iterator, Name_Reversible_Iterator) and then Is_Predefined_File_Name (Unit_File_Name (Get_Source_Unit (Root_Type (Iter_Typ)))); end Denotes_Iterator; -- Local variables Iface_Elmt : Elmt_Id; Ifaces : Elist_Id; -- Start of processing for Is_Iterator begin -- The type may be a subtype of a descendant of the proper instance of -- the predefined interface type, so we must use the root type of the -- given type. The same is done for Is_Reversible_Iterator. if Is_Class_Wide_Type (Typ) and then Denotes_Iterator (Root_Type (Typ)) then return True; elsif not Is_Tagged_Type (Typ) or else not Is_Derived_Type (Typ) then return False; elsif Present (Find_Value_Of_Aspect (Typ, Aspect_Iterable)) then return True; else Collect_Interfaces (Typ, Ifaces); Iface_Elmt := First_Elmt (Ifaces); while Present (Iface_Elmt) loop if Denotes_Iterator (Node (Iface_Elmt)) then return True; end if; Next_Elmt (Iface_Elmt); end loop; return False; end if; end Is_Iterator; ---------------------------- -- Is_Iterator_Over_Array -- ---------------------------- function Is_Iterator_Over_Array (N : Node_Id) return Boolean is Container : constant Node_Id := Name (N); Container_Typ : constant Entity_Id := Base_Type (Etype (Container)); begin return Is_Array_Type (Container_Typ); end Is_Iterator_Over_Array; ------------ -- Is_LHS -- ------------ -- We seem to have a lot of overlapping functions that do similar things -- (testing for left hand sides or lvalues???). function Is_LHS (N : Node_Id) return Is_LHS_Result is P : constant Node_Id := Parent (N); begin -- Return True if we are the left hand side of an assignment statement if Nkind (P) = N_Assignment_Statement then if Name (P) = N then return Yes; else return No; end if; -- Case of prefix of indexed or selected component or slice elsif Nkind_In (P, N_Indexed_Component, N_Selected_Component, N_Slice) and then N = Prefix (P) then -- Here we have the case where the parent P is N.Q or N(Q .. R). -- If P is an LHS, then N is also effectively an LHS, but there -- is an important exception. If N is of an access type, then -- what we really have is N.all.Q (or N.all(Q .. R)). In either -- case this makes N.all a left hand side but not N itself. -- If we don't know the type yet, this is the case where we return -- Unknown, since the answer depends on the type which is unknown. if No (Etype (N)) then return Unknown; -- We have an Etype set, so we can check it elsif Is_Access_Type (Etype (N)) then return No; -- OK, not access type case, so just test whole expression else return Is_LHS (P); end if; -- All other cases are not left hand sides else return No; end if; end Is_LHS; ----------------------------- -- Is_Library_Level_Entity -- ----------------------------- function Is_Library_Level_Entity (E : Entity_Id) return Boolean is begin -- The following is a small optimization, and it also properly handles -- discriminals, which in task bodies might appear in expressions before -- the corresponding procedure has been created, and which therefore do -- not have an assigned scope. if Is_Formal (E) then return False; end if; -- Normal test is simply that the enclosing dynamic scope is Standard return Enclosing_Dynamic_Scope (E) = Standard_Standard; end Is_Library_Level_Entity; -------------------------------- -- Is_Limited_Class_Wide_Type -- -------------------------------- function Is_Limited_Class_Wide_Type (Typ : Entity_Id) return Boolean is begin return Is_Class_Wide_Type (Typ) and then (Is_Limited_Type (Typ) or else From_Limited_With (Typ)); end Is_Limited_Class_Wide_Type; --------------------------------- -- Is_Local_Variable_Reference -- --------------------------------- function Is_Local_Variable_Reference (Expr : Node_Id) return Boolean is begin if not Is_Entity_Name (Expr) then return False; else declare Ent : constant Entity_Id := Entity (Expr); Sub : constant Entity_Id := Enclosing_Subprogram (Ent); begin if not Ekind_In (Ent, E_Variable, E_In_Out_Parameter) then return False; else return Present (Sub) and then Sub = Current_Subprogram; end if; end; end if; end Is_Local_Variable_Reference; ----------------------- -- Is_Name_Reference -- ----------------------- function Is_Name_Reference (N : Node_Id) return Boolean is begin if Is_Entity_Name (N) then return Present (Entity (N)) and then Is_Object (Entity (N)); end if; case Nkind (N) is when N_Indexed_Component | N_Slice => return Is_Name_Reference (Prefix (N)) or else Is_Access_Type (Etype (Prefix (N))); -- Attributes 'Input, 'Old and 'Result produce objects when N_Attribute_Reference => return Nam_In (Attribute_Name (N), Name_Input, Name_Old, Name_Result); when N_Selected_Component => return Is_Name_Reference (Selector_Name (N)) and then (Is_Name_Reference (Prefix (N)) or else Is_Access_Type (Etype (Prefix (N)))); when N_Explicit_Dereference => return True; -- A view conversion of a tagged name is a name reference when N_Type_Conversion => return Is_Tagged_Type (Etype (Subtype_Mark (N))) and then Is_Tagged_Type (Etype (Expression (N))) and then Is_Name_Reference (Expression (N)); -- An unchecked type conversion is considered to be a name if the -- operand is a name (this construction arises only as a result of -- expansion activities). when N_Unchecked_Type_Conversion => return Is_Name_Reference (Expression (N)); when others => return False; end case; end Is_Name_Reference; --------------------------------- -- Is_Nontrivial_DIC_Procedure -- --------------------------------- function Is_Nontrivial_DIC_Procedure (Id : Entity_Id) return Boolean is Body_Decl : Node_Id; Stmt : Node_Id; begin if Ekind (Id) = E_Procedure and then Is_DIC_Procedure (Id) then Body_Decl := Unit_Declaration_Node (Corresponding_Body (Unit_Declaration_Node (Id))); -- The body of the Default_Initial_Condition procedure must contain -- at least one statement, otherwise the generation of the subprogram -- body failed. pragma Assert (Present (Handled_Statement_Sequence (Body_Decl))); -- To qualify as nontrivial, the first statement of the procedure -- must be a check in the form of an if statement. If the original -- Default_Initial_Condition expression was folded, then the first -- statement is not a check. Stmt := First (Statements (Handled_Statement_Sequence (Body_Decl))); return Nkind (Stmt) = N_If_Statement and then Nkind (Original_Node (Stmt)) = N_Pragma; end if; return False; end Is_Nontrivial_DIC_Procedure; ------------------------- -- Is_Null_Record_Type -- ------------------------- function Is_Null_Record_Type (T : Entity_Id) return Boolean is Decl : constant Node_Id := Parent (T); begin return Nkind (Decl) = N_Full_Type_Declaration and then Nkind (Type_Definition (Decl)) = N_Record_Definition and then (No (Component_List (Type_Definition (Decl))) or else Null_Present (Component_List (Type_Definition (Decl)))); end Is_Null_Record_Type; ------------------------- -- Is_Object_Reference -- ------------------------- function Is_Object_Reference (N : Node_Id) return Boolean is function Is_Internally_Generated_Renaming (N : Node_Id) return Boolean; -- Determine whether N is the name of an internally-generated renaming -------------------------------------- -- Is_Internally_Generated_Renaming -- -------------------------------------- function Is_Internally_Generated_Renaming (N : Node_Id) return Boolean is P : Node_Id; begin P := N; while Present (P) loop if Nkind (P) = N_Object_Renaming_Declaration then return not Comes_From_Source (P); elsif Is_List_Member (P) then return False; end if; P := Parent (P); end loop; return False; end Is_Internally_Generated_Renaming; -- Start of processing for Is_Object_Reference begin if Is_Entity_Name (N) then return Present (Entity (N)) and then Is_Object (Entity (N)); else case Nkind (N) is when N_Indexed_Component | N_Slice => return Is_Object_Reference (Prefix (N)) or else Is_Access_Type (Etype (Prefix (N))); -- In Ada 95, a function call is a constant object; a procedure -- call is not. when N_Function_Call => return Etype (N) /= Standard_Void_Type; -- Attributes 'Input, 'Loop_Entry, 'Old, and 'Result produce -- objects. when N_Attribute_Reference => return Nam_In (Attribute_Name (N), Name_Input, Name_Loop_Entry, Name_Old, Name_Result); when N_Selected_Component => return Is_Object_Reference (Selector_Name (N)) and then (Is_Object_Reference (Prefix (N)) or else Is_Access_Type (Etype (Prefix (N)))); when N_Explicit_Dereference => return True; -- A view conversion of a tagged object is an object reference when N_Type_Conversion => return Is_Tagged_Type (Etype (Subtype_Mark (N))) and then Is_Tagged_Type (Etype (Expression (N))) and then Is_Object_Reference (Expression (N)); -- An unchecked type conversion is considered to be an object if -- the operand is an object (this construction arises only as a -- result of expansion activities). when N_Unchecked_Type_Conversion => return True; -- Allow string literals to act as objects as long as they appear -- in internally-generated renamings. The expansion of iterators -- may generate such renamings when the range involves a string -- literal. when N_String_Literal => return Is_Internally_Generated_Renaming (Parent (N)); -- AI05-0003: In Ada 2012 a qualified expression is a name. -- This allows disambiguation of function calls and the use -- of aggregates in more contexts. when N_Qualified_Expression => if Ada_Version < Ada_2012 then return False; else return Is_Object_Reference (Expression (N)) or else Nkind (Expression (N)) = N_Aggregate; end if; when others => return False; end case; end if; end Is_Object_Reference; ----------------------------------- -- Is_OK_Variable_For_Out_Formal -- ----------------------------------- function Is_OK_Variable_For_Out_Formal (AV : Node_Id) return Boolean is begin Note_Possible_Modification (AV, Sure => True); -- We must reject parenthesized variable names. Comes_From_Source is -- checked because there are currently cases where the compiler violates -- this rule (e.g. passing a task object to its controlled Initialize -- routine). This should be properly documented in sinfo??? if Paren_Count (AV) > 0 and then Comes_From_Source (AV) then return False; -- A variable is always allowed elsif Is_Variable (AV) then return True; -- Generalized indexing operations are rewritten as explicit -- dereferences, and it is only during resolution that we can -- check whether the context requires an access_to_variable type. elsif Nkind (AV) = N_Explicit_Dereference and then Ada_Version >= Ada_2012 and then Nkind (Original_Node (AV)) = N_Indexed_Component and then Present (Etype (Original_Node (AV))) and then Has_Implicit_Dereference (Etype (Original_Node (AV))) then return not Is_Access_Constant (Etype (Prefix (AV))); -- Unchecked conversions are allowed only if they come from the -- generated code, which sometimes uses unchecked conversions for out -- parameters in cases where code generation is unaffected. We tell -- source unchecked conversions by seeing if they are rewrites of -- an original Unchecked_Conversion function call, or of an explicit -- conversion of a function call or an aggregate (as may happen in the -- expansion of a packed array aggregate). elsif Nkind (AV) = N_Unchecked_Type_Conversion then if Nkind_In (Original_Node (AV), N_Function_Call, N_Aggregate) then return False; elsif Comes_From_Source (AV) and then Nkind (Original_Node (Expression (AV))) = N_Function_Call then return False; elsif Nkind (Original_Node (AV)) = N_Type_Conversion then return Is_OK_Variable_For_Out_Formal (Expression (AV)); else return True; end if; -- Normal type conversions are allowed if argument is a variable elsif Nkind (AV) = N_Type_Conversion then if Is_Variable (Expression (AV)) and then Paren_Count (Expression (AV)) = 0 then Note_Possible_Modification (Expression (AV), Sure => True); return True; -- We also allow a non-parenthesized expression that raises -- constraint error if it rewrites what used to be a variable elsif Raises_Constraint_Error (Expression (AV)) and then Paren_Count (Expression (AV)) = 0 and then Is_Variable (Original_Node (Expression (AV))) then return True; -- Type conversion of something other than a variable else return False; end if; -- If this node is rewritten, then test the original form, if that is -- OK, then we consider the rewritten node OK (for example, if the -- original node is a conversion, then Is_Variable will not be true -- but we still want to allow the conversion if it converts a variable). elsif Original_Node (AV) /= AV then -- In Ada 2012, the explicit dereference may be a rewritten call to a -- Reference function. if Ada_Version >= Ada_2012 and then Nkind (Original_Node (AV)) = N_Function_Call and then Has_Implicit_Dereference (Etype (Name (Original_Node (AV)))) then -- Check that this is not a constant reference. return not Is_Access_Constant (Etype (Prefix (AV))); elsif Has_Implicit_Dereference (Etype (Original_Node (AV))) then return not Is_Access_Constant (Etype (Get_Reference_Discriminant (Etype (Original_Node (AV))))); else return Is_OK_Variable_For_Out_Formal (Original_Node (AV)); end if; -- All other non-variables are rejected else return False; end if; end Is_OK_Variable_For_Out_Formal; ---------------------------- -- Is_OK_Volatile_Context -- ---------------------------- function Is_OK_Volatile_Context (Context : Node_Id; Obj_Ref : Node_Id) return Boolean is function Is_Protected_Operation_Call (Nod : Node_Id) return Boolean; -- Determine whether an arbitrary node denotes a call to a protected -- entry, function, or procedure in prefixed form where the prefix is -- Obj_Ref. function Within_Check (Nod : Node_Id) return Boolean; -- Determine whether an arbitrary node appears in a check node function Within_Subprogram_Call (Nod : Node_Id) return Boolean; -- Determine whether an arbitrary node appears in an entry, function, or -- procedure call. function Within_Volatile_Function (Id : Entity_Id) return Boolean; -- Determine whether an arbitrary entity appears in a volatile function --------------------------------- -- Is_Protected_Operation_Call -- --------------------------------- function Is_Protected_Operation_Call (Nod : Node_Id) return Boolean is Pref : Node_Id; Subp : Node_Id; begin -- A call to a protected operations retains its selected component -- form as opposed to other prefixed calls that are transformed in -- expanded names. if Nkind (Nod) = N_Selected_Component then Pref := Prefix (Nod); Subp := Selector_Name (Nod); return Pref = Obj_Ref and then Present (Etype (Pref)) and then Is_Protected_Type (Etype (Pref)) and then Is_Entity_Name (Subp) and then Present (Entity (Subp)) and then Ekind_In (Entity (Subp), E_Entry, E_Entry_Family, E_Function, E_Procedure); else return False; end if; end Is_Protected_Operation_Call; ------------------ -- Within_Check -- ------------------ function Within_Check (Nod : Node_Id) return Boolean is Par : Node_Id; begin -- Climb the parent chain looking for a check node Par := Nod; while Present (Par) loop if Nkind (Par) in N_Raise_xxx_Error then return True; -- Prevent the search from going too far elsif Is_Body_Or_Package_Declaration (Par) then exit; end if; Par := Parent (Par); end loop; return False; end Within_Check; ---------------------------- -- Within_Subprogram_Call -- ---------------------------- function Within_Subprogram_Call (Nod : Node_Id) return Boolean is Par : Node_Id; begin -- Climb the parent chain looking for a function or procedure call Par := Nod; while Present (Par) loop if Nkind_In (Par, N_Entry_Call_Statement, N_Function_Call, N_Procedure_Call_Statement) then return True; -- Prevent the search from going too far elsif Is_Body_Or_Package_Declaration (Par) then exit; end if; Par := Parent (Par); end loop; return False; end Within_Subprogram_Call; ------------------------------ -- Within_Volatile_Function -- ------------------------------ function Within_Volatile_Function (Id : Entity_Id) return Boolean is Func_Id : Entity_Id; begin -- Traverse the scope stack looking for a [generic] function Func_Id := Id; while Present (Func_Id) and then Func_Id /= Standard_Standard loop if Ekind_In (Func_Id, E_Function, E_Generic_Function) then return Is_Volatile_Function (Func_Id); end if; Func_Id := Scope (Func_Id); end loop; return False; end Within_Volatile_Function; -- Local variables Obj_Id : Entity_Id; -- Start of processing for Is_OK_Volatile_Context begin -- The volatile object appears on either side of an assignment if Nkind (Context) = N_Assignment_Statement then return True; -- The volatile object is part of the initialization expression of -- another object. elsif Nkind (Context) = N_Object_Declaration and then Present (Expression (Context)) and then Expression (Context) = Obj_Ref then Obj_Id := Defining_Entity (Context); -- The volatile object acts as the initialization expression of an -- extended return statement. This is valid context as long as the -- function is volatile. if Is_Return_Object (Obj_Id) then return Within_Volatile_Function (Obj_Id); -- Otherwise this is a normal object initialization else return True; end if; -- The volatile object acts as the name of a renaming declaration elsif Nkind (Context) = N_Object_Renaming_Declaration and then Name (Context) = Obj_Ref then return True; -- The volatile object appears as an actual parameter in a call to an -- instance of Unchecked_Conversion whose result is renamed. elsif Nkind (Context) = N_Function_Call and then Is_Entity_Name (Name (Context)) and then Is_Unchecked_Conversion_Instance (Entity (Name (Context))) and then Nkind (Parent (Context)) = N_Object_Renaming_Declaration then return True; -- The volatile object is actually the prefix in a protected entry, -- function, or procedure call. elsif Is_Protected_Operation_Call (Context) then return True; -- The volatile object appears as the expression of a simple return -- statement that applies to a volatile function. elsif Nkind (Context) = N_Simple_Return_Statement and then Expression (Context) = Obj_Ref then return Within_Volatile_Function (Return_Statement_Entity (Context)); -- The volatile object appears as the prefix of a name occurring in a -- non-interfering context. elsif Nkind_In (Context, N_Attribute_Reference, N_Explicit_Dereference, N_Indexed_Component, N_Selected_Component, N_Slice) and then Prefix (Context) = Obj_Ref and then Is_OK_Volatile_Context (Context => Parent (Context), Obj_Ref => Context) then return True; -- The volatile object appears as the prefix of attributes Address, -- Alignment, Component_Size, First_Bit, Last_Bit, Position, Size, -- Storage_Size. elsif Nkind (Context) = N_Attribute_Reference and then Prefix (Context) = Obj_Ref and then Nam_In (Attribute_Name (Context), Name_Address, Name_Alignment, Name_Component_Size, Name_First_Bit, Name_Last_Bit, Name_Position, Name_Size, Name_Storage_Size) then return True; -- The volatile object appears as the expression of a type conversion -- occurring in a non-interfering context. elsif Nkind_In (Context, N_Type_Conversion, N_Unchecked_Type_Conversion) and then Expression (Context) = Obj_Ref and then Is_OK_Volatile_Context (Context => Parent (Context), Obj_Ref => Context) then return True; -- The volatile object appears as the expression in a delay statement elsif Nkind (Context) in N_Delay_Statement then return True; -- Allow references to volatile objects in various checks. This is not a -- direct SPARK 2014 requirement. elsif Within_Check (Context) then return True; -- Assume that references to effectively volatile objects that appear -- as actual parameters in a subprogram call are always legal. A full -- legality check is done when the actuals are resolved (see routine -- Resolve_Actuals). elsif Within_Subprogram_Call (Context) then return True; -- Otherwise the context is not suitable for an effectively volatile -- object. else return False; end if; end Is_OK_Volatile_Context; ------------------------------------ -- Is_Package_Contract_Annotation -- ------------------------------------ function Is_Package_Contract_Annotation (Item : Node_Id) return Boolean is Nam : Name_Id; begin if Nkind (Item) = N_Aspect_Specification then Nam := Chars (Identifier (Item)); else pragma Assert (Nkind (Item) = N_Pragma); Nam := Pragma_Name (Item); end if; return Nam = Name_Abstract_State or else Nam = Name_Initial_Condition or else Nam = Name_Initializes or else Nam = Name_Refined_State; end Is_Package_Contract_Annotation; ----------------------------------- -- Is_Partially_Initialized_Type -- ----------------------------------- function Is_Partially_Initialized_Type (Typ : Entity_Id; Include_Implicit : Boolean := True) return Boolean is begin if Is_Scalar_Type (Typ) then return False; elsif Is_Access_Type (Typ) then return Include_Implicit; elsif Is_Array_Type (Typ) then -- If component type is partially initialized, so is array type if Is_Partially_Initialized_Type (Component_Type (Typ), Include_Implicit) then return True; -- Otherwise we are only partially initialized if we are fully -- initialized (this is the empty array case, no point in us -- duplicating that code here). else return Is_Fully_Initialized_Type (Typ); end if; elsif Is_Record_Type (Typ) then -- A discriminated type is always partially initialized if in -- all mode if Has_Discriminants (Typ) and then Include_Implicit then return True; -- A tagged type is always partially initialized elsif Is_Tagged_Type (Typ) then return True; -- Case of non-discriminated record else declare Ent : Entity_Id; Component_Present : Boolean := False; -- Set True if at least one component is present. If no -- components are present, then record type is fully -- initialized (another odd case, like the null array). begin -- Loop through components Ent := First_Entity (Typ); while Present (Ent) loop if Ekind (Ent) = E_Component then Component_Present := True; -- If a component has an initialization expression then -- the enclosing record type is partially initialized if Present (Parent (Ent)) and then Present (Expression (Parent (Ent))) then return True; -- If a component is of a type which is itself partially -- initialized, then the enclosing record type is also. elsif Is_Partially_Initialized_Type (Etype (Ent), Include_Implicit) then return True; end if; end if; Next_Entity (Ent); end loop; -- No initialized components found. If we found any components -- they were all uninitialized so the result is false. if Component_Present then return False; -- But if we found no components, then all the components are -- initialized so we consider the type to be initialized. else return True; end if; end; end if; -- Concurrent types are always fully initialized elsif Is_Concurrent_Type (Typ) then return True; -- For a private type, go to underlying type. If there is no underlying -- type then just assume this partially initialized. Not clear if this -- can happen in a non-error case, but no harm in testing for this. elsif Is_Private_Type (Typ) then declare U : constant Entity_Id := Underlying_Type (Typ); begin if No (U) then return True; else return Is_Partially_Initialized_Type (U, Include_Implicit); end if; end; -- For any other type (are there any?) assume partially initialized else return True; end if; end Is_Partially_Initialized_Type; ------------------------------------ -- Is_Potentially_Persistent_Type -- ------------------------------------ function Is_Potentially_Persistent_Type (T : Entity_Id) return Boolean is Comp : Entity_Id; Indx : Node_Id; begin -- For private type, test corresponding full type if Is_Private_Type (T) then return Is_Potentially_Persistent_Type (Full_View (T)); -- Scalar types are potentially persistent elsif Is_Scalar_Type (T) then return True; -- Record type is potentially persistent if not tagged and the types of -- all it components are potentially persistent, and no component has -- an initialization expression. elsif Is_Record_Type (T) and then not Is_Tagged_Type (T) and then not Is_Partially_Initialized_Type (T) then Comp := First_Component (T); while Present (Comp) loop if not Is_Potentially_Persistent_Type (Etype (Comp)) then return False; else Next_Entity (Comp); end if; end loop; return True; -- Array type is potentially persistent if its component type is -- potentially persistent and if all its constraints are static. elsif Is_Array_Type (T) then if not Is_Potentially_Persistent_Type (Component_Type (T)) then return False; end if; Indx := First_Index (T); while Present (Indx) loop if not Is_OK_Static_Subtype (Etype (Indx)) then return False; else Next_Index (Indx); end if; end loop; return True; -- All other types are not potentially persistent else return False; end if; end Is_Potentially_Persistent_Type; -------------------------------- -- Is_Potentially_Unevaluated -- -------------------------------- function Is_Potentially_Unevaluated (N : Node_Id) return Boolean is Par : Node_Id; Expr : Node_Id; begin Expr := N; Par := Parent (N); -- A postcondition whose expression is a short-circuit is broken down -- into individual aspects for better exception reporting. The original -- short-circuit expression is rewritten as the second operand, and an -- occurrence of 'Old in that operand is potentially unevaluated. -- See Sem_ch13.adb for details of this transformation. if Nkind (Original_Node (Par)) = N_And_Then then return True; end if; while not Nkind_In (Par, N_If_Expression, N_Case_Expression, N_And_Then, N_Or_Else, N_In, N_Not_In) loop Expr := Par; Par := Parent (Par); -- If the context is not an expression, or if is the result of -- expansion of an enclosing construct (such as another attribute) -- the predicate does not apply. if Nkind (Par) not in N_Subexpr or else not Comes_From_Source (Par) then return False; end if; end loop; if Nkind (Par) = N_If_Expression then return Is_Elsif (Par) or else Expr /= First (Expressions (Par)); elsif Nkind (Par) = N_Case_Expression then return Expr /= Expression (Par); elsif Nkind_In (Par, N_And_Then, N_Or_Else) then return Expr = Right_Opnd (Par); elsif Nkind_In (Par, N_In, N_Not_In) then return Expr /= Left_Opnd (Par); else return False; end if; end Is_Potentially_Unevaluated; --------------------------------- -- Is_Protected_Self_Reference -- --------------------------------- function Is_Protected_Self_Reference (N : Node_Id) return Boolean is function In_Access_Definition (N : Node_Id) return Boolean; -- Returns true if N belongs to an access definition -------------------------- -- In_Access_Definition -- -------------------------- function In_Access_Definition (N : Node_Id) return Boolean is P : Node_Id; begin P := Parent (N); while Present (P) loop if Nkind (P) = N_Access_Definition then return True; end if; P := Parent (P); end loop; return False; end In_Access_Definition; -- Start of processing for Is_Protected_Self_Reference begin -- Verify that prefix is analyzed and has the proper form. Note that -- the attributes Elab_Spec, Elab_Body, and Elab_Subp_Body, which also -- produce the address of an entity, do not analyze their prefix -- because they denote entities that are not necessarily visible. -- Neither of them can apply to a protected type. return Ada_Version >= Ada_2005 and then Is_Entity_Name (N) and then Present (Entity (N)) and then Is_Protected_Type (Entity (N)) and then In_Open_Scopes (Entity (N)) and then not In_Access_Definition (N); end Is_Protected_Self_Reference; ----------------------------- -- Is_RCI_Pkg_Spec_Or_Body -- ----------------------------- function Is_RCI_Pkg_Spec_Or_Body (Cunit : Node_Id) return Boolean is function Is_RCI_Pkg_Decl_Cunit (Cunit : Node_Id) return Boolean; -- Return True if the unit of Cunit is an RCI package declaration --------------------------- -- Is_RCI_Pkg_Decl_Cunit -- --------------------------- function Is_RCI_Pkg_Decl_Cunit (Cunit : Node_Id) return Boolean is The_Unit : constant Node_Id := Unit (Cunit); begin if Nkind (The_Unit) /= N_Package_Declaration then return False; end if; return Is_Remote_Call_Interface (Defining_Entity (The_Unit)); end Is_RCI_Pkg_Decl_Cunit; -- Start of processing for Is_RCI_Pkg_Spec_Or_Body begin return Is_RCI_Pkg_Decl_Cunit (Cunit) or else (Nkind (Unit (Cunit)) = N_Package_Body and then Is_RCI_Pkg_Decl_Cunit (Library_Unit (Cunit))); end Is_RCI_Pkg_Spec_Or_Body; ----------------------------------------- -- Is_Remote_Access_To_Class_Wide_Type -- ----------------------------------------- function Is_Remote_Access_To_Class_Wide_Type (E : Entity_Id) return Boolean is begin -- A remote access to class-wide type is a general access to object type -- declared in the visible part of a Remote_Types or Remote_Call_ -- Interface unit. return Ekind (E) = E_General_Access_Type and then (Is_Remote_Call_Interface (E) or else Is_Remote_Types (E)); end Is_Remote_Access_To_Class_Wide_Type; ----------------------------------------- -- Is_Remote_Access_To_Subprogram_Type -- ----------------------------------------- function Is_Remote_Access_To_Subprogram_Type (E : Entity_Id) return Boolean is begin return (Ekind (E) = E_Access_Subprogram_Type or else (Ekind (E) = E_Record_Type and then Present (Corresponding_Remote_Type (E)))) and then (Is_Remote_Call_Interface (E) or else Is_Remote_Types (E)); end Is_Remote_Access_To_Subprogram_Type; -------------------- -- Is_Remote_Call -- -------------------- function Is_Remote_Call (N : Node_Id) return Boolean is begin if Nkind (N) not in N_Subprogram_Call then -- An entry call cannot be remote return False; elsif Nkind (Name (N)) in N_Has_Entity and then Is_Remote_Call_Interface (Entity (Name (N))) then -- A subprogram declared in the spec of a RCI package is remote return True; elsif Nkind (Name (N)) = N_Explicit_Dereference and then Is_Remote_Access_To_Subprogram_Type (Etype (Prefix (Name (N)))) then -- The dereference of a RAS is a remote call return True; elsif Present (Controlling_Argument (N)) and then Is_Remote_Access_To_Class_Wide_Type (Etype (Controlling_Argument (N))) then -- Any primitive operation call with a controlling argument of -- a RACW type is a remote call. return True; end if; -- All other calls are local calls return False; end Is_Remote_Call; ---------------------- -- Is_Renamed_Entry -- ---------------------- function Is_Renamed_Entry (Proc_Nam : Entity_Id) return Boolean is Orig_Node : Node_Id := Empty; Subp_Decl : Node_Id := Parent (Parent (Proc_Nam)); function Is_Entry (Nam : Node_Id) return Boolean; -- Determine whether Nam is an entry. Traverse selectors if there are -- nested selected components. -------------- -- Is_Entry -- -------------- function Is_Entry (Nam : Node_Id) return Boolean is begin if Nkind (Nam) = N_Selected_Component then return Is_Entry (Selector_Name (Nam)); end if; return Ekind (Entity (Nam)) = E_Entry; end Is_Entry; -- Start of processing for Is_Renamed_Entry begin if Present (Alias (Proc_Nam)) then Subp_Decl := Parent (Parent (Alias (Proc_Nam))); end if; -- Look for a rewritten subprogram renaming declaration if Nkind (Subp_Decl) = N_Subprogram_Declaration and then Present (Original_Node (Subp_Decl)) then Orig_Node := Original_Node (Subp_Decl); end if; -- The rewritten subprogram is actually an entry if Present (Orig_Node) and then Nkind (Orig_Node) = N_Subprogram_Renaming_Declaration and then Is_Entry (Name (Orig_Node)) then return True; end if; return False; end Is_Renamed_Entry; ----------------------------- -- Is_Renaming_Declaration -- ----------------------------- function Is_Renaming_Declaration (N : Node_Id) return Boolean is begin case Nkind (N) is when N_Exception_Renaming_Declaration | N_Generic_Function_Renaming_Declaration | N_Generic_Package_Renaming_Declaration | N_Generic_Procedure_Renaming_Declaration | N_Object_Renaming_Declaration | N_Package_Renaming_Declaration | N_Subprogram_Renaming_Declaration => return True; when others => return False; end case; end Is_Renaming_Declaration; ---------------------------- -- Is_Reversible_Iterator -- ---------------------------- function Is_Reversible_Iterator (Typ : Entity_Id) return Boolean is Ifaces_List : Elist_Id; Iface_Elmt : Elmt_Id; Iface : Entity_Id; begin if Is_Class_Wide_Type (Typ) and then Chars (Root_Type (Typ)) = Name_Reversible_Iterator and then Is_Predefined_File_Name (Unit_File_Name (Get_Source_Unit (Root_Type (Typ)))) then return True; elsif not Is_Tagged_Type (Typ) or else not Is_Derived_Type (Typ) then return False; else Collect_Interfaces (Typ, Ifaces_List); Iface_Elmt := First_Elmt (Ifaces_List); while Present (Iface_Elmt) loop Iface := Node (Iface_Elmt); if Chars (Iface) = Name_Reversible_Iterator and then Is_Predefined_File_Name (Unit_File_Name (Get_Source_Unit (Iface))) then return True; end if; Next_Elmt (Iface_Elmt); end loop; end if; return False; end Is_Reversible_Iterator; ---------------------- -- Is_Selector_Name -- ---------------------- function Is_Selector_Name (N : Node_Id) return Boolean is begin if not Is_List_Member (N) then declare P : constant Node_Id := Parent (N); begin return Nkind_In (P, N_Expanded_Name, N_Generic_Association, N_Parameter_Association, N_Selected_Component) and then Selector_Name (P) = N; end; else declare L : constant List_Id := List_Containing (N); P : constant Node_Id := Parent (L); begin return (Nkind (P) = N_Discriminant_Association and then Selector_Names (P) = L) or else (Nkind (P) = N_Component_Association and then Choices (P) = L); end; end if; end Is_Selector_Name; --------------------------------- -- Is_Single_Concurrent_Object -- --------------------------------- function Is_Single_Concurrent_Object (Id : Entity_Id) return Boolean is begin return Is_Single_Protected_Object (Id) or else Is_Single_Task_Object (Id); end Is_Single_Concurrent_Object; ------------------------------- -- Is_Single_Concurrent_Type -- ------------------------------- function Is_Single_Concurrent_Type (Id : Entity_Id) return Boolean is begin return Ekind_In (Id, E_Protected_Type, E_Task_Type) and then Is_Single_Concurrent_Type_Declaration (Declaration_Node (Id)); end Is_Single_Concurrent_Type; ------------------------------------------- -- Is_Single_Concurrent_Type_Declaration -- ------------------------------------------- function Is_Single_Concurrent_Type_Declaration (N : Node_Id) return Boolean is begin return Nkind_In (Original_Node (N), N_Single_Protected_Declaration, N_Single_Task_Declaration); end Is_Single_Concurrent_Type_Declaration; --------------------------------------------- -- Is_Single_Precision_Floating_Point_Type -- --------------------------------------------- function Is_Single_Precision_Floating_Point_Type (E : Entity_Id) return Boolean is begin return Is_Floating_Point_Type (E) and then Machine_Radix_Value (E) = Uint_2 and then Machine_Mantissa_Value (E) = Uint_24 and then Machine_Emax_Value (E) = Uint_2 ** Uint_7 and then Machine_Emin_Value (E) = Uint_3 - (Uint_2 ** Uint_7); end Is_Single_Precision_Floating_Point_Type; -------------------------------- -- Is_Single_Protected_Object -- -------------------------------- function Is_Single_Protected_Object (Id : Entity_Id) return Boolean is begin return Ekind (Id) = E_Variable and then Ekind (Etype (Id)) = E_Protected_Type and then Is_Single_Concurrent_Type (Etype (Id)); end Is_Single_Protected_Object; --------------------------- -- Is_Single_Task_Object -- --------------------------- function Is_Single_Task_Object (Id : Entity_Id) return Boolean is begin return Ekind (Id) = E_Variable and then Ekind (Etype (Id)) = E_Task_Type and then Is_Single_Concurrent_Type (Etype (Id)); end Is_Single_Task_Object; ------------------------------------- -- Is_SPARK_05_Initialization_Expr -- ------------------------------------- function Is_SPARK_05_Initialization_Expr (N : Node_Id) return Boolean is Is_Ok : Boolean; Expr : Node_Id; Comp_Assn : Node_Id; Orig_N : constant Node_Id := Original_Node (N); begin Is_Ok := True; if not Comes_From_Source (Orig_N) then goto Done; end if; pragma Assert (Nkind (Orig_N) in N_Subexpr); case Nkind (Orig_N) is when N_Character_Literal | N_Integer_Literal | N_Real_Literal | N_String_Literal => null; when N_Expanded_Name | N_Identifier => if Is_Entity_Name (Orig_N) and then Present (Entity (Orig_N)) -- needed in some cases then case Ekind (Entity (Orig_N)) is when E_Constant | E_Enumeration_Literal | E_Named_Integer | E_Named_Real => null; when others => if Is_Type (Entity (Orig_N)) then null; else Is_Ok := False; end if; end case; end if; when N_Qualified_Expression | N_Type_Conversion => Is_Ok := Is_SPARK_05_Initialization_Expr (Expression (Orig_N)); when N_Unary_Op => Is_Ok := Is_SPARK_05_Initialization_Expr (Right_Opnd (Orig_N)); when N_Binary_Op | N_Membership_Test | N_Short_Circuit => Is_Ok := Is_SPARK_05_Initialization_Expr (Left_Opnd (Orig_N)) and then Is_SPARK_05_Initialization_Expr (Right_Opnd (Orig_N)); when N_Aggregate | N_Extension_Aggregate => if Nkind (Orig_N) = N_Extension_Aggregate then Is_Ok := Is_SPARK_05_Initialization_Expr (Ancestor_Part (Orig_N)); end if; Expr := First (Expressions (Orig_N)); while Present (Expr) loop if not Is_SPARK_05_Initialization_Expr (Expr) then Is_Ok := False; goto Done; end if; Next (Expr); end loop; Comp_Assn := First (Component_Associations (Orig_N)); while Present (Comp_Assn) loop Expr := Expression (Comp_Assn); -- Note: test for Present here needed for box assocation if Present (Expr) and then not Is_SPARK_05_Initialization_Expr (Expr) then Is_Ok := False; goto Done; end if; Next (Comp_Assn); end loop; when N_Attribute_Reference => if Nkind (Prefix (Orig_N)) in N_Subexpr then Is_Ok := Is_SPARK_05_Initialization_Expr (Prefix (Orig_N)); end if; Expr := First (Expressions (Orig_N)); while Present (Expr) loop if not Is_SPARK_05_Initialization_Expr (Expr) then Is_Ok := False; goto Done; end if; Next (Expr); end loop; -- Selected components might be expanded named not yet resolved, so -- default on the safe side. (Eg on sparklex.ads) when N_Selected_Component => null; when others => Is_Ok := False; end case; <<Done>> return Is_Ok; end Is_SPARK_05_Initialization_Expr; ---------------------------------- -- Is_SPARK_05_Object_Reference -- ---------------------------------- function Is_SPARK_05_Object_Reference (N : Node_Id) return Boolean is begin if Is_Entity_Name (N) then return Present (Entity (N)) and then (Ekind_In (Entity (N), E_Constant, E_Variable) or else Ekind (Entity (N)) in Formal_Kind); else case Nkind (N) is when N_Selected_Component => return Is_SPARK_05_Object_Reference (Prefix (N)); when others => return False; end case; end if; end Is_SPARK_05_Object_Reference; ----------------------------- -- Is_Specific_Tagged_Type -- ----------------------------- function Is_Specific_Tagged_Type (Typ : Entity_Id) return Boolean is Full_Typ : Entity_Id; begin -- Handle private types if Is_Private_Type (Typ) and then Present (Full_View (Typ)) then Full_Typ := Full_View (Typ); else Full_Typ := Typ; end if; -- A specific tagged type is a non-class-wide tagged type return Is_Tagged_Type (Full_Typ) and not Is_Class_Wide_Type (Full_Typ); end Is_Specific_Tagged_Type; ------------------ -- Is_Statement -- ------------------ function Is_Statement (N : Node_Id) return Boolean is begin return Nkind (N) in N_Statement_Other_Than_Procedure_Call or else Nkind (N) = N_Procedure_Call_Statement; end Is_Statement; --------------------------------------- -- Is_Subprogram_Contract_Annotation -- --------------------------------------- function Is_Subprogram_Contract_Annotation (Item : Node_Id) return Boolean is Nam : Name_Id; begin if Nkind (Item) = N_Aspect_Specification then Nam := Chars (Identifier (Item)); else pragma Assert (Nkind (Item) = N_Pragma); Nam := Pragma_Name (Item); end if; return Nam = Name_Contract_Cases or else Nam = Name_Depends or else Nam = Name_Extensions_Visible or else Nam = Name_Global or else Nam = Name_Post or else Nam = Name_Post_Class or else Nam = Name_Postcondition or else Nam = Name_Pre or else Nam = Name_Pre_Class or else Nam = Name_Precondition or else Nam = Name_Refined_Depends or else Nam = Name_Refined_Global or else Nam = Name_Refined_Post or else Nam = Name_Test_Case; end Is_Subprogram_Contract_Annotation; -------------------------------------------------- -- Is_Subprogram_Stub_Without_Prior_Declaration -- -------------------------------------------------- function Is_Subprogram_Stub_Without_Prior_Declaration (N : Node_Id) return Boolean is begin -- A subprogram stub without prior declaration serves as declaration for -- the actual subprogram body. As such, it has an attached defining -- entity of E_[Generic_]Function or E_[Generic_]Procedure. return Nkind (N) = N_Subprogram_Body_Stub and then Ekind (Defining_Entity (N)) /= E_Subprogram_Body; end Is_Subprogram_Stub_Without_Prior_Declaration; -------------------------- -- Is_Suspension_Object -- -------------------------- function Is_Suspension_Object (Id : Entity_Id) return Boolean is begin -- This approach does an exact name match rather than to rely on -- RTSfind. Routine Is_Effectively_Volatile is used by clients of the -- front end at point where all auxiliary tables are locked and any -- modifications to them are treated as violations. Do not tamper with -- the tables, instead examine the Chars fields of all the scopes of Id. return Chars (Id) = Name_Suspension_Object and then Present (Scope (Id)) and then Chars (Scope (Id)) = Name_Synchronous_Task_Control and then Present (Scope (Scope (Id))) and then Chars (Scope (Scope (Id))) = Name_Ada and then Present (Scope (Scope (Scope (Id)))) and then Scope (Scope (Scope (Id))) = Standard_Standard; end Is_Suspension_Object; ---------------------------- -- Is_Synchronized_Object -- ---------------------------- function Is_Synchronized_Object (Id : Entity_Id) return Boolean is Prag : Node_Id; begin if Is_Object (Id) then -- The object is synchronized if it is of a type that yields a -- synchronized object. if Yields_Synchronized_Object (Etype (Id)) then return True; -- The object is synchronized if it is atomic and Async_Writers is -- enabled. elsif Is_Atomic (Id) and then Async_Writers_Enabled (Id) then return True; -- A constant is a synchronized object by default elsif Ekind (Id) = E_Constant then return True; -- A variable is a synchronized object if it is subject to pragma -- Constant_After_Elaboration. elsif Ekind (Id) = E_Variable then Prag := Get_Pragma (Id, Pragma_Constant_After_Elaboration); return Present (Prag) and then Is_Enabled_Pragma (Prag); end if; end if; -- Otherwise the input is not an object or it does not qualify as a -- synchronized object. return False; end Is_Synchronized_Object; --------------------------------- -- Is_Synchronized_Tagged_Type -- --------------------------------- function Is_Synchronized_Tagged_Type (E : Entity_Id) return Boolean is Kind : constant Entity_Kind := Ekind (Base_Type (E)); begin -- A task or protected type derived from an interface is a tagged type. -- Such a tagged type is called a synchronized tagged type, as are -- synchronized interfaces and private extensions whose declaration -- includes the reserved word synchronized. return (Is_Tagged_Type (E) and then (Kind = E_Task_Type or else Kind = E_Protected_Type)) or else (Is_Interface (E) and then Is_Synchronized_Interface (E)) or else (Ekind (E) = E_Record_Type_With_Private and then Nkind (Parent (E)) = N_Private_Extension_Declaration and then (Synchronized_Present (Parent (E)) or else Is_Synchronized_Interface (Etype (E)))); end Is_Synchronized_Tagged_Type; ----------------- -- Is_Transfer -- ----------------- function Is_Transfer (N : Node_Id) return Boolean is Kind : constant Node_Kind := Nkind (N); begin if Kind = N_Simple_Return_Statement or else Kind = N_Extended_Return_Statement or else Kind = N_Goto_Statement or else Kind = N_Raise_Statement or else Kind = N_Requeue_Statement then return True; elsif (Kind = N_Exit_Statement or else Kind in N_Raise_xxx_Error) and then No (Condition (N)) then return True; elsif Kind = N_Procedure_Call_Statement and then Is_Entity_Name (Name (N)) and then Present (Entity (Name (N))) and then No_Return (Entity (Name (N))) then return True; elsif Nkind (Original_Node (N)) = N_Raise_Statement then return True; else return False; end if; end Is_Transfer; ------------- -- Is_True -- ------------- function Is_True (U : Uint) return Boolean is begin return (U /= 0); end Is_True; -------------------------------------- -- Is_Unchecked_Conversion_Instance -- -------------------------------------- function Is_Unchecked_Conversion_Instance (Id : Entity_Id) return Boolean is Par : Node_Id; begin -- Look for a function whose generic parent is the predefined intrinsic -- function Unchecked_Conversion, or for one that renames such an -- instance. if Ekind (Id) = E_Function then Par := Parent (Id); if Nkind (Par) = N_Function_Specification then Par := Generic_Parent (Par); if Present (Par) then return Chars (Par) = Name_Unchecked_Conversion and then Is_Intrinsic_Subprogram (Par) and then Is_Predefined_File_Name (Unit_File_Name (Get_Source_Unit (Par))); else return Present (Alias (Id)) and then Is_Unchecked_Conversion_Instance (Alias (Id)); end if; end if; end if; return False; end Is_Unchecked_Conversion_Instance; ------------------------------- -- Is_Universal_Numeric_Type -- ------------------------------- function Is_Universal_Numeric_Type (T : Entity_Id) return Boolean is begin return T = Universal_Integer or else T = Universal_Real; end Is_Universal_Numeric_Type; ---------------------------- -- Is_Variable_Size_Array -- ---------------------------- function Is_Variable_Size_Array (E : Entity_Id) return Boolean is Idx : Node_Id; begin pragma Assert (Is_Array_Type (E)); -- Check if some index is initialized with a non-constant value Idx := First_Index (E); while Present (Idx) loop if Nkind (Idx) = N_Range then if not Is_Constant_Bound (Low_Bound (Idx)) or else not Is_Constant_Bound (High_Bound (Idx)) then return True; end if; end if; Idx := Next_Index (Idx); end loop; return False; end Is_Variable_Size_Array; ----------------------------- -- Is_Variable_Size_Record -- ----------------------------- function Is_Variable_Size_Record (E : Entity_Id) return Boolean is Comp : Entity_Id; Comp_Typ : Entity_Id; begin pragma Assert (Is_Record_Type (E)); Comp := First_Entity (E); while Present (Comp) loop Comp_Typ := Etype (Comp); -- Recursive call if the record type has discriminants if Is_Record_Type (Comp_Typ) and then Has_Discriminants (Comp_Typ) and then Is_Variable_Size_Record (Comp_Typ) then return True; elsif Is_Array_Type (Comp_Typ) and then Is_Variable_Size_Array (Comp_Typ) then return True; end if; Next_Entity (Comp); end loop; return False; end Is_Variable_Size_Record; ----------------- -- Is_Variable -- ----------------- function Is_Variable (N : Node_Id; Use_Original_Node : Boolean := True) return Boolean is Orig_Node : Node_Id; function In_Protected_Function (E : Entity_Id) return Boolean; -- Within a protected function, the private components of the enclosing -- protected type are constants. A function nested within a (protected) -- procedure is not itself protected. Within the body of a protected -- function the current instance of the protected type is a constant. function Is_Variable_Prefix (P : Node_Id) return Boolean; -- Prefixes can involve implicit dereferences, in which case we must -- test for the case of a reference of a constant access type, which can -- can never be a variable. --------------------------- -- In_Protected_Function -- --------------------------- function In_Protected_Function (E : Entity_Id) return Boolean is Prot : Entity_Id; S : Entity_Id; begin -- E is the current instance of a type if Is_Type (E) then Prot := E; -- E is an object else Prot := Scope (E); end if; if not Is_Protected_Type (Prot) then return False; else S := Current_Scope; while Present (S) and then S /= Prot loop if Ekind (S) = E_Function and then Scope (S) = Prot then return True; end if; S := Scope (S); end loop; return False; end if; end In_Protected_Function; ------------------------ -- Is_Variable_Prefix -- ------------------------ function Is_Variable_Prefix (P : Node_Id) return Boolean is begin if Is_Access_Type (Etype (P)) then return not Is_Access_Constant (Root_Type (Etype (P))); -- For the case of an indexed component whose prefix has a packed -- array type, the prefix has been rewritten into a type conversion. -- Determine variable-ness from the converted expression. elsif Nkind (P) = N_Type_Conversion and then not Comes_From_Source (P) and then Is_Array_Type (Etype (P)) and then Is_Packed (Etype (P)) then return Is_Variable (Expression (P)); else return Is_Variable (P); end if; end Is_Variable_Prefix; -- Start of processing for Is_Variable begin -- Special check, allow x'Deref(expr) as a variable if Nkind (N) = N_Attribute_Reference and then Attribute_Name (N) = Name_Deref then return True; end if; -- Check if we perform the test on the original node since this may be a -- test of syntactic categories which must not be disturbed by whatever -- rewriting might have occurred. For example, an aggregate, which is -- certainly NOT a variable, could be turned into a variable by -- expansion. if Use_Original_Node then Orig_Node := Original_Node (N); else Orig_Node := N; end if; -- Definitely OK if Assignment_OK is set. Since this is something that -- only gets set for expanded nodes, the test is on N, not Orig_Node. if Nkind (N) in N_Subexpr and then Assignment_OK (N) then return True; -- Normally we go to the original node, but there is one exception where -- we use the rewritten node, namely when it is an explicit dereference. -- The generated code may rewrite a prefix which is an access type with -- an explicit dereference. The dereference is a variable, even though -- the original node may not be (since it could be a constant of the -- access type). -- In Ada 2005 we have a further case to consider: the prefix may be a -- function call given in prefix notation. The original node appears to -- be a selected component, but we need to examine the call. elsif Nkind (N) = N_Explicit_Dereference and then Nkind (Orig_Node) /= N_Explicit_Dereference and then Present (Etype (Orig_Node)) and then Is_Access_Type (Etype (Orig_Node)) then -- Note that if the prefix is an explicit dereference that does not -- come from source, we must check for a rewritten function call in -- prefixed notation before other forms of rewriting, to prevent a -- compiler crash. return (Nkind (Orig_Node) = N_Function_Call and then not Is_Access_Constant (Etype (Prefix (N)))) or else Is_Variable_Prefix (Original_Node (Prefix (N))); -- in Ada 2012, the dereference may have been added for a type with -- a declared implicit dereference aspect. Check that it is not an -- access to constant. elsif Nkind (N) = N_Explicit_Dereference and then Present (Etype (Orig_Node)) and then Ada_Version >= Ada_2012 and then Has_Implicit_Dereference (Etype (Orig_Node)) then return not Is_Access_Constant (Etype (Prefix (N))); -- A function call is never a variable elsif Nkind (N) = N_Function_Call then return False; -- All remaining checks use the original node elsif Is_Entity_Name (Orig_Node) and then Present (Entity (Orig_Node)) then declare E : constant Entity_Id := Entity (Orig_Node); K : constant Entity_Kind := Ekind (E); begin return (K = E_Variable and then Nkind (Parent (E)) /= N_Exception_Handler) or else (K = E_Component and then not In_Protected_Function (E)) or else K = E_Out_Parameter or else K = E_In_Out_Parameter or else K = E_Generic_In_Out_Parameter -- Current instance of type. If this is a protected type, check -- we are not within the body of one of its protected functions. or else (Is_Type (E) and then In_Open_Scopes (E) and then not In_Protected_Function (E)) or else (Is_Incomplete_Or_Private_Type (E) and then In_Open_Scopes (Full_View (E))); end; else case Nkind (Orig_Node) is when N_Indexed_Component | N_Slice => return Is_Variable_Prefix (Prefix (Orig_Node)); when N_Selected_Component => return (Is_Variable (Selector_Name (Orig_Node)) and then Is_Variable_Prefix (Prefix (Orig_Node))) or else (Nkind (N) = N_Expanded_Name and then Scope (Entity (N)) = Entity (Prefix (N))); -- For an explicit dereference, the type of the prefix cannot -- be an access to constant or an access to subprogram. when N_Explicit_Dereference => declare Typ : constant Entity_Id := Etype (Prefix (Orig_Node)); begin return Is_Access_Type (Typ) and then not Is_Access_Constant (Root_Type (Typ)) and then Ekind (Typ) /= E_Access_Subprogram_Type; end; -- The type conversion is the case where we do not deal with the -- context dependent special case of an actual parameter. Thus -- the type conversion is only considered a variable for the -- purposes of this routine if the target type is tagged. However, -- a type conversion is considered to be a variable if it does not -- come from source (this deals for example with the conversions -- of expressions to their actual subtypes). when N_Type_Conversion => return Is_Variable (Expression (Orig_Node)) and then (not Comes_From_Source (Orig_Node) or else (Is_Tagged_Type (Etype (Subtype_Mark (Orig_Node))) and then Is_Tagged_Type (Etype (Expression (Orig_Node))))); -- GNAT allows an unchecked type conversion as a variable. This -- only affects the generation of internal expanded code, since -- calls to instantiations of Unchecked_Conversion are never -- considered variables (since they are function calls). when N_Unchecked_Type_Conversion => return Is_Variable (Expression (Orig_Node)); when others => return False; end case; end if; end Is_Variable; ------------------------------ -- Is_Verifiable_DIC_Pragma -- ------------------------------ function Is_Verifiable_DIC_Pragma (Prag : Node_Id) return Boolean is Args : constant List_Id := Pragma_Argument_Associations (Prag); begin -- To qualify as verifiable, a DIC pragma must have a non-null argument return Present (Args) and then Nkind (Get_Pragma_Arg (First (Args))) /= N_Null; end Is_Verifiable_DIC_Pragma; --------------------------- -- Is_Visibly_Controlled -- --------------------------- function Is_Visibly_Controlled (T : Entity_Id) return Boolean is Root : constant Entity_Id := Root_Type (T); begin return Chars (Scope (Root)) = Name_Finalization and then Chars (Scope (Scope (Root))) = Name_Ada and then Scope (Scope (Scope (Root))) = Standard_Standard; end Is_Visibly_Controlled; -------------------------- -- Is_Volatile_Function -- -------------------------- function Is_Volatile_Function (Func_Id : Entity_Id) return Boolean is begin pragma Assert (Ekind_In (Func_Id, E_Function, E_Generic_Function)); -- A function declared within a protected type is volatile if Is_Protected_Type (Scope (Func_Id)) then return True; -- An instance of Ada.Unchecked_Conversion is a volatile function if -- either the source or the target are effectively volatile. elsif Is_Unchecked_Conversion_Instance (Func_Id) and then Has_Effectively_Volatile_Profile (Func_Id) then return True; -- Otherwise the function is treated as volatile if it is subject to -- enabled pragma Volatile_Function. else return Is_Enabled_Pragma (Get_Pragma (Func_Id, Pragma_Volatile_Function)); end if; end Is_Volatile_Function; ------------------------ -- Is_Volatile_Object -- ------------------------ function Is_Volatile_Object (N : Node_Id) return Boolean is function Is_Volatile_Prefix (N : Node_Id) return Boolean; -- If prefix is an implicit dereference, examine designated type function Object_Has_Volatile_Components (N : Node_Id) return Boolean; -- Determines if given object has volatile components ------------------------ -- Is_Volatile_Prefix -- ------------------------ function Is_Volatile_Prefix (N : Node_Id) return Boolean is Typ : constant Entity_Id := Etype (N); begin if Is_Access_Type (Typ) then declare Dtyp : constant Entity_Id := Designated_Type (Typ); begin return Is_Volatile (Dtyp) or else Has_Volatile_Components (Dtyp); end; else return Object_Has_Volatile_Components (N); end if; end Is_Volatile_Prefix; ------------------------------------ -- Object_Has_Volatile_Components -- ------------------------------------ function Object_Has_Volatile_Components (N : Node_Id) return Boolean is Typ : constant Entity_Id := Etype (N); begin if Is_Volatile (Typ) or else Has_Volatile_Components (Typ) then return True; elsif Is_Entity_Name (N) and then (Has_Volatile_Components (Entity (N)) or else Is_Volatile (Entity (N))) then return True; elsif Nkind (N) = N_Indexed_Component or else Nkind (N) = N_Selected_Component then return Is_Volatile_Prefix (Prefix (N)); else return False; end if; end Object_Has_Volatile_Components; -- Start of processing for Is_Volatile_Object begin if Nkind (N) = N_Defining_Identifier then return Is_Volatile (N) or else Is_Volatile (Etype (N)); elsif Nkind (N) = N_Expanded_Name then return Is_Volatile_Object (Entity (N)); elsif Is_Volatile (Etype (N)) or else (Is_Entity_Name (N) and then Is_Volatile (Entity (N))) then return True; elsif Nkind_In (N, N_Indexed_Component, N_Selected_Component) and then Is_Volatile_Prefix (Prefix (N)) then return True; elsif Nkind (N) = N_Selected_Component and then Is_Volatile (Entity (Selector_Name (N))) then return True; else return False; end if; end Is_Volatile_Object; --------------------------- -- Itype_Has_Declaration -- --------------------------- function Itype_Has_Declaration (Id : Entity_Id) return Boolean is begin pragma Assert (Is_Itype (Id)); return Present (Parent (Id)) and then Nkind_In (Parent (Id), N_Full_Type_Declaration, N_Subtype_Declaration) and then Defining_Entity (Parent (Id)) = Id; end Itype_Has_Declaration; ------------------------- -- Kill_Current_Values -- ------------------------- procedure Kill_Current_Values (Ent : Entity_Id; Last_Assignment_Only : Boolean := False) is begin if Is_Assignable (Ent) then Set_Last_Assignment (Ent, Empty); end if; if Is_Object (Ent) then if not Last_Assignment_Only then Kill_Checks (Ent); Set_Current_Value (Ent, Empty); -- Do not reset the Is_Known_[Non_]Null and Is_Known_Valid flags -- for a constant. Once the constant is elaborated, its value is -- not changed, therefore the associated flags that describe the -- value should not be modified either. if Ekind (Ent) = E_Constant then null; -- Non-constant entities else if not Can_Never_Be_Null (Ent) then Set_Is_Known_Non_Null (Ent, False); end if; Set_Is_Known_Null (Ent, False); -- Reset the Is_Known_Valid flag unless the type is always -- valid. This does not apply to a loop parameter because its -- bounds are defined by the loop header and therefore always -- valid. if not Is_Known_Valid (Etype (Ent)) and then Ekind (Ent) /= E_Loop_Parameter then Set_Is_Known_Valid (Ent, False); end if; end if; end if; end if; end Kill_Current_Values; procedure Kill_Current_Values (Last_Assignment_Only : Boolean := False) is S : Entity_Id; procedure Kill_Current_Values_For_Entity_Chain (E : Entity_Id); -- Clear current value for entity E and all entities chained to E ------------------------------------------ -- Kill_Current_Values_For_Entity_Chain -- ------------------------------------------ procedure Kill_Current_Values_For_Entity_Chain (E : Entity_Id) is Ent : Entity_Id; begin Ent := E; while Present (Ent) loop Kill_Current_Values (Ent, Last_Assignment_Only); Next_Entity (Ent); end loop; end Kill_Current_Values_For_Entity_Chain; -- Start of processing for Kill_Current_Values begin -- Kill all saved checks, a special case of killing saved values if not Last_Assignment_Only then Kill_All_Checks; end if; -- Loop through relevant scopes, which includes the current scope and -- any parent scopes if the current scope is a block or a package. S := Current_Scope; Scope_Loop : loop -- Clear current values of all entities in current scope Kill_Current_Values_For_Entity_Chain (First_Entity (S)); -- If scope is a package, also clear current values of all private -- entities in the scope. if Is_Package_Or_Generic_Package (S) or else Is_Concurrent_Type (S) then Kill_Current_Values_For_Entity_Chain (First_Private_Entity (S)); end if; -- If this is a not a subprogram, deal with parents if not Is_Subprogram (S) then S := Scope (S); exit Scope_Loop when S = Standard_Standard; else exit Scope_Loop; end if; end loop Scope_Loop; end Kill_Current_Values; -------------------------- -- Kill_Size_Check_Code -- -------------------------- procedure Kill_Size_Check_Code (E : Entity_Id) is begin if (Ekind (E) = E_Constant or else Ekind (E) = E_Variable) and then Present (Size_Check_Code (E)) then Remove (Size_Check_Code (E)); Set_Size_Check_Code (E, Empty); end if; end Kill_Size_Check_Code; -------------------------- -- Known_To_Be_Assigned -- -------------------------- function Known_To_Be_Assigned (N : Node_Id) return Boolean is P : constant Node_Id := Parent (N); begin case Nkind (P) is -- Test left side of assignment when N_Assignment_Statement => return N = Name (P); -- Function call arguments are never lvalues when N_Function_Call => return False; -- Positional parameter for procedure or accept call when N_Accept_Statement | N_Procedure_Call_Statement => declare Proc : Entity_Id; Form : Entity_Id; Act : Node_Id; begin Proc := Get_Subprogram_Entity (P); if No (Proc) then return False; end if; -- If we are not a list member, something is strange, so -- be conservative and return False. if not Is_List_Member (N) then return False; end if; -- We are going to find the right formal by stepping forward -- through the formals, as we step backwards in the actuals. Form := First_Formal (Proc); Act := N; loop -- If no formal, something is weird, so be conservative -- and return False. if No (Form) then return False; end if; Prev (Act); exit when No (Act); Next_Formal (Form); end loop; return Ekind (Form) /= E_In_Parameter; end; -- Named parameter for procedure or accept call when N_Parameter_Association => declare Proc : Entity_Id; Form : Entity_Id; begin Proc := Get_Subprogram_Entity (Parent (P)); if No (Proc) then return False; end if; -- Loop through formals to find the one that matches Form := First_Formal (Proc); loop -- If no matching formal, that's peculiar, some kind of -- previous error, so return False to be conservative. -- Actually this also happens in legal code in the case -- where P is a parameter association for an Extra_Formal??? if No (Form) then return False; end if; -- Else test for match if Chars (Form) = Chars (Selector_Name (P)) then return Ekind (Form) /= E_In_Parameter; end if; Next_Formal (Form); end loop; end; -- Test for appearing in a conversion that itself appears -- in an lvalue context, since this should be an lvalue. when N_Type_Conversion => return Known_To_Be_Assigned (P); -- All other references are definitely not known to be modifications when others => return False; end case; end Known_To_Be_Assigned; --------------------------- -- Last_Source_Statement -- --------------------------- function Last_Source_Statement (HSS : Node_Id) return Node_Id is N : Node_Id; begin N := Last (Statements (HSS)); while Present (N) loop exit when Comes_From_Source (N); Prev (N); end loop; return N; end Last_Source_Statement; ---------------------------------- -- Matching_Static_Array_Bounds -- ---------------------------------- function Matching_Static_Array_Bounds (L_Typ : Node_Id; R_Typ : Node_Id) return Boolean is L_Ndims : constant Nat := Number_Dimensions (L_Typ); R_Ndims : constant Nat := Number_Dimensions (R_Typ); L_Index : Node_Id; R_Index : Node_Id; L_Low : Node_Id; L_High : Node_Id; L_Len : Uint; R_Low : Node_Id; R_High : Node_Id; R_Len : Uint; begin if L_Ndims /= R_Ndims then return False; end if; -- Unconstrained types do not have static bounds if not Is_Constrained (L_Typ) or else not Is_Constrained (R_Typ) then return False; end if; -- First treat specially the first dimension, as the lower bound and -- length of string literals are not stored like those of arrays. if Ekind (L_Typ) = E_String_Literal_Subtype then L_Low := String_Literal_Low_Bound (L_Typ); L_Len := String_Literal_Length (L_Typ); else L_Index := First_Index (L_Typ); Get_Index_Bounds (L_Index, L_Low, L_High); if Is_OK_Static_Expression (L_Low) and then Is_OK_Static_Expression (L_High) then if Expr_Value (L_High) < Expr_Value (L_Low) then L_Len := Uint_0; else L_Len := (Expr_Value (L_High) - Expr_Value (L_Low)) + 1; end if; else return False; end if; end if; if Ekind (R_Typ) = E_String_Literal_Subtype then R_Low := String_Literal_Low_Bound (R_Typ); R_Len := String_Literal_Length (R_Typ); else R_Index := First_Index (R_Typ); Get_Index_Bounds (R_Index, R_Low, R_High); if Is_OK_Static_Expression (R_Low) and then Is_OK_Static_Expression (R_High) then if Expr_Value (R_High) < Expr_Value (R_Low) then R_Len := Uint_0; else R_Len := (Expr_Value (R_High) - Expr_Value (R_Low)) + 1; end if; else return False; end if; end if; if (Is_OK_Static_Expression (L_Low) and then Is_OK_Static_Expression (R_Low)) and then Expr_Value (L_Low) = Expr_Value (R_Low) and then L_Len = R_Len then null; else return False; end if; -- Then treat all other dimensions for Indx in 2 .. L_Ndims loop Next (L_Index); Next (R_Index); Get_Index_Bounds (L_Index, L_Low, L_High); Get_Index_Bounds (R_Index, R_Low, R_High); if (Is_OK_Static_Expression (L_Low) and then Is_OK_Static_Expression (L_High) and then Is_OK_Static_Expression (R_Low) and then Is_OK_Static_Expression (R_High)) and then (Expr_Value (L_Low) = Expr_Value (R_Low) and then Expr_Value (L_High) = Expr_Value (R_High)) then null; else return False; end if; end loop; -- If we fall through the loop, all indexes matched return True; end Matching_Static_Array_Bounds; ------------------- -- May_Be_Lvalue -- ------------------- function May_Be_Lvalue (N : Node_Id) return Boolean is P : constant Node_Id := Parent (N); begin case Nkind (P) is -- Test left side of assignment when N_Assignment_Statement => return N = Name (P); -- Test prefix of component or attribute. Note that the prefix of an -- explicit or implicit dereference cannot be an l-value. In the case -- of a 'Read attribute, the reference can be an actual in the -- argument list of the attribute. when N_Attribute_Reference => return (N = Prefix (P) and then Name_Implies_Lvalue_Prefix (Attribute_Name (P))) or else Attribute_Name (P) = Name_Read; -- For an expanded name, the name is an lvalue if the expanded name -- is an lvalue, but the prefix is never an lvalue, since it is just -- the scope where the name is found. when N_Expanded_Name => if N = Prefix (P) then return May_Be_Lvalue (P); else return False; end if; -- For a selected component A.B, A is certainly an lvalue if A.B is. -- B is a little interesting, if we have A.B := 3, there is some -- discussion as to whether B is an lvalue or not, we choose to say -- it is. Note however that A is not an lvalue if it is of an access -- type since this is an implicit dereference. when N_Selected_Component => if N = Prefix (P) and then Present (Etype (N)) and then Is_Access_Type (Etype (N)) then return False; else return May_Be_Lvalue (P); end if; -- For an indexed component or slice, the index or slice bounds is -- never an lvalue. The prefix is an lvalue if the indexed component -- or slice is an lvalue, except if it is an access type, where we -- have an implicit dereference. when N_Indexed_Component | N_Slice => if N /= Prefix (P) or else (Present (Etype (N)) and then Is_Access_Type (Etype (N))) then return False; else return May_Be_Lvalue (P); end if; -- Prefix of a reference is an lvalue if the reference is an lvalue when N_Reference => return May_Be_Lvalue (P); -- Prefix of explicit dereference is never an lvalue when N_Explicit_Dereference => return False; -- Positional parameter for subprogram, entry, or accept call. -- In older versions of Ada function call arguments are never -- lvalues. In Ada 2012 functions can have in-out parameters. when N_Accept_Statement | N_Entry_Call_Statement | N_Subprogram_Call => if Nkind (P) = N_Function_Call and then Ada_Version < Ada_2012 then return False; end if; -- The following mechanism is clumsy and fragile. A single flag -- set in Resolve_Actuals would be preferable ??? declare Proc : Entity_Id; Form : Entity_Id; Act : Node_Id; begin Proc := Get_Subprogram_Entity (P); if No (Proc) then return True; end if; -- If we are not a list member, something is strange, so be -- conservative and return True. if not Is_List_Member (N) then return True; end if; -- We are going to find the right formal by stepping forward -- through the formals, as we step backwards in the actuals. Form := First_Formal (Proc); Act := N; loop -- If no formal, something is weird, so be conservative and -- return True. if No (Form) then return True; end if; Prev (Act); exit when No (Act); Next_Formal (Form); end loop; return Ekind (Form) /= E_In_Parameter; end; -- Named parameter for procedure or accept call when N_Parameter_Association => declare Proc : Entity_Id; Form : Entity_Id; begin Proc := Get_Subprogram_Entity (Parent (P)); if No (Proc) then return True; end if; -- Loop through formals to find the one that matches Form := First_Formal (Proc); loop -- If no matching formal, that's peculiar, some kind of -- previous error, so return True to be conservative. -- Actually happens with legal code for an unresolved call -- where we may get the wrong homonym??? if No (Form) then return True; end if; -- Else test for match if Chars (Form) = Chars (Selector_Name (P)) then return Ekind (Form) /= E_In_Parameter; end if; Next_Formal (Form); end loop; end; -- Test for appearing in a conversion that itself appears in an -- lvalue context, since this should be an lvalue. when N_Type_Conversion => return May_Be_Lvalue (P); -- Test for appearance in object renaming declaration when N_Object_Renaming_Declaration => return True; -- All other references are definitely not lvalues when others => return False; end case; end May_Be_Lvalue; ----------------------- -- Mark_Coextensions -- ----------------------- procedure Mark_Coextensions (Context_Nod : Node_Id; Root_Nod : Node_Id) is Is_Dynamic : Boolean; -- Indicates whether the context causes nested coextensions to be -- dynamic or static function Mark_Allocator (N : Node_Id) return Traverse_Result; -- Recognize an allocator node and label it as a dynamic coextension -------------------- -- Mark_Allocator -- -------------------- function Mark_Allocator (N : Node_Id) return Traverse_Result is begin if Nkind (N) = N_Allocator then if Is_Dynamic then Set_Is_Dynamic_Coextension (N); -- If the allocator expression is potentially dynamic, it may -- be expanded out of order and require dynamic allocation -- anyway, so we treat the coextension itself as dynamic. -- Potential optimization ??? elsif Nkind (Expression (N)) = N_Qualified_Expression and then Nkind (Expression (Expression (N))) = N_Op_Concat then Set_Is_Dynamic_Coextension (N); else Set_Is_Static_Coextension (N); end if; end if; return OK; end Mark_Allocator; procedure Mark_Allocators is new Traverse_Proc (Mark_Allocator); -- Start of processing for Mark_Coextensions begin -- An allocator that appears on the right-hand side of an assignment is -- treated as a potentially dynamic coextension when the right-hand side -- is an allocator or a qualified expression. -- Obj := new ...'(new Coextension ...); if Nkind (Context_Nod) = N_Assignment_Statement then Is_Dynamic := Nkind_In (Expression (Context_Nod), N_Allocator, N_Qualified_Expression); -- An allocator that appears within the expression of a simple return -- statement is treated as a potentially dynamic coextension when the -- expression is either aggregate, allocator, or qualified expression. -- return (new Coextension ...); -- return new ...'(new Coextension ...); elsif Nkind (Context_Nod) = N_Simple_Return_Statement then Is_Dynamic := Nkind_In (Expression (Context_Nod), N_Aggregate, N_Allocator, N_Qualified_Expression); -- An allocator that appears within the initialization expression of an -- object declaration is considered a potentially dynamic coextension -- when the initialization expression is an allocator or a qualified -- expression. -- Obj : ... := new ...'(new Coextension ...); -- A similar case arises when the object declaration is part of an -- extended return statement. -- return Obj : ... := new ...'(new Coextension ...); -- return Obj : ... := (new Coextension ...); elsif Nkind (Context_Nod) = N_Object_Declaration then Is_Dynamic := Nkind_In (Root_Nod, N_Allocator, N_Qualified_Expression) or else Nkind (Parent (Context_Nod)) = N_Extended_Return_Statement; -- This routine should not be called with constructs that cannot contain -- coextensions. else raise Program_Error; end if; Mark_Allocators (Root_Nod); end Mark_Coextensions; ---------------------- -- Needs_One_Actual -- ---------------------- function Needs_One_Actual (E : Entity_Id) return Boolean is Formal : Entity_Id; begin -- Ada 2005 or later, and formals present if Ada_Version >= Ada_2005 and then Present (First_Formal (E)) and then No (Default_Value (First_Formal (E))) then Formal := Next_Formal (First_Formal (E)); while Present (Formal) loop if No (Default_Value (Formal)) then return False; end if; Next_Formal (Formal); end loop; return True; -- Ada 83/95 or no formals else return False; end if; end Needs_One_Actual; ------------------------ -- New_Copy_List_Tree -- ------------------------ function New_Copy_List_Tree (List : List_Id) return List_Id is NL : List_Id; E : Node_Id; begin if List = No_List then return No_List; else NL := New_List; E := First (List); while Present (E) loop Append (New_Copy_Tree (E), NL); E := Next (E); end loop; return NL; end if; end New_Copy_List_Tree; ------------------- -- New_Copy_Tree -- ------------------- function New_Copy_Tree (Source : Node_Id; Map : Elist_Id := No_Elist; New_Sloc : Source_Ptr := No_Location; New_Scope : Entity_Id := Empty) return Node_Id is ------------------------------------ -- Auxiliary Data and Subprograms -- ------------------------------------ use Atree.Unchecked_Access; use Atree_Private_Part; -- Our approach here requires a two pass traversal of the tree. The -- first pass visits all nodes that eventually will be copied looking -- for defining Itypes. If any defining Itypes are found, then they are -- copied, and an entry is added to the replacement map. In the second -- phase, the tree is copied, using the replacement map to replace any -- Itype references within the copied tree. -- The following hash tables are used if the Map supplied has more than -- hash threshold entries to speed up access to the map. If there are -- fewer entries, then the map is searched sequentially (because setting -- up a hash table for only a few entries takes more time than it saves. subtype NCT_Header_Num is Int range 0 .. 511; -- Defines range of headers in hash tables (512 headers) function New_Copy_Hash (E : Entity_Id) return NCT_Header_Num; -- Hash function used for hash operations --------------- -- NCT_Assoc -- --------------- -- The hash table NCT_Assoc associates old entities in the table with -- their corresponding new entities (i.e. the pairs of entries presented -- in the original Map argument are Key-Element pairs). package NCT_Assoc is new Simple_HTable ( Header_Num => NCT_Header_Num, Element => Entity_Id, No_Element => Empty, Key => Entity_Id, Hash => New_Copy_Hash, Equal => Types."="); --------------------- -- NCT_Itype_Assoc -- --------------------- -- The hash table NCT_Itype_Assoc contains entries only for those old -- nodes which have a non-empty Associated_Node_For_Itype set. The key -- is the associated node, and the element is the new node itself (NOT -- the associated node for the new node). package NCT_Itype_Assoc is new Simple_HTable ( Header_Num => NCT_Header_Num, Element => Entity_Id, No_Element => Empty, Key => Entity_Id, Hash => New_Copy_Hash, Equal => Types."="); function Assoc (N : Node_Or_Entity_Id) return Node_Id; -- Called during second phase to map entities into their corresponding -- copies using the hash table. If the argument is not an entity, or is -- not in the hash table, then it is returned unchanged. procedure Build_NCT_Hash_Tables; -- Builds hash tables. function Copy_Elist_With_Replacement (Old_Elist : Elist_Id) return Elist_Id; -- Called during second phase to copy element list doing replacements procedure Copy_Itype_With_Replacement (New_Itype : Entity_Id); -- Called during the second phase to process a copied Itype. The actual -- copy happened during the first phase (so that we could make the entry -- in the mapping), but we still have to deal with the descendants of -- the copied Itype and copy them where necessary. function Copy_List_With_Replacement (Old_List : List_Id) return List_Id; -- Called during second phase to copy list doing replacements function Copy_Node_With_Replacement (Old_Node : Node_Id) return Node_Id; -- Called during second phase to copy node doing replacements procedure Visit_Elist (E : Elist_Id); -- Called during first phase to visit all elements of an Elist procedure Visit_Field (F : Union_Id; N : Node_Id); -- Visit a single field, recursing to call Visit_Node or Visit_List if -- the field is a syntactic descendant of the current node (i.e. its -- parent is Node N). procedure Visit_Itype (Old_Itype : Entity_Id); -- Called during first phase to visit subsidiary fields of a defining -- Itype, and also create a copy and make an entry in the replacement -- map for the new copy. procedure Visit_List (L : List_Id); -- Called during first phase to visit all elements of a List procedure Visit_Node (N : Node_Or_Entity_Id); -- Called during first phase to visit a node and all its subtrees ----------- -- Assoc -- ----------- function Assoc (N : Node_Or_Entity_Id) return Node_Id is Ent : Entity_Id; begin if Nkind (N) not in N_Entity then return N; else Ent := NCT_Assoc.Get (Entity_Id (N)); if Present (Ent) then return Ent; end if; end if; return N; end Assoc; --------------------------- -- Build_NCT_Hash_Tables -- --------------------------- procedure Build_NCT_Hash_Tables is Elmt : Elmt_Id; Ent : Entity_Id; begin if No (Map) then return; end if; Elmt := First_Elmt (Map); while Present (Elmt) loop Ent := Node (Elmt); -- Get new entity, and associate old and new Next_Elmt (Elmt); NCT_Assoc.Set (Ent, Node (Elmt)); if Is_Type (Ent) then declare Anode : constant Entity_Id := Associated_Node_For_Itype (Ent); begin if Present (Anode) then -- Enter a link between the associated node of the old -- Itype and the new Itype, for updating later when node -- is copied. NCT_Itype_Assoc.Set (Anode, Node (Elmt)); end if; end; end if; Next_Elmt (Elmt); end loop; end Build_NCT_Hash_Tables; --------------------------------- -- Copy_Elist_With_Replacement -- --------------------------------- function Copy_Elist_With_Replacement (Old_Elist : Elist_Id) return Elist_Id is M : Elmt_Id; New_Elist : Elist_Id; begin if No (Old_Elist) then return No_Elist; else New_Elist := New_Elmt_List; M := First_Elmt (Old_Elist); while Present (M) loop Append_Elmt (Copy_Node_With_Replacement (Node (M)), New_Elist); Next_Elmt (M); end loop; end if; return New_Elist; end Copy_Elist_With_Replacement; --------------------------------- -- Copy_Itype_With_Replacement -- --------------------------------- -- This routine exactly parallels its phase one analog Visit_Itype, procedure Copy_Itype_With_Replacement (New_Itype : Entity_Id) is begin -- Translate Next_Entity, Scope, and Etype fields, in case they -- reference entities that have been mapped into copies. Set_Next_Entity (New_Itype, Assoc (Next_Entity (New_Itype))); Set_Etype (New_Itype, Assoc (Etype (New_Itype))); if Present (New_Scope) then Set_Scope (New_Itype, New_Scope); else Set_Scope (New_Itype, Assoc (Scope (New_Itype))); end if; -- Copy referenced fields if Is_Discrete_Type (New_Itype) then Set_Scalar_Range (New_Itype, Copy_Node_With_Replacement (Scalar_Range (New_Itype))); elsif Has_Discriminants (Base_Type (New_Itype)) then Set_Discriminant_Constraint (New_Itype, Copy_Elist_With_Replacement (Discriminant_Constraint (New_Itype))); elsif Is_Array_Type (New_Itype) then if Present (First_Index (New_Itype)) then Set_First_Index (New_Itype, First (Copy_List_With_Replacement (List_Containing (First_Index (New_Itype))))); end if; if Is_Packed (New_Itype) then Set_Packed_Array_Impl_Type (New_Itype, Copy_Node_With_Replacement (Packed_Array_Impl_Type (New_Itype))); end if; end if; end Copy_Itype_With_Replacement; -------------------------------- -- Copy_List_With_Replacement -- -------------------------------- function Copy_List_With_Replacement (Old_List : List_Id) return List_Id is New_List : List_Id; E : Node_Id; begin if Old_List = No_List then return No_List; else New_List := Empty_List; E := First (Old_List); while Present (E) loop Append (Copy_Node_With_Replacement (E), New_List); Next (E); end loop; return New_List; end if; end Copy_List_With_Replacement; -------------------------------- -- Copy_Node_With_Replacement -- -------------------------------- function Copy_Node_With_Replacement (Old_Node : Node_Id) return Node_Id is New_Node : Node_Id; procedure Adjust_Named_Associations (Old_Node : Node_Id; New_Node : Node_Id); -- If a call node has named associations, these are chained through -- the First_Named_Actual, Next_Named_Actual links. These must be -- propagated separately to the new parameter list, because these -- are not syntactic fields. function Copy_Field_With_Replacement (Field : Union_Id) return Union_Id; -- Given Field, which is a field of Old_Node, return a copy of it -- if it is a syntactic field (i.e. its parent is Node), setting -- the parent of the copy to poit to New_Node. Otherwise returns -- the field (possibly mapped if it is an entity). ------------------------------- -- Adjust_Named_Associations -- ------------------------------- procedure Adjust_Named_Associations (Old_Node : Node_Id; New_Node : Node_Id) is Old_E : Node_Id; New_E : Node_Id; Old_Next : Node_Id; New_Next : Node_Id; begin Old_E := First (Parameter_Associations (Old_Node)); New_E := First (Parameter_Associations (New_Node)); while Present (Old_E) loop if Nkind (Old_E) = N_Parameter_Association and then Present (Next_Named_Actual (Old_E)) then if First_Named_Actual (Old_Node) = Explicit_Actual_Parameter (Old_E) then Set_First_Named_Actual (New_Node, Explicit_Actual_Parameter (New_E)); end if; -- Now scan parameter list from the beginning, to locate -- next named actual, which can be out of order. Old_Next := First (Parameter_Associations (Old_Node)); New_Next := First (Parameter_Associations (New_Node)); while Nkind (Old_Next) /= N_Parameter_Association or else Explicit_Actual_Parameter (Old_Next) /= Next_Named_Actual (Old_E) loop Next (Old_Next); Next (New_Next); end loop; Set_Next_Named_Actual (New_E, Explicit_Actual_Parameter (New_Next)); end if; Next (Old_E); Next (New_E); end loop; end Adjust_Named_Associations; --------------------------------- -- Copy_Field_With_Replacement -- --------------------------------- function Copy_Field_With_Replacement (Field : Union_Id) return Union_Id is begin if Field = Union_Id (Empty) then return Field; elsif Field in Node_Range then declare Old_N : constant Node_Id := Node_Id (Field); New_N : Node_Id; begin -- If syntactic field, as indicated by the parent pointer -- being set, then copy the referenced node recursively. if Parent (Old_N) = Old_Node then New_N := Copy_Node_With_Replacement (Old_N); if New_N /= Old_N then Set_Parent (New_N, New_Node); end if; -- For semantic fields, update possible entity reference -- from the replacement map. else New_N := Assoc (Old_N); end if; return Union_Id (New_N); end; elsif Field in List_Range then declare Old_L : constant List_Id := List_Id (Field); New_L : List_Id; begin -- If syntactic field, as indicated by the parent pointer, -- then recursively copy the entire referenced list. if Parent (Old_L) = Old_Node then New_L := Copy_List_With_Replacement (Old_L); Set_Parent (New_L, New_Node); -- For semantic list, just returned unchanged else New_L := Old_L; end if; return Union_Id (New_L); end; -- Anything other than a list or a node is returned unchanged else return Field; end if; end Copy_Field_With_Replacement; -- Start of processing for Copy_Node_With_Replacement begin if Old_Node <= Empty_Or_Error then return Old_Node; elsif Nkind (Old_Node) in N_Entity then return Assoc (Old_Node); else New_Node := New_Copy (Old_Node); -- If the node we are copying is the associated node of a -- previously copied Itype, then adjust the associated node -- of the copy of that Itype accordingly. declare Ent : constant Entity_Id := NCT_Itype_Assoc.Get (Old_Node); begin if Present (Ent) then Set_Associated_Node_For_Itype (Ent, New_Node); end if; end; -- Recursively copy descendants Set_Field1 (New_Node, Copy_Field_With_Replacement (Field1 (New_Node))); Set_Field2 (New_Node, Copy_Field_With_Replacement (Field2 (New_Node))); Set_Field3 (New_Node, Copy_Field_With_Replacement (Field3 (New_Node))); Set_Field4 (New_Node, Copy_Field_With_Replacement (Field4 (New_Node))); Set_Field5 (New_Node, Copy_Field_With_Replacement (Field5 (New_Node))); -- Adjust Sloc of new node if necessary if New_Sloc /= No_Location then Set_Sloc (New_Node, New_Sloc); -- If we adjust the Sloc, then we are essentially making a -- completely new node, so the Comes_From_Source flag should -- be reset to the proper default value. Set_Comes_From_Source (New_Node, Default_Node.Comes_From_Source); end if; -- If the node is a call and has named associations, set the -- corresponding links in the copy. if Nkind_In (Old_Node, N_Entry_Call_Statement, N_Function_Call, N_Procedure_Call_Statement) and then Present (First_Named_Actual (Old_Node)) then Adjust_Named_Associations (Old_Node, New_Node); end if; -- Reset First_Real_Statement for Handled_Sequence_Of_Statements. -- The replacement mechanism applies to entities, and is not used -- here. Eventually we may need a more general graph-copying -- routine. For now, do a sequential search to find desired node. if Nkind (Old_Node) = N_Handled_Sequence_Of_Statements and then Present (First_Real_Statement (Old_Node)) then declare Old_F : constant Node_Id := First_Real_Statement (Old_Node); N1, N2 : Node_Id; begin N1 := First (Statements (Old_Node)); N2 := First (Statements (New_Node)); while N1 /= Old_F loop Next (N1); Next (N2); end loop; Set_First_Real_Statement (New_Node, N2); end; end if; end if; -- All done, return copied node return New_Node; end Copy_Node_With_Replacement; ------------------- -- New_Copy_Hash -- ------------------- function New_Copy_Hash (E : Entity_Id) return NCT_Header_Num is begin return Nat (E) mod (NCT_Header_Num'Last + 1); end New_Copy_Hash; ----------------- -- Visit_Elist -- ----------------- procedure Visit_Elist (E : Elist_Id) is Elmt : Elmt_Id; begin if Present (E) then Elmt := First_Elmt (E); while Elmt /= No_Elmt loop Visit_Node (Node (Elmt)); Next_Elmt (Elmt); end loop; end if; end Visit_Elist; ----------------- -- Visit_Field -- ----------------- procedure Visit_Field (F : Union_Id; N : Node_Id) is begin if F = Union_Id (Empty) then return; elsif F in Node_Range then -- Copy node if it is syntactic, i.e. its parent pointer is -- set to point to the field that referenced it (certain -- Itypes will also meet this criterion, which is fine, since -- these are clearly Itypes that do need to be copied, since -- we are copying their parent.) if Parent (Node_Id (F)) = N then Visit_Node (Node_Id (F)); return; -- Another case, if we are pointing to an Itype, then we want -- to copy it if its associated node is somewhere in the tree -- being copied. -- Note: the exclusion of self-referential copies is just an -- optimization, since the search of the already copied list -- would catch it, but it is a common case (Etype pointing to -- itself for an Itype that is a base type). elsif Nkind (Node_Id (F)) in N_Entity and then Is_Itype (Entity_Id (F)) and then Node_Id (F) /= N then declare P : Node_Id; begin P := Associated_Node_For_Itype (Node_Id (F)); while Present (P) loop if P = Source then Visit_Node (Node_Id (F)); return; else P := Parent (P); end if; end loop; -- An Itype whose parent is not being copied definitely -- should NOT be copied, since it does not belong in any -- sense to the copied subtree. return; end; end if; elsif F in List_Range and then Parent (List_Id (F)) = N then Visit_List (List_Id (F)); return; end if; end Visit_Field; ----------------- -- Visit_Itype -- ----------------- procedure Visit_Itype (Old_Itype : Entity_Id) is New_Itype : Entity_Id; Ent : Entity_Id; begin -- Itypes that describe the designated type of access to subprograms -- have the structure of subprogram declarations, with signatures, -- etc. Either we duplicate the signatures completely, or choose to -- share such itypes, which is fine because their elaboration will -- have no side effects. if Ekind (Old_Itype) = E_Subprogram_Type then return; end if; New_Itype := New_Copy (Old_Itype); -- The new Itype has all the attributes of the old one, and we -- just copy the contents of the entity. However, the back-end -- needs different names for debugging purposes, so we create a -- new internal name for it in all cases. Set_Chars (New_Itype, New_Internal_Name ('T')); -- If our associated node is an entity that has already been copied, -- then set the associated node of the copy to point to the right -- copy. If we have copied an Itype that is itself the associated -- node of some previously copied Itype, then we set the right -- pointer in the other direction. Ent := NCT_Assoc.Get (Associated_Node_For_Itype (Old_Itype)); if Present (Ent) then Set_Associated_Node_For_Itype (New_Itype, Ent); end if; Ent := NCT_Itype_Assoc.Get (Old_Itype); if Present (Ent) then Set_Associated_Node_For_Itype (Ent, New_Itype); -- If the hash table has no association for this Itype and its -- associated node, enter one now. else NCT_Itype_Assoc.Set (Associated_Node_For_Itype (Old_Itype), New_Itype); end if; if Present (Freeze_Node (New_Itype)) then Set_Is_Frozen (New_Itype, False); Set_Freeze_Node (New_Itype, Empty); end if; -- Add new association to map NCT_Assoc.Set (Old_Itype, New_Itype); -- If a record subtype is simply copied, the entity list will be -- shared. Thus cloned_Subtype must be set to indicate the sharing. if Ekind_In (Old_Itype, E_Class_Wide_Subtype, E_Record_Subtype) then Set_Cloned_Subtype (New_Itype, Old_Itype); end if; -- Visit descendants that eventually get copied Visit_Field (Union_Id (Etype (Old_Itype)), Old_Itype); if Is_Discrete_Type (Old_Itype) then Visit_Field (Union_Id (Scalar_Range (Old_Itype)), Old_Itype); elsif Has_Discriminants (Base_Type (Old_Itype)) then -- ??? This should involve call to Visit_Field Visit_Elist (Discriminant_Constraint (Old_Itype)); elsif Is_Array_Type (Old_Itype) then if Present (First_Index (Old_Itype)) then Visit_Field (Union_Id (List_Containing (First_Index (Old_Itype))), Old_Itype); end if; if Is_Packed (Old_Itype) then Visit_Field (Union_Id (Packed_Array_Impl_Type (Old_Itype)), Old_Itype); end if; end if; end Visit_Itype; ---------------- -- Visit_List -- ---------------- procedure Visit_List (L : List_Id) is N : Node_Id; begin if L /= No_List then N := First (L); while Present (N) loop Visit_Node (N); Next (N); end loop; end if; end Visit_List; ---------------- -- Visit_Node -- ---------------- procedure Visit_Node (N : Node_Or_Entity_Id) is begin -- Handle case of an Itype, which must be copied if Nkind (N) in N_Entity and then Is_Itype (N) then -- Nothing to do if already in the list. This can happen with an -- Itype entity that appears more than once in the tree. Note that -- we do not want to visit descendants in this case. if Present (NCT_Assoc.Get (Entity_Id (N))) then return; end if; Visit_Itype (N); end if; -- Visit descendants Visit_Field (Field1 (N), N); Visit_Field (Field2 (N), N); Visit_Field (Field3 (N), N); Visit_Field (Field4 (N), N); Visit_Field (Field5 (N), N); end Visit_Node; -- Start of processing for New_Copy_Tree begin Build_NCT_Hash_Tables; -- Hash table set up if required, now start phase one by visiting top -- node (we will recursively visit the descendants). Visit_Node (Source); -- Now the second phase of the copy can start. First we process all the -- mapped entities, copying their descendants. declare Old_E : Entity_Id := Empty; New_E : Entity_Id; begin NCT_Assoc.Get_First (Old_E, New_E); while Present (New_E) loop if Is_Itype (New_E) then Copy_Itype_With_Replacement (New_E); end if; NCT_Assoc.Get_Next (Old_E, New_E); end loop; end; -- Now we can copy the actual tree declare Result : constant Node_Id := Copy_Node_With_Replacement (Source); begin NCT_Assoc.Reset; NCT_Itype_Assoc.Reset; return Result; end; end New_Copy_Tree; ------------------------- -- New_External_Entity -- ------------------------- function New_External_Entity (Kind : Entity_Kind; Scope_Id : Entity_Id; Sloc_Value : Source_Ptr; Related_Id : Entity_Id; Suffix : Character; Suffix_Index : Nat := 0; Prefix : Character := ' ') return Entity_Id is N : constant Entity_Id := Make_Defining_Identifier (Sloc_Value, New_External_Name (Chars (Related_Id), Suffix, Suffix_Index, Prefix)); begin Set_Ekind (N, Kind); Set_Is_Internal (N, True); Append_Entity (N, Scope_Id); Set_Public_Status (N); if Kind in Type_Kind then Init_Size_Align (N); end if; return N; end New_External_Entity; ------------------------- -- New_Internal_Entity -- ------------------------- function New_Internal_Entity (Kind : Entity_Kind; Scope_Id : Entity_Id; Sloc_Value : Source_Ptr; Id_Char : Character) return Entity_Id is N : constant Entity_Id := Make_Temporary (Sloc_Value, Id_Char); begin Set_Ekind (N, Kind); Set_Is_Internal (N, True); Append_Entity (N, Scope_Id); if Kind in Type_Kind then Init_Size_Align (N); end if; return N; end New_Internal_Entity; ----------------- -- Next_Actual -- ----------------- function Next_Actual (Actual_Id : Node_Id) return Node_Id is N : Node_Id; begin -- If we are pointing at a positional parameter, it is a member of a -- node list (the list of parameters), and the next parameter is the -- next node on the list, unless we hit a parameter association, then -- we shift to using the chain whose head is the First_Named_Actual in -- the parent, and then is threaded using the Next_Named_Actual of the -- Parameter_Association. All this fiddling is because the original node -- list is in the textual call order, and what we need is the -- declaration order. if Is_List_Member (Actual_Id) then N := Next (Actual_Id); if Nkind (N) = N_Parameter_Association then return First_Named_Actual (Parent (Actual_Id)); else return N; end if; else return Next_Named_Actual (Parent (Actual_Id)); end if; end Next_Actual; procedure Next_Actual (Actual_Id : in out Node_Id) is begin Actual_Id := Next_Actual (Actual_Id); end Next_Actual; ---------------------------------- -- New_Requires_Transient_Scope -- ---------------------------------- function New_Requires_Transient_Scope (Id : Entity_Id) return Boolean is function Caller_Known_Size_Record (Typ : Entity_Id) return Boolean; -- This is called for untagged records and protected types, with -- nondefaulted discriminants. Returns True if the size of function -- results is known at the call site, False otherwise. Returns False -- if there is a variant part that depends on the discriminants of -- this type, or if there is an array constrained by the discriminants -- of this type. ???Currently, this is overly conservative (the array -- could be nested inside some other record that is constrained by -- nondiscriminants). That is, the recursive calls are too conservative. function Large_Max_Size_Mutable (Typ : Entity_Id) return Boolean; -- Returns True if Typ is a nonlimited record with defaulted -- discriminants whose max size makes it unsuitable for allocating on -- the primary stack. ------------------------------ -- Caller_Known_Size_Record -- ------------------------------ function Caller_Known_Size_Record (Typ : Entity_Id) return Boolean is pragma Assert (Typ = Underlying_Type (Typ)); begin if Has_Variant_Part (Typ) and then not Is_Definite_Subtype (Typ) then return False; end if; declare Comp : Entity_Id; begin Comp := First_Entity (Typ); while Present (Comp) loop -- Only look at E_Component entities. No need to look at -- E_Discriminant entities, and we must ignore internal -- subtypes generated for constrained components. if Ekind (Comp) = E_Component then declare Comp_Type : constant Entity_Id := Underlying_Type (Etype (Comp)); begin if Is_Record_Type (Comp_Type) or else Is_Protected_Type (Comp_Type) then if not Caller_Known_Size_Record (Comp_Type) then return False; end if; elsif Is_Array_Type (Comp_Type) then if Size_Depends_On_Discriminant (Comp_Type) then return False; end if; end if; end; end if; Next_Entity (Comp); end loop; end; return True; end Caller_Known_Size_Record; ------------------------------ -- Large_Max_Size_Mutable -- ------------------------------ function Large_Max_Size_Mutable (Typ : Entity_Id) return Boolean is pragma Assert (Typ = Underlying_Type (Typ)); function Is_Large_Discrete_Type (T : Entity_Id) return Boolean; -- Returns true if the discrete type T has a large range ---------------------------- -- Is_Large_Discrete_Type -- ---------------------------- function Is_Large_Discrete_Type (T : Entity_Id) return Boolean is Threshold : constant Int := 16; -- Arbitrary threshold above which we consider it "large". We want -- a fairly large threshold, because these large types really -- shouldn't have default discriminants in the first place, in -- most cases. begin return UI_To_Int (RM_Size (T)) > Threshold; end Is_Large_Discrete_Type; -- Start of processing for Large_Max_Size_Mutable begin if Is_Record_Type (Typ) and then not Is_Limited_View (Typ) and then Has_Defaulted_Discriminants (Typ) then -- Loop through the components, looking for an array whose upper -- bound(s) depends on discriminants, where both the subtype of -- the discriminant and the index subtype are too large. declare Comp : Entity_Id; begin Comp := First_Entity (Typ); while Present (Comp) loop if Ekind (Comp) = E_Component then declare Comp_Type : constant Entity_Id := Underlying_Type (Etype (Comp)); Hi : Node_Id; Indx : Node_Id; Ityp : Entity_Id; begin if Is_Array_Type (Comp_Type) then Indx := First_Index (Comp_Type); while Present (Indx) loop Ityp := Etype (Indx); Hi := Type_High_Bound (Ityp); if Nkind (Hi) = N_Identifier and then Ekind (Entity (Hi)) = E_Discriminant and then Is_Large_Discrete_Type (Ityp) and then Is_Large_Discrete_Type (Etype (Entity (Hi))) then return True; end if; Next_Index (Indx); end loop; end if; end; end if; Next_Entity (Comp); end loop; end; end if; return False; end Large_Max_Size_Mutable; -- Local declarations Typ : constant Entity_Id := Underlying_Type (Id); -- Start of processing for New_Requires_Transient_Scope begin -- This is a private type which is not completed yet. This can only -- happen in a default expression (of a formal parameter or of a -- record component). Do not expand transient scope in this case. if No (Typ) then return False; -- Do not expand transient scope for non-existent procedure return or -- string literal types. elsif Typ = Standard_Void_Type or else Ekind (Typ) = E_String_Literal_Subtype then return False; -- If Typ is a generic formal incomplete type, then we want to look at -- the actual type. elsif Ekind (Typ) = E_Record_Subtype and then Present (Cloned_Subtype (Typ)) then return New_Requires_Transient_Scope (Cloned_Subtype (Typ)); -- Functions returning specific tagged types may dispatch on result, so -- their returned value is allocated on the secondary stack, even in the -- definite case. We must treat nondispatching functions the same way, -- because access-to-function types can point at both, so the calling -- conventions must be compatible. Is_Tagged_Type includes controlled -- types and class-wide types. Controlled type temporaries need -- finalization. -- ???It's not clear why we need to return noncontrolled types with -- controlled components on the secondary stack. elsif Is_Tagged_Type (Typ) or else Has_Controlled_Component (Typ) then return True; -- Untagged definite subtypes are known size. This includes all -- elementary [sub]types. Tasks are known size even if they have -- discriminants. So we return False here, with one exception: -- For a type like: -- type T (Last : Natural := 0) is -- X : String (1 .. Last); -- end record; -- we return True. That's because for "P(F(...));", where F returns T, -- we don't know the size of the result at the call site, so if we -- allocated it on the primary stack, we would have to allocate the -- maximum size, which is way too big. elsif Is_Definite_Subtype (Typ) or else Is_Task_Type (Typ) then return Large_Max_Size_Mutable (Typ); -- Indefinite (discriminated) untagged record or protected type elsif Is_Record_Type (Typ) or else Is_Protected_Type (Typ) then return not Caller_Known_Size_Record (Typ); -- Unconstrained array else pragma Assert (Is_Array_Type (Typ) and not Is_Definite_Subtype (Typ)); return True; end if; end New_Requires_Transient_Scope; ----------------------- -- Normalize_Actuals -- ----------------------- -- Chain actuals according to formals of subprogram. If there are no named -- associations, the chain is simply the list of Parameter Associations, -- since the order is the same as the declaration order. If there are named -- associations, then the First_Named_Actual field in the N_Function_Call -- or N_Procedure_Call_Statement node points to the Parameter_Association -- node for the parameter that comes first in declaration order. The -- remaining named parameters are then chained in declaration order using -- Next_Named_Actual. -- This routine also verifies that the number of actuals is compatible with -- the number and default values of formals, but performs no type checking -- (type checking is done by the caller). -- If the matching succeeds, Success is set to True and the caller proceeds -- with type-checking. If the match is unsuccessful, then Success is set to -- False, and the caller attempts a different interpretation, if there is -- one. -- If the flag Report is on, the call is not overloaded, and a failure to -- match can be reported here, rather than in the caller. procedure Normalize_Actuals (N : Node_Id; S : Entity_Id; Report : Boolean; Success : out Boolean) is Actuals : constant List_Id := Parameter_Associations (N); Actual : Node_Id := Empty; Formal : Entity_Id; Last : Node_Id := Empty; First_Named : Node_Id := Empty; Found : Boolean; Formals_To_Match : Integer := 0; Actuals_To_Match : Integer := 0; procedure Chain (A : Node_Id); -- Add named actual at the proper place in the list, using the -- Next_Named_Actual link. function Reporting return Boolean; -- Determines if an error is to be reported. To report an error, we -- need Report to be True, and also we do not report errors caused -- by calls to init procs that occur within other init procs. Such -- errors must always be cascaded errors, since if all the types are -- declared correctly, the compiler will certainly build decent calls. ----------- -- Chain -- ----------- procedure Chain (A : Node_Id) is begin if No (Last) then -- Call node points to first actual in list Set_First_Named_Actual (N, Explicit_Actual_Parameter (A)); else Set_Next_Named_Actual (Last, Explicit_Actual_Parameter (A)); end if; Last := A; Set_Next_Named_Actual (Last, Empty); end Chain; --------------- -- Reporting -- --------------- function Reporting return Boolean is begin if not Report then return False; elsif not Within_Init_Proc then return True; elsif Is_Init_Proc (Entity (Name (N))) then return False; else return True; end if; end Reporting; -- Start of processing for Normalize_Actuals begin if Is_Access_Type (S) then -- The name in the call is a function call that returns an access -- to subprogram. The designated type has the list of formals. Formal := First_Formal (Designated_Type (S)); else Formal := First_Formal (S); end if; while Present (Formal) loop Formals_To_Match := Formals_To_Match + 1; Next_Formal (Formal); end loop; -- Find if there is a named association, and verify that no positional -- associations appear after named ones. if Present (Actuals) then Actual := First (Actuals); end if; while Present (Actual) and then Nkind (Actual) /= N_Parameter_Association loop Actuals_To_Match := Actuals_To_Match + 1; Next (Actual); end loop; if No (Actual) and Actuals_To_Match = Formals_To_Match then -- Most common case: positional notation, no defaults Success := True; return; elsif Actuals_To_Match > Formals_To_Match then -- Too many actuals: will not work if Reporting then if Is_Entity_Name (Name (N)) then Error_Msg_N ("too many arguments in call to&", Name (N)); else Error_Msg_N ("too many arguments in call", N); end if; end if; Success := False; return; end if; First_Named := Actual; while Present (Actual) loop if Nkind (Actual) /= N_Parameter_Association then Error_Msg_N ("positional parameters not allowed after named ones", Actual); Success := False; return; else Actuals_To_Match := Actuals_To_Match + 1; end if; Next (Actual); end loop; if Present (Actuals) then Actual := First (Actuals); end if; Formal := First_Formal (S); while Present (Formal) loop -- Match the formals in order. If the corresponding actual is -- positional, nothing to do. Else scan the list of named actuals -- to find the one with the right name. if Present (Actual) and then Nkind (Actual) /= N_Parameter_Association then Next (Actual); Actuals_To_Match := Actuals_To_Match - 1; Formals_To_Match := Formals_To_Match - 1; else -- For named parameters, search the list of actuals to find -- one that matches the next formal name. Actual := First_Named; Found := False; while Present (Actual) loop if Chars (Selector_Name (Actual)) = Chars (Formal) then Found := True; Chain (Actual); Actuals_To_Match := Actuals_To_Match - 1; Formals_To_Match := Formals_To_Match - 1; exit; end if; Next (Actual); end loop; if not Found then if Ekind (Formal) /= E_In_Parameter or else No (Default_Value (Formal)) then if Reporting then if (Comes_From_Source (S) or else Sloc (S) = Standard_Location) and then Is_Overloadable (S) then if No (Actuals) and then Nkind_In (Parent (N), N_Procedure_Call_Statement, N_Function_Call, N_Parameter_Association) and then Ekind (S) /= E_Function then Set_Etype (N, Etype (S)); else Error_Msg_Name_1 := Chars (S); Error_Msg_Sloc := Sloc (S); Error_Msg_NE ("missing argument for parameter & " & "in call to % declared #", N, Formal); end if; elsif Is_Overloadable (S) then Error_Msg_Name_1 := Chars (S); -- Point to type derivation that generated the -- operation. Error_Msg_Sloc := Sloc (Parent (S)); Error_Msg_NE ("missing argument for parameter & " & "in call to % (inherited) #", N, Formal); else Error_Msg_NE ("missing argument for parameter &", N, Formal); end if; end if; Success := False; return; else Formals_To_Match := Formals_To_Match - 1; end if; end if; end if; Next_Formal (Formal); end loop; if Formals_To_Match = 0 and then Actuals_To_Match = 0 then Success := True; return; else if Reporting then -- Find some superfluous named actual that did not get -- attached to the list of associations. Actual := First (Actuals); while Present (Actual) loop if Nkind (Actual) = N_Parameter_Association and then Actual /= Last and then No (Next_Named_Actual (Actual)) then -- A validity check may introduce a copy of a call that -- includes an extra actual (for example for an unrelated -- accessibility check). Check that the extra actual matches -- some extra formal, which must exist already because -- subprogram must be frozen at this point. if Present (Extra_Formals (S)) and then not Comes_From_Source (Actual) and then Nkind (Actual) = N_Parameter_Association and then Chars (Extra_Formals (S)) = Chars (Selector_Name (Actual)) then null; else Error_Msg_N ("unmatched actual & in call", Selector_Name (Actual)); exit; end if; end if; Next (Actual); end loop; end if; Success := False; return; end if; end Normalize_Actuals; -------------------------------- -- Note_Possible_Modification -- -------------------------------- procedure Note_Possible_Modification (N : Node_Id; Sure : Boolean) is Modification_Comes_From_Source : constant Boolean := Comes_From_Source (Parent (N)); Ent : Entity_Id; Exp : Node_Id; begin -- Loop to find referenced entity, if there is one Exp := N; loop Ent := Empty; if Is_Entity_Name (Exp) then Ent := Entity (Exp); -- If the entity is missing, it is an undeclared identifier, -- and there is nothing to annotate. if No (Ent) then return; end if; elsif Nkind (Exp) = N_Explicit_Dereference then declare P : constant Node_Id := Prefix (Exp); begin -- In formal verification mode, keep track of all reads and -- writes through explicit dereferences. if GNATprove_Mode then SPARK_Specific.Generate_Dereference (N, 'm'); end if; if Nkind (P) = N_Selected_Component and then Present (Entry_Formal (Entity (Selector_Name (P)))) then -- Case of a reference to an entry formal Ent := Entry_Formal (Entity (Selector_Name (P))); elsif Nkind (P) = N_Identifier and then Nkind (Parent (Entity (P))) = N_Object_Declaration and then Present (Expression (Parent (Entity (P)))) and then Nkind (Expression (Parent (Entity (P)))) = N_Reference then -- Case of a reference to a value on which side effects have -- been removed. Exp := Prefix (Expression (Parent (Entity (P)))); goto Continue; else return; end if; end; elsif Nkind_In (Exp, N_Type_Conversion, N_Unchecked_Type_Conversion) then Exp := Expression (Exp); goto Continue; elsif Nkind_In (Exp, N_Slice, N_Indexed_Component, N_Selected_Component) then -- Special check, if the prefix is an access type, then return -- since we are modifying the thing pointed to, not the prefix. -- When we are expanding, most usually the prefix is replaced -- by an explicit dereference, and this test is not needed, but -- in some cases (notably -gnatc mode and generics) when we do -- not do full expansion, we need this special test. if Is_Access_Type (Etype (Prefix (Exp))) then return; -- Otherwise go to prefix and keep going else Exp := Prefix (Exp); goto Continue; end if; -- All other cases, not a modification else return; end if; -- Now look for entity being referenced if Present (Ent) then if Is_Object (Ent) then if Comes_From_Source (Exp) or else Modification_Comes_From_Source then -- Give warning if pragma unmodified is given and we are -- sure this is a modification. if Has_Pragma_Unmodified (Ent) and then Sure then -- Note that the entity may be present only as a result -- of pragma Unused. if Has_Pragma_Unused (Ent) then Error_Msg_NE ("??pragma Unused given for &!", N, Ent); else Error_Msg_NE ("??pragma Unmodified given for &!", N, Ent); end if; end if; Set_Never_Set_In_Source (Ent, False); end if; Set_Is_True_Constant (Ent, False); Set_Current_Value (Ent, Empty); Set_Is_Known_Null (Ent, False); if not Can_Never_Be_Null (Ent) then Set_Is_Known_Non_Null (Ent, False); end if; -- Follow renaming chain if (Ekind (Ent) = E_Variable or else Ekind (Ent) = E_Constant) and then Present (Renamed_Object (Ent)) then Exp := Renamed_Object (Ent); -- If the entity is the loop variable in an iteration over -- a container, retrieve container expression to indicate -- possible modification. if Present (Related_Expression (Ent)) and then Nkind (Parent (Related_Expression (Ent))) = N_Iterator_Specification then Exp := Original_Node (Related_Expression (Ent)); end if; goto Continue; -- The expression may be the renaming of a subcomponent of an -- array or container. The assignment to the subcomponent is -- a modification of the container. elsif Comes_From_Source (Original_Node (Exp)) and then Nkind_In (Original_Node (Exp), N_Selected_Component, N_Indexed_Component) then Exp := Prefix (Original_Node (Exp)); goto Continue; end if; -- Generate a reference only if the assignment comes from -- source. This excludes, for example, calls to a dispatching -- assignment operation when the left-hand side is tagged. In -- GNATprove mode, we need those references also on generated -- code, as these are used to compute the local effects of -- subprograms. if Modification_Comes_From_Source or GNATprove_Mode then Generate_Reference (Ent, Exp, 'm'); -- If the target of the assignment is the bound variable -- in an iterator, indicate that the corresponding array -- or container is also modified. if Ada_Version >= Ada_2012 and then Nkind (Parent (Ent)) = N_Iterator_Specification then declare Domain : constant Node_Id := Name (Parent (Ent)); begin -- TBD : in the full version of the construct, the -- domain of iteration can be given by an expression. if Is_Entity_Name (Domain) then Generate_Reference (Entity (Domain), Exp, 'm'); Set_Is_True_Constant (Entity (Domain), False); Set_Never_Set_In_Source (Entity (Domain), False); end if; end; end if; end if; end if; Kill_Checks (Ent); -- If we are sure this is a modification from source, and we know -- this modifies a constant, then give an appropriate warning. if Sure and then Modification_Comes_From_Source and then Overlays_Constant (Ent) and then Address_Clause_Overlay_Warnings then declare Addr : constant Node_Id := Address_Clause (Ent); O_Ent : Entity_Id; Off : Boolean; begin Find_Overlaid_Entity (Addr, O_Ent, Off); Error_Msg_Sloc := Sloc (Addr); Error_Msg_NE ("??constant& may be modified via address clause#", N, O_Ent); end; end if; return; end if; <<Continue>> null; end loop; end Note_Possible_Modification; -------------------------------------- -- Null_To_Null_Address_Convert_OK -- -------------------------------------- function Null_To_Null_Address_Convert_OK (N : Node_Id; Typ : Entity_Id := Empty) return Boolean is begin if not Relaxed_RM_Semantics then return False; end if; if Nkind (N) = N_Null then return Present (Typ) and then Is_Descendant_Of_Address (Typ); elsif Nkind_In (N, N_Op_Eq, N_Op_Ge, N_Op_Gt, N_Op_Le, N_Op_Lt, N_Op_Ne) then declare L : constant Node_Id := Left_Opnd (N); R : constant Node_Id := Right_Opnd (N); begin -- We check the Etype of the complementary operand since the -- N_Null node is not decorated at this stage. return ((Nkind (L) = N_Null and then Is_Descendant_Of_Address (Etype (R))) or else (Nkind (R) = N_Null and then Is_Descendant_Of_Address (Etype (L)))); end; end if; return False; end Null_To_Null_Address_Convert_OK; ------------------------- -- Object_Access_Level -- ------------------------- -- Returns the static accessibility level of the view denoted by Obj. Note -- that the value returned is the result of a call to Scope_Depth. Only -- scope depths associated with dynamic scopes can actually be returned. -- Since only relative levels matter for accessibility checking, the fact -- that the distance between successive levels of accessibility is not -- always one is immaterial (invariant: if level(E2) is deeper than -- level(E1), then Scope_Depth(E1) < Scope_Depth(E2)). function Object_Access_Level (Obj : Node_Id) return Uint is function Is_Interface_Conversion (N : Node_Id) return Boolean; -- Determine whether N is a construct of the form -- Some_Type (Operand._tag'Address) -- This construct appears in the context of dispatching calls. function Reference_To (Obj : Node_Id) return Node_Id; -- An explicit dereference is created when removing side-effects from -- expressions for constraint checking purposes. In this case a local -- access type is created for it. The correct access level is that of -- the original source node. We detect this case by noting that the -- prefix of the dereference is created by an object declaration whose -- initial expression is a reference. ----------------------------- -- Is_Interface_Conversion -- ----------------------------- function Is_Interface_Conversion (N : Node_Id) return Boolean is begin return Nkind (N) = N_Unchecked_Type_Conversion and then Nkind (Expression (N)) = N_Attribute_Reference and then Attribute_Name (Expression (N)) = Name_Address; end Is_Interface_Conversion; ------------------ -- Reference_To -- ------------------ function Reference_To (Obj : Node_Id) return Node_Id is Pref : constant Node_Id := Prefix (Obj); begin if Is_Entity_Name (Pref) and then Nkind (Parent (Entity (Pref))) = N_Object_Declaration and then Present (Expression (Parent (Entity (Pref)))) and then Nkind (Expression (Parent (Entity (Pref)))) = N_Reference then return (Prefix (Expression (Parent (Entity (Pref))))); else return Empty; end if; end Reference_To; -- Local variables E : Entity_Id; -- Start of processing for Object_Access_Level begin if Nkind (Obj) = N_Defining_Identifier or else Is_Entity_Name (Obj) then if Nkind (Obj) = N_Defining_Identifier then E := Obj; else E := Entity (Obj); end if; if Is_Prival (E) then E := Prival_Link (E); end if; -- If E is a type then it denotes a current instance. For this case -- we add one to the normal accessibility level of the type to ensure -- that current instances are treated as always being deeper than -- than the level of any visible named access type (see 3.10.2(21)). if Is_Type (E) then return Type_Access_Level (E) + 1; elsif Present (Renamed_Object (E)) then return Object_Access_Level (Renamed_Object (E)); -- Similarly, if E is a component of the current instance of a -- protected type, any instance of it is assumed to be at a deeper -- level than the type. For a protected object (whose type is an -- anonymous protected type) its components are at the same level -- as the type itself. elsif not Is_Overloadable (E) and then Ekind (Scope (E)) = E_Protected_Type and then Comes_From_Source (Scope (E)) then return Type_Access_Level (Scope (E)) + 1; else -- Aliased formals of functions take their access level from the -- point of call, i.e. require a dynamic check. For static check -- purposes, this is smaller than the level of the subprogram -- itself. For procedures the aliased makes no difference. if Is_Formal (E) and then Is_Aliased (E) and then Ekind (Scope (E)) = E_Function then return Type_Access_Level (Etype (E)); else return Scope_Depth (Enclosing_Dynamic_Scope (E)); end if; end if; elsif Nkind (Obj) = N_Selected_Component then if Is_Access_Type (Etype (Prefix (Obj))) then return Type_Access_Level (Etype (Prefix (Obj))); else return Object_Access_Level (Prefix (Obj)); end if; elsif Nkind (Obj) = N_Indexed_Component then if Is_Access_Type (Etype (Prefix (Obj))) then return Type_Access_Level (Etype (Prefix (Obj))); else return Object_Access_Level (Prefix (Obj)); end if; elsif Nkind (Obj) = N_Explicit_Dereference then -- If the prefix is a selected access discriminant then we make a -- recursive call on the prefix, which will in turn check the level -- of the prefix object of the selected discriminant. -- In Ada 2012, if the discriminant has implicit dereference and -- the context is a selected component, treat this as an object of -- unknown scope (see below). This is necessary in compile-only mode; -- otherwise expansion will already have transformed the prefix into -- a temporary. if Nkind (Prefix (Obj)) = N_Selected_Component and then Ekind (Etype (Prefix (Obj))) = E_Anonymous_Access_Type and then Ekind (Entity (Selector_Name (Prefix (Obj)))) = E_Discriminant and then (not Has_Implicit_Dereference (Entity (Selector_Name (Prefix (Obj)))) or else Nkind (Parent (Obj)) /= N_Selected_Component) then return Object_Access_Level (Prefix (Obj)); -- Detect an interface conversion in the context of a dispatching -- call. Use the original form of the conversion to find the access -- level of the operand. elsif Is_Interface (Etype (Obj)) and then Is_Interface_Conversion (Prefix (Obj)) and then Nkind (Original_Node (Obj)) = N_Type_Conversion then return Object_Access_Level (Original_Node (Obj)); elsif not Comes_From_Source (Obj) then declare Ref : constant Node_Id := Reference_To (Obj); begin if Present (Ref) then return Object_Access_Level (Ref); else return Type_Access_Level (Etype (Prefix (Obj))); end if; end; else return Type_Access_Level (Etype (Prefix (Obj))); end if; elsif Nkind_In (Obj, N_Type_Conversion, N_Unchecked_Type_Conversion) then return Object_Access_Level (Expression (Obj)); elsif Nkind (Obj) = N_Function_Call then -- Function results are objects, so we get either the access level of -- the function or, in the case of an indirect call, the level of the -- access-to-subprogram type. (This code is used for Ada 95, but it -- looks wrong, because it seems that we should be checking the level -- of the call itself, even for Ada 95. However, using the Ada 2005 -- version of the code causes regressions in several tests that are -- compiled with -gnat95. ???) if Ada_Version < Ada_2005 then if Is_Entity_Name (Name (Obj)) then return Subprogram_Access_Level (Entity (Name (Obj))); else return Type_Access_Level (Etype (Prefix (Name (Obj)))); end if; -- For Ada 2005, the level of the result object of a function call is -- defined to be the level of the call's innermost enclosing master. -- We determine that by querying the depth of the innermost enclosing -- dynamic scope. else Return_Master_Scope_Depth_Of_Call : declare function Innermost_Master_Scope_Depth (N : Node_Id) return Uint; -- Returns the scope depth of the given node's innermost -- enclosing dynamic scope (effectively the accessibility -- level of the innermost enclosing master). ---------------------------------- -- Innermost_Master_Scope_Depth -- ---------------------------------- function Innermost_Master_Scope_Depth (N : Node_Id) return Uint is Node_Par : Node_Id := Parent (N); begin -- Locate the nearest enclosing node (by traversing Parents) -- that Defining_Entity can be applied to, and return the -- depth of that entity's nearest enclosing dynamic scope. while Present (Node_Par) loop case Nkind (Node_Par) is when N_Abstract_Subprogram_Declaration | N_Block_Statement | N_Body_Stub | N_Component_Declaration | N_Entry_Body | N_Entry_Declaration | N_Exception_Declaration | N_Formal_Object_Declaration | N_Formal_Package_Declaration | N_Formal_Subprogram_Declaration | N_Formal_Type_Declaration | N_Full_Type_Declaration | N_Function_Specification | N_Generic_Declaration | N_Generic_Instantiation | N_Implicit_Label_Declaration | N_Incomplete_Type_Declaration | N_Loop_Parameter_Specification | N_Number_Declaration | N_Object_Declaration | N_Package_Declaration | N_Package_Specification | N_Parameter_Specification | N_Private_Extension_Declaration | N_Private_Type_Declaration | N_Procedure_Specification | N_Proper_Body | N_Protected_Type_Declaration | N_Renaming_Declaration | N_Single_Protected_Declaration | N_Single_Task_Declaration | N_Subprogram_Declaration | N_Subtype_Declaration | N_Subunit | N_Task_Type_Declaration => return Scope_Depth (Nearest_Dynamic_Scope (Defining_Entity (Node_Par))); when others => null; end case; Node_Par := Parent (Node_Par); end loop; pragma Assert (False); -- Should never reach the following return return Scope_Depth (Current_Scope) + 1; end Innermost_Master_Scope_Depth; -- Start of processing for Return_Master_Scope_Depth_Of_Call begin return Innermost_Master_Scope_Depth (Obj); end Return_Master_Scope_Depth_Of_Call; end if; -- For convenience we handle qualified expressions, even though they -- aren't technically object names. elsif Nkind (Obj) = N_Qualified_Expression then return Object_Access_Level (Expression (Obj)); -- Ditto for aggregates. They have the level of the temporary that -- will hold their value. elsif Nkind (Obj) = N_Aggregate then return Object_Access_Level (Current_Scope); -- Otherwise return the scope level of Standard. (If there are cases -- that fall through to this point they will be treated as having -- global accessibility for now. ???) else return Scope_Depth (Standard_Standard); end if; end Object_Access_Level; ---------------------------------- -- Old_Requires_Transient_Scope -- ---------------------------------- function Old_Requires_Transient_Scope (Id : Entity_Id) return Boolean is Typ : constant Entity_Id := Underlying_Type (Id); begin -- This is a private type which is not completed yet. This can only -- happen in a default expression (of a formal parameter or of a -- record component). Do not expand transient scope in this case. if No (Typ) then return False; -- Do not expand transient scope for non-existent procedure return elsif Typ = Standard_Void_Type then return False; -- Elementary types do not require a transient scope elsif Is_Elementary_Type (Typ) then return False; -- Generally, indefinite subtypes require a transient scope, since the -- back end cannot generate temporaries, since this is not a valid type -- for declaring an object. It might be possible to relax this in the -- future, e.g. by declaring the maximum possible space for the type. elsif not Is_Definite_Subtype (Typ) then return True; -- Functions returning tagged types may dispatch on result so their -- returned value is allocated on the secondary stack. Controlled -- type temporaries need finalization. elsif Is_Tagged_Type (Typ) or else Has_Controlled_Component (Typ) then return True; -- Record type elsif Is_Record_Type (Typ) then declare Comp : Entity_Id; begin Comp := First_Entity (Typ); while Present (Comp) loop if Ekind (Comp) = E_Component then -- ???It's not clear we need a full recursive call to -- Old_Requires_Transient_Scope here. Note that the -- following can't happen. pragma Assert (Is_Definite_Subtype (Etype (Comp))); pragma Assert (not Has_Controlled_Component (Etype (Comp))); if Old_Requires_Transient_Scope (Etype (Comp)) then return True; end if; end if; Next_Entity (Comp); end loop; end; return False; -- String literal types never require transient scope elsif Ekind (Typ) = E_String_Literal_Subtype then return False; -- Array type. Note that we already know that this is a constrained -- array, since unconstrained arrays will fail the indefinite test. elsif Is_Array_Type (Typ) then -- If component type requires a transient scope, the array does too if Old_Requires_Transient_Scope (Component_Type (Typ)) then return True; -- Otherwise, we only need a transient scope if the size depends on -- the value of one or more discriminants. else return Size_Depends_On_Discriminant (Typ); end if; -- All other cases do not require a transient scope else pragma Assert (Is_Protected_Type (Typ) or else Is_Task_Type (Typ)); return False; end if; end Old_Requires_Transient_Scope; --------------------------------- -- Original_Aspect_Pragma_Name -- --------------------------------- function Original_Aspect_Pragma_Name (N : Node_Id) return Name_Id is Item : Node_Id; Item_Nam : Name_Id; begin pragma Assert (Nkind_In (N, N_Aspect_Specification, N_Pragma)); Item := N; -- The pragma was generated to emulate an aspect, use the original -- aspect specification. if Nkind (Item) = N_Pragma and then From_Aspect_Specification (Item) then Item := Corresponding_Aspect (Item); end if; -- Retrieve the name of the aspect/pragma. Note that Pre, Pre_Class, -- Post and Post_Class rewrite their pragma identifier to preserve the -- original name. -- ??? this is kludgey if Nkind (Item) = N_Pragma then Item_Nam := Chars (Original_Node (Pragma_Identifier (Item))); else pragma Assert (Nkind (Item) = N_Aspect_Specification); Item_Nam := Chars (Identifier (Item)); end if; -- Deal with 'Class by converting the name to its _XXX form if Class_Present (Item) then if Item_Nam = Name_Invariant then Item_Nam := Name_uInvariant; elsif Item_Nam = Name_Post then Item_Nam := Name_uPost; elsif Item_Nam = Name_Pre then Item_Nam := Name_uPre; elsif Nam_In (Item_Nam, Name_Type_Invariant, Name_Type_Invariant_Class) then Item_Nam := Name_uType_Invariant; -- Nothing to do for other cases (e.g. a Check that derived from -- Pre_Class and has the flag set). Also we do nothing if the name -- is already in special _xxx form. end if; end if; return Item_Nam; end Original_Aspect_Pragma_Name; -------------------------------------- -- Original_Corresponding_Operation -- -------------------------------------- function Original_Corresponding_Operation (S : Entity_Id) return Entity_Id is Typ : constant Entity_Id := Find_Dispatching_Type (S); begin -- If S is an inherited primitive S2 the original corresponding -- operation of S is the original corresponding operation of S2 if Present (Alias (S)) and then Find_Dispatching_Type (Alias (S)) /= Typ then return Original_Corresponding_Operation (Alias (S)); -- If S overrides an inherited subprogram S2 the original corresponding -- operation of S is the original corresponding operation of S2 elsif Present (Overridden_Operation (S)) then return Original_Corresponding_Operation (Overridden_Operation (S)); -- otherwise it is S itself else return S; end if; end Original_Corresponding_Operation; ------------------- -- Output_Entity -- ------------------- procedure Output_Entity (Id : Entity_Id) is Scop : Entity_Id; begin Scop := Scope (Id); -- The entity may lack a scope when it is in the process of being -- analyzed. Use the current scope as an approximation. if No (Scop) then Scop := Current_Scope; end if; Output_Name (Chars (Id), Scop); end Output_Entity; ----------------- -- Output_Name -- ----------------- procedure Output_Name (Nam : Name_Id; Scop : Entity_Id := Current_Scope) is begin Write_Str (Get_Name_String (Get_Qualified_Name (Nam => Nam, Suffix => No_Name, Scop => Scop))); Write_Eol; end Output_Name; ---------------------- -- Policy_In_Effect -- ---------------------- function Policy_In_Effect (Policy : Name_Id) return Name_Id is function Policy_In_List (List : Node_Id) return Name_Id; -- Determine the mode of a policy in a N_Pragma list -------------------- -- Policy_In_List -- -------------------- function Policy_In_List (List : Node_Id) return Name_Id is Arg1 : Node_Id; Arg2 : Node_Id; Prag : Node_Id; begin Prag := List; while Present (Prag) loop Arg1 := First (Pragma_Argument_Associations (Prag)); Arg2 := Next (Arg1); Arg1 := Get_Pragma_Arg (Arg1); Arg2 := Get_Pragma_Arg (Arg2); -- The current Check_Policy pragma matches the requested policy or -- appears in the single argument form (Assertion, policy_id). if Nam_In (Chars (Arg1), Name_Assertion, Policy) then return Chars (Arg2); end if; Prag := Next_Pragma (Prag); end loop; return No_Name; end Policy_In_List; -- Local variables Kind : Name_Id; -- Start of processing for Policy_In_Effect begin if not Is_Valid_Assertion_Kind (Policy) then raise Program_Error; end if; -- Inspect all policy pragmas that appear within scopes (if any) Kind := Policy_In_List (Check_Policy_List); -- Inspect all configuration policy pragmas (if any) if Kind = No_Name then Kind := Policy_In_List (Check_Policy_List_Config); end if; -- The context lacks policy pragmas, determine the mode based on whether -- assertions are enabled at the configuration level. This ensures that -- the policy is preserved when analyzing generics. if Kind = No_Name then if Assertions_Enabled_Config then Kind := Name_Check; else Kind := Name_Ignore; end if; end if; return Kind; end Policy_In_Effect; ---------------------------------- -- Predicate_Tests_On_Arguments -- ---------------------------------- function Predicate_Tests_On_Arguments (Subp : Entity_Id) return Boolean is begin -- Always test predicates on indirect call if Ekind (Subp) = E_Subprogram_Type then return True; -- Do not test predicates on call to generated default Finalize, since -- we are not interested in whether something we are finalizing (and -- typically destroying) satisfies its predicates. elsif Chars (Subp) = Name_Finalize and then not Comes_From_Source (Subp) then return False; -- Do not test predicates on any internally generated routines elsif Is_Internal_Name (Chars (Subp)) then return False; -- Do not test predicates on call to Init_Proc, since if needed the -- predicate test will occur at some other point. elsif Is_Init_Proc (Subp) then return False; -- Do not test predicates on call to predicate function, since this -- would cause infinite recursion. elsif Ekind (Subp) = E_Function and then (Is_Predicate_Function (Subp) or else Is_Predicate_Function_M (Subp)) then return False; -- For now, no other exceptions else return True; end if; end Predicate_Tests_On_Arguments; ----------------------- -- Private_Component -- ----------------------- function Private_Component (Type_Id : Entity_Id) return Entity_Id is Ancestor : constant Entity_Id := Base_Type (Type_Id); function Trace_Components (T : Entity_Id; Check : Boolean) return Entity_Id; -- Recursive function that does the work, and checks against circular -- definition for each subcomponent type. ---------------------- -- Trace_Components -- ---------------------- function Trace_Components (T : Entity_Id; Check : Boolean) return Entity_Id is Btype : constant Entity_Id := Base_Type (T); Component : Entity_Id; P : Entity_Id; Candidate : Entity_Id := Empty; begin if Check and then Btype = Ancestor then Error_Msg_N ("circular type definition", Type_Id); return Any_Type; end if; if Is_Private_Type (Btype) and then not Is_Generic_Type (Btype) then if Present (Full_View (Btype)) and then Is_Record_Type (Full_View (Btype)) and then not Is_Frozen (Btype) then -- To indicate that the ancestor depends on a private type, the -- current Btype is sufficient. However, to check for circular -- definition we must recurse on the full view. Candidate := Trace_Components (Full_View (Btype), True); if Candidate = Any_Type then return Any_Type; else return Btype; end if; else return Btype; end if; elsif Is_Array_Type (Btype) then return Trace_Components (Component_Type (Btype), True); elsif Is_Record_Type (Btype) then Component := First_Entity (Btype); while Present (Component) and then Comes_From_Source (Component) loop -- Skip anonymous types generated by constrained components if not Is_Type (Component) then P := Trace_Components (Etype (Component), True); if Present (P) then if P = Any_Type then return P; else Candidate := P; end if; end if; end if; Next_Entity (Component); end loop; return Candidate; else return Empty; end if; end Trace_Components; -- Start of processing for Private_Component begin return Trace_Components (Type_Id, False); end Private_Component; --------------------------- -- Primitive_Names_Match -- --------------------------- function Primitive_Names_Match (E1, E2 : Entity_Id) return Boolean is function Non_Internal_Name (E : Entity_Id) return Name_Id; -- Given an internal name, returns the corresponding non-internal name ------------------------ -- Non_Internal_Name -- ------------------------ function Non_Internal_Name (E : Entity_Id) return Name_Id is begin Get_Name_String (Chars (E)); Name_Len := Name_Len - 1; return Name_Find; end Non_Internal_Name; -- Start of processing for Primitive_Names_Match begin pragma Assert (Present (E1) and then Present (E2)); return Chars (E1) = Chars (E2) or else (not Is_Internal_Name (Chars (E1)) and then Is_Internal_Name (Chars (E2)) and then Non_Internal_Name (E2) = Chars (E1)) or else (not Is_Internal_Name (Chars (E2)) and then Is_Internal_Name (Chars (E1)) and then Non_Internal_Name (E1) = Chars (E2)) or else (Is_Predefined_Dispatching_Operation (E1) and then Is_Predefined_Dispatching_Operation (E2) and then Same_TSS (E1, E2)) or else (Is_Init_Proc (E1) and then Is_Init_Proc (E2)); end Primitive_Names_Match; ----------------------- -- Process_End_Label -- ----------------------- procedure Process_End_Label (N : Node_Id; Typ : Character; Ent : Entity_Id) is Loc : Source_Ptr; Nam : Node_Id; Scop : Entity_Id; Label_Ref : Boolean; -- Set True if reference to end label itself is required Endl : Node_Id; -- Gets set to the operator symbol or identifier that references the -- entity Ent. For the child unit case, this is the identifier from the -- designator. For other cases, this is simply Endl. procedure Generate_Parent_Ref (N : Node_Id; E : Entity_Id); -- N is an identifier node that appears as a parent unit reference in -- the case where Ent is a child unit. This procedure generates an -- appropriate cross-reference entry. E is the corresponding entity. ------------------------- -- Generate_Parent_Ref -- ------------------------- procedure Generate_Parent_Ref (N : Node_Id; E : Entity_Id) is begin -- If names do not match, something weird, skip reference if Chars (E) = Chars (N) then -- Generate the reference. We do NOT consider this as a reference -- for unreferenced symbol purposes. Generate_Reference (E, N, 'r', Set_Ref => False, Force => True); if Style_Check then Style.Check_Identifier (N, E); end if; end if; end Generate_Parent_Ref; -- Start of processing for Process_End_Label begin -- If no node, ignore. This happens in some error situations, and -- also for some internally generated structures where no end label -- references are required in any case. if No (N) then return; end if; -- Nothing to do if no End_Label, happens for internally generated -- constructs where we don't want an end label reference anyway. Also -- nothing to do if Endl is a string literal, which means there was -- some prior error (bad operator symbol) Endl := End_Label (N); if No (Endl) or else Nkind (Endl) = N_String_Literal then return; end if; -- Reference node is not in extended main source unit if not In_Extended_Main_Source_Unit (N) then -- Generally we do not collect references except for the extended -- main source unit. The one exception is the 'e' entry for a -- package spec, where it is useful for a client to have the -- ending information to define scopes. if Typ /= 'e' then return; else Label_Ref := False; -- For this case, we can ignore any parent references, but we -- need the package name itself for the 'e' entry. if Nkind (Endl) = N_Designator then Endl := Identifier (Endl); end if; end if; -- Reference is in extended main source unit else Label_Ref := True; -- For designator, generate references for the parent entries if Nkind (Endl) = N_Designator then -- Generate references for the prefix if the END line comes from -- source (otherwise we do not need these references) We climb the -- scope stack to find the expected entities. if Comes_From_Source (Endl) then Nam := Name (Endl); Scop := Current_Scope; while Nkind (Nam) = N_Selected_Component loop Scop := Scope (Scop); exit when No (Scop); Generate_Parent_Ref (Selector_Name (Nam), Scop); Nam := Prefix (Nam); end loop; if Present (Scop) then Generate_Parent_Ref (Nam, Scope (Scop)); end if; end if; Endl := Identifier (Endl); end if; end if; -- If the end label is not for the given entity, then either we have -- some previous error, or this is a generic instantiation for which -- we do not need to make a cross-reference in this case anyway. In -- either case we simply ignore the call. if Chars (Ent) /= Chars (Endl) then return; end if; -- If label was really there, then generate a normal reference and then -- adjust the location in the end label to point past the name (which -- should almost always be the semicolon). Loc := Sloc (Endl); if Comes_From_Source (Endl) then -- If a label reference is required, then do the style check and -- generate an l-type cross-reference entry for the label if Label_Ref then if Style_Check then Style.Check_Identifier (Endl, Ent); end if; Generate_Reference (Ent, Endl, 'l', Set_Ref => False); end if; -- Set the location to point past the label (normally this will -- mean the semicolon immediately following the label). This is -- done for the sake of the 'e' or 't' entry generated below. Get_Decoded_Name_String (Chars (Endl)); Set_Sloc (Endl, Sloc (Endl) + Source_Ptr (Name_Len)); else -- In SPARK mode, no missing label is allowed for packages and -- subprogram bodies. Detect those cases by testing whether -- Process_End_Label was called for a body (Typ = 't') or a package. if Restriction_Check_Required (SPARK_05) and then (Typ = 't' or else Ekind (Ent) = E_Package) then Error_Msg_Node_1 := Endl; Check_SPARK_05_Restriction ("`END &` required", Endl, Force => True); end if; end if; -- Now generate the e/t reference Generate_Reference (Ent, Endl, Typ, Set_Ref => False, Force => True); -- Restore Sloc, in case modified above, since we have an identifier -- and the normal Sloc should be left set in the tree. Set_Sloc (Endl, Loc); end Process_End_Label; -------------------------------- -- Propagate_Concurrent_Flags -- -------------------------------- procedure Propagate_Concurrent_Flags (Typ : Entity_Id; Comp_Typ : Entity_Id) is begin if Has_Task (Comp_Typ) then Set_Has_Task (Typ); end if; if Has_Protected (Comp_Typ) then Set_Has_Protected (Typ); end if; if Has_Timing_Event (Comp_Typ) then Set_Has_Timing_Event (Typ); end if; end Propagate_Concurrent_Flags; ------------------------------ -- Propagate_DIC_Attributes -- ------------------------------ procedure Propagate_DIC_Attributes (Typ : Entity_Id; From_Typ : Entity_Id) is DIC_Proc : Entity_Id; begin if Present (Typ) and then Present (From_Typ) then pragma Assert (Is_Type (Typ) and then Is_Type (From_Typ)); -- Nothing to do if both the source and the destination denote the -- same type. if From_Typ = Typ then return; end if; DIC_Proc := DIC_Procedure (From_Typ); -- The setting of the attributes is intentionally conservative. This -- prevents accidental clobbering of enabled attributes. if Has_Inherited_DIC (From_Typ) and then not Has_Inherited_DIC (Typ) then Set_Has_Inherited_DIC (Typ); end if; if Has_Own_DIC (From_Typ) and then not Has_Own_DIC (Typ) then Set_Has_Own_DIC (Typ); end if; if Present (DIC_Proc) and then No (DIC_Procedure (Typ)) then Set_DIC_Procedure (Typ, DIC_Proc); end if; end if; end Propagate_DIC_Attributes; ------------------------------------ -- Propagate_Invariant_Attributes -- ------------------------------------ procedure Propagate_Invariant_Attributes (Typ : Entity_Id; From_Typ : Entity_Id) is Full_IP : Entity_Id; Part_IP : Entity_Id; begin if Present (Typ) and then Present (From_Typ) then pragma Assert (Is_Type (Typ) and then Is_Type (From_Typ)); -- Nothing to do if both the source and the destination denote the -- same type. if From_Typ = Typ then return; end if; Full_IP := Invariant_Procedure (From_Typ); Part_IP := Partial_Invariant_Procedure (From_Typ); -- The setting of the attributes is intentionally conservative. This -- prevents accidental clobbering of enabled attributes. if Has_Inheritable_Invariants (From_Typ) and then not Has_Inheritable_Invariants (Typ) then Set_Has_Inheritable_Invariants (Typ, True); end if; if Has_Inherited_Invariants (From_Typ) and then not Has_Inherited_Invariants (Typ) then Set_Has_Inherited_Invariants (Typ, True); end if; if Has_Own_Invariants (From_Typ) and then not Has_Own_Invariants (Typ) then Set_Has_Own_Invariants (Typ, True); end if; if Present (Full_IP) and then No (Invariant_Procedure (Typ)) then Set_Invariant_Procedure (Typ, Full_IP); end if; if Present (Part_IP) and then No (Partial_Invariant_Procedure (Typ)) then Set_Partial_Invariant_Procedure (Typ, Part_IP); end if; end if; end Propagate_Invariant_Attributes; --------------------------------------- -- Record_Possible_Part_Of_Reference -- --------------------------------------- procedure Record_Possible_Part_Of_Reference (Var_Id : Entity_Id; Ref : Node_Id) is Encap : constant Entity_Id := Encapsulating_State (Var_Id); Refs : Elist_Id; begin -- The variable is a constituent of a single protected/task type. Such -- a variable acts as a component of the type and must appear within a -- specific region (SPARK RM 9.3). Instead of recording the reference, -- verify its legality now. if Present (Encap) and then Is_Single_Concurrent_Object (Encap) then Check_Part_Of_Reference (Var_Id, Ref); -- The variable is subject to pragma Part_Of and may eventually become a -- constituent of a single protected/task type. Record the reference to -- verify its placement when the contract of the variable is analyzed. elsif Present (Get_Pragma (Var_Id, Pragma_Part_Of)) then Refs := Part_Of_References (Var_Id); if No (Refs) then Refs := New_Elmt_List; Set_Part_Of_References (Var_Id, Refs); end if; Append_Elmt (Ref, Refs); end if; end Record_Possible_Part_Of_Reference; ---------------- -- Referenced -- ---------------- function Referenced (Id : Entity_Id; Expr : Node_Id) return Boolean is Seen : Boolean := False; function Is_Reference (N : Node_Id) return Traverse_Result; -- Determine whether node N denotes a reference to Id. If this is the -- case, set global flag Seen to True and stop the traversal. ------------------ -- Is_Reference -- ------------------ function Is_Reference (N : Node_Id) return Traverse_Result is begin if Is_Entity_Name (N) and then Present (Entity (N)) and then Entity (N) = Id then Seen := True; return Abandon; else return OK; end if; end Is_Reference; procedure Inspect_Expression is new Traverse_Proc (Is_Reference); -- Start of processing for Referenced begin Inspect_Expression (Expr); return Seen; end Referenced; ------------------------------------ -- References_Generic_Formal_Type -- ------------------------------------ function References_Generic_Formal_Type (N : Node_Id) return Boolean is function Process (N : Node_Id) return Traverse_Result; -- Process one node in search for generic formal type ------------- -- Process -- ------------- function Process (N : Node_Id) return Traverse_Result is begin if Nkind (N) in N_Has_Entity then declare E : constant Entity_Id := Entity (N); begin if Present (E) then if Is_Generic_Type (E) then return Abandon; elsif Present (Etype (E)) and then Is_Generic_Type (Etype (E)) then return Abandon; end if; end if; end; end if; return Atree.OK; end Process; function Traverse is new Traverse_Func (Process); -- Traverse tree to look for generic type begin if Inside_A_Generic then return Traverse (N) = Abandon; else return False; end if; end References_Generic_Formal_Type; -------------------- -- Remove_Homonym -- -------------------- procedure Remove_Homonym (E : Entity_Id) is Prev : Entity_Id := Empty; H : Entity_Id; begin if E = Current_Entity (E) then if Present (Homonym (E)) then Set_Current_Entity (Homonym (E)); else Set_Name_Entity_Id (Chars (E), Empty); end if; else H := Current_Entity (E); while Present (H) and then H /= E loop Prev := H; H := Homonym (H); end loop; -- If E is not on the homonym chain, nothing to do if Present (H) then Set_Homonym (Prev, Homonym (E)); end if; end if; end Remove_Homonym; ------------------------------ -- Remove_Overloaded_Entity -- ------------------------------ procedure Remove_Overloaded_Entity (Id : Entity_Id) is procedure Remove_Primitive_Of (Typ : Entity_Id); -- Remove primitive subprogram Id from the list of primitives that -- belong to type Typ. ------------------------- -- Remove_Primitive_Of -- ------------------------- procedure Remove_Primitive_Of (Typ : Entity_Id) is Prims : Elist_Id; begin if Is_Tagged_Type (Typ) then Prims := Direct_Primitive_Operations (Typ); if Present (Prims) then Remove (Prims, Id); end if; end if; end Remove_Primitive_Of; -- Local variables Scop : constant Entity_Id := Scope (Id); Formal : Entity_Id; Prev_Id : Entity_Id; -- Start of processing for Remove_Overloaded_Entity begin -- Remove the entity from the homonym chain. When the entity is the -- head of the chain, associate the entry in the name table with its -- homonym effectively making it the new head of the chain. if Current_Entity (Id) = Id then Set_Name_Entity_Id (Chars (Id), Homonym (Id)); -- Otherwise link the previous and next homonyms else Prev_Id := Current_Entity (Id); while Present (Prev_Id) and then Homonym (Prev_Id) /= Id loop Prev_Id := Homonym (Prev_Id); end loop; Set_Homonym (Prev_Id, Homonym (Id)); end if; -- Remove the entity from the scope entity chain. When the entity is -- the head of the chain, set the next entity as the new head of the -- chain. if First_Entity (Scop) = Id then Prev_Id := Empty; Set_First_Entity (Scop, Next_Entity (Id)); -- Otherwise the entity is either in the middle of the chain or it acts -- as its tail. Traverse and link the previous and next entities. else Prev_Id := First_Entity (Scop); while Present (Prev_Id) and then Next_Entity (Prev_Id) /= Id loop Next_Entity (Prev_Id); end loop; Set_Next_Entity (Prev_Id, Next_Entity (Id)); end if; -- Handle the case where the entity acts as the tail of the scope entity -- chain. if Last_Entity (Scop) = Id then Set_Last_Entity (Scop, Prev_Id); end if; -- The entity denotes a primitive subprogram. Remove it from the list of -- primitives of the associated controlling type. if Ekind_In (Id, E_Function, E_Procedure) and then Is_Primitive (Id) then Formal := First_Formal (Id); while Present (Formal) loop if Is_Controlling_Formal (Formal) then Remove_Primitive_Of (Etype (Formal)); exit; end if; Next_Formal (Formal); end loop; if Ekind (Id) = E_Function and then Has_Controlling_Result (Id) then Remove_Primitive_Of (Etype (Id)); end if; end if; end Remove_Overloaded_Entity; --------------------- -- Rep_To_Pos_Flag -- --------------------- function Rep_To_Pos_Flag (E : Entity_Id; Loc : Source_Ptr) return Node_Id is begin return New_Occurrence_Of (Boolean_Literals (not Range_Checks_Suppressed (E)), Loc); end Rep_To_Pos_Flag; -------------------- -- Require_Entity -- -------------------- procedure Require_Entity (N : Node_Id) is begin if Is_Entity_Name (N) and then No (Entity (N)) then if Total_Errors_Detected /= 0 then Set_Entity (N, Any_Id); else raise Program_Error; end if; end if; end Require_Entity; ------------------------------ -- Requires_Transient_Scope -- ------------------------------ -- A transient scope is required when variable-sized temporaries are -- allocated on the secondary stack, or when finalization actions must be -- generated before the next instruction. function Requires_Transient_Scope (Id : Entity_Id) return Boolean is Old_Result : constant Boolean := Old_Requires_Transient_Scope (Id); begin if Debug_Flag_QQ then return Old_Result; end if; declare New_Result : constant Boolean := New_Requires_Transient_Scope (Id); begin -- Assert that we're not putting things on the secondary stack if we -- didn't before; we are trying to AVOID secondary stack when -- possible. if not Old_Result then pragma Assert (not New_Result); null; end if; if New_Result /= Old_Result then Results_Differ (Id, Old_Result, New_Result); end if; return New_Result; end; end Requires_Transient_Scope; -------------------- -- Results_Differ -- -------------------- procedure Results_Differ (Id : Entity_Id; Old_Val : Boolean; New_Val : Boolean) is begin if False then -- False to disable; True for debugging Treepr.Print_Tree_Node (Id); if Old_Val = New_Val then raise Program_Error; end if; end if; end Results_Differ; -------------------------- -- Reset_Analyzed_Flags -- -------------------------- procedure Reset_Analyzed_Flags (N : Node_Id) is function Clear_Analyzed (N : Node_Id) return Traverse_Result; -- Function used to reset Analyzed flags in tree. Note that we do -- not reset Analyzed flags in entities, since there is no need to -- reanalyze entities, and indeed, it is wrong to do so, since it -- can result in generating auxiliary stuff more than once. -------------------- -- Clear_Analyzed -- -------------------- function Clear_Analyzed (N : Node_Id) return Traverse_Result is begin if Nkind (N) not in N_Entity then Set_Analyzed (N, False); end if; return OK; end Clear_Analyzed; procedure Reset_Analyzed is new Traverse_Proc (Clear_Analyzed); -- Start of processing for Reset_Analyzed_Flags begin Reset_Analyzed (N); end Reset_Analyzed_Flags; ------------------------ -- Restore_SPARK_Mode -- ------------------------ procedure Restore_SPARK_Mode (Mode : SPARK_Mode_Type) is begin SPARK_Mode := Mode; end Restore_SPARK_Mode; -------------------------------- -- Returns_Unconstrained_Type -- -------------------------------- function Returns_Unconstrained_Type (Subp : Entity_Id) return Boolean is begin return Ekind (Subp) = E_Function and then not Is_Scalar_Type (Etype (Subp)) and then not Is_Access_Type (Etype (Subp)) and then not Is_Constrained (Etype (Subp)); end Returns_Unconstrained_Type; ---------------------------- -- Root_Type_Of_Full_View -- ---------------------------- function Root_Type_Of_Full_View (T : Entity_Id) return Entity_Id is Rtyp : constant Entity_Id := Root_Type (T); begin -- The root type of the full view may itself be a private type. Keep -- looking for the ultimate derivation parent. if Is_Private_Type (Rtyp) and then Present (Full_View (Rtyp)) then return Root_Type_Of_Full_View (Full_View (Rtyp)); else return Rtyp; end if; end Root_Type_Of_Full_View; --------------------------- -- Safe_To_Capture_Value -- --------------------------- function Safe_To_Capture_Value (N : Node_Id; Ent : Entity_Id; Cond : Boolean := False) return Boolean is begin -- The only entities for which we track constant values are variables -- which are not renamings, constants, out parameters, and in out -- parameters, so check if we have this case. -- Note: it may seem odd to track constant values for constants, but in -- fact this routine is used for other purposes than simply capturing -- the value. In particular, the setting of Known[_Non]_Null. if (Ekind (Ent) = E_Variable and then No (Renamed_Object (Ent))) or else Ekind_In (Ent, E_Constant, E_Out_Parameter, E_In_Out_Parameter) then null; -- For conditionals, we also allow loop parameters and all formals, -- including in parameters. elsif Cond and then Ekind_In (Ent, E_Loop_Parameter, E_In_Parameter) then null; -- For all other cases, not just unsafe, but impossible to capture -- Current_Value, since the above are the only entities which have -- Current_Value fields. else return False; end if; -- Skip if volatile or aliased, since funny things might be going on in -- these cases which we cannot necessarily track. Also skip any variable -- for which an address clause is given, or whose address is taken. Also -- never capture value of library level variables (an attempt to do so -- can occur in the case of package elaboration code). if Treat_As_Volatile (Ent) or else Is_Aliased (Ent) or else Present (Address_Clause (Ent)) or else Address_Taken (Ent) or else (Is_Library_Level_Entity (Ent) and then Ekind (Ent) = E_Variable) then return False; end if; -- OK, all above conditions are met. We also require that the scope of -- the reference be the same as the scope of the entity, not counting -- packages and blocks and loops. declare E_Scope : constant Entity_Id := Scope (Ent); R_Scope : Entity_Id; begin R_Scope := Current_Scope; while R_Scope /= Standard_Standard loop exit when R_Scope = E_Scope; if not Ekind_In (R_Scope, E_Package, E_Block, E_Loop) then return False; else R_Scope := Scope (R_Scope); end if; end loop; end; -- We also require that the reference does not appear in a context -- where it is not sure to be executed (i.e. a conditional context -- or an exception handler). We skip this if Cond is True, since the -- capturing of values from conditional tests handles this ok. if Cond then return True; end if; declare Desc : Node_Id; P : Node_Id; begin Desc := N; -- Seems dubious that case expressions are not handled here ??? P := Parent (N); while Present (P) loop if Nkind (P) = N_If_Statement or else Nkind (P) = N_Case_Statement or else (Nkind (P) in N_Short_Circuit and then Desc = Right_Opnd (P)) or else (Nkind (P) = N_If_Expression and then Desc /= First (Expressions (P))) or else Nkind (P) = N_Exception_Handler or else Nkind (P) = N_Selective_Accept or else Nkind (P) = N_Conditional_Entry_Call or else Nkind (P) = N_Timed_Entry_Call or else Nkind (P) = N_Asynchronous_Select then return False; else Desc := P; P := Parent (P); -- A special Ada 2012 case: the original node may be part -- of the else_actions of a conditional expression, in which -- case it might not have been expanded yet, and appears in -- a non-syntactic list of actions. In that case it is clearly -- not safe to save a value. if No (P) and then Is_List_Member (Desc) and then No (Parent (List_Containing (Desc))) then return False; end if; end if; end loop; end; -- OK, looks safe to set value return True; end Safe_To_Capture_Value; --------------- -- Same_Name -- --------------- function Same_Name (N1, N2 : Node_Id) return Boolean is K1 : constant Node_Kind := Nkind (N1); K2 : constant Node_Kind := Nkind (N2); begin if (K1 = N_Identifier or else K1 = N_Defining_Identifier) and then (K2 = N_Identifier or else K2 = N_Defining_Identifier) then return Chars (N1) = Chars (N2); elsif (K1 = N_Selected_Component or else K1 = N_Expanded_Name) and then (K2 = N_Selected_Component or else K2 = N_Expanded_Name) then return Same_Name (Selector_Name (N1), Selector_Name (N2)) and then Same_Name (Prefix (N1), Prefix (N2)); else return False; end if; end Same_Name; ----------------- -- Same_Object -- ----------------- function Same_Object (Node1, Node2 : Node_Id) return Boolean is N1 : constant Node_Id := Original_Node (Node1); N2 : constant Node_Id := Original_Node (Node2); -- We do the tests on original nodes, since we are most interested -- in the original source, not any expansion that got in the way. K1 : constant Node_Kind := Nkind (N1); K2 : constant Node_Kind := Nkind (N2); begin -- First case, both are entities with same entity if K1 in N_Has_Entity and then K2 in N_Has_Entity then declare EN1 : constant Entity_Id := Entity (N1); EN2 : constant Entity_Id := Entity (N2); begin if Present (EN1) and then Present (EN2) and then (Ekind_In (EN1, E_Variable, E_Constant) or else Is_Formal (EN1)) and then EN1 = EN2 then return True; end if; end; end if; -- Second case, selected component with same selector, same record if K1 = N_Selected_Component and then K2 = N_Selected_Component and then Chars (Selector_Name (N1)) = Chars (Selector_Name (N2)) then return Same_Object (Prefix (N1), Prefix (N2)); -- Third case, indexed component with same subscripts, same array elsif K1 = N_Indexed_Component and then K2 = N_Indexed_Component and then Same_Object (Prefix (N1), Prefix (N2)) then declare E1, E2 : Node_Id; begin E1 := First (Expressions (N1)); E2 := First (Expressions (N2)); while Present (E1) loop if not Same_Value (E1, E2) then return False; else Next (E1); Next (E2); end if; end loop; return True; end; -- Fourth case, slice of same array with same bounds elsif K1 = N_Slice and then K2 = N_Slice and then Nkind (Discrete_Range (N1)) = N_Range and then Nkind (Discrete_Range (N2)) = N_Range and then Same_Value (Low_Bound (Discrete_Range (N1)), Low_Bound (Discrete_Range (N2))) and then Same_Value (High_Bound (Discrete_Range (N1)), High_Bound (Discrete_Range (N2))) then return Same_Name (Prefix (N1), Prefix (N2)); -- All other cases, not clearly the same object else return False; end if; end Same_Object; --------------- -- Same_Type -- --------------- function Same_Type (T1, T2 : Entity_Id) return Boolean is begin if T1 = T2 then return True; elsif not Is_Constrained (T1) and then not Is_Constrained (T2) and then Base_Type (T1) = Base_Type (T2) then return True; -- For now don't bother with case of identical constraints, to be -- fiddled with later on perhaps (this is only used for optimization -- purposes, so it is not critical to do a best possible job) else return False; end if; end Same_Type; ---------------- -- Same_Value -- ---------------- function Same_Value (Node1, Node2 : Node_Id) return Boolean is begin if Compile_Time_Known_Value (Node1) and then Compile_Time_Known_Value (Node2) and then Expr_Value (Node1) = Expr_Value (Node2) then return True; elsif Same_Object (Node1, Node2) then return True; else return False; end if; end Same_Value; ----------------------------- -- Save_SPARK_Mode_And_Set -- ----------------------------- procedure Save_SPARK_Mode_And_Set (Context : Entity_Id; Mode : out SPARK_Mode_Type) is begin -- Save the current mode in effect Mode := SPARK_Mode; -- Do not consider illegal or partially decorated constructs if Ekind (Context) = E_Void or else Error_Posted (Context) then null; elsif Present (SPARK_Pragma (Context)) then SPARK_Mode := Get_SPARK_Mode_From_Annotation (SPARK_Pragma (Context)); end if; end Save_SPARK_Mode_And_Set; ------------------------- -- Scalar_Part_Present -- ------------------------- function Scalar_Part_Present (T : Entity_Id) return Boolean is C : Entity_Id; begin if Is_Scalar_Type (T) then return True; elsif Is_Array_Type (T) then return Scalar_Part_Present (Component_Type (T)); elsif Is_Record_Type (T) or else Has_Discriminants (T) then C := First_Component_Or_Discriminant (T); while Present (C) loop if Scalar_Part_Present (Etype (C)) then return True; else Next_Component_Or_Discriminant (C); end if; end loop; end if; return False; end Scalar_Part_Present; ------------------------ -- Scope_Is_Transient -- ------------------------ function Scope_Is_Transient return Boolean is begin return Scope_Stack.Table (Scope_Stack.Last).Is_Transient; end Scope_Is_Transient; ------------------ -- Scope_Within -- ------------------ function Scope_Within (Scope1, Scope2 : Entity_Id) return Boolean is Scop : Entity_Id; begin Scop := Scope1; while Scop /= Standard_Standard loop Scop := Scope (Scop); if Scop = Scope2 then return True; end if; end loop; return False; end Scope_Within; -------------------------- -- Scope_Within_Or_Same -- -------------------------- function Scope_Within_Or_Same (Scope1, Scope2 : Entity_Id) return Boolean is Scop : Entity_Id; begin Scop := Scope1; while Scop /= Standard_Standard loop if Scop = Scope2 then return True; else Scop := Scope (Scop); end if; end loop; return False; end Scope_Within_Or_Same; -------------------- -- Set_Convention -- -------------------- procedure Set_Convention (E : Entity_Id; Val : Snames.Convention_Id) is begin Basic_Set_Convention (E, Val); if Is_Type (E) and then Is_Access_Subprogram_Type (Base_Type (E)) and then Has_Foreign_Convention (E) then -- A pragma Convention in an instance may apply to the subtype -- created for a formal, in which case we have already verified -- that conventions of actual and formal match and there is nothing -- to flag on the subtype. if In_Instance then null; else Set_Can_Use_Internal_Rep (E, False); end if; end if; -- If E is an object or component, and the type of E is an anonymous -- access type with no convention set, then also set the convention of -- the anonymous access type. We do not do this for anonymous protected -- types, since protected types always have the default convention. if Present (Etype (E)) and then (Is_Object (E) or else Ekind (E) = E_Component -- Allow E_Void (happens for pragma Convention appearing -- in the middle of a record applying to a component) or else Ekind (E) = E_Void) then declare Typ : constant Entity_Id := Etype (E); begin if Ekind_In (Typ, E_Anonymous_Access_Type, E_Anonymous_Access_Subprogram_Type) and then not Has_Convention_Pragma (Typ) then Basic_Set_Convention (Typ, Val); Set_Has_Convention_Pragma (Typ); -- And for the access subprogram type, deal similarly with the -- designated E_Subprogram_Type if it is also internal (which -- it always is?) if Ekind (Typ) = E_Anonymous_Access_Subprogram_Type then declare Dtype : constant Entity_Id := Designated_Type (Typ); begin if Ekind (Dtype) = E_Subprogram_Type and then Is_Itype (Dtype) and then not Has_Convention_Pragma (Dtype) then Basic_Set_Convention (Dtype, Val); Set_Has_Convention_Pragma (Dtype); end if; end; end if; end if; end; end if; end Set_Convention; ------------------------ -- Set_Current_Entity -- ------------------------ -- The given entity is to be set as the currently visible definition of its -- associated name (i.e. the Node_Id associated with its name). All we have -- to do is to get the name from the identifier, and then set the -- associated Node_Id to point to the given entity. procedure Set_Current_Entity (E : Entity_Id) is begin Set_Name_Entity_Id (Chars (E), E); end Set_Current_Entity; --------------------------- -- Set_Debug_Info_Needed -- --------------------------- procedure Set_Debug_Info_Needed (T : Entity_Id) is procedure Set_Debug_Info_Needed_If_Not_Set (E : Entity_Id); pragma Inline (Set_Debug_Info_Needed_If_Not_Set); -- Used to set debug info in a related node if not set already -------------------------------------- -- Set_Debug_Info_Needed_If_Not_Set -- -------------------------------------- procedure Set_Debug_Info_Needed_If_Not_Set (E : Entity_Id) is begin if Present (E) and then not Needs_Debug_Info (E) then Set_Debug_Info_Needed (E); -- For a private type, indicate that the full view also needs -- debug information. if Is_Type (E) and then Is_Private_Type (E) and then Present (Full_View (E)) then Set_Debug_Info_Needed (Full_View (E)); end if; end if; end Set_Debug_Info_Needed_If_Not_Set; -- Start of processing for Set_Debug_Info_Needed begin -- Nothing to do if argument is Empty or has Debug_Info_Off set, which -- indicates that Debug_Info_Needed is never required for the entity. -- Nothing to do if entity comes from a predefined file. Library files -- are compiled without debug information, but inlined bodies of these -- routines may appear in user code, and debug information on them ends -- up complicating debugging the user code. if No (T) or else Debug_Info_Off (T) then return; elsif In_Inlined_Body and then Is_Predefined_File_Name (Unit_File_Name (Get_Source_Unit (Sloc (T)))) then Set_Needs_Debug_Info (T, False); end if; -- Set flag in entity itself. Note that we will go through the following -- circuitry even if the flag is already set on T. That's intentional, -- it makes sure that the flag will be set in subsidiary entities. Set_Needs_Debug_Info (T); -- Set flag on subsidiary entities if not set already if Is_Object (T) then Set_Debug_Info_Needed_If_Not_Set (Etype (T)); elsif Is_Type (T) then Set_Debug_Info_Needed_If_Not_Set (Etype (T)); if Is_Record_Type (T) then declare Ent : Entity_Id := First_Entity (T); begin while Present (Ent) loop Set_Debug_Info_Needed_If_Not_Set (Ent); Next_Entity (Ent); end loop; end; -- For a class wide subtype, we also need debug information -- for the equivalent type. if Ekind (T) = E_Class_Wide_Subtype then Set_Debug_Info_Needed_If_Not_Set (Equivalent_Type (T)); end if; elsif Is_Array_Type (T) then Set_Debug_Info_Needed_If_Not_Set (Component_Type (T)); declare Indx : Node_Id := First_Index (T); begin while Present (Indx) loop Set_Debug_Info_Needed_If_Not_Set (Etype (Indx)); Indx := Next_Index (Indx); end loop; end; -- For a packed array type, we also need debug information for -- the type used to represent the packed array. Conversely, we -- also need it for the former if we need it for the latter. if Is_Packed (T) then Set_Debug_Info_Needed_If_Not_Set (Packed_Array_Impl_Type (T)); end if; if Is_Packed_Array_Impl_Type (T) then Set_Debug_Info_Needed_If_Not_Set (Original_Array_Type (T)); end if; elsif Is_Access_Type (T) then Set_Debug_Info_Needed_If_Not_Set (Directly_Designated_Type (T)); elsif Is_Private_Type (T) then declare FV : constant Entity_Id := Full_View (T); begin Set_Debug_Info_Needed_If_Not_Set (FV); -- If the full view is itself a derived private type, we need -- debug information on its underlying type. if Present (FV) and then Is_Private_Type (FV) and then Present (Underlying_Full_View (FV)) then Set_Needs_Debug_Info (Underlying_Full_View (FV)); end if; end; elsif Is_Protected_Type (T) then Set_Debug_Info_Needed_If_Not_Set (Corresponding_Record_Type (T)); elsif Is_Scalar_Type (T) then -- If the subrange bounds are materialized by dedicated constant -- objects, also include them in the debug info to make sure the -- debugger can properly use them. if Present (Scalar_Range (T)) and then Nkind (Scalar_Range (T)) = N_Range then declare Low_Bnd : constant Node_Id := Type_Low_Bound (T); High_Bnd : constant Node_Id := Type_High_Bound (T); begin if Is_Entity_Name (Low_Bnd) then Set_Debug_Info_Needed_If_Not_Set (Entity (Low_Bnd)); end if; if Is_Entity_Name (High_Bnd) then Set_Debug_Info_Needed_If_Not_Set (Entity (High_Bnd)); end if; end; end if; end if; end if; end Set_Debug_Info_Needed; ---------------------------- -- Set_Entity_With_Checks -- ---------------------------- procedure Set_Entity_With_Checks (N : Node_Id; Val : Entity_Id) is Val_Actual : Entity_Id; Nod : Node_Id; Post_Node : Node_Id; begin -- Unconditionally set the entity Set_Entity (N, Val); -- The node to post on is the selector in the case of an expanded name, -- and otherwise the node itself. if Nkind (N) = N_Expanded_Name then Post_Node := Selector_Name (N); else Post_Node := N; end if; -- Check for violation of No_Fixed_IO if Restriction_Check_Required (No_Fixed_IO) and then ((RTU_Loaded (Ada_Text_IO) and then (Is_RTE (Val, RE_Decimal_IO) or else Is_RTE (Val, RE_Fixed_IO))) or else (RTU_Loaded (Ada_Wide_Text_IO) and then (Is_RTE (Val, RO_WT_Decimal_IO) or else Is_RTE (Val, RO_WT_Fixed_IO))) or else (RTU_Loaded (Ada_Wide_Wide_Text_IO) and then (Is_RTE (Val, RO_WW_Decimal_IO) or else Is_RTE (Val, RO_WW_Fixed_IO)))) -- A special extra check, don't complain about a reference from within -- the Ada.Interrupts package itself! and then not In_Same_Extended_Unit (N, Val) then Check_Restriction (No_Fixed_IO, Post_Node); end if; -- Remaining checks are only done on source nodes. Note that we test -- for violation of No_Fixed_IO even on non-source nodes, because the -- cases for checking violations of this restriction are instantiations -- where the reference in the instance has Comes_From_Source False. if not Comes_From_Source (N) then return; end if; -- Check for violation of No_Abort_Statements, which is triggered by -- call to Ada.Task_Identification.Abort_Task. if Restriction_Check_Required (No_Abort_Statements) and then (Is_RTE (Val, RE_Abort_Task)) -- A special extra check, don't complain about a reference from within -- the Ada.Task_Identification package itself! and then not In_Same_Extended_Unit (N, Val) then Check_Restriction (No_Abort_Statements, Post_Node); end if; if Val = Standard_Long_Long_Integer then Check_Restriction (No_Long_Long_Integers, Post_Node); end if; -- Check for violation of No_Dynamic_Attachment if Restriction_Check_Required (No_Dynamic_Attachment) and then RTU_Loaded (Ada_Interrupts) and then (Is_RTE (Val, RE_Is_Reserved) or else Is_RTE (Val, RE_Is_Attached) or else Is_RTE (Val, RE_Current_Handler) or else Is_RTE (Val, RE_Attach_Handler) or else Is_RTE (Val, RE_Exchange_Handler) or else Is_RTE (Val, RE_Detach_Handler) or else Is_RTE (Val, RE_Reference)) -- A special extra check, don't complain about a reference from within -- the Ada.Interrupts package itself! and then not In_Same_Extended_Unit (N, Val) then Check_Restriction (No_Dynamic_Attachment, Post_Node); end if; -- Check for No_Implementation_Identifiers if Restriction_Check_Required (No_Implementation_Identifiers) then -- We have an implementation defined entity if it is marked as -- implementation defined, or is defined in a package marked as -- implementation defined. However, library packages themselves -- are excluded (we don't want to flag Interfaces itself, just -- the entities within it). if (Is_Implementation_Defined (Val) or else (Present (Scope (Val)) and then Is_Implementation_Defined (Scope (Val)))) and then not (Ekind_In (Val, E_Package, E_Generic_Package) and then Is_Library_Level_Entity (Val)) then Check_Restriction (No_Implementation_Identifiers, Post_Node); end if; end if; -- Do the style check if Style_Check and then not Suppress_Style_Checks (Val) and then not In_Instance then if Nkind (N) = N_Identifier then Nod := N; elsif Nkind (N) = N_Expanded_Name then Nod := Selector_Name (N); else return; end if; -- A special situation arises for derived operations, where we want -- to do the check against the parent (since the Sloc of the derived -- operation points to the derived type declaration itself). Val_Actual := Val; while not Comes_From_Source (Val_Actual) and then Nkind (Val_Actual) in N_Entity and then (Ekind (Val_Actual) = E_Enumeration_Literal or else Is_Subprogram_Or_Generic_Subprogram (Val_Actual)) and then Present (Alias (Val_Actual)) loop Val_Actual := Alias (Val_Actual); end loop; -- Renaming declarations for generic actuals do not come from source, -- and have a different name from that of the entity they rename, so -- there is no style check to perform here. if Chars (Nod) = Chars (Val_Actual) then Style.Check_Identifier (Nod, Val_Actual); end if; end if; Set_Entity (N, Val); end Set_Entity_With_Checks; ------------------------ -- Set_Name_Entity_Id -- ------------------------ procedure Set_Name_Entity_Id (Id : Name_Id; Val : Entity_Id) is begin Set_Name_Table_Int (Id, Int (Val)); end Set_Name_Entity_Id; --------------------- -- Set_Next_Actual -- --------------------- procedure Set_Next_Actual (Ass1_Id : Node_Id; Ass2_Id : Node_Id) is begin if Nkind (Parent (Ass1_Id)) = N_Parameter_Association then Set_First_Named_Actual (Parent (Ass1_Id), Ass2_Id); end if; end Set_Next_Actual; ---------------------------------- -- Set_Optimize_Alignment_Flags -- ---------------------------------- procedure Set_Optimize_Alignment_Flags (E : Entity_Id) is begin if Optimize_Alignment = 'S' then Set_Optimize_Alignment_Space (E); elsif Optimize_Alignment = 'T' then Set_Optimize_Alignment_Time (E); end if; end Set_Optimize_Alignment_Flags; ----------------------- -- Set_Public_Status -- ----------------------- procedure Set_Public_Status (Id : Entity_Id) is S : constant Entity_Id := Current_Scope; function Within_HSS_Or_If (E : Entity_Id) return Boolean; -- Determines if E is defined within handled statement sequence or -- an if statement, returns True if so, False otherwise. ---------------------- -- Within_HSS_Or_If -- ---------------------- function Within_HSS_Or_If (E : Entity_Id) return Boolean is N : Node_Id; begin N := Declaration_Node (E); loop N := Parent (N); if No (N) then return False; elsif Nkind_In (N, N_Handled_Sequence_Of_Statements, N_If_Statement) then return True; end if; end loop; end Within_HSS_Or_If; -- Start of processing for Set_Public_Status begin -- Everything in the scope of Standard is public if S = Standard_Standard then Set_Is_Public (Id); -- Entity is definitely not public if enclosing scope is not public elsif not Is_Public (S) then return; -- An object or function declaration that occurs in a handled sequence -- of statements or within an if statement is the declaration for a -- temporary object or local subprogram generated by the expander. It -- never needs to be made public and furthermore, making it public can -- cause back end problems. elsif Nkind_In (Parent (Id), N_Object_Declaration, N_Function_Specification) and then Within_HSS_Or_If (Id) then return; -- Entities in public packages or records are public elsif Ekind (S) = E_Package or Is_Record_Type (S) then Set_Is_Public (Id); -- The bounds of an entry family declaration can generate object -- declarations that are visible to the back-end, e.g. in the -- the declaration of a composite type that contains tasks. elsif Is_Concurrent_Type (S) and then not Has_Completion (S) and then Nkind (Parent (Id)) = N_Object_Declaration then Set_Is_Public (Id); end if; end Set_Public_Status; ----------------------------- -- Set_Referenced_Modified -- ----------------------------- procedure Set_Referenced_Modified (N : Node_Id; Out_Param : Boolean) is Pref : Node_Id; begin -- Deal with indexed or selected component where prefix is modified if Nkind_In (N, N_Indexed_Component, N_Selected_Component) then Pref := Prefix (N); -- If prefix is access type, then it is the designated object that is -- being modified, which means we have no entity to set the flag on. if No (Etype (Pref)) or else Is_Access_Type (Etype (Pref)) then return; -- Otherwise chase the prefix else Set_Referenced_Modified (Pref, Out_Param); end if; -- Otherwise see if we have an entity name (only other case to process) elsif Is_Entity_Name (N) and then Present (Entity (N)) then Set_Referenced_As_LHS (Entity (N), not Out_Param); Set_Referenced_As_Out_Parameter (Entity (N), Out_Param); end if; end Set_Referenced_Modified; ------------------ -- Set_Rep_Info -- ------------------ procedure Set_Rep_Info (T1, T2 : Entity_Id) is begin Set_Is_Atomic (T1, Is_Atomic (T2)); Set_Is_Independent (T1, Is_Independent (T2)); Set_Is_Volatile_Full_Access (T1, Is_Volatile_Full_Access (T2)); if Is_Base_Type (T1) then Set_Is_Volatile (T1, Is_Volatile (T2)); end if; end Set_Rep_Info; ---------------------------- -- Set_Scope_Is_Transient -- ---------------------------- procedure Set_Scope_Is_Transient (V : Boolean := True) is begin Scope_Stack.Table (Scope_Stack.Last).Is_Transient := V; end Set_Scope_Is_Transient; ------------------- -- Set_Size_Info -- ------------------- procedure Set_Size_Info (T1, T2 : Entity_Id) is begin -- We copy Esize, but not RM_Size, since in general RM_Size is -- subtype specific and does not get inherited by all subtypes. Set_Esize (T1, Esize (T2)); Set_Has_Biased_Representation (T1, Has_Biased_Representation (T2)); if Is_Discrete_Or_Fixed_Point_Type (T1) and then Is_Discrete_Or_Fixed_Point_Type (T2) then Set_Is_Unsigned_Type (T1, Is_Unsigned_Type (T2)); end if; Set_Alignment (T1, Alignment (T2)); end Set_Size_Info; -------------------- -- Static_Boolean -- -------------------- function Static_Boolean (N : Node_Id) return Uint is begin Analyze_And_Resolve (N, Standard_Boolean); if N = Error or else Error_Posted (N) or else Etype (N) = Any_Type then return No_Uint; end if; if Is_OK_Static_Expression (N) then if not Raises_Constraint_Error (N) then return Expr_Value (N); else return No_Uint; end if; elsif Etype (N) = Any_Type then return No_Uint; else Flag_Non_Static_Expr ("static boolean expression required here", N); return No_Uint; end if; end Static_Boolean; -------------------- -- Static_Integer -- -------------------- function Static_Integer (N : Node_Id) return Uint is begin Analyze_And_Resolve (N, Any_Integer); if N = Error or else Error_Posted (N) or else Etype (N) = Any_Type then return No_Uint; end if; if Is_OK_Static_Expression (N) then if not Raises_Constraint_Error (N) then return Expr_Value (N); else return No_Uint; end if; elsif Etype (N) = Any_Type then return No_Uint; else Flag_Non_Static_Expr ("static integer expression required here", N); return No_Uint; end if; end Static_Integer; -------------------------- -- Statically_Different -- -------------------------- function Statically_Different (E1, E2 : Node_Id) return Boolean is R1 : constant Node_Id := Get_Referenced_Object (E1); R2 : constant Node_Id := Get_Referenced_Object (E2); begin return Is_Entity_Name (R1) and then Is_Entity_Name (R2) and then Entity (R1) /= Entity (R2) and then not Is_Formal (Entity (R1)) and then not Is_Formal (Entity (R2)); end Statically_Different; -------------------------------------- -- Subject_To_Loop_Entry_Attributes -- -------------------------------------- function Subject_To_Loop_Entry_Attributes (N : Node_Id) return Boolean is Stmt : Node_Id; begin Stmt := N; -- The expansion mechanism transform a loop subject to at least one -- 'Loop_Entry attribute into a conditional block. Infinite loops lack -- the conditional part. if Nkind_In (Stmt, N_Block_Statement, N_If_Statement) and then Nkind (Original_Node (N)) = N_Loop_Statement then Stmt := Original_Node (N); end if; return Nkind (Stmt) = N_Loop_Statement and then Present (Identifier (Stmt)) and then Present (Entity (Identifier (Stmt))) and then Has_Loop_Entry_Attributes (Entity (Identifier (Stmt))); end Subject_To_Loop_Entry_Attributes; ----------------------------- -- Subprogram_Access_Level -- ----------------------------- function Subprogram_Access_Level (Subp : Entity_Id) return Uint is begin if Present (Alias (Subp)) then return Subprogram_Access_Level (Alias (Subp)); else return Scope_Depth (Enclosing_Dynamic_Scope (Subp)); end if; end Subprogram_Access_Level; ------------------------------- -- Support_Atomic_Primitives -- ------------------------------- function Support_Atomic_Primitives (Typ : Entity_Id) return Boolean is Size : Int; begin -- Verify the alignment of Typ is known if not Known_Alignment (Typ) then return False; end if; if Known_Static_Esize (Typ) then Size := UI_To_Int (Esize (Typ)); -- If the Esize (Object_Size) is unknown at compile time, look at the -- RM_Size (Value_Size) which may have been set by an explicit rep item. elsif Known_Static_RM_Size (Typ) then Size := UI_To_Int (RM_Size (Typ)); -- Otherwise, the size is considered to be unknown. else return False; end if; -- Check that the size of the component is 8, 16, 32, or 64 bits and -- that Typ is properly aligned. case Size is when 8 | 16 | 32 | 64 => return Size = UI_To_Int (Alignment (Typ)) * 8; when others => return False; end case; end Support_Atomic_Primitives; ----------------- -- Trace_Scope -- ----------------- procedure Trace_Scope (N : Node_Id; E : Entity_Id; Msg : String) is begin if Debug_Flag_W then for J in 0 .. Scope_Stack.Last loop Write_Str (" "); end loop; Write_Str (Msg); Write_Name (Chars (E)); Write_Str (" from "); Write_Location (Sloc (N)); Write_Eol; end if; end Trace_Scope; ----------------------- -- Transfer_Entities -- ----------------------- procedure Transfer_Entities (From : Entity_Id; To : Entity_Id) is procedure Set_Public_Status_Of (Id : Entity_Id); -- Set the Is_Public attribute of arbitrary entity Id by calling routine -- Set_Public_Status. If successfull and Id denotes a record type, set -- the Is_Public attribute of its fields. -------------------------- -- Set_Public_Status_Of -- -------------------------- procedure Set_Public_Status_Of (Id : Entity_Id) is Field : Entity_Id; begin if not Is_Public (Id) then Set_Public_Status (Id); -- When the input entity is a public record type, ensure that all -- its internal fields are also exposed to the linker. The fields -- of a class-wide type are never made public. if Is_Public (Id) and then Is_Record_Type (Id) and then not Is_Class_Wide_Type (Id) then Field := First_Entity (Id); while Present (Field) loop Set_Is_Public (Field); Next_Entity (Field); end loop; end if; end if; end Set_Public_Status_Of; -- Local variables Full_Id : Entity_Id; Id : Entity_Id; -- Start of processing for Transfer_Entities begin Id := First_Entity (From); if Present (Id) then -- Merge the entity chain of the source scope with that of the -- destination scope. if Present (Last_Entity (To)) then Set_Next_Entity (Last_Entity (To), Id); else Set_First_Entity (To, Id); end if; Set_Last_Entity (To, Last_Entity (From)); -- Inspect the entities of the source scope and update their Scope -- attribute. while Present (Id) loop Set_Scope (Id, To); Set_Public_Status_Of (Id); -- Handle an internally generated full view for a private type if Is_Private_Type (Id) and then Present (Full_View (Id)) and then Is_Itype (Full_View (Id)) then Full_Id := Full_View (Id); Set_Scope (Full_Id, To); Set_Public_Status_Of (Full_Id); end if; Next_Entity (Id); end loop; Set_First_Entity (From, Empty); Set_Last_Entity (From, Empty); end if; end Transfer_Entities; ----------------------- -- Type_Access_Level -- ----------------------- function Type_Access_Level (Typ : Entity_Id) return Uint is Btyp : Entity_Id; begin Btyp := Base_Type (Typ); -- Ada 2005 (AI-230): For most cases of anonymous access types, we -- simply use the level where the type is declared. This is true for -- stand-alone object declarations, and for anonymous access types -- associated with components the level is the same as that of the -- enclosing composite type. However, special treatment is needed for -- the cases of access parameters, return objects of an anonymous access -- type, and, in Ada 95, access discriminants of limited types. if Is_Access_Type (Btyp) then if Ekind (Btyp) = E_Anonymous_Access_Type then -- If the type is a nonlocal anonymous access type (such as for -- an access parameter) we treat it as being declared at the -- library level to ensure that names such as X.all'access don't -- fail static accessibility checks. if not Is_Local_Anonymous_Access (Typ) then return Scope_Depth (Standard_Standard); -- If this is a return object, the accessibility level is that of -- the result subtype of the enclosing function. The test here is -- little complicated, because we have to account for extended -- return statements that have been rewritten as blocks, in which -- case we have to find and the Is_Return_Object attribute of the -- itype's associated object. It would be nice to find a way to -- simplify this test, but it doesn't seem worthwhile to add a new -- flag just for purposes of this test. ??? elsif Ekind (Scope (Btyp)) = E_Return_Statement or else (Is_Itype (Btyp) and then Nkind (Associated_Node_For_Itype (Btyp)) = N_Object_Declaration and then Is_Return_Object (Defining_Identifier (Associated_Node_For_Itype (Btyp)))) then declare Scop : Entity_Id; begin Scop := Scope (Scope (Btyp)); while Present (Scop) loop exit when Ekind (Scop) = E_Function; Scop := Scope (Scop); end loop; -- Treat the return object's type as having the level of the -- function's result subtype (as per RM05-6.5(5.3/2)). return Type_Access_Level (Etype (Scop)); end; end if; end if; Btyp := Root_Type (Btyp); -- The accessibility level of anonymous access types associated with -- discriminants is that of the current instance of the type, and -- that's deeper than the type itself (AARM 3.10.2 (12.3.21)). -- AI-402: access discriminants have accessibility based on the -- object rather than the type in Ada 2005, so the above paragraph -- doesn't apply. -- ??? Needs completion with rules from AI-416 if Ada_Version <= Ada_95 and then Ekind (Typ) = E_Anonymous_Access_Type and then Present (Associated_Node_For_Itype (Typ)) and then Nkind (Associated_Node_For_Itype (Typ)) = N_Discriminant_Specification then return Scope_Depth (Enclosing_Dynamic_Scope (Btyp)) + 1; end if; end if; -- Return library level for a generic formal type. This is done because -- RM(10.3.2) says that "The statically deeper relationship does not -- apply to ... a descendant of a generic formal type". Rather than -- checking at each point where a static accessibility check is -- performed to see if we are dealing with a formal type, this rule is -- implemented by having Type_Access_Level and Deepest_Type_Access_Level -- return extreme values for a formal type; Deepest_Type_Access_Level -- returns Int'Last. By calling the appropriate function from among the -- two, we ensure that the static accessibility check will pass if we -- happen to run into a formal type. More specifically, we should call -- Deepest_Type_Access_Level instead of Type_Access_Level whenever the -- call occurs as part of a static accessibility check and the error -- case is the case where the type's level is too shallow (as opposed -- to too deep). if Is_Generic_Type (Root_Type (Btyp)) then return Scope_Depth (Standard_Standard); end if; return Scope_Depth (Enclosing_Dynamic_Scope (Btyp)); end Type_Access_Level; ------------------------------------ -- Type_Without_Stream_Operation -- ------------------------------------ function Type_Without_Stream_Operation (T : Entity_Id; Op : TSS_Name_Type := TSS_Null) return Entity_Id is BT : constant Entity_Id := Base_Type (T); Op_Missing : Boolean; begin if not Restriction_Active (No_Default_Stream_Attributes) then return Empty; end if; if Is_Elementary_Type (T) then if Op = TSS_Null then Op_Missing := No (TSS (BT, TSS_Stream_Read)) or else No (TSS (BT, TSS_Stream_Write)); else Op_Missing := No (TSS (BT, Op)); end if; if Op_Missing then return T; else return Empty; end if; elsif Is_Array_Type (T) then return Type_Without_Stream_Operation (Component_Type (T), Op); elsif Is_Record_Type (T) then declare Comp : Entity_Id; C_Typ : Entity_Id; begin Comp := First_Component (T); while Present (Comp) loop C_Typ := Type_Without_Stream_Operation (Etype (Comp), Op); if Present (C_Typ) then return C_Typ; end if; Next_Component (Comp); end loop; return Empty; end; elsif Is_Private_Type (T) and then Present (Full_View (T)) then return Type_Without_Stream_Operation (Full_View (T), Op); else return Empty; end if; end Type_Without_Stream_Operation; ---------------------------- -- Unique_Defining_Entity -- ---------------------------- function Unique_Defining_Entity (N : Node_Id) return Entity_Id is begin return Unique_Entity (Defining_Entity (N)); end Unique_Defining_Entity; ------------------- -- Unique_Entity -- ------------------- function Unique_Entity (E : Entity_Id) return Entity_Id is U : Entity_Id := E; P : Node_Id; begin case Ekind (E) is when E_Constant => if Present (Full_View (E)) then U := Full_View (E); end if; when Entry_Kind => if Nkind (Parent (E)) = N_Entry_Body then declare Prot_Item : Entity_Id; Prot_Type : Entity_Id; begin if Ekind (E) = E_Entry then Prot_Type := Scope (E); -- Bodies of entry families are nested within an extra scope -- that contains an entry index declaration else Prot_Type := Scope (Scope (E)); end if; pragma Assert (Ekind (Prot_Type) = E_Protected_Type); -- Traverse the entity list of the protected type and locate -- an entry declaration which matches the entry body. Prot_Item := First_Entity (Prot_Type); while Present (Prot_Item) loop if Ekind (Prot_Item) in Entry_Kind and then Corresponding_Body (Parent (Prot_Item)) = E then U := Prot_Item; exit; end if; Next_Entity (Prot_Item); end loop; end; end if; when Formal_Kind => if Present (Spec_Entity (E)) then U := Spec_Entity (E); end if; when E_Package_Body => P := Parent (E); if Nkind (P) = N_Defining_Program_Unit_Name then P := Parent (P); end if; if Nkind (P) = N_Package_Body and then Present (Corresponding_Spec (P)) then U := Corresponding_Spec (P); elsif Nkind (P) = N_Package_Body_Stub and then Present (Corresponding_Spec_Of_Stub (P)) then U := Corresponding_Spec_Of_Stub (P); end if; when E_Protected_Body => P := Parent (E); if Nkind (P) = N_Protected_Body and then Present (Corresponding_Spec (P)) then U := Corresponding_Spec (P); elsif Nkind (P) = N_Protected_Body_Stub and then Present (Corresponding_Spec_Of_Stub (P)) then U := Corresponding_Spec_Of_Stub (P); if Is_Single_Protected_Object (U) then U := Etype (U); end if; end if; when E_Subprogram_Body => P := Parent (E); if Nkind (P) = N_Defining_Program_Unit_Name then P := Parent (P); end if; P := Parent (P); if Nkind (P) = N_Subprogram_Body and then Present (Corresponding_Spec (P)) then U := Corresponding_Spec (P); elsif Nkind (P) = N_Subprogram_Body_Stub and then Present (Corresponding_Spec_Of_Stub (P)) then U := Corresponding_Spec_Of_Stub (P); elsif Nkind (P) = N_Subprogram_Renaming_Declaration then U := Corresponding_Spec (P); end if; when E_Task_Body => P := Parent (E); if Nkind (P) = N_Task_Body and then Present (Corresponding_Spec (P)) then U := Corresponding_Spec (P); elsif Nkind (P) = N_Task_Body_Stub and then Present (Corresponding_Spec_Of_Stub (P)) then U := Corresponding_Spec_Of_Stub (P); if Is_Single_Task_Object (U) then U := Etype (U); end if; end if; when Type_Kind => if Present (Full_View (E)) then U := Full_View (E); end if; when others => null; end case; return U; end Unique_Entity; ----------------- -- Unique_Name -- ----------------- function Unique_Name (E : Entity_Id) return String is -- Names in E_Subprogram_Body or E_Package_Body entities are not -- reliable, as they may not include the overloading suffix. Instead, -- when looking for the name of E or one of its enclosing scope, we get -- the name of the corresponding Unique_Entity. U : constant Entity_Id := Unique_Entity (E); function This_Name return String; --------------- -- This_Name -- --------------- function This_Name return String is begin return Get_Name_String (Chars (U)); end This_Name; -- Start of processing for Unique_Name begin if E = Standard_Standard or else Has_Fully_Qualified_Name (E) then return This_Name; elsif Ekind (E) = E_Enumeration_Literal then return Unique_Name (Etype (E)) & "__" & This_Name; else declare S : constant Entity_Id := Scope (U); pragma Assert (Present (S)); begin -- Prefix names of predefined types with standard__, but leave -- names of user-defined packages and subprograms without prefix -- (even if technically they are nested in the Standard package). if S = Standard_Standard then if Ekind (U) = E_Package or else Is_Subprogram (U) then return This_Name; else return Unique_Name (S) & "__" & This_Name; end if; -- For intances of generic subprograms use the name of the related -- instace and skip the scope of its wrapper package. elsif Is_Wrapper_Package (S) then pragma Assert (Scope (S) = Scope (Related_Instance (S))); -- Wrapper package and the instantiation are in the same scope declare Enclosing_Name : constant String := Unique_Name (Scope (S)) & "__" & Get_Name_String (Chars (Related_Instance (S))); begin if Is_Subprogram (U) and then not Is_Generic_Actual_Subprogram (U) then return Enclosing_Name; else return Enclosing_Name & "__" & This_Name; end if; end; else return Unique_Name (S) & "__" & This_Name; end if; end; end if; end Unique_Name; --------------------- -- Unit_Is_Visible -- --------------------- function Unit_Is_Visible (U : Entity_Id) return Boolean is Curr : constant Node_Id := Cunit (Current_Sem_Unit); Curr_Entity : constant Entity_Id := Cunit_Entity (Current_Sem_Unit); function Unit_In_Parent_Context (Par_Unit : Node_Id) return Boolean; -- For a child unit, check whether unit appears in a with_clause -- of a parent. function Unit_In_Context (Comp_Unit : Node_Id) return Boolean; -- Scan the context clause of one compilation unit looking for a -- with_clause for the unit in question. ---------------------------- -- Unit_In_Parent_Context -- ---------------------------- function Unit_In_Parent_Context (Par_Unit : Node_Id) return Boolean is begin if Unit_In_Context (Par_Unit) then return True; elsif Is_Child_Unit (Defining_Entity (Unit (Par_Unit))) then return Unit_In_Parent_Context (Parent_Spec (Unit (Par_Unit))); else return False; end if; end Unit_In_Parent_Context; --------------------- -- Unit_In_Context -- --------------------- function Unit_In_Context (Comp_Unit : Node_Id) return Boolean is Clause : Node_Id; begin Clause := First (Context_Items (Comp_Unit)); while Present (Clause) loop if Nkind (Clause) = N_With_Clause then if Library_Unit (Clause) = U then return True; -- The with_clause may denote a renaming of the unit we are -- looking for, eg. Text_IO which renames Ada.Text_IO. elsif Renamed_Entity (Entity (Name (Clause))) = Defining_Entity (Unit (U)) then return True; end if; end if; Next (Clause); end loop; return False; end Unit_In_Context; -- Start of processing for Unit_Is_Visible begin -- The currrent unit is directly visible if Curr = U then return True; elsif Unit_In_Context (Curr) then return True; -- If the current unit is a body, check the context of the spec elsif Nkind (Unit (Curr)) = N_Package_Body or else (Nkind (Unit (Curr)) = N_Subprogram_Body and then not Acts_As_Spec (Unit (Curr))) then if Unit_In_Context (Library_Unit (Curr)) then return True; end if; end if; -- If the spec is a child unit, examine the parents if Is_Child_Unit (Curr_Entity) then if Nkind (Unit (Curr)) in N_Unit_Body then return Unit_In_Parent_Context (Parent_Spec (Unit (Library_Unit (Curr)))); else return Unit_In_Parent_Context (Parent_Spec (Unit (Curr))); end if; else return False; end if; end Unit_Is_Visible; ------------------------------ -- Universal_Interpretation -- ------------------------------ function Universal_Interpretation (Opnd : Node_Id) return Entity_Id is Index : Interp_Index; It : Interp; begin -- The argument may be a formal parameter of an operator or subprogram -- with multiple interpretations, or else an expression for an actual. if Nkind (Opnd) = N_Defining_Identifier or else not Is_Overloaded (Opnd) then if Etype (Opnd) = Universal_Integer or else Etype (Opnd) = Universal_Real then return Etype (Opnd); else return Empty; end if; else Get_First_Interp (Opnd, Index, It); while Present (It.Typ) loop if It.Typ = Universal_Integer or else It.Typ = Universal_Real then return It.Typ; end if; Get_Next_Interp (Index, It); end loop; return Empty; end if; end Universal_Interpretation; --------------- -- Unqualify -- --------------- function Unqualify (Expr : Node_Id) return Node_Id is begin -- Recurse to handle unlikely case of multiple levels of qualification if Nkind (Expr) = N_Qualified_Expression then return Unqualify (Expression (Expr)); -- Normal case, not a qualified expression else return Expr; end if; end Unqualify; ----------------------- -- Visible_Ancestors -- ----------------------- function Visible_Ancestors (Typ : Entity_Id) return Elist_Id is List_1 : Elist_Id; List_2 : Elist_Id; Elmt : Elmt_Id; begin pragma Assert (Is_Record_Type (Typ) and then Is_Tagged_Type (Typ)); -- Collect all the parents and progenitors of Typ. If the full-view of -- private parents and progenitors is available then it is used to -- generate the list of visible ancestors; otherwise their partial -- view is added to the resulting list. Collect_Parents (T => Typ, List => List_1, Use_Full_View => True); Collect_Interfaces (T => Typ, Ifaces_List => List_2, Exclude_Parents => True, Use_Full_View => True); -- Join the two lists. Avoid duplications because an interface may -- simultaneously be parent and progenitor of a type. Elmt := First_Elmt (List_2); while Present (Elmt) loop Append_Unique_Elmt (Node (Elmt), List_1); Next_Elmt (Elmt); end loop; return List_1; end Visible_Ancestors; ---------------------- -- Within_Init_Proc -- ---------------------- function Within_Init_Proc return Boolean is S : Entity_Id; begin S := Current_Scope; while not Is_Overloadable (S) loop if S = Standard_Standard then return False; else S := Scope (S); end if; end loop; return Is_Init_Proc (S); end Within_Init_Proc; ------------------ -- Within_Scope -- ------------------ function Within_Scope (E : Entity_Id; S : Entity_Id) return Boolean is begin return Scope_Within_Or_Same (Scope (E), S); end Within_Scope; ---------------- -- Wrong_Type -- ---------------- procedure Wrong_Type (Expr : Node_Id; Expected_Type : Entity_Id) is Found_Type : constant Entity_Id := First_Subtype (Etype (Expr)); Expec_Type : constant Entity_Id := First_Subtype (Expected_Type); Matching_Field : Entity_Id; -- Entity to give a more precise suggestion on how to write a one- -- element positional aggregate. function Has_One_Matching_Field return Boolean; -- Determines if Expec_Type is a record type with a single component or -- discriminant whose type matches the found type or is one dimensional -- array whose component type matches the found type. In the case of -- one discriminant, we ignore the variant parts. That's not accurate, -- but good enough for the warning. ---------------------------- -- Has_One_Matching_Field -- ---------------------------- function Has_One_Matching_Field return Boolean is E : Entity_Id; begin Matching_Field := Empty; if Is_Array_Type (Expec_Type) and then Number_Dimensions (Expec_Type) = 1 and then Covers (Etype (Component_Type (Expec_Type)), Found_Type) then -- Use type name if available. This excludes multidimensional -- arrays and anonymous arrays. if Comes_From_Source (Expec_Type) then Matching_Field := Expec_Type; -- For an assignment, use name of target elsif Nkind (Parent (Expr)) = N_Assignment_Statement and then Is_Entity_Name (Name (Parent (Expr))) then Matching_Field := Entity (Name (Parent (Expr))); end if; return True; elsif not Is_Record_Type (Expec_Type) then return False; else E := First_Entity (Expec_Type); loop if No (E) then return False; elsif not Ekind_In (E, E_Discriminant, E_Component) or else Nam_In (Chars (E), Name_uTag, Name_uParent) then Next_Entity (E); else exit; end if; end loop; if not Covers (Etype (E), Found_Type) then return False; elsif Present (Next_Entity (E)) and then (Ekind (E) = E_Component or else Ekind (Next_Entity (E)) = E_Discriminant) then return False; else Matching_Field := E; return True; end if; end if; end Has_One_Matching_Field; -- Start of processing for Wrong_Type begin -- Don't output message if either type is Any_Type, or if a message -- has already been posted for this node. We need to do the latter -- check explicitly (it is ordinarily done in Errout), because we -- are using ! to force the output of the error messages. if Expec_Type = Any_Type or else Found_Type = Any_Type or else Error_Posted (Expr) then return; -- If one of the types is a Taft-Amendment type and the other it its -- completion, it must be an illegal use of a TAT in the spec, for -- which an error was already emitted. Avoid cascaded errors. elsif Is_Incomplete_Type (Expec_Type) and then Has_Completion_In_Body (Expec_Type) and then Full_View (Expec_Type) = Etype (Expr) then return; elsif Is_Incomplete_Type (Etype (Expr)) and then Has_Completion_In_Body (Etype (Expr)) and then Full_View (Etype (Expr)) = Expec_Type then return; -- In an instance, there is an ongoing problem with completion of -- type derived from private types. Their structure is what Gigi -- expects, but the Etype is the parent type rather than the -- derived private type itself. Do not flag error in this case. The -- private completion is an entity without a parent, like an Itype. -- Similarly, full and partial views may be incorrect in the instance. -- There is no simple way to insure that it is consistent ??? -- A similar view discrepancy can happen in an inlined body, for the -- same reason: inserted body may be outside of the original package -- and only partial views are visible at the point of insertion. elsif In_Instance or else In_Inlined_Body then if Etype (Etype (Expr)) = Etype (Expected_Type) and then (Has_Private_Declaration (Expected_Type) or else Has_Private_Declaration (Etype (Expr))) and then No (Parent (Expected_Type)) then return; elsif Nkind (Parent (Expr)) = N_Qualified_Expression and then Entity (Subtype_Mark (Parent (Expr))) = Expected_Type then return; elsif Is_Private_Type (Expected_Type) and then Present (Full_View (Expected_Type)) and then Covers (Full_View (Expected_Type), Etype (Expr)) then return; -- Conversely, type of expression may be the private one elsif Is_Private_Type (Base_Type (Etype (Expr))) and then Full_View (Base_Type (Etype (Expr))) = Expected_Type then return; end if; end if; -- An interesting special check. If the expression is parenthesized -- and its type corresponds to the type of the sole component of the -- expected record type, or to the component type of the expected one -- dimensional array type, then assume we have a bad aggregate attempt. if Nkind (Expr) in N_Subexpr and then Paren_Count (Expr) /= 0 and then Has_One_Matching_Field then Error_Msg_N ("positional aggregate cannot have one component", Expr); if Present (Matching_Field) then if Is_Array_Type (Expec_Type) then Error_Msg_NE ("\write instead `&''First ='> ...`", Expr, Matching_Field); else Error_Msg_NE ("\write instead `& ='> ...`", Expr, Matching_Field); end if; end if; -- Another special check, if we are looking for a pool-specific access -- type and we found an E_Access_Attribute_Type, then we have the case -- of an Access attribute being used in a context which needs a pool- -- specific type, which is never allowed. The one extra check we make -- is that the expected designated type covers the Found_Type. elsif Is_Access_Type (Expec_Type) and then Ekind (Found_Type) = E_Access_Attribute_Type and then Ekind (Base_Type (Expec_Type)) /= E_General_Access_Type and then Ekind (Base_Type (Expec_Type)) /= E_Anonymous_Access_Type and then Covers (Designated_Type (Expec_Type), Designated_Type (Found_Type)) then Error_Msg_N -- CODEFIX ("result must be general access type!", Expr); Error_Msg_NE -- CODEFIX ("add ALL to }!", Expr, Expec_Type); -- Another special check, if the expected type is an integer type, -- but the expression is of type System.Address, and the parent is -- an addition or subtraction operation whose left operand is the -- expression in question and whose right operand is of an integral -- type, then this is an attempt at address arithmetic, so give -- appropriate message. elsif Is_Integer_Type (Expec_Type) and then Is_RTE (Found_Type, RE_Address) and then Nkind_In (Parent (Expr), N_Op_Add, N_Op_Subtract) and then Expr = Left_Opnd (Parent (Expr)) and then Is_Integer_Type (Etype (Right_Opnd (Parent (Expr)))) then Error_Msg_N ("address arithmetic not predefined in package System", Parent (Expr)); Error_Msg_N ("\possible missing with/use of System.Storage_Elements", Parent (Expr)); return; -- If the expected type is an anonymous access type, as for access -- parameters and discriminants, the error is on the designated types. elsif Ekind (Expec_Type) = E_Anonymous_Access_Type then if Comes_From_Source (Expec_Type) then Error_Msg_NE ("expected}!", Expr, Expec_Type); else Error_Msg_NE ("expected an access type with designated}", Expr, Designated_Type (Expec_Type)); end if; if Is_Access_Type (Found_Type) and then not Comes_From_Source (Found_Type) then Error_Msg_NE ("\\found an access type with designated}!", Expr, Designated_Type (Found_Type)); else if From_Limited_With (Found_Type) then Error_Msg_NE ("\\found incomplete}!", Expr, Found_Type); Error_Msg_Qual_Level := 99; Error_Msg_NE -- CODEFIX ("\\missing `WITH &;", Expr, Scope (Found_Type)); Error_Msg_Qual_Level := 0; else Error_Msg_NE ("found}!", Expr, Found_Type); end if; end if; -- Normal case of one type found, some other type expected else -- If the names of the two types are the same, see if some number -- of levels of qualification will help. Don't try more than three -- levels, and if we get to standard, it's no use (and probably -- represents an error in the compiler) Also do not bother with -- internal scope names. declare Expec_Scope : Entity_Id; Found_Scope : Entity_Id; begin Expec_Scope := Expec_Type; Found_Scope := Found_Type; for Levels in Nat range 0 .. 3 loop if Chars (Expec_Scope) /= Chars (Found_Scope) then Error_Msg_Qual_Level := Levels; exit; end if; Expec_Scope := Scope (Expec_Scope); Found_Scope := Scope (Found_Scope); exit when Expec_Scope = Standard_Standard or else Found_Scope = Standard_Standard or else not Comes_From_Source (Expec_Scope) or else not Comes_From_Source (Found_Scope); end loop; end; if Is_Record_Type (Expec_Type) and then Present (Corresponding_Remote_Type (Expec_Type)) then Error_Msg_NE ("expected}!", Expr, Corresponding_Remote_Type (Expec_Type)); else Error_Msg_NE ("expected}!", Expr, Expec_Type); end if; if Is_Entity_Name (Expr) and then Is_Package_Or_Generic_Package (Entity (Expr)) then Error_Msg_N ("\\found package name!", Expr); elsif Is_Entity_Name (Expr) and then Ekind_In (Entity (Expr), E_Procedure, E_Generic_Procedure) then if Ekind (Expec_Type) = E_Access_Subprogram_Type then Error_Msg_N ("found procedure name, possibly missing Access attribute!", Expr); else Error_Msg_N ("\\found procedure name instead of function!", Expr); end if; elsif Nkind (Expr) = N_Function_Call and then Ekind (Expec_Type) = E_Access_Subprogram_Type and then Etype (Designated_Type (Expec_Type)) = Etype (Expr) and then No (Parameter_Associations (Expr)) then Error_Msg_N ("found function name, possibly missing Access attribute!", Expr); -- Catch common error: a prefix or infix operator which is not -- directly visible because the type isn't. elsif Nkind (Expr) in N_Op and then Is_Overloaded (Expr) and then not Is_Immediately_Visible (Expec_Type) and then not Is_Potentially_Use_Visible (Expec_Type) and then not In_Use (Expec_Type) and then Has_Compatible_Type (Right_Opnd (Expr), Expec_Type) then Error_Msg_N ("operator of the type is not directly visible!", Expr); elsif Ekind (Found_Type) = E_Void and then Present (Parent (Found_Type)) and then Nkind (Parent (Found_Type)) = N_Full_Type_Declaration then Error_Msg_NE ("\\found premature usage of}!", Expr, Found_Type); else Error_Msg_NE ("\\found}!", Expr, Found_Type); end if; -- A special check for cases like M1 and M2 = 0 where M1 and M2 are -- of the same modular type, and (M1 and M2) = 0 was intended. if Expec_Type = Standard_Boolean and then Is_Modular_Integer_Type (Found_Type) and then Nkind_In (Parent (Expr), N_Op_And, N_Op_Or, N_Op_Xor) and then Nkind (Right_Opnd (Parent (Expr))) in N_Op_Compare then declare Op : constant Node_Id := Right_Opnd (Parent (Expr)); L : constant Node_Id := Left_Opnd (Op); R : constant Node_Id := Right_Opnd (Op); begin -- The case for the message is when the left operand of the -- comparison is the same modular type, or when it is an -- integer literal (or other universal integer expression), -- which would have been typed as the modular type if the -- parens had been there. if (Etype (L) = Found_Type or else Etype (L) = Universal_Integer) and then Is_Integer_Type (Etype (R)) then Error_Msg_N ("\\possible missing parens for modular operation", Expr); end if; end; end if; -- Reset error message qualification indication Error_Msg_Qual_Level := 0; end if; end Wrong_Type; -------------------------------- -- Yields_Synchronized_Object -- -------------------------------- function Yields_Synchronized_Object (Typ : Entity_Id) return Boolean is Has_Sync_Comp : Boolean := False; Id : Entity_Id; begin -- An array type yields a synchronized object if its component type -- yields a synchronized object. if Is_Array_Type (Typ) then return Yields_Synchronized_Object (Component_Type (Typ)); -- A descendant of type Ada.Synchronous_Task_Control.Suspension_Object -- yields a synchronized object by default. elsif Is_Descendant_Of_Suspension_Object (Typ) then return True; -- A protected type yields a synchronized object by default elsif Is_Protected_Type (Typ) then return True; -- A record type or type extension yields a synchronized object when its -- discriminants (if any) lack default values and all components are of -- a type that yelds a synchronized object. elsif Is_Record_Type (Typ) then -- Inspect all entities defined in the scope of the type, looking for -- components of a type that does not yeld a synchronized object or -- for discriminants with default values. Id := First_Entity (Typ); while Present (Id) loop if Comes_From_Source (Id) then if Ekind (Id) = E_Component then if Yields_Synchronized_Object (Etype (Id)) then Has_Sync_Comp := True; -- The component does not yield a synchronized object else return False; end if; elsif Ekind (Id) = E_Discriminant and then Present (Expression (Parent (Id))) then return False; end if; end if; Next_Entity (Id); end loop; -- Ensure that the parent type of a type extension yields a -- synchronized object. if Etype (Typ) /= Typ and then not Yields_Synchronized_Object (Etype (Typ)) then return False; end if; -- If we get here, then all discriminants lack default values and all -- components are of a type that yields a synchronized object. return Has_Sync_Comp; -- A synchronized interface type yields a synchronized object by default elsif Is_Synchronized_Interface (Typ) then return True; -- A task type yelds a synchronized object by default elsif Is_Task_Type (Typ) then return True; -- Otherwise the type does not yield a synchronized object else return False; end if; end Yields_Synchronized_Object; --------------------------- -- Yields_Universal_Type -- --------------------------- function Yields_Universal_Type (N : Node_Id) return Boolean is begin -- Integer and real literals are of a universal type if Nkind_In (N, N_Integer_Literal, N_Real_Literal) then return True; -- The values of certain attributes are of a universal type elsif Nkind (N) = N_Attribute_Reference then return Universal_Type_Attribute (Get_Attribute_Id (Attribute_Name (N))); -- ??? There are possibly other cases to consider else return False; end if; end Yields_Universal_Type; end Sem_Util;
32.450276
79
0.548288
9a477923d7ec4b7480e7c4f944a8b8a6b9c68b6c
58
ads
Ada
Ada/inc/Problem_46.ads
Tim-Tom/project-euler
177e0043ee93409742ec596c4379251f681b4275
[ "Unlicense" ]
null
null
null
Ada/inc/Problem_46.ads
Tim-Tom/project-euler
177e0043ee93409742ec596c4379251f681b4275
[ "Unlicense" ]
null
null
null
Ada/inc/Problem_46.ads
Tim-Tom/project-euler
177e0043ee93409742ec596c4379251f681b4275
[ "Unlicense" ]
null
null
null
package Problem_46 is procedure Solve; end Problem_46;
14.5
21
0.793103
58625466b84d59b73e8021657355e60f057280cc
347
adb
Ada
c3.unicap.br.waldemar.plp/Ada2Java/Ada2Java/src/ada2java/assets/repeticao.adb
LuisFLCCQ/base_cod_java
8a19086ab2e0c0e27f7f2a5dd616c0a49b40accb
[ "MIT" ]
1
2019-03-06T02:51:08.000Z
2019-03-06T02:51:08.000Z
c3.unicap.br.waldemar.plp/Ada2Java/Ada2Java/src/ada2java/assets/repeticao.adb
LuisFLCCQ/base-cod-java
8a19086ab2e0c0e27f7f2a5dd616c0a49b40accb
[ "MIT" ]
null
null
null
c3.unicap.br.waldemar.plp/Ada2Java/Ada2Java/src/ada2java/assets/repeticao.adb
LuisFLCCQ/base-cod-java
8a19086ab2e0c0e27f7f2a5dd616c0a49b40accb
[ "MIT" ]
2
2021-03-17T18:01:06.000Z
2021-12-08T15:10:17.000Z
with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; procedure repeticao is begin for I in 1 .. 5 loop Put_Line("Ola, mundo! " & Integer'Image (I)); end loop; Put_Line(""); for I in reverse 1 .. 5 loop Put_Line("Ola, mundo2! " & Integer'Image (I)); end loop; end repeticao;
20.411765
52
0.631124
9a52403854c8a18b80270c3c2b891da8e24ac31f
2,381
ads
Ada
llvm-gcc-4.2-2.9/gcc/ada/hlo.ads
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
1
2016-04-09T02:58:13.000Z
2016-04-09T02:58:13.000Z
llvm-gcc-4.2-2.9/gcc/ada/hlo.ads
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
llvm-gcc-4.2-2.9/gcc/ada/hlo.ads
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- H L O -- -- -- -- S p e c -- -- -- -- Copyright (C) 1998 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Types; use Types; package HLO is procedure High_Level_Optimize (N : Node_Id); -- This procedure activates the high level optimizer. At the time it is -- called, the tree for compilation unit N has been fully analyzed, but -- not expanded, but the Analyzed flags have been reset. On return, the -- tree may be modified (and will be reanalyzed and expanded as required). end HLO;
62.657895
78
0.420412
c73fe9f228fb8fb85e9080bc368480efcff73859
167
adb
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt21.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt21.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt21.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- { dg-do run } -- { dg-options "-O2" } with System; with Opt21_Pkg; use Opt21_Pkg; procedure Opt21 is V : System.Address := Convert (null); begin null; end;
13.916667
40
0.634731
134d700261e7ae1950d6226accdb323b6babb1d6
6,720
adb
Ada
tlsf/src/tlsf-block-types.adb
vasil-sd/ada-tlsf
c30cfaf5f0b87ebb6e4dd479e50b3f9b11381ddd
[ "MIT" ]
3
2020-02-21T15:42:14.000Z
2020-04-08T09:42:32.000Z
tlsf/src/tlsf-block-types.adb
vasil-sd/ada-tlsf
c30cfaf5f0b87ebb6e4dd479e50b3f9b11381ddd
[ "MIT" ]
null
null
null
tlsf/src/tlsf-block-types.adb
vasil-sd/ada-tlsf
c30cfaf5f0b87ebb6e4dd479e50b3f9b11381ddd
[ "MIT" ]
1
2020-02-21T15:29:26.000Z
2020-02-21T15:29:26.000Z
pragma Ada_2012; with Bits; with BitOperations.Search.Axiom; with BitOperations.Search.Axiom.Most_Significant_Bit; package body TLSF.Block.Types with SPARK_Mode, Pure, Preelaborate is package Bits_Size is new Bits(Size_Bits); use Bits_Size; function To_Size_Bits (S : Size) return Size_Bits is Result : constant Size_Bits := Size_Bits(S); begin pragma Assert (Natural(Size_Bits'Last) = Natural(Size'Last)); pragma Assert (Natural(S) in 0 .. Natural(Size_Bits'Last)); pragma Assert (Size(Result) = S); return Result; end To_Size_Bits; function To_Address_Bits (A : Address) return Address_Bits is Result : constant Address_Bits := Address_Bits(A); begin pragma Assert (Natural(Address_Bits'Last) = Natural(Address'Last)); pragma Assert (Natural(A) in 0 .. Natural(Address_Bits'Last)); pragma Assert (Address(Result) = A); return Result; end To_Address_Bits; generic type Value_Type is range <>; type Value_Type_Mod is mod <>; function Is_Aligned_Generic(Val : Value_Type_Mod) return Boolean with Pre => Integer(Value_Type_Mod'First) = Integer(Value_Type'First) and then Integer(Value_Type_Mod'Last) = Integer(Value_Type'Last) and then Integer(Val) in 0 .. Integer(Value_Type'Last), Contract_Cases => ( (Val and Align_Mask) = 0 => Is_Aligned_Generic'Result = True, (Val and Align_Mask) /= 0 => Is_Aligned_Generic'Result = False); function Is_Aligned_Generic(Val : Value_Type_Mod) return Boolean is Result : constant Boolean := (Val and Align_Mask) = 0; begin return Result; end Is_Aligned_Generic; function Is_Aligned(Val : Size) return Boolean is function Is_Aligned_Size is new Is_Aligned_Generic(Size, Size_Bits); begin return Is_Aligned_Size(Size_Bits(Val)); end Is_Aligned; function Is_Aligned(Val : Address) return Boolean is function Is_Aligned_Addr is new Is_Aligned_Generic(Address, Address_Bits); begin return Is_Aligned_Addr(Address_Bits(Val)); end Is_Aligned; ---------------- -- Round_Size -- ---------------- generic type Value_Type is range <>; type Value_Type_Mod is mod <>; with function Is_Aligned (Val : Value_Type_Mod) return Boolean; function Round_Generic (V : Value_Type) return Value_Type with Pre => V <= Value_Type'Last - Align_Mask and then Integer(Value_Type_Mod'First) = Integer(Value_Type'First) and then Integer(Value_Type_Mod'Last) = Integer(Value_Type'Last) and then Integer(V) in 0 .. Integer(Value_Type'Last), Post => Is_Aligned(Value_Type_Mod(Round_Generic'Result)) and then (Value_Type_Mod(Round_Generic'Result) and Align_Mask) = 0; function Round_Generic (V : Value_Type) return Value_Type is pragma Assert (V <= Value_Type'Last - Align_Mask); USize : constant Value_Type_Mod := Value_Type_Mod(V); pragma Assert (USize <= Value_Type_Mod(Size'Last - Align_Mask)); Adj_Size : constant Value_Type_Mod := USize + Align_Mask; Masked_Size : constant Value_Type_Mod := Adj_Size and (not Align_Mask); pragma Assert (Natural(Value_Type_Mod'Last) = Natural(Value_Type'Last)); Result_Size : constant Value_Type := Value_Type(Masked_Size); begin pragma Assert (Is_Aligned(Masked_Size)); return Result_Size; end Round_Generic; function Round_Size_Up (S : Size) return Aligned_Size is function Is_Aligned_Val is new Is_Aligned_Generic(Size, Size_Bits); function Round is new Round_Generic(Size, Size_Bits, Is_Aligned_Val); begin return Round(S); end Round_Size_Up; function Round_Address_Up (A : Address) return Aligned_Address is function Is_Aligned_Val is new Is_Aligned_Generic(Address, Address_Bits); function Round is new Round_Generic(Address, Address_Bits, Is_Aligned_Val); begin return Round(A); end Round_Address_Up; function "+" (A: Aligned_Address; S: Aligned_Size) return Aligned_Address is Addr : constant Natural := Natural(A) + Natural(S); pragma Assert (Addr in 0 .. Natural (Address'Last)); -- TODO add lemma: -- Aligned + Aligned = Aligned -- or more common case: preservation of aligment by +,-,* operations pragma Assume (Is_Aligned(Address(Addr))); Result : constant Aligned_Address := Address(Addr); begin return Result; end "+"; function "+" (L, R : Aligned_Size) return Aligned_Size is Sz : constant Natural := Natural (L) + Natural (R); pragma Assert (Sz in 0 .. Natural (Size'Last)); pragma Assume (Is_Aligned (Size (Sz))); Result : constant Aligned_Size := Size (Sz); begin return Result; end "+"; function "-" (To, From : Aligned_Address) return Aligned_Size is Sz : constant Natural := Natural(To) - Natural(From); pragma Assert (Sz in 0.. Natural(Size'Last)); -- TODO add lemma: -- Aligned + Aligned = Aligned -- or more common case: preservation of aligment by +,-,* operations pragma Assume (Is_Aligned(Size(Sz))); Result : constant Aligned_Size := Size(Sz); begin return Result; end "-"; function Calculate_Levels_Indices (S : Size_Bits) return Level_Index is package Search_Axiom_Pkg is new Bits_Size.Search.Axiom; package MSB_Axiom is new Search_Axiom_Pkg.Most_Significant_Bit; First_Bit : constant Bits_Size.Bit_Position := Bits_Size.Most_Significant_Bit(S); Second_Level_Bits : Size_Bits; MSB_Small_Block_Size : constant Bits_Size.Bit_Position := Bits_Size.Most_Significant_Bit(Small_Block_Size) with Ghost; Result : Level_Index; begin MSB_Axiom.Result_Is_Correct(S, First_Bit); MSB_Axiom.Result_Is_Correct(Small_Block_Size, MSB_Small_Block_Size); MSB_Axiom.Order_Preservation_Value_To_Index (Value1 => S, Value2 => Small_Block_Size, Index1 => First_Bit, Index2 => FL_Index_Shift); pragma Assert (First_Bit >= FL_Index_Shift); Second_Level_Bits := Bits_Size.Extract(S, First_Bit - SL_Index_Count_Log2, First_Bit - 1); Result.First_Level := First_Level_Index (First_Bit); Result.Second_Level := Second_Level_Index (Second_Level_Bits); return Result; end Calculate_Levels_Indices; function Is_Same_Size_Class(S1, S2: Size) return Boolean is (Calculate_Levels_Indices(Size_Bits(S1)) = Calculate_Levels_Indices(Size_Bits(S2))); end TLSF.Block.Types;
37.333333
81
0.674851
4bb2cd923979870ef08f73487a4bf14d0789b897
3,874
ads
Ada
include/sf-window-videomode.ads
danva994/ASFML-1.6
bd74ae700843338a15aef295f99297b866aa0c93
[ "Zlib" ]
1
2017-10-07T06:20:38.000Z
2017-10-07T06:20:38.000Z
include/sf-window-videomode.ads
danva994/ASFML-1.6
bd74ae700843338a15aef295f99297b866aa0c93
[ "Zlib" ]
3
2020-09-15T21:19:34.000Z
2022-03-02T23:13:46.000Z
include/sf-window-videomode.ads
danva994/ASFML-1.6
bd74ae700843338a15aef295f99297b866aa0c93
[ "Zlib" ]
2
2020-09-26T21:16:43.000Z
2022-01-16T19:36:48.000Z
-- //////////////////////////////////////////////////////////// -- // -- // SFML - Simple and Fast Multimedia Library -- // Copyright (C) 2007-2009 Laurent Gomila ([email protected]) -- // -- // This software is provided 'as-is', without any express or implied warranty. -- // In no event will the authors be held liable for any damages arising from the use of this software. -- // -- // Permission is granted to anyone to use this software for any purpose, -- // including commercial applications, and to alter it and redistribute it freely, -- // subject to the following restrictions: -- // -- // 1. The origin of this software must not be misrepresented; -- // you must not claim that you wrote the original software. -- // If you use this software in a product, an acknowledgment -- // in the product documentation would be appreciated but is not required. -- // -- // 2. Altered source versions must be plainly marked as such, -- // and must not be misrepresented as being the original software. -- // -- // 3. This notice may not be removed or altered from any source distribution. -- // -- //////////////////////////////////////////////////////////// -- //////////////////////////////////////////////////////////// -- // Headers -- //////////////////////////////////////////////////////////// with Sf.Config; package Sf.Window.VideoMode is use Sf.Config; -- //////////////////////////////////////////////////////////// -- /// sfVideoMode defines a video mode (width, height, bpp, frequency) -- /// and provides functions for getting modes supported -- /// by the display device -- //////////////////////////////////////////////////////////// type sfVideoMode is record Width : aliased sfUint32; -- ///< Video mode width, in pixels Height : aliased sfUint32; -- ///< Video mode height, in pixels BitsPerPixel : aliased sfUint32; -- ///< Video mode pixel depth, in bits per pixels end record; -- //////////////////////////////////////////////////////////// -- /// Get the current desktop video mode -- /// -- /// \return Current desktop video mode -- /// -- //////////////////////////////////////////////////////////// function sfVideoMode_GetDesktopMode return sfVideoMode; -- //////////////////////////////////////////////////////////// -- /// Get a valid video mode -- /// Index must be in range [0, GetModesCount()[ -- /// Modes are sorted from best to worst -- /// -- /// \param Index : Index of video mode to get -- /// -- /// \return Corresponding video mode (invalid mode if index is out of range) -- /// -- //////////////////////////////////////////////////////////// function sfVideoMode_GetMode (Index : sfSize_t) return sfVideoMode; -- //////////////////////////////////////////////////////////// -- /// Get valid video modes count -- /// -- /// \return Number of valid video modes available -- /// -- //////////////////////////////////////////////////////////// function sfVideoMode_GetModesCount return sfSize_t; -- //////////////////////////////////////////////////////////// -- /// Tell whether or not a video mode is supported -- /// -- /// \param Mode : Video mode to check -- /// -- /// -- /// \return True if video mode is supported, false otherwise -- /// -- //////////////////////////////////////////////////////////// function sfVideoMode_IsValid (Mode : sfVideoMode) return sfBool; private pragma Convention (C_Pass_By_Copy, sfVideoMode); pragma Import (C, sfVideoMode_GetDesktopMode, "sfVideoMode_GetDesktopMode"); pragma Import (C, sfVideoMode_GetMode, "sfVideoMode_GetMode"); pragma Import (C, sfVideoMode_GetModesCount, "sfVideoMode_GetModesCount"); pragma Import (C, sfVideoMode_IsValid, "sfVideoMode_IsValid"); end Sf.Window.VideoMode;
41.655914
104
0.51239
4de5e192380c98ab92ce0010e6d8ed4b83bb76ef
1,400
ada
Ada
snapshot/Ada/server.ada
daemonl/openapi-codegen
7dec48c1768ca6e23e6bf136df5fc7863af88c1d
[ "Apache-2.0" ]
null
null
null
snapshot/Ada/server.ada
daemonl/openapi-codegen
7dec48c1768ca6e23e6bf136df5fc7863af88c1d
[ "Apache-2.0" ]
null
null
null
snapshot/Ada/server.ada
daemonl/openapi-codegen
7dec48c1768ca6e23e6bf136df5fc7863af88c1d
[ "Apache-2.0" ]
null
null
null
with Ada.IO_Exceptions; with AWS.Config.Set; with Swagger.Servers.AWS; with Swagger.Servers.Applications; with Util.Log.Loggers; with Util.Properties; with IO.OpenAPI.Api.Servers; procedure IO.OpenAPI.Api.Server is procedure Configure (Config : in out AWS.Config.Object); CONFIG_PATH : constant String := ".properties"; procedure Configure (Config : in out AWS.Config.Object) is begin AWS.Config.Set.Server_Port (Config, 8080); AWS.Config.Set.Max_Connection (Config, 8); AWS.Config.Set.Accept_Queue_Size (Config, 512); end Configure; App : aliased Swagger.Servers.Applications.Application_Type; WS : Swagger.Servers.AWS.AWS_Container; Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("IO.OpenAPI.Api.Server"); Props : Util.Properties.Manager; begin Props.Load_Properties (CONFIG_PATH); Util.Log.Loggers.Initialize (Props); App.Configure (Props); IO.OpenAPI.Api.Servers.Server_Impl.Register (App); WS.Configure (Configure'Access); WS.Register_Application ("/v2", App'Unchecked_Access); App.Dump_Routes (Util.Log.INFO_LEVEL); Log.Info ("Connect you browser to: http://localhost:8080/v2/ui/index.html"); WS.Start; delay 6000.0; exception when Ada.IO_Exceptions.Name_Error => Log.Error ("Cannot read application configuration file {0}", CONFIG_PATH); end IO.OpenAPI.Api.Server;
31.818182
99
0.724286
4b904d911e8123296d367c1d2043ba1ed6b9d1a8
2,792
ads
Ada
gcc-gcc-7_3_0-release/gcc/ada/g-soccon.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/ada/g-soccon.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/g-soccon.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G N A T . S O C K E T S . C O N S T A N T S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2000-2009, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides a temporary compatibility renaming for deprecated -- internal package GNAT.Sockets.Constants. -- This package should not be directly used by an applications program. -- It is a compatibility artefact to help building legacy code with newer -- compilers, and will be removed at some point in the future. with System.OS_Constants; package GNAT.Sockets.Constants renames System.OS_Constants;
68.097561
78
0.432307
5706be07cc19907a7456ad074a71d472f9f0fecf
1,664
ads
Ada
src/main/resources/project-templates/microbit_example/src/generic_timers.ads
georgemackayshore/Ada-IntelliJ
581f87237a610b3142aed20358b955bdca807213
[ "Apache-2.0" ]
17
2018-10-03T21:31:03.000Z
2021-01-22T04:16:05.000Z
src/main/resources/project-templates/microbit_example/src/generic_timers.ads
georgemackayshore/Ada-IntelliJ
581f87237a610b3142aed20358b955bdca807213
[ "Apache-2.0" ]
20
2018-11-01T21:17:09.000Z
2021-10-01T18:57:20.000Z
src/main/resources/project-templates/microbit_example/src/generic_timers.ads
georgemackayshore/Ada-IntelliJ
581f87237a610b3142aed20358b955bdca807213
[ "Apache-2.0" ]
4
2020-04-14T15:02:37.000Z
2022-03-10T20:35:54.000Z
------------------------------------------------------------------------------ -- Copyright (C) 2018, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. This software is distributed in the hope that it will be useful, -- -- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- -- License for more details. You should have received a copy of the GNU -- -- General Public License distributed with this software; see file -- -- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- -- of the license. -- ------------------------------------------------------------------------------ -- This is an implementation of generic timer based on -- Ada.Real_Time.Timing_Events. -- -- See https://www.adacore.com/gems/ada-gem-15 for more info. with Ada.Real_Time.Timing_Events; generic One_Shot : Boolean := True; Timer_Name : String := "Generic_Timers"; Period : in Ada.Real_Time.Time_Span; with procedure Action is <>; package Generic_Timers is Timer_Error : exception; procedure Start; procedure Stop; procedure Cancel; private The_Event : Ada.Real_Time.Timing_Events.Timing_Event; end Generic_Timers;
39.619048
78
0.564303
2e848aadfd3c2341af320329d49545127d9687ba
6,655
ads
Ada
src/common/keccak-generic_tuple_hash.ads
damaki/libkeccak
d06217e525f7927380690d6c37b485bdbe8aa96e
[ "BSD-3-Clause" ]
26
2015-09-20T17:52:38.000Z
2021-07-29T21:47:04.000Z
src/common/keccak-generic_tuple_hash.ads
damaki/libkeccak
d06217e525f7927380690d6c37b485bdbe8aa96e
[ "BSD-3-Clause" ]
3
2019-03-12T16:01:36.000Z
2020-05-23T13:06:43.000Z
src/common/keccak-generic_tuple_hash.ads
damaki/libkeccak
d06217e525f7927380690d6c37b485bdbe8aa96e
[ "BSD-3-Clause" ]
2
2019-04-15T18:02:19.000Z
2020-11-22T11:22:18.000Z
------------------------------------------------------------------------------- -- Copyright (c) 2019, Daniel King -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * The name of the copyright holder may not be used to endorse or promote -- Products derived from this software without specific prior written -- permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- with Keccak.Generic_CSHAKE; with Keccak.Types; use Keccak.Types; -- @summary -- Generic implementation of the TupleHash algorithm. -- -- @description -- TupleHash is a SHA-3-derived hash function with variable-length output -- that is designed to simply hash a tuple of input strings, any or all of -- which may be empty strings, in an unambiguous way. -- -- This API is used as follows: -- -- 1 Call Init to initialise a new TupleHash context. -- -- 2 Call Update_Tuple_Item for each item in the tuple. -- -- 3 Call either Finish or Extract to produce the desired type of output -- (TupleHash or TupleHashXOF): -- -- * Finish is used to produce a single output of arbitrary length (TupleHash). -- The requested output length affects the output. For example, requesting -- a 10-byte output will produce an unrelated hash to requesting a 20-byte -- output. -- -- * Extract can be called one or more times to produce an arbitrary number -- of output bytes (TupleHashXOF). In this case, the total output length is -- unknown in advance so the output does not change based on the overall length. -- For example, a 10-byte output is the truncated version of a 20-byte output. -- -- @group TupleHash generic with package CSHAKE is new Generic_CSHAKE (<>); package Keccak.Generic_Tuple_Hash is type Context is private; type States is (Updating, Extracting, Finished); -- @value Updating When in this state additional data can be input into the -- TupleHash context. -- -- @value Extracting When in this state, the TupleHash context can generate -- output bytes by calling the Extract procedure. -- -- @value Finished When in this state the context is finished and no more data -- can be input or output. procedure Init (Ctx : out Context; Customization : in String := "") with Global => null, Depends => (Ctx => Customization), Post => State_Of (Ctx) = Updating; -- Initialise the TupleHash context. -- -- @param Ctx The TupleHash context to initialise. -- -- @param Customization An optional customisation string to provide domain -- separation between different instances of TupleHash. procedure Update_Tuple_Item (Ctx : in out Context; Item : in Byte_Array) with Global => null, Depends => (Ctx =>+ Item), Pre => State_Of (Ctx) = Updating, Post => State_Of (Ctx) = Updating; -- Process the next tuple item. -- -- The entire tuple item must be passed into this procedure. -- -- This may be called multiple times to process an arbitrary number of items. procedure Finish (Ctx : in out Context; Digest : out Byte_Array) with Global => null, Depends => ((Ctx, Digest) => (Ctx, Digest)), Pre => State_Of (Ctx) = Updating, Post => State_Of (Ctx) = Finished; -- Produce a TupleHash digest (TupleHash variant) -- -- After calling this procedure the context can no longer be used. However, -- it can be re-initialized to perform a new TupleHash computation. -- -- The number of output bytes requested is determined from the length of -- the Digest array (i.e. Digest'Length) and has an effect on the value of the -- output digest. For example, two different ParallelHash computations with identical -- inputs (same key and input data) but with different digest lengths will -- produce independent digest values. -- -- Note that this procedure can only be called once for each ParallelHash -- computation. This requires that the required digest length is known before -- calling this procedure, and a Byte_Array with the correct length is -- given to this procedure. For applications where the number of required -- output bytes is not known until after bytes are output, see the Extract -- procedure. procedure Extract (Ctx : in out Context; Digest : out Byte_Array) with Global => null, Depends => ((Ctx, Digest) => (Ctx, Digest)), Pre => State_Of (Ctx) in Updating | Extracting, Post => State_Of (Ctx) = Extracting; -- Produce a TupleHash digest (TupleHashXOF variant) -- -- After calling this procudure no more data can be input into the ParllelHash -- computation. -- -- This function can be called multiple times to produce an arbitrary -- number of output bytes. function State_Of (Ctx : in Context) return States with Global => null; private use type CSHAKE.States; type Context is record Ctx : CSHAKE.Context; Finished : Boolean; end record; function State_Of (Ctx : in Context) return States is (if Ctx.Finished then Finished elsif CSHAKE.State_Of (Ctx.Ctx) = CSHAKE.Updating then Updating else Extracting); end Keccak.Generic_Tuple_Hash;
43.214286
89
0.673629
1a31f113da6032818383becd22c5a7c8ab011022
7,390
ada
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c8/c87b32a.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c8/c87b32a.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c8/c87b32a.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- C87B32A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT OVERLOADING RESOLUTION USES THE FOLLOWING RULES: -- FOR ATTRIBUTES OF THE FORM: T'SUCC (X), T'PRED (X), T'POS (X), -- AND T'IMAGE (X) , THE OPERAND X MUST BE OF TYPE T. -- -- FOR THE ATTRIBUTE OF THE FORM T'VAL (X), THE OPERAND X MUST BE -- OF AN INTEGER TYPE. -- -- FOR THE ATTRIBUTE OF THE FORM T'VALUE (X), THE OPERAND X MUST -- BE OF THE PREDEFINED TYPE STRING. -- TRH 13 SEPT 82 -- JRK 12 JAN 84 WITH REPORT; USE REPORT; PROCEDURE C87B32A IS TYPE COLOR IS (BROWN, RED, WHITE); TYPE SCHOOL IS (HARVARD, BROWN, YALE); TYPE COOK IS (SIMMER, SAUTE, BROWN, BOIL); TYPE SUGAR IS (DEXTROSE, CANE, GLUCOSE, BROWN); TYPE WHOLE IS NEW INTEGER RANGE 0 .. INTEGER'LAST; TYPE LIT_CHAR IS ('+', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'); TYPE LIT_STRING IS ARRAY (POSITIVE RANGE <>) OF LIT_CHAR; FUNCTION "+" (X, Y : WHOLE) RETURN WHOLE RENAMES "*"; FUNCTION F1 RETURN STRING IS BEGIN RETURN "+10"; END F1; FUNCTION F1 RETURN LIT_STRING IS BEGIN FAILED ("THE VALUE ATTRIBUTE TAKES A PREDEFINED STRING " & "OPERAND"); RETURN "+3"; END F1; FUNCTION F1 RETURN CHARACTER IS BEGIN FAILED ("THE VALUE ATTRIBUTE TAKES A STRING OPERAND"); RETURN '2'; END F1; FUNCTION F2 (X : INTEGER) RETURN FLOAT IS BEGIN FAILED ("THE VAL ATTRIBUTE TAKES AN INTEGER TYPE OPERAND"); RETURN 0.0; END F2; FUNCTION F2 (X : INTEGER := 1) RETURN INTEGER IS BEGIN RETURN X; END F2; BEGIN TEST ("C87B32A","OVERLOADED OPERANDS FOR THE ATTRIBUTES " & "T'PRED, T'SUCC, T'POS, T'VAL, T'IMAGE AND T'VALUE"); IF COLOR'POS (BROWN) /= 0 THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 1"); END IF; IF SCHOOL'POS (BROWN) /= 1 THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 2"); END IF; IF COOK'POS (BROWN) /= 2 THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 3"); END IF; IF SUGAR'POS (BROWN) /= 3 THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 4"); END IF; IF SCHOOL'PRED (BROWN) /= HARVARD THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 5"); END IF; IF COOK'PRED (BROWN) /= SAUTE THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 6"); END IF; IF SUGAR'PRED (BROWN) /= GLUCOSE THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 7"); END IF; IF COLOR'SUCC (BROWN) /= RED THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 8"); END IF; IF SCHOOL'SUCC (BROWN) /= YALE THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 9"); END IF; IF COOK'SUCC (BROWN) /= BOIL THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 10"); END IF; IF COLOR'VAL (F2 (0)) /= BROWN THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 11"); END IF; IF SCHOOL'VAL (F2) /= BROWN THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 12"); END IF; IF COOK'VAL (F2 (2)) /= BROWN THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 13"); END IF; IF SUGAR'VAL (F2) /= CANE THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 14"); END IF; IF WHOLE'POS (1 + 1) /= 1 THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 15"); END IF; IF WHOLE'VAL (1 + 1) /= 2 THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 16"); END IF; IF WHOLE'SUCC (1 + 1) /= 2 THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 17"); END IF; IF WHOLE'PRED (1 + 1) /= 0 THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 18"); END IF; IF WHOLE'VALUE ("+1") + 1 /= 1 THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 19"); END IF; IF WHOLE'IMAGE (1 + 1) /= " 1" THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 20"); END IF; IF WHOLE'VALUE (F1) + 1 /= 10 THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 21"); END IF; IF WHOLE'VAL (1) + 1 /= 1 THEN FAILED ("RESOLUTION INCORRECT FOR OPERANDS OF THE ATTRIBUTES" & " PRED, SUCC, VAL, POS, IMAGE AND VALUE - 22"); END IF; RESULT; END C87B32A;
36.95
79
0.570636
4bb55469e22c5496898b3550f5638d48c6dd74de
3,524
ada
Ada
Task/Topological-sort/Ada/topological-sort-2.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:38.000Z
2018-11-09T22:08:38.000Z
Task/Topological-sort/Ada/topological-sort-2.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
null
null
null
Task/Topological-sort/Ada/topological-sort-2.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:40.000Z
2018-11-09T22:08:40.000Z
package body Digraphs is function Node_Count(Graph: Graph_Type) return Node_Idx_With_Null is begin return Node_Idx_With_Null(Graph.Length); end Node_Count; procedure Add_Node(Graph: in out Graph_Type'Class; Node: Node_Index) is begin for I in Node_Index range Graph.Node_Count+1 .. Node loop Graph.Append(Node_Vec.Empty_Vector); end loop; end Add_Node; procedure Add_Connection (Graph: in out Graph_Type'Class; From, To: Node_Index) is begin Graph.Add_Node(Node_Index'Max(From, To)); declare Connection_List: Node_Vec.Vector := Graph.Element(From); begin for I in Connection_List.First_Index .. Connection_List.Last_Index loop if Connection_List.Element(I) >= To then if Connection_List.Element(I) = To then return; -- if To is already there, don't add it a second time else -- I is the first index with Element(I)>To, insert To here Connection_List.Insert(Before => I, New_Item => To); Graph.Replace_Element(From, Connection_List); return; end if; end if; end loop; -- there was no I with no Element(I) > To, so insert To at the end Connection_List.Append(To); Graph.Replace_Element(From, Connection_List); return; end; end Add_Connection; procedure Del_Connection (Graph: in out Graph_Type'Class; From, To: Node_Index) is Connection_List: Node_Vec.Vector := Graph.Element(From); begin for I in Connection_List.First_Index .. Connection_List.Last_Index loop if Connection_List.Element(I) = To then Connection_List.Delete(I); Graph.Replace_Element(From, Connection_List); return; -- we are done end if; end loop; end Del_Connection; function Connected (Graph: Graph_Type; From, To: Node_Index) return Boolean is Connection_List: Node_Vec.Vector renames Graph.Element(From); begin for I in Connection_List.First_Index .. Connection_List.Last_Index loop if Connection_List.Element(I) = To then return True; end if; end loop; return False; end Connected; function All_Connections (Graph: Graph_Type; From: Node_Index) return Node_Vec.Vector is begin return Graph.Element(From); end All_Connections; function Top_Sort (Graph: Graph_Type) return Node_Vec.Vector is Result: Node_Vec.Vector; Visited: array(1 .. Graph.Node_Count) of Boolean := (others => False); Active: array(1 .. Graph.Node_Count) of Boolean := (others => False); procedure Visit(Node: Node_Index) is begin if not Visited(Node) then Visited(Node) := True; Active(Node) := True; declare Cons: Node_Vec.Vector := All_Connections(Graph, Node); begin for Idx in Cons.First_Index .. Cons.Last_Index loop Visit(Cons.Element(Idx)); end loop; end; Active(Node) := False; Result.Append(Node); else if Active(Node) then raise Constraint_Error with "Graph is Cyclic"; end if; end if; end Visit; begin for Some_Node in Visited'Range loop Visit(Some_Node); end loop; return Result; end Top_Sort; end Digraphs;
32.934579
80
0.612372
adabffcff23afa6d3223c97d8f01bccf86ed761c
1,475
ads
Ada
source/streams/a-iomode.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
33
2015-04-04T09:19:36.000Z
2021-11-10T05:33:34.000Z
source/streams/a-iomode.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
8
2017-11-14T13:05:07.000Z
2018-08-09T15:28:49.000Z
source/streams/a-iomode.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
9
2015-02-03T17:09:53.000Z
2021-11-12T01:16:05.000Z
pragma License (Unrestricted); -- extended unit package Ada.IO_Modes is -- Root types of File_Mode and for the parameters Form. pragma Pure; type File_Mode is (In_File, Out_File, Append_File); type Inout_File_Mode is (In_File, Inout_File, Out_File); -- Direct_IO -- the types for the parameters Form of Stream_IO type File_Shared_Spec is ( Allow, -- "shared=allow", "shared=yes", or "shared=no" Read_Only, -- "shared=read" Deny, -- "shared=deny" By_Mode); -- default type File_Shared is new File_Shared_Spec range Allow .. Deny; -- subtype File_Wait is Boolean; -- False as "wait=false", or default -- True as "wait=true" -- subtype File_Overwrite is Boolean; -- False as "overwrite=false" -- True as "overwrite=true", or default -- the types for the parameters Form of Text_IO type File_External_Base is ( Terminal, UTF_8, -- "external=utf-8", or "wcem=8" Locale, -- "external=dbcs", Windows only By_Target); -- default, UTF_8 in POSIX, or Locale in Windows type File_External_Spec is new File_External_Base range UTF_8 .. By_Target; type File_External is new File_External_Base range Terminal .. Locale; type File_New_Line_Spec is ( LF, -- "nl=lf" CR, -- "nl=cr" CR_LF, -- "nl=m" By_Target); -- default, LF in POSIX, or CR_LF in Windows type File_New_Line is new File_New_Line_Spec range LF .. CR_LF; end Ada.IO_Modes;
32.777778
78
0.666441