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
1331364548e458e45e25cb3d5275b364737c2b1e
3,310
ads
Ada
tools-src/gnu/gcc/gcc/ada/a-diocst.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/a-diocst.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/a-diocst.ads
modern-tomato/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
69
2015-01-02T10:45:56.000Z
2021-09-06T07:52:13.000Z
------------------------------------------------------------------------------ -- -- -- GNAT RUNTIME COMPONENTS -- -- -- -- A D A . D I R E C T _ I O . C _ S T R E A M S -- -- -- -- S p e c -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992,1993,1994,1995 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 provides an interface between Ada.Direct_IO and the -- C streams. This allows sharing of a stream between Ada and C or C++, -- as well as allowing the Ada program to operate directly on the stream. with Interfaces.C_Streams; generic package Ada.Direct_IO.C_Streams is package ICS renames Interfaces.C_Streams; function C_Stream (F : File_Type) return ICS.FILEs; -- Obtain stream from existing open file procedure Open (File : in out File_Type; Mode : in File_Mode; C_Stream : in ICS.FILEs; Form : in String := ""); -- Create new file from existing stream end Ada.Direct_IO.C_Streams;
57.068966
78
0.456798
58a00b3005272b4c33b7c0368e6c4df956b00ea0
5,481
adb
Ada
thirdparty/glut/progs/ada/fog_procs.adb
ShiroixD/pag_zad_2
cdb6ccf48402cf4dbf1284827a4e281d3b12a64b
[ "MIT" ]
1
2019-01-11T13:55:53.000Z
2019-01-11T13:55:53.000Z
thirdparty/glut/progs/ada/fog_procs.adb
ShiroixD/pag_zad_2
cdb6ccf48402cf4dbf1284827a4e281d3b12a64b
[ "MIT" ]
1
2018-08-10T19:11:58.000Z
2018-08-10T19:12:17.000Z
thirdparty/glut/progs/ada/fog_procs.adb
ShiroixD/pag_zad_2
cdb6ccf48402cf4dbf1284827a4e281d3b12a64b
[ "MIT" ]
null
null
null
-- -- (c) Copyright 1993,1994,1995,1996 Silicon Graphics, Inc. -- ALL RIGHTS RESERVED -- Permission to use, copy, modify, and distribute this software for -- any purpose and without fee is hereby granted, provided that the above -- copyright notice appear in all copies and that both the copyright notice -- and this permission notice appear in supporting documentation, and that -- the name of Silicon Graphics, Inc. not be used in advertising -- or publicity pertaining to distribution of the software without specific, -- written prior permission. -- -- THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" -- AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, -- INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR -- FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -- GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, -- SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY -- KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, -- LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF -- THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN -- ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON -- ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE -- POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. -- -- US Government Users Restricted Rights -- Use, duplication, or disclosure by the Government is subject to -- restrictions set forth in FAR 52.227.19(c)(2) or subparagraph -- (c)(1)(ii) of the Rights in Technical Data and Computer Software -- clause at DFARS 252.227-7013 and/or in similar or successor -- clauses in the FAR or the DOD or NASA FAR Supplement. -- Unpublished-- rights reserved under the copyright laws of the -- United States. Contractor/manufacturer is Silicon Graphics, -- Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. -- -- OpenGL(TM) is a trademark of Silicon Graphics, Inc. -- with GL; use GL; with Glut; use Glut; with Text_IO; use Text_IO; with Unchecked_Conversion; package body Fog_Procs is package tio renames Text_IO; function FogToInt is new Unchecked_Conversion (Source => FogMode, Target => GLint); procedure CycleFog (btn: Integer; state: Integer; x, y: Integer) is begin if btn = GLUT_LEFT_BUTTON then if state = GLUT_DOWN then if fogType = GL_EXP then fogType := GL_EXP2; elsif fogType = GL_EXP2 then fogType := GL_LINEAR; glFogf (GL_FOG_START, 1.0); glFogf (GL_FOG_END, 5.0); elsif fogType = GL_LINEAR then fogType := GL_EXP; end if; -- tio.Put_Line("Fog mode is " & FogMode'IMAGE (fogType)); glFogi (GL_FOG_MODE, FogToInt (fogType)); glutPostRedisplay; end if; end if; end CycleFog; procedure Initialize is position : array (0 .. 3) of aliased GLfloat := (0.0, 3.0, 3.0, 0.0); local_view : aliased GLfloat := 0.0; fogColor : array (0 .. 3) of aliased GLfloat := (0.5, 0.5, 0.5, 1.0); begin glEnable (GL_DEPTH_TEST); glDepthFunc (GL_LESS); glLightfv (GL_LIGHT0, GL_POSITION, position (0)'Access); glLightModelfv (GL_LIGHT_MODEL_LOCAL_VIEWER, local_view'Access); glFrontFace (GL_CW); glEnable (GL_LIGHTING); glEnable (GL_LIGHT0); glEnable (GL_AUTO_NORMAL); glEnable (GL_NORMALIZE); glEnable (GL_FOG); fogType := GL_EXP; glFogi (GL_FOG_MODE, FogToInt (fogType)); glFogfv (GL_FOG_COLOR, fogColor (0)'Access); glFogf (GL_FOG_DENSITY, 0.35); glHint (GL_FOG_HINT, GL_DONT_CARE); glClearColor (0.5, 0.5, 0.5, 1.0); end Initialize; procedure RenderRedTeapot (x : GLfloat; y : GLfloat; z : GLfloat) is mat : array (0 .. 3) of aliased GLfloat; begin glPushMatrix; glTranslatef (x, y, z); mat (0) := 0.1745; mat (1) := 0.01175; mat (2) := 0.01175; mat (3) := 1.0; glMaterialfv (GL_FRONT, GL_AMBIENT, mat (0)'Access); mat (0) := 0.61424; mat (1) := 0.04136; mat (2) := 0.04136; glMaterialfv (GL_FRONT, GL_DIFFUSE, mat (0)'Access); mat (0) := 0.727811; mat (1) := 0.626959; mat (2) := 0.626959; glMaterialfv (GL_FRONT, GL_SPECULAR, mat (0)'Access); glMaterialf (GL_FRONT, GL_SHININESS, 0.6*128.0); glutSolidTeapot (1.0); glPopMatrix; end RenderRedTeapot; procedure Display is begin glClear (GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); RenderRedTeapot (-4.0, -0.5, -1.0); RenderRedTeapot (-2.0, -0.5, -2.0); RenderRedTeapot (0.0, -0.5, -3.0); RenderRedTeapot (2.0, -0.5, -4.0); RenderRedTeapot (4.0, -0.5, -5.0); glFlush; end Display; procedure HandleReshape (w : Integer; h : Integer) is begin glViewport (0, 0, GLsizei(w), GLsizei(h)); glMatrixMode (GL_PROJECTION); glLoadIdentity; if w <= (h * 3) then glOrtho (-6.0, 6.0, GLdouble (-2.0 * (GLdouble (h) * 3.0) / GLdouble (w)), GLdouble (2.0 * (GLdouble (h) * 3.0 / GLdouble (w))), 0.0, 10.0); else glOrtho (GLdouble (-6.0 * GLdouble (w) / (GLdouble (h) * 3.0)), GLdouble (6.0 * GLdouble (w) / (GLdouble (h) * 3.0)), -2.0, 2.0, 0.0, 10.0); end if; glMatrixMode (GL_MODELVIEW); glLoadIdentity; end HandleReshape; end Fog_Procs;
33.625767
77
0.643313
5977eb91acc9e65d61ab3f4a61332fe916ebf2db
4,995
ada
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cc/cc3125d.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/cc/cc3125d.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cc/cc3125d.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- CC3125D.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 CONSTRAINT_ERROR IS RAISED FOR A GENERIC IN PARAMETER -- HAVING A FIXED POINT TYPE IF AND ONLY IF THE VALUE OF THE ACTUAL -- PARAMETER LIES OUTSIDE THE RANGE OF THE FORMAL PARAMETER. -- TBN 12/15/86 WITH REPORT; USE REPORT; PROCEDURE CC3125D IS TYPE FIXED IS DELTA 0.125 RANGE -10.0 .. 10.0; SUBTYPE FIX IS FIXED RANGE -5.0 .. 5.0; FUNCTION IDENT_FIX (X : FIXED) RETURN FIXED IS BEGIN IF EQUAL (3, 3) THEN RETURN X; END IF; RETURN 0.0; END IDENT_FIX; BEGIN TEST ("CC3125D", "CHECK THAT CONSTRAINT_ERROR IS RAISED FOR A " & "GENERIC IN PARAMETER HAVING A FIXED POINT " & "TYPE IF AND ONLY IF THE VALUE OF THE ACTUAL " & "PARAMETER LIES OUTSIDE THE RANGE OF THE " & "FORMAL PARAMETER"); DECLARE GENERIC GEN_FIX : IN FIX; PACKAGE P IS PAC_FIX : FIXED := GEN_FIX; END P; BEGIN BEGIN DECLARE PACKAGE P1 IS NEW P(IDENT_FIX(-5.0)); BEGIN IF P1.PAC_FIX /= IDENT_FIX(-5.0) THEN FAILED ("INCORRECT VALUE PASSED - 1"); END IF; END; EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED - 1"); END; BEGIN DECLARE PACKAGE P2 IS NEW P(IDENT_FIX(-5.2)); BEGIN FAILED ("NO EXCEPTION RAISED - 2"); END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("UNEXPECTED EXCEPTION RAISED - 2"); END; BEGIN DECLARE PACKAGE P3 IS NEW P(IDENT_FIX(5.2)); BEGIN FAILED ("NO EXCEPTION RAISED - 3"); END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("UNEXPECTED EXCEPTION RAISED - 3"); END; END; ------------------------------------------------------------------- DECLARE GENERIC TYPE GEN_TYP IS DELTA <>; GEN_FIX : IN GEN_TYP; PACKAGE Q IS PAC_FIX : GEN_TYP := GEN_FIX; END Q; BEGIN BEGIN DECLARE PACKAGE Q1 IS NEW Q(FIX, IDENT_FIX(5.0)); BEGIN IF Q1.PAC_FIX /= IDENT_FIX(5.0) THEN FAILED ("INCORRECT VALUE PASSED - 4"); END IF; END; EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED - 4"); END; BEGIN DECLARE PACKAGE Q2 IS NEW Q(FIX, IDENT_FIX(-5.2)); BEGIN FAILED ("NO EXCEPTION RAISED - 5"); END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("UNEXPECTED EXCEPTION RAISED - 5"); END; BEGIN DECLARE PACKAGE Q3 IS NEW Q(FIX, IDENT_FIX(5.2)); BEGIN FAILED ("NO EXCEPTION RAISED - 6"); END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("UNEXPECTED EXCEPTION RAISED - 6"); END; END; RESULT; END CC3125D;
33.52349
79
0.487888
adc60fb7ba89bdfd90265c57fc150e9f42cf6def
16,094
adb
Ada
tests/natools-reference_tests.adb
faelys/natools
947c004e6f69ca144942c6af40e102d089223cf8
[ "0BSD" ]
null
null
null
tests/natools-reference_tests.adb
faelys/natools
947c004e6f69ca144942c6af40e102d089223cf8
[ "0BSD" ]
null
null
null
tests/natools-reference_tests.adb
faelys/natools
947c004e6f69ca144942c6af40e102d089223cf8
[ "0BSD" ]
null
null
null
------------------------------------------------------------------------------ -- Copyright (c) 2013-2014, Natacha Porté -- -- -- -- Permission to use, copy, modify, and distribute this software for any -- -- purpose with or without fee is hereby granted, provided that the above -- -- copyright notice and this permission notice appear in all copies. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- -- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- -- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- -- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- ------------------------------------------------------------------------------ with Ada.Calendar; with Ada.Exceptions; with Natools.References.Tools; package body Natools.Reference_Tests is package Tools is new Refs.Tools; procedure Check_Ref (Report : in out NT.Reporter'Class; Name : in String; Ref : in Refs.Reference; Expected_Count : in Natural; Continue : in out Boolean); -- Check the given reference and report failure if any -- Do nothing if Continue is False procedure Check_Consistency (Report : in out NT.Reporter'Class; Name : in String; Left, Right : in Refs.Reference; Continue : in out Boolean); -- Check consistency between two reference and report if failed -- Do nothing if Continue is False procedure Check_Count (Report : in out NT.Reporter'Class; Name : in String; Expected_Count : in Integer; Continue : in out Boolean); -- Check instance count and report failure if any -- Do nothing if Continue is False -------------------- -- Object counter -- -------------------- function Factory return Counter is begin Instance_Count := Instance_Count + 1; return Counter'(Ada.Finalization.Limited_Controlled with Instance_Number => Instance_Count); end Factory; overriding procedure Initialize (Object : in out Counter) is begin Instance_Count := Instance_Count + 1; Object.Instance_Number := Instance_Count; end Initialize; overriding procedure Finalize (Object : in out Counter) is pragma Unreferenced (Object); begin Instance_Count := Instance_Count - 1; end Finalize; ------------------------ -- Helper subprograms -- ------------------------ procedure Check_Consistency (Report : in out NT.Reporter'Class; Name : in String; Left, Right : in Refs.Reference; Continue : in out Boolean) is begin if Continue and then not Tools.Is_Consistent (Left, Right) then NT.Item (Report, Name, NT.Fail); NT.Info (Report, "Inconsistent references found"); Continue := False; end if; end Check_Consistency; procedure Check_Count (Report : in out NT.Reporter'Class; Name : in String; Expected_Count : in Integer; Continue : in out Boolean) is begin if not Continue then return; end if; if Instance_Count < 0 then NT.Item (Report, Name, NT.Fail); NT.Info (Report, "Invalid Instance_Count " & Integer'Image (Instance_Count)); Continue := False; elsif Instance_Count /= Expected_Count then NT.Item (Report, Name, NT.Fail); NT.Info (Report, "Unexpected Instance_Count" & Integer'Image (Instance_Count) & " instead of" & Integer'Image (Expected_Count)); Continue := False; end if; end Check_Count; procedure Check_Ref (Report : in out NT.Reporter'Class; Name : in String; Ref : in Refs.Reference; Expected_Count : in Natural; Continue : in out Boolean) is Actual_Count : constant Integer := Tools.Count (Ref); begin if not Continue then return; end if; if not Tools.Is_Valid (Ref) then NT.Item (Report, Name, NT.Fail); NT.Info (Report, "Invalid internal state for reference"); Continue := False; elsif Actual_Count /= Expected_Count then NT.Item (Report, Name, NT.Fail); NT.Info (Report, "Unexpected reference count" & Natural'Image (Actual_Count) & " instead of" & Natural'Image (Expected_Count)); Continue := False; elsif not Ref.Is_Empty and then Ref.Is_Last /= (Actual_Count = 1) then NT.Item (Report, Name, NT.Fail); NT.Info (Report, "Unexpected result of Is_Last (" & Boolean'Image (Ref.Is_Last) & ") while counter is" & Natural'Image (Actual_Count)); Continue := False; end if; end Check_Ref; -------------------- -- Invidual tests -- -------------------- procedure Test_Data_Access (Report : in out NT.Reporter'Class) is Argument_Count : Natural; Result : Boolean; procedure Check (Self : in Counter); procedure Set (Self : in out Counter); procedure Check (Self : in Counter) is begin Result := Argument_Count = Self.Instance_Number; Argument_Count := Self.Instance_Number; end Check; procedure Set (Self : in out Counter) is begin Self.Instance_Number := Argument_Count; end Set; Name : constant String := "Data access"; begin declare Ref_1 : Refs.Reference := Refs.Create (Factory'Access); Ref_2 : Refs.Reference; begin Ref_2.Replace (Factory'Access); Argument_Count := 42; Ref_2.Update (Set'Access); Ref_1.Update.Data.Instance_Number := 18; Argument_Count := 18; Ref_1.Query (Check'Access); if not Result then NT.Item (Report, Name, NT.Fail); NT.Info (Report, "Stored 18, retrieved" & Integer'Image (Argument_Count)); return; end if; Ref_1.Reset; Argument_Count := Ref_2.Query.Data.Instance_Number; if Argument_Count /= 42 then NT.Item (Report, Name, NT.Fail); NT.Info (Report, "Stored 42, retrieved" & Integer'Image (Argument_Count)); return; end if; end; NT.Item (Report, Name, NT.Success); exception when Error : others => NT.Report_Exception (Report, Name, Error); end Test_Data_Access; procedure Test_Double_Finalize (Report : in out NT.Reporter'Class) is Name : constant String := "Double finalize"; Initial_Count : constant Integer := Instance_Count; Continue : Boolean := True; begin declare Ref : Refs.Reference := Refs.Create (Factory'Access); begin Ref.Finalize; end; Check_Count (Report, Name, Initial_Count, Continue); if Continue then NT.Item (Report, Name, NT.Success); end if; exception when Error : others => NT.Report_Exception (Report, Name, Error); end Test_Double_Finalize; procedure Test_Implicit_Dereference (Report : in out NT.Reporter'Class) is Test : NT.Test := Report.Item ("Implicit dereference"); Other_Number : constant Integer := 123; procedure Set_Number (Object : in out Counter); procedure Set_Number (Object : in out Counter) is begin Object.Instance_Number := Other_Number; end Set_Number; begin declare Ref : constant Refs.Reference := Refs.Create (Factory'Access); Original_Number : constant Natural := Ref.Query.Instance_Number; begin Set_Number (Ref.Update); Ref.Update.Instance_Number := Original_Number; end; exception when Error : others => Test.Report_Exception (Error); end Test_Implicit_Dereference; procedure Test_Instance_Counts (Report : in out NT.Reporter'Class) is Name : constant String := "Instance counts"; Initial_Count : constant Integer := Instance_Count; Continue : Boolean := True; begin declare procedure Check (Count_0, Count_1, Count_2, Delta_I : in Integer); Ref_0 : Refs.Reference := Refs.Create (Factory'Access); Ref_1 : Refs.Reference := Refs.Create (Refs.Data_Access'(null)); Ref_2 : Refs.Reference; procedure Check (Count_0, Count_1, Count_2, Delta_I : in Integer) is begin Check_Ref (Report, Name, Ref_0, Count_0, Continue); Check_Ref (Report, Name, Ref_1, Count_1, Continue); Check_Ref (Report, Name, Ref_2, Count_2, Continue); Check_Consistency (Report, Name, Ref_0, Ref_1, Continue); Check_Consistency (Report, Name, Ref_1, Ref_2, Continue); Check_Consistency (Report, Name, Ref_2, Ref_0, Continue); Check_Count (Report, Name, Initial_Count + Delta_I, Continue); end Check; begin Check (1, 0, 0, 1); if Continue then Ref_1 := Refs.Create (new Counter); end if; Check (1, 1, 0, 2); if Continue then Ref_2 := Ref_0; end if; Check (2, 1, 2, 2); if Continue then Ref_1 := Ref_0; end if; Check (3, 3, 3, 1); if Continue then Ref_2.Replace (new Counter); end if; Check (2, 2, 1, 2); if Continue then Ref_1.Reset; Ref_0 := Ref_1; end if; Check (0, 0, 1, 1); end; Check_Count (Report, Name, Initial_Count, Continue); if Continue then NT.Item (Report, Name, NT.Success); end if; exception when Error : others => NT.Report_Exception (Report, Name, Error); end Test_Instance_Counts; procedure Test_Reference_Counts (Report : in out NT.Reporter'Class) is Name : constant String := "Reference counts"; Initial_Count : constant Integer := Instance_Count; Continue : Boolean := True; begin declare procedure Check (Count_0, Count_1, Count_2 : in Integer); Ref_0 : constant Refs.Reference := Refs.Create (Factory'Access); Ref_1 : Refs.Reference := Ref_0; Ref_2 : Refs.Reference; procedure Check (Count_0, Count_1, Count_2 : in Integer) is begin Check_Ref (Report, Name, Ref_0, Count_0, Continue); Check_Ref (Report, Name, Ref_1, Count_1, Continue); Check_Ref (Report, Name, Ref_2, Count_2, Continue); Check_Consistency (Report, Name, Ref_0, Ref_1, Continue); Check_Consistency (Report, Name, Ref_1, Ref_2, Continue); Check_Consistency (Report, Name, Ref_2, Ref_0, Continue); end Check; begin Check (2, 2, 0); if Continue then Ref_2 := Ref_0; end if; Check (3, 3, 3); if Continue then Refs.Reset (Ref_1); end if; Check (2, 0, 2); end; Check_Count (Report, Name, Initial_Count, Continue); if Continue then NT.Item (Report, Name, NT.Success); end if; exception when Error : others => NT.Report_Exception (Report, Name, Error); end Test_Reference_Counts; procedure Test_Reference_Tests (Report : in out NT.Reporter'Class) is Name : constant String := "Reference tests"; Initial_Count : constant Integer := Instance_Count; Continue : Boolean := True; begin declare use type Refs.Reference; Ref : Refs.Reference; Base : constant Refs.Reference := Refs.Create (Factory'Access); begin if not Ref.Is_Empty then NT.Item (Report, Name, NT.Fail); NT.Info (Report, "Default reference is not empty"); return; end if; if Base.Is_Empty then NT.Item (Report, Name, NT.Fail); NT.Info (Report, "Created reference is empty"); return; end if; Ref.Replace (Factory'Access); if Ref.Is_Empty then NT.Item (Report, Name, NT.Fail); NT.Info (Report, "Replaced reference is empty"); return; end if; if Ref = Base then NT.Item (Report, Name, NT.Fail); NT.Info (Report, "Unexpected equality between Ref and Base"); return; end if; Ref := Base; if Ref /= Base then NT.Item (Report, Name, NT.Fail); NT.Info (Report, "Unexpected inequality between Ref and Base"); return; end if; end; Check_Count (Report, Name, Initial_Count, Continue); if Continue then NT.Item (Report, Name, NT.Success); end if; exception when Error : others => NT.Report_Exception (Report, Name, Error); end Test_Reference_Tests; procedure Test_Task_Safety (Report : in out NT.Reporter'Class) is Test : NT.Test := Report.Item ("Task safety"); Success : Boolean := True; protected Protected_Report is procedure Report_Exception (Ex : Ada.Exceptions.Exception_Occurrence); end Protected_Report; protected body Protected_Report is procedure Report_Exception (Ex : Ada.Exceptions.Exception_Occurrence) is begin Test.Report_Exception (Ex, NT.Fail); end Report_Exception; end Protected_Report; task type Checker is entry Start (Count : in Natural; Ref : in Refs.Immutable_Reference); end Checker; task body Checker is Starting_Value, Last : Natural; R : Refs.Immutable_Reference; begin accept Start (Count : in Natural; Ref : in Refs.Immutable_Reference) do Last := Count; R := Ref; end Start; Starting_Value := R.Query.Data.Instance_Number; for I in 1 .. Last loop declare Temp : constant Refs.Immutable_Reference := R; begin if Temp.Query.Data.Instance_Number /= Starting_Value then Success := False; end if; end; end loop; exception when Error : others => Protected_Report.Report_Exception (Error); end Checker; Start : constant Ada.Calendar.Time := Ada.Calendar.Clock; begin declare Base : constant Refs.Immutable_Reference := Refs.Create (Factory'Access); begin declare Checkers : array (1 .. 16) of Checker; begin for I in Checkers'Range loop Checkers (I).Start (10 ** 6, Base); end loop; end; if not Success then Test.Fail ("Success somehow got to False"); end if; end; Test.Info ("Test run in " & Duration'Image (Ada.Calendar."-" (Ada.Calendar.Clock, Start))); exception when Error : others => Test.Report_Exception (Error); Test.Info ("Test run in " & Duration'Image (Ada.Calendar."-" (Ada.Calendar.Clock, Start))); end Test_Task_Safety; --------------------- -- Test everything -- --------------------- procedure All_Tests (Report : in out NT.Reporter'Class) is begin Test_Data_Access (Report); Test_Double_Finalize (Report); Test_Implicit_Dereference (Report); Test_Instance_Counts (Report); Test_Reference_Counts (Report); Test_Reference_Tests (Report); end All_Tests; end Natools.Reference_Tests;
30.655238
79
0.579471
586b1f2f08a7a2f971529c12d39e1f7f17921925
6,707
ads
Ada
src/asis/a4g-asis_tables.ads
jquorning/dynamo
10d68571476c270b8e45a9c5ef585fa9139b0d05
[ "Apache-2.0" ]
15
2015-01-18T23:04:19.000Z
2022-03-01T20:27:08.000Z
src/asis/a4g-asis_tables.ads
jquorning/dynamo
10d68571476c270b8e45a9c5ef585fa9139b0d05
[ "Apache-2.0" ]
16
2018-06-10T07:09:30.000Z
2022-03-26T18:28:40.000Z
src/asis/a4g-asis_tables.ads
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 . A S I S _ T A B L E S -- -- -- -- S p e c -- -- -- -- 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). -- -- -- ------------------------------------------------------------------------------ -- This package contains definitions of tables and related auxilary resources -- needed in more than one ASIS implementation package with Asis; with Sinfo; use Sinfo; with Table; with Types; use Types; package A4G.Asis_Tables is package Internal_Asis_Element_Table is new Table.Table ( Table_Component_Type => Asis.Element, Table_Index_Type => Asis.ASIS_Natural, Table_Low_Bound => 1, Table_Initial => 10, Table_Increment => 100, Table_Name => "Internal Element_List"); -- This table contains ASIS Elements. It is supposed to be used only for -- creating the result Element lists in ASIS structural queries. Note that -- many ASIS queries use instantiations of Traverse_Elements to create -- result lists, so we have to make sure that ASIS structural queries -- used in the implementation of Traverse_Element use another table to -- create result lists package Asis_Element_Table is new Table.Table ( Table_Component_Type => Asis.Element, Table_Index_Type => Asis.ASIS_Natural, Table_Low_Bound => 1, Table_Initial => 10, Table_Increment => 100, Table_Name => "Element_List"); -- This table contains ASIS Elements. It is supposed to be used for any -- purpose except creating the result Element lists in ASIS structural -- queries. procedure Add_New_Element (Element : Asis.Element); -- Differs from Asis_Element_Table.Append that checks if the argument -- Element already is in the table, and appends the new element only if the -- check fails. Note that the implementation is based on a simple array -- search, so it can result in performance penalties if there are too -- many elements in the table. type Node_Trace_Rec is record Kind : Node_Kind; Node_Line : Physical_Line_Number; Node_Col : Column_Number; end record; -- This record represents a Node in the node trace used to find the same -- construct in another tree package Node_Trace is new Table.Table ( Table_Component_Type => Node_Trace_Rec, Table_Index_Type => Int, Table_Low_Bound => 0, Table_Initial => 10, Table_Increment => 100, Table_Name => "Node_Trace"); -- This table is used to create the node trace needed to compare elements -- from nested instances function Is_Equal (N : Node_Id; Trace_Rec : Node_Trace_Rec) return Boolean; -- Checks if N (in the currently accessed tree corresponds to the node -- for which Trace_Rec was created procedure Create_Node_Trace (N : Node_Id); -- Creates the Node trace which is supposed to be used to find the node -- representing the same construct in another tree. The trace is also used -- to check is two nodes from different trees, each belonging to expanded -- generics both denote the same thing. This trace contains the record -- about N itself and all the enclosing constructs such as package bodies -- and package specs. For the package which is an expanded generic, the -- next element in the trace is the corresponding instantiation node. function Enclosing_Scope (N : Node_Id) return Node_Id; -- Given a node somewhere from expanded generic, returnes its enclosing -- "scope" which can be N_Package_Declaration, N_Package_Body or -- N_Generic_Declaration node. The idea is to use this function to create -- the node trace either for storing it in the Note Trace table or for -- creating the trace on the fly to compare it with the stored trace. end A4G.Asis_Tables;
53.230159
79
0.540629
22b24a00eb2bc3889c54b25169e2d201c20fca43
11,362
adb
Ada
test/data/Ada-83/adabkend.adb
jfitz/code-stat
dd2a13177f3ef03ab42123ef3cfcbbd062a2ae26
[ "MIT" ]
null
null
null
test/data/Ada-83/adabkend.adb
jfitz/code-stat
dd2a13177f3ef03ab42123ef3cfcbbd062a2ae26
[ "MIT" ]
null
null
null
test/data/Ada-83/adabkend.adb
jfitz/code-stat
dd2a13177f3ef03ab42123ef3cfcbbd062a2ae26
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- A D A B K E N D -- -- -- -- B o d y -- -- -- -- Copyright (C) 2001-2019, 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. 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. -- -- -- ------------------------------------------------------------------------------ -- This is the version of the Back_End package for back ends written in Ada with Atree; use Atree; with Debug; with Lib; with Opt; use Opt; with Output; use Output; with Osint; use Osint; with Osint.C; use Osint.C; with Switch.C; use Switch.C; with Types; use Types; with System.OS_Lib; use System.OS_Lib; package body Adabkend is use Switch; ------------------- -- Call_Back_End -- ------------------- procedure Call_Back_End is begin if (Opt.Verbose_Mode or Opt.Full_List) and then not Debug.Debug_Flag_7 then Write_Eol; Write_Str (Product_Name); Write_Str (", Copyright "); Write_Str (Copyright_Years); Write_Str (" Ada Core Technologies, Inc."); Write_Str (" (http://www.adacore.com)"); Write_Eol; Write_Eol; end if; -- The front end leaves the Current_Error_Node at a location that is -- meaningless and confusing when emitting bug boxes from the back end. -- Reset the global variable in order to emit "No source file position -- information available" messages on back end crashes. Current_Error_Node := Empty; Driver (Lib.Cunit (Types.Main_Unit)); end Call_Back_End; ----------------------------- -- Scan_Compiler_Arguments -- ----------------------------- procedure Scan_Compiler_Arguments is Output_File_Name_Seen : Boolean := False; -- Set to True after having scanned the file_name for switch -- "-gnatO file_name" Argument_Count : constant Integer := Arg_Count - 1; -- Number of arguments (excluding program name) Args : Argument_List (1 .. Argument_Count); Next_Arg : Positive := 1; procedure Scan_Back_End_Switches (Switch_Chars : String); -- Procedure to scan out switches stored in Switch_Chars. The first -- character is known to be a valid switch character, and there are no -- blanks or other switch terminator characters in the string, so the -- entire string should consist of valid switch characters, except that -- an optional terminating NUL character is allowed. -- -- If the switch is not valid, control will not return. The switches -- must still be scanned to skip the "-o" arguments, or internal GCC -- switches, which may be safely ignored by other back ends. ---------------------------- -- Scan_Back_End_Switches -- ---------------------------- procedure Scan_Back_End_Switches (Switch_Chars : String) is First : constant Positive := Switch_Chars'First + 1; Last : constant Natural := Switch_Last (Switch_Chars); begin -- Process any back end switches, returning if the switch does not -- affect code generation or falling through if it does, so the -- switch will get stored. -- Skip -o, -G or internal GCC switches together with their argument. if Switch_Chars (First .. Last) = "o" or else Switch_Chars (First .. Last) = "G" or else Is_Internal_GCC_Switch (Switch_Chars) then Next_Arg := Next_Arg + 1; return; -- ignore this switch -- Set optimization indicators appropriately. In gcc-based GNAT this -- is picked up from imported variables set by the gcc driver, but -- for compilers with non-gcc back ends we do it here to allow use -- of these switches by the front end. Allowed optimization switches -- are -Os (optimize for size), -O[0123], and -O (same as -O1). elsif Switch_Chars (First) = 'O' then if First = Last then Optimization_Level := 1; elsif Last - First = 1 then if Switch_Chars (Last) = 's' then Optimize_Size := 1; Optimization_Level := 2; -- Consistent with gcc setting elsif Switch_Chars (Last) in '0' .. '3' then Optimization_Level := Character'Pos (Switch_Chars (Last)) - Character'Pos ('0'); else Fail ("invalid switch: " & Switch_Chars); end if; else Fail ("invalid switch: " & Switch_Chars); end if; elsif Switch_Chars (First .. Last) = "quiet" then return; -- ignore this switch elsif Switch_Chars (First .. Last) = "c" then return; -- ignore this switch -- The -x switch and its language name argument will generally be -- ignored by non-gcc back ends. In any case, we save the switch and -- argument in the compilation switches. elsif Switch_Chars (First .. Last) = "x" then Lib.Store_Compilation_Switch (Switch_Chars); Next_Arg := Next_Arg + 1; declare Argv : constant String := Args (Next_Arg).all; begin if Is_Switch (Argv) then Fail ("language name missing after -x"); else Lib.Store_Compilation_Switch (Argv); end if; end; return; -- Special check, the back end switch -fno-inline also sets the -- front end flags to entirely inhibit all inlining. So we store it -- and set the appropriate flags. elsif Switch_Chars (First .. Last) = "fno-inline" then Lib.Store_Compilation_Switch (Switch_Chars); Opt.Disable_FE_Inline := True; Opt.Disable_FE_Inline_Always := True; return; -- Similar processing for -fpreserve-control-flow elsif Switch_Chars (First .. Last) = "fpreserve-control-flow" then Lib.Store_Compilation_Switch (Switch_Chars); Opt.Suppress_Control_Flow_Optimizations := True; return; -- Recognize -gxxx switches elsif Switch_Chars (First) = 'g' then Debugger_Level := 2; if First < Last then case Switch_Chars (First + 1) is when '0' => Debugger_Level := 0; when '1' => Debugger_Level := 1; when '2' => Debugger_Level := 2; when '3' => Debugger_Level := 3; when others => null; end case; end if; -- Ignore all other back end switches elsif Is_Back_End_Switch (Switch_Chars) then null; -- Give error for junk switch else Fail ("invalid switch: " & Switch_Chars); end if; -- Store any other GCC switches Lib.Store_Compilation_Switch (Switch_Chars); end Scan_Back_End_Switches; -- Start of processing for Scan_Compiler_Args begin -- Put all the arguments in argument list Args for Arg in 1 .. Argument_Count loop declare Argv : String (1 .. Len_Arg (Arg)); begin Fill_Arg (Argv'Address, Arg); Args (Arg) := new String'(Argv); end; end loop; -- Loop through command line arguments, storing them for later access while Next_Arg <= Argument_Count loop Look_At_Arg : declare Argv : constant String := Args (Next_Arg).all; begin if Argv'Length = 0 then Fail ("Empty argument"); end if; -- If the previous switch has set the Output_File_Name_Present -- flag (that is we have seen a -gnatO), then the next argument -- is the name of the output object file. if Opt.Output_File_Name_Present and then not Output_File_Name_Seen then if Is_Switch (Argv) then Fail ("Object file name missing after -gnatO"); else Set_Output_Object_File_Name (Argv); Output_File_Name_Seen := True; end if; -- If the previous switch has set the Search_Directory_Present -- flag (that is if we have just seen -I), then the next -- argument is a search directory path. elsif Search_Directory_Present then if Is_Switch (Argv) then Fail ("search directory missing after -I"); else Add_Src_Search_Dir (Argv); -- Add directory to lib search so that back end can take as -- input ALI files if needed. Otherwise this won't have any -- impact on the compiler. Add_Lib_Search_Dir (Argv); Search_Directory_Present := False; end if; -- If not a switch, must be a file name elsif not Is_Switch (Argv) then Add_File (Argv); -- We must recognize -nostdinc to suppress visibility on the -- standard GNAT RTL sources. elsif Argv (Argv'First + 1 .. Argv'Last) = "nostdinc" then Opt.No_Stdinc := True; -- Front end switch elsif Is_Front_End_Switch (Argv) then Scan_Front_End_Switches (Argv, Args, Next_Arg); -- All non-front-end switches are back-end switches else Scan_Back_End_Switches (Argv); end if; end Look_At_Arg; Next_Arg := Next_Arg + 1; end loop; end Scan_Compiler_Arguments; end Adabkend;
36.651613
79
0.525524
5826ed0e9bdbfdc1e191ad7620fe07c841484f3b
248
ads
Ada
source/strings/a-sbsfma.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
33
2015-04-04T09:19:36.000Z
2021-11-10T05:33:34.000Z
source/strings/a-sbsfma.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
8
2017-11-14T13:05:07.000Z
2018-08-09T15:28:49.000Z
source/strings/a-sbsfma.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
9
2015-02-03T17:09:53.000Z
2021-11-12T01:16:05.000Z
pragma License (Unrestricted); -- extended unit with Ada.Strings.Functions.Maps; package Ada.Strings.Bounded_Strings.Functions.Maps is new Generic_Maps (Strings.Functions.Maps); pragma Preelaborate (Ada.Strings.Bounded_Strings.Functions.Maps);
35.428571
65
0.814516
1346ffd67a39f348729f660a8dcedfe0e2eff6f1
415
ada
Ada
Task/CRC-32/Ada/crc-32.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:38.000Z
2018-11-09T22:08:38.000Z
Task/CRC-32/Ada/crc-32.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
null
null
null
Task/CRC-32/Ada/crc-32.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:40.000Z
2018-11-09T22:08:40.000Z
with Ada.Text_IO; use Ada.Text_IO; with GNAT.CRC32; use GNAT.CRC32; with Interfaces; use Interfaces; procedure TestCRC is package IIO is new Ada.Text_IO.Modular_IO (Unsigned_32); crc : CRC32; num : Unsigned_32; str : String := "The quick brown fox jumps over the lazy dog"; begin Initialize (crc); Update (crc, str); num := Get_Value (crc); IIO.Put (num, Base => 16); New_Line; end TestCRC;
27.666667
65
0.691566
2fe01970899d261cd19d8ad4d97a97035075eb7c
3,034
ads
Ada
Ada95/samples/ncurses2.ads
mvaisakh/android_external_libncurses
d44c8a16d7f1ed276d0de0b3f6f1a5596c5f556f
[ "DOC", "Unlicense" ]
1,167
2017-08-21T21:21:24.000Z
2022-03-31T15:42:10.000Z
release/src/router/libncurses/Ada95/samples/ncurses2.ads
mon-routeur/Firmware
b25fef7cdab7fe306853baa471ad4a96a9da4600
[ "FSFAP" ]
374
2015-11-03T12:37:22.000Z
2021-12-17T14:18:08.000Z
release/src/router/libncurses/Ada95/samples/ncurses2.ads
mon-routeur/Firmware
b25fef7cdab7fe306853baa471ad4a96a9da4600
[ "FSFAP" ]
96
2015-11-22T07:47:26.000Z
2022-01-20T19:52:19.000Z
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000 Free Software Foundation, Inc. -- -- -- -- 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, distribute with modifications, 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 ABOVE 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. -- -- -- -- Except as contained in this notice, the name(s) of the above copyright -- -- holders shall not be used in advertising or otherwise to promote the -- -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ -- Author: Eugene V. Melaragno <[email protected]> 2000 -- Version Control -- $Revision: 1.1 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package ncurses2 is pragma Pure (ncurses2); end ncurses2;
67.422222
78
0.407713
5817fa1c516179fdbc25dfb194cec303d577c192
130,709
adb
Ada
Vivado_HLS_Tutorial/RTL_Verification/lab2/duc_prj/solution1/.autopilot/db/duc_imf2.bind.adb
williambong/Vivado
68efafbc44b65c0bb047dbafc0ff7f1b56ee36bb
[ "MIT" ]
null
null
null
Vivado_HLS_Tutorial/RTL_Verification/lab2/duc_prj/solution1/.autopilot/db/duc_imf2.bind.adb
williambong/Vivado
68efafbc44b65c0bb047dbafc0ff7f1b56ee36bb
[ "MIT" ]
null
null
null
Vivado_HLS_Tutorial/RTL_Verification/lab2/duc_prj/solution1/.autopilot/db/duc_imf2.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>duc_imf2</name> <ret_bitwidth>18</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>1</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>x</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>x</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>18</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> </ports> <nodes class_id="8" tracking_level="0" version="0"> <count>50</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_2"> <Value> <Obj> <type>0</type> <id>9</id> <name>x_read</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>x</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>18</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>69</item> <item>70</item> </oprand_edges> <opcode>read</opcode> </item> <item class_id_reference="9" object_id="_3"> <Value> <Obj> <type>0</type> <id>10</id> <name>i_3_load</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>24</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="11" tracking_level="0" version="0"> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second class_id="12" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="13" tracking_level="0" version="0"> <first class_id="14" tracking_level="0" version="0"> <first>imf2.c</first> <second>imf2</second> </first> <second>24</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>71</item> </oprand_edges> <opcode>load</opcode> </item> <item class_id_reference="9" object_id="_4"> <Value> <Obj> <type>0</type> <id>11</id> <name>tmp</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>24</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>24</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>72</item> <item>74</item> </oprand_edges> <opcode>icmp</opcode> </item> <item class_id_reference="9" object_id="_5"> <Value> <Obj> <type>0</type> <id>12</id> <name></name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>24</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>24</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>75</item> <item>76</item> <item>77</item> </oprand_edges> <opcode>br</opcode> </item> <item class_id_reference="9" object_id="_6"> <Value> <Obj> <type>0</type> <id>14</id> <name></name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>25</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</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>78</item> <item>79</item> </oprand_edges> <opcode>store</opcode> </item> <item class_id_reference="9" object_id="_7"> <Value> <Obj> <type>0</type> <id>15</id> <name></name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>26</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>26</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>80</item> </oprand_edges> <opcode>br</opcode> </item> <item class_id_reference="9" object_id="_8"> <Value> <Obj> <type>0</type> <id>17</id> <name>inc</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>27</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>27</second> </item> </second> </item> </inlineStackInfo> <originalName>inc</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>81</item> <item>83</item> </oprand_edges> <opcode>add</opcode> </item> <item class_id_reference="9" object_id="_9"> <Value> <Obj> <type>0</type> <id>18</id> <name>tmp_s</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>29</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</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>84</item> </oprand_edges> <opcode>zext</opcode> </item> <item class_id_reference="9" object_id="_10"> <Value> <Obj> <type>0</type> <id>19</id> <name>c_1_addr</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>29</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</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>85</item> <item>87</item> <item>88</item> </oprand_edges> <opcode>getelementptr</opcode> </item> <item class_id_reference="9" object_id="_11"> <Value> <Obj> <type>0</type> <id>20</id> <name>c_1_load</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>29</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</second> </item> </second> </item> </inlineStackInfo> <originalName>c</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>18</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>89</item> </oprand_edges> <opcode>load</opcode> </item> <item class_id_reference="9" object_id="_12"> <Value> <Obj> <type>0</type> <id>21</id> <name>in_2_load</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>29</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</second> </item> </second> </item> </inlineStackInfo> <originalName>d</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>18</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>90</item> <item>192</item> </oprand_edges> <opcode>load</opcode> </item> <item class_id_reference="9" object_id="_13"> <Value> <Obj> <type>0</type> <id>22</id> <name>init_3_load</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>29</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>91</item> </oprand_edges> <opcode>load</opcode> </item> <item class_id_reference="9" object_id="_14"> <Value> <Obj> <type>0</type> <id>23</id> <name>ch_2_load</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>29</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>92</item> </oprand_edges> <opcode>load</opcode> </item> <item class_id_reference="9" object_id="_15"> <Value> <Obj> <type>0</type> <id>24</id> <name>tmp_14</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>27</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>27</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>94</item> <item>95</item> <item>96</item> </oprand_edges> <opcode>bitconcatenate</opcode> </item> <item class_id_reference="9" object_id="_16"> <Value> <Obj> <type>0</type> <id>25</id> <name>tmp_15</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>29</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</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>97</item> </oprand_edges> <opcode>zext</opcode> </item> <item class_id_reference="9" object_id="_17"> <Value> <Obj> <type>0</type> <id>26</id> <name>shift_reg_p_1_addr</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>29</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>98</item> <item>99</item> <item>100</item> </oprand_edges> <opcode>getelementptr</opcode> </item> <item class_id_reference="9" object_id="_18"> <Value> <Obj> <type>0</type> <id>27</id> <name>shift_reg_p_1_load</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>29</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>38</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>101</item> </oprand_edges> <opcode>load</opcode> </item> <item class_id_reference="9" object_id="_19"> <Value> <Obj> <type>0</type> <id>28</id> <name>sel_tmp1</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>29</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</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>102</item> <item>104</item> </oprand_edges> <opcode>icmp</opcode> </item> <item class_id_reference="9" object_id="_20"> <Value> <Obj> <type>0</type> <id>29</id> <name>sel_tmp2</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>29</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</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>105</item> <item>107</item> </oprand_edges> <opcode>icmp</opcode> </item> <item class_id_reference="9" object_id="_21"> <Value> <Obj> <type>0</type> <id>30</id> <name>sel_tmp3</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>29</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</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>108</item> <item>110</item> </oprand_edges> <opcode>xor</opcode> </item> <item class_id_reference="9" object_id="_22"> <Value> <Obj> <type>0</type> <id>31</id> <name>sel_tmp4</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>29</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</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>111</item> <item>112</item> </oprand_edges> <opcode>or</opcode> </item> <item class_id_reference="9" object_id="_23"> <Value> <Obj> <type>0</type> <id>32</id> <name>sel_tmp5</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>29</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</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>113</item> <item>114</item> </oprand_edges> <opcode>and</opcode> </item> <item class_id_reference="9" object_id="_24"> <Value> <Obj> <type>0</type> <id>33</id> <name>tmp_20</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>29</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</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>115</item> <item>116</item> </oprand_edges> <opcode>or</opcode> </item> <item class_id_reference="9" object_id="_25"> <Value> <Obj> <type>0</type> <id>34</id> <name>s_assign</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>29</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</second> </item> </second> </item> </inlineStackInfo> <originalName>s</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>38</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>117</item> <item>119</item> <item>120</item> </oprand_edges> <opcode>select</opcode> </item> <item class_id_reference="9" object_id="_26"> <Value> <Obj> <type>0</type> <id>35</id> <name>tmp_i</name> <fileName>mac.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>36</lineNumber> <contextFuncName>mac2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</second> </item> <item> <first> <first>mac.c</first> <second>mac2</second> </first> <second>36</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>36</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>121</item> </oprand_edges> <opcode>sext</opcode> </item> <item class_id_reference="9" object_id="_27"> <Value> <Obj> <type>0</type> <id>36</id> <name>tmp_i_13</name> <fileName>mac.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>36</lineNumber> <contextFuncName>mac2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</second> </item> <item> <first> <first>mac.c</first> <second>mac2</second> </first> <second>36</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>36</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>122</item> </oprand_edges> <opcode>sext</opcode> </item> <item class_id_reference="9" object_id="_28"> <Value> <Obj> <type>0</type> <id>37</id> <name>m</name> <fileName>mac.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>36</lineNumber> <contextFuncName>mac2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</second> </item> <item> <first> <first>mac.c</first> <second>mac2</second> </first> <second>36</second> </item> </second> </item> </inlineStackInfo> <originalName>m</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>36</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>123</item> <item>124</item> </oprand_edges> <opcode>mul</opcode> </item> <item class_id_reference="9" object_id="_29"> <Value> <Obj> <type>0</type> <id>38</id> <name>tmp_25_i</name> <fileName>mac.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>37</lineNumber> <contextFuncName>mac2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</second> </item> <item> <first> <first>mac.c</first> <second>mac2</second> </first> <second>37</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>38</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>125</item> </oprand_edges> <opcode>sext</opcode> </item> <item class_id_reference="9" object_id="_30"> <Value> <Obj> <type>0</type> <id>39</id> <name>sum</name> <fileName>mac.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>37</lineNumber> <contextFuncName>mac2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>29</second> </item> <item> <first> <first>mac.c</first> <second>mac2</second> </first> <second>37</second> </item> </second> </item> </inlineStackInfo> <originalName>sum</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>38</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>126</item> <item>127</item> </oprand_edges> <opcode>add</opcode> </item> <item class_id_reference="9" object_id="_31"> <Value> <Obj> <type>0</type> <id>40</id> <name>tmp_16</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>24</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>24</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>128</item> <item>129</item> <item>130</item> </oprand_edges> <opcode>bitconcatenate</opcode> </item> <item class_id_reference="9" object_id="_32"> <Value> <Obj> <type>0</type> <id>41</id> <name>tmp_17</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>31</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>31</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>131</item> </oprand_edges> <opcode>zext</opcode> </item> <item class_id_reference="9" object_id="_33"> <Value> <Obj> <type>0</type> <id>42</id> <name>shift_reg_p_1_addr_1</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>31</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>31</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>132</item> <item>133</item> <item>134</item> </oprand_edges> <opcode>getelementptr</opcode> </item> <item class_id_reference="9" object_id="_34"> <Value> <Obj> <type>0</type> <id>43</id> <name></name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>31</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>31</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>135</item> <item>136</item> <item>190</item> </oprand_edges> <opcode>store</opcode> </item> <item class_id_reference="9" object_id="_35"> <Value> <Obj> <type>0</type> <id>44</id> <name></name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>32</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>32</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>137</item> <item>138</item> <item>139</item> </oprand_edges> <opcode>br</opcode> </item> <item class_id_reference="9" object_id="_36"> <Value> <Obj> <type>0</type> <id>46</id> <name>cnt_load</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>33</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>33</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>140</item> </oprand_edges> <opcode>load</opcode> </item> <item class_id_reference="9" object_id="_37"> <Value> <Obj> <type>0</type> <id>47</id> <name>tmp_21</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>33</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</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>141</item> <item>143</item> </oprand_edges> <opcode>icmp</opcode> </item> <item class_id_reference="9" object_id="_38"> <Value> <Obj> <type>0</type> <id>48</id> <name></name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>33</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</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>144</item> <item>145</item> <item>146</item> </oprand_edges> <opcode>br</opcode> </item> <item class_id_reference="9" object_id="_39"> <Value> <Obj> <type>0</type> <id>50</id> <name></name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>34</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>34</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>147</item> <item>148</item> <item>149</item> </oprand_edges> <opcode>br</opcode> </item> <item class_id_reference="9" object_id="_40"> <Value> <Obj> <type>0</type> <id>52</id> <name></name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>34</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>34</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>151</item> <item>152</item> <item>193</item> </oprand_edges> <opcode>store</opcode> </item> <item class_id_reference="9" object_id="_41"> <Value> <Obj> <type>0</type> <id>53</id> <name></name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>34</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>34</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>153</item> </oprand_edges> <opcode>br</opcode> </item> <item class_id_reference="9" object_id="_42"> <Value> <Obj> <type>0</type> <id>55</id> <name>tmp_22</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>35</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>35</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>154</item> <item>155</item> </oprand_edges> <opcode>xor</opcode> </item> <item class_id_reference="9" object_id="_43"> <Value> <Obj> <type>0</type> <id>56</id> <name></name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>35</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>35</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>156</item> <item>157</item> <item>194</item> </oprand_edges> <opcode>store</opcode> </item> <item class_id_reference="9" object_id="_44"> <Value> <Obj> <type>0</type> <id>57</id> <name></name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>36</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>36</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>158</item> </oprand_edges> <opcode>br</opcode> </item> <item class_id_reference="9" object_id="_45"> <Value> <Obj> <type>0</type> <id>59</id> <name>tmp_23</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>37</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>37</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>159</item> <item>161</item> </oprand_edges> <opcode>add</opcode> </item> <item class_id_reference="9" object_id="_46"> <Value> <Obj> <type>0</type> <id>60</id> <name></name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>37</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>37</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>162</item> <item>163</item> <item>195</item> </oprand_edges> <opcode>store</opcode> </item> <item class_id_reference="9" object_id="_47"> <Value> <Obj> <type>0</type> <id>61</id> <name></name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>38</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>38</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>164</item> </oprand_edges> <opcode>br</opcode> </item> <item class_id_reference="9" object_id="_48"> <Value> <Obj> <type>0</type> <id>63</id> <name>y_write_assign</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>42</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>42</second> </item> </second> </item> </inlineStackInfo> <originalName>y</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>18</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>166</item> <item>167</item> <item>169</item> <item>171</item> </oprand_edges> <opcode>partselect</opcode> </item> <item class_id_reference="9" object_id="_49"> <Value> <Obj> <type>0</type> <id>64</id> <name>inc_3</name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>45</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>45</second> </item> </second> </item> </inlineStackInfo> <originalName>inc</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>172</item> <item>173</item> <item>174</item> </oprand_edges> <opcode>select</opcode> </item> <item class_id_reference="9" object_id="_50"> <Value> <Obj> <type>0</type> <id>65</id> <name></name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>45</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>45</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>175</item> <item>176</item> <item>191</item> </oprand_edges> <opcode>store</opcode> </item> <item class_id_reference="9" object_id="_51"> <Value> <Obj> <type>0</type> <id>66</id> <name></name> <fileName>imf2.c</fileName> <fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</fileDirectory> <lineNumber>46</lineNumber> <contextFuncName>imf2</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/RTL_Verification/lab2</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>imf2.c</first> <second>imf2</second> </first> <second>46</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>177</item> </oprand_edges> <opcode>ret</opcode> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>12</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_52"> <Value> <Obj> <type>2</type> <id>73</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="_53"> <Value> <Obj> <type>2</type> <id>82</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="_54"> <Value> <Obj> <type>2</type> <id>86</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="_55"> <Value> <Obj> <type>2</type> <id>103</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>11</content> </item> <item class_id_reference="16" object_id="_56"> <Value> <Obj> <type>2</type> <id>106</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>5</content> </item> <item class_id_reference="16" object_id="_57"> <Value> <Obj> <type>2</type> <id>109</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>1</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_58"> <Value> <Obj> <type>2</type> <id>118</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>38</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_59"> <Value> <Obj> <type>2</type> <id>142</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>2</bitwidth> </Value> <const_type>0</const_type> <content>3</content> </item> <item class_id_reference="16" object_id="_60"> <Value> <Obj> <type>2</type> <id>150</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>1</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_61"> <Value> <Obj> <type>2</type> <id>160</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>2</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>168</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>17</content> </item> <item class_id_reference="16" object_id="_63"> <Value> <Obj> <type>2</type> <id>170</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>34</content> </item> </consts> <blocks class_id="17" tracking_level="0" version="0"> <count>9</count> <item_version>0</item_version> <item class_id="18" tracking_level="1" version="0" object_id="_64"> <Obj> <type>3</type> <id>13</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>9</item> <item>10</item> <item>11</item> <item>12</item> </node_objs> </item> <item class_id_reference="18" object_id="_65"> <Obj> <type>3</type> <id>16</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>2</count> <item_version>0</item_version> <item>14</item> <item>15</item> </node_objs> </item> <item class_id_reference="18" object_id="_66"> <Obj> <type>3</type> <id>45</id> <name>._crit_edge_ifconv</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>28</count> <item_version>0</item_version> <item>17</item> <item>18</item> <item>19</item> <item>20</item> <item>21</item> <item>22</item> <item>23</item> <item>24</item> <item>25</item> <item>26</item> <item>27</item> <item>28</item> <item>29</item> <item>30</item> <item>31</item> <item>32</item> <item>33</item> <item>34</item> <item>35</item> <item>36</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> </node_objs> </item> <item class_id_reference="18" object_id="_67"> <Obj> <type>3</type> <id>49</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>46</item> <item>47</item> <item>48</item> </node_objs> </item> <item class_id_reference="18" object_id="_68"> <Obj> <type>3</type> <id>51</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>50</item> </node_objs> </item> <item class_id_reference="18" object_id="_69"> <Obj> <type>3</type> <id>54</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>2</count> <item_version>0</item_version> <item>52</item> <item>53</item> </node_objs> </item> <item class_id_reference="18" object_id="_70"> <Obj> <type>3</type> <id>58</id> <name>._crit_edge10</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>55</item> <item>56</item> <item>57</item> </node_objs> </item> <item class_id_reference="18" object_id="_71"> <Obj> <type>3</type> <id>62</id> <name>._crit_edge9</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>59</item> <item>60</item> <item>61</item> </node_objs> </item> <item class_id_reference="18" object_id="_72"> <Obj> <type>3</type> <id>67</id> <name>._crit_edge8_ifconv</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>63</item> <item>64</item> <item>65</item> <item>66</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>109</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_73"> <id>70</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>9</sink_obj> </item> <item class_id_reference="20" object_id="_74"> <id>71</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>10</sink_obj> </item> <item class_id_reference="20" object_id="_75"> <id>72</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_76"> <id>74</id> <edge_type>1</edge_type> <source_obj>73</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_77"> <id>75</id> <edge_type>1</edge_type> <source_obj>11</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_78"> <id>76</id> <edge_type>2</edge_type> <source_obj>45</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_79"> <id>77</id> <edge_type>2</edge_type> <source_obj>16</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_80"> <id>78</id> <edge_type>1</edge_type> <source_obj>9</source_obj> <sink_obj>14</sink_obj> </item> <item class_id_reference="20" object_id="_81"> <id>79</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>14</sink_obj> </item> <item class_id_reference="20" object_id="_82"> <id>80</id> <edge_type>2</edge_type> <source_obj>45</source_obj> <sink_obj>15</sink_obj> </item> <item class_id_reference="20" object_id="_83"> <id>81</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>17</sink_obj> </item> <item class_id_reference="20" object_id="_84"> <id>83</id> <edge_type>1</edge_type> <source_obj>82</source_obj> <sink_obj>17</sink_obj> </item> <item class_id_reference="20" object_id="_85"> <id>84</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>18</sink_obj> </item> <item class_id_reference="20" object_id="_86"> <id>85</id> <edge_type>1</edge_type> <source_obj>4</source_obj> <sink_obj>19</sink_obj> </item> <item class_id_reference="20" object_id="_87"> <id>87</id> <edge_type>1</edge_type> <source_obj>86</source_obj> <sink_obj>19</sink_obj> </item> <item class_id_reference="20" object_id="_88"> <id>88</id> <edge_type>1</edge_type> <source_obj>18</source_obj> <sink_obj>19</sink_obj> </item> <item class_id_reference="20" object_id="_89"> <id>89</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>20</sink_obj> </item> <item class_id_reference="20" object_id="_90"> <id>90</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>21</sink_obj> </item> <item class_id_reference="20" object_id="_91"> <id>91</id> <edge_type>1</edge_type> <source_obj>5</source_obj> <sink_obj>22</sink_obj> </item> <item class_id_reference="20" object_id="_92"> <id>92</id> <edge_type>1</edge_type> <source_obj>6</source_obj> <sink_obj>23</sink_obj> </item> <item class_id_reference="20" object_id="_93"> <id>95</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>24</sink_obj> </item> <item class_id_reference="20" object_id="_94"> <id>96</id> <edge_type>1</edge_type> <source_obj>23</source_obj> <sink_obj>24</sink_obj> </item> <item class_id_reference="20" object_id="_95"> <id>97</id> <edge_type>1</edge_type> <source_obj>24</source_obj> <sink_obj>25</sink_obj> </item> <item class_id_reference="20" object_id="_96"> <id>98</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>26</sink_obj> </item> <item class_id_reference="20" object_id="_97"> <id>99</id> <edge_type>1</edge_type> <source_obj>86</source_obj> <sink_obj>26</sink_obj> </item> <item class_id_reference="20" object_id="_98"> <id>100</id> <edge_type>1</edge_type> <source_obj>25</source_obj> <sink_obj>26</sink_obj> </item> <item class_id_reference="20" object_id="_99"> <id>101</id> <edge_type>1</edge_type> <source_obj>26</source_obj> <sink_obj>27</sink_obj> </item> <item class_id_reference="20" object_id="_100"> <id>102</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>28</sink_obj> </item> <item class_id_reference="20" object_id="_101"> <id>104</id> <edge_type>1</edge_type> <source_obj>103</source_obj> <sink_obj>28</sink_obj> </item> <item class_id_reference="20" object_id="_102"> <id>105</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>29</sink_obj> </item> <item class_id_reference="20" object_id="_103"> <id>107</id> <edge_type>1</edge_type> <source_obj>106</source_obj> <sink_obj>29</sink_obj> </item> <item class_id_reference="20" object_id="_104"> <id>108</id> <edge_type>1</edge_type> <source_obj>22</source_obj> <sink_obj>30</sink_obj> </item> <item class_id_reference="20" object_id="_105"> <id>110</id> <edge_type>1</edge_type> <source_obj>109</source_obj> <sink_obj>30</sink_obj> </item> <item class_id_reference="20" object_id="_106"> <id>111</id> <edge_type>1</edge_type> <source_obj>28</source_obj> <sink_obj>31</sink_obj> </item> <item class_id_reference="20" object_id="_107"> <id>112</id> <edge_type>1</edge_type> <source_obj>29</source_obj> <sink_obj>31</sink_obj> </item> <item class_id_reference="20" object_id="_108"> <id>113</id> <edge_type>1</edge_type> <source_obj>31</source_obj> <sink_obj>32</sink_obj> </item> <item class_id_reference="20" object_id="_109"> <id>114</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>32</sink_obj> </item> <item class_id_reference="20" object_id="_110"> <id>115</id> <edge_type>1</edge_type> <source_obj>32</source_obj> <sink_obj>33</sink_obj> </item> <item class_id_reference="20" object_id="_111"> <id>116</id> <edge_type>1</edge_type> <source_obj>22</source_obj> <sink_obj>33</sink_obj> </item> <item class_id_reference="20" object_id="_112"> <id>117</id> <edge_type>1</edge_type> <source_obj>33</source_obj> <sink_obj>34</sink_obj> </item> <item class_id_reference="20" object_id="_113"> <id>119</id> <edge_type>1</edge_type> <source_obj>118</source_obj> <sink_obj>34</sink_obj> </item> <item class_id_reference="20" object_id="_114"> <id>120</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>34</sink_obj> </item> <item class_id_reference="20" object_id="_115"> <id>121</id> <edge_type>1</edge_type> <source_obj>20</source_obj> <sink_obj>35</sink_obj> </item> <item class_id_reference="20" object_id="_116"> <id>122</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>36</sink_obj> </item> <item class_id_reference="20" object_id="_117"> <id>123</id> <edge_type>1</edge_type> <source_obj>35</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_118"> <id>124</id> <edge_type>1</edge_type> <source_obj>36</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_119"> <id>125</id> <edge_type>1</edge_type> <source_obj>37</source_obj> <sink_obj>38</sink_obj> </item> <item class_id_reference="20" object_id="_120"> <id>126</id> <edge_type>1</edge_type> <source_obj>38</source_obj> <sink_obj>39</sink_obj> </item> <item class_id_reference="20" object_id="_121"> <id>127</id> <edge_type>1</edge_type> <source_obj>34</source_obj> <sink_obj>39</sink_obj> </item> <item class_id_reference="20" object_id="_122"> <id>129</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>40</sink_obj> </item> <item class_id_reference="20" object_id="_123"> <id>130</id> <edge_type>1</edge_type> <source_obj>23</source_obj> <sink_obj>40</sink_obj> </item> <item class_id_reference="20" object_id="_124"> <id>131</id> <edge_type>1</edge_type> <source_obj>40</source_obj> <sink_obj>41</sink_obj> </item> <item class_id_reference="20" object_id="_125"> <id>132</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>42</sink_obj> </item> <item class_id_reference="20" object_id="_126"> <id>133</id> <edge_type>1</edge_type> <source_obj>86</source_obj> <sink_obj>42</sink_obj> </item> <item class_id_reference="20" object_id="_127"> <id>134</id> <edge_type>1</edge_type> <source_obj>41</source_obj> <sink_obj>42</sink_obj> </item> <item class_id_reference="20" object_id="_128"> <id>135</id> <edge_type>1</edge_type> <source_obj>39</source_obj> <sink_obj>43</sink_obj> </item> <item class_id_reference="20" object_id="_129"> <id>136</id> <edge_type>1</edge_type> <source_obj>42</source_obj> <sink_obj>43</sink_obj> </item> <item class_id_reference="20" object_id="_130"> <id>137</id> <edge_type>1</edge_type> <source_obj>28</source_obj> <sink_obj>44</sink_obj> </item> <item class_id_reference="20" object_id="_131"> <id>138</id> <edge_type>2</edge_type> <source_obj>67</source_obj> <sink_obj>44</sink_obj> </item> <item class_id_reference="20" object_id="_132"> <id>139</id> <edge_type>2</edge_type> <source_obj>49</source_obj> <sink_obj>44</sink_obj> </item> <item class_id_reference="20" object_id="_133"> <id>140</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_134"> <id>141</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>47</sink_obj> </item> <item class_id_reference="20" object_id="_135"> <id>143</id> <edge_type>1</edge_type> <source_obj>142</source_obj> <sink_obj>47</sink_obj> </item> <item class_id_reference="20" object_id="_136"> <id>144</id> <edge_type>1</edge_type> <source_obj>47</source_obj> <sink_obj>48</sink_obj> </item> <item class_id_reference="20" object_id="_137"> <id>145</id> <edge_type>2</edge_type> <source_obj>62</source_obj> <sink_obj>48</sink_obj> </item> <item class_id_reference="20" object_id="_138"> <id>146</id> <edge_type>2</edge_type> <source_obj>51</source_obj> <sink_obj>48</sink_obj> </item> <item class_id_reference="20" object_id="_139"> <id>147</id> <edge_type>1</edge_type> <source_obj>23</source_obj> <sink_obj>50</sink_obj> </item> <item class_id_reference="20" object_id="_140"> <id>148</id> <edge_type>2</edge_type> <source_obj>58</source_obj> <sink_obj>50</sink_obj> </item> <item class_id_reference="20" object_id="_141"> <id>149</id> <edge_type>2</edge_type> <source_obj>54</source_obj> <sink_obj>50</sink_obj> </item> <item class_id_reference="20" object_id="_142"> <id>151</id> <edge_type>1</edge_type> <source_obj>150</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_143"> <id>152</id> <edge_type>1</edge_type> <source_obj>5</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_144"> <id>153</id> <edge_type>2</edge_type> <source_obj>58</source_obj> <sink_obj>53</sink_obj> </item> <item class_id_reference="20" object_id="_145"> <id>154</id> <edge_type>1</edge_type> <source_obj>23</source_obj> <sink_obj>55</sink_obj> </item> <item class_id_reference="20" object_id="_146"> <id>155</id> <edge_type>1</edge_type> <source_obj>109</source_obj> <sink_obj>55</sink_obj> </item> <item class_id_reference="20" object_id="_147"> <id>156</id> <edge_type>1</edge_type> <source_obj>55</source_obj> <sink_obj>56</sink_obj> </item> <item class_id_reference="20" object_id="_148"> <id>157</id> <edge_type>1</edge_type> <source_obj>6</source_obj> <sink_obj>56</sink_obj> </item> <item class_id_reference="20" object_id="_149"> <id>158</id> <edge_type>2</edge_type> <source_obj>62</source_obj> <sink_obj>57</sink_obj> </item> <item class_id_reference="20" object_id="_150"> <id>159</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>59</sink_obj> </item> <item class_id_reference="20" object_id="_151"> <id>161</id> <edge_type>1</edge_type> <source_obj>160</source_obj> <sink_obj>59</sink_obj> </item> <item class_id_reference="20" object_id="_152"> <id>162</id> <edge_type>1</edge_type> <source_obj>59</source_obj> <sink_obj>60</sink_obj> </item> <item class_id_reference="20" object_id="_153"> <id>163</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>60</sink_obj> </item> <item class_id_reference="20" object_id="_154"> <id>164</id> <edge_type>2</edge_type> <source_obj>67</source_obj> <sink_obj>61</sink_obj> </item> <item class_id_reference="20" object_id="_155"> <id>167</id> <edge_type>1</edge_type> <source_obj>39</source_obj> <sink_obj>63</sink_obj> </item> <item class_id_reference="20" object_id="_156"> <id>169</id> <edge_type>1</edge_type> <source_obj>168</source_obj> <sink_obj>63</sink_obj> </item> <item class_id_reference="20" object_id="_157"> <id>171</id> <edge_type>1</edge_type> <source_obj>170</source_obj> <sink_obj>63</sink_obj> </item> <item class_id_reference="20" object_id="_158"> <id>172</id> <edge_type>1</edge_type> <source_obj>28</source_obj> <sink_obj>64</sink_obj> </item> <item class_id_reference="20" object_id="_159"> <id>173</id> <edge_type>1</edge_type> <source_obj>73</source_obj> <sink_obj>64</sink_obj> </item> <item class_id_reference="20" object_id="_160"> <id>174</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>64</sink_obj> </item> <item class_id_reference="20" object_id="_161"> <id>175</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>176</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>65</sink_obj> </item> <item class_id_reference="20" object_id="_163"> <id>177</id> <edge_type>1</edge_type> <source_obj>63</source_obj> <sink_obj>66</sink_obj> </item> <item class_id_reference="20" object_id="_164"> <id>178</id> <edge_type>2</edge_type> <source_obj>13</source_obj> <sink_obj>16</sink_obj> </item> <item class_id_reference="20" object_id="_165"> <id>179</id> <edge_type>2</edge_type> <source_obj>13</source_obj> <sink_obj>45</sink_obj> </item> <item class_id_reference="20" object_id="_166"> <id>180</id> <edge_type>2</edge_type> <source_obj>16</source_obj> <sink_obj>45</sink_obj> </item> <item class_id_reference="20" object_id="_167"> <id>181</id> <edge_type>2</edge_type> <source_obj>45</source_obj> <sink_obj>49</sink_obj> </item> <item class_id_reference="20" object_id="_168"> <id>182</id> <edge_type>2</edge_type> <source_obj>45</source_obj> <sink_obj>67</sink_obj> </item> <item class_id_reference="20" object_id="_169"> <id>183</id> <edge_type>2</edge_type> <source_obj>49</source_obj> <sink_obj>51</sink_obj> </item> <item class_id_reference="20" object_id="_170"> <id>184</id> <edge_type>2</edge_type> <source_obj>49</source_obj> <sink_obj>62</sink_obj> </item> <item class_id_reference="20" object_id="_171"> <id>185</id> <edge_type>2</edge_type> <source_obj>51</source_obj> <sink_obj>54</sink_obj> </item> <item class_id_reference="20" object_id="_172"> <id>186</id> <edge_type>2</edge_type> <source_obj>51</source_obj> <sink_obj>58</sink_obj> </item> <item class_id_reference="20" object_id="_173"> <id>187</id> <edge_type>2</edge_type> <source_obj>54</source_obj> <sink_obj>58</sink_obj> </item> <item class_id_reference="20" object_id="_174"> <id>188</id> <edge_type>2</edge_type> <source_obj>58</source_obj> <sink_obj>62</sink_obj> </item> <item class_id_reference="20" object_id="_175"> <id>189</id> <edge_type>2</edge_type> <source_obj>62</source_obj> <sink_obj>67</sink_obj> </item> <item class_id_reference="20" object_id="_176"> <id>190</id> <edge_type>4</edge_type> <source_obj>27</source_obj> <sink_obj>43</sink_obj> </item> <item class_id_reference="20" object_id="_177"> <id>191</id> <edge_type>4</edge_type> <source_obj>10</source_obj> <sink_obj>65</sink_obj> </item> <item class_id_reference="20" object_id="_178"> <id>192</id> <edge_type>4</edge_type> <source_obj>14</source_obj> <sink_obj>21</sink_obj> </item> <item class_id_reference="20" object_id="_179"> <id>193</id> <edge_type>4</edge_type> <source_obj>22</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_180"> <id>194</id> <edge_type>4</edge_type> <source_obj>23</source_obj> <sink_obj>56</sink_obj> </item> <item class_id_reference="20" object_id="_181"> <id>195</id> <edge_type>4</edge_type> <source_obj>46</source_obj> <sink_obj>60</sink_obj> </item> </edges> </cdfg> <cdfg_regions class_id="21" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="22" tracking_level="1" version="0" object_id="_182"> <mId>1</mId> <mTag>duc_imf2</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>9</count> <item_version>0</item_version> <item>13</item> <item>16</item> <item>45</item> <item>49</item> <item>51</item> <item>54</item> <item>58</item> <item>62</item> <item>67</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>6</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="_183"> <states class_id="25" tracking_level="0" version="0"> <count>7</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_184"> <id>1</id> <operations class_id="27" tracking_level="0" version="0"> <count>10</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_185"> <id>9</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_186"> <id>10</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_187"> <id>11</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_188"> <id>12</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_189"> <id>14</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_190"> <id>15</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_191"> <id>17</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_192"> <id>18</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_193"> <id>19</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_194"> <id>20</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_195"> <id>2</id> <operations> <count>8</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_196"> <id>20</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_197"> <id>23</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_198"> <id>24</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_199"> <id>25</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_200"> <id>26</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_201"> <id>27</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_202"> <id>28</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_203"> <id>29</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_204"> <id>3</id> <operations> <count>9</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_205"> <id>21</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_206"> <id>22</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_207"> <id>27</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_208"> <id>30</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_209"> <id>31</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_210"> <id>32</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_211"> <id>35</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_212"> <id>36</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_213"> <id>37</id> <stage>3</stage> <latency>3</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_214"> <id>4</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_215"> <id>33</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_216"> <id>34</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_217"> <id>37</id> <stage>2</stage> <latency>3</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_218"> <id>5</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_219"> <id>37</id> <stage>1</stage> <latency>3</latency> </item> <item class_id_reference="28" object_id="_220"> <id>38</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_221"> <id>39</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_222"> <id>6</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_223"> <id>39</id> <stage>1</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_224"> <id>7</id> <operations> <count>21</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_225"> <id>40</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_226"> <id>41</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_227"> <id>42</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_228"> <id>43</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_229"> <id>44</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_230"> <id>46</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_231"> <id>47</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_232"> <id>48</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_233"> <id>50</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_234"> <id>52</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_235"> <id>53</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_236"> <id>55</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_237"> <id>56</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_238"> <id>57</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_239"> <id>59</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_240"> <id>60</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_241"> <id>61</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_242"> <id>63</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_243"> <id>64</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_244"> <id>65</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_245"> <id>66</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="_246"> <inState>1</inState> <outState>2</outState> <condition class_id="31" tracking_level="0" version="0"> <id>27</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="_247"> <inState>2</inState> <outState>3</outState> <condition> <id>30</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="_248"> <inState>3</inState> <outState>4</outState> <condition> <id>31</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="_249"> <inState>4</inState> <outState>5</outState> <condition> <id>32</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="_250"> <inState>5</inState> <outState>6</outState> <condition> <id>33</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="_251"> <inState>6</inState> <outState>7</outState> <condition> <id>34</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> </transitions> </fsm> <res class_id="34" tracking_level="1" version="0" object_id="_252"> <dp_component_resource class_id="35" 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="36" 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="37" tracking_level="0" version="0"> <count>50</count> <item_version>0</item_version> <item class_id="38" tracking_level="0" version="0"> <first>9</first> <second class_id="39" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>10</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>11</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>12</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>14</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>15</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>17</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>18</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>19</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>20</first> <second> <first>0</first> <second>1</second> </second> </item> <item> <first>21</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>22</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>23</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>24</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>25</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>26</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>27</first> <second> <first>1</first> <second>1</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>2</first> <second>0</second> </second> </item> <item> <first>31</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>32</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>33</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>34</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>35</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>36</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>37</first> <second> <first>2</first> <second>2</second> </second> </item> <item> <first>38</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>39</first> <second> <first>4</first> <second>1</second> </second> </item> <item> <first>40</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>41</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>42</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>43</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>44</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>46</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>47</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>48</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>50</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>52</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>53</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>55</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>56</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>57</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>59</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>60</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>61</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>63</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>64</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>65</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>66</first> <second> <first>6</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="40" tracking_level="0" version="0"> <count>9</count> <item_version>0</item_version> <item class_id="41" tracking_level="0" version="0"> <first>13</first> <second class_id="42" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>16</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>45</first> <second> <first>0</first> <second>6</second> </second> </item> <item> <first>49</first> <second> <first>6</first> <second>6</second> </second> </item> <item> <first>51</first> <second> <first>6</first> <second>6</second> </second> </item> <item> <first>54</first> <second> <first>6</first> <second>6</second> </second> </item> <item> <first>58</first> <second> <first>6</first> <second>6</second> </second> </item> <item> <first>62</first> <second> <first>6</first> <second>6</second> </second> </item> <item> <first>67</first> <second> <first>6</first> <second>6</second> </second> </item> </bblk_ent_exit> <regions class_id="43" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </regions> <dp_fu_nodes class_id="44" tracking_level="0" version="0"> <count>38</count> <item_version>0</item_version> <item class_id="45" tracking_level="0" version="0"> <first>46</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> <item> <first>52</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>59</first> <second> <count>2</count> <item_version>0</item_version> <item>20</item> <item>20</item> </second> </item> <item> <first>64</first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> <item> <first>71</first> <second> <count>3</count> <item_version>0</item_version> <item>27</item> <item>27</item> <item>43</item> </second> </item> <item> <first>76</first> <second> <count>1</count> <item_version>0</item_version> <item>42</item> </second> </item> <item> <first>84</first> <second> <count>1</count> <item_version>0</item_version> <item>10</item> </second> </item> <item> <first>88</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> <item> <first>94</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>100</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> <item> <first>106</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>111</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>115</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>122</first> <second> <count>1</count> <item_version>0</item_version> <item>25</item> </second> </item> <item> <first>127</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>132</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>137</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>141</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>145</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>151</first> <second> <count>1</count> <item_version>0</item_version> <item>31</item> </second> </item> <item> <first>155</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>161</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>164</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>168</first> <second> <count>1</count> <item_version>0</item_version> <item>33</item> </second> </item> <item> <first>172</first> <second> <count>1</count> <item_version>0</item_version> <item>34</item> </second> </item> <item> <first>179</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>185</first> <second> <count>1</count> <item_version>0</item_version> <item>41</item> </second> </item> <item> <first>190</first> <second> <count>1</count> <item_version>0</item_version> <item>46</item> </second> </item> <item> <first>194</first> <second> <count>1</count> <item_version>0</item_version> <item>47</item> </second> </item> <item> <first>200</first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first>206</first> <second> <count>1</count> <item_version>0</item_version> <item>55</item> </second> </item> <item> <first>211</first> <second> <count>1</count> <item_version>0</item_version> <item>56</item> </second> </item> <item> <first>217</first> <second> <count>1</count> <item_version>0</item_version> <item>59</item> </second> </item> <item> <first>223</first> <second> <count>1</count> <item_version>0</item_version> <item>60</item> </second> </item> <item> <first>229</first> <second> <count>1</count> <item_version>0</item_version> <item>63</item> </second> </item> <item> <first>238</first> <second> <count>1</count> <item_version>0</item_version> <item>64</item> </second> </item> <item> <first>244</first> <second> <count>1</count> <item_version>0</item_version> <item>65</item> </second> </item> <item> <first>250</first> <second> <count>6</count> <item_version>0</item_version> <item>37</item> <item>37</item> <item>37</item> <item>39</item> <item>39</item> <item>38</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="47" tracking_level="0" version="0"> <count>24</count> <item_version>0</item_version> <item class_id="48" tracking_level="0" version="0"> <first>c_1_addr_gep_fu_52</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>inc_3_fu_238</first> <second> <count>1</count> <item_version>0</item_version> <item>64</item> </second> </item> <item> <first>inc_fu_100</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> <item> <first>s_assign_fu_172</first> <second> <count>1</count> <item_version>0</item_version> <item>34</item> </second> </item> <item> <first>sel_tmp1_fu_127</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>sel_tmp2_fu_132</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>sel_tmp3_fu_145</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>sel_tmp4_fu_151</first> <second> <count>1</count> <item_version>0</item_version> <item>31</item> </second> </item> <item> <first>sel_tmp5_fu_155</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>shift_reg_p_1_addr_1_gep_fu_76</first> <second> <count>1</count> <item_version>0</item_version> <item>42</item> </second> </item> <item> <first>shift_reg_p_1_addr_gep_fu_64</first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> <item> <first>tmp_14_fu_115</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>tmp_15_fu_122</first> <second> <count>1</count> <item_version>0</item_version> <item>25</item> </second> </item> <item> <first>tmp_16_fu_179</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>tmp_17_fu_185</first> <second> <count>1</count> <item_version>0</item_version> <item>41</item> </second> </item> <item> <first>tmp_20_fu_168</first> <second> <count>1</count> <item_version>0</item_version> <item>33</item> </second> </item> <item> <first>tmp_21_fu_194</first> <second> <count>1</count> <item_version>0</item_version> <item>47</item> </second> </item> <item> <first>tmp_22_fu_206</first> <second> <count>1</count> <item_version>0</item_version> <item>55</item> </second> </item> <item> <first>tmp_23_fu_217</first> <second> <count>1</count> <item_version>0</item_version> <item>59</item> </second> </item> <item> <first>tmp_fu_88</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> <item> <first>tmp_i_13_fu_164</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>tmp_i_fu_161</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>tmp_s_fu_106</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>y_write_assign_fu_229</first> <second> <count>1</count> <item_version>0</item_version> <item>63</item> </second> </item> </dp_fu_nodes_expression> <dp_fu_nodes_module> <count>1</count> <item_version>0</item_version> <item> <first>grp_fu_250</first> <second> <count>6</count> <item_version>0</item_version> <item>37</item> <item>37</item> <item>37</item> <item>39</item> <item>39</item> <item>38</item> </second> </item> </dp_fu_nodes_module> <dp_fu_nodes_io> <count>11</count> <item_version>0</item_version> <item> <first>ch_2_load_load_fu_111</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>cnt_load_load_fu_190</first> <second> <count>1</count> <item_version>0</item_version> <item>46</item> </second> </item> <item> <first>i_3_load_load_fu_84</first> <second> <count>1</count> <item_version>0</item_version> <item>10</item> </second> </item> <item> <first>in_2_load_load_fu_137</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>init_3_load_load_fu_141</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>stg_12_store_fu_94</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>stg_51_store_fu_200</first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first>stg_54_store_fu_211</first> <second> <count>1</count> <item_version>0</item_version> <item>56</item> </second> </item> <item> <first>stg_57_store_fu_223</first> <second> <count>1</count> <item_version>0</item_version> <item>60</item> </second> </item> <item> <first>stg_61_store_fu_244</first> <second> <count>1</count> <item_version>0</item_version> <item>65</item> </second> </item> <item> <first>x_read_read_fu_46</first> <second> <count>1</count> <item_version>0</item_version> <item>9</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="49" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="50" tracking_level="0" version="0"> <first class_id="51" tracking_level="0" version="0"> <first>c_1</first> <second>0</second> </first> <second> <count>2</count> <item_version>0</item_version> <item>20</item> <item>20</item> </second> </item> <item> <first> <first>shift_reg_p_1</first> <second>0</second> </first> <second> <count>3</count> <item_version>0</item_version> <item>27</item> <item>27</item> <item>43</item> </second> </item> </dp_mem_port_nodes> <dp_reg_nodes> <count>15</count> <item_version>0</item_version> <item> <first>257</first> <second> <count>1</count> <item_version>0</item_version> <item>10</item> </second> </item> <item> <first>267</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> <item> <first>273</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>278</first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> <item> <first>283</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>289</first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> <item> <first>294</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>300</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>305</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>310</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>315</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>320</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>325</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>330</first> <second> <count>1</count> <item_version>0</item_version> <item>34</item> </second> </item> <item> <first>335</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> </dp_reg_nodes> <dp_regname_nodes> <count>15</count> <item_version>0</item_version> <item> <first>c_1_addr_reg_273</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>c_1_load_reg_278</first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> <item> <first>ch_2_load_reg_283</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>i_3_load_reg_257</first> <second> <count>1</count> <item_version>0</item_version> <item>10</item> </second> </item> <item> <first>inc_reg_267</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> <item> <first>init_3_load_reg_305</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>s_assign_reg_330</first> <second> <count>1</count> <item_version>0</item_version> <item>34</item> </second> </item> <item> <first>sel_tmp1_reg_294</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>sel_tmp2_reg_300</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>sel_tmp5_reg_315</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>shift_reg_p_1_addr_reg_289</first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> <item> <first>shift_reg_p_1_load_reg_310</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>sum_reg_335</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> <item> <first>tmp_i_13_reg_325</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>tmp_i_reg_320</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> </dp_regname_nodes> <dp_reg_phi> <count>0</count> <item_version>0</item_version> </dp_reg_phi> <dp_regname_phi> <count>0</count> <item_version>0</item_version> </dp_regname_phi> <dp_port_io_nodes class_id="52" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="53" tracking_level="0" version="0"> <first>x</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>read</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core class_id="54" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </port2core> <node2core> <count>0</count> <item_version>0</item_version> </node2core> </syndb> </boost_serialization>
25.020865
99
0.580542
39ed4d4db3bb4bde2d37837454b8cc44bde24ab2
1,178
ads
Ada
source/resolver/program-plain_contexts-unit_name_resolvers.ads
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
null
null
null
source/resolver/program-plain_contexts-unit_name_resolvers.ads
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
null
null
null
source/resolver/program-plain_contexts-unit_name_resolvers.ads
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
1
2019-10-16T09:05:27.000Z
2019-10-16T09:05:27.000Z
-- SPDX-FileCopyrightText: 2020 Max Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Program.Cross_Reference_Updaters; with Program.Elements.Identifiers; with Program.Simple_Resolvers; with Program.Symbol_Lists; with Program.Error_Listeners; private package Program.Plain_Contexts.Unit_Name_Resolvers is pragma Preelaborate; type Unit_Name_Resolver (Lists : not null Program.Symbol_Lists.Symbol_List_Table_Access; Errors : not null Program.Error_Listeners.Error_Listener_Access; Declarations : not null Unit_Vector_Access; Bodies : not null Unit_Vector_Access) is new Program.Simple_Resolvers.Simple_Resolver with null record; type Unit_Name_Resolver_Access is access all Unit_Name_Resolver'Class with Storage_Size => 0; overriding procedure Resolve_Identifier (Self : Unit_Name_Resolver; Name : not null Program.Elements.Identifiers.Identifier_Access; Setter : not null Program.Cross_Reference_Updaters.Cross_Reference_Updater_Access); end Program.Plain_Contexts.Unit_Name_Resolvers;
34.647059
76
0.727504
ad579e87d7b3bd170894b4f814c122e2764647a8
2,173
adb
Ada
src/configuration.adb
kqr/qweyboard
d4e8b8cac8450d5dbb0ed69e78d8d71dcaec91da
[ "0BSD" ]
33
2017-02-25T22:20:45.000Z
2022-02-18T01:21:58.000Z
src/configuration.adb
kqr/qweyboard
d4e8b8cac8450d5dbb0ed69e78d8d71dcaec91da
[ "0BSD" ]
1
2017-03-09T08:05:57.000Z
2017-03-09T08:05:57.000Z
src/configuration.adb
kqr/qweyboard
d4e8b8cac8450d5dbb0ed69e78d8d71dcaec91da
[ "0BSD" ]
2
2017-03-08T21:32:37.000Z
2020-01-09T21:15:30.000Z
package body Configuration is procedure Get_Settings (Config : in out Settings) is I : Positive := 1; begin while I <= CLI.Argument_Count loop if Get_Argument (I, "-t", Config.Timeout) then null; elsif Get_Argument (I, "-l", Config.Language_File_Name) then null; elsif Get_Argument (I, "-v", Config.Log_Level) then null; elsif Get_Argument (I, "-vv", Config.Log_Level) then null; elsif Get_Argument (I, "-vvv", Config.Log_Level) then null; else raise ARGUMENTS_ERROR; end if; end loop; end Get_Settings; procedure Load_Language (Config : in out Settings) is begin if Length (Config.Language_File_Name) > 0 then Qweyboard.Languages.Parser.Parse (To_String (Config.Language_File_Name)); end if; end; function Get_Argument (Count : in out Positive; Flag : String; File_Name : in out Unbounded_String) return Boolean is begin if CLI.Argument (Count) /= Flag then return False; end if; File_Name := To_Unbounded_String (CLI.Argument (Count + 1)); Count := Count + 2; return True; end Get_Argument; function Get_Argument (Count : in out Positive; Flag : String; Timeout : in out Ada.Real_Time.Time_Span) return Boolean is begin if CLI.Argument (Count) /= Flag then return False; end if; Timeout := Ada.Real_Time.Milliseconds (Natural'Value (CLI.Argument (Count + 1))); Count := Count + 2; return True; exception when CONSTRAINT_ERROR => return False; end Get_Argument; function Get_Argument (Count : in out Positive; Flag : String; Verbosity : in out Logging.Verbosity_Level) return Boolean is begin if CLI.Argument (Count) /= Flag then return False; end if; if Flag = "-v" then Verbosity := Logging.Log_Warning; elsif Flag = "-vv" then Verbosity := Logging.Log_Info; elsif Flag = "-vvv" then Verbosity := Logging.Log_Chatty; else return False; end if; Count := Count + 1; return True; end; end Configuration;
32.924242
127
0.624942
22c4573968774615ffda901d85c17775d5c9be13
2,944
ads
Ada
support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-retide.ads
orb-zhuchen/Orb
6da2404b949ac28bde786e08bf4debe4a27cd3a0
[ "CNRI-Python-GPL-Compatible", "MIT" ]
null
null
null
support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-retide.ads
orb-zhuchen/Orb
6da2404b949ac28bde786e08bf4debe4a27cd3a0
[ "CNRI-Python-GPL-Compatible", "MIT" ]
null
null
null
support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/a-retide.ads
orb-zhuchen/Orb
6da2404b949ac28bde786e08bf4debe4a27cd3a0
[ "CNRI-Python-GPL-Compatible", "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- A D A . R E A L _ T I M E . D E L A Y S -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2019, 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 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/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- Implements Real_Time.Time absolute delays -- Note: the compiler generates direct calls to this interface, in the -- processing of time types. package Ada.Real_Time.Delays is function To_Duration (T : Real_Time.Time) return Duration; -- Convert Time to Duration procedure Delay_Until (T : Time); -- Delay until Clock has reached (at least) time T, -- or the task is aborted to at least the current ATC nesting level. -- The body of this procedure must perform all the processing -- required for an abort point. end Ada.Real_Time.Delays;
60.081633
78
0.439538
2e1616926e9e727f176d575564f2041d780ecb20
2,246
ads
Ada
src/fltk-widgets-valuators-counters.ads
micahwelf/FLTK-Ada
83e0c58ea98e5ede2cbbb158b42eae44196c3ba7
[ "Unlicense" ]
1
2020-12-18T15:20:13.000Z
2020-12-18T15:20:13.000Z
src/fltk-widgets-valuators-counters.ads
micahwelf/FLTK-Ada
83e0c58ea98e5ede2cbbb158b42eae44196c3ba7
[ "Unlicense" ]
null
null
null
src/fltk-widgets-valuators-counters.ads
micahwelf/FLTK-Ada
83e0c58ea98e5ede2cbbb158b42eae44196c3ba7
[ "Unlicense" ]
null
null
null
package FLTK.Widgets.Valuators.Counters is type Counter is new Valuator with private; type Counter_Reference (Data : not null access Counter'Class) is limited null record with Implicit_Dereference => Data; package Forge is function Create (X, Y, W, H : in Integer; Text : in String) return Counter; end Forge; function Get_Step (This : in Counter) return Long_Float; procedure Set_Step (This : in out Counter; To : in Long_Float); function Get_Long_Step (This : in Counter) return Long_Float; procedure Set_Long_Step (This : in out Counter; To : in Long_Float); function Get_Text_Color (This : in Counter) return Color; procedure Set_Text_Color (This : in out Counter; To : in Color); function Get_Text_Font (This : in Counter) return Font_Kind; procedure Set_Text_Font (This : in out Counter; To : in Font_Kind); function Get_Text_Size (This : in Counter) return Font_Size; procedure Set_Text_Size (This : in out Counter; To : in Font_Size); procedure Draw (This : in out Counter); function Handle (This : in out Counter; Event : in Event_Kind) return Event_Outcome; private type Counter is new Valuator with record -- Needed because Fl_Counter doesn't have -- a way to retrieve this value otherwise. Long_Step : Long_Float := 1.0; end record; overriding procedure Finalize (This : in out Counter); pragma Inline (Get_Step); pragma Inline (Set_Step); pragma Inline (Get_Long_Step); pragma Inline (Set_Long_Step); pragma Inline (Get_Text_Color); pragma Inline (Set_Text_Color); pragma Inline (Get_Text_Font); pragma Inline (Set_Text_Font); pragma Inline (Get_Text_Size); pragma Inline (Set_Text_Size); pragma Inline (Draw); pragma Inline (Handle); end FLTK.Widgets.Valuators.Counters;
19.362069
68
0.58415
22420dc3980df0a267b1654c13bc74123089b06b
1,665
adb
Ada
gdb/testsuite/gdb.ada/variant/pkg.adb
greyblue9/binutils-gdb
05377632b124fe7600eea7f4ee0e9a35d1b0cbdc
[ "BSD-3-Clause" ]
1
2020-10-14T03:24:35.000Z
2020-10-14T03:24:35.000Z
gdb/testsuite/gdb.ada/variant/pkg.adb
greyblue9/binutils-gdb
05377632b124fe7600eea7f4ee0e9a35d1b0cbdc
[ "BSD-3-Clause" ]
null
null
null
gdb/testsuite/gdb.ada/variant/pkg.adb
greyblue9/binutils-gdb
05377632b124fe7600eea7f4ee0e9a35d1b0cbdc
[ "BSD-3-Clause" ]
null
null
null
-- Copyright 2020-2021 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/>. with Pck; use Pck; procedure Pkg is R, Q : Rec_Type; ST1 : constant Second_Type := (I => -4, One => 1, X => 2); ST2 : constant Second_Type := (I => 99, One => 1, Y => 77); NAV1 : constant Nested_And_Variable := (One => 0, Two => 93, Str => (others => 'z')); NAV2 : constant Nested_And_Variable := (One => 3, OneValue => 33, Str => (others => 'z'), Str2 => (others => 'q'), Two => 0); NAV3 : constant Nested_And_Variable := (One => 3, OneValue => 33, Str => (others => 'z'), Str2 => (others => 'q'), Two => 7, TwoValue => 88); begin R := (C => 'd'); Q := (C => Character'First, X_First => 27); null; -- STOP end Pkg;
39.642857
73
0.524925
ad12f54d82ca0fc0f1564a2ffa3adc492545f6a2
2,268
adb
Ada
src/sdl-versions.adb
alire-project/sdlada
9593807925f5f6651d81514c7f2d163ab3156dc1
[ "Zlib" ]
null
null
null
src/sdl-versions.adb
alire-project/sdlada
9593807925f5f6651d81514c7f2d163ab3156dc1
[ "Zlib" ]
null
null
null
src/sdl-versions.adb
alire-project/sdlada
9593807925f5f6651d81514c7f2d163ab3156dc1
[ "Zlib" ]
null
null
null
-------------------------------------------------------------------------------------------------------------------- -- Copyright (c) 2013-2018 Luke A. Guest -- -- 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. -------------------------------------------------------------------------------------------------------------------- with Interfaces.C; with Interfaces.C.Strings; with System; package body SDL.Versions is package C renames Interfaces.C; function Revision return String is function SDL_Get_Revision return C.Strings.chars_ptr with Import => True, Convention => C, External_Name => "SDL_GetRevision"; C_Str : C.Strings.chars_ptr := SDL_Get_Revision; begin return C.Strings.Value (C_Str); end Revision; function Revision return Revision_Level is function SDL_Get_Revision_Number return C.int with Import => True, Convention => C, External_Name => "SDL_GetRevisionNumber"; begin return Revision_Level (SDL_Get_Revision_Number); end Revision; procedure Linked_With (Info : in out Version) is procedure SDL_Get_Version (V : access Version) with Import => True, Convention => C, External_Name => "SDL_GetVersion"; Data : aliased Version; begin SDL_Get_Version (Data'Access); Info := Data; end Linked_With; end SDL.Versions;
36
116
0.614638
a1bde3185f10906fcbc500f9c6c6e3d1fd9c2710
1,642
ads
Ada
source/protocol/lsp-request_dispatchers.ads
reznikmm/ada_lsp
b0e2666f758d6e46b973b5d7e4b9a7ba66c46157
[ "MIT" ]
11
2017-10-18T18:22:04.000Z
2022-01-01T12:22:23.000Z
source/protocol/lsp-request_dispatchers.ads
reznikmm/ada_lsp
b0e2666f758d6e46b973b5d7e4b9a7ba66c46157
[ "MIT" ]
null
null
null
source/protocol/lsp-request_dispatchers.ads
reznikmm/ada_lsp
b0e2666f758d6e46b973b5d7e4b9a7ba66c46157
[ "MIT" ]
1
2019-09-14T23:13:33.000Z
2019-09-14T23:13:33.000Z
-- Copyright (c) 2017 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Ada.Containers.Hashed_Maps; with Ada.Streams; with League.Strings; private with League.Strings.Hash; with LSP.Messages; with LSP.Message_Handlers; with LSP.Types; package LSP.Request_Dispatchers is pragma Preelaborate; type Request_Dispatcher is tagged limited private; type Parameter_Handler_Access is access function (Stream : access Ada.Streams.Root_Stream_Type'Class; Handler : not null LSP.Message_Handlers.Request_Handler_Access) return LSP.Messages.ResponseMessage'Class; not overriding procedure Register (Self : in out Request_Dispatcher; Method : League.Strings.Universal_String; Value : Parameter_Handler_Access); not overriding function Dispatch (Self : in out Request_Dispatcher; Method : LSP.Types.LSP_String; Stream : access Ada.Streams.Root_Stream_Type'Class; Handler : not null LSP.Message_Handlers.Request_Handler_Access) return LSP.Messages.ResponseMessage'Class; private package Maps is new Ada.Containers.Hashed_Maps (Key_Type => League.Strings.Universal_String, Element_Type => Parameter_Handler_Access, Hash => League.Strings.Hash, Equivalent_Keys => League.Strings."=", "=" => "="); type Request_Dispatcher is tagged limited record Map : Maps.Map; Value : LSP.Message_Handlers.Request_Handler_Access; end record; end LSP.Request_Dispatchers;
30.407407
71
0.690621
1a387a805ec0114e1525361236e86ad35b676384
24,648
adb
Ada
src/words_engine/words_engine-list_sweep.adb
finleyexp/whitakers-words
9c07fe7e96ac15dc3262b82a37f6ea69947f458b
[ "FTL" ]
3
2019-02-22T13:24:42.000Z
2021-02-22T13:20:55.000Z
src/words_engine/words_engine-list_sweep.adb
finleyexp/whitakers-words
9c07fe7e96ac15dc3262b82a37f6ea69947f458b
[ "FTL" ]
null
null
null
src/words_engine/words_engine-list_sweep.adb
finleyexp/whitakers-words
9c07fe7e96ac15dc3262b82a37f6ea69947f458b
[ "FTL" ]
null
null
null
-- 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. with Ada.Exceptions; use Ada.Exceptions; with Latin_Utils.Strings_Package; use Latin_Utils.Strings_Package; with Support_Utils.Word_Parameters; use Support_Utils.Word_Parameters; with Latin_Utils.Inflections_Package; use Latin_Utils.Inflections_Package; with Support_Utils.Uniques_Package; use Support_Utils.Uniques_Package; with Support_Utils.Developer_Parameters; use Support_Utils.Developer_Parameters; with Support_Utils.Word_Support_Package; use Support_Utils.Word_Support_Package; use Latin_Utils; package body Words_Engine.List_Sweep is function Allowed_Stem (Pr : Parse_Record) return Boolean is Allowed : Boolean := True; -- modify as necessary and return it De : Dictionary_Entry; begin -- TEXT_IO.PUT ("ALLOWED? >"); -- PARSE_RECORD_IO.PUT (PR); -- TEXT_IO.NEW_LINE; -- FIXME: duplicates (commented) code below if Pr.D_K not in General .. Local then return True; end if; Dict_IO.Read (Dict_File (Pr.D_K), De, Pr.MNPC); -- NOUN CHECKS case Pr.IR.Qual.Pofs is when N => if Words_Mdev (For_Word_List_Check) then if (Nom <= Pr.IR.Qual.Noun.Of_Case) and then (S <= Pr.IR.Qual.Noun.Number) then Allowed := True; elsif (Nom <= Pr.IR.Qual.Noun.Of_Case) and then (Pr.IR.Qual.Noun.Number = P) then Search_For_Pl : declare De : Dictionary_Entry; Mean : Meaning_Type := Null_Meaning_Type; begin Allowed := False; Dict_IO.Read (Dict_File (Pr.D_K), De, Pr.MNPC); Mean := De.Mean; for J in Meaning_Type'First .. Meaning_Type'Last - 2 loop if Mean (J .. J + 2) = "pl." then Allowed := True; exit; end if; end loop; end Search_For_Pl; else Allowed := False; end if; end if; when Adj => if Words_Mdev (For_Word_List_Check) then Allowed := (Nom <= Pr.IR.Qual.Adj.Of_Case) and then (S <= Pr.IR.Qual.Adj.Number) and then (M <= Pr.IR.Qual.Adj.Gender); end if; -- VERB CHECKS when V => --TEXT_IO.PUT ("VERB "); -- Check for Verb 3 1 dic/duc/fac/fer shortened imperative -- See G&L 130.5 declare Stem : constant String := Trim (Pr.Stem); Last_Three : String (1 .. 3); begin if (Pr.IR.Qual.Verb = ((3, 1), (Pres, Active, Imp), 2, S)) and (Pr.IR.Ending.Size = 0) then -- For this special case if Stem'Length >= 3 then Last_Three := Stem (Stem'Last - 2 .. Stem'Last); if not ((Last_Three = "dic") or (Last_Three = "duc") or (Last_Three = "fac") or (Last_Three = "fer")) then Allowed := False; end if; else Allowed := False; end if; end if; end; -- Check for Verb Imperative being in permitted person if Pr.IR.Qual.Verb.Tense_Voice_Mood.Mood = Imp and then not (((Pr.IR.Qual.Verb.Tense_Voice_Mood.Tense = Pres) and (Pr.IR.Qual.Verb.Person = 2)) or else ((Pr.IR.Qual.Verb.Tense_Voice_Mood.Tense = Fut) and (Pr.IR.Qual.Verb.Person = 2 or Pr.IR.Qual.Verb.Person = 3))) then Allowed := False; end if; -- Check for V IMPERS and demand that only 3rd person if De.Part.V.Kind = Impers and then Pr.IR.Qual.Verb.Person /= 3 then Allowed := False; end if; -- Check for V DEP and demand PASSIVE if De.Part.V.Kind = Dep then --TEXT_IO.PUT ("DEP "); if (Pr.IR.Qual.Verb.Tense_Voice_Mood.Voice = Active) and (Pr.IR.Qual.Verb.Tense_Voice_Mood.Mood = Inf) and (Pr.IR.Qual.Verb.Tense_Voice_Mood.Tense = Fut) then --TEXT_IO.PUT ("PASSIVE "); Allowed := True; elsif (Pr.IR.Qual.Verb.Tense_Voice_Mood.Voice = Active) and (Pr.IR.Qual.Verb.Tense_Voice_Mood.Mood in Ind .. Inf) then --TEXT_IO.PUT ("ACTIVE "); Allowed := False; else --TEXT_IO.PUT ("?????? "); null; end if; end if; -- Check for V SEMIDEP and demand PASSIVE ex Perf if De.Part.V.Kind = Semidep and (Pr.IR.Qual.Verb.Tense_Voice_Mood.Mood in Ind .. Imp) and (((Pr.IR.Qual.Verb.Tense_Voice_Mood.Voice = Passive) and (Pr.IR.Qual.Verb.Tense_Voice_Mood.Tense in Pres .. Fut)) or ((Pr.IR.Qual.Verb.Tense_Voice_Mood.Voice = Active) and (Pr.IR.Qual.Verb.Tense_Voice_Mood.Tense in Perf .. Futp))) then Allowed := False; end if; if Words_Mdev (For_Word_List_Check) then if (Pr.IR.Qual.Verb.Person = 1) and then (Pr.IR.Qual.Verb.Number = S) then Allowed := (Pr.IR.Qual.Verb.Tense_Voice_Mood = (Pres, Active, Ind)) and ((De.Part.V.Kind in X .. Intrans) or else (De.Part.V.Kind = Dep) or else (De.Part.V.Kind = Semidep) or else (De.Part.V.Kind = Perfdef)); elsif De.Part.V.Kind = Impers then Allowed := (Pr.IR.Qual.Verb.Person = 3) and then (Pr.IR.Qual.Verb.Number = S) and then (Pr.IR.Qual.Verb.Tense_Voice_Mood = (Pres, Active, Ind)); else Allowed := False; end if; end if; when others => null; end case; if Words_Mdev (For_Word_List_Check) then -- Non parts if Pr.IR.Qual.Pofs in Vpar .. Supine then Allowed := False; end if; end if; -- Non parts return Allowed; end Allowed_Stem; -- FIXME: Pa is effectively passed in twice; Sl is often a slice of Pa procedure Order_Parse_Array (Sl : in out Parse_Array; Diff_J : out Integer; Pa : in Parse_Array) is use Dict_IO; Hits : Integer := 0; Sl_Last : Integer := Sl'Last; Sl_Last_Initial : constant Integer := Sl_Last; Sm : Parse_Record; Has_Noun_Abbreviation : Boolean := False; Not_Only_Archaic : Boolean := False; Not_Only_Medieval : Boolean := False; Not_Only_Uncommon : Boolean := False; function Depr (Pr : Parse_Record) return Dictionary_Entry is De : Dictionary_Entry; begin -- TEXT_IO.PUT ("DEPR "); -- PARSE_RECORD_IO.PUT (PR); -- TEXT_IO.NEW_LINE; -- FIXME: duplicates (commented) code above if Pr.MNPC = Null_MNPC then return Null_Dictionary_Entry; else if Pr.D_K in General .. Local then --if PR.MNPC /= OMNPC then Dict_IO.Set_Index (Dict_File (Pr.D_K), Pr.MNPC); Dict_IO.Read (Dict_File (Pr.D_K), De); --OMNPC := PR.MNPC; --ODE := DE; --else --DE := ODE; --end if; elsif Pr.D_K = Unique then De := Uniques_De (Pr.MNPC); end if; end if; return De; end Depr; begin if Sl'Length = 0 then Diff_J := Sl_Last_Initial - Sl_Last; return; end if; -- FIXME: this code looks like it's duplicated in another file -- Bubble sort since this list should usually be very small (1-5) Hit_Loop : loop Hits := 0; -------------------------------------------------- Switch : declare function "<" (Left, Right : Quality_Record) return Boolean is begin if Left.Pofs = Right.Pofs and then Left.Pofs = Pron and then Left.Pron.Decl.Which = 1 then return (Left.Pron.Decl.Var < Right.Pron.Decl.Var); else return Inflections_Package."<"(Left, Right); end if; end "<"; function Equ (Left, Right : Quality_Record) return Boolean is begin if Left.Pofs = Right.Pofs and then Left.Pofs = Pron and then Left.Pron.Decl.Which = 1 then return (Left.Pron.Decl.Var = Right.Pron.Decl.Var); else return Inflections_Package."="(Left, Right); end if; end Equ; function Meaning (Pr : Parse_Record) return Meaning_Type is begin return Depr (Pr).Mean; end Meaning; function Compare (L : Parse_Record; R : Parse_Record) return Boolean is begin -- Maybe < = on PR.STEM - will have to make up "<" -- Actually STEM and PART -- and check that later in print return R.D_K > L.D_K or else -- Let DICT.LOC list first (R.D_K = L.D_K and then R.MNPC < L.MNPC) or else (R.D_K = L.D_K and then R.MNPC = L.MNPC and then R.IR.Qual < L.IR.Qual) or else (R.D_K = L.D_K and then R.MNPC = L.MNPC and then Equ (R.IR.Qual, L.IR.Qual) and then Meaning (R) < Meaning (L)) or else -- | is > letter (R.D_K = L.D_K and then R.MNPC = L.MNPC and then Equ (R.IR.Qual, L.IR.Qual) and then Meaning (R) = Meaning (L) and then R.IR.Ending.Size < L.IR.Ending.Size) or else (R.D_K = L.D_K and then R.MNPC = L.MNPC and then Equ (R.IR.Qual, L.IR.Qual) and then Meaning (R) = Meaning (L) and then R.IR.Ending.Size = L.IR.Ending.Size and then Inflections_Package."<"(R.IR.Qual, L.IR.Qual)); end Compare; begin -- Need to remove duplicates in ARRAY_STEMS -- This sort is very sloppy -- One problem is that it can mix up some of the order of -- PREFIX, XXX, LOC -- I ought to do this for every set of results from -- different approaches not just in one fell swoop -- at the end !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Inner_Loop : for I in Sl'First .. Sl_Last - 1 loop if Compare (Sl (I), Sl (I + 1)) then Sm := Sl (I); Sl (I) := Sl (I + 1); Sl (I + 1) := Sm; Hits := Hits + 1; end if; end loop Inner_Loop; end Switch; -------------------------------------------------- exit Hit_Loop when Hits = 0; end loop Hit_Loop; -- Fix up the Archaic/Medieval if Words_Mode (Trim_Output) then -- Check to see if we can afford to TRIM, -- if there will be something left over for I in Sl'First .. Sl_Last loop declare De : Dictionary_Entry; begin if Sl (I).D_K in General .. Local then Dict_IO.Set_Index (Dict_File (Sl (I).D_K), Sl (I).MNPC); --TEXT_IO.PUT (INTEGER'IMAGE (INTEGER (SL (I).MNPC))); Dict_IO.Read (Dict_File (Sl (I).D_K), De); --DICTIONARY_ENTRY_IO.PUT (DE); TEXT_IO.NEW_LINE; if ((Sl (I).IR.Age = X) or else (Sl (I).IR.Age > A)) and ((De.Tran.Age = X) or else (De.Tran.Age > A)) then Not_Only_Archaic := True; end if; if ((Sl (I).IR.Age = X) or else (Sl (I).IR.Age < F)) and -- Or E???? ((De.Tran.Age = X) or else (De.Tran.Age < F)) then Not_Only_Medieval := True; end if; if ((Sl (I).IR.Freq = X) or else (Sl (I).IR.Freq < C)) and -- A/X < C -- C for inflections is uncommon !!!! ((De.Tran.Freq = X) or else (De.Tran.Freq < D)) -- -- E for DICTLINE is uncommon !!!! then Not_Only_Uncommon := True; end if; if Sl (I).IR.Qual.Pofs = N and then Sl (I).IR.Qual.Noun.Decl = (9, 8) then Has_Noun_Abbreviation := True; end if; end if; end; end loop; -- We order and Trim within a subset SL, but have to correct the -- big set PA also -- Kill not ALLOWED first, then check the remaining from the top -- I am assuming there is no Trim ming of FIXES for AGE/ .. . for I in reverse Sl'First .. Sl_Last loop -- Remove not ALLOWED_STEM & null if not Allowed_Stem (Sl (I)) or (Pa (I) = Null_Parse_Record) then Sl (I .. Sl_Last - 1) := Sl (I + 1 .. Sl_Last); Sl_Last := Sl_Last - 1; Trimmed := True; elsif (Not_Only_Archaic and Words_Mdev (Omit_Archaic)) and then Sl (I).IR.Age = A then Sl (I .. Sl_Last - 1) := Sl (I + 1 .. Sl_Last); Sl_Last := Sl_Last - 1; Trimmed := True; elsif (Not_Only_Medieval and Words_Mdev (Omit_Medieval)) and then Sl (I).IR.Age >= F then Sl (I .. Sl_Last - 1) := Sl (I + 1 .. Sl_Last); Sl_Last := Sl_Last - 1; Trimmed := True; elsif (Not_Only_Uncommon and Words_Mdev (Omit_Uncommon)) and then Sl (I).IR.Freq >= C then -- Remember A < C Sl (I .. Sl_Last - 1) := Sl (I + 1 .. Sl_Last); Sl_Last := Sl_Last - 1; Trimmed := True; ----Big problem. This area has been generaing exceptions. ----At least one difficulty is that suffixes change POFS. ----So one has a N inflection (SL) but a V DE ----When the program checks for VOC, it wants a N ---- and then asks about KIND (P, N, T, .. .) ---- But the DE (v) does not have those ---- The solution would be to fix ADD SUFFIX ---- to do somethnig about -- passing the ADDON KIND ---- I do not want to face that now ---- It is likely that all this VOC/LOC is worthless anyway. --- Maybe lower FREQ in INFLECTS ---- ---- A further complication is the GANT and AO give -- different results (AO no exception) ---- That is probably because the program is in -- error and the result threrfore unspecified ---- ---- -- This is really working much too hard! -- just to kill Roman numeral for three single letters -- Also strange in that code depends on dictionary knowledge elsif Has_Noun_Abbreviation and then (All_Caps and Followed_By_Period) then if (Sl (I).IR.Qual.Pofs /= N) or ((Sl (I).IR.Qual /= (N, ((9, 8), X, X, M))) and (Trim (Sl (I).Stem)'Length = 1 and then (Sl (I).Stem (1) = 'A' or Sl (I).Stem (1) = 'C' or Sl (I).Stem (1) = 'D' or --SL (I).STEM (1) = 'K' or -- No problem here Sl (I).Stem (1) = 'L' or Sl (I).Stem (1) = 'M' -- or ))) then Sl (I .. Sl_Last - 1) := Sl (I + 1 .. Sl_Last); Sl_Last := Sl_Last - 1; Trimmed := True; end if; end if; end loop; end if; -- On TRIM Diff_J := Sl_Last_Initial - Sl_Last; end Order_Parse_Array; procedure List_Sweep (Pa : in out Parse_Array; Pa_Last : in out Integer) is -- This procedure is supposed to process the Output PARSE_ARRAY at -- PA level -- before it gets turned into SIRAA and DMNPCA in LIST_PACKAGE -- Since it does only PARSE_ARRAY it is just cheaking INFLECTIONS, not -- DICTIONARY ----------------------------------------------------------- begin -- LIST_SWEEP if Pa'Length = 0 then return; end if; Reset_Pronoun_Kind : declare De : Dictionary_Entry; begin for I in 1 .. Pa_Last loop if Pa (I).D_K = General then Dict_IO.Set_Index (Dict_File (Pa (I).D_K), Pa (I).MNPC); Dict_IO.Read (Dict_File (Pa (I).D_K), De); if De.Part.Pofs = Pron and then De.Part.Pron.Decl.Which = 1 then Pa (I).IR.Qual.Pron.Decl.Var := Pronoun_Kind_Type'Pos (De.Part.Pron.Kind); end if; end if; end loop; end Reset_Pronoun_Kind; --------------------------------------------------- -- NEED TO REMOVE DISALLOWED BEFORE DOING ANYTHING - BUT -- WITHOUT REORDERING -- The problem I seem to have to face first, if not the first problem, -- is the situation in which there are several sets of identical IRs -- with different MNPC. These may be variants with some other stem -- (e.g., K=3) not affecting the (K=1) word. Or they might be -- identical forms with different meanings (| additional meanings) -- I need to group such common inflections - and pass this on somehow Sweeping : -- To remove disallowed stems/inflections and resulting dangling fixes declare Internal_Loop_Error : exception; Fix_On : Boolean := False; Pw_On : Boolean := False; P_First : Integer := 1; P_Last : Integer := 0; Jj : Integer := 0; Diff_J : Integer := 0; subtype Xons is Part_Of_Speech_Type range Tackon .. Suffix; begin for J in reverse 1 .. Pa_Last loop -- Sweep backwards over PA if ((Pa (J).D_K in Addons .. Yyy) or (Pa (J).IR.Qual.Pofs in Xons)) and then (Pw_On) then -- first FIX/TRICK after regular Fix_On := True; Pw_On := False; P_First := J + 1; Jj := J; while Pa (Jj + 1).IR.Qual.Pofs = Pa (Jj).IR.Qual.Pofs loop P_Last := Jj + 1; Raise_Exception (Internal_Loop_Error'Identity, "Programming error; known bug, #70"); end loop; ----Order internal to this set of inflections Order_Parse_Array (Pa (P_First .. P_Last), Diff_J, Pa); Pa (P_Last - Diff_J + 1 .. Pa_Last - Diff_J) := Pa (P_Last + 1 .. Pa_Last); Pa_Last := Pa_Last - Diff_J; P_First := 1; P_Last := 0; elsif ((Pa (J).D_K in Addons .. Yyy) or (Pa (J).IR.Qual.Pofs in Xons)) and then (Fix_On) then -- another FIX null; elsif ((Pa (J).D_K in Addons .. Yyy) or (Pa (J).IR.Qual.Pofs = X)) and then -- Kills TRICKS stuff (not Pw_On) then Pa (P_Last - Diff_J + 1 .. Pa_Last - Diff_J) := Pa (P_Last + 1 .. Pa_Last); Pa_Last := Pa_Last - Diff_J; P_Last := P_Last - 1; else Pw_On := True; Fix_On := False; if P_Last <= 0 then P_Last := J; end if; if J = 1 then Order_Parse_Array (Pa (1 .. P_Last), Diff_J, Pa); Pa (P_Last - Diff_J + 1 .. Pa_Last - Diff_J) := Pa (P_Last + 1 .. Pa_Last); Pa_Last := Pa_Last - Diff_J; end if; end if; -- check PART end loop; -- loop sweep over PA end Sweeping; -- Last chance to weed out duplicates declare Pr : Parse_Record := Null_Parse_Record; Opr : Parse_Record := Pa (1); J : Integer := 2; begin Compress_Loop : loop exit Compress_Loop when J > Pa_Last; Pr := Pa (J); if Pr /= Opr then Supress_Key_Check : declare function "<=" (A, B : Parse_Record) return Boolean is use Dict_IO; begin -- !!!!!!!!!!!!!!!!!!!!!!!!!! return A.IR.Qual = B.IR.Qual and A.MNPC = B.MNPC; end "<="; begin if (Pr.D_K /= Xxx) and (Pr.D_K /= Yyy) and (Pr.D_K /= Ppp) then if Pr <= Opr then -- Get rid of duplicates, if ORDER is OK Pa (J .. Pa_Last - 1) := Pa (J + 1 .. Pa_Last); -- Shift PA down 1 Pa_Last := Pa_Last - 1; -- because found key duplicate end if; else J := J + 1; end if; end Supress_Key_Check; else J := J + 1; end if; Opr := Pr; end loop Compress_Loop; end; for I in 1 .. Pa_Last loop -- Destroy the artificial VAR for PRON 1 X if Pa (I).IR.Qual.Pofs = Pron and then Pa (I).IR.Qual.Pron.Decl.Which = 1 then Pa (I).IR.Qual.Pron.Decl.Var := 0; end if; if Pa (I).IR.Qual.Pofs = V then if Pa (I).IR.Qual.Verb.Con = (3, 4) then -- Fix V 3 4 to be 4th conjugation Pa (I).IR.Qual.Verb.Con := (4, 1); -- else -- -- Set to 0 other VAR for V -- PA (I).IR.QUAL.V.CON.VAR := 0; end if; end if; end loop; end List_Sweep; end Words_Engine.List_Sweep;
38.213953
80
0.461376
0400467ba6bfe23f485117fb9fc4c9f6f1a5b270
492
ads
Ada
testcases/driver_connections/mysql/connect.ads
jrmarino/AdaBase
660f278613773dc4007c8b3fab21bcfddc1828b3
[ "0BSD" ]
30
2016-02-21T11:09:30.000Z
2021-12-08T14:12:32.000Z
testcases/driver_connections/mysql/connect.ads
jrmarino/AdaBase
660f278613773dc4007c8b3fab21bcfddc1828b3
[ "0BSD" ]
3
2018-10-29T18:44:48.000Z
2022-03-12T23:14:20.000Z
testcases/driver_connections/mysql/connect.ads
jrmarino/AdaBase
660f278613773dc4007c8b3fab21bcfddc1828b3
[ "0BSD" ]
3
2015-04-22T12:17:27.000Z
2017-01-19T14:29:59.000Z
-- Used for all testcases for MySQL driver with AdaBase.Driver.Base.MySQL; with AdaBase.Statement.Base.MySQL; package Connect is -- All specific drivers renamed to "Database_Driver" subtype Database_Driver is AdaBase.Driver.Base.MySQL.MySQL_Driver; subtype Stmt_Type is AdaBase.Statement.Base.MySQL.MySQL_statement; subtype Stmt_Type_access is AdaBase.Statement.Base.MySQL.MySQL_statement_access; DR : Database_Driver; procedure connect_database; end Connect;
25.894737
69
0.784553
13ebed0287336feda4e9467cf13fbb3aa6bf8c0a
209
adb
Ada
gyak/gyak1-2/factorial.adb
balintsoos/LearnAda
9d2fc76209f6e15b4fa91b4b39107ae6cc7e7114
[ "MIT" ]
null
null
null
gyak/gyak1-2/factorial.adb
balintsoos/LearnAda
9d2fc76209f6e15b4fa91b4b39107ae6cc7e7114
[ "MIT" ]
null
null
null
gyak/gyak1-2/factorial.adb
balintsoos/LearnAda
9d2fc76209f6e15b4fa91b4b39107ae6cc7e7114
[ "MIT" ]
1
2021-07-16T16:15:11.000Z
2021-07-16T16:15:11.000Z
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; with Ada.Text_IO; use Ada.Text_IO; with Mat; -- use Mat; procedure factorial is N : Natural; begin Get( N ); Put( Mat.factorial(N) ); end factorial;
17.416667
27
0.708134
04487d42631016160ae2295cc12a3bb5877893a0
2,769
ads
Ada
Validation/pyFrame3DD-master/gcc-master/gcc/ada/exp_ch2.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/exp_ch2.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/exp_ch2.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- E X P _ C H 2 -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-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. 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. -- -- -- ------------------------------------------------------------------------------ -- Expand routines for chapter 2 constructs with Types; use Types; package Exp_Ch2 is procedure Expand_N_Expanded_Name (N : Node_Id); procedure Expand_N_Identifier (N : Node_Id); procedure Expand_N_Real_Literal (N : Node_Id); function Param_Entity (N : Node_Id) return Entity_Id; -- Given an expression N, determines if the expression is a reference -- to a formal (of a subprogram or entry), and if so returns the Id -- of the corresponding formal entity, otherwise returns Empty. The -- reason that this is in Exp_Ch2 is that it has to deal with the case -- where the reference is to an entry formal, and has been expanded -- already. Since Exp_Ch2 is in charge of the expansion, it is best -- suited to knowing how to detect this case. Also handles the case -- of references to renamings of formals. end Exp_Ch2;
60.195652
78
0.47779
041bbb626a908614324fd9c469a0d15ffea4b071
21,219
ads
Ada
SVD2ada/svd/stm32_svd-exti.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
SVD2ada/svd/stm32_svd-exti.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
SVD2ada/svd/stm32_svd-exti.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
pragma Style_Checks (Off); -- This spec has been automatically generated from STM32F3x4.svd pragma Restrictions (No_Elaboration_Code); with HAL; with System; package STM32_SVD.EXTI is pragma Preelaborate; --------------- -- Registers -- --------------- -- IMR1_MR array type IMR1_MR_Field_Array is array (0 .. 17) of Boolean with Component_Size => 1, Size => 18; -- Type definition for IMR1_MR type IMR1_MR_Field (As_Array : Boolean := False) is record case As_Array is when False => -- MR as a value Val : HAL.UInt18; when True => -- MR as an array Arr : IMR1_MR_Field_Array; end case; end record with Unchecked_Union, Size => 18; for IMR1_MR_Field use record Val at 0 range 0 .. 17; Arr at 0 range 0 .. 17; end record; -- IMR1_MR array type IMR1_MR_Field_Array_1 is array (19 .. 20) of Boolean with Component_Size => 1, Size => 2; -- Type definition for IMR1_MR type IMR1_MR_Field_1 (As_Array : Boolean := False) is record case As_Array is when False => -- MR as a value Val : HAL.UInt2; when True => -- MR as an array Arr : IMR1_MR_Field_Array_1; end case; end record with Unchecked_Union, Size => 2; for IMR1_MR_Field_1 use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- IMR1_MR array type IMR1_MR_Field_Array_2 is array (22 .. 23) of Boolean with Component_Size => 1, Size => 2; -- Type definition for IMR1_MR type IMR1_MR_Field_2 (As_Array : Boolean := False) is record case As_Array is when False => -- MR as a value Val : HAL.UInt2; when True => -- MR as an array Arr : IMR1_MR_Field_Array_2; end case; end record with Unchecked_Union, Size => 2; for IMR1_MR_Field_2 use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- Interrupt mask register type IMR1_Register is record -- Interrupt Mask on line 0 MR : IMR1_MR_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_18_18 : HAL.Bit := 16#0#; -- Interrupt Mask on line 19 MR_1 : IMR1_MR_Field_1 := (As_Array => False, Val => 16#0#); -- unspecified Reserved_21_21 : HAL.Bit := 16#0#; -- Interrupt Mask on line 22 MR_2 : IMR1_MR_Field_2 := (As_Array => False, Val => 16#0#); -- unspecified Reserved_24_24 : HAL.Bit := 16#1#; -- Interrupt Mask on line 25 MR25 : Boolean := True; -- unspecified Reserved_26_29 : HAL.UInt4 := 16#7#; -- Interrupt Mask on line 30 MR30 : Boolean := False; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IMR1_Register use record MR at 0 range 0 .. 17; Reserved_18_18 at 0 range 18 .. 18; MR_1 at 0 range 19 .. 20; Reserved_21_21 at 0 range 21 .. 21; MR_2 at 0 range 22 .. 23; Reserved_24_24 at 0 range 24 .. 24; MR25 at 0 range 25 .. 25; Reserved_26_29 at 0 range 26 .. 29; MR30 at 0 range 30 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; -- EMR1_MR array type EMR1_MR_Field_Array is array (0 .. 17) of Boolean with Component_Size => 1, Size => 18; -- Type definition for EMR1_MR type EMR1_MR_Field (As_Array : Boolean := False) is record case As_Array is when False => -- MR as a value Val : HAL.UInt18; when True => -- MR as an array Arr : EMR1_MR_Field_Array; end case; end record with Unchecked_Union, Size => 18; for EMR1_MR_Field use record Val at 0 range 0 .. 17; Arr at 0 range 0 .. 17; end record; -- EMR1_MR array type EMR1_MR_Field_Array_1 is array (19 .. 20) of Boolean with Component_Size => 1, Size => 2; -- Type definition for EMR1_MR type EMR1_MR_Field_1 (As_Array : Boolean := False) is record case As_Array is when False => -- MR as a value Val : HAL.UInt2; when True => -- MR as an array Arr : EMR1_MR_Field_Array_1; end case; end record with Unchecked_Union, Size => 2; for EMR1_MR_Field_1 use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- EMR1_MR array type EMR1_MR_Field_Array_2 is array (22 .. 23) of Boolean with Component_Size => 1, Size => 2; -- Type definition for EMR1_MR type EMR1_MR_Field_2 (As_Array : Boolean := False) is record case As_Array is when False => -- MR as a value Val : HAL.UInt2; when True => -- MR as an array Arr : EMR1_MR_Field_Array_2; end case; end record with Unchecked_Union, Size => 2; for EMR1_MR_Field_2 use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- Event mask register type EMR1_Register is record -- Event Mask on line 0 MR : EMR1_MR_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_18_18 : HAL.Bit := 16#0#; -- Event Mask on line 19 MR_1 : EMR1_MR_Field_1 := (As_Array => False, Val => 16#0#); -- unspecified Reserved_21_21 : HAL.Bit := 16#0#; -- Event Mask on line 22 MR_2 : EMR1_MR_Field_2 := (As_Array => False, Val => 16#0#); -- unspecified Reserved_24_24 : HAL.Bit := 16#0#; -- Event Mask on line 25 MR25 : Boolean := False; -- unspecified Reserved_26_29 : HAL.UInt4 := 16#0#; -- Event Mask on line 30 MR30 : Boolean := False; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for EMR1_Register use record MR at 0 range 0 .. 17; Reserved_18_18 at 0 range 18 .. 18; MR_1 at 0 range 19 .. 20; Reserved_21_21 at 0 range 21 .. 21; MR_2 at 0 range 22 .. 23; Reserved_24_24 at 0 range 24 .. 24; MR25 at 0 range 25 .. 25; Reserved_26_29 at 0 range 26 .. 29; MR30 at 0 range 30 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; -- RTSR1_TR array type RTSR1_TR_Field_Array is array (0 .. 17) of Boolean with Component_Size => 1, Size => 18; -- Type definition for RTSR1_TR type RTSR1_TR_Field (As_Array : Boolean := False) is record case As_Array is when False => -- TR as a value Val : HAL.UInt18; when True => -- TR as an array Arr : RTSR1_TR_Field_Array; end case; end record with Unchecked_Union, Size => 18; for RTSR1_TR_Field use record Val at 0 range 0 .. 17; Arr at 0 range 0 .. 17; end record; -- RTSR1_TR array type RTSR1_TR_Field_Array_1 is array (19 .. 20) of Boolean with Component_Size => 1, Size => 2; -- Type definition for RTSR1_TR type RTSR1_TR_Field_1 (As_Array : Boolean := False) is record case As_Array is when False => -- TR as a value Val : HAL.UInt2; when True => -- TR as an array Arr : RTSR1_TR_Field_Array_1; end case; end record with Unchecked_Union, Size => 2; for RTSR1_TR_Field_1 use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- Rising Trigger selection register type RTSR1_Register is record -- Rising trigger event configuration of line 0 TR : RTSR1_TR_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_18_18 : HAL.Bit := 16#0#; -- Rising trigger event configuration of line 19 TR_1 : RTSR1_TR_Field_1 := (As_Array => False, Val => 16#0#); -- unspecified Reserved_21_21 : HAL.Bit := 16#0#; -- Rising trigger event configuration of line 22 TR22 : Boolean := False; -- unspecified Reserved_23_29 : HAL.UInt7 := 16#0#; -- Rising trigger event configuration of line 30 TR30 : Boolean := False; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for RTSR1_Register use record TR at 0 range 0 .. 17; Reserved_18_18 at 0 range 18 .. 18; TR_1 at 0 range 19 .. 20; Reserved_21_21 at 0 range 21 .. 21; TR22 at 0 range 22 .. 22; Reserved_23_29 at 0 range 23 .. 29; TR30 at 0 range 30 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; -- FTSR1_TR array type FTSR1_TR_Field_Array is array (0 .. 17) of Boolean with Component_Size => 1, Size => 18; -- Type definition for FTSR1_TR type FTSR1_TR_Field (As_Array : Boolean := False) is record case As_Array is when False => -- TR as a value Val : HAL.UInt18; when True => -- TR as an array Arr : FTSR1_TR_Field_Array; end case; end record with Unchecked_Union, Size => 18; for FTSR1_TR_Field use record Val at 0 range 0 .. 17; Arr at 0 range 0 .. 17; end record; -- FTSR1_TR array type FTSR1_TR_Field_Array_1 is array (19 .. 20) of Boolean with Component_Size => 1, Size => 2; -- Type definition for FTSR1_TR type FTSR1_TR_Field_1 (As_Array : Boolean := False) is record case As_Array is when False => -- TR as a value Val : HAL.UInt2; when True => -- TR as an array Arr : FTSR1_TR_Field_Array_1; end case; end record with Unchecked_Union, Size => 2; for FTSR1_TR_Field_1 use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- Falling Trigger selection register type FTSR1_Register is record -- Falling trigger event configuration of line 0 TR : FTSR1_TR_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_18_18 : HAL.Bit := 16#0#; -- Falling trigger event configuration of line 19 TR_1 : FTSR1_TR_Field_1 := (As_Array => False, Val => 16#0#); -- unspecified Reserved_21_21 : HAL.Bit := 16#0#; -- Falling trigger event configuration of line 22 TR22 : Boolean := False; -- unspecified Reserved_23_29 : HAL.UInt7 := 16#0#; -- Falling trigger event configuration of line 30. TR30 : Boolean := False; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for FTSR1_Register use record TR at 0 range 0 .. 17; Reserved_18_18 at 0 range 18 .. 18; TR_1 at 0 range 19 .. 20; Reserved_21_21 at 0 range 21 .. 21; TR22 at 0 range 22 .. 22; Reserved_23_29 at 0 range 23 .. 29; TR30 at 0 range 30 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; -- SWIER1_SWIER array type SWIER1_SWIER_Field_Array is array (0 .. 17) of Boolean with Component_Size => 1, Size => 18; -- Type definition for SWIER1_SWIER type SWIER1_SWIER_Field (As_Array : Boolean := False) is record case As_Array is when False => -- SWIER as a value Val : HAL.UInt18; when True => -- SWIER as an array Arr : SWIER1_SWIER_Field_Array; end case; end record with Unchecked_Union, Size => 18; for SWIER1_SWIER_Field use record Val at 0 range 0 .. 17; Arr at 0 range 0 .. 17; end record; -- SWIER1_SWIER array type SWIER1_SWIER_Field_Array_1 is array (19 .. 20) of Boolean with Component_Size => 1, Size => 2; -- Type definition for SWIER1_SWIER type SWIER1_SWIER_Field_1 (As_Array : Boolean := False) is record case As_Array is when False => -- SWIER as a value Val : HAL.UInt2; when True => -- SWIER as an array Arr : SWIER1_SWIER_Field_Array_1; end case; end record with Unchecked_Union, Size => 2; for SWIER1_SWIER_Field_1 use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- Software interrupt event register type SWIER1_Register is record -- Software Interrupt on line 0 SWIER : SWIER1_SWIER_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_18_18 : HAL.Bit := 16#0#; -- Software Interrupt on line 19 SWIER_1 : SWIER1_SWIER_Field_1 := (As_Array => False, Val => 16#0#); -- unspecified Reserved_21_21 : HAL.Bit := 16#0#; -- Software Interrupt on line 22 SWIER22 : Boolean := False; -- unspecified Reserved_23_29 : HAL.UInt7 := 16#0#; -- Software Interrupt on line 309 SWIER30 : Boolean := False; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SWIER1_Register use record SWIER at 0 range 0 .. 17; Reserved_18_18 at 0 range 18 .. 18; SWIER_1 at 0 range 19 .. 20; Reserved_21_21 at 0 range 21 .. 21; SWIER22 at 0 range 22 .. 22; Reserved_23_29 at 0 range 23 .. 29; SWIER30 at 0 range 30 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; -- PR1_PR array type PR1_PR_Field_Array is array (0 .. 17) of Boolean with Component_Size => 1, Size => 18; -- Type definition for PR1_PR type PR1_PR_Field (As_Array : Boolean := False) is record case As_Array is when False => -- PR as a value Val : HAL.UInt18; when True => -- PR as an array Arr : PR1_PR_Field_Array; end case; end record with Unchecked_Union, Size => 18; for PR1_PR_Field use record Val at 0 range 0 .. 17; Arr at 0 range 0 .. 17; end record; -- PR1_PR array type PR1_PR_Field_Array_1 is array (19 .. 20) of Boolean with Component_Size => 1, Size => 2; -- Type definition for PR1_PR type PR1_PR_Field_1 (As_Array : Boolean := False) is record case As_Array is when False => -- PR as a value Val : HAL.UInt2; when True => -- PR as an array Arr : PR1_PR_Field_Array_1; end case; end record with Unchecked_Union, Size => 2; for PR1_PR_Field_1 use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- Pending register type PR1_Register is record -- Pending bit 0 PR : PR1_PR_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_18_18 : HAL.Bit := 16#0#; -- Pending bit 19 PR_1 : PR1_PR_Field_1 := (As_Array => False, Val => 16#0#); -- unspecified Reserved_21_21 : HAL.Bit := 16#0#; -- Pending bit 22 PR22 : Boolean := False; -- unspecified Reserved_23_29 : HAL.UInt7 := 16#0#; -- Pending bit 30 PR30 : Boolean := False; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PR1_Register use record PR at 0 range 0 .. 17; Reserved_18_18 at 0 range 18 .. 18; PR_1 at 0 range 19 .. 20; Reserved_21_21 at 0 range 21 .. 21; PR22 at 0 range 22 .. 22; Reserved_23_29 at 0 range 23 .. 29; PR30 at 0 range 30 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; -- Interrupt mask register type IMR2_Register is record -- Interrupt Mask on external/internal line 32 MR32 : Boolean := False; -- unspecified Reserved_1_31 : HAL.UInt31 := 16#7FFFFFFE#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IMR2_Register use record MR32 at 0 range 0 .. 0; Reserved_1_31 at 0 range 1 .. 31; end record; -- Event mask register type EMR2_Register is record -- Event mask on external/internal line 32 MR32 : Boolean := False; -- unspecified Reserved_1_31 : HAL.UInt31 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for EMR2_Register use record MR32 at 0 range 0 .. 0; Reserved_1_31 at 0 range 1 .. 31; end record; -- Rising Trigger selection register type RTSR2_Register is record -- Rising trigger event configuration bit of line 32 TR32 : Boolean := False; -- unspecified Reserved_1_31 : HAL.UInt31 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for RTSR2_Register use record TR32 at 0 range 0 .. 0; Reserved_1_31 at 0 range 1 .. 31; end record; -- Falling Trigger selection register type FTSR2_Register is record -- Falling trigger event configuration bit of line 32 TR32 : Boolean := False; -- unspecified Reserved_1_31 : HAL.UInt31 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for FTSR2_Register use record TR32 at 0 range 0 .. 0; Reserved_1_31 at 0 range 1 .. 31; end record; -- Software interrupt event register type SWIER2_Register is record -- Software interrupt on line 32 SWIER32 : Boolean := False; -- unspecified Reserved_1_31 : HAL.UInt31 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SWIER2_Register use record SWIER32 at 0 range 0 .. 0; Reserved_1_31 at 0 range 1 .. 31; end record; -- Pending register type PR2_Register is record -- Pending bit on line 32 PR32 : Boolean := False; -- unspecified Reserved_1_31 : HAL.UInt31 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PR2_Register use record PR32 at 0 range 0 .. 0; Reserved_1_31 at 0 range 1 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- External interrupt/event controller type EXTI_Peripheral is record -- Interrupt mask register IMR1 : aliased IMR1_Register; -- Event mask register EMR1 : aliased EMR1_Register; -- Rising Trigger selection register RTSR1 : aliased RTSR1_Register; -- Falling Trigger selection register FTSR1 : aliased FTSR1_Register; -- Software interrupt event register SWIER1 : aliased SWIER1_Register; -- Pending register PR1 : aliased PR1_Register; -- Interrupt mask register IMR2 : aliased IMR2_Register; -- Event mask register EMR2 : aliased EMR2_Register; -- Rising Trigger selection register RTSR2 : aliased RTSR2_Register; -- Falling Trigger selection register FTSR2 : aliased FTSR2_Register; -- Software interrupt event register SWIER2 : aliased SWIER2_Register; -- Pending register PR2 : aliased PR2_Register; end record with Volatile; for EXTI_Peripheral use record IMR1 at 16#0# range 0 .. 31; EMR1 at 16#4# range 0 .. 31; RTSR1 at 16#8# range 0 .. 31; FTSR1 at 16#C# range 0 .. 31; SWIER1 at 16#10# range 0 .. 31; PR1 at 16#14# range 0 .. 31; IMR2 at 16#18# range 0 .. 31; EMR2 at 16#1C# range 0 .. 31; RTSR2 at 16#20# range 0 .. 31; FTSR2 at 16#24# range 0 .. 31; SWIER2 at 16#28# range 0 .. 31; PR2 at 16#2C# range 0 .. 31; end record; -- External interrupt/event controller EXTI_Periph : aliased EXTI_Peripheral with Import, Address => EXTI_Base; end STM32_SVD.EXTI;
29.970339
77
0.569113
221f28bd60f8d3a819f65192b0fafb95473513fb
1,392
ads
Ada
src/spi_master_itsybitsy.ads
hgrodriguez/spi_two_devices
868ac3e84c80d49dd815ba8e574cba732787a1d4
[ "BSD-3-Clause" ]
null
null
null
src/spi_master_itsybitsy.ads
hgrodriguez/spi_two_devices
868ac3e84c80d49dd815ba8e574cba732787a1d4
[ "BSD-3-Clause" ]
null
null
null
src/spi_master_itsybitsy.ads
hgrodriguez/spi_two_devices
868ac3e84c80d49dd815ba8e574cba732787a1d4
[ "BSD-3-Clause" ]
null
null
null
--=========================================================================== -- -- This package is the master configuration for the ItsyBitsy -- use cases: -- 3: Master ItsyBitsy -> Slave Pico -- 4: Master ItsyBitsy -> Slave ItsyBitsy -- --=========================================================================== -- -- Copyright 2022 (C) Holger Rodriguez -- -- SPDX-License-Identifier: BSD-3-Clause -- with HAL.SPI; with RP.Device; with RP.GPIO; with RP.SPI; with ItsyBitsy; package SPI_Master_ItsyBitsy is ----------------------------------------------------------------------- -- Master section SPI : RP.SPI.SPI_Port renames RP.Device.SPI_1; SCK : RP.GPIO.GPIO_Point renames ItsyBitsy.GP26; NSS : RP.GPIO.GPIO_Point renames ItsyBitsy.GP29; MOSI : RP.GPIO.GPIO_Point renames ItsyBitsy.GP27; MISO : RP.GPIO.GPIO_Point renames ItsyBitsy.GP28; ----------------------------------------------------------------------- -- Configuration for the master part for the ItsyBitsy Config : constant RP.SPI.SPI_Configuration := (Role => RP.SPI.Master, Baud => 10_000_000, Data_Size => HAL.SPI.Data_Size_16b, others => <>); ----------------------------------------------------------------------- -- Initializes the ItsyBitsy as master procedure Initialize; end SPI_Master_ItsyBitsy;
30.26087
77
0.487787
048390e9b5b378b82d8332e780b1d3e4e45fdbc4
127
adb
Ada
tests/syntax/bad/testfile-return-3.adb
xuedong/mini-ada
59a8b966cf50ba22a3b5a7cb449f671e4da32e44
[ "MIT" ]
null
null
null
tests/syntax/bad/testfile-return-3.adb
xuedong/mini-ada
59a8b966cf50ba22a3b5a7cb449f671e4da32e44
[ "MIT" ]
1
2019-03-10T19:13:21.000Z
2019-03-10T19:19:46.000Z
tests/syntax/bad/testfile-return-3.adb
xuedong/mini-ada
59a8b966cf50ba22a3b5a7cb449f671e4da32e44
[ "MIT" ]
null
null
null
with Ada.Text_IO; use Ada.Text_IO; procedure Test is begin if 0=1 then Q(0); else Q(1); elsif 1=2 then Q(2); end if; end;
18.142857
60
0.661417
133dd736d9bb352f671c3041792592635b051aeb
9,636
adb
Ada
source/textio/machine-pc-freebsd/s-ntitco.adb
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
33
2015-04-04T09:19:36.000Z
2021-11-10T05:33:34.000Z
source/textio/machine-pc-freebsd/s-ntitco.adb
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
8
2017-11-14T13:05:07.000Z
2018-08-09T15:28:49.000Z
source/textio/machine-pc-linux-gnu/s-ntitco.adb
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
9
2015-02-03T17:09:53.000Z
2021-11-12T01:16:05.000Z
-- reference: -- http://www.mudpedia.org/mediawiki/index.php/Xterm_256_colors with System.Address_To_Named_Access_Conversions; with System.Formatting; with System.Long_Long_Integer_Types; with System.Once; with C.stdlib; package body System.Native_Text_IO.Terminal_Colors is use type C.char_array; use type C.char_ptr; use type C.signed_int; use type C.size_t; subtype Word_Unsigned is Long_Long_Integer_Types.Word_Unsigned; function strlen (s : not null access constant C.char) return C.size_t with Import, Convention => Intrinsic, External_Name => "__builtin_strlen"; package char_ptr_Conv is new Address_To_Named_Access_Conversions (C.char, C.char_ptr); TERM_Variable : constant C.char_array (0 .. 4) := "TERM" & C.char'Val (0); xterm_256color : constant String (1 .. 14) := "xterm-256color"; Support_256_Color_Flag : aliased Once.Flag := 0; Support_256_Color : Boolean; procedure Support_256_Color_Init; procedure Support_256_Color_Init is TERM : C.char_ptr; begin TERM := C.stdlib.getenv (TERM_Variable (0)'Access); if TERM /= null and then strlen (TERM) = xterm_256color'Length then declare TERM_All : String (1 .. xterm_256color'Length); for TERM_All'Address use char_ptr_Conv.To_Address (TERM); begin Support_256_Color := TERM_All = xterm_256color; end; else Support_256_Color := False; end if; end Support_256_Color_Init; procedure Initialize; procedure Initialize is begin Once.Initialize ( Support_256_Color_Flag'Access, Support_256_Color_Init'Access); end Initialize; function RGB_To_256_Color (Item : Ada.Colors.RGB) return Color; function RGB_To_256_Color (Item : Ada.Colors.RGB) return Color is subtype B is Ada.Colors.Brightness'Base; function Color_Scale (Item : B) return Color; function Color_Scale (Item : B) return Color is begin if Item < (0.0 + 16#5F.0#) / 2.0 / 255.0 then return 0; elsif Item < (16#5F.0# + 16#87.0#) / 2.0 / 255.0 then return 1; elsif Item < (16#87.0# + 16#AF.0#) / 2.0 / 255.0 then return 2; elsif Item < (16#AF.0# + 16#D7.0#) / 2.0 / 255.0 then return 3; elsif Item < (16#D7.0# + 16#FF.0#) / 2.0 / 255.0 then return 4; else return 5; end if; end Color_Scale; begin return 16 + 36 * Color_Scale (Item.Red) + 6 * Color_Scale (Item.Green) + Color_Scale (Item.Blue); end RGB_To_256_Color; function Brightness_To_Grayscale_256_Color (Item : Ada.Colors.Brightness) return Color; function Brightness_To_Grayscale_256_Color (Item : Ada.Colors.Brightness) return Color is subtype B is Ada.Colors.Brightness'Base; Grayscale_Index : constant Integer := (Integer (B'Floor (Item * B'Pred (250.0))) + 5) / 10 - 1 + 232; begin if Grayscale_Index < 232 then return 16; -- 16#00# elsif Grayscale_Index <= 255 then -- in 232 .. 255 return Color (Grayscale_Index); else return 16 + 6#555#; -- 16#FF# end if; end Brightness_To_Grayscale_256_Color; function RGB_To_System_Color (Item : Ada.Colors.RGB) return Color; function RGB_To_System_Color (Item : Ada.Colors.RGB) return Color is subtype B is Ada.Colors.Brightness'Base; Result : Color; begin if Item.Red in 0.25 .. B'Pred (0.675) and then Item.Green in 0.25 .. B'Pred (0.675) and then Item.Blue in 0.25 .. B'Pred (0.675) then -- Dark_Gray = (16#80#, 16#80#, 16#80#) Result := 8; elsif Item.Red >= 0.875 or else Item.Green >= 0.875 or else Item.Blue >= 0.875 then -- bright colors Result := 8; if Item.Red >= 0.875 then Result := Result or 1; end if; if Item.Green >= 0.875 then Result := Result or 2; end if; if Item.Blue >= 0.875 then Result := Result or 4; end if; else -- dark colors Result := 0; if Item.Red >= 0.375 then Result := Result or 1; end if; if Item.Green >= 0.375 then Result := Result or 2; end if; if Item.Blue >= 0.375 then Result := Result or 4; end if; end if; return Result; end RGB_To_System_Color; function Brightness_To_Grayscale_System_Color (Item : Ada.Colors.Brightness) return Color; function Brightness_To_Grayscale_System_Color (Item : Ada.Colors.Brightness) return Color is begin -- [0.000 .. 0.250) => 0 -- [0.250 .. 0.625) => 16#80# = 8 -- [0.625 .. 0.875) => 16#C0# = 7 -- [0.875 .. 1.000] => 16#FF# = 15 return RGB_To_System_Color ((Red => Item, Green => Item, Blue => Item)); end Brightness_To_Grayscale_System_Color; -- implementation function RGB_To_Color (Item : Ada.Colors.RGB) return Color is begin Initialize; if Support_256_Color then return RGB_To_256_Color (Item); else return RGB_To_System_Color (Item); end if; end RGB_To_Color; function Brightness_To_Grayscale_Color (Item : Ada.Colors.Brightness) return Color is begin Initialize; if Support_256_Color then return Brightness_To_Grayscale_256_Color (Item); else return Brightness_To_Grayscale_System_Color (Item); end if; end Brightness_To_Grayscale_Color; procedure Set ( Handle : Handle_Type; Reset : Boolean; Bold_Changing : Boolean; Bold : Boolean; Underline_Changing : Boolean; Underline : Boolean; Blink_Changing : Boolean; Blink : Boolean; Reversed_Changing : Boolean; Reversed : Boolean; Foreground_Changing : Boolean; Foreground : Color; Background_Changing : Boolean; Background : Color) is Seq : String (1 .. 256); Last : Natural; Error : Boolean; begin Seq (1) := Character'Val (16#1B#); Seq (2) := '['; Last := 2; -- changing if Reset then Last := Last + 1; Seq (Last) := '0'; end if; if Bold_Changing and then Bold then if Last > 2 then Last := Last + 1; Seq (Last) := ';'; end if; Last := Last + 1; Seq (Last) := '1'; end if; if Underline_Changing and then Underline then if Last > 2 then Last := Last + 1; Seq (Last) := ';'; end if; Last := Last + 1; Seq (Last) := '4'; end if; if Blink_Changing and then Blink then if Last > 2 then Last := Last + 1; Seq (Last) := ';'; end if; Last := Last + 1; Seq (Last) := '5'; end if; if Reversed_Changing and then Reversed then if Last > 2 then Last := Last + 1; Seq (Last) := ';'; end if; Last := Last + 1; Seq (Last) := '7'; end if; if Foreground_Changing then if Last > 2 then Last := Last + 1; Seq (Last) := ';'; end if; declare Color_Index : Word_Unsigned := Word_Unsigned (Foreground); begin if Foreground < 16#10# then -- system color if (Foreground and 8) = 0 then Last := Last + 1; Seq (Last) := '3'; else Last := Last + 1; Seq (Last) := '9'; Color_Index := Word_Unsigned (Foreground and 7); end if; else -- 256 color Seq (Last + 1 .. Last + 5) := "38;5;"; Last := Last + 5; end if; Formatting.Image ( Color_Index, Seq (Last + 1 .. Seq'Last), Last, Error => Error); end; end if; if Background_Changing then if Last > 2 then Last := Last + 1; Seq (Last) := ';'; end if; declare Color_Index : Word_Unsigned := Word_Unsigned (Background); begin if Background < 16#10# then -- system color if (Background and 8) = 0 then Last := Last + 1; Seq (Last) := '4'; else Last := Last + 1; Seq (Last) := '1'; Last := Last + 1; Seq (Last) := '0'; Color_Index := Word_Unsigned (Background and 7); end if; else -- 256 color Seq (Last + 1 .. Last + 5) := "48;5;"; Last := Last + 5; end if; Formatting.Image ( Color_Index, Seq (Last + 1 .. Seq'Last), Last, Error => Error); end; end if; -- setting if Last > 2 then Last := Last + 1; Seq (Last) := 'm'; Write_Just (Handle, Seq (1 .. Last)); end if; end Set; procedure Reset ( Handle : Handle_Type) is Seq : constant String (1 .. 4) := (Character'Val (16#1b#), '[', '0', 'm'); begin Write_Just (Handle, Seq); end Reset; end System.Native_Text_IO.Terminal_Colors;
30.493671
79
0.532897
579e3545213a1070e0a45e99da284c77f4ecc7a3
5,475
ads
Ada
awa/plugins/awa-storages/src/awa-storages.ads
twdroeger/ada-awa
77b824773747aecb912c37b1b7b59ea414679b80
[ "Apache-2.0" ]
null
null
null
awa/plugins/awa-storages/src/awa-storages.ads
twdroeger/ada-awa
77b824773747aecb912c37b1b7b59ea414679b80
[ "Apache-2.0" ]
null
null
null
awa/plugins/awa-storages/src/awa-storages.ads
twdroeger/ada-awa
77b824773747aecb912c37b1b7b59ea414679b80
[ "Apache-2.0" ]
null
null
null
----------------------------------------------------------------------- -- awa-storages -- Storage module -- Copyright (C) 2012, 2015, 2016, 2018 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.Strings.Unbounded; with Ada.Finalization; with ADO; -- = Storages Module = -- The `Storages` module provides a set of storage services allowing an application -- to store data files, documents, images in a persistent area. The persistent store can -- be on a file system, in the database or provided by a remote service such as -- Amazon Simple Storage Service. -- -- == Creating a storage == -- A data in the storage is represented by a `Storage_Ref` instance. The data itself -- can be physically stored in a file system (`FILE` mode), in the database (`DATABASE` -- mode) or on a remote server (`URL` mode). To put a file in the storage space, first create -- the storage object instance: -- -- Data : AWA.Storages.Models.Storage_Ref; -- -- Then setup the storage mode that you want. The storage service uses this information -- to save the data in a file, in the database or in a remote service (in the future). -- To save a file in the store, we can use the `Save` operation of the storage service. -- It will read the file and put in in the corresponding persistent store (the database -- in this example). -- -- Service.Save (Into => Data, Path => Path_To_The_File, -- Storage => AWA.Storages.Models.DATABASE); -- -- Upon successful completion, the storage instance `Data` will be allocated a unique -- identifier that can be retrieved by `Get_Id` or `Get_Key`. -- -- == Getting the data == -- Several operations are defined to retrieve the data. Each of them has been designed -- to optimize the retrieval and -- -- * The data can be retrieved in a local file. -- This mode is useful if an external program must be launched and be able to read -- the file. If the storage mode of the data is `FILE`, the path of the file on -- the storage file system is used. For other storage modes, the file is saved -- in a temporary file. In that case the `Store_Local` database table is used -- to track such locally saved data. -- -- * The data can be returned as a stream. -- When the application has to read the data, opening a read stream connection is -- the most efficient mechanism. -- -- == Local file == -- To access the data by using a local file, we must define a local storage reference: -- -- Data : AWA.Storages.Models.Store_Local_Ref; -- -- and use the `Load` operation with the storage identifier. When loading locally we -- also indicate whether the file will be read or written. A file that is in `READ` mode -- can be shared by several tasks or processes. A file that is in `WRITE` mode will have -- a specific copy for the caller. An optional expiration parameter indicate when the -- local file representation can expire. -- -- Service.Load (From => Id, Into => Data, Mode => READ, Expire => ONE_DAY); -- -- Once the load operation succeeded, the data is stored on the file system and -- the local path is obtained by using the `Get_Path` operation: -- -- Path : constant String := Data.Get_Path; -- -- @include awa-storages-modules.ads -- @include awa-storages-services.ads -- -- == Ada Beans == -- @include-bean storages.xml -- @include-bean storage-list.xml -- @include-bean folder-queries.xml -- @include-bean storage-queries.xml -- -- @include awa-storages-servlets.ads -- -- == Queries == -- @include-query storage-list.xml -- @include-query folder-queries.xml -- @include-query storage-queries.xml -- -- == Data model == -- [images/awa_storages_model.png] -- package AWA.Storages is type Storage_Type is (DATABASE, FILE, URL, CACHE, TMP); type Storage_File (Storage : Storage_Type) is tagged limited private; -- Get the path to get access to the file. function Get_Path (File : in Storage_File) return String; -- Set the file path for the FILE, URL, CACHE or TMP storage. procedure Set (File : in out Storage_File; Path : in String); -- Set the file database storage identifier. procedure Set (File : in out Storage_File; Workspace : in ADO.Identifier; Store : in ADO.Identifier); private type Storage_File (Storage : Storage_Type) is limited new Ada.Finalization.Limited_Controlled with record case Storage is when DATABASE => Workspace : ADO.Identifier; Store : ADO.Identifier; when FILE | URL | CACHE | TMP => Path : Ada.Strings.Unbounded.Unbounded_String; end case; end record; overriding procedure Finalize (File : in out Storage_File); end AWA.Storages;
39.673913
95
0.671233
2e916893e4bb219f7ea7180a48f63b97cf9c66d4
2,739
ads
Ada
orka/src/orka/interface/orka-loops.ads
onox/orka
9edf99559a16ffa96dfdb208322f4d18efbcbac6
[ "Apache-2.0" ]
52
2016-07-30T23:00:28.000Z
2022-02-05T11:54:55.000Z
orka/src/orka/interface/orka-loops.ads
onox/orka
9edf99559a16ffa96dfdb208322f4d18efbcbac6
[ "Apache-2.0" ]
79
2016-08-01T18:36:48.000Z
2022-02-27T12:14:20.000Z
orka/src/orka/interface/orka-loops.ads
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 Ada.Containers.Ordered_Sets; with Ada.Real_Time; with Orka.Behaviors; with Orka.Cameras; with Orka.Jobs.System; use Ada.Real_Time; generic Time_Step, Frame_Limit : Time_Span; Camera : Cameras.Camera_Ptr; with package Job_Manager is new Orka.Jobs.System (<>); Maximum_Frame_Time : Time_Span := Milliseconds (1000); -- Maximum allowed duration of a frame. The simulation loop will -- exit by raising an exception if this time is exceeded package Orka.Loops is protected Handler is procedure Stop; procedure Set_Frame_Limit (Value : Time_Span); function Frame_Limit return Time_Span; procedure Enable_Limit (Enable : Boolean); function Limit_Enabled return Boolean; function Should_Stop return Boolean; private Limit : Time_Span := Orka.Loops.Frame_Limit; Stop_Flag : Boolean := False; Limit_Flag : Boolean := False; end Handler; use type Behaviors.Behavior_Ptr; use type Behaviors.Behavior_Array_Access; function "<" (Left, Right : Behaviors.Behavior_Ptr) return Boolean; package Behavior_Sets is new Ada.Containers.Ordered_Sets (Behaviors.Behavior_Ptr, "<", "="); protected Scene is procedure Add (Object : Behaviors.Behavior_Ptr) with Post => Modified; procedure Remove (Object : Behaviors.Behavior_Ptr) with Post => Modified; procedure Replace_Array (Target : in out Behaviors.Behavior_Array_Access) with Pre => Target /= null, Post => Target /= null and not Modified; function Modified return Boolean; procedure Set_Camera (Camera : Cameras.Camera_Ptr); function Camera return Cameras.Camera_Ptr; private Modified_Flag : Boolean := False; Behaviors_Set : Behavior_Sets.Set; Scene_Camera : Cameras.Camera_Ptr := Orka.Loops.Camera; end Scene; procedure Stop_Loop; procedure Run_Loop (Render : not null access procedure (Scene : not null Behaviors.Behavior_Array_Access; Camera : Cameras.Camera_Ptr)); end Orka.Loops;
29.138298
79
0.703907
58269618d8b9159f8a5f480bdc70db0ac3bb7270
2,738
ads
Ada
arch/ARM/NXP/svd/lpc55s6x/nxp_svd-crc.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/svd/lpc55s6x/nxp_svd-crc.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
null
null
null
arch/ARM/NXP/svd/lpc55s6x/nxp_svd-crc.ads
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
null
null
null
-- Copyright 2016-2019 NXP -- All rights reserved.SPDX-License-Identifier: BSD-3-Clause -- This spec has been automatically generated from LPC55S6x.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package NXP_SVD.CRC is pragma Preelaborate; --------------- -- Registers -- --------------- subtype MODE_CRC_POLY_Field is HAL.UInt2; -- CRC mode register type MODE_Register is record -- CRC polynomial: 1X = CRC-32 polynomial 01 = CRC-16 polynomial 00 = -- CRC-CCITT polynomial CRC_POLY : MODE_CRC_POLY_Field := 16#0#; -- Data bit order: 1 = Bit order reverse for CRC_WR_DATA (per byte) 0 = -- No bit order reverse for CRC_WR_DATA (per byte) BIT_RVS_WR : Boolean := False; -- Data complement: 1 = 1's complement for CRC_WR_DATA 0 = No 1's -- complement for CRC_WR_DATA CMPL_WR : Boolean := False; -- CRC sum bit order: 1 = Bit order reverse for CRC_SUM 0 = No bit order -- reverse for CRC_SUM BIT_RVS_SUM : Boolean := False; -- CRC sum complement: 1 = 1's complement for CRC_SUM 0 = No 1's -- complement for CRC_SUM CMPL_SUM : Boolean := False; -- unspecified Reserved_6_31 : HAL.UInt26 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MODE_Register use record CRC_POLY at 0 range 0 .. 1; BIT_RVS_WR at 0 range 2 .. 2; CMPL_WR at 0 range 3 .. 3; BIT_RVS_SUM at 0 range 4 .. 4; CMPL_SUM at 0 range 5 .. 5; Reserved_6_31 at 0 range 6 .. 31; end record; ----------------- -- Peripherals -- ----------------- type CRC_ENGINE_Disc is ( Mode_1, Mode_2); -- CRC engine type CRC_ENGINE_Peripheral (Discriminent : CRC_ENGINE_Disc := Mode_1) is record -- CRC mode register MODE : aliased MODE_Register; -- CRC seed register SEED : aliased HAL.UInt32; case Discriminent is when Mode_1 => -- CRC checksum register SUM : aliased HAL.UInt32; when Mode_2 => -- CRC data register WR_DATA : aliased HAL.UInt32; end case; end record with Unchecked_Union, Volatile; for CRC_ENGINE_Peripheral use record MODE at 16#0# range 0 .. 31; SEED at 16#4# range 0 .. 31; SUM at 16#8# range 0 .. 31; WR_DATA at 16#8# range 0 .. 31; end record; -- CRC engine CRC_ENGINE_Periph : aliased CRC_ENGINE_Peripheral with Import, Address => System'To_Address (16#40095000#); end NXP_SVD.CRC;
28.821053
79
0.59569
c74a539abfc56ba2592ab3677f5f8d8c4b365e7f
2,885
ads
Ada
source/libgela/gela-decoders-fixed_width_8.ads
faelys/gela-asis
48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253
[ "BSD-3-Clause" ]
4
2016-02-05T15:51:56.000Z
2022-03-25T20:38:32.000Z
source/libgela/gela-decoders-fixed_width_8.ads
faelys/gela-asis
48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253
[ "BSD-3-Clause" ]
null
null
null
source/libgela/gela-decoders-fixed_width_8.ads
faelys/gela-asis
48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------ -- G E L A A S I S -- -- ASIS implementation for Gela project, a portable Ada compiler -- -- http://gela.ada-ru.org -- -- - - - - - - - - - - - - - - - -- -- Read copyright and license at the end of this file -- ------------------------------------------------------------------------------ -- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $ -- Purpose: -- Decoder for any fixed width encoding. package Gela.Decoders.Fixed_Width_8 is type Translation_Table is new Wide_String; type Decoder (Table : access Translation_Table) is new Decoders.Decoder with null record; procedure Decode (Object : in Decoder; From : in Source_Buffers.Cursor; To : in Source_Buffers.Cursor; Result : out Wide_String; Last : out Natural); end Gela.Decoders.Fixed_Width_8; ------------------------------------------------------------------------------ -- Copyright (c) 2008, 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. -- ------------------------------------------------------------------------------
50.614035
79
0.586482
58ac484c40f1c7d58c878f1c7547259555f740ca
3,096
ads
Ada
llvm-gcc-4.2-2.9/gcc/ada/s-widllu.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-widllu.ads
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
llvm-gcc-4.2-2.9/gcc/ada/s-widllu.ads
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . W I D _ L L U -- -- -- -- 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. -- -- -- -- 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 the routine used for Width attribute for all -- non-static unsigned integer (modular integer) subtypes. Note we only -- have one routine, since this seems a fairly marginal function. with System.Unsigned_Types; package System.Wid_LLU is pragma Pure; function Width_Long_Long_Unsigned (Lo, Hi : System.Unsigned_Types.Long_Long_Unsigned) return Natural; -- Compute Width attribute for non-static type derived from a modular -- integer type. The arguments Lo, Hi are the bounds of the type. end System.Wid_LLU;
61.92
78
0.470607
adc826100b2bf8c56894061133a1754eb120c9d6
13,336
ads
Ada
bb-runtimes/arm/stm32/stm32f401/svd/i-stm32-gpio.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/arm/stm32/stm32f401/svd/i-stm32-gpio.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/arm/stm32/stm32f401/svd/i-stm32-gpio.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
-- -- Copyright (C) 2020, AdaCore -- -- This spec has been automatically generated from STM32F401.svd pragma Ada_2012; pragma Style_Checks (Off); with System; package Interfaces.STM32.GPIO is pragma Preelaborate; pragma No_Elaboration_Code_All; --------------- -- Registers -- --------------- -- MODER array element subtype MODER_Element is Interfaces.STM32.UInt2; -- MODER array type MODER_Field_Array is array (0 .. 15) of MODER_Element with Component_Size => 2, Size => 32; -- GPIO port mode register type MODER_Register (As_Array : Boolean := False) is record case As_Array is when False => -- MODER as a value Val : Interfaces.STM32.UInt32; when True => -- MODER as an array Arr : MODER_Field_Array; end case; end record with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for MODER_Register use record Val at 0 range 0 .. 31; Arr at 0 range 0 .. 31; end record; -- OTYPER_OT array element subtype OTYPER_OT_Element is Interfaces.STM32.Bit; -- OTYPER_OT array type OTYPER_OT_Field_Array is array (0 .. 15) of OTYPER_OT_Element with Component_Size => 1, Size => 16; -- Type definition for OTYPER_OT type OTYPER_OT_Field (As_Array : Boolean := False) is record case As_Array is when False => -- OT as a value Val : Interfaces.STM32.UInt16; when True => -- OT as an array Arr : OTYPER_OT_Field_Array; end case; end record with Unchecked_Union, Size => 16; for OTYPER_OT_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- GPIO port output type register type OTYPER_Register is record -- Port x configuration bits (y = 0..15) OT : OTYPER_OT_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_16_31 : Interfaces.STM32.UInt16 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for OTYPER_Register use record OT at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -- OSPEEDR array element subtype OSPEEDR_Element is Interfaces.STM32.UInt2; -- OSPEEDR array type OSPEEDR_Field_Array is array (0 .. 15) of OSPEEDR_Element with Component_Size => 2, Size => 32; -- GPIO port output speed register type OSPEEDR_Register (As_Array : Boolean := False) is record case As_Array is when False => -- OSPEEDR as a value Val : Interfaces.STM32.UInt32; when True => -- OSPEEDR as an array Arr : OSPEEDR_Field_Array; end case; end record with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for OSPEEDR_Register use record Val at 0 range 0 .. 31; Arr at 0 range 0 .. 31; end record; -- PUPDR array element subtype PUPDR_Element is Interfaces.STM32.UInt2; -- PUPDR array type PUPDR_Field_Array is array (0 .. 15) of PUPDR_Element with Component_Size => 2, Size => 32; -- GPIO port pull-up/pull-down register type PUPDR_Register (As_Array : Boolean := False) is record case As_Array is when False => -- PUPDR as a value Val : Interfaces.STM32.UInt32; when True => -- PUPDR as an array Arr : PUPDR_Field_Array; end case; end record with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PUPDR_Register use record Val at 0 range 0 .. 31; Arr at 0 range 0 .. 31; end record; -- IDR array element subtype IDR_Element is Interfaces.STM32.Bit; -- IDR array type IDR_Field_Array is array (0 .. 15) of IDR_Element with Component_Size => 1, Size => 16; -- Type definition for IDR type IDR_Field (As_Array : Boolean := False) is record case As_Array is when False => -- IDR as a value Val : Interfaces.STM32.UInt16; when True => -- IDR as an array Arr : IDR_Field_Array; end case; end record with Unchecked_Union, Size => 16; for IDR_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- GPIO port input data register type IDR_Register is record -- Read-only. Port input data (y = 0..15) IDR : IDR_Field; -- unspecified Reserved_16_31 : Interfaces.STM32.UInt16; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IDR_Register use record IDR at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -- ODR array element subtype ODR_Element is Interfaces.STM32.Bit; -- ODR array type ODR_Field_Array is array (0 .. 15) of ODR_Element with Component_Size => 1, Size => 16; -- Type definition for ODR type ODR_Field (As_Array : Boolean := False) is record case As_Array is when False => -- ODR as a value Val : Interfaces.STM32.UInt16; when True => -- ODR as an array Arr : ODR_Field_Array; end case; end record with Unchecked_Union, Size => 16; for ODR_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- GPIO port output data register type ODR_Register is record -- Port output data (y = 0..15) ODR : ODR_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_16_31 : Interfaces.STM32.UInt16 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for ODR_Register use record ODR at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -- BSRR_BS array element subtype BSRR_BS_Element is Interfaces.STM32.Bit; -- BSRR_BS array type BSRR_BS_Field_Array is array (0 .. 15) of BSRR_BS_Element with Component_Size => 1, Size => 16; -- Type definition for BSRR_BS type BSRR_BS_Field (As_Array : Boolean := False) is record case As_Array is when False => -- BS as a value Val : Interfaces.STM32.UInt16; when True => -- BS as an array Arr : BSRR_BS_Field_Array; end case; end record with Unchecked_Union, Size => 16; for BSRR_BS_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- BSRR_BR array element subtype BSRR_BR_Element is Interfaces.STM32.Bit; -- BSRR_BR array type BSRR_BR_Field_Array is array (0 .. 15) of BSRR_BR_Element with Component_Size => 1, Size => 16; -- Type definition for BSRR_BR type BSRR_BR_Field (As_Array : Boolean := False) is record case As_Array is when False => -- BR as a value Val : Interfaces.STM32.UInt16; when True => -- BR as an array Arr : BSRR_BR_Field_Array; end case; end record with Unchecked_Union, Size => 16; for BSRR_BR_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- GPIO port bit set/reset register type BSRR_Register is record -- Write-only. Port x set bit y (y= 0..15) BS : BSRR_BS_Field := (As_Array => False, Val => 16#0#); -- Write-only. Port x set bit y (y= 0..15) BR : BSRR_BR_Field := (As_Array => False, Val => 16#0#); end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for BSRR_Register use record BS at 0 range 0 .. 15; BR at 0 range 16 .. 31; end record; -- LCKR_LCK array element subtype LCKR_LCK_Element is Interfaces.STM32.Bit; -- LCKR_LCK array type LCKR_LCK_Field_Array is array (0 .. 15) of LCKR_LCK_Element with Component_Size => 1, Size => 16; -- Type definition for LCKR_LCK type LCKR_LCK_Field (As_Array : Boolean := False) is record case As_Array is when False => -- LCK as a value Val : Interfaces.STM32.UInt16; when True => -- LCK as an array Arr : LCKR_LCK_Field_Array; end case; end record with Unchecked_Union, Size => 16; for LCKR_LCK_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; subtype LCKR_LCKK_Field is Interfaces.STM32.Bit; -- GPIO port configuration lock register type LCKR_Register is record -- Port x lock bit y (y= 0..15) LCK : LCKR_LCK_Field := (As_Array => False, Val => 16#0#); -- Port x lock bit y (y= 0..15) LCKK : LCKR_LCKK_Field := 16#0#; -- unspecified Reserved_17_31 : Interfaces.STM32.UInt15 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for LCKR_Register use record LCK at 0 range 0 .. 15; LCKK at 0 range 16 .. 16; Reserved_17_31 at 0 range 17 .. 31; end record; -- AFRL array element subtype AFRL_Element is Interfaces.STM32.UInt4; -- AFRL array type AFRL_Field_Array is array (0 .. 7) of AFRL_Element with Component_Size => 4, Size => 32; -- GPIO alternate function low register type AFRL_Register (As_Array : Boolean := False) is record case As_Array is when False => -- AFRL as a value Val : Interfaces.STM32.UInt32; when True => -- AFRL as an array Arr : AFRL_Field_Array; end case; end record with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for AFRL_Register use record Val at 0 range 0 .. 31; Arr at 0 range 0 .. 31; end record; -- AFRH array element subtype AFRH_Element is Interfaces.STM32.UInt4; -- AFRH array type AFRH_Field_Array is array (8 .. 15) of AFRH_Element with Component_Size => 4, Size => 32; -- GPIO alternate function high register type AFRH_Register (As_Array : Boolean := False) is record case As_Array is when False => -- AFRH as a value Val : Interfaces.STM32.UInt32; when True => -- AFRH as an array Arr : AFRH_Field_Array; end case; end record with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for AFRH_Register use record Val at 0 range 0 .. 31; Arr at 0 range 0 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- General-purpose I/Os type GPIO_Peripheral is record -- GPIO port mode register MODER : aliased MODER_Register; -- GPIO port output type register OTYPER : aliased OTYPER_Register; -- GPIO port output speed register OSPEEDR : aliased OSPEEDR_Register; -- GPIO port pull-up/pull-down register PUPDR : aliased PUPDR_Register; -- GPIO port input data register IDR : aliased IDR_Register; -- GPIO port output data register ODR : aliased ODR_Register; -- GPIO port bit set/reset register BSRR : aliased BSRR_Register; -- GPIO port configuration lock register LCKR : aliased LCKR_Register; -- GPIO alternate function low register AFRL : aliased AFRL_Register; -- GPIO alternate function high register AFRH : aliased AFRH_Register; end record with Volatile; for GPIO_Peripheral use record MODER at 16#0# range 0 .. 31; OTYPER at 16#4# range 0 .. 31; OSPEEDR at 16#8# range 0 .. 31; PUPDR at 16#C# range 0 .. 31; IDR at 16#10# range 0 .. 31; ODR at 16#14# range 0 .. 31; BSRR at 16#18# range 0 .. 31; LCKR at 16#1C# range 0 .. 31; AFRL at 16#20# range 0 .. 31; AFRH at 16#24# range 0 .. 31; end record; -- General-purpose I/Os GPIOA_Periph : aliased GPIO_Peripheral with Import, Address => GPIOA_Base; -- General-purpose I/Os GPIOB_Periph : aliased GPIO_Peripheral with Import, Address => GPIOB_Base; -- General-purpose I/Os GPIOC_Periph : aliased GPIO_Peripheral with Import, Address => GPIOC_Base; -- General-purpose I/Os GPIOD_Periph : aliased GPIO_Peripheral with Import, Address => GPIOD_Base; -- General-purpose I/Os GPIOE_Periph : aliased GPIO_Peripheral with Import, Address => GPIOE_Base; -- General-purpose I/Os GPIOH_Periph : aliased GPIO_Peripheral with Import, Address => GPIOH_Base; end Interfaces.STM32.GPIO;
28.434968
79
0.600405
13d685a6bb25cb3b2f925fb48f8afd0ca518363c
4,114
ads
Ada
resources/scripts/api/robtex.ads
r0ck3rt/Amass
8a7cd5dbdc0458422bd2ff9cda08712562a681ef
[ "Apache-2.0" ]
1
2022-03-22T11:16:31.000Z
2022-03-22T11:16:31.000Z
resources/scripts/api/robtex.ads
r0ck3rt/Amass
8a7cd5dbdc0458422bd2ff9cda08712562a681ef
[ "Apache-2.0" ]
null
null
null
resources/scripts/api/robtex.ads
r0ck3rt/Amass
8a7cd5dbdc0458422bd2ff9cda08712562a681ef
[ "Apache-2.0" ]
null
null
null
-- Copyright © by Jeff Foley 2021-2022. All rights reserved. -- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. -- SPDX-License-Identifier: Apache-2.0 local json = require("json") name = "Robtex" type = "api" function start() set_rate_limit(7) end function vertical(ctx, domain) local cfg = datasrc_config() if (cfg == nil) then return end local vurl = "https://freeapi.robtex.com/pdns/forward/" .. domain local resp, err = request(ctx, {['url']=vurl}) if (err ~= nil and err ~= "") then log(ctx, "vertical request to service failed: " .. err) return end local j = json.decode("{\"results\": [" .. resp .. "]}") if (j == nil or #(j.results) == 0) then return end for _, rr in pairs(j.results) do if (rr.rrtype == "A") then local d = ipinfo(ctx, rr.rrdata, cfg.ttl) if (d == nil) then return end extract_names(ctx, d) elseif (rr.rrtype == "NS" or rr.rrtype == "MX") then send_names(ctx, rr.rrdata) end end end function asn(ctx, addr, asn) local cfg = datasrc_config() if (cfg == nil) then return end local d local prefix if (asn == 0) then if (addr == "") then return end d = ip_info(ctx, addr, cfg.ttl) if (d == nil) then return end asn = d.as prefix = d.bgproute end local cidrs = netblocks(ctx, asn, cfg.ttl) if (cidrs == nil or #cidrs == 0) then return end if (prefix == "") then prefix = cidrs[1] parts = split(prefix, "/") addr = parts[1] d = ip_info(ctx, addr, cfg.ttl) if (d == nil) then return end end extract_names(ctx, d) local desc = d.asname if (desc == nil) then desc = "" end if (d.whoisdesc ~= nil and string.len(desc) < string.len(d.whoisdesc)) then desc = d.whoisdesc end if (d.asdesc ~= nil and string.len(d.asdesc) > 0) then desc = desc .. " - " .. d.asdesc elseif (d.routedesc ~= nil and string.len(d.routedesc) > 0) then desc = desc .. " - " .. d.routedesc end new_asn(ctx, { ['addr']=addr, ['asn']=asn, ['prefix']=prefix, ['desc']=desc, ['netblocks']=cidrs, }) end function ip_info(ctx, addr, ttl) local url = "https://freeapi.robtex.com/ipquery/" .. addr local resp, err = request(ctx, {['url']=url}) if (err ~= nil and err ~= "") then log(ctx, "ip_info request to service failed: " .. err) return nil end local j = json.decode(resp) if (j == nil or j.status ~= "ok") then return nil end return j end function extract_names(ctx, djson) local sections = {"act", "acth", "pas", "pash"} for _, s in pairs(sections) do if (djson[s] ~= nil and #(djson[s]) > 0) then for _, name in pairs(djson[s]) do if in_scope(ctx, name.o) then new_name(ctx, name.o) end end end end end function netblocks(ctx, asn, ttl) local url = "https://freeapi.robtex.com/asquery/" .. tostring(asn) local resp, err = request(ctx, {['url']=url}) if (err ~= nil and err ~= "") then log(ctx, "netblocks request to service failed: " .. err) return nil end local j = json.decode(resp) if (j == nil or j.status ~= "ok") then return nil end local netblocks = {} for _, net in pairs(j.nets) do table.insert(netblocks, net.n) end if (#netblocks == 0) then return nil end return netblocks end function split(str, delim) local result = {} local pattern = "[^%" .. delim .. "]+" local matches = find(str, pattern) if (matches == nil or #matches == 0) then return result end for i, match in pairs(matches) do table.insert(result, match) end return result end
24.05848
97
0.53403
2e27aee6ea3b932fbf484156e9193f7466c57a1c
25,533
adb
Ada
components/src/motion/bno055/bosch_bno055.adb
shakram02/Ada_Drivers_Library
a407ca7ddbc2d9756647016c2f8fd8ef24a239ff
[ "BSD-3-Clause" ]
192
2016-06-01T18:32:04.000Z
2022-03-26T22:52:31.000Z
components/src/motion/bno055/bosch_bno055.adb
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
239
2016-05-26T20:02:01.000Z
2022-03-31T09:46:56.000Z
components/src/motion/bno055/bosch_bno055.adb
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
142
2016-06-05T08:12:20.000Z
2022-03-24T17:37:17.000Z
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2016, 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 Ada.Unchecked_Conversion; package body Bosch_BNO055 is subtype Register_Address is UInt8; function Value_At (This : in out BNO055_9DOF_IMU; MSB, LSB : Register_Address) return UInt16 with Inline; -- MSB and LSB are the *register addresses* from which to get the values, -- not the values themselves function Value_At (This : in out BNO055_9DOF_IMU; MSB, LSB : Register_Address) return Integer_16 with Inline; -- MSB and LSB are the *register addresses* from which to get the values, -- not the values themselves function To_Integer_16 (LSB, MSB : UInt8) return Integer_16 with Inline; -- returns a signed value, possibly negative based on high-order bit of MSB function As_Self_Test_Results is new Ada.Unchecked_Conversion (Source => UInt8, Target => Self_Test_Results); procedure Set_Units_Register (This : in out BNO055_9DOF_IMU; New_Value : UInt8; Units_Mask : UInt8); -- An internal utility routine. Sets the units bits within the UNIT_SEL -- register to the New_Value. Other bits are not altered. ----------- -- Reset -- ----------- procedure Reset (This : in out BNO055_9DOF_IMU) is Reset_Bit : constant UInt8 := 16#20#; begin Write (This.Port, BNO055_SYS_TRIGGER_ADDR, Value => Reset_Bit); Delay_Milliseconds (650); end Reset; --------------- -- Configure -- --------------- procedure Configure (This : in out BNO055_9DOF_IMU; Operating_Mode : Operating_Modes := Operating_Mode_NDOF; Power_Mode : Power_Modes := Power_Mode_Normal; Use_External_Crystal : Boolean := True) is begin Set_Mode (This, Operating_Mode_Config); -- select register map page zero Write (This.Port, BNO055_PAGE_ID_ADDR, 0); Delay_Milliseconds (10); Write (This.Port, BNO055_PWR_MODE_ADDR, Power_Mode'Enum_Rep); Delay_Milliseconds (10); -- clear interrupt, self-test, and reset bits, conditionally set -- external oscillator bit if Use_External_Crystal then Write (This.Port, BNO055_SYS_TRIGGER_ADDR, Value => 16#80#); else Write (This.Port, BNO055_SYS_TRIGGER_ADDR, Value => 0); end if; Delay_Milliseconds (10); Set_Mode (This, Operating_Mode); -- Note that Set_Mode automatically does a delay at the end so we don't -- need to do it here end Configure; ---------------------------- -- Set_Acceleration_Units -- ---------------------------- procedure Set_Acceleration_Units (This : in out BNO055_9DOF_IMU; Units : Acceleration_Units) is begin Set_Units_Register (This, Units'Enum_Rep, Acceleration_Units_Mask); end Set_Acceleration_Units; ---------------------------- -- Set_Angular_Rate_Units -- ---------------------------- procedure Set_Angular_Rate_Units (This : in out BNO055_9DOF_IMU; Units : Angular_Rate_Units) is begin Set_Units_Register (This, Units'Enum_Rep, Angular_Rate_Units_Mask); end Set_Angular_Rate_Units; --------------------------- -- Set_Euler_Angle_Units -- --------------------------- procedure Set_Euler_Angle_Units (This : in out BNO055_9DOF_IMU; Units : Euler_Angle_Units) is begin Set_Units_Register (This, Units'Enum_Rep, Euler_Angle_Units_Mask); end Set_Euler_Angle_Units; --------------------------- -- Set_Temperature_Units -- --------------------------- procedure Set_Temperature_Units (This : in out BNO055_9DOF_IMU; Units : Temperature_Units) is begin Set_Units_Register (This, Units'Enum_Rep, Temperature_Units_Mask); end Set_Temperature_Units; ------------------------ -- Set_Pitch_Rotation -- ------------------------ procedure Set_Pitch_Rotation (This : in out BNO055_9DOF_IMU; Convention : Pitch_Rotation_Conventions) is begin Set_Units_Register (This, Convention'Enum_Rep, Pitch_Rotation_Convention_Mask); end Set_Pitch_Rotation; -------------------------- -- Selected_Euler_Units -- -------------------------- function Selected_Euler_Units (This : in out BNO055_9DOF_IMU) return Euler_Angle_Units is Value : UInt8; begin Read (This.Port, BNO055_UNIT_SEL_ADDR, Value); if (Value and Euler_Angle_Units_Mask) = Degrees'Enum_Rep then return Degrees; else return Radians; end if; end Selected_Euler_Units; --------------------------------- -- Selected_Acceleration_Units -- --------------------------------- function Selected_Acceleration_Units (This : in out BNO055_9DOF_IMU) return Acceleration_Units is Value : UInt8; begin Read (This.Port, BNO055_UNIT_SEL_ADDR, Value); if (Value and Acceleration_Units_Mask) = Meters_Second_Squared'Enum_Rep then return Meters_Second_Squared; else return Milligravity; end if; end Selected_Acceleration_Units; -------------------------------- -- Selected_Temperature_Units -- -------------------------------- function Selected_Temperature_Units (This : in out BNO055_9DOF_IMU) return Temperature_Units is Value : UInt8; begin Read (This.Port, BNO055_UNIT_SEL_ADDR, Value); if (Value and Temperature_Units_Mask) = Fahrenheit'Enum_Rep then return Fahrenheit; else return Celsius; end if; end Selected_Temperature_Units; --------------- -- Device_Id -- --------------- function Device_Id (This : in out BNO055_9DOF_IMU) return UInt8 is Result : UInt8; begin Read (This.Port, BNO055_CHIP_ID_ADDR, Value => Result); return Result; end Device_Id; -------------- -- Set_Mode -- -------------- procedure Set_Mode (This : in out BNO055_9DOF_IMU; Mode : Operating_Modes) is -- Table 3-6 of the datasheet + 1ms as margin Switching_From_Config_Mode : constant := 8; -- milliseconds Switching_To_Config_Mode : constant := 20; -- milliseconds begin if This.Mode = Operating_Mode_Config then Write (This.Port, BNO055_OPR_MODE_ADDR, Value => Mode'Enum_Rep); Delay_Milliseconds (Switching_From_Config_Mode); else Write (This.Port, BNO055_OPR_MODE_ADDR, Value => Operating_Mode_Config'Enum_Rep); Delay_Milliseconds (Switching_To_Config_Mode); Write (This.Port, BNO055_OPR_MODE_ADDR, Value => Mode'Enum_Rep); Delay_Milliseconds (Switching_From_Config_Mode); end if; This.Mode := Mode; end Set_Mode; ------------------ -- Current_Mode -- ------------------ function Current_Mode (This : in out BNO055_9DOF_IMU) return Operating_Modes is Result : UInt8 := 0; begin Write (This.Port, BNO055_PAGE_ID_ADDR, 0); -- x7, x0 Delay_Milliseconds (10); Read (This.Port, BNO055_OPR_MODE_ADDR, Value => Result); return Operating_Modes'Val (Result and Operating_Mode_Mask); end Current_Mode; ----------------------- -- Get_Revision_Info -- ----------------------- procedure Get_Revision_Info (This : in out BNO055_9DOF_IMU; Info : out Revision_Information) is begin Read (This.Port, BNO055_ACCEL_REV_ID_ADDR, Info.Accelerometer); Read (This.Port, BNO055_MAG_REV_ID_ADDR, Info.Magnetometer); Read (This.Port, BNO055_GYRO_REV_ID_ADDR, Info.Gyroscope); Read (This.Port, BNO055_BL_REV_ID_ADDR, Info.Bootloader); Info.Software := Value_At (This, MSB => BNO055_SW_REV_ID_MSB_ADDR, LSB => BNO055_SW_REV_ID_LSB_ADDR); end Get_Revision_Info; ---------------- -- Get_Status -- ---------------- procedure Get_Status (This : in out BNO055_9DOF_IMU; System_Status : out System_Status_Values; Self_Test : out Self_Test_Results; System_Error : out System_Error_Values) is Value : UInt8; begin Read (This.Port, BNO055_SYS_STAT_ADDR, Value); System_Status := System_Status_Values'Val (Value); Read (This.Port, BNO055_SELFTEST_RESULT_ADDR, Value); Self_Test := As_Self_Test_Results (Value); Read (This.Port, BNO055_SYS_ERR_ADDR, Value); System_Error := System_Error_Values'Val (Value); end Get_Status; ------------------------ -- Sensor_Calibration -- ------------------------ function Sensor_Calibration (This : in out BNO055_9DOF_IMU) return Calibration_States is Data : UInt8; Mask : constant := 2#00000011#; Result : Calibration_States; begin Read (This.Port, BNO055_CALIB_STAT_ADDR, Data); Result.Platform := Shift_Right (Data, 6) and Mask; Result.Gyroscope := Shift_Right (Data, 4) and Mask; Result.Accelerometer := Shift_Right (Data, 2) and Mask; Result.Magnetometer := Data and Mask; return Result; end Sensor_Calibration; -------------------------- -- Calibration_Complete -- -------------------------- function Calibration_Complete (This : in out BNO055_9DOF_IMU; Selection : Sensors_Selection := All_Sensors) return Boolean is States : constant Calibration_States := Sensor_Calibration (This); begin for Sensor of Selection loop case Sensor is when Gyroscope => if States.Gyroscope not in Fully_Calibrated then return False; end if; when Accelerometer => if States.Accelerometer not in Fully_Calibrated then return False; end if; when Magnetometer => if States.Magnetometer not in Fully_Calibrated then return False; end if; end case; end loop; return True; end Calibration_Complete; ---------- -- Data -- ---------- function Output (This : in out BNO055_9DOF_IMU; Kind : Sensor_Data_Kinds) return Sensor_Data is Result : Sensor_Data; Buffer : Sensor_Data_Buffer (0 .. 5); New_X : Integer_16; New_Y : Integer_16; New_Z : Integer_16; LSB : Float; Source : Register_Address; begin case Kind is when Accelerometer_Data => Source := BNO055_ACCEL_DATA_X_LSB_ADDR; when Magnetometer_Data => Source := BNO055_MAG_DATA_X_LSB_ADDR; when Gyroscope_Data => Source := BNO055_GYRO_DATA_X_LSB_ADDR; when Euler_Orientation => Source := BNO055_EULER_H_LSB_ADDR; when Linear_Acceleration_Data => Source := BNO055_LINEAR_ACCEL_DATA_X_LSB_ADDR; when Gravity_Data => Source := BNO055_GRAVITY_DATA_X_LSB_ADDR; end case; Read_Buffer (This.Port, Source, Buffer); -- By reading multiple UInt8s, the device ensures data consistency, -- whereas reading single UInt8s individually does not have that -- guarantee. See the Datasheet, section 3.7 "Data register shadowing" New_X := To_Integer_16 (LSB => Buffer (0), MSB => Buffer (1)); New_Y := To_Integer_16 (LSB => Buffer (2), MSB => Buffer (3)); New_Z := To_Integer_16 (LSB => Buffer (4), MSB => Buffer (5)); case Kind is when Magnetometer_Data => LSB := 16.0; when Euler_Orientation => if Selected_Euler_Units (This) = Degrees then LSB := 16.0; else -- radians LSB := 900.0; end if; when Gyroscope_Data => LSB := 900.0; when Accelerometer_Data => if Selected_Acceleration_Units (This) = Milligravity then LSB := 1.0; else -- Meters_Second_Squared LSB := 100.0; end if; when Linear_Acceleration_Data | Gravity_Data => LSB := 100.0; end case; Result (X) := Float (New_X) / LSB; Result (Y) := Float (New_Y) / LSB; Result (Z) := Float (New_Z) / LSB; return Result; end Output; ---------------------------- -- Quaternion_Orientation -- ---------------------------- function Quaternion_Orientation (This : in out BNO055_9DOF_IMU) return Quaternion is Buffer : Sensor_Data_Buffer (0 .. 7); New_W : Integer_16; New_X : Integer_16; New_Y : Integer_16; New_Z : Integer_16; Result : Quaternion; Scale : constant Float := 1.0 / Float (2 ** 14); -- see section 3.6.5.5 begin Read_Buffer (This.Port, BNO055_QUATERNION_DATA_W_LSB_ADDR, Buffer); -- By reading multiple UInt8s, the device ensures data consistency, -- whereas reading single UInt8s individually does not have that -- guarantee. See the Datasheet, section 3.7 "Data register shadowing" New_W := To_Integer_16 (MSB => Buffer (1), LSB => Buffer (0)); New_X := To_Integer_16 (MSB => Buffer (3), LSB => Buffer (2)); New_Y := To_Integer_16 (MSB => Buffer (5), LSB => Buffer (4)); New_Z := To_Integer_16 (MSB => Buffer (7), LSB => Buffer (6)); Result (1) := Float (New_W) * Scale; Result (2) := Float (New_X) * Scale; Result (3) := Float (New_Y) * Scale; Result (4) := Float (New_Z) * Scale; return Result; end Quaternion_Orientation; ------------------------ -- Sensor_Temperature -- ------------------------ function Sensor_Temperature (This : in out BNO055_9DOF_IMU; Source : Temperature_Source) return Integer_8 is Result : UInt8; begin -- see Datasheet section 3.6.5.8 Write (This.Port, BNO055_TEMP_SOURCE_ADDR, Source'Enum_Rep); Read (This.Port, BNO055_TEMP_ADDR, Value => Result); if Selected_Temperature_Units (This) = Fahrenheit then Result := Result * 2; -- LSB is 2 for Fahrenheit, 1 for Celcius end if; return Integer_8 (Result); end Sensor_Temperature; ------------------------ -- Get_Sensor_Offsets -- ------------------------ function Sensor_Offsets (This : in out BNO055_9DOF_IMU) return Sensor_Offset_Values is Previous_Mode : constant Operating_Modes := This.Mode; Offsets : Sensor_Offset_Values; begin Set_Mode (This, Operating_Mode_Config); Delay_Milliseconds (25); Offsets.Accel_Offset_X := Value_At (This, MSB => ACCEL_OFFSET_X_MSB_ADDR, LSB => ACCEL_OFFSET_X_LSB_ADDR); Offsets.Accel_Offset_Y := Value_At (This, MSB => ACCEL_OFFSET_Y_MSB_ADDR, LSB => ACCEL_OFFSET_Y_LSB_ADDR); Offsets.Accel_Offset_Z := Value_At (This, MSB => ACCEL_OFFSET_Z_MSB_ADDR, LSB => ACCEL_OFFSET_Z_LSB_ADDR); Offsets.Gyro_Offset_X := Value_At (This, MSB => GYRO_OFFSET_X_MSB_ADDR, LSB => GYRO_OFFSET_X_LSB_ADDR); Offsets.Gyro_Offset_Y := Value_At (This, MSB => GYRO_OFFSET_Y_MSB_ADDR, LSB => GYRO_OFFSET_Y_LSB_ADDR); Offsets.Gyro_Offset_Z := Value_At (This, MSB => GYRO_OFFSET_Z_MSB_ADDR, LSB => GYRO_OFFSET_Z_LSB_ADDR); Offsets.Mag_Offset_X := Value_At (This, MSB => MAG_OFFSET_X_MSB_ADDR, LSB => MAG_OFFSET_X_LSB_ADDR); Offsets.Mag_Offset_Y := Value_At (This, MSB => MAG_OFFSET_Y_MSB_ADDR, LSB => MAG_OFFSET_Y_LSB_ADDR); Offsets.Mag_Offset_Z := Value_At (This, MSB => MAG_OFFSET_Z_MSB_ADDR, LSB => MAG_OFFSET_Z_LSB_ADDR); Offsets.Accel_Radius := Value_At (This, MSB => ACCEL_RADIUS_MSB_ADDR, LSB => ACCEL_RADIUS_LSB_ADDR); Offsets.Mag_Radius := Value_At (This, MSB => MAG_RADIUS_MSB_ADDR, LSB => MAG_RADIUS_LSB_ADDR); Set_Mode (This, Previous_Mode); return Offsets; end Sensor_Offsets; ------------------------ -- Set_Sensor_Offsets -- ------------------------ procedure Set_Sensor_Offsets (This : in out BNO055_9DOF_IMU; Offsets : Sensor_Offset_Values) is Previous_Mode : constant Operating_Modes := This.Mode; Outgoing : UInt16; begin Set_Mode (This, Operating_Mode_Config); Delay_Milliseconds (25); Outgoing := UInt16'Mod (Offsets.Accel_Offset_X); Write (This.Port, ACCEL_OFFSET_X_LSB_ADDR, Value => UInt8 (Outgoing and 16#FF#)); Write (This.Port, ACCEL_OFFSET_X_MSB_ADDR, Value => UInt8 (Shift_Right (Outgoing, 8))); Outgoing := UInt16'Mod (Offsets.Accel_Offset_Y); Write (This.Port, ACCEL_OFFSET_Y_LSB_ADDR, Value => UInt8 (Outgoing and 16#FF#)); Write (This.Port, ACCEL_OFFSET_Y_MSB_ADDR, Value => UInt8 (Shift_Right (Outgoing, 8))); Outgoing := UInt16'Mod (Offsets.Accel_Offset_Z); Write (This.Port, ACCEL_OFFSET_Z_LSB_ADDR, Value => UInt8 (Outgoing and 16#FF#)); Write (This.Port, ACCEL_OFFSET_Z_MSB_ADDR, Value => UInt8 (Shift_Right (Outgoing, 8))); -- The Datasheet, section 3.6.4.1 "Accelerometer offset" says the -- configuration only occurs when the MSB of the Z offset is written Outgoing := UInt16'Mod (Offsets.Gyro_Offset_X); Write (This.Port, GYRO_OFFSET_X_LSB_ADDR, Value => UInt8 (Outgoing and 16#FF#)); Write (This.Port, GYRO_OFFSET_X_MSB_ADDR, Value => UInt8 (Shift_Right (Outgoing, 8))); Outgoing := UInt16'Mod (Offsets.Gyro_Offset_Y); Write (This.Port, GYRO_OFFSET_Y_LSB_ADDR, Value => UInt8 (Outgoing and 16#FF#)); Write (This.Port, GYRO_OFFSET_Y_MSB_ADDR, Value => UInt8 (Shift_Right (Outgoing, 8))); Outgoing := UInt16'Mod (Offsets.Gyro_Offset_Z); Write (This.Port, GYRO_OFFSET_Z_LSB_ADDR, Value => UInt8 (Outgoing and 16#FF#)); Write (This.Port, GYRO_OFFSET_Z_MSB_ADDR, Value => UInt8 (Shift_Right (Outgoing, 8))); -- The Datasheet, section 3.6.4.3 "Gyroscope offset" says the -- configuration only occurs when the MSB of the Z offset is written Outgoing := UInt16'Mod (Offsets.Mag_Offset_X); Write (This.Port, MAG_OFFSET_X_LSB_ADDR, Value => UInt8 (Outgoing and 16#FF#)); Write (This.Port, MAG_OFFSET_X_MSB_ADDR, Value => UInt8 (Shift_Right (Outgoing, 8))); Outgoing := UInt16'Mod (Offsets.Mag_Offset_Y); Write (This.Port, MAG_OFFSET_Y_LSB_ADDR, Value => UInt8 (Outgoing and 16#FF#)); Write (This.Port, MAG_OFFSET_Y_MSB_ADDR, Value => UInt8 (Shift_Right (Outgoing, 8))); Outgoing := UInt16'Mod (Offsets.Mag_Offset_Z); Write (This.Port, MAG_OFFSET_Z_LSB_ADDR, Value => UInt8 (Outgoing and 16#FF#)); Write (This.Port, MAG_OFFSET_Z_MSB_ADDR, Value => UInt8 (Shift_Right (Outgoing, 8))); -- The Datasheet, section 3.6.4.2 "Magnetometer offset" says the -- configuration only occurs when the MSB of the Z offset is written Outgoing := UInt16'Mod (Offsets.Accel_Radius); Write (This.Port, ACCEL_RADIUS_LSB_ADDR, Value => UInt8 (Outgoing and 16#FF#)); Write (This.Port, ACCEL_RADIUS_MSB_ADDR, Value => UInt8 (Shift_Right (Outgoing, 8))); -- The Datasheet, section 3.6.4.4 "Radius" says the -- configuration only occurs when the MSB of the radius is written Outgoing := UInt16'Mod (Offsets.Mag_Radius); Write (This.Port, MAG_RADIUS_LSB_ADDR, Value => UInt8 (Outgoing and 16#FF#)); Write (This.Port, MAG_RADIUS_MSB_ADDR, Value => UInt8 (Shift_Right (Outgoing, 8))); -- The Datasheet, section 3.6.4.4 "Radius" says the -- configuration only occurs when the MSB of the radius is written Set_Mode (This, Previous_Mode); end Set_Sensor_Offsets; ------------------------ -- Set_Units_Register -- ------------------------ procedure Set_Units_Register (This : in out BNO055_9DOF_IMU; New_Value : UInt8; Units_Mask : UInt8) is Value : UInt8; Previous_Mode : constant Operating_Modes := This.Mode; begin if Previous_Mode /= Operating_Mode_Config then Set_Mode (This, Operating_Mode_Config); end if; -- we don't set all the bits within this register in this routine, so we -- read the current value in order to preserve those that are unchanged Read (This.Port, BNO055_UNIT_SEL_ADDR, Value); Value := Value and not Units_Mask; -- clear the bits we're working with here Value := Value or New_Value'Enum_Rep; -- set or clear the bits per the value Write (This.Port, BNO055_UNIT_SEL_ADDR, Value); Delay_Milliseconds (10); if Previous_Mode /= Operating_Mode_Config then Set_Mode (This, Previous_Mode); end if; end Set_Units_Register; ---------------- -- Remap_Axes -- ---------------- procedure Remap_Axes (This : in out BNO055_9DOF_IMU; Map : Axes_Remapping) is New_Mapping : UInt8 := 0; begin New_Mapping := New_Mapping or Axis_Remapping_Selections'Enum_Rep (Map (Z)); New_Mapping := Shift_Left (New_Mapping, 2); New_Mapping := New_Mapping or Axis_Remapping_Selections'Enum_Rep (Map (Y)); New_Mapping := Shift_Left (New_Mapping, 2); New_Mapping := New_Mapping or Axis_Remapping_Selections'Enum_Rep (Map (X)); Write (This.Port, BNO055_AXIS_MAP_CONFIG_ADDR, Value => New_Mapping); Delay_Milliseconds (10); end Remap_Axes; ---------------------- -- Remap_Axes_Signs -- ---------------------- procedure Remap_Axes_Signs (This : in out BNO055_9DOF_IMU; Map : Axes_Sign_Remapping) is New_Mapping : UInt8 := 0; begin New_Mapping := New_Mapping or Axis_Sign_Selections'Enum_Rep (Map (X)); New_Mapping := Shift_Left (New_Mapping, 1); New_Mapping := New_Mapping or Axis_Sign_Selections'Enum_Rep (Map (Y)); New_Mapping := Shift_Left (New_Mapping, 1); New_Mapping := New_Mapping or Axis_Sign_Selections'Enum_Rep (Map (Z)); Write (This.Port, BNO055_AXIS_MAP_SIGN_ADDR, Value => New_Mapping); Delay_Milliseconds (10); end Remap_Axes_Signs; -------------- -- Value_At -- -------------- function Value_At (This : in out BNO055_9DOF_IMU; MSB, LSB : Register_Address) return Integer_16 is High, Low : UInt8; begin Read (This.Port, Register => MSB, Value => High); Read (This.Port, Register => LSB, Value => Low); return To_Integer_16 (LSB => Low, MSB => High); end Value_At; -------------- -- Value_At -- -------------- function Value_At (This : in out BNO055_9DOF_IMU; MSB, LSB : Register_Address) return UInt16 is High, Low : UInt8; Result : UInt16; begin Read (This.Port, Register => MSB, Value => High); Read (This.Port, Register => LSB, Value => Low); Result := UInt16 (High); Result := Shift_Left (Result, 8); Result := Result or UInt16 (Low); return Result; end Value_At; ------------------- -- To_Integer_16 -- ------------------- function To_Integer_16 (LSB : UInt8; MSB : UInt8) return Integer_16 is Result : Integer_32; begin Result := Integer_32 (MSB) * 256; Result := Result + Integer_32 (LSB); if (MSB and 16#80#) /= 0 then Result := -((16#FFFF# - Result) + 1); end if; return Integer_16 (Result); end To_Integer_16; end Bosch_BNO055;
36.320057
112
0.608585
2e80d6640482582dc7fb88669500389483a7bbca
4,189
adb
Ada
src/registre.adb
GauBen/Arbre-Genealogique
410dfd4e783871846a87aa2198ab37e05413f5b6
[ "MIT" ]
1
2021-01-26T16:03:10.000Z
2021-01-26T16:03:10.000Z
src/registre.adb
GauBen/Arbre-Genealogique
410dfd4e783871846a87aa2198ab37e05413f5b6
[ "MIT" ]
null
null
null
src/registre.adb
GauBen/Arbre-Genealogique
410dfd4e783871846a87aa2198ab37e05413f5b6
[ "MIT" ]
null
null
null
with Ada.Unchecked_Deallocation; package body Registre is procedure Initialiser (Registre : out T_Registre) is begin Registre := (others => null); end Initialiser; function Hash (Cle : Integer) return Integer is begin return Cle mod Modulo; end Hash; function Est_Vide (Registre : T_Registre) return Boolean is begin for I in Registre'Range loop if Registre (I) /= null then return False; end if; end loop; return True; end Est_Vide; -- Renvoie vrai si la clé est presente dans le registre. function Existe (Registre : T_Registre; Cle : Integer) return Boolean is Pointeur : T_Pointeur_Sur_Maillon; begin Pointeur := Registre (Hash (Cle)); while Pointeur /= null loop if Pointeur.all.Cle = Cle then return True; end if; Pointeur := Pointeur.all.Suivant; end loop; return False; end Existe; procedure Attribuer (Registre : in out T_Registre; Cle : in Integer; Element : in T_Element) is Pointeur : T_Pointeur_Sur_Maillon; begin if Registre (Hash (Cle)) = null then Pointeur := new T_Maillon; Pointeur.all := (Cle, Element, null); Registre (Hash (Cle)) := Pointeur; else Pointeur := Registre (Hash (Cle)); while Pointeur.all.Suivant /= null loop if Pointeur.all.Cle = Cle then Pointeur.all.Element := Element; return; end if; Pointeur := Pointeur.all.Suivant; end loop; if Pointeur.all.Cle = Cle then Pointeur.all.Element := Element; else Pointeur.all.Suivant := new T_Maillon; Pointeur.all.Suivant.all := (Cle, Element, null); end if; end if; end Attribuer; function Acceder (Registre : T_Registre; Cle : Integer) return T_Element is Pointeur : T_Pointeur_Sur_Maillon; begin Pointeur := Registre (Hash (Cle)); while Pointeur /= null loop if Pointeur.all.Cle = Cle then return Pointeur.all.Element; end if; Pointeur := Pointeur.all.Suivant; end loop; raise Cle_Absente_Exception; end Acceder; procedure Appliquer_Sur_Tous (Registre : in T_Registre) is procedure Appliquer_Sur_Maillon (Pointeur : in T_Pointeur_Sur_Maillon) is begin if Pointeur /= null then P (Pointeur.all.Cle, Pointeur.all.Element); Appliquer_Sur_Maillon (Pointeur.all.Suivant); end if; end Appliquer_Sur_Maillon; begin for I in Registre'Range loop Appliquer_Sur_Maillon (Registre (I)); end loop; end Appliquer_Sur_Tous; procedure Desallouer_Maillon is new Ada.Unchecked_Deallocation (T_Maillon, T_Pointeur_Sur_Maillon); procedure Supprimer (Registre : in out T_Registre; Cle : in Integer) is Pointeur : T_Pointeur_Sur_Maillon; Ancien : T_Pointeur_Sur_Maillon; begin if Registre (Hash (Cle)) /= null then Pointeur := Registre (Hash (Cle)); if Pointeur.all.Cle = Cle then Registre (Hash (Cle)) := Pointeur.all.Suivant; Desallouer_Maillon (Pointeur); return; end if; while Pointeur.all.Suivant /= null loop if Pointeur.all.Suivant.all.Cle = Cle then Ancien := Pointeur.all.Suivant; Pointeur.all.Suivant := Pointeur.all.Suivant.all.Suivant; Desallouer_Maillon (Ancien); return; end if; Pointeur := Pointeur.all.Suivant; end loop; end if; end Supprimer; procedure Supprimer_Maillons (Pointeur : in out T_Pointeur_Sur_Maillon) is begin if Pointeur /= null then Supprimer_Maillons (Pointeur.all.Suivant); end if; Desallouer_Maillon (Pointeur); end Supprimer_Maillons; procedure Detruire (Registre : in out T_Registre) is begin for I in Registre'Range loop Supprimer_Maillons (Registre (I)); end loop; end Detruire; end Registre;
31.02963
79
0.608021
c77ec4edee13805fcd157c33bfcd43dd9d335336
14,658
ada
Ada
aflex/src/vaxvms/skeleton_managerb.ada
irion7/aflex-ayacc-mirror
6c8e444ca735a1e2149beb14c5a85759d05403fe
[ "Unlicense" ]
1
2015-01-18T23:09:29.000Z
2015-01-18T23:09:29.000Z
aflex/src/vaxvms/skeleton_managerb.ada
irion7/aflex-ayacc-mirror
6c8e444ca735a1e2149beb14c5a85759d05403fe
[ "Unlicense" ]
null
null
null
aflex/src/vaxvms/skeleton_managerb.ada
irion7/aflex-ayacc-mirror
6c8e444ca735a1e2149beb14c5a85759d05403fe
[ "Unlicense" ]
null
null
null
-- Copyright (c) 1990 Regents of the University of California. -- All rights reserved. -- -- This software was developed by John Self of the Arcadia project -- at the University of California, Irvine. -- -- Redistribution and use in source and binary forms are permitted -- provided that the above copyright notice and this paragraph are -- duplicated in all such forms and that any documentation, -- advertising materials, and other materials related to such -- distribution and use acknowledge that the software was developed -- by the University of California, Irvine. The name of the -- University may not be used to endorse or promote products derived -- from this software without specific prior written permission. -- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. -- TITLE skeleton manager -- AUTHOR: John Self (UCI) -- DESCRIPTION outputs skeleton sections when called by gen. -- NOTES allows use of internal or external skeleton -- $Header: /dc/uc/self/arcadia/aflex/ada/src/vaxvms/RCS/skeleton_managerb.ada,v 1.3 1993/06/01 19:34:16 self Exp $ -- -- Modified 3.9.92 by Simon Wright ([email protected]), for VAX/VMS -- in which you _must_ use Text_Io.New_Line() to end a line, rather than just -- expecting the runtime to translate '\n' (Ascii.Lf) automatically. -- I also changed ECHO() to just output yytext(1 .. yylength). -- 4.9.92 sjw; removed references to Standard_Error (a VADS feature, I think?) -- which is only used in debug. with MISC_DEFS, TEXT_IO, FILE_STRING; package body SKELETON_MANAGER is use FILE_STRING; -- to save having to type FILE_STRING 177 times USE_EXTERNAL_SKELETON : BOOLEAN := FALSE; -- are we using an external skelfile? CURRENT_LINE : INTEGER := 1; type FILE_ARRAY is array(POSITIVE range <>) of FILE_STRING.VSTRING; SKEL_TEMPLATE : constant FILE_ARRAY := ( -- START OF SKELETON -- START OF S1 VSTR("-- A lexical scanner generated by aflex"), VSTR("with text_io; use text_io;"), VSTR("%% user's code up to the double pound goes right here"), -- BEGIN S2 VSTR("function YYLex return Token is"), VSTR("subtype short is integer range -32768..32767;"), VSTR(" yy_act : integer;"), VSTR(" yy_c : short;"), VSTR(""), VSTR("-- returned upon end-of-file"), VSTR("YY_END_TOK : constant integer := 0;"), VSTR("%% tables get generated here."), -- BEGIN S3 VSTR(""), VSTR("-- copy whatever the last rule matched to the standard output"), VSTR(""), VSTR("procedure ECHO is"), VSTR("begin"), VSTR(" if (text_io.is_open(user_output_file)) then"), VSTR(" for i in 1 .. yylength loop"), VSTR(" if yytext (i) /= ascii.lf then"), VSTR(" text_io.put (user_output_file, yytext (i));"), VSTR(" else"), VSTR(" text_io.new_line(user_output_file);"), VSTR(" end if;"), VSTR(" end loop;"), VSTR(" else"), VSTR(" for i in 1 .. yylength loop"), VSTR(" if yytext (i) /= ascii.lf then"), VSTR(" text_io.put (yytext (i));"), VSTR(" else"), VSTR(" text_io.new_line;"), VSTR(" end if;"), VSTR(" end loop;"), VSTR(" end if;"), VSTR("end ECHO;"), VSTR(""), VSTR("-- enter a start condition."), VSTR("-- Using procedure requires a () after the ENTER, but makes everything"), VSTR("-- much neater."), VSTR(""), VSTR("procedure ENTER( state : integer ) is"), VSTR("begin"), VSTR(" yy_start := 1 + 2 * state;"), VSTR("end ENTER;"), VSTR(""), VSTR("-- action number for EOF rule of a given start state"), VSTR("function YY_STATE_EOF(state : integer) return integer is"), VSTR("begin"), VSTR(" return YY_END_OF_BUFFER + state + 1;"), VSTR("end YY_STATE_EOF;"), VSTR(""), VSTR("-- return all but the first 'n' matched characters back to the input stream"), VSTR("procedure yyless(n : integer) is"), VSTR("begin"), VSTR(" yy_ch_buf(yy_cp) := yy_hold_char; -- undo effects of setting up yytext"), VSTR(" yy_cp := yy_bp + n;"), VSTR(" yy_c_buf_p := yy_cp;"), VSTR(" YY_DO_BEFORE_ACTION; -- set up yytext again"), VSTR("end yyless;"), VSTR(""), VSTR("-- redefine this if you have something you want each time."), VSTR("procedure YY_USER_ACTION is"), VSTR("begin"), VSTR(" null;"), VSTR("end;"), VSTR(""), VSTR("-- yy_get_previous_state - get the state just before the EOB char was reached"), VSTR(""), VSTR("function yy_get_previous_state return yy_state_type is"), VSTR(" yy_current_state : yy_state_type;"), VSTR(" yy_c : short;"), VSTR("%% a local declaration of yy_bp goes here if bol_needed"), VSTR("begin"), VSTR("%% code to get the start state into yy_current_state goes here"), -- BEGIN S3A VSTR(""), VSTR(" for yy_cp in yytext_ptr..yy_c_buf_p - 1 loop"), VSTR("%% code to find the next state goes here"), -- BEGIN S4 VSTR(" end loop;"), VSTR(""), VSTR(" return yy_current_state;"), VSTR("end yy_get_previous_state;"), VSTR(""), VSTR("procedure yyrestart( input_file : file_type ) is"), VSTR("begin"), VSTR(" open_input(text_io.name(input_file));"), VSTR("end yyrestart;"), VSTR(""), VSTR("begin -- of YYLex"), VSTR("<<new_file>>"), VSTR(" -- this is where we enter upon encountering an end-of-file and"), VSTR(" -- yywrap() indicating that we should continue processing"), VSTR(""), VSTR(" if ( yy_init ) then"), VSTR(" if ( yy_start = 0 ) then"), VSTR(" yy_start := 1; -- first start state"), VSTR(" end if;"), VSTR(""), VSTR(" -- we put in the '\n' and start reading from [1] so that an"), VSTR(" -- initial match-at-newline will be true."), VSTR(""), VSTR(" yy_ch_buf(0) := ASCII.LF;"), VSTR(" yy_n_chars := 1;"), VSTR(""), VSTR(" -- we always need two end-of-buffer characters. The first causes"), VSTR(" -- a transition to the end-of-buffer state. The second causes"), VSTR(" -- a jam in that state."), VSTR(""), VSTR(" yy_ch_buf(yy_n_chars) := YY_END_OF_BUFFER_CHAR;"), VSTR(" yy_ch_buf(yy_n_chars + 1) := YY_END_OF_BUFFER_CHAR;"), VSTR(""), VSTR(" yy_eof_has_been_seen := false;"), VSTR(""), VSTR(" yytext_ptr := 1;"), VSTR(" yy_c_buf_p := yytext_ptr;"), VSTR(" yy_hold_char := yy_ch_buf(yy_c_buf_p);"), VSTR(" yy_init := false;"), VSTR("-- UMASS CODES :"), VSTR("-- Initialization"), VSTR(" tok_begin_line := 1;"), VSTR(" tok_end_line := 1;"), VSTR(" tok_begin_col := 0;"), VSTR(" tok_end_col := 0;"), VSTR(" token_at_end_of_line := false;"), VSTR(" line_number_of_saved_tok_line1 := 0;"), VSTR(" line_number_of_saved_tok_line2 := 0;"), VSTR("-- END OF UMASS CODES."), VSTR(" end if; -- yy_init"), VSTR(""), VSTR(" loop -- loops until end-of-file is reached"), VSTR(""), VSTR("-- UMASS CODES :"), VSTR("-- if last matched token is end_of_line, we must"), VSTR("-- update the token_end_line and reset tok_end_col."), VSTR(" if Token_At_End_Of_Line then"), VSTR(" Tok_End_Line := Tok_End_Line + 1;"), VSTR(" Tok_End_Col := 0;"), VSTR(" Token_At_End_Of_Line := False;"), VSTR(" end if;"), VSTR("-- END OF UMASS CODES."), VSTR(""), VSTR(" yy_cp := yy_c_buf_p;"), VSTR(""), VSTR(" -- support of yytext"), VSTR(" yy_ch_buf(yy_cp) := yy_hold_char;"), VSTR(""), VSTR(" -- yy_bp points to the position in yy_ch_buf of the start of the"), VSTR(" -- current run."), VSTR("%%"), -- BEGIN S5 VSTR(""), VSTR("<<next_action>>"), VSTR("%% call to gen_find_action goes here"), -- BEGIN S6 VSTR(" YY_DO_BEFORE_ACTION;"), VSTR(" YY_USER_ACTION;"), VSTR(""), VSTR(" if aflex_debug then -- output acceptance info. for (-d) debug mode"), VSTR(" text_io.put( Standard_Error, ""--accepting rule #"" );"), VSTR(" text_io.put( Standard_Error, INTEGER'IMAGE(yy_act) );"), VSTR(" text_io.put_line( Standard_Error, ""("""""" & yytext & """""")"");"), VSTR(" end if;"), VSTR(""), VSTR("-- UMASS CODES :"), VSTR("-- Update tok_begin_line, tok_end_line, tok_begin_col and tok_end_col"), VSTR("-- after matching the token."), VSTR(" if yy_act /= YY_END_OF_BUFFER and then yy_act /= 0 then"), VSTR("-- Token are matched only when yy_act is not yy_end_of_buffer or 0."), VSTR(" Tok_Begin_Line := Tok_End_Line;"), VSTR(" Tok_Begin_Col := Tok_End_Col + 1;"), VSTR(" Tok_End_Col := Tok_Begin_Col + yy_cp - yy_bp - 1;"), VSTR(" if yy_ch_buf ( yy_bp ) = ASCII.LF then"), VSTR(" Token_At_End_Of_Line := True;"), VSTR(" end if;"), VSTR(" end if;"), VSTR("-- END OF UMASS CODES."), VSTR(""), VSTR("<<do_action>> -- this label is used only to access EOF actions"), VSTR(" case yy_act is"), VSTR("%% actions go here"), -- BEGIN S7 VSTR(" when YY_END_OF_BUFFER =>"), VSTR(" -- undo the effects of YY_DO_BEFORE_ACTION"), VSTR(" yy_ch_buf(yy_cp) := yy_hold_char;"), VSTR(""), VSTR(" yytext_ptr := yy_bp;"), VSTR(""), VSTR(" case yy_get_next_buffer is"), VSTR(" when EOB_ACT_END_OF_FILE =>"), VSTR(" begin"), VSTR(" if ( yywrap ) then"), VSTR(" -- note: because we've taken care in"), VSTR(" -- yy_get_next_buffer() to have set up yytext,"), VSTR(" -- we can now set up yy_c_buf_p so that if some"), VSTR(" -- total hoser (like aflex itself) wants"), VSTR(" -- to call the scanner after we return the"), VSTR(" -- End_Of_Input, it'll still work - another"), VSTR(" -- End_Of_Input will get returned."), VSTR(""), VSTR(" yy_c_buf_p := yytext_ptr;"), VSTR(""), VSTR(" yy_act := YY_STATE_EOF((yy_start - 1) / 2);"), VSTR(""), VSTR(" goto do_action;"), VSTR(" else"), VSTR(" -- start processing a new file"), VSTR(" yy_init := true;"), VSTR(" goto new_file;"), VSTR(" end if;"), VSTR(" end;"), VSTR(" when EOB_ACT_RESTART_SCAN =>"), VSTR(" yy_c_buf_p := yytext_ptr;"), VSTR(" yy_hold_char := yy_ch_buf(yy_c_buf_p);"), VSTR(" when EOB_ACT_LAST_MATCH =>"), VSTR(" yy_c_buf_p := yy_n_chars;"), VSTR(" yy_current_state := yy_get_previous_state;"), VSTR(""), VSTR(" yy_cp := yy_c_buf_p;"), VSTR(" yy_bp := yytext_ptr;"), VSTR(" goto next_action;"), VSTR(" when others => null;"), VSTR(" end case; -- case yy_get_next_buffer()"), VSTR(" when others =>"), VSTR(" text_io.put( ""action # "" );"), VSTR(" text_io.put( INTEGER'IMAGE(yy_act) );"), VSTR(" text_io.new_line;"), VSTR(" raise AFLEX_INTERNAL_ERROR;"), VSTR(" end case; -- case (yy_act)"), VSTR(" end loop; -- end of loop waiting for end of file"), VSTR("end YYLex;"), VSTR("%%"), VSTR("ERROR tried to output beyond end of skeleton file") -- END OF SKELETON ); -- set_external_skeleton -- -- DESCRIPTION -- sets flag so we know to use an external skelfile procedure SET_EXTERNAL_SKELETON is begin USE_EXTERNAL_SKELETON := TRUE; end SET_EXTERNAL_SKELETON; procedure GET_INTERNAL(BUFFER : in out FILE_STRING.VSTRING) is begin BUFFER := SKEL_TEMPLATE(CURRENT_LINE); CURRENT_LINE := CURRENT_LINE + 1; end GET_INTERNAL; procedure GET_EXTERNAL(BUFFER : in out FILE_STRING.VSTRING) is begin FILE_STRING.GET_LINE(MISC_DEFS.SKELFILE, BUFFER); end GET_EXTERNAL; -- end_of_skeleton -- -- DESCRIPTION -- returns true if there are no more lines left to output in the skeleton function END_OF_SKELETON return BOOLEAN is begin if (USE_EXTERNAL_SKELETON) then -- we're using an external skelfile return TEXT_IO.END_OF_FILE(MISC_DEFS.SKELFILE); else -- internal skeleton return CURRENT_LINE > SKEL_TEMPLATE'LAST; end if; end END_OF_SKELETON; procedure GET_FILE_LINE(BUFFER : in out FILE_STRING.VSTRING) is begin if (USE_EXTERNAL_SKELETON) then GET_EXTERNAL(BUFFER); else GET_INTERNAL(BUFFER); end if; end GET_FILE_LINE; -- skelout - write out one section of the skeleton file -- -- DESCRIPTION -- Either outputs internal skeleton, or from a file with "%%" dividers -- if a skeleton file is specified by the user. -- Copies from skelfile to stdout until a line beginning with "%%" or -- EOF is found. procedure SKELOUT is BUF : FILE_STRING.VSTRING; LINE_LEN : INTEGER; -- UMASS CODES : Umass_Codes : Boolean := False; -- Indicates whether or not current line of the template -- is the Umass codes. -- END OF UMASS CODES. begin while (not END_OF_SKELETON) loop GET_FILE_LINE(BUF); if ((FILE_STRING.LEN(BUF) >= 2) and then ((FILE_STRING.CHAR(BUF, 1) = '%') and (FILE_STRING.CHAR(BUF, 2) = '%'))) then exit; else -- UMASS CODES : -- In the template, the codes between "-- UMASS CODES : " and -- "-- END OF UMASS CODES." are specific to be used by Ayacc -- extension. Ayacc extension has more power in error recovery. -- So we generate those codes only when Ayacc_Extension_Flag is True. if FILE_STRING.STR(BUF) = "-- UMASS CODES :" then Umass_Codes := True; end if; if not Umass_Codes or else MISC_DEFS.Ayacc_Extension_Flag then FILE_STRING.PUT_LINE(BUF); end if; if FILE_STRING.STR(BUF) = "-- END OF UMASS CODES." then Umass_Codes := False; end if; -- END OF UMASS CODES. -- UCI CODES commented out : -- The following line is commented out because it is done in Umass codes. -- FILE_STRING.PUT_LINE(BUF); end if; end loop; end SKELOUT; end SKELETON_MANAGER;
38.880637
116
0.591281
13793a8624fcd598c2af3f4bf1877320b4d95ccc
3,476
adb
Ada
llvm-gcc-4.2-2.9/gcc/ada/g-semaph.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-semaph.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
llvm-gcc-4.2-2.9/gcc/ada/g-semaph.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- G N A T . S E M A P H O R E S -- -- -- -- B o d y -- -- -- -- Copyright (C) 2003-2005, 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 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. -- -- -- -- 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. -- -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). -- -- -- ------------------------------------------------------------------------------ package body GNAT.Semaphores is ------------------------ -- Counting_Semaphore -- ------------------------ protected body Counting_Semaphore is ----------- -- Seize -- ----------- entry Seize when Count > 0 is begin Count := Count - 1; end Seize; ------------- -- Release -- ------------- procedure Release is begin Count := Count + 1; end Release; end Counting_Semaphore; ---------------------- -- Binary_Semaphore -- ---------------------- protected body Binary_Semaphore is ----------- -- Seize -- ----------- entry Seize when Available is begin Available := False; end Seize; ------------- -- Release -- ------------- procedure Release is begin Available := True; end Release; end Binary_Semaphore; end GNAT.Semaphores;
39.954023
78
0.4042
1adc688e91b0443358cbf7ecc52e17234090f507
7,072
adb
Ada
src/sys/streams/util-streams-buffered-encoders.adb
yrashk/ada-util
2aaa1d87e92a7137e1c63dce90f0722c549dfafd
[ "Apache-2.0" ]
60
2015-01-18T23:05:34.000Z
2022-03-20T18:56:30.000Z
src/sys/streams/util-streams-buffered-encoders.adb
yrashk/ada-util
2aaa1d87e92a7137e1c63dce90f0722c549dfafd
[ "Apache-2.0" ]
20
2016-09-15T16:41:30.000Z
2022-03-29T22:02:32.000Z
src/sys/streams/util-streams-buffered-encoders.adb
yrashk/ada-util
2aaa1d87e92a7137e1c63dce90f0722c549dfafd
[ "Apache-2.0" ]
10
2015-02-13T04:00:45.000Z
2022-03-20T18:57:54.000Z
----------------------------------------------------------------------- -- util-streams-encoders -- Streams with encoding and decoding capabilities -- Copyright (C) 2017, 2018, 2019, 2021 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 Util.Streams.Buffered.Encoders is -- ----------------------- -- Initialize the stream with a buffer of <b>Size</b> bytes. -- ----------------------- procedure Initialize (Stream : in out Encoder_Stream; Size : in Positive) is begin Buffer_Stream (Stream).Initialize (Size); Stream.No_Flush := True; end Initialize; -- ----------------------- -- Initialize the stream to write on the given stream. -- An internal buffer is allocated for writing the stream. -- ----------------------- -- overriding procedure Produces (Stream : in out Encoder_Stream; Output : access Output_Stream'Class; Size : in Positive) is begin Stream.Initialize (Size); Stream.Output := Output; Stream.No_Flush := False; end Produces; -- ----------------------- -- Initialize the stream to read the given streams. -- ----------------------- procedure Consumes (Stream : in out Encoder_Stream; Input : access Input_Stream'Class; Size : in Positive) is begin Stream.Initialize (Size); Stream.Input := Input; end Consumes; -- ----------------------- -- Close the sink. -- ----------------------- overriding procedure Close (Stream : in out Encoder_Stream) is begin Stream.Flush; if Stream.Output /= null then Stream.Output.Close; end if; end Close; -- ----------------------- -- Write the buffer array to the output stream. -- ----------------------- overriding procedure Write (Stream : in out Encoder_Stream; Buffer : in Ada.Streams.Stream_Element_Array) is First_Encoded : Ada.Streams.Stream_Element_Offset := Buffer'First; Last_Encoded : Ada.Streams.Stream_Element_Offset; Last_Pos : Ada.Streams.Stream_Element_Offset; begin while First_Encoded <= Buffer'Last loop Stream.Transform.Transform (Data => Buffer (First_Encoded .. Buffer'Last), Into => Stream.Buffer (Stream.Write_Pos .. Stream.Buffer'Last), Last => Last_Pos, Encoded => Last_Encoded); if Last_Encoded < Buffer'Last or else Last_Pos = Stream.Buffer'Last then Stream.Output.Write (Stream.Buffer (Stream.Buffer'First .. Last_Pos)); Stream.Write_Pos := Stream.Buffer'First; else Stream.Write_Pos := Last_Pos + 1; end if; First_Encoded := Last_Encoded + 1; end loop; end Write; -- ------------------------------ -- Fill the buffer by reading the input stream. -- Raises Data_Error if there is no input stream; -- ------------------------------ procedure Fill (Stream : in out Encoder_Stream) is begin if Stream.Input = null then Stream.Eof := True; else Stream.Input.Read (Stream.Buffer (1 .. Stream.Last), Stream.Write_Pos); Stream.Eof := Stream.Write_Pos < 1; if not Stream.Eof then Stream.Write_Pos := Stream.Write_Pos + 1; end if; Stream.Read_Pos := 1; end if; end Fill; -- ----------------------- -- Read into the buffer as many bytes as possible and return in -- `last` the position of the last byte read. -- ----------------------- overriding procedure Read (Stream : in out Encoder_Stream; Into : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset) is Start : Stream_Element_Offset := Into'First; Pos : Stream_Element_Offset := Stream.Read_Pos; Avail : Stream_Element_Offset; Last_Decoded : Ada.Streams.Stream_Element_Offset; Last_Pos : Ada.Streams.Stream_Element_Offset; begin while Start <= Into'Last loop Avail := Stream.Write_Pos - Pos; if Avail = 0 then Stream.Fill; Pos := Stream.Read_Pos; Avail := Stream.Write_Pos - Pos; if Avail <= 0 then Last := Start - 1; Stream.Transform.Finish (Into => Into (Start .. Into'Last), Last => Last); return; end if; end if; Stream.Transform.Transform (Data => Stream.Buffer (Pos .. Pos + Avail - 1), Into => Into (Start .. Into'Last), Last => Last_Pos, Encoded => Last_Decoded); Stream.Read_Pos := Last_Decoded + 1; Start := Last_Pos + 1; exit when Stream.Read_Pos = Pos; Pos := Stream.Read_Pos; end loop; Last := Start - 1; end Read; -- ----------------------- -- Flush the buffer by writing on the output stream. -- Raises Data_Error if there is no output stream. -- ----------------------- overriding procedure Flush (Stream : in out Encoder_Stream) is Last_Pos : Ada.Streams.Stream_Element_Offset := Stream.Write_Pos - 1; begin if not Stream.Flushed and then Stream.Buffer /= null and then Stream.Write_Pos >= Stream.Buffer'First then Stream.Transform.Finish (Stream.Buffer (Stream.Write_Pos .. Stream.Buffer'Last), Last_Pos); Stream.Write_Pos := Last_Pos + 1; if not Stream.No_Flush then if Stream.Write_Pos > 1 then if Stream.Output /= null then Stream.Output.Write (Stream.Buffer (1 .. Stream.Write_Pos - 1)); end if; Stream.Write_Pos := 1; end if; if Stream.Output /= null then Stream.Output.Flush; end if; end if; Stream.Flushed := True; end if; end Flush; overriding procedure Finalize (Stream : in out Encoder_Stream) is begin if not Stream.Flushed and then Stream.Buffer /= null then Stream.Flush; end if; Buffer_Stream (Stream).Finalize; end Finalize; end Util.Streams.Buffered.Encoders;
36.833333
89
0.549208
0490e9e9f922c21328af4e6cbe4ff7c5bc6a3321
4,569
ads
Ada
source/league/codecs/matreshka-internals-text_codecs-koi8u.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/league/codecs/matreshka-internals-text_codecs-koi8u.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/league/codecs/matreshka-internals-text_codecs-koi8u.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, 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$ ------------------------------------------------------------------------------ private package Matreshka.Internals.Text_Codecs.KOI8U is pragma Preelaborate; ------------------------- -- KOI8U_Decoder -- ------------------------- type KOI8U_Decoder is new Abstract_Decoder with private; overriding function Is_Error (Self : KOI8U_Decoder) return Boolean; overriding function Is_Mailformed (Self : KOI8U_Decoder) return Boolean; overriding procedure Decode_Append (Self : in out KOI8U_Decoder; Data : Ada.Streams.Stream_Element_Array; String : in out Matreshka.Internals.Strings.Shared_String_Access); function Decoder (Mode : Decoder_Mode) return Abstract_Decoder'Class; ------------------------- -- KOI8U_Encoder -- ------------------------- type KOI8U_Encoder is new Abstract_Encoder with private; overriding procedure Encode (Self : in out KOI8U_Encoder; String : not null Matreshka.Internals.Strings.Shared_String_Access; Buffer : out MISEV.Shared_Stream_Element_Vector_Access); function Encoder return Abstract_Encoder'Class; private type KOI8U_Decoder is new Abstract_Decoder with null record; type KOI8U_Encoder is new Abstract_Encoder with null record; end Matreshka.Internals.Text_Codecs.KOI8U;
52.517241
78
0.477347
1a761a5414d2c9f05e837a1649bfc3305df49e35
3,911
ada
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c43204i.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/c4/c43204i.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c43204i.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- C43204I.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 AN AGGREGATE WITH AN OTHERS CLAUSE CAN APPEAR AS THE -- EXPRESSION IN AN ASSIGNMENT STATEMENT, AND THAT THE BOUNDS OF -- THE AGGREGATE ARE DETERMINED CORRECTLY. -- HISTORY: -- JET 08/15/88 CREATED ORIGINAL TEST. WITH REPORT; USE REPORT; PROCEDURE C43204I IS TYPE ARR11 IS ARRAY (INTEGER RANGE -3 .. 3) OF INTEGER; TYPE ARR12 IS ARRAY (IDENT_INT(-3) .. IDENT_INT(3)) OF INTEGER; TYPE ARR13 IS ARRAY (IDENT_INT(1) .. IDENT_INT(-1)) OF INTEGER; TYPE ARR21 IS ARRAY (INTEGER RANGE -1 .. 1, INTEGER RANGE -1 .. 1) OF INTEGER; TYPE ARR22 IS ARRAY (IDENT_INT(-1) .. IDENT_INT(1), IDENT_INT(-1) .. IDENT_INT(1)) OF INTEGER; TYPE ARR23 IS ARRAY (INTEGER RANGE -1 .. 1, IDENT_INT(-1) .. IDENT_INT(1)) OF INTEGER; TYPE ARR24 IS ARRAY (IDENT_INT(1) .. IDENT_INT(-1), IDENT_INT(-1) .. IDENT_INT(1)) OF INTEGER; VA11 : ARR11; VA12 : ARR12; VA13 : ARR13; VA21 : ARR21; VA22 : ARR22; VA23 : ARR23; VA24 : ARR24; BEGIN TEST ("C43204I", "CHECK THAT AN AGGREGATE WITH AN OTHERS CLAUSE " & "CAN APPEAR AS THE EXPRESSION IN AN ASSIGNMENT " & "STATEMENT, AND THAT THE BOUNDS OF THE " & "AGGREGATE ARE DETERMINED CORRECTLY"); VA11 := (1,1, OTHERS => IDENT_INT(2)); VA12 := (OTHERS => IDENT_INT(2)); VA13 := (OTHERS => IDENT_INT(2)); VA21 := ((1,1,1), OTHERS => (-1..1 => IDENT_INT(2))); VA22 := (-1 => (1,1,1), 0..1 => (OTHERS => IDENT_INT(2))); VA23 := (OTHERS => (OTHERS => IDENT_INT(2))); VA24 := (OTHERS => (OTHERS => IDENT_INT(2))); IF VA11 /= (1, 1, 2, 2, 2, 2, 2) THEN FAILED("INCORRECT VALUE OF VA11"); END IF; IF VA12 /= (2, 2, 2, 2, 2, 2, 2) THEN FAILED("INCORRECT VALUE OF VA12"); END IF; IF VA13'LENGTH /= 0 THEN FAILED("INCORRECT VALUE OF VA13"); END IF; IF VA21 /= ((1,1,1), (2,2,2), (2,2,2)) THEN FAILED("INCORRECT VALUE OF VA21"); END IF; IF VA22 /= ((1,1,1), (2,2,2), (2,2,2)) THEN FAILED("INCORRECT VALUE OF VA22"); END IF; IF VA23 /= ((2,2,2), (2,2,2), (2,2,2)) THEN FAILED("INCORRECT VALUE OF VA23"); END IF; IF VA24'LENGTH /= 0 OR VA24'LENGTH(2) /= 3 THEN FAILED("INCORRECT VALUE OF VA24"); END IF; RESULT; EXCEPTION WHEN OTHERS => FAILED ("UNEXPECTED CONSTRAINT_ERROR OR OTHER EXCEPTION " & "RAISED"); RESULT; END C43204I;
36.551402
79
0.581437
c78858aeca4504869079388bb76b2c1e22c94c66
70,076
adb
Ada
tools-src/gnu/gcc/gcc/ada/a-except.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/a-except.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/a-except.adb
modern-tomato/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
69
2015-01-02T10:45:56.000Z
2021-09-06T07:52:13.000Z
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- A D A . E X C E P T I O N S -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992-2001 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. -- -- -- ------------------------------------------------------------------------------ pragma Polling (Off); -- We must turn polling off for this unit, because otherwise we get -- elaboration circularities with System.Exception_Tables. with Ada.Unchecked_Deallocation; with GNAT.Heap_Sort_A; use GNAT.Heap_Sort_A; with System; use System; with System.Exception_Table; use System.Exception_Table; with System.Exceptions; use System.Exceptions; with System.Standard_Library; use System.Standard_Library; with System.Storage_Elements; use System.Storage_Elements; with System.Soft_Links; use System.Soft_Links; with System.Machine_State_Operations; use System.Machine_State_Operations; with System.Traceback; with Unchecked_Conversion; package body Ada.Exceptions is procedure builtin_longjmp (buffer : Address; Flag : Integer); pragma No_Return (builtin_longjmp); pragma Import (C, builtin_longjmp, "_gnat_builtin_longjmp"); pragma Suppress (All_Checks); -- We definitely do not want exceptions occurring within this unit, or -- we are in big trouble. If an exceptional situation does occur, better -- that it not be raised, since raising it can cause confusing chaos. type Subprogram_Descriptor_List_Ptr is access all Subprogram_Descriptor_List; Subprogram_Descriptors : Subprogram_Descriptor_List_Ptr; -- This location is initialized by Register_Exceptions to point to a -- list of pointers to procedure descriptors, sorted into ascending -- order of PC addresses. -- -- Note that SDP_Table_Build is called *before* this unit (or any -- other unit) is elaborated. That's important, because exceptions can -- and do occur during elaboration of units, and must be handled during -- elaboration. This means that we are counting on the fact that the -- initialization of Subprogram_Descriptors to null is done by the -- load process and NOT by an explicit assignment during elaboration. Num_Subprogram_Descriptors : Natural; -- Number of subprogram descriptors, the useful descriptors are stored -- in Subprogram_Descriptors (1 .. Num_Subprogram_Descriptors). There -- can be unused entries at the end of the array due to elimination of -- duplicated entries (which can arise from use of pragma Import). Exception_Tracebacks : Integer; pragma Import (C, Exception_Tracebacks, "__gl_exception_tracebacks"); -- Boolean indicating whether tracebacks should be stored in exception -- occurrences. Nline : constant String := String' (1 => ASCII.LF); -- Convenient shortcut ----------------------- -- Local Subprograms -- ----------------------- -- Note: the exported subprograms in this package body are called directly -- from C clients using the given external name, even though they are not -- technically visible in the Ada sense. procedure AAA; -- Mark start of procedures in this unit procedure ZZZ; -- Mark end of procedures in this package Address_Image_Length : constant := 13 + 10 * Boolean'Pos (Standard'Address_Size > 32); -- Length of string returned by Address_Image function function Address_Image (A : System.Address) return String; -- Returns at string of the form 0xhhhhhhhhh for 32-bit addresses -- or 0xhhhhhhhhhhhhhhhh for 64-bit addresses. Hex characters are -- in lower case. procedure Free is new Ada.Unchecked_Deallocation (Subprogram_Descriptor_List, Subprogram_Descriptor_List_Ptr); procedure Raise_Current_Excep (E : Exception_Id); pragma No_Return (Raise_Current_Excep); pragma Export (C, Raise_Current_Excep, "__gnat_raise_nodefer_with_msg"); -- This is the lowest level raise routine. It raises the exception -- referenced by Current_Excep.all in the TSD, without deferring -- abort (the caller must ensure that abort is deferred on entry). -- The parameter E is ignored. -- -- This external name for Raise_Current_Excep is historical, and probably -- should be changed but for now we keep it, because gdb knows about it. -- The parameter is also present for historical compatibility. ??? procedure Raise_Exception_No_Defer (E : Exception_Id; Message : String := ""); pragma Export (Ada, Raise_Exception_No_Defer, "ada__exceptions__raise_exception_no_defer"); pragma No_Return (Raise_Exception_No_Defer); -- Similar to Raise_Exception, but with no abort deferral procedure Raise_With_Msg (E : Exception_Id); pragma No_Return (Raise_With_Msg); pragma Export (C, Raise_With_Msg, "__gnat_raise_with_msg"); -- Raises an exception with given exception id value. A message -- is associated with the raise, and has already been stored in the -- exception occurrence referenced by the Current_Excep in the TSD. -- Abort is deferred before the raise call. procedure Raise_With_Location (E : Exception_Id; F : SSL.Big_String_Ptr; L : Integer); pragma No_Return (Raise_With_Location); -- Raise an exception with given exception id value. A filename and line -- number is associated with the raise and is stored in the exception -- occurrence. procedure Raise_Constraint_Error (File : SSL.Big_String_Ptr; Line : Integer); pragma No_Return (Raise_Constraint_Error); pragma Export (C, Raise_Constraint_Error, "__gnat_raise_constraint_error"); -- Raise constraint error with file:line information procedure Raise_Program_Error (File : SSL.Big_String_Ptr; Line : Integer); pragma No_Return (Raise_Program_Error); pragma Export (C, Raise_Program_Error, "__gnat_raise_program_error"); -- Raise program error with file:line information procedure Raise_Storage_Error (File : SSL.Big_String_Ptr; Line : Integer); pragma No_Return (Raise_Storage_Error); pragma Export (C, Raise_Storage_Error, "__gnat_raise_storage_error"); -- Raise storage error with file:line information -- The exception raising process and the automatic tracing mechanism rely -- on some careful use of flags attached to the exception occurrence. The -- graph below illustrates the relations between the Raise_ subprograms -- and identifies the points where basic flags such as Exception_Raised -- are initialized. -- -- (i) signs indicate the flags initialization points. R stands for Raise, -- W for With, and E for Exception. -- -- R_No_Msg R_E R_Pe R_Ce R_Se -- | | | | | -- +--+ +--+ +---+ | +---+ -- | | | | | -- R_E_No_Defer(i) R_W_Msg(i) R_W_Loc R_W_C_Msg -- | | | | | | -- +------------+ | +-----------+ +--+ +--+ | -- | | | | | | -- | | | Set_E_C_Msg(i) | -- | | | | -- | | | +--------------------------+ -- | | | | -- Raise_Current_Excep procedure Reraise; pragma No_Return (Reraise); pragma Export (C, Reraise, "__gnat_reraise"); -- Reraises the exception referenced by the Current_Excep field of -- the TSD (all fields of this exception occurrence are set). Abort -- is deferred before the reraise operation. function SDP_Table_Sort_Lt (Op1, Op2 : Natural) return Boolean; -- Used in call to sort SDP table (SDP_Table_Build), compares two elements procedure SDP_Table_Sort_Move (From : Natural; To : Natural); -- Used in call to sort SDP table (SDP_Table_Build), moves one element procedure Set_Exception_C_Msg (Id : Exception_Id; Msg : SSL.Big_String_Ptr; Line : Integer := 0); -- This routine is called to setup the exception referenced by the -- Current_Excep field in the TSD to contain the indicated Id value -- and message. Msg is a null terminated string. when Line > 0, -- Msg is the filename and line the line number of the exception location. procedure To_Stderr (S : String); pragma Export (Ada, To_Stderr, "__gnat_to_stderr"); -- Little routine to output string to stderr that is also used -- in the tasking run time. procedure Unhandled_Exception_Terminate; pragma No_Return (Unhandled_Exception_Terminate); -- This procedure is called to terminate execution following an unhandled -- exception. The exception information, including traceback if available -- is output, and execution is then terminated. Note that at the point -- where this routine is called, the stack has typically been destroyed --------------------------------- -- Debugger Interface Routines -- --------------------------------- -- The routines here are null routines that normally have no effect. -- they are provided for the debugger to place breakpoints on their -- entry points to get control on an exception. procedure Notify_Exception (Id : Exception_Id; Handler : Code_Loc; Is_Others : Boolean); pragma Export (C, Notify_Exception, "__gnat_notify_exception"); -- This routine is called whenever an exception is signalled. The Id -- parameter is the Exception_Id of the exception being raised. The -- second parameter Handler is Null_Loc if the exception is unhandled, -- and is otherwise the entry point of the handler that will handle -- the exception. Is_Others is True if the handler is an others handler -- and False otherwise. In the unhandled exception case, if possible -- (and certainly if zero cost exception handling is active), the -- stack is still intact when this procedure is called. Note that this -- routine is entered before any finalization handlers are entered if -- the exception is unhandled by a "real" exception handler. procedure Unhandled_Exception; pragma Export (C, Unhandled_Exception, "__gnat_unhandled_exception"); -- This routine is called in addition to Notify_Exception in the -- unhandled exception case. The fact that there are two routines -- which are somewhat redundant is historical. Notify_Exception -- certainly is complete enough, but GDB still uses this routine. --------------------------------------- -- Exception backtracing subprograms -- --------------------------------------- -- What is automatically output when exception tracing is on basically -- corresponds to the usual exception information, but with the call -- chain backtrace possibly tailored by a backtrace decorator. Modifying -- Exception_Information itself is not a good idea because the decorated -- output is completely out of control and would break all our code -- related to the streaming of exceptions. -- -- We then provide an alternative function to Exception_Information to -- compute the possibly tailored output, which is equivalent if no -- decorator is currently set : function Tailored_Exception_Information (X : Exception_Occurrence) return String; -- Exception information to be output in the case of automatic tracing -- requested through GNAT.Exception_Traces. -- -- This is the same as Exception_Information if no backtrace decorator -- is currently in place. Otherwise, this is Exception_Information with -- the call chain raw addresses replaced by the result of a call to the -- current decorator provided with the call chain addresses. pragma Export (Ada, Tailored_Exception_Information, "__gnat_tailored_exception_information"); -- This function is used within this package but also from within -- System.Tasking.Stages. -- -- The output of Exception_Information and Tailored_Exception_Information -- share a common part which was formerly built using local procedures -- within Exception_Information. These procedures have been extracted from -- their original place to be available to Tailored_Exception_Information -- also. -- -- Each of these procedures appends some input to an information string -- currently being built. The Ptr argument represents the last position -- in this string at which a character has been written. procedure Append_Info_Nat (N : Natural; Info : in out String; Ptr : in out Natural); -- Append the image of N at the end of the provided information string. procedure Append_Info_NL (Info : in out String; Ptr : in out Natural); -- Append a CR/LF couple at the end of the provided information string. procedure Append_Info_String (S : String; Info : in out String; Ptr : in out Natural); -- Append a string at the end of the provided information string. -- To build Exception_Information and Tailored_Exception_Information, -- we then use three intermediate functions : function Basic_Exception_Information (X : Exception_Occurrence) return String; -- Returns the basic exception information string associated with a -- given exception occurrence. This is the common part shared by both -- Exception_Information and Tailored_Exception_Infomation. function Basic_Exception_Traceback (X : Exception_Occurrence) return String; -- Returns an image of the complete call chain associated with an -- exception occurrence in its most basic form, that is as a raw sequence -- of hexadecimal binary addresses. function Tailored_Exception_Traceback (X : Exception_Occurrence) return String; -- Returns an image of the complete call chain associated with an -- exception occurrence, either in its basic form if no decorator is -- in place, or as formatted by the decorator otherwise. -- The overall organization of the exception information related code -- is summarized below : -- -- Exception_Information -- | -- +-------+--------+ -- | | -- Basic_Exc_Info & Basic_Exc_Tback -- -- -- Tailored_Exception_Information -- | -- +----------+----------+ -- | | -- Basic_Exc_Info & Tailored_Exc_Tback -- | -- +-----------+------------+ -- | | -- Basic_Exc_Tback Or Tback_Decorator -- if no decorator set otherwise ---------------------------------------------- -- Run-Time Exception Notification Routines -- ---------------------------------------------- -- The notification routines described above are low level "handles" for -- the debugger but what needs to be done at the notification points -- always involves more than just calling one of these routines. The -- routines below provide a common run-time interface for this purpose, -- with variations depending on the handled/not handled status of the -- occurrence. They are exported to be usable by the Ada exception -- handling personality routine when the GCC 3 mechanism is used. procedure Notify_Handled_Exception (Handler : Code_Loc; Is_Others : Boolean; Low_Notify : Boolean); pragma Export (C, Notify_Handled_Exception, "__gnat_notify_handled_exception"); -- Routine to call when a handled occurrence is about to be propagated. -- Low_Notify might be set to false to skip the low level debugger -- notification, which is useful when the information it requires is -- not available, like in the SJLJ case. procedure Notify_Unhandled_Exception (Id : Exception_Id); pragma Export (C, Notify_Unhandled_Exception, "__gnat_notify_unhandled_exception"); -- Routine to call when an unhandled occurrence is about to be propagated. -------------------------------- -- Import Run-Time C Routines -- -------------------------------- -- The purpose of the following pragma Imports is to ensure that we -- generate appropriate subprogram descriptors for all C routines in -- the standard GNAT library that can raise exceptions. This ensures -- that the exception propagation can properly find these routines pragma Warnings (Off); -- so old compiler does not complain pragma Propagate_Exceptions; procedure Unhandled_Terminate; pragma Import (C, Unhandled_Terminate, "__gnat_unhandled_terminate"); procedure Propagate_Exception (Mstate : Machine_State); pragma No_Return (Propagate_Exception); -- This procedure propagates the exception represented by the occurrence -- referenced by Current_Excep in the TSD for the current task. M is -- the initial machine state, representing the site of the exception -- raise operation. Propagate_Exception searches the exception tables -- for an applicable handler, calling Pop_Frame as needed. If and when -- it locates an applicable handler Propagate_Exception makes a call -- to Enter_Handler to actually enter the handler. If the search is -- unable to locate an applicable handler, execution is terminated by -- calling Unhandled_Exception_Terminate. procedure Call_Chain (Excep : EOA); -- Store up to Max_Tracebacks in Excep, corresponding to the current -- call chain. ----------------------- -- Polling Interface -- ----------------------- type Unsigned is mod 2 ** 32; Counter : Unsigned := 0; -- This counter is provided for convenience. It can be used in Poll to -- perform periodic but not systematic operations. procedure Poll is separate; -- The actual polling routine is separate, so that it can easily -- be replaced with a target dependent version. --------- -- AAA -- --------- -- This dummy procedure gives us the start of the PC range for addresses -- within the exception unit itself. We hope that gigi/gcc keep all the -- procedures in their original order! procedure AAA is begin null; end AAA; ------------------- -- Address_Image -- ------------------- function Address_Image (A : Address) return String is S : String (1 .. 18); P : Natural; N : Integer_Address; H : constant array (Integer range 0 .. 15) of Character := "0123456789abcdef"; begin P := S'Last; N := To_Integer (A); while N /= 0 loop S (P) := H (Integer (N mod 16)); P := P - 1; N := N / 16; end loop; S (P - 1) := '0'; S (P) := 'x'; return S (P - 1 .. S'Last); end Address_Image; --------------------- -- Append_Info_Nat -- --------------------- procedure Append_Info_Nat (N : Natural; Info : in out String; Ptr : in out Natural) is begin if N > 9 then Append_Info_Nat (N / 10, Info, Ptr); end if; Ptr := Ptr + 1; Info (Ptr) := Character'Val (Character'Pos ('0') + N mod 10); end Append_Info_Nat; -------------------- -- Append_Info_NL -- -------------------- procedure Append_Info_NL (Info : in out String; Ptr : in out Natural) is begin Ptr := Ptr + 1; Info (Ptr) := ASCII.CR; Ptr := Ptr + 1; Info (Ptr) := ASCII.LF; end Append_Info_NL; ------------------------ -- Append_Info_String -- ------------------------ procedure Append_Info_String (S : String; Info : in out String; Ptr : in out Natural) is begin Info (Ptr + 1 .. Ptr + S'Length) := S; Ptr := Ptr + S'Length; end Append_Info_String; --------------------------------- -- Basic_Exception_Information -- --------------------------------- function Basic_Exception_Information (X : Exception_Occurrence) return String is Name : constant String := Exception_Name (X); Msg : constant String := Exception_Message (X); -- Exception name and message that are going to be included in the -- information to return, if not empty. Name_Len : constant Natural := Name'Length; Msg_Len : constant Natural := Msg'Length; -- Length of these strings, useful to compute the size of the string -- we have to allocate for the complete result as well as in the body -- of this procedure. Info_Maxlen : constant Natural := 50 + Name_Len + Msg_Len; -- Maximum length of the information string we will build, with : -- -- 50 = 16 + 2 for the text associated with the name -- + 9 + 2 for the text associated with the message -- + 5 + 2 for the text associated with the pid -- + 14 for the text image of the pid itself and a margin. -- -- This is indeed a maximum since some data may not appear at all if -- not relevant. For example, nothing related to the exception message -- will be there if this message is empty. -- -- WARNING : Do not forget to update these numbers if anything -- involved in the computation changes. Info : String (1 .. Info_Maxlen); -- Information string we are going to build, containing the common -- part shared by Exc_Info and Tailored_Exc_Info. Ptr : Natural := 0; begin -- Output exception name and message except for _ABORT_SIGNAL, where -- these two lines are omitted (see discussion above). if Name (1) /= '_' then Append_Info_String ("Exception name: ", Info, Ptr); Append_Info_String (Name, Info, Ptr); Append_Info_NL (Info, Ptr); if Msg_Len /= 0 then Append_Info_String ("Message: ", Info, Ptr); Append_Info_String (Msg, Info, Ptr); Append_Info_NL (Info, Ptr); end if; end if; -- Output PID line if non-zero if X.Pid /= 0 then Append_Info_String ("PID: ", Info, Ptr); Append_Info_Nat (X.Pid, Info, Ptr); Append_Info_NL (Info, Ptr); end if; return Info (1 .. Ptr); end Basic_Exception_Information; ------------------------------- -- Basic_Exception_Traceback -- ------------------------------- function Basic_Exception_Traceback (X : Exception_Occurrence) return String is Info_Maxlen : constant Natural := 35 + X.Num_Tracebacks * 19; -- Maximum length of the information string we are building, with : -- 33 = 31 + 4 for the text before and after the traceback, and -- 19 = 2 + 16 + 1 for each address ("0x" + HHHH + " ") -- -- WARNING : Do not forget to update these numbers if anything -- involved in the computation changes. Info : String (1 .. Info_Maxlen); -- Information string we are going to build, containing an image -- of the call chain associated with the exception occurrence in its -- most basic form, that is as a sequence of binary addresses. Ptr : Natural := 0; begin if X.Num_Tracebacks > 0 then Append_Info_String ("Call stack traceback locations:", Info, Ptr); Append_Info_NL (Info, Ptr); for J in 1 .. X.Num_Tracebacks loop Append_Info_String (Address_Image (X.Tracebacks (J)), Info, Ptr); exit when J = X.Num_Tracebacks; Append_Info_String (" ", Info, Ptr); end loop; Append_Info_NL (Info, Ptr); end if; return Info (1 .. Ptr); end Basic_Exception_Traceback; ----------------- -- Break_Start -- ----------------- procedure Break_Start is begin null; end Break_Start; ---------------- -- Call_Chain -- ---------------- procedure Call_Chain (Excep : EOA) is begin if Excep.Num_Tracebacks /= 0 then -- This is a reraise, no need to store a new (wrong) chain. return; end if; System.Traceback.Call_Chain (Excep.Tracebacks'Address, Max_Tracebacks, Excep.Num_Tracebacks, AAA'Address, ZZZ'Address); end Call_Chain; ------------------------------ -- Current_Target_Exception -- ------------------------------ function Current_Target_Exception return Exception_Occurrence is begin return Null_Occurrence; end Current_Target_Exception; ------------------- -- EId_To_String -- ------------------- function EId_To_String (X : Exception_Id) return String is begin if X = Null_Id then return ""; else return Exception_Name (X); end if; end EId_To_String; ------------------ -- EO_To_String -- ------------------ -- We use the null string to represent the null occurrence, otherwise -- we output the Exception_Information string for the occurrence. function EO_To_String (X : Exception_Occurrence) return String is begin if X.Id = Null_Id then return ""; else return Exception_Information (X); end if; end EO_To_String; ------------------------ -- Exception_Identity -- ------------------------ function Exception_Identity (X : Exception_Occurrence) return Exception_Id is begin if X.Id = Null_Id then raise Constraint_Error; else return X.Id; end if; end Exception_Identity; --------------------------- -- Exception_Information -- --------------------------- -- The format of the string is: -- Exception_Name: nnnnn -- Message: mmmmm -- PID: ppp -- Call stack traceback locations: -- 0xhhhh 0xhhhh 0xhhhh ... 0xhhh -- where -- nnnn is the fully qualified name of the exception in all upper -- case letters. This line is always present. -- mmmm is the message (this line present only if message is non-null) -- ppp is the Process Id value as a decimal integer (this line is -- present only if the Process Id is non-zero). Currently we are -- not making use of this field. -- The Call stack traceback locations line and the following values -- are present only if at least one traceback location was recorded. -- the values are given in C style format, with lower case letters -- for a-f, and only as many digits present as are necessary. -- The line terminator sequence at the end of each line, including the -- last line is a CR-LF sequence (16#0D# followed by 16#0A#). -- The Exception_Name and Message lines are omitted in the abort -- signal case, since this is not really an exception, and the only -- use of this routine is internal for printing termination output. -- WARNING: if the format of the generated string is changed, please note -- that an equivalent modification to the routine String_To_EO must be -- made to preserve proper functioning of the stream attributes. function Exception_Information (X : Exception_Occurrence) return String is -- This information is now built using the circuitry introduced in -- association with the support of traceback decorators, as the -- catenation of the exception basic information and the call chain -- backtrace in its basic form. Basic_Info : constant String := Basic_Exception_Information (X); Tback_Info : constant String := Basic_Exception_Traceback (X); Basic_Len : constant Natural := Basic_Info'Length; Tback_Len : constant Natural := Tback_Info'Length; Info : String (1 .. Basic_Len + Tback_Len); Ptr : Natural := 0; begin Append_Info_String (Basic_Info, Info, Ptr); Append_Info_String (Tback_Info, Info, Ptr); return Info; end Exception_Information; ----------------------- -- Exception_Message -- ----------------------- function Exception_Message (X : Exception_Occurrence) return String is begin if X.Id = Null_Id then raise Constraint_Error; end if; return X.Msg (1 .. X.Msg_Length); end Exception_Message; -------------------- -- Exception_Name -- -------------------- function Exception_Name (Id : Exception_Id) return String is begin if Id = null then raise Constraint_Error; end if; return Id.Full_Name.all (1 .. Id.Name_Length - 1); end Exception_Name; function Exception_Name (X : Exception_Occurrence) return String is begin return Exception_Name (X.Id); end Exception_Name; --------------------------- -- Exception_Name_Simple -- --------------------------- function Exception_Name_Simple (X : Exception_Occurrence) return String is Name : constant String := Exception_Name (X); P : Natural; begin P := Name'Length; while P > 1 loop exit when Name (P - 1) = '.'; P := P - 1; end loop; return Name (P .. Name'Length); end Exception_Name_Simple; ------------------------- -- Propagate_Exception -- ------------------------- procedure Propagate_Exception (Mstate : Machine_State) is Excep : constant EOA := Get_Current_Excep.all; Loc : Code_Loc; Lo, Hi : Natural; Pdesc : Natural; Hrec : Handler_Record_Ptr; Info : Subprogram_Info_Type; type Machine_State_Record is new Storage_Array (1 .. Machine_State_Length); for Machine_State_Record'Alignment use Standard'Maximum_Alignment; procedure Duplicate_Machine_State (Dest, Src : Machine_State); -- Copy Src into Dest, assuming that a Machine_State is pointing to -- an area of Machine_State_Length bytes. procedure Duplicate_Machine_State (Dest, Src : Machine_State) is type Machine_State_Record_Access is access Machine_State_Record; function To_MSR is new Unchecked_Conversion (Machine_State, Machine_State_Record_Access); begin To_MSR (Dest).all := To_MSR (Src).all; end Duplicate_Machine_State; -- Data for handling the finalization handler case. A simple approach -- in this routine would simply to unwind stack frames till we find a -- handler and then enter it. But this is undesirable in the case where -- we have only finalization handlers, and no "real" handler, i.e. a -- case where we have an unhandled exception. -- In this case we prefer to signal unhandled exception with the stack -- intact, and entering finalization handlers would destroy the stack -- state. To deal with this, as we unwind the stack, we note the first -- finalization handler, and remember it in the following variables. -- We then continue to unwind. If and when we find a "real", i.e. non- -- finalization handler, then we use these variables to pass control to -- the finalization handler. FH_Found : Boolean := False; -- Set when a finalization handler is found FH_Mstate : aliased Machine_State_Record; -- Records the machine state for the finalization handler FH_Handler : Code_Loc; -- Record handler address for finalization handler FH_Num_Trb : Natural; -- Save number of tracebacks for finalization handler begin -- Loop through stack frames as exception propagates Main_Loop : loop Loc := Get_Code_Loc (Mstate); exit Main_Loop when Loc = Null_Loc; -- Record location unless it is inside this unit. Note: this -- test should really say Code_Address, but Address is the same -- as Code_Address for unnested subprograms, and Code_Address -- would cause a bootstrap problem if Loc < AAA'Address or else Loc > ZZZ'Address then -- Record location unless we already recorded max tracebacks if Excep.Num_Tracebacks /= Max_Tracebacks then -- Do not record location if it is the return point from -- a reraise call from within a cleanup handler if not Excep.Cleanup_Flag then Excep.Num_Tracebacks := Excep.Num_Tracebacks + 1; Excep.Tracebacks (Excep.Num_Tracebacks) := Loc; -- For reraise call from cleanup handler, skip entry and -- clear the flag so that we will start to record again else Excep.Cleanup_Flag := False; end if; end if; end if; -- Do binary search on procedure table Lo := 1; Hi := Num_Subprogram_Descriptors; -- Binary search loop loop Pdesc := (Lo + Hi) / 2; -- Note that Loc is expected to be the procedure's call point -- and not the return point. if Loc < Subprogram_Descriptors (Pdesc).Code then Hi := Pdesc - 1; elsif Pdesc < Num_Subprogram_Descriptors and then Loc > Subprogram_Descriptors (Pdesc + 1).Code then Lo := Pdesc + 1; else exit; end if; -- This happens when the current Loc is completely outside of -- the range of the program, which usually means that we reached -- the top level frame (e.g __start). In this case we have an -- unhandled exception. exit Main_Loop when Hi < Lo; end loop; -- Come here with Subprogram_Descriptors (Pdesc) referencing the -- procedure descriptor that applies to this PC value. Now do a -- serial search to see if any handler is applicable to this PC -- value, and to the exception that we are propagating for J in 1 .. Subprogram_Descriptors (Pdesc).Num_Handlers loop Hrec := Subprogram_Descriptors (Pdesc).Handler_Records (J); if Loc >= Hrec.Lo and then Loc < Hrec.Hi then -- PC range is applicable, see if handler is for this exception -- First test for case of "all others" (finalization) handler. -- We do not enter such a handler until we are sure there is -- a real handler further up the stack. if Hrec.Id = All_Others_Id then -- If this is the first finalization handler, then -- save the machine state so we can enter it later -- without having to repeat the search. if not FH_Found then FH_Found := True; Duplicate_Machine_State (Machine_State (FH_Mstate'Address), Mstate); FH_Handler := Hrec.Handler; FH_Num_Trb := Excep.Num_Tracebacks; end if; -- Normal (non-finalization exception with matching Id) elsif Excep.Id = Hrec.Id or else (Hrec.Id = Others_Id and not Excep.Id.Not_Handled_By_Others) then -- Perform the necessary notification tasks. Notify_Handled_Exception (Hrec.Handler, Hrec.Id = Others_Id, True); -- If we already encountered a finalization handler, then -- reset the context to that handler, and enter it. if FH_Found then Excep.Num_Tracebacks := FH_Num_Trb; Excep.Cleanup_Flag := True; Enter_Handler (Machine_State (FH_Mstate'Address), FH_Handler); -- If we have not encountered a finalization handler, -- then enter the current handler. else Enter_Handler (Mstate, Hrec.Handler); end if; end if; end if; end loop; Info := Subprogram_Descriptors (Pdesc).Subprogram_Info; exit Main_Loop when Info = No_Info; Pop_Frame (Mstate, Info); end loop Main_Loop; -- Fall through if no "real" exception handler found. First thing is to -- perform the necessary notification tasks with the stack intact. Notify_Unhandled_Exception (Excep.Id); -- If there were finalization handlers, then enter the top one. -- Just because there is no handler does not mean we don't have -- to still execute all finalizations and cleanups before -- terminating. Note that the process of calling cleanups -- does not disturb the back trace stack, since he same -- exception occurrence gets reraised, and new traceback -- entries added as we go along. if FH_Found then Excep.Num_Tracebacks := FH_Num_Trb; Excep.Cleanup_Flag := True; Enter_Handler (Machine_State (FH_Mstate'Address), FH_Handler); end if; -- If no cleanups, then this is the real unhandled termination Unhandled_Exception_Terminate; end Propagate_Exception; ------------------------- -- Raise_Current_Excep -- ------------------------- procedure Raise_Current_Excep (E : Exception_Id) is pragma Inspection_Point (E); -- This is so the debugger can reliably inspect the parameter Jumpbuf_Ptr : constant Address := Get_Jmpbuf_Address.all; Mstate_Ptr : constant Machine_State := Machine_State (Get_Machine_State_Addr.all); Excep : EOA; begin -- WARNING : There should be no exception handler for this body -- because this would cause gigi to prepend a setup for a new -- jmpbuf to the sequence of statements. We would then always get -- this new buf in Jumpbuf_Ptr instead of the one for the exception -- we are handling, which would completely break the whole design -- of this procedure. -- If the jump buffer pointer is non-null, it means that a jump -- buffer was allocated (obviously that happens only in the case -- of zero cost exceptions not implemented, or if a jump buffer -- was manually set up by C code). if Jumpbuf_Ptr /= Null_Address then Excep := Get_Current_Excep.all; if Exception_Tracebacks /= 0 then Call_Chain (Excep); end if; -- Perform the necessary notification tasks if this is not a -- reraise. Actually ask to skip the low level debugger notification -- call since we do not have the necessary information to "feed" -- it properly. if not Excep.Exception_Raised then Excep.Exception_Raised := True; Notify_Handled_Exception (Null_Loc, False, False); end if; builtin_longjmp (Jumpbuf_Ptr, 1); -- If we have no jump buffer, then either zero cost exception -- handling is in place, or we have no handlers anyway. In -- either case we have an unhandled exception. If zero cost -- exception handling is in place, propagate the exception elsif Subprogram_Descriptors /= null then Set_Machine_State (Mstate_Ptr); Propagate_Exception (Mstate_Ptr); -- Otherwise, we know the exception is unhandled by the absence -- of an allocated jump buffer. Note that this means that we also -- have no finalizations to do other than at the outer level. else if Exception_Tracebacks /= 0 then Call_Chain (Get_Current_Excep.all); end if; Notify_Unhandled_Exception (E); Unhandled_Exception_Terminate; end if; end Raise_Current_Excep; --------------------- -- Raise_Exception -- --------------------- procedure Raise_Exception (E : Exception_Id; Message : String := "") is Len : constant Natural := Natural'Min (Message'Length, Exception_Msg_Max_Length); Excep : constant EOA := Get_Current_Excep.all; begin if E /= null then Excep.Msg_Length := Len; Excep.Msg (1 .. Len) := Message (1 .. Len); Raise_With_Msg (E); end if; end Raise_Exception; ---------------------------- -- Raise_Exception_Always -- ---------------------------- procedure Raise_Exception_Always (E : Exception_Id; Message : String := "") is Len : constant Natural := Natural'Min (Message'Length, Exception_Msg_Max_Length); Excep : constant EOA := Get_Current_Excep.all; begin Excep.Msg_Length := Len; Excep.Msg (1 .. Len) := Message (1 .. Len); Raise_With_Msg (E); end Raise_Exception_Always; ------------------------------- -- Raise_From_Signal_Handler -- ------------------------------- procedure Raise_From_Signal_Handler (E : Exception_Id; M : SSL.Big_String_Ptr) is Jumpbuf_Ptr : constant Address := Get_Jmpbuf_Address.all; Mstate_Ptr : constant Machine_State := Machine_State (Get_Machine_State_Addr.all); begin Set_Exception_C_Msg (E, M); Abort_Defer.all; -- Now we raise the exception. The following code is essentially -- identical to the Raise_Current_Excep routine, except that in the -- zero cost exception case, we do not call Set_Machine_State, since -- the signal handler that passed control here has already set the -- machine state directly. -- -- We also do not compute the backtrace for the occurrence since going -- through the signal handler is far from trivial and it is not a -- problem to fail providing a backtrace in the "raised from signal -- handler" case. -- If the jump buffer pointer is non-null, it means that a jump -- buffer was allocated (obviously that happens only in the case -- of zero cost exceptions not implemented, or if a jump buffer -- was manually set up by C code). if Jumpbuf_Ptr /= Null_Address then builtin_longjmp (Jumpbuf_Ptr, 1); -- If we have no jump buffer, then either zero cost exception -- handling is in place, or we have no handlers anyway. In -- either case we have an unhandled exception. If zero cost -- exception handling is in place, propagate the exception elsif Subprogram_Descriptors /= null then Propagate_Exception (Mstate_Ptr); -- Otherwise, we know the exception is unhandled by the absence -- of an allocated jump buffer. Note that this means that we also -- have no finalizations to do other than at the outer level. else Notify_Unhandled_Exception (E); Unhandled_Exception_Terminate; end if; end Raise_From_Signal_Handler; ------------------ -- Raise_No_Msg -- ------------------ procedure Raise_No_Msg (E : Exception_Id) is Excep : constant EOA := Get_Current_Excep.all; begin Excep.Msg_Length := 0; Raise_With_Msg (E); end Raise_No_Msg; ------------------------- -- Raise_With_Location -- ------------------------- procedure Raise_With_Location (E : Exception_Id; F : SSL.Big_String_Ptr; L : Integer) is begin Set_Exception_C_Msg (E, F, L); Abort_Defer.all; Raise_Current_Excep (E); end Raise_With_Location; ---------------------------- -- Raise_Constraint_Error -- ---------------------------- procedure Raise_Constraint_Error (File : SSL.Big_String_Ptr; Line : Integer) is begin Raise_With_Location (Constraint_Error_Def'Access, File, Line); end Raise_Constraint_Error; ------------------------- -- Raise_Program_Error -- ------------------------- procedure Raise_Program_Error (File : SSL.Big_String_Ptr; Line : Integer) is begin Raise_With_Location (Program_Error_Def'Access, File, Line); end Raise_Program_Error; ------------------------- -- Raise_Storage_Error -- ------------------------- procedure Raise_Storage_Error (File : SSL.Big_String_Ptr; Line : Integer) is begin Raise_With_Location (Storage_Error_Def'Access, File, Line); end Raise_Storage_Error; ---------------------- -- Raise_With_C_Msg -- ---------------------- procedure Raise_With_C_Msg (E : Exception_Id; M : SSL.Big_String_Ptr) is begin Set_Exception_C_Msg (E, M); Abort_Defer.all; Raise_Current_Excep (E); end Raise_With_C_Msg; -------------------- -- Raise_With_Msg -- -------------------- procedure Raise_With_Msg (E : Exception_Id) is Excep : constant EOA := Get_Current_Excep.all; begin Excep.Exception_Raised := False; Excep.Id := E; Excep.Num_Tracebacks := 0; Excep.Cleanup_Flag := False; Excep.Pid := Local_Partition_ID; Abort_Defer.all; Raise_Current_Excep (E); end Raise_With_Msg; ------------- -- Reraise -- ------------- procedure Reraise is Excep : constant EOA := Get_Current_Excep.all; begin Abort_Defer.all; Raise_Current_Excep (Excep.Id); end Reraise; ------------------------ -- Reraise_Occurrence -- ------------------------ procedure Reraise_Occurrence (X : Exception_Occurrence) is begin if X.Id /= null then Abort_Defer.all; Save_Occurrence (Get_Current_Excep.all.all, X); Raise_Current_Excep (X.Id); end if; end Reraise_Occurrence; ------------------------------- -- Reraise_Occurrence_Always -- ------------------------------- procedure Reraise_Occurrence_Always (X : Exception_Occurrence) is begin Abort_Defer.all; Save_Occurrence (Get_Current_Excep.all.all, X); Raise_Current_Excep (X.Id); end Reraise_Occurrence_Always; --------------------------------- -- Reraise_Occurrence_No_Defer -- --------------------------------- procedure Reraise_Occurrence_No_Defer (X : Exception_Occurrence) is begin Save_Occurrence (Get_Current_Excep.all.all, X); Raise_Current_Excep (X.Id); end Reraise_Occurrence_No_Defer; --------------------- -- Save_Occurrence -- --------------------- procedure Save_Occurrence (Target : out Exception_Occurrence; Source : Exception_Occurrence) is begin Target.Id := Source.Id; Target.Msg_Length := Source.Msg_Length; Target.Num_Tracebacks := Source.Num_Tracebacks; Target.Pid := Source.Pid; Target.Cleanup_Flag := Source.Cleanup_Flag; Target.Msg (1 .. Target.Msg_Length) := Source.Msg (1 .. Target.Msg_Length); Target.Tracebacks (1 .. Target.Num_Tracebacks) := Source.Tracebacks (1 .. Target.Num_Tracebacks); end Save_Occurrence; function Save_Occurrence (Source : Exception_Occurrence) return EOA is Target : EOA := new Exception_Occurrence; begin Save_Occurrence (Target.all, Source); return Target; end Save_Occurrence; --------------------- -- SDP_Table_Build -- --------------------- procedure SDP_Table_Build (SDP_Addresses : System.Address; SDP_Count : Natural; Elab_Addresses : System.Address; Elab_Addr_Count : Natural) is type SDLP_Array is array (1 .. SDP_Count) of Subprogram_Descriptors_Ptr; type SDLP_Array_Ptr is access all SDLP_Array; function To_SDLP_Array_Ptr is new Unchecked_Conversion (System.Address, SDLP_Array_Ptr); T : constant SDLP_Array_Ptr := To_SDLP_Array_Ptr (SDP_Addresses); type Elab_Array is array (1 .. Elab_Addr_Count) of Code_Loc; type Elab_Array_Ptr is access all Elab_Array; function To_Elab_Array_Ptr is new Unchecked_Conversion (System.Address, Elab_Array_Ptr); EA : constant Elab_Array_Ptr := To_Elab_Array_Ptr (Elab_Addresses); Ndes : Natural; Previous_Subprogram_Descriptors : Subprogram_Descriptor_List_Ptr; begin -- If first call, then initialize count of subprogram descriptors if Subprogram_Descriptors = null then Num_Subprogram_Descriptors := 0; end if; -- First count number of subprogram descriptors. This count includes -- entries with duplicated code addresses (resulting from Import). Ndes := Num_Subprogram_Descriptors + Elab_Addr_Count; for J in T'Range loop Ndes := Ndes + T (J).Count; end loop; -- Now, allocate the new table (extra zero'th element is for sort call) -- after having saved the previous one Previous_Subprogram_Descriptors := Subprogram_Descriptors; Subprogram_Descriptors := new Subprogram_Descriptor_List (0 .. Ndes); -- If there was a previous Subprogram_Descriptors table, copy it back -- into the new one being built. Then free the memory used for the -- previous table. for J in 1 .. Num_Subprogram_Descriptors loop Subprogram_Descriptors (J) := Previous_Subprogram_Descriptors (J); end loop; Free (Previous_Subprogram_Descriptors); -- Next, append the elaboration routine addresses, building dummy -- SDP's for them as we go through the list. Ndes := Num_Subprogram_Descriptors; for J in EA'Range loop Ndes := Ndes + 1; Subprogram_Descriptors (Ndes) := new Subprogram_Descriptor_0; Subprogram_Descriptors (Ndes).all := Subprogram_Descriptor' (Num_Handlers => 0, Code => Fetch_Code (EA (J)), Subprogram_Info => EA (J), Handler_Records => (1 .. 0 => null)); end loop; -- Now copy in pointers to SDP addresses of application subprograms for J in T'Range loop for K in 1 .. T (J).Count loop Ndes := Ndes + 1; Subprogram_Descriptors (Ndes) := T (J).SDesc (K); Subprogram_Descriptors (Ndes).Code := Fetch_Code (T (J).SDesc (K).Code); end loop; end loop; -- Now we need to sort the table into ascending PC order Sort (Ndes, SDP_Table_Sort_Move'Access, SDP_Table_Sort_Lt'Access); -- Now eliminate duplicate entries. Note that in the case where -- entries have duplicate code addresses, the code for the Lt -- routine ensures that the interesting one (i.e. the one with -- handler entries if there are any) comes first. Num_Subprogram_Descriptors := 1; for J in 2 .. Ndes loop if Subprogram_Descriptors (J).Code /= Subprogram_Descriptors (Num_Subprogram_Descriptors).Code then Num_Subprogram_Descriptors := Num_Subprogram_Descriptors + 1; Subprogram_Descriptors (Num_Subprogram_Descriptors) := Subprogram_Descriptors (J); end if; end loop; end SDP_Table_Build; ----------------------- -- SDP_Table_Sort_Lt -- ----------------------- function SDP_Table_Sort_Lt (Op1, Op2 : Natural) return Boolean is SDC1 : constant Code_Loc := Subprogram_Descriptors (Op1).Code; SDC2 : constant Code_Loc := Subprogram_Descriptors (Op2).Code; begin if SDC1 < SDC2 then return True; elsif SDC1 > SDC2 then return False; -- For two descriptors for the same procedure, we want the more -- interesting one first. A descriptor with an exception handler -- is more interesting than one without. This happens if the less -- interesting one came from a pragma Import. else return Subprogram_Descriptors (Op1).Num_Handlers /= 0 and then Subprogram_Descriptors (Op2).Num_Handlers = 0; end if; end SDP_Table_Sort_Lt; -------------------------- -- SDP_Table_Sort_Move -- -------------------------- procedure SDP_Table_Sort_Move (From : Natural; To : Natural) is begin Subprogram_Descriptors (To) := Subprogram_Descriptors (From); end SDP_Table_Sort_Move; ------------------------- -- Set_Exception_C_Msg -- ------------------------- procedure Set_Exception_C_Msg (Id : Exception_Id; Msg : Big_String_Ptr; Line : Integer := 0) is Excep : constant EOA := Get_Current_Excep.all; Val : Integer := Line; Remind : Integer; Size : Integer := 1; begin Excep.Exception_Raised := False; Excep.Id := Id; Excep.Num_Tracebacks := 0; Excep.Pid := Local_Partition_ID; Excep.Msg_Length := 0; Excep.Cleanup_Flag := False; while Msg (Excep.Msg_Length + 1) /= ASCII.NUL and then Excep.Msg_Length < Exception_Msg_Max_Length loop Excep.Msg_Length := Excep.Msg_Length + 1; Excep.Msg (Excep.Msg_Length) := Msg (Excep.Msg_Length); end loop; if Line > 0 then -- Compute the number of needed characters while Val > 0 loop Val := Val / 10; Size := Size + 1; end loop; -- If enough characters are available, put the line number if Excep.Msg_Length <= Exception_Msg_Max_Length - Size then Excep.Msg (Excep.Msg_Length + 1) := ':'; Excep.Msg_Length := Excep.Msg_Length + Size; Val := Line; Size := 0; while Val > 0 loop Remind := Val rem 10; Val := Val / 10; Excep.Msg (Excep.Msg_Length - Size) := Character'Val (Remind + Character'Pos ('0')); Size := Size + 1; end loop; end if; end if; end Set_Exception_C_Msg; ------------------- -- String_To_EId -- ------------------- function String_To_EId (S : String) return Exception_Id is begin if S = "" then return Null_Id; else return Exception_Id (Internal_Exception (S)); end if; end String_To_EId; ------------------ -- String_To_EO -- ------------------ function String_To_EO (S : String) return Exception_Occurrence is From : Natural; To : Integer; X : Exception_Occurrence; -- This is the exception occurrence we will create procedure Bad_EO; pragma No_Return (Bad_EO); -- Signal bad exception occurrence string procedure Next_String; -- On entry, To points to last character of previous line of the -- message, terminated by CR/LF. On return, From .. To are set to -- specify the next string, or From > To if there are no more lines. procedure Bad_EO is begin Raise_Exception (Program_Error'Identity, "bad exception occurrence in stream input"); end Bad_EO; procedure Next_String is begin From := To + 3; if From < S'Last then To := From + 1; while To < S'Last - 2 loop if To >= S'Last then Bad_EO; elsif S (To + 1) = ASCII.CR then exit; else To := To + 1; end if; end loop; end if; end Next_String; -- Start of processing for String_To_EO begin if S = "" then return Null_Occurrence; else X.Cleanup_Flag := False; To := S'First - 3; Next_String; if S (From .. From + 15) /= "Exception name: " then Bad_EO; end if; X.Id := Exception_Id (Internal_Exception (S (From + 16 .. To))); Next_String; if From <= To and then S (From) = 'M' then if S (From .. From + 8) /= "Message: " then Bad_EO; end if; X.Msg_Length := To - From - 8; X.Msg (1 .. X.Msg_Length) := S (From + 9 .. To); Next_String; else X.Msg_Length := 0; end if; X.Pid := 0; if From <= To and then S (From) = 'P' then if S (From .. From + 3) /= "PID:" then Bad_EO; end if; From := From + 5; -- skip past PID: space while From <= To loop X.Pid := X.Pid * 10 + (Character'Pos (S (From)) - Character'Pos ('0')); From := From + 1; end loop; Next_String; end if; X.Num_Tracebacks := 0; if From <= To then if S (From .. To) /= "Call stack traceback locations:" then Bad_EO; end if; Next_String; loop exit when From > To; declare Ch : Character; C : Integer_Address; N : Integer_Address; begin if S (From) /= '0' or else S (From + 1) /= 'x' then Bad_EO; else From := From + 2; end if; C := 0; while From <= To loop Ch := S (From); if Ch in '0' .. '9' then N := Character'Pos (S (From)) - Character'Pos ('0'); elsif Ch in 'a' .. 'f' then N := Character'Pos (S (From)) - Character'Pos ('a') + 10; elsif Ch = ' ' then From := From + 1; exit; else Bad_EO; end if; C := C * 16 + N; From := From + 1; end loop; if X.Num_Tracebacks = Max_Tracebacks then Bad_EO; end if; X.Num_Tracebacks := X.Num_Tracebacks + 1; X.Tracebacks (X.Num_Tracebacks) := To_Address (C); end; end loop; end if; -- If an exception was converted to a string, it must have -- already been raised, so flag it accordingly and we are done. X.Exception_Raised := True; return X; end if; end String_To_EO; ---------------------------------- -- Tailored_Exception_Traceback -- ---------------------------------- function Tailored_Exception_Traceback (X : Exception_Occurrence) return String is -- We indeed reference the decorator *wrapper* from here and not the -- decorator itself. The purpose of the local variable Wrapper is to -- prevent a potential crash by race condition in the code below. The -- atomicity of this assignment is enforced by pragma Atomic in -- System.Soft_Links. -- The potential race condition here, if no local variable was used, -- relates to the test upon the wrapper's value and the call, which -- are not performed atomically. With the local variable, potential -- changes of the wrapper's global value between the test and the -- call become inoffensive. Wrapper : constant Traceback_Decorator_Wrapper_Call := Traceback_Decorator_Wrapper; begin if Wrapper = null then return Basic_Exception_Traceback (X); else return Wrapper.all (X.Tracebacks'Address, X.Num_Tracebacks); end if; end Tailored_Exception_Traceback; ------------------------------------ -- Tailored_Exception_Information -- ------------------------------------ function Tailored_Exception_Information (X : Exception_Occurrence) return String is -- The tailored exception information is simply the basic information -- associated with the tailored call chain backtrace. Basic_Info : constant String := Basic_Exception_Information (X); Tback_Info : constant String := Tailored_Exception_Traceback (X); Basic_Len : constant Natural := Basic_Info'Length; Tback_Len : constant Natural := Tback_Info'Length; Info : String (1 .. Basic_Len + Tback_Len); Ptr : Natural := 0; begin Append_Info_String (Basic_Info, Info, Ptr); Append_Info_String (Tback_Info, Info, Ptr); return Info; end Tailored_Exception_Information; ------------------------- -- Unhandled_Exception -- ------------------------- procedure Unhandled_Exception is begin null; end Unhandled_Exception; ---------------------- -- Notify_Exception -- ---------------------- procedure Notify_Exception (Id : Exception_Id; Handler : Code_Loc; Is_Others : Boolean) is begin null; end Notify_Exception; ------------------------------ -- Notify_Handled_Exception -- ------------------------------ procedure Notify_Handled_Exception (Handler : Code_Loc; Is_Others : Boolean; Low_Notify : Boolean) is Excep : constant EOA := Get_Current_Excep.all; begin -- Notify the debugger that we have found a handler and are about to -- propagate an exception, but only if specifically told to do so. if Low_Notify then Notify_Exception (Excep.Id, Handler, Is_Others); end if; -- Output some exception information if necessary, as specified by -- GNAT.Exception_Traces. Take care not to output information about -- internal exceptions. -- -- ??? In the ZCX case, the traceback entries we have at this point -- only include the ones we stored while walking up the stack *up to -- the handler*. All the frames above the subprogram in which the -- handler is found are missing. if Exception_Trace = Every_Raise and then not Excep.Id.Not_Handled_By_Others then To_Stderr (Nline); To_Stderr ("Exception raised"); To_Stderr (Nline); To_Stderr (Tailored_Exception_Information (Excep.all)); end if; end Notify_Handled_Exception; ------------------------------ -- Notify_Handled_Exception -- ------------------------------ procedure Notify_Unhandled_Exception (Id : Exception_Id) is begin -- Simply perform the two necessary low level notification calls. Unhandled_Exception; Notify_Exception (Id, Null_Loc, False); end Notify_Unhandled_Exception; ----------------------------------- -- Unhandled_Exception_Terminate -- ----------------------------------- adafinal_Called : Boolean := False; -- Used to prevent recursive call to adafinal in the event that -- adafinal processing itself raises an unhandled exception. type FILEs is new System.Address; type int is new Integer; procedure Unhandled_Exception_Terminate is Excep : constant EOA := Get_Current_Excep.all; Msg : constant String := Exception_Message (Excep.all); -- Start of processing for Unhandled_Exception_Terminate begin -- First call adafinal if not adafinal_Called then adafinal_Called := True; System.Soft_Links.Adafinal.all; end if; -- Check for special case of raising _ABORT_SIGNAL, which is not -- really an exception at all. We recognize this by the fact that -- it is the only exception whose name starts with underscore. if Exception_Name (Excep.all) (1) = '_' then To_Stderr (Nline); To_Stderr ("Execution terminated by abort of environment task"); To_Stderr (Nline); -- If no tracebacks, we print the unhandled exception in the old style -- (i.e. the style used before ZCX was implemented). We do this to -- retain compatibility, especially with the nightly scripts, but -- this can be removed at some point ??? elsif Excep.Num_Tracebacks = 0 then To_Stderr (Nline); To_Stderr ("raised "); To_Stderr (Exception_Name (Excep.all)); if Msg'Length /= 0 then To_Stderr (" : "); To_Stderr (Msg); end if; To_Stderr (Nline); -- New style, zero cost exception case else -- Tailored_Exception_Information is also called here so that the -- backtrace decorator gets called if it has been set. This is -- currently required because some paths in Raise_Current_Excep -- do not go through the calls that display this information. -- -- Note also that with the current scheme in Raise_Current_Excep -- we can have this whole information output twice, typically when -- some handler is found on the call chain but none deals with the -- occurrence or if this occurrence gets reraised up to here. To_Stderr (Nline); To_Stderr ("Execution terminated by unhandled exception"); To_Stderr (Nline); To_Stderr (Tailored_Exception_Information (Excep.all)); end if; -- Perform system dependent shutdown code declare procedure Unhandled_Terminate; pragma No_Return (Unhandled_Terminate); pragma Import (C, Unhandled_Terminate, "__gnat_unhandled_terminate"); begin Unhandled_Terminate; end; end Unhandled_Exception_Terminate; ------------------------------ -- Raise_Exception_No_Defer -- ------------------------------ procedure Raise_Exception_No_Defer (E : Exception_Id; Message : String := "") is Len : constant Natural := Natural'Min (Message'Length, Exception_Msg_Max_Length); Excep : constant EOA := Get_Current_Excep.all; begin Excep.Exception_Raised := False; Excep.Msg_Length := Len; Excep.Msg (1 .. Len) := Message (1 .. Len); Excep.Id := E; Excep.Num_Tracebacks := 0; Excep.Cleanup_Flag := False; Excep.Pid := Local_Partition_ID; -- DO NOT CALL Abort_Defer.all; !!!! Raise_Current_Excep (E); end Raise_Exception_No_Defer; --------------- -- To_Stderr -- --------------- procedure To_Stderr (S : String) is procedure put_char_stderr (C : int); pragma Import (C, put_char_stderr, "put_char_stderr"); begin for J in 1 .. S'Length loop if S (J) /= ASCII.CR then put_char_stderr (Character'Pos (S (J))); end if; end loop; end To_Stderr; --------- -- ZZZ -- --------- -- This dummy procedure gives us the end of the PC range for addresses -- within the exception unit itself. We hope that gigi/gcc keeps all the -- procedures in their original order! procedure ZZZ is begin null; end ZZZ; begin -- Allocate the Non-Tasking Machine_State Set_Machine_State_Addr_NT (System.Address (Allocate_Machine_State)); end Ada.Exceptions;
34.673924
79
0.59297
049df79c77a9f30f5829640caf38fe1ffd68dd99
18,178
adb
Ada
thirdparty/adasdl/thin/adasdl/AdaSDL_framebuff/sdltests/testalpha.adb
Lucretia/old_nehe_ada95
d0378c3bfce202eb01bf00b57c128735dbe8582d
[ "BSD-3-Clause" ]
null
null
null
thirdparty/adasdl/thin/adasdl/AdaSDL_framebuff/sdltests/testalpha.adb
Lucretia/old_nehe_ada95
d0378c3bfce202eb01bf00b57c128735dbe8582d
[ "BSD-3-Clause" ]
null
null
null
thirdparty/adasdl/thin/adasdl/AdaSDL_framebuff/sdltests/testalpha.adb
Lucretia/old_nehe_ada95
d0378c3bfce202eb01bf00b57c128735dbe8582d
[ "BSD-3-Clause" ]
null
null
null
-- ----------------------------------------------------------------- -- -- -- -- This 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 2 of the License, or (at your option) any later version. -- -- -- -- This software 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 library; if not, write to the -- -- Free Software Foundation, Inc., 59 Temple Place - Suite 330, -- -- Boston, MA 02111-1307, USA. -- -- -- -- ----------------------------------------------------------------- -- -- ----------------------------------------------------------------- -- -- This is a translation, to the Ada programming language, of the -- -- original C test files written by Sam Lantinga - www.libsdl.org -- -- translation made by Antonio F. Vargas - www.adapower.net/~avargas -- -- ----------------------------------------------------------------- -- with Interfaces.C.Strings; with Ada.Numerics.Generic_Elementary_Functions; with Ada.Text_IO; use Ada.Text_IO; with Ada.Float_Text_IO; use Ada.Float_Text_IO; with Ada.Command_Line; with Ada.Characters.Handling; with GNAT.OS_Lib; with SDL.Types; use SDL.Types; with SDL.Video; with SDL.Timer; with SDL.Error; with SDL.Events; with SDL.Mouse; with SDL.Quit; with Lib_C; with SDL_Framebuffer; procedure Testalpha is package C renames Interfaces.C; use type C.int; package CS renames Interfaces.C.Strings; package Uint8_IO is new Modular_IO (Uint8); package CL renames Ada.Command_Line; package CH renames Ada.Characters.Handling; use type SDL.Init_Flags; package V renames SDL.Video; use type V.Surface_Flags; use type V.Surface_ptr; use type V.Palette_ptr; package T renames SDL.Timer; package Er renames SDL.Error; package Ev renames SDL.Events; package M renames SDL.Mouse; package Fb renames SDL_Framebuffer; Screen_Width : constant := 800; -- 1024; -- 640; Screen_Height : constant := 600; -- 768; -- 480; package AN is new Ada.Numerics.Generic_Elementary_Functions (float); FRAME_TICKS : constant := 1000 / 30; -- =========================================================== -- Create a "light" -- a yellowish surface with variable alpha function CreateLight (screen : V.Surface_ptr; radius : C.int) return V.Surface_ptr is trans, alphamask : Uint8; the_range, addition : C.int; xdist, ydist : C.int; skip : Uint16; pixel : Uint32; light : V.Surface_ptr; -- buf : Uint16_ptrs.Object_Pointer; use type Interfaces.Unsigned_32; buf : Fb.Framebuffer_32bPointer; begin -- Create a 16 (4/4/4/4) bpp square with a full 4-bit alpha channel -- Note: this isn't any faster than a 32 bit alpha surface -- alphamask := 16#0000000F#; -- light := V.CreateRGBSurface (V.SWSURFACE, 2*radius, 2*radius, 16, -- 16#0000F000#, 16#00000F00#, alphamask); -- Create a 32 (8/8/8/8) bpp square with a full 8-bit alpha channel alphamask := 16#000000FF#; light := V.CreateRGBSurface (V.SWSURFACE, 2 * radius, 2 * radius, 32, 16#FF000000#, 16#00FF0000#, 16#0000FF00#, Uint32(alphamask)); if light = null then Put_Line ("Couldn't create light: " & Er.Get_Error); return null; end if; -- Fill with a light a yellow-orange color skip :=Fb.Pitch_Gap (light); buf := Fb.Get_Framebuffer (light); -- Get a transparent pixel value - we'll add alpha later pixel := V.MapRGBA (light.format, 16#FF#, 16#DD#, 16#88#, 0); for y in 0 .. light.h - 1 loop for x in 0 .. light.w - 1 loop buf.all := pixel; buf := Increment (buf, 1); end loop; buf := Increment (buf, Natural (skip)); end loop; buf := Fb.Get_Framebuffer (light); for y in 0 .. light.h - 1 loop for x in 0 .. light.w - 1 loop -- Slow distance formula (from center of light) xdist := x - (light.w / 2); ydist := y - (light.h / 2); the_range := C.int ( AN.Sqrt (float (xdist**2 + ydist**2))); -- Scale distance to range of transparency (0-255) if the_range > radius then trans := alphamask; else -- Increasing transparency with distance trans := Uint8 ( float (the_range * C.int (alphamask)) / float (radius)); -- Lights are very transparent addition := C.int (float (alphamask + 1) / 8.0); if C.int (trans) + addition > C.int (alphamask) then trans := alphamask; else trans := trans + Uint8 (addition); end if; end if; -- We set the alpha component as the right N bits buf.all := Uint32 ( Interfaces.Unsigned_32 (buf.all) or Interfaces.Unsigned_32 (255 - trans)); buf := Increment (buf, 1); end loop; buf := Increment (buf, Natural (skip)); end loop; -- Enable RLE acceleration of this alpha surface V.SetAlpha (light, V.SRCALPHA or V.RLEACCEL, 0); -- we're done! return light; end CreateLight; -- =========================================================== flashes : Uint32 := 0; flashtime : Uint32 := 0; -- =========================================================== procedure FlashLight (screen : V.Surface_ptr; light : V.Surface_ptr; x, y : Uint16) is position : V.Rect; ticks1 : Uint32; ticks2 : Uint32; begin -- Easy, center light position.x := Sint16 (x - Uint16 (light.w / 2)); position.y := Sint16 (y - Uint16 (light.h / 2)); position.w := Uint16 (light.w); position.h := Uint16 (light.h); ticks1 := T.GetTicks; V.BlitSurface(light, null, screen, position); ticks2 := T.GetTicks; V.Update_Rect(screen, position); flashes := flashes + 1; -- Update time spend doing alpha blitting flashtime := flashtime + (ticks2 - ticks1); end FlashLight; -- =========================================================== sprite_visible : C.int := 0; sprite : V.Surface_ptr; backing : V.Surface_ptr; position : V.Rect; x_vel, y_vel : C.int; alpha_vel : C.int; -- =========================================================== function LoadSprite (screen : V.Surface_ptr; file : String) return C.int is converted : V.Surface_ptr; begin -- Load the sprite image sprite := V.LoadBMP (file); if sprite = null then Put_Line ("Couldn't load " & file & Er.Get_Error); return -1; end if; -- set transparent pixel as the pixel as (0,0) if sprite.format.palette /= null then V.SetColorKey (sprite, V.SRCCOLORKEY, Fb.Get_Framebuffer( sprite).all); end if; -- Convert sprite to video format converted := V.DisplayFormat (sprite); V.FreeSurface (sprite); if converted = null then Put_Line ("Couldn't convert background: " & Er.Get_Error); return -1; end if; sprite := converted; -- Create the background backing := V.CreateRGBSurface ( V.SWSURFACE, sprite.w, sprite.h, 8, 0, 0, 0, 0); if backing = null then V.FreeSurface (sprite); return -1; end if; -- Create background to video format converted := V.DisplayFormat (backing); V.FreeSurface (backing); if converted = null then Put_Line ("Couldn't convert background: " & Er.Get_Error); V.FreeSurface (sprite); return -1; end if; backing := converted; -- Set the initial position of the sprite position.x := Sint16 (screen.w - sprite.w) / 2; position.y := Sint16 (screen.h - sprite.h) / 2; position.w := Uint16 (sprite.w); position.h := Uint16 (sprite.h); x_vel := 0; y_vel := 0; alpha_vel := 1; -- we're ready to roll return 0; end LoadSprite; -- =========================================================== procedure AttractSprite (x : Uint16; y : Uint16) is begin x_vel := (C.int (x) - C.int (position.x)) / 10; y_vel := (C.int (y) - C.int (position.y)) / 10; end AttractSprite; -- =========================================================== procedure MoveSprite (screen : V.Surface_ptr; light : V.Surface_ptr) is updates : V.Rects_Array (0 .. 1); alpha : Uint8; begin -- Erase the sprite if it was visible; if sprite_visible /= 0 then updates (0) := position; V.BlitSurface (backing, null, screen, updates (0)); else -- updates (0).x := 0; updates (0).y := 0; -- updates (0).w := 0; updates (0).h := 0; updates (0) := (0, 0, 0, 0); sprite_visible := 1; end if; -- Since the sprite is off the screen, we can do other drawing -- without being overwriten by the saved area behing the sprite if light /= null then declare x, y : C.int; State : M.Mouse_State; begin M.Get_Mouse_State (State, x, y); FlashLight (screen, light, Uint16 (x), Uint16 (y)); end; end if; -- Move the sprite, bounce at the wall position.x := position.x + Sint16 (x_vel); if (position.x < 0) or (C.int (position.x) >= screen.w) then x_vel := -x_vel; position.x := position.x + Sint16 (x_vel); end if; position.y := position.y + Sint16 (y_vel); if (position.y < 0) or (C.int (position.y) >= screen.h) then y_vel := -y_vel; position.y := position.y + Sint16 (y_vel); end if; -- Update transparency (fade in and out) alpha := sprite.format.alpha; if (C.int (alpha) + alpha_vel) < 0 then alpha_vel := -alpha_vel; elsif (C.int (alpha) + alpha_vel) > 255 then alpha_vel := -alpha_vel; end if; V.SetAlpha (sprite, V.SRCALPHA, alpha + Uint8 (alpha_vel)); -- Save the area behind the sprite updates (1) := position; V.BlitSurface (screen, updates (1), backing, null); -- Blit the sprite onto the screen updates (1) := position; V.BlitSurface (sprite, null, screen, updates (1)); -- Make it so! V.UpdateRects(screen, updates'Length, updates); end MoveSprite; -- =========================================================== procedure WarpSprite (screen : V.Surface_ptr; x, y : C.int) is updates : V.Rects_Array (0 .. 1); begin -- Erase, move, Draw, update updates (0) := position; V.BlitSurface (backing, null, screen, updates (0)); position.x := Sint16 (x - sprite.w / 2); -- Center about X position.y := Sint16 (y - sprite.h / 2); -- Center about Y updates (1) := position; V.BlitSurface (screen, updates (1), backing, null); updates (1) := position; V.BlitSurface (sprite, null, screen, updates (1)); V.UpdateRects (screen, updates'Length, updates); end WarpSprite; -- =========================================================== info : V.VideoInfo_ConstPtr; screen : V.Surface_ptr; video_bpp : Uint8; videoflags : V.Surface_Flags; buffer : Fb.Framebuffer_8bPointer; done : C.int; event : Ev.Event; light : V.Surface_ptr; mouse_pressed : C.int; ticks, lastticks : Uint32; argc : Integer := CL.Argument_Count; PollEvent_Result : C.int; begin -- Initialize SDL if SDL.Init (SDL.INIT_VIDEO or SDL.INIT_JOYSTICK) < 0 then Put_Line ("Couldn't initialize SDL: " & Er.Get_Error); GNAT.OS_Lib.OS_Exit (1); end if; SDL.Quit.atexit (SDL.SDL_Quit'Access); -- Alpha blending doesn't work well at 8-bit color info := V.GetVideoInfo; if info.vfmt.BitsPerPixel > 8 then video_bpp := info.vfmt.BitsPerPixel; else video_bpp := 16; end if; videoflags := V.SWSURFACE; while argc > 0 loop if (argc > 1) and then (CL.Argument (argc - 1) = "-bpp") and then CH.Is_Digit (CL.Argument (argc) (1)) then declare last : Positive; begin Uint8_IO.Get (CL.Argument (argc), video_bpp, last); end; argc := argc - 2; Put_Line ("-bpp" & Uint8'Image (video_bpp)); elsif CL.Argument (argc) = "-hw" then videoflags := videoflags or V.HWSURFACE; argc := argc - 1; Put_Line ("-hw"); elsif CL.Argument (argc) = "-warp" then videoflags := videoflags or V.HWPALETTE; argc := argc -1; Put_Line ("-warp"); elsif CL.Argument (argc) = "-fullscreen" then videoflags := videoflags or V.FULLSCREEN; argc := argc - 1; Put_Line ("-fullscreen"); else Put_Line ("Usage: " & CL.Command_Name & " " & "[-bpp N] [-warp] [-hw] [-fullscreen]"); GNAT.OS_Lib.OS_Exit (1); end if; end loop; -- Set video mode screen := V.SetVideoMode (Screen_Width, Screen_Height, C.int (video_bpp), videoflags); if screen = null then Put_Line ("Couldn't set " & Integer'Image (Screen_Width) & "x" & Integer'Image (Screen_Height) & " video mode: " & Er.Get_Error); GNAT.OS_Lib.OS_Exit (2); end if; -- Set the surface pixels and refresh if V.LockSurface (screen) < 0 then Put_Line ("Couldn't lock the display surface: " & Er.Get_Error); GNAT.OS_Lib.OS_Exit (2); end if; buffer := Fb.Get_Framebuffer (screen); for i in 0 .. screen.h - 1 loop Fb.Paint_Line_Unchecked (screen, buffer, i * 255 / screen.h); buffer := Fb.Next_Line_Unchecked (screen, buffer); end loop; V.UnlockSurface (screen); V.UpdateRect (screen, 0, 0, 0, 0); -- Create the light light := CreateLight (screen, 82); if light = null then GNAT.OS_Lib.OS_Exit (1); end if; -- Load the sprite if LoadSprite (screen, "icon.bmp") < 0 then V.FreeSurface (light); GNAT.OS_Lib.OS_Exit (1); end if; -- Set a clipping rectangle do clip the outside edge of the screen declare clip : V.Rect; begin clip.x := 32; clip.y := 32; clip.w := Uint16 (screen.w - (2 * 32)); clip.h := Uint16 (screen.h - (2 * 32)); V.SetClipRect (screen, clip); end; -- Wait for a keystroke lastticks := T.GetTicks; done := 0; mouse_pressed := 0; while done = 0 loop -- Update the frame -- move the sprite if mouse_pressed /= 0 then MoveSprite (screen, light); mouse_pressed := 0; else MoveSprite (screen, null); end if; -- Slow down the loop to 30 frames / second ticks := T.GetTicks; if (ticks - lastticks) < FRAME_TICKS then -- if CHECK_SLEEP_GRANULARITY -- Put_Line ("Sleeping " & -- Uint32'Image (FRAME_TICKS - (ticks - lastticks)) & -- " ticks"); T.SDL_Delay (FRAME_TICKS - (ticks - lastticks)); -- if CHECK_SLEEP_GRANULARIRY -- Put_Line ("Slept " & -- Uint32'Image (FRAME_TICKS - (ticks - lastticks)) & -- " ticks"); end if; lastticks := ticks; -- Check for events loop Ev.PollEventVP (PollEvent_Result, event); exit when PollEvent_Result = 0; case event.the_type is when Ev.MOUSEMOTION => if event.motion.state /= 0 then AttractSprite (event.motion.x, event.motion.y); mouse_pressed := 1; end if; when Ev.MOUSEBUTTONDOWN => if event.button.button = 1 then AttractSprite (event.button.x, event.button.y); mouse_pressed := 1; else declare area : V.Rect; begin area.x := Sint16 (event.button.x - 16); area.y := Sint16 (event.button.y - 16); area.w := 32; area.h := 32; V.FillRect (screen, area, 0); V.Update_Rect (screen, area); end; end if; when Ev.KEYDOWN => -- Any keypress quits the app ... done := 1; when Ev.QUIT => done := 1; when others => null; end case; end loop; end loop; V.FreeSurface (light); V.FreeSurface (sprite); V.FreeSurface (backing); -- print out some timing information if flashes > 0 then Put (Uint32'Image (flashes) & " alpha blits, ~"); Put (Float (flashtime) / Float (flashes), 3, 2, 0); Put_Line (" ms per blit"); end if; end Testalpha;
33.851024
79
0.518374
29466e60a696e6e258492cb79b591cebe271d7d7
38,148
adb
Ada
apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d/conv2d/hls_target/.autopilot/db/linebuffer_Loop_1_pr.bind.adb
dillonhuff/Halide-HLS
e9f4c3ac7915e5a52f211ce65004ae17890515a0
[ "MIT" ]
1
2020-06-18T16:51:39.000Z
2020-06-18T16:51:39.000Z
apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d/conv2d/hls_target/.autopilot/db/linebuffer_Loop_1_pr.bind.adb
dillonhuff/Halide-HLS
e9f4c3ac7915e5a52f211ce65004ae17890515a0
[ "MIT" ]
null
null
null
apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d/conv2d/hls_target/.autopilot/db/linebuffer_Loop_1_pr.bind.adb
dillonhuff/Halide-HLS
e9f4c3ac7915e5a52f211ce65004ae17890515a0
[ "MIT" ]
1
2020-03-18T00:43:22.000Z
2020-03-18T00:43:22.000Z
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization> <boost_serialization signature="serialization::archive" version="14"> <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>linebuffer_Loop_1_pr</name> <ret_bitwidth>0</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>3</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>in_axi_stream_V_value_V</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>stream&amp;lt;AxiPackedStencil&amp;lt;unsigned int, 1, 1, 1, 1&amp;gt; &amp;gt;.V.value.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</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>in_axi_stream_V_last_V</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>stream&amp;lt;AxiPackedStencil&amp;lt;unsigned int, 1, 1, 1, 1&amp;gt; &amp;gt;.V.last.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <direction>0</direction> <if_type>0</if_type> <array_size>0</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>in_stream_V_value_V</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>FIFO_SRL</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>3</if_type> <array_size>0</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>10</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_4"> <Value> <Obj> <type>0</type> <id>6</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>24</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_5"> <Value> <Obj> <type>0</type> <id>8</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>21</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>36</item> <item>37</item> <item>38</item> <item>39</item> </oprand_edges> <opcode>phi</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_6"> <Value> <Obj> <type>0</type> <id>9</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>40</item> <item>42</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_7"> <Value> <Obj> <type>0</type> <id>10</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>21</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>43</item> <item>45</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_8"> <Value> <Obj> <type>0</type> <id>11</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>46</item> <item>47</item> <item>48</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_9"> <Value> <Obj> <type>0</type> <id>16</id> <name>empty_16</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d</fileDirectory> <lineNumber>554</lineNumber> <contextFuncName>linebuffer&amp;lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="11" tracking_level="0" version="0"> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d</first> <second class_id="12" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="13" tracking_level="0" version="0"> <first class_id="14" tracking_level="0" version="0"> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer&amp;lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&amp;gt;</second> </first> <second>554</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>33</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>26</item> <item>27</item> <item>28</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_10"> <Value> <Obj> <type>0</type> <id>17</id> <name>tmp_value_V</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d</fileDirectory> <lineNumber>554</lineNumber> <contextFuncName>linebuffer&amp;lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer&amp;lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&amp;gt;</second> </first> <second>554</second> </item> </second> </item> </inlineStackInfo> <originalName>tmp.value.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>29</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_11"> <Value> <Obj> <type>0</type> <id>18</id> <name></name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d</fileDirectory> <lineNumber>554</lineNumber> <contextFuncName>linebuffer&amp;lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer&amp;lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&amp;gt;</second> </first> <second>554</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>31</item> <item>32</item> <item>33</item> </oprand_edges> <opcode>write</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_12"> <Value> <Obj> <type>0</type> <id>20</id> <name></name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d</fileDirectory> <lineNumber>552</lineNumber> <contextFuncName>linebuffer&amp;lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer&amp;lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&amp;gt;</second> </first> <second>552</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>34</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_13"> <Value> <Obj> <type>0</type> <id>22</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>0</count> <item_version>0</item_version> </oprand_edges> <opcode>ret</opcode> <m_Display>0</m_Display> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_14"> <Value> <Obj> <type>2</type> <id>35</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>21</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_15"> <Value> <Obj> <type>2</type> <id>41</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>21</bitwidth> </Value> <const_type>0</const_type> <content>2073600</content> </item> <item class_id_reference="16" object_id="_16"> <Value> <Obj> <type>2</type> <id>44</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>21</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> </consts> <blocks class_id="17" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="18" tracking_level="1" version="0" object_id="_17"> <Obj> <type>3</type> <id>7</id> <name>newFuncRoot</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>6</item> </node_objs> </item> <item class_id_reference="18" object_id="_18"> <Obj> <type>3</type> <id>12</id> <name>.preheader.i</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>8</item> <item>9</item> <item>10</item> <item>11</item> </node_objs> </item> <item class_id_reference="18" object_id="_19"> <Obj> <type>3</type> <id>21</id> <name>.preheader4.i</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>16</item> <item>17</item> <item>18</item> <item>20</item> </node_objs> </item> <item class_id_reference="18" object_id="_20"> <Obj> <type>3</type> <id>23</id> <name>.critedge.exitStub</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>22</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>22</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_21"> <id>24</id> <edge_type>2</edge_type> <source_obj>12</source_obj> <sink_obj>6</sink_obj> </item> <item class_id_reference="20" object_id="_22"> <id>27</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>16</sink_obj> </item> <item class_id_reference="20" object_id="_23"> <id>28</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>16</sink_obj> </item> <item class_id_reference="20" object_id="_24"> <id>29</id> <edge_type>1</edge_type> <source_obj>16</source_obj> <sink_obj>17</sink_obj> </item> <item class_id_reference="20" object_id="_25"> <id>32</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>18</sink_obj> </item> <item class_id_reference="20" object_id="_26"> <id>33</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>18</sink_obj> </item> <item class_id_reference="20" object_id="_27"> <id>34</id> <edge_type>2</edge_type> <source_obj>12</source_obj> <sink_obj>20</sink_obj> </item> <item class_id_reference="20" object_id="_28"> <id>36</id> <edge_type>1</edge_type> <source_obj>35</source_obj> <sink_obj>8</sink_obj> </item> <item class_id_reference="20" object_id="_29"> <id>37</id> <edge_type>2</edge_type> <source_obj>7</source_obj> <sink_obj>8</sink_obj> </item> <item class_id_reference="20" object_id="_30"> <id>38</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>8</sink_obj> </item> <item class_id_reference="20" object_id="_31"> <id>39</id> <edge_type>2</edge_type> <source_obj>21</source_obj> <sink_obj>8</sink_obj> </item> <item class_id_reference="20" object_id="_32"> <id>40</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>9</sink_obj> </item> <item class_id_reference="20" object_id="_33"> <id>42</id> <edge_type>1</edge_type> <source_obj>41</source_obj> <sink_obj>9</sink_obj> </item> <item class_id_reference="20" object_id="_34"> <id>43</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>10</sink_obj> </item> <item class_id_reference="20" object_id="_35"> <id>45</id> <edge_type>1</edge_type> <source_obj>44</source_obj> <sink_obj>10</sink_obj> </item> <item class_id_reference="20" object_id="_36"> <id>46</id> <edge_type>1</edge_type> <source_obj>9</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_37"> <id>47</id> <edge_type>2</edge_type> <source_obj>21</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_38"> <id>48</id> <edge_type>2</edge_type> <source_obj>23</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_39"> <id>108</id> <edge_type>2</edge_type> <source_obj>7</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_40"> <id>109</id> <edge_type>2</edge_type> <source_obj>12</source_obj> <sink_obj>23</sink_obj> </item> <item class_id_reference="20" object_id="_41"> <id>110</id> <edge_type>2</edge_type> <source_obj>12</source_obj> <sink_obj>21</sink_obj> </item> <item class_id_reference="20" object_id="_42"> <id>111</id> <edge_type>2</edge_type> <source_obj>21</source_obj> <sink_obj>12</sink_obj> </item> </edges> </cdfg> <cdfg_regions class_id="21" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="22" tracking_level="1" version="0" object_id="_43"> <mId>1</mId> <mTag>linebuffer_Loop_1_pr</mTag> <mType>0</mType> <sub_regions> <count>3</count> <item_version>0</item_version> <item>2</item> <item>3</item> <item>4</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>2073602</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_44"> <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>7</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="_45"> <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>12</item> <item>21</item> </basic_blocks> <mII>1</mII> <mDepth>2</mDepth> <mMinTripCount>2073600</mMinTripCount> <mMaxTripCount>2073600</mMaxTripCount> <mMinLatency>2073600</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_46"> <mId>4</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>23</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="_47"> <states class_id="25" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_48"> <id>1</id> <operations class_id="27" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_49"> <id>4</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_50"> <id>5</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_51"> <id>6</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_52"> <id>2</id> <operations> <count>6</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_53"> <id>8</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_54"> <id>9</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_55"> <id>10</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_56"> <id>11</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_57"> <id>16</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_58"> <id>17</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_59"> <id>3</id> <operations> <count>6</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_60"> <id>13</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_61"> <id>14</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_62"> <id>15</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_63"> <id>18</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_64"> <id>19</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_65"> <id>20</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_66"> <id>4</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_67"> <id>22</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="29" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="30" tracking_level="1" version="0" object_id="_68"> <inState>1</inState> <outState>2</outState> <condition class_id="31" tracking_level="0" version="0"> <id>12</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="_69"> <inState>3</inState> <outState>2</outState> <condition> <id>20</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="_70"> <inState>2</inState> <outState>4</outState> <condition> <id>19</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>9</first> <second>0</second> </first> <second>0</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_71"> <inState>2</inState> <outState>3</outState> <condition> <id>21</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item> <first> <first>9</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>10</count> <item_version>0</item_version> <item class_id="38" tracking_level="0" version="0"> <first>6</first> <second class_id="39" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>8</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>9</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>10</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>11</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>16</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>17</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>18</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>20</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>22</first> <second> <first>2</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="40" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="41" tracking_level="0" version="0"> <first>7</first> <second class_id="42" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>12</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>21</first> <second> <first>1</first> <second>2</second> </second> </item> <item> <first>23</first> <second> <first>2</first> <second>2</second> </second> </item> </bblk_ent_exit> <regions class_id="43" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="44" tracking_level="1" version="0" object_id="_72"> <region_name>Loop 1</region_name> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>12</item> <item>21</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="45" tracking_level="0" version="0"> <count>6</count> <item_version>0</item_version> <item class_id="46" tracking_level="0" version="0"> <first>48</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> <item> <first>56</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>67</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>74</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> <item> <first>80</first> <second> <count>1</count> <item_version>0</item_version> <item>10</item> </second> </item> <item> <first>86</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="48" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="49" tracking_level="0" version="0"> <first>exitcond_flatten_fu_74</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> <item> <first>indvar_flatten_next_fu_80</first> <second> <count>1</count> <item_version>0</item_version> <item>10</item> </second> </item> <item> <first>indvar_flatten_phi_fu_67</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>tmp_value_V_fu_86</first> <second> <count>1</count> <item_version>0</item_version> <item>17</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>2</count> <item_version>0</item_version> <item> <first>StgValue_17_write_fu_56</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>empty_16_read_fu_48</first> <second> <count>1</count> <item_version>0</item_version> <item>16</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>0</count> <item_version>0</item_version> </dp_mem_port_nodes> <dp_reg_nodes> <count>4</count> <item_version>0</item_version> <item> <first>63</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>90</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> <item> <first>94</first> <second> <count>1</count> <item_version>0</item_version> <item>10</item> </second> </item> <item> <first>99</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> </dp_reg_nodes> <dp_regname_nodes> <count>4</count> <item_version>0</item_version> <item> <first>exitcond_flatten_reg_90</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> <item> <first>indvar_flatten_next_reg_94</first> <second> <count>1</count> <item_version>0</item_version> <item>10</item> </second> </item> <item> <first>indvar_flatten_reg_63</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>tmp_value_V_reg_99</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> </dp_regname_nodes> <dp_reg_phi> <count>1</count> <item_version>0</item_version> <item> <first>63</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> </dp_reg_phi> <dp_regname_phi> <count>1</count> <item_version>0</item_version> <item> <first>indvar_flatten_reg_63</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> </dp_regname_phi> <dp_port_io_nodes class_id="51" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="52" tracking_level="0" version="0"> <first>in_axi_stream_V_last_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>read</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> </second> </item> <item> <first>in_axi_stream_V_value_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>read</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> </second> </item> <item> <first>in_stream_V_value_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>write</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core class_id="53" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="54" tracking_level="0" version="0"> <first>3</first> <second>FIFO_SRL</second> </item> </port2core> <node2core> <count>0</count> <item_version>0</item_version> </node2core> </syndb> </boost_serialization>
26.218557
135
0.601552
1a86bfd8ab6393f7b4a987fe638ddf43d2f5eb92
876
ads
Ada
opengl-types.ads
io7m/coreland-opengl-ada
31760853a42fcba1e37513e0521548592817c7f2
[ "0BSD" ]
1
2017-10-07T05:53:51.000Z
2017-10-07T05:53:51.000Z
opengl-types.ads
io7m/coreland-opengl-ada
31760853a42fcba1e37513e0521548592817c7f2
[ "0BSD" ]
null
null
null
opengl-types.ads
io7m/coreland-opengl-ada
31760853a42fcba1e37513e0521548592817c7f2
[ "0BSD" ]
null
null
null
with Ada.Numerics.Generic_Real_Arrays; with OpenGL.Thin; package OpenGL.Types is subtype Integer_t is Thin.Integer_t; subtype Float_t is Thin.Float_t; subtype Double_t is Thin.Double_t; subtype Clamped_Double_t is Double_t range 0.0 .. 1.0; subtype Clamped_Float_t is Float_t range 0.0 .. 1.0; package Float_Arrays is new Ada.Numerics.Generic_Real_Arrays (Types.Float_t); package Double_Arrays is new Ada.Numerics.Generic_Real_Arrays (Types.Double_t); type Vector_2i_t is array (1 .. 2) of aliased Integer_t; type Vector_3i_t is array (1 .. 3) of aliased Integer_t; type Vector_4i_t is array (1 .. 4) of aliased Integer_t; type Vector_2f_t is new Float_Arrays.Real_Vector (1 .. 2); type Vector_3f_t is new Float_Arrays.Real_Vector (1 .. 3); type Vector_4f_t is new Float_Arrays.Real_Vector (1 .. 4); end OpenGL.Types;
35.04
81
0.737443
22f42f3c6da01c25fe009667e83024d39ec6eacc
8,000
ads
Ada
gcc-gcc-7_3_0-release/gcc/ada/system-vxworks-x86.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/system-vxworks-x86.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/system-vxworks-x86.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M -- -- -- -- S p e c -- -- (VxWorks 5 Version x86) -- -- -- -- Copyright (C) 1992-2016, 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. -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ package System is pragma Pure; -- Note that we take advantage of the implementation permission to make -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada -- 2005, this is Pure in any case (AI-362). pragma No_Elaboration_Code_All; -- Allow the use of that restriction in units that WITH this unit type Name is (SYSTEM_NAME_GNAT); System_Name : constant Name := SYSTEM_NAME_GNAT; -- System-Dependent Named Numbers Min_Int : constant := Long_Long_Integer'First; Max_Int : constant := Long_Long_Integer'Last; Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size; Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1; Max_Base_Digits : constant := Long_Long_Float'Digits; Max_Digits : constant := Long_Long_Float'Digits; Max_Mantissa : constant := 63; Fine_Delta : constant := 2.0 ** (-Max_Mantissa); Tick : constant := 1.0 / 60.0; -- Storage-related Declarations type Address is private; pragma Preelaborable_Initialization (Address); Null_Address : constant Address; Storage_Unit : constant := 8; Word_Size : constant := 32; Memory_Size : constant := 2 ** 32; -- Address comparison function "<" (Left, Right : Address) return Boolean; function "<=" (Left, Right : Address) return Boolean; function ">" (Left, Right : Address) return Boolean; function ">=" (Left, Right : Address) return Boolean; function "=" (Left, Right : Address) return Boolean; pragma Import (Intrinsic, "<"); pragma Import (Intrinsic, "<="); pragma Import (Intrinsic, ">"); pragma Import (Intrinsic, ">="); pragma Import (Intrinsic, "="); -- Other System-Dependent Declarations type Bit_Order is (High_Order_First, Low_Order_First); Default_Bit_Order : constant Bit_Order := Low_Order_First; pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning -- Priority-related Declarations (RM D.1) -- Ada priorities are mapped to VxWorks priorities using the following -- transformation: 255 - Ada Priority -- Ada priorities are used as follows: -- 256 is reserved for the VxWorks kernel -- 248 - 255 correspond to hardware interrupt levels 0 .. 7 -- 247 is a catchall default "interrupt" priority for signals, -- allowing higher priority than normal tasks, but lower than -- hardware priority levels. Protected Object ceilings can -- override these values. -- 246 is used by the Interrupt_Manager task Max_Priority : constant Positive := 245; Max_Interrupt_Priority : constant Positive := 255; subtype Any_Priority is Integer range 0 .. 255; subtype Priority is Any_Priority range 0 .. 245; subtype Interrupt_Priority is Any_Priority range 246 .. 255; Default_Priority : constant Priority := 122; private pragma Linker_Options ("--specs=vxworks-x86-link.spec"); -- Setup proper set of -L's for this configuration type Address is mod Memory_Size; Null_Address : constant Address := 0; -------------------------------------- -- System Implementation Parameters -- -------------------------------------- -- These parameters provide information about the target that is used -- by the compiler. They are in the private part of System, where they -- can be accessed using the special circuitry in the Targparm unit -- whose source should be consulted for more detailed descriptions -- of the individual switch values. Backend_Divide_Checks : constant Boolean := False; Backend_Overflow_Checks : constant Boolean := True; Command_Line_Args : constant Boolean := False; Configurable_Run_Time : constant Boolean := False; Denorm : constant Boolean := True; Duration_32_Bits : constant Boolean := False; Exit_Status_Supported : constant Boolean := True; Fractional_Fixed_Ops : constant Boolean := False; Frontend_Layout : constant Boolean := False; Machine_Overflows : constant Boolean := False; Machine_Rounds : constant Boolean := True; Preallocated_Stacks : constant Boolean := False; Signed_Zeros : constant Boolean := True; Stack_Check_Default : constant Boolean := False; Stack_Check_Probes : constant Boolean := True; Stack_Check_Limits : constant Boolean := False; Support_Aggregates : constant Boolean := True; Support_Atomic_Primitives : constant Boolean := True; Support_Composite_Assign : constant Boolean := True; Support_Composite_Compare : constant Boolean := True; Support_Long_Shifts : constant Boolean := True; Always_Compatible_Rep : constant Boolean := False; Suppress_Standard_Library : constant Boolean := False; Use_Ada_Main_Program_Name : constant Boolean := True; Frontend_Exceptions : constant Boolean := True; ZCX_By_Default : constant Boolean := False; Executable_Extension : constant String := ".out"; end System;
47.904192
79
0.561625
c73ab743c5b625940c60f3ca9cd7510737646f18
2,473
ads
Ada
source/oasis/program-elements-return_object_specifications.ads
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
null
null
null
source/oasis/program-elements-return_object_specifications.ads
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
null
null
null
source/oasis/program-elements-return_object_specifications.ads
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 ------------------------------------------------------------- with Program.Elements.Declarations; with Program.Elements.Defining_Identifiers; with Program.Lexical_Elements; with Program.Elements.Expressions; package Program.Elements.Return_Object_Specifications is pragma Pure (Program.Elements.Return_Object_Specifications); type Return_Object_Specification is limited interface and Program.Elements.Declarations.Declaration; type Return_Object_Specification_Access is access all Return_Object_Specification'Class with Storage_Size => 0; not overriding function Name (Self : Return_Object_Specification) return not null Program.Elements.Defining_Identifiers .Defining_Identifier_Access is abstract; not overriding function Object_Subtype (Self : Return_Object_Specification) return not null Program.Elements.Element_Access is abstract; not overriding function Expression (Self : Return_Object_Specification) return Program.Elements.Expressions.Expression_Access is abstract; not overriding function Has_Aliased (Self : Return_Object_Specification) return Boolean is abstract; not overriding function Has_Constant (Self : Return_Object_Specification) return Boolean is abstract; type Return_Object_Specification_Text is limited interface; type Return_Object_Specification_Text_Access is access all Return_Object_Specification_Text'Class with Storage_Size => 0; not overriding function To_Return_Object_Specification_Text (Self : in out Return_Object_Specification) return Return_Object_Specification_Text_Access is abstract; not overriding function Colon_Token (Self : Return_Object_Specification_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Aliased_Token (Self : Return_Object_Specification_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Constant_Token (Self : Return_Object_Specification_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Assignment_Token (Self : Return_Object_Specification_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; end Program.Elements.Return_Object_Specifications;
35.84058
78
0.782046
04827726ba272b632164c19beb8cd6e56d55b002
1,560
adb
Ada
examples/simple/simple_reader.adb
glencornell/ada-socketcan
5ea24aff42ee9b91bb44b39a1c957886651ad46b
[ "MIT" ]
2
2020-03-02T10:49:31.000Z
2020-03-05T18:47:28.000Z
examples/simple/simple_reader.adb
glencornell/ada-socketcan
5ea24aff42ee9b91bb44b39a1c957886651ad46b
[ "MIT" ]
null
null
null
examples/simple/simple_reader.adb
glencornell/ada-socketcan
5ea24aff42ee9b91bb44b39a1c957886651ad46b
[ "MIT" ]
null
null
null
-- MIT License -- -- Copyright (c) 2021 Glen Cornell <[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 Sockets.Can; with Sockets.Can_Frame; with Print_Can_Frame; procedure Simple_Reader is Socket : Sockets.Can.Socket_Type; Frame : Sockets.Can_Frame.Can_Frame; If_Name : constant String := "vcan0"; begin Socket := Sockets.Can.Open(If_Name); loop Sockets.Can.Receive_Socket(Socket, Frame); Print_Can_Frame (Frame, If_Name); end loop; end Simple_Reader;
41.052632
81
0.744872
040bcb7d2d5b9280ce0899cf0c6c1c8f305f9095
361
adb
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/dse_step.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/dse_step.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/dse_step.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
package body Dse_Step is procedure Do_Step (This : in out Counter) is begin This.Value := This.Value + This.Step; end; procedure Step_From (Start : in My_Counter) is Lc : My_Counter := Start; begin while Nsteps > 0 loop Do_Step (Lc); Nsteps := Nsteps - 1; end loop; Mv := Lc.Value; end; end;
19
49
0.576177
580ad9482c0b91912db9a170500f85ddde7be214
53
adb
Ada
puzzle_14/src/puzzle_14.adb
AdaForge/Advent_of_Code_2020
ed8bde7eb2a21b6fba70988f8220a3facc12890f
[ "CC0-1.0" ]
null
null
null
puzzle_14/src/puzzle_14.adb
AdaForge/Advent_of_Code_2020
ed8bde7eb2a21b6fba70988f8220a3facc12890f
[ "CC0-1.0" ]
null
null
null
puzzle_14/src/puzzle_14.adb
AdaForge/Advent_of_Code_2020
ed8bde7eb2a21b6fba70988f8220a3facc12890f
[ "CC0-1.0" ]
null
null
null
procedure Puzzle_14 is begin null; end Puzzle_14;
10.6
22
0.773585
c7657733817efe64808f2634d51492611b6bce6b
817
adb
Ada
src/bb_pico_bsp-keyboard.adb
Fabien-Chouteau/bb_pico_bsp
76f9999eba98bf8b1088fc18b6e23325fd8adc75
[ "MIT" ]
null
null
null
src/bb_pico_bsp-keyboard.adb
Fabien-Chouteau/bb_pico_bsp
76f9999eba98bf8b1088fc18b6e23325fd8adc75
[ "MIT" ]
null
null
null
src/bb_pico_bsp-keyboard.adb
Fabien-Chouteau/bb_pico_bsp
76f9999eba98bf8b1088fc18b6e23325fd8adc75
[ "MIT" ]
null
null
null
with BB_Pico_Bsp.I2C; package body BB_Pico_Bsp.Keyboard is Device : BBQ10KBD.BBQ10KBD_Device (BB_Pico_Bsp.I2C.Port); ------------------ -- Key_FIFO_Pop -- ------------------ function Key_FIFO_Pop return BBQ10KBD.Key_State is begin return Device.Key_FIFO_Pop; end Key_FIFO_Pop; ------------ -- Status -- ------------ function Status return BBQ10KBD.KBD_Status is begin return Device.Status; end Status; ------------------- -- Set_Backlight -- ------------------- procedure Set_Backlight (Lvl : HAL.UInt8) is begin Device.Set_Backlight (Lvl); end Set_Backlight; ------------- -- Version -- ------------- function Version return HAL.UInt8 is begin return Device.Version; end Version; end BB_Pico_Bsp.Keyboard;
18.568182
60
0.564259
049af3050d29033dff3605a2a31a12bdce07d95e
6,166
ads
Ada
source/league/ucd/matreshka-internals-unicode-ucd-core_010b.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
24
2016-11-29T06:59:41.000Z
2021-08-30T11:55:16.000Z
source/league/ucd/matreshka-internals-unicode-ucd-core_010b.ads
svn2github/matreshka
9d222b3ad9da508855fb1f5adbe5e8a4fad4c530
[ "BSD-3-Clause" ]
2
2019-01-16T05:15:20.000Z
2019-02-03T10:03:32.000Z
source/league/ucd/matreshka-internals-unicode-ucd-core_010b.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$ ------------------------------------------------------------------------------ pragma Restrictions (No_Elaboration_Code); -- GNAT: enforce generation of preinitialized data section instead of -- generation of elaboration code. package Matreshka.Internals.Unicode.Ucd.Core_010B is pragma Preelaborate; Group_010B : aliased constant Core_Second_Stage := (16#36# .. 16#38# => -- 010B36 .. 010B38 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#39# => -- 010B39 (Other_Punctuation, Neutral, Other, Other, Other, Break_After, (Grapheme_Base => True, others => False)), 16#3A# .. 16#3F# => -- 010B3A .. 010B3F (Other_Punctuation, Neutral, Other, Other, Other, Break_After, (Terminal_Punctuation | Grapheme_Base => True, others => False)), 16#56# .. 16#57# => -- 010B56 .. 010B57 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#58# .. 16#5F# => -- 010B58 .. 010B5F (Other_Number, Neutral, Other, Other, Other, Alphabetic, (Grapheme_Base => True, others => False)), 16#73# .. 16#77# => -- 010B73 .. 010B77 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#78# .. 16#7F# => -- 010B78 .. 010B7F (Other_Number, Neutral, Other, Other, Other, Alphabetic, (Grapheme_Base => True, others => False)), 16#92# .. 16#98# => -- 010B92 .. 010B98 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#99# .. 16#9C# => -- 010B99 .. 010B9C (Other_Punctuation, Neutral, Other, Other, Other, Alphabetic, (Terminal_Punctuation | Grapheme_Base => True, others => False)), 16#9D# .. 16#A8# => -- 010B9D .. 010BA8 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#A9# .. 16#AF# => -- 010BA9 .. 010BAF (Other_Number, Neutral, Other, Other, Other, Alphabetic, (Grapheme_Base => True, others => False)), 16#B0# .. 16#FF# => -- 010BB0 .. 010BFF (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), others => (Other_Letter, Neutral, Other, A_Letter, O_Letter, Alphabetic, (Alphabetic | Grapheme_Base | ID_Continue | ID_Start | XID_Continue | XID_Start => True, others => False))); end Matreshka.Internals.Unicode.Ucd.Core_010B;
50.540984
78
0.445994
3d8967b7a3b7139b929dfe4ff19103b09a2d1f2b
12,887
ads
Ada
demo/adainclude/s-bbthre.ads
e3l6/SSMDev
2929757aab3842aefd84debb2d7c3e8b28c2b340
[ "MIT" ]
null
null
null
demo/adainclude/s-bbthre.ads
e3l6/SSMDev
2929757aab3842aefd84debb2d7c3e8b28c2b340
[ "MIT" ]
null
null
null
demo/adainclude/s-bbthre.ads
e3l6/SSMDev
2929757aab3842aefd84debb2d7c3e8b28c2b340
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . B B . T H R E A D S -- -- -- -- S p e c -- -- -- -- Copyright (C) 1999-2002 Universidad Politecnica de Madrid -- -- Copyright (C) 2003-2005 The European Space Agency -- -- Copyright (C) 2003-2014, 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 3, 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. -- -- -- -- -- -- -- -- -- -- -- -- 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/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- -- The port of GNARL to bare board targets was initially developed by the -- -- Real-Time Systems Group at the Technical University of Madrid. -- -- -- ------------------------------------------------------------------------------ -- Package that implements basic tasking functionalities pragma Restrictions (No_Elaboration_Code); with System; with System.Parameters; with System.BB.CPU_Primitives; with System.BB.Time; with System.BB.Interrupts; with System.Multiprocessors; with System.BB.CPU_Primitives.Multiprocessors; package System.BB.Threads is pragma Preelaborate; use type System.Multiprocessors.CPU; -------------------------- -- Basic thread support -- -------------------------- Initialized : Boolean := False; -- Boolean that indicates whether the tasking executive has finished its -- initialization. type Thread_Descriptor; -- This type contains the information about a thread type Thread_Id is access all Thread_Descriptor; -- Type used as thread identifier Null_Thread_Id : constant Thread_Id := null; -- Identifier used to define an invalid value for a thread identifier type Thread_States is (Runnable, Suspended, Delayed); -- These are the three possible states for a thread under the Ravenscar -- profile restrictions: Runnable (not blocked, and it may also be -- executing), Suspended (waiting on an entry call), and Delayed (waiting -- on a delay until statement). type Thread_Descriptor is record Context : aliased System.BB.CPU_Primitives.Context_Buffer; -- Location where the hardware registers (stack pointer, program -- counter, ...) are stored. This field supports context switches among -- threads. -- It is important that the Context field is placed at the beginning of -- the record, because this assumption is using for implementing context -- switching. Take into account the alignment (8 bytes, 64 bits) to -- compute the required size. ATCB : System.Address; -- Address of the Ada Task Control Block corresponding to the Ada task -- that executes on this thread. Base_CPU : System.Multiprocessors.CPU_Range; -- CPU affinity of the thread Base_Priority : System.Any_Priority; -- Base priority of the thread Active_Priority : System.Any_Priority; pragma Volatile (Active_Priority); -- Active priority that differs from the base priority due to dynamic -- priority changes required by the Ceiling Priority Protocol. -- This field is marked as Volatile for a fast implementation -- of Get_Priority. Top_Of_Stack : System.Address; -- Address of the top of the stack that is used by the thread Bottom_Of_Stack : System.Address; -- Address of the bottom of the stack that is used by the thread Next : Thread_Id; -- Points to the ready thread that is in the next position for -- execution. Alarm_Time : System.BB.Time.Time; -- Time (absolute) when the alarm for this thread expires Next_Alarm : Thread_Id; -- Next thread in the alarm queue. The queue is ordered by expiration -- times. The first place is occupied by the thread which must be -- first awaken. State : Thread_States; -- Encodes some basic information about the state of a thread In_Interrupt : Boolean; pragma Volatile (In_Interrupt); -- True iff this task has been interrupted, and an interrupt handler -- is being executed. Wakeup_Signaled : Boolean; -- Variable which reflects whether another thread has performed a -- Wakeup operation on the thread. It may happen when a task is about -- to suspend itself, but it is preempted just before by the task that -- is going to awake it. Global_List : Thread_Id; -- Next thread in the global list. The queue is ordered by creation -- time. The first place is occupied by the environment thread, and -- it links all threads in the system. Execution_Time : System.BB.Time.Composite_Execution_Time; -- CPU time spent for this thread end record; function Get_Affinity (Thread : Thread_Id) return System.Multiprocessors.CPU_Range with -- Return CPU affinity of the given thread (maybe Not_A_Specific_CPU) Pre => Thread /= Null_Thread_Id, Inline => True; function Get_CPU (Thread : Thread_Id) return System.Multiprocessors.CPU with -- Return the CPU in charge of the given thread (always a valid CPU) Pre => Thread /= Null_Thread_Id, Inline => True; procedure Initialize (Environment_Thread : Thread_Id; Main_Priority : System.Any_Priority) with -- Procedure to initialize the board and the data structures related to the -- low level tasking system. This procedure must be called before any other -- tasking operation. The operations to perform are: -- - Hardware initialization -- * Any board-specific initialization -- * Interrupts -- * Timer -- - Initialize stacks for main procedures to be executed on slave CPUs -- - Initialize the thread descriptor for the environment task -- * Set base CPU for the environment task to the one on which this -- initialization code executes -- * Set the base and active priority of the environment task -- * Store the boundaries of the stack for the environment task -- * Initialize the register context -- - Initialize the global queues -- * Set the environment task as first (and only at this moment) in -- the ready queue -- * Set the environment task as first (and only at this moment) in -- the global list of tasks -- * Set the environment task as the currently executing task -- - Initialize the floating point unit -- - Signal the flag corresponding to the initialization Pre => -- This procedure must be called by the master CPU CPU_Primitives.Multiprocessors.Current_CPU = Multiprocessors.CPU'First -- Initialization can only happen once and then not Initialized; procedure Initialize_Slave_Environment (Environment_Thread : Thread_Id) with -- Procedure to initialize the fake environment thread on a slave CPU. -- This thread is used to handle interrupt if the CPU doesn't have any -- other task. The initialization for the main CPU must have been -- performed. The operations to perform are: -- - Initialize the thread descriptor for the environment task -- * Set base CPU for the environment task to the one on which this -- initialization code executes -- * Set the base and active priority of the environment task -- * Store the boundaries of the stack for the environment task. -- These stacks are 1 KB -- * Initialize the register context -- - Initialize the global queues -- * Set the environment task as the currently executing task in this -- processor. Set its state as suspended to signal that this is a -- fake task not intended to execute once there are other tasks -- ready Pre => -- This procedure must be called by a slave CPU and never by the master CPU_Primitives.Multiprocessors.Current_CPU > Multiprocessors.CPU'First -- It must happen after the initialization of the master CPU and then Initialized; procedure Thread_Create (Id : Thread_Id; Code : System.Address; Arg : System.Address; Priority : System.Any_Priority; Base_CPU : System.Multiprocessors.CPU_Range; Stack_Address : System.Address; Stack_Size : System.Parameters.Size_Type) with -- Create a new thread -- -- The new thread executes the code at address Code and using Args as -- argument. Priority is the base priority of the new thread. The new -- thread is provided with a stack of size Stack_Size that has been -- preallocated at Stack_Address. -- -- A procedure to destroy threads is not available because that is not -- allowed by the Ravenscar profile. Pre => Initialized; function Thread_Self return Thread_Id with -- Return the thread identifier of the calling thread Post => Thread_Self'Result /= Null_Thread_Id, Inline => True; ---------------- -- Scheduling -- ---------------- procedure Set_Priority (Priority : System.Any_Priority); pragma Inline (Set_Priority); -- Set the active priority of the executing thread to the given value function Get_Priority (Id : Thread_Id) return System.Any_Priority with -- Get the current active priority of any thread Pre => Id /= Null_Thread_Id, Inline => True; procedure Sleep; -- The calling thread is unconditionally suspended. In the case when there -- is a request to wakeup the caller just before the state changed to -- Suspended then the situation is signaled with the flag Wakeup_Signaled, -- and the call to Sleep consumes this token and the state remains -- Runnable. procedure Wakeup (Id : Thread_Id) with -- Thread Id becomes ready (the thread must be previously suspended). In -- the case when there is a request to wakeup the caller just before the -- state changed to Suspended then the situation is signaled with the -- flag Wakeup_Signaled (the state remains unchanged in this case). Pre => Id /= Null_Thread_Id -- We can only wakeup a task that is already suspended or about to be -- suspended (and hence still runnable). and then Id.all.State in Suspended | Runnable -- Any wakeup previously signaled must have been consumed and then not Id.all.Wakeup_Signaled; ---------- -- ATCB -- ---------- procedure Set_ATCB (ATCB : System.Address); pragma Inline (Set_ATCB); -- This procedure sets the ATCB passed as argument for the currently -- running thread. function Get_ATCB return System.Address; pragma Inline (Get_ATCB); -- Returns the ATCB of the currently executing thread end System.BB.Threads;
41.977199
79
0.60045
0417c15db24a6ced627def6fe05af8bb2bb6a187
2,600
adb
Ada
gcc-gcc-7_3_0-release/gcc/ada/a-suhcin.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-suhcin.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/a-suhcin.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ADA.STRINGS.UNBOUNDED.HASH_CASE_INSENSITIVE -- -- -- -- B o d y -- -- -- -- Copyright (C) 2011, 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.Strings.Unbounded.Aux; with Ada.Strings.Hash_Case_Insensitive; function Ada.Strings.Unbounded.Hash_Case_Insensitive (Key : Unbounded.Unbounded_String) return Containers.Hash_Type is S : Aux.Big_String_Access; L : Natural; begin Aux.Get_String (Key, S, L); return Ada.Strings.Hash_Case_Insensitive (S (1 .. L)); end Ada.Strings.Unbounded.Hash_Case_Insensitive;
59.090909
78
0.429231
adc3bfbde96573de73345dc9d7a79234975d268f
1,842
ads
Ada
src/model/l_system/lse-model-l_system-growth_rule_utils.ads
Heziode/lsystem-editor
d15ab3769d025ff86d98a11f87400d87db8f022e
[ "MIT" ]
2
2021-01-09T14:49:35.000Z
2022-01-18T18:57:45.000Z
src/model/l_system/lse-model-l_system-growth_rule_utils.ads
Heziode/lsystem-editor
d15ab3769d025ff86d98a11f87400d87db8f022e
[ "MIT" ]
1
2021-12-03T18:49:59.000Z
2021-12-03T18:49:59.000Z
src/model/l_system/lse-model-l_system-growth_rule_utils.ads
Heziode/lsystem-editor
d15ab3769d025ff86d98a11f87400d87db8f022e
[ "MIT" ]
1
2021-12-03T18:07:44.000Z
2021-12-03T18:07:44.000Z
------------------------------------------------------------------------------- -- LSE -- L-System Editor -- Author: Heziode -- -- License: -- MIT License -- -- Copyright (c) 2018 Quentin Dauprat (Heziode) <[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.Containers.Indefinite_Doubly_Linked_Lists; with LSE.Model.L_System.Growth_Rule; use LSE.Model.L_System.Growth_Rule; -- @description -- This package provid a list of Growth rule. -- package LSE.Model.L_System.Growth_Rule_Utils is package P_List is new Ada.Containers.Indefinite_Doubly_Linked_Lists ( Element_Type => Instance'Class ); use P_List; end LSE.Model.L_System.Growth_Rule_Utils;
39.191489
79
0.680239
04161144d20f0b880682c9995825a6b87c011eee
4,525
adb
Ada
gcc-gcc-7_3_0-release/gcc/ada/s-casi32.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-casi32.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/s-casi32.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY COMPONENTS -- -- -- -- S Y S T E M . C O M P A R E _ A R R A Y _ S I G N E D _ 3 2 -- -- -- -- B o d y -- -- -- -- Copyright (C) 2002-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. -- -- -- ------------------------------------------------------------------------------ with System.Address_Operations; use System.Address_Operations; with Ada.Unchecked_Conversion; package body System.Compare_Array_Signed_32 is type Word is range -2**31 .. 2**31 - 1; for Word'Size use 32; -- Used to process operands by words type Uword is new Word; for Uword'Alignment use 1; -- Used to process operands when unaligned type WP is access Word; type UP is access Uword; function W is new Ada.Unchecked_Conversion (Address, WP); function U is new Ada.Unchecked_Conversion (Address, UP); ----------------------- -- Compare_Array_S32 -- ----------------------- function Compare_Array_S32 (Left : System.Address; Right : System.Address; Left_Len : Natural; Right_Len : Natural) return Integer is Clen : Natural := Natural'Min (Left_Len, Right_Len); -- Number of elements left to compare L : Address := Left; R : Address := Right; -- Pointers to next elements to compare begin -- Case of going by aligned words if ModA (OrA (Left, Right), 4) = 0 then while Clen /= 0 loop if W (L).all /= W (R).all then if W (L).all > W (R).all then return +1; else return -1; end if; end if; Clen := Clen - 1; L := AddA (L, 4); R := AddA (R, 4); end loop; -- Case of going by unaligned words else while Clen /= 0 loop if U (L).all /= U (R).all then if U (L).all > U (R).all then return +1; else return -1; end if; end if; Clen := Clen - 1; L := AddA (L, 4); R := AddA (R, 4); end loop; end if; -- Here if common section equal, result decided by lengths if Left_Len = Right_Len then return 0; elsif Left_Len > Right_Len then return +1; else return -1; end if; end Compare_Array_S32; end System.Compare_Array_Signed_32;
38.675214
78
0.441989
1398711f5bbc89f563a2d10f7db4acf2c172df30
4,655
ads
Ada
tools/scitools/conf/understand/ada/ada05/g-crc32.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/g-crc32.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
tools/scitools/conf/understand/ada/ada05/g-crc32.ads
brucegua/moocos
575c161cfa35e220f10d042e2e5ca18773691695
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- G N A T . C R C 3 2 -- -- -- -- S p e c -- -- -- -- Copyright (C) 2004-2005, 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 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 routines for computing a commonly used checksum -- called CRC-32. This is a checksum based on treating the binary data -- as a polynomial over a binary field, and the exact specifications of -- the CRC-32 algorithm are as follows: -- Name : "CRC-32" -- Width : 32 -- Poly : 04C11DB7 -- Init : FFFFFFFF -- RefIn : True -- RefOut : True -- XorOut : FFFFFFFF -- Check : CBF43926 -- Note that this is the algorithm used by PKZip, Ethernet and FDDI -- For more information about this algorithm see: -- ftp://ftp.rocksoft.com/papers/crc_v3.txt -- "A Painless Guide to CRC Error Detection Algorithms", Ross N. Williams -- "Computation of Cyclic Redundancy Checks via Table Look-Up", Communications -- of the ACM, Vol. 31 No. 8, pp.1008-1013 Aug. 1988. Sarwate, D.V. with Ada.Streams; with Interfaces; with System.CRC32; package GNAT.CRC32 is subtype CRC32 is System.CRC32.CRC32; -- Used to represent CRC32 values, which are 32 bit bit-strings procedure Initialize (C : out CRC32) renames System.CRC32.Initialize; -- Initialize CRC value by assigning the standard Init value (16#FFFF_FFFF) procedure Update (C : in out CRC32; Value : Character) renames System.CRC32.Update; -- Evolve CRC by including the contribution from Character'Pos (Value) procedure Update (C : in out CRC32; Value : String); -- For each character in the Value string call above routine procedure Wide_Update (C : in out CRC32; Value : Wide_Character); -- Evolve CRC by including the contribution from Wide_Character'Pos (Value) -- with the bytes being included in the natural memory order. procedure Wide_Update (C : in out CRC32; Value : Wide_String); -- For each character in the Value string call above routine procedure Update (C : in out CRC32; Value : Ada.Streams.Stream_Element); -- Evolve CRC by including the contribution from Value procedure Update (C : in out CRC32; Value : Ada.Streams.Stream_Element_Array); -- For each element in the Value array call above routine function Get_Value (C : CRC32) return Interfaces.Unsigned_32 renames System.CRC32.Get_Value; -- Get_Value computes the CRC32 value by performing an XOR with the -- standard XorOut value (16#FFFF_FFFF). Note that this does not -- change the value of C, so it may be used to retrieve intermediate -- values of the CRC32 value during a sequence of Update calls. pragma Inline (Update); pragma Inline (Wide_Update); end GNAT.CRC32;
40.833333
79
0.541783
c746a1f39c42c8644a4a09304eb60eaff9c1a0eb
1,763
ads
Ada
test_draw_line_major/src/points.ads
rogermc2/GA_Ada
0b55eb5691ac1c543c79c9a06ffdbe2e47e8f1be
[ "ISC" ]
3
2019-04-12T01:09:55.000Z
2021-02-24T18:17:32.000Z
test_draw_line_major/src/points.ads
rogermc2/GA_Ada
0b55eb5691ac1c543c79c9a06ffdbe2e47e8f1be
[ "ISC" ]
1
2020-08-12T10:10:25.000Z
2020-08-12T10:10:25.000Z
test_draw_line_major/src/points.ads
rogermc2/GA_Ada
0b55eb5691ac1c543c79c9a06ffdbe2e47e8f1be
[ "ISC" ]
1
2019-04-12T01:14:15.000Z
2019-04-12T01:14:15.000Z
with GL.Types; use GL.Types; with C3GA; with E3GA; with Multivectors; package Points is use Multivectors; use C3GA; type Normalized_Points_Array is array (int range <>) of Normalized_Point; Num_Points : constant Int := 6; Point_Data : Vector_E3GA_Array (1 .. Num_Points) := -- E1 E2 E3 ((-0.356756, -0.881980, 0.0), -- L1 (-0.725786, 0.934177, -0.366154), -- L2 (2.612482, 1.495455, -2.704073), -- C1 (2.218644, 0.425753, -1.780935), -- C2 (0.865897, 0.629159, -1.438985), -- C3 (2.846445, -1.112365, -0.366769)); -- P1 type Colour_Data is new Singles.Vector4_Array (1 .. Num_Points); Line_Point_Index : Int := 1; Circle_Point_Index : Int := 3; Plane_Point_Index : Int := 6; -- A Normalized_Point consists of five blades representing the vectors: -- no = 1.0, E1, E2, E3, ni = Inf n : constant Vector := E3GA.e2; -- n is a direction vector L1 : constant Normalized_Point := Set_Normalized_Point (Point_Data (1)); L2 : constant Normalized_Point := Set_Normalized_Point (Point_Data (2)); C1 : constant Normalized_Point := Set_Normalized_Point (Point_Data (3)); C2 : constant Normalized_Point := Set_Normalized_Point (Point_Data (4)); C3 : constant Normalized_Point := Set_Normalized_Point (Point_Data (5)); P1 : constant Normalized_Point := Set_Normalized_Point (Point_Data (6)); Normalized_Points : constant Normalized_Points_Array (1 .. Num_Points) := (L1, L2, C1, C2, C3, P1); function Set_Draw_Colour (Colour : Singles.Vector4) return Colour_Data; end Points;
36.729167
76
0.600681
1afed87bc0340509f7223ff67db4b4c09b9d62a3
3,632
ads
Ada
source/amf/uml/amf-uml-central_buffer_nodes-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-central_buffer_nodes-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-central_buffer_nodes-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.Central_Buffer_Nodes.Hash is new AMF.Elements.Generic_Hash (UML_Central_Buffer_Node, UML_Central_Buffer_Node_Access);
72.64
90
0.405837
13fec942f2e23619aefc713453311846832d8f1e
6,442
ada
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c48009g.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/c4/c48009g.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c48009g.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- C48009G.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: -- FOR ALLOCATORS OF THE FORM "NEW T'(X)", CHECK THAT -- CONSTRAINT_ERROR IS RAISED IF T IS A CONSTRAINED ACCESS -- TYPE AND THE OBJECT DESIGNATED BY X DOES NOT HAVE DISCRIMINANTS -- OR INDEX BOUNDS THAT EQUAL THE CORRESPONDING VALUES FOR T. -- HISTORY: -- EG 08/30/84 CREATED ORIGINAL TEST. -- JET 01/05/87 UPDATED HEADER FORMAT AND ADDED CODE TO PREVENT -- OPTIMIZATION. WITH REPORT; PROCEDURE C48009G IS USE REPORT; GENERIC TYPE G_TYPE IS PRIVATE; FUNCTION EQUAL_G (X : G_TYPE; Y : G_TYPE) RETURN BOOLEAN; FUNCTION EQUAL_G (X : G_TYPE; Y : G_TYPE) RETURN BOOLEAN IS BEGIN IF (IDENT_INT(3) = 3) AND (X = Y) THEN RETURN TRUE; ELSE RETURN FALSE; END IF; END EQUAL_G; BEGIN TEST("C48009G","FOR ALLOCATORS OF THE FORM 'NEW T'(X)', CHECK " & "THAT CONSTRAINT_ERROR IS RAISED WHEN " & "APPROPRIATE - CONSTRAINED ACCESS TYPE"); DECLARE TYPE INT IS RANGE 1 .. 5; TYPE UR(A : INT) IS RECORD B : INTEGER; END RECORD; TYPE UA IS ARRAY(INT RANGE <>) OF INTEGER; PACKAGE P IS TYPE UP(A, B : INT) IS PRIVATE; TYPE UL(A, B : INT) IS LIMITED PRIVATE; CONS_UP : CONSTANT UP; PRIVATE TYPE UP(A, B : INT) IS RECORD C : INTEGER; END RECORD; TYPE UL(A, B : INT) IS RECORD C : INTEGER; END RECORD; CONS_UP : CONSTANT UP := (2, 2, (IDENT_INT(3))); END P; TYPE A_UR IS ACCESS UR; TYPE A_UA IS ACCESS UA; TYPE A_UP IS ACCESS P.UP; TYPE A_UL IS ACCESS P.UL; SUBTYPE CA_UR IS A_UR(2); SUBTYPE CA_UA IS A_UA(2 .. 3); SUBTYPE CA_UP IS A_UP(3, 2); SUBTYPE CA_UL IS A_UL(2, 4); TYPE A_CA_UR IS ACCESS CA_UR; TYPE A_CA_UA IS ACCESS CA_UA; TYPE A_CA_UP IS ACCESS CA_UP; TYPE A_CA_UL IS ACCESS CA_UL; V_A_CA_UR : A_CA_UR; V_A_CA_UA : A_CA_UA; V_A_CA_UP : A_CA_UP; V_A_CA_UL : A_CA_UL; FUNCTION EQUAL IS NEW EQUAL_G(A_CA_UR); FUNCTION EQUAL IS NEW EQUAL_G(A_CA_UA); FUNCTION EQUAL IS NEW EQUAL_G(A_CA_UP); FUNCTION EQUAL IS NEW EQUAL_G(A_CA_UL); BEGIN BEGIN V_A_CA_UR := NEW CA_UR'(NEW UR'(1,(IDENT_INT(2)))); IF EQUAL (V_A_CA_UR, V_A_CA_UR) THEN FAILED ("NO EXCEPTION RAISED - UR"); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - UR"); END; BEGIN V_A_CA_UA := NEW CA_UA'(NEW UA'(1 => 2, 2 => IDENT_INT(3))); IF EQUAL (V_A_CA_UA, V_A_CA_UA) THEN FAILED ("NO EXCEPTION RAISED - UA"); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - UA"); END; BEGIN V_A_CA_UP := NEW CA_UP'(NEW P.UP'(P.CONS_UP)); IF EQUAL (V_A_CA_UP, V_A_CA_UP) THEN FAILED ("NO EXCEPTION RAISED - UP"); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - UP"); END; BEGIN V_A_CA_UR := NEW CA_UR'(NULL); IF NOT EQUAL (V_A_CA_UR, V_A_CA_UR) THEN COMMENT ("NO EXCEPTION RAISED - UR"); END IF; EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED - UR"); END; BEGIN V_A_CA_UA := NEW CA_UA'(NULL); IF NOT EQUAL (V_A_CA_UA, V_A_CA_UA) THEN COMMENT ("NO EXCEPTION RAISED - UA"); END IF; EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED - UA"); END; BEGIN V_A_CA_UP := NEW CA_UP'(NULL); IF NOT EQUAL (V_A_CA_UP, V_A_CA_UP) THEN COMMENT ("NO EXCEPTION RAISED - UP"); END IF; EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED - UP"); END; BEGIN V_A_CA_UL := NEW CA_UL'(NULL); IF NOT EQUAL (V_A_CA_UL, V_A_CA_UL) THEN COMMENT ("NO EXCEPTION RAISED - UL"); END IF; EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED - UL"); END; END; RESULT; END C48009G;
30.67619
79
0.505588
59d778d943ed7073a9a2725fbab4c588dad1ac67
17,590
ads
Ada
regtests/model/regtests-statements-model.ads
My-Colaborations/ada-ado
cebf1f9b38c0c259c44935e8bca05a5bff12aace
[ "Apache-2.0" ]
null
null
null
regtests/model/regtests-statements-model.ads
My-Colaborations/ada-ado
cebf1f9b38c0c259c44935e8bca05a5bff12aace
[ "Apache-2.0" ]
null
null
null
regtests/model/regtests-statements-model.ads
My-Colaborations/ada-ado
cebf1f9b38c0c259c44935e8bca05a5bff12aace
[ "Apache-2.0" ]
null
null
null
----------------------------------------------------------------------- -- Regtests.Statements.Model -- Regtests.Statements.Model ----------------------------------------------------------------------- -- File generated by ada-gen DO NOT MODIFY -- Template used: templates/model/package-spec.xhtml -- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095 ----------------------------------------------------------------------- -- Copyright (C) 2020 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. ----------------------------------------------------------------------- pragma Warnings (Off); with ADO.Sessions; with ADO.Objects; with ADO.Statements; with ADO.SQL; with ADO.Schemas; with Ada.Calendar; with Ada.Containers.Vectors; with Ada.Strings.Unbounded; with Util.Beans.Objects; with Util.Beans.Basic.Lists; pragma Warnings (On); package Regtests.Statements.Model is pragma Style_Checks ("-mr"); type Nullable_Table_Ref is new ADO.Objects.Object_Ref with null record; type Table_Ref is new ADO.Objects.Object_Ref with null record; -- -------------------- -- Record representing a user -- -------------------- -- Create an object key for Nullable_Table. function Nullable_Table_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key; -- Create an object key for Nullable_Table from a string. -- Raises Constraint_Error if the string cannot be converted into the object key. function Nullable_Table_Key (Id : in String) return ADO.Objects.Object_Key; Null_Nullable_Table : constant Nullable_Table_Ref; function "=" (Left, Right : Nullable_Table_Ref'Class) return Boolean; -- Set the user id procedure Set_Id (Object : in out Nullable_Table_Ref; Value : in ADO.Identifier); -- Get the user id function Get_Id (Object : in Nullable_Table_Ref) return ADO.Identifier; -- Get the comment version. function Get_Version (Object : in Nullable_Table_Ref) return Integer; -- Set an identifier value procedure Set_Id_Value (Object : in out Nullable_Table_Ref; Value : in ADO.Identifier); -- Get an identifier value function Get_Id_Value (Object : in Nullable_Table_Ref) return ADO.Identifier; -- Set an integer value procedure Set_Int_Value (Object : in out Nullable_Table_Ref; Value : in ADO.Nullable_Integer); -- Get an integer value function Get_Int_Value (Object : in Nullable_Table_Ref) return ADO.Nullable_Integer; -- Set a boolean value procedure Set_Bool_Value (Object : in out Nullable_Table_Ref; Value : in ADO.Nullable_Boolean); -- Get a boolean value function Get_Bool_Value (Object : in Nullable_Table_Ref) return ADO.Nullable_Boolean; -- Set a string value procedure Set_String_Value (Object : in out Nullable_Table_Ref; Value : in ADO.Nullable_String); procedure Set_String_Value (Object : in out Nullable_Table_Ref; Value : in String); -- Get a string value function Get_String_Value (Object : in Nullable_Table_Ref) return ADO.Nullable_String; function Get_String_Value (Object : in Nullable_Table_Ref) return String; -- Set a time value procedure Set_Time_Value (Object : in out Nullable_Table_Ref; Value : in ADO.Nullable_Time); -- Get a time value function Get_Time_Value (Object : in Nullable_Table_Ref) return ADO.Nullable_Time; -- Set an entity value procedure Set_Entity_Value (Object : in out Nullable_Table_Ref; Value : in ADO.Nullable_Entity_Type); -- Get an entity value function Get_Entity_Value (Object : in Nullable_Table_Ref) return ADO.Nullable_Entity_Type; -- Load the entity identified by 'Id'. -- Raises the NOT_FOUND exception if it does not exist. procedure Load (Object : in out Nullable_Table_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier); -- Load the entity identified by 'Id'. -- Returns True in <b>Found</b> if the object was found and False if it does not exist. procedure Load (Object : in out Nullable_Table_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier; Found : out Boolean); -- Find and load the entity. overriding procedure Find (Object : in out Nullable_Table_Ref; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean); -- Save the entity. If the entity does not have an identifier, an identifier is allocated -- and it is inserted in the table. Otherwise, only data fields which have been changed -- are updated. overriding procedure Save (Object : in out Nullable_Table_Ref; Session : in out ADO.Sessions.Master_Session'Class); -- Delete the entity. overriding procedure Delete (Object : in out Nullable_Table_Ref; Session : in out ADO.Sessions.Master_Session'Class); overriding function Get_Value (From : in Nullable_Table_Ref; Name : in String) return Util.Beans.Objects.Object; -- Table definition NULLABLE_TABLE_TABLE : constant ADO.Schemas.Class_Mapping_Access; -- Internal method to allocate the Object_Record instance overriding procedure Allocate (Object : in out Nullable_Table_Ref); -- Copy of the object. procedure Copy (Object : in Nullable_Table_Ref; Into : in out Nullable_Table_Ref); package Nullable_Table_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Nullable_Table_Ref, "=" => "="); subtype Nullable_Table_Vector is Nullable_Table_Vectors.Vector; procedure List (Object : in out Nullable_Table_Vector; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class); -- -------------------- -- Record representing a user -- -------------------- -- Create an object key for Table. function Table_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key; -- Create an object key for Table from a string. -- Raises Constraint_Error if the string cannot be converted into the object key. function Table_Key (Id : in String) return ADO.Objects.Object_Key; Null_Table : constant Table_Ref; function "=" (Left, Right : Table_Ref'Class) return Boolean; -- Set the user id procedure Set_Id (Object : in out Table_Ref; Value : in ADO.Identifier); -- Get the user id function Get_Id (Object : in Table_Ref) return ADO.Identifier; -- Get the comment version. function Get_Version (Object : in Table_Ref) return Integer; -- Set an identifier value procedure Set_Id_Value (Object : in out Table_Ref; Value : in ADO.Identifier); -- Get an identifier value function Get_Id_Value (Object : in Table_Ref) return ADO.Identifier; -- Set an integer value procedure Set_Int_Value (Object : in out Table_Ref; Value : in Integer); -- Get an integer value function Get_Int_Value (Object : in Table_Ref) return Integer; -- Set a boolean value procedure Set_Bool_Value (Object : in out Table_Ref; Value : in Boolean); -- Get a boolean value function Get_Bool_Value (Object : in Table_Ref) return Boolean; -- Set a string value procedure Set_String_Value (Object : in out Table_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String); procedure Set_String_Value (Object : in out Table_Ref; Value : in String); -- Get a string value function Get_String_Value (Object : in Table_Ref) return Ada.Strings.Unbounded.Unbounded_String; function Get_String_Value (Object : in Table_Ref) return String; -- Set a time value procedure Set_Time_Value (Object : in out Table_Ref; Value : in Ada.Calendar.Time); -- Get a time value function Get_Time_Value (Object : in Table_Ref) return Ada.Calendar.Time; -- Set an entity value procedure Set_Entity_Value (Object : in out Table_Ref; Value : in ADO.Entity_Type); -- Get an entity value function Get_Entity_Value (Object : in Table_Ref) return ADO.Entity_Type; -- Load the entity identified by 'Id'. -- Raises the NOT_FOUND exception if it does not exist. procedure Load (Object : in out Table_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier); -- Load the entity identified by 'Id'. -- Returns True in <b>Found</b> if the object was found and False if it does not exist. procedure Load (Object : in out Table_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier; Found : out Boolean); -- Find and load the entity. overriding procedure Find (Object : in out Table_Ref; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean); -- Save the entity. If the entity does not have an identifier, an identifier is allocated -- and it is inserted in the table. Otherwise, only data fields which have been changed -- are updated. overriding procedure Save (Object : in out Table_Ref; Session : in out ADO.Sessions.Master_Session'Class); -- Delete the entity. overriding procedure Delete (Object : in out Table_Ref; Session : in out ADO.Sessions.Master_Session'Class); overriding function Get_Value (From : in Table_Ref; Name : in String) return Util.Beans.Objects.Object; -- Table definition TABLE_TABLE : constant ADO.Schemas.Class_Mapping_Access; -- Internal method to allocate the Object_Record instance overriding procedure Allocate (Object : in out Table_Ref); -- Copy of the object. procedure Copy (Object : in Table_Ref; Into : in out Table_Ref); package Table_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Table_Ref, "=" => "="); subtype Table_Vector is Table_Vectors.Vector; procedure List (Object : in out Table_Vector; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class); private NULLABLE_TABLE_NAME : aliased constant String := "test_nullable_table"; COL_0_1_NAME : aliased constant String := "id"; COL_1_1_NAME : aliased constant String := "version"; COL_2_1_NAME : aliased constant String := "id_value"; COL_3_1_NAME : aliased constant String := "int_value"; COL_4_1_NAME : aliased constant String := "bool_value"; COL_5_1_NAME : aliased constant String := "string_value"; COL_6_1_NAME : aliased constant String := "time_value"; COL_7_1_NAME : aliased constant String := "entity_value"; NULLABLE_TABLE_DEF : aliased constant ADO.Schemas.Class_Mapping := (Count => 8, Table => NULLABLE_TABLE_NAME'Access, Members => ( 1 => COL_0_1_NAME'Access, 2 => COL_1_1_NAME'Access, 3 => COL_2_1_NAME'Access, 4 => COL_3_1_NAME'Access, 5 => COL_4_1_NAME'Access, 6 => COL_5_1_NAME'Access, 7 => COL_6_1_NAME'Access, 8 => COL_7_1_NAME'Access) ); NULLABLE_TABLE_TABLE : constant ADO.Schemas.Class_Mapping_Access := NULLABLE_TABLE_DEF'Access; Null_Nullable_Table : constant Nullable_Table_Ref := Nullable_Table_Ref'(ADO.Objects.Object_Ref with null record); type Nullable_Table_Impl is new ADO.Objects.Object_Record (Key_Type => ADO.Objects.KEY_INTEGER, Of_Class => NULLABLE_TABLE_DEF'Access) with record Version : Integer; Id_Value : ADO.Identifier; Int_Value : ADO.Nullable_Integer; Bool_Value : ADO.Nullable_Boolean; String_Value : ADO.Nullable_String; Time_Value : ADO.Nullable_Time; Entity_Value : ADO.Nullable_Entity_Type; end record; type Nullable_Table_Access is access all Nullable_Table_Impl; overriding procedure Destroy (Object : access Nullable_Table_Impl); overriding procedure Find (Object : in out Nullable_Table_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean); overriding procedure Load (Object : in out Nullable_Table_Impl; Session : in out ADO.Sessions.Session'Class); procedure Load (Object : in out Nullable_Table_Impl; Stmt : in out ADO.Statements.Query_Statement'Class; Session : in out ADO.Sessions.Session'Class); overriding procedure Save (Object : in out Nullable_Table_Impl; Session : in out ADO.Sessions.Master_Session'Class); procedure Create (Object : in out Nullable_Table_Impl; Session : in out ADO.Sessions.Master_Session'Class); overriding procedure Delete (Object : in out Nullable_Table_Impl; Session : in out ADO.Sessions.Master_Session'Class); procedure Set_Field (Object : in out Nullable_Table_Ref'Class; Impl : out Nullable_Table_Access); TABLE_NAME : aliased constant String := "test_table"; COL_0_2_NAME : aliased constant String := "id"; COL_1_2_NAME : aliased constant String := "version"; COL_2_2_NAME : aliased constant String := "id_value"; COL_3_2_NAME : aliased constant String := "int_value"; COL_4_2_NAME : aliased constant String := "bool_value"; COL_5_2_NAME : aliased constant String := "string_value"; COL_6_2_NAME : aliased constant String := "time_value"; COL_7_2_NAME : aliased constant String := "entity_value"; TABLE_DEF : aliased constant ADO.Schemas.Class_Mapping := (Count => 8, Table => TABLE_NAME'Access, Members => ( 1 => COL_0_2_NAME'Access, 2 => COL_1_2_NAME'Access, 3 => COL_2_2_NAME'Access, 4 => COL_3_2_NAME'Access, 5 => COL_4_2_NAME'Access, 6 => COL_5_2_NAME'Access, 7 => COL_6_2_NAME'Access, 8 => COL_7_2_NAME'Access) ); TABLE_TABLE : constant ADO.Schemas.Class_Mapping_Access := TABLE_DEF'Access; Null_Table : constant Table_Ref := Table_Ref'(ADO.Objects.Object_Ref with null record); type Table_Impl is new ADO.Objects.Object_Record (Key_Type => ADO.Objects.KEY_INTEGER, Of_Class => TABLE_DEF'Access) with record Version : Integer; Id_Value : ADO.Identifier; Int_Value : Integer; Bool_Value : Boolean; String_Value : Ada.Strings.Unbounded.Unbounded_String; Time_Value : Ada.Calendar.Time; Entity_Value : ADO.Entity_Type; end record; type Table_Access is access all Table_Impl; overriding procedure Destroy (Object : access Table_Impl); overriding procedure Find (Object : in out Table_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean); overriding procedure Load (Object : in out Table_Impl; Session : in out ADO.Sessions.Session'Class); procedure Load (Object : in out Table_Impl; Stmt : in out ADO.Statements.Query_Statement'Class; Session : in out ADO.Sessions.Session'Class); overriding procedure Save (Object : in out Table_Impl; Session : in out ADO.Sessions.Master_Session'Class); procedure Create (Object : in out Table_Impl; Session : in out ADO.Sessions.Master_Session'Class); overriding procedure Delete (Object : in out Table_Impl; Session : in out ADO.Sessions.Master_Session'Class); procedure Set_Field (Object : in out Table_Ref'Class; Impl : out Table_Access); end Regtests.Statements.Model;
38.406114
94
0.624389
13d0225957a86bef401404f02a30c699720304ab
14,418
adb
Ada
model_multistart/0/hls4ml_prj/myproject_prj/solution1/.autopilot/db/dense_large_2.bind.adb
filipemlins/nas-hls4ml
b35afc4f684d803d352776c40f3a6cbbf47c4b1c
[ "MIT" ]
null
null
null
model_multistart/0/hls4ml_prj/myproject_prj/solution1/.autopilot/db/dense_large_2.bind.adb
filipemlins/nas-hls4ml
b35afc4f684d803d352776c40f3a6cbbf47c4b1c
[ "MIT" ]
null
null
null
model_multistart/0/hls4ml_prj/myproject_prj/solution1/.autopilot/db/dense_large_2.bind.adb
filipemlins/nas-hls4ml
b35afc4f684d803d352776c40f3a6cbbf47c4b1c
[ "MIT" ]
null
null
null
<?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>dense_large_2</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>data_V</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>data.V</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>14</bitwidth> </Value> <direction>0</direction> <if_type>1</if_type> <array_size>576</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>res_V</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>res.V</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>14</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>120</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>2</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_3"> <Value> <Obj> <type>0</type> <id>5</id> <name></name> <fileName>firmware/nnet_utils/nnet_dense_large.h</fileName> <fileDirectory>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</fileDirectory> <lineNumber>276</lineNumber> <contextFuncName>dense_large&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, config11&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="10" tracking_level="0" version="0"> <first>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</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>firmware/nnet_utils/nnet_dense_large.h</first> <second>dense_large&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, config11&amp;gt;</second> </first> <second>276</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>5</count> <item_version>0</item_version> <item>9</item> <item>10</item> <item>11</item> <item>12</item> <item>13</item> </oprand_edges> <opcode>call</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>1</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_4"> <Value> <Obj> <type>0</type> <id>6</id> <name></name> <fileName>firmware/nnet_utils/nnet_dense_large.h</fileName> <fileDirectory>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</fileDirectory> <lineNumber>280</lineNumber> <contextFuncName>dense_large&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, config11&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/filipe/MEGA/GitHub/nas-hls4ml/model_multistart/0/hls4ml_prj</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>firmware/nnet_utils/nnet_dense_large.h</first> <second>dense_large&amp;lt;ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, ap_fixed&amp;lt;14, 2, 0, 0, 0&amp;gt;, config11&amp;gt;</second> </first> <second>280</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> <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> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_5"> <Value> <Obj> <type>2</type> <id>8</id> <name>dense_large_rf_gt_ni_4</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:dense_large_rf_gt_ni.4&gt;</content> </item> </consts> <blocks class_id="17" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="18" tracking_level="1" version="0" object_id="_6"> <Obj> <type>3</type> <id>7</id> <name>dense_large.2</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>5</item> <item>6</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>5</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_7"> <id>9</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>5</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_8"> <id>10</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>5</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_9"> <id>11</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>5</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_10"> <id>12</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>5</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_11"> <id>13</id> <edge_type>1</edge_type> <source_obj>4</source_obj> <sink_obj>5</sink_obj> <is_back_edge>0</is_back_edge> </item> </edges> </cdfg> <cdfg_regions class_id="21" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="22" tracking_level="1" version="0" object_id="_12"> <mId>1</mId> <mTag>dense_large.2</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>7</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>553444</mMinLatency> <mMaxLatency>2917348</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> </cdfg_regions> <fsm class_id="24" tracking_level="1" version="0" object_id="_13"> <states class_id="25" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_14"> <id>1</id> <operations class_id="27" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_15"> <id>5</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_16"> <id>2</id> <operations> <count>2</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_17"> <id>5</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_18"> <id>6</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="29" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="30" tracking_level="1" version="0" object_id="_19"> <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> </transitions> </fsm> <res class_id="-1"></res> <node_label_latency class_id="35" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="36" tracking_level="0" version="0"> <first>5</first> <second class_id="37" tracking_level="0" version="0"> <first>0</first> <second>1</second> </second> </item> <item> <first>6</first> <second> <first>1</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="38" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="39" tracking_level="0" version="0"> <first>7</first> <second class_id="40" tracking_level="0" version="0"> <first>0</first> <second>1</second> </second> </item> </bblk_ent_exit> <regions class_id="41" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </regions> <dp_fu_nodes class_id="42" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="43" tracking_level="0" version="0"> <first>10</first> <second> <count>2</count> <item_version>0</item_version> <item>5</item> <item>5</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="45" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_fu_nodes_expression> <dp_fu_nodes_module> <count>1</count> <item_version>0</item_version> <item class_id="46" tracking_level="0" version="0"> <first>grp_dense_large_rf_gt_ni_4_fu_10</first> <second> <count>2</count> <item_version>0</item_version> <item>5</item> <item>5</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="47" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="48" tracking_level="0" version="0"> <first class_id="49" tracking_level="0" version="0"> <first>outidx5</first> <second>100</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>5</item> </second> </item> <item> <first> <first>w11_V</first> <second>100</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>5</item> </second> </item> </dp_mem_port_nodes> <dp_reg_nodes> <count>0</count> <item_version>0</item_version> </dp_reg_nodes> <dp_regname_nodes> <count>0</count> <item_version>0</item_version> </dp_regname_nodes> <dp_reg_phi> <count>0</count> <item_version>0</item_version> </dp_reg_phi> <dp_regname_phi> <count>0</count> <item_version>0</item_version> </dp_regname_phi> <dp_port_io_nodes class_id="50" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_port_io_nodes> <port2core class_id="51" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="52" tracking_level="0" version="0"> <first>1</first> <second>RAM</second> </item> <item> <first>2</first> <second>RAM</second> </item> </port2core> <node2core> <count>0</count> <item_version>0</item_version> </node2core> </syndb> </boost_serialization>
29.727835
156
0.632751
0b72197e039117530b9836357a864c95c98e0e85
2,558
ads
Ada
src/formatted_output-enumeration_output.ads
VitalijBondarenko/Formatted_Output_NG
91fbdba8b2c720d9769a52f2b2152c14236adaa0
[ "MIT" ]
null
null
null
src/formatted_output-enumeration_output.ads
VitalijBondarenko/Formatted_Output_NG
91fbdba8b2c720d9769a52f2b2152c14236adaa0
[ "MIT" ]
null
null
null
src/formatted_output-enumeration_output.ads
VitalijBondarenko/Formatted_Output_NG
91fbdba8b2c720d9769a52f2b2152c14236adaa0
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- Copyright (c) 2016-2021 Vitalii Bondarenko <[email protected]> -- -- -- ------------------------------------------------------------------------------ -- -- -- The MIT License (MIT) -- -- -- -- 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. -- ------------------------------------------------------------------------------ generic type Item_Type is (<>); package Formatted_Output.Enumeration_Output is function "&" (Fmt : Format_Type; Value : Item_Type) return Format_Type; -- Replaces leftmost formatting sequence in Fmt with formatted Value image, -- then returns Fmt. Raises exception Format_Error when invalid formatting -- sequence is found or no formatting sequence found at all end Formatted_Output.Enumeration_Output;
63.95
79
0.476935
046d98fe38ec34884ffee5edb31dc18012ac6d07
13,247
ads
Ada
source/yaml.ads
ytomino/yaml-ada
eebe0ca39544163dfe8c66f89dbbc0dd7e0998b6
[ "MIT", "Unlicense" ]
4
2015-10-02T06:44:55.000Z
2022-02-11T22:51:49.000Z
source/yaml.ads
ytomino/yaml-ada
eebe0ca39544163dfe8c66f89dbbc0dd7e0998b6
[ "MIT", "Unlicense" ]
null
null
null
source/yaml.ads
ytomino/yaml-ada
eebe0ca39544163dfe8c66f89dbbc0dd7e0998b6
[ "MIT", "Unlicense" ]
null
null
null
with Ada.IO_Exceptions; private with C.yaml; private with Ada.Finalization; package YAML is pragma Preelaborate; pragma Linker_Options ("-lyaml"); function Version return String; type Version_Directive is record Major : Natural; Minor : Natural; end record; type Tag_Directive is record Handle : not null access constant String; Prefix : not null access constant String; end record; type Tag_Directive_Array is array (Positive range <>) of Tag_Directive; type Encoding is (Any, UTF_8, UTF_16LE, UTF_16BE); type Line_Break is (Any, CR, LN, CRLN); subtype Indent_Width is Integer range 1 .. 10; subtype Line_Width is Integer range -1 .. Integer'Last; type Mark is record Index : Natural; Line : Natural; Column : Natural; end record; type Scalar_Style is (Any, Plain, Single_Quoted, Double_Quoted, Literal, Folded); type Sequence_Style is (Any, Block, Flow); type Mapping_Style is (Any, Block, Flow); package Event_Types is type Event_Type is ( No_Event, -- An empty event. Stream_Start, -- A STREAM-START event. Stream_End, -- A STREAM-END event. Document_Start, -- A DOCUMENT-START event. Document_End, -- A DOCUMENT-END event. Alias, -- An ALIAS event. Scalar, -- A SCALAR event. Sequence_Start, -- A SEQUENCE-START event. Sequence_End, -- A SEQUENCE-END event. Mapping_Start, -- A MAPPING-START event. Mapping_End); -- A MAPPING-END event. private for Event_Type use ( No_Event => C.yaml.yaml_event_type_t'Enum_Rep (C.yaml.YAML_NO_EVENT), Stream_Start => C.yaml.yaml_event_type_t'Enum_Rep (C.yaml.YAML_STREAM_START_EVENT), Stream_End => C.yaml.yaml_event_type_t'Enum_Rep (C.yaml.YAML_STREAM_END_EVENT), Document_Start => C.yaml.yaml_event_type_t'Enum_Rep (C.yaml.YAML_DOCUMENT_START_EVENT), Document_End => C.yaml.yaml_event_type_t'Enum_Rep (C.yaml.YAML_DOCUMENT_END_EVENT), Alias => C.yaml.yaml_event_type_t'Enum_Rep (C.yaml.YAML_ALIAS_EVENT), Scalar => C.yaml.yaml_event_type_t'Enum_Rep (C.yaml.YAML_SCALAR_EVENT), Sequence_Start => C.yaml.yaml_event_type_t'Enum_Rep (C.yaml.YAML_SEQUENCE_START_EVENT), Sequence_End => C.yaml.yaml_event_type_t'Enum_Rep (C.yaml.YAML_SEQUENCE_END_EVENT), Mapping_Start => C.yaml.yaml_event_type_t'Enum_Rep (C.yaml.YAML_MAPPING_START_EVENT), Mapping_End => C.yaml.yaml_event_type_t'Enum_Rep (C.yaml.YAML_MAPPING_END_EVENT)); end Event_Types; type Event_Type is new Event_Types.Event_Type; type Event (Event_Type : YAML.Event_Type := No_Event) is record case Event_Type is when Stream_Start => Encoding : YAML.Encoding; when Document_Start | Document_End => Implicit_Indicator : Boolean; case Event_Type is when Document_Start => Version_Directive : access constant YAML.Version_Directive; Tag_Directives : access constant YAML.Tag_Directive_Array; when others => null; end case; when Alias | Scalar | Sequence_Start | Mapping_Start => Anchor : access constant String; case Event_Type is when Scalar | Sequence_Start | Mapping_Start => Tag : access constant String; case Event_Type is when Scalar => Value : not null access constant String; Plain_Implicit_Tag : Boolean; Quoted_Implicit_Tag : Boolean; Scalar_Style : YAML.Scalar_Style; when Sequence_Start | Mapping_Start => Implicit_Tag : Boolean; case Event_Type is when Sequence_Start => Sequence_Style : YAML.Sequence_Style; when Mapping_Start => Mapping_Style : YAML.Mapping_Style; when others => null; end case; when others => null; end case; when others => null; end case; when No_Event | Stream_End | Sequence_End | Mapping_End => null; end case; end record; -- scalar Binary_Tag : constant String := "tag:yaml.org,2002:binary"; Boolean_Tag : constant String := "tag:yaml.org,2002:bool"; Float_Tag : constant String := "tag:yaml.org,2002:float"; -- Floating-Point Integer_Tag : constant String := "tag:yaml.org,2002:int"; Merge_Key_Tag : constant String := "tag:yaml.org,2002:merge"; Null_Tag : constant String := "tag:yaml.org,2002:null"; String_Tag : constant String := "tag:yaml.org,2002:str"; Time_Tag : constant String := "tag:yaml.org,2002:timestamp"; -- Timestamp Value_Key_Tag : constant String := "tag:yaml.org,2002:value"; YAML_Encoding_Key_Tag : constant String := "tag:yaml.org,2002:yaml"; -- sequence Ordered_Mapping_Tag : constant String := "tag:yaml.org,2002:omap"; Pairs_Tag : constant String := "tag:yaml.org,2002:pairs"; Sequence_Tag : constant String := "tag:yaml.org,2002:seq"; -- mapping Mapping_Tag : constant String := "tag:yaml.org,2002:map"; -- Unordered Mapping Set_Tag : constant String := "tag:yaml.org,2002:set"; -- parser type Parsing_Entry_Type is limited private; pragma Preelaborable_Initialization (Parsing_Entry_Type); function Is_Assigned (Parsing_Entry : Parsing_Entry_Type) return Boolean; pragma Inline (Is_Assigned); type Event_Reference_Type ( Element : not null access constant Event) is null record with Implicit_Dereference => Element; type Mark_Reference_Type ( Element : not null access constant Mark) is null record with Implicit_Dereference => Element; function Value (Parsing_Entry : aliased Parsing_Entry_Type) return Event_Reference_Type; function Start_Mark (Parsing_Entry : aliased Parsing_Entry_Type) return Mark_Reference_Type; function End_Mark (Parsing_Entry : aliased Parsing_Entry_Type) return Mark_Reference_Type; pragma Inline (Value); pragma Inline (Start_Mark); pragma Inline (End_Mark); type Parser (<>) is limited private; function Create ( Input : not null access procedure (Item : out String; Last : out Natural)) return Parser; procedure Set_Encoding (Object : in out Parser; Encoding : in YAML.Encoding); procedure Get ( Object : in out Parser; Process : not null access procedure ( Event : in YAML.Event; Start_Mark, End_Mark : in Mark)); procedure Get ( Object : in out Parser; Parsing_Entry : out Parsing_Entry_Type); procedure Get_Document_Start (Object : in out Parser); procedure Get_Document_End (Object : in out Parser); procedure Finish (Object : in out Parser); function Last_Error_Mark (Object : Parser) return Mark; function Last_Error_Message (Object : Parser) return String; -- emitter type Emitter (<>) is limited private; function Create (Output : not null access procedure (Item : in String)) return Emitter; procedure Flush (Object : in out Emitter); procedure Set_Encoding ( Object : in out Emitter; Encoding : in YAML.Encoding); procedure Set_Canonical (Object : in out Emitter; Canonical : in Boolean); procedure Set_Indent (Object : in out Emitter; Indent : in Indent_Width); procedure Set_Width (Object : in out Emitter; Width : in Line_Width); procedure Set_Unicode (Object : in out Emitter; Unicode : in Boolean); procedure Set_Break (Object : in out Emitter; Break : in Line_Break); procedure Put (Object : in out Emitter; Event : in YAML.Event); procedure Put_Document_Start ( Object : in out Emitter; Implicit_Indicator : in Boolean := False; Version_Directive : access constant YAML.Version_Directive := null; Tag_Directives : access constant YAML.Tag_Directive_Array := null); procedure Put_Document_End ( Object : in out Emitter; Implicit_Indicator : in Boolean := True); procedure Finish (Object : in out Emitter); -- exceptions Status_Error : exception renames Ada.IO_Exceptions.Status_Error; Use_Error : exception renames Ada.IO_Exceptions.Use_Error; Data_Error : exception renames Ada.IO_Exceptions.Data_Error; private for Encoding use ( Any => C.yaml.yaml_encoding_t'Enum_Rep (C.yaml.YAML_ANY_ENCODING), UTF_8 => C.yaml.yaml_encoding_t'Enum_Rep (C.yaml.YAML_UTF8_ENCODING), UTF_16LE => C.yaml.yaml_encoding_t'Enum_Rep (C.yaml.YAML_UTF16LE_ENCODING), UTF_16BE => C.yaml.yaml_encoding_t'Enum_Rep (C.yaml.YAML_UTF16BE_ENCODING)); for Line_Break use ( Any => C.yaml.yaml_break_t'Enum_Rep (C.yaml.YAML_ANY_BREAK), CR => C.yaml.yaml_break_t'Enum_Rep (C.yaml.YAML_CR_BREAK), LN => C.yaml.yaml_break_t'Enum_Rep (C.yaml.YAML_LN_BREAK), CRLN => C.yaml.yaml_break_t'Enum_Rep (C.yaml.YAML_CRLN_BREAK)); for Scalar_Style use ( Any => C.yaml.yaml_scalar_style_t'Enum_Rep (C.yaml.YAML_ANY_SCALAR_STYLE), Plain => C.yaml.yaml_scalar_style_t'Enum_Rep (C.yaml.YAML_PLAIN_SCALAR_STYLE), Single_Quoted => C.yaml.yaml_scalar_style_t'Enum_Rep (C.yaml.YAML_SINGLE_QUOTED_SCALAR_STYLE), Double_Quoted => C.yaml.yaml_scalar_style_t'Enum_Rep (C.yaml.YAML_DOUBLE_QUOTED_SCALAR_STYLE), Literal => C.yaml.yaml_scalar_style_t'Enum_Rep (C.yaml.YAML_LITERAL_SCALAR_STYLE), Folded => C.yaml.yaml_scalar_style_t'Enum_Rep (C.yaml.YAML_FOLDED_SCALAR_STYLE)); for Sequence_Style use ( Any => C.yaml.yaml_sequence_style_t'Enum_Rep (C.yaml.YAML_ANY_SEQUENCE_STYLE), Block => C.yaml.yaml_sequence_style_t'Enum_Rep (C.yaml.YAML_BLOCK_SEQUENCE_STYLE), Flow => C.yaml.yaml_sequence_style_t'Enum_Rep (C.yaml.YAML_FLOW_SEQUENCE_STYLE)); for Mapping_Style use ( Any => C.yaml.yaml_mapping_style_t'Enum_Rep (C.yaml.YAML_ANY_MAPPING_STYLE), Block => C.yaml.yaml_mapping_style_t'Enum_Rep (C.yaml.YAML_BLOCK_MAPPING_STYLE), Flow => C.yaml.yaml_mapping_style_t'Enum_Rep (C.yaml.YAML_FLOW_MAPPING_STYLE)); -- parser type String_Constraint is record First : Positive; Last : Natural; end record; pragma Suppress_Initialization (String_Constraint); type Uninitialized_Parsing_Data is limited record Event : aliased YAML.Event; Start_Mark, End_Mark : aliased Mark; Version_Directive : aliased YAML.Version_Directive; Anchor_Constraint : aliased String_Constraint; Tag_Constraint : aliased String_Constraint; Value_Constraint : aliased String_Constraint; yaml_event : aliased C.yaml.yaml_event_t; end record; pragma Suppress_Initialization (Uninitialized_Parsing_Data); type Parsed_Data_Type is limited record -- uninitialized U : aliased Uninitialized_Parsing_Data; -- initialized Delete : access procedure (Parsed_Data : in out Parsed_Data_Type) := null; end record; package Controlled_Parsing_Entries is type Parsing_Entry_Type is limited private; pragma Preelaborable_Initialization (Parsing_Entry_Type); function Constant_Reference (Object : aliased YAML.Parsing_Entry_Type) return not null access constant Parsed_Data_Type; pragma Inline (Constant_Reference); generic type Result_Type (<>) is limited private; with function Process (Raw : Parsed_Data_Type) return Result_Type; function Query (Object : YAML.Parsing_Entry_Type) return Result_Type; pragma Inline (Query); generic with procedure Process (Raw : in out Parsed_Data_Type); procedure Update (Object : in out YAML.Parsing_Entry_Type); pragma Inline (Update); private type Parsing_Entry_Type is limited new Ada.Finalization.Limited_Controlled with record Data : aliased Parsed_Data_Type; end record; overriding procedure Finalize (Object : in out Parsing_Entry_Type); end Controlled_Parsing_Entries; type Parsing_Entry_Type is new Controlled_Parsing_Entries.Parsing_Entry_Type; package Controlled_Parsers is type Parser is limited private; generic type Result_Type (<>) is limited private; with function Process (Raw : not null access constant C.yaml.yaml_parser_t) return Result_Type; function Query (Object : YAML.Parser) return Result_Type; pragma Inline (Query); generic with procedure Process (Raw : not null access C.yaml.yaml_parser_t); procedure Update (Object : in out YAML.Parser); pragma Inline (Update); private type Uninitialized_yaml_parser_t is record X : aliased C.yaml.yaml_parser_t; end record; pragma Suppress_Initialization (Uninitialized_yaml_parser_t); type Parser is limited new Ada.Finalization.Limited_Controlled with record Raw : aliased Uninitialized_yaml_parser_t; end record; overriding procedure Finalize (Object : in out Parser); end Controlled_Parsers; type Parser is new Controlled_Parsers.Parser; -- emitter package Controlled_Emitters is type Emitter is limited private; generic with procedure Process (Raw : not null access C.yaml.yaml_emitter_t); procedure Update (Object : in out YAML.Emitter); pragma Inline (Update); private type Uninitialized_yaml_emitter_t is record X : aliased C.yaml.yaml_emitter_t; end record; pragma Suppress_Initialization (Uninitialized_yaml_emitter_t); type Emitter is limited new Ada.Finalization.Limited_Controlled with record Raw : aliased Uninitialized_yaml_emitter_t; end record; overriding procedure Finalize (Object : in out Emitter); end Controlled_Emitters; type Emitter is new Controlled_Emitters.Emitter; -- exceptions procedure Raise_Error ( Error : in C.yaml.yaml_error_type_t; Problem : access constant C.char; Mark : access constant C.yaml.yaml_mark_t); pragma No_Return (Raise_Error); end YAML;
32.388753
80
0.740394
2e694a1b96302b303317ac1a711f5ac2eb0e1c6d
1,195
ads
Ada
extern/gnat_sdl/gnat_sdl2/src/umingw_secapi_h.ads
AdaCore/training_material
6651eb2c53f8c39649b8e0b3c757bc8ff963025a
[ "CC-BY-4.0" ]
15
2020-10-07T08:56:45.000Z
2022-02-08T23:13:22.000Z
extern/gnat_sdl/gnat_sdl2/src/umingw_secapi_h.ads
AdaCore/training_material
6651eb2c53f8c39649b8e0b3c757bc8ff963025a
[ "CC-BY-4.0" ]
20
2020-11-05T14:35:20.000Z
2022-01-13T15:59:33.000Z
extern/gnat_sdl/gnat_sdl2/src/umingw_secapi_h.ads
AdaCore/training_material
6651eb2c53f8c39649b8e0b3c757bc8ff963025a
[ "CC-BY-4.0" ]
6
2020-10-08T15:57:06.000Z
2021-08-31T12:03:08.000Z
pragma Ada_2005; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; package umingw_secapi_h is --* -- * This file has no copyright assigned and is placed in the Public Domain. -- * This file is part of the mingw-w64 runtime package. -- * No warranty is given; refer to the file DISCLAIMER.PD within this package. -- -- http://msdn.microsoft.com/en-us/library/ms175759%28v=VS.100%29.aspx -- Templates won't work in C, will break if secure API is not enabled, disabled -- The macro _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT requires that _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES -- is also defined as 1. If _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT is defined as 1 and -- _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES is defined as 0, the application will not perform any template overloads. -- -- Fallback on insecure mode if not possible to know destination size at compile time, NULL is appended for strncpy -- For *_l locale types -- https://blogs.msdn.com/b/sdl/archive/2010/02/16/vc-2010-and-memcpy.aspx?Redirected=true -- fallback on default implementation if we can't know the size of the destination end umingw_secapi_h;
45.961538
119
0.755649
04858027b42b69e4690dcc8294e78ffb0f2953e9
2,992
ads
Ada
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/a-dirval.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/a-dirval.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/a-dirval.ads
djamal2727/Main-Bearing-Analytical-Model
2f00c2219c71be0175c6f4f8f1d4cca231d97096
[ "Apache-2.0" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . D I R E C T O R I E S . V A L I D I T Y -- -- -- -- S p e c -- -- -- -- Copyright (C) 2004-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 private child package is used in the body of Ada.Directories. -- It has several bodies, for different platforms. private package Ada.Directories.Validity is function Is_Valid_Simple_Name (Name : String) return Boolean; -- Returns True if Name is a valid file name function Is_Valid_Path_Name (Name : String) return Boolean; -- Returns True if Name is a valid path name function Is_Path_Name_Case_Sensitive return Boolean; -- Returns True if file and path names are case-sensitive function Windows return Boolean; -- Return True when OS is Windows end Ada.Directories.Validity;
59.84
78
0.448195
2f7ab709cb2c44aacc778cadb16ee314af2d6b1f
13,003
ads
Ada
tools-src/gnu/gcc/gcc/ada/s-tposen.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-tposen.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-tposen.ads
modern-tomato/tomato
96f09fab4929c6ddde5c9113f1b2476ad37133c4
[ "FSFAP" ]
69
2015-01-02T10:45:56.000Z
2021-09-06T07:52:13.000Z
------------------------------------------------------------------------------ -- -- -- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . T A S K I N G . P R O T E C T E D _ O B J E C T S . -- -- S I N G L E _ E N T R Y -- -- -- -- S p e c -- -- -- -- $Revision$ -- -- -- Copyright (C) 1991-1999 Florida State University -- -- -- -- 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, 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. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. It is -- -- now maintained by Ada Core Technologies Inc. in cooperation with Florida -- -- State University (http://www.gnat.com). -- -- -- ------------------------------------------------------------------------------ -- This package provides an optimized version of Protected_Objects.Operations -- and Protected_Objects.Entries making the following assumptions: -- -- PO have only one entry -- There is only one caller at a time (No_Entry_Queue) -- There is no dynamic priority support (No_Dynamic_Priorities) -- No Abort Statements -- (No_Abort_Statements, Max_Asynchronous_Select_Nesting => 0) -- PO are at library level -- None of the tasks will terminate (no need for finalization) -- -- This interface is intended to be used in the ravenscar profile, the -- compiler is responsible for ensuring that the conditions mentioned above -- are respected, except for the No_Entry_Queue restriction that is checked -- dynamically in this package, since the check cannot be performed at compile -- time, and is relatively cheap (see body). -- -- This package is part of the high level tasking interface used by the -- compiler to expand Ada 95 tasking constructs into simpler run time calls -- (aka GNARLI, GNU Ada Run-time Library Interface) -- -- Note: the compiler generates direct calls to this interface, via Rtsfind. -- Any changes to this interface may require corresponding compiler changes -- in exp_ch9.adb and possibly exp_ch7.adb package System.Tasking.Protected_Objects.Single_Entry is pragma Elaborate_Body; --------------------------------- -- Compiler Interface (GNARLI) -- --------------------------------- -- The compiler will expand in the GNAT tree the following construct: -- -- protected PO is -- entry E; -- procedure P; -- private -- Open : Boolean := False; -- end PO; -- -- protected body PO is -- entry E when Open is -- ...variable declarations... -- begin -- ...B... -- end E; -- -- procedure P is -- ...variable declarations... -- begin -- ...C... -- end P; -- end PO; -- -- as follows: -- -- protected type poT is -- entry e; -- procedure p; -- private -- open : boolean := false; -- end poT; -- type poTV is limited record -- open : boolean := false; -- _object : aliased protection_entry; -- end record; -- procedure poPT__E1s (O : address; P : address; E : -- protected_entry_index); -- function poPT__B2s (O : address; E : protected_entry_index) return -- boolean; -- procedure poPT__pN (_object : in out poTV); -- procedure poPT__pP (_object : in out poTV); -- poTA : aliased entry_body := ( -- barrier => poPT__B2s'unrestricted_access, -- action => poPT__E1s'unrestricted_access); -- freeze poTV [ -- procedure _init_proc (_init : in out poTV) is -- begin -- _init.open := false; -- _init_proc (_init._object); -- initialize_protection_entry (_init._object'unchecked_access, -- unspecified_priority, _init'address, poTA' -- unrestricted_access); -- return; -- end _init_proc; -- ] -- po : poT; -- _init_proc (poTV!(po)); -- -- function poPT__B2s (O : address; E : protected_entry_index) return -- boolean is -- type poTVP is access poTV; -- _object : poTVP := poTVP!(O); -- poR : protection_entry renames _object._object; -- openP : boolean renames _object.open; -- begin -- return open; -- end poPT__B2s; -- -- procedure poPT__E1s (O : address; P : address; E : -- protected_entry_index) is -- type poTVP is access poTV; -- _object : poTVP := poTVP!(O); -- begin -- B1b : declare -- poR : protection_entry renames _object._object; -- openP : boolean renames _object.open; -- ...variable declarations... -- begin -- ...B... -- end B1b; -- complete_single_entry_body (_object._object'unchecked_access); -- return; -- exception -- when all others => -- exceptional_complete_single_entry_body (_object._object' -- unchecked_access, get_gnat_exception); -- return; -- end poPT__E1s; -- -- procedure poPT__pN (_object : in out poTV) is -- poR : protection_entry renames _object._object; -- openP : boolean renames _object.open; -- ...variable declarations... -- begin -- ...C... -- return; -- end poPT__pN; -- -- procedure poPT__pP (_object : in out poTV) is -- procedure _clean is -- begin -- service_entry (_object._object'unchecked_access); -- unlock_entry (_object._object'unchecked_access); -- return; -- end _clean; -- begin -- lock_entry (_object._object'unchecked_access); -- B5b : begin -- poPT__pN (_object); -- at end -- _clean; -- end B5b; -- return; -- end poPT__pP; type Protection_Entry is limited private; -- This type contains the GNARL state of a protected object. The -- application-defined portion of the state (i.e. private objects) -- is maintained by the compiler-generated code. type Protection_Entry_Access is access all Protection_Entry; procedure Initialize_Protection_Entry (Object : Protection_Entry_Access; Ceiling_Priority : Integer; Compiler_Info : System.Address; Entry_Body : Entry_Body_Access); -- Initialize the Object parameter so that it can be used by the run time -- to keep track of the runtime state of a protected object. procedure Lock_Entry (Object : Protection_Entry_Access); -- Lock a protected object for write access. Upon return, the caller -- owns the lock to this object, and no other call to Lock or -- Lock_Read_Only with the same argument will return until the -- corresponding call to Unlock has been made by the caller. procedure Lock_Read_Only_Entry (Object : Protection_Entry_Access); -- Lock a protected object for read access. Upon return, the caller -- owns the lock for read access, and no other calls to Lock -- with the same argument will return until the corresponding call -- to Unlock has been made by the caller. Other cals to Lock_Read_Only -- may (but need not) return before the call to Unlock, and the -- corresponding callers will also own the lock for read access. procedure Unlock_Entry (Object : Protection_Entry_Access); -- Relinquish ownership of the lock for the object represented by -- the Object parameter. If this ownership was for write access, or -- if it was for read access where there are no other read access -- locks outstanding, one (or more, in the case of Lock_Read_Only) -- of the tasks waiting on this lock (if any) will be given the -- lock and allowed to return from the Lock or Lock_Read_Only call. procedure Service_Entry (Object : Protection_Entry_Access); -- Service the entry queue of the specified object, executing the -- corresponding body of any queued entry call that is waiting on True -- barrier. This is used when the state of a protected object may have -- changed, in particular after the execution of the statement sequence of -- a protected procedure. -- This must be called with abortion deferred and with the corresponding -- object locked. procedure Protected_Single_Entry_Call (Object : Protection_Entry_Access; Uninterpreted_Data : System.Address; Mode : Call_Modes); -- Make a protected entry call to the specified object. -- Pend a protected entry call on the protected object represented -- by Object. A pended call is not queued; it may be executed immediately -- or queued, depending on the state of the entry barrier. -- -- Uninterpreted_Data -- This will be returned by Next_Entry_Call when this call is serviced. -- It can be used by the compiler to pass information between the -- caller and the server, in particular entry parameters. -- -- Mode -- The kind of call to be pended procedure Timed_Protected_Single_Entry_Call (Object : Protection_Entry_Access; Uninterpreted_Data : System.Address; Timeout : Duration; Mode : Delay_Modes; Entry_Call_Successful : out Boolean); -- Same as the Protected_Entry_Call but with time-out specified. -- This routine is used to implement timed entry calls. procedure Complete_Single_Entry_Body (Object : Protection_Entry_Access); pragma Inline (Complete_Single_Entry_Body); -- Called from within an entry body procedure, indicates that the -- corresponding entry call has been serviced. procedure Exceptional_Complete_Single_Entry_Body (Object : Protection_Entry_Access; Ex : Ada.Exceptions.Exception_Id); -- Perform all of the functions of Complete_Entry_Body. In addition, -- report in Ex the exception whose propagation terminated the entry -- body to the runtime system. function Protected_Count_Entry (Object : Protection_Entry) return Natural; -- Return the number of entry calls on Object (0 or 1). function Protected_Single_Entry_Caller (Object : Protection_Entry) return Task_ID; -- Return value of E'Caller, where E is the protected entry currently -- being handled. This will only work if called from within an -- entry body, as required by the LRM (C.7.1(14)). private type Protection_Entry is record L : aliased Task_Primitives.Lock; Compiler_Info : System.Address; Call_In_Progress : Entry_Call_Link; Ceiling : System.Any_Priority; Entry_Body : Entry_Body_Access; Entry_Queue : Entry_Call_Link; end record; pragma Volatile (Protection_Entry); for Protection_Entry'Alignment use Standard'Maximum_Alignment; -- Use maximum alignement so that one can convert a protection_entry_access -- to a task_id. end System.Tasking.Protected_Objects.Single_Entry;
43.929054
79
0.595862
c745a98e0c53726652daa4d945233973cf015bab
7,810
ads
Ada
bb-runtimes/arm/nordic/nrf52/nrf52832/svd/i-nrf52-uicr.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/arm/nordic/nrf52/nrf52832/svd/i-nrf52-uicr.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
bb-runtimes/arm/nordic/nrf52/nrf52832/svd/i-nrf52-uicr.ads
JCGobbi/Nucleo-STM32F334R8
2a0b1b4b2664c92773703ac5e95dcb71979d051c
[ "BSD-3-Clause" ]
null
null
null
-- -- Copyright (C) 2019, AdaCore -- -- Copyright (c) 2010 - 2018, Nordic Semiconductor ASA -- -- All rights reserved. -- -- 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, except as embedded into a Nordic -- Semiconductor ASA integrated circuit in a product or a software update for -- such product, 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 Nordic Semiconductor ASA nor the names of its -- contributors may be used to endorse or promote products derived from this -- software without specific prior written permission. -- -- 4. This software, with or without modification, must only be used with a -- Nordic Semiconductor ASA integrated circuit. -- -- 5. Any software provided in binary form under this license must not be -- reverse engineered, decompiled, modified and/or disassembled. -- -- THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY -- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -- WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A -- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR -- ASA 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 spec has been automatically generated from nrf52.svd pragma Ada_2012; pragma Style_Checks (Off); with System; package Interfaces.NRF52.UICR is pragma Preelaborate; pragma No_Elaboration_Code_All; --------------- -- Registers -- --------------- -- Description collection[0]: Reserved for Nordic firmware design -- Description collection[0]: Reserved for Nordic firmware design type NRFFW_Registers is array (0 .. 14) of Interfaces.NRF52.UInt32; -- Description collection[0]: Reserved for Nordic hardware design -- Description collection[0]: Reserved for Nordic hardware design type NRFHW_Registers is array (0 .. 11) of Interfaces.NRF52.UInt32; -- Description collection[0]: Reserved for customer -- Description collection[0]: Reserved for customer type CUSTOMER_Registers is array (0 .. 31) of Interfaces.NRF52.UInt32; subtype PSELRESET_PIN_Field is Interfaces.NRF52.UInt6; -- Connection type PSELRESET_CONNECT_Field is (-- Connect Connected, -- Disconnect Disconnected) with Size => 1; for PSELRESET_CONNECT_Field use (Connected => 0, Disconnected => 1); -- Description collection[0]: Mapping of the nRESET function (see POWER -- chapter for details) type PSELRESET_Register is record -- GPIO number P0.n onto which Reset is exposed PIN : PSELRESET_PIN_Field := 16#3F#; -- unspecified Reserved_6_30 : Interfaces.NRF52.UInt25 := 16#1FFFFFF#; -- Connection CONNECT : PSELRESET_CONNECT_Field := Interfaces.NRF52.UICR.Disconnected; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PSELRESET_Register use record PIN at 0 range 0 .. 5; Reserved_6_30 at 0 range 6 .. 30; CONNECT at 0 range 31 .. 31; end record; -- Description collection[0]: Mapping of the nRESET function (see POWER -- chapter for details) type PSELRESET_Registers is array (0 .. 1) of PSELRESET_Register; -- Enable or disable Access Port protection. Any other value than 0xFF -- being written to this field will enable protection. type APPROTECT_PALL_Field is (-- Enable Enabled, -- Disable Disabled) with Size => 8; for APPROTECT_PALL_Field use (Enabled => 0, Disabled => 255); -- Access Port protection type APPROTECT_Register is record -- Enable or disable Access Port protection. Any other value than 0xFF -- being written to this field will enable protection. PALL : APPROTECT_PALL_Field := Interfaces.NRF52.UICR.Disabled; -- unspecified Reserved_8_31 : Interfaces.NRF52.UInt24 := 16#FFFFFF#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for APPROTECT_Register use record PALL at 0 range 0 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; -- Setting of pins dedicated to NFC functionality type NFCPINS_PROTECT_Field is (-- Operation as GPIO pins. Same protection as normal GPIO pins Disabled, -- Operation as NFC antenna pins. Configures the protection for NFC operation Nfc) with Size => 1; for NFCPINS_PROTECT_Field use (Disabled => 0, Nfc => 1); -- Setting of pins dedicated to NFC functionality: NFC antenna or GPIO type NFCPINS_Register is record -- Setting of pins dedicated to NFC functionality PROTECT : NFCPINS_PROTECT_Field := Interfaces.NRF52.UICR.Nfc; -- unspecified Reserved_1_31 : Interfaces.NRF52.UInt31 := 16#7FFFFFFF#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for NFCPINS_Register use record PROTECT at 0 range 0 .. 0; Reserved_1_31 at 0 range 1 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- User Information Configuration Registers type UICR_Peripheral is record -- Unspecified UNUSED0 : aliased Interfaces.NRF52.UInt32; -- Unspecified UNUSED1 : aliased Interfaces.NRF52.UInt32; -- Unspecified UNUSED2 : aliased Interfaces.NRF52.UInt32; -- Unspecified UNUSED3 : aliased Interfaces.NRF52.UInt32; -- Description collection[0]: Reserved for Nordic firmware design NRFFW : aliased NRFFW_Registers; -- Description collection[0]: Reserved for Nordic hardware design NRFHW : aliased NRFHW_Registers; -- Description collection[0]: Reserved for customer CUSTOMER : aliased CUSTOMER_Registers; -- Description collection[0]: Mapping of the nRESET function (see POWER -- chapter for details) PSELRESET : aliased PSELRESET_Registers; -- Access Port protection APPROTECT : aliased APPROTECT_Register; -- Setting of pins dedicated to NFC functionality: NFC antenna or GPIO NFCPINS : aliased NFCPINS_Register; end record with Volatile; for UICR_Peripheral use record UNUSED0 at 16#0# range 0 .. 31; UNUSED1 at 16#4# range 0 .. 31; UNUSED2 at 16#8# range 0 .. 31; UNUSED3 at 16#10# range 0 .. 31; NRFFW at 16#14# range 0 .. 479; NRFHW at 16#50# range 0 .. 383; CUSTOMER at 16#80# range 0 .. 1023; PSELRESET at 16#200# range 0 .. 63; APPROTECT at 16#208# range 0 .. 31; NFCPINS at 16#20C# range 0 .. 31; end record; -- User Information Configuration Registers UICR_Periph : aliased UICR_Peripheral with Import, Address => UICR_Base; end Interfaces.NRF52.UICR;
36.666667
84
0.680282
3d6c39583c84886567680e0cbbb80cca51825116
475,624
adb
Ada
gcc-gcc-7_3_0-release/gcc/ada/sem_res.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_res.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/sem_res.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 _ R E S -- -- -- -- 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 Atree; use Atree; with Checks; use Checks; with Debug; use Debug; with Debug_A; use Debug_A; with Einfo; use Einfo; with Errout; use Errout; with Expander; use Expander; with Exp_Disp; use Exp_Disp; with Exp_Ch6; use Exp_Ch6; with Exp_Ch7; use Exp_Ch7; with Exp_Tss; use Exp_Tss; with Exp_Util; use Exp_Util; with Fname; use Fname; with Freeze; use Freeze; with Ghost; use Ghost; with Inline; use Inline; with Itypes; use Itypes; with Lib; use Lib; with Lib.Xref; use Lib.Xref; with Namet; use Namet; with Nmake; use Nmake; with Nlists; use Nlists; with Opt; use Opt; with Output; use Output; with Par_SCO; use Par_SCO; with Restrict; use Restrict; with Rident; use Rident; with Rtsfind; use Rtsfind; with Sem; use Sem; with Sem_Aux; use Sem_Aux; with Sem_Aggr; use Sem_Aggr; with Sem_Attr; use Sem_Attr; with Sem_Cat; use Sem_Cat; with Sem_Ch4; use Sem_Ch4; with Sem_Ch3; use Sem_Ch3; with Sem_Ch6; use Sem_Ch6; with Sem_Ch8; use Sem_Ch8; with Sem_Ch13; use Sem_Ch13; with Sem_Dim; use Sem_Dim; with Sem_Disp; use Sem_Disp; with Sem_Dist; use Sem_Dist; with Sem_Elim; use Sem_Elim; with Sem_Elab; use Sem_Elab; with Sem_Eval; use Sem_Eval; with Sem_Intr; use Sem_Intr; with Sem_Util; use Sem_Util; with Targparm; use Targparm; with Sem_Type; use Sem_Type; with Sem_Warn; use Sem_Warn; with Sinfo; use Sinfo; with Sinfo.CN; use Sinfo.CN; with Snames; use Snames; with Stand; use Stand; with Stringt; use Stringt; with Style; use Style; with Tbuild; use Tbuild; with Uintp; use Uintp; with Urealp; use Urealp; package body Sem_Res is ----------------------- -- Local Subprograms -- ----------------------- -- Second pass (top-down) type checking and overload resolution procedures -- Typ is the type required by context. These procedures propagate the -- type information recursively to the descendants of N. If the node is not -- overloaded, its Etype is established in the first pass. If overloaded, -- the Resolve routines set the correct type. For arithmetic operators, the -- Etype is the base type of the context. -- Note that Resolve_Attribute is separated off in Sem_Attr procedure Check_Discriminant_Use (N : Node_Id); -- Enforce the restrictions on the use of discriminants when constraining -- a component of a discriminated type (record or concurrent type). procedure Check_For_Visible_Operator (N : Node_Id; T : Entity_Id); -- Given a node for an operator associated with type T, check that the -- operator is visible. Operators all of whose operands are universal must -- be checked for visibility during resolution because their type is not -- determinable based on their operands. procedure Check_Fully_Declared_Prefix (Typ : Entity_Id; Pref : Node_Id); -- Check that the type of the prefix of a dereference is not incomplete function Check_Infinite_Recursion (N : Node_Id) return Boolean; -- Given a call node, N, which is known to occur immediately within the -- subprogram being called, determines whether it is a detectable case of -- an infinite recursion, and if so, outputs appropriate messages. Returns -- True if an infinite recursion is detected, and False otherwise. procedure Check_Initialization_Call (N : Entity_Id; Nam : Entity_Id); -- If the type of the object being initialized uses the secondary stack -- directly or indirectly, create a transient scope for the call to the -- init proc. This is because we do not create transient scopes for the -- initialization of individual components within the init proc itself. -- Could be optimized away perhaps? procedure Check_No_Direct_Boolean_Operators (N : Node_Id); -- N is the node for a logical operator. If the operator is predefined, and -- the root type of the operands is Standard.Boolean, then a check is made -- for restriction No_Direct_Boolean_Operators. This procedure also handles -- the style check for Style_Check_Boolean_And_Or. function Is_Atomic_Ref_With_Address (N : Node_Id) return Boolean; -- N is either an indexed component or a selected component. This function -- returns true if the prefix refers to an object that has an address -- clause (the case in which we may want to issue a warning). function Is_Definite_Access_Type (E : Entity_Id) return Boolean; -- Determine whether E is an access type declared by an access declaration, -- and not an (anonymous) allocator type. function Is_Predefined_Op (Nam : Entity_Id) return Boolean; -- Utility to check whether the entity for an operator is a predefined -- operator, in which case the expression is left as an operator in the -- tree (else it is rewritten into a call). An instance of an intrinsic -- conversion operation may be given an operator name, but is not treated -- like an operator. Note that an operator that is an imported back-end -- builtin has convention Intrinsic, but is expected to be rewritten into -- a call, so such an operator is not treated as predefined by this -- predicate. procedure Replace_Actual_Discriminants (N : Node_Id; Default : Node_Id); -- If a default expression in entry call N depends on the discriminants -- of the task, it must be replaced with a reference to the discriminant -- of the task being called. procedure Resolve_Op_Concat_Arg (N : Node_Id; Arg : Node_Id; Typ : Entity_Id; Is_Comp : Boolean); -- Internal procedure for Resolve_Op_Concat to resolve one operand of -- concatenation operator. The operand is either of the array type or of -- the component type. If the operand is an aggregate, and the component -- type is composite, this is ambiguous if component type has aggregates. procedure Resolve_Op_Concat_First (N : Node_Id; Typ : Entity_Id); -- Does the first part of the work of Resolve_Op_Concat procedure Resolve_Op_Concat_Rest (N : Node_Id; Typ : Entity_Id); -- Does the "rest" of the work of Resolve_Op_Concat, after the left operand -- has been resolved. See Resolve_Op_Concat for details. procedure Resolve_Allocator (N : Node_Id; Typ : Entity_Id); procedure Resolve_Arithmetic_Op (N : Node_Id; Typ : Entity_Id); procedure Resolve_Call (N : Node_Id; Typ : Entity_Id); procedure Resolve_Case_Expression (N : Node_Id; Typ : Entity_Id); procedure Resolve_Character_Literal (N : Node_Id; Typ : Entity_Id); procedure Resolve_Comparison_Op (N : Node_Id; Typ : Entity_Id); procedure Resolve_Entity_Name (N : Node_Id; Typ : Entity_Id); procedure Resolve_Equality_Op (N : Node_Id; Typ : Entity_Id); procedure Resolve_Explicit_Dereference (N : Node_Id; Typ : Entity_Id); procedure Resolve_Expression_With_Actions (N : Node_Id; Typ : Entity_Id); procedure Resolve_If_Expression (N : Node_Id; Typ : Entity_Id); procedure Resolve_Generalized_Indexing (N : Node_Id; Typ : Entity_Id); procedure Resolve_Indexed_Component (N : Node_Id; Typ : Entity_Id); procedure Resolve_Integer_Literal (N : Node_Id; Typ : Entity_Id); procedure Resolve_Logical_Op (N : Node_Id; Typ : Entity_Id); procedure Resolve_Membership_Op (N : Node_Id; Typ : Entity_Id); procedure Resolve_Null (N : Node_Id; Typ : Entity_Id); procedure Resolve_Operator_Symbol (N : Node_Id; Typ : Entity_Id); procedure Resolve_Op_Concat (N : Node_Id; Typ : Entity_Id); procedure Resolve_Op_Expon (N : Node_Id; Typ : Entity_Id); procedure Resolve_Op_Not (N : Node_Id; Typ : Entity_Id); procedure Resolve_Qualified_Expression (N : Node_Id; Typ : Entity_Id); procedure Resolve_Raise_Expression (N : Node_Id; Typ : Entity_Id); procedure Resolve_Range (N : Node_Id; Typ : Entity_Id); procedure Resolve_Real_Literal (N : Node_Id; Typ : Entity_Id); procedure Resolve_Reference (N : Node_Id; Typ : Entity_Id); procedure Resolve_Selected_Component (N : Node_Id; Typ : Entity_Id); procedure Resolve_Shift (N : Node_Id; Typ : Entity_Id); procedure Resolve_Short_Circuit (N : Node_Id; Typ : Entity_Id); procedure Resolve_Slice (N : Node_Id; Typ : Entity_Id); procedure Resolve_String_Literal (N : Node_Id; Typ : Entity_Id); procedure Resolve_Target_Name (N : Node_Id; Typ : Entity_Id); procedure Resolve_Type_Conversion (N : Node_Id; Typ : Entity_Id); procedure Resolve_Unary_Op (N : Node_Id; Typ : Entity_Id); procedure Resolve_Unchecked_Expression (N : Node_Id; Typ : Entity_Id); procedure Resolve_Unchecked_Type_Conversion (N : Node_Id; Typ : Entity_Id); function Operator_Kind (Op_Name : Name_Id; Is_Binary : Boolean) return Node_Kind; -- Utility to map the name of an operator into the corresponding Node. Used -- by other node rewriting procedures. procedure Resolve_Actuals (N : Node_Id; Nam : Entity_Id); -- Resolve actuals of call, and add default expressions for missing ones. -- N is the Node_Id for the subprogram call, and Nam is the entity of the -- called subprogram. procedure Resolve_Entry_Call (N : Node_Id; Typ : Entity_Id); -- Called from Resolve_Call, when the prefix denotes an entry or element -- of entry family. Actuals are resolved as for subprograms, and the node -- is rebuilt as an entry call. Also called for protected operations. Typ -- is the context type, which is used when the operation is a protected -- function with no arguments, and the return value is indexed. procedure Resolve_Intrinsic_Operator (N : Node_Id; Typ : Entity_Id); -- A call to a user-defined intrinsic operator is rewritten as a call to -- the corresponding predefined operator, with suitable conversions. Note -- that this applies only for intrinsic operators that denote predefined -- operators, not ones that are intrinsic imports of back-end builtins. procedure Resolve_Intrinsic_Unary_Operator (N : Node_Id; Typ : Entity_Id); -- Ditto, for arithmetic unary operators procedure Rewrite_Operator_As_Call (N : Node_Id; Nam : Entity_Id); -- If an operator node resolves to a call to a user-defined operator, -- rewrite the node as a function call. procedure Make_Call_Into_Operator (N : Node_Id; Typ : Entity_Id; Op_Id : Entity_Id); -- Inverse transformation: if an operator is given in functional notation, -- then after resolving the node, transform into an operator node, so that -- operands are resolved properly. Recall that predefined operators do not -- have a full signature and special resolution rules apply. procedure Rewrite_Renamed_Operator (N : Node_Id; Op : Entity_Id; Typ : Entity_Id); -- An operator can rename another, e.g. in an instantiation. In that -- case, the proper operator node must be constructed and resolved. procedure Set_String_Literal_Subtype (N : Node_Id; Typ : Entity_Id); -- The String_Literal_Subtype is built for all strings that are not -- operands of a static concatenation operation. If the argument is not -- a N_String_Literal node, then the call has no effect. procedure Set_Slice_Subtype (N : Node_Id); -- Build subtype of array type, with the range specified by the slice procedure Simplify_Type_Conversion (N : Node_Id); -- Called after N has been resolved and evaluated, but before range checks -- have been applied. Currently simplifies a combination of floating-point -- to integer conversion and Rounding or Truncation attribute. function Unique_Fixed_Point_Type (N : Node_Id) return Entity_Id; -- A universal_fixed expression in an universal context is unambiguous if -- there is only one applicable fixed point type. Determining whether there -- is only one requires a search over all visible entities, and happens -- only in very pathological cases (see 6115-006). ------------------------- -- Ambiguous_Character -- ------------------------- procedure Ambiguous_Character (C : Node_Id) is E : Entity_Id; begin if Nkind (C) = N_Character_Literal then Error_Msg_N ("ambiguous character literal", C); -- First the ones in Standard Error_Msg_N ("\\possible interpretation: Character!", C); Error_Msg_N ("\\possible interpretation: Wide_Character!", C); -- Include Wide_Wide_Character in Ada 2005 mode if Ada_Version >= Ada_2005 then Error_Msg_N ("\\possible interpretation: Wide_Wide_Character!", C); end if; -- Now any other types that match E := Current_Entity (C); while Present (E) loop Error_Msg_NE ("\\possible interpretation:}!", C, Etype (E)); E := Homonym (E); end loop; end if; end Ambiguous_Character; ------------------------- -- Analyze_And_Resolve -- ------------------------- procedure Analyze_And_Resolve (N : Node_Id) is begin Analyze (N); Resolve (N); end Analyze_And_Resolve; procedure Analyze_And_Resolve (N : Node_Id; Typ : Entity_Id) is begin Analyze (N); Resolve (N, Typ); end Analyze_And_Resolve; -- Versions with check(s) suppressed procedure Analyze_And_Resolve (N : Node_Id; Typ : Entity_Id; Suppress : Check_Id) is Scop : constant Entity_Id := Current_Scope; begin if Suppress = All_Checks then declare Sva : constant Suppress_Array := Scope_Suppress.Suppress; begin Scope_Suppress.Suppress := (others => True); Analyze_And_Resolve (N, Typ); Scope_Suppress.Suppress := Sva; end; else declare Svg : constant Boolean := Scope_Suppress.Suppress (Suppress); begin Scope_Suppress.Suppress (Suppress) := True; Analyze_And_Resolve (N, Typ); Scope_Suppress.Suppress (Suppress) := Svg; end; end if; if Current_Scope /= Scop and then Scope_Is_Transient then -- This can only happen if a transient scope was created for an inner -- expression, which will be removed upon completion of the analysis -- of an enclosing construct. The transient scope must have the -- suppress status of the enclosing environment, not of this Analyze -- call. Scope_Stack.Table (Scope_Stack.Last).Save_Scope_Suppress := Scope_Suppress; end if; end Analyze_And_Resolve; procedure Analyze_And_Resolve (N : Node_Id; Suppress : Check_Id) is Scop : constant Entity_Id := Current_Scope; begin if Suppress = All_Checks then declare Sva : constant Suppress_Array := Scope_Suppress.Suppress; begin Scope_Suppress.Suppress := (others => True); Analyze_And_Resolve (N); Scope_Suppress.Suppress := Sva; end; else declare Svg : constant Boolean := Scope_Suppress.Suppress (Suppress); begin Scope_Suppress.Suppress (Suppress) := True; Analyze_And_Resolve (N); Scope_Suppress.Suppress (Suppress) := Svg; end; end if; if Current_Scope /= Scop and then Scope_Is_Transient then Scope_Stack.Table (Scope_Stack.Last).Save_Scope_Suppress := Scope_Suppress; end if; end Analyze_And_Resolve; ---------------------------- -- Check_Discriminant_Use -- ---------------------------- procedure Check_Discriminant_Use (N : Node_Id) is PN : constant Node_Id := Parent (N); Disc : constant Entity_Id := Entity (N); P : Node_Id; D : Node_Id; begin -- Any use in a spec-expression is legal if In_Spec_Expression then null; elsif Nkind (PN) = N_Range then -- Discriminant cannot be used to constrain a scalar type P := Parent (PN); if Nkind (P) = N_Range_Constraint and then Nkind (Parent (P)) = N_Subtype_Indication and then Nkind (Parent (Parent (P))) = N_Component_Definition then Error_Msg_N ("discriminant cannot constrain scalar type", N); elsif Nkind (P) = N_Index_Or_Discriminant_Constraint then -- The following check catches the unusual case where a -- discriminant appears within an index constraint that is part -- of a larger expression within a constraint on a component, -- e.g. "C : Int range 1 .. F (new A(1 .. D))". For now we only -- check case of record components, and note that a similar check -- should also apply in the case of discriminant constraints -- below. ??? -- Note that the check for N_Subtype_Declaration below is to -- detect the valid use of discriminants in the constraints of a -- subtype declaration when this subtype declaration appears -- inside the scope of a record type (which is syntactically -- illegal, but which may be created as part of derived type -- processing for records). See Sem_Ch3.Build_Derived_Record_Type -- for more info. if Ekind (Current_Scope) = E_Record_Type and then Scope (Disc) = Current_Scope and then not (Nkind (Parent (P)) = N_Subtype_Indication and then Nkind_In (Parent (Parent (P)), N_Component_Definition, N_Subtype_Declaration) and then Paren_Count (N) = 0) then Error_Msg_N ("discriminant must appear alone in component constraint", N); return; end if; -- Detect a common error: -- type R (D : Positive := 100) is record -- Name : String (1 .. D); -- end record; -- The default value causes an object of type R to be allocated -- with room for Positive'Last characters. The RM does not mandate -- the allocation of the maximum size, but that is what GNAT does -- so we should warn the programmer that there is a problem. Check_Large : declare SI : Node_Id; T : Entity_Id; TB : Node_Id; CB : Entity_Id; function Large_Storage_Type (T : Entity_Id) return Boolean; -- Return True if type T has a large enough range that any -- array whose index type covered the whole range of the type -- would likely raise Storage_Error. ------------------------ -- Large_Storage_Type -- ------------------------ function Large_Storage_Type (T : Entity_Id) return Boolean is begin -- The type is considered large if its bounds are known at -- compile time and if it requires at least as many bits as -- a Positive to store the possible values. return Compile_Time_Known_Value (Type_Low_Bound (T)) and then Compile_Time_Known_Value (Type_High_Bound (T)) and then Minimum_Size (T, Biased => True) >= RM_Size (Standard_Positive); end Large_Storage_Type; -- Start of processing for Check_Large begin -- Check that the Disc has a large range if not Large_Storage_Type (Etype (Disc)) then goto No_Danger; end if; -- If the enclosing type is limited, we allocate only the -- default value, not the maximum, and there is no need for -- a warning. if Is_Limited_Type (Scope (Disc)) then goto No_Danger; end if; -- Check that it is the high bound if N /= High_Bound (PN) or else No (Discriminant_Default_Value (Disc)) then goto No_Danger; end if; -- Check the array allows a large range at this bound. First -- find the array SI := Parent (P); if Nkind (SI) /= N_Subtype_Indication then goto No_Danger; end if; T := Entity (Subtype_Mark (SI)); if not Is_Array_Type (T) then goto No_Danger; end if; -- Next, find the dimension TB := First_Index (T); CB := First (Constraints (P)); while True and then Present (TB) and then Present (CB) and then CB /= PN loop Next_Index (TB); Next (CB); end loop; if CB /= PN then goto No_Danger; end if; -- Now, check the dimension has a large range if not Large_Storage_Type (Etype (TB)) then goto No_Danger; end if; -- Warn about the danger Error_Msg_N ("??creation of & object may raise Storage_Error!", Scope (Disc)); <<No_Danger>> null; end Check_Large; end if; -- Legal case is in index or discriminant constraint elsif Nkind_In (PN, N_Index_Or_Discriminant_Constraint, N_Discriminant_Association) then if Paren_Count (N) > 0 then Error_Msg_N ("discriminant in constraint must appear alone", N); elsif Nkind (N) = N_Expanded_Name and then Comes_From_Source (N) then Error_Msg_N ("discriminant must appear alone as a direct name", N); end if; return; -- Otherwise, context is an expression. It should not be within (i.e. a -- subexpression of) a constraint for a component. else D := PN; P := Parent (PN); while not Nkind_In (P, N_Component_Declaration, N_Subtype_Indication, N_Entry_Declaration) loop D := P; P := Parent (P); exit when No (P); end loop; -- If the discriminant is used in an expression that is a bound of a -- scalar type, an Itype is created and the bounds are attached to -- its range, not to the original subtype indication. Such use is of -- course a double fault. if (Nkind (P) = N_Subtype_Indication and then Nkind_In (Parent (P), N_Component_Definition, N_Derived_Type_Definition) and then D = Constraint (P)) -- The constraint itself may be given by a subtype indication, -- rather than by a more common discrete range. or else (Nkind (P) = N_Subtype_Indication and then Nkind (Parent (P)) = N_Index_Or_Discriminant_Constraint) or else Nkind (P) = N_Entry_Declaration or else Nkind (D) = N_Defining_Identifier then Error_Msg_N ("discriminant in constraint must appear alone", N); end if; end if; end Check_Discriminant_Use; -------------------------------- -- Check_For_Visible_Operator -- -------------------------------- procedure Check_For_Visible_Operator (N : Node_Id; T : Entity_Id) is begin if Is_Invisible_Operator (N, T) then Error_Msg_NE -- CODEFIX ("operator for} is not directly visible!", N, First_Subtype (T)); Error_Msg_N -- CODEFIX ("use clause would make operation legal!", N); end if; end Check_For_Visible_Operator; ---------------------------------- -- Check_Fully_Declared_Prefix -- ---------------------------------- procedure Check_Fully_Declared_Prefix (Typ : Entity_Id; Pref : Node_Id) is begin -- Check that the designated type of the prefix of a dereference is -- not an incomplete type. This cannot be done unconditionally, because -- dereferences of private types are legal in default expressions. This -- case is taken care of in Check_Fully_Declared, called below. There -- are also 2005 cases where it is legal for the prefix to be unfrozen. -- This consideration also applies to similar checks for allocators, -- qualified expressions, and type conversions. -- An additional exception concerns other per-object expressions that -- are not directly related to component declarations, in particular -- representation pragmas for tasks. These will be per-object -- expressions if they depend on discriminants or some global entity. -- If the task has access discriminants, the designated type may be -- incomplete at the point the expression is resolved. This resolution -- takes place within the body of the initialization procedure, where -- the discriminant is replaced by its discriminal. if Is_Entity_Name (Pref) and then Ekind (Entity (Pref)) = E_In_Parameter then null; -- Ada 2005 (AI-326): Tagged incomplete types allowed. The wrong usages -- are handled by Analyze_Access_Attribute, Analyze_Assignment, -- Analyze_Object_Renaming, and Freeze_Entity. elsif Ada_Version >= Ada_2005 and then Is_Entity_Name (Pref) and then Is_Access_Type (Etype (Pref)) and then Ekind (Directly_Designated_Type (Etype (Pref))) = E_Incomplete_Type and then Is_Tagged_Type (Directly_Designated_Type (Etype (Pref))) then null; else Check_Fully_Declared (Typ, Parent (Pref)); end if; end Check_Fully_Declared_Prefix; ------------------------------ -- Check_Infinite_Recursion -- ------------------------------ function Check_Infinite_Recursion (N : Node_Id) return Boolean is P : Node_Id; C : Node_Id; function Same_Argument_List return Boolean; -- Check whether list of actuals is identical to list of formals of -- called function (which is also the enclosing scope). ------------------------ -- Same_Argument_List -- ------------------------ function Same_Argument_List return Boolean is A : Node_Id; F : Entity_Id; Subp : Entity_Id; begin if not Is_Entity_Name (Name (N)) then return False; else Subp := Entity (Name (N)); end if; F := First_Formal (Subp); A := First_Actual (N); while Present (F) and then Present (A) loop if not Is_Entity_Name (A) or else Entity (A) /= F then return False; end if; Next_Actual (A); Next_Formal (F); end loop; return True; end Same_Argument_List; -- Start of processing for Check_Infinite_Recursion begin -- Special case, if this is a procedure call and is a call to the -- current procedure with the same argument list, then this is for -- sure an infinite recursion and we insert a call to raise SE. if Is_List_Member (N) and then List_Length (List_Containing (N)) = 1 and then Same_Argument_List then declare P : constant Node_Id := Parent (N); begin if Nkind (P) = N_Handled_Sequence_Of_Statements and then Nkind (Parent (P)) = N_Subprogram_Body and then Is_Empty_List (Declarations (Parent (P))) then Error_Msg_Warn := SPARK_Mode /= On; Error_Msg_N ("!infinite recursion<<", N); Error_Msg_N ("\!Storage_Error [<<", N); Insert_Action (N, Make_Raise_Storage_Error (Sloc (N), Reason => SE_Infinite_Recursion)); return True; end if; end; end if; -- If not that special case, search up tree, quitting if we reach a -- construct (e.g. a conditional) that tells us that this is not a -- case for an infinite recursion warning. C := N; loop P := Parent (C); -- If no parent, then we were not inside a subprogram, this can for -- example happen when processing certain pragmas in a spec. Just -- return False in this case. if No (P) then return False; end if; -- Done if we get to subprogram body, this is definitely an infinite -- recursion case if we did not find anything to stop us. exit when Nkind (P) = N_Subprogram_Body; -- If appearing in conditional, result is false if Nkind_In (P, N_Or_Else, N_And_Then, N_Case_Expression, N_Case_Statement, N_If_Expression, N_If_Statement) then return False; elsif Nkind (P) = N_Handled_Sequence_Of_Statements and then C /= First (Statements (P)) then -- If the call is the expression of a return statement and the -- actuals are identical to the formals, it's worth a warning. -- However, we skip this if there is an immediately preceding -- raise statement, since the call is never executed. -- Furthermore, this corresponds to a common idiom: -- function F (L : Thing) return Boolean is -- begin -- raise Program_Error; -- return F (L); -- end F; -- for generating a stub function if Nkind (Parent (N)) = N_Simple_Return_Statement and then Same_Argument_List then exit when not Is_List_Member (Parent (N)); -- OK, return statement is in a statement list, look for raise declare Nod : Node_Id; begin -- Skip past N_Freeze_Entity nodes generated by expansion Nod := Prev (Parent (N)); while Present (Nod) and then Nkind (Nod) = N_Freeze_Entity loop Prev (Nod); end loop; -- If no raise statement, give warning. We look at the -- original node, because in the case of "raise ... with -- ...", the node has been transformed into a call. exit when Nkind (Original_Node (Nod)) /= N_Raise_Statement and then (Nkind (Nod) not in N_Raise_xxx_Error or else Present (Condition (Nod))); end; end if; return False; else C := P; end if; end loop; Error_Msg_Warn := SPARK_Mode /= On; Error_Msg_N ("!possible infinite recursion<<", N); Error_Msg_N ("\!??Storage_Error ]<<", N); return True; end Check_Infinite_Recursion; ------------------------------- -- Check_Initialization_Call -- ------------------------------- procedure Check_Initialization_Call (N : Entity_Id; Nam : Entity_Id) is Typ : constant Entity_Id := Etype (First_Formal (Nam)); function Uses_SS (T : Entity_Id) return Boolean; -- Check whether the creation of an object of the type will involve -- use of the secondary stack. If T is a record type, this is true -- if the expression for some component uses the secondary stack, e.g. -- through a call to a function that returns an unconstrained value. -- False if T is controlled, because cleanups occur elsewhere. ------------- -- Uses_SS -- ------------- function Uses_SS (T : Entity_Id) return Boolean is Comp : Entity_Id; Expr : Node_Id; Full_Type : Entity_Id := Underlying_Type (T); begin -- Normally we want to use the underlying type, but if it's not set -- then continue with T. if not Present (Full_Type) then Full_Type := T; end if; if Is_Controlled (Full_Type) then return False; elsif Is_Array_Type (Full_Type) then return Uses_SS (Component_Type (Full_Type)); elsif Is_Record_Type (Full_Type) then Comp := First_Component (Full_Type); while Present (Comp) loop if Ekind (Comp) = E_Component and then Nkind (Parent (Comp)) = N_Component_Declaration then -- The expression for a dynamic component may be rewritten -- as a dereference, so retrieve original node. Expr := Original_Node (Expression (Parent (Comp))); -- Return True if the expression is a call to a function -- (including an attribute function such as Image, or a -- user-defined operator) with a result that requires a -- transient scope. if (Nkind (Expr) = N_Function_Call or else Nkind (Expr) in N_Op or else (Nkind (Expr) = N_Attribute_Reference and then Present (Expressions (Expr)))) and then Requires_Transient_Scope (Etype (Expr)) then return True; elsif Uses_SS (Etype (Comp)) then return True; end if; end if; Next_Component (Comp); end loop; return False; else return False; end if; end Uses_SS; -- Start of processing for Check_Initialization_Call begin -- Establish a transient scope if the type needs it if Uses_SS (Typ) then Establish_Transient_Scope (First_Actual (N), Sec_Stack => True); end if; end Check_Initialization_Call; --------------------------------------- -- Check_No_Direct_Boolean_Operators -- --------------------------------------- procedure Check_No_Direct_Boolean_Operators (N : Node_Id) is begin if Scope (Entity (N)) = Standard_Standard and then Root_Type (Etype (Left_Opnd (N))) = Standard_Boolean then -- Restriction only applies to original source code if Comes_From_Source (N) then Check_Restriction (No_Direct_Boolean_Operators, N); end if; end if; -- Do style check (but skip if in instance, error is on template) if Style_Check then if not In_Instance then Check_Boolean_Operator (N); end if; end if; end Check_No_Direct_Boolean_Operators; ------------------------------ -- Check_Parameterless_Call -- ------------------------------ procedure Check_Parameterless_Call (N : Node_Id) is Nam : Node_Id; function Prefix_Is_Access_Subp return Boolean; -- If the prefix is of an access_to_subprogram type, the node must be -- rewritten as a call. Ditto if the prefix is overloaded and all its -- interpretations are access to subprograms. --------------------------- -- Prefix_Is_Access_Subp -- --------------------------- function Prefix_Is_Access_Subp return Boolean is I : Interp_Index; It : Interp; begin -- If the context is an attribute reference that can apply to -- functions, this is never a parameterless call (RM 4.1.4(6)). if Nkind (Parent (N)) = N_Attribute_Reference and then Nam_In (Attribute_Name (Parent (N)), Name_Address, Name_Code_Address, Name_Access) then return False; end if; if not Is_Overloaded (N) then return Ekind (Etype (N)) = E_Subprogram_Type and then Base_Type (Etype (Etype (N))) /= Standard_Void_Type; else Get_First_Interp (N, I, It); while Present (It.Typ) loop if Ekind (It.Typ) /= E_Subprogram_Type or else Base_Type (Etype (It.Typ)) = Standard_Void_Type then return False; end if; Get_Next_Interp (I, It); end loop; return True; end if; end Prefix_Is_Access_Subp; -- Start of processing for Check_Parameterless_Call begin -- Defend against junk stuff if errors already detected if Total_Errors_Detected /= 0 then if Nkind (N) in N_Has_Etype and then Etype (N) = Any_Type then return; elsif Nkind (N) in N_Has_Chars and then Chars (N) in Error_Name_Or_No_Name then return; end if; Require_Entity (N); end if; -- If the context expects a value, and the name is a procedure, this is -- most likely a missing 'Access. Don't try to resolve the parameterless -- call, error will be caught when the outer call is analyzed. if Is_Entity_Name (N) and then Ekind (Entity (N)) = E_Procedure and then not Is_Overloaded (N) and then Nkind_In (Parent (N), N_Parameter_Association, N_Function_Call, N_Procedure_Call_Statement) then return; end if; -- Rewrite as call if overloadable entity that is (or could be, in the -- overloaded case) a function call. If we know for sure that the entity -- is an enumeration literal, we do not rewrite it. -- If the entity is the name of an operator, it cannot be a call because -- operators cannot have default parameters. In this case, this must be -- a string whose contents coincide with an operator name. Set the kind -- of the node appropriately. if (Is_Entity_Name (N) and then Nkind (N) /= N_Operator_Symbol and then Is_Overloadable (Entity (N)) and then (Ekind (Entity (N)) /= E_Enumeration_Literal or else Is_Overloaded (N))) -- Rewrite as call if it is an explicit dereference of an expression of -- a subprogram access type, and the subprogram type is not that of a -- procedure or entry. or else (Nkind (N) = N_Explicit_Dereference and then Prefix_Is_Access_Subp) -- Rewrite as call if it is a selected component which is a function, -- this is the case of a call to a protected function (which may be -- overloaded with other protected operations). or else (Nkind (N) = N_Selected_Component and then (Ekind (Entity (Selector_Name (N))) = E_Function or else (Ekind_In (Entity (Selector_Name (N)), E_Entry, E_Procedure) and then Is_Overloaded (Selector_Name (N))))) -- If one of the above three conditions is met, rewrite as call. Apply -- the rewriting only once. then if Nkind (Parent (N)) /= N_Function_Call or else N /= Name (Parent (N)) then -- This may be a prefixed call that was not fully analyzed, e.g. -- an actual in an instance. if Ada_Version >= Ada_2005 and then Nkind (N) = N_Selected_Component and then Is_Dispatching_Operation (Entity (Selector_Name (N))) then Analyze_Selected_Component (N); if Nkind (N) /= N_Selected_Component then return; end if; end if; -- The node is the name of the parameterless call. Preserve its -- descendants, which may be complex expressions. Nam := Relocate_Node (N); -- If overloaded, overload set belongs to new copy Save_Interps (N, Nam); -- Change node to parameterless function call (note that the -- Parameter_Associations associations field is left set to Empty, -- its normal default value since there are no parameters) Change_Node (N, N_Function_Call); Set_Name (N, Nam); Set_Sloc (N, Sloc (Nam)); Analyze_Call (N); end if; elsif Nkind (N) = N_Parameter_Association then Check_Parameterless_Call (Explicit_Actual_Parameter (N)); elsif Nkind (N) = N_Operator_Symbol then Change_Operator_Symbol_To_String_Literal (N); Set_Is_Overloaded (N, False); Set_Etype (N, Any_String); end if; end Check_Parameterless_Call; -------------------------------- -- Is_Atomic_Ref_With_Address -- -------------------------------- function Is_Atomic_Ref_With_Address (N : Node_Id) return Boolean is Pref : constant Node_Id := Prefix (N); begin if not Is_Entity_Name (Pref) then return False; else declare Pent : constant Entity_Id := Entity (Pref); Ptyp : constant Entity_Id := Etype (Pent); begin return not Is_Access_Type (Ptyp) and then (Is_Atomic (Ptyp) or else Is_Atomic (Pent)) and then Present (Address_Clause (Pent)); end; end if; end Is_Atomic_Ref_With_Address; ----------------------------- -- Is_Definite_Access_Type -- ----------------------------- function Is_Definite_Access_Type (E : Entity_Id) return Boolean is Btyp : constant Entity_Id := Base_Type (E); begin return Ekind (Btyp) = E_Access_Type or else (Ekind (Btyp) = E_Access_Subprogram_Type and then Comes_From_Source (Btyp)); end Is_Definite_Access_Type; ---------------------- -- Is_Predefined_Op -- ---------------------- function Is_Predefined_Op (Nam : Entity_Id) return Boolean is begin -- Predefined operators are intrinsic subprograms if not Is_Intrinsic_Subprogram (Nam) then return False; end if; -- A call to a back-end builtin is never a predefined operator if Is_Imported (Nam) and then Present (Interface_Name (Nam)) then return False; end if; return not Is_Generic_Instance (Nam) and then Chars (Nam) in Any_Operator_Name and then (No (Alias (Nam)) or else Is_Predefined_Op (Alias (Nam))); end Is_Predefined_Op; ----------------------------- -- Make_Call_Into_Operator -- ----------------------------- procedure Make_Call_Into_Operator (N : Node_Id; Typ : Entity_Id; Op_Id : Entity_Id) is Op_Name : constant Name_Id := Chars (Op_Id); Act1 : Node_Id := First_Actual (N); Act2 : Node_Id := Next_Actual (Act1); Error : Boolean := False; Func : constant Entity_Id := Entity (Name (N)); Is_Binary : constant Boolean := Present (Act2); Op_Node : Node_Id; Opnd_Type : Entity_Id; Orig_Type : Entity_Id := Empty; Pack : Entity_Id; type Kind_Test is access function (E : Entity_Id) return Boolean; function Operand_Type_In_Scope (S : Entity_Id) return Boolean; -- If the operand is not universal, and the operator is given by an -- expanded name, verify that the operand has an interpretation with a -- type defined in the given scope of the operator. function Type_In_P (Test : Kind_Test) return Entity_Id; -- Find a type of the given class in package Pack that contains the -- operator. --------------------------- -- Operand_Type_In_Scope -- --------------------------- function Operand_Type_In_Scope (S : Entity_Id) return Boolean is Nod : constant Node_Id := Right_Opnd (Op_Node); I : Interp_Index; It : Interp; begin if not Is_Overloaded (Nod) then return Scope (Base_Type (Etype (Nod))) = S; else Get_First_Interp (Nod, I, It); while Present (It.Typ) loop if Scope (Base_Type (It.Typ)) = S then return True; end if; Get_Next_Interp (I, It); end loop; return False; end if; end Operand_Type_In_Scope; --------------- -- Type_In_P -- --------------- function Type_In_P (Test : Kind_Test) return Entity_Id is E : Entity_Id; function In_Decl return Boolean; -- Verify that node is not part of the type declaration for the -- candidate type, which would otherwise be invisible. ------------- -- In_Decl -- ------------- function In_Decl return Boolean is Decl_Node : constant Node_Id := Parent (E); N2 : Node_Id; begin N2 := N; if Etype (E) = Any_Type then return True; elsif No (Decl_Node) then return False; else while Present (N2) and then Nkind (N2) /= N_Compilation_Unit loop if N2 = Decl_Node then return True; else N2 := Parent (N2); end if; end loop; return False; end if; end In_Decl; -- Start of processing for Type_In_P begin -- If the context type is declared in the prefix package, this is the -- desired base type. if Scope (Base_Type (Typ)) = Pack and then Test (Typ) then return Base_Type (Typ); else E := First_Entity (Pack); while Present (E) loop if Test (E) and then not In_Decl then return E; end if; Next_Entity (E); end loop; return Empty; end if; end Type_In_P; -- Start of processing for Make_Call_Into_Operator begin Op_Node := New_Node (Operator_Kind (Op_Name, Is_Binary), Sloc (N)); -- Binary operator if Is_Binary then Set_Left_Opnd (Op_Node, Relocate_Node (Act1)); Set_Right_Opnd (Op_Node, Relocate_Node (Act2)); Save_Interps (Act1, Left_Opnd (Op_Node)); Save_Interps (Act2, Right_Opnd (Op_Node)); Act1 := Left_Opnd (Op_Node); Act2 := Right_Opnd (Op_Node); -- Unary operator else Set_Right_Opnd (Op_Node, Relocate_Node (Act1)); Save_Interps (Act1, Right_Opnd (Op_Node)); Act1 := Right_Opnd (Op_Node); end if; -- If the operator is denoted by an expanded name, and the prefix is -- not Standard, but the operator is a predefined one whose scope is -- Standard, then this is an implicit_operator, inserted as an -- interpretation by the procedure of the same name. This procedure -- overestimates the presence of implicit operators, because it does -- not examine the type of the operands. Verify now that the operand -- type appears in the given scope. If right operand is universal, -- check the other operand. In the case of concatenation, either -- argument can be the component type, so check the type of the result. -- If both arguments are literals, look for a type of the right kind -- defined in the given scope. This elaborate nonsense is brought to -- you courtesy of b33302a. The type itself must be frozen, so we must -- find the type of the proper class in the given scope. -- A final wrinkle is the multiplication operator for fixed point types, -- which is defined in Standard only, and not in the scope of the -- fixed point type itself. if Nkind (Name (N)) = N_Expanded_Name then Pack := Entity (Prefix (Name (N))); -- If this is a package renaming, get renamed entity, which will be -- the scope of the operands if operaton is type-correct. if Present (Renamed_Entity (Pack)) then Pack := Renamed_Entity (Pack); end if; -- If the entity being called is defined in the given package, it is -- a renaming of a predefined operator, and known to be legal. if Scope (Entity (Name (N))) = Pack and then Pack /= Standard_Standard then null; -- Visibility does not need to be checked in an instance: if the -- operator was not visible in the generic it has been diagnosed -- already, else there is an implicit copy of it in the instance. elsif In_Instance then null; elsif Nam_In (Op_Name, Name_Op_Multiply, Name_Op_Divide) and then Is_Fixed_Point_Type (Etype (Left_Opnd (Op_Node))) and then Is_Fixed_Point_Type (Etype (Right_Opnd (Op_Node))) then if Pack /= Standard_Standard then Error := True; end if; -- Ada 2005 AI-420: Predefined equality on Universal_Access is -- available. elsif Ada_Version >= Ada_2005 and then Nam_In (Op_Name, Name_Op_Eq, Name_Op_Ne) and then Ekind (Etype (Act1)) = E_Anonymous_Access_Type then null; else Opnd_Type := Base_Type (Etype (Right_Opnd (Op_Node))); if Op_Name = Name_Op_Concat then Opnd_Type := Base_Type (Typ); elsif (Scope (Opnd_Type) = Standard_Standard and then Is_Binary) or else (Nkind (Right_Opnd (Op_Node)) = N_Attribute_Reference and then Is_Binary and then not Comes_From_Source (Opnd_Type)) then Opnd_Type := Base_Type (Etype (Left_Opnd (Op_Node))); end if; if Scope (Opnd_Type) = Standard_Standard then -- Verify that the scope contains a type that corresponds to -- the given literal. Optimize the case where Pack is Standard. if Pack /= Standard_Standard then if Opnd_Type = Universal_Integer then Orig_Type := Type_In_P (Is_Integer_Type'Access); elsif Opnd_Type = Universal_Real then Orig_Type := Type_In_P (Is_Real_Type'Access); elsif Opnd_Type = Any_String then Orig_Type := Type_In_P (Is_String_Type'Access); elsif Opnd_Type = Any_Access then Orig_Type := Type_In_P (Is_Definite_Access_Type'Access); elsif Opnd_Type = Any_Composite then Orig_Type := Type_In_P (Is_Composite_Type'Access); if Present (Orig_Type) then if Has_Private_Component (Orig_Type) then Orig_Type := Empty; else Set_Etype (Act1, Orig_Type); if Is_Binary then Set_Etype (Act2, Orig_Type); end if; end if; end if; else Orig_Type := Empty; end if; Error := No (Orig_Type); end if; elsif Ekind (Opnd_Type) = E_Allocator_Type and then No (Type_In_P (Is_Definite_Access_Type'Access)) then Error := True; -- If the type is defined elsewhere, and the operator is not -- defined in the given scope (by a renaming declaration, e.g.) -- then this is an error as well. If an extension of System is -- present, and the type may be defined there, Pack must be -- System itself. elsif Scope (Opnd_Type) /= Pack and then Scope (Op_Id) /= Pack and then (No (System_Aux_Id) or else Scope (Opnd_Type) /= System_Aux_Id or else Pack /= Scope (System_Aux_Id)) then if not Is_Overloaded (Right_Opnd (Op_Node)) then Error := True; else Error := not Operand_Type_In_Scope (Pack); end if; elsif Pack = Standard_Standard and then not Operand_Type_In_Scope (Standard_Standard) then Error := True; end if; end if; if Error then Error_Msg_Node_2 := Pack; Error_Msg_NE ("& not declared in&", N, Selector_Name (Name (N))); Set_Etype (N, Any_Type); return; -- Detect a mismatch between the context type and the result type -- in the named package, which is otherwise not detected if the -- operands are universal. Check is only needed if source entity is -- an operator, not a function that renames an operator. elsif Nkind (Parent (N)) /= N_Type_Conversion and then Ekind (Entity (Name (N))) = E_Operator and then Is_Numeric_Type (Typ) and then not Is_Universal_Numeric_Type (Typ) and then Scope (Base_Type (Typ)) /= Pack and then not In_Instance then if Is_Fixed_Point_Type (Typ) and then Nam_In (Op_Name, Name_Op_Multiply, Name_Op_Divide) then -- Already checked above null; -- Operator may be defined in an extension of System elsif Present (System_Aux_Id) and then Scope (Opnd_Type) = System_Aux_Id then null; else -- Could we use Wrong_Type here??? (this would require setting -- Etype (N) to the actual type found where Typ was expected). Error_Msg_NE ("expect }", N, Typ); end if; end if; end if; Set_Chars (Op_Node, Op_Name); if not Is_Private_Type (Etype (N)) then Set_Etype (Op_Node, Base_Type (Etype (N))); else Set_Etype (Op_Node, Etype (N)); end if; -- If this is a call to a function that renames a predefined equality, -- the renaming declaration provides a type that must be used to -- resolve the operands. This must be done now because resolution of -- the equality node will not resolve any remaining ambiguity, and it -- assumes that the first operand is not overloaded. if Nam_In (Op_Name, Name_Op_Eq, Name_Op_Ne) and then Ekind (Func) = E_Function and then Is_Overloaded (Act1) then Resolve (Act1, Base_Type (Etype (First_Formal (Func)))); Resolve (Act2, Base_Type (Etype (First_Formal (Func)))); end if; Set_Entity (Op_Node, Op_Id); Generate_Reference (Op_Id, N, ' '); -- Do rewrite setting Comes_From_Source on the result if the original -- call came from source. Although it is not strictly the case that the -- operator as such comes from the source, logically it corresponds -- exactly to the function call in the source, so it should be marked -- this way (e.g. to make sure that validity checks work fine). declare CS : constant Boolean := Comes_From_Source (N); begin Rewrite (N, Op_Node); Set_Comes_From_Source (N, CS); end; -- If this is an arithmetic operator and the result type is private, -- the operands and the result must be wrapped in conversion to -- expose the underlying numeric type and expand the proper checks, -- e.g. on division. if Is_Private_Type (Typ) then case Nkind (N) is when N_Op_Add | N_Op_Divide | N_Op_Expon | N_Op_Mod | N_Op_Multiply | N_Op_Rem | N_Op_Subtract => Resolve_Intrinsic_Operator (N, Typ); when N_Op_Abs | N_Op_Minus | N_Op_Plus => Resolve_Intrinsic_Unary_Operator (N, Typ); when others => Resolve (N, Typ); end case; else Resolve (N, Typ); end if; -- If in ASIS_Mode, propagate operand types to original actuals of -- function call, which would otherwise not be fully resolved. If -- the call has already been constant-folded, nothing to do. We -- relocate the operand nodes rather than copy them, to preserve -- original_node pointers, given that the operands themselves may -- have been rewritten. If the call was itself a rewriting of an -- operator node, nothing to do. if ASIS_Mode and then Nkind (N) in N_Op and then Nkind (Original_Node (N)) = N_Function_Call then declare L : Node_Id; R : constant Node_Id := Right_Opnd (N); Old_First : constant Node_Id := First (Parameter_Associations (Original_Node (N))); Old_Sec : Node_Id; begin if Is_Binary then L := Left_Opnd (N); Old_Sec := Next (Old_First); -- If the original call has named associations, replace the -- explicit actual parameter in the association with the proper -- resolved operand. if Nkind (Old_First) = N_Parameter_Association then if Chars (Selector_Name (Old_First)) = Chars (First_Entity (Op_Id)) then Rewrite (Explicit_Actual_Parameter (Old_First), Relocate_Node (L)); else Rewrite (Explicit_Actual_Parameter (Old_First), Relocate_Node (R)); end if; else Rewrite (Old_First, Relocate_Node (L)); end if; if Nkind (Old_Sec) = N_Parameter_Association then if Chars (Selector_Name (Old_Sec)) = Chars (First_Entity (Op_Id)) then Rewrite (Explicit_Actual_Parameter (Old_Sec), Relocate_Node (L)); else Rewrite (Explicit_Actual_Parameter (Old_Sec), Relocate_Node (R)); end if; else Rewrite (Old_Sec, Relocate_Node (R)); end if; else if Nkind (Old_First) = N_Parameter_Association then Rewrite (Explicit_Actual_Parameter (Old_First), Relocate_Node (R)); else Rewrite (Old_First, Relocate_Node (R)); end if; end if; end; Set_Parent (Original_Node (N), Parent (N)); end if; end Make_Call_Into_Operator; ------------------- -- Operator_Kind -- ------------------- function Operator_Kind (Op_Name : Name_Id; Is_Binary : Boolean) return Node_Kind is Kind : Node_Kind; begin -- Use CASE statement or array??? if Is_Binary then if Op_Name = Name_Op_And then Kind := N_Op_And; elsif Op_Name = Name_Op_Or then Kind := N_Op_Or; elsif Op_Name = Name_Op_Xor then Kind := N_Op_Xor; elsif Op_Name = Name_Op_Eq then Kind := N_Op_Eq; elsif Op_Name = Name_Op_Ne then Kind := N_Op_Ne; elsif Op_Name = Name_Op_Lt then Kind := N_Op_Lt; elsif Op_Name = Name_Op_Le then Kind := N_Op_Le; elsif Op_Name = Name_Op_Gt then Kind := N_Op_Gt; elsif Op_Name = Name_Op_Ge then Kind := N_Op_Ge; elsif Op_Name = Name_Op_Add then Kind := N_Op_Add; elsif Op_Name = Name_Op_Subtract then Kind := N_Op_Subtract; elsif Op_Name = Name_Op_Concat then Kind := N_Op_Concat; elsif Op_Name = Name_Op_Multiply then Kind := N_Op_Multiply; elsif Op_Name = Name_Op_Divide then Kind := N_Op_Divide; elsif Op_Name = Name_Op_Mod then Kind := N_Op_Mod; elsif Op_Name = Name_Op_Rem then Kind := N_Op_Rem; elsif Op_Name = Name_Op_Expon then Kind := N_Op_Expon; else raise Program_Error; end if; -- Unary operators else if Op_Name = Name_Op_Add then Kind := N_Op_Plus; elsif Op_Name = Name_Op_Subtract then Kind := N_Op_Minus; elsif Op_Name = Name_Op_Abs then Kind := N_Op_Abs; elsif Op_Name = Name_Op_Not then Kind := N_Op_Not; else raise Program_Error; end if; end if; return Kind; end Operator_Kind; ---------------------------- -- Preanalyze_And_Resolve -- ---------------------------- procedure Preanalyze_And_Resolve (N : Node_Id; T : Entity_Id) is Save_Full_Analysis : constant Boolean := Full_Analysis; begin Full_Analysis := False; Expander_Mode_Save_And_Set (False); -- Normally, we suppress all checks for this preanalysis. There is no -- point in processing them now, since they will be applied properly -- and in the proper location when the default expressions reanalyzed -- and reexpanded later on. We will also have more information at that -- point for possible suppression of individual checks. -- However, in SPARK mode, most expansion is suppressed, and this -- later reanalysis and reexpansion may not occur. SPARK mode does -- require the setting of checking flags for proof purposes, so we -- do the SPARK preanalysis without suppressing checks. -- This special handling for SPARK mode is required for example in the -- case of Ada 2012 constructs such as quantified expressions, which are -- expanded in two separate steps. if GNATprove_Mode then Analyze_And_Resolve (N, T); else Analyze_And_Resolve (N, T, Suppress => All_Checks); end if; Expander_Mode_Restore; Full_Analysis := Save_Full_Analysis; end Preanalyze_And_Resolve; -- Version without context type procedure Preanalyze_And_Resolve (N : Node_Id) is Save_Full_Analysis : constant Boolean := Full_Analysis; begin Full_Analysis := False; Expander_Mode_Save_And_Set (False); Analyze (N); Resolve (N, Etype (N), Suppress => All_Checks); Expander_Mode_Restore; Full_Analysis := Save_Full_Analysis; end Preanalyze_And_Resolve; ---------------------------------- -- Replace_Actual_Discriminants -- ---------------------------------- procedure Replace_Actual_Discriminants (N : Node_Id; Default : Node_Id) is Loc : constant Source_Ptr := Sloc (N); Tsk : Node_Id := Empty; function Process_Discr (Nod : Node_Id) return Traverse_Result; -- Comment needed??? ------------------- -- Process_Discr -- ------------------- function Process_Discr (Nod : Node_Id) return Traverse_Result is Ent : Entity_Id; begin if Nkind (Nod) = N_Identifier then Ent := Entity (Nod); if Present (Ent) and then Ekind (Ent) = E_Discriminant then Rewrite (Nod, Make_Selected_Component (Loc, Prefix => New_Copy_Tree (Tsk, New_Sloc => Loc), Selector_Name => Make_Identifier (Loc, Chars (Ent)))); Set_Etype (Nod, Etype (Ent)); end if; end if; return OK; end Process_Discr; procedure Replace_Discrs is new Traverse_Proc (Process_Discr); -- Start of processing for Replace_Actual_Discriminants begin if not Expander_Active then return; end if; if Nkind (Name (N)) = N_Selected_Component then Tsk := Prefix (Name (N)); elsif Nkind (Name (N)) = N_Indexed_Component then Tsk := Prefix (Prefix (Name (N))); end if; if No (Tsk) then return; else Replace_Discrs (Default); end if; end Replace_Actual_Discriminants; ------------- -- Resolve -- ------------- procedure Resolve (N : Node_Id; Typ : Entity_Id) is Ambiguous : Boolean := False; Ctx_Type : Entity_Id := Typ; Expr_Type : Entity_Id := Empty; -- prevent junk warning Err_Type : Entity_Id := Empty; Found : Boolean := False; From_Lib : Boolean; I : Interp_Index; I1 : Interp_Index := 0; -- prevent junk warning It : Interp; It1 : Interp; Seen : Entity_Id := Empty; -- prevent junk warning function Comes_From_Predefined_Lib_Unit (Nod : Node_Id) return Boolean; -- Determine whether a node comes from a predefined library unit or -- Standard. procedure Patch_Up_Value (N : Node_Id; Typ : Entity_Id); -- Try and fix up a literal so that it matches its expected type. New -- literals are manufactured if necessary to avoid cascaded errors. procedure Report_Ambiguous_Argument; -- Additional diagnostics when an ambiguous call has an ambiguous -- argument (typically a controlling actual). procedure Resolution_Failed; -- Called when attempt at resolving current expression fails ------------------------------------ -- Comes_From_Predefined_Lib_Unit -- ------------------------------------- function Comes_From_Predefined_Lib_Unit (Nod : Node_Id) return Boolean is begin return Sloc (Nod) = Standard_Location or else Is_Predefined_File_Name (Unit_File_Name (Get_Source_Unit (Sloc (Nod)))); end Comes_From_Predefined_Lib_Unit; -------------------- -- Patch_Up_Value -- -------------------- procedure Patch_Up_Value (N : Node_Id; Typ : Entity_Id) is begin if Nkind (N) = N_Integer_Literal and then Is_Real_Type (Typ) then Rewrite (N, Make_Real_Literal (Sloc (N), Realval => UR_From_Uint (Intval (N)))); Set_Etype (N, Universal_Real); Set_Is_Static_Expression (N); elsif Nkind (N) = N_Real_Literal and then Is_Integer_Type (Typ) then Rewrite (N, Make_Integer_Literal (Sloc (N), Intval => UR_To_Uint (Realval (N)))); Set_Etype (N, Universal_Integer); Set_Is_Static_Expression (N); elsif Nkind (N) = N_String_Literal and then Is_Character_Type (Typ) then Set_Character_Literal_Name (Char_Code (Character'Pos ('A'))); Rewrite (N, Make_Character_Literal (Sloc (N), Chars => Name_Find, Char_Literal_Value => UI_From_Int (Character'Pos ('A')))); Set_Etype (N, Any_Character); Set_Is_Static_Expression (N); elsif Nkind (N) /= N_String_Literal and then Is_String_Type (Typ) then Rewrite (N, Make_String_Literal (Sloc (N), Strval => End_String)); elsif Nkind (N) = N_Range then Patch_Up_Value (Low_Bound (N), Typ); Patch_Up_Value (High_Bound (N), Typ); end if; end Patch_Up_Value; ------------------------------- -- Report_Ambiguous_Argument -- ------------------------------- procedure Report_Ambiguous_Argument is Arg : constant Node_Id := First (Parameter_Associations (N)); I : Interp_Index; It : Interp; begin if Nkind (Arg) = N_Function_Call and then Is_Entity_Name (Name (Arg)) and then Is_Overloaded (Name (Arg)) then Error_Msg_NE ("ambiguous call to&", Arg, Name (Arg)); -- Could use comments on what is going on here??? Get_First_Interp (Name (Arg), I, It); while Present (It.Nam) loop Error_Msg_Sloc := Sloc (It.Nam); if Nkind (Parent (It.Nam)) = N_Full_Type_Declaration then Error_Msg_N ("interpretation (inherited) #!", Arg); else Error_Msg_N ("interpretation #!", Arg); end if; Get_Next_Interp (I, It); end loop; end if; end Report_Ambiguous_Argument; ----------------------- -- Resolution_Failed -- ----------------------- procedure Resolution_Failed is begin Patch_Up_Value (N, Typ); -- Set the type to the desired one to minimize cascaded errors. Note -- that this is an approximation and does not work in all cases. Set_Etype (N, Typ); Debug_A_Exit ("resolving ", N, " (done, resolution failed)"); Set_Is_Overloaded (N, False); -- The caller will return without calling the expander, so we need -- to set the analyzed flag. Note that it is fine to set Analyzed -- to True even if we are in the middle of a shallow analysis, -- (see the spec of sem for more details) since this is an error -- situation anyway, and there is no point in repeating the -- analysis later (indeed it won't work to repeat it later, since -- we haven't got a clear resolution of which entity is being -- referenced.) Set_Analyzed (N, True); return; end Resolution_Failed; -- Start of processing for Resolve begin if N = Error then return; end if; -- Access attribute on remote subprogram cannot be used for a non-remote -- access-to-subprogram type. if Nkind (N) = N_Attribute_Reference and then Nam_In (Attribute_Name (N), Name_Access, Name_Unrestricted_Access, Name_Unchecked_Access) and then Comes_From_Source (N) and then Is_Entity_Name (Prefix (N)) and then Is_Subprogram (Entity (Prefix (N))) and then Is_Remote_Call_Interface (Entity (Prefix (N))) and then not Is_Remote_Access_To_Subprogram_Type (Typ) then Error_Msg_N ("prefix must statically denote a non-remote subprogram", N); end if; From_Lib := Comes_From_Predefined_Lib_Unit (N); -- If the context is a Remote_Access_To_Subprogram, access attributes -- must be resolved with the corresponding fat pointer. There is no need -- to check for the attribute name since the return type of an -- attribute is never a remote type. if Nkind (N) = N_Attribute_Reference and then Comes_From_Source (N) and then (Is_Remote_Call_Interface (Typ) or else Is_Remote_Types (Typ)) then declare Attr : constant Attribute_Id := Get_Attribute_Id (Attribute_Name (N)); Pref : constant Node_Id := Prefix (N); Decl : Node_Id; Spec : Node_Id; Is_Remote : Boolean := True; begin -- Check that Typ is a remote access-to-subprogram type if Is_Remote_Access_To_Subprogram_Type (Typ) then -- Prefix (N) must statically denote a remote subprogram -- declared in a package specification. if Attr = Attribute_Access or else Attr = Attribute_Unchecked_Access or else Attr = Attribute_Unrestricted_Access then Decl := Unit_Declaration_Node (Entity (Pref)); if Nkind (Decl) = N_Subprogram_Body then Spec := Corresponding_Spec (Decl); if Present (Spec) then Decl := Unit_Declaration_Node (Spec); end if; end if; Spec := Parent (Decl); if not Is_Entity_Name (Prefix (N)) or else Nkind (Spec) /= N_Package_Specification or else not Is_Remote_Call_Interface (Defining_Entity (Spec)) then Is_Remote := False; Error_Msg_N ("prefix must statically denote a remote subprogram ", N); end if; -- If we are generating code in distributed mode, perform -- semantic checks against corresponding remote entities. if Expander_Active and then Get_PCS_Name /= Name_No_DSA then Check_Subtype_Conformant (New_Id => Entity (Prefix (N)), Old_Id => Designated_Type (Corresponding_Remote_Type (Typ)), Err_Loc => N); if Is_Remote then Process_Remote_AST_Attribute (N, Typ); end if; end if; end if; end if; end; end if; Debug_A_Entry ("resolving ", N); if Debug_Flag_V then Write_Overloads (N); end if; if Comes_From_Source (N) then if Is_Fixed_Point_Type (Typ) then Check_Restriction (No_Fixed_Point, N); elsif Is_Floating_Point_Type (Typ) and then Typ /= Universal_Real and then Typ /= Any_Real then Check_Restriction (No_Floating_Point, N); end if; end if; -- Return if already analyzed if Analyzed (N) then Debug_A_Exit ("resolving ", N, " (done, already analyzed)"); Analyze_Dimension (N); return; -- Any case of Any_Type as the Etype value means that we had a -- previous error. elsif Etype (N) = Any_Type then Debug_A_Exit ("resolving ", N, " (done, Etype = Any_Type)"); return; end if; Check_Parameterless_Call (N); -- The resolution of an Expression_With_Actions is determined by -- its Expression. if Nkind (N) = N_Expression_With_Actions then Resolve (Expression (N), Typ); Found := True; Expr_Type := Etype (Expression (N)); -- If not overloaded, then we know the type, and all that needs doing -- is to check that this type is compatible with the context. elsif not Is_Overloaded (N) then Found := Covers (Typ, Etype (N)); Expr_Type := Etype (N); -- In the overloaded case, we must select the interpretation that -- is compatible with the context (i.e. the type passed to Resolve) else -- Loop through possible interpretations Get_First_Interp (N, I, It); Interp_Loop : while Present (It.Typ) loop if Debug_Flag_V then Write_Str ("Interp: "); Write_Interp (It); end if; -- We are only interested in interpretations that are compatible -- with the expected type, any other interpretations are ignored. if not Covers (Typ, It.Typ) then if Debug_Flag_V then Write_Str (" interpretation incompatible with context"); Write_Eol; end if; else -- Skip the current interpretation if it is disabled by an -- abstract operator. This action is performed only when the -- type against which we are resolving is the same as the -- type of the interpretation. if Ada_Version >= Ada_2005 and then It.Typ = Typ and then Typ /= Universal_Integer and then Typ /= Universal_Real and then Present (It.Abstract_Op) then if Debug_Flag_V then Write_Line ("Skip."); end if; goto Continue; end if; -- First matching interpretation if not Found then Found := True; I1 := I; Seen := It.Nam; Expr_Type := It.Typ; -- Matching interpretation that is not the first, maybe an -- error, but there are some cases where preference rules are -- used to choose between the two possibilities. These and -- some more obscure cases are handled in Disambiguate. else -- If the current statement is part of a predefined library -- unit, then all interpretations which come from user level -- packages should not be considered. Check previous and -- current one. if From_Lib then if not Comes_From_Predefined_Lib_Unit (It.Nam) then goto Continue; elsif not Comes_From_Predefined_Lib_Unit (Seen) then -- Previous interpretation must be discarded I1 := I; Seen := It.Nam; Expr_Type := It.Typ; Set_Entity (N, Seen); goto Continue; end if; end if; -- Otherwise apply further disambiguation steps Error_Msg_Sloc := Sloc (Seen); It1 := Disambiguate (N, I1, I, Typ); -- Disambiguation has succeeded. Skip the remaining -- interpretations. if It1 /= No_Interp then Seen := It1.Nam; Expr_Type := It1.Typ; while Present (It.Typ) loop Get_Next_Interp (I, It); end loop; else -- Before we issue an ambiguity complaint, check for the -- case of a subprogram call where at least one of the -- arguments is Any_Type, and if so suppress the message, -- since it is a cascaded error. This can also happen for -- a generalized indexing operation. if Nkind (N) in N_Subprogram_Call or else (Nkind (N) = N_Indexed_Component and then Present (Generalized_Indexing (N))) then declare A : Node_Id; E : Node_Id; begin if Nkind (N) = N_Indexed_Component then Rewrite (N, Generalized_Indexing (N)); end if; A := First_Actual (N); while Present (A) loop E := A; if Nkind (E) = N_Parameter_Association then E := Explicit_Actual_Parameter (E); end if; if Etype (E) = Any_Type then if Debug_Flag_V then Write_Str ("Any_Type in call"); Write_Eol; end if; exit Interp_Loop; end if; Next_Actual (A); end loop; end; elsif Nkind (N) in N_Binary_Op and then (Etype (Left_Opnd (N)) = Any_Type or else Etype (Right_Opnd (N)) = Any_Type) then exit Interp_Loop; elsif Nkind (N) in N_Unary_Op and then Etype (Right_Opnd (N)) = Any_Type then exit Interp_Loop; end if; -- Not that special case, so issue message using the flag -- Ambiguous to control printing of the header message -- only at the start of an ambiguous set. if not Ambiguous then if Nkind (N) = N_Function_Call and then Nkind (Name (N)) = N_Explicit_Dereference then Error_Msg_N ("ambiguous expression (cannot resolve indirect " & "call)!", N); else Error_Msg_NE -- CODEFIX ("ambiguous expression (cannot resolve&)!", N, It.Nam); end if; Ambiguous := True; if Nkind (Parent (Seen)) = N_Full_Type_Declaration then Error_Msg_N ("\\possible interpretation (inherited)#!", N); else Error_Msg_N -- CODEFIX ("\\possible interpretation#!", N); end if; if Nkind (N) in N_Subprogram_Call and then Present (Parameter_Associations (N)) then Report_Ambiguous_Argument; end if; end if; Error_Msg_Sloc := Sloc (It.Nam); -- By default, the error message refers to the candidate -- interpretation. But if it is a predefined operator, it -- is implicitly declared at the declaration of the type -- of the operand. Recover the sloc of that declaration -- for the error message. if Nkind (N) in N_Op and then Scope (It.Nam) = Standard_Standard and then not Is_Overloaded (Right_Opnd (N)) and then Scope (Base_Type (Etype (Right_Opnd (N)))) /= Standard_Standard then Err_Type := First_Subtype (Etype (Right_Opnd (N))); if Comes_From_Source (Err_Type) and then Present (Parent (Err_Type)) then Error_Msg_Sloc := Sloc (Parent (Err_Type)); end if; elsif Nkind (N) in N_Binary_Op and then Scope (It.Nam) = Standard_Standard and then not Is_Overloaded (Left_Opnd (N)) and then Scope (Base_Type (Etype (Left_Opnd (N)))) /= Standard_Standard then Err_Type := First_Subtype (Etype (Left_Opnd (N))); if Comes_From_Source (Err_Type) and then Present (Parent (Err_Type)) then Error_Msg_Sloc := Sloc (Parent (Err_Type)); end if; -- If this is an indirect call, use the subprogram_type -- in the message, to have a meaningful location. Also -- indicate if this is an inherited operation, created -- by a type declaration. elsif Nkind (N) = N_Function_Call and then Nkind (Name (N)) = N_Explicit_Dereference and then Is_Type (It.Nam) then Err_Type := It.Nam; Error_Msg_Sloc := Sloc (Associated_Node_For_Itype (Err_Type)); else Err_Type := Empty; end if; if Nkind (N) in N_Op and then Scope (It.Nam) = Standard_Standard and then Present (Err_Type) then -- Special-case the message for universal_fixed -- operators, which are not declared with the type -- of the operand, but appear forever in Standard. if It.Typ = Universal_Fixed and then Scope (It.Nam) = Standard_Standard then Error_Msg_N ("\\possible interpretation as universal_fixed " & "operation (RM 4.5.5 (19))", N); else Error_Msg_N ("\\possible interpretation (predefined)#!", N); end if; elsif Nkind (Parent (It.Nam)) = N_Full_Type_Declaration then Error_Msg_N ("\\possible interpretation (inherited)#!", N); else Error_Msg_N -- CODEFIX ("\\possible interpretation#!", N); end if; end if; end if; -- We have a matching interpretation, Expr_Type is the type -- from this interpretation, and Seen is the entity. -- For an operator, just set the entity name. The type will be -- set by the specific operator resolution routine. if Nkind (N) in N_Op then Set_Entity (N, Seen); Generate_Reference (Seen, N); elsif Nkind (N) = N_Case_Expression then Set_Etype (N, Expr_Type); elsif Nkind (N) = N_Character_Literal then Set_Etype (N, Expr_Type); elsif Nkind (N) = N_If_Expression then Set_Etype (N, Expr_Type); -- AI05-0139-2: Expression is overloaded because type has -- implicit dereference. If type matches context, no implicit -- dereference is involved. elsif Has_Implicit_Dereference (Expr_Type) then Set_Etype (N, Expr_Type); Set_Is_Overloaded (N, False); exit Interp_Loop; elsif Is_Overloaded (N) and then Present (It.Nam) and then Ekind (It.Nam) = E_Discriminant and then Has_Implicit_Dereference (It.Nam) then -- If the node is a general indexing, the dereference is -- is inserted when resolving the rewritten form, else -- insert it now. if Nkind (N) /= N_Indexed_Component or else No (Generalized_Indexing (N)) then Build_Explicit_Dereference (N, It.Nam); end if; -- For an explicit dereference, attribute reference, range, -- short-circuit form (which is not an operator node), or call -- with a name that is an explicit dereference, there is -- nothing to be done at this point. elsif Nkind_In (N, N_Attribute_Reference, N_And_Then, N_Explicit_Dereference, N_Identifier, N_Indexed_Component, N_Or_Else, N_Range, N_Selected_Component, N_Slice) or else Nkind (Name (N)) = N_Explicit_Dereference then null; -- For procedure or function calls, set the type of the name, -- and also the entity pointer for the prefix. elsif Nkind (N) in N_Subprogram_Call and then Is_Entity_Name (Name (N)) then Set_Etype (Name (N), Expr_Type); Set_Entity (Name (N), Seen); Generate_Reference (Seen, Name (N)); elsif Nkind (N) = N_Function_Call and then Nkind (Name (N)) = N_Selected_Component then Set_Etype (Name (N), Expr_Type); Set_Entity (Selector_Name (Name (N)), Seen); Generate_Reference (Seen, Selector_Name (Name (N))); -- For all other cases, just set the type of the Name else Set_Etype (Name (N), Expr_Type); end if; end if; <<Continue>> -- Move to next interpretation exit Interp_Loop when No (It.Typ); Get_Next_Interp (I, It); end loop Interp_Loop; end if; -- At this stage Found indicates whether or not an acceptable -- interpretation exists. If not, then we have an error, except that if -- the context is Any_Type as a result of some other error, then we -- suppress the error report. if not Found then if Typ /= Any_Type then -- If type we are looking for is Void, then this is the procedure -- call case, and the error is simply that what we gave is not a -- procedure name (we think of procedure calls as expressions with -- types internally, but the user doesn't think of them this way). if Typ = Standard_Void_Type then -- Special case message if function used as a procedure if Nkind (N) = N_Procedure_Call_Statement and then Is_Entity_Name (Name (N)) and then Ekind (Entity (Name (N))) = E_Function then Error_Msg_NE ("cannot use function & in a procedure call", Name (N), Entity (Name (N))); -- Otherwise give general message (not clear what cases this -- covers, but no harm in providing for them). else Error_Msg_N ("expect procedure name in procedure call", N); end if; Found := True; -- Otherwise we do have a subexpression with the wrong type -- Check for the case of an allocator which uses an access type -- instead of the designated type. This is a common error and we -- specialize the message, posting an error on the operand of the -- allocator, complaining that we expected the designated type of -- the allocator. elsif Nkind (N) = N_Allocator and then Is_Access_Type (Typ) and then Is_Access_Type (Etype (N)) and then Designated_Type (Etype (N)) = Typ then Wrong_Type (Expression (N), Designated_Type (Typ)); Found := True; -- Check for view mismatch on Null in instances, for which the -- view-swapping mechanism has no identifier. elsif (In_Instance or else In_Inlined_Body) and then (Nkind (N) = N_Null) and then Is_Private_Type (Typ) and then Is_Access_Type (Full_View (Typ)) then Resolve (N, Full_View (Typ)); Set_Etype (N, Typ); return; -- Check for an aggregate. Sometimes we can get bogus aggregates -- from misuse of parentheses, and we are about to complain about -- the aggregate without even looking inside it. -- Instead, if we have an aggregate of type Any_Composite, then -- analyze and resolve the component fields, and then only issue -- another message if we get no errors doing this (otherwise -- assume that the errors in the aggregate caused the problem). elsif Nkind (N) = N_Aggregate and then Etype (N) = Any_Composite then -- Disable expansion in any case. If there is a type mismatch -- it may be fatal to try to expand the aggregate. The flag -- would otherwise be set to false when the error is posted. Expander_Active := False; declare procedure Check_Aggr (Aggr : Node_Id); -- Check one aggregate, and set Found to True if we have a -- definite error in any of its elements procedure Check_Elmt (Aelmt : Node_Id); -- Check one element of aggregate and set Found to True if -- we definitely have an error in the element. ---------------- -- Check_Aggr -- ---------------- procedure Check_Aggr (Aggr : Node_Id) is Elmt : Node_Id; begin if Present (Expressions (Aggr)) then Elmt := First (Expressions (Aggr)); while Present (Elmt) loop Check_Elmt (Elmt); Next (Elmt); end loop; end if; if Present (Component_Associations (Aggr)) then Elmt := First (Component_Associations (Aggr)); while Present (Elmt) loop -- If this is a default-initialized component, then -- there is nothing to check. The box will be -- replaced by the appropriate call during late -- expansion. if Nkind (Elmt) /= N_Iterated_Component_Association and then not Box_Present (Elmt) then Check_Elmt (Expression (Elmt)); end if; Next (Elmt); end loop; end if; end Check_Aggr; ---------------- -- Check_Elmt -- ---------------- procedure Check_Elmt (Aelmt : Node_Id) is begin -- If we have a nested aggregate, go inside it (to -- attempt a naked analyze-resolve of the aggregate can -- cause undesirable cascaded errors). Do not resolve -- expression if it needs a type from context, as for -- integer * fixed expression. if Nkind (Aelmt) = N_Aggregate then Check_Aggr (Aelmt); else Analyze (Aelmt); if not Is_Overloaded (Aelmt) and then Etype (Aelmt) /= Any_Fixed then Resolve (Aelmt); end if; if Etype (Aelmt) = Any_Type then Found := True; end if; end if; end Check_Elmt; begin Check_Aggr (N); end; end if; -- Looks like we have a type error, but check for special case -- of Address wanted, integer found, with the configuration pragma -- Allow_Integer_Address active. If we have this case, introduce -- an unchecked conversion to allow the integer expression to be -- treated as an Address. The reverse case of integer wanted, -- Address found, is treated in an analogous manner. if Address_Integer_Convert_OK (Typ, Etype (N)) then Rewrite (N, Unchecked_Convert_To (Typ, Relocate_Node (N))); Analyze_And_Resolve (N, Typ); return; -- Under relaxed RM semantics silently replace occurrences of null -- by System.Address_Null. elsif Null_To_Null_Address_Convert_OK (N, Typ) then Replace_Null_By_Null_Address (N); Analyze_And_Resolve (N, Typ); return; end if; -- That special Allow_Integer_Address check did not apply, so we -- have a real type error. If an error message was issued already, -- Found got reset to True, so if it's still False, issue standard -- Wrong_Type message. if not Found then if Is_Overloaded (N) and then Nkind (N) = N_Function_Call then declare Subp_Name : Node_Id; begin if Is_Entity_Name (Name (N)) then Subp_Name := Name (N); elsif Nkind (Name (N)) = N_Selected_Component then -- Protected operation: retrieve operation name Subp_Name := Selector_Name (Name (N)); else raise Program_Error; end if; Error_Msg_Node_2 := Typ; Error_Msg_NE ("no visible interpretation of& matches expected type&", N, Subp_Name); end; if All_Errors_Mode then declare Index : Interp_Index; It : Interp; begin Error_Msg_N ("\\possible interpretations:", N); Get_First_Interp (Name (N), Index, It); while Present (It.Nam) loop Error_Msg_Sloc := Sloc (It.Nam); Error_Msg_Node_2 := It.Nam; Error_Msg_NE ("\\ type& for & declared#", N, It.Typ); Get_Next_Interp (Index, It); end loop; end; else Error_Msg_N ("\use -gnatf for details", N); end if; else Wrong_Type (N, Typ); end if; end if; end if; Resolution_Failed; return; -- Test if we have more than one interpretation for the context elsif Ambiguous then Resolution_Failed; return; -- Only one intepretation else -- In Ada 2005, if we have something like "X : T := 2 + 2;", where -- the "+" on T is abstract, and the operands are of universal type, -- the above code will have (incorrectly) resolved the "+" to the -- universal one in Standard. Therefore check for this case and give -- an error. We can't do this earlier, because it would cause legal -- cases to get errors (when some other type has an abstract "+"). if Ada_Version >= Ada_2005 and then Nkind (N) in N_Op and then Is_Overloaded (N) and then Is_Universal_Numeric_Type (Etype (Entity (N))) then Get_First_Interp (N, I, It); while Present (It.Typ) loop if Present (It.Abstract_Op) and then Etype (It.Abstract_Op) = Typ then Error_Msg_NE ("cannot call abstract subprogram &!", N, It.Abstract_Op); return; end if; Get_Next_Interp (I, It); end loop; end if; -- Here we have an acceptable interpretation for the context -- Propagate type information and normalize tree for various -- predefined operations. If the context only imposes a class of -- types, rather than a specific type, propagate the actual type -- downward. if Typ = Any_Integer or else Typ = Any_Boolean or else Typ = Any_Modular or else Typ = Any_Real or else Typ = Any_Discrete then Ctx_Type := Expr_Type; -- Any_Fixed is legal in a real context only if a specific fixed- -- point type is imposed. If Norman Cohen can be confused by this, -- it deserves a separate message. if Typ = Any_Real and then Expr_Type = Any_Fixed then Error_Msg_N ("illegal context for mixed mode operation", N); Set_Etype (N, Universal_Real); Ctx_Type := Universal_Real; end if; end if; -- A user-defined operator is transformed into a function call at -- this point, so that further processing knows that operators are -- really operators (i.e. are predefined operators). User-defined -- operators that are intrinsic are just renamings of the predefined -- ones, and need not be turned into calls either, but if they rename -- a different operator, we must transform the node accordingly. -- Instantiations of Unchecked_Conversion are intrinsic but are -- treated as functions, even if given an operator designator. if Nkind (N) in N_Op and then Present (Entity (N)) and then Ekind (Entity (N)) /= E_Operator then if not Is_Predefined_Op (Entity (N)) then Rewrite_Operator_As_Call (N, Entity (N)); elsif Present (Alias (Entity (N))) and then Nkind (Parent (Parent (Entity (N)))) = N_Subprogram_Renaming_Declaration then Rewrite_Renamed_Operator (N, Alias (Entity (N)), Typ); -- If the node is rewritten, it will be fully resolved in -- Rewrite_Renamed_Operator. if Analyzed (N) then return; end if; end if; end if; case N_Subexpr'(Nkind (N)) is when N_Aggregate => Resolve_Aggregate (N, Ctx_Type); when N_Allocator => Resolve_Allocator (N, Ctx_Type); when N_Short_Circuit => Resolve_Short_Circuit (N, Ctx_Type); when N_Attribute_Reference => Resolve_Attribute (N, Ctx_Type); when N_Case_Expression => Resolve_Case_Expression (N, Ctx_Type); when N_Character_Literal => Resolve_Character_Literal (N, Ctx_Type); when N_Delta_Aggregate => Resolve_Delta_Aggregate (N, Ctx_Type); when N_Expanded_Name => Resolve_Entity_Name (N, Ctx_Type); when N_Explicit_Dereference => Resolve_Explicit_Dereference (N, Ctx_Type); when N_Expression_With_Actions => Resolve_Expression_With_Actions (N, Ctx_Type); when N_Extension_Aggregate => Resolve_Extension_Aggregate (N, Ctx_Type); when N_Function_Call => Resolve_Call (N, Ctx_Type); when N_Identifier => Resolve_Entity_Name (N, Ctx_Type); when N_If_Expression => Resolve_If_Expression (N, Ctx_Type); when N_Indexed_Component => Resolve_Indexed_Component (N, Ctx_Type); when N_Integer_Literal => Resolve_Integer_Literal (N, Ctx_Type); when N_Membership_Test => Resolve_Membership_Op (N, Ctx_Type); when N_Null => Resolve_Null (N, Ctx_Type); when N_Op_And | N_Op_Or | N_Op_Xor => Resolve_Logical_Op (N, Ctx_Type); when N_Op_Eq | N_Op_Ne => Resolve_Equality_Op (N, Ctx_Type); when N_Op_Ge | N_Op_Gt | N_Op_Le | N_Op_Lt => Resolve_Comparison_Op (N, Ctx_Type); when N_Op_Not => Resolve_Op_Not (N, Ctx_Type); when N_Op_Add | N_Op_Divide | N_Op_Mod | N_Op_Multiply | N_Op_Rem | N_Op_Subtract => Resolve_Arithmetic_Op (N, Ctx_Type); when N_Op_Concat => Resolve_Op_Concat (N, Ctx_Type); when N_Op_Expon => Resolve_Op_Expon (N, Ctx_Type); when N_Op_Abs | N_Op_Minus | N_Op_Plus => Resolve_Unary_Op (N, Ctx_Type); when N_Op_Shift => Resolve_Shift (N, Ctx_Type); when N_Procedure_Call_Statement => Resolve_Call (N, Ctx_Type); when N_Operator_Symbol => Resolve_Operator_Symbol (N, Ctx_Type); when N_Qualified_Expression => Resolve_Qualified_Expression (N, Ctx_Type); -- Why is the following null, needs a comment ??? when N_Quantified_Expression => null; when N_Raise_Expression => Resolve_Raise_Expression (N, Ctx_Type); when N_Raise_xxx_Error => Set_Etype (N, Ctx_Type); when N_Range => Resolve_Range (N, Ctx_Type); when N_Real_Literal => Resolve_Real_Literal (N, Ctx_Type); when N_Reference => Resolve_Reference (N, Ctx_Type); when N_Selected_Component => Resolve_Selected_Component (N, Ctx_Type); when N_Slice => Resolve_Slice (N, Ctx_Type); when N_String_Literal => Resolve_String_Literal (N, Ctx_Type); when N_Target_Name => Resolve_Target_Name (N, Ctx_Type); when N_Type_Conversion => Resolve_Type_Conversion (N, Ctx_Type); when N_Unchecked_Expression => Resolve_Unchecked_Expression (N, Ctx_Type); when N_Unchecked_Type_Conversion => Resolve_Unchecked_Type_Conversion (N, Ctx_Type); end case; -- Ada 2012 (AI05-0149): Apply an (implicit) conversion to an -- expression of an anonymous access type that occurs in the context -- of a named general access type, except when the expression is that -- of a membership test. This ensures proper legality checking in -- terms of allowed conversions (expressions that would be illegal to -- convert implicitly are allowed in membership tests). if Ada_Version >= Ada_2012 and then Ekind (Ctx_Type) = E_General_Access_Type and then Ekind (Etype (N)) = E_Anonymous_Access_Type and then Nkind (Parent (N)) not in N_Membership_Test then Rewrite (N, Convert_To (Ctx_Type, Relocate_Node (N))); Analyze_And_Resolve (N, Ctx_Type); end if; -- If the subexpression was replaced by a non-subexpression, then -- all we do is to expand it. The only legitimate case we know of -- is converting procedure call statement to entry call statements, -- but there may be others, so we are making this test general. if Nkind (N) not in N_Subexpr then Debug_A_Exit ("resolving ", N, " (done)"); Expand (N); return; end if; -- The expression is definitely NOT overloaded at this point, so -- we reset the Is_Overloaded flag to avoid any confusion when -- reanalyzing the node. Set_Is_Overloaded (N, False); -- Freeze expression type, entity if it is a name, and designated -- type if it is an allocator (RM 13.14(10,11,13)). -- Now that the resolution of the type of the node is complete, and -- we did not detect an error, we can expand this node. We skip the -- expand call if we are in a default expression, see section -- "Handling of Default Expressions" in Sem spec. Debug_A_Exit ("resolving ", N, " (done)"); -- We unconditionally freeze the expression, even if we are in -- default expression mode (the Freeze_Expression routine tests this -- flag and only freezes static types if it is set). -- Ada 2012 (AI05-177): The declaration of an expression function -- does not cause freezing, but we never reach here in that case. -- Here we are resolving the corresponding expanded body, so we do -- need to perform normal freezing. Freeze_Expression (N); -- Now we can do the expansion Expand (N); end if; end Resolve; ------------- -- Resolve -- ------------- -- Version with check(s) suppressed procedure Resolve (N : Node_Id; Typ : Entity_Id; Suppress : Check_Id) is begin if Suppress = All_Checks then declare Sva : constant Suppress_Array := Scope_Suppress.Suppress; begin Scope_Suppress.Suppress := (others => True); Resolve (N, Typ); Scope_Suppress.Suppress := Sva; end; else declare Svg : constant Boolean := Scope_Suppress.Suppress (Suppress); begin Scope_Suppress.Suppress (Suppress) := True; Resolve (N, Typ); Scope_Suppress.Suppress (Suppress) := Svg; end; end if; end Resolve; ------------- -- Resolve -- ------------- -- Version with implicit type procedure Resolve (N : Node_Id) is begin Resolve (N, Etype (N)); end Resolve; --------------------- -- Resolve_Actuals -- --------------------- procedure Resolve_Actuals (N : Node_Id; Nam : Entity_Id) is Loc : constant Source_Ptr := Sloc (N); A : Node_Id; A_Id : Entity_Id; A_Typ : Entity_Id; F : Entity_Id; F_Typ : Entity_Id; Prev : Node_Id := Empty; Orig_A : Node_Id; Real_F : Entity_Id; Real_Subp : Entity_Id; -- If the subprogram being called is an inherited operation for -- a formal derived type in an instance, Real_Subp is the subprogram -- that will be called. It may have different formal names than the -- operation of the formal in the generic, so after actual is resolved -- the name of the actual in a named association must carry the name -- of the actual of the subprogram being called. procedure Check_Aliased_Parameter; -- Check rules on aliased parameters and related accessibility rules -- in (RM 3.10.2 (10.2-10.4)). procedure Check_Argument_Order; -- Performs a check for the case where the actuals are all simple -- identifiers that correspond to the formal names, but in the wrong -- order, which is considered suspicious and cause for a warning. procedure Check_Prefixed_Call; -- If the original node is an overloaded call in prefix notation, -- insert an 'Access or a dereference as needed over the first actual. -- Try_Object_Operation has already verified that there is a valid -- interpretation, but the form of the actual can only be determined -- once the primitive operation is identified. procedure Flag_Effectively_Volatile_Objects (Expr : Node_Id); -- Emit an error concerning the illegal usage of an effectively volatile -- object in interfering context (SPARK RM 7.13(12)). procedure Insert_Default; -- If the actual is missing in a call, insert in the actuals list -- an instance of the default expression. The insertion is always -- a named association. procedure Property_Error (Var : Node_Id; Var_Id : Entity_Id; Prop_Nam : Name_Id); -- Emit an error concerning variable Var with entity Var_Id that has -- enabled property Prop_Nam when it acts as an actual parameter in a -- call and the corresponding formal parameter is of mode IN. function Same_Ancestor (T1, T2 : Entity_Id) return Boolean; -- Check whether T1 and T2, or their full views, are derived from a -- common type. Used to enforce the restrictions on array conversions -- of AI95-00246. function Static_Concatenation (N : Node_Id) return Boolean; -- Predicate to determine whether an actual that is a concatenation -- will be evaluated statically and does not need a transient scope. -- This must be determined before the actual is resolved and expanded -- because if needed the transient scope must be introduced earlier. ----------------------------- -- Check_Aliased_Parameter -- ----------------------------- procedure Check_Aliased_Parameter is Nominal_Subt : Entity_Id; begin if Is_Aliased (F) then if Is_Tagged_Type (A_Typ) then null; elsif Is_Aliased_View (A) then if Is_Constr_Subt_For_U_Nominal (A_Typ) then Nominal_Subt := Base_Type (A_Typ); else Nominal_Subt := A_Typ; end if; if Subtypes_Statically_Match (F_Typ, Nominal_Subt) then null; -- In a generic body assume the worst for generic formals: -- they can have a constrained partial view (AI05-041). elsif Has_Discriminants (F_Typ) and then not Is_Constrained (F_Typ) and then not Has_Constrained_Partial_View (F_Typ) and then not Is_Generic_Type (F_Typ) then null; else Error_Msg_NE ("untagged actual does not match " & "aliased formal&", A, F); end if; else Error_Msg_NE ("actual for aliased formal& must be " & "aliased object", A, F); end if; if Ekind (Nam) = E_Procedure then null; elsif Ekind (Etype (Nam)) = E_Anonymous_Access_Type then if Nkind (Parent (N)) = N_Type_Conversion and then Type_Access_Level (Etype (Parent (N))) < Object_Access_Level (A) then Error_Msg_N ("aliased actual has wrong accessibility", A); end if; elsif Nkind (Parent (N)) = N_Qualified_Expression and then Nkind (Parent (Parent (N))) = N_Allocator and then Type_Access_Level (Etype (Parent (Parent (N)))) < Object_Access_Level (A) then Error_Msg_N ("aliased actual in allocator has wrong accessibility", A); end if; end if; end Check_Aliased_Parameter; -------------------------- -- Check_Argument_Order -- -------------------------- procedure Check_Argument_Order is begin -- Nothing to do if no parameters, or original node is neither a -- function call nor a procedure call statement (happens in the -- operator-transformed-to-function call case), or the call does -- not come from source, or this warning is off. if not Warn_On_Parameter_Order or else No (Parameter_Associations (N)) or else Nkind (Original_Node (N)) not in N_Subprogram_Call or else not Comes_From_Source (N) then return; end if; declare Nargs : constant Nat := List_Length (Parameter_Associations (N)); begin -- Nothing to do if only one parameter if Nargs < 2 then return; end if; -- Here if at least two arguments declare Actuals : array (1 .. Nargs) of Node_Id; Actual : Node_Id; Formal : Node_Id; Wrong_Order : Boolean := False; -- Set True if an out of order case is found begin -- Collect identifier names of actuals, fail if any actual is -- not a simple identifier, and record max length of name. Actual := First (Parameter_Associations (N)); for J in Actuals'Range loop if Nkind (Actual) /= N_Identifier then return; else Actuals (J) := Actual; Next (Actual); end if; end loop; -- If we got this far, all actuals are identifiers and the list -- of their names is stored in the Actuals array. Formal := First_Formal (Nam); for J in Actuals'Range loop -- If we ran out of formals, that's odd, probably an error -- which will be detected elsewhere, but abandon the search. if No (Formal) then return; end if; -- If name matches and is in order OK if Chars (Formal) = Chars (Actuals (J)) then null; else -- If no match, see if it is elsewhere in list and if so -- flag potential wrong order if type is compatible. for K in Actuals'Range loop if Chars (Formal) = Chars (Actuals (K)) and then Has_Compatible_Type (Actuals (K), Etype (Formal)) then Wrong_Order := True; goto Continue; end if; end loop; -- No match return; end if; <<Continue>> Next_Formal (Formal); end loop; -- If Formals left over, also probably an error, skip warning if Present (Formal) then return; end if; -- Here we give the warning if something was out of order if Wrong_Order then Error_Msg_N ("?P?actuals for this call may be in wrong order", N); end if; end; end; end Check_Argument_Order; ------------------------- -- Check_Prefixed_Call -- ------------------------- procedure Check_Prefixed_Call is Act : constant Node_Id := First_Actual (N); A_Type : constant Entity_Id := Etype (Act); F_Type : constant Entity_Id := Etype (First_Formal (Nam)); Orig : constant Node_Id := Original_Node (N); New_A : Node_Id; begin -- Check whether the call is a prefixed call, with or without -- additional actuals. if Nkind (Orig) = N_Selected_Component or else (Nkind (Orig) = N_Indexed_Component and then Nkind (Prefix (Orig)) = N_Selected_Component and then Is_Entity_Name (Prefix (Prefix (Orig))) and then Is_Entity_Name (Act) and then Chars (Act) = Chars (Prefix (Prefix (Orig)))) then if Is_Access_Type (A_Type) and then not Is_Access_Type (F_Type) then -- Introduce dereference on object in prefix New_A := Make_Explicit_Dereference (Sloc (Act), Prefix => Relocate_Node (Act)); Rewrite (Act, New_A); Analyze (Act); elsif Is_Access_Type (F_Type) and then not Is_Access_Type (A_Type) then -- Introduce an implicit 'Access in prefix if not Is_Aliased_View (Act) then Error_Msg_NE ("object in prefixed call to& must be aliased " & "(RM 4.1.3 (13 1/2))", Prefix (Act), Nam); end if; Rewrite (Act, Make_Attribute_Reference (Loc, Attribute_Name => Name_Access, Prefix => Relocate_Node (Act))); end if; Analyze (Act); end if; end Check_Prefixed_Call; --------------------------------------- -- Flag_Effectively_Volatile_Objects -- --------------------------------------- procedure Flag_Effectively_Volatile_Objects (Expr : Node_Id) is function Flag_Object (N : Node_Id) return Traverse_Result; -- Determine whether arbitrary node N denotes an effectively volatile -- object and if it does, emit an error. ----------------- -- Flag_Object -- ----------------- function Flag_Object (N : Node_Id) return Traverse_Result is Id : Entity_Id; begin -- Do not consider nested function calls because they have already -- been processed during their own resolution. if Nkind (N) = N_Function_Call then return Skip; elsif Is_Entity_Name (N) and then Present (Entity (N)) then Id := Entity (N); if Is_Object (Id) and then Is_Effectively_Volatile (Id) and then (Async_Writers_Enabled (Id) or else Effective_Reads_Enabled (Id)) then Error_Msg_N ("volatile object cannot appear in this context (SPARK " & "RM 7.1.3(11))", N); return Skip; end if; end if; return OK; end Flag_Object; procedure Flag_Objects is new Traverse_Proc (Flag_Object); -- Start of processing for Flag_Effectively_Volatile_Objects begin Flag_Objects (Expr); end Flag_Effectively_Volatile_Objects; -------------------- -- Insert_Default -- -------------------- procedure Insert_Default is Actval : Node_Id; Assoc : Node_Id; begin -- Missing argument in call, nothing to insert if No (Default_Value (F)) then return; else -- Note that we do a full New_Copy_Tree, so that any associated -- Itypes are properly copied. This may not be needed any more, -- but it does no harm as a safety measure. Defaults of a generic -- formal may be out of bounds of the corresponding actual (see -- cc1311b) and an additional check may be required. Actval := New_Copy_Tree (Default_Value (F), New_Scope => Current_Scope, New_Sloc => Loc); -- Propagate dimension information, if any. Copy_Dimensions (Default_Value (F), Actval); if Is_Concurrent_Type (Scope (Nam)) and then Has_Discriminants (Scope (Nam)) then Replace_Actual_Discriminants (N, Actval); end if; if Is_Overloadable (Nam) and then Present (Alias (Nam)) then if Base_Type (Etype (F)) /= Base_Type (Etype (Actval)) and then not Is_Tagged_Type (Etype (F)) then -- If default is a real literal, do not introduce a -- conversion whose effect may depend on the run-time -- size of universal real. if Nkind (Actval) = N_Real_Literal then Set_Etype (Actval, Base_Type (Etype (F))); else Actval := Unchecked_Convert_To (Etype (F), Actval); end if; end if; if Is_Scalar_Type (Etype (F)) then Enable_Range_Check (Actval); end if; Set_Parent (Actval, N); -- Resolve aggregates with their base type, to avoid scope -- anomalies: the subtype was first built in the subprogram -- declaration, and the current call may be nested. if Nkind (Actval) = N_Aggregate then Analyze_And_Resolve (Actval, Etype (F)); else Analyze_And_Resolve (Actval, Etype (Actval)); end if; else Set_Parent (Actval, N); -- See note above concerning aggregates if Nkind (Actval) = N_Aggregate and then Has_Discriminants (Etype (Actval)) then Analyze_And_Resolve (Actval, Base_Type (Etype (Actval))); -- Resolve entities with their own type, which may differ from -- the type of a reference in a generic context (the view -- swapping mechanism did not anticipate the re-analysis of -- default values in calls). elsif Is_Entity_Name (Actval) then Analyze_And_Resolve (Actval, Etype (Entity (Actval))); else Analyze_And_Resolve (Actval, Etype (Actval)); end if; end if; -- If default is a tag indeterminate function call, propagate tag -- to obtain proper dispatching. if Is_Controlling_Formal (F) and then Nkind (Default_Value (F)) = N_Function_Call then Set_Is_Controlling_Actual (Actval); end if; end if; -- If the default expression raises constraint error, then just -- silently replace it with an N_Raise_Constraint_Error node, since -- we already gave the warning on the subprogram spec. If node is -- already a Raise_Constraint_Error leave as is, to prevent loops in -- the warnings removal machinery. if Raises_Constraint_Error (Actval) and then Nkind (Actval) /= N_Raise_Constraint_Error then Rewrite (Actval, Make_Raise_Constraint_Error (Loc, Reason => CE_Range_Check_Failed)); Set_Raises_Constraint_Error (Actval); Set_Etype (Actval, Etype (F)); end if; Assoc := Make_Parameter_Association (Loc, Explicit_Actual_Parameter => Actval, Selector_Name => Make_Identifier (Loc, Chars (F))); -- Case of insertion is first named actual if No (Prev) or else Nkind (Parent (Prev)) /= N_Parameter_Association then Set_Next_Named_Actual (Assoc, First_Named_Actual (N)); Set_First_Named_Actual (N, Actval); if No (Prev) then if No (Parameter_Associations (N)) then Set_Parameter_Associations (N, New_List (Assoc)); else Append (Assoc, Parameter_Associations (N)); end if; else Insert_After (Prev, Assoc); end if; -- Case of insertion is not first named actual else Set_Next_Named_Actual (Assoc, Next_Named_Actual (Parent (Prev))); Set_Next_Named_Actual (Parent (Prev), Actval); Append (Assoc, Parameter_Associations (N)); end if; Mark_Rewrite_Insertion (Assoc); Mark_Rewrite_Insertion (Actval); Prev := Actval; end Insert_Default; -------------------- -- Property_Error -- -------------------- procedure Property_Error (Var : Node_Id; Var_Id : Entity_Id; Prop_Nam : Name_Id) is begin Error_Msg_Name_1 := Prop_Nam; Error_Msg_NE ("external variable & with enabled property % cannot appear as " & "actual in procedure call (SPARK RM 7.1.3(10))", Var, Var_Id); Error_Msg_N ("\\corresponding formal parameter has mode In", Var); end Property_Error; ------------------- -- Same_Ancestor -- ------------------- function Same_Ancestor (T1, T2 : Entity_Id) return Boolean is FT1 : Entity_Id := T1; FT2 : Entity_Id := T2; begin if Is_Private_Type (T1) and then Present (Full_View (T1)) then FT1 := Full_View (T1); end if; if Is_Private_Type (T2) and then Present (Full_View (T2)) then FT2 := Full_View (T2); end if; return Root_Type (Base_Type (FT1)) = Root_Type (Base_Type (FT2)); end Same_Ancestor; -------------------------- -- Static_Concatenation -- -------------------------- function Static_Concatenation (N : Node_Id) return Boolean is begin case Nkind (N) is when N_String_Literal => return True; when N_Op_Concat => -- Concatenation is static when both operands are static and -- the concatenation operator is a predefined one. return Scope (Entity (N)) = Standard_Standard and then Static_Concatenation (Left_Opnd (N)) and then Static_Concatenation (Right_Opnd (N)); when others => if Is_Entity_Name (N) then declare Ent : constant Entity_Id := Entity (N); begin return Ekind (Ent) = E_Constant and then Present (Constant_Value (Ent)) and then Is_OK_Static_Expression (Constant_Value (Ent)); end; else return False; end if; end case; end Static_Concatenation; -- Start of processing for Resolve_Actuals begin Check_Argument_Order; if Is_Overloadable (Nam) and then Is_Inherited_Operation (Nam) and then In_Instance and then Present (Alias (Nam)) and then Present (Overridden_Operation (Alias (Nam))) then Real_Subp := Alias (Nam); else Real_Subp := Empty; end if; if Present (First_Actual (N)) then Check_Prefixed_Call; end if; A := First_Actual (N); F := First_Formal (Nam); if Present (Real_Subp) then Real_F := First_Formal (Real_Subp); end if; while Present (F) loop if No (A) and then Needs_No_Actuals (Nam) then null; -- If we have an error in any actual or formal, indicated by a type -- of Any_Type, then abandon resolution attempt, and set result type -- to Any_Type. Skip this if the actual is a Raise_Expression, whose -- type is imposed from context. elsif (Present (A) and then Etype (A) = Any_Type) or else Etype (F) = Any_Type then if Nkind (A) /= N_Raise_Expression then Set_Etype (N, Any_Type); return; end if; end if; -- Case where actual is present -- If the actual is an entity, generate a reference to it now. We -- do this before the actual is resolved, because a formal of some -- protected subprogram, or a task discriminant, will be rewritten -- during expansion, and the source entity reference may be lost. if Present (A) and then Is_Entity_Name (A) and then Comes_From_Source (A) then Orig_A := Entity (A); if Present (Orig_A) then if Is_Formal (Orig_A) and then Ekind (F) /= E_In_Parameter then Generate_Reference (Orig_A, A, 'm'); elsif not Is_Overloaded (A) then if Ekind (F) /= E_Out_Parameter then Generate_Reference (Orig_A, A); -- RM 6.4.1(12): For an out parameter that is passed by -- copy, the formal parameter object is created, and: -- * For an access type, the formal parameter is initialized -- from the value of the actual, without checking that the -- value satisfies any constraint, any predicate, or any -- exclusion of the null value. -- * For a scalar type that has the Default_Value aspect -- specified, the formal parameter is initialized from the -- value of the actual, without checking that the value -- satisfies any constraint or any predicate. -- I do not understand why this case is included??? this is -- not a case where an OUT parameter is treated as IN OUT. -- * For a composite type with discriminants or that has -- implicit initial values for any subcomponents, the -- behavior is as for an in out parameter passed by copy. -- Hence for these cases we generate the read reference now -- (the write reference will be generated later by -- Note_Possible_Modification). elsif Is_By_Copy_Type (Etype (F)) and then (Is_Access_Type (Etype (F)) or else (Is_Scalar_Type (Etype (F)) and then Present (Default_Aspect_Value (Etype (F)))) or else (Is_Composite_Type (Etype (F)) and then (Has_Discriminants (Etype (F)) or else Is_Partially_Initialized_Type (Etype (F))))) then Generate_Reference (Orig_A, A); end if; end if; end if; end if; if Present (A) and then (Nkind (Parent (A)) /= N_Parameter_Association or else Chars (Selector_Name (Parent (A))) = Chars (F)) then -- If style checking mode on, check match of formal name if Style_Check then if Nkind (Parent (A)) = N_Parameter_Association then Check_Identifier (Selector_Name (Parent (A)), F); end if; end if; -- If the formal is Out or In_Out, do not resolve and expand the -- conversion, because it is subsequently expanded into explicit -- temporaries and assignments. However, the object of the -- conversion can be resolved. An exception is the case of tagged -- type conversion with a class-wide actual. In that case we want -- the tag check to occur and no temporary will be needed (no -- representation change can occur) and the parameter is passed by -- reference, so we go ahead and resolve the type conversion. -- Another exception is the case of reference to component or -- subcomponent of a bit-packed array, in which case we want to -- defer expansion to the point the in and out assignments are -- performed. if Ekind (F) /= E_In_Parameter and then Nkind (A) = N_Type_Conversion and then not Is_Class_Wide_Type (Etype (Expression (A))) then if Ekind (F) = E_In_Out_Parameter and then Is_Array_Type (Etype (F)) then -- In a view conversion, the conversion must be legal in -- both directions, and thus both component types must be -- aliased, or neither (4.6 (8)). -- The extra rule in 4.6 (24.9.2) seems unduly restrictive: -- the privacy requirement should not apply to generic -- types, and should be checked in an instance. ARG query -- is in order ??? if Has_Aliased_Components (Etype (Expression (A))) /= Has_Aliased_Components (Etype (F)) then Error_Msg_N ("both component types in a view conversion must be" & " aliased, or neither", A); -- Comment here??? what set of cases??? elsif not Same_Ancestor (Etype (F), Etype (Expression (A))) then -- Check view conv between unrelated by ref array types if Is_By_Reference_Type (Etype (F)) or else Is_By_Reference_Type (Etype (Expression (A))) then Error_Msg_N ("view conversion between unrelated by reference " & "array types not allowed (\'A'I-00246)", A); -- In Ada 2005 mode, check view conversion component -- type cannot be private, tagged, or volatile. Note -- that we only apply this to source conversions. The -- generated code can contain conversions which are -- not subject to this test, and we cannot extract the -- component type in such cases since it is not present. elsif Comes_From_Source (A) and then Ada_Version >= Ada_2005 then declare Comp_Type : constant Entity_Id := Component_Type (Etype (Expression (A))); begin if (Is_Private_Type (Comp_Type) and then not Is_Generic_Type (Comp_Type)) or else Is_Tagged_Type (Comp_Type) or else Is_Volatile (Comp_Type) then Error_Msg_N ("component type of a view conversion cannot" & " be private, tagged, or volatile" & " (RM 4.6 (24))", Expression (A)); end if; end; end if; end if; end if; -- Resolve expression if conversion is all OK if (Conversion_OK (A) or else Valid_Conversion (A, Etype (A), Expression (A))) and then not Is_Ref_To_Bit_Packed_Array (Expression (A)) then Resolve (Expression (A)); end if; -- If the actual is a function call that returns a limited -- unconstrained object that needs finalization, create a -- transient scope for it, so that it can receive the proper -- finalization list. elsif Nkind (A) = N_Function_Call and then Is_Limited_Record (Etype (F)) and then not Is_Constrained (Etype (F)) and then Expander_Active and then (Is_Controlled (Etype (F)) or else Has_Task (Etype (F))) then Establish_Transient_Scope (A, Sec_Stack => False); Resolve (A, Etype (F)); -- A small optimization: if one of the actuals is a concatenation -- create a block around a procedure call to recover stack space. -- This alleviates stack usage when several procedure calls in -- the same statement list use concatenation. We do not perform -- this wrapping for code statements, where the argument is a -- static string, and we want to preserve warnings involving -- sequences of such statements. elsif Nkind (A) = N_Op_Concat and then Nkind (N) = N_Procedure_Call_Statement and then Expander_Active and then not (Is_Intrinsic_Subprogram (Nam) and then Chars (Nam) = Name_Asm) and then not Static_Concatenation (A) then Establish_Transient_Scope (A, Sec_Stack => False); Resolve (A, Etype (F)); else if Nkind (A) = N_Type_Conversion and then Is_Array_Type (Etype (F)) and then not Same_Ancestor (Etype (F), Etype (Expression (A))) and then (Is_Limited_Type (Etype (F)) or else Is_Limited_Type (Etype (Expression (A)))) then Error_Msg_N ("conversion between unrelated limited array types " & "not allowed ('A'I-00246)", A); if Is_Limited_Type (Etype (F)) then Explain_Limited_Type (Etype (F), A); end if; if Is_Limited_Type (Etype (Expression (A))) then Explain_Limited_Type (Etype (Expression (A)), A); end if; end if; -- (Ada 2005: AI-251): If the actual is an allocator whose -- directly designated type is a class-wide interface, we build -- an anonymous access type to use it as the type of the -- allocator. Later, when the subprogram call is expanded, if -- the interface has a secondary dispatch table the expander -- will add a type conversion to force the correct displacement -- of the pointer. if Nkind (A) = N_Allocator then declare DDT : constant Entity_Id := Directly_Designated_Type (Base_Type (Etype (F))); New_Itype : Entity_Id; begin if Is_Class_Wide_Type (DDT) and then Is_Interface (DDT) then New_Itype := Create_Itype (E_Anonymous_Access_Type, A); Set_Etype (New_Itype, Etype (A)); Set_Directly_Designated_Type (New_Itype, Directly_Designated_Type (Etype (A))); Set_Etype (A, New_Itype); end if; -- Ada 2005, AI-162:If the actual is an allocator, the -- innermost enclosing statement is the master of the -- created object. This needs to be done with expansion -- enabled only, otherwise the transient scope will not -- be removed in the expansion of the wrapped construct. if (Is_Controlled (DDT) or else Has_Task (DDT)) and then Expander_Active then Establish_Transient_Scope (A, Sec_Stack => False); end if; end; if Ekind (Etype (F)) = E_Anonymous_Access_Type then Check_Restriction (No_Access_Parameter_Allocators, A); end if; end if; -- (Ada 2005): The call may be to a primitive operation of a -- tagged synchronized type, declared outside of the type. In -- this case the controlling actual must be converted to its -- corresponding record type, which is the formal type. The -- actual may be a subtype, either because of a constraint or -- because it is a generic actual, so use base type to locate -- concurrent type. F_Typ := Base_Type (Etype (F)); if Is_Tagged_Type (F_Typ) and then (Is_Concurrent_Type (F_Typ) or else Is_Concurrent_Record_Type (F_Typ)) then -- If the actual is overloaded, look for an interpretation -- that has a synchronized type. if not Is_Overloaded (A) then A_Typ := Base_Type (Etype (A)); else declare Index : Interp_Index; It : Interp; begin Get_First_Interp (A, Index, It); while Present (It.Typ) loop if Is_Concurrent_Type (It.Typ) or else Is_Concurrent_Record_Type (It.Typ) then A_Typ := Base_Type (It.Typ); exit; end if; Get_Next_Interp (Index, It); end loop; end; end if; declare Full_A_Typ : Entity_Id; begin if Present (Full_View (A_Typ)) then Full_A_Typ := Base_Type (Full_View (A_Typ)); else Full_A_Typ := A_Typ; end if; -- Tagged synchronized type (case 1): the actual is a -- concurrent type. if Is_Concurrent_Type (A_Typ) and then Corresponding_Record_Type (A_Typ) = F_Typ then Rewrite (A, Unchecked_Convert_To (Corresponding_Record_Type (A_Typ), A)); Resolve (A, Etype (F)); -- Tagged synchronized type (case 2): the formal is a -- concurrent type. elsif Ekind (Full_A_Typ) = E_Record_Type and then Present (Corresponding_Concurrent_Type (Full_A_Typ)) and then Is_Concurrent_Type (F_Typ) and then Present (Corresponding_Record_Type (F_Typ)) and then Full_A_Typ = Corresponding_Record_Type (F_Typ) then Resolve (A, Corresponding_Record_Type (F_Typ)); -- Common case else Resolve (A, Etype (F)); end if; end; -- Not a synchronized operation else Resolve (A, Etype (F)); end if; end if; A_Typ := Etype (A); F_Typ := Etype (F); -- An actual cannot be an untagged formal incomplete type if Ekind (A_Typ) = E_Incomplete_Type and then not Is_Tagged_Type (A_Typ) and then Is_Generic_Type (A_Typ) then Error_Msg_N ("invalid use of untagged formal incomplete type", A); end if; if Comes_From_Source (Original_Node (N)) and then Nkind_In (Original_Node (N), N_Function_Call, N_Procedure_Call_Statement) then -- In formal mode, check that actual parameters matching -- formals of tagged types are objects (or ancestor type -- conversions of objects), not general expressions. if Is_Actual_Tagged_Parameter (A) then if Is_SPARK_05_Object_Reference (A) then null; elsif Nkind (A) = N_Type_Conversion then declare Operand : constant Node_Id := Expression (A); Operand_Typ : constant Entity_Id := Etype (Operand); Target_Typ : constant Entity_Id := A_Typ; begin if not Is_SPARK_05_Object_Reference (Operand) then Check_SPARK_05_Restriction ("object required", Operand); -- In formal mode, the only view conversions are those -- involving ancestor conversion of an extended type. elsif not (Is_Tagged_Type (Target_Typ) and then not Is_Class_Wide_Type (Target_Typ) and then Is_Tagged_Type (Operand_Typ) and then not Is_Class_Wide_Type (Operand_Typ) and then Is_Ancestor (Target_Typ, Operand_Typ)) then if Ekind_In (F, E_Out_Parameter, E_In_Out_Parameter) then Check_SPARK_05_Restriction ("ancestor conversion is the only permitted " & "view conversion", A); else Check_SPARK_05_Restriction ("ancestor conversion required", A); end if; else null; end if; end; else Check_SPARK_05_Restriction ("object required", A); end if; -- In formal mode, the only view conversions are those -- involving ancestor conversion of an extended type. elsif Nkind (A) = N_Type_Conversion and then Ekind_In (F, E_Out_Parameter, E_In_Out_Parameter) then Check_SPARK_05_Restriction ("ancestor conversion is the only permitted view " & "conversion", A); end if; end if; -- has warnings suppressed, then we reset Never_Set_In_Source for -- the calling entity. The reason for this is to catch cases like -- GNAT.Spitbol.Patterns.Vstring_Var where the called subprogram -- uses trickery to modify an IN parameter. if Ekind (F) = E_In_Parameter and then Is_Entity_Name (A) and then Present (Entity (A)) and then Ekind (Entity (A)) = E_Variable and then Has_Warnings_Off (F_Typ) then Set_Never_Set_In_Source (Entity (A), False); end if; -- Perform error checks for IN and IN OUT parameters if Ekind (F) /= E_Out_Parameter then -- Check unset reference. For scalar parameters, it is clearly -- wrong to pass an uninitialized value as either an IN or -- IN-OUT parameter. For composites, it is also clearly an -- error to pass a completely uninitialized value as an IN -- parameter, but the case of IN OUT is trickier. We prefer -- not to give a warning here. For example, suppose there is -- a routine that sets some component of a record to False. -- It is perfectly reasonable to make this IN-OUT and allow -- either initialized or uninitialized records to be passed -- in this case. -- For partially initialized composite values, we also avoid -- warnings, since it is quite likely that we are passing a -- partially initialized value and only the initialized fields -- will in fact be read in the subprogram. if Is_Scalar_Type (A_Typ) or else (Ekind (F) = E_In_Parameter and then not Is_Partially_Initialized_Type (A_Typ)) then Check_Unset_Reference (A); end if; -- In Ada 83 we cannot pass an OUT parameter as an IN or IN OUT -- actual to a nested call, since this constitutes a reading of -- the parameter, which is not allowed. if Ada_Version = Ada_83 and then Is_Entity_Name (A) and then Ekind (Entity (A)) = E_Out_Parameter then Error_Msg_N ("(Ada 83) illegal reading of out parameter", A); end if; end if; -- Case of OUT or IN OUT parameter if Ekind (F) /= E_In_Parameter then -- For an Out parameter, check for useless assignment. Note -- that we can't set Last_Assignment this early, because we may -- kill current values in Resolve_Call, and that call would -- clobber the Last_Assignment field. -- Note: call Warn_On_Useless_Assignment before doing the check -- below for Is_OK_Variable_For_Out_Formal so that the setting -- of Referenced_As_LHS/Referenced_As_Out_Formal properly -- reflects the last assignment, not this one. if Ekind (F) = E_Out_Parameter then if Warn_On_Modified_As_Out_Parameter (F) and then Is_Entity_Name (A) and then Present (Entity (A)) and then Comes_From_Source (N) then Warn_On_Useless_Assignment (Entity (A), A); end if; end if; -- Validate the form of the actual. Note that the call to -- Is_OK_Variable_For_Out_Formal generates the required -- reference in this case. -- A call to an initialization procedure for an aggregate -- component may initialize a nested component of a constant -- designated object. In this context the object is variable. if not Is_OK_Variable_For_Out_Formal (A) and then not Is_Init_Proc (Nam) then Error_Msg_NE ("actual for& must be a variable", A, F); if Is_Subprogram (Current_Scope) then if Is_Invariant_Procedure (Current_Scope) or else Is_Partial_Invariant_Procedure (Current_Scope) then Error_Msg_N ("function used in invariant cannot modify its " & "argument", F); elsif Is_Predicate_Function (Current_Scope) then Error_Msg_N ("function used in predicate cannot modify its " & "argument", F); end if; end if; end if; -- What's the following about??? if Is_Entity_Name (A) then Kill_Checks (Entity (A)); else Kill_All_Checks; end if; end if; if Etype (A) = Any_Type then Set_Etype (N, Any_Type); return; end if; -- Apply appropriate constraint/predicate checks for IN [OUT] case if Ekind_In (F, E_In_Parameter, E_In_Out_Parameter) then -- Apply predicate tests except in certain special cases. Note -- that it might be more consistent to apply these only when -- expansion is active (in Exp_Ch6.Expand_Actuals), as we do -- for the outbound predicate tests ??? In any case indicate -- the function being called, for better warnings if the call -- leads to an infinite recursion. if Predicate_Tests_On_Arguments (Nam) then Apply_Predicate_Check (A, F_Typ, Nam); end if; -- Apply required constraint checks -- Gigi looks at the check flag and uses the appropriate types. -- For now since one flag is used there is an optimization -- which might not be done in the IN OUT case since Gigi does -- not do any analysis. More thought required about this ??? -- In fact is this comment obsolete??? doesn't the expander now -- generate all these tests anyway??? if Is_Scalar_Type (Etype (A)) then Apply_Scalar_Range_Check (A, F_Typ); elsif Is_Array_Type (Etype (A)) then Apply_Length_Check (A, F_Typ); elsif Is_Record_Type (F_Typ) and then Has_Discriminants (F_Typ) and then Is_Constrained (F_Typ) and then (not Is_Derived_Type (F_Typ) or else Comes_From_Source (Nam)) then Apply_Discriminant_Check (A, F_Typ); -- For view conversions of a discriminated object, apply -- check to object itself, the conversion alreay has the -- proper type. if Nkind (A) = N_Type_Conversion and then Is_Constrained (Etype (Expression (A))) then Apply_Discriminant_Check (Expression (A), F_Typ); end if; elsif Is_Access_Type (F_Typ) and then Is_Array_Type (Designated_Type (F_Typ)) and then Is_Constrained (Designated_Type (F_Typ)) then Apply_Length_Check (A, F_Typ); elsif Is_Access_Type (F_Typ) and then Has_Discriminants (Designated_Type (F_Typ)) and then Is_Constrained (Designated_Type (F_Typ)) then Apply_Discriminant_Check (A, F_Typ); else Apply_Range_Check (A, F_Typ); end if; -- Ada 2005 (AI-231): Note that the controlling parameter case -- already existed in Ada 95, which is partially checked -- elsewhere (see Checks), and we don't want the warning -- message to differ. if Is_Access_Type (F_Typ) and then Can_Never_Be_Null (F_Typ) and then Known_Null (A) then if Is_Controlling_Formal (F) then Apply_Compile_Time_Constraint_Error (N => A, Msg => "null value not allowed here??", Reason => CE_Access_Check_Failed); elsif Ada_Version >= Ada_2005 then Apply_Compile_Time_Constraint_Error (N => A, Msg => "(Ada 2005) null not allowed in " & "null-excluding formal??", Reason => CE_Null_Not_Allowed); end if; end if; end if; -- Checks for OUT parameters and IN OUT parameters if Ekind_In (F, E_Out_Parameter, E_In_Out_Parameter) then -- If there is a type conversion, make sure the return value -- meets the constraints of the variable before the conversion. if Nkind (A) = N_Type_Conversion then if Is_Scalar_Type (A_Typ) then Apply_Scalar_Range_Check (Expression (A), Etype (Expression (A)), A_Typ); -- In addition, the returned value of the parameter must -- satisfy the bounds of the object type (see comment -- below). Apply_Scalar_Range_Check (A, A_Typ, F_Typ); else Apply_Range_Check (Expression (A), Etype (Expression (A)), A_Typ); end if; -- If no conversion, apply scalar range checks and length check -- based on the subtype of the actual (NOT that of the formal). -- This indicates that the check takes place on return from the -- call. During expansion the required constraint checks are -- inserted. In GNATprove mode, in the absence of expansion, -- the flag indicates that the returned value is valid. else if Is_Scalar_Type (F_Typ) then Apply_Scalar_Range_Check (A, A_Typ, F_Typ); elsif Is_Array_Type (F_Typ) and then Ekind (F) = E_Out_Parameter then Apply_Length_Check (A, F_Typ); else Apply_Range_Check (A, A_Typ, F_Typ); end if; end if; -- Note: we do not apply the predicate checks for the case of -- OUT and IN OUT parameters. They are instead applied in the -- Expand_Actuals routine in Exp_Ch6. end if; -- An actual associated with an access parameter is implicitly -- converted to the anonymous access type of the formal and must -- satisfy the legality checks for access conversions. if Ekind (F_Typ) = E_Anonymous_Access_Type then if not Valid_Conversion (A, F_Typ, A) then Error_Msg_N ("invalid implicit conversion for access parameter", A); end if; -- If the actual is an access selected component of a variable, -- the call may modify its designated object. It is reasonable -- to treat this as a potential modification of the enclosing -- record, to prevent spurious warnings that it should be -- declared as a constant, because intuitively programmers -- regard the designated subcomponent as part of the record. if Nkind (A) = N_Selected_Component and then Is_Entity_Name (Prefix (A)) and then not Is_Constant_Object (Entity (Prefix (A))) then Note_Possible_Modification (A, Sure => False); end if; end if; -- Check bad case of atomic/volatile argument (RM C.6(12)) if Is_By_Reference_Type (Etype (F)) and then Comes_From_Source (N) then if Is_Atomic_Object (A) and then not Is_Atomic (Etype (F)) then Error_Msg_NE ("cannot pass atomic argument to non-atomic formal&", A, F); elsif Is_Volatile_Object (A) and then not Is_Volatile (Etype (F)) then Error_Msg_NE ("cannot pass volatile argument to non-volatile formal&", A, F); end if; end if; -- Check that subprograms don't have improper controlling -- arguments (RM 3.9.2 (9)). -- A primitive operation may have an access parameter of an -- incomplete tagged type, but a dispatching call is illegal -- if the type is still incomplete. if Is_Controlling_Formal (F) then Set_Is_Controlling_Actual (A); if Ekind (Etype (F)) = E_Anonymous_Access_Type then declare Desig : constant Entity_Id := Designated_Type (Etype (F)); begin if Ekind (Desig) = E_Incomplete_Type and then No (Full_View (Desig)) and then No (Non_Limited_View (Desig)) then Error_Msg_NE ("premature use of incomplete type& " & "in dispatching call", A, Desig); end if; end; end if; elsif Nkind (A) = N_Explicit_Dereference then Validate_Remote_Access_To_Class_Wide_Type (A); end if; -- Apply legality rule 3.9.2 (9/1) if (Is_Class_Wide_Type (A_Typ) or else Is_Dynamically_Tagged (A)) and then not Is_Class_Wide_Type (F_Typ) and then not Is_Controlling_Formal (F) and then not In_Instance then Error_Msg_N ("class-wide argument not allowed here!", A); if Is_Subprogram (Nam) and then Comes_From_Source (Nam) then Error_Msg_Node_2 := F_Typ; Error_Msg_NE ("& is not a dispatching operation of &!", A, Nam); end if; -- Apply the checks described in 3.10.2(27): if the context is a -- specific access-to-object, the actual cannot be class-wide. -- Use base type to exclude access_to_subprogram cases. elsif Is_Access_Type (A_Typ) and then Is_Access_Type (F_Typ) and then not Is_Access_Subprogram_Type (Base_Type (F_Typ)) and then (Is_Class_Wide_Type (Designated_Type (A_Typ)) or else (Nkind (A) = N_Attribute_Reference and then Is_Class_Wide_Type (Etype (Prefix (A))))) and then not Is_Class_Wide_Type (Designated_Type (F_Typ)) and then not Is_Controlling_Formal (F) -- Disable these checks for call to imported C++ subprograms and then not (Is_Entity_Name (Name (N)) and then Is_Imported (Entity (Name (N))) and then Convention (Entity (Name (N))) = Convention_CPP) then Error_Msg_N ("access to class-wide argument not allowed here!", A); if Is_Subprogram (Nam) and then Comes_From_Source (Nam) then Error_Msg_Node_2 := Designated_Type (F_Typ); Error_Msg_NE ("& is not a dispatching operation of &!", A, Nam); end if; end if; Check_Aliased_Parameter; Eval_Actual (A); -- If it is a named association, treat the selector_name as a -- proper identifier, and mark the corresponding entity. if Nkind (Parent (A)) = N_Parameter_Association -- Ignore reference in SPARK mode, as it refers to an entity not -- in scope at the point of reference, so the reference should -- be ignored for computing effects of subprograms. and then not GNATprove_Mode then -- If subprogram is overridden, use name of formal that -- is being called. if Present (Real_Subp) then Set_Entity (Selector_Name (Parent (A)), Real_F); Set_Etype (Selector_Name (Parent (A)), Etype (Real_F)); else Set_Entity (Selector_Name (Parent (A)), F); Generate_Reference (F, Selector_Name (Parent (A))); Set_Etype (Selector_Name (Parent (A)), F_Typ); Generate_Reference (F_Typ, N, ' '); end if; end if; Prev := A; if Ekind (F) /= E_Out_Parameter then Check_Unset_Reference (A); end if; -- The following checks are only relevant when SPARK_Mode is on as -- they are not standard Ada legality rule. Internally generated -- temporaries are ignored. if SPARK_Mode = On and then Comes_From_Source (A) then -- An effectively volatile object may act as an actual when the -- corresponding formal is of a non-scalar effectively volatile -- type (SPARK RM 7.1.3(11)). if not Is_Scalar_Type (Etype (F)) and then Is_Effectively_Volatile (Etype (F)) then null; -- An effectively volatile object may act as an actual in a -- call to an instance of Unchecked_Conversion. -- (SPARK RM 7.1.3(11)). elsif Is_Unchecked_Conversion_Instance (Nam) then null; -- The actual denotes an object elsif Is_Effectively_Volatile_Object (A) then Error_Msg_N ("volatile object cannot act as actual in a call (SPARK " & "RM 7.1.3(11))", A); -- Otherwise the actual denotes an expression. Inspect the -- expression and flag each effectively volatile object with -- enabled property Async_Writers or Effective_Reads as illegal -- because it apprears within an interfering context. Note that -- this is usually done in Resolve_Entity_Name, but when the -- effectively volatile object appears as an actual in a call, -- the call must be resolved first. else Flag_Effectively_Volatile_Objects (A); end if; -- Detect an external variable with an enabled property that -- does not match the mode of the corresponding formal in a -- procedure call. Functions are not considered because they -- cannot have effectively volatile formal parameters in the -- first place. if Ekind (Nam) = E_Procedure and then Ekind (F) = E_In_Parameter and then Is_Entity_Name (A) and then Present (Entity (A)) and then Ekind (Entity (A)) = E_Variable then A_Id := Entity (A); if Async_Readers_Enabled (A_Id) then Property_Error (A, A_Id, Name_Async_Readers); elsif Effective_Reads_Enabled (A_Id) then Property_Error (A, A_Id, Name_Effective_Reads); elsif Effective_Writes_Enabled (A_Id) then Property_Error (A, A_Id, Name_Effective_Writes); end if; end if; end if; -- A formal parameter of a specific tagged type whose related -- subprogram is subject to pragma Extensions_Visible with value -- "False" cannot act as an actual in a subprogram with value -- "True" (SPARK RM 6.1.7(3)). if Is_EVF_Expression (A) and then Extensions_Visible_Status (Nam) = Extensions_Visible_True then Error_Msg_N ("formal parameter cannot act as actual parameter when " & "Extensions_Visible is False", A); Error_Msg_NE ("\subprogram & has Extensions_Visible True", A, Nam); end if; -- The actual parameter of a Ghost subprogram whose formal is of -- mode IN OUT or OUT must be a Ghost variable (SPARK RM 6.9(12)). if Comes_From_Source (Nam) and then Is_Ghost_Entity (Nam) and then Ekind_In (F, E_In_Out_Parameter, E_Out_Parameter) and then Is_Entity_Name (A) and then Present (Entity (A)) and then not Is_Ghost_Entity (Entity (A)) then Error_Msg_NE ("non-ghost variable & cannot appear as actual in call to " & "ghost procedure", A, Entity (A)); if Ekind (F) = E_In_Out_Parameter then Error_Msg_N ("\corresponding formal has mode `IN OUT`", A); else Error_Msg_N ("\corresponding formal has mode OUT", A); end if; end if; Next_Actual (A); -- Case where actual is not present else Insert_Default; end if; Next_Formal (F); if Present (Real_Subp) then Next_Formal (Real_F); end if; end loop; end Resolve_Actuals; ----------------------- -- Resolve_Allocator -- ----------------------- procedure Resolve_Allocator (N : Node_Id; Typ : Entity_Id) is Desig_T : constant Entity_Id := Designated_Type (Typ); E : constant Node_Id := Expression (N); Subtyp : Entity_Id; Discrim : Entity_Id; Constr : Node_Id; Aggr : Node_Id; Assoc : Node_Id := Empty; Disc_Exp : Node_Id; procedure Check_Allocator_Discrim_Accessibility (Disc_Exp : Node_Id; Alloc_Typ : Entity_Id); -- Check that accessibility level associated with an access discriminant -- initialized in an allocator by the expression Disc_Exp is not deeper -- than the level of the allocator type Alloc_Typ. An error message is -- issued if this condition is violated. Specialized checks are done for -- the cases of a constraint expression which is an access attribute or -- an access discriminant. function In_Dispatching_Context return Boolean; -- If the allocator is an actual in a call, it is allowed to be class- -- wide when the context is not because it is a controlling actual. ------------------------------------------- -- Check_Allocator_Discrim_Accessibility -- ------------------------------------------- procedure Check_Allocator_Discrim_Accessibility (Disc_Exp : Node_Id; Alloc_Typ : Entity_Id) is begin if Type_Access_Level (Etype (Disc_Exp)) > Deepest_Type_Access_Level (Alloc_Typ) then Error_Msg_N ("operand type has deeper level than allocator type", Disc_Exp); -- When the expression is an Access attribute the level of the prefix -- object must not be deeper than that of the allocator's type. elsif Nkind (Disc_Exp) = N_Attribute_Reference and then Get_Attribute_Id (Attribute_Name (Disc_Exp)) = Attribute_Access and then Object_Access_Level (Prefix (Disc_Exp)) > Deepest_Type_Access_Level (Alloc_Typ) then Error_Msg_N ("prefix of attribute has deeper level than allocator type", Disc_Exp); -- When the expression is an access discriminant the check is against -- the level of the prefix object. elsif Ekind (Etype (Disc_Exp)) = E_Anonymous_Access_Type and then Nkind (Disc_Exp) = N_Selected_Component and then Object_Access_Level (Prefix (Disc_Exp)) > Deepest_Type_Access_Level (Alloc_Typ) then Error_Msg_N ("access discriminant has deeper level than allocator type", Disc_Exp); -- All other cases are legal else null; end if; end Check_Allocator_Discrim_Accessibility; ---------------------------- -- In_Dispatching_Context -- ---------------------------- function In_Dispatching_Context return Boolean is Par : constant Node_Id := Parent (N); begin return Nkind (Par) in N_Subprogram_Call and then Is_Entity_Name (Name (Par)) and then Is_Dispatching_Operation (Entity (Name (Par))); end In_Dispatching_Context; -- Start of processing for Resolve_Allocator begin -- Replace general access with specific type if Ekind (Etype (N)) = E_Allocator_Type then Set_Etype (N, Base_Type (Typ)); end if; if Is_Abstract_Type (Typ) then Error_Msg_N ("type of allocator cannot be abstract", N); end if; -- For qualified expression, resolve the expression using the given -- subtype (nothing to do for type mark, subtype indication) if Nkind (E) = N_Qualified_Expression then if Is_Class_Wide_Type (Etype (E)) and then not Is_Class_Wide_Type (Desig_T) and then not In_Dispatching_Context then Error_Msg_N ("class-wide allocator not allowed for this access type", N); end if; Resolve (Expression (E), Etype (E)); Check_Non_Static_Context (Expression (E)); Check_Unset_Reference (Expression (E)); -- Allocators generated by the build-in-place expansion mechanism -- are explicitly marked as coming from source but do not need to be -- checked for limited initialization. To exclude this case, ensure -- that the parent of the allocator is a source node. if Is_Limited_Type (Etype (E)) and then Comes_From_Source (N) and then Comes_From_Source (Parent (N)) and then not In_Instance_Body then if not OK_For_Limited_Init (Etype (E), Expression (E)) then if Nkind (Parent (N)) = N_Assignment_Statement then Error_Msg_N ("illegal expression for initialized allocator of a " & "limited type (RM 7.5 (2.7/2))", N); else Error_Msg_N ("initialization not allowed for limited types", N); end if; Explain_Limited_Type (Etype (E), N); end if; end if; -- A qualified expression requires an exact match of the type. Class- -- wide matching is not allowed. if (Is_Class_Wide_Type (Etype (Expression (E))) or else Is_Class_Wide_Type (Etype (E))) and then Base_Type (Etype (Expression (E))) /= Base_Type (Etype (E)) then Wrong_Type (Expression (E), Etype (E)); end if; -- Calls to build-in-place functions are not currently supported in -- allocators for access types associated with a simple storage pool. -- Supporting such allocators may require passing additional implicit -- parameters to build-in-place functions (or a significant revision -- of the current b-i-p implementation to unify the handling for -- multiple kinds of storage pools). ??? if Is_Limited_View (Desig_T) and then Nkind (Expression (E)) = N_Function_Call then declare Pool : constant Entity_Id := Associated_Storage_Pool (Root_Type (Typ)); begin if Present (Pool) and then Present (Get_Rep_Pragma (Etype (Pool), Name_Simple_Storage_Pool_Type)) then Error_Msg_N ("limited function calls not yet supported in simple " & "storage pool allocators", Expression (E)); end if; end; end if; -- A special accessibility check is needed for allocators that -- constrain access discriminants. The level of the type of the -- expression used to constrain an access discriminant cannot be -- deeper than the type of the allocator (in contrast to access -- parameters, where the level of the actual can be arbitrary). -- We can't use Valid_Conversion to perform this check because in -- general the type of the allocator is unrelated to the type of -- the access discriminant. if Ekind (Typ) /= E_Anonymous_Access_Type or else Is_Local_Anonymous_Access (Typ) then Subtyp := Entity (Subtype_Mark (E)); Aggr := Original_Node (Expression (E)); if Has_Discriminants (Subtyp) and then Nkind_In (Aggr, N_Aggregate, N_Extension_Aggregate) then Discrim := First_Discriminant (Base_Type (Subtyp)); -- Get the first component expression of the aggregate if Present (Expressions (Aggr)) then Disc_Exp := First (Expressions (Aggr)); elsif Present (Component_Associations (Aggr)) then Assoc := First (Component_Associations (Aggr)); if Present (Assoc) then Disc_Exp := Expression (Assoc); else Disc_Exp := Empty; end if; else Disc_Exp := Empty; end if; while Present (Discrim) and then Present (Disc_Exp) loop if Ekind (Etype (Discrim)) = E_Anonymous_Access_Type then Check_Allocator_Discrim_Accessibility (Disc_Exp, Typ); end if; Next_Discriminant (Discrim); if Present (Discrim) then if Present (Assoc) then Next (Assoc); Disc_Exp := Expression (Assoc); elsif Present (Next (Disc_Exp)) then Next (Disc_Exp); else Assoc := First (Component_Associations (Aggr)); if Present (Assoc) then Disc_Exp := Expression (Assoc); else Disc_Exp := Empty; end if; end if; end if; end loop; end if; end if; -- For a subtype mark or subtype indication, freeze the subtype else Freeze_Expression (E); if Is_Access_Constant (Typ) and then not No_Initialization (N) then Error_Msg_N ("initialization required for access-to-constant allocator", N); end if; -- A special accessibility check is needed for allocators that -- constrain access discriminants. The level of the type of the -- expression used to constrain an access discriminant cannot be -- deeper than the type of the allocator (in contrast to access -- parameters, where the level of the actual can be arbitrary). -- We can't use Valid_Conversion to perform this check because -- in general the type of the allocator is unrelated to the type -- of the access discriminant. if Nkind (Original_Node (E)) = N_Subtype_Indication and then (Ekind (Typ) /= E_Anonymous_Access_Type or else Is_Local_Anonymous_Access (Typ)) then Subtyp := Entity (Subtype_Mark (Original_Node (E))); if Has_Discriminants (Subtyp) then Discrim := First_Discriminant (Base_Type (Subtyp)); Constr := First (Constraints (Constraint (Original_Node (E)))); while Present (Discrim) and then Present (Constr) loop if Ekind (Etype (Discrim)) = E_Anonymous_Access_Type then if Nkind (Constr) = N_Discriminant_Association then Disc_Exp := Original_Node (Expression (Constr)); else Disc_Exp := Original_Node (Constr); end if; Check_Allocator_Discrim_Accessibility (Disc_Exp, Typ); end if; Next_Discriminant (Discrim); Next (Constr); end loop; end if; end if; end if; -- Ada 2005 (AI-344): A class-wide allocator requires an accessibility -- check that the level of the type of the created object is not deeper -- than the level of the allocator's access type, since extensions can -- now occur at deeper levels than their ancestor types. This is a -- static accessibility level check; a run-time check is also needed in -- the case of an initialized allocator with a class-wide argument (see -- Expand_Allocator_Expression). if Ada_Version >= Ada_2005 and then Is_Class_Wide_Type (Desig_T) then declare Exp_Typ : Entity_Id; begin if Nkind (E) = N_Qualified_Expression then Exp_Typ := Etype (E); elsif Nkind (E) = N_Subtype_Indication then Exp_Typ := Entity (Subtype_Mark (Original_Node (E))); else Exp_Typ := Entity (E); end if; if Type_Access_Level (Exp_Typ) > Deepest_Type_Access_Level (Typ) then if In_Instance_Body then Error_Msg_Warn := SPARK_Mode /= On; Error_Msg_N ("type in allocator has deeper level than " & "designated class-wide type<<", E); Error_Msg_N ("\Program_Error [<<", E); Rewrite (N, Make_Raise_Program_Error (Sloc (N), Reason => PE_Accessibility_Check_Failed)); Set_Etype (N, Typ); -- Do not apply Ada 2005 accessibility checks on a class-wide -- allocator if the type given in the allocator is a formal -- type. A run-time check will be performed in the instance. elsif not Is_Generic_Type (Exp_Typ) then Error_Msg_N ("type in allocator has deeper level than " & "designated class-wide type", E); end if; end if; end; end if; -- Check for allocation from an empty storage pool if No_Pool_Assigned (Typ) then Error_Msg_N ("allocation from empty storage pool!", N); -- If the context is an unchecked conversion, as may happen within an -- inlined subprogram, the allocator is being resolved with its own -- anonymous type. In that case, if the target type has a specific -- storage pool, it must be inherited explicitly by the allocator type. elsif Nkind (Parent (N)) = N_Unchecked_Type_Conversion and then No (Associated_Storage_Pool (Typ)) then Set_Associated_Storage_Pool (Typ, Associated_Storage_Pool (Etype (Parent (N)))); end if; if Ekind (Etype (N)) = E_Anonymous_Access_Type then Check_Restriction (No_Anonymous_Allocators, N); end if; -- Check that an allocator with task parts isn't for a nested access -- type when restriction No_Task_Hierarchy applies. if not Is_Library_Level_Entity (Base_Type (Typ)) and then Has_Task (Base_Type (Desig_T)) then Check_Restriction (No_Task_Hierarchy, N); end if; -- An illegal allocator may be rewritten as a raise Program_Error -- statement. if Nkind (N) = N_Allocator then -- An anonymous access discriminant is the definition of a -- coextension. if Ekind (Typ) = E_Anonymous_Access_Type and then Nkind (Associated_Node_For_Itype (Typ)) = N_Discriminant_Specification then declare Discr : constant Entity_Id := Defining_Identifier (Associated_Node_For_Itype (Typ)); begin Check_Restriction (No_Coextensions, N); -- Ada 2012 AI05-0052: If the designated type of the allocator -- is limited, then the allocator shall not be used to define -- the value of an access discriminant unless the discriminated -- type is immutably limited. if Ada_Version >= Ada_2012 and then Is_Limited_Type (Desig_T) and then not Is_Limited_View (Scope (Discr)) then Error_Msg_N ("only immutably limited types can have anonymous " & "access discriminants designating a limited type", N); end if; end; -- Avoid marking an allocator as a dynamic coextension if it is -- within a static construct. if not Is_Static_Coextension (N) then Set_Is_Dynamic_Coextension (N); end if; -- Cleanup for potential static coextensions else Set_Is_Dynamic_Coextension (N, False); Set_Is_Static_Coextension (N, False); end if; end if; -- Report a simple error: if the designated object is a local task, -- its body has not been seen yet, and its activation will fail an -- elaboration check. if Is_Task_Type (Desig_T) and then Scope (Base_Type (Desig_T)) = Current_Scope and then Is_Compilation_Unit (Current_Scope) and then Ekind (Current_Scope) = E_Package and then not In_Package_Body (Current_Scope) then Error_Msg_Warn := SPARK_Mode /= On; Error_Msg_N ("cannot activate task before body seen<<", N); Error_Msg_N ("\Program_Error [<<", N); end if; -- Ada 2012 (AI05-0111-3): Detect an attempt to allocate a task or a -- type with a task component on a subpool. This action must raise -- Program_Error at runtime. if Ada_Version >= Ada_2012 and then Nkind (N) = N_Allocator and then Present (Subpool_Handle_Name (N)) and then Has_Task (Desig_T) then Error_Msg_Warn := SPARK_Mode /= On; Error_Msg_N ("cannot allocate task on subpool<<", N); Error_Msg_N ("\Program_Error [<<", N); Rewrite (N, Make_Raise_Program_Error (Sloc (N), Reason => PE_Explicit_Raise)); Set_Etype (N, Typ); end if; end Resolve_Allocator; --------------------------- -- Resolve_Arithmetic_Op -- --------------------------- -- Used for resolving all arithmetic operators except exponentiation procedure Resolve_Arithmetic_Op (N : Node_Id; Typ : Entity_Id) is L : constant Node_Id := Left_Opnd (N); R : constant Node_Id := Right_Opnd (N); TL : constant Entity_Id := Base_Type (Etype (L)); TR : constant Entity_Id := Base_Type (Etype (R)); T : Entity_Id; Rop : Node_Id; B_Typ : constant Entity_Id := Base_Type (Typ); -- We do the resolution using the base type, because intermediate values -- in expressions always are of the base type, not a subtype of it. function Expected_Type_Is_Any_Real (N : Node_Id) return Boolean; -- Returns True if N is in a context that expects "any real type" function Is_Integer_Or_Universal (N : Node_Id) return Boolean; -- Return True iff given type is Integer or universal real/integer procedure Set_Mixed_Mode_Operand (N : Node_Id; T : Entity_Id); -- Choose type of integer literal in fixed-point operation to conform -- to available fixed-point type. T is the type of the other operand, -- which is needed to determine the expected type of N. procedure Set_Operand_Type (N : Node_Id); -- Set operand type to T if universal ------------------------------- -- Expected_Type_Is_Any_Real -- ------------------------------- function Expected_Type_Is_Any_Real (N : Node_Id) return Boolean is begin -- N is the expression after "delta" in a fixed_point_definition; -- see RM-3.5.9(6): return Nkind_In (Parent (N), N_Ordinary_Fixed_Point_Definition, N_Decimal_Fixed_Point_Definition, -- N is one of the bounds in a real_range_specification; -- see RM-3.5.7(5): N_Real_Range_Specification, -- N is the expression of a delta_constraint; -- see RM-J.3(3): N_Delta_Constraint); end Expected_Type_Is_Any_Real; ----------------------------- -- Is_Integer_Or_Universal -- ----------------------------- function Is_Integer_Or_Universal (N : Node_Id) return Boolean is T : Entity_Id; Index : Interp_Index; It : Interp; begin if not Is_Overloaded (N) then T := Etype (N); return Base_Type (T) = Base_Type (Standard_Integer) or else T = Universal_Integer or else T = Universal_Real; else Get_First_Interp (N, Index, It); while Present (It.Typ) loop if Base_Type (It.Typ) = Base_Type (Standard_Integer) or else It.Typ = Universal_Integer or else It.Typ = Universal_Real then return True; end if; Get_Next_Interp (Index, It); end loop; end if; return False; end Is_Integer_Or_Universal; ---------------------------- -- Set_Mixed_Mode_Operand -- ---------------------------- procedure Set_Mixed_Mode_Operand (N : Node_Id; T : Entity_Id) is Index : Interp_Index; It : Interp; begin if Universal_Interpretation (N) = Universal_Integer then -- A universal integer literal is resolved as standard integer -- except in the case of a fixed-point result, where we leave it -- as universal (to be handled by Exp_Fixd later on) if Is_Fixed_Point_Type (T) then Resolve (N, Universal_Integer); else Resolve (N, Standard_Integer); end if; elsif Universal_Interpretation (N) = Universal_Real and then (T = Base_Type (Standard_Integer) or else T = Universal_Integer or else T = Universal_Real) then -- A universal real can appear in a fixed-type context. We resolve -- the literal with that context, even though this might raise an -- exception prematurely (the other operand may be zero). Resolve (N, B_Typ); elsif Etype (N) = Base_Type (Standard_Integer) and then T = Universal_Real and then Is_Overloaded (N) then -- Integer arg in mixed-mode operation. Resolve with universal -- type, in case preference rule must be applied. Resolve (N, Universal_Integer); elsif Etype (N) = T and then B_Typ /= Universal_Fixed then -- Not a mixed-mode operation, resolve with context Resolve (N, B_Typ); elsif Etype (N) = Any_Fixed then -- N may itself be a mixed-mode operation, so use context type Resolve (N, B_Typ); elsif Is_Fixed_Point_Type (T) and then B_Typ = Universal_Fixed and then Is_Overloaded (N) then -- Must be (fixed * fixed) operation, operand must have one -- compatible interpretation. Resolve (N, Any_Fixed); elsif Is_Fixed_Point_Type (B_Typ) and then (T = Universal_Real or else Is_Fixed_Point_Type (T)) and then Is_Overloaded (N) then -- C * F(X) in a fixed context, where C is a real literal or a -- fixed-point expression. F must have either a fixed type -- interpretation or an integer interpretation, but not both. Get_First_Interp (N, Index, It); while Present (It.Typ) loop if Base_Type (It.Typ) = Base_Type (Standard_Integer) then if Analyzed (N) then Error_Msg_N ("ambiguous operand in fixed operation", N); else Resolve (N, Standard_Integer); end if; elsif Is_Fixed_Point_Type (It.Typ) then if Analyzed (N) then Error_Msg_N ("ambiguous operand in fixed operation", N); else Resolve (N, It.Typ); end if; end if; Get_Next_Interp (Index, It); end loop; -- Reanalyze the literal with the fixed type of the context. If -- context is Universal_Fixed, we are within a conversion, leave -- the literal as a universal real because there is no usable -- fixed type, and the target of the conversion plays no role in -- the resolution. declare Op2 : Node_Id; T2 : Entity_Id; begin if N = L then Op2 := R; else Op2 := L; end if; if B_Typ = Universal_Fixed and then Nkind (Op2) = N_Real_Literal then T2 := Universal_Real; else T2 := B_Typ; end if; Set_Analyzed (Op2, False); Resolve (Op2, T2); end; else Resolve (N); end if; end Set_Mixed_Mode_Operand; ---------------------- -- Set_Operand_Type -- ---------------------- procedure Set_Operand_Type (N : Node_Id) is begin if Etype (N) = Universal_Integer or else Etype (N) = Universal_Real then Set_Etype (N, T); end if; end Set_Operand_Type; -- Start of processing for Resolve_Arithmetic_Op begin if Comes_From_Source (N) and then Ekind (Entity (N)) = E_Function and then Is_Imported (Entity (N)) and then Is_Intrinsic_Subprogram (Entity (N)) then Resolve_Intrinsic_Operator (N, Typ); return; -- Special-case for mixed-mode universal expressions or fixed point type -- operation: each argument is resolved separately. The same treatment -- is required if one of the operands of a fixed point operation is -- universal real, since in this case we don't do a conversion to a -- specific fixed-point type (instead the expander handles the case). -- Set the type of the node to its universal interpretation because -- legality checks on an exponentiation operand need the context. elsif (B_Typ = Universal_Integer or else B_Typ = Universal_Real) and then Present (Universal_Interpretation (L)) and then Present (Universal_Interpretation (R)) then Set_Etype (N, B_Typ); Resolve (L, Universal_Interpretation (L)); Resolve (R, Universal_Interpretation (R)); elsif (B_Typ = Universal_Real or else Etype (N) = Universal_Fixed or else (Etype (N) = Any_Fixed and then Is_Fixed_Point_Type (B_Typ)) or else (Is_Fixed_Point_Type (B_Typ) and then (Is_Integer_Or_Universal (L) or else Is_Integer_Or_Universal (R)))) and then Nkind_In (N, N_Op_Multiply, N_Op_Divide) then if TL = Universal_Integer or else TR = Universal_Integer then Check_For_Visible_Operator (N, B_Typ); end if; -- If context is a fixed type and one operand is integer, the other -- is resolved with the type of the context. if Is_Fixed_Point_Type (B_Typ) and then (Base_Type (TL) = Base_Type (Standard_Integer) or else TL = Universal_Integer) then Resolve (R, B_Typ); Resolve (L, TL); elsif Is_Fixed_Point_Type (B_Typ) and then (Base_Type (TR) = Base_Type (Standard_Integer) or else TR = Universal_Integer) then Resolve (L, B_Typ); Resolve (R, TR); else Set_Mixed_Mode_Operand (L, TR); Set_Mixed_Mode_Operand (R, TL); end if; -- Check the rule in RM05-4.5.5(19.1/2) disallowing universal_fixed -- multiplying operators from being used when the expected type is -- also universal_fixed. Note that B_Typ will be Universal_Fixed in -- some cases where the expected type is actually Any_Real; -- Expected_Type_Is_Any_Real takes care of that case. if Etype (N) = Universal_Fixed or else Etype (N) = Any_Fixed then if B_Typ = Universal_Fixed and then not Expected_Type_Is_Any_Real (N) and then not Nkind_In (Parent (N), N_Type_Conversion, N_Unchecked_Type_Conversion) then Error_Msg_N ("type cannot be determined from context!", N); Error_Msg_N ("\explicit conversion to result type required", N); Set_Etype (L, Any_Type); Set_Etype (R, Any_Type); else if Ada_Version = Ada_83 and then Etype (N) = Universal_Fixed and then not Nkind_In (Parent (N), N_Type_Conversion, N_Unchecked_Type_Conversion) then Error_Msg_N ("(Ada 83) fixed-point operation needs explicit " & "conversion", N); end if; -- The expected type is "any real type" in contexts like -- type T is delta <universal_fixed-expression> ... -- in which case we need to set the type to Universal_Real -- so that static expression evaluation will work properly. if Expected_Type_Is_Any_Real (N) then Set_Etype (N, Universal_Real); else Set_Etype (N, B_Typ); end if; end if; elsif Is_Fixed_Point_Type (B_Typ) and then (Is_Integer_Or_Universal (L) or else Nkind (L) = N_Real_Literal or else Nkind (R) = N_Real_Literal or else Is_Integer_Or_Universal (R)) then Set_Etype (N, B_Typ); elsif Etype (N) = Any_Fixed then -- If no previous errors, this is only possible if one operand is -- overloaded and the context is universal. Resolve as such. Set_Etype (N, B_Typ); end if; else if (TL = Universal_Integer or else TL = Universal_Real) and then (TR = Universal_Integer or else TR = Universal_Real) then Check_For_Visible_Operator (N, B_Typ); end if; -- If the context is Universal_Fixed and the operands are also -- universal fixed, this is an error, unless there is only one -- applicable fixed_point type (usually Duration). if B_Typ = Universal_Fixed and then Etype (L) = Universal_Fixed then T := Unique_Fixed_Point_Type (N); if T = Any_Type then Set_Etype (N, T); return; else Resolve (L, T); Resolve (R, T); end if; else Resolve (L, B_Typ); Resolve (R, B_Typ); end if; -- If one of the arguments was resolved to a non-universal type. -- label the result of the operation itself with the same type. -- Do the same for the universal argument, if any. T := Intersect_Types (L, R); Set_Etype (N, Base_Type (T)); Set_Operand_Type (L); Set_Operand_Type (R); end if; Generate_Operator_Reference (N, Typ); Analyze_Dimension (N); Eval_Arithmetic_Op (N); -- In SPARK, a multiplication or division with operands of fixed point -- types must be qualified or explicitly converted to identify the -- result type. if (Is_Fixed_Point_Type (Etype (L)) or else Is_Fixed_Point_Type (Etype (R))) and then Nkind_In (N, N_Op_Multiply, N_Op_Divide) and then not Nkind_In (Parent (N), N_Qualified_Expression, N_Type_Conversion) then Check_SPARK_05_Restriction ("operation should be qualified or explicitly converted", N); end if; -- Set overflow and division checking bit if Nkind (N) in N_Op then if not Overflow_Checks_Suppressed (Etype (N)) then Enable_Overflow_Check (N); end if; -- Give warning if explicit division by zero if Nkind_In (N, N_Op_Divide, N_Op_Rem, N_Op_Mod) and then not Division_Checks_Suppressed (Etype (N)) then Rop := Right_Opnd (N); if Compile_Time_Known_Value (Rop) and then ((Is_Integer_Type (Etype (Rop)) and then Expr_Value (Rop) = Uint_0) or else (Is_Real_Type (Etype (Rop)) and then Expr_Value_R (Rop) = Ureal_0)) then -- Specialize the warning message according to the operation. -- When SPARK_Mode is On, force a warning instead of an error -- in that case, as this likely corresponds to deactivated -- code. The following warnings are for the case case Nkind (N) is when N_Op_Divide => -- For division, we have two cases, for float division -- of an unconstrained float type, on a machine where -- Machine_Overflows is false, we don't get an exception -- at run-time, but rather an infinity or Nan. The Nan -- case is pretty obscure, so just warn about infinities. if Is_Floating_Point_Type (Typ) and then not Is_Constrained (Typ) and then not Machine_Overflows_On_Target then Error_Msg_N ("float division by zero, may generate " & "'+'/'- infinity??", Right_Opnd (N)); -- For all other cases, we get a Constraint_Error else Apply_Compile_Time_Constraint_Error (N, "division by zero??", CE_Divide_By_Zero, Loc => Sloc (Right_Opnd (N)), Warn => SPARK_Mode = On); end if; when N_Op_Rem => Apply_Compile_Time_Constraint_Error (N, "rem with zero divisor??", CE_Divide_By_Zero, Loc => Sloc (Right_Opnd (N)), Warn => SPARK_Mode = On); when N_Op_Mod => Apply_Compile_Time_Constraint_Error (N, "mod with zero divisor??", CE_Divide_By_Zero, Loc => Sloc (Right_Opnd (N)), Warn => SPARK_Mode = On); -- Division by zero can only happen with division, rem, -- and mod operations. when others => raise Program_Error; end case; -- In GNATprove mode, we enable the division check so that -- GNATprove will issue a message if it cannot be proved. if GNATprove_Mode then Activate_Division_Check (N); end if; -- Otherwise just set the flag to check at run time else Activate_Division_Check (N); end if; end if; -- If Restriction No_Implicit_Conditionals is active, then it is -- violated if either operand can be negative for mod, or for rem -- if both operands can be negative. if Restriction_Check_Required (No_Implicit_Conditionals) and then Nkind_In (N, N_Op_Rem, N_Op_Mod) then declare Lo : Uint; Hi : Uint; OK : Boolean; LNeg : Boolean; RNeg : Boolean; -- Set if corresponding operand might be negative begin Determine_Range (Left_Opnd (N), OK, Lo, Hi, Assume_Valid => True); LNeg := (not OK) or else Lo < 0; Determine_Range (Right_Opnd (N), OK, Lo, Hi, Assume_Valid => True); RNeg := (not OK) or else Lo < 0; -- Check if we will be generating conditionals. There are two -- cases where that can happen, first for REM, the only case -- is largest negative integer mod -1, where the division can -- overflow, but we still have to give the right result. The -- front end generates a test for this annoying case. Here we -- just test if both operands can be negative (that's what the -- expander does, so we match its logic here). -- The second case is mod where either operand can be negative. -- In this case, the back end has to generate additional tests. if (Nkind (N) = N_Op_Rem and then (LNeg and RNeg)) or else (Nkind (N) = N_Op_Mod and then (LNeg or RNeg)) then Check_Restriction (No_Implicit_Conditionals, N); end if; end; end if; end if; Check_Unset_Reference (L); Check_Unset_Reference (R); end Resolve_Arithmetic_Op; ------------------ -- Resolve_Call -- ------------------ procedure Resolve_Call (N : Node_Id; Typ : Entity_Id) is function Same_Or_Aliased_Subprograms (S : Entity_Id; E : Entity_Id) return Boolean; -- Returns True if the subprogram entity S is the same as E or else -- S is an alias of E. --------------------------------- -- Same_Or_Aliased_Subprograms -- --------------------------------- function Same_Or_Aliased_Subprograms (S : Entity_Id; E : Entity_Id) return Boolean is Subp_Alias : constant Entity_Id := Alias (S); begin return S = E or else (Present (Subp_Alias) and then Subp_Alias = E); end Same_Or_Aliased_Subprograms; -- Local variables Loc : constant Source_Ptr := Sloc (N); Subp : constant Node_Id := Name (N); Body_Id : Entity_Id; I : Interp_Index; It : Interp; Nam : Entity_Id; Nam_Decl : Node_Id; Nam_UA : Entity_Id; Norm_OK : Boolean; Rtype : Entity_Id; Scop : Entity_Id; -- Start of processing for Resolve_Call begin -- The context imposes a unique interpretation with type Typ on a -- procedure or function call. Find the entity of the subprogram that -- yields the expected type, and propagate the corresponding formal -- constraints on the actuals. The caller has established that an -- interpretation exists, and emitted an error if not unique. -- First deal with the case of a call to an access-to-subprogram, -- dereference made explicit in Analyze_Call. if Ekind (Etype (Subp)) = E_Subprogram_Type then if not Is_Overloaded (Subp) then Nam := Etype (Subp); else -- Find the interpretation whose type (a subprogram type) has a -- return type that is compatible with the context. Analysis of -- the node has established that one exists. Nam := Empty; Get_First_Interp (Subp, I, It); while Present (It.Typ) loop if Covers (Typ, Etype (It.Typ)) then Nam := It.Typ; exit; end if; Get_Next_Interp (I, It); end loop; if No (Nam) then raise Program_Error; end if; end if; -- If the prefix is not an entity, then resolve it if not Is_Entity_Name (Subp) then Resolve (Subp, Nam); end if; -- For an indirect call, we always invalidate checks, since we do not -- know whether the subprogram is local or global. Yes we could do -- better here, e.g. by knowing that there are no local subprograms, -- but it does not seem worth the effort. Similarly, we kill all -- knowledge of current constant values. Kill_Current_Values; -- If this is a procedure call which is really an entry call, do -- the conversion of the procedure call to an entry call. Protected -- operations use the same circuitry because the name in the call -- can be an arbitrary expression with special resolution rules. elsif Nkind_In (Subp, N_Selected_Component, N_Indexed_Component) or else (Is_Entity_Name (Subp) and then Ekind (Entity (Subp)) = E_Entry) then Resolve_Entry_Call (N, Typ); Check_Elab_Call (N); -- Kill checks and constant values, as above for indirect case -- Who knows what happens when another task is activated? Kill_Current_Values; return; -- Normal subprogram call with name established in Resolve elsif not (Is_Type (Entity (Subp))) then Nam := Entity (Subp); Set_Entity_With_Checks (Subp, Nam); -- Otherwise we must have the case of an overloaded call else pragma Assert (Is_Overloaded (Subp)); -- Initialize Nam to prevent warning (we know it will be assigned -- in the loop below, but the compiler does not know that). Nam := Empty; Get_First_Interp (Subp, I, It); while Present (It.Typ) loop if Covers (Typ, It.Typ) then Nam := It.Nam; Set_Entity_With_Checks (Subp, Nam); exit; end if; Get_Next_Interp (I, It); end loop; end if; if Is_Access_Subprogram_Type (Base_Type (Etype (Nam))) and then not Is_Access_Subprogram_Type (Base_Type (Typ)) and then Nkind (Subp) /= N_Explicit_Dereference and then Present (Parameter_Associations (N)) then -- The prefix is a parameterless function call that returns an access -- to subprogram. If parameters are present in the current call, add -- add an explicit dereference. We use the base type here because -- within an instance these may be subtypes. -- The dereference is added either in Analyze_Call or here. Should -- be consolidated ??? Set_Is_Overloaded (Subp, False); Set_Etype (Subp, Etype (Nam)); Insert_Explicit_Dereference (Subp); Nam := Designated_Type (Etype (Nam)); Resolve (Subp, Nam); end if; -- Check that a call to Current_Task does not occur in an entry body if Is_RTE (Nam, RE_Current_Task) then declare P : Node_Id; begin P := N; loop P := Parent (P); -- Exclude calls that occur within the default of a formal -- parameter of the entry, since those are evaluated outside -- of the body. exit when No (P) or else Nkind (P) = N_Parameter_Specification; if Nkind (P) = N_Entry_Body or else (Nkind (P) = N_Subprogram_Body and then Is_Entry_Barrier_Function (P)) then Rtype := Etype (N); Error_Msg_Warn := SPARK_Mode /= On; Error_Msg_NE ("& should not be used in entry body (RM C.7(17))<<", N, Nam); Error_Msg_NE ("\Program_Error [<<", N, Nam); Rewrite (N, Make_Raise_Program_Error (Loc, Reason => PE_Current_Task_In_Entry_Body)); Set_Etype (N, Rtype); return; end if; end loop; end; end if; -- Check that a procedure call does not occur in the context of the -- entry call statement of a conditional or timed entry call. Note that -- the case of a call to a subprogram renaming of an entry will also be -- rejected. The test for N not being an N_Entry_Call_Statement is -- defensive, covering the possibility that the processing of entry -- calls might reach this point due to later modifications of the code -- above. if Nkind (Parent (N)) = N_Entry_Call_Alternative and then Nkind (N) /= N_Entry_Call_Statement and then Entry_Call_Statement (Parent (N)) = N then if Ada_Version < Ada_2005 then Error_Msg_N ("entry call required in select statement", N); -- Ada 2005 (AI-345): If a procedure_call_statement is used -- for a procedure_or_entry_call, the procedure_name or -- procedure_prefix of the procedure_call_statement shall denote -- an entry renamed by a procedure, or (a view of) a primitive -- subprogram of a limited interface whose first parameter is -- a controlling parameter. elsif Nkind (N) = N_Procedure_Call_Statement and then not Is_Renamed_Entry (Nam) and then not Is_Controlling_Limited_Procedure (Nam) then Error_Msg_N ("entry call or dispatching primitive of interface required", N); end if; end if; -- If the SPARK_05 restriction is active, we are not allowed -- to have a call to a subprogram before we see its completion. if not Has_Completion (Nam) and then Restriction_Check_Required (SPARK_05) -- Don't flag strange internal calls and then Comes_From_Source (N) and then Comes_From_Source (Nam) -- Only flag calls in extended main source and then In_Extended_Main_Source_Unit (Nam) and then In_Extended_Main_Source_Unit (N) -- Exclude enumeration literals from this processing and then Ekind (Nam) /= E_Enumeration_Literal then Check_SPARK_05_Restriction ("call to subprogram cannot appear before its body", N); end if; -- Check that this is not a call to a protected procedure or entry from -- within a protected function. Check_Internal_Protected_Use (N, Nam); -- Freeze the subprogram name if not in a spec-expression. Note that -- we freeze procedure calls as well as function calls. Procedure calls -- are not frozen according to the rules (RM 13.14(14)) because it is -- impossible to have a procedure call to a non-frozen procedure in -- pure Ada, but in the code that we generate in the expander, this -- rule needs extending because we can generate procedure calls that -- need freezing. -- In Ada 2012, expression functions may be called within pre/post -- conditions of subsequent functions or expression functions. Such -- calls do not freeze when they appear within generated bodies, -- (including the body of another expression function) which would -- place the freeze node in the wrong scope. An expression function -- is frozen in the usual fashion, by the appearance of a real body, -- or at the end of a declarative part. if Is_Entity_Name (Subp) and then not In_Spec_Expression and then not Is_Expression_Function_Or_Completion (Current_Scope) and then (not Is_Expression_Function_Or_Completion (Entity (Subp)) or else Scope (Entity (Subp)) = Current_Scope) then Freeze_Expression (Subp); end if; -- For a predefined operator, the type of the result is the type imposed -- by context, except for a predefined operation on universal fixed. -- Otherwise The type of the call is the type returned by the subprogram -- being called. if Is_Predefined_Op (Nam) then if Etype (N) /= Universal_Fixed then Set_Etype (N, Typ); end if; -- If the subprogram returns an array type, and the context requires the -- component type of that array type, the node is really an indexing of -- the parameterless call. Resolve as such. A pathological case occurs -- when the type of the component is an access to the array type. In -- this case the call is truly ambiguous. If the call is to an intrinsic -- subprogram, it can't be an indexed component. This check is necessary -- because if it's Unchecked_Conversion, and we have "type T_Ptr is -- access T;" and "type T is array (...) of T_Ptr;" (i.e. an array of -- pointers to the same array), the compiler gets confused and does an -- infinite recursion. elsif (Needs_No_Actuals (Nam) or else Needs_One_Actual (Nam)) and then ((Is_Array_Type (Etype (Nam)) and then Covers (Typ, Component_Type (Etype (Nam)))) or else (Is_Access_Type (Etype (Nam)) and then Is_Array_Type (Designated_Type (Etype (Nam))) and then Covers (Typ, Component_Type (Designated_Type (Etype (Nam)))) and then not Is_Intrinsic_Subprogram (Entity (Subp)))) then declare Index_Node : Node_Id; New_Subp : Node_Id; Ret_Type : constant Entity_Id := Etype (Nam); begin if Is_Access_Type (Ret_Type) and then Ret_Type = Component_Type (Designated_Type (Ret_Type)) then Error_Msg_N ("cannot disambiguate function call and indexing", N); else New_Subp := Relocate_Node (Subp); -- The called entity may be an explicit dereference, in which -- case there is no entity to set. if Nkind (New_Subp) /= N_Explicit_Dereference then Set_Entity (Subp, Nam); end if; if (Is_Array_Type (Ret_Type) and then Component_Type (Ret_Type) /= Any_Type) or else (Is_Access_Type (Ret_Type) and then Component_Type (Designated_Type (Ret_Type)) /= Any_Type) then if Needs_No_Actuals (Nam) then -- Indexed call to a parameterless function Index_Node := Make_Indexed_Component (Loc, Prefix => Make_Function_Call (Loc, Name => New_Subp), Expressions => Parameter_Associations (N)); else -- An Ada 2005 prefixed call to a primitive operation -- whose first parameter is the prefix. This prefix was -- prepended to the parameter list, which is actually a -- list of indexes. Remove the prefix in order to build -- the proper indexed component. Index_Node := Make_Indexed_Component (Loc, Prefix => Make_Function_Call (Loc, Name => New_Subp, Parameter_Associations => New_List (Remove_Head (Parameter_Associations (N)))), Expressions => Parameter_Associations (N)); end if; -- Preserve the parenthesis count of the node Set_Paren_Count (Index_Node, Paren_Count (N)); -- Since we are correcting a node classification error made -- by the parser, we call Replace rather than Rewrite. Replace (N, Index_Node); Set_Etype (Prefix (N), Ret_Type); Set_Etype (N, Typ); Resolve_Indexed_Component (N, Typ); Check_Elab_Call (Prefix (N)); end if; end if; return; end; else -- If the called function is not declared in the main unit and it -- returns the limited view of type then use the available view (as -- is done in Try_Object_Operation) to prevent back-end confusion; -- the call must appear in a context where the nonlimited view is -- available. If the called function is in the extended main unit -- then no action is needed, because the back end handles this case. if not In_Extended_Main_Code_Unit (Nam) and then From_Limited_With (Etype (Nam)) then Set_Etype (Nam, Available_View (Etype (Nam))); end if; Set_Etype (N, Etype (Nam)); end if; -- In the case where the call is to an overloaded subprogram, Analyze -- calls Normalize_Actuals once per overloaded subprogram. Therefore in -- such a case Normalize_Actuals needs to be called once more to order -- the actuals correctly. Otherwise the call will have the ordering -- given by the last overloaded subprogram whether this is the correct -- one being called or not. if Is_Overloaded (Subp) then Normalize_Actuals (N, Nam, False, Norm_OK); pragma Assert (Norm_OK); end if; -- In any case, call is fully resolved now. Reset Overload flag, to -- prevent subsequent overload resolution if node is analyzed again Set_Is_Overloaded (Subp, False); Set_Is_Overloaded (N, False); -- A Ghost entity must appear in a specific context if Is_Ghost_Entity (Nam) and then Comes_From_Source (N) then Check_Ghost_Context (Nam, N); end if; -- If we are calling the current subprogram from immediately within its -- body, then that is the case where we can sometimes detect cases of -- infinite recursion statically. Do not try this in case restriction -- No_Recursion is in effect anyway, and do it only for source calls. if Comes_From_Source (N) then Scop := Current_Scope; -- Check violation of SPARK_05 restriction which does not permit -- a subprogram body to contain a call to the subprogram directly. if Restriction_Check_Required (SPARK_05) and then Same_Or_Aliased_Subprograms (Nam, Scop) then Check_SPARK_05_Restriction ("subprogram may not contain direct call to itself", N); end if; -- Issue warning for possible infinite recursion in the absence -- of the No_Recursion restriction. if Same_Or_Aliased_Subprograms (Nam, Scop) and then not Restriction_Active (No_Recursion) and then Check_Infinite_Recursion (N) then -- Here we detected and flagged an infinite recursion, so we do -- not need to test the case below for further warnings. Also we -- are all done if we now have a raise SE node. if Nkind (N) = N_Raise_Storage_Error then return; end if; -- If call is to immediately containing subprogram, then check for -- the case of a possible run-time detectable infinite recursion. else Scope_Loop : while Scop /= Standard_Standard loop if Same_Or_Aliased_Subprograms (Nam, Scop) then -- Although in general case, recursion is not statically -- checkable, the case of calling an immediately containing -- subprogram is easy to catch. Check_Restriction (No_Recursion, N); -- If the recursive call is to a parameterless subprogram, -- then even if we can't statically detect infinite -- recursion, this is pretty suspicious, and we output a -- warning. Furthermore, we will try later to detect some -- cases here at run time by expanding checking code (see -- Detect_Infinite_Recursion in package Exp_Ch6). -- If the recursive call is within a handler, do not emit a -- warning, because this is a common idiom: loop until input -- is correct, catch illegal input in handler and restart. if No (First_Formal (Nam)) and then Etype (Nam) = Standard_Void_Type and then not Error_Posted (N) and then Nkind (Parent (N)) /= N_Exception_Handler then -- For the case of a procedure call. We give the message -- only if the call is the first statement in a sequence -- of statements, or if all previous statements are -- simple assignments. This is simply a heuristic to -- decrease false positives, without losing too many good -- warnings. The idea is that these previous statements -- may affect global variables the procedure depends on. -- We also exclude raise statements, that may arise from -- constraint checks and are probably unrelated to the -- intended control flow. if Nkind (N) = N_Procedure_Call_Statement and then Is_List_Member (N) then declare P : Node_Id; begin P := Prev (N); while Present (P) loop if not Nkind_In (P, N_Assignment_Statement, N_Raise_Constraint_Error) then exit Scope_Loop; end if; Prev (P); end loop; end; end if; -- Do not give warning if we are in a conditional context declare K : constant Node_Kind := Nkind (Parent (N)); begin if (K = N_Loop_Statement and then Present (Iteration_Scheme (Parent (N)))) or else K = N_If_Statement or else K = N_Elsif_Part or else K = N_Case_Statement_Alternative then exit Scope_Loop; end if; end; -- Here warning is to be issued Set_Has_Recursive_Call (Nam); Error_Msg_Warn := SPARK_Mode /= On; Error_Msg_N ("possible infinite recursion<<!", N); Error_Msg_N ("\Storage_Error ]<<!", N); end if; exit Scope_Loop; end if; Scop := Scope (Scop); end loop Scope_Loop; end if; end if; -- Check obsolescent reference to Ada.Characters.Handling subprogram Check_Obsolescent_2005_Entity (Nam, Subp); -- If subprogram name is a predefined operator, it was given in -- functional notation. Replace call node with operator node, so -- that actuals can be resolved appropriately. if Is_Predefined_Op (Nam) or else Ekind (Nam) = E_Operator then Make_Call_Into_Operator (N, Typ, Entity (Name (N))); return; elsif Present (Alias (Nam)) and then Is_Predefined_Op (Alias (Nam)) then Resolve_Actuals (N, Nam); Make_Call_Into_Operator (N, Typ, Alias (Nam)); return; end if; -- Create a transient scope if the resulting type requires it -- There are several notable exceptions: -- a) In init procs, the transient scope overhead is not needed, and is -- even incorrect when the call is a nested initialization call for a -- component whose expansion may generate adjust calls. However, if the -- call is some other procedure call within an initialization procedure -- (for example a call to Create_Task in the init_proc of the task -- run-time record) a transient scope must be created around this call. -- b) Enumeration literal pseudo-calls need no transient scope -- c) Intrinsic subprograms (Unchecked_Conversion and source info -- functions) do not use the secondary stack even though the return -- type may be unconstrained. -- d) Calls to a build-in-place function, since such functions may -- allocate their result directly in a target object, and cases where -- the result does get allocated in the secondary stack are checked for -- within the specialized Exp_Ch6 procedures for expanding those -- build-in-place calls. -- e) Calls to inlinable expression functions do not use the secondary -- stack (since the call will be replaced by its returned object). -- f) If the subprogram is marked Inline_Always, then even if it returns -- an unconstrained type the call does not require use of the secondary -- stack. However, inlining will only take place if the body to inline -- is already present. It may not be available if e.g. the subprogram is -- declared in a child instance. -- If this is an initialization call for a type whose construction -- uses the secondary stack, and it is not a nested call to initialize -- a component, we do need to create a transient scope for it. We -- check for this by traversing the type in Check_Initialization_Call. if Is_Inlined (Nam) and then Has_Pragma_Inline (Nam) and then Nkind (Unit_Declaration_Node (Nam)) = N_Subprogram_Declaration and then Present (Body_To_Inline (Unit_Declaration_Node (Nam))) then null; elsif Ekind (Nam) = E_Enumeration_Literal or else Is_Build_In_Place_Function (Nam) or else Is_Intrinsic_Subprogram (Nam) or else Is_Inlinable_Expression_Function (Nam) then null; elsif Expander_Active and then Is_Type (Etype (Nam)) and then Requires_Transient_Scope (Etype (Nam)) and then (not Within_Init_Proc or else (not Is_Init_Proc (Nam) and then Ekind (Nam) /= E_Function)) then Establish_Transient_Scope (N, Sec_Stack => True); -- If the call appears within the bounds of a loop, it will -- be rewritten and reanalyzed, nothing left to do here. if Nkind (N) /= N_Function_Call then return; end if; elsif Is_Init_Proc (Nam) and then not Within_Init_Proc then Check_Initialization_Call (N, Nam); end if; -- A protected function cannot be called within the definition of the -- enclosing protected type, unless it is part of a pre/postcondition -- on another protected operation. This may appear in the entry wrapper -- created for an entry with preconditions. if Is_Protected_Type (Scope (Nam)) and then In_Open_Scopes (Scope (Nam)) and then not Has_Completion (Scope (Nam)) and then not In_Spec_Expression and then not Is_Entry_Wrapper (Current_Scope) then Error_Msg_NE ("& cannot be called before end of protected definition", N, Nam); end if; -- Propagate interpretation to actuals, and add default expressions -- where needed. if Present (First_Formal (Nam)) then Resolve_Actuals (N, Nam); -- Overloaded literals are rewritten as function calls, for purpose of -- resolution. After resolution, we can replace the call with the -- literal itself. elsif Ekind (Nam) = E_Enumeration_Literal then Copy_Node (Subp, N); Resolve_Entity_Name (N, Typ); -- Avoid validation, since it is a static function call Generate_Reference (Nam, Subp); return; end if; -- If the subprogram is not global, then kill all saved values and -- checks. This is a bit conservative, since in many cases we could do -- better, but it is not worth the effort. Similarly, we kill constant -- values. However we do not need to do this for internal entities -- (unless they are inherited user-defined subprograms), since they -- are not in the business of molesting local values. -- If the flag Suppress_Value_Tracking_On_Calls is set, then we also -- kill all checks and values for calls to global subprograms. This -- takes care of the case where an access to a local subprogram is -- taken, and could be passed directly or indirectly and then called -- from almost any context. -- Note: we do not do this step till after resolving the actuals. That -- way we still take advantage of the current value information while -- scanning the actuals. -- We suppress killing values if we are processing the nodes associated -- with N_Freeze_Entity nodes. Otherwise the declaration of a tagged -- type kills all the values as part of analyzing the code that -- initializes the dispatch tables. if Inside_Freezing_Actions = 0 and then (not Is_Library_Level_Entity (Nam) or else Suppress_Value_Tracking_On_Call (Nearest_Dynamic_Scope (Current_Scope))) and then (Comes_From_Source (Nam) or else (Present (Alias (Nam)) and then Comes_From_Source (Alias (Nam)))) then Kill_Current_Values; end if; -- If we are warning about unread OUT parameters, this is the place to -- set Last_Assignment for OUT and IN OUT parameters. We have to do this -- after the above call to Kill_Current_Values (since that call clears -- the Last_Assignment field of all local variables). if (Warn_On_Modified_Unread or Warn_On_All_Unread_Out_Parameters) and then Comes_From_Source (N) and then In_Extended_Main_Source_Unit (N) then declare F : Entity_Id; A : Node_Id; begin F := First_Formal (Nam); A := First_Actual (N); while Present (F) and then Present (A) loop if Ekind_In (F, E_Out_Parameter, E_In_Out_Parameter) and then Warn_On_Modified_As_Out_Parameter (F) and then Is_Entity_Name (A) and then Present (Entity (A)) and then Comes_From_Source (N) and then Safe_To_Capture_Value (N, Entity (A)) then Set_Last_Assignment (Entity (A), A); end if; Next_Formal (F); Next_Actual (A); end loop; end; end if; -- If the subprogram is a primitive operation, check whether or not -- it is a correct dispatching call. if Is_Overloadable (Nam) and then Is_Dispatching_Operation (Nam) then Check_Dispatching_Call (N); elsif Ekind (Nam) /= E_Subprogram_Type and then Is_Abstract_Subprogram (Nam) and then not In_Instance then Error_Msg_NE ("cannot call abstract subprogram &!", N, Nam); end if; -- If this is a dispatching call, generate the appropriate reference, -- for better source navigation in GPS. if Is_Overloadable (Nam) and then Present (Controlling_Argument (N)) then Generate_Reference (Nam, Subp, 'R'); -- Normal case, not a dispatching call: generate a call reference else Generate_Reference (Nam, Subp, 's'); end if; if Is_Intrinsic_Subprogram (Nam) then Check_Intrinsic_Call (N); end if; -- Check for violation of restriction No_Specific_Termination_Handlers -- and warn on a potentially blocking call to Abort_Task. if Restriction_Check_Required (No_Specific_Termination_Handlers) and then (Is_RTE (Nam, RE_Set_Specific_Handler) or else Is_RTE (Nam, RE_Specific_Handler)) then Check_Restriction (No_Specific_Termination_Handlers, N); elsif Is_RTE (Nam, RE_Abort_Task) then Check_Potentially_Blocking_Operation (N); end if; -- A call to Ada.Real_Time.Timing_Events.Set_Handler to set a relative -- timing event violates restriction No_Relative_Delay (AI-0211). We -- need to check the second argument to determine whether it is an -- absolute or relative timing event. if Restriction_Check_Required (No_Relative_Delay) and then Is_RTE (Nam, RE_Set_Handler) and then Is_RTE (Etype (Next_Actual (First_Actual (N))), RE_Time_Span) then Check_Restriction (No_Relative_Delay, N); end if; -- Issue an error for a call to an eliminated subprogram. This routine -- will not perform the check if the call appears within a default -- expression. Check_For_Eliminated_Subprogram (Subp, Nam); -- In formal mode, the primitive operations of a tagged type or type -- extension do not include functions that return the tagged type. if Nkind (N) = N_Function_Call and then Is_Tagged_Type (Etype (N)) and then Is_Entity_Name (Name (N)) and then Is_Inherited_Operation_For_Type (Entity (Name (N)), Etype (N)) then Check_SPARK_05_Restriction ("function not inherited", N); end if; -- Implement rule in 12.5.1 (23.3/2): In an instance, if the actual is -- class-wide and the call dispatches on result in a context that does -- not provide a tag, the call raises Program_Error. if Nkind (N) = N_Function_Call and then In_Instance and then Is_Generic_Actual_Type (Typ) and then Is_Class_Wide_Type (Typ) and then Has_Controlling_Result (Nam) and then Nkind (Parent (N)) = N_Object_Declaration then -- Verify that none of the formals are controlling declare Call_OK : Boolean := False; F : Entity_Id; begin F := First_Formal (Nam); while Present (F) loop if Is_Controlling_Formal (F) then Call_OK := True; exit; end if; Next_Formal (F); end loop; if not Call_OK then Error_Msg_Warn := SPARK_Mode /= On; Error_Msg_N ("!cannot determine tag of result<<", N); Error_Msg_N ("\Program_Error [<<!", N); Insert_Action (N, Make_Raise_Program_Error (Sloc (N), Reason => PE_Explicit_Raise)); end if; end; end if; -- Check for calling a function with OUT or IN OUT parameter when the -- calling context (us right now) is not Ada 2012, so does not allow -- OUT or IN OUT parameters in function calls. Functions declared in -- a predefined unit are OK, as they may be called indirectly from a -- user-declared instantiation. if Ada_Version < Ada_2012 and then Ekind (Nam) = E_Function and then Has_Out_Or_In_Out_Parameter (Nam) and then not In_Predefined_Unit (Nam) then Error_Msg_NE ("& has at least one OUT or `IN OUT` parameter", N, Nam); Error_Msg_N ("\call to this function only allowed in Ada 2012", N); end if; -- Check the dimensions of the actuals in the call. For function calls, -- propagate the dimensions from the returned type to N. Analyze_Dimension_Call (N, Nam); -- All done, evaluate call and deal with elaboration issues Eval_Call (N); Check_Elab_Call (N); -- In GNATprove mode, expansion is disabled, but we want to inline some -- subprograms to facilitate formal verification. Indirect calls through -- a subprogram type or within a generic cannot be inlined. Inlining is -- performed only for calls subject to SPARK_Mode on. if GNATprove_Mode and then SPARK_Mode = On and then Is_Overloadable (Nam) and then not Inside_A_Generic then Nam_UA := Ultimate_Alias (Nam); Nam_Decl := Unit_Declaration_Node (Nam_UA); if Nkind (Nam_Decl) = N_Subprogram_Declaration then Body_Id := Corresponding_Body (Nam_Decl); -- Nothing to do if the subprogram is not eligible for inlining in -- GNATprove mode. if not Is_Inlined_Always (Nam_UA) or else not Can_Be_Inlined_In_GNATprove_Mode (Nam_UA, Body_Id) then null; -- Calls cannot be inlined inside assertions, as GNATprove treats -- assertions as logic expressions. elsif In_Assertion_Expr /= 0 then Cannot_Inline ("cannot inline & (in assertion expression)?", N, Nam_UA); -- Calls cannot be inlined inside default expressions elsif In_Default_Expr then Cannot_Inline ("cannot inline & (in default expression)?", N, Nam_UA); -- Inlining should not be performed during pre-analysis elsif Full_Analysis then -- With the one-pass inlining technique, a call cannot be -- inlined if the corresponding body has not been seen yet. if No (Body_Id) then Cannot_Inline ("cannot inline & (body not seen yet)?", N, Nam_UA); -- Nothing to do if there is no body to inline, indicating that -- the subprogram is not suitable for inlining in GNATprove -- mode. elsif No (Body_To_Inline (Nam_Decl)) then null; -- Do not inline calls inside expression functions, as this -- would prevent interpreting them as logical formulas in -- GNATprove. elsif Present (Current_Subprogram) and then Is_Expression_Function_Or_Completion (Current_Subprogram) then Cannot_Inline ("cannot inline & (inside expression function)?", N, Nam_UA); -- Calls cannot be inlined inside potentially unevaluated -- expressions, as this would create complex actions inside -- expressions, that are not handled by GNATprove. elsif Is_Potentially_Unevaluated (N) then Cannot_Inline ("cannot inline & (in potentially unevaluated context)?", N, Nam_UA); -- Do not inline calls which would possibly lead to missing a -- type conversion check on an input parameter. elsif not Call_Can_Be_Inlined_In_GNATprove_Mode (N, Nam) then Cannot_Inline ("cannot inline & (possible check on input parameters)?", N, Nam_UA); -- Otherwise, inline the call else Expand_Inlined_Call (N, Nam_UA, Nam); end if; end if; end if; end if; Warn_On_Overlapping_Actuals (Nam, N); end Resolve_Call; ----------------------------- -- Resolve_Case_Expression -- ----------------------------- procedure Resolve_Case_Expression (N : Node_Id; Typ : Entity_Id) is Alt : Node_Id; Alt_Expr : Node_Id; Alt_Typ : Entity_Id; Is_Dyn : Boolean; begin Alt := First (Alternatives (N)); while Present (Alt) loop Alt_Expr := Expression (Alt); Resolve (Alt_Expr, Typ); Alt_Typ := Etype (Alt_Expr); -- When the expression is of a scalar subtype different from the -- result subtype, then insert a conversion to ensure the generation -- of a constraint check. if Is_Scalar_Type (Alt_Typ) and then Alt_Typ /= Typ then Rewrite (Alt_Expr, Convert_To (Typ, Alt_Expr)); Analyze_And_Resolve (Alt_Expr, Typ); end if; Next (Alt); end loop; -- Apply RM 4.5.7 (17/3): whether the expression is statically or -- dynamically tagged must be known statically. if Is_Tagged_Type (Typ) and then not Is_Class_Wide_Type (Typ) then Alt := First (Alternatives (N)); Is_Dyn := Is_Dynamically_Tagged (Expression (Alt)); while Present (Alt) loop if Is_Dynamically_Tagged (Expression (Alt)) /= Is_Dyn then Error_Msg_N ("all or none of the dependent expressions can be " & "dynamically tagged", N); end if; Next (Alt); end loop; end if; Set_Etype (N, Typ); Eval_Case_Expression (N); end Resolve_Case_Expression; ------------------------------- -- Resolve_Character_Literal -- ------------------------------- procedure Resolve_Character_Literal (N : Node_Id; Typ : Entity_Id) is B_Typ : constant Entity_Id := Base_Type (Typ); C : Entity_Id; begin -- Verify that the character does belong to the type of the context Set_Etype (N, B_Typ); Eval_Character_Literal (N); -- Wide_Wide_Character literals must always be defined, since the set -- of wide wide character literals is complete, i.e. if a character -- literal is accepted by the parser, then it is OK for wide wide -- character (out of range character literals are rejected). if Root_Type (B_Typ) = Standard_Wide_Wide_Character then return; -- Always accept character literal for type Any_Character, which -- occurs in error situations and in comparisons of literals, both -- of which should accept all literals. elsif B_Typ = Any_Character then return; -- For Standard.Character or a type derived from it, check that the -- literal is in range. elsif Root_Type (B_Typ) = Standard_Character then if In_Character_Range (UI_To_CC (Char_Literal_Value (N))) then return; end if; -- For Standard.Wide_Character or a type derived from it, check that the -- literal is in range. elsif Root_Type (B_Typ) = Standard_Wide_Character then if In_Wide_Character_Range (UI_To_CC (Char_Literal_Value (N))) then return; end if; -- For Standard.Wide_Wide_Character or a type derived from it, we -- know the literal is in range, since the parser checked. elsif Root_Type (B_Typ) = Standard_Wide_Wide_Character then return; -- If the entity is already set, this has already been resolved in a -- generic context, or comes from expansion. Nothing else to do. elsif Present (Entity (N)) then return; -- Otherwise we have a user defined character type, and we can use the -- standard visibility mechanisms to locate the referenced entity. else C := Current_Entity (N); while Present (C) loop if Etype (C) = B_Typ then Set_Entity_With_Checks (N, C); Generate_Reference (C, N); return; end if; C := Homonym (C); end loop; end if; -- If we fall through, then the literal does not match any of the -- entries of the enumeration type. This isn't just a constraint error -- situation, it is an illegality (see RM 4.2). Error_Msg_NE ("character not defined for }", N, First_Subtype (B_Typ)); end Resolve_Character_Literal; --------------------------- -- Resolve_Comparison_Op -- --------------------------- -- Context requires a boolean type, and plays no role in resolution. -- Processing identical to that for equality operators. The result type is -- the base type, which matters when pathological subtypes of booleans with -- limited ranges are used. procedure Resolve_Comparison_Op (N : Node_Id; Typ : Entity_Id) is L : constant Node_Id := Left_Opnd (N); R : constant Node_Id := Right_Opnd (N); T : Entity_Id; begin -- If this is an intrinsic operation which is not predefined, use the -- types of its declared arguments to resolve the possibly overloaded -- operands. Otherwise the operands are unambiguous and specify the -- expected type. if Scope (Entity (N)) /= Standard_Standard then T := Etype (First_Entity (Entity (N))); else T := Find_Unique_Type (L, R); if T = Any_Fixed then T := Unique_Fixed_Point_Type (L); end if; end if; Set_Etype (N, Base_Type (Typ)); Generate_Reference (T, N, ' '); -- Skip remaining processing if already set to Any_Type if T = Any_Type then return; end if; -- Deal with other error cases if T = Any_String or else T = Any_Composite or else T = Any_Character then if T = Any_Character then Ambiguous_Character (L); else Error_Msg_N ("ambiguous operands for comparison", N); end if; Set_Etype (N, Any_Type); return; end if; -- Resolve the operands if types OK Resolve (L, T); Resolve (R, T); Check_Unset_Reference (L); Check_Unset_Reference (R); Generate_Operator_Reference (N, T); Check_Low_Bound_Tested (N); -- In SPARK, ordering operators <, <=, >, >= are not defined for Boolean -- types or array types except String. if Is_Boolean_Type (T) then Check_SPARK_05_Restriction ("comparison is not defined on Boolean type", N); elsif Is_Array_Type (T) and then Base_Type (T) /= Standard_String then Check_SPARK_05_Restriction ("comparison is not defined on array types other than String", N); end if; -- Check comparison on unordered enumeration if Bad_Unordered_Enumeration_Reference (N, Etype (L)) then Error_Msg_Sloc := Sloc (Etype (L)); Error_Msg_NE ("comparison on unordered enumeration type& declared#?U?", N, Etype (L)); end if; -- Evaluate the relation (note we do this after the above check since -- this Eval call may change N to True/False. Analyze_Dimension (N); Eval_Relational_Op (N); end Resolve_Comparison_Op; ----------------------------------------- -- Resolve_Discrete_Subtype_Indication -- ----------------------------------------- procedure Resolve_Discrete_Subtype_Indication (N : Node_Id; Typ : Entity_Id) is R : Node_Id; S : Entity_Id; begin Analyze (Subtype_Mark (N)); S := Entity (Subtype_Mark (N)); if Nkind (Constraint (N)) /= N_Range_Constraint then Error_Msg_N ("expect range constraint for discrete type", N); Set_Etype (N, Any_Type); else R := Range_Expression (Constraint (N)); if R = Error then return; end if; Analyze (R); if Base_Type (S) /= Base_Type (Typ) then Error_Msg_NE ("expect subtype of }", N, First_Subtype (Typ)); -- Rewrite the constraint as a range of Typ -- to allow compilation to proceed further. Set_Etype (N, Typ); Rewrite (Low_Bound (R), Make_Attribute_Reference (Sloc (Low_Bound (R)), Prefix => New_Occurrence_Of (Typ, Sloc (R)), Attribute_Name => Name_First)); Rewrite (High_Bound (R), Make_Attribute_Reference (Sloc (High_Bound (R)), Prefix => New_Occurrence_Of (Typ, Sloc (R)), Attribute_Name => Name_First)); else Resolve (R, Typ); Set_Etype (N, Etype (R)); -- Additionally, we must check that the bounds are compatible -- with the given subtype, which might be different from the -- type of the context. Apply_Range_Check (R, S); -- ??? If the above check statically detects a Constraint_Error -- it replaces the offending bound(s) of the range R with a -- Constraint_Error node. When the itype which uses these bounds -- is frozen the resulting call to Duplicate_Subexpr generates -- a new temporary for the bounds. -- Unfortunately there are other itypes that are also made depend -- on these bounds, so when Duplicate_Subexpr is called they get -- a forward reference to the newly created temporaries and Gigi -- aborts on such forward references. This is probably sign of a -- more fundamental problem somewhere else in either the order of -- itype freezing or the way certain itypes are constructed. -- To get around this problem we call Remove_Side_Effects right -- away if either bounds of R are a Constraint_Error. declare L : constant Node_Id := Low_Bound (R); H : constant Node_Id := High_Bound (R); begin if Nkind (L) = N_Raise_Constraint_Error then Remove_Side_Effects (L); end if; if Nkind (H) = N_Raise_Constraint_Error then Remove_Side_Effects (H); end if; end; Check_Unset_Reference (Low_Bound (R)); Check_Unset_Reference (High_Bound (R)); end if; end if; end Resolve_Discrete_Subtype_Indication; ------------------------- -- Resolve_Entity_Name -- ------------------------- -- Used to resolve identifiers and expanded names procedure Resolve_Entity_Name (N : Node_Id; Typ : Entity_Id) is function Is_Assignment_Or_Object_Expression (Context : Node_Id; Expr : Node_Id) return Boolean; -- Determine whether node Context denotes an assignment statement or an -- object declaration whose expression is node Expr. ---------------------------------------- -- Is_Assignment_Or_Object_Expression -- ---------------------------------------- function Is_Assignment_Or_Object_Expression (Context : Node_Id; Expr : Node_Id) return Boolean is begin if Nkind_In (Context, N_Assignment_Statement, N_Object_Declaration) and then Expression (Context) = Expr then return True; -- Check whether a construct that yields a name is the expression of -- an assignment statement or an object declaration. elsif (Nkind_In (Context, N_Attribute_Reference, N_Explicit_Dereference, N_Indexed_Component, N_Selected_Component, N_Slice) and then Prefix (Context) = Expr) or else (Nkind_In (Context, N_Type_Conversion, N_Unchecked_Type_Conversion) and then Expression (Context) = Expr) then return Is_Assignment_Or_Object_Expression (Context => Parent (Context), Expr => Context); -- Otherwise the context is not an assignment statement or an object -- declaration. else return False; end if; end Is_Assignment_Or_Object_Expression; -- Local variables E : constant Entity_Id := Entity (N); Par : Node_Id; -- Start of processing for Resolve_Entity_Name begin -- If garbage from errors, set to Any_Type and return if No (E) and then Total_Errors_Detected /= 0 then Set_Etype (N, Any_Type); return; end if; -- Replace named numbers by corresponding literals. Note that this is -- the one case where Resolve_Entity_Name must reset the Etype, since -- it is currently marked as universal. if Ekind (E) = E_Named_Integer then Set_Etype (N, Typ); Eval_Named_Integer (N); elsif Ekind (E) = E_Named_Real then Set_Etype (N, Typ); Eval_Named_Real (N); -- For enumeration literals, we need to make sure that a proper style -- check is done, since such literals are overloaded, and thus we did -- not do a style check during the first phase of analysis. elsif Ekind (E) = E_Enumeration_Literal then Set_Entity_With_Checks (N, E); Eval_Entity_Name (N); -- Case of (sub)type name appearing in a context where an expression -- is expected. This is legal if occurrence is a current instance. -- See RM 8.6 (17/3). elsif Is_Type (E) then if Is_Current_Instance (N) then null; -- Any other use is an error else Error_Msg_N ("invalid use of subtype mark in expression or call", N); end if; -- Check discriminant use if entity is discriminant in current scope, -- i.e. discriminant of record or concurrent type currently being -- analyzed. Uses in corresponding body are unrestricted. elsif Ekind (E) = E_Discriminant and then Scope (E) = Current_Scope and then not Has_Completion (Current_Scope) then Check_Discriminant_Use (N); -- A parameterless generic function cannot appear in a context that -- requires resolution. elsif Ekind (E) = E_Generic_Function then Error_Msg_N ("illegal use of generic function", N); -- In Ada 83 an OUT parameter cannot be read elsif Ekind (E) = E_Out_Parameter and then (Nkind (Parent (N)) in N_Op or else Nkind (Parent (N)) = N_Explicit_Dereference or else Is_Assignment_Or_Object_Expression (Context => Parent (N), Expr => N)) then if Ada_Version = Ada_83 then Error_Msg_N ("(Ada 83) illegal reading of out parameter", N); end if; -- In all other cases, just do the possible static evaluation else -- A deferred constant that appears in an expression must have a -- completion, unless it has been removed by in-place expansion of -- an aggregate. A constant that is a renaming does not need -- initialization. if Ekind (E) = E_Constant and then Comes_From_Source (E) and then No (Constant_Value (E)) and then Is_Frozen (Etype (E)) and then not In_Spec_Expression and then not Is_Imported (E) and then Nkind (Parent (E)) /= N_Object_Renaming_Declaration then if No_Initialization (Parent (E)) or else (Present (Full_View (E)) and then No_Initialization (Parent (Full_View (E)))) then null; else Error_Msg_N ("deferred constant is frozen before completion", N); end if; end if; Eval_Entity_Name (N); end if; Par := Parent (N); -- When the entity appears in a parameter association, retrieve the -- related subprogram call. if Nkind (Par) = N_Parameter_Association then Par := Parent (Par); end if; if Comes_From_Source (N) then -- The following checks are only relevant when SPARK_Mode is on as -- they are not standard Ada legality rules. if SPARK_Mode = On then -- An effectively volatile object subject to enabled properties -- Async_Writers or Effective_Reads must appear in non-interfering -- context (SPARK RM 7.1.3(12)). if Is_Object (E) and then Is_Effectively_Volatile (E) and then (Async_Writers_Enabled (E) or else Effective_Reads_Enabled (E)) and then not Is_OK_Volatile_Context (Par, N) then SPARK_Msg_N ("volatile object cannot appear in this context " & "(SPARK RM 7.1.3(12))", N); end if; -- Check for possible elaboration issues with respect to reads of -- variables. The act of renaming the variable is not considered a -- read as it simply establishes an alias. if Ekind (E) = E_Variable and then Dynamic_Elaboration_Checks and then Nkind (Par) /= N_Object_Renaming_Declaration then Check_Elab_Call (N); end if; -- The variable may eventually become a constituent of a single -- protected/task type. Record the reference now and verify its -- legality when analyzing the contract of the variable -- (SPARK RM 9.3). if Ekind (E) = E_Variable then Record_Possible_Part_Of_Reference (E, N); end if; end if; -- A Ghost entity must appear in a specific context if Is_Ghost_Entity (E) then Check_Ghost_Context (E, N); end if; end if; end Resolve_Entity_Name; ------------------- -- Resolve_Entry -- ------------------- procedure Resolve_Entry (Entry_Name : Node_Id) is Loc : constant Source_Ptr := Sloc (Entry_Name); Nam : Entity_Id; New_N : Node_Id; S : Entity_Id; Tsk : Entity_Id; E_Name : Node_Id; Index : Node_Id; function Actual_Index_Type (E : Entity_Id) return Entity_Id; -- If the bounds of the entry family being called depend on task -- discriminants, build a new index subtype where a discriminant is -- replaced with the value of the discriminant of the target task. -- The target task is the prefix of the entry name in the call. ----------------------- -- Actual_Index_Type -- ----------------------- function Actual_Index_Type (E : Entity_Id) return Entity_Id is Typ : constant Entity_Id := Entry_Index_Type (E); Tsk : constant Entity_Id := Scope (E); Lo : constant Node_Id := Type_Low_Bound (Typ); Hi : constant Node_Id := Type_High_Bound (Typ); New_T : Entity_Id; function Actual_Discriminant_Ref (Bound : Node_Id) return Node_Id; -- If the bound is given by a discriminant, replace with a reference -- to the discriminant of the same name in the target task. If the -- entry name is the target of a requeue statement and the entry is -- in the current protected object, the bound to be used is the -- discriminal of the object (see Apply_Range_Checks for details of -- the transformation). ----------------------------- -- Actual_Discriminant_Ref -- ----------------------------- function Actual_Discriminant_Ref (Bound : Node_Id) return Node_Id is Typ : constant Entity_Id := Etype (Bound); Ref : Node_Id; begin Remove_Side_Effects (Bound); if not Is_Entity_Name (Bound) or else Ekind (Entity (Bound)) /= E_Discriminant then return Bound; elsif Is_Protected_Type (Tsk) and then In_Open_Scopes (Tsk) and then Nkind (Parent (Entry_Name)) = N_Requeue_Statement then -- Note: here Bound denotes a discriminant of the corresponding -- record type tskV, whose discriminal is a formal of the -- init-proc tskVIP. What we want is the body discriminal, -- which is associated to the discriminant of the original -- concurrent type tsk. return New_Occurrence_Of (Find_Body_Discriminal (Entity (Bound)), Loc); else Ref := Make_Selected_Component (Loc, Prefix => New_Copy_Tree (Prefix (Prefix (Entry_Name))), Selector_Name => New_Occurrence_Of (Entity (Bound), Loc)); Analyze (Ref); Resolve (Ref, Typ); return Ref; end if; end Actual_Discriminant_Ref; -- Start of processing for Actual_Index_Type begin if not Has_Discriminants (Tsk) or else (not Is_Entity_Name (Lo) and then not Is_Entity_Name (Hi)) then return Entry_Index_Type (E); else New_T := Create_Itype (Ekind (Typ), Parent (Entry_Name)); Set_Etype (New_T, Base_Type (Typ)); Set_Size_Info (New_T, Typ); Set_RM_Size (New_T, RM_Size (Typ)); Set_Scalar_Range (New_T, Make_Range (Sloc (Entry_Name), Low_Bound => Actual_Discriminant_Ref (Lo), High_Bound => Actual_Discriminant_Ref (Hi))); return New_T; end if; end Actual_Index_Type; -- Start of processing for Resolve_Entry begin -- Find name of entry being called, and resolve prefix of name with its -- own type. The prefix can be overloaded, and the name and signature of -- the entry must be taken into account. if Nkind (Entry_Name) = N_Indexed_Component then -- Case of dealing with entry family within the current tasks E_Name := Prefix (Entry_Name); else E_Name := Entry_Name; end if; if Is_Entity_Name (E_Name) then -- Entry call to an entry (or entry family) in the current task. This -- is legal even though the task will deadlock. Rewrite as call to -- current task. -- This can also be a call to an entry in an enclosing task. If this -- is a single task, we have to retrieve its name, because the scope -- of the entry is the task type, not the object. If the enclosing -- task is a task type, the identity of the task is given by its own -- self variable. -- Finally this can be a requeue on an entry of the same task or -- protected object. S := Scope (Entity (E_Name)); for J in reverse 0 .. Scope_Stack.Last loop if Is_Task_Type (Scope_Stack.Table (J).Entity) and then not Comes_From_Source (S) then -- S is an enclosing task or protected object. The concurrent -- declaration has been converted into a type declaration, and -- the object itself has an object declaration that follows -- the type in the same declarative part. Tsk := Next_Entity (S); while Etype (Tsk) /= S loop Next_Entity (Tsk); end loop; S := Tsk; exit; elsif S = Scope_Stack.Table (J).Entity then -- Call to current task. Will be transformed into call to Self exit; end if; end loop; New_N := Make_Selected_Component (Loc, Prefix => New_Occurrence_Of (S, Loc), Selector_Name => New_Occurrence_Of (Entity (E_Name), Loc)); Rewrite (E_Name, New_N); Analyze (E_Name); elsif Nkind (Entry_Name) = N_Selected_Component and then Is_Overloaded (Prefix (Entry_Name)) then -- Use the entry name (which must be unique at this point) to find -- the prefix that returns the corresponding task/protected type. declare Pref : constant Node_Id := Prefix (Entry_Name); Ent : constant Entity_Id := Entity (Selector_Name (Entry_Name)); I : Interp_Index; It : Interp; begin Get_First_Interp (Pref, I, It); while Present (It.Typ) loop if Scope (Ent) = It.Typ then Set_Etype (Pref, It.Typ); exit; end if; Get_Next_Interp (I, It); end loop; end; end if; if Nkind (Entry_Name) = N_Selected_Component then Resolve (Prefix (Entry_Name)); else pragma Assert (Nkind (Entry_Name) = N_Indexed_Component); Nam := Entity (Selector_Name (Prefix (Entry_Name))); Resolve (Prefix (Prefix (Entry_Name))); Index := First (Expressions (Entry_Name)); Resolve (Index, Entry_Index_Type (Nam)); -- Up to this point the expression could have been the actual in a -- simple entry call, and be given by a named association. if Nkind (Index) = N_Parameter_Association then Error_Msg_N ("expect expression for entry index", Index); else Apply_Range_Check (Index, Actual_Index_Type (Nam)); end if; end if; end Resolve_Entry; ------------------------ -- Resolve_Entry_Call -- ------------------------ procedure Resolve_Entry_Call (N : Node_Id; Typ : Entity_Id) is Entry_Name : constant Node_Id := Name (N); Loc : constant Source_Ptr := Sloc (Entry_Name); Actuals : List_Id; First_Named : Node_Id; Nam : Entity_Id; Norm_OK : Boolean; Obj : Node_Id; Was_Over : Boolean; begin -- We kill all checks here, because it does not seem worth the effort to -- do anything better, an entry call is a big operation. Kill_All_Checks; -- Processing of the name is similar for entry calls and protected -- operation calls. Once the entity is determined, we can complete -- the resolution of the actuals. -- The selector may be overloaded, in the case of a protected object -- with overloaded functions. The type of the context is used for -- resolution. if Nkind (Entry_Name) = N_Selected_Component and then Is_Overloaded (Selector_Name (Entry_Name)) and then Typ /= Standard_Void_Type then declare I : Interp_Index; It : Interp; begin Get_First_Interp (Selector_Name (Entry_Name), I, It); while Present (It.Typ) loop if Covers (Typ, It.Typ) then Set_Entity (Selector_Name (Entry_Name), It.Nam); Set_Etype (Entry_Name, It.Typ); Generate_Reference (It.Typ, N, ' '); end if; Get_Next_Interp (I, It); end loop; end; end if; Resolve_Entry (Entry_Name); if Nkind (Entry_Name) = N_Selected_Component then -- Simple entry call Nam := Entity (Selector_Name (Entry_Name)); Obj := Prefix (Entry_Name); Was_Over := Is_Overloaded (Selector_Name (Entry_Name)); else pragma Assert (Nkind (Entry_Name) = N_Indexed_Component); -- Call to member of entry family Nam := Entity (Selector_Name (Prefix (Entry_Name))); Obj := Prefix (Prefix (Entry_Name)); Was_Over := Is_Overloaded (Selector_Name (Prefix (Entry_Name))); end if; -- We cannot in general check the maximum depth of protected entry calls -- at compile time. But we can tell that any protected entry call at all -- violates a specified nesting depth of zero. if Is_Protected_Type (Scope (Nam)) then Check_Restriction (Max_Entry_Queue_Length, N); end if; -- Use context type to disambiguate a protected function that can be -- called without actuals and that returns an array type, and where the -- argument list may be an indexing of the returned value. if Ekind (Nam) = E_Function and then Needs_No_Actuals (Nam) and then Present (Parameter_Associations (N)) and then ((Is_Array_Type (Etype (Nam)) and then Covers (Typ, Component_Type (Etype (Nam)))) or else (Is_Access_Type (Etype (Nam)) and then Is_Array_Type (Designated_Type (Etype (Nam))) and then Covers (Typ, Component_Type (Designated_Type (Etype (Nam)))))) then declare Index_Node : Node_Id; begin Index_Node := Make_Indexed_Component (Loc, Prefix => Make_Function_Call (Loc, Name => Relocate_Node (Entry_Name)), Expressions => Parameter_Associations (N)); -- Since we are correcting a node classification error made by the -- parser, we call Replace rather than Rewrite. Replace (N, Index_Node); Set_Etype (Prefix (N), Etype (Nam)); Set_Etype (N, Typ); Resolve_Indexed_Component (N, Typ); return; end; end if; if Ekind_In (Nam, E_Entry, E_Entry_Family) and then Present (Contract_Wrapper (Nam)) and then Current_Scope /= Contract_Wrapper (Nam) then -- Note the entity being called before rewriting the call, so that -- it appears used at this point. Generate_Reference (Nam, Entry_Name, 'r'); -- Rewrite as call to the precondition wrapper, adding the task -- object to the list of actuals. If the call is to a member of an -- entry family, include the index as well. declare New_Call : Node_Id; New_Actuals : List_Id; begin New_Actuals := New_List (Obj); if Nkind (Entry_Name) = N_Indexed_Component then Append_To (New_Actuals, New_Copy_Tree (First (Expressions (Entry_Name)))); end if; Append_List (Parameter_Associations (N), New_Actuals); New_Call := Make_Procedure_Call_Statement (Loc, Name => New_Occurrence_Of (Contract_Wrapper (Nam), Loc), Parameter_Associations => New_Actuals); Rewrite (N, New_Call); -- Preanalyze and resolve new call. Current procedure is called -- from Resolve_Call, after which expansion will take place. Preanalyze_And_Resolve (N); return; end; end if; -- The operation name may have been overloaded. Order the actuals -- according to the formals of the resolved entity, and set the return -- type to that of the operation. if Was_Over then Normalize_Actuals (N, Nam, False, Norm_OK); pragma Assert (Norm_OK); Set_Etype (N, Etype (Nam)); -- Reset the Is_Overloaded flag, since resolution is now completed -- Simple entry call if Nkind (Entry_Name) = N_Selected_Component then Set_Is_Overloaded (Selector_Name (Entry_Name), False); -- Call to a member of an entry family else pragma Assert (Nkind (Entry_Name) = N_Indexed_Component); Set_Is_Overloaded (Selector_Name (Prefix (Entry_Name)), False); end if; end if; Resolve_Actuals (N, Nam); Check_Internal_Protected_Use (N, Nam); -- Create a call reference to the entry Generate_Reference (Nam, Entry_Name, 's'); if Ekind_In (Nam, E_Entry, E_Entry_Family) then Check_Potentially_Blocking_Operation (N); end if; -- Verify that a procedure call cannot masquerade as an entry -- call where an entry call is expected. if Ekind (Nam) = E_Procedure then if Nkind (Parent (N)) = N_Entry_Call_Alternative and then N = Entry_Call_Statement (Parent (N)) then Error_Msg_N ("entry call required in select statement", N); elsif Nkind (Parent (N)) = N_Triggering_Alternative and then N = Triggering_Statement (Parent (N)) then Error_Msg_N ("triggering statement cannot be procedure call", N); elsif Ekind (Scope (Nam)) = E_Task_Type and then not In_Open_Scopes (Scope (Nam)) then Error_Msg_N ("task has no entry with this name", Entry_Name); end if; end if; -- After resolution, entry calls and protected procedure calls are -- changed into entry calls, for expansion. The structure of the node -- does not change, so it can safely be done in place. Protected -- function calls must keep their structure because they are -- subexpressions. if Ekind (Nam) /= E_Function then -- A protected operation that is not a function may modify the -- corresponding object, and cannot apply to a constant. If this -- is an internal call, the prefix is the type itself. if Is_Protected_Type (Scope (Nam)) and then not Is_Variable (Obj) and then (not Is_Entity_Name (Obj) or else not Is_Type (Entity (Obj))) then Error_Msg_N ("prefix of protected procedure or entry call must be variable", Entry_Name); end if; Actuals := Parameter_Associations (N); First_Named := First_Named_Actual (N); Rewrite (N, Make_Entry_Call_Statement (Loc, Name => Entry_Name, Parameter_Associations => Actuals)); Set_First_Named_Actual (N, First_Named); Set_Analyzed (N, True); -- Protected functions can return on the secondary stack, in which -- case we must trigger the transient scope mechanism. elsif Expander_Active and then Requires_Transient_Scope (Etype (Nam)) then Establish_Transient_Scope (N, Sec_Stack => True); end if; end Resolve_Entry_Call; ------------------------- -- Resolve_Equality_Op -- ------------------------- -- Both arguments must have the same type, and the boolean context does -- not participate in the resolution. The first pass verifies that the -- interpretation is not ambiguous, and the type of the left argument is -- correctly set, or is Any_Type in case of ambiguity. If both arguments -- are strings or aggregates, allocators, or Null, they are ambiguous even -- though they carry a single (universal) type. Diagnose this case here. procedure Resolve_Equality_Op (N : Node_Id; Typ : Entity_Id) is L : constant Node_Id := Left_Opnd (N); R : constant Node_Id := Right_Opnd (N); T : Entity_Id := Find_Unique_Type (L, R); procedure Check_If_Expression (Cond : Node_Id); -- The resolution rule for if expressions requires that each such must -- have a unique type. This means that if several dependent expressions -- are of a non-null anonymous access type, and the context does not -- impose an expected type (as can be the case in an equality operation) -- the expression must be rejected. procedure Explain_Redundancy (N : Node_Id); -- Attempt to explain the nature of a redundant comparison with True. If -- the expression N is too complex, this routine issues a general error -- message. function Find_Unique_Access_Type return Entity_Id; -- In the case of allocators and access attributes, the context must -- provide an indication of the specific access type to be used. If -- one operand is of such a "generic" access type, check whether there -- is a specific visible access type that has the same designated type. -- This is semantically dubious, and of no interest to any real code, -- but c48008a makes it all worthwhile. ------------------------- -- Check_If_Expression -- ------------------------- procedure Check_If_Expression (Cond : Node_Id) is Then_Expr : Node_Id; Else_Expr : Node_Id; begin if Nkind (Cond) = N_If_Expression then Then_Expr := Next (First (Expressions (Cond))); Else_Expr := Next (Then_Expr); if Nkind (Then_Expr) /= N_Null and then Nkind (Else_Expr) /= N_Null then Error_Msg_N ("cannot determine type of if expression", Cond); end if; end if; end Check_If_Expression; ------------------------ -- Explain_Redundancy -- ------------------------ procedure Explain_Redundancy (N : Node_Id) is Error : Name_Id; Val : Node_Id; Val_Id : Entity_Id; begin Val := N; -- Strip the operand down to an entity loop if Nkind (Val) = N_Selected_Component then Val := Selector_Name (Val); else exit; end if; end loop; -- The construct denotes an entity if Is_Entity_Name (Val) and then Present (Entity (Val)) then Val_Id := Entity (Val); -- Do not generate an error message when the comparison is done -- against the enumeration literal Standard.True. if Ekind (Val_Id) /= E_Enumeration_Literal then -- Build a customized error message Name_Len := 0; Add_Str_To_Name_Buffer ("?r?"); if Ekind (Val_Id) = E_Component then Add_Str_To_Name_Buffer ("component "); elsif Ekind (Val_Id) = E_Constant then Add_Str_To_Name_Buffer ("constant "); elsif Ekind (Val_Id) = E_Discriminant then Add_Str_To_Name_Buffer ("discriminant "); elsif Is_Formal (Val_Id) then Add_Str_To_Name_Buffer ("parameter "); elsif Ekind (Val_Id) = E_Variable then Add_Str_To_Name_Buffer ("variable "); end if; Add_Str_To_Name_Buffer ("& is always True!"); Error := Name_Find; Error_Msg_NE (Get_Name_String (Error), Val, Val_Id); end if; -- The construct is too complex to disect, issue a general message else Error_Msg_N ("?r?expression is always True!", Val); end if; end Explain_Redundancy; ----------------------------- -- Find_Unique_Access_Type -- ----------------------------- function Find_Unique_Access_Type return Entity_Id is Acc : Entity_Id; E : Entity_Id; S : Entity_Id; begin if Ekind_In (Etype (R), E_Allocator_Type, E_Access_Attribute_Type) then Acc := Designated_Type (Etype (R)); elsif Ekind_In (Etype (L), E_Allocator_Type, E_Access_Attribute_Type) then Acc := Designated_Type (Etype (L)); else return Empty; end if; S := Current_Scope; while S /= Standard_Standard loop E := First_Entity (S); while Present (E) loop if Is_Type (E) and then Is_Access_Type (E) and then Ekind (E) /= E_Allocator_Type and then Designated_Type (E) = Base_Type (Acc) then return E; end if; Next_Entity (E); end loop; S := Scope (S); end loop; return Empty; end Find_Unique_Access_Type; -- Start of processing for Resolve_Equality_Op begin Set_Etype (N, Base_Type (Typ)); Generate_Reference (T, N, ' '); if T = Any_Fixed then T := Unique_Fixed_Point_Type (L); end if; if T /= Any_Type then if T = Any_String or else T = Any_Composite or else T = Any_Character then if T = Any_Character then Ambiguous_Character (L); else Error_Msg_N ("ambiguous operands for equality", N); end if; Set_Etype (N, Any_Type); return; elsif T = Any_Access or else Ekind_In (T, E_Allocator_Type, E_Access_Attribute_Type) then T := Find_Unique_Access_Type; if No (T) then Error_Msg_N ("ambiguous operands for equality", N); Set_Etype (N, Any_Type); return; end if; -- If expressions must have a single type, and if the context does -- not impose one the dependent expressions cannot be anonymous -- access types. -- Why no similar processing for case expressions??? elsif Ada_Version >= Ada_2012 and then Ekind_In (Etype (L), E_Anonymous_Access_Type, E_Anonymous_Access_Subprogram_Type) and then Ekind_In (Etype (R), E_Anonymous_Access_Type, E_Anonymous_Access_Subprogram_Type) then Check_If_Expression (L); Check_If_Expression (R); end if; Resolve (L, T); Resolve (R, T); -- In SPARK, equality operators = and /= for array types other than -- String are only defined when, for each index position, the -- operands have equal static bounds. if Is_Array_Type (T) then -- Protect call to Matching_Static_Array_Bounds to avoid costly -- operation if not needed. if Restriction_Check_Required (SPARK_05) and then Base_Type (T) /= Standard_String and then Base_Type (Etype (L)) = Base_Type (Etype (R)) and then Etype (L) /= Any_Composite -- or else L in error and then Etype (R) /= Any_Composite -- or else R in error and then not Matching_Static_Array_Bounds (Etype (L), Etype (R)) then Check_SPARK_05_Restriction ("array types should have matching static bounds", N); end if; end if; -- If the unique type is a class-wide type then it will be expanded -- into a dispatching call to the predefined primitive. Therefore we -- check here for potential violation of such restriction. if Is_Class_Wide_Type (T) then Check_Restriction (No_Dispatching_Calls, N); end if; if Warn_On_Redundant_Constructs and then Comes_From_Source (N) and then Comes_From_Source (R) and then Is_Entity_Name (R) and then Entity (R) = Standard_True then Error_Msg_N -- CODEFIX ("?r?comparison with True is redundant!", N); Explain_Redundancy (Original_Node (R)); end if; Check_Unset_Reference (L); Check_Unset_Reference (R); Generate_Operator_Reference (N, T); Check_Low_Bound_Tested (N); -- If this is an inequality, it may be the implicit inequality -- created for a user-defined operation, in which case the corres- -- ponding equality operation is not intrinsic, and the operation -- cannot be constant-folded. Else fold. if Nkind (N) = N_Op_Eq or else Comes_From_Source (Entity (N)) or else Ekind (Entity (N)) = E_Operator or else Is_Intrinsic_Subprogram (Corresponding_Equality (Entity (N))) then Analyze_Dimension (N); Eval_Relational_Op (N); elsif Nkind (N) = N_Op_Ne and then Is_Abstract_Subprogram (Entity (N)) then Error_Msg_NE ("cannot call abstract subprogram &!", N, Entity (N)); end if; -- Ada 2005: If one operand is an anonymous access type, convert the -- other operand to it, to ensure that the underlying types match in -- the back-end. Same for access_to_subprogram, and the conversion -- verifies that the types are subtype conformant. -- We apply the same conversion in the case one of the operands is a -- private subtype of the type of the other. -- Why the Expander_Active test here ??? if Expander_Active and then (Ekind_In (T, E_Anonymous_Access_Type, E_Anonymous_Access_Subprogram_Type) or else Is_Private_Type (T)) then if Etype (L) /= T then Rewrite (L, Make_Unchecked_Type_Conversion (Sloc (L), Subtype_Mark => New_Occurrence_Of (T, Sloc (L)), Expression => Relocate_Node (L))); Analyze_And_Resolve (L, T); end if; if (Etype (R)) /= T then Rewrite (R, Make_Unchecked_Type_Conversion (Sloc (R), Subtype_Mark => New_Occurrence_Of (Etype (L), Sloc (R)), Expression => Relocate_Node (R))); Analyze_And_Resolve (R, T); end if; end if; end if; end Resolve_Equality_Op; ---------------------------------- -- Resolve_Explicit_Dereference -- ---------------------------------- procedure Resolve_Explicit_Dereference (N : Node_Id; Typ : Entity_Id) is Loc : constant Source_Ptr := Sloc (N); New_N : Node_Id; P : constant Node_Id := Prefix (N); P_Typ : Entity_Id; -- The candidate prefix type, if overloaded I : Interp_Index; It : Interp; begin Check_Fully_Declared_Prefix (Typ, P); P_Typ := Empty; -- A useful optimization: check whether the dereference denotes an -- element of a container, and if so rewrite it as a call to the -- corresponding Element function. -- Disabled for now, on advice of ARG. A more restricted form of the -- predicate might be acceptable ??? -- if Is_Container_Element (N) then -- return; -- end if; if Is_Overloaded (P) then -- Use the context type to select the prefix that has the correct -- designated type. Keep the first match, which will be the inner- -- most. Get_First_Interp (P, I, It); while Present (It.Typ) loop if Is_Access_Type (It.Typ) and then Covers (Typ, Designated_Type (It.Typ)) then if No (P_Typ) then P_Typ := It.Typ; end if; -- Remove access types that do not match, but preserve access -- to subprogram interpretations, in case a further dereference -- is needed (see below). elsif Ekind (It.Typ) /= E_Access_Subprogram_Type then Remove_Interp (I); end if; Get_Next_Interp (I, It); end loop; if Present (P_Typ) then Resolve (P, P_Typ); Set_Etype (N, Designated_Type (P_Typ)); else -- If no interpretation covers the designated type of the prefix, -- this is the pathological case where not all implementations of -- the prefix allow the interpretation of the node as a call. Now -- that the expected type is known, Remove other interpretations -- from prefix, rewrite it as a call, and resolve again, so that -- the proper call node is generated. Get_First_Interp (P, I, It); while Present (It.Typ) loop if Ekind (It.Typ) /= E_Access_Subprogram_Type then Remove_Interp (I); end if; Get_Next_Interp (I, It); end loop; New_N := Make_Function_Call (Loc, Name => Make_Explicit_Dereference (Loc, Prefix => P), Parameter_Associations => New_List); Save_Interps (N, New_N); Rewrite (N, New_N); Analyze_And_Resolve (N, Typ); return; end if; -- If not overloaded, resolve P with its own type else Resolve (P); end if; -- If the prefix might be null, add an access check if Is_Access_Type (Etype (P)) and then not Can_Never_Be_Null (Etype (P)) then Apply_Access_Check (N); end if; -- If the designated type is a packed unconstrained array type, and the -- explicit dereference is not in the context of an attribute reference, -- then we must compute and set the actual subtype, since it is needed -- by Gigi. The reason we exclude the attribute case is that this is -- handled fine by Gigi, and in fact we use such attributes to build the -- actual subtype. We also exclude generated code (which builds actual -- subtypes directly if they are needed). if Is_Array_Type (Etype (N)) and then Is_Packed (Etype (N)) and then not Is_Constrained (Etype (N)) and then Nkind (Parent (N)) /= N_Attribute_Reference and then Comes_From_Source (N) then Set_Etype (N, Get_Actual_Subtype (N)); end if; Analyze_Dimension (N); -- Note: No Eval processing is required for an explicit dereference, -- because such a name can never be static. end Resolve_Explicit_Dereference; ------------------------------------- -- Resolve_Expression_With_Actions -- ------------------------------------- procedure Resolve_Expression_With_Actions (N : Node_Id; Typ : Entity_Id) is begin Set_Etype (N, Typ); -- If N has no actions, and its expression has been constant folded, -- then rewrite N as just its expression. Note, we can't do this in -- the general case of Is_Empty_List (Actions (N)) as this would cause -- Expression (N) to be expanded again. if Is_Empty_List (Actions (N)) and then Compile_Time_Known_Value (Expression (N)) then Rewrite (N, Expression (N)); end if; end Resolve_Expression_With_Actions; ---------------------------------- -- Resolve_Generalized_Indexing -- ---------------------------------- procedure Resolve_Generalized_Indexing (N : Node_Id; Typ : Entity_Id) is Indexing : constant Node_Id := Generalized_Indexing (N); Call : Node_Id; Indexes : List_Id; Pref : Node_Id; begin -- In ASIS mode, propagate the information about the indexes back to -- to the original indexing node. The generalized indexing is either -- a function call, or a dereference of one. The actuals include the -- prefix of the original node, which is the container expression. if ASIS_Mode then Resolve (Indexing, Typ); Set_Etype (N, Etype (Indexing)); Set_Is_Overloaded (N, False); Call := Indexing; while Nkind_In (Call, N_Explicit_Dereference, N_Selected_Component) loop Call := Prefix (Call); end loop; if Nkind (Call) = N_Function_Call then Indexes := New_Copy_List (Parameter_Associations (Call)); Pref := Remove_Head (Indexes); Set_Expressions (N, Indexes); -- If expression is to be reanalyzed, reset Generalized_Indexing -- to recreate call node, as is the case when the expression is -- part of an expression function. if In_Spec_Expression then Set_Generalized_Indexing (N, Empty); end if; Set_Prefix (N, Pref); end if; else Rewrite (N, Indexing); Resolve (N, Typ); end if; end Resolve_Generalized_Indexing; --------------------------- -- Resolve_If_Expression -- --------------------------- procedure Resolve_If_Expression (N : Node_Id; Typ : Entity_Id) is Condition : constant Node_Id := First (Expressions (N)); Then_Expr : constant Node_Id := Next (Condition); Else_Expr : Node_Id := Next (Then_Expr); Else_Typ : Entity_Id; Then_Typ : Entity_Id; begin Resolve (Condition, Any_Boolean); Resolve (Then_Expr, Typ); Then_Typ := Etype (Then_Expr); -- When the "then" expression is of a scalar subtype different from the -- result subtype, then insert a conversion to ensure the generation of -- a constraint check. The same is done for the else part below, again -- comparing subtypes rather than base types. if Is_Scalar_Type (Then_Typ) and then Then_Typ /= Typ then Rewrite (Then_Expr, Convert_To (Typ, Then_Expr)); Analyze_And_Resolve (Then_Expr, Typ); end if; -- If ELSE expression present, just resolve using the determined type -- If type is universal, resolve to any member of the class. if Present (Else_Expr) then if Typ = Universal_Integer then Resolve (Else_Expr, Any_Integer); elsif Typ = Universal_Real then Resolve (Else_Expr, Any_Real); else Resolve (Else_Expr, Typ); end if; Else_Typ := Etype (Else_Expr); if Is_Scalar_Type (Else_Typ) and then Else_Typ /= Typ then Rewrite (Else_Expr, Convert_To (Typ, Else_Expr)); Analyze_And_Resolve (Else_Expr, Typ); -- Apply RM 4.5.7 (17/3): whether the expression is statically or -- dynamically tagged must be known statically. elsif Is_Tagged_Type (Typ) and then not Is_Class_Wide_Type (Typ) then if Is_Dynamically_Tagged (Then_Expr) /= Is_Dynamically_Tagged (Else_Expr) then Error_Msg_N ("all or none of the dependent expressions " & "can be dynamically tagged", N); end if; end if; -- If no ELSE expression is present, root type must be Standard.Boolean -- and we provide a Standard.True result converted to the appropriate -- Boolean type (in case it is a derived boolean type). elsif Root_Type (Typ) = Standard_Boolean then Else_Expr := Convert_To (Typ, New_Occurrence_Of (Standard_True, Sloc (N))); Analyze_And_Resolve (Else_Expr, Typ); Append_To (Expressions (N), Else_Expr); else Error_Msg_N ("can only omit ELSE expression in Boolean case", N); Append_To (Expressions (N), Error); end if; Set_Etype (N, Typ); Eval_If_Expression (N); end Resolve_If_Expression; ------------------------------- -- Resolve_Indexed_Component -- ------------------------------- procedure Resolve_Indexed_Component (N : Node_Id; Typ : Entity_Id) is Name : constant Node_Id := Prefix (N); Expr : Node_Id; Array_Type : Entity_Id := Empty; -- to prevent junk warning Index : Node_Id; begin if Present (Generalized_Indexing (N)) then Resolve_Generalized_Indexing (N, Typ); return; end if; if Is_Overloaded (Name) then -- Use the context type to select the prefix that yields the correct -- component type. declare I : Interp_Index; It : Interp; I1 : Interp_Index := 0; P : constant Node_Id := Prefix (N); Found : Boolean := False; begin Get_First_Interp (P, I, It); while Present (It.Typ) loop if (Is_Array_Type (It.Typ) and then Covers (Typ, Component_Type (It.Typ))) or else (Is_Access_Type (It.Typ) and then Is_Array_Type (Designated_Type (It.Typ)) and then Covers (Typ, Component_Type (Designated_Type (It.Typ)))) then if Found then It := Disambiguate (P, I1, I, Any_Type); if It = No_Interp then Error_Msg_N ("ambiguous prefix for indexing", N); Set_Etype (N, Typ); return; else Found := True; Array_Type := It.Typ; I1 := I; end if; else Found := True; Array_Type := It.Typ; I1 := I; end if; end if; Get_Next_Interp (I, It); end loop; end; else Array_Type := Etype (Name); end if; Resolve (Name, Array_Type); Array_Type := Get_Actual_Subtype_If_Available (Name); -- If prefix is access type, dereference to get real array type. -- Note: we do not apply an access check because the expander always -- introduces an explicit dereference, and the check will happen there. if Is_Access_Type (Array_Type) then Array_Type := Designated_Type (Array_Type); end if; -- If name was overloaded, set component type correctly now -- If a misplaced call to an entry family (which has no index types) -- return. Error will be diagnosed from calling context. if Is_Array_Type (Array_Type) then Set_Etype (N, Component_Type (Array_Type)); else return; end if; Index := First_Index (Array_Type); Expr := First (Expressions (N)); -- The prefix may have resolved to a string literal, in which case its -- etype has a special representation. This is only possible currently -- if the prefix is a static concatenation, written in functional -- notation. if Ekind (Array_Type) = E_String_Literal_Subtype then Resolve (Expr, Standard_Positive); else while Present (Index) and Present (Expr) loop Resolve (Expr, Etype (Index)); Check_Unset_Reference (Expr); if Is_Scalar_Type (Etype (Expr)) then Apply_Scalar_Range_Check (Expr, Etype (Index)); else Apply_Range_Check (Expr, Get_Actual_Subtype (Index)); end if; Next_Index (Index); Next (Expr); end loop; end if; Analyze_Dimension (N); -- Do not generate the warning on suspicious index if we are analyzing -- package Ada.Tags; otherwise we will report the warning with the -- Prims_Ptr field of the dispatch table. if Scope (Etype (Prefix (N))) = Standard_Standard or else not Is_RTU (Cunit_Entity (Get_Source_Unit (Etype (Prefix (N)))), Ada_Tags) then Warn_On_Suspicious_Index (Name, First (Expressions (N))); Eval_Indexed_Component (N); end if; -- If the array type is atomic, and the component is not atomic, then -- this is worth a warning, since we have a situation where the access -- to the component may cause extra read/writes of the atomic array -- object, or partial word accesses, which could be unexpected. if Nkind (N) = N_Indexed_Component and then Is_Atomic_Ref_With_Address (N) and then not (Has_Atomic_Components (Array_Type) or else (Is_Entity_Name (Prefix (N)) and then Has_Atomic_Components (Entity (Prefix (N))))) and then not Is_Atomic (Component_Type (Array_Type)) then Error_Msg_N ("??access to non-atomic component of atomic array", Prefix (N)); Error_Msg_N ("??\may cause unexpected accesses to atomic object", Prefix (N)); end if; end Resolve_Indexed_Component; ----------------------------- -- Resolve_Integer_Literal -- ----------------------------- procedure Resolve_Integer_Literal (N : Node_Id; Typ : Entity_Id) is begin Set_Etype (N, Typ); Eval_Integer_Literal (N); end Resolve_Integer_Literal; -------------------------------- -- Resolve_Intrinsic_Operator -- -------------------------------- procedure Resolve_Intrinsic_Operator (N : Node_Id; Typ : Entity_Id) is Btyp : constant Entity_Id := Base_Type (Underlying_Type (Typ)); Op : Entity_Id; Arg1 : Node_Id; Arg2 : Node_Id; function Convert_Operand (Opnd : Node_Id) return Node_Id; -- If the operand is a literal, it cannot be the expression in a -- conversion. Use a qualified expression instead. --------------------- -- Convert_Operand -- --------------------- function Convert_Operand (Opnd : Node_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (Opnd); Res : Node_Id; begin if Nkind_In (Opnd, N_Integer_Literal, N_Real_Literal) then Res := Make_Qualified_Expression (Loc, Subtype_Mark => New_Occurrence_Of (Btyp, Loc), Expression => Relocate_Node (Opnd)); Analyze (Res); else Res := Unchecked_Convert_To (Btyp, Opnd); end if; return Res; end Convert_Operand; -- Start of processing for Resolve_Intrinsic_Operator begin -- We must preserve the original entity in a generic setting, so that -- the legality of the operation can be verified in an instance. if not Expander_Active then return; end if; Op := Entity (N); while Scope (Op) /= Standard_Standard loop Op := Homonym (Op); pragma Assert (Present (Op)); end loop; Set_Entity (N, Op); Set_Is_Overloaded (N, False); -- If the result or operand types are private, rewrite with unchecked -- conversions on the operands and the result, to expose the proper -- underlying numeric type. if Is_Private_Type (Typ) or else Is_Private_Type (Etype (Left_Opnd (N))) or else Is_Private_Type (Etype (Right_Opnd (N))) then Arg1 := Convert_Operand (Left_Opnd (N)); if Nkind (N) = N_Op_Expon then Arg2 := Unchecked_Convert_To (Standard_Integer, Right_Opnd (N)); else Arg2 := Convert_Operand (Right_Opnd (N)); end if; if Nkind (Arg1) = N_Type_Conversion then Save_Interps (Left_Opnd (N), Expression (Arg1)); end if; if Nkind (Arg2) = N_Type_Conversion then Save_Interps (Right_Opnd (N), Expression (Arg2)); end if; Set_Left_Opnd (N, Arg1); Set_Right_Opnd (N, Arg2); Set_Etype (N, Btyp); Rewrite (N, Unchecked_Convert_To (Typ, N)); Resolve (N, Typ); elsif Typ /= Etype (Left_Opnd (N)) or else Typ /= Etype (Right_Opnd (N)) then -- Add explicit conversion where needed, and save interpretations in -- case operands are overloaded. Arg1 := Convert_To (Typ, Left_Opnd (N)); Arg2 := Convert_To (Typ, Right_Opnd (N)); if Nkind (Arg1) = N_Type_Conversion then Save_Interps (Left_Opnd (N), Expression (Arg1)); else Save_Interps (Left_Opnd (N), Arg1); end if; if Nkind (Arg2) = N_Type_Conversion then Save_Interps (Right_Opnd (N), Expression (Arg2)); else Save_Interps (Right_Opnd (N), Arg2); end if; Rewrite (Left_Opnd (N), Arg1); Rewrite (Right_Opnd (N), Arg2); Analyze (Arg1); Analyze (Arg2); Resolve_Arithmetic_Op (N, Typ); else Resolve_Arithmetic_Op (N, Typ); end if; end Resolve_Intrinsic_Operator; -------------------------------------- -- Resolve_Intrinsic_Unary_Operator -- -------------------------------------- procedure Resolve_Intrinsic_Unary_Operator (N : Node_Id; Typ : Entity_Id) is Btyp : constant Entity_Id := Base_Type (Underlying_Type (Typ)); Op : Entity_Id; Arg2 : Node_Id; begin Op := Entity (N); while Scope (Op) /= Standard_Standard loop Op := Homonym (Op); pragma Assert (Present (Op)); end loop; Set_Entity (N, Op); if Is_Private_Type (Typ) then Arg2 := Unchecked_Convert_To (Btyp, Right_Opnd (N)); Save_Interps (Right_Opnd (N), Expression (Arg2)); Set_Right_Opnd (N, Arg2); Set_Etype (N, Btyp); Rewrite (N, Unchecked_Convert_To (Typ, N)); Resolve (N, Typ); else Resolve_Unary_Op (N, Typ); end if; end Resolve_Intrinsic_Unary_Operator; ------------------------ -- Resolve_Logical_Op -- ------------------------ procedure Resolve_Logical_Op (N : Node_Id; Typ : Entity_Id) is B_Typ : Entity_Id; begin Check_No_Direct_Boolean_Operators (N); -- Predefined operations on scalar types yield the base type. On the -- other hand, logical operations on arrays yield the type of the -- arguments (and the context). if Is_Array_Type (Typ) then B_Typ := Typ; else B_Typ := Base_Type (Typ); end if; -- The following test is required because the operands of the operation -- may be literals, in which case the resulting type appears to be -- compatible with a signed integer type, when in fact it is compatible -- only with modular types. If the context itself is universal, the -- operation is illegal. if not Valid_Boolean_Arg (Typ) then Error_Msg_N ("invalid context for logical operation", N); Set_Etype (N, Any_Type); return; elsif Typ = Any_Modular then Error_Msg_N ("no modular type available in this context", N); Set_Etype (N, Any_Type); return; elsif Is_Modular_Integer_Type (Typ) and then Etype (Left_Opnd (N)) = Universal_Integer and then Etype (Right_Opnd (N)) = Universal_Integer then Check_For_Visible_Operator (N, B_Typ); end if; -- Replace AND by AND THEN, or OR by OR ELSE, if Short_Circuit_And_Or -- is active and the result type is standard Boolean (do not mess with -- ops that return a nonstandard Boolean type, because something strange -- is going on). -- Note: you might expect this replacement to be done during expansion, -- but that doesn't work, because when the pragma Short_Circuit_And_Or -- is used, no part of the right operand of an "and" or "or" operator -- should be executed if the left operand would short-circuit the -- evaluation of the corresponding "and then" or "or else". If we left -- the replacement to expansion time, then run-time checks associated -- with such operands would be evaluated unconditionally, due to being -- before the condition prior to the rewriting as short-circuit forms -- during expansion. if Short_Circuit_And_Or and then B_Typ = Standard_Boolean and then Nkind_In (N, N_Op_And, N_Op_Or) then -- Mark the corresponding putative SCO operator as truly a logical -- (and short-circuit) operator. if Generate_SCO and then Comes_From_Source (N) then Set_SCO_Logical_Operator (N); end if; if Nkind (N) = N_Op_And then Rewrite (N, Make_And_Then (Sloc (N), Left_Opnd => Relocate_Node (Left_Opnd (N)), Right_Opnd => Relocate_Node (Right_Opnd (N)))); Analyze_And_Resolve (N, B_Typ); -- Case of OR changed to OR ELSE else Rewrite (N, Make_Or_Else (Sloc (N), Left_Opnd => Relocate_Node (Left_Opnd (N)), Right_Opnd => Relocate_Node (Right_Opnd (N)))); Analyze_And_Resolve (N, B_Typ); end if; -- Return now, since analysis of the rewritten ops will take care of -- other reference bookkeeping and expression folding. return; end if; Resolve (Left_Opnd (N), B_Typ); Resolve (Right_Opnd (N), B_Typ); Check_Unset_Reference (Left_Opnd (N)); Check_Unset_Reference (Right_Opnd (N)); Set_Etype (N, B_Typ); Generate_Operator_Reference (N, B_Typ); Eval_Logical_Op (N); -- In SPARK, logical operations AND, OR and XOR for arrays are defined -- only when both operands have same static lower and higher bounds. Of -- course the types have to match, so only check if operands are -- compatible and the node itself has no errors. if Is_Array_Type (B_Typ) and then Nkind (N) in N_Binary_Op then declare Left_Typ : constant Node_Id := Etype (Left_Opnd (N)); Right_Typ : constant Node_Id := Etype (Right_Opnd (N)); begin -- Protect call to Matching_Static_Array_Bounds to avoid costly -- operation if not needed. if Restriction_Check_Required (SPARK_05) and then Base_Type (Left_Typ) = Base_Type (Right_Typ) and then Left_Typ /= Any_Composite -- or Left_Opnd in error and then Right_Typ /= Any_Composite -- or Right_Opnd in error and then not Matching_Static_Array_Bounds (Left_Typ, Right_Typ) then Check_SPARK_05_Restriction ("array types should have matching static bounds", N); end if; end; end if; end Resolve_Logical_Op; --------------------------- -- Resolve_Membership_Op -- --------------------------- -- The context can only be a boolean type, and does not determine the -- arguments. Arguments should be unambiguous, but the preference rule for -- universal types applies. procedure Resolve_Membership_Op (N : Node_Id; Typ : Entity_Id) is pragma Warnings (Off, Typ); L : constant Node_Id := Left_Opnd (N); R : constant Node_Id := Right_Opnd (N); T : Entity_Id; procedure Resolve_Set_Membership; -- Analysis has determined a unique type for the left operand. Use it to -- resolve the disjuncts. ---------------------------- -- Resolve_Set_Membership -- ---------------------------- procedure Resolve_Set_Membership is Alt : Node_Id; Ltyp : Entity_Id; begin -- If the left operand is overloaded, find type compatible with not -- overloaded alternative of the right operand. if Is_Overloaded (L) then Ltyp := Empty; Alt := First (Alternatives (N)); while Present (Alt) loop if not Is_Overloaded (Alt) then Ltyp := Intersect_Types (L, Alt); exit; else Next (Alt); end if; end loop; -- Unclear how to resolve expression if all alternatives are also -- overloaded. if No (Ltyp) then Error_Msg_N ("ambiguous expression", N); end if; else Ltyp := Etype (L); end if; Resolve (L, Ltyp); Alt := First (Alternatives (N)); while Present (Alt) loop -- Alternative is an expression, a range -- or a subtype mark. if not Is_Entity_Name (Alt) or else not Is_Type (Entity (Alt)) then Resolve (Alt, Ltyp); end if; Next (Alt); end loop; -- Check for duplicates for discrete case if Is_Discrete_Type (Ltyp) then declare type Ent is record Alt : Node_Id; Val : Uint; end record; Alts : array (0 .. List_Length (Alternatives (N))) of Ent; Nalts : Nat; begin -- Loop checking duplicates. This is quadratic, but giant sets -- are unlikely in this context so it's a reasonable choice. Nalts := 0; Alt := First (Alternatives (N)); while Present (Alt) loop if Is_OK_Static_Expression (Alt) and then (Nkind_In (Alt, N_Integer_Literal, N_Character_Literal) or else Nkind (Alt) in N_Has_Entity) then Nalts := Nalts + 1; Alts (Nalts) := (Alt, Expr_Value (Alt)); for J in 1 .. Nalts - 1 loop if Alts (J).Val = Alts (Nalts).Val then Error_Msg_Sloc := Sloc (Alts (J).Alt); Error_Msg_N ("duplicate of value given#??", Alt); end if; end loop; end if; Alt := Next (Alt); end loop; end; end if; end Resolve_Set_Membership; -- Start of processing for Resolve_Membership_Op begin if L = Error or else R = Error then return; end if; if Present (Alternatives (N)) then Resolve_Set_Membership; goto SM_Exit; elsif not Is_Overloaded (R) and then (Etype (R) = Universal_Integer or else Etype (R) = Universal_Real) and then Is_Overloaded (L) then T := Etype (R); -- Ada 2005 (AI-251): Support the following case: -- type I is interface; -- type T is tagged ... -- function Test (O : I'Class) is -- begin -- return O in T'Class. -- end Test; -- In this case we have nothing else to do. The membership test will be -- done at run time. elsif Ada_Version >= Ada_2005 and then Is_Class_Wide_Type (Etype (L)) and then Is_Interface (Etype (L)) and then Is_Class_Wide_Type (Etype (R)) and then not Is_Interface (Etype (R)) then return; else T := Intersect_Types (L, R); end if; -- If mixed-mode operations are present and operands are all literal, -- the only interpretation involves Duration, which is probably not -- the intention of the programmer. if T = Any_Fixed then T := Unique_Fixed_Point_Type (N); if T = Any_Type then return; end if; end if; Resolve (L, T); Check_Unset_Reference (L); if Nkind (R) = N_Range and then not Is_Scalar_Type (T) then Error_Msg_N ("scalar type required for range", R); end if; if Is_Entity_Name (R) then Freeze_Expression (R); else Resolve (R, T); Check_Unset_Reference (R); end if; -- Here after resolving membership operation <<SM_Exit>> Eval_Membership_Op (N); end Resolve_Membership_Op; ------------------ -- Resolve_Null -- ------------------ procedure Resolve_Null (N : Node_Id; Typ : Entity_Id) is Loc : constant Source_Ptr := Sloc (N); begin -- Handle restriction against anonymous null access values This -- restriction can be turned off using -gnatdj. -- Ada 2005 (AI-231): Remove restriction if Ada_Version < Ada_2005 and then not Debug_Flag_J and then Ekind (Typ) = E_Anonymous_Access_Type and then Comes_From_Source (N) then -- In the common case of a call which uses an explicitly null value -- for an access parameter, give specialized error message. if Nkind (Parent (N)) in N_Subprogram_Call then Error_Msg_N ("null is not allowed as argument for an access parameter", N); -- Standard message for all other cases (are there any?) else Error_Msg_N ("null cannot be of an anonymous access type", N); end if; end if; -- Ada 2005 (AI-231): Generate the null-excluding check in case of -- assignment to a null-excluding object if Ada_Version >= Ada_2005 and then Can_Never_Be_Null (Typ) and then Nkind (Parent (N)) = N_Assignment_Statement then if not Inside_Init_Proc then Insert_Action (Compile_Time_Constraint_Error (N, "(Ada 2005) null not allowed in null-excluding objects??"), Make_Raise_Constraint_Error (Loc, Reason => CE_Access_Check_Failed)); else Insert_Action (N, Make_Raise_Constraint_Error (Loc, Reason => CE_Access_Check_Failed)); end if; end if; -- In a distributed context, null for a remote access to subprogram may -- need to be replaced with a special record aggregate. In this case, -- return after having done the transformation. if (Ekind (Typ) = E_Record_Type or else Is_Remote_Access_To_Subprogram_Type (Typ)) and then Remote_AST_Null_Value (N, Typ) then return; end if; -- The null literal takes its type from the context Set_Etype (N, Typ); end Resolve_Null; ----------------------- -- Resolve_Op_Concat -- ----------------------- procedure Resolve_Op_Concat (N : Node_Id; Typ : Entity_Id) is -- We wish to avoid deep recursion, because concatenations are often -- deeply nested, as in A&B&...&Z. Therefore, we walk down the left -- operands nonrecursively until we find something that is not a simple -- concatenation (A in this case). We resolve that, and then walk back -- up the tree following Parent pointers, calling Resolve_Op_Concat_Rest -- to do the rest of the work at each level. The Parent pointers allow -- us to avoid recursion, and thus avoid running out of memory. See also -- Sem_Ch4.Analyze_Concatenation, where a similar approach is used. NN : Node_Id := N; Op1 : Node_Id; begin -- The following code is equivalent to: -- Resolve_Op_Concat_First (NN, Typ); -- Resolve_Op_Concat_Arg (N, ...); -- Resolve_Op_Concat_Rest (N, Typ); -- where the Resolve_Op_Concat_Arg call recurses back here if the left -- operand is a concatenation. -- Walk down left operands loop Resolve_Op_Concat_First (NN, Typ); Op1 := Left_Opnd (NN); exit when not (Nkind (Op1) = N_Op_Concat and then not Is_Array_Type (Component_Type (Typ)) and then Entity (Op1) = Entity (NN)); NN := Op1; end loop; -- Now (given the above example) NN is A&B and Op1 is A -- First resolve Op1 ... Resolve_Op_Concat_Arg (NN, Op1, Typ, Is_Component_Left_Opnd (NN)); -- ... then walk NN back up until we reach N (where we started), calling -- Resolve_Op_Concat_Rest along the way. loop Resolve_Op_Concat_Rest (NN, Typ); exit when NN = N; NN := Parent (NN); end loop; if Base_Type (Etype (N)) /= Standard_String then Check_SPARK_05_Restriction ("result of concatenation should have type String", N); end if; end Resolve_Op_Concat; --------------------------- -- Resolve_Op_Concat_Arg -- --------------------------- procedure Resolve_Op_Concat_Arg (N : Node_Id; Arg : Node_Id; Typ : Entity_Id; Is_Comp : Boolean) is Btyp : constant Entity_Id := Base_Type (Typ); Ctyp : constant Entity_Id := Component_Type (Typ); begin if In_Instance then if Is_Comp or else (not Is_Overloaded (Arg) and then Etype (Arg) /= Any_Composite and then Covers (Ctyp, Etype (Arg))) then Resolve (Arg, Ctyp); else Resolve (Arg, Btyp); end if; -- If both Array & Array and Array & Component are visible, there is a -- potential ambiguity that must be reported. elsif Has_Compatible_Type (Arg, Ctyp) then if Nkind (Arg) = N_Aggregate and then Is_Composite_Type (Ctyp) then if Is_Private_Type (Ctyp) then Resolve (Arg, Btyp); -- If the operation is user-defined and not overloaded use its -- profile. The operation may be a renaming, in which case it has -- been rewritten, and we want the original profile. elsif not Is_Overloaded (N) and then Comes_From_Source (Entity (Original_Node (N))) and then Ekind (Entity (Original_Node (N))) = E_Function then Resolve (Arg, Etype (Next_Formal (First_Formal (Entity (Original_Node (N)))))); return; -- Otherwise an aggregate may match both the array type and the -- component type. else Error_Msg_N ("ambiguous aggregate must be qualified", Arg); Set_Etype (Arg, Any_Type); end if; else if Is_Overloaded (Arg) and then Has_Compatible_Type (Arg, Typ) and then Etype (Arg) /= Any_Type then declare I : Interp_Index; It : Interp; Func : Entity_Id; begin Get_First_Interp (Arg, I, It); Func := It.Nam; Get_Next_Interp (I, It); -- Special-case the error message when the overloading is -- caused by a function that yields an array and can be -- called without parameters. if It.Nam = Func then Error_Msg_Sloc := Sloc (Func); Error_Msg_N ("ambiguous call to function#", Arg); Error_Msg_NE ("\\interpretation as call yields&", Arg, Typ); Error_Msg_NE ("\\interpretation as indexing of call yields&", Arg, Component_Type (Typ)); else Error_Msg_N ("ambiguous operand for concatenation!", Arg); Get_First_Interp (Arg, I, It); while Present (It.Nam) loop Error_Msg_Sloc := Sloc (It.Nam); if Base_Type (It.Typ) = Btyp or else Base_Type (It.Typ) = Base_Type (Ctyp) then Error_Msg_N -- CODEFIX ("\\possible interpretation#", Arg); end if; Get_Next_Interp (I, It); end loop; end if; end; end if; Resolve (Arg, Component_Type (Typ)); if Nkind (Arg) = N_String_Literal then Set_Etype (Arg, Component_Type (Typ)); end if; if Arg = Left_Opnd (N) then Set_Is_Component_Left_Opnd (N); else Set_Is_Component_Right_Opnd (N); end if; end if; else Resolve (Arg, Btyp); end if; -- Concatenation is restricted in SPARK: each operand must be either a -- string literal, the name of a string constant, a static character or -- string expression, or another concatenation. Arg cannot be a -- concatenation here as callers of Resolve_Op_Concat_Arg call it -- separately on each final operand, past concatenation operations. if Is_Character_Type (Etype (Arg)) then if not Is_OK_Static_Expression (Arg) then Check_SPARK_05_Restriction ("character operand for concatenation should be static", Arg); end if; elsif Is_String_Type (Etype (Arg)) then if not (Nkind_In (Arg, N_Identifier, N_Expanded_Name) and then Is_Constant_Object (Entity (Arg))) and then not Is_OK_Static_Expression (Arg) then Check_SPARK_05_Restriction ("string operand for concatenation should be static", Arg); end if; -- Do not issue error on an operand that is neither a character nor a -- string, as the error is issued in Resolve_Op_Concat. else null; end if; Check_Unset_Reference (Arg); end Resolve_Op_Concat_Arg; ----------------------------- -- Resolve_Op_Concat_First -- ----------------------------- procedure Resolve_Op_Concat_First (N : Node_Id; Typ : Entity_Id) is Btyp : constant Entity_Id := Base_Type (Typ); Op1 : constant Node_Id := Left_Opnd (N); Op2 : constant Node_Id := Right_Opnd (N); begin -- The parser folds an enormous sequence of concatenations of string -- literals into "" & "...", where the Is_Folded_In_Parser flag is set -- in the right operand. If the expression resolves to a predefined "&" -- operator, all is well. Otherwise, the parser's folding is wrong, so -- we give an error. See P_Simple_Expression in Par.Ch4. if Nkind (Op2) = N_String_Literal and then Is_Folded_In_Parser (Op2) and then Ekind (Entity (N)) = E_Function then pragma Assert (Nkind (Op1) = N_String_Literal -- should be "" and then String_Length (Strval (Op1)) = 0); Error_Msg_N ("too many user-defined concatenations", N); return; end if; Set_Etype (N, Btyp); if Is_Limited_Composite (Btyp) then Error_Msg_N ("concatenation not available for limited array", N); Explain_Limited_Type (Btyp, N); end if; end Resolve_Op_Concat_First; ---------------------------- -- Resolve_Op_Concat_Rest -- ---------------------------- procedure Resolve_Op_Concat_Rest (N : Node_Id; Typ : Entity_Id) is Op1 : constant Node_Id := Left_Opnd (N); Op2 : constant Node_Id := Right_Opnd (N); begin Resolve_Op_Concat_Arg (N, Op2, Typ, Is_Component_Right_Opnd (N)); Generate_Operator_Reference (N, Typ); if Is_String_Type (Typ) then Eval_Concatenation (N); end if; -- If this is not a static concatenation, but the result is a string -- type (and not an array of strings) ensure that static string operands -- have their subtypes properly constructed. if Nkind (N) /= N_String_Literal and then Is_Character_Type (Component_Type (Typ)) then Set_String_Literal_Subtype (Op1, Typ); Set_String_Literal_Subtype (Op2, Typ); end if; end Resolve_Op_Concat_Rest; ---------------------- -- Resolve_Op_Expon -- ---------------------- procedure Resolve_Op_Expon (N : Node_Id; Typ : Entity_Id) is B_Typ : constant Entity_Id := Base_Type (Typ); begin -- Catch attempts to do fixed-point exponentiation with universal -- operands, which is a case where the illegality is not caught during -- normal operator analysis. This is not done in preanalysis mode -- since the tree is not fully decorated during preanalysis. if Full_Analysis then if Is_Fixed_Point_Type (Typ) and then Comes_From_Source (N) then Error_Msg_N ("exponentiation not available for fixed point", N); return; elsif Nkind (Parent (N)) in N_Op and then Is_Fixed_Point_Type (Etype (Parent (N))) and then Etype (N) = Universal_Real and then Comes_From_Source (N) then Error_Msg_N ("exponentiation not available for fixed point", N); return; end if; end if; if Comes_From_Source (N) and then Ekind (Entity (N)) = E_Function and then Is_Imported (Entity (N)) and then Is_Intrinsic_Subprogram (Entity (N)) then Resolve_Intrinsic_Operator (N, Typ); return; end if; if Etype (Left_Opnd (N)) = Universal_Integer or else Etype (Left_Opnd (N)) = Universal_Real then Check_For_Visible_Operator (N, B_Typ); end if; -- We do the resolution using the base type, because intermediate values -- in expressions are always of the base type, not a subtype of it. Resolve (Left_Opnd (N), B_Typ); Resolve (Right_Opnd (N), Standard_Integer); -- For integer types, right argument must be in Natural range if Is_Integer_Type (Typ) then Apply_Scalar_Range_Check (Right_Opnd (N), Standard_Natural); end if; Check_Unset_Reference (Left_Opnd (N)); Check_Unset_Reference (Right_Opnd (N)); Set_Etype (N, B_Typ); Generate_Operator_Reference (N, B_Typ); Analyze_Dimension (N); if Ada_Version >= Ada_2012 and then Has_Dimension_System (B_Typ) then -- Evaluate the exponentiation operator for dimensioned type Eval_Op_Expon_For_Dimensioned_Type (N, B_Typ); else Eval_Op_Expon (N); end if; -- Set overflow checking bit. Much cleverer code needed here eventually -- and perhaps the Resolve routines should be separated for the various -- arithmetic operations, since they will need different processing. ??? if Nkind (N) in N_Op then if not Overflow_Checks_Suppressed (Etype (N)) then Enable_Overflow_Check (N); end if; end if; end Resolve_Op_Expon; -------------------- -- Resolve_Op_Not -- -------------------- procedure Resolve_Op_Not (N : Node_Id; Typ : Entity_Id) is B_Typ : Entity_Id; function Parent_Is_Boolean return Boolean; -- This function determines if the parent node is a boolean operator or -- operation (comparison op, membership test, or short circuit form) and -- the not in question is the left operand of this operation. Note that -- if the not is in parens, then false is returned. ----------------------- -- Parent_Is_Boolean -- ----------------------- function Parent_Is_Boolean return Boolean is begin if Paren_Count (N) /= 0 then return False; else case Nkind (Parent (N)) is when N_And_Then | N_In | N_Not_In | N_Op_And | N_Op_Eq | N_Op_Ge | N_Op_Gt | N_Op_Le | N_Op_Lt | N_Op_Ne | N_Op_Or | N_Op_Xor | N_Or_Else => return Left_Opnd (Parent (N)) = N; when others => return False; end case; end if; end Parent_Is_Boolean; -- Start of processing for Resolve_Op_Not begin -- Predefined operations on scalar types yield the base type. On the -- other hand, logical operations on arrays yield the type of the -- arguments (and the context). if Is_Array_Type (Typ) then B_Typ := Typ; else B_Typ := Base_Type (Typ); end if; -- Straightforward case of incorrect arguments if not Valid_Boolean_Arg (Typ) then Error_Msg_N ("invalid operand type for operator&", N); Set_Etype (N, Any_Type); return; -- Special case of probable missing parens elsif Typ = Universal_Integer or else Typ = Any_Modular then if Parent_Is_Boolean then Error_Msg_N ("operand of not must be enclosed in parentheses", Right_Opnd (N)); else Error_Msg_N ("no modular type available in this context", N); end if; Set_Etype (N, Any_Type); return; -- OK resolution of NOT else -- Warn if non-boolean types involved. This is a case like not a < b -- where a and b are modular, where we will get (not a) < b and most -- likely not (a < b) was intended. if Warn_On_Questionable_Missing_Parens and then not Is_Boolean_Type (Typ) and then Parent_Is_Boolean then Error_Msg_N ("?q?not expression should be parenthesized here!", N); end if; -- Warn on double negation if checking redundant constructs if Warn_On_Redundant_Constructs and then Comes_From_Source (N) and then Comes_From_Source (Right_Opnd (N)) and then Root_Type (Typ) = Standard_Boolean and then Nkind (Right_Opnd (N)) = N_Op_Not then Error_Msg_N ("redundant double negation?r?", N); end if; -- Complete resolution and evaluation of NOT Resolve (Right_Opnd (N), B_Typ); Check_Unset_Reference (Right_Opnd (N)); Set_Etype (N, B_Typ); Generate_Operator_Reference (N, B_Typ); Eval_Op_Not (N); end if; end Resolve_Op_Not; ----------------------------- -- Resolve_Operator_Symbol -- ----------------------------- -- Nothing to be done, all resolved already procedure Resolve_Operator_Symbol (N : Node_Id; Typ : Entity_Id) is pragma Warnings (Off, N); pragma Warnings (Off, Typ); begin null; end Resolve_Operator_Symbol; ---------------------------------- -- Resolve_Qualified_Expression -- ---------------------------------- procedure Resolve_Qualified_Expression (N : Node_Id; Typ : Entity_Id) is pragma Warnings (Off, Typ); Target_Typ : constant Entity_Id := Entity (Subtype_Mark (N)); Expr : constant Node_Id := Expression (N); begin Resolve (Expr, Target_Typ); -- Protect call to Matching_Static_Array_Bounds to avoid costly -- operation if not needed. if Restriction_Check_Required (SPARK_05) and then Is_Array_Type (Target_Typ) and then Is_Array_Type (Etype (Expr)) and then Etype (Expr) /= Any_Composite -- or else Expr in error and then not Matching_Static_Array_Bounds (Target_Typ, Etype (Expr)) then Check_SPARK_05_Restriction ("array types should have matching static bounds", N); end if; -- A qualified expression requires an exact match of the type, class- -- wide matching is not allowed. However, if the qualifying type is -- specific and the expression has a class-wide type, it may still be -- okay, since it can be the result of the expansion of a call to a -- dispatching function, so we also have to check class-wideness of the -- type of the expression's original node. if (Is_Class_Wide_Type (Target_Typ) or else (Is_Class_Wide_Type (Etype (Expr)) and then Is_Class_Wide_Type (Etype (Original_Node (Expr))))) and then Base_Type (Etype (Expr)) /= Base_Type (Target_Typ) then Wrong_Type (Expr, Target_Typ); end if; -- If the target type is unconstrained, then we reset the type of the -- result from the type of the expression. For other cases, the actual -- subtype of the expression is the target type. if Is_Composite_Type (Target_Typ) and then not Is_Constrained (Target_Typ) then Set_Etype (N, Etype (Expr)); end if; Analyze_Dimension (N); Eval_Qualified_Expression (N); -- If we still have a qualified expression after the static evaluation, -- then apply a scalar range check if needed. The reason that we do this -- after the Eval call is that otherwise, the application of the range -- check may convert an illegal static expression and result in warning -- rather than giving an error (e.g Integer'(Integer'Last + 1)). if Nkind (N) = N_Qualified_Expression and then Is_Scalar_Type (Typ) then Apply_Scalar_Range_Check (Expr, Typ); end if; -- Finally, check whether a predicate applies to the target type. This -- comes from AI12-0100. As for type conversions, check the enclosing -- context to prevent an infinite expansion. if Has_Predicates (Target_Typ) then if Nkind (Parent (N)) = N_Function_Call and then Present (Name (Parent (N))) and then (Is_Predicate_Function (Entity (Name (Parent (N)))) or else Is_Predicate_Function_M (Entity (Name (Parent (N))))) then null; -- In the case of a qualified expression in an allocator, the check -- is applied when expanding the allocator, so avoid redundant check. elsif Nkind (N) = N_Qualified_Expression and then Nkind (Parent (N)) /= N_Allocator then Apply_Predicate_Check (N, Target_Typ); end if; end if; end Resolve_Qualified_Expression; ------------------------------ -- Resolve_Raise_Expression -- ------------------------------ procedure Resolve_Raise_Expression (N : Node_Id; Typ : Entity_Id) is begin if Typ = Raise_Type then Error_Msg_N ("cannot find unique type for raise expression", N); Set_Etype (N, Any_Type); else Set_Etype (N, Typ); end if; end Resolve_Raise_Expression; ------------------- -- Resolve_Range -- ------------------- procedure Resolve_Range (N : Node_Id; Typ : Entity_Id) is L : constant Node_Id := Low_Bound (N); H : constant Node_Id := High_Bound (N); function First_Last_Ref return Boolean; -- Returns True if N is of the form X'First .. X'Last where X is the -- same entity for both attributes. -------------------- -- First_Last_Ref -- -------------------- function First_Last_Ref return Boolean is Lorig : constant Node_Id := Original_Node (L); Horig : constant Node_Id := Original_Node (H); begin if Nkind (Lorig) = N_Attribute_Reference and then Nkind (Horig) = N_Attribute_Reference and then Attribute_Name (Lorig) = Name_First and then Attribute_Name (Horig) = Name_Last then declare PL : constant Node_Id := Prefix (Lorig); PH : constant Node_Id := Prefix (Horig); begin if Is_Entity_Name (PL) and then Is_Entity_Name (PH) and then Entity (PL) = Entity (PH) then return True; end if; end; end if; return False; end First_Last_Ref; -- Start of processing for Resolve_Range begin Set_Etype (N, Typ); -- The lower bound should be in Typ. The higher bound can be in Typ's -- base type if the range is null. It may still be invalid if it is -- higher than the lower bound. This is checked later in the context in -- which the range appears. Resolve (L, Typ); Resolve (H, Base_Type (Typ)); -- Check for inappropriate range on unordered enumeration type if Bad_Unordered_Enumeration_Reference (N, Typ) -- Exclude X'First .. X'Last if X is the same entity for both and then not First_Last_Ref then Error_Msg_Sloc := Sloc (Typ); Error_Msg_NE ("subrange of unordered enumeration type& declared#?U?", N, Typ); end if; Check_Unset_Reference (L); Check_Unset_Reference (H); -- We have to check the bounds for being within the base range as -- required for a non-static context. Normally this is automatic and -- done as part of evaluating expressions, but the N_Range node is an -- exception, since in GNAT we consider this node to be a subexpression, -- even though in Ada it is not. The circuit in Sem_Eval could check for -- this, but that would put the test on the main evaluation path for -- expressions. Check_Non_Static_Context (L); Check_Non_Static_Context (H); -- Check for an ambiguous range over character literals. This will -- happen with a membership test involving only literals. if Typ = Any_Character then Ambiguous_Character (L); Set_Etype (N, Any_Type); return; end if; -- If bounds are static, constant-fold them, so size computations are -- identical between front-end and back-end. Do not perform this -- transformation while analyzing generic units, as type information -- would be lost when reanalyzing the constant node in the instance. if Is_Discrete_Type (Typ) and then Expander_Active then if Is_OK_Static_Expression (L) then Fold_Uint (L, Expr_Value (L), Is_OK_Static_Expression (L)); end if; if Is_OK_Static_Expression (H) then Fold_Uint (H, Expr_Value (H), Is_OK_Static_Expression (H)); end if; end if; end Resolve_Range; -------------------------- -- Resolve_Real_Literal -- -------------------------- procedure Resolve_Real_Literal (N : Node_Id; Typ : Entity_Id) is Actual_Typ : constant Entity_Id := Etype (N); begin -- Special processing for fixed-point literals to make sure that the -- value is an exact multiple of small where this is required. We skip -- this for the universal real case, and also for generic types. if Is_Fixed_Point_Type (Typ) and then Typ /= Universal_Fixed and then Typ /= Any_Fixed and then not Is_Generic_Type (Typ) then declare Val : constant Ureal := Realval (N); Cintr : constant Ureal := Val / Small_Value (Typ); Cint : constant Uint := UR_Trunc (Cintr); Den : constant Uint := Norm_Den (Cintr); Stat : Boolean; begin -- Case of literal is not an exact multiple of the Small if Den /= 1 then -- For a source program literal for a decimal fixed-point type, -- this is statically illegal (RM 4.9(36)). if Is_Decimal_Fixed_Point_Type (Typ) and then Actual_Typ = Universal_Real and then Comes_From_Source (N) then Error_Msg_N ("value has extraneous low order digits", N); end if; -- Generate a warning if literal from source if Is_OK_Static_Expression (N) and then Warn_On_Bad_Fixed_Value then Error_Msg_N ("?b?static fixed-point value is not a multiple of Small!", N); end if; -- Replace literal by a value that is the exact representation -- of a value of the type, i.e. a multiple of the small value, -- by truncation, since Machine_Rounds is false for all GNAT -- fixed-point types (RM 4.9(38)). Stat := Is_OK_Static_Expression (N); Rewrite (N, Make_Real_Literal (Sloc (N), Realval => Small_Value (Typ) * Cint)); Set_Is_Static_Expression (N, Stat); end if; -- In all cases, set the corresponding integer field Set_Corresponding_Integer_Value (N, Cint); end; end if; -- Now replace the actual type by the expected type as usual Set_Etype (N, Typ); Eval_Real_Literal (N); end Resolve_Real_Literal; ----------------------- -- Resolve_Reference -- ----------------------- procedure Resolve_Reference (N : Node_Id; Typ : Entity_Id) is P : constant Node_Id := Prefix (N); begin -- Replace general access with specific type if Ekind (Etype (N)) = E_Allocator_Type then Set_Etype (N, Base_Type (Typ)); end if; Resolve (P, Designated_Type (Etype (N))); -- If we are taking the reference of a volatile entity, then treat it as -- a potential modification of this entity. This is too conservative, -- but necessary because remove side effects can cause transformations -- of normal assignments into reference sequences that otherwise fail to -- notice the modification. if Is_Entity_Name (P) and then Treat_As_Volatile (Entity (P)) then Note_Possible_Modification (P, Sure => False); end if; end Resolve_Reference; -------------------------------- -- Resolve_Selected_Component -- -------------------------------- procedure Resolve_Selected_Component (N : Node_Id; Typ : Entity_Id) is Comp : Entity_Id; Comp1 : Entity_Id := Empty; -- prevent junk warning P : constant Node_Id := Prefix (N); S : constant Node_Id := Selector_Name (N); T : Entity_Id := Etype (P); I : Interp_Index; I1 : Interp_Index := 0; -- prevent junk warning It : Interp; It1 : Interp; Found : Boolean; function Init_Component return Boolean; -- Check whether this is the initialization of a component within an -- init proc (by assignment or call to another init proc). If true, -- there is no need for a discriminant check. -------------------- -- Init_Component -- -------------------- function Init_Component return Boolean is begin return Inside_Init_Proc and then Nkind (Prefix (N)) = N_Identifier and then Chars (Prefix (N)) = Name_uInit and then Nkind (Parent (Parent (N))) = N_Case_Statement_Alternative; end Init_Component; -- Start of processing for Resolve_Selected_Component begin if Is_Overloaded (P) then -- Use the context type to select the prefix that has a selector -- of the correct name and type. Found := False; Get_First_Interp (P, I, It); Search : while Present (It.Typ) loop if Is_Access_Type (It.Typ) then T := Designated_Type (It.Typ); else T := It.Typ; end if; -- Locate selected component. For a private prefix the selector -- can denote a discriminant. if Is_Record_Type (T) or else Is_Private_Type (T) then -- The visible components of a class-wide type are those of -- the root type. if Is_Class_Wide_Type (T) then T := Etype (T); end if; Comp := First_Entity (T); while Present (Comp) loop if Chars (Comp) = Chars (S) and then Covers (Typ, Etype (Comp)) then if not Found then Found := True; I1 := I; It1 := It; Comp1 := Comp; else It := Disambiguate (P, I1, I, Any_Type); if It = No_Interp then Error_Msg_N ("ambiguous prefix for selected component", N); Set_Etype (N, Typ); return; else It1 := It; -- There may be an implicit dereference. Retrieve -- designated record type. if Is_Access_Type (It1.Typ) then T := Designated_Type (It1.Typ); else T := It1.Typ; end if; if Scope (Comp1) /= T then -- Resolution chooses the new interpretation. -- Find the component with the right name. Comp1 := First_Entity (T); while Present (Comp1) and then Chars (Comp1) /= Chars (S) loop Comp1 := Next_Entity (Comp1); end loop; end if; exit Search; end if; end if; end if; Comp := Next_Entity (Comp); end loop; end if; Get_Next_Interp (I, It); end loop Search; -- There must be a legal interpretation at this point pragma Assert (Found); Resolve (P, It1.Typ); Set_Etype (N, Typ); Set_Entity_With_Checks (S, Comp1); else -- Resolve prefix with its type Resolve (P, T); end if; -- Generate cross-reference. We needed to wait until full overloading -- resolution was complete to do this, since otherwise we can't tell if -- we are an lvalue or not. if May_Be_Lvalue (N) then Generate_Reference (Entity (S), S, 'm'); else Generate_Reference (Entity (S), S, 'r'); end if; -- If prefix is an access type, the node will be transformed into an -- explicit dereference during expansion. The type of the node is the -- designated type of that of the prefix. if Is_Access_Type (Etype (P)) then T := Designated_Type (Etype (P)); Check_Fully_Declared_Prefix (T, P); else T := Etype (P); end if; -- Set flag for expander if discriminant check required on a component -- appearing within a variant. if Has_Discriminants (T) and then Ekind (Entity (S)) = E_Component and then Present (Original_Record_Component (Entity (S))) and then Ekind (Original_Record_Component (Entity (S))) = E_Component and then Is_Declared_Within_Variant (Original_Record_Component (Entity (S))) and then not Discriminant_Checks_Suppressed (T) and then not Init_Component then Set_Do_Discriminant_Check (N); end if; if Ekind (Entity (S)) = E_Void then Error_Msg_N ("premature use of component", S); end if; -- If the prefix is a record conversion, this may be a renamed -- discriminant whose bounds differ from those of the original -- one, so we must ensure that a range check is performed. if Nkind (P) = N_Type_Conversion and then Ekind (Entity (S)) = E_Discriminant and then Is_Discrete_Type (Typ) then Set_Etype (N, Base_Type (Typ)); end if; -- Note: No Eval processing is required, because the prefix is of a -- record type, or protected type, and neither can possibly be static. -- If the record type is atomic, and the component is non-atomic, then -- this is worth a warning, since we have a situation where the access -- to the component may cause extra read/writes of the atomic array -- object, or partial word accesses, both of which may be unexpected. if Nkind (N) = N_Selected_Component and then Is_Atomic_Ref_With_Address (N) and then not Is_Atomic (Entity (S)) and then not Is_Atomic (Etype (Entity (S))) then Error_Msg_N ("??access to non-atomic component of atomic record", Prefix (N)); Error_Msg_N ("\??may cause unexpected accesses to atomic object", Prefix (N)); end if; Analyze_Dimension (N); end Resolve_Selected_Component; ------------------- -- Resolve_Shift -- ------------------- procedure Resolve_Shift (N : Node_Id; Typ : Entity_Id) is B_Typ : constant Entity_Id := Base_Type (Typ); L : constant Node_Id := Left_Opnd (N); R : constant Node_Id := Right_Opnd (N); begin -- We do the resolution using the base type, because intermediate values -- in expressions always are of the base type, not a subtype of it. Resolve (L, B_Typ); Resolve (R, Standard_Natural); Check_Unset_Reference (L); Check_Unset_Reference (R); Set_Etype (N, B_Typ); Generate_Operator_Reference (N, B_Typ); Eval_Shift (N); end Resolve_Shift; --------------------------- -- Resolve_Short_Circuit -- --------------------------- procedure Resolve_Short_Circuit (N : Node_Id; Typ : Entity_Id) is B_Typ : constant Entity_Id := Base_Type (Typ); L : constant Node_Id := Left_Opnd (N); R : constant Node_Id := Right_Opnd (N); begin -- Ensure all actions associated with the left operand (e.g. -- finalization of transient objects) are fully evaluated locally within -- an expression with actions. This is particularly helpful for coverage -- analysis. However this should not happen in generics or if option -- Minimize_Expression_With_Actions is set. if Expander_Active and not Minimize_Expression_With_Actions then declare Reloc_L : constant Node_Id := Relocate_Node (L); begin Save_Interps (Old_N => L, New_N => Reloc_L); Rewrite (L, Make_Expression_With_Actions (Sloc (L), Actions => New_List, Expression => Reloc_L)); -- Set Comes_From_Source on L to preserve warnings for unset -- reference. Set_Comes_From_Source (L, Comes_From_Source (Reloc_L)); end; end if; Resolve (L, B_Typ); Resolve (R, B_Typ); -- Check for issuing warning for always False assert/check, this happens -- when assertions are turned off, in which case the pragma Assert/Check -- was transformed into: -- if False and then <condition> then ... -- and we detect this pattern if Warn_On_Assertion_Failure and then Is_Entity_Name (R) and then Entity (R) = Standard_False and then Nkind (Parent (N)) = N_If_Statement and then Nkind (N) = N_And_Then and then Is_Entity_Name (L) and then Entity (L) = Standard_False then declare Orig : constant Node_Id := Original_Node (Parent (N)); begin -- Special handling of Asssert pragma if Nkind (Orig) = N_Pragma and then Pragma_Name (Orig) = Name_Assert then declare Expr : constant Node_Id := Original_Node (Expression (First (Pragma_Argument_Associations (Orig)))); begin -- Don't warn if original condition is explicit False, -- since obviously the failure is expected in this case. if Is_Entity_Name (Expr) and then Entity (Expr) = Standard_False then null; -- Issue warning. We do not want the deletion of the -- IF/AND-THEN to take this message with it. We achieve this -- by making sure that the expanded code points to the Sloc -- of the expression, not the original pragma. else -- Note: Use Error_Msg_F here rather than Error_Msg_N. -- The source location of the expression is not usually -- the best choice here. For example, it gets located on -- the last AND keyword in a chain of boolean expressiond -- AND'ed together. It is best to put the message on the -- first character of the assertion, which is the effect -- of the First_Node call here. Error_Msg_F ("?A?assertion would fail at run time!", Expression (First (Pragma_Argument_Associations (Orig)))); end if; end; -- Similar processing for Check pragma elsif Nkind (Orig) = N_Pragma and then Pragma_Name (Orig) = Name_Check then -- Don't want to warn if original condition is explicit False declare Expr : constant Node_Id := Original_Node (Expression (Next (First (Pragma_Argument_Associations (Orig))))); begin if Is_Entity_Name (Expr) and then Entity (Expr) = Standard_False then null; -- Post warning else -- Again use Error_Msg_F rather than Error_Msg_N, see -- comment above for an explanation of why we do this. Error_Msg_F ("?A?check would fail at run time!", Expression (Last (Pragma_Argument_Associations (Orig)))); end if; end; end if; end; end if; -- Continue with processing of short circuit Check_Unset_Reference (L); Check_Unset_Reference (R); Set_Etype (N, B_Typ); Eval_Short_Circuit (N); end Resolve_Short_Circuit; ------------------- -- Resolve_Slice -- ------------------- procedure Resolve_Slice (N : Node_Id; Typ : Entity_Id) is Drange : constant Node_Id := Discrete_Range (N); Name : constant Node_Id := Prefix (N); Array_Type : Entity_Id := Empty; Dexpr : Node_Id := Empty; Index_Type : Entity_Id; begin if Is_Overloaded (Name) then -- Use the context type to select the prefix that yields the correct -- array type. declare I : Interp_Index; I1 : Interp_Index := 0; It : Interp; P : constant Node_Id := Prefix (N); Found : Boolean := False; begin Get_First_Interp (P, I, It); while Present (It.Typ) loop if (Is_Array_Type (It.Typ) and then Covers (Typ, It.Typ)) or else (Is_Access_Type (It.Typ) and then Is_Array_Type (Designated_Type (It.Typ)) and then Covers (Typ, Designated_Type (It.Typ))) then if Found then It := Disambiguate (P, I1, I, Any_Type); if It = No_Interp then Error_Msg_N ("ambiguous prefix for slicing", N); Set_Etype (N, Typ); return; else Found := True; Array_Type := It.Typ; I1 := I; end if; else Found := True; Array_Type := It.Typ; I1 := I; end if; end if; Get_Next_Interp (I, It); end loop; end; else Array_Type := Etype (Name); end if; Resolve (Name, Array_Type); if Is_Access_Type (Array_Type) then Apply_Access_Check (N); Array_Type := Designated_Type (Array_Type); -- If the prefix is an access to an unconstrained array, we must use -- the actual subtype of the object to perform the index checks. The -- object denoted by the prefix is implicit in the node, so we build -- an explicit representation for it in order to compute the actual -- subtype. if not Is_Constrained (Array_Type) then Remove_Side_Effects (Prefix (N)); declare Obj : constant Node_Id := Make_Explicit_Dereference (Sloc (N), Prefix => New_Copy_Tree (Prefix (N))); begin Set_Etype (Obj, Array_Type); Set_Parent (Obj, Parent (N)); Array_Type := Get_Actual_Subtype (Obj); end; end if; elsif Is_Entity_Name (Name) or else Nkind (Name) = N_Explicit_Dereference or else (Nkind (Name) = N_Function_Call and then not Is_Constrained (Etype (Name))) then Array_Type := Get_Actual_Subtype (Name); -- If the name is a selected component that depends on discriminants, -- build an actual subtype for it. This can happen only when the name -- itself is overloaded; otherwise the actual subtype is created when -- the selected component is analyzed. elsif Nkind (Name) = N_Selected_Component and then Full_Analysis and then Depends_On_Discriminant (First_Index (Array_Type)) then declare Act_Decl : constant Node_Id := Build_Actual_Subtype_Of_Component (Array_Type, Name); begin Insert_Action (N, Act_Decl); Array_Type := Defining_Identifier (Act_Decl); end; -- Maybe this should just be "else", instead of checking for the -- specific case of slice??? This is needed for the case where the -- prefix is an Image attribute, which gets expanded to a slice, and so -- has a constrained subtype which we want to use for the slice range -- check applied below (the range check won't get done if the -- unconstrained subtype of the 'Image is used). elsif Nkind (Name) = N_Slice then Array_Type := Etype (Name); end if; -- Obtain the type of the array index if Ekind (Array_Type) = E_String_Literal_Subtype then Index_Type := Etype (String_Literal_Low_Bound (Array_Type)); else Index_Type := Etype (First_Index (Array_Type)); end if; -- If name was overloaded, set slice type correctly now Set_Etype (N, Array_Type); -- Handle the generation of a range check that compares the array index -- against the discrete_range. The check is not applied to internally -- built nodes associated with the expansion of dispatch tables. Check -- that Ada.Tags has already been loaded to avoid extra dependencies on -- the unit. if Tagged_Type_Expansion and then RTU_Loaded (Ada_Tags) and then Nkind (Prefix (N)) = N_Selected_Component and then Present (Entity (Selector_Name (Prefix (N)))) and then Entity (Selector_Name (Prefix (N))) = RTE_Record_Component (RE_Prims_Ptr) then null; -- The discrete_range is specified by a subtype indication. Create a -- shallow copy and inherit the type, parent and source location from -- the discrete_range. This ensures that the range check is inserted -- relative to the slice and that the runtime exception points to the -- proper construct. elsif Is_Entity_Name (Drange) then Dexpr := New_Copy (Scalar_Range (Entity (Drange))); Set_Etype (Dexpr, Etype (Drange)); Set_Parent (Dexpr, Parent (Drange)); Set_Sloc (Dexpr, Sloc (Drange)); -- The discrete_range is a regular range. Resolve the bounds and remove -- their side effects. else Resolve (Drange, Base_Type (Index_Type)); if Nkind (Drange) = N_Range then Force_Evaluation (Low_Bound (Drange)); Force_Evaluation (High_Bound (Drange)); Dexpr := Drange; end if; end if; if Present (Dexpr) then Apply_Range_Check (Dexpr, Index_Type); end if; Set_Slice_Subtype (N); -- Check bad use of type with predicates declare Subt : Entity_Id; begin if Nkind (Drange) = N_Subtype_Indication and then Has_Predicates (Entity (Subtype_Mark (Drange))) then Subt := Entity (Subtype_Mark (Drange)); else Subt := Etype (Drange); end if; if Has_Predicates (Subt) then Bad_Predicated_Subtype_Use ("subtype& has predicate, not allowed in slice", Drange, Subt); end if; end; -- Otherwise here is where we check suspicious indexes if Nkind (Drange) = N_Range then Warn_On_Suspicious_Index (Name, Low_Bound (Drange)); Warn_On_Suspicious_Index (Name, High_Bound (Drange)); end if; Analyze_Dimension (N); Eval_Slice (N); end Resolve_Slice; ---------------------------- -- Resolve_String_Literal -- ---------------------------- procedure Resolve_String_Literal (N : Node_Id; Typ : Entity_Id) is C_Typ : constant Entity_Id := Component_Type (Typ); R_Typ : constant Entity_Id := Root_Type (C_Typ); Loc : constant Source_Ptr := Sloc (N); Str : constant String_Id := Strval (N); Strlen : constant Nat := String_Length (Str); Subtype_Id : Entity_Id; Need_Check : Boolean; begin -- For a string appearing in a concatenation, defer creation of the -- string_literal_subtype until the end of the resolution of the -- concatenation, because the literal may be constant-folded away. This -- is a useful optimization for long concatenation expressions. -- If the string is an aggregate built for a single character (which -- happens in a non-static context) or a is null string to which special -- checks may apply, we build the subtype. Wide strings must also get a -- string subtype if they come from a one character aggregate. Strings -- generated by attributes might be static, but it is often hard to -- determine whether the enclosing context is static, so we generate -- subtypes for them as well, thus losing some rarer optimizations ??? -- Same for strings that come from a static conversion. Need_Check := (Strlen = 0 and then Typ /= Standard_String) or else Nkind (Parent (N)) /= N_Op_Concat or else (N /= Left_Opnd (Parent (N)) and then N /= Right_Opnd (Parent (N))) or else ((Typ = Standard_Wide_String or else Typ = Standard_Wide_Wide_String) and then Nkind (Original_Node (N)) /= N_String_Literal); -- If the resolving type is itself a string literal subtype, we can just -- reuse it, since there is no point in creating another. if Ekind (Typ) = E_String_Literal_Subtype then Subtype_Id := Typ; elsif Nkind (Parent (N)) = N_Op_Concat and then not Need_Check and then not Nkind_In (Original_Node (N), N_Character_Literal, N_Attribute_Reference, N_Qualified_Expression, N_Type_Conversion) then Subtype_Id := Typ; -- Do not generate a string literal subtype for the default expression -- of a formal parameter in GNATprove mode. This is because the string -- subtype is associated with the freezing actions of the subprogram, -- however freezing is disabled in GNATprove mode and as a result the -- subtype is unavailable. elsif GNATprove_Mode and then Nkind (Parent (N)) = N_Parameter_Specification then Subtype_Id := Typ; -- Otherwise we must create a string literal subtype. Note that the -- whole idea of string literal subtypes is simply to avoid the need -- for building a full fledged array subtype for each literal. else Set_String_Literal_Subtype (N, Typ); Subtype_Id := Etype (N); end if; if Nkind (Parent (N)) /= N_Op_Concat or else Need_Check then Set_Etype (N, Subtype_Id); Eval_String_Literal (N); end if; if Is_Limited_Composite (Typ) or else Is_Private_Composite (Typ) then Error_Msg_N ("string literal not available for private array", N); Set_Etype (N, Any_Type); return; end if; -- The validity of a null string has been checked in the call to -- Eval_String_Literal. if Strlen = 0 then return; -- Always accept string literal with component type Any_Character, which -- occurs in error situations and in comparisons of literals, both of -- which should accept all literals. elsif R_Typ = Any_Character then return; -- If the type is bit-packed, then we always transform the string -- literal into a full fledged aggregate. elsif Is_Bit_Packed_Array (Typ) then null; -- Deal with cases of Wide_Wide_String, Wide_String, and String else -- For Standard.Wide_Wide_String, or any other type whose component -- type is Standard.Wide_Wide_Character, we know that all the -- characters in the string must be acceptable, since the parser -- accepted the characters as valid character literals. if R_Typ = Standard_Wide_Wide_Character then null; -- For the case of Standard.String, or any other type whose component -- type is Standard.Character, we must make sure that there are no -- wide characters in the string, i.e. that it is entirely composed -- of characters in range of type Character. -- If the string literal is the result of a static concatenation, the -- test has already been performed on the components, and need not be -- repeated. elsif R_Typ = Standard_Character and then Nkind (Original_Node (N)) /= N_Op_Concat then for J in 1 .. Strlen loop if not In_Character_Range (Get_String_Char (Str, J)) then -- If we are out of range, post error. This is one of the -- very few places that we place the flag in the middle of -- a token, right under the offending wide character. Not -- quite clear if this is right wrt wide character encoding -- sequences, but it's only an error message. Error_Msg ("literal out of range of type Standard.Character", Source_Ptr (Int (Loc) + J)); return; end if; end loop; -- For the case of Standard.Wide_String, or any other type whose -- component type is Standard.Wide_Character, we must make sure that -- there are no wide characters in the string, i.e. that it is -- entirely composed of characters in range of type Wide_Character. -- If the string literal is the result of a static concatenation, -- the test has already been performed on the components, and need -- not be repeated. elsif R_Typ = Standard_Wide_Character and then Nkind (Original_Node (N)) /= N_Op_Concat then for J in 1 .. Strlen loop if not In_Wide_Character_Range (Get_String_Char (Str, J)) then -- If we are out of range, post error. This is one of the -- very few places that we place the flag in the middle of -- a token, right under the offending wide character. -- This is not quite right, because characters in general -- will take more than one character position ??? Error_Msg ("literal out of range of type Standard.Wide_Character", Source_Ptr (Int (Loc) + J)); return; end if; end loop; -- If the root type is not a standard character, then we will convert -- the string into an aggregate and will let the aggregate code do -- the checking. Standard Wide_Wide_Character is also OK here. else null; end if; -- See if the component type of the array corresponding to the string -- has compile time known bounds. If yes we can directly check -- whether the evaluation of the string will raise constraint error. -- Otherwise we need to transform the string literal into the -- corresponding character aggregate and let the aggregate code do -- the checking. if Is_Standard_Character_Type (R_Typ) then -- Check for the case of full range, where we are definitely OK if Component_Type (Typ) = Base_Type (Component_Type (Typ)) then return; end if; -- Here the range is not the complete base type range, so check declare Comp_Typ_Lo : constant Node_Id := Type_Low_Bound (Component_Type (Typ)); Comp_Typ_Hi : constant Node_Id := Type_High_Bound (Component_Type (Typ)); Char_Val : Uint; begin if Compile_Time_Known_Value (Comp_Typ_Lo) and then Compile_Time_Known_Value (Comp_Typ_Hi) then for J in 1 .. Strlen loop Char_Val := UI_From_Int (Int (Get_String_Char (Str, J))); if Char_Val < Expr_Value (Comp_Typ_Lo) or else Char_Val > Expr_Value (Comp_Typ_Hi) then Apply_Compile_Time_Constraint_Error (N, "character out of range??", CE_Range_Check_Failed, Loc => Source_Ptr (Int (Loc) + J)); end if; end loop; return; end if; end; end if; end if; -- If we got here we meed to transform the string literal into the -- equivalent qualified positional array aggregate. This is rather -- heavy artillery for this situation, but it is hard work to avoid. declare Lits : constant List_Id := New_List; P : Source_Ptr := Loc + 1; C : Char_Code; begin -- Build the character literals, we give them source locations that -- correspond to the string positions, which is a bit tricky given -- the possible presence of wide character escape sequences. for J in 1 .. Strlen loop C := Get_String_Char (Str, J); Set_Character_Literal_Name (C); Append_To (Lits, Make_Character_Literal (P, Chars => Name_Find, Char_Literal_Value => UI_From_CC (C))); if In_Character_Range (C) then P := P + 1; -- Should we have a call to Skip_Wide here ??? -- ??? else -- Skip_Wide (P); end if; end loop; Rewrite (N, Make_Qualified_Expression (Loc, Subtype_Mark => New_Occurrence_Of (Typ, Loc), Expression => Make_Aggregate (Loc, Expressions => Lits))); Analyze_And_Resolve (N, Typ); end; end Resolve_String_Literal; ------------------------- -- Resolve_Target_Name -- ------------------------- procedure Resolve_Target_Name (N : Node_Id; Typ : Entity_Id) is begin Set_Etype (N, Typ); end Resolve_Target_Name; ----------------------------- -- Resolve_Type_Conversion -- ----------------------------- procedure Resolve_Type_Conversion (N : Node_Id; Typ : Entity_Id) is Conv_OK : constant Boolean := Conversion_OK (N); Operand : constant Node_Id := Expression (N); Operand_Typ : constant Entity_Id := Etype (Operand); Target_Typ : constant Entity_Id := Etype (N); Rop : Node_Id; Orig_N : Node_Id; Orig_T : Node_Id; Test_Redundant : Boolean := Warn_On_Redundant_Constructs; -- Set to False to suppress cases where we want to suppress the test -- for redundancy to avoid possible false positives on this warning. begin if not Conv_OK and then not Valid_Conversion (N, Target_Typ, Operand) then return; end if; -- If the Operand Etype is Universal_Fixed, then the conversion is -- never redundant. We need this check because by the time we have -- finished the rather complex transformation, the conversion looks -- redundant when it is not. if Operand_Typ = Universal_Fixed then Test_Redundant := False; -- If the operand is marked as Any_Fixed, then special processing is -- required. This is also a case where we suppress the test for a -- redundant conversion, since most certainly it is not redundant. elsif Operand_Typ = Any_Fixed then Test_Redundant := False; -- Mixed-mode operation involving a literal. Context must be a fixed -- type which is applied to the literal subsequently. if Is_Fixed_Point_Type (Typ) then Set_Etype (Operand, Universal_Real); elsif Is_Numeric_Type (Typ) and then Nkind_In (Operand, N_Op_Multiply, N_Op_Divide) and then (Etype (Right_Opnd (Operand)) = Universal_Real or else Etype (Left_Opnd (Operand)) = Universal_Real) then -- Return if expression is ambiguous if Unique_Fixed_Point_Type (N) = Any_Type then return; -- If nothing else, the available fixed type is Duration else Set_Etype (Operand, Standard_Duration); end if; -- Resolve the real operand with largest available precision if Etype (Right_Opnd (Operand)) = Universal_Real then Rop := New_Copy_Tree (Right_Opnd (Operand)); else Rop := New_Copy_Tree (Left_Opnd (Operand)); end if; Resolve (Rop, Universal_Real); -- If the operand is a literal (it could be a non-static and -- illegal exponentiation) check whether the use of Duration -- is potentially inaccurate. if Nkind (Rop) = N_Real_Literal and then Realval (Rop) /= Ureal_0 and then abs (Realval (Rop)) < Delta_Value (Standard_Duration) then Error_Msg_N ("??universal real operand can only " & "be interpreted as Duration!", Rop); Error_Msg_N ("\??precision will be lost in the conversion!", Rop); end if; elsif Is_Numeric_Type (Typ) and then Nkind (Operand) in N_Op and then Unique_Fixed_Point_Type (N) /= Any_Type then Set_Etype (Operand, Standard_Duration); else Error_Msg_N ("invalid context for mixed mode operation", N); Set_Etype (Operand, Any_Type); return; end if; end if; Resolve (Operand); -- In SPARK, a type conversion between array types should be restricted -- to types which have matching static bounds. -- Protect call to Matching_Static_Array_Bounds to avoid costly -- operation if not needed. if Restriction_Check_Required (SPARK_05) and then Is_Array_Type (Target_Typ) and then Is_Array_Type (Operand_Typ) and then Operand_Typ /= Any_Composite -- or else Operand in error and then not Matching_Static_Array_Bounds (Target_Typ, Operand_Typ) then Check_SPARK_05_Restriction ("array types should have matching static bounds", N); end if; -- In formal mode, the operand of an ancestor type conversion must be an -- object (not an expression). if Is_Tagged_Type (Target_Typ) and then not Is_Class_Wide_Type (Target_Typ) and then Is_Tagged_Type (Operand_Typ) and then not Is_Class_Wide_Type (Operand_Typ) and then Is_Ancestor (Target_Typ, Operand_Typ) and then not Is_SPARK_05_Object_Reference (Operand) then Check_SPARK_05_Restriction ("object required", Operand); end if; Analyze_Dimension (N); -- Note: we do the Eval_Type_Conversion call before applying the -- required checks for a subtype conversion. This is important, since -- both are prepared under certain circumstances to change the type -- conversion to a constraint error node, but in the case of -- Eval_Type_Conversion this may reflect an illegality in the static -- case, and we would miss the illegality (getting only a warning -- message), if we applied the type conversion checks first. Eval_Type_Conversion (N); -- Even when evaluation is not possible, we may be able to simplify the -- conversion or its expression. This needs to be done before applying -- checks, since otherwise the checks may use the original expression -- and defeat the simplifications. This is specifically the case for -- elimination of the floating-point Truncation attribute in -- float-to-int conversions. Simplify_Type_Conversion (N); -- If after evaluation we still have a type conversion, then we may need -- to apply checks required for a subtype conversion. -- Skip these type conversion checks if universal fixed operands -- operands involved, since range checks are handled separately for -- these cases (in the appropriate Expand routines in unit Exp_Fixd). if Nkind (N) = N_Type_Conversion and then not Is_Generic_Type (Root_Type (Target_Typ)) and then Target_Typ /= Universal_Fixed and then Operand_Typ /= Universal_Fixed then Apply_Type_Conversion_Checks (N); end if; -- Issue warning for conversion of simple object to its own type. We -- have to test the original nodes, since they may have been rewritten -- by various optimizations. Orig_N := Original_Node (N); -- Here we test for a redundant conversion if the warning mode is -- active (and was not locally reset), and we have a type conversion -- from source not appearing in a generic instance. if Test_Redundant and then Nkind (Orig_N) = N_Type_Conversion and then Comes_From_Source (Orig_N) and then not In_Instance then Orig_N := Original_Node (Expression (Orig_N)); Orig_T := Target_Typ; -- If the node is part of a larger expression, the Target_Type -- may not be the original type of the node if the context is a -- condition. Recover original type to see if conversion is needed. if Is_Boolean_Type (Orig_T) and then Nkind (Parent (N)) in N_Op then Orig_T := Etype (Parent (N)); end if; -- If we have an entity name, then give the warning if the entity -- is the right type, or if it is a loop parameter covered by the -- original type (that's needed because loop parameters have an -- odd subtype coming from the bounds). if (Is_Entity_Name (Orig_N) and then (Etype (Entity (Orig_N)) = Orig_T or else (Ekind (Entity (Orig_N)) = E_Loop_Parameter and then Covers (Orig_T, Etype (Entity (Orig_N)))))) -- If not an entity, then type of expression must match or else Etype (Orig_N) = Orig_T then -- One more check, do not give warning if the analyzed conversion -- has an expression with non-static bounds, and the bounds of the -- target are static. This avoids junk warnings in cases where the -- conversion is necessary to establish staticness, for example in -- a case statement. if not Is_OK_Static_Subtype (Operand_Typ) and then Is_OK_Static_Subtype (Target_Typ) then null; -- Finally, if this type conversion occurs in a context requiring -- a prefix, and the expression is a qualified expression then the -- type conversion is not redundant, since a qualified expression -- is not a prefix, whereas a type conversion is. For example, "X -- := T'(Funx(...)).Y;" is illegal because a selected component -- requires a prefix, but a type conversion makes it legal: "X := -- T(T'(Funx(...))).Y;" -- In Ada 2012, a qualified expression is a name, so this idiom is -- no longer needed, but we still suppress the warning because it -- seems unfriendly for warnings to pop up when you switch to the -- newer language version. elsif Nkind (Orig_N) = N_Qualified_Expression and then Nkind_In (Parent (N), N_Attribute_Reference, N_Indexed_Component, N_Selected_Component, N_Slice, N_Explicit_Dereference) then null; -- Never warn on conversion to Long_Long_Integer'Base since -- that is most likely an artifact of the extended overflow -- checking and comes from complex expanded code. elsif Orig_T = Base_Type (Standard_Long_Long_Integer) then null; -- Here we give the redundant conversion warning. If it is an -- entity, give the name of the entity in the message. If not, -- just mention the expression. -- Shoudn't we test Warn_On_Redundant_Constructs here ??? else if Is_Entity_Name (Orig_N) then Error_Msg_Node_2 := Orig_T; Error_Msg_NE -- CODEFIX ("??redundant conversion, & is of type &!", N, Entity (Orig_N)); else Error_Msg_NE ("??redundant conversion, expression is of type&!", N, Orig_T); end if; end if; end if; end if; -- Ada 2005 (AI-251): Handle class-wide interface type conversions. -- No need to perform any interface conversion if the type of the -- expression coincides with the target type. if Ada_Version >= Ada_2005 and then Expander_Active and then Operand_Typ /= Target_Typ then declare Opnd : Entity_Id := Operand_Typ; Target : Entity_Id := Target_Typ; begin -- If the type of the operand is a limited view, use nonlimited -- view when available. If it is a class-wide type, recover the -- class-wide type of the nonlimited view. if From_Limited_With (Opnd) and then Has_Non_Limited_View (Opnd) then Opnd := Non_Limited_View (Opnd); Set_Etype (Expression (N), Opnd); end if; if Is_Access_Type (Opnd) then Opnd := Designated_Type (Opnd); end if; if Is_Access_Type (Target_Typ) then Target := Designated_Type (Target); end if; if Opnd = Target then null; -- Conversion from interface type elsif Is_Interface (Opnd) then -- Ada 2005 (AI-217): Handle entities from limited views if From_Limited_With (Opnd) then Error_Msg_Qual_Level := 99; Error_Msg_NE -- CODEFIX ("missing WITH clause on package &", N, Cunit_Entity (Get_Source_Unit (Base_Type (Opnd)))); Error_Msg_N ("type conversions require visibility of the full view", N); elsif From_Limited_With (Target) and then not (Is_Access_Type (Target_Typ) and then Present (Non_Limited_View (Etype (Target)))) then Error_Msg_Qual_Level := 99; Error_Msg_NE -- CODEFIX ("missing WITH clause on package &", N, Cunit_Entity (Get_Source_Unit (Base_Type (Target)))); Error_Msg_N ("type conversions require visibility of the full view", N); else Expand_Interface_Conversion (N); end if; -- Conversion to interface type elsif Is_Interface (Target) then -- Handle subtypes if Ekind_In (Opnd, E_Protected_Subtype, E_Task_Subtype) then Opnd := Etype (Opnd); end if; if Is_Class_Wide_Type (Opnd) or else Interface_Present_In_Ancestor (Typ => Opnd, Iface => Target) then Expand_Interface_Conversion (N); else Error_Msg_Name_1 := Chars (Etype (Target)); Error_Msg_Name_2 := Chars (Opnd); Error_Msg_N ("wrong interface conversion (% is not a progenitor " & "of %)", N); end if; end if; end; end if; -- Ada 2012: if target type has predicates, the result requires a -- predicate check. If the context is a call to another predicate -- check we must prevent infinite recursion. if Has_Predicates (Target_Typ) then if Nkind (Parent (N)) = N_Function_Call and then Present (Name (Parent (N))) and then (Is_Predicate_Function (Entity (Name (Parent (N)))) or else Is_Predicate_Function_M (Entity (Name (Parent (N))))) then null; else Apply_Predicate_Check (N, Target_Typ); end if; end if; -- If at this stage we have a real to integer conversion, make sure -- that the Do_Range_Check flag is set, because such conversions in -- general need a range check. We only need this if expansion is off -- or we are in GNATProve mode. if Nkind (N) = N_Type_Conversion and then (GNATprove_Mode or not Expander_Active) and then Is_Integer_Type (Target_Typ) and then Is_Real_Type (Operand_Typ) then Set_Do_Range_Check (Operand); end if; -- Generating C code a type conversion of an access to constrained -- array type to access to unconstrained array type involves building -- a fat pointer which in general cannot be generated on the fly. We -- remove side effects in order to store the result of the conversion -- into a temporary. if Modify_Tree_For_C and then Nkind (N) = N_Type_Conversion and then Nkind (Parent (N)) /= N_Object_Declaration and then Is_Access_Type (Etype (N)) and then Is_Array_Type (Designated_Type (Etype (N))) and then not Is_Constrained (Designated_Type (Etype (N))) and then Is_Constrained (Designated_Type (Etype (Expression (N)))) then Remove_Side_Effects (N); end if; end Resolve_Type_Conversion; ---------------------- -- Resolve_Unary_Op -- ---------------------- procedure Resolve_Unary_Op (N : Node_Id; Typ : Entity_Id) is B_Typ : constant Entity_Id := Base_Type (Typ); R : constant Node_Id := Right_Opnd (N); OK : Boolean; Lo : Uint; Hi : Uint; begin if Is_Modular_Integer_Type (Typ) and then Nkind (N) /= N_Op_Not then Error_Msg_Name_1 := Chars (Typ); Check_SPARK_05_Restriction ("unary operator not defined for modular type%", N); end if; -- Deal with intrinsic unary operators if Comes_From_Source (N) and then Ekind (Entity (N)) = E_Function and then Is_Imported (Entity (N)) and then Is_Intrinsic_Subprogram (Entity (N)) then Resolve_Intrinsic_Unary_Operator (N, Typ); return; end if; -- Deal with universal cases if Etype (R) = Universal_Integer or else Etype (R) = Universal_Real then Check_For_Visible_Operator (N, B_Typ); end if; Set_Etype (N, B_Typ); Resolve (R, B_Typ); -- Generate warning for expressions like abs (x mod 2) if Warn_On_Redundant_Constructs and then Nkind (N) = N_Op_Abs then Determine_Range (Right_Opnd (N), OK, Lo, Hi); if OK and then Hi >= Lo and then Lo >= 0 then Error_Msg_N -- CODEFIX ("?r?abs applied to known non-negative value has no effect", N); end if; end if; -- Deal with reference generation Check_Unset_Reference (R); Generate_Operator_Reference (N, B_Typ); Analyze_Dimension (N); Eval_Unary_Op (N); -- Set overflow checking bit. Much cleverer code needed here eventually -- and perhaps the Resolve routines should be separated for the various -- arithmetic operations, since they will need different processing ??? if Nkind (N) in N_Op then if not Overflow_Checks_Suppressed (Etype (N)) then Enable_Overflow_Check (N); end if; end if; -- Generate warning for expressions like -5 mod 3 for integers. No need -- to worry in the floating-point case, since parens do not affect the -- result so there is no point in giving in a warning. declare Norig : constant Node_Id := Original_Node (N); Rorig : Node_Id; Val : Uint; HB : Uint; LB : Uint; Lval : Uint; Opnd : Node_Id; begin if Warn_On_Questionable_Missing_Parens and then Comes_From_Source (Norig) and then Is_Integer_Type (Typ) and then Nkind (Norig) = N_Op_Minus then Rorig := Original_Node (Right_Opnd (Norig)); -- We are looking for cases where the right operand is not -- parenthesized, and is a binary operator, multiply, divide, or -- mod. These are the cases where the grouping can affect results. if Paren_Count (Rorig) = 0 and then Nkind_In (Rorig, N_Op_Mod, N_Op_Multiply, N_Op_Divide) then -- For mod, we always give the warning, since the value is -- affected by the parenthesization (e.g. (-5) mod 315 /= -- -(5 mod 315)). But for the other cases, the only concern is -- overflow, e.g. for the case of 8 big signed (-(2 * 64) -- overflows, but (-2) * 64 does not). So we try to give the -- message only when overflow is possible. if Nkind (Rorig) /= N_Op_Mod and then Compile_Time_Known_Value (R) then Val := Expr_Value (R); if Compile_Time_Known_Value (Type_High_Bound (Typ)) then HB := Expr_Value (Type_High_Bound (Typ)); else HB := Expr_Value (Type_High_Bound (Base_Type (Typ))); end if; if Compile_Time_Known_Value (Type_Low_Bound (Typ)) then LB := Expr_Value (Type_Low_Bound (Typ)); else LB := Expr_Value (Type_Low_Bound (Base_Type (Typ))); end if; -- Note that the test below is deliberately excluding the -- largest negative number, since that is a potentially -- troublesome case (e.g. -2 * x, where the result is the -- largest negative integer has an overflow with 2 * x). if Val > LB and then Val <= HB then return; end if; end if; -- For the multiplication case, the only case we have to worry -- about is when (-a)*b is exactly the largest negative number -- so that -(a*b) can cause overflow. This can only happen if -- a is a power of 2, and more generally if any operand is a -- constant that is not a power of 2, then the parentheses -- cannot affect whether overflow occurs. We only bother to -- test the left most operand -- Loop looking at left operands for one that has known value Opnd := Rorig; Opnd_Loop : while Nkind (Opnd) = N_Op_Multiply loop if Compile_Time_Known_Value (Left_Opnd (Opnd)) then Lval := UI_Abs (Expr_Value (Left_Opnd (Opnd))); -- Operand value of 0 or 1 skips warning if Lval <= 1 then return; -- Otherwise check power of 2, if power of 2, warn, if -- anything else, skip warning. else while Lval /= 2 loop if Lval mod 2 = 1 then return; else Lval := Lval / 2; end if; end loop; exit Opnd_Loop; end if; end if; -- Keep looking at left operands Opnd := Left_Opnd (Opnd); end loop Opnd_Loop; -- For rem or "/" we can only have a problematic situation -- if the divisor has a value of minus one or one. Otherwise -- overflow is impossible (divisor > 1) or we have a case of -- division by zero in any case. if Nkind_In (Rorig, N_Op_Divide, N_Op_Rem) and then Compile_Time_Known_Value (Right_Opnd (Rorig)) and then UI_Abs (Expr_Value (Right_Opnd (Rorig))) /= 1 then return; end if; -- If we fall through warning should be issued -- Shouldn't we test Warn_On_Questionable_Missing_Parens ??? Error_Msg_N ("??unary minus expression should be parenthesized here!", N); end if; end if; end; end Resolve_Unary_Op; ---------------------------------- -- Resolve_Unchecked_Expression -- ---------------------------------- procedure Resolve_Unchecked_Expression (N : Node_Id; Typ : Entity_Id) is begin Resolve (Expression (N), Typ, Suppress => All_Checks); Set_Etype (N, Typ); end Resolve_Unchecked_Expression; --------------------------------------- -- Resolve_Unchecked_Type_Conversion -- --------------------------------------- procedure Resolve_Unchecked_Type_Conversion (N : Node_Id; Typ : Entity_Id) is pragma Warnings (Off, Typ); Operand : constant Node_Id := Expression (N); Opnd_Type : constant Entity_Id := Etype (Operand); begin -- Resolve operand using its own type Resolve (Operand, Opnd_Type); -- In an inlined context, the unchecked conversion may be applied -- to a literal, in which case its type is the type of the context. -- (In other contexts conversions cannot apply to literals). if In_Inlined_Body and then (Opnd_Type = Any_Character or else Opnd_Type = Any_Integer or else Opnd_Type = Any_Real) then Set_Etype (Operand, Typ); end if; Analyze_Dimension (N); Eval_Unchecked_Conversion (N); end Resolve_Unchecked_Type_Conversion; ------------------------------ -- Rewrite_Operator_As_Call -- ------------------------------ procedure Rewrite_Operator_As_Call (N : Node_Id; Nam : Entity_Id) is Loc : constant Source_Ptr := Sloc (N); Actuals : constant List_Id := New_List; New_N : Node_Id; begin if Nkind (N) in N_Binary_Op then Append (Left_Opnd (N), Actuals); end if; Append (Right_Opnd (N), Actuals); New_N := Make_Function_Call (Sloc => Loc, Name => New_Occurrence_Of (Nam, Loc), Parameter_Associations => Actuals); Preserve_Comes_From_Source (New_N, N); Preserve_Comes_From_Source (Name (New_N), N); Rewrite (N, New_N); Set_Etype (N, Etype (Nam)); end Rewrite_Operator_As_Call; ------------------------------ -- Rewrite_Renamed_Operator -- ------------------------------ procedure Rewrite_Renamed_Operator (N : Node_Id; Op : Entity_Id; Typ : Entity_Id) is Nam : constant Name_Id := Chars (Op); Is_Binary : constant Boolean := Nkind (N) in N_Binary_Op; Op_Node : Node_Id; begin -- Do not perform this transformation within a pre/postcondition, -- because the expression will be re-analyzed, and the transformation -- might affect the visibility of the operator, e.g. in an instance. -- Note that fully analyzed and expanded pre/postconditions appear as -- pragma Check equivalents. if In_Pre_Post_Condition (N) then return; end if; -- Rewrite the operator node using the real operator, not its renaming. -- Exclude user-defined intrinsic operations of the same name, which are -- treated separately and rewritten as calls. if Ekind (Op) /= E_Function or else Chars (N) /= Nam then Op_Node := New_Node (Operator_Kind (Nam, Is_Binary), Sloc (N)); Set_Chars (Op_Node, Nam); Set_Etype (Op_Node, Etype (N)); Set_Entity (Op_Node, Op); Set_Right_Opnd (Op_Node, Right_Opnd (N)); -- Indicate that both the original entity and its renaming are -- referenced at this point. Generate_Reference (Entity (N), N); Generate_Reference (Op, N); if Is_Binary then Set_Left_Opnd (Op_Node, Left_Opnd (N)); end if; Rewrite (N, Op_Node); -- If the context type is private, add the appropriate conversions so -- that the operator is applied to the full view. This is done in the -- routines that resolve intrinsic operators. if Is_Intrinsic_Subprogram (Op) and then Is_Private_Type (Typ) then case Nkind (N) is when N_Op_Add | N_Op_Divide | N_Op_Expon | N_Op_Mod | N_Op_Multiply | N_Op_Rem | N_Op_Subtract => Resolve_Intrinsic_Operator (N, Typ); when N_Op_Abs | N_Op_Minus | N_Op_Plus => Resolve_Intrinsic_Unary_Operator (N, Typ); when others => Resolve (N, Typ); end case; end if; elsif Ekind (Op) = E_Function and then Is_Intrinsic_Subprogram (Op) then -- Operator renames a user-defined operator of the same name. Use the -- original operator in the node, which is the one Gigi knows about. Set_Entity (N, Op); Set_Is_Overloaded (N, False); end if; end Rewrite_Renamed_Operator; ----------------------- -- Set_Slice_Subtype -- ----------------------- -- Build an implicit subtype declaration to represent the type delivered by -- the slice. This is an abbreviated version of an array subtype. We define -- an index subtype for the slice, using either the subtype name or the -- discrete range of the slice. To be consistent with index usage elsewhere -- we create a list header to hold the single index. This list is not -- otherwise attached to the syntax tree. procedure Set_Slice_Subtype (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); Index_List : constant List_Id := New_List; Index : Node_Id; Index_Subtype : Entity_Id; Index_Type : Entity_Id; Slice_Subtype : Entity_Id; Drange : constant Node_Id := Discrete_Range (N); begin Index_Type := Base_Type (Etype (Drange)); if Is_Entity_Name (Drange) then Index_Subtype := Entity (Drange); else -- We force the evaluation of a range. This is definitely needed in -- the renamed case, and seems safer to do unconditionally. Note in -- any case that since we will create and insert an Itype referring -- to this range, we must make sure any side effect removal actions -- are inserted before the Itype definition. if Nkind (Drange) = N_Range then Force_Evaluation (Low_Bound (Drange)); Force_Evaluation (High_Bound (Drange)); -- If the discrete range is given by a subtype indication, the -- type of the slice is the base of the subtype mark. elsif Nkind (Drange) = N_Subtype_Indication then declare R : constant Node_Id := Range_Expression (Constraint (Drange)); begin Index_Type := Base_Type (Entity (Subtype_Mark (Drange))); Force_Evaluation (Low_Bound (R)); Force_Evaluation (High_Bound (R)); end; end if; Index_Subtype := Create_Itype (Subtype_Kind (Ekind (Index_Type)), N); -- Take a new copy of Drange (where bounds have been rewritten to -- reference side-effect-free names). Using a separate tree ensures -- that further expansion (e.g. while rewriting a slice assignment -- into a FOR loop) does not attempt to remove side effects on the -- bounds again (which would cause the bounds in the index subtype -- definition to refer to temporaries before they are defined) (the -- reason is that some names are considered side effect free here -- for the subtype, but not in the context of a loop iteration -- scheme). Set_Scalar_Range (Index_Subtype, New_Copy_Tree (Drange)); Set_Parent (Scalar_Range (Index_Subtype), Index_Subtype); Set_Etype (Index_Subtype, Index_Type); Set_Size_Info (Index_Subtype, Index_Type); Set_RM_Size (Index_Subtype, RM_Size (Index_Type)); end if; Slice_Subtype := Create_Itype (E_Array_Subtype, N); Index := New_Occurrence_Of (Index_Subtype, Loc); Set_Etype (Index, Index_Subtype); Append (Index, Index_List); Set_First_Index (Slice_Subtype, Index); Set_Etype (Slice_Subtype, Base_Type (Etype (N))); Set_Is_Constrained (Slice_Subtype, True); Check_Compile_Time_Size (Slice_Subtype); -- The Etype of the existing Slice node is reset to this slice subtype. -- Its bounds are obtained from its first index. Set_Etype (N, Slice_Subtype); -- For packed slice subtypes, freeze immediately (except in the case of -- being in a "spec expression" where we never freeze when we first see -- the expression). if Is_Packed (Slice_Subtype) and not In_Spec_Expression then Freeze_Itype (Slice_Subtype, N); -- For all other cases insert an itype reference in the slice's actions -- so that the itype is frozen at the proper place in the tree (i.e. at -- the point where actions for the slice are analyzed). Note that this -- is different from freezing the itype immediately, which might be -- premature (e.g. if the slice is within a transient scope). This needs -- to be done only if expansion is enabled. elsif Expander_Active then Ensure_Defined (Typ => Slice_Subtype, N => N); end if; end Set_Slice_Subtype; -------------------------------- -- Set_String_Literal_Subtype -- -------------------------------- procedure Set_String_Literal_Subtype (N : Node_Id; Typ : Entity_Id) is Loc : constant Source_Ptr := Sloc (N); Low_Bound : constant Node_Id := Type_Low_Bound (Etype (First_Index (Typ))); Subtype_Id : Entity_Id; begin if Nkind (N) /= N_String_Literal then return; end if; Subtype_Id := Create_Itype (E_String_Literal_Subtype, N); Set_String_Literal_Length (Subtype_Id, UI_From_Int (String_Length (Strval (N)))); Set_Etype (Subtype_Id, Base_Type (Typ)); Set_Is_Constrained (Subtype_Id); Set_Etype (N, Subtype_Id); -- The low bound is set from the low bound of the corresponding index -- type. Note that we do not store the high bound in the string literal -- subtype, but it can be deduced if necessary from the length and the -- low bound. if Is_OK_Static_Expression (Low_Bound) then Set_String_Literal_Low_Bound (Subtype_Id, Low_Bound); -- If the lower bound is not static we create a range for the string -- literal, using the index type and the known length of the literal. -- The index type is not necessarily Positive, so the upper bound is -- computed as T'Val (T'Pos (Low_Bound) + L - 1). else declare Index_List : constant List_Id := New_List; Index_Type : constant Entity_Id := Etype (First_Index (Typ)); High_Bound : constant Node_Id := Make_Attribute_Reference (Loc, Attribute_Name => Name_Val, Prefix => New_Occurrence_Of (Index_Type, Loc), Expressions => New_List ( Make_Op_Add (Loc, Left_Opnd => Make_Attribute_Reference (Loc, Attribute_Name => Name_Pos, Prefix => New_Occurrence_Of (Index_Type, Loc), Expressions => New_List (New_Copy_Tree (Low_Bound))), Right_Opnd => Make_Integer_Literal (Loc, String_Length (Strval (N)) - 1)))); Array_Subtype : Entity_Id; Drange : Node_Id; Index : Node_Id; Index_Subtype : Entity_Id; begin if Is_Integer_Type (Index_Type) then Set_String_Literal_Low_Bound (Subtype_Id, Make_Integer_Literal (Loc, 1)); else -- If the index type is an enumeration type, build bounds -- expression with attributes. Set_String_Literal_Low_Bound (Subtype_Id, Make_Attribute_Reference (Loc, Attribute_Name => Name_First, Prefix => New_Occurrence_Of (Base_Type (Index_Type), Loc))); Set_Etype (String_Literal_Low_Bound (Subtype_Id), Index_Type); end if; Analyze_And_Resolve (String_Literal_Low_Bound (Subtype_Id)); -- Build bona fide subtype for the string, and wrap it in an -- unchecked conversion, because the backend expects the -- String_Literal_Subtype to have a static lower bound. Index_Subtype := Create_Itype (Subtype_Kind (Ekind (Index_Type)), N); Drange := Make_Range (Loc, New_Copy_Tree (Low_Bound), High_Bound); Set_Scalar_Range (Index_Subtype, Drange); Set_Parent (Drange, N); Analyze_And_Resolve (Drange, Index_Type); -- In the context, the Index_Type may already have a constraint, -- so use common base type on string subtype. The base type may -- be used when generating attributes of the string, for example -- in the context of a slice assignment. Set_Etype (Index_Subtype, Base_Type (Index_Type)); Set_Size_Info (Index_Subtype, Index_Type); Set_RM_Size (Index_Subtype, RM_Size (Index_Type)); Array_Subtype := Create_Itype (E_Array_Subtype, N); Index := New_Occurrence_Of (Index_Subtype, Loc); Set_Etype (Index, Index_Subtype); Append (Index, Index_List); Set_First_Index (Array_Subtype, Index); Set_Etype (Array_Subtype, Base_Type (Typ)); Set_Is_Constrained (Array_Subtype, True); Rewrite (N, Make_Unchecked_Type_Conversion (Loc, Subtype_Mark => New_Occurrence_Of (Array_Subtype, Loc), Expression => Relocate_Node (N))); Set_Etype (N, Array_Subtype); end; end if; end Set_String_Literal_Subtype; ------------------------------ -- Simplify_Type_Conversion -- ------------------------------ procedure Simplify_Type_Conversion (N : Node_Id) is begin if Nkind (N) = N_Type_Conversion then declare Operand : constant Node_Id := Expression (N); Target_Typ : constant Entity_Id := Etype (N); Opnd_Typ : constant Entity_Id := Etype (Operand); begin -- Special processing if the conversion is the expression of a -- Rounding or Truncation attribute reference. In this case we -- replace: -- ityp (ftyp'Rounding (x)) or ityp (ftyp'Truncation (x)) -- by -- ityp (x) -- with the Float_Truncate flag set to False or True respectively, -- which is more efficient. if Is_Floating_Point_Type (Opnd_Typ) and then (Is_Integer_Type (Target_Typ) or else (Is_Fixed_Point_Type (Target_Typ) and then Conversion_OK (N))) and then Nkind (Operand) = N_Attribute_Reference and then Nam_In (Attribute_Name (Operand), Name_Rounding, Name_Truncation) then declare Truncate : constant Boolean := Attribute_Name (Operand) = Name_Truncation; begin Rewrite (Operand, Relocate_Node (First (Expressions (Operand)))); Set_Float_Truncate (N, Truncate); end; end if; end; end if; end Simplify_Type_Conversion; ----------------------------- -- Unique_Fixed_Point_Type -- ----------------------------- function Unique_Fixed_Point_Type (N : Node_Id) return Entity_Id is T1 : Entity_Id := Empty; T2 : Entity_Id; Item : Node_Id; Scop : Entity_Id; procedure Fixed_Point_Error; -- Give error messages for true ambiguity. Messages are posted on node -- N, and entities T1, T2 are the possible interpretations. ----------------------- -- Fixed_Point_Error -- ----------------------- procedure Fixed_Point_Error is begin Error_Msg_N ("ambiguous universal_fixed_expression", N); Error_Msg_NE ("\\possible interpretation as}", N, T1); Error_Msg_NE ("\\possible interpretation as}", N, T2); end Fixed_Point_Error; -- Start of processing for Unique_Fixed_Point_Type begin -- The operations on Duration are visible, so Duration is always a -- possible interpretation. T1 := Standard_Duration; -- Look for fixed-point types in enclosing scopes Scop := Current_Scope; while Scop /= Standard_Standard loop T2 := First_Entity (Scop); while Present (T2) loop if Is_Fixed_Point_Type (T2) and then Current_Entity (T2) = T2 and then Scope (Base_Type (T2)) = Scop then if Present (T1) then Fixed_Point_Error; return Any_Type; else T1 := T2; end if; end if; Next_Entity (T2); end loop; Scop := Scope (Scop); end loop; -- Look for visible fixed type declarations in the context Item := First (Context_Items (Cunit (Current_Sem_Unit))); while Present (Item) loop if Nkind (Item) = N_With_Clause then Scop := Entity (Name (Item)); T2 := First_Entity (Scop); while Present (T2) loop if Is_Fixed_Point_Type (T2) and then Scope (Base_Type (T2)) = Scop and then (Is_Potentially_Use_Visible (T2) or else In_Use (T2)) then if Present (T1) then Fixed_Point_Error; return Any_Type; else T1 := T2; end if; end if; Next_Entity (T2); end loop; end if; Next (Item); end loop; if Nkind (N) = N_Real_Literal then Error_Msg_NE ("??real literal interpreted as }!", N, T1); else Error_Msg_NE ("??universal_fixed expression interpreted as }!", N, T1); end if; return T1; end Unique_Fixed_Point_Type; ---------------------- -- Valid_Conversion -- ---------------------- function Valid_Conversion (N : Node_Id; Target : Entity_Id; Operand : Node_Id; Report_Errs : Boolean := True) return Boolean is Target_Type : constant Entity_Id := Base_Type (Target); Opnd_Type : Entity_Id := Etype (Operand); Inc_Ancestor : Entity_Id; function Conversion_Check (Valid : Boolean; Msg : String) return Boolean; -- Little routine to post Msg if Valid is False, returns Valid value procedure Conversion_Error_N (Msg : String; N : Node_Or_Entity_Id); -- If Report_Errs, then calls Errout.Error_Msg_N with its arguments procedure Conversion_Error_NE (Msg : String; N : Node_Or_Entity_Id; E : Node_Or_Entity_Id); -- If Report_Errs, then calls Errout.Error_Msg_NE with its arguments function Valid_Tagged_Conversion (Target_Type : Entity_Id; Opnd_Type : Entity_Id) return Boolean; -- Specifically test for validity of tagged conversions function Valid_Array_Conversion return Boolean; -- Check index and component conformance, and accessibility levels if -- the component types are anonymous access types (Ada 2005). ---------------------- -- Conversion_Check -- ---------------------- function Conversion_Check (Valid : Boolean; Msg : String) return Boolean is begin if not Valid -- A generic unit has already been analyzed and we have verified -- that a particular conversion is OK in that context. Since the -- instance is reanalyzed without relying on the relationships -- established during the analysis of the generic, it is possible -- to end up with inconsistent views of private types. Do not emit -- the error message in such cases. The rest of the machinery in -- Valid_Conversion still ensures the proper compatibility of -- target and operand types. and then not In_Instance then Conversion_Error_N (Msg, Operand); end if; return Valid; end Conversion_Check; ------------------------ -- Conversion_Error_N -- ------------------------ procedure Conversion_Error_N (Msg : String; N : Node_Or_Entity_Id) is begin if Report_Errs then Error_Msg_N (Msg, N); end if; end Conversion_Error_N; ------------------------- -- Conversion_Error_NE -- ------------------------- procedure Conversion_Error_NE (Msg : String; N : Node_Or_Entity_Id; E : Node_Or_Entity_Id) is begin if Report_Errs then Error_Msg_NE (Msg, N, E); end if; end Conversion_Error_NE; ---------------------------- -- Valid_Array_Conversion -- ---------------------------- function Valid_Array_Conversion return Boolean is Opnd_Comp_Type : constant Entity_Id := Component_Type (Opnd_Type); Opnd_Comp_Base : constant Entity_Id := Base_Type (Opnd_Comp_Type); Opnd_Index : Node_Id; Opnd_Index_Type : Entity_Id; Target_Comp_Type : constant Entity_Id := Component_Type (Target_Type); Target_Comp_Base : constant Entity_Id := Base_Type (Target_Comp_Type); Target_Index : Node_Id; Target_Index_Type : Entity_Id; begin -- Error if wrong number of dimensions if Number_Dimensions (Target_Type) /= Number_Dimensions (Opnd_Type) then Conversion_Error_N ("incompatible number of dimensions for conversion", Operand); return False; -- Number of dimensions matches else -- Loop through indexes of the two arrays Target_Index := First_Index (Target_Type); Opnd_Index := First_Index (Opnd_Type); while Present (Target_Index) and then Present (Opnd_Index) loop Target_Index_Type := Etype (Target_Index); Opnd_Index_Type := Etype (Opnd_Index); -- Error if index types are incompatible if not (Is_Integer_Type (Target_Index_Type) and then Is_Integer_Type (Opnd_Index_Type)) and then (Root_Type (Target_Index_Type) /= Root_Type (Opnd_Index_Type)) then Conversion_Error_N ("incompatible index types for array conversion", Operand); return False; end if; Next_Index (Target_Index); Next_Index (Opnd_Index); end loop; -- If component types have same base type, all set if Target_Comp_Base = Opnd_Comp_Base then null; -- Here if base types of components are not the same. The only -- time this is allowed is if we have anonymous access types. -- The conversion of arrays of anonymous access types can lead -- to dangling pointers. AI-392 formalizes the accessibility -- checks that must be applied to such conversions to prevent -- out-of-scope references. elsif Ekind_In (Target_Comp_Base, E_Anonymous_Access_Type, E_Anonymous_Access_Subprogram_Type) and then Ekind (Opnd_Comp_Base) = Ekind (Target_Comp_Base) and then Subtypes_Statically_Match (Target_Comp_Type, Opnd_Comp_Type) then if Type_Access_Level (Target_Type) < Deepest_Type_Access_Level (Opnd_Type) then if In_Instance_Body then Error_Msg_Warn := SPARK_Mode /= On; Conversion_Error_N ("source array type has deeper accessibility " & "level than target<<", Operand); Conversion_Error_N ("\Program_Error [<<", Operand); Rewrite (N, Make_Raise_Program_Error (Sloc (N), Reason => PE_Accessibility_Check_Failed)); Set_Etype (N, Target_Type); return False; -- Conversion not allowed because of accessibility levels else Conversion_Error_N ("source array type has deeper accessibility " & "level than target", Operand); return False; end if; else null; end if; -- All other cases where component base types do not match else Conversion_Error_N ("incompatible component types for array conversion", Operand); return False; end if; -- Check that component subtypes statically match. For numeric -- types this means that both must be either constrained or -- unconstrained. For enumeration types the bounds must match. -- All of this is checked in Subtypes_Statically_Match. if not Subtypes_Statically_Match (Target_Comp_Type, Opnd_Comp_Type) then Conversion_Error_N ("component subtypes must statically match", Operand); return False; end if; end if; return True; end Valid_Array_Conversion; ----------------------------- -- Valid_Tagged_Conversion -- ----------------------------- function Valid_Tagged_Conversion (Target_Type : Entity_Id; Opnd_Type : Entity_Id) return Boolean is begin -- Upward conversions are allowed (RM 4.6(22)) if Covers (Target_Type, Opnd_Type) or else Is_Ancestor (Target_Type, Opnd_Type) then return True; -- Downward conversion are allowed if the operand is class-wide -- (RM 4.6(23)). elsif Is_Class_Wide_Type (Opnd_Type) and then Covers (Opnd_Type, Target_Type) then return True; elsif Covers (Opnd_Type, Target_Type) or else Is_Ancestor (Opnd_Type, Target_Type) then return Conversion_Check (False, "downward conversion of tagged objects not allowed"); -- Ada 2005 (AI-251): The conversion to/from interface types is -- always valid. The types involved may be class-wide (sub)types. elsif Is_Interface (Etype (Base_Type (Target_Type))) or else Is_Interface (Etype (Base_Type (Opnd_Type))) then return True; -- If the operand is a class-wide type obtained through a limited_ -- with clause, and the context includes the nonlimited view, use -- it to determine whether the conversion is legal. elsif Is_Class_Wide_Type (Opnd_Type) and then From_Limited_With (Opnd_Type) and then Present (Non_Limited_View (Etype (Opnd_Type))) and then Is_Interface (Non_Limited_View (Etype (Opnd_Type))) then return True; elsif Is_Access_Type (Opnd_Type) and then Is_Interface (Directly_Designated_Type (Opnd_Type)) then return True; else Conversion_Error_NE ("invalid tagged conversion, not compatible with}", N, First_Subtype (Opnd_Type)); return False; end if; end Valid_Tagged_Conversion; -- Start of processing for Valid_Conversion begin Check_Parameterless_Call (Operand); if Is_Overloaded (Operand) then declare I : Interp_Index; I1 : Interp_Index; It : Interp; It1 : Interp; N1 : Entity_Id; T1 : Entity_Id; begin -- Remove procedure calls, which syntactically cannot appear in -- this context, but which cannot be removed by type checking, -- because the context does not impose a type. -- The node may be labelled overloaded, but still contain only one -- interpretation because others were discarded earlier. If this -- is the case, retain the single interpretation if legal. Get_First_Interp (Operand, I, It); Opnd_Type := It.Typ; Get_Next_Interp (I, It); if Present (It.Typ) and then Opnd_Type /= Standard_Void_Type then -- More than one candidate interpretation is available Get_First_Interp (Operand, I, It); while Present (It.Typ) loop if It.Typ = Standard_Void_Type then Remove_Interp (I); end if; -- When compiling for a system where Address is of a visible -- integer type, spurious ambiguities can be produced when -- arithmetic operations have a literal operand and return -- System.Address or a descendant of it. These ambiguities -- are usually resolved by the context, but for conversions -- there is no context type and the removal of the spurious -- operations must be done explicitly here. if not Address_Is_Private and then Is_Descendant_Of_Address (It.Typ) then Remove_Interp (I); end if; Get_Next_Interp (I, It); end loop; end if; Get_First_Interp (Operand, I, It); I1 := I; It1 := It; if No (It.Typ) then Conversion_Error_N ("illegal operand in conversion", Operand); return False; end if; Get_Next_Interp (I, It); if Present (It.Typ) then N1 := It1.Nam; T1 := It1.Typ; It1 := Disambiguate (Operand, I1, I, Any_Type); if It1 = No_Interp then Conversion_Error_N ("ambiguous operand in conversion", Operand); -- If the interpretation involves a standard operator, use -- the location of the type, which may be user-defined. if Sloc (It.Nam) = Standard_Location then Error_Msg_Sloc := Sloc (It.Typ); else Error_Msg_Sloc := Sloc (It.Nam); end if; Conversion_Error_N -- CODEFIX ("\\possible interpretation#!", Operand); if Sloc (N1) = Standard_Location then Error_Msg_Sloc := Sloc (T1); else Error_Msg_Sloc := Sloc (N1); end if; Conversion_Error_N -- CODEFIX ("\\possible interpretation#!", Operand); return False; end if; end if; Set_Etype (Operand, It1.Typ); Opnd_Type := It1.Typ; end; end if; -- Deal with conversion of integer type to address if the pragma -- Allow_Integer_Address is in effect. We convert the conversion to -- an unchecked conversion in this case and we are all done. if Address_Integer_Convert_OK (Opnd_Type, Target_Type) then Rewrite (N, Unchecked_Convert_To (Target_Type, Expression (N))); Analyze_And_Resolve (N, Target_Type); return True; end if; -- If we are within a child unit, check whether the type of the -- expression has an ancestor in a parent unit, in which case it -- belongs to its derivation class even if the ancestor is private. -- See RM 7.3.1 (5.2/3). Inc_Ancestor := Get_Incomplete_View_Of_Ancestor (Opnd_Type); -- Numeric types if Is_Numeric_Type (Target_Type) then -- A universal fixed expression can be converted to any numeric type if Opnd_Type = Universal_Fixed then return True; -- Also no need to check when in an instance or inlined body, because -- the legality has been established when the template was analyzed. -- Furthermore, numeric conversions may occur where only a private -- view of the operand type is visible at the instantiation point. -- This results in a spurious error if we check that the operand type -- is a numeric type. -- Note: in a previous version of this unit, the following tests were -- applied only for generated code (Comes_From_Source set to False), -- but in fact the test is required for source code as well, since -- this situation can arise in source code. elsif In_Instance or else In_Inlined_Body then return True; -- Otherwise we need the conversion check else return Conversion_Check (Is_Numeric_Type (Opnd_Type) or else (Present (Inc_Ancestor) and then Is_Numeric_Type (Inc_Ancestor)), "illegal operand for numeric conversion"); end if; -- Array types elsif Is_Array_Type (Target_Type) then if not Is_Array_Type (Opnd_Type) or else Opnd_Type = Any_Composite or else Opnd_Type = Any_String then Conversion_Error_N ("illegal operand for array conversion", Operand); return False; else return Valid_Array_Conversion; end if; -- Ada 2005 (AI-251): Internally generated conversions of access to -- interface types added to force the displacement of the pointer to -- reference the corresponding dispatch table. elsif not Comes_From_Source (N) and then Is_Access_Type (Target_Type) and then Is_Interface (Designated_Type (Target_Type)) then return True; -- Ada 2005 (AI-251): Anonymous access types where target references an -- interface type. elsif Is_Access_Type (Opnd_Type) and then Ekind_In (Target_Type, E_General_Access_Type, E_Anonymous_Access_Type) and then Is_Interface (Directly_Designated_Type (Target_Type)) then -- Check the static accessibility rule of 4.6(17). Note that the -- check is not enforced when within an instance body, since the -- RM requires such cases to be caught at run time. -- If the operand is a rewriting of an allocator no check is needed -- because there are no accessibility issues. if Nkind (Original_Node (N)) = N_Allocator then null; elsif Ekind (Target_Type) /= E_Anonymous_Access_Type then if Type_Access_Level (Opnd_Type) > Deepest_Type_Access_Level (Target_Type) then -- In an instance, this is a run-time check, but one we know -- will fail, so generate an appropriate warning. The raise -- will be generated by Expand_N_Type_Conversion. if In_Instance_Body then Error_Msg_Warn := SPARK_Mode /= On; Conversion_Error_N ("cannot convert local pointer to non-local access type<<", Operand); Conversion_Error_N ("\Program_Error [<<", Operand); else Conversion_Error_N ("cannot convert local pointer to non-local access type", Operand); return False; end if; -- Special accessibility checks are needed in the case of access -- discriminants declared for a limited type. elsif Ekind (Opnd_Type) = E_Anonymous_Access_Type and then not Is_Local_Anonymous_Access (Opnd_Type) then -- When the operand is a selected access discriminant the check -- needs to be made against the level of the object denoted by -- the prefix of the selected name (Object_Access_Level handles -- checking the prefix of the operand for this case). if Nkind (Operand) = N_Selected_Component and then Object_Access_Level (Operand) > Deepest_Type_Access_Level (Target_Type) then -- In an instance, this is a run-time check, but one we know -- will fail, so generate an appropriate warning. The raise -- will be generated by Expand_N_Type_Conversion. if In_Instance_Body then Error_Msg_Warn := SPARK_Mode /= On; Conversion_Error_N ("cannot convert access discriminant to non-local " & "access type<<", Operand); Conversion_Error_N ("\Program_Error [<<", Operand); -- Real error if not in instance body else Conversion_Error_N ("cannot convert access discriminant to non-local " & "access type", Operand); return False; end if; end if; -- The case of a reference to an access discriminant from -- within a limited type declaration (which will appear as -- a discriminal) is always illegal because the level of the -- discriminant is considered to be deeper than any (nameable) -- access type. if Is_Entity_Name (Operand) and then not Is_Local_Anonymous_Access (Opnd_Type) and then Ekind_In (Entity (Operand), E_In_Parameter, E_Constant) and then Present (Discriminal_Link (Entity (Operand))) then Conversion_Error_N ("discriminant has deeper accessibility level than target", Operand); return False; end if; end if; end if; return True; -- General and anonymous access types elsif Ekind_In (Target_Type, E_General_Access_Type, E_Anonymous_Access_Type) and then Conversion_Check (Is_Access_Type (Opnd_Type) and then not Ekind_In (Opnd_Type, E_Access_Subprogram_Type, E_Access_Protected_Subprogram_Type), "must be an access-to-object type") then if Is_Access_Constant (Opnd_Type) and then not Is_Access_Constant (Target_Type) then Conversion_Error_N ("access-to-constant operand type not allowed", Operand); return False; end if; -- Check the static accessibility rule of 4.6(17). Note that the -- check is not enforced when within an instance body, since the RM -- requires such cases to be caught at run time. if Ekind (Target_Type) /= E_Anonymous_Access_Type or else Is_Local_Anonymous_Access (Target_Type) or else Nkind (Associated_Node_For_Itype (Target_Type)) = N_Object_Declaration then -- Ada 2012 (AI05-0149): Perform legality checking on implicit -- conversions from an anonymous access type to a named general -- access type. Such conversions are not allowed in the case of -- access parameters and stand-alone objects of an anonymous -- access type. The implicit conversion case is recognized by -- testing that Comes_From_Source is False and that it's been -- rewritten. The Comes_From_Source test isn't sufficient because -- nodes in inlined calls to predefined library routines can have -- Comes_From_Source set to False. (Is there a better way to test -- for implicit conversions???) if Ada_Version >= Ada_2012 and then not Comes_From_Source (N) and then N /= Original_Node (N) and then Ekind (Target_Type) = E_General_Access_Type and then Ekind (Opnd_Type) = E_Anonymous_Access_Type then if Is_Itype (Opnd_Type) then -- Implicit conversions aren't allowed for objects of an -- anonymous access type, since such objects have nonstatic -- levels in Ada 2012. if Nkind (Associated_Node_For_Itype (Opnd_Type)) = N_Object_Declaration then Conversion_Error_N ("implicit conversion of stand-alone anonymous " & "access object not allowed", Operand); return False; -- Implicit conversions aren't allowed for anonymous access -- parameters. The "not Is_Local_Anonymous_Access_Type" test -- is done to exclude anonymous access results. elsif not Is_Local_Anonymous_Access (Opnd_Type) and then Nkind_In (Associated_Node_For_Itype (Opnd_Type), N_Function_Specification, N_Procedure_Specification) then Conversion_Error_N ("implicit conversion of anonymous access formal " & "not allowed", Operand); return False; -- This is a case where there's an enclosing object whose -- to which the "statically deeper than" relationship does -- not apply (such as an access discriminant selected from -- a dereference of an access parameter). elsif Object_Access_Level (Operand) = Scope_Depth (Standard_Standard) then Conversion_Error_N ("implicit conversion of anonymous access value " & "not allowed", Operand); return False; -- In other cases, the level of the operand's type must be -- statically less deep than that of the target type, else -- implicit conversion is disallowed (by RM12-8.6(27.1/3)). elsif Type_Access_Level (Opnd_Type) > Deepest_Type_Access_Level (Target_Type) then Conversion_Error_N ("implicit conversion of anonymous access value " & "violates accessibility", Operand); return False; end if; end if; elsif Type_Access_Level (Opnd_Type) > Deepest_Type_Access_Level (Target_Type) then -- In an instance, this is a run-time check, but one we know -- will fail, so generate an appropriate warning. The raise -- will be generated by Expand_N_Type_Conversion. if In_Instance_Body then Error_Msg_Warn := SPARK_Mode /= On; Conversion_Error_N ("cannot convert local pointer to non-local access type<<", Operand); Conversion_Error_N ("\Program_Error [<<", Operand); -- If not in an instance body, this is a real error else -- Avoid generation of spurious error message if not Error_Posted (N) then Conversion_Error_N ("cannot convert local pointer to non-local access type", Operand); end if; return False; end if; -- Special accessibility checks are needed in the case of access -- discriminants declared for a limited type. elsif Ekind (Opnd_Type) = E_Anonymous_Access_Type and then not Is_Local_Anonymous_Access (Opnd_Type) then -- When the operand is a selected access discriminant the check -- needs to be made against the level of the object denoted by -- the prefix of the selected name (Object_Access_Level handles -- checking the prefix of the operand for this case). if Nkind (Operand) = N_Selected_Component and then Object_Access_Level (Operand) > Deepest_Type_Access_Level (Target_Type) then -- In an instance, this is a run-time check, but one we know -- will fail, so generate an appropriate warning. The raise -- will be generated by Expand_N_Type_Conversion. if In_Instance_Body then Error_Msg_Warn := SPARK_Mode /= On; Conversion_Error_N ("cannot convert access discriminant to non-local " & "access type<<", Operand); Conversion_Error_N ("\Program_Error [<<", Operand); -- If not in an instance body, this is a real error else Conversion_Error_N ("cannot convert access discriminant to non-local " & "access type", Operand); return False; end if; end if; -- The case of a reference to an access discriminant from -- within a limited type declaration (which will appear as -- a discriminal) is always illegal because the level of the -- discriminant is considered to be deeper than any (nameable) -- access type. if Is_Entity_Name (Operand) and then Ekind_In (Entity (Operand), E_In_Parameter, E_Constant) and then Present (Discriminal_Link (Entity (Operand))) then Conversion_Error_N ("discriminant has deeper accessibility level than target", Operand); return False; end if; end if; end if; -- In the presence of limited_with clauses we have to use nonlimited -- views, if available. Check_Limited : declare function Full_Designated_Type (T : Entity_Id) return Entity_Id; -- Helper function to handle limited views -------------------------- -- Full_Designated_Type -- -------------------------- function Full_Designated_Type (T : Entity_Id) return Entity_Id is Desig : constant Entity_Id := Designated_Type (T); begin -- Handle the limited view of a type if From_Limited_With (Desig) and then Has_Non_Limited_View (Desig) then return Available_View (Desig); else return Desig; end if; end Full_Designated_Type; -- Local Declarations Target : constant Entity_Id := Full_Designated_Type (Target_Type); Opnd : constant Entity_Id := Full_Designated_Type (Opnd_Type); Same_Base : constant Boolean := Base_Type (Target) = Base_Type (Opnd); -- Start of processing for Check_Limited begin if Is_Tagged_Type (Target) then return Valid_Tagged_Conversion (Target, Opnd); else if not Same_Base then Conversion_Error_NE ("target designated type not compatible with }", N, Base_Type (Opnd)); return False; -- Ada 2005 AI-384: legality rule is symmetric in both -- designated types. The conversion is legal (with possible -- constraint check) if either designated type is -- unconstrained. elsif Subtypes_Statically_Match (Target, Opnd) or else (Has_Discriminants (Target) and then (not Is_Constrained (Opnd) or else not Is_Constrained (Target))) then -- Special case, if Value_Size has been used to make the -- sizes different, the conversion is not allowed even -- though the subtypes statically match. if Known_Static_RM_Size (Target) and then Known_Static_RM_Size (Opnd) and then RM_Size (Target) /= RM_Size (Opnd) then Conversion_Error_NE ("target designated subtype not compatible with }", N, Opnd); Conversion_Error_NE ("\because sizes of the two designated subtypes differ", N, Opnd); return False; -- Normal case where conversion is allowed else return True; end if; else Error_Msg_NE ("target designated subtype not compatible with }", N, Opnd); return False; end if; end if; end Check_Limited; -- Access to subprogram types. If the operand is an access parameter, -- the type has a deeper accessibility that any master, and cannot be -- assigned. We must make an exception if the conversion is part of an -- assignment and the target is the return object of an extended return -- statement, because in that case the accessibility check takes place -- after the return. elsif Is_Access_Subprogram_Type (Target_Type) -- Note: this test of Opnd_Type is there to prevent entering this -- branch in the case of a remote access to subprogram type, which -- is internally represented as an E_Record_Type. and then Is_Access_Type (Opnd_Type) then if Ekind (Base_Type (Opnd_Type)) = E_Anonymous_Access_Subprogram_Type and then Is_Entity_Name (Operand) and then Ekind (Entity (Operand)) = E_In_Parameter and then (Nkind (Parent (N)) /= N_Assignment_Statement or else not Is_Entity_Name (Name (Parent (N))) or else not Is_Return_Object (Entity (Name (Parent (N))))) then Conversion_Error_N ("illegal attempt to store anonymous access to subprogram", Operand); Conversion_Error_N ("\value has deeper accessibility than any master " & "(RM 3.10.2 (13))", Operand); Error_Msg_NE ("\use named access type for& instead of access parameter", Operand, Entity (Operand)); end if; -- Check that the designated types are subtype conformant Check_Subtype_Conformant (New_Id => Designated_Type (Target_Type), Old_Id => Designated_Type (Opnd_Type), Err_Loc => N); -- Check the static accessibility rule of 4.6(20) if Type_Access_Level (Opnd_Type) > Deepest_Type_Access_Level (Target_Type) then Conversion_Error_N ("operand type has deeper accessibility level than target", Operand); -- Check that if the operand type is declared in a generic body, -- then the target type must be declared within that same body -- (enforces last sentence of 4.6(20)). elsif Present (Enclosing_Generic_Body (Opnd_Type)) then declare O_Gen : constant Node_Id := Enclosing_Generic_Body (Opnd_Type); T_Gen : Node_Id; begin T_Gen := Enclosing_Generic_Body (Target_Type); while Present (T_Gen) and then T_Gen /= O_Gen loop T_Gen := Enclosing_Generic_Body (T_Gen); end loop; if T_Gen /= O_Gen then Conversion_Error_N ("target type must be declared in same generic body " & "as operand type", N); end if; end; end if; return True; -- Remote access to subprogram types elsif Is_Remote_Access_To_Subprogram_Type (Target_Type) and then Is_Remote_Access_To_Subprogram_Type (Opnd_Type) then -- It is valid to convert from one RAS type to another provided -- that their specification statically match. -- Note: at this point, remote access to subprogram types have been -- expanded to their E_Record_Type representation, and we need to -- go back to the original access type definition using the -- Corresponding_Remote_Type attribute in order to check that the -- designated profiles match. pragma Assert (Ekind (Target_Type) = E_Record_Type); pragma Assert (Ekind (Opnd_Type) = E_Record_Type); Check_Subtype_Conformant (New_Id => Designated_Type (Corresponding_Remote_Type (Target_Type)), Old_Id => Designated_Type (Corresponding_Remote_Type (Opnd_Type)), Err_Loc => N); return True; -- If it was legal in the generic, it's legal in the instance elsif In_Instance_Body then return True; -- If both are tagged types, check legality of view conversions elsif Is_Tagged_Type (Target_Type) and then Is_Tagged_Type (Opnd_Type) then return Valid_Tagged_Conversion (Target_Type, Opnd_Type); -- Types derived from the same root type are convertible elsif Root_Type (Target_Type) = Root_Type (Opnd_Type) then return True; -- In an instance or an inlined body, there may be inconsistent views of -- the same type, or of types derived from a common root. elsif (In_Instance or In_Inlined_Body) and then Root_Type (Underlying_Type (Target_Type)) = Root_Type (Underlying_Type (Opnd_Type)) then return True; -- Special check for common access type error case elsif Ekind (Target_Type) = E_Access_Type and then Is_Access_Type (Opnd_Type) then Conversion_Error_N ("target type must be general access type!", N); Conversion_Error_NE -- CODEFIX ("add ALL to }!", N, Target_Type); return False; -- Here we have a real conversion error else Conversion_Error_NE ("invalid conversion, not compatible with }", N, Opnd_Type); return False; end if; end Valid_Conversion; end Sem_Res;
37.192993
79
0.549459
c71408cc3b7127781f1c1b60c95a42e4014958f2
10,391
ada
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c5/c52104a.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/c5/c52104a.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c5/c52104a.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- C52104A.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 LENGTHS MUST MATCH IN ARRAY AND SLICE ASSIGNMENTS. -- MORE SPECIFICALLY, TEST THAT ATTEMPTED ASSIGNMENTS BETWEEN -- ARRAYS WITH NON-MATCHING LENGTHS LEAVE THE DESTINATION ARRAY -- INTACT AND CAUSE CONSTRAINT_ERROR TO BE RAISED. -- (OVERLAPS BETWEEN THE OPERANDS OF THE ASSIGNMENT STATEMENT -- ARE TREATED ELSEWHERE.) -- DIVISION A : STATICALLY-DETERMINABLE NON-NULL LENGTHS. -- RM 07/20/81 -- SPS 3/22/83 WITH REPORT; PROCEDURE C52104A IS USE REPORT ; BEGIN TEST( "C52104A" , "CHECK THAT IN ARRAY ASSIGNMENTS AND IN SLICE" & " ASSIGNMENTS THE LENGTHS MUST MATCH" ); -- IN THIS TEST WE CAN'T USE AGGREGATE ASSIGNMENT (EXCEPT WHEN -- THE AGGREGATES ARE STRING LITERALS); THEREFORE: -- -- (1) ARRAYS WILL BE INITIALIZED BY INDIVIDUAL ASSIGNMENTS; -- (2) CAN'T USE NON-NULL CONSTANT ARRAYS. -- WE ASSUME THAT IN AN ARRAY_TYPE_DEFINITION THE INDEX PORTION -- AND THE COMPONENT_TYPE PORTION ARE FUNCTIONALLY ORTHOGONAL -- ALSO AT THE IMPLEMENTATION LEVEL, I.E. THAT THE CORRECTNESS -- OF THE ACCESSING MECHANISM FOR ARRAYS DOES NOT DEPEND ON -- COMPONENT_TYPE. ACCORDINGLY WE ARE TESTING FOR SOME BUT -- NOT ALL KINDS OF COMPONENT_TYPE. (COMPONENT_TYPES INCLUDED: -- INTEGER , CHARACTER , BOOLEAN .) -- CASES DISTINGUISHED: ( 8 SELECTED CASES ARE IMPLEMENTED) -- -- ( THE 8 SELECTIONS ARE THE 5-CASE -- SERIES 10-11-12-13-14 FOLLOWED -- BY 7 , 8 , 9 (IN THIS ORDER). ) -- -- -- ( EACH DIVISION COMPRISES 3 FILES, -- COVERING RESPECTIVELY THE FIRST -- 3 , NEXT 2 , AND LAST 3 OF THE 8 -- SELECTIONS FOR THE DIVISION.) -- -- -- (1..6) (DO NOT APPLY TO NON-MATCHING OBJECTS, SINCE WE WANT -- THE OBJECTS TO HAVE THE S A M E BASE TYPE.) -- -- -- (7) UNSLICED OBJECTS OF THE PREDEFINED TYPE 'STRING' (BY -- THEMSELVES). -- -- -- (8) SLICED OBJECTS OF THE PREDEFINED TYPE 'STRING' , WITH -- STRING LITERALS. -- -- -- (9) SLICED OBJECTS OF THE PREDEFINED TYPE 'STRING' (BY -- THEMSELVES). -- -- -- (-) CONSTRAINABLE TYPES: ONLY SUBTESTS 2, 3, 4, 5, 6 -- WILL BE REPLICATED -- AS SUBTESTS 10, 11, 12, 13, 14 . -- -- -- (10) MULTIDIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS WERE -- DEFINED USING THE "BOX" COMPOUND SYMBOL. -- (TWO-DIMENSIONAL ARRAYS OF INTEGERS.) -- -- -- (11) UNSLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS -- WERE DEFINED USING THE "BOX" SYMBOL -- AND FOR WHICH THE COMPONENT TYPE IS NOT 'CHARACTER' . -- ((ONE-DIMENSIONAL) ARRAYS OF INTEGERS.) -- -- -- (12) SLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS -- WERE DEFINED USING THE "BOX" SYMBOL -- AND FOR WHICH THE COMPONENT TYPE IS NOT 'CHARACTER' . -- ((ONE-DIMENSIONAL) ARRAYS OF BOOLEANS.) -- -- -- (13) UNSLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS -- WERE DEFINED USING THE "BOX" SYMBOL -- AND FOR WHICH THE COMPONENT TYPE IS 'CHARACTER' . -- -- (STRING LITERALS ARE THE ONLY AGGREGATES WE ARE USING -- IN THIS TEST. TO FORCE SLIDING, THE LOWER LIMIT IMPLIED -- BY THE TYPEMARK WILL NOT BE 1 .) -- -- -- (14) SLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS -- WERE DEFINED USING THE "BOX" SYMBOL -- AND FOR WHICH THE COMPONENT TYPE IS 'CHARACTER' . -- -- -- -- (-) SPECIAL CASES: NULL ARRAYS....... TREATED IN DIVISION B. -- SUPERLONG ARRAYS.. (TREATED FOR DYNAMIC -- ARRAYS ONLY, -- DIVISIONS C AND D .) -- -- -- (-) THE DYNAMIC-ARRAY COUNTERPARTS OF THESE TESTS ARE IN DI- -- VISIONS C (FOR NON-NULL ARRAYS) AND D (FOR NULL ARRAYS). -- -- ------------------------------------------------------------------- -- (1..6: NOT APPLICABLE) -- -- ------------------------------------------------------------------- -- (10) MULTIDIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS WERE -- DEFINED USING THE "BOX" COMPOUND SYMBOL. -- (TWO-DIMENSIONAL ARRAYS OF INTEGERS.) DECLARE TYPE TABOX0 IS ARRAY( INTEGER RANGE <> , INTEGER RANGE <> ) OF INTEGER ; SUBTYPE TABOX01 IS TABOX0( 1..5 , 0..7 ); SUBTYPE TABOX02 IS TABOX0( 0..5 , 2..9 ); ARRX01 : TABOX01 ; ARRX02 : TABOX02 ; BEGIN -- INITIALIZATION OF RHS ARRAY: FOR I IN 1..5 LOOP FOR J IN 0..7 LOOP ARRX01( I , J ) := I * I * J ; END LOOP; END LOOP; -- INITIALIZATION OF LHS ARRAY: FOR I IN 0..5 LOOP FOR J IN 2..9 LOOP ARRX02( I , J ) := I * I * J * 3 ; END LOOP; END LOOP; -- ARRAY ASSIGNMENT: ARRX02 := ARRX01 ; FAILED( "EXCEPTION NOT RAISED - SUBTEST 10" ); EXCEPTION WHEN CONSTRAINT_ERROR => -- CHECKING THE VALUES AFTER THE ARRAY ASSIGNMENT: FOR I IN 0..5 LOOP FOR J IN 2..9 LOOP IF ARRX02( I , J ) /= I * I * J * 3 THEN FAILED( "ORIG. VALUE ALTERED (10)" ); END IF; END LOOP; END LOOP; WHEN OTHERS => FAILED( "WRONG EXCEPTION RAISED - SUBTEST 10" ); END ; ------------------------------------------------------------------- -- (11) UNSLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS -- WERE DEFINED USING THE "BOX" SYMBOL -- AND FOR WHICH THE COMPONENT TYPE IS NOT 'CHARACTER' . -- ((ONE-DIMENSIONAL) ARRAYS OF INTEGERS.) DECLARE TYPE TABOX1 IS ARRAY( INTEGER RANGE <> ) OF INTEGER ; SUBTYPE TABOX11 IS TABOX1( 1..5 ) ; ARRX11 : TABOX11 ; ARRX12 : TABOX1( 6..9 ); BEGIN -- INITIALIZATION OF RHS ARRAY: FOR I IN 1..5 LOOP ARRX11( I ) := I * I ; END LOOP; -- INITIALIZATION OF LHS ARRAY: FOR I IN 6..9 LOOP ARRX12( I ) := I * I * 3 ; END LOOP; -- ARRAY ASSIGNMENT: ARRX12 := ARRX11 ; FAILED( "EXCEPTION NOT RAISED - SUBTEST 11" ); EXCEPTION WHEN CONSTRAINT_ERROR => -- CHECKING THE VALUES AFTER THE ARRAY ASSIGNMENT: FOR I IN 6..9 LOOP IF ARRX12( I ) /= I * I * 3 THEN FAILED( "ORIG. VALUE ALTERED (11)" ); END IF; END LOOP; WHEN OTHERS => FAILED( "WRONG EXCEPTION RAISED - SUBTEST 11" ); END ; ------------------------------------------------------------------- -- (12) SLICED ONE-DIMENSIONAL ARRAY OBJECTS WHOSE TYPEMARKS -- WERE DEFINED USING THE "BOX" SYMBOL -- AND FOR WHICH THE COMPONENT TYPE IS NOT 'CHARACTER' . -- ((ONE-DIMENSIONAL) ARRAYS OF BOOLEANS.) DECLARE TYPE TABOX5 IS ARRAY( INTEGER RANGE <> ) OF BOOLEAN ; SUBTYPE TABOX51 IS TABOX5( 1..5 ); ARRX51 : TABOX51 ; ARRX52 : TABOX5( 5..9 ); BEGIN -- INITIALIZATION OF LHS ARRAY: FOR I IN 5..9 LOOP ARRX52( I ) := FALSE ; END LOOP; -- INITIALIZATION OF RHS ARRAY: FOR I IN 1..5 LOOP ARRX51( I ) := TRUE ; END LOOP; -- SLICE ASSIGNMENT: ARRX52(6..9) := ARRX51(3..3) ; FAILED( "EXCEPTION NOT RAISED (12)" ); EXCEPTION WHEN CONSTRAINT_ERROR => -- CHECKING THE VALUES AFTER THE SLICE ASSIGNMENT: FOR I IN 5..9 LOOP IF ARRX52( I ) /= FALSE THEN FAILED( "LHS ARRAY ALTERED ( 12 ) " ); END IF; END LOOP; WHEN OTHERS => FAILED( "EXCEPTION RAISED - SUBTEST 12" ); END ; ------------------------------------------------------------------- RESULT ; END C52104A;
30.206395
79
0.491002
a1af75794cdf2a7d17613712ae9b691625dd10d6
268,058
adb
Ada
code-HLS/PLAN8_8/.autopilot/db/sigmoid_plan.bind.adb
Pz1996/HLS-Sigmoid
319f418a71d3dd10b68f5eede68e8153d86c8d70
[ "Apache-2.0" ]
null
null
null
code-HLS/PLAN8_8/.autopilot/db/sigmoid_plan.bind.adb
Pz1996/HLS-Sigmoid
319f418a71d3dd10b68f5eede68e8153d86c8d70
[ "Apache-2.0" ]
null
null
null
code-HLS/PLAN8_8/.autopilot/db/sigmoid_plan.bind.adb
Pz1996/HLS-Sigmoid
319f418a71d3dd10b68f5eede68e8153d86c8d70
[ "Apache-2.0" ]
null
null
null
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization> <boost_serialization signature="serialization::archive" version="17"> <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>sigmoid_plan</name> <module_structure>Pipeline</module_structure> <ret_bitwidth>8</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>1</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>in_r</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo class_id="6" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>in.V</originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1953394531</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</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> </ports> <nodes class_id="8" tracking_level="0" version="0"> <count>77</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_2"> <Value> <Obj> <type>0</type> <id>7</id> <name>in_read</name> <fileName>Sigmoid.cpp</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>38</lineNumber> <contextFuncName>sigmoid_plan</contextFuncName> <contextNormFuncName>sigmoid_plan</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="10" tracking_level="0" version="0"> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</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>Sigmoid.cpp</first> <second>sigmoid_plan</second> </first> <second>38</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>741749052</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>86</item> <item>87</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>1</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_3"> <Value> <Obj> <type>0</type> <id>8</id> <name>input</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>737</lineNumber> <contextFuncName>operator=&amp;lt;8, 4, false, AP_TRN, AP_WRAP, 0&amp;gt;</contextFuncName> <contextNormFuncName>operator_assign_8_4_false_AP_TRN_AP_WRAP_0</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator=&amp;lt;8, 4, false, AP_TRN, AP_WRAP, 0&amp;gt;</second> </first> <second>737</second> </item> </second> </item> </inlineStackInfo> <originalName>input</originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>741487420</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>11</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>89</item> <item>90</item> <item>92</item> </oprand_edges> <opcode>bitconcatenate</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="_4"> <Value> <Obj> <type>0</type> <id>9</id> <name>zext_ln43</name> <fileName>Sigmoid.cpp</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>43</lineNumber> <contextFuncName>sigmoid_plan</contextFuncName> <contextNormFuncName>sigmoid_plan</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>Sigmoid.cpp</first> <second>sigmoid_plan</second> </first> <second>43</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>741749052</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>13</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>93</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>54</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_5"> <Value> <Obj> <type>0</type> <id>10</id> <name>icmp_ln1549</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1549</lineNumber> <contextFuncName>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</contextFuncName> <contextNormFuncName>operator_ge_32_32_true_AP_TRN_AP_WRAP_0</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</second> </first> <second>1549</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>icmp</opType> <implIndex>auto</implIndex> <coreName>Cmp</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>9</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>94</item> <item>96</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>0.94</m_delay> <m_topoIndex>55</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_6"> <Value> <Obj> <type>0</type> <id>11</id> <name>icmp_ln938</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>938</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>938</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>icmp</opType> <implIndex>auto</implIndex> <coreName>Cmp</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>9</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>97</item> <item>99</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>0.94</m_delay> <m_topoIndex>56</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_7"> <Value> <Obj> <type>0</type> <id>12</id> <name>p_Result_s</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_int_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1227</lineNumber> <contextFuncName>countLeadingZeros</contextFuncName> <contextNormFuncName>countLeadingZeros</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_int_base.h</first> <second>countLeadingZeros</second> </first> <second>1227</second> </item> </second> </item> </inlineStackInfo> <originalName>__Result__</originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>539767840</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>101</item> <item>102</item> <item>104</item> <item>106</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>2</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_8"> <Value> <Obj> <type>0</type> <id>13</id> <name>p_Result_6</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_int_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1228</lineNumber> <contextFuncName>countLeadingZeros</contextFuncName> <contextNormFuncName>countLeadingZeros</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_int_base.h</first> <second>countLeadingZeros</second> </first> <second>1228</second> </item> </second> </item> </inlineStackInfo> <originalName>__Result__</originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>741749052</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>108</item> <item>110</item> <item>111</item> </oprand_edges> <opcode>bitconcatenate</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>3</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_9"> <Value> <Obj> <type>0</type> <id>14</id> <name>l</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_int_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1229</lineNumber> <contextFuncName>countLeadingZeros</contextFuncName> <contextNormFuncName>countLeadingZeros</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_int_base.h</first> <second>countLeadingZeros</second> </first> <second>1229</second> </item> </second> </item> </inlineStackInfo> <originalName>l</originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>741613612</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>113</item> <item>114</item> <item>116</item> </oprand_edges> <opcode>cttz</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>4</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_10"> <Value> <Obj> <type>0</type> <id>15</id> <name>sub_ln947</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>947</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>947</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>sub</opType> <implIndex>fabric</implIndex> <coreName>Adder</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>118</item> <item>119</item> </oprand_edges> <opcode>sub</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.51</m_delay> <m_topoIndex>5</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_11"> <Value> <Obj> <type>0</type> <id>16</id> <name>trunc_ln947</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>947</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>947</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>741487420</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>120</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>6</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_12"> <Value> <Obj> <type>0</type> <id>17</id> <name>lsb_index</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>947</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>947</second> </item> </second> </item> </inlineStackInfo> <originalName>lsb_index</originalName> <rtlName></rtlName> <control>auto</control> <opType>add</opType> <implIndex>fabric</implIndex> <coreName>Adder</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>121</item> <item>123</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.51</m_delay> <m_topoIndex>7</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_13"> <Value> <Obj> <type>0</type> <id>18</id> <name>tmp_2</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>949</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>949</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>741487420</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>31</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>125</item> <item>126</item> <item>128</item> <item>130</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>8</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_14"> <Value> <Obj> <type>0</type> <id>19</id> <name>icmp_ln949</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>949</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>949</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>icmp</opType> <implIndex>auto</implIndex> <coreName>Cmp</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>9</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>131</item> <item>133</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.28</m_delay> <m_topoIndex>9</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_15"> <Value> <Obj> <type>0</type> <id>20</id> <name>trunc_ln950</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>950</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>950</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>539767840</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>134</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>10</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_16"> <Value> <Obj> <type>0</type> <id>21</id> <name>sub_ln950</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>950</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>950</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>sub</opType> <implIndex>fabric</implIndex> <coreName>Adder</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>136</item> <item>137</item> </oprand_edges> <opcode>sub</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.01</m_delay> <m_topoIndex>11</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_17"> <Value> <Obj> <type>0</type> <id>22</id> <name>zext_ln950</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>950</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>950</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>741613612</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>138</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>12</m_topoIndex> <m_clusterGroupNumber>1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_18"> <Value> <Obj> <type>0</type> <id>23</id> <name>lshr_ln950</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>950</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>950</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>lshr</opType> <implIndex>auto_pipe</implIndex> <coreName>Shifter</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>75</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>140</item> <item>141</item> </oprand_edges> <opcode>lshr</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="_19"> <Value> <Obj> <type>0</type> <id>24</id> <name>p_Result_2</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>950</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>950</second> </item> </second> </item> </inlineStackInfo> <originalName>__Result__</originalName> <rtlName></rtlName> <control>auto</control> <opType>and</opType> <implIndex>auto</implIndex> <coreName>LogicGate</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>74</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>142</item> <item>143</item> </oprand_edges> <opcode>and</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="_20"> <Value> <Obj> <type>0</type> <id>25</id> <name>icmp_ln950</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>950</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>950</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>icmp</opType> <implIndex>auto</implIndex> <coreName>Cmp</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>9</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>144</item> <item>145</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.41</m_delay> <m_topoIndex>15</m_topoIndex> <m_clusterGroupNumber>1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_21"> <Value> <Obj> <type>0</type> <id>26</id> <name>tmp_6</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>952</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>952</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>539767840</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>147</item> <item>148</item> <item>149</item> </oprand_edges> <opcode>bitselect</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>2</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_22"> <Value> <Obj> <type>0</type> <id>27</id> <name>xor_ln952</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>952</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>952</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>xor</opType> <implIndex>auto</implIndex> <coreName>LogicGate</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>74</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>150</item> <item>151</item> </oprand_edges> <opcode>xor</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>2</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_23"> <Value> <Obj> <type>0</type> <id>28</id> <name>and_ln949</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>949</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>949</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>and</opType> <implIndex>auto</implIndex> <coreName>LogicGate</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>74</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>152</item> <item>153</item> </oprand_edges> <opcode>and</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>2</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_24"> <Value> <Obj> <type>0</type> <id>29</id> <name>add_ln952</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>952</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>952</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>add</opType> <implIndex>fabric</implIndex> <coreName>Adder</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>154</item> <item>156</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.35</m_delay> <m_topoIndex>19</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_25"> <Value> <Obj> <type>0</type> <id>30</id> <name>shl_ln952</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>952</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>952</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>shl</opType> <implIndex>auto_pipe</implIndex> <coreName>Shifter</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>75</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>158</item> <item>159</item> </oprand_edges> <opcode>shl</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>3</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_26"> <Value> <Obj> <type>0</type> <id>31</id> <name>and_ln952</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>952</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>952</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>and</opType> <implIndex>auto</implIndex> <coreName>LogicGate</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>74</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>160</item> <item>161</item> </oprand_edges> <opcode>and</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>3</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_27"> <Value> <Obj> <type>0</type> <id>32</id> <name>p_Result_3</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>952</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>952</second> </item> </second> </item> </inlineStackInfo> <originalName>__Result__</originalName> <rtlName></rtlName> <control>auto</control> <opType>icmp</opType> <implIndex>auto</implIndex> <coreName>Cmp</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>9</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>162</item> <item>163</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.83</m_delay> <m_topoIndex>22</m_topoIndex> <m_clusterGroupNumber>3</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_28"> <Value> <Obj> <type>0</type> <id>33</id> <name>a</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>952</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>952</second> </item> </second> </item> </inlineStackInfo> <originalName>a</originalName> <rtlName></rtlName> <control>auto</control> <opType>or</opType> <implIndex>auto</implIndex> <coreName>LogicGate</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>74</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>164</item> <item>165</item> </oprand_edges> <opcode>or</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>23</m_topoIndex> <m_clusterGroupNumber>2</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_29"> <Value> <Obj> <type>0</type> <id>34</id> <name>zext_ln960</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>960</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>960</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>976894836</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>166</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>32</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_30"> <Value> <Obj> <type>0</type> <id>35</id> <name>icmp_ln961</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>961</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>961</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>icmp</opType> <implIndex>auto</implIndex> <coreName>Cmp</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>9</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>167</item> <item>168</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.28</m_delay> <m_topoIndex>24</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_31"> <Value> <Obj> <type>0</type> <id>36</id> <name>add_ln961</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>961</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>961</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>add</opType> <implIndex>fabric</implIndex> <coreName>Adder</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>169</item> <item>171</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.51</m_delay> <m_topoIndex>25</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_32"> <Value> <Obj> <type>0</type> <id>37</id> <name>zext_ln961</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>961</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>961</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>27069648</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>172</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>33</m_topoIndex> <m_clusterGroupNumber>4</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_33"> <Value> <Obj> <type>0</type> <id>38</id> <name>lshr_ln961</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>961</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>961</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>lshr</opType> <implIndex>auto_pipe</implIndex> <coreName>Shifter</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>75</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>173</item> <item>174</item> </oprand_edges> <opcode>lshr</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>4</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_34"> <Value> <Obj> <type>0</type> <id>39</id> <name>sub_ln962</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>962</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>962</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>sub</opType> <implIndex>fabric</implIndex> <coreName>Adder</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>176</item> <item>177</item> </oprand_edges> <opcode>sub</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.51</m_delay> <m_topoIndex>26</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_35"> <Value> <Obj> <type>0</type> <id>40</id> <name>zext_ln962</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>962</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>962</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>4294967295</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>178</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>35</m_topoIndex> <m_clusterGroupNumber>4</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_36"> <Value> <Obj> <type>0</type> <id>41</id> <name>shl_ln962</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>962</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>962</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>shl</opType> <implIndex>auto_pipe</implIndex> <coreName>Shifter</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>75</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>179</item> <item>180</item> </oprand_edges> <opcode>shl</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>4</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_37"> <Value> <Obj> <type>0</type> <id>42</id> <name>tobool29_i_i290</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>952</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>952</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>and</opType> <implIndex>auto</implIndex> <coreName>LogicGate</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>74</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>181</item> <item>182</item> </oprand_edges> <opcode>and</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.47</m_delay> <m_topoIndex>27</m_topoIndex> <m_clusterGroupNumber>2</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_38"> <Value> <Obj> <type>0</type> <id>43</id> <name>m</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>961</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>961</second> </item> </second> </item> </inlineStackInfo> <originalName>m</originalName> <rtlName></rtlName> <control>auto</control> <opType>select</opType> <implIndex>auto_sel</implIndex> <coreName>Sel</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>73</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>183</item> <item>184</item> <item>185</item> </oprand_edges> <opcode>select</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>4</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_39"> <Value> <Obj> <type>0</type> <id>44</id> <name>zext_ln964</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>964</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>964</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1214215017</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>186</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>38</m_topoIndex> <m_clusterGroupNumber>4</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_40"> <Value> <Obj> <type>0</type> <id>45</id> <name>m_1</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>964</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>964</second> </item> </second> </item> </inlineStackInfo> <originalName>m</originalName> <rtlName></rtlName> <control>auto</control> <opType>add</opType> <implIndex>fabric</implIndex> <coreName>Adder</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>187</item> <item>188</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>2.00</m_delay> <m_topoIndex>39</m_topoIndex> <m_clusterGroupNumber>4</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_41"> <Value> <Obj> <type>0</type> <id>46</id> <name>m_4</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>965</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>965</second> </item> </second> </item> </inlineStackInfo> <originalName>m</originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>808662074</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>63</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>190</item> <item>191</item> <item>192</item> <item>194</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="_42"> <Value> <Obj> <type>0</type> <id>47</id> <name>zext_ln965</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>965</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>965</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1852142702</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>195</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>41</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_43"> <Value> <Obj> <type>0</type> <id>48</id> <name>p_Result_4</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>968</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>968</second> </item> </second> </item> </inlineStackInfo> <originalName>__Result__</originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1868767291</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>197</item> <item>198</item> <item>199</item> </oprand_edges> <opcode>bitselect</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="_44"> <Value> <Obj> <type>0</type> <id>49</id> <name>select_ln946</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>946</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>946</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>select</opType> <implIndex>auto_sel</implIndex> <coreName>Sel</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>73</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>11</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>200</item> <item>202</item> <item>204</item> </oprand_edges> <opcode>select</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.49</m_delay> <m_topoIndex>43</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_45"> <Value> <Obj> <type>0</type> <id>50</id> <name>trunc_ln946</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>946</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>946</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>574106982</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>11</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>205</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>28</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_46"> <Value> <Obj> <type>0</type> <id>51</id> <name>sub_ln968</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>968</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>968</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>add</opType> <implIndex>tadder</implIndex> <coreName>TAddSub</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>10</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>11</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>207</item> <item>208</item> </oprand_edges> <opcode>sub</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="_47"> <Value> <Obj> <type>0</type> <id>52</id> <name>add_ln968</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>968</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>968</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>add</opType> <implIndex>tadder</implIndex> <coreName>TAddSub</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>10</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>11</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>209</item> <item>210</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.98</m_delay> <m_topoIndex>45</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_48"> <Value> <Obj> <type>0</type> <id>53</id> <name>tmp</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>974</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>974</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1279811443</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>12</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>212</item> <item>214</item> <item>215</item> </oprand_edges> <opcode>bitconcatenate</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="_49"> <Value> <Obj> <type>0</type> <id>54</id> <name>p_Result_7</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>974</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>974</second> </item> </second> </item> </inlineStackInfo> <originalName>__Result__</originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1702390118</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>5</count> <item_version>0</item_version> <item>217</item> <item>218</item> <item>219</item> <item>221</item> <item>222</item> </oprand_edges> <opcode>partset</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>47</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_50"> <Value> <Obj> <type>0</type> <id>55</id> <name>bitcast_ln741</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_common.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>741</lineNumber> <contextFuncName>rawBitsToDouble</contextFuncName> <contextNormFuncName>rawBitsToDouble</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_common.h</first> <second>rawBitsToDouble</second> </first> <second>741</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1869635878</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>223</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>48</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_51"> <Value> <Obj> <type>0</type> <id>56</id> <name>trunc_ln3</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1560</lineNumber> <contextFuncName>operator&amp;gt;=</contextFuncName> <contextNormFuncName>operator_ge</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;=</second> </first> <second>1560</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1713384500</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>52</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>225</item> <item>226</item> <item>227</item> <item>228</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>49</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_52"> <Value> <Obj> <type>0</type> <id>57</id> <name>icmp_ln1560</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1560</lineNumber> <contextFuncName>operator&amp;gt;=</contextFuncName> <contextNormFuncName>operator_ge</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;=</second> </first> <second>1560</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>icmp</opType> <implIndex>auto</implIndex> <coreName>Cmp</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>9</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>229</item> <item>231</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.07</m_delay> <m_topoIndex>50</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_53"> <Value> <Obj> <type>0</type> <id>58</id> <name>icmp_ln1560_1</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1560</lineNumber> <contextFuncName>operator&amp;gt;=</contextFuncName> <contextNormFuncName>operator_ge</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;=</second> </first> <second>1560</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>icmp</opType> <implIndex>auto</implIndex> <coreName>Cmp</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>9</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>232</item> <item>234</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.36</m_delay> <m_topoIndex>51</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_54"> <Value> <Obj> <type>0</type> <id>59</id> <name>or_ln1560</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1560</lineNumber> <contextFuncName>operator&amp;gt;=</contextFuncName> <contextNormFuncName>operator_ge</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;=</second> </first> <second>1560</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>or</opType> <implIndex>auto</implIndex> <coreName>LogicGate</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>74</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>235</item> <item>236</item> </oprand_edges> <opcode>or</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>5</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_55"> <Value> <Obj> <type>0</type> <id>60</id> <name>tmp_1</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1560</lineNumber> <contextFuncName>operator&amp;gt;=</contextFuncName> <contextNormFuncName>operator_ge</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;=</second> </first> <second>1560</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>dcmp</opType> <implIndex>auto</implIndex> <coreName>DCompare</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>38</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>237</item> <item>239</item> </oprand_edges> <opcode>dcmp</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>2.81</m_delay> <m_topoIndex>52</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_56"> <Value> <Obj> <type>0</type> <id>61</id> <name>and_ln1560</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1560</lineNumber> <contextFuncName>operator&amp;gt;=</contextFuncName> <contextNormFuncName>operator_ge</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;=</second> </first> <second>1560</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>and</opType> <implIndex>auto</implIndex> <coreName>LogicGate</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>74</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>240</item> <item>241</item> </oprand_edges> <opcode>and</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>5</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_57"> <Value> <Obj> <type>0</type> <id>62</id> <name>xor_ln1560</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1560</lineNumber> <contextFuncName>operator&amp;gt;=</contextFuncName> <contextNormFuncName>operator_ge</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;=</second> </first> <second>1560</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>xor</opType> <implIndex>auto</implIndex> <coreName>LogicGate</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>74</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>242</item> <item>243</item> </oprand_edges> <opcode>xor</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.47</m_delay> <m_topoIndex>59</m_topoIndex> <m_clusterGroupNumber>5</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_58"> <Value> <Obj> <type>0</type> <id>63</id> <name>tmp_8</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1549</lineNumber> <contextFuncName>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</contextFuncName> <contextNormFuncName>operator_ge_32_32_true_AP_TRN_AP_WRAP_0</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</second> </first> <second>1549</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>842019375</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>245</item> <item>246</item> <item>248</item> <item>249</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>29</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_59"> <Value> <Obj> <type>0</type> <id>64</id> <name>icmp_ln1549_1</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1549</lineNumber> <contextFuncName>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</contextFuncName> <contextNormFuncName>operator_ge_32_32_true_AP_TRN_AP_WRAP_0</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</second> </first> <second>1549</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>icmp</opType> <implIndex>auto</implIndex> <coreName>Cmp</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>9</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>250</item> <item>252</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>0.86</m_delay> <m_topoIndex>30</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_60"> <Value> <Obj> <type>0</type> <id>65</id> <name>x0_V</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>712</lineNumber> <contextFuncName>operator=&amp;lt;17, 5, false, AP_TRN, AP_WRAP, 0&amp;gt;</contextFuncName> <contextNormFuncName>operator_assign_17_5_false_AP_TRN_AP_WRAP_0</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator=&amp;lt;17, 5, false, AP_TRN, AP_WRAP, 0&amp;gt;</second> </first> <second>712</second> </item> </second> </item> </inlineStackInfo> <originalName>x0.V</originalName> <rtlName></rtlName> <control>auto</control> <opType>add</opType> <implIndex>fabric</implIndex> <coreName>Adder</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>13</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>253</item> <item>255</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.35</m_delay> <m_topoIndex>60</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_61"> <Value> <Obj> <type>0</type> <id>66</id> <name>r_1</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1386</lineNumber> <contextFuncName>operator&amp;gt;&amp;gt;</contextFuncName> <contextNormFuncName>operator_rs</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;&amp;gt;</second> </first> <second>1386</second> </item> </second> </item> </inlineStackInfo> <originalName>r</originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1868525665</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>13</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>257</item> <item>258</item> <item>260</item> </oprand_edges> <opcode>bitconcatenate</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="_62"> <Value> <Obj> <type>0</type> <id>67</id> <name>x0_V_1</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>712</lineNumber> <contextFuncName>operator=&amp;lt;17, 5, false, AP_TRN, AP_WRAP, 0&amp;gt;</contextFuncName> <contextNormFuncName>operator_assign_17_5_false_AP_TRN_AP_WRAP_0</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator=&amp;lt;17, 5, false, AP_TRN, AP_WRAP, 0&amp;gt;</second> </first> <second>712</second> </item> </second> </item> </inlineStackInfo> <originalName>x0.V</originalName> <rtlName></rtlName> <control>auto</control> <opType>add</opType> <implIndex>fabric</implIndex> <coreName>Adder</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>13</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>261</item> <item>263</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.35</m_delay> <m_topoIndex>62</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_63"> <Value> <Obj> <type>0</type> <id>68</id> <name>trunc_ln1386</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1386</lineNumber> <contextFuncName>operator&amp;gt;&amp;gt;</contextFuncName> <contextNormFuncName>operator_rs</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;&amp;gt;</second> </first> <second>1386</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1663052091</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>264</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>31</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_64"> <Value> <Obj> <type>0</type> <id>69</id> <name>r_2</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1386</lineNumber> <contextFuncName>operator&amp;gt;&amp;gt;</contextFuncName> <contextNormFuncName>operator_rs</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;&amp;gt;</second> </first> <second>1386</second> </item> </second> </item> </inlineStackInfo> <originalName>r</originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>540767087</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>13</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>266</item> <item>267</item> <item>269</item> </oprand_edges> <opcode>bitconcatenate</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>63</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_65"> <Value> <Obj> <type>0</type> <id>70</id> <name>x0_V_2</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>712</lineNumber> <contextFuncName>operator=&amp;lt;17, 5, false, AP_TRN, AP_WRAP, 0&amp;gt;</contextFuncName> <contextNormFuncName>operator_assign_17_5_false_AP_TRN_AP_WRAP_0</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator=&amp;lt;17, 5, false, AP_TRN, AP_WRAP, 0&amp;gt;</second> </first> <second>712</second> </item> </second> </item> </inlineStackInfo> <originalName>x0.V</originalName> <rtlName></rtlName> <control>auto</control> <opType>add</opType> <implIndex>fabric</implIndex> <coreName>Adder</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>13</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>270</item> <item>272</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.35</m_delay> <m_topoIndex>64</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_66"> <Value> <Obj> <type>0</type> <id>71</id> <name>or_ln938</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>938</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>938</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>or</opType> <implIndex>auto</implIndex> <coreName>LogicGate</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>74</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>273</item> <item>274</item> </oprand_edges> <opcode>or</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.47</m_delay> <m_topoIndex>65</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_67"> <Value> <Obj> <type>0</type> <id>72</id> <name>or_ln1560_1</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1560</lineNumber> <contextFuncName>operator&amp;gt;=</contextFuncName> <contextNormFuncName>operator_ge</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;=</second> </first> <second>1560</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>or</opType> <implIndex>auto</implIndex> <coreName>LogicGate</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>74</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>275</item> <item>276</item> </oprand_edges> <opcode>or</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>6</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_68"> <Value> <Obj> <type>0</type> <id>73</id> <name>xor_ln938</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>938</lineNumber> <contextFuncName>to_double</contextFuncName> <contextNormFuncName>to_double</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>to_double</second> </first> <second>938</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>xor</opType> <implIndex>auto</implIndex> <coreName>LogicGate</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>74</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>277</item> <item>278</item> </oprand_edges> <opcode>xor</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>67</m_topoIndex> <m_clusterGroupNumber>7</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_69"> <Value> <Obj> <type>0</type> <id>74</id> <name>and_ln1549</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1549</lineNumber> <contextFuncName>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</contextFuncName> <contextNormFuncName>operator_ge_32_32_true_AP_TRN_AP_WRAP_0</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</second> </first> <second>1549</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>and</opType> <implIndex>auto</implIndex> <coreName>LogicGate</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>74</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>279</item> <item>280</item> </oprand_edges> <opcode>and</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>7</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_70"> <Value> <Obj> <type>0</type> <id>75</id> <name>and_ln1549_1</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1549</lineNumber> <contextFuncName>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</contextFuncName> <contextNormFuncName>operator_ge_32_32_true_AP_TRN_AP_WRAP_0</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</second> </first> <second>1549</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>and</opType> <implIndex>auto</implIndex> <coreName>LogicGate</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>74</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>281</item> <item>282</item> </oprand_edges> <opcode>and</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>7</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_71"> <Value> <Obj> <type>0</type> <id>76</id> <name>or_ln1549</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1549</lineNumber> <contextFuncName>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</contextFuncName> <contextNormFuncName>operator_ge_32_32_true_AP_TRN_AP_WRAP_0</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</second> </first> <second>1549</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>or</opType> <implIndex>auto</implIndex> <coreName>LogicGate</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>74</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>283</item> <item>284</item> </oprand_edges> <opcode>or</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.47</m_delay> <m_topoIndex>70</m_topoIndex> <m_clusterGroupNumber>7</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_72"> <Value> <Obj> <type>0</type> <id>77</id> <name>tmp_3</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>717</lineNumber> <contextFuncName>operator=&amp;lt;16, 4, false, AP_TRN, AP_WRAP, 0&amp;gt;</contextFuncName> <contextNormFuncName>operator_assign_16_4_false_AP_TRN_AP_WRAP_0</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator=&amp;lt;16, 4, false, AP_TRN, AP_WRAP, 0&amp;gt;</second> </first> <second>717</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1601200416</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>286</item> <item>287</item> <item>289</item> <item>291</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>71</m_topoIndex> <m_clusterGroupNumber>8</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_73"> <Value> <Obj> <type>0</type> <id>78</id> <name>select_ln1549</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1549</lineNumber> <contextFuncName>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</contextFuncName> <contextNormFuncName>operator_ge_32_32_true_AP_TRN_AP_WRAP_0</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</second> </first> <second>1549</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>select</opType> <implIndex>auto_sel</implIndex> <coreName>Sel</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>73</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>292</item> <item>294</item> <item>295</item> </oprand_edges> <opcode>select</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>8</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_74"> <Value> <Obj> <type>0</type> <id>79</id> <name>tmp_4</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>717</lineNumber> <contextFuncName>operator=&amp;lt;16, 4, false, AP_TRN, AP_WRAP, 0&amp;gt;</contextFuncName> <contextNormFuncName>operator_assign_16_4_false_AP_TRN_AP_WRAP_0</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator=&amp;lt;16, 4, false, AP_TRN, AP_WRAP, 0&amp;gt;</second> </first> <second>717</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1885420403</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>296</item> <item>297</item> <item>298</item> <item>299</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>73</m_topoIndex> <m_clusterGroupNumber>6</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_75"> <Value> <Obj> <type>0</type> <id>80</id> <name>tmp_5</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>717</lineNumber> <contextFuncName>operator=&amp;lt;16, 4, false, AP_TRN, AP_WRAP, 0&amp;gt;</contextFuncName> <contextNormFuncName>operator_assign_16_4_false_AP_TRN_AP_WRAP_0</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator=&amp;lt;16, 4, false, AP_TRN, AP_WRAP, 0&amp;gt;</second> </first> <second>717</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>997484326</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>300</item> <item>301</item> <item>302</item> <item>303</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>74</m_topoIndex> <m_clusterGroupNumber>6</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_76"> <Value> <Obj> <type>0</type> <id>81</id> <name>select_ln1549_1</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1549</lineNumber> <contextFuncName>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</contextFuncName> <contextNormFuncName>operator_ge_32_32_true_AP_TRN_AP_WRAP_0</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</second> </first> <second>1549</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>select</opType> <implIndex>auto_sel</implIndex> <coreName>Sel</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>73</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>304</item> <item>305</item> <item>306</item> </oprand_edges> <opcode>select</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.47</m_delay> <m_topoIndex>75</m_topoIndex> <m_clusterGroupNumber>6</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_77"> <Value> <Obj> <type>0</type> <id>82</id> <name>select_ln1549_2</name> <fileName>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>1549</lineNumber> <contextFuncName>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</contextFuncName> <contextNormFuncName>operator_ge_32_32_true_AP_TRN_AP_WRAP_0</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>C:/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot\ap_fixed_base.h</first> <second>operator&amp;gt;=&amp;lt;32, 32, true, AP_TRN, AP_WRAP, 0&amp;gt;</second> </first> <second>1549</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control>auto</control> <opType>select</opType> <implIndex>auto_sel</implIndex> <coreName>Sel</coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>73</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>307</item> <item>308</item> <item>309</item> </oprand_edges> <opcode>select</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.37</m_delay> <m_topoIndex>76</m_topoIndex> <m_clusterGroupNumber>8</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_78"> <Value> <Obj> <type>0</type> <id>83</id> <name>_ln50</name> <fileName>Sigmoid.cpp</fileName> <fileDirectory>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>sigmoid_plan</contextFuncName> <contextNormFuncName>sigmoid_plan</contextNormFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\Sunnyday\AppData\Roaming\Xilinx\Vitis</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>Sigmoid.cpp</first> <second>sigmoid_plan</second> </first> <second>50</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1953852527</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>310</item> </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>77</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>37</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_79"> <Value> <Obj> <type>2</type> <id>91</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1953394531</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>3</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_80"> <Value> <Obj> <type>2</type> <id>95</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1953394531</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <const_type>0</const_type> <content>79</content> </item> <item class_id_reference="16" object_id="_81"> <Value> <Obj> <type>2</type> <id>98</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1953394531</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_82"> <Value> <Obj> <type>2</type> <id>103</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1953394531</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>7</content> </item> <item class_id_reference="16" object_id="_83"> <Value> <Obj> <type>2</type> <id>105</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1953394531</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_84"> <Value> <Obj> <type>2</type> <id>109</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1818322464</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>24</bitwidth> </Value> <const_type>0</const_type> <content>16777215</content> </item> <item class_id_reference="16" object_id="_85"> <Value> <Obj> <type>2</type> <id>115</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>892811054</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_86"> <Value> <Obj> <type>2</type> <id>117</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1601134448</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>8</content> </item> <item class_id_reference="16" object_id="_87"> <Value> <Obj> <type>2</type> <id>122</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1869635878</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>4294967243</content> </item> <item class_id_reference="16" object_id="_88"> <Value> <Obj> <type>2</type> <id>127</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>891905380</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_89"> <Value> <Obj> <type>2</type> <id>129</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1702043749</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>31</content> </item> <item class_id_reference="16" object_id="_90"> <Value> <Obj> <type>2</type> <id>132</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>572669294</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>31</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_91"> <Value> <Obj> <type>2</type> <id>135</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>842211372</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>4</bitwidth> </Value> <const_type>0</const_type> <content>14</content> </item> <item class_id_reference="16" object_id="_92"> <Value> <Obj> <type>2</type> <id>139</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1397508130</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <const_type>0</const_type> <content>255</content> </item> <item class_id_reference="16" object_id="_93"> <Value> <Obj> <type>2</type> <id>155</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>808595283</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <const_type>0</const_type> <content>203</content> </item> <item class_id_reference="16" object_id="_94"> <Value> <Obj> <type>2</type> <id>157</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1601200424</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_95"> <Value> <Obj> <type>2</type> <id>170</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1600415096</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>4294967242</content> </item> <item class_id_reference="16" object_id="_96"> <Value> <Obj> <type>2</type> <id>175</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1631205947</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>54</content> </item> <item class_id_reference="16" object_id="_97"> <Value> <Obj> <type>2</type> <id>193</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1713399662</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>63</content> </item> <item class_id_reference="16" object_id="_98"> <Value> <Obj> <type>2</type> <id>201</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1936018748</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>11</bitwidth> </Value> <const_type>0</const_type> <content>1023</content> </item> <item class_id_reference="16" object_id="_99"> <Value> <Obj> <type>2</type> <id>203</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1601265520</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>11</bitwidth> </Value> <const_type>0</const_type> <content>1022</content> </item> <item class_id_reference="16" object_id="_100"> <Value> <Obj> <type>2</type> <id>206</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1885415456</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>11</bitwidth> </Value> <const_type>0</const_type> <content>4</content> </item> <item class_id_reference="16" object_id="_101"> <Value> <Obj> <type>2</type> <id>213</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>540767087</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>1</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_102"> <Value> <Obj> <type>2</type> <id>220</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>539122993</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>52</content> </item> <item class_id_reference="16" object_id="_103"> <Value> <Obj> <type>2</type> <id>230</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1663052091</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>11</bitwidth> </Value> <const_type>0</const_type> <content>2047</content> </item> <item class_id_reference="16" object_id="_104"> <Value> <Obj> <type>2</type> <id>233</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1868771121</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>52</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_105"> <Value> <Obj> <type>2</type> <id>238</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>640688172</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>64</bitwidth> </Value> <const_type>1</const_type> <content>2.375</content> </item> <item class_id_reference="16" object_id="_106"> <Value> <Obj> <type>2</type> <id>247</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>793988168</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>4</content> </item> <item class_id_reference="16" object_id="_107"> <Value> <Obj> <type>2</type> <id>251</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1768316784</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>4</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_108"> <Value> <Obj> <type>2</type> <id>254</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>796421737</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>13</bitwidth> </Value> <const_type>0</const_type> <content>3456</content> </item> <item class_id_reference="16" object_id="_109"> <Value> <Obj> <type>2</type> <id>259</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1601200424</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>5</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_110"> <Value> <Obj> <type>2</type> <id>262</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1818322464</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>13</bitwidth> </Value> <const_type>0</const_type> <content>2560</content> </item> <item class_id_reference="16" object_id="_111"> <Value> <Obj> <type>2</type> <id>268</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>825438509</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>6</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_112"> <Value> <Obj> <type>2</type> <id>271</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1835888483</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>13</bitwidth> </Value> <const_type>0</const_type> <content>2048</content> </item> <item class_id_reference="16" object_id="_113"> <Value> <Obj> <type>2</type> <id>288</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1769104758</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>5</content> </item> <item class_id_reference="16" object_id="_114"> <Value> <Obj> <type>2</type> <id>290</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>842019375</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>12</content> </item> <item class_id_reference="16" object_id="_115"> <Value> <Obj> <type>2</type> <id>293</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>795766637</coreId> <rtlModuleName></rtlModuleName> </Obj> <bitwidth>8</bitwidth> </Value> <const_type>0</const_type> <content>128</content> </item> </consts> <blocks class_id="17" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="18" tracking_level="1" version="0" object_id="_116"> <Obj> <type>3</type> <id>84</id> <name>sigmoid_plan</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <contextNormFuncName></contextNormFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <control></control> <opType></opType> <implIndex></implIndex> <coreName></coreName> <isStorage>0</isStorage> <storageDepth>0</storageDepth> <coreId>1397508191</coreId> <rtlModuleName></rtlModuleName> </Obj> <node_objs> <count>77</count> <item_version>0</item_version> <item>7</item> <item>8</item> <item>9</item> <item>10</item> <item>11</item> <item>12</item> <item>13</item> <item>14</item> <item>15</item> <item>16</item> <item>17</item> <item>18</item> <item>19</item> <item>20</item> <item>21</item> <item>22</item> <item>23</item> <item>24</item> <item>25</item> <item>26</item> <item>27</item> <item>28</item> <item>29</item> <item>30</item> <item>31</item> <item>32</item> <item>33</item> <item>34</item> <item>35</item> <item>36</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>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> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>155</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_117"> <id>87</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>7</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_118"> <id>90</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>8</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_119"> <id>92</id> <edge_type>1</edge_type> <source_obj>91</source_obj> <sink_obj>8</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_120"> <id>93</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>9</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_121"> <id>94</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>10</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_122"> <id>96</id> <edge_type>1</edge_type> <source_obj>95</source_obj> <sink_obj>10</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_123"> <id>97</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>11</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_124"> <id>99</id> <edge_type>1</edge_type> <source_obj>98</source_obj> <sink_obj>11</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_125"> <id>102</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>12</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_126"> <id>104</id> <edge_type>1</edge_type> <source_obj>103</source_obj> <sink_obj>12</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_127"> <id>106</id> <edge_type>1</edge_type> <source_obj>105</source_obj> <sink_obj>12</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_128"> <id>110</id> <edge_type>1</edge_type> <source_obj>109</source_obj> <sink_obj>13</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_129"> <id>111</id> <edge_type>1</edge_type> <source_obj>12</source_obj> <sink_obj>13</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_130"> <id>114</id> <edge_type>1</edge_type> <source_obj>13</source_obj> <sink_obj>14</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_131"> <id>116</id> <edge_type>1</edge_type> <source_obj>115</source_obj> <sink_obj>14</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_132"> <id>118</id> <edge_type>1</edge_type> <source_obj>117</source_obj> <sink_obj>15</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_133"> <id>119</id> <edge_type>1</edge_type> <source_obj>14</source_obj> <sink_obj>15</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_134"> <id>120</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>16</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_135"> <id>121</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>17</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_136"> <id>123</id> <edge_type>1</edge_type> <source_obj>122</source_obj> <sink_obj>17</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_137"> <id>126</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>18</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_138"> <id>128</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>18</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_139"> <id>130</id> <edge_type>1</edge_type> <source_obj>129</source_obj> <sink_obj>18</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_140"> <id>131</id> <edge_type>1</edge_type> <source_obj>18</source_obj> <sink_obj>19</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_141"> <id>133</id> <edge_type>1</edge_type> <source_obj>132</source_obj> <sink_obj>19</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_142"> <id>134</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>20</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_143"> <id>136</id> <edge_type>1</edge_type> <source_obj>135</source_obj> <sink_obj>21</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_144"> <id>137</id> <edge_type>1</edge_type> <source_obj>20</source_obj> <sink_obj>21</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_145"> <id>138</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>22</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_146"> <id>140</id> <edge_type>1</edge_type> <source_obj>139</source_obj> <sink_obj>23</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_147"> <id>141</id> <edge_type>1</edge_type> <source_obj>22</source_obj> <sink_obj>23</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_148"> <id>142</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>24</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_149"> <id>143</id> <edge_type>1</edge_type> <source_obj>23</source_obj> <sink_obj>24</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_150"> <id>144</id> <edge_type>1</edge_type> <source_obj>24</source_obj> <sink_obj>25</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_151"> <id>145</id> <edge_type>1</edge_type> <source_obj>98</source_obj> <sink_obj>25</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_152"> <id>148</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>26</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_153"> <id>149</id> <edge_type>1</edge_type> <source_obj>129</source_obj> <sink_obj>26</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_154"> <id>150</id> <edge_type>1</edge_type> <source_obj>26</source_obj> <sink_obj>27</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_155"> <id>151</id> <edge_type>1</edge_type> <source_obj>115</source_obj> <sink_obj>27</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_156"> <id>152</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>28</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_157"> <id>153</id> <edge_type>1</edge_type> <source_obj>25</source_obj> <sink_obj>28</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_158"> <id>154</id> <edge_type>1</edge_type> <source_obj>16</source_obj> <sink_obj>29</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_159"> <id>156</id> <edge_type>1</edge_type> <source_obj>155</source_obj> <sink_obj>29</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_160"> <id>158</id> <edge_type>1</edge_type> <source_obj>157</source_obj> <sink_obj>30</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_161"> <id>159</id> <edge_type>1</edge_type> <source_obj>29</source_obj> <sink_obj>30</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_162"> <id>160</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>31</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_163"> <id>161</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>31</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_164"> <id>162</id> <edge_type>1</edge_type> <source_obj>31</source_obj> <sink_obj>32</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_165"> <id>163</id> <edge_type>1</edge_type> <source_obj>98</source_obj> <sink_obj>32</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_166"> <id>164</id> <edge_type>1</edge_type> <source_obj>32</source_obj> <sink_obj>33</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_167"> <id>165</id> <edge_type>1</edge_type> <source_obj>28</source_obj> <sink_obj>33</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_168"> <id>166</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>34</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_169"> <id>167</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>35</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_170"> <id>168</id> <edge_type>1</edge_type> <source_obj>105</source_obj> <sink_obj>35</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_171"> <id>169</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>36</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_172"> <id>171</id> <edge_type>1</edge_type> <source_obj>170</source_obj> <sink_obj>36</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_173"> <id>172</id> <edge_type>1</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="_174"> <id>173</id> <edge_type>1</edge_type> <source_obj>34</source_obj> <sink_obj>38</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_175"> <id>174</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="_176"> <id>176</id> <edge_type>1</edge_type> <source_obj>175</source_obj> <sink_obj>39</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_177"> <id>177</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>39</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_178"> <id>178</id> <edge_type>1</edge_type> <source_obj>39</source_obj> <sink_obj>40</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_179"> <id>179</id> <edge_type>1</edge_type> <source_obj>34</source_obj> <sink_obj>41</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_180"> <id>180</id> <edge_type>1</edge_type> <source_obj>40</source_obj> <sink_obj>41</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_181"> <id>181</id> <edge_type>1</edge_type> <source_obj>33</source_obj> <sink_obj>42</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_182"> <id>182</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>42</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_183"> <id>183</id> <edge_type>1</edge_type> <source_obj>35</source_obj> <sink_obj>43</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_184"> <id>184</id> <edge_type>1</edge_type> <source_obj>38</source_obj> <sink_obj>43</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_185"> <id>185</id> <edge_type>1</edge_type> <source_obj>41</source_obj> <sink_obj>43</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_186"> <id>186</id> <edge_type>1</edge_type> <source_obj>42</source_obj> <sink_obj>44</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_187"> <id>187</id> <edge_type>1</edge_type> <source_obj>43</source_obj> <sink_obj>45</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_188"> <id>188</id> <edge_type>1</edge_type> <source_obj>44</source_obj> <sink_obj>45</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_189"> <id>191</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>46</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_190"> <id>192</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>46</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_191"> <id>194</id> <edge_type>1</edge_type> <source_obj>193</source_obj> <sink_obj>46</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_192"> <id>195</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="_193"> <id>198</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>48</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_194"> <id>199</id> <edge_type>1</edge_type> <source_obj>175</source_obj> <sink_obj>48</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_195"> <id>200</id> <edge_type>1</edge_type> <source_obj>48</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_196"> <id>202</id> <edge_type>1</edge_type> <source_obj>201</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_197"> <id>204</id> <edge_type>1</edge_type> <source_obj>203</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_198"> <id>205</id> <edge_type>1</edge_type> <source_obj>14</source_obj> <sink_obj>50</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_199"> <id>207</id> <edge_type>1</edge_type> <source_obj>206</source_obj> <sink_obj>51</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_200"> <id>208</id> <edge_type>1</edge_type> <source_obj>50</source_obj> <sink_obj>51</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_201"> <id>209</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="_202"> <id>210</id> <edge_type>1</edge_type> <source_obj>49</source_obj> <sink_obj>52</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_203"> <id>214</id> <edge_type>1</edge_type> <source_obj>213</source_obj> <sink_obj>53</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_204"> <id>215</id> <edge_type>1</edge_type> <source_obj>52</source_obj> <sink_obj>53</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_205"> <id>218</id> <edge_type>1</edge_type> <source_obj>47</source_obj> <sink_obj>54</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_206"> <id>219</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="_207"> <id>221</id> <edge_type>1</edge_type> <source_obj>220</source_obj> <sink_obj>54</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_208"> <id>222</id> <edge_type>1</edge_type> <source_obj>193</source_obj> <sink_obj>54</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_209"> <id>223</id> <edge_type>1</edge_type> <source_obj>54</source_obj> <sink_obj>55</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_210"> <id>226</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>56</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_211"> <id>227</id> <edge_type>1</edge_type> <source_obj>127</source_obj> <sink_obj>56</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_212"> <id>228</id> <edge_type>1</edge_type> <source_obj>220</source_obj> <sink_obj>56</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_213"> <id>229</id> <edge_type>1</edge_type> <source_obj>52</source_obj> <sink_obj>57</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_214"> <id>231</id> <edge_type>1</edge_type> <source_obj>230</source_obj> <sink_obj>57</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_215"> <id>232</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="_216"> <id>234</id> <edge_type>1</edge_type> <source_obj>233</source_obj> <sink_obj>58</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_217"> <id>235</id> <edge_type>1</edge_type> <source_obj>58</source_obj> <sink_obj>59</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_218"> <id>236</id> <edge_type>1</edge_type> <source_obj>57</source_obj> <sink_obj>59</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_219"> <id>237</id> <edge_type>1</edge_type> <source_obj>55</source_obj> <sink_obj>60</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_220"> <id>239</id> <edge_type>1</edge_type> <source_obj>238</source_obj> <sink_obj>60</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_221"> <id>240</id> <edge_type>1</edge_type> <source_obj>59</source_obj> <sink_obj>61</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_222"> <id>241</id> <edge_type>1</edge_type> <source_obj>60</source_obj> <sink_obj>61</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_223"> <id>242</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="_224"> <id>243</id> <edge_type>1</edge_type> <source_obj>115</source_obj> <sink_obj>62</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_225"> <id>246</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>63</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_226"> <id>248</id> <edge_type>1</edge_type> <source_obj>247</source_obj> <sink_obj>63</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_227"> <id>249</id> <edge_type>1</edge_type> <source_obj>103</source_obj> <sink_obj>63</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_228"> <id>250</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="_229"> <id>252</id> <edge_type>1</edge_type> <source_obj>251</source_obj> <sink_obj>64</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_230"> <id>253</id> <edge_type>1</edge_type> <source_obj>9</source_obj> <sink_obj>65</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_231"> <id>255</id> <edge_type>1</edge_type> <source_obj>254</source_obj> <sink_obj>65</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_232"> <id>258</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>66</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_233"> <id>260</id> <edge_type>1</edge_type> <source_obj>259</source_obj> <sink_obj>66</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_234"> <id>261</id> <edge_type>1</edge_type> <source_obj>66</source_obj> <sink_obj>67</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_235"> <id>263</id> <edge_type>1</edge_type> <source_obj>262</source_obj> <sink_obj>67</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_236"> <id>264</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>68</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_237"> <id>267</id> <edge_type>1</edge_type> <source_obj>68</source_obj> <sink_obj>69</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_238"> <id>269</id> <edge_type>1</edge_type> <source_obj>268</source_obj> <sink_obj>69</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_239"> <id>270</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="_240"> <id>272</id> <edge_type>1</edge_type> <source_obj>271</source_obj> <sink_obj>70</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_241"> <id>273</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>71</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_242"> <id>274</id> <edge_type>1</edge_type> <source_obj>11</source_obj> <sink_obj>71</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_243"> <id>275</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="_244"> <id>276</id> <edge_type>1</edge_type> <source_obj>62</source_obj> <sink_obj>72</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_245"> <id>277</id> <edge_type>1</edge_type> <source_obj>71</source_obj> <sink_obj>73</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_246"> <id>278</id> <edge_type>1</edge_type> <source_obj>115</source_obj> <sink_obj>73</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_247"> <id>279</id> <edge_type>1</edge_type> <source_obj>64</source_obj> <sink_obj>74</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_248"> <id>280</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="_249"> <id>281</id> <edge_type>1</edge_type> <source_obj>74</source_obj> <sink_obj>75</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_250"> <id>282</id> <edge_type>1</edge_type> <source_obj>62</source_obj> <sink_obj>75</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_251"> <id>283</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>76</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_252"> <id>284</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="_253"> <id>287</id> <edge_type>1</edge_type> <source_obj>67</source_obj> <sink_obj>77</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_254"> <id>289</id> <edge_type>1</edge_type> <source_obj>288</source_obj> <sink_obj>77</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_255"> <id>291</id> <edge_type>1</edge_type> <source_obj>290</source_obj> <sink_obj>77</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_256"> <id>292</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>78</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_257"> <id>294</id> <edge_type>1</edge_type> <source_obj>293</source_obj> <sink_obj>78</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_258"> <id>295</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="_259"> <id>297</id> <edge_type>1</edge_type> <source_obj>70</source_obj> <sink_obj>79</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_260"> <id>298</id> <edge_type>1</edge_type> <source_obj>288</source_obj> <sink_obj>79</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_261"> <id>299</id> <edge_type>1</edge_type> <source_obj>290</source_obj> <sink_obj>79</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_262"> <id>301</id> <edge_type>1</edge_type> <source_obj>65</source_obj> <sink_obj>80</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_263"> <id>302</id> <edge_type>1</edge_type> <source_obj>288</source_obj> <sink_obj>80</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_264"> <id>303</id> <edge_type>1</edge_type> <source_obj>290</source_obj> <sink_obj>80</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_265"> <id>304</id> <edge_type>1</edge_type> <source_obj>72</source_obj> <sink_obj>81</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_266"> <id>305</id> <edge_type>1</edge_type> <source_obj>79</source_obj> <sink_obj>81</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_267"> <id>306</id> <edge_type>1</edge_type> <source_obj>80</source_obj> <sink_obj>81</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_268"> <id>307</id> <edge_type>1</edge_type> <source_obj>76</source_obj> <sink_obj>82</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_269"> <id>308</id> <edge_type>1</edge_type> <source_obj>78</source_obj> <sink_obj>82</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_270"> <id>309</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="_271"> <id>310</id> <edge_type>1</edge_type> <source_obj>82</source_obj> <sink_obj>83</sink_obj> <is_back_edge>0</is_back_edge> </item> </edges> </cdfg> <cdfg_regions class_id="21" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="22" tracking_level="1" version="0" object_id="_272"> <mId>1</mId> <mTag>sigmoid_plan</mTag> <mNormTag>sigmoid_plan</mNormTag> <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>84</item> </basic_blocks> <mII>1</mII> <mDepth>3</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>2</mMinLatency> <mMaxLatency>2</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> </cdfg_regions> <fsm class_id="24" tracking_level="1" version="0" object_id="_273"> <states class_id="25" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_274"> <id>1</id> <operations class_id="27" tracking_level="0" version="0"> <count>31</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_275"> <id>7</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_276"> <id>12</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_277"> <id>13</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_278"> <id>14</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_279"> <id>15</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_280"> <id>16</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_281"> <id>17</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_282"> <id>18</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_283"> <id>19</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_284"> <id>20</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_285"> <id>21</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_286"> <id>22</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_287"> <id>23</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_288"> <id>24</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_289"> <id>25</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_290"> <id>26</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_291"> <id>27</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_292"> <id>28</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_293"> <id>29</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_294"> <id>30</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_295"> <id>31</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_296"> <id>32</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_297"> <id>33</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_298"> <id>35</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_299"> <id>36</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_300"> <id>39</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_301"> <id>42</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_302"> <id>50</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_303"> <id>63</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_304"> <id>64</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_305"> <id>68</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_306"> <id>2</id> <operations> <count>21</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_307"> <id>34</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_308"> <id>37</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_309"> <id>38</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_310"> <id>40</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_311"> <id>41</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_312"> <id>43</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_313"> <id>44</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_314"> <id>45</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_315"> <id>46</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_316"> <id>47</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_317"> <id>48</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_318"> <id>49</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_319"> <id>51</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_320"> <id>52</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_321"> <id>53</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_322"> <id>54</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_323"> <id>55</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_324"> <id>56</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_325"> <id>57</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_326"> <id>58</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_327"> <id>60</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_328"> <id>3</id> <operations> <count>31</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_329"> <id>2</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_330"> <id>3</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_331"> <id>4</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_332"> <id>5</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_333"> <id>6</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_334"> <id>8</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_335"> <id>9</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_336"> <id>10</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_337"> <id>11</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_338"> <id>59</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_339"> <id>60</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_340"> <id>61</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_341"> <id>62</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_342"> <id>65</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_343"> <id>66</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_344"> <id>67</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_345"> <id>69</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_346"> <id>70</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_347"> <id>71</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_348"> <id>72</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_349"> <id>73</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_350"> <id>74</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_351"> <id>75</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_352"> <id>76</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_353"> <id>77</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_354"> <id>78</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_355"> <id>79</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_356"> <id>80</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_357"> <id>81</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_358"> <id>82</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_359"> <id>83</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="29" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="30" tracking_level="1" version="0" object_id="_360"> <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="_361"> <inState>2</inState> <outState>3</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> </transitions> </fsm> <res class_id="-1"></res> <node_label_latency class_id="35" tracking_level="0" version="0"> <count>77</count> <item_version>0</item_version> <item class_id="36" tracking_level="0" version="0"> <first>7</first> <second class_id="37" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>8</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>9</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>10</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>11</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>12</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>13</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>14</first> <second> <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>17</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>18</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>19</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>20</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>21</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>22</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>23</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>24</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>25</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>26</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>27</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>28</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>29</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>30</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>31</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>32</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>33</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>34</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>35</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>36</first> <second> <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>39</first> <second> <first>0</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>42</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>43</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>44</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>0</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>2</first> <second>0</second> </second> </item> <item> <first>60</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>61</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>62</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>63</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>64</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>65</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>66</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>67</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>68</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>69</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>70</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>71</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>72</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>73</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>74</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>75</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>76</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>77</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>78</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>79</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>80</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>81</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>82</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>83</first> <second> <first>2</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="38" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="39" tracking_level="0" version="0"> <first>84</first> <second class_id="40" tracking_level="0" version="0"> <first>0</first> <second>2</second> </second> </item> </bblk_ent_exit> <regions class_id="41" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="42" tracking_level="1" version="0" object_id="_362"> <region_name>sigmoid_plan</region_name> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>84</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>3</pipe_depth> <mDBIIViolationVec class_id="43" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </mDBIIViolationVec> </item> </regions> <dp_fu_nodes class_id="44" tracking_level="0" version="0"> <count>76</count> <item_version>0</item_version> <item class_id="45" tracking_level="0" version="0"> <first>124</first> <second> <count>1</count> <item_version>0</item_version> <item>7</item> </second> </item> <item> <first>130</first> <second> <count>2</count> <item_version>0</item_version> <item>60</item> <item>60</item> </second> </item> <item> <first>135</first> <second> <count>1</count> <item_version>0</item_version> <item>12</item> </second> </item> <item> <first>145</first> <second> <count>1</count> <item_version>0</item_version> <item>13</item> </second> </item> <item> <first>153</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>161</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> <item> <first>167</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> <item> <first>171</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> <item> <first>177</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>187</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>193</first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> <item> <first>197</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>203</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>207</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>213</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>219</first> <second> <count>1</count> <item_version>0</item_version> <item>25</item> </second> </item> <item> <first>225</first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> <item> <first>233</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>239</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>245</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>251</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>257</first> <second> <count>1</count> <item_version>0</item_version> <item>31</item> </second> </item> <item> <first>263</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>269</first> <second> <count>1</count> <item_version>0</item_version> <item>33</item> </second> </item> <item> <first>275</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>281</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>287</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> <item> <first>293</first> <second> <count>1</count> <item_version>0</item_version> <item>42</item> </second> </item> <item> <first>299</first> <second> <count>1</count> <item_version>0</item_version> <item>50</item> </second> </item> <item> <first>303</first> <second> <count>1</count> <item_version>0</item_version> <item>63</item> </second> </item> <item> <first>313</first> <second> <count>1</count> <item_version>0</item_version> <item>64</item> </second> </item> <item> <first>319</first> <second> <count>1</count> <item_version>0</item_version> <item>68</item> </second> </item> <item> <first>323</first> <second> <count>1</count> <item_version>0</item_version> <item>34</item> </second> </item> <item> <first>326</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>329</first> <second> <count>1</count> <item_version>0</item_version> <item>38</item> </second> </item> <item> <first>335</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>338</first> <second> <count>1</count> <item_version>0</item_version> <item>41</item> </second> </item> <item> <first>344</first> <second> <count>1</count> <item_version>0</item_version> <item>43</item> </second> </item> <item> <first>351</first> <second> <count>1</count> <item_version>0</item_version> <item>44</item> </second> </item> <item> <first>354</first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>360</first> <second> <count>1</count> <item_version>0</item_version> <item>46</item> </second> </item> <item> <first>370</first> <second> <count>1</count> <item_version>0</item_version> <item>47</item> </second> </item> <item> <first>374</first> <second> <count>1</count> <item_version>0</item_version> <item>48</item> </second> </item> <item> <first>382</first> <second> <count>1</count> <item_version>0</item_version> <item>49</item> </second> </item> <item> <first>390</first> <second> <count>1</count> <item_version>0</item_version> <item>51</item> </second> </item> <item> <first>395</first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first>401</first> <second> <count>1</count> <item_version>0</item_version> <item>53</item> </second> </item> <item> <first>409</first> <second> <count>1</count> <item_version>0</item_version> <item>54</item> </second> </item> <item> <first>421</first> <second> <count>1</count> <item_version>0</item_version> <item>55</item> </second> </item> <item> <first>426</first> <second> <count>1</count> <item_version>0</item_version> <item>56</item> </second> </item> <item> <first>436</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> <item> <first>442</first> <second> <count>1</count> <item_version>0</item_version> <item>58</item> </second> </item> <item> <first>448</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>455</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> <item> <first>459</first> <second> <count>1</count> <item_version>0</item_version> <item>10</item> </second> </item> <item> <first>464</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> <item> <first>469</first> <second> <count>1</count> <item_version>0</item_version> <item>59</item> </second> </item> <item> <first>473</first> <second> <count>1</count> <item_version>0</item_version> <item>61</item> </second> </item> <item> <first>479</first> <second> <count>1</count> <item_version>0</item_version> <item>62</item> </second> </item> <item> <first>485</first> <second> <count>1</count> <item_version>0</item_version> <item>65</item> </second> </item> <item> <first>491</first> <second> <count>1</count> <item_version>0</item_version> <item>66</item> </second> </item> <item> <first>498</first> <second> <count>1</count> <item_version>0</item_version> <item>67</item> </second> </item> <item> <first>504</first> <second> <count>1</count> <item_version>0</item_version> <item>69</item> </second> </item> <item> <first>511</first> <second> <count>1</count> <item_version>0</item_version> <item>70</item> </second> </item> <item> <first>517</first> <second> <count>1</count> <item_version>0</item_version> <item>71</item> </second> </item> <item> <first>523</first> <second> <count>1</count> <item_version>0</item_version> <item>72</item> </second> </item> <item> <first>529</first> <second> <count>1</count> <item_version>0</item_version> <item>73</item> </second> </item> <item> <first>535</first> <second> <count>1</count> <item_version>0</item_version> <item>74</item> </second> </item> <item> <first>540</first> <second> <count>1</count> <item_version>0</item_version> <item>75</item> </second> </item> <item> <first>546</first> <second> <count>1</count> <item_version>0</item_version> <item>76</item> </second> </item> <item> <first>552</first> <second> <count>1</count> <item_version>0</item_version> <item>77</item> </second> </item> <item> <first>562</first> <second> <count>1</count> <item_version>0</item_version> <item>78</item> </second> </item> <item> <first>570</first> <second> <count>1</count> <item_version>0</item_version> <item>79</item> </second> </item> <item> <first>580</first> <second> <count>1</count> <item_version>0</item_version> <item>80</item> </second> </item> <item> <first>590</first> <second> <count>1</count> <item_version>0</item_version> <item>81</item> </second> </item> <item> <first>598</first> <second> <count>1</count> <item_version>0</item_version> <item>82</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="47" tracking_level="0" version="0"> <count>74</count> <item_version>0</item_version> <item class_id="48" tracking_level="0" version="0"> <first>a_fu_269</first> <second> <count>1</count> <item_version>0</item_version> <item>33</item> </second> </item> <item> <first>add_ln952_fu_245</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>add_ln961_fu_281</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>add_ln968_fu_395</first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first>and_ln1549_1_fu_540</first> <second> <count>1</count> <item_version>0</item_version> <item>75</item> </second> </item> <item> <first>and_ln1549_fu_535</first> <second> <count>1</count> <item_version>0</item_version> <item>74</item> </second> </item> <item> <first>and_ln1560_fu_473</first> <second> <count>1</count> <item_version>0</item_version> <item>61</item> </second> </item> <item> <first>and_ln949_fu_239</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>and_ln952_fu_257</first> <second> <count>1</count> <item_version>0</item_version> <item>31</item> </second> </item> <item> <first>bitcast_ln741_fu_421</first> <second> <count>1</count> <item_version>0</item_version> <item>55</item> </second> </item> <item> <first>icmp_ln1549_1_fu_313</first> <second> <count>1</count> <item_version>0</item_version> <item>64</item> </second> </item> <item> <first>icmp_ln1549_fu_459</first> <second> <count>1</count> <item_version>0</item_version> <item>10</item> </second> </item> <item> <first>icmp_ln1560_1_fu_442</first> <second> <count>1</count> <item_version>0</item_version> <item>58</item> </second> </item> <item> <first>icmp_ln1560_fu_436</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> <item> <first>icmp_ln938_fu_464</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> <item> <first>icmp_ln949_fu_187</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>icmp_ln950_fu_219</first> <second> <count>1</count> <item_version>0</item_version> <item>25</item> </second> </item> <item> <first>icmp_ln961_fu_275</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>input_fu_448</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>l_fu_153</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>lsb_index_fu_171</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> <item> <first>lshr_ln950_fu_207</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>lshr_ln961_fu_329</first> <second> <count>1</count> <item_version>0</item_version> <item>38</item> </second> </item> <item> <first>m_1_fu_354</first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>m_4_fu_360</first> <second> <count>1</count> <item_version>0</item_version> <item>46</item> </second> </item> <item> <first>m_fu_344</first> <second> <count>1</count> <item_version>0</item_version> <item>43</item> </second> </item> <item> <first>or_ln1549_fu_546</first> <second> <count>1</count> <item_version>0</item_version> <item>76</item> </second> </item> <item> <first>or_ln1560_1_fu_523</first> <second> <count>1</count> <item_version>0</item_version> <item>72</item> </second> </item> <item> <first>or_ln1560_fu_469</first> <second> <count>1</count> <item_version>0</item_version> <item>59</item> </second> </item> <item> <first>or_ln938_fu_517</first> <second> <count>1</count> <item_version>0</item_version> <item>71</item> </second> </item> <item> <first>p_Result_2_fu_213</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>p_Result_3_fu_263</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>p_Result_4_fu_374</first> <second> <count>1</count> <item_version>0</item_version> <item>48</item> </second> </item> <item> <first>p_Result_6_fu_145</first> <second> <count>1</count> <item_version>0</item_version> <item>13</item> </second> </item> <item> <first>p_Result_7_fu_409</first> <second> <count>1</count> <item_version>0</item_version> <item>54</item> </second> </item> <item> <first>p_Result_s_fu_135</first> <second> <count>1</count> <item_version>0</item_version> <item>12</item> </second> </item> <item> <first>r_1_fu_491</first> <second> <count>1</count> <item_version>0</item_version> <item>66</item> </second> </item> <item> <first>r_2_fu_504</first> <second> <count>1</count> <item_version>0</item_version> <item>69</item> </second> </item> <item> <first>select_ln1549_1_fu_590</first> <second> <count>1</count> <item_version>0</item_version> <item>81</item> </second> </item> <item> <first>select_ln1549_2_fu_598</first> <second> <count>1</count> <item_version>0</item_version> <item>82</item> </second> </item> <item> <first>select_ln1549_fu_562</first> <second> <count>1</count> <item_version>0</item_version> <item>78</item> </second> </item> <item> <first>select_ln946_fu_382</first> <second> <count>1</count> <item_version>0</item_version> <item>49</item> </second> </item> <item> <first>shl_ln952_fu_251</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>shl_ln962_fu_338</first> <second> <count>1</count> <item_version>0</item_version> <item>41</item> </second> </item> <item> <first>sub_ln947_fu_161</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> <item> <first>sub_ln950_fu_197</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>sub_ln962_fu_287</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> <item> <first>sub_ln968_fu_390</first> <second> <count>1</count> <item_version>0</item_version> <item>51</item> </second> </item> <item> <first>tmp_2_fu_177</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>tmp_3_fu_552</first> <second> <count>1</count> <item_version>0</item_version> <item>77</item> </second> </item> <item> <first>tmp_4_fu_570</first> <second> <count>1</count> <item_version>0</item_version> <item>79</item> </second> </item> <item> <first>tmp_5_fu_580</first> <second> <count>1</count> <item_version>0</item_version> <item>80</item> </second> </item> <item> <first>tmp_6_fu_225</first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> <item> <first>tmp_8_fu_303</first> <second> <count>1</count> <item_version>0</item_version> <item>63</item> </second> </item> <item> <first>tmp_fu_401</first> <second> <count>1</count> <item_version>0</item_version> <item>53</item> </second> </item> <item> <first>tobool29_i_i290_fu_293</first> <second> <count>1</count> <item_version>0</item_version> <item>42</item> </second> </item> <item> <first>trunc_ln1386_fu_319</first> <second> <count>1</count> <item_version>0</item_version> <item>68</item> </second> </item> <item> <first>trunc_ln3_fu_426</first> <second> <count>1</count> <item_version>0</item_version> <item>56</item> </second> </item> <item> <first>trunc_ln946_fu_299</first> <second> <count>1</count> <item_version>0</item_version> <item>50</item> </second> </item> <item> <first>trunc_ln947_fu_167</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> <item> <first>trunc_ln950_fu_193</first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> <item> <first>x0_V_1_fu_498</first> <second> <count>1</count> <item_version>0</item_version> <item>67</item> </second> </item> <item> <first>x0_V_2_fu_511</first> <second> <count>1</count> <item_version>0</item_version> <item>70</item> </second> </item> <item> <first>x0_V_fu_485</first> <second> <count>1</count> <item_version>0</item_version> <item>65</item> </second> </item> <item> <first>xor_ln1560_fu_479</first> <second> <count>1</count> <item_version>0</item_version> <item>62</item> </second> </item> <item> <first>xor_ln938_fu_529</first> <second> <count>1</count> <item_version>0</item_version> <item>73</item> </second> </item> <item> <first>xor_ln952_fu_233</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>zext_ln43_fu_455</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> <item> <first>zext_ln950_fu_203</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>zext_ln960_fu_323</first> <second> <count>1</count> <item_version>0</item_version> <item>34</item> </second> </item> <item> <first>zext_ln961_fu_326</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>zext_ln962_fu_335</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>zext_ln964_fu_351</first> <second> <count>1</count> <item_version>0</item_version> <item>44</item> </second> </item> <item> <first>zext_ln965_fu_370</first> <second> <count>1</count> <item_version>0</item_version> <item>47</item> </second> </item> </dp_fu_nodes_expression> <dp_fu_nodes_module> <count>1</count> <item_version>0</item_version> <item> <first>grp_fu_130</first> <second> <count>2</count> <item_version>0</item_version> <item>60</item> <item>60</item> </second> </item> </dp_fu_nodes_module> <dp_fu_nodes_io> <count>1</count> <item_version>0</item_version> <item> <first>in_read_read_fu_124</first> <second> <count>1</count> <item_version>0</item_version> <item>7</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="49" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_mem_port_nodes> <dp_reg_nodes> <count>11</count> <item_version>0</item_version> <item> <first>606</first> <second> <count>1</count> <item_version>0</item_version> <item>7</item> </second> </item> <item> <first>615</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>620</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>625</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> <item> <first>630</first> <second> <count>1</count> <item_version>0</item_version> <item>42</item> </second> </item> <item> <first>635</first> <second> <count>1</count> <item_version>0</item_version> <item>50</item> </second> </item> <item> <first>640</first> <second> <count>1</count> <item_version>0</item_version> <item>64</item> </second> </item> <item> <first>645</first> <second> <count>1</count> <item_version>0</item_version> <item>68</item> </second> </item> <item> <first>650</first> <second> <count>1</count> <item_version>0</item_version> <item>55</item> </second> </item> <item> <first>655</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> <item> <first>660</first> <second> <count>1</count> <item_version>0</item_version> <item>58</item> </second> </item> </dp_reg_nodes> <dp_regname_nodes> <count>11</count> <item_version>0</item_version> <item> <first>add_ln961_reg_620</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>bitcast_ln741_reg_650</first> <second> <count>1</count> <item_version>0</item_version> <item>55</item> </second> </item> <item> <first>icmp_ln1549_1_reg_640</first> <second> <count>1</count> <item_version>0</item_version> <item>64</item> </second> </item> <item> <first>icmp_ln1560_1_reg_660</first> <second> <count>1</count> <item_version>0</item_version> <item>58</item> </second> </item> <item> <first>icmp_ln1560_reg_655</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> <item> <first>icmp_ln961_reg_615</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>in_read_reg_606</first> <second> <count>1</count> <item_version>0</item_version> <item>7</item> </second> </item> <item> <first>sub_ln962_reg_625</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> <item> <first>tobool29_i_i290_reg_630</first> <second> <count>1</count> <item_version>0</item_version> <item>42</item> </second> </item> <item> <first>trunc_ln1386_reg_645</first> <second> <count>1</count> <item_version>0</item_version> <item>68</item> </second> </item> <item> <first>trunc_ln946_reg_635</first> <second> <count>1</count> <item_version>0</item_version> <item>50</item> </second> </item> </dp_regname_nodes> <dp_reg_phi> <count>0</count> <item_version>0</item_version> </dp_reg_phi> <dp_regname_phi> <count>0</count> <item_version>0</item_version> </dp_regname_phi> <dp_port_io_nodes class_id="50" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="51" tracking_level="0" version="0"> <first>in_r</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>read</first> <second> <count>1</count> <item_version>0</item_version> <item>7</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core> <count>0</count> <item_version>0</item_version> </port2core> <node2core> <count>46</count> <item_version>0</item_version> <item> <first>10</first> <second> <first>45</first> <second>0</second> </second> </item> <item> <first>11</first> <second> <first>45</first> <second>0</second> </second> </item> <item> <first>15</first> <second> <first>10</first> <second>4</second> </second> </item> <item> <first>17</first> <second> <first>8</first> <second>4</second> </second> </item> <item> <first>19</first> <second> <first>45</first> <second>0</second> </second> </item> <item> <first>21</first> <second> <first>10</first> <second>4</second> </second> </item> <item> <first>23</first> <second> <first>21</first> <second>2</second> </second> </item> <item> <first>24</first> <second> <first>23</first> <second>0</second> </second> </item> <item> <first>25</first> <second> <first>45</first> <second>0</second> </second> </item> <item> <first>27</first> <second> <first>25</first> <second>0</second> </second> </item> <item> <first>28</first> <second> <first>23</first> <second>0</second> </second> </item> <item> <first>29</first> <second> <first>8</first> <second>4</second> </second> </item> <item> <first>30</first> <second> <first>20</first> <second>2</second> </second> </item> <item> <first>31</first> <second> <first>23</first> <second>0</second> </second> </item> <item> <first>32</first> <second> <first>45</first> <second>0</second> </second> </item> <item> <first>33</first> <second> <first>24</first> <second>0</second> </second> </item> <item> <first>35</first> <second> <first>45</first> <second>0</second> </second> </item> <item> <first>36</first> <second> <first>8</first> <second>4</second> </second> </item> <item> <first>38</first> <second> <first>21</first> <second>2</second> </second> </item> <item> <first>39</first> <second> <first>10</first> <second>4</second> </second> </item> <item> <first>41</first> <second> <first>20</first> <second>2</second> </second> </item> <item> <first>42</first> <second> <first>23</first> <second>0</second> </second> </item> <item> <first>43</first> <second> <first>49</first> <second>107</second> </second> </item> <item> <first>45</first> <second> <first>8</first> <second>4</second> </second> </item> <item> <first>49</first> <second> <first>49</first> <second>107</second> </second> </item> <item> <first>51</first> <second> <first>8</first> <second>156</second> </second> </item> <item> <first>52</first> <second> <first>8</first> <second>156</second> </second> </item> <item> <first>57</first> <second> <first>45</first> <second>0</second> </second> </item> <item> <first>58</first> <second> <first>45</first> <second>0</second> </second> </item> <item> <first>59</first> <second> <first>24</first> <second>0</second> </second> </item> <item> <first>60</first> <second> <first>513</first> <second>0</second> </second> </item> <item> <first>61</first> <second> <first>23</first> <second>0</second> </second> </item> <item> <first>62</first> <second> <first>25</first> <second>0</second> </second> </item> <item> <first>64</first> <second> <first>45</first> <second>0</second> </second> </item> <item> <first>65</first> <second> <first>8</first> <second>4</second> </second> </item> <item> <first>67</first> <second> <first>8</first> <second>4</second> </second> </item> <item> <first>70</first> <second> <first>8</first> <second>4</second> </second> </item> <item> <first>71</first> <second> <first>24</first> <second>0</second> </second> </item> <item> <first>72</first> <second> <first>24</first> <second>0</second> </second> </item> <item> <first>73</first> <second> <first>25</first> <second>0</second> </second> </item> <item> <first>74</first> <second> <first>23</first> <second>0</second> </second> </item> <item> <first>75</first> <second> <first>23</first> <second>0</second> </second> </item> <item> <first>76</first> <second> <first>24</first> <second>0</second> </second> </item> <item> <first>78</first> <second> <first>49</first> <second>107</second> </second> </item> <item> <first>81</first> <second> <first>49</first> <second>107</second> </second> </item> <item> <first>82</first> <second> <first>49</first> <second>107</second> </second> </item> </node2core> </syndb> </boost_serialization>
27.683363
106
0.611233
044798bc9d5645203d926192d15983fcb041422e
12,938
adb
Ada
regtests/ado-queries-tests.adb
My-Colaborations/ada-ado
cebf1f9b38c0c259c44935e8bca05a5bff12aace
[ "Apache-2.0" ]
null
null
null
regtests/ado-queries-tests.adb
My-Colaborations/ada-ado
cebf1f9b38c0c259c44935e8bca05a5bff12aace
[ "Apache-2.0" ]
null
null
null
regtests/ado-queries-tests.adb
My-Colaborations/ada-ado
cebf1f9b38c0c259c44935e8bca05a5bff12aace
[ "Apache-2.0" ]
null
null
null
----------------------------------------------------------------------- -- ado-queries-tests -- Test loading of database queries -- Copyright (C) 2011, 2012, 2013, 2014, 2015, 2017, 2018, 2019, 2020 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.Test_Caller; with ADO.Connections; with ADO.Queries.Loaders; package body ADO.Queries.Tests is use Util.Tests; package Caller is new Util.Test_Caller (Test, "ADO.Queries"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test ADO.Queries.Read_Query", Test_Load_Queries'Access); Caller.Add_Test (Suite, "Test ADO.Queries.Find_Query", Test_Find_Query'Access); Caller.Add_Test (Suite, "Test ADO.Queries.Initialize", Test_Initialize'Access); Caller.Add_Test (Suite, "Test ADO.Queries.Read_Query (reload)", Test_Reload_Queries'Access); Caller.Add_Test (Suite, "Test ADO.Queries.Set_Query", Test_Set_Query'Access); Caller.Add_Test (Suite, "Test ADO.Queries.Set_Limit", Test_Set_Limit'Access); Caller.Add_Test (Suite, "Test ADO.Queries.Get_SQL (raise Query_Error)", Test_Missing_Query'Access); end Add_Tests; package Simple_Query_File is new ADO.Queries.Loaders.File (Path => "regtests/files/simple-query.xml", Sha1 => ""); package Multi_Query_File is new ADO.Queries.Loaders.File (Path => "regtests/files/multi-query.xml", Sha1 => ""); package Missing_Query_File is new ADO.Queries.Loaders.File (Path => "regtests/files/missing-query.xml", Sha1 => ""); package Simple_Query is new ADO.Queries.Loaders.Query (Name => "simple-query", File => Simple_Query_File.File'Access); package Simple_Query_2 is new ADO.Queries.Loaders.Query (Name => "simple-query", File => Multi_Query_File.File'Access); package Index_Query is new ADO.Queries.Loaders.Query (Name => "index", File => Multi_Query_File.File'Access); package Value_Query is new ADO.Queries.Loaders.Query (Name => "value", File => Multi_Query_File.File'Access); package Missing_Query_SQLite is new ADO.Queries.Loaders.Query (Name => "missing-query-sqlite", File => Missing_Query_File.File'Access); package Missing_Query_MySQL is new ADO.Queries.Loaders.Query (Name => "missing-query-mysql", File => Missing_Query_File.File'Access); package Missing_Query_Postgresql is new ADO.Queries.Loaders.Query (Name => "missing-query-postgresql", File => Missing_Query_File.File'Access); package Missing_Query is new ADO.Queries.Loaders.Query (Name => "missing-query", File => Missing_Query_File.File'Access); pragma Warnings (Off, Simple_Query_2); pragma Warnings (Off, Value_Query); pragma Warnings (Off, Missing_Query); pragma Warnings (Off, Missing_Query_SQLite); pragma Warnings (Off, Missing_Query_MySQL); pragma Warnings (Off, Missing_Query_Postgresql); procedure Test_Load_Queries (T : in out Test) is use ADO.Connections; use type ADO.Configs.Driver_Index; Mysql_Driver : constant Driver_Access := ADO.Connections.Get_Driver ("mysql"); Sqlite_Driver : constant Driver_Access := ADO.Connections.Get_Driver ("sqlite"); Psql_Driver : constant Driver_Access := ADO.Connections.Get_Driver ("postgresql"); Config : ADO.Connections.Configuration; Manager : Query_Manager; Config_URL : constant String := Util.Tests.Get_Parameter ("test.database", "sqlite:///regtests.db"); begin -- Configure the XML query loader. Config.Set_Connection (Config_URL); ADO.Queries.Loaders.Initialize (Manager, Config); declare SQL : constant String := ADO.Queries.Get_SQL (Simple_Query.Query'Access, Manager, False); begin Assert_Equals (T, "select count(*) from user", SQL, "Invalid query for 'simple-query'"); end; declare SQL : constant String := ADO.Queries.Get_SQL (Index_Query.Query'Access, Manager, False); begin if Mysql_Driver /= null and then Manager.Driver = Mysql_Driver.Get_Driver_Index then Assert_Equals (T, "select 1", SQL, "Invalid query for 'index'"); elsif Psql_Driver /= null and then Manager.Driver = Psql_Driver.Get_Driver_Index then Assert_Equals (T, "select 3", SQL, "Invalid query for 'index'"); else Assert_Equals (T, "select 0", SQL, "Invalid query for 'index'"); end if; end; if Mysql_Driver /= null and then Manager.Driver = Mysql_Driver.Get_Driver_Index then declare SQL : constant String := ADO.Queries.Get_SQL (Index_Query.Query'Access, Manager, False); begin Assert_Equals (T, "select 1", SQL, "Invalid query for 'index' (MySQL driver)"); end; end if; if Sqlite_Driver /= null and then Manager.Driver = Sqlite_Driver.Get_Driver_Index then declare SQL : constant String := ADO.Queries.Get_SQL (Index_Query.Query'Access, Manager, False); begin Assert_Equals (T, "select 0", SQL, "Invalid query for 'index' (SQLite driver)"); end; end if; if Psql_Driver /= null and then Manager.Driver = Psql_Driver.Get_Driver_Index then declare SQL : constant String := ADO.Queries.Get_SQL (Index_Query.Query'Access, Manager, False); begin Assert_Equals (T, "select 3", SQL, "Invalid query for 'index' (PostgreSQL driver)"); end; end if; end Test_Load_Queries; -- ------------------------------ -- Test re-loading queries. -- ------------------------------ procedure Test_Reload_Queries (T : in out Test) is Config : ADO.Connections.Configuration; Manager : Query_Manager; Query : ADO.Queries.Context; Config_URL : constant String := Util.Tests.Get_Parameter ("test.database", "sqlite:///regtests.db"); begin -- Configure the XML query loader. Config.Set_Connection (Config_URL); ADO.Queries.Loaders.Initialize (Manager, Config); for I in 1 .. 10 loop Query.Set_Query ("simple-query"); declare SQL : constant String := Query.Get_SQL (Manager); begin Assert_Equals (T, "select count(*) from user", SQL, "Invalid query for 'simple-query'"); end; for J in Manager.Files'Range loop Manager.Files (J).Next_Check := 0; end loop; end loop; end Test_Reload_Queries; -- ------------------------------ -- Test the Initialize operation called several times -- ------------------------------ procedure Test_Initialize (T : in out Test) is Config : ADO.Connections.Configuration; Manager : Query_Manager; Pos : Query_Index; Config_URL : constant String := Util.Tests.Get_Parameter ("test.database", "sqlite:///regtests.db"); begin Config.Set_Connection (Config_URL); -- Configure and load the XML queries. for Pass in 1 .. 10 loop Config.Set_Property ("ado.queries.load", (if Pass = 1 then "false" else "true")); ADO.Queries.Loaders.Initialize (Manager, Config); T.Assert (Manager.Queries /= null, "The queries table is allocated"); T.Assert (Manager.Files /= null, "The files table is allocated"); Pos := 1; for Query of Manager.Queries.all loop if Pass = 1 then T.Assert (Query.Is_Null, "Query must not be loaded"); elsif Missing_Query.Query.Query /= Pos then T.Assert (not Query.Is_Null, "Query must have been loaded"); else T.Assert (Query.Is_Null, "Query must not be loaded (not found)"); end if; Pos := Pos + 1; end loop; end loop; end Test_Initialize; -- ------------------------------ -- Test the Set_Query operation. -- ------------------------------ procedure Test_Set_Query (T : in out Test) is Query : ADO.Queries.Context; Manager : Query_Manager; Config : ADO.Connections.Configuration; Config_URL : constant String := Util.Tests.Get_Parameter ("test.database", "sqlite:///regtests.db"); begin Config.Set_Connection (Config_URL); ADO.Queries.Loaders.Initialize (Manager, Config); Query.Set_Query ("simple-query"); declare SQL : constant String := Query.Get_SQL (Manager); begin Assert_Equals (T, "select count(*) from user", SQL, "Invalid query for 'simple-query'"); end; end Test_Set_Query; -- ------------------------------ -- Test the Set_Limit operation. -- ------------------------------ procedure Test_Set_Limit (T : in out Test) is Query : ADO.Queries.Context; begin Query.Set_Query ("index"); Query.Set_Limit (0, 10); Assert_Equals (T, 0, Query.Get_First_Row_Index, "Invalid first row index"); Assert_Equals (T, 10, Query.Get_Last_Row_Index, "Invalid last row index"); end Test_Set_Limit; -- ------------------------------ -- Test the Find_Query operation. -- ------------------------------ procedure Test_Find_Query (T : in out Test) is Q : Query_Definition_Access; begin Q := ADO.Queries.Loaders.Find_Query ("this query does not exist"); T.Assert (Q = null, "Find_Query should return null for unkown query"); end Test_Find_Query; -- ------------------------------ -- Test the missing query. -- ------------------------------ procedure Test_Missing_Query (T : in out Test) is Query : ADO.Queries.Context; Manager : Query_Manager; Config : ADO.Connections.Configuration; Count : Natural := 0; Config_URL : constant String := Util.Tests.Get_Parameter ("test.database", "sqlite:///regtests.db"); begin Config.Set_Connection (Config_URL); ADO.Queries.Loaders.Initialize (Manager, Config); Query.Set_Query ("missing-query"); begin Assert_Equals (T, "?", Query.Get_SQL (Manager)); T.Fail ("No ADO.Queries.Query_Error exception was raised"); exception when ADO.Queries.Query_Error => null; end; begin Query.Set_Query ("missing-query-sqlite"); Assert_Equals (T, "select count(*) from user", Query.Get_SQL (Manager)); exception when ADO.Queries.Query_Error => Count := Count + 1; end; begin Query.Set_Query ("missing-query-mysql"); Assert_Equals (T, "select count(*) from user", Query.Get_SQL (Manager)); exception when ADO.Queries.Query_Error => Count := Count + 1; end; begin Query.Set_Query ("missing-query-postgresql"); Assert_Equals (T, "select count(*) from user", Query.Get_SQL (Manager)); exception when ADO.Queries.Query_Error => Count := Count + 1; end; T.Assert (Count > 0, "No Query_Error exception was raised"); end Test_Missing_Query; end ADO.Queries.Tests;
40.557994
98
0.565698
1397c9750b93c56ed3115889e383383752e417e2
4,951
ads
Ada
src/postgresql/ado-connections-postgresql.ads
My-Colaborations/ada-ado
cebf1f9b38c0c259c44935e8bca05a5bff12aace
[ "Apache-2.0" ]
null
null
null
src/postgresql/ado-connections-postgresql.ads
My-Colaborations/ada-ado
cebf1f9b38c0c259c44935e8bca05a5bff12aace
[ "Apache-2.0" ]
null
null
null
src/postgresql/ado-connections-postgresql.ads
My-Colaborations/ada-ado
cebf1f9b38c0c259c44935e8bca05a5bff12aace
[ "Apache-2.0" ]
null
null
null
----------------------------------------------------------------------- -- ado-connections-postgresql -- Postgresql Database connections -- Copyright (C) 2018, 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. ----------------------------------------------------------------------- private with PQ; private with Ada.Strings.Unbounded; package ADO.Connections.Postgresql is type Postgresql_Driver is limited private; -- Initialize the Postgresql driver. procedure Initialize; private use Ada.Strings.Unbounded; -- Create a new Postgresql connection using the configuration parameters. procedure Create_Connection (D : in out Postgresql_Driver; Config : in Configuration'Class; Result : in out Ref.Ref'Class); type Postgresql_Driver is new ADO.Connections.Driver with record Id : Natural := 0; end record; -- Create the database and initialize it with the schema SQL file. -- The `Admin` parameter describes the database connection with administrator access. -- The `Config` parameter describes the target database connection. overriding procedure Create_Database (D : in out Postgresql_Driver; Admin : in Configs.Configuration'Class; Config : in Configs.Configuration'Class; Schema_Path : in String; Messages : out Util.Strings.Vectors.Vector); -- Deletes the Postgresql driver. overriding procedure Finalize (D : in out Postgresql_Driver); -- Database connection implementation type Database_Connection is new ADO.Connections.Database_Connection with record Name : Unbounded_String; Server_Name : Unbounded_String; Login_Name : Unbounded_String; Password : Unbounded_String; Server : PQ.PGconn_Access := PQ.Null_PGconn; Connected : Boolean := False; end record; type Database_Connection_Access is access all Database_Connection'Class; -- Get the database driver which manages this connection. overriding function Get_Driver (Database : in Database_Connection) return Driver_Access; overriding function Create_Statement (Database : in Database_Connection; Table : in ADO.Schemas.Class_Mapping_Access) return Query_Statement_Access; overriding function Create_Statement (Database : in Database_Connection; Query : in String) return Query_Statement_Access; -- Create a delete statement. overriding function Create_Statement (Database : in Database_Connection; Table : in ADO.Schemas.Class_Mapping_Access) return Delete_Statement_Access; -- Create an insert statement. overriding function Create_Statement (Database : in Database_Connection; Table : in ADO.Schemas.Class_Mapping_Access) return Insert_Statement_Access; -- Create an update statement. overriding function Create_Statement (Database : in Database_Connection; Table : in ADO.Schemas.Class_Mapping_Access) return Update_Statement_Access; -- Start a transaction. overriding procedure Begin_Transaction (Database : in out Database_Connection); -- Commit the current transaction. overriding procedure Commit (Database : in out Database_Connection); -- Rollback the current transaction. overriding procedure Rollback (Database : in out Database_Connection); procedure Execute (Database : in out Database_Connection; SQL : in Query_String); -- Closes the database connection overriding procedure Close (Database : in out Database_Connection); overriding procedure Finalize (Database : in out Database_Connection); -- Load the database schema definition for the current database. overriding procedure Load_Schema (Database : in Database_Connection; Schema : out ADO.Schemas.Schema_Definition); end ADO.Connections.Postgresql;
38.984252
89
0.640881
13f1bd872ec1bd02d2c42038895cd59e7763526d
57,673
adb
Ada
apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/sharpen/sharpen/hls_target/.autopilot/db/hls_target.bind.adb
dillonhuff/Halide-HLS
e9f4c3ac7915e5a52f211ce65004ae17890515a0
[ "MIT" ]
1
2020-06-18T16:51:39.000Z
2020-06-18T16:51:39.000Z
apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/sharpen/sharpen/hls_target/.autopilot/db/hls_target.bind.adb
dillonhuff/Halide-HLS
e9f4c3ac7915e5a52f211ce65004ae17890515a0
[ "MIT" ]
null
null
null
apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/sharpen/sharpen/hls_target/.autopilot/db/hls_target.bind.adb
dillonhuff/Halide-HLS
e9f4c3ac7915e5a52f211ce65004ae17890515a0
[ "MIT" ]
1
2020-03-18T00:43:22.000Z
2020-03-18T00:43:22.000Z
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization> <boost_serialization signature="serialization::archive" version="14"> <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>hls_target</name> <ret_bitwidth>0</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>4</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>hw_input_V_value_V</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>hw_input.V.value.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</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>hw_input_V_last_V</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>hw_input.V.last.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <direction>0</direction> <if_type>0</if_type> <array_size>0</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>hw_output_V_value_V</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>hw_output.V.value.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <direction>1</direction> <if_type>0</if_type> <array_size>0</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>hw_output_V_last_V</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>hw_output.V.last.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <direction>1</direction> <if_type>0</if_type> <array_size>0</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>11</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_5"> <Value> <Obj> <type>0</type> <id>11</id> <name>p_hw_input_stencil_st</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/sharpen</fileDirectory> <lineNumber>52</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="10" tracking_level="0" version="0"> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/sharpen</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>hls_target.cpp</first> <second>hls_target</second> </first> <second>52</second> </item> </second> </item> </inlineStackInfo> <originalName>_hw_input_stencil_stream.V.value.V</originalName> <rtlName></rtlName> <coreName>FIFO_SRL</coreName> </Obj> <bitwidth>72</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>41</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_6"> <Value> <Obj> <type>0</type> <id>15</id> <name>p_hw_input_stencil_st_3</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>FIFO_SRL</coreName> </Obj> <bitwidth>72</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>42</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_7"> <Value> <Obj> <type>0</type> <id>19</id> <name>p_hw_input_stencil_st_4</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>FIFO_SRL</coreName> </Obj> <bitwidth>72</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>43</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_8"> <Value> <Obj> <type>0</type> <id>23</id> <name>p_delayed_input_stenc</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/sharpen</fileDirectory> <lineNumber>82</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>82</second> </item> </second> </item> </inlineStackInfo> <originalName>_delayed_input_stencil_stream.V.value.V</originalName> <rtlName></rtlName> <coreName>FIFO_SRL</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>44</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_9"> <Value> <Obj> <type>0</type> <id>27</id> <name>p_mul_stencil_stream_s</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/sharpen</fileDirectory> <lineNumber>190</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>190</second> </item> </second> </item> </inlineStackInfo> <originalName>_mul_stencil_stream.V.value.V</originalName> <rtlName></rtlName> <coreName>FIFO_SRL</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>45</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_10"> <Value> <Obj> <type>0</type> <id>33</id> <name></name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/sharpen</fileDirectory> <lineNumber>56</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>56</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>47</item> <item>48</item> <item>49</item> <item>50</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_11"> <Value> <Obj> <type>0</type> <id>34</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>6</count> <item_version>0</item_version> <item>52</item> <item>53</item> <item>54</item> <item>55</item> <item>329</item> <item>330</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_12"> <Value> <Obj> <type>0</type> <id>35</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>5</count> <item_version>0</item_version> <item>57</item> <item>58</item> <item>59</item> <item>327</item> <item>331</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_13"> <Value> <Obj> <type>0</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> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>61</item> <item>62</item> <item>63</item> <item>328</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_14"> <Value> <Obj> <type>0</type> <id>37</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>8</count> <item_version>0</item_version> <item>65</item> <item>66</item> <item>67</item> <item>68</item> <item>69</item> <item>325</item> <item>326</item> <item>332</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_15"> <Value> <Obj> <type>0</type> <id>38</id> <name></name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/sharpen</fileDirectory> <lineNumber>343</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>343</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> <m_Display>0</m_Display> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>6</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_16"> <Value> <Obj> <type>2</type> <id>40</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="_17"> <Value> <Obj> <type>2</type> <id>46</id> <name>linebuffer_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> <bitwidth>0</bitwidth> </Value> <const_type>6</const_type> <content>&lt;constant:linebuffer.1&gt;</content> </item> <item class_id_reference="16" object_id="_18"> <Value> <Obj> <type>2</type> <id>51</id> <name>Loop_1_proc</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:Loop_1_proc&gt;</content> </item> <item class_id_reference="16" object_id="_19"> <Value> <Obj> <type>2</type> <id>56</id> <name>Loop_2_proc</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:Loop_2_proc&gt;</content> </item> <item class_id_reference="16" object_id="_20"> <Value> <Obj> <type>2</type> <id>60</id> <name>Loop_3_proc</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:Loop_3_proc&gt;</content> </item> <item class_id_reference="16" object_id="_21"> <Value> <Obj> <type>2</type> <id>64</id> <name>Loop_4_proc</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:Loop_4_proc&gt;</content> </item> </consts> <blocks class_id="17" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="18" tracking_level="1" version="0" object_id="_22"> <Obj> <type>3</type> <id>39</id> <name>hls_target</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>11</count> <item_version>0</item_version> <item>11</item> <item>15</item> <item>19</item> <item>23</item> <item>27</item> <item>33</item> <item>34</item> <item>35</item> <item>36</item> <item>37</item> <item>38</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>32</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_23"> <id>41</id> <edge_type>1</edge_type> <source_obj>40</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_24"> <id>42</id> <edge_type>1</edge_type> <source_obj>40</source_obj> <sink_obj>15</sink_obj> </item> <item class_id_reference="20" object_id="_25"> <id>43</id> <edge_type>1</edge_type> <source_obj>40</source_obj> <sink_obj>19</sink_obj> </item> <item class_id_reference="20" object_id="_26"> <id>44</id> <edge_type>1</edge_type> <source_obj>40</source_obj> <sink_obj>23</sink_obj> </item> <item class_id_reference="20" object_id="_27"> <id>45</id> <edge_type>1</edge_type> <source_obj>40</source_obj> <sink_obj>27</sink_obj> </item> <item class_id_reference="20" object_id="_28"> <id>47</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>33</sink_obj> </item> <item class_id_reference="20" object_id="_29"> <id>48</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>33</sink_obj> </item> <item class_id_reference="20" object_id="_30"> <id>49</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>33</sink_obj> </item> <item class_id_reference="20" object_id="_31"> <id>50</id> <edge_type>1</edge_type> <source_obj>11</source_obj> <sink_obj>33</sink_obj> </item> <item class_id_reference="20" object_id="_32"> <id>52</id> <edge_type>1</edge_type> <source_obj>51</source_obj> <sink_obj>34</sink_obj> </item> <item class_id_reference="20" object_id="_33"> <id>53</id> <edge_type>1</edge_type> <source_obj>11</source_obj> <sink_obj>34</sink_obj> </item> <item class_id_reference="20" object_id="_34"> <id>54</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>34</sink_obj> </item> <item class_id_reference="20" object_id="_35"> <id>55</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>34</sink_obj> </item> <item class_id_reference="20" object_id="_36"> <id>57</id> <edge_type>1</edge_type> <source_obj>56</source_obj> <sink_obj>35</sink_obj> </item> <item class_id_reference="20" object_id="_37"> <id>58</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>35</sink_obj> </item> <item class_id_reference="20" object_id="_38"> <id>59</id> <edge_type>1</edge_type> <source_obj>23</source_obj> <sink_obj>35</sink_obj> </item> <item class_id_reference="20" object_id="_39"> <id>61</id> <edge_type>1</edge_type> <source_obj>60</source_obj> <sink_obj>36</sink_obj> </item> <item class_id_reference="20" object_id="_40"> <id>62</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>36</sink_obj> </item> <item class_id_reference="20" object_id="_41"> <id>63</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>36</sink_obj> </item> <item class_id_reference="20" object_id="_42"> <id>65</id> <edge_type>1</edge_type> <source_obj>64</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_43"> <id>66</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_44"> <id>67</id> <edge_type>1</edge_type> <source_obj>4</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_45"> <id>68</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_46"> <id>69</id> <edge_type>1</edge_type> <source_obj>23</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_47"> <id>325</id> <edge_type>4</edge_type> <source_obj>36</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_48"> <id>326</id> <edge_type>4</edge_type> <source_obj>35</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_49"> <id>327</id> <edge_type>4</edge_type> <source_obj>34</source_obj> <sink_obj>35</sink_obj> </item> <item class_id_reference="20" object_id="_50"> <id>328</id> <edge_type>4</edge_type> <source_obj>34</source_obj> <sink_obj>36</sink_obj> </item> <item class_id_reference="20" object_id="_51"> <id>329</id> <edge_type>4</edge_type> <source_obj>33</source_obj> <sink_obj>34</sink_obj> </item> <item class_id_reference="20" object_id="_52"> <id>330</id> <edge_type>4</edge_type> <source_obj>33</source_obj> <sink_obj>34</sink_obj> </item> <item class_id_reference="20" object_id="_53"> <id>331</id> <edge_type>4</edge_type> <source_obj>34</source_obj> <sink_obj>35</sink_obj> </item> <item class_id_reference="20" object_id="_54"> <id>332</id> <edge_type>4</edge_type> <source_obj>35</source_obj> <sink_obj>37</sink_obj> </item> </edges> </cdfg> <cdfg_regions class_id="21" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="22" tracking_level="1" version="0" object_id="_55"> <mId>1</mId> <mTag>hls_target</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>39</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>33</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>1</mIsDfPipe> <mDfPipe class_id="23" tracking_level="1" version="0" object_id="_56"> <port_list class_id="24" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </port_list> <process_list 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="_57"> <type>0</type> <name>linebuffer_1_U0</name> <ssdmobj_id>33</ssdmobj_id> <pins class_id="27" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_58"> <port class_id="29" tracking_level="1" version="0" object_id="_59"> <name>in_axi_stream_V_value_V</name> <dir>3</dir> <type>0</type> </port> <inst class_id="30" tracking_level="1" version="0" object_id="_60"> <type>0</type> <name>linebuffer_1_U0</name> <ssdmobj_id>33</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_61"> <port class_id_reference="29" object_id="_62"> <name>in_axi_stream_V_last_V</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_60"></inst> </item> <item class_id_reference="28" object_id="_63"> <port class_id_reference="29" object_id="_64"> <name>out_stream_V_value_V</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_60"></inst> </item> </pins> </item> <item class_id_reference="26" object_id="_65"> <type>0</type> <name>Loop_1_proc_U0</name> <ssdmobj_id>34</ssdmobj_id> <pins> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_66"> <port class_id_reference="29" object_id="_67"> <name>p_hw_input_stencil_stream_V_value_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id="_68"> <type>0</type> <name>Loop_1_proc_U0</name> <ssdmobj_id>34</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_69"> <port class_id_reference="29" object_id="_70"> <name>p_hw_input_stencil_stream_to_delayed_input_V_value_V</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_68"></inst> </item> <item class_id_reference="28" object_id="_71"> <port class_id_reference="29" object_id="_72"> <name>p_hw_input_stencil_stream_to_mul_V_value_V</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_68"></inst> </item> </pins> </item> <item class_id_reference="26" object_id="_73"> <type>0</type> <name>Loop_2_proc_U0</name> <ssdmobj_id>35</ssdmobj_id> <pins> <count>2</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_74"> <port class_id_reference="29" object_id="_75"> <name>p_hw_input_stencil_stream_to_delayed_input_V_value_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id="_76"> <type>0</type> <name>Loop_2_proc_U0</name> <ssdmobj_id>35</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_77"> <port class_id_reference="29" object_id="_78"> <name>p_delayed_input_stencil_stream_V_value_V</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_76"></inst> </item> </pins> </item> <item class_id_reference="26" object_id="_79"> <type>0</type> <name>Loop_3_proc_U0</name> <ssdmobj_id>36</ssdmobj_id> <pins> <count>2</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_80"> <port class_id_reference="29" object_id="_81"> <name>p_hw_input_stencil_stream_to_mul_V_value_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id="_82"> <type>0</type> <name>Loop_3_proc_U0</name> <ssdmobj_id>36</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_83"> <port class_id_reference="29" object_id="_84"> <name>p_mul_stencil_stream_V_value_V</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_82"></inst> </item> </pins> </item> <item class_id_reference="26" object_id="_85"> <type>0</type> <name>Loop_4_proc_U0</name> <ssdmobj_id>37</ssdmobj_id> <pins> <count>4</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_86"> <port class_id_reference="29" object_id="_87"> <name>hw_output_V_value_V</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id="_88"> <type>0</type> <name>Loop_4_proc_U0</name> <ssdmobj_id>37</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_89"> <port class_id_reference="29" object_id="_90"> <name>hw_output_V_last_V</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_88"></inst> </item> <item class_id_reference="28" object_id="_91"> <port class_id_reference="29" object_id="_92"> <name>p_mul_stencil_stream_V_value_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_88"></inst> </item> <item class_id_reference="28" object_id="_93"> <port class_id_reference="29" object_id="_94"> <name>p_delayed_input_stencil_stream_V_value_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_88"></inst> </item> </pins> </item> </process_list> <channel_list class_id="31" tracking_level="0" version="0"> <count>5</count> <item_version>0</item_version> <item class_id="32" tracking_level="1" version="0" object_id="_95"> <type>1</type> <name>p_hw_input_stencil_st</name> <ssdmobj_id>11</ssdmobj_id> <ctype>0</ctype> <depth>1</depth> <bitwidth>72</bitwidth> <source class_id_reference="28" object_id="_96"> <port class_id_reference="29" object_id="_97"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_60"></inst> </source> <sink class_id_reference="28" object_id="_98"> <port class_id_reference="29" object_id="_99"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_68"></inst> </sink> </item> <item class_id_reference="32" object_id="_100"> <type>1</type> <name>p_hw_input_stencil_st_3</name> <ssdmobj_id>15</ssdmobj_id> <ctype>0</ctype> <depth>1</depth> <bitwidth>72</bitwidth> <source class_id_reference="28" object_id="_101"> <port class_id_reference="29" object_id="_102"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_68"></inst> </source> <sink class_id_reference="28" object_id="_103"> <port class_id_reference="29" object_id="_104"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_76"></inst> </sink> </item> <item class_id_reference="32" object_id="_105"> <type>1</type> <name>p_hw_input_stencil_st_4</name> <ssdmobj_id>19</ssdmobj_id> <ctype>0</ctype> <depth>1</depth> <bitwidth>72</bitwidth> <source class_id_reference="28" object_id="_106"> <port class_id_reference="29" object_id="_107"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_68"></inst> </source> <sink class_id_reference="28" object_id="_108"> <port class_id_reference="29" object_id="_109"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_82"></inst> </sink> </item> <item class_id_reference="32" object_id="_110"> <type>1</type> <name>p_delayed_input_stenc</name> <ssdmobj_id>23</ssdmobj_id> <ctype>0</ctype> <depth>1</depth> <bitwidth>32</bitwidth> <source class_id_reference="28" object_id="_111"> <port class_id_reference="29" object_id="_112"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_76"></inst> </source> <sink class_id_reference="28" object_id="_113"> <port class_id_reference="29" object_id="_114"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_88"></inst> </sink> </item> <item class_id_reference="32" object_id="_115"> <type>1</type> <name>p_mul_stencil_stream_s</name> <ssdmobj_id>27</ssdmobj_id> <ctype>0</ctype> <depth>1</depth> <bitwidth>32</bitwidth> <source class_id_reference="28" object_id="_116"> <port class_id_reference="29" object_id="_117"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_82"></inst> </source> <sink class_id_reference="28" object_id="_118"> <port class_id_reference="29" object_id="_119"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_88"></inst> </sink> </item> </channel_list> <net_list class_id="33" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </net_list> </mDfPipe> </item> </cdfg_regions> <fsm class_id="34" tracking_level="1" version="0" object_id="_120"> <states class_id="35" tracking_level="0" version="0"> <count>8</count> <item_version>0</item_version> <item class_id="36" tracking_level="1" version="0" object_id="_121"> <id>1</id> <operations class_id="37" tracking_level="0" version="0"> <count>6</count> <item_version>0</item_version> <item class_id="38" tracking_level="1" version="0" object_id="_122"> <id>11</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_123"> <id>15</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_124"> <id>19</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_125"> <id>23</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_126"> <id>27</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_127"> <id>33</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_128"> <id>2</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_129"> <id>33</id> <stage>1</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_130"> <id>3</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_131"> <id>34</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_132"> <id>4</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_133"> <id>34</id> <stage>1</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_134"> <id>5</id> <operations> <count>2</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_135"> <id>35</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="38" object_id="_136"> <id>36</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_137"> <id>6</id> <operations> <count>2</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_138"> <id>35</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="38" object_id="_139"> <id>36</id> <stage>1</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_140"> <id>7</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_141"> <id>37</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_142"> <id>8</id> <operations> <count>25</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_143"> <id>5</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_144"> <id>6</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_145"> <id>7</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_146"> <id>8</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_147"> <id>9</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_148"> <id>10</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_149"> <id>12</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_150"> <id>13</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_151"> <id>14</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_152"> <id>16</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_153"> <id>17</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_154"> <id>18</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_155"> <id>20</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_156"> <id>21</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_157"> <id>22</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_158"> <id>24</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_159"> <id>25</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_160"> <id>26</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_161"> <id>28</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_162"> <id>29</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_163"> <id>30</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_164"> <id>31</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_165"> <id>32</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_166"> <id>37</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="38" object_id="_167"> <id>38</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="39" tracking_level="0" version="0"> <count>7</count> <item_version>0</item_version> <item class_id="40" tracking_level="1" version="0" object_id="_168"> <inState>1</inState> <outState>2</outState> <condition class_id="41" tracking_level="0" version="0"> <id>0</id> <sop class_id="42" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="43" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="40" object_id="_169"> <inState>2</inState> <outState>3</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="40" object_id="_170"> <inState>3</inState> <outState>4</outState> <condition> <id>2</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="40" object_id="_171"> <inState>4</inState> <outState>5</outState> <condition> <id>3</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="40" object_id="_172"> <inState>5</inState> <outState>6</outState> <condition> <id>4</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="40" object_id="_173"> <inState>6</inState> <outState>7</outState> <condition> <id>5</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="40" object_id="_174"> <inState>7</inState> <outState>8</outState> <condition> <id>6</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> </transitions> </fsm> <res class_id="-1"></res> <node_label_latency class_id="45" tracking_level="0" version="0"> <count>11</count> <item_version>0</item_version> <item class_id="46" tracking_level="0" version="0"> <first>11</first> <second class_id="47" 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>19</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>23</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>27</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>33</first> <second> <first>0</first> <second>1</second> </second> </item> <item> <first>34</first> <second> <first>2</first> <second>1</second> </second> </item> <item> <first>35</first> <second> <first>4</first> <second>1</second> </second> </item> <item> <first>36</first> <second> <first>4</first> <second>1</second> </second> </item> <item> <first>37</first> <second> <first>6</first> <second>1</second> </second> </item> <item> <first>38</first> <second> <first>7</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="48" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="49" tracking_level="0" version="0"> <first>39</first> <second class_id="50" tracking_level="0" version="0"> <first>0</first> <second>7</second> </second> </item> </bblk_ent_exit> <regions class_id="51" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="52" tracking_level="1" version="0" object_id="_175"> <region_name>hls_target</region_name> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>39</item> </basic_blocks> <nodes> <count>34</count> <item_version>0</item_version> <item>5</item> <item>6</item> <item>7</item> <item>8</item> <item>9</item> <item>10</item> <item>11</item> <item>12</item> <item>13</item> <item>14</item> <item>15</item> <item>16</item> <item>17</item> <item>18</item> <item>19</item> <item>20</item> <item>21</item> <item>22</item> <item>23</item> <item>24</item> <item>25</item> <item>26</item> <item>27</item> <item>28</item> <item>29</item> <item>30</item> <item>31</item> <item>32</item> <item>33</item> <item>34</item> <item>35</item> <item>36</item> <item>37</item> <item>38</item> </nodes> <anchor_node>-1</anchor_node> <region_type>16</region_type> <interval>0</interval> <pipe_depth>0</pipe_depth> </item> </regions> <dp_fu_nodes class_id="53" tracking_level="0" version="0"> <count>10</count> <item_version>0</item_version> <item class_id="54" tracking_level="0" version="0"> <first>62</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> <item> <first>66</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> <item> <first>70</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>74</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>78</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>82</first> <second> <count>2</count> <item_version>0</item_version> <item>33</item> <item>33</item> </second> </item> <item> <first>91</first> <second> <count>2</count> <item_version>0</item_version> <item>36</item> <item>36</item> </second> </item> <item> <first>97</first> <second> <count>2</count> <item_version>0</item_version> <item>37</item> <item>37</item> </second> </item> <item> <first>107</first> <second> <count>2</count> <item_version>0</item_version> <item>35</item> <item>35</item> </second> </item> <item> <first>113</first> <second> <count>2</count> <item_version>0</item_version> <item>34</item> <item>34</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="56" tracking_level="0" version="0"> <count>5</count> <item_version>0</item_version> <item class_id="57" tracking_level="0" version="0"> <first>p_delayed_input_stenc_fu_74</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>p_hw_input_stencil_st_3_fu_66</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> <item> <first>p_hw_input_stencil_st_4_fu_70</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>p_hw_input_stencil_st_fu_62</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> <item> <first>p_mul_stencil_stream_s_fu_78</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> </dp_fu_nodes_expression> <dp_fu_nodes_module> <count>5</count> <item_version>0</item_version> <item> <first>grp_Loop_1_proc_fu_113</first> <second> <count>2</count> <item_version>0</item_version> <item>34</item> <item>34</item> </second> </item> <item> <first>grp_Loop_2_proc_fu_107</first> <second> <count>2</count> <item_version>0</item_version> <item>35</item> <item>35</item> </second> </item> <item> <first>grp_Loop_3_proc_fu_91</first> <second> <count>2</count> <item_version>0</item_version> <item>36</item> <item>36</item> </second> </item> <item> <first>grp_Loop_4_proc_fu_97</first> <second> <count>2</count> <item_version>0</item_version> <item>37</item> <item>37</item> </second> </item> <item> <first>grp_linebuffer_1_fu_82</first> <second> <count>2</count> <item_version>0</item_version> <item>33</item> <item>33</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="58" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_mem_port_nodes> <dp_reg_nodes> <count>5</count> <item_version>0</item_version> <item> <first>120</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> <item> <first>126</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> <item> <first>132</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>138</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>144</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> </dp_reg_nodes> <dp_regname_nodes> <count>5</count> <item_version>0</item_version> <item> <first>p_delayed_input_stenc_reg_138</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>p_hw_input_stencil_st_3_reg_126</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> <item> <first>p_hw_input_stencil_st_4_reg_132</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>p_hw_input_stencil_st_reg_120</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> <item> <first>p_mul_stencil_stream_s_reg_144</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> </dp_regname_nodes> <dp_reg_phi> <count>0</count> <item_version>0</item_version> </dp_reg_phi> <dp_regname_phi> <count>0</count> <item_version>0</item_version> </dp_regname_phi> <dp_port_io_nodes class_id="59" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="60" tracking_level="0" version="0"> <first>hw_input_V_last_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>33</item> </second> </item> </second> </item> <item> <first>hw_input_V_value_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>33</item> </second> </item> </second> </item> <item> <first>hw_output_V_last_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> </second> </item> <item> <first>hw_output_V_value_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core class_id="61" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </port2core> <node2core> <count>5</count> <item_version>0</item_version> <item class_id="62" tracking_level="0" version="0"> <first>11</first> <second>FIFO_SRL</second> </item> <item> <first>15</first> <second>FIFO_SRL</second> </item> <item> <first>19</first> <second>FIFO_SRL</second> </item> <item> <first>23</first> <second>FIFO_SRL</second> </item> <item> <first>27</first> <second>FIFO_SRL</second> </item> </node2core> </syndb> </boost_serialization>
26.912273
138
0.594802
132435b822783ad5cc9321dc7144a94ec1c5a232
8,322
ads
Ada
source/nodes/program-nodes-anonymous_access_to_functions.ads
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
null
null
null
source/nodes/program-nodes-anonymous_access_to_functions.ads
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
null
null
null
source/nodes/program-nodes-anonymous_access_to_functions.ads
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 ------------------------------------------------------------- with Program.Lexical_Elements; with Program.Elements.Parameter_Specifications; with Program.Elements.Anonymous_Access_To_Functions; with Program.Element_Visitors; package Program.Nodes.Anonymous_Access_To_Functions is pragma Preelaborate; type Anonymous_Access_To_Function is new Program.Nodes.Node and Program.Elements.Anonymous_Access_To_Functions .Anonymous_Access_To_Function and Program.Elements.Anonymous_Access_To_Functions .Anonymous_Access_To_Function_Text with private; function Create (Not_Token : Program.Lexical_Elements.Lexical_Element_Access; Null_Token : Program.Lexical_Elements.Lexical_Element_Access; Access_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Protected_Token : Program.Lexical_Elements.Lexical_Element_Access; Function_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access; Parameters : Program.Elements.Parameter_Specifications .Parameter_Specification_Vector_Access; Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access; Return_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Not_Token_2 : Program.Lexical_Elements.Lexical_Element_Access; Null_Token_2 : Program.Lexical_Elements.Lexical_Element_Access; Result_Subtype : not null Program.Elements.Element_Access) return Anonymous_Access_To_Function; type Implicit_Anonymous_Access_To_Function is new Program.Nodes.Node and Program.Elements.Anonymous_Access_To_Functions .Anonymous_Access_To_Function with private; function Create (Parameters : Program.Elements.Parameter_Specifications .Parameter_Specification_Vector_Access; Result_Subtype : not null Program.Elements.Element_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False; Has_Not_Null : Boolean := False; Has_Protected : Boolean := False; Has_Not_Null_2 : Boolean := False) return Implicit_Anonymous_Access_To_Function with Pre => Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance; private type Base_Anonymous_Access_To_Function is abstract new Program.Nodes.Node and Program.Elements.Anonymous_Access_To_Functions .Anonymous_Access_To_Function with record Parameters : Program.Elements.Parameter_Specifications .Parameter_Specification_Vector_Access; Result_Subtype : not null Program.Elements.Element_Access; end record; procedure Initialize (Self : in out Base_Anonymous_Access_To_Function'Class); overriding procedure Visit (Self : not null access Base_Anonymous_Access_To_Function; Visitor : in out Program.Element_Visitors.Element_Visitor'Class); overriding function Parameters (Self : Base_Anonymous_Access_To_Function) return Program.Elements.Parameter_Specifications .Parameter_Specification_Vector_Access; overriding function Result_Subtype (Self : Base_Anonymous_Access_To_Function) return not null Program.Elements.Element_Access; overriding function Is_Anonymous_Access_To_Function (Self : Base_Anonymous_Access_To_Function) return Boolean; overriding function Is_Anonymous_Access_Definition (Self : Base_Anonymous_Access_To_Function) return Boolean; overriding function Is_Definition (Self : Base_Anonymous_Access_To_Function) return Boolean; type Anonymous_Access_To_Function is new Base_Anonymous_Access_To_Function and Program.Elements.Anonymous_Access_To_Functions .Anonymous_Access_To_Function_Text with record Not_Token : Program.Lexical_Elements.Lexical_Element_Access; Null_Token : Program.Lexical_Elements.Lexical_Element_Access; Access_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Protected_Token : Program.Lexical_Elements.Lexical_Element_Access; Function_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; Return_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Not_Token_2 : Program.Lexical_Elements.Lexical_Element_Access; Null_Token_2 : Program.Lexical_Elements.Lexical_Element_Access; end record; overriding function To_Anonymous_Access_To_Function_Text (Self : in out Anonymous_Access_To_Function) return Program.Elements.Anonymous_Access_To_Functions .Anonymous_Access_To_Function_Text_Access; overriding function Not_Token (Self : Anonymous_Access_To_Function) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Null_Token (Self : Anonymous_Access_To_Function) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Access_Token (Self : Anonymous_Access_To_Function) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function Protected_Token (Self : Anonymous_Access_To_Function) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Function_Token (Self : Anonymous_Access_To_Function) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function Left_Bracket_Token (Self : Anonymous_Access_To_Function) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Right_Bracket_Token (Self : Anonymous_Access_To_Function) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Return_Token (Self : Anonymous_Access_To_Function) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function Not_Token_2 (Self : Anonymous_Access_To_Function) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Null_Token_2 (Self : Anonymous_Access_To_Function) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Has_Not_Null (Self : Anonymous_Access_To_Function) return Boolean; overriding function Has_Protected (Self : Anonymous_Access_To_Function) return Boolean; overriding function Has_Not_Null_2 (Self : Anonymous_Access_To_Function) return Boolean; type Implicit_Anonymous_Access_To_Function is new Base_Anonymous_Access_To_Function with record Is_Part_Of_Implicit : Boolean; Is_Part_Of_Inherited : Boolean; Is_Part_Of_Instance : Boolean; Has_Not_Null : Boolean; Has_Protected : Boolean; Has_Not_Null_2 : Boolean; end record; overriding function To_Anonymous_Access_To_Function_Text (Self : in out Implicit_Anonymous_Access_To_Function) return Program.Elements.Anonymous_Access_To_Functions .Anonymous_Access_To_Function_Text_Access; overriding function Is_Part_Of_Implicit (Self : Implicit_Anonymous_Access_To_Function) return Boolean; overriding function Is_Part_Of_Inherited (Self : Implicit_Anonymous_Access_To_Function) return Boolean; overriding function Is_Part_Of_Instance (Self : Implicit_Anonymous_Access_To_Function) return Boolean; overriding function Has_Not_Null (Self : Implicit_Anonymous_Access_To_Function) return Boolean; overriding function Has_Protected (Self : Implicit_Anonymous_Access_To_Function) return Boolean; overriding function Has_Not_Null_2 (Self : Implicit_Anonymous_Access_To_Function) return Boolean; end Program.Nodes.Anonymous_Access_To_Functions;
38
78
0.751021
c7f44939f29ac0e5ffcffa8bce8b819f269dd5d5
1,071
ada
Ada
Task/Long-multiplication/Ada/long-multiplication-1.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:38.000Z
2018-11-09T22:08:38.000Z
Task/Long-multiplication/Ada/long-multiplication-1.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
null
null
null
Task/Long-multiplication/Ada/long-multiplication-1.ada
mullikine/RosettaCodeData
4f0027c6ce83daa36118ee8b67915a13cd23ab67
[ "Info-ZIP" ]
1
2018-11-09T22:08:40.000Z
2018-11-09T22:08:40.000Z
package Long_Multiplication is type Number (<>) is private; Zero : constant Number; One : constant Number; function Value (Item : in String) return Number; function Image (Item : in Number) return String; overriding function "=" (Left, Right : in Number) return Boolean; function "+" (Left, Right : in Number) return Number; function "*" (Left, Right : in Number) return Number; function Trim (Item : in Number) return Number; private Bits : constant := 16; Base : constant := 2 ** Bits; type Accumulated_Value is range 0 .. (Base - 1) * Base; subtype Digit is Accumulated_Value range 0 .. Base - 1; type Number is array (Natural range <>) of Digit; for Number'Component_Size use Bits; -- or pragma Pack (Number); Zero : constant Number := (1 .. 0 => 0); One : constant Number := (0 => 1); procedure Divide (Dividend : in Number; Divisor : in Digit; Result : out Number; Remainder : out Digit); end Long_Multiplication;
30.6
66
0.611578
13f1ca50f013cbb5f30abd85f969e2dcffda0fd2
5,129
ads
Ada
source/amf/uml/amf-uml-variable_actions-collections.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-variable_actions-collections.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-variable_actions-collections.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.Generic_Collections; package AMF.UML.Variable_Actions.Collections is pragma Preelaborate; package UML_Variable_Action_Collections is new AMF.Generic_Collections (UML_Variable_Action, UML_Variable_Action_Access); type Set_Of_UML_Variable_Action is new UML_Variable_Action_Collections.Set with null record; Empty_Set_Of_UML_Variable_Action : constant Set_Of_UML_Variable_Action; type Ordered_Set_Of_UML_Variable_Action is new UML_Variable_Action_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_UML_Variable_Action : constant Ordered_Set_Of_UML_Variable_Action; type Bag_Of_UML_Variable_Action is new UML_Variable_Action_Collections.Bag with null record; Empty_Bag_Of_UML_Variable_Action : constant Bag_Of_UML_Variable_Action; type Sequence_Of_UML_Variable_Action is new UML_Variable_Action_Collections.Sequence with null record; Empty_Sequence_Of_UML_Variable_Action : constant Sequence_Of_UML_Variable_Action; private Empty_Set_Of_UML_Variable_Action : constant Set_Of_UML_Variable_Action := (UML_Variable_Action_Collections.Set with null record); Empty_Ordered_Set_Of_UML_Variable_Action : constant Ordered_Set_Of_UML_Variable_Action := (UML_Variable_Action_Collections.Ordered_Set with null record); Empty_Bag_Of_UML_Variable_Action : constant Bag_Of_UML_Variable_Action := (UML_Variable_Action_Collections.Bag with null record); Empty_Sequence_Of_UML_Variable_Action : constant Sequence_Of_UML_Variable_Action := (UML_Variable_Action_Collections.Sequence with null record); end AMF.UML.Variable_Actions.Collections;
55.75
90
0.528368
13edb9c049cf941fc7f9d1166fcf113ff598671e
777
ads
Ada
src/gdb/gdb-8.3/gdb/testsuite/gdb.ada/mi_exc_info/const.ads
alrooney/unum-sdk
bbccb10b0cd3500feccbbef22e27ea111c3d18eb
[ "Apache-2.0" ]
31
2018-08-01T21:25:24.000Z
2022-02-14T07:52:34.000Z
src/gdb/gdb-8.3/gdb/testsuite/gdb.ada/mi_exc_info/const.ads
alrooney/unum-sdk
bbccb10b0cd3500feccbbef22e27ea111c3d18eb
[ "Apache-2.0" ]
40
2018-12-03T19:48:52.000Z
2021-03-10T06:34:26.000Z
src/gdb/gdb-8.3/gdb/testsuite/gdb.ada/mi_exc_info/const.ads
alrooney/unum-sdk
bbccb10b0cd3500feccbbef22e27ea111c3d18eb
[ "Apache-2.0" ]
20
2018-11-16T21:19:22.000Z
2021-10-18T23:08:24.000Z
-- Copyright 2013-2019 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 Const is Aint_Global_GDB_E : exception; end Const;
40.894737
73
0.741313
574b18fbee61a414d1b3f599a9ab6adbc06fde60
1,373
ads
Ada
tier-1/xcb/source/thin/xcb-xcb_rectangle_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_rectangle_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_rectangle_t.ads
charlie5/cBound
741be08197a61ad9c72553e3302f3b669902216d
[ "0BSD" ]
null
null
null
-- This file is generated by SWIG. Please do not modify by hand. -- with Interfaces; with Interfaces.C; with Interfaces.C.Pointers; package xcb.xcb_rectangle_t is -- Item -- type Item is record x : aliased Interfaces.Integer_16; y : aliased Interfaces.Integer_16; width : aliased Interfaces.Unsigned_16; height : aliased Interfaces.Unsigned_16; end record; -- Item_Array -- type Item_Array is array (Interfaces.C.size_t range <>) of aliased xcb.xcb_rectangle_t.Item; -- Pointer -- package C_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_rectangle_t.Item, Element_Array => xcb.xcb_rectangle_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_rectangle_t.Pointer; -- Pointer_Pointer -- package C_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_rectangle_t.Pointer, Element_Array => xcb.xcb_rectangle_t.Pointer_Array, Default_Terminator => null); subtype Pointer_Pointer is C_Pointer_Pointers.Pointer; end xcb.xcb_rectangle_t;
26.921569
78
0.660597
2f14e6ddf47d2b755964285829f0a1a704378cfc
1,112
ads
Ada
orka_transforms/src/x86/generic/orka-transforms-singles-matrices.ads
onox/orka
9edf99559a16ffa96dfdb208322f4d18efbcbac6
[ "Apache-2.0" ]
52
2016-07-30T23:00:28.000Z
2022-02-05T11:54:55.000Z
orka_transforms/src/x86/generic/orka-transforms-singles-matrices.ads
onox/orka
9edf99559a16ffa96dfdb208322f4d18efbcbac6
[ "Apache-2.0" ]
79
2016-08-01T18:36:48.000Z
2022-02-27T12:14:20.000Z
orka_transforms/src/x86/generic/orka-transforms-singles-matrices.ads
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) 2016 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 Orka.Transforms.SIMD_Matrices; with Orka.Transforms.Singles.Vectors; with Orka.SIMD.SSE.Singles.Arithmetic; with Orka.SIMD.SSE.Singles.Swizzle; package Orka.Transforms.Singles.Matrices is new Orka.Transforms.SIMD_Matrices (Orka.Transforms.Singles.Vectors, SIMD.SSE.Singles.m128_Array, SIMD.SSE.Singles.Arithmetic."*", SIMD.SSE.Singles.Arithmetic."*", SIMD.SSE.Singles.Swizzle.Transpose); pragma Pure (Orka.Transforms.Singles.Matrices);
39.714286
77
0.756295
04a3ee8f71325629643823865e17ced1fae79a93
1,423
ads
Ada
tier-1/xcb/source/thin/xcb-xcb_segment_iterator_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_segment_iterator_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_segment_iterator_t.ads
charlie5/cBound
741be08197a61ad9c72553e3302f3b669902216d
[ "0BSD" ]
null
null
null
-- This file is generated by SWIG. Please do not modify by hand. -- with Interfaces.C; with xcb.xcb_segment_t; with Interfaces.C; with Interfaces.C.Pointers; package xcb.xcb_segment_iterator_t is -- Item -- type Item is record data : access xcb.xcb_segment_t.Item; the_rem : aliased Interfaces.C.int; index : aliased Interfaces.C.int; end record; -- Item_Array -- type Item_Array is array (Interfaces.C.size_t range <>) of aliased xcb.xcb_segment_iterator_t .Item; -- Pointer -- package C_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_segment_iterator_t.Item, Element_Array => xcb.xcb_segment_iterator_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_segment_iterator_t .Pointer; -- Pointer_Pointer -- package C_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_segment_iterator_t.Pointer, Element_Array => xcb.xcb_segment_iterator_t.Pointer_Array, Default_Terminator => null); subtype Pointer_Pointer is C_Pointer_Pointers.Pointer; end xcb.xcb_segment_iterator_t;
26.351852
75
0.66409
2e7aafc1916ef0ae87f113968afd3b3cb433bc46
6,091
ads
Ada
resources/scripts/api/spyse.ads
walkerdgp/Amass
0fd06fa8f927117e7e918cf1f38c6d71b192f034
[ "Apache-2.0" ]
1
2021-07-16T21:06:34.000Z
2021-07-16T21:06:34.000Z
resources/scripts/api/spyse.ads
walkerdgp/Amass
0fd06fa8f927117e7e918cf1f38c6d71b192f034
[ "Apache-2.0" ]
null
null
null
resources/scripts/api/spyse.ads
walkerdgp/Amass
0fd06fa8f927117e7e918cf1f38c6d71b192f034
[ "Apache-2.0" ]
null
null
null
-- Copyright 2017-2021 Jeff Foley. All rights reserved. -- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. local json = require("json") name = "Spyse" type = "api" function start() setratelimit(1) end function check() local c local cfg = datasrc_config() if cfg ~= nil then c = cfg.credentials end if (c ~= nil and c.key ~= nil and c.key ~= "") then return true end return false end function vertical(ctx, domain) local c local cfg = datasrc_config() if cfg ~= nil then c = cfg.credentials end if (c == nil or c.key == nil or c.key == "") then return end local step = 100 for i = 0,10000,step do local payload = '{"search_params":[{"name":{"operator":"ends","value":".' .. domain .. '"}}],"limit":100,"offset":' .. tostring(i) .. '}' local resp = postreq(ctx, "https://api.spyse.com/v4/data/domain/search", c.key, cfg.ttl, payload) if (resp == "") then break end local d = json.decode(resp) if (d == nil or #(d['data'].items) == 0) then return false end for i, item in pairs(d['data'].items) do sendnames(ctx, item.name) end if (i+step >= d['data'].total_items) then break end end end function horizontal(ctx, domain) local c local cfg = datasrc_config() if cfg ~= nil then c = cfg.credentials end if (c == nil or c.key == nil or c.key == "") then return end horizoncerts(ctx, domain, c.key, cfg.ttl) end function horizoncerts(ctx, domain, key, ttl) local u = "https://api.spyse.com/v4/data/domain/" .. domain local resp = getpage(ctx, u, key, ttl) if (resp == "") then return end local d = json.decode(resp) if (d == nil or #(d['data'].items) == 0) then return end if (d['data'].items[0].cert_summary == nil) then return end local certid = d['data'].items[0].cert_summary.fingerprint_sha256 u = "https://api.spyse.com/v4/data/certificate/" .. certid resp = getpage(ctx, u, key, ttl) if (resp == "") then return end d = json.decode(resp) if (d == nil or #(d['data'].items) == 0) then return end local san = d['data'].items[0].parsed.extensions.subject_alt_name if (san ~= nil and #(san.dns_names) > 0) then for j, name in pairs(san.dns_names) do local names = find(name, subdomainre) if (names ~= nil and #names > 0 and names[1] ~= "") then associated(ctx, domain, names[1]) end end end end function asn(ctx, addr, asn) local c local cfg = datasrc_config() if cfg ~= nil then c = cfg.credentials end if (c == nil or c.key == nil or c.key == "") then return end local prefix if (asn == 0) then if (addr == "") then return end asn, prefix = getasn(ctx, addr, c.key, cfg.ttl) if (asn == 0) then return end end local a = asinfo(ctx, asn, c.key, cfg.ttl) if (a == nil or #(a.netblocks) == 0) then return end if (prefix == "") then prefix = a.netblocks[1] parts = split(prefix, "/") addr = parts[1] end newasn(ctx, { ['addr']=addr, ['asn']=asn, ['prefix']=prefix, ['desc']=a.desc, ['netblocks']=a.netblocks, }) end function getasn(ctx, ip, key, ttl) local u = "https://api.spyse.com/v4/data/ip/" .. tostring(ip) local resp = getpage(ctx, u, key, ttl) if (resp == "") then return 0, "" end local d = json.decode(resp) if (d == nil or #(d['data'].items) == 0) then return 0, "" end local cidr local asn = 0 for i, item in pairs(d['data'].items) do local num = item.isp_info.as_num if (asn == 0 or asn < num) then asn = num cidr = item.cidr end end return asn, cidr end function asinfo(ctx, asn, key, ttl) local u = "https://api.spyse.com/v4/data/as/" .. tostring(asn) local resp = getpage(ctx, u, key, ttl) if (resp == "") then return nil end local d = json.decode(resp) if (d == nil or #(d['data'].items) == 0) then return nil end local cidrs = {} for i, p in pairs(d.items[1].ipv4_cidr_array) do table.insert(cidrs, p.ip .. "/" .. tostring(p.cidr)) end for i, p in pairs(d.items[1].ipv6_cidr_array) do table.insert(cidrs, p.ip .. "/" .. tostring(p.cidr)) end return { desc=d.items[1].as_org, netblocks=cidrs, } end function getpage(ctx, url, key, ttl) local resp, err = request(ctx, { ['url']=url, headers={ ['Authorization']="Bearer " .. key, ['Content-Type']="application/json", }, }) if (err ~= nil and err ~= "") then return "" end return resp end function postreq(ctx, url, key, ttl, payload) local resp, err = request(ctx, { ['url']=url, method="POST", data=payload, headers={ ['Authorization']="Bearer " .. key, ['Content-Type']="application/json", }, }) if (err ~= nil and err ~= "") then return "" end return resp end function sendnames(ctx, content) local names = find(content, subdomainre) if (names == nil) then return end local found = {} for i, v in pairs(names) do if (found[v] == nil) then newname(ctx, v) found[v] = true end end end function split(str, delim) local result = {} local pattern = "[^%" .. delim .. "]+" local matches = find(str, pattern) if (matches == nil or #matches == 0) then return result end for i, match in pairs(matches) do table.insert(result, match) end return result end
22.311355
145
0.529634
1d1e695e9d905b8161889fb58716f20a392cdaa9
280
adb
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/discr23.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/discr23.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/discr23.adb
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- { dg-do compile } with Discr23_Pkg; use Discr23_Pkg; package body Discr23 is N : constant Text := Get; function Try (A : in Text) return Text is begin return A; exception when others => return N; end; procedure Dummy is begin null; end; end Discr23;
14.736842
43
0.660714
3d1e1e782134ee5fca7f5b55bfa9ba4dc4988412
5,588
ads
Ada
.emacs.d/elpa/wisi-3.1.3/sal-gen_unbounded_definite_stacks.ads
caqg/linux-home
eed631aae6f5e59e4f46e14f1dff443abca5fa28
[ "Linux-OpenIB" ]
null
null
null
.emacs.d/elpa/wisi-3.1.3/sal-gen_unbounded_definite_stacks.ads
caqg/linux-home
eed631aae6f5e59e4f46e14f1dff443abca5fa28
[ "Linux-OpenIB" ]
null
null
null
.emacs.d/elpa/wisi-3.1.3/sal-gen_unbounded_definite_stacks.ads
caqg/linux-home
eed631aae6f5e59e4f46e14f1dff443abca5fa28
[ "Linux-OpenIB" ]
null
null
null
-- Abstract: -- -- Stack implementation. -- -- Copyright (C) 1998-2000, 2002-2003, 2009, 2015, 2017 - 2020 Free Software Foundation, Inc. -- -- SAL 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 3, or (at your option) -- any later version. SAL 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 distributed -- with SAL; 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 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. pragma License (Modified_GPL); with Ada.Finalization; with Ada.Iterator_Interfaces; with Ada.Unchecked_Deallocation; generic type Element_Type is private; package SAL.Gen_Unbounded_Definite_Stacks is package Sguds renames SAL.Gen_Unbounded_Definite_Stacks; type Stack is new Ada.Finalization.Controlled with private with Constant_Indexing => Constant_Reference, Default_Iterator => Iterate, Iterator_Element => Element_Type; Empty_Stack : constant Stack; overriding procedure Finalize (Stack : in out Sguds.Stack); overriding procedure Adjust (Stack : in out Sguds.Stack); overriding function "=" (Left, Right : in Sguds.Stack) return Boolean; procedure Clear (Stack : in out Sguds.Stack); -- Empty Stack of all items. function Depth (Stack : in Sguds.Stack) return Base_Peek_Type; -- Returns current count of items in the Stack function Is_Empty (Stack : in Sguds.Stack) return Boolean; -- Returns true iff no items are in Stack. function Peek (Stack : in Sguds.Stack; Index : in Peek_Type := 1) return Element_Type with Inline; -- Return the Index'th item from the top of Stack; the Item is _not_ removed. -- Top item has index 1. -- -- Raises Constraint_Error if Index > Depth. -- -- See also Constant_Ref, implicit indexing procedure Pop (Stack : in out Sguds.Stack; Count : in Base_Peek_Type := 1); -- Remove Count Items from the top of Stack, discard them. -- -- Raises Container_Empty if there are fewer than Count items on -- Stack. function Pop (Stack : in out Sguds.Stack) return Element_Type; -- Remove Item from the top of Stack, and return it. -- -- Raises Container_Empty if Is_Empty. procedure Push (Stack : in out Sguds.Stack; Item : in Element_Type); -- Add Item to the top of Stack. -- -- May raise Container_Full. function Top (Stack : in Sguds.Stack) return Element_Type; -- Return the item at the top of Stack; the Item is _not_ removed. -- Same as Peek (Stack, 1). -- -- Raises Container_Empty if Is_Empty. procedure Set_Depth (Stack : in out Sguds.Stack; Depth : in Peek_Type); -- Empty Stack, set its Depth to Depth. Must be followed by Set -- for each element. -- -- Useful when creating a stack from pre-existing data. procedure Set (Stack : in out Sguds.Stack; Index : in Peek_Type; Depth : in Peek_Type; Element : in Element_Type); -- Set a Stack element. Index is the same as Peek Index; Depth is -- used to compute the index in the underlying array. -- -- Stack must have been initialized by Set_Depth. -- -- Useful when creating a stack from pre-existing data. type Constant_Reference_Type (Element : not null access constant Element_Type) is private with Implicit_Dereference => Element; function Constant_Reference (Container : aliased in Stack'Class; Position : in Peek_Type) return Constant_Reference_Type with Inline, Pre => Position in 1 .. Container.Depth; type Cursor (<>) is private; function Constant_Reference (Container : aliased in Stack'Class; Position : in Cursor) return Constant_Reference_Type with Inline, Pre => Has_Element (Position); function Has_Element (Position : in Cursor) return Boolean; package Iterator_Interfaces is new Ada.Iterator_Interfaces (Cursor, Has_Element); function Iterate (Container : aliased in Stack) return Iterator_Interfaces.Forward_Iterator'Class; private type Element_Array is array (Peek_Type range <>) of aliased Element_Type; type Element_Array_Access is access Element_Array; procedure Free is new Ada.Unchecked_Deallocation (Element_Array, Element_Array_Access); type Stack is new Ada.Finalization.Controlled with record Top : Base_Peek_Type := Invalid_Peek_Index; -- empty Data : Element_Array_Access; -- Top of stack is at Data (Top). -- Data (1 .. Top) has been set at some point. end record; type Constant_Reference_Type (Element : not null access constant Element_Type) is record Dummy : Integer := raise Program_Error with "uninitialized reference"; end record; Empty_Stack : constant Stack := (Ada.Finalization.Controlled with Invalid_Peek_Index, null); type Cursor (Container : not null access constant Stack) is record Ptr : Peek_Type; end record; end SAL.Gen_Unbounded_Definite_Stacks;
35.144654
101
0.706335
2e29415e0c18199ec2f09299948b01f49ed1e945
12,288
adb
Ada
llvm-gcc-4.2-2.9/gcc/ada/a-stzsea.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/a-stzsea.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
llvm-gcc-4.2-2.9/gcc/ada/a-stzsea.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . S T R I N G S . W I D E _ W I D E _ S E A R C H -- -- -- -- B o d y -- -- -- -- 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. -- -- -- -- 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.Strings.Wide_Wide_Maps; use Ada.Strings.Wide_Wide_Maps; package body Ada.Strings.Wide_Wide_Search is ----------------------- -- Local Subprograms -- ----------------------- function Belongs (Element : Wide_Wide_Character; Set : Wide_Wide_Maps.Wide_Wide_Character_Set; Test : Membership) return Boolean; pragma Inline (Belongs); -- Determines if the given element is in (Test = Inside) or not in -- (Test = Outside) the given character set. ------------- -- Belongs -- ------------- function Belongs (Element : Wide_Wide_Character; Set : Wide_Wide_Maps.Wide_Wide_Character_Set; Test : Membership) return Boolean is begin if Test = Inside then return Is_In (Element, Set); else return not Is_In (Element, Set); end if; end Belongs; ----------- -- Count -- ----------- function Count (Source : Wide_Wide_String; Pattern : Wide_Wide_String; Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping := Wide_Wide_Maps.Identity) return Natural is N : Natural; J : Natural; begin if Pattern = "" then raise Pattern_Error; end if; -- Handle the case of non-identity mappings by creating a mapped -- string and making a recursive call using the identity mapping -- on this mapped string. if Mapping /= Wide_Wide_Maps.Identity then declare Mapped_Source : Wide_Wide_String (Source'Range); begin for J in Source'Range loop Mapped_Source (J) := Value (Mapping, Source (J)); end loop; return Count (Mapped_Source, Pattern); end; end if; N := 0; J := Source'First; while J <= Source'Last - (Pattern'Length - 1) loop if Source (J .. J + (Pattern'Length - 1)) = Pattern then N := N + 1; J := J + Pattern'Length; else J := J + 1; end if; end loop; return N; end Count; function Count (Source : Wide_Wide_String; Pattern : Wide_Wide_String; Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function) return Natural is Mapped_Source : Wide_Wide_String (Source'Range); begin for J in Source'Range loop Mapped_Source (J) := Mapping (Source (J)); end loop; return Count (Mapped_Source, Pattern); end Count; function Count (Source : Wide_Wide_String; Set : Wide_Wide_Maps.Wide_Wide_Character_Set) return Natural is N : Natural := 0; begin for J in Source'Range loop if Is_In (Source (J), Set) then N := N + 1; end if; end loop; return N; end Count; ---------------- -- Find_Token -- ---------------- procedure Find_Token (Source : Wide_Wide_String; Set : Wide_Wide_Maps.Wide_Wide_Character_Set; Test : Membership; First : out Positive; Last : out Natural) is begin for J in Source'Range loop if Belongs (Source (J), Set, Test) then First := J; for K in J + 1 .. Source'Last loop if not Belongs (Source (K), Set, Test) then Last := K - 1; return; end if; end loop; -- Here if J indexes 1st char of token, and all chars -- after J are in the token Last := Source'Last; return; end if; end loop; -- Here if no token found First := Source'First; Last := 0; end Find_Token; ----------- -- Index -- ----------- function Index (Source : Wide_Wide_String; Pattern : Wide_Wide_String; Going : Direction := Forward; Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping := Wide_Wide_Maps.Identity) return Natural is begin if Pattern = "" then raise Pattern_Error; end if; -- Handle the case of non-identity mappings by creating a mapped -- string and making a recursive call using the identity mapping -- on this mapped string. if Mapping /= Identity then declare Mapped_Source : Wide_Wide_String (Source'Range); begin for J in Source'Range loop Mapped_Source (J) := Value (Mapping, Source (J)); end loop; return Index (Mapped_Source, Pattern, Going); end; end if; if Going = Forward then for J in Source'First .. Source'Last - Pattern'Length + 1 loop if Pattern = Source (J .. J + Pattern'Length - 1) then return J; end if; end loop; else -- Going = Backward for J in reverse Source'First .. Source'Last - Pattern'Length + 1 loop if Pattern = Source (J .. J + Pattern'Length - 1) then return J; end if; end loop; end if; -- Fall through if no match found. Note that the loops are skipped -- completely in the case of the pattern being longer than the source. return 0; end Index; function Index (Source : Wide_Wide_String; Pattern : Wide_Wide_String; Going : Direction := Forward; Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function) return Natural is Mapped_Source : Wide_Wide_String (Source'Range); begin for J in Source'Range loop Mapped_Source (J) := Mapping (Source (J)); end loop; return Index (Mapped_Source, Pattern, Going); end Index; function Index (Source : Wide_Wide_String; Set : Wide_Wide_Maps.Wide_Wide_Character_Set; Test : Membership := Inside; Going : Direction := Forward) return Natural is begin if Going = Forward then for J in Source'Range loop if Belongs (Source (J), Set, Test) then return J; end if; end loop; else -- Going = Backward for J in reverse Source'Range loop if Belongs (Source (J), Set, Test) then return J; end if; end loop; end if; -- Fall through if no match return 0; end Index; function Index (Source : Wide_Wide_String; Pattern : Wide_Wide_String; From : Positive; Going : Direction := Forward; Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping := Wide_Wide_Maps.Identity) return Natural is begin if Going = Forward then if From < Source'First then raise Index_Error; end if; return Index (Source (From .. Source'Last), Pattern, Forward, Mapping); else if From > Source'Last then raise Index_Error; end if; return Index (Source (Source'First .. From), Pattern, Backward, Mapping); end if; end Index; function Index (Source : Wide_Wide_String; Pattern : Wide_Wide_String; From : Positive; Going : Direction := Forward; Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function) return Natural is begin if Going = Forward then if From < Source'First then raise Index_Error; end if; return Index (Source (From .. Source'Last), Pattern, Forward, Mapping); else if From > Source'Last then raise Index_Error; end if; return Index (Source (Source'First .. From), Pattern, Backward, Mapping); end if; end Index; function Index (Source : Wide_Wide_String; Set : Wide_Wide_Maps.Wide_Wide_Character_Set; From : Positive; Test : Membership := Inside; Going : Direction := Forward) return Natural is begin if Going = Forward then if From < Source'First then raise Index_Error; end if; return Index (Source (From .. Source'Last), Set, Test, Forward); else if From > Source'Last then raise Index_Error; end if; return Index (Source (Source'First .. From), Set, Test, Backward); end if; end Index; --------------------- -- Index_Non_Blank -- --------------------- function Index_Non_Blank (Source : Wide_Wide_String; Going : Direction := Forward) return Natural is begin if Going = Forward then for J in Source'Range loop if Source (J) /= Wide_Wide_Space then return J; end if; end loop; else -- Going = Backward for J in reverse Source'Range loop if Source (J) /= Wide_Wide_Space then return J; end if; end loop; end if; -- Fall through if no match return 0; end Index_Non_Blank; function Index_Non_Blank (Source : Wide_Wide_String; From : Positive; Going : Direction := Forward) return Natural is begin if Going = Forward then if From < Source'First then raise Index_Error; end if; return Index_Non_Blank (Source (From .. Source'Last), Forward); else if From > Source'Last then raise Index_Error; end if; return Index_Non_Blank (Source (Source'First .. From), Backward); end if; end Index_Non_Blank; end Ada.Strings.Wide_Wide_Search;
29.187648
79
0.523275
adfaf11d961a179d30d084d4c6f0c4a2296cc576
5,046
adb
Ada
llvm-gcc-4.2-2.9/gcc/ada/s-tpopsp-rtems.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/s-tpopsp-rtems.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
llvm-gcc-4.2-2.9/gcc/ada/s-tpopsp-rtems.adb
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . T A S K _ P R I M I T I V E S . O P E R A T I O N S . -- -- S P E C I F I C -- -- -- -- B o d y -- -- -- -- $Revision: 1.2 $ -- -- -- Copyright (C) 1991-2003, Florida State University -- -- -- -- 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. It is -- -- now maintained by Ada Core Technologies Inc. in cooperation with Florida -- -- State University (http://www.gnat.com). -- -- -- ------------------------------------------------------------------------------ -- This is a RTEMS version of this package which uses a special -- variable for Ada self which is contexted switch implicitly by RTEMS. -- -- This is the same as the POSIX version except that an RTEMS variable -- is used instead of a POSIX key. separate (System.Task_Primitives.Operations) package body Specific is -- The following gives the Ada run-time direct access to a variable -- context switched by RTEMS at the lowest level. RTEMS_Ada_Self : System.Address; pragma Import (C, RTEMS_Ada_Self, "rtems_ada_self"); ---------------- -- Initialize -- ---------------- procedure Initialize (Environment_Task : Task_Id) is pragma Warnings (Off, Environment_Task); begin ATCB_Key := No_Key; RTEMS_Ada_Self := To_Address (Environment_Task); end Initialize; ------------------- -- Is_Valid_Task -- ------------------- function Is_Valid_Task return Boolean is begin return RTEMS_Ada_Self /= System.Null_Address; end Is_Valid_Task; --------- -- Set -- --------- procedure Set (Self_Id : Task_Id) is begin RTEMS_Ada_Self := To_Address (Self_Id); end Set; ---------- -- Self -- ---------- -- To make Ada tasks and C threads interoperate better, we have added some -- functionality to Self. Suppose a C main program (with threads) calls an -- Ada procedure and the Ada procedure calls the tasking runtime system. -- Eventually, a call will be made to self. Since the call is not coming -- from an Ada task, there will be no corresponding ATCB. -- What we do in Self is to catch references that do not come from -- recognized Ada tasks, and create an ATCB for the calling thread. -- The new ATCB will be "detached" from the normal Ada task master -- hierarchy, much like the existing implicitly created signal-server -- tasks. function Self return Task_Id is Result : System.Address; begin Result := RTEMS_Ada_Self; -- If the key value is Null, then it is a non-Ada task. if Result /= System.Null_Address then return To_Task_Id (Result); else return Register_Foreign_Thread; end if; end Self; end Specific;
43.5
78
0.507927
2e716d49c9b17afe58cc3a9ce3ccedefc7045607
2,609
ads
Ada
support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-exnlli.ads
orb-zhuchen/Orb
6da2404b949ac28bde786e08bf4debe4a27cd3a0
[ "CNRI-Python-GPL-Compatible", "MIT" ]
null
null
null
support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-exnlli.ads
orb-zhuchen/Orb
6da2404b949ac28bde786e08bf4debe4a27cd3a0
[ "CNRI-Python-GPL-Compatible", "MIT" ]
null
null
null
support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-exnlli.ads
orb-zhuchen/Orb
6da2404b949ac28bde786e08bf4debe4a27cd3a0
[ "CNRI-Python-GPL-Compatible", "MIT" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . E X N _ L L I -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2019, 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. -- -- -- ------------------------------------------------------------------------------ -- Long_Long_Integer exponentiation (checks off) package System.Exn_LLI is pragma Pure; function Exn_Long_Long_Integer (Left : Long_Long_Integer; Right : Natural) return Long_Long_Integer; end System.Exn_LLI;
60.674419
78
0.39747
13781fbf409ed2f8116b953ad45985a12de74e9a
5,085
ada
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c41107a.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/c4/c41107a.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c41107a.ada
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
-- C41107A.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 AN ARRAY HAVING BOTH POSITIVE AND NEGATIVE -- INDEX VALUES, THE PROPER COMPONENT IS SELECTED - A. -- CHECK THAT FOR AN ARRAY INDEXED WITH AN ENUMERATION TYPE, -- APPROPRIATE COMPONENTS CAN BE SELECTED - B. -- CHECK THAT SUBSCRIPT EXPRESSIONS CAN BE OF COMPLEXITY GREATER -- THAN VARIABLE + - CONSTANT - C. -- CHECK THAT MULTIPLY DIMENSIONED ARRAYS ARE PROPERLY INDEXED - D. -- WKB 7/29/81 -- JBG 8/21/83 WITH REPORT; USE REPORT; PROCEDURE C41107A IS TYPE T1 IS ARRAY (INTEGER RANGE -2..2) OF INTEGER; A : T1 := (1,2,3,4,5); TYPE COLOR IS (RED,ORANGE,YELLOW,GREEN,BLUE); TYPE T2 IS ARRAY (COLOR RANGE RED..BLUE) OF INTEGER; B : T2 := (5,4,3,2,1); C : STRING (1..7) := "ABCDEFG"; TYPE T4 IS ARRAY (1..4,1..3) OF INTEGER; D : T4 := (1 => (1,2,3), 2 => (4,5,6), 3 => (7,8,9), 4 => (0,-1,-2)); V1 : INTEGER := IDENT_INT (1); V2 : INTEGER := IDENT_INT (2); V3 : INTEGER := IDENT_INT (3); PROCEDURE P1 (X : IN INTEGER; Y : IN OUT INTEGER; Z : OUT INTEGER; W : STRING) IS BEGIN IF X /= 1 THEN FAILED ("WRONG VALUE FOR IN PARAMETER - " & W); END IF; IF Y /= 4 THEN FAILED ("WRONG VALUE FOR IN OUT PARAMETER - " & W); END IF; Y := 11; Z := 12; END P1; PROCEDURE P2 (X : IN CHARACTER; Y : IN OUT CHARACTER; Z : OUT CHARACTER) IS BEGIN IF X /= 'D' THEN FAILED ("WRONG VALUE FOR IN PARAMETER - C"); END IF; IF Y /= 'F' THEN FAILED ("WRONG VALUE FOR IN OUT PARAMETER - C"); END IF; Y := 'Y'; Z := 'Z'; END P2; BEGIN TEST ("C41107A", "CHECK THAT THE PROPER COMPONENT IS SELECTED " & "FOR ARRAYS WITH POS AND NEG INDICES, " & "ENUMERATION INDICES, COMPLEX SUBSCRIPT " & "EXPRESSIONS, AND MULTIPLE DIMENSIONS"); IF A(IDENT_INT(1)) /= 4 THEN FAILED ("WRONG VALUE FOR EXPRESSION - A"); END IF; A(IDENT_INT(-2)) := 10; IF A /= (10,2,3,4,5) THEN FAILED ("WRONG TARGET FOR ASSIGNMENT - A"); END IF; A := (2,1,0,3,4); P1 (A(-1), A(2), A(-2), "A"); IF A /= (12,1,0,3,11) THEN FAILED ("WRONG TARGET FOR (IN) OUT PARAMETER - A"); END IF; IF B(GREEN) /= 2 THEN FAILED ("WRONG VALUE FOR EXPRESSION - B"); END IF; B(YELLOW) := 10; IF B /= (5,4,10,2,1) THEN FAILED ("WRONG TARGET FOR ASSIGNMENT - B"); END IF; B := (1,4,2,3,5); P1 (B(RED), B(ORANGE), B(BLUE), "B"); IF B /= (1,11,2,3,12) THEN FAILED ("WRONG TARGET FOR (IN) OUT PARAMETER - B"); END IF; IF C(3..6)(3**2 / 3 * (2-1) - 6 / 3 + 2) /= 'C' THEN FAILED ("WRONG VALUE FOR EXPRESSION - C"); END IF; C(3..6)(V3**2 / V1 * (V3-V2) + IDENT_INT(4) - V3 * V2 - V1) := 'W'; IF C /= "ABCDEWG" THEN FAILED ("WRONG TARGET FOR ASSIGNMENT - C"); END IF; C := "ABCDEFG"; P2 (C(3..6)(V3+V1), C(3..6)(V3*V2), C(3..6)((V1+V2)*V1)); IF C /= "ABZDEYG" THEN FAILED ("WRONG TARGET FOR (IN) OUT PARAMETER - C"); END IF; IF D(IDENT_INT(1),IDENT_INT(3)) /= 3 THEN FAILED ("WRONG VALUE FOR EXPRESSION - D"); END IF; D(IDENT_INT(4),IDENT_INT(2)) := 10; IF D /= ((1,2,3),(4,5,6),(7,8,9),(0,10,-2)) THEN FAILED ("WRONG TARGET FOR ASSIGNMENT - D"); END IF; D := (1 => (0,2,3), 2 => (4,5,6), 3 => (7,8,9), 4 => (1,-1,-2)); P1 (D(4,1), D(2,1), D(3,2), "D"); IF D /= ((0,2,3),(11,5,6),(7,12,9),(1,-1,-2)) THEN FAILED ("WRONG TARGET FOR (IN) OUT PARAMETER - D"); END IF; RESULT; END C41107A;
35.559441
79
0.540806
1327c30dd08af3b944c55631ccb8a8ea252afa96
2,612
ads
Ada
gcc-gcc-7_3_0-release/gcc/ada/a-slcain.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-slcain.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/ada/a-slcain.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ADA.STRINGS.LESS_CASE_INSENSITIVE -- -- -- -- S p e c -- -- -- -- Copyright (C) 2004-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/>. -- -- -- -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ function Ada.Strings.Less_Case_Insensitive (Left, Right : String) return Boolean; pragma Pure (Ada.Strings.Less_Case_Insensitive); -- Performs a case-insensitive lexicographic comparison of Left and -- Right. This is useful as the generic actual less-than operator when -- instantiating an ordered container package with type String as the key, -- allowing case-insensitive equivalence tests.
70.594595
78
0.432619
047d4a6635f8e24126a1b06a09d507d33a38c62c
145
ads
Ada
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/debug7.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/debug7.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/debug7.ads
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
package Debug7 is function Next (I : Integer) return Integer; function Renamed_Next (I : Integer) return Integer renames Next; end Debug7;
29
67
0.751724
adc960b0b2b67a4385cd9ff4853ceb489ebc1bfa
3,451
ads
Ada
source/oasis/program-elements-task_body_declarations.ads
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
null
null
null
source/oasis/program-elements-task_body_declarations.ads
reznikmm/gela
20134f1d154fb763812e73860c6f4b04f353df79
[ "MIT" ]
null
null
null
source/oasis/program-elements-task_body_declarations.ads
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 ------------------------------------------------------------- with Program.Elements.Declarations; with Program.Lexical_Elements; with Program.Elements.Defining_Identifiers; with Program.Elements.Aspect_Specifications; with Program.Element_Vectors; with Program.Elements.Exception_Handlers; with Program.Elements.Identifiers; package Program.Elements.Task_Body_Declarations is pragma Pure (Program.Elements.Task_Body_Declarations); type Task_Body_Declaration is limited interface and Program.Elements.Declarations.Declaration; type Task_Body_Declaration_Access is access all Task_Body_Declaration'Class with Storage_Size => 0; not overriding function Name (Self : Task_Body_Declaration) return not null Program.Elements.Defining_Identifiers .Defining_Identifier_Access is abstract; not overriding function Aspects (Self : Task_Body_Declaration) return Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access is abstract; not overriding function Declarations (Self : Task_Body_Declaration) return Program.Element_Vectors.Element_Vector_Access is abstract; not overriding function Statements (Self : Task_Body_Declaration) return not null Program.Element_Vectors.Element_Vector_Access is abstract; not overriding function Exception_Handlers (Self : Task_Body_Declaration) return Program.Elements.Exception_Handlers .Exception_Handler_Vector_Access is abstract; not overriding function End_Name (Self : Task_Body_Declaration) return Program.Elements.Identifiers.Identifier_Access is abstract; type Task_Body_Declaration_Text is limited interface; type Task_Body_Declaration_Text_Access is access all Task_Body_Declaration_Text'Class with Storage_Size => 0; not overriding function To_Task_Body_Declaration_Text (Self : in out Task_Body_Declaration) return Task_Body_Declaration_Text_Access is abstract; not overriding function Task_Token (Self : Task_Body_Declaration_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Body_Token (Self : Task_Body_Declaration_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function With_Token (Self : Task_Body_Declaration_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Is_Token (Self : Task_Body_Declaration_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Begin_Token (Self : Task_Body_Declaration_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Exception_Token (Self : Task_Body_Declaration_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function End_Token (Self : Task_Body_Declaration_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Semicolon_Token (Self : Task_Body_Declaration_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; end Program.Elements.Task_Body_Declarations;
34.51
78
0.775138
138e0274c88808b1f240ba19881426ead03cc879
934
adb
Ada
generated/simple_webapps-commands-append_servers-server_hash.adb
faelys/simple-webapps
32f4f567cddb54a1703c9b6a8232f01073c92a44
[ "0BSD" ]
1
2017-03-13T21:40:47.000Z
2017-03-13T21:40:47.000Z
generated/simple_webapps-commands-append_servers-server_hash.adb
faelys/simple-webapps
32f4f567cddb54a1703c9b6a8232f01073c92a44
[ "0BSD" ]
null
null
null
generated/simple_webapps-commands-append_servers-server_hash.adb
faelys/simple-webapps
32f4f567cddb54a1703c9b6a8232f01073c92a44
[ "0BSD" ]
null
null
null
with Interfaces; use Interfaces; package body Simple_Webapps.Commands.Append_Servers.Server_Hash is P : constant array (0 .. 1) of Natural := (1, 11); T1 : constant array (0 .. 1) of Unsigned_8 := (10, 12); T2 : constant array (0 .. 1) of Unsigned_8 := (15, 5); G : constant array (0 .. 15) of Unsigned_8 := (0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 3, 4, 0, 4, 0); function Hash (S : String) return Natural is F : constant Natural := S'First - 1; L : constant Natural := S'Length; F1, F2 : Natural := 0; J : Natural; begin for K in P'Range loop exit when L < P (K); J := Character'Pos (S (P (K) + F)); F1 := (F1 + Natural (T1 (K)) * J) mod 16; F2 := (F2 + Natural (T2 (K)) * J) mod 16; end loop; return (Natural (G (F1)) + Natural (G (F2))) mod 7; end Hash; end Simple_Webapps.Commands.Append_Servers.Server_Hash;
28.30303
66
0.543897
136be694daecddf2e80c04c3b159049a8d1a7711
1,290
ads
Ada
src/arch/socs/stm32f439/Ada/soc-gpio-interfaces.ads
wookey-project/ewok-legacy
c973752dac3a0ebe3f7cfca062f50744578f051b
[ "Apache-2.0" ]
null
null
null
src/arch/socs/stm32f439/Ada/soc-gpio-interfaces.ads
wookey-project/ewok-legacy
c973752dac3a0ebe3f7cfca062f50744578f051b
[ "Apache-2.0" ]
null
null
null
src/arch/socs/stm32f439/Ada/soc-gpio-interfaces.ads
wookey-project/ewok-legacy
c973752dac3a0ebe3f7cfca062f50744578f051b
[ "Apache-2.0" ]
null
null
null
-- -- Copyright 2018 The wookey project team <[email protected]> -- - Ryad Benadjila -- - Arnauld Michelizza -- - Mathieu Renard -- - Philippe Thierry -- - Philippe Trebuchet -- -- 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 types.c; package soc.gpio.interfaces with spark_mode => off is function configure (port : in unsigned_8; pin : in unsigned_8; mode : in t_pin_mode; otype : in t_pin_output_type; ospeed : in t_pin_output_speed; pupd : in t_pin_pupd; af : in t_pin_alt_func) return types.c.t_retval with convention => c, export => true, external_name => "soc_gpio_configure"; end soc.gpio.interfaces;
28.666667
79
0.648062
ad27438231669746e1aed0da0f7873556669e13b
1,034
ads
Ada
source/textio/a-wtdeio.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
33
2015-04-04T09:19:36.000Z
2021-11-10T05:33:34.000Z
source/textio/a-wtdeio.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
8
2017-11-14T13:05:07.000Z
2018-08-09T15:28:49.000Z
source/textio/a-wtdeio.ads
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
9
2015-02-03T17:09:53.000Z
2021-11-12T01:16:05.000Z
pragma License (Unrestricted); -- separated and auto-loaded by compiler private generic type Num is delta <> digits <>; package Ada.Wide_Text_IO.Decimal_IO is Default_Fore : Field := Num'Fore; Default_Aft : Field := Num'Aft; Default_Exp : Field := 0; -- procedure Get ( -- File : File_Type; -- Input_File_Type -- Item : out Num; -- Width : Field := 0); -- procedure Get ( -- Item : out Num; -- Width : Field := 0); -- procedure Put ( -- File : File_Type; -- Output_File_Type -- Item : Num; -- Fore : Field := Default_Fore; -- Aft : Field := Default_Aft; -- Exp : Field := Default_Exp); -- procedure Put ( -- Item : Num; -- Fore : Field := Default_Fore; -- Aft : Field := Default_Aft; -- Exp : Field := Default_Exp); -- procedure Get ( -- From : String; -- Item : out Num; -- Last : out Positive); -- procedure Put ( -- To : out String; -- Item : Num; -- Aft : Field := Default_Aft; -- Exp : Field := Default_Exp); end Ada.Wide_Text_IO.Decimal_IO;
24.619048
43
0.589942
c71cc30c4647c842e7fa1d11b40f64470f9c3ff1
1,589
adb
Ada
examples/nonce/demo_ada.adb
jrmarino/libsodium-ada
cca3879ea41e64c05011c9b5f36de550d9435eb9
[ "0BSD" ]
10
2016-07-16T16:22:16.000Z
2021-07-18T13:19:23.000Z
examples/nonce/demo_ada.adb
jrmarino/libsodium-ada
cca3879ea41e64c05011c9b5f36de550d9435eb9
[ "0BSD" ]
1
2022-03-15T20:32:04.000Z
2022-03-23T04:16:05.000Z
examples/nonce/demo_ada.adb
jrmarino/libsodium-ada
cca3879ea41e64c05011c9b5f36de550d9435eb9
[ "0BSD" ]
1
2021-07-18T13:19:02.000Z
2021-07-18T13:19:02.000Z
with Sodium.Functions; use Sodium.Functions; with Ada.Text_IO; use Ada.Text_IO; procedure Demo_Ada is FF : constant Character := Character'Val (255); n1 : String (1 .. 3) := (others => ASCII.NUL); n2 : String (1 .. 3) := (others => FF); n3 : String (1 .. 3) := (3 => Character'Val (254), others => ASCII.NUL); n4 : String (1 .. 3) := (3 => FF, others => ASCII.NUL); n5 : String (1 .. 3) := (1 => Character'Val (5), 2 => FF, 3 => FF); n6 : Box_Nonce; n7 : Symmetric_Nonce; begin if not initialize_sodium_library then Put_Line ("Initialization failed"); return; end if; n6 := Random_Nonce; n7 := Random_Symmetric_Nonce; Put_Line ("N1: " & As_Hexidecimal (n1)); increment_nonce (n1); Put_Line ("+1: " & As_Hexidecimal (n1)); Put_Line (""); Put_Line ("N2: " & As_Hexidecimal (n2)); increment_nonce (n2); Put_Line ("+1: " & As_Hexidecimal (n2)); Put_Line (""); Put_Line ("N3: " & As_Hexidecimal (n3)); increment_nonce (n3); Put_Line ("+1: " & As_Hexidecimal (n3)); Put_Line (""); Put_Line ("N4: " & As_Hexidecimal (n4)); increment_nonce (n4); Put_Line ("+1: " & As_Hexidecimal (n4)); Put_Line (""); Put_Line ("N5: " & As_Hexidecimal (n5)); increment_nonce (n5); Put_Line ("+1: " & As_Hexidecimal (n5)); Put_Line (""); Put_Line ("N6: " & As_Hexidecimal (n6)); increment_nonce (n6); Put_Line ("+1: " & As_Hexidecimal (n6)); Put_Line (""); Put_Line ("N7: " & As_Hexidecimal (n7)); increment_nonce (n7); Put_Line ("+1: " & As_Hexidecimal (n7)); end Demo_Ada;
27.396552
75
0.58842
0473e0ae07cfffce58a941a4455d8580a61c044d
12,352
adb
Ada
test/stream.adb
Fabien-Chouteau/sdlada
f08d72e3f5dcec228d68fb5b6681ea831f81ef47
[ "Zlib" ]
1
2021-10-30T14:41:56.000Z
2021-10-30T14:41:56.000Z
test/stream.adb
Fabien-Chouteau/sdlada
f08d72e3f5dcec228d68fb5b6681ea831f81ef47
[ "Zlib" ]
null
null
null
test/stream.adb
Fabien-Chouteau/sdlada
f08d72e3f5dcec228d68fb5b6681ea831f81ef47
[ "Zlib" ]
null
null
null
with Ada.Calendar; with Ada.Directories; with Ada.Text_IO.Text_Streams; with Ada.Unchecked_Conversion; with Interfaces.C.Pointers; with SDL; with SDL.Error; with SDL.Log; with SDL.Video.Palettes; with SDL.Video.Pixel_Formats; with SDL.Video.Pixels; with SDL.Video.Renderers.Makers; with SDL.Video.Textures.Makers; with SDL.Video.Windows.Makers; with SDL.Versions; with System; with System.Address_To_Access_Conversions; procedure Stream is use type SDL.Dimension; use type SDL.Positive_Sizes; type Moose_Frames is mod 10; type Moose_Colour_Index is range 1 .. 84; type Moose_Palette_Array is array (Moose_Colour_Index'Range) of SDL.Video.Palettes.RGB_Colour; W : SDL.Video.Windows.Window; Moose_Size : SDL.Positive_Sizes := (64, 88); Moose_Frame_Size : constant SDL.Dimension := (Moose_Size.Width * Moose_Size.Height) - 1; Moose_Frame : Moose_Frames := Moose_Frames'First; Moose_Palette : constant Moose_Palette_Array := ((49, 49, 49), (66, 24, 0), (66, 33, 0), (66, 66, 66), (66, 115, 49), (74, 33, 0), (74, 41, 16), (82, 33, 8), (82, 41, 8), (82, 49, 16), (82, 82, 82), (90, 41, 8), (90, 41, 16), (90, 57, 24), (99, 49, 16), (99, 66, 24), (99, 66, 33), (99, 74, 33), (107, 57, 24), (107, 82, 41), (115, 57, 33), (115, 66, 33), (115, 66, 41), (115, 74, 0), (115, 90, 49), (115, 115, 115), (123, 82, 0), (123, 99, 57), (132, 66, 41), (132, 74, 41), (132, 90, 8), (132, 99, 33), (132, 99, 66), (132, 107, 66), (140, 74, 49), (140, 99, 16), (140, 107, 74), (140, 115, 74), (148, 107, 24), (148, 115, 82), (148, 123, 74), (148, 123, 90), (156, 115, 33), (156, 115, 90), (156, 123, 82), (156, 132, 82), (156, 132, 99), (156, 156, 156), (165, 123, 49), (165, 123, 90), (165, 132, 82), (165, 132, 90), (165, 132, 99), (165, 140, 90), (173, 132, 57), (173, 132, 99), (173, 140, 107), (173, 140, 115), (173, 148, 99), (173, 173, 173), (181, 140, 74), (181, 148, 115), (181, 148, 123), (181, 156, 107), (189, 148, 123), (189, 156, 82), (189, 156, 123), (189, 156, 132), (189, 189, 189), (198, 156, 123), (198, 165, 132), (206, 165, 99), (206, 165, 132), (206, 173, 140), (206, 206, 206), (214, 173, 115), (214, 173, 140), (222, 181, 148), (222, 189, 132), (222, 189, 156), (222, 222, 222), (231, 198, 165), (231, 231, 231), (239, 206, 173)); type Moose_Frame_Data_Array is array (Moose_Frames'Range, 0 .. Moose_Frame_Size) of Moose_Colour_Index; Moose_Frame_Data : Moose_Frame_Data_Array; procedure Load_Moose_Data (Data : out Moose_Frame_Data_Array) is package Dirs renames Ada.Directories; Actual_Name : String := "../../test/moose.dat"; Size : Dirs.File_Size := Dirs.Size (Actual_Name); Data_File : Ada.Text_IO.File_Type; Stream : Ada.Text_IO.Text_Streams.Stream_Access := null; use type Ada.Text_IO.File_Mode; begin Ada.Text_IO.Open (File => Data_File, Mode => Ada.Text_IO.In_File, Name => Actual_Name); Stream := Ada.Text_IO.Text_Streams.Stream (File => Data_File); Moose_Frame_Data_Array'Read (Stream, Data); Ada.Text_IO.Close (File => Data_File); exception when others => SDL.Log.Put_Error ("Error, reading source file, " & Actual_Name); raise; end Load_Moose_Data; Renderer : SDL.Video.Renderers.Renderer; Texture : SDL.Video.Textures.Texture; Pixels : SDL.Video.Pixels.ARGB_8888_Access.Pointer; procedure Lock is new SDL.Video.Textures.Lock (Pixel_Pointer_Type => SDL.Video.Pixels.ARGB_8888_Access.Pointer); type Pixel_Array is new SDL.Video.Pixels.ARGB_8888_Array (1 .. Moose_Frame_Size); use type SDL.Video.Pixels.ARGB_8888_Access.Pointer; use type Ada.Calendar.Time; -- This uses the same algorithm as the original teststream.c. It copies 1 pixel at a time, indexing into the moose -- palette using the data from moose.dat. procedure Update_Texture_1 (Pointer : in SDL.Video.Pixels.ARGB_8888_Access.Pointer) is function To_Address is new Ada.Unchecked_Conversion (Source => SDL.Video.Pixels.ARGB_8888_Access.Pointer, Target => System.Address); Start_Time : Ada.Calendar.Time; End_Time : Ada.Calendar.Time; Colour : SDL.Video.Palettes.RGB_Colour; begin Start_Time := Ada.Calendar.Clock; for Y in 1 .. Moose_Size.Height loop declare Dest : SDL.Video.Pixels.ARGB_8888_Access.Pointer := Pointer + Interfaces.C.ptrdiff_t ((Y - 1) * Moose_Size.Width); begin for X in 1 .. Moose_Size.Width loop Colour := Moose_Palette (Moose_Frame_Data (Moose_Frame, ((Y - 1) * Moose_Size.Width) + (X - 1))); Dest.all := SDL.Video.Pixels.ARGB_8888'(Red => Colour.Red, Green => Colour.Green, Blue => Colour.Blue, Alpha => SDL.Video.Palettes.Colour_Component'Last); SDL.Video.Pixels.ARGB_8888_Access.Increment (Dest); end loop; end; end loop; End_Time := Ada.Calendar.Clock; SDL.Log.Put_Debug ("Update_Texture_1 took " & Duration'Image (End_Time - Start_Time) & " seconds."); end Update_Texture_1; type Texture_2D_Array is array (SDL.Dimension range <>, SDL.Dimension range <>) of aliased SDL.Video.Pixels.ARGB_8888; package Texture_2D is new SDL.Video.Pixels.Texture_Data (Index => SDL.Dimension, Element => SDL.Video.Pixels.ARGB_8888, Element_Array_1D => SDL.Video.Pixels.ARGB_8888_Array, Element_Array_2D => Texture_2D_Array, Default_Terminator => SDL.Video.Pixels.ARGB_8888'(others => SDL.Video.Palettes.Colour_Component'First)); procedure Update_Texture_2 (Pointer : in Texture_2D.Pointer) is function To_Address is new Ada.Unchecked_Conversion (Source => SDL.Video.Pixels.ARGB_8888_Access.Pointer, Target => System.Address); Start_Time : Ada.Calendar.Time; End_Time : Ada.Calendar.Time; Colour : SDL.Video.Palettes.RGB_Colour; Actual_Pixels : Texture_2D_Array (1 .. Moose_Size.Height, 1 .. Moose_Size.Width) with Address => To_Address (Pixels); begin Start_Time := Ada.Calendar.Clock; for Y in 1 .. Moose_Size.Height loop for X in 1 .. Moose_Size.Width loop Colour := Moose_Palette (Moose_Frame_Data (Moose_Frame, ((Y - 1) * Moose_Size.Width) + (X - 1))); Actual_Pixels (Y, X) := SDL.Video.Pixels.ARGB_8888'(Red => Colour.Red, Green => Colour.Green, Blue => Colour.Blue, Alpha => SDL.Video.Palettes.Colour_Component'Last); end loop; end loop; End_Time := Ada.Calendar.Clock; SDL.Log.Put_Debug ("Update_Texture_2 took " & Duration'Image (End_Time - Start_Time) & " seconds."); end Update_Texture_2; type Cached_Moose_Frame_Array is array (Moose_Frames) of Texture_2D_Array (1 .. Moose_Size.Height, 1 .. Moose_Size.Width); procedure Cache_Moose (Cache : in out Cached_Moose_Frame_Array; Indices : in Moose_Frame_Data_Array; Palette : in Moose_Palette_Array) is Colour : SDL.Video.Palettes.RGB_Colour; begin for Frame in Moose_Frames loop for Y in 1 .. Moose_Size.Height loop for X in 1 .. Moose_Size.Width loop Colour := Palette (Indices (Frame, ((Y - 1) * Moose_Size.Width) + (X - 1))); Cache (Frame) (Y, X) := SDL.Video.Pixels.ARGB_8888'(Red => Colour.Red, Green => Colour.Green, Blue => Colour.Blue, Alpha => SDL.Video.Palettes.Colour_Component'Last); end loop; end loop; end loop; end Cache_Moose; Cache : Cached_Moose_Frame_Array; begin SDL.Log.Set (Category => SDL.Log.Application, Priority => SDL.Log.Debug); Load_Moose_Data (Data => Moose_Frame_Data); Cache_Moose (Cache, Moose_Frame_Data, Moose_Palette); if SDL.Initialise = True then SDL.Video.Windows.Makers.Create (Win => W, Title => "Stream (Moose animation)", Position => SDL.Natural_Coordinates'(X => 100, Y => 100), Size => Moose_Size * 4, Flags => SDL.Video.Windows.Resizable); SDL.Video.Renderers.Makers.Create (Renderer, W); SDL.Video.Textures.Makers.Create (Tex => Texture, Renderer => Renderer, Format => SDL.Video.Pixel_Formats.Pixel_Format_ARGB_8888, Kind => SDL.Video.Textures.Streaming, Size => Moose_Size); -- W.Set_Mode (SDL.Video.Windows.Full_Screen); -- First test. for Index in 1 .. 10 loop Lock (Texture, Pixels); -- The block makes things a bit clearer. begin Update_Texture_1 (Pixels); end; Texture.Unlock; Renderer.Clear; Renderer.Copy (Texture); Renderer.Present; Moose_Frame := Moose_Frame + 1; -- if Moose_Frame = Moose_Frame'Last then -- Pixel := Data.Element_Array (0)'Access; -- end if; delay 0.05; end loop; Renderer.Clear; Renderer.Present; delay 0.7; SDL.Log.Put_Debug (""); -- Second test. for Index in 1 .. 10 loop Lock (Texture, Pixels); -- The block makes things a bit clearer. begin Update_Texture_2 (Texture_2D.Pointer (Pixels)); end; Texture.Unlock; Renderer.Clear; Renderer.Copy (Texture); Renderer.Present; Moose_Frame := Moose_Frame + 1; -- if Moose_Frame = Moose_Frame'Last then -- Pixel := Data.Element_Array (0)'Access; -- end if; delay 0.05; end loop; Renderer.Clear; Renderer.Present; delay 0.7; SDL.Log.Put_Debug (""); -- Third test. for Index in 1 .. 100 loop Lock (Texture, Pixels); -- The block makes things a bit clearer. Update_Texture_3 : declare function To_Address is new Ada.Unchecked_Conversion (Source => SDL.Video.Pixels.ARGB_8888_Access.Pointer, Target => System.Address); Start_Time : Ada.Calendar.Time; End_Time : Ada.Calendar.Time; Actual_Pixels : Texture_2D_Array (1 .. Moose_Size.Height, 1 .. Moose_Size.Width) with Address => To_Address (Pixels); begin Start_Time := Ada.Calendar.Clock; Actual_Pixels := Cache (Moose_Frame); End_Time := Ada.Calendar.Clock; SDL.Log.Put_Debug ("Update_Texture_3 took " & Duration'Image (End_Time - Start_Time) & " seconds."); end Update_Texture_3; Texture.Unlock; Renderer.Clear; Renderer.Copy (Texture); Renderer.Present; Moose_Frame := Moose_Frame + 1; -- if Moose_Frame = Moose_Frame'Last then -- Pixel := Data.Element_Array (0)'Access; -- end if; delay 0.05; end loop; W.Finalize; SDL.Finalise; end if; end Stream;
39.212698
118
0.549709
1db7cc4065b34a46e5592d6dd0fc374aa69cbe64
2,525
adb
Ada
test/unknown/test_unknown-write.adb
skill-lang/skillAdaTestSuite
279ea0c0cd489c2e39d7532a3b68c564497101e2
[ "BSD-3-Clause" ]
1
2019-02-09T22:04:10.000Z
2019-02-09T22:04:10.000Z
test/unknown/test_unknown-write.adb
skill-lang/skillAdaTestSuite
279ea0c0cd489c2e39d7532a3b68c564497101e2
[ "BSD-3-Clause" ]
null
null
null
test/unknown/test_unknown-write.adb
skill-lang/skillAdaTestSuite
279ea0c0cd489c2e39d7532a3b68c564497101e2
[ "BSD-3-Clause" ]
null
null
null
package body Test_Unknown.Write is File_Name : constant String := "tmp/test-unknown-write.sf"; procedure Initialize (T : in out Test) is begin Set_Name (T, "Test_Unknown.Write"); Ahven.Framework.Add_Test_Routine (T, Check_Types'Access, "unknownSubtypes read written"); Ahven.Framework.Add_Test_Routine (T, Check_Fields_A'Access, "a: all fields are self-references"); Ahven.Framework.Add_Test_Routine (T, Check_Fields_C'Access, "c: all fields are self-references"); end Initialize; procedure Set_Up (T : in out Test) is State : access Skill_State := new Skill_State; begin Skill.Read (State, "resources/localBasePoolStartIndex.sf"); Skill.Write (State, File_Name); end Set_Up; procedure Tear_Down (T : in out Test) is begin Ada.Directories.Delete_File (File_Name); end Tear_Down; procedure Check_Types (T : in out Ahven.Framework.Test_Case'Class) is use Ada.Characters.Handling; use Ada.Strings.Fixed; use Ada.Tags; State : access Skill_State := new Skill_State; begin Skill.Read (State, File_Name); declare Types : constant String := "aaaaaaaaaaacc"; begin for I in Types'Range loop declare Object : Skill_Type'Class := Get_A (State, I).all; C : Character := To_Lower (Expanded_Name (Object'Tag)(9)); begin Ahven.Assert (Types (I) = C, "index " & Trim (I'Img, Ada.Strings.Left)); end; end loop; end; end Check_Types; procedure Check_Fields_A (T : in out Ahven.Framework.Test_Case'Class) is use Ada.Strings.Fixed; State : access Skill_State := new Skill_State; begin Skill.Read (State, File_Name); for I in 1 .. As_Size (State) loop declare X : A_Type_Access := Get_A (State, I); begin Ahven.Assert (X = X.Get_A, "index " & Trim (I'Img, Ada.Strings.Left)); end; end loop; end Check_Fields_A; procedure Check_Fields_C (T : in out Ahven.Framework.Test_Case'Class) is use Ada.Strings.Fixed; State : access Skill_State := new Skill_State; begin Skill.Read (State, File_Name); for I in 1 .. Cs_Size (State) loop declare X : C_Type_Access := Get_C (State, I); begin Ahven.Assert (X = X.Get_C, "index " & Trim (I'Img, Ada.Strings.Left)); end; end loop; end Check_Fields_C; end Test_Unknown.Write;
31.5625
103
0.622178
043259dbedc930d33f1989d0e344841f6c4e7765
8,879
adb
Ada
source/required/s-arit64.adb
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
33
2015-04-04T09:19:36.000Z
2021-11-10T05:33:34.000Z
source/required/s-arit64.adb
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
8
2017-11-14T13:05:07.000Z
2018-08-09T15:28:49.000Z
source/required/s-arit64.adb
ytomino/drake
4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2
[ "MIT" ]
9
2015-02-03T17:09:53.000Z
2021-11-12T01:16:05.000Z
with System.Long_Long_Integer_Types; with System.Unwind.Raising; pragma Warnings (Off, System.Unwind.Raising); -- break "pure" rule package body System.Arith_64 is pragma Suppress (All_Checks); use type Interfaces.Integer_64; use type Interfaces.Unsigned_32; use type Interfaces.Unsigned_64; subtype Long_Long_Unsigned is Long_Long_Integer_Types.Long_Long_Unsigned; pragma Compile_Time_Error ( Long_Long_Integer'Size /= 64, "Long_Long_Integer is not 64-bit."); procedure unreachable with Import, Convention => Intrinsic, External_Name => "__builtin_unreachable"; pragma No_Return (unreachable); subtype U32 is Interfaces.Unsigned_32; subtype U64 is Interfaces.Unsigned_64; function add_overflow ( a, b : U64; res : not null access U64) return Boolean with Import, Convention => Intrinsic, External_Name => "__builtin_uaddll_overflow"; function mul_overflow ( a, b : Interfaces.Integer_64; res : not null access Interfaces.Integer_64) return Boolean with Import, Convention => Intrinsic, External_Name => "__builtin_smulll_overflow"; procedure Add (X : U64; R1, R2, R3 : in out U32); procedure Add (X : U64; R1, R2, R3 : in out U32) is R : constant U64 := U64 (R1) or Interfaces.Shift_Left (U64 (R2), 32); XR : aliased U64; Overflow : Boolean; begin Overflow := add_overflow (X, R, XR'Access); R1 := U32'Mod (XR); R2 := U32'Mod (Interfaces.Shift_Right (XR, 32)); if Overflow then R3 := R3 + 1; end if; end Add; procedure Mul (X : U64; Y : U64; RL, RH : out U64); procedure Mul (X : U64; Y : U64; RL, RH : out U64) is X1 : constant U32 := U32'Mod (X); X2 : constant U32 := U32'Mod (Interfaces.Shift_Right (X, 32)); Y1 : constant U32 := U32'Mod (Y); Y2 : constant U32 := U32'Mod (Interfaces.Shift_Right (Y, 32)); R1, R2, R3, R4 : U32; begin declare R12 : constant U64 := U64 (X1) * U64 (Y1); begin R1 := U32'Mod (R12); R2 := U32'Mod (Interfaces.Shift_Right (R12, 32)); end; if X2 = 0 and then Y2 = 0 then R3 := 0; R4 := 0; elsif X2 = 0 then R3 := 0; R4 := 0; declare T23 : constant U64 := U64 (X1) * U64 (Y2); begin Add (T23, R2, R3, R4); end; elsif Y2 = 0 then R3 := 0; R4 := 0; declare T23 : constant U64 := U64 (X2) * U64 (Y1); begin Add (T23, R2, R3, R4); end; else declare R34 : constant U64 := U64 (X2) * U64 (Y2); begin R3 := U32'Mod (R34); R4 := U32'Mod (Interfaces.Shift_Right (R34, 32)); end; declare T23 : constant U64 := U64 (X1) * U64 (Y2); begin Add (T23, R2, R3, R4); end; declare T23 : constant U64 := U64 (X2) * U64 (Y1); begin Add (T23, R2, R3, R4); end; end if; RL := U64 (R1) or Interfaces.Shift_Left (U64 (R2), 32); RH := U64 (R3) or Interfaces.Shift_Left (U64 (R4), 32); end Mul; procedure Div (X : U64; Y : U64; Q : out U64; R : out U64); procedure Div (X : U64; Y : U64; Q : out U64; R : out U64) is begin Long_Long_Integer_Types.Divide ( Long_Long_Unsigned (X), Long_Long_Unsigned (Y), Long_Long_Unsigned (Q), Long_Long_Unsigned (R)); end Div; type Unsigned is mod 2 ** Integer'Size; function clz (X : U64) return Unsigned with Import, Convention => Intrinsic, External_Name => "__builtin_clzll"; procedure Div (XL, XH : U64; Y : U64; Q : out U64; R : out U64); procedure Div (XL, XH : U64; Y : U64; Q : out U64; R : out U64) is Temp_XL : U64 := XL; Temp_XH : U64 := XH; -- XH <= 2 ** 62 (abs signed * abs signed) Rem_Q : U64; begin Q := 0; while Temp_XH > 0 loop declare Scaling_W : constant Natural := Natural (clz (Temp_XH) xor 63) + 1; Scaled_X : U64; begin if Scaling_W not in 1 .. 63 then unreachable; end if; Scaled_X := Interfaces.Shift_Left (Temp_XH, 64 - Scaling_W) or Interfaces.Shift_Right (Temp_XL, Scaling_W); -- 0 < Scaled_X < 2 ** 63 if Scaled_X < Y then -- Y <= 2 ** 63 (original Y is signed) declare YL : constant U64 := Interfaces.Shift_Left (Y, Scaling_W); YH : constant U64 := Interfaces.Shift_Right (Y, 64 - Scaling_W); begin Q := Q + Interfaces.Shift_Left (1, Scaling_W); if Temp_XL < YL then Temp_XH := Temp_XH - 1; -- borrow end if; Temp_XL := Temp_XL - YL; Temp_XH := Temp_XH - YH; end; else declare Temp_Q, Temp_R : U64; begin Div (Scaled_X, Y, Temp_Q, Temp_R); Q := Q + Interfaces.Shift_Left (Temp_Q, Scaling_W); Temp_XH := Interfaces.Shift_Right (Temp_R, 64 - Scaling_W); Temp_XL := Interfaces.Shift_Left (Temp_R, Scaling_W) or ( Temp_XL and (Interfaces.Shift_Left (1, Scaling_W) - 1)); end; end if; end; end loop; Div (Temp_XL, Y, Rem_Q, R); Q := Q + Rem_Q; end Div; -- implementation function Multiply (X, Y : Interfaces.Integer_64) return Interfaces.Integer_64 is Result : aliased Interfaces.Integer_64; begin if mul_overflow (X, Y, Result'Access) then Unwind.Raising.Overflow; end if; return Result; end Multiply; procedure Scaled_Divide ( X, Y, Z : Interfaces.Integer_64; Q, R : out Interfaces.Integer_64; Round : Boolean) is begin if Z = 0 then Unwind.Raising.Zero_Division; end if; declare XY_Is_Minus : constant Boolean := (X < 0) /= (Y < 0); Q_Is_Minus : constant Boolean := XY_Is_Minus /= (Z < 0); AX : constant U64 := U64'Mod (abs X); AY : constant U64 := U64'Mod (abs Y); AZ : constant U64 := U64'Mod (abs Z); AXYL, AXYH : U64; AQ, AR : U64; begin Mul (AX, AY, AXYL, AXYH); if AXYH >= AZ then Unwind.Raising.Overflow; end if; Div (AXYL, AXYH, AZ, AQ, AR); if Round and then AR > (AZ - 1) / 2 then AQ := AQ + 1; end if; if Q_Is_Minus then if AQ > 2 ** 63 then Unwind.Raising.Overflow; end if; Q := -Interfaces.Integer_64 (AQ); else if AQ >= 2 ** 63 then Unwind.Raising.Overflow; end if; Q := Interfaces.Integer_64 (AQ); end if; if XY_Is_Minus then R := -Interfaces.Integer_64 (AR); else R := Interfaces.Integer_64 (AR); end if; end; end Scaled_Divide; procedure Double_Divide ( X, Y, Z : Interfaces.Integer_64; Q, R : out Interfaces.Integer_64; Round : Boolean) is YZ : aliased Interfaces.Integer_64; begin if Y = 0 or else Z = 0 then Unwind.Raising.Zero_Division; end if; if mul_overflow (Y, Z, YZ'Access) then if X = Interfaces.Integer_64'First and then (Y = -1 or else Z = -1) then -- special case, Integer_64'First / (Integer_64'First * -1) Q := -1; R := 0; else Q := 0; R := X; end if; else declare AX : constant U64 := U64'Mod (abs X); AYZ : constant U64 := U64'Mod (abs YZ); AQ, AR : U64; begin Div (AX, AYZ, AQ, AR); if Round and then AR > (AYZ - 1) / 2 then AQ := AQ + 1; end if; if (X < 0) /= (YZ <= 0) then if AQ > 2 ** 63 then Unwind.Raising.Overflow; end if; Q := -Interfaces.Integer_64 (AQ); else if AQ >= 2 ** 63 then Unwind.Raising.Overflow; end if; Q := Interfaces.Integer_64 (AQ); end if; if X < 0 then R := -Interfaces.Integer_64 (AR); else R := Interfaces.Integer_64 (AR); end if; end; end if; end Double_Divide; end System.Arith_64;
31.374558
79
0.504449
57ffde3c388d238ef7e2391f5092817e984041cf
1,148
ads
Ada
gdb/testsuite/gdb.ada/complete/pck.ads
greyblue9/binutils-gdb
05377632b124fe7600eea7f4ee0e9a35d1b0cbdc
[ "BSD-3-Clause" ]
1
2020-10-14T03:24:35.000Z
2020-10-14T03:24:35.000Z
gdb/testsuite/gdb.ada/complete/pck.ads
greyblue9/binutils-gdb
05377632b124fe7600eea7f4ee0e9a35d1b0cbdc
[ "BSD-3-Clause" ]
null
null
null
gdb/testsuite/gdb.ada/complete/pck.ads
greyblue9/binutils-gdb
05377632b124fe7600eea7f4ee0e9a35d1b0cbdc
[ "BSD-3-Clause" ]
null
null
null
-- Copyright 2008-2021 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 My_Global_Variable : Integer := 1; Exported_Capitalized : Integer := 2; pragma Export (C, Exported_Capitalized, "Exported_Capitalized"); Local_Identical_One : Integer := 4; Local_Identical_Two : Integer := 8; External_Identical_One : Integer := 19; package Inner is Inside_Variable : Integer := 3; end Inner; procedure Proc (I : Integer); procedure Ambiguous_Func; end Pck;
31.027027
73
0.720383
04e7baac77130f4d328deacb98affabb2d077864
32,869
adb
Ada
arch/ARM/STM32/devices/stm32f46_79x/stm32-device.adb
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
2
2018-05-16T03:56:39.000Z
2019-07-31T13:53:56.000Z
arch/ARM/STM32/devices/stm32f46_79x/stm32-device.adb
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
null
null
null
arch/ARM/STM32/devices/stm32f46_79x/stm32-device.adb
morbos/Ada_Drivers_Library
a4ab26799be60997c38735f4056160c4af597ef7
[ "BSD-3-Clause" ]
null
null
null
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015-2016, 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 System; use System; pragma Warnings (Off, "* is an internal GNAT unit"); with System.BB.Parameters; pragma Warnings (On, "* is an internal GNAT unit"); with STM32_SVD.RCC; use STM32_SVD.RCC; package body STM32.Device is HSE_VALUE : constant UInt32 := UInt32 (System.BB.Parameters.HSE_Clock); -- External oscillator in Hz HSI_VALUE : constant := 16_000_000; -- Internal oscillator in Hz HPRE_Presc_Table : constant array (UInt4) of UInt32 := (1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 8, 16, 64, 128, 256, 512); PPRE_Presc_Table : constant array (UInt3) of UInt32 := (1, 1, 1, 1, 2, 4, 8, 16); function PLLSAI_Enabled return Boolean; ------------------ -- Enable_Clock -- ------------------ procedure Enable_Clock (This : aliased in out GPIO_Port) is begin if This'Address = GPIOA_Base then RCC_Periph.AHB1ENR.GPIOAEN := True; elsif This'Address = GPIOB_Base then RCC_Periph.AHB1ENR.GPIOBEN := True; elsif This'Address = GPIOC_Base then RCC_Periph.AHB1ENR.GPIOCEN := True; elsif This'Address = GPIOD_Base then RCC_Periph.AHB1ENR.GPIODEN := True; elsif This'Address = GPIOE_Base then RCC_Periph.AHB1ENR.GPIOEEN := True; elsif This'Address = GPIOF_Base then RCC_Periph.AHB1ENR.GPIOFEN := True; elsif This'Address = GPIOG_Base then RCC_Periph.AHB1ENR.GPIOGEN := True; elsif This'Address = GPIOH_Base then RCC_Periph.AHB1ENR.GPIOHEN := True; elsif This'Address = GPIOI_Base then RCC_Periph.AHB1ENR.GPIOIEN := True; elsif This'Address = GPIOJ_Base then RCC_Periph.AHB1ENR.GPIOJEN := True; elsif This'Address = GPIOK_Base then RCC_Periph.AHB1ENR.GPIOKEN := True; else raise Unknown_Device; end if; end Enable_Clock; ------------------ -- Enable_Clock -- ------------------ procedure Enable_Clock (Point : GPIO_Point) is begin Enable_Clock (Point.Periph.all); end Enable_Clock; ------------------ -- Enable_Clock -- ------------------ procedure Enable_Clock (Points : GPIO_Points) is begin for Point of Points loop Enable_Clock (Point.Periph.all); end loop; end Enable_Clock; ----------- -- Reset -- ----------- procedure Reset (This : aliased in out GPIO_Port) is begin if This'Address = GPIOA_Base then RCC_Periph.AHB1RSTR.GPIOARST := True; RCC_Periph.AHB1RSTR.GPIOARST := False; elsif This'Address = GPIOB_Base then RCC_Periph.AHB1RSTR.GPIOBRST := True; RCC_Periph.AHB1RSTR.GPIOBRST := False; elsif This'Address = GPIOC_Base then RCC_Periph.AHB1RSTR.GPIOCRST := True; RCC_Periph.AHB1RSTR.GPIOCRST := False; elsif This'Address = GPIOD_Base then RCC_Periph.AHB1RSTR.GPIODRST := True; RCC_Periph.AHB1RSTR.GPIODRST := False; elsif This'Address = GPIOE_Base then RCC_Periph.AHB1RSTR.GPIOERST := True; RCC_Periph.AHB1RSTR.GPIOERST := False; elsif This'Address = GPIOF_Base then RCC_Periph.AHB1RSTR.GPIOFRST := True; RCC_Periph.AHB1RSTR.GPIOFRST := False; elsif This'Address = GPIOG_Base then RCC_Periph.AHB1RSTR.GPIOGRST := True; RCC_Periph.AHB1RSTR.GPIOGRST := False; elsif This'Address = GPIOH_Base then RCC_Periph.AHB1RSTR.GPIOHRST := True; RCC_Periph.AHB1RSTR.GPIOHRST := False; elsif This'Address = GPIOI_Base then RCC_Periph.AHB1RSTR.GPIOIRST := True; RCC_Periph.AHB1RSTR.GPIOIRST := False; elsif This'Address = GPIOJ_Base then RCC_Periph.AHB1RSTR.GPIOJRST := True; RCC_Periph.AHB1RSTR.GPIOJRST := False; elsif This'Address = GPIOK_Base then RCC_Periph.AHB1RSTR.GPIOKRST := True; RCC_Periph.AHB1RSTR.GPIOKRST := False; else raise Unknown_Device; end if; end Reset; ----------- -- Reset -- ----------- procedure Reset (Point : GPIO_Point) is begin Reset (Point.Periph.all); end Reset; ----------- -- Reset -- ----------- procedure Reset (Points : GPIO_Points) is Do_Reset : Boolean; begin for J in Points'Range loop Do_Reset := True; for K in Points'First .. J - 1 loop if Points (K).Periph = Points (J).Periph then Do_Reset := False; exit; end if; end loop; if Do_Reset then Reset (Points (J).Periph.all); end if; end loop; end Reset; ------------------------------ -- GPIO_Port_Representation -- ------------------------------ function GPIO_Port_Representation (Port : GPIO_Port) return UInt4 is begin -- TODO: rather ugly to have this board-specific range here if Port'Address = GPIOA_Base then return 0; elsif Port'Address = GPIOB_Base then return 1; elsif Port'Address = GPIOC_Base then return 2; elsif Port'Address = GPIOD_Base then return 3; elsif Port'Address = GPIOE_Base then return 4; elsif Port'Address = GPIOF_Base then return 5; elsif Port'Address = GPIOG_Base then return 6; elsif Port'Address = GPIOH_Base then return 7; elsif Port'Address = GPIOI_Base then return 8; elsif Port'Address = GPIOJ_Base then return 9; elsif Port'Address = GPIOK_Base then return 10; else raise Program_Error; end if; end GPIO_Port_Representation; ------------------ -- Enable_Clock -- ------------------ procedure Enable_Clock (This : aliased in out Analog_To_Digital_Converter) is begin if This'Address = ADC1_Base then RCC_Periph.APB2ENR.ADC1EN := True; elsif This'Address = ADC2_Base then RCC_Periph.APB2ENR.ADC2EN := True; elsif This'Address = ADC3_Base then RCC_Periph.APB2ENR.ADC3EN := True; else raise Unknown_Device; end if; end Enable_Clock; ------------------------- -- Reset_All_ADC_Units -- ------------------------- procedure Reset_All_ADC_Units is begin RCC_Periph.APB2RSTR.ADCRST := True; RCC_Periph.APB2RSTR.ADCRST := False; end Reset_All_ADC_Units; ------------------ -- Enable_Clock -- ------------------ procedure Enable_Clock (This : aliased in out Digital_To_Analog_Converter) is pragma Unreferenced (This); begin RCC_Periph.APB1ENR.DACEN := True; end Enable_Clock; ----------- -- Reset -- ----------- procedure Reset (This : aliased in out Digital_To_Analog_Converter) is pragma Unreferenced (This); begin RCC_Periph.APB1RSTR.DACRST := True; RCC_Periph.APB1RSTR.DACRST := False; end Reset; ------------------ -- Enable_Clock -- ------------------ procedure Enable_Clock (This : aliased in out USART) is begin if This.Periph.all'Address = USART1_Base then RCC_Periph.APB2ENR.USART1EN := True; elsif This.Periph.all'Address = USART2_Base then RCC_Periph.APB1ENR.USART2EN := True; elsif This.Periph.all'Address = USART3_Base then RCC_Periph.APB1ENR.USART3EN := True; elsif This.Periph.all'Address = UART4_Base then RCC_Periph.APB1ENR.UART4EN := True; elsif This.Periph.all'Address = UART5_Base then RCC_Periph.APB1ENR.UART5EN := True; elsif This.Periph.all'Address = USART6_Base then RCC_Periph.APB2ENR.USART6EN := True; elsif This.Periph.all'Address = UART7_Base then RCC_Periph.APB1ENR.UART7ENR := True; elsif This.Periph.all'Address = UART8_Base then RCC_Periph.APB1ENR.UART8ENR := True; else raise Unknown_Device; end if; end Enable_Clock; ----------- -- Reset -- ----------- procedure Reset (This : aliased in out USART) is begin if This.Periph.all'Address = USART1_Base then RCC_Periph.APB2RSTR.USART1RST := True; RCC_Periph.APB2RSTR.USART1RST := False; elsif This.Periph.all'Address = USART2_Base then RCC_Periph.APB1RSTR.UART2RST := True; RCC_Periph.APB1RSTR.UART2RST := False; elsif This.Periph.all'Address = USART3_Base then RCC_Periph.APB1RSTR.UART3RST := True; RCC_Periph.APB1RSTR.UART3RST := False; elsif This.Periph.all'Address = UART4_Base then RCC_Periph.APB1RSTR.UART4RST := True; RCC_Periph.APB1RSTR.UART4RST := False; elsif This.Periph.all'Address = UART5_Base then RCC_Periph.APB1RSTR.UART5RST := True; RCC_Periph.APB1RSTR.UART5RST := False; elsif This.Periph.all'Address = USART6_Base then RCC_Periph.APB2RSTR.USART6RST := True; RCC_Periph.APB2RSTR.USART6RST := False; elsif This.Periph.all'Address = UART7_Base then RCC_Periph.APB1RSTR.UART7RST := True; RCC_Periph.APB1RSTR.UART7RST := False; elsif This.Periph.all'Address = UART8_Base then RCC_Periph.APB1RSTR.UART8RST := True; RCC_Periph.APB1RSTR.UART8RST := False; else raise Unknown_Device; end if; end Reset; ------------------ -- Enable_Clock -- ------------------ procedure Enable_Clock (This : aliased in out DMA_Controller) is begin if This'Address = STM32_SVD.DMA1_Base then RCC_Periph.AHB1ENR.DMA1EN := True; elsif This'Address = STM32_SVD.DMA2_Base then RCC_Periph.AHB1ENR.DMA2EN := True; else raise Unknown_Device; end if; end Enable_Clock; ----------- -- Reset -- ----------- procedure Reset (This : aliased in out DMA_Controller) is begin if This'Address = STM32_SVD.DMA1_Base then RCC_Periph.AHB1RSTR.DMA1RST := True; RCC_Periph.AHB1RSTR.DMA1RST := False; elsif This'Address = STM32_SVD.DMA2_Base then RCC_Periph.AHB1RSTR.DMA2RST := True; RCC_Periph.AHB1RSTR.DMA2RST := False; else raise Unknown_Device; end if; end Reset; ---------------- -- As_Port_Id -- ---------------- function As_Port_Id (Port : I2C_Port) return I2C_Port_Id is begin if Port.Periph.all'Address = I2C1_Base then return I2C_Id_1; elsif Port.Periph.all'Address = I2C2_Base then return I2C_Id_2; elsif Port.Periph.all'Address = I2C3_Base then return I2C_Id_3; else raise Unknown_Device; end if; end As_Port_Id; ------------------ -- Enable_Clock -- ------------------ procedure Enable_Clock (This : I2C_Port) is begin Enable_Clock (As_Port_Id (This)); end Enable_Clock; ------------------ -- Enable_Clock -- ------------------ procedure Enable_Clock (This : I2C_Port_Id) is begin case This is when I2C_Id_1 => RCC_Periph.APB1ENR.I2C1EN := True; when I2C_Id_2 => RCC_Periph.APB1ENR.I2C2EN := True; when I2C_Id_3 => RCC_Periph.APB1ENR.I2C3EN := True; end case; end Enable_Clock; ----------- -- Reset -- ----------- procedure Reset (This : I2C_Port) is begin Reset (As_Port_Id (This)); end Reset; ----------- -- Reset -- ----------- procedure Reset (This : I2C_Port_Id) is begin case This is when I2C_Id_1 => RCC_Periph.APB1RSTR.I2C1RST := True; RCC_Periph.APB1RSTR.I2C1RST := False; when I2C_Id_2 => RCC_Periph.APB1RSTR.I2C2RST := True; RCC_Periph.APB1RSTR.I2C2RST := False; when I2C_Id_3 => RCC_Periph.APB1RSTR.I2C3RST := True; RCC_Periph.APB1RSTR.I2C3RST := False; end case; end Reset; ------------------ -- Enable_Clock -- ------------------ procedure Enable_Clock (This : aliased in out SPI_Port) is begin if This'Address = SPI1_Base then RCC_Periph.APB2ENR.SPI1EN := True; elsif This'Address = SPI2_Base then RCC_Periph.APB1ENR.SPI2EN := True; elsif This'Address = SPI3_Base then RCC_Periph.APB1ENR.SPI3EN := True; elsif This'Address = SPI4_Base then RCC_Periph.APB2ENR.SPI4ENR := True; elsif This'Address = SPI5_Base then RCC_Periph.APB2ENR.SPI5ENR := True; elsif This'Address = SPI6_Base then RCC_Periph.APB2ENR.SPI6ENR := True; else raise Unknown_Device; end if; end Enable_Clock; ----------- -- Reset -- ----------- procedure Reset (This : in out SPI_Port) is begin if This.Periph.all'Address = SPI1_Base then RCC_Periph.APB2RSTR.SPI1RST := True; RCC_Periph.APB2RSTR.SPI1RST := False; elsif This.Periph.all'Address = SPI2_Base then RCC_Periph.APB1RSTR.SPI2RST := True; RCC_Periph.APB1RSTR.SPI2RST := False; elsif This.Periph.all'Address = SPI3_Base then RCC_Periph.APB1RSTR.SPI3RST := True; RCC_Periph.APB1RSTR.SPI3RST := False; elsif This.Periph.all'Address = SPI4_Base then RCC_Periph.APB2RSTR.SPI4RST := True; RCC_Periph.APB2RSTR.SPI4RST := False; elsif This.Periph.all'Address = SPI5_Base then RCC_Periph.APB2RSTR.SPI5RST := True; RCC_Periph.APB2RSTR.SPI5RST := False; elsif This.Periph.all'Address = SPI6_Base then RCC_Periph.APB2RSTR.SPI6RST := True; RCC_Periph.APB2RSTR.SPI6RST := False; else raise Unknown_Device; end if; end Reset; ------------------ -- Enable_Clock -- ------------------ procedure Enable_Clock (This : I2S_Port) is begin if This.Periph.all'Address = SPI1_Base then RCC_Periph.APB2ENR.SPI1EN := True; elsif This.Periph.all'Address = SPI2_Base then RCC_Periph.APB1ENR.SPI2EN := True; elsif This.Periph.all'Address = SPI3_Base then RCC_Periph.APB1ENR.SPI3EN := True; elsif This.Periph.all'Address = SPI4_Base then RCC_Periph.APB2ENR.SPI5ENR := True; elsif This.Periph.all'Address = SPI5_Base then RCC_Periph.APB2ENR.SPI5ENR := True; elsif This.Periph.all'Address = SPI6_Base then RCC_Periph.APB2ENR.SPI6ENR := True; else raise Unknown_Device; end if; end Enable_Clock; ----------- -- Reset -- ----------- procedure Reset (This : in out I2S_Port) is begin if This.Periph.all'Address = SPI1_Base then RCC_Periph.APB2RSTR.SPI1RST := True; RCC_Periph.APB2RSTR.SPI1RST := False; elsif This.Periph.all'Address = SPI2_Base then RCC_Periph.APB1RSTR.SPI2RST := True; RCC_Periph.APB1RSTR.SPI2RST := False; elsif This.Periph.all'Address = SPI3_Base then RCC_Periph.APB1RSTR.SPI3RST := True; RCC_Periph.APB1RSTR.SPI3RST := False; elsif This.Periph.all'Address = SPI4_Base then RCC_Periph.APB2RSTR.SPI4RST := True; RCC_Periph.APB2RSTR.SPI4RST := False; elsif This.Periph.all'Address = SPI5_Base then RCC_Periph.APB2RSTR.SPI5RST := True; RCC_Periph.APB2RSTR.SPI5RST := False; elsif This.Periph.all'Address = SPI6_Base then RCC_Periph.APB2RSTR.SPI6RST := True; RCC_Periph.APB2RSTR.SPI6RST := False; else raise Unknown_Device; end if; end Reset; ------------------ -- Enable_Clock -- ------------------ procedure Enable_Clock (This : in out Timer) is begin if This'Address = TIM1_Base then RCC_Periph.APB2ENR.TIM1EN := True; elsif This'Address = TIM2_Base then RCC_Periph.APB1ENR.TIM2EN := True; elsif This'Address = TIM3_Base then RCC_Periph.APB1ENR.TIM3EN := True; elsif This'Address = TIM4_Base then RCC_Periph.APB1ENR.TIM4EN := True; elsif This'Address = TIM5_Base then RCC_Periph.APB1ENR.TIM5EN := True; elsif This'Address = TIM6_Base then RCC_Periph.APB1ENR.TIM6EN := True; elsif This'Address = TIM7_Base then RCC_Periph.APB1ENR.TIM7EN := True; elsif This'Address = TIM8_Base then RCC_Periph.APB2ENR.TIM8EN := True; elsif This'Address = TIM9_Base then RCC_Periph.APB2ENR.TIM9EN := True; elsif This'Address = TIM10_Base then RCC_Periph.APB2ENR.TIM10EN := True; elsif This'Address = TIM11_Base then RCC_Periph.APB2ENR.TIM11EN := True; elsif This'Address = TIM12_Base then RCC_Periph.APB1ENR.TIM12EN := True; elsif This'Address = TIM13_Base then RCC_Periph.APB1ENR.TIM13EN := True; elsif This'Address = TIM14_Base then RCC_Periph.APB1ENR.TIM14EN := True; else raise Unknown_Device; end if; end Enable_Clock; ----------- -- Reset -- ----------- procedure Reset (This : in out Timer) is begin if This'Address = TIM1_Base then RCC_Periph.APB2RSTR.TIM1RST := True; RCC_Periph.APB2RSTR.TIM1RST := False; elsif This'Address = TIM2_Base then RCC_Periph.APB1RSTR.TIM2RST := True; RCC_Periph.APB1RSTR.TIM2RST := False; elsif This'Address = TIM3_Base then RCC_Periph.APB1RSTR.TIM3RST := True; RCC_Periph.APB1RSTR.TIM3RST := False; elsif This'Address = TIM4_Base then RCC_Periph.APB1RSTR.TIM4RST := True; RCC_Periph.APB1RSTR.TIM4RST := False; elsif This'Address = TIM5_Base then RCC_Periph.APB1RSTR.TIM5RST := True; RCC_Periph.APB1RSTR.TIM5RST := False; elsif This'Address = TIM6_Base then RCC_Periph.APB1RSTR.TIM6RST := True; RCC_Periph.APB1RSTR.TIM6RST := False; elsif This'Address = TIM7_Base then RCC_Periph.APB1RSTR.TIM7RST := True; RCC_Periph.APB1RSTR.TIM7RST := False; elsif This'Address = TIM8_Base then RCC_Periph.APB2RSTR.TIM8RST := True; RCC_Periph.APB2RSTR.TIM8RST := False; elsif This'Address = TIM9_Base then RCC_Periph.APB2RSTR.TIM9RST := True; RCC_Periph.APB2RSTR.TIM9RST := False; elsif This'Address = TIM10_Base then RCC_Periph.APB2RSTR.TIM10RST := True; RCC_Periph.APB2RSTR.TIM10RST := False; elsif This'Address = TIM11_Base then RCC_Periph.APB2RSTR.TIM11RST := True; RCC_Periph.APB2RSTR.TIM11RST := False; elsif This'Address = TIM12_Base then RCC_Periph.APB1RSTR.TIM12RST := True; RCC_Periph.APB1RSTR.TIM12RST := False; elsif This'Address = TIM13_Base then RCC_Periph.APB1RSTR.TIM13RST := True; RCC_Periph.APB1RSTR.TIM13RST := False; elsif This'Address = TIM14_Base then RCC_Periph.APB1RSTR.TIM14RST := True; RCC_Periph.APB1RSTR.TIM14RST := False; else raise Unknown_Device; end if; end Reset; ------------------ -- Enable_Clock -- ------------------ procedure Enable_Clock (This : in out SAI_Port) is begin pragma Assert (This'Address = SAI_Base); RCC_Periph.APB2ENR.SAI1EN := True; end Enable_Clock; ----------- -- Reset -- ----------- procedure Reset (This : in out SAI_Port) is begin pragma Assert (This'Address = SAI_Base); RCC_Periph.APB2RSTR.SAI1RST := True; RCC_Periph.APB2RSTR.SAI1RST := False; end Reset; --------------------- -- Get_Input_Clock -- --------------------- function Get_Input_Clock (Periph : SAI_Port) return UInt32 is Input_Selector : UInt2; VCO_Input : UInt32; SAI_First_Level : UInt32; begin if Periph'Address /= SAI_Base then raise Unknown_Device; end if; Input_Selector := RCC_Periph.DCKCFGR.SAI1ASRC; -- This driver doesn't support external source clock if Input_Selector > 1 then raise Constraint_Error with "External PLL SAI source clock unsupported"; end if; if not RCC_Periph.PLLCFGR.PLLSRC then -- PLLSAI SRC is HSI VCO_Input := HSI_VALUE / UInt32 (RCC_Periph.PLLCFGR.PLLM); else -- PLLSAI SRC is HSE VCO_Input := HSE_VALUE / UInt32 (RCC_Periph.PLLCFGR.PLLM); end if; if Input_Selector = 0 then -- PLLSAI is the clock source -- VCO out = VCO in & PLLSAIN -- SAI firstlevel = VCO out / PLLSAIQ SAI_First_Level := VCO_Input * UInt32 (RCC_Periph.PLLSAICFGR.PLLSAIN) / UInt32 (RCC_Periph.PLLSAICFGR.PLLSAIQ); -- SAI frequency is SAI First level / PLLSAIDIVQ return SAI_First_Level / UInt32 (RCC_Periph.DCKCFGR.PLLSAIDIVQ); else -- PLLI2S as clock source SAI_First_Level := VCO_Input * UInt32 (RCC_Periph.PLLI2SCFGR.PLLI2SN) / UInt32 (RCC_Periph.PLLI2SCFGR.PLLI2SQ); -- SAI frequency is SAI First level / PLLI2SDIVQ return SAI_First_Level / UInt32 (RCC_Periph.DCKCFGR.PLLIS2DIVQ + 1); end if; end Get_Input_Clock; ------------------ -- Enable_Clock -- ------------------ procedure Enable_Clock (This : in out SDMMC_Controller) is begin if This.Periph.all'Address /= SDIO_Base then raise Unknown_Device; end if; RCC_Periph.APB2ENR.SDIOEN := True; end Enable_Clock; ----------- -- Reset -- ----------- procedure Reset (This : in out SDMMC_Controller) is begin if This.Periph.all'Address /= SDIO_Base then raise Unknown_Device; end if; RCC_Periph.APB2RSTR.SDIORST := True; RCC_Periph.APB2RSTR.SDIORST := False; end Reset; ------------------------------ -- System_Clock_Frequencies -- ------------------------------ function System_Clock_Frequencies return RCC_System_Clocks is Source : constant UInt2 := RCC_Periph.CFGR.SWS; Result : RCC_System_Clocks; begin Result.I2SCLK := 0; case Source is when 0 => -- HSI as source Result.SYSCLK := HSI_VALUE; when 1 => -- HSE as source Result.SYSCLK := HSE_VALUE; when 2 => -- PLL as source declare HSE_Source : constant Boolean := RCC_Periph.PLLCFGR.PLLSRC; Pllm : constant UInt32 := UInt32 (RCC_Periph.PLLCFGR.PLLM); Plln : constant UInt32 := UInt32 (RCC_Periph.PLLCFGR.PLLN); Pllp : constant UInt32 := (UInt32 (RCC_Periph.PLLCFGR.PLLP) + 1) * 2; Pllvco : UInt32; begin if not HSE_Source then Pllvco := HSI_VALUE; else Pllvco := HSE_VALUE; end if; Pllvco := Pllvco / Pllm; Result.I2SCLK := Pllvco; Pllvco := Pllvco * Plln; Result.SYSCLK := Pllvco / Pllp; end; when others => Result.SYSCLK := HSI_VALUE; end case; declare HPRE : constant UInt4 := RCC_Periph.CFGR.HPRE; PPRE1 : constant UInt3 := RCC_Periph.CFGR.PPRE.Arr (1); PPRE2 : constant UInt3 := RCC_Periph.CFGR.PPRE.Arr (2); begin Result.HCLK := Result.SYSCLK / HPRE_Presc_Table (HPRE); Result.PCLK1 := Result.HCLK / PPRE_Presc_Table (PPRE1); Result.PCLK2 := Result.HCLK / PPRE_Presc_Table (PPRE2); -- Timer clocks -- See Dedicated clock cfg register documentation. if not RCC_Periph.DCKCFGR.TIMPRE then -- Mode 0: -- If the APB prescaler (PPRE1, PPRE2 in the RCC_CFGR register) -- is configured to a division factor of 1, TIMxCLK = PCLKx. -- Otherwise, the timer clock frequencies are set to twice to the -- frequency of the APB domain to which the timers are connected : -- TIMxCLK = 2xPCLKx. if PPRE_Presc_Table (PPRE1) = 1 then Result.TIMCLK1 := Result.PCLK1; else Result.TIMCLK1 := Result.PCLK1 * 2; end if; if PPRE_Presc_Table (PPRE2) = 1 then Result.TIMCLK2 := Result.PCLK2; else Result.TIMCLK2 := Result.PCLK2 * 2; end if; else -- Mpde 1: -- If the APB prescaler (PPRE1, PPRE2 in the RCC_CFGR register) is -- configured to a division factor of 1, 2 or 4, TIMxCLK = HCLK. -- Otherwise, the timer clock frequencies are set to four times -- to the frequency of the APB domain to which the timers are -- connected : TIMxCLK = 4xPCLKx. if PPRE_Presc_Table (PPRE1) in 1 .. 4 then Result.TIMCLK1 := Result.HCLK; else Result.TIMCLK1 := Result.PCLK1 * 4; end if; if PPRE_Presc_Table (PPRE2) in 1 .. 4 then Result.TIMCLK2 := Result.HCLK; else Result.TIMCLK2 := Result.PCLK1 * 4; end if; end if; end; -- I2S Clock -- if RCC_Periph.CFGR.I2SSRC then -- External clock source Result.I2SCLK := 0; raise Program_Error with "External I2S clock value is unknown"; else -- Pll clock source declare Plli2sn : constant UInt32 := UInt32 (RCC_Periph.PLLI2SCFGR.PLLI2SN); Plli2sr : constant UInt32 := UInt32 (RCC_Periph.PLLI2SCFGR.PLLI2SR); begin Result.I2SCLK := (Result.I2SCLK * Plli2sn) / Plli2sr; end; end if; return Result; end System_Clock_Frequencies; -------------------- -- PLLI2S_Enabled -- -------------------- function PLLI2S_Enabled return Boolean is (RCC_Periph.CR.PLLI2SRDY); ------------------------ -- Set_PLLI2S_Factors -- ------------------------ procedure Set_PLLI2S_Factors (Pll_N : UInt9; Pll_R : UInt3) is begin RCC_Periph.PLLI2SCFGR.PLLI2SN := Pll_N; RCC_Periph.PLLI2SCFGR.PLLI2SR := Pll_R; end Set_PLLI2S_Factors; ------------------- -- Enable_PLLI2S -- ------------------- procedure Enable_PLLI2S is begin RCC_Periph.CR.PLLI2SON := True; loop exit when PLLI2S_Enabled; end loop; end Enable_PLLI2S; -------------------- -- Disable_PLLI2S -- -------------------- procedure Disable_PLLI2S is begin RCC_Periph.CR.PLLI2SON := False; loop exit when not PLLI2S_Enabled; end loop; end Disable_PLLI2S; ------------------- -- Enable_PLLSAI -- ------------------- procedure Enable_PLLSAI is begin RCC_Periph.CR.PLLSAION := True; -- Wait for PLLSAI activation loop exit when RCC_Periph.CR.PLLSAIRDY; end loop; end Enable_PLLSAI; ------------------- -- Enable_PLLSAI -- ------------------- procedure Disable_PLLSAI is begin RCC_Periph.CR.PLLSAION := False; end Disable_PLLSAI; -------------------- -- PLLSAI_Enabled -- -------------------- function PLLSAI_Enabled return Boolean is begin return RCC_Periph.CR.PLLSAION and then RCC_Periph.CR.PLLSAIRDY; end PLLSAI_Enabled; ------------------------ -- Set_PLLSAI_Factors -- ------------------------ procedure Set_PLLSAI_Factors (LCD : UInt3; VCO : UInt9; DivR : PLLSAI_DivR) is PLLSAICFGR : PLLSAICFGR_Register; begin PLLSAICFGR.PLLSAIR := LCD; PLLSAICFGR.PLLSAIN := VCO; RCC_Periph.PLLSAICFGR := PLLSAICFGR; -- The exact bit name is device-specific RCC_Periph.DCKCFGR.PLLSAIDIVR := UInt2 (DivR); end Set_PLLSAI_Factors; ------------------------- -- Configure_SAI_Clock -- ------------------------- procedure Configure_SAI_I2S_Clock (Periph : SAI_Port; PLLI2SN : UInt9; PLLI2SQ : UInt4; PLLI2SDIVQ : DIVQ) is PLLI2SCFGR : PLLI2SCFGR_Register := RCC_Periph.PLLI2SCFGR; SAION : constant Boolean := PLLSAI_Enabled; begin if Periph'Address /= SAI_Base then raise Unknown_Device; end if; if SAION then Disable_PLLSAI; end if; if RCC_Periph.CR.PLLI2SON then RCC_Periph.CR.PLLI2SON := False; end if; -- We will configure the PLLSAI2 clock from a PLLI2S source. -- SAI2SEL (page 188 of the STM32F7xx Ref manual): -- 00: SAI clock = PLLSAI_Q / PLLSAIDIVQ -- 01: SAI clock = PLLI2S_Q / PLLI2SDIVQ -- 10: SAI clock = AF input frequency -- 11: invalid RCC_Periph.DCKCFGR.SAI1ASRC := 2#01#; PLLI2SCFGR.PLLI2SN := PLLI2SN; PLLI2SCFGR.PLLI2SQ := PLLI2SQ; RCC_Periph.PLLI2SCFGR := PLLI2SCFGR; RCC_Periph.DCKCFGR.PLLIS2DIVQ := UInt5 (PLLI2SDIVQ - 1); if SAION then Enable_PLLSAI; end if; RCC_Periph.CR.PLLI2SON := True; loop exit when RCC_Periph.CR.PLLI2SRDY; end loop; end Configure_SAI_I2S_Clock; ----------------------- -- Enable_DCMI_Clock -- ----------------------- procedure Enable_DCMI_Clock is begin RCC_Periph.AHB2ENR.DCMIEN := True; end Enable_DCMI_Clock; ---------------- -- Reset_DCMI -- ---------------- procedure Reset_DCMI is begin RCC_Periph.AHB2RSTR.DCMIRST := True; RCC_Periph.AHB2RSTR.DCMIRST := False; end Reset_DCMI; ------------------ -- Enable_Clock -- ------------------ procedure Enable_Clock (This : in out CRC_32) is pragma Unreferenced (This); begin RCC_Periph.AHB1ENR.CRCEN := True; end Enable_Clock; ------------------- -- Disable_Clock -- ------------------- procedure Disable_Clock (This : in out CRC_32) is pragma Unreferenced (This); begin RCC_Periph.AHB1ENR.CRCEN := False; end Disable_Clock; ----------- -- Reset -- ----------- procedure Reset (This : in out CRC_32) is pragma Unreferenced (This); begin RCC_Periph.AHB1RSTR.CRCRST := True; RCC_Periph.AHB1RSTR.CRCRST := False; end Reset; end STM32.Device;
31.36355
79
0.574858
04d1fac02dbbce29a76309492ccfbcf4bc3fe967
3,620
ads
Ada
source/amf/uml/amf-uml-data_store_nodes-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-data_store_nodes-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-data_store_nodes-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.Data_Store_Nodes.Hash is new AMF.Elements.Generic_Hash (UML_Data_Store_Node, UML_Data_Store_Node_Access);
72.4
82
0.403867
ade5cbc41536250d697d0bf3c5b123621de29248
76
ads
Ada
tracker-datasource.ads
mimo/Tracker
a913446c6d2f6679a2e557bd92194e255190e6a7
[ "MIT" ]
1
2020-09-30T01:30:48.000Z
2020-09-30T01:30:48.000Z
tracker-datasource.ads
mimo/Tracker
a913446c6d2f6679a2e557bd92194e255190e6a7
[ "MIT" ]
null
null
null
tracker-datasource.ads
mimo/Tracker
a913446c6d2f6679a2e557bd92194e255190e6a7
[ "MIT" ]
null
null
null
package tracker.datasource is procedure Load; end tracker.datasource;
10.857143
29
0.776316