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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d07d56e1f82d4692ea386408dadb4d6ea623e4b8 | 11,926 | ads | Ada | arch/ARM/STM32/svd/stm32f40x/stm32_svd-dcmi.ads | shakram02/Ada_Drivers_Library | a407ca7ddbc2d9756647016c2f8fd8ef24a239ff | [
"BSD-3-Clause"
] | 192 | 2016-06-01T18:32:04.000Z | 2022-03-26T22:52:31.000Z | arch/ARM/STM32/svd/stm32f40x/stm32_svd-dcmi.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 239 | 2016-05-26T20:02:01.000Z | 2022-03-31T09:46:56.000Z | arch/ARM/STM32/svd/stm32f40x/stm32_svd-dcmi.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 142 | 2016-06-05T08:12:20.000Z | 2022-03-24T17:37:17.000Z | -- This spec has been automatically generated from STM32F40x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.DCMI is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype CR_FCRC_Field is HAL.UInt2;
subtype CR_EDM_Field is HAL.UInt2;
-- control register 1
type CR_Register is record
-- Capture enable
CAPTURE : Boolean := False;
-- Capture mode
CM : Boolean := False;
-- Crop feature
CROP : Boolean := False;
-- JPEG format
JPEG : Boolean := False;
-- Embedded synchronization select
ESS : Boolean := False;
-- Pixel clock polarity
PCKPOL : Boolean := False;
-- Horizontal synchronization polarity
HSPOL : Boolean := False;
-- Vertical synchronization polarity
VSPOL : Boolean := False;
-- Frame capture rate control
FCRC : CR_FCRC_Field := 16#0#;
-- Extended data mode
EDM : CR_EDM_Field := 16#0#;
-- unspecified
Reserved_12_13 : HAL.UInt2 := 16#0#;
-- DCMI enable
ENABLE : Boolean := False;
-- unspecified
Reserved_15_31 : HAL.UInt17 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR_Register use record
CAPTURE at 0 range 0 .. 0;
CM at 0 range 1 .. 1;
CROP at 0 range 2 .. 2;
JPEG at 0 range 3 .. 3;
ESS at 0 range 4 .. 4;
PCKPOL at 0 range 5 .. 5;
HSPOL at 0 range 6 .. 6;
VSPOL at 0 range 7 .. 7;
FCRC at 0 range 8 .. 9;
EDM at 0 range 10 .. 11;
Reserved_12_13 at 0 range 12 .. 13;
ENABLE at 0 range 14 .. 14;
Reserved_15_31 at 0 range 15 .. 31;
end record;
-- status register
type SR_Register is record
-- Read-only. HSYNC
HSYNC : Boolean;
-- Read-only. VSYNC
VSYNC : Boolean;
-- Read-only. FIFO not empty
FNE : Boolean;
-- unspecified
Reserved_3_31 : HAL.UInt29;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SR_Register use record
HSYNC at 0 range 0 .. 0;
VSYNC at 0 range 1 .. 1;
FNE at 0 range 2 .. 2;
Reserved_3_31 at 0 range 3 .. 31;
end record;
-- raw interrupt status register
type RIS_Register is record
-- Read-only. Capture complete raw interrupt status
FRAME_RIS : Boolean;
-- Read-only. Overrun raw interrupt status
OVR_RIS : Boolean;
-- Read-only. Synchronization error raw interrupt status
ERR_RIS : Boolean;
-- Read-only. VSYNC raw interrupt status
VSYNC_RIS : Boolean;
-- Read-only. Line raw interrupt status
LINE_RIS : Boolean;
-- unspecified
Reserved_5_31 : HAL.UInt27;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RIS_Register use record
FRAME_RIS at 0 range 0 .. 0;
OVR_RIS at 0 range 1 .. 1;
ERR_RIS at 0 range 2 .. 2;
VSYNC_RIS at 0 range 3 .. 3;
LINE_RIS at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
-- interrupt enable register
type IER_Register is record
-- Capture complete interrupt enable
FRAME_IE : Boolean := False;
-- Overrun interrupt enable
OVR_IE : Boolean := False;
-- Synchronization error interrupt enable
ERR_IE : Boolean := False;
-- VSYNC interrupt enable
VSYNC_IE : Boolean := False;
-- Line interrupt enable
LINE_IE : Boolean := False;
-- unspecified
Reserved_5_31 : HAL.UInt27 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IER_Register use record
FRAME_IE at 0 range 0 .. 0;
OVR_IE at 0 range 1 .. 1;
ERR_IE at 0 range 2 .. 2;
VSYNC_IE at 0 range 3 .. 3;
LINE_IE at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
-- masked interrupt status register
type MIS_Register is record
-- Read-only. Capture complete masked interrupt status
FRAME_MIS : Boolean;
-- Read-only. Overrun masked interrupt status
OVR_MIS : Boolean;
-- Read-only. Synchronization error masked interrupt status
ERR_MIS : Boolean;
-- Read-only. VSYNC masked interrupt status
VSYNC_MIS : Boolean;
-- Read-only. Line masked interrupt status
LINE_MIS : Boolean;
-- unspecified
Reserved_5_31 : HAL.UInt27;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for MIS_Register use record
FRAME_MIS at 0 range 0 .. 0;
OVR_MIS at 0 range 1 .. 1;
ERR_MIS at 0 range 2 .. 2;
VSYNC_MIS at 0 range 3 .. 3;
LINE_MIS at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
-- interrupt clear register
type ICR_Register is record
-- Write-only. Capture complete interrupt status clear
FRAME_ISC : Boolean := False;
-- Write-only. Overrun interrupt status clear
OVR_ISC : Boolean := False;
-- Write-only. Synchronization error interrupt status clear
ERR_ISC : Boolean := False;
-- Write-only. Vertical synch interrupt status clear
VSYNC_ISC : Boolean := False;
-- Write-only. line interrupt status clear
LINE_ISC : Boolean := False;
-- unspecified
Reserved_5_31 : HAL.UInt27 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ICR_Register use record
FRAME_ISC at 0 range 0 .. 0;
OVR_ISC at 0 range 1 .. 1;
ERR_ISC at 0 range 2 .. 2;
VSYNC_ISC at 0 range 3 .. 3;
LINE_ISC at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
subtype ESCR_FSC_Field is HAL.UInt8;
subtype ESCR_LSC_Field is HAL.UInt8;
subtype ESCR_LEC_Field is HAL.UInt8;
subtype ESCR_FEC_Field is HAL.UInt8;
-- embedded synchronization code register
type ESCR_Register is record
-- Frame start delimiter code
FSC : ESCR_FSC_Field := 16#0#;
-- Line start delimiter code
LSC : ESCR_LSC_Field := 16#0#;
-- Line end delimiter code
LEC : ESCR_LEC_Field := 16#0#;
-- Frame end delimiter code
FEC : ESCR_FEC_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ESCR_Register use record
FSC at 0 range 0 .. 7;
LSC at 0 range 8 .. 15;
LEC at 0 range 16 .. 23;
FEC at 0 range 24 .. 31;
end record;
subtype ESUR_FSU_Field is HAL.UInt8;
subtype ESUR_LSU_Field is HAL.UInt8;
subtype ESUR_LEU_Field is HAL.UInt8;
subtype ESUR_FEU_Field is HAL.UInt8;
-- embedded synchronization unmask register
type ESUR_Register is record
-- Frame start delimiter unmask
FSU : ESUR_FSU_Field := 16#0#;
-- Line start delimiter unmask
LSU : ESUR_LSU_Field := 16#0#;
-- Line end delimiter unmask
LEU : ESUR_LEU_Field := 16#0#;
-- Frame end delimiter unmask
FEU : ESUR_FEU_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ESUR_Register use record
FSU at 0 range 0 .. 7;
LSU at 0 range 8 .. 15;
LEU at 0 range 16 .. 23;
FEU at 0 range 24 .. 31;
end record;
subtype CWSTRT_HOFFCNT_Field is HAL.UInt14;
subtype CWSTRT_VST_Field is HAL.UInt13;
-- crop window start
type CWSTRT_Register is record
-- Horizontal offset count
HOFFCNT : CWSTRT_HOFFCNT_Field := 16#0#;
-- unspecified
Reserved_14_15 : HAL.UInt2 := 16#0#;
-- Vertical start line count
VST : CWSTRT_VST_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CWSTRT_Register use record
HOFFCNT at 0 range 0 .. 13;
Reserved_14_15 at 0 range 14 .. 15;
VST at 0 range 16 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
subtype CWSIZE_CAPCNT_Field is HAL.UInt14;
subtype CWSIZE_VLINE_Field is HAL.UInt14;
-- crop window size
type CWSIZE_Register is record
-- Capture count
CAPCNT : CWSIZE_CAPCNT_Field := 16#0#;
-- unspecified
Reserved_14_15 : HAL.UInt2 := 16#0#;
-- Vertical line count
VLINE : CWSIZE_VLINE_Field := 16#0#;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CWSIZE_Register use record
CAPCNT at 0 range 0 .. 13;
Reserved_14_15 at 0 range 14 .. 15;
VLINE at 0 range 16 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
-- DR_Byte array element
subtype DR_Byte_Element is HAL.UInt8;
-- DR_Byte array
type DR_Byte_Field_Array is array (0 .. 3) of DR_Byte_Element
with Component_Size => 8, Size => 32;
-- data register
type DR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- Byte as a value
Val : HAL.UInt32;
when True =>
-- Byte as an array
Arr : DR_Byte_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for DR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Digital camera interface
type DCMI_Peripheral is record
-- control register 1
CR : aliased CR_Register;
-- status register
SR : aliased SR_Register;
-- raw interrupt status register
RIS : aliased RIS_Register;
-- interrupt enable register
IER : aliased IER_Register;
-- masked interrupt status register
MIS : aliased MIS_Register;
-- interrupt clear register
ICR : aliased ICR_Register;
-- embedded synchronization code register
ESCR : aliased ESCR_Register;
-- embedded synchronization unmask register
ESUR : aliased ESUR_Register;
-- crop window start
CWSTRT : aliased CWSTRT_Register;
-- crop window size
CWSIZE : aliased CWSIZE_Register;
-- data register
DR : aliased DR_Register;
end record
with Volatile;
for DCMI_Peripheral use record
CR at 16#0# range 0 .. 31;
SR at 16#4# range 0 .. 31;
RIS at 16#8# range 0 .. 31;
IER at 16#C# range 0 .. 31;
MIS at 16#10# range 0 .. 31;
ICR at 16#14# range 0 .. 31;
ESCR at 16#18# range 0 .. 31;
ESUR at 16#1C# range 0 .. 31;
CWSTRT at 16#20# range 0 .. 31;
CWSIZE at 16#24# range 0 .. 31;
DR at 16#28# range 0 .. 31;
end record;
-- Digital camera interface
DCMI_Periph : aliased DCMI_Peripheral
with Import, Address => System'To_Address (16#50050000#);
end STM32_SVD.DCMI;
| 31.802667 | 66 | 0.58209 |
d00adad04fcd9fe00f312bf0e2eaea690530cfb4 | 1,576 | ads | Ada | source/oasis/program-elements-formal_signed_integer_type_definitions.ads | optikos/oasis | 9f64d46d26d964790d69f9db681c874cfb3bf96d | [
"MIT"
] | null | null | null | source/oasis/program-elements-formal_signed_integer_type_definitions.ads | optikos/oasis | 9f64d46d26d964790d69f9db681c874cfb3bf96d | [
"MIT"
] | null | null | null | source/oasis/program-elements-formal_signed_integer_type_definitions.ads | optikos/oasis | 9f64d46d26d964790d69f9db681c874cfb3bf96d | [
"MIT"
] | 2 | 2019-09-14T23:18:50.000Z | 2019-10-02T10:11:40.000Z | -- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Elements.Formal_Type_Definitions;
with Program.Lexical_Elements;
package Program.Elements.Formal_Signed_Integer_Type_Definitions is
pragma Pure (Program.Elements.Formal_Signed_Integer_Type_Definitions);
type Formal_Signed_Integer_Type_Definition is
limited interface
and Program.Elements.Formal_Type_Definitions.Formal_Type_Definition;
type Formal_Signed_Integer_Type_Definition_Access is
access all Formal_Signed_Integer_Type_Definition'Class
with Storage_Size => 0;
type Formal_Signed_Integer_Type_Definition_Text is limited interface;
type Formal_Signed_Integer_Type_Definition_Text_Access is
access all Formal_Signed_Integer_Type_Definition_Text'Class
with Storage_Size => 0;
not overriding function To_Formal_Signed_Integer_Type_Definition_Text
(Self : aliased in out Formal_Signed_Integer_Type_Definition)
return Formal_Signed_Integer_Type_Definition_Text_Access is abstract;
not overriding function Range_Token
(Self : Formal_Signed_Integer_Type_Definition_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Box_Token
(Self : Formal_Signed_Integer_Type_Definition_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
end Program.Elements.Formal_Signed_Integer_Type_Definitions;
| 36.651163 | 75 | 0.788706 |
d06f209aec8b13f29b1f910b3e6203158e2bed2f | 4,377 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c43205e.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/c43205e.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c43205e.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- C43205E.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 THE BOUNDS OF A POSITIONAL AGGREGATE ARE DETERMINED
-- CORRECTLY. IN PARTICULAR, CHECK THAT THE LOWER BOUND IS GIVEN BY
-- 'FIRST OF THE INDEX SUBTYPE WHEN THE POSITIONAL AGGREGATE IS USED AS:
-- E) THE LEFT OR RIGHT OPERAND OF "&".
-- EG 01/26/84
WITH REPORT;
PROCEDURE C43205E IS
USE REPORT;
BEGIN
TEST("C43205E", "CASE E : OPERAND OF &");
BEGIN
CASE_E : DECLARE
SUBTYPE STE IS INTEGER RANGE 2 .. 10;
TYPE COLOR IS (RED, GREEN, BLUE);
TYPE TE IS ARRAY (STE RANGE <>) OF COLOR;
FUNCTION CONCAT1 RETURN TE IS
BEGIN
RETURN (RED, GREEN, BLUE) & (7 .. 8 => RED);
END;
FUNCTION CONCAT2 RETURN TE IS
BEGIN
RETURN (IDENT_INT(4) .. 3 => RED) & (GREEN, BLUE);
END;
FUNCTION CONCAT3 RETURN STRING IS
BEGIN
RETURN "TEST" & (7 .. 8 => 'X');
END;
FUNCTION CONCAT4 RETURN STRING IS
BEGIN
RETURN (8 .. 5 => 'A') & "BC";
END;
BEGIN
IF CONCAT1'FIRST /= IDENT_INT(2) THEN
FAILED ("CASE E1 : LOWER BOUND INCORRECTLY " &
"GIVEN BY 'FIRST");
ELSIF CONCAT1'LAST /= 6 THEN
FAILED ("CASE E1 : UPPER BOUND INCORRECTLY " &
"GIVEN BY 'LAST");
ELSIF CONCAT1 /= (RED, GREEN, BLUE, RED, RED) THEN
FAILED ("CASE E1 : INCORRECT VALUES PRODUCED");
END IF;
IF CONCAT2'FIRST /= IDENT_INT(2) THEN
FAILED ("CASE E2 : LOWER BOUND INCORRECTLY " &
"GIVEN BY 'FIRST");
ELSIF CONCAT2'LAST /= 3 THEN
FAILED ("CASE E2 : UPPER BOUND INCORRECTLY " &
"GIVEN BY 'LAST");
ELSIF CONCAT2 /= (GREEN, BLUE) THEN
FAILED ("CASE E2 : INCORRECT VALUES PRODUCED");
END IF;
IF CONCAT3'FIRST /= IDENT_INT(1) THEN
FAILED ("CASE E3 : LOWER BOUND INCORRECTLY " &
"GIVEN BY 'FIRST");
ELSIF CONCAT3'LAST /= 6 THEN
FAILED ("CASE E3 : UPPER BOUND INCORRECTLY " &
"GIVEN BY 'LAST");
ELSIF CONCAT3 /= "TESTXX" THEN
FAILED ("CASE E3 : INCORRECT VALUES PRODUCED");
END IF;
IF CONCAT4'FIRST /= IDENT_INT(1) THEN
FAILED ("CASE E4 : LOWER BOUND INCORRECTLY " &
"GIVEN BY 'FIRST");
ELSIF CONCAT4'LAST /= 2 THEN
FAILED ("CASE E4 : UPPER BOUND INCORRECTLY " &
"GIVEN BY 'LAST");
ELSIF CONCAT4 /= "BC" THEN
FAILED ("CASE E4 : INCORRECT VALUES PRODUCED");
END IF;
END CASE_E;
END;
RESULT;
END C43205E;
| 37.09322 | 79 | 0.518392 |
dccd8ef343309b679d266e7935968d1ddae46454 | 4,574 | ads | Ada | gcc-gcc-7_3_0-release/gcc/ada/comperr.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/comperr.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/ada/comperr.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- C O M P E R R --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains the routine called when a fatal internal compiler
-- error is detected. Calls to this routines cause termination of the
-- current compilation with appropriate error output.
package Comperr is
procedure Compiler_Abort
(X : String;
Fallback_Loc : String := "";
From_GCC : Boolean := False);
pragma No_Return (Compiler_Abort);
-- Signals an internal compiler error. Never returns control. Depending on
-- processing may end up raising Unrecoverable_Error, or exiting directly.
-- The message output is a "bug box" containing the first string passed as
-- an argument. The Sloc field of the node in Current_Error_Node is used to
-- provide the location where the error should be signalled. If this Sloc
-- value is set to No_Location or any of the other special location values,
-- then the Fallback_Loc argument string is used instead. The message text
-- includes the node id, and the code parameter if it is positive.
--
-- Note that this is only used at the outer level (to handle constraint
-- errors or assert errors etc.) In the normal logic of the compiler we
-- always use pragma Assert to check for errors, and if necessary an
-- explicit abort is achieved by pragma Assert (False). From_GCC is true
-- for a GCC abort and false for a front end exception (with a possible
-- message stored in TSD.Current_Excep).
procedure Delete_SCIL_Files;
-- Delete SCIL files associated with the main unit
------------------------------
-- Use of gnat_bug.box File --
------------------------------
-- When comperr generates the "bug box". The first two lines contain
-- information on the version number, type of abort, and source location.
-- Normally the remaining text is one of three possible forms
-- depending on Gnatvsn.Gnat_Version_Type (FSF, Public, GNATPRO).
-- See body of this package for the exact text used.
-- In addition, an alternative mechanism exists for easily substituting
-- different text for this message. Compiler_Abort checks for the
-- existence of the file "gnat_bug.box" in the current source path.
-- Most typically this file, if present, will be in the directory
-- containing the run-time sources.
-- If this file is present, then it is a plain ASCII file, whose contents
-- replace the remaining text. The lines in this file should be seventy-two
-- characters or less to avoid misformatting the right boundary of the box.
-- Note that the file does not contain the vertical bar characters or any
-- leading spaces in lines.
end Comperr;
| 57.175 | 79 | 0.561434 |
d076aae806dc90cfe8c7a32307818b654f2189d3 | 1,664 | adb | Ada | gnu/src/gdb/gdb/testsuite/gdb.ada/unc_arr_ptr_in_var_rec/foo.adb | ghsecuritylab/ellcc-mirror | b03a4afac74d50cf0987554b8c0cd8209bcb92a2 | [
"BSD-2-Clause"
] | null | null | null | gnu/src/gdb/gdb/testsuite/gdb.ada/unc_arr_ptr_in_var_rec/foo.adb | ghsecuritylab/ellcc-mirror | b03a4afac74d50cf0987554b8c0cd8209bcb92a2 | [
"BSD-2-Clause"
] | null | null | null | gnu/src/gdb/gdb/testsuite/gdb.ada/unc_arr_ptr_in_var_rec/foo.adb | ghsecuritylab/ellcc-mirror | b03a4afac74d50cf0987554b8c0cd8209bcb92a2 | [
"BSD-2-Clause"
] | null | null | null | -- Copyright 2012-2015 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
procedure Foo is
type Table is array (Positive range <>) of Integer;
type Table_Access is access Table;
type Object (N : Integer) is record
Ptr : Table_Access;
Data : Table (1 .. N);
end record;
My_Object : Object := (N => 3, Ptr => null, Data => (3, 5, 8));
-- Same as above, but with a pointer to an unconstrained packed array.
type Byte is range 0 .. 255;
type P_Table is array (Positive range <>) of Byte;
pragma Pack (P_Table);
type P_Table_Access is access P_Table;
type P_Object (N : Integer) is record
Ptr : P_Table_Access;
Data : P_Table (1 .. N);
end record;
My_P_Object : P_Object := (N => 3, Ptr => null, Data => (3, 5, 8));
begin
My_Object.Ptr := new Table'(13, 21, 34); -- STOP1
My_P_Object.Ptr := new P_Table'(13, 21, 34);
Do_Nothing (My_Object'Address); -- STOP2
Do_Nothing (My_P_Object'Address);
end Foo;
| 32 | 74 | 0.665264 |
d050ee0e90bdf537bc8d23b2565e855085a13361 | 3,518 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/a/ae3101a.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/a/ae3101a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/a/ae3101a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- AE3101A.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 CREATE, OPEN, CLOSE, DELETE, RESET, MODE, NAME,
-- FORM, IS_OPEN, AND END_OF_FILE ARE AVAILABLE FOR TEXT FILES.
-- ALSO CHECK THAT FORMAL PARAMETER NAMES ARE CORRECT.
-- HISTORY:
-- ABW 08/24/82
-- SPS 09/16/82
-- SPS 11/09/82
-- DWC 09/24/87 REMOVED DEPENDENCE ON FILE SUPPORT.
WITH REPORT;
USE REPORT;
WITH TEXT_IO;
USE TEXT_IO;
PROCEDURE AE3101A IS
FILE1 : FILE_TYPE;
BEGIN
TEST ("AE3101A" , "CHECK THAT CREATE, OPEN, DELETE, " &
"RESET, MODE, NAME, FORM, IS_OPEN, " &
"AND END_OF_FILE ARE AVAILABLE " &
"FOR TEXT FILE");
BEGIN
CREATE (FILE => FILE1,
MODE => OUT_FILE,
NAME => LEGAL_FILE_NAME,
FORM => "");
EXCEPTION
WHEN OTHERS =>
NULL;
END;
BEGIN
RESET (FILE => FILE1, MODE => IN_FILE);
EXCEPTION
WHEN OTHERS =>
NULL;
END;
BEGIN
CLOSE (FILE => FILE1);
EXCEPTION
WHEN OTHERS =>
NULL;
END;
BEGIN
OPEN (FILE => FILE1,
MODE => IN_FILE,
NAME => LEGAL_FILE_NAME,
FORM => "");
EXCEPTION
WHEN OTHERS =>
NULL;
END;
IF IS_OPEN (FILE => FILE1) THEN
NULL;
END IF;
BEGIN
IF MODE (FILE => FILE1) /= IN_FILE THEN
NULL;
END IF;
EXCEPTION
WHEN OTHERS =>
NULL;
END;
BEGIN
IF NAME (FILE => FILE1) /= LEGAL_FILE_NAME THEN
NULL;
END IF;
EXCEPTION
WHEN OTHERS =>
NULL;
END;
BEGIN
IF FORM (FILE => FILE1) /= "" THEN
NULL;
END IF;
EXCEPTION
WHEN OTHERS =>
NULL;
END;
BEGIN
IF END_OF_FILE (FILE => FILE1) THEN
NULL;
END IF;
EXCEPTION
WHEN OTHERS =>
NULL;
END;
BEGIN
DELETE (FILE => FILE1);
EXCEPTION
WHEN OTHERS =>
NULL;
END;
RESULT;
END AE3101A;
| 25.867647 | 79 | 0.529278 |
184369c9199c7e6d5048a2643630bf45208d9511 | 18,751 | adb | Ada | modular_hashing-sha1.adb | annexi-strayline/ASAP-Modular_Hashing | a4684ca2030c2e8e33ae53a1fb08afc960d44fc2 | [
"BSD-3-Clause"
] | null | null | null | modular_hashing-sha1.adb | annexi-strayline/ASAP-Modular_Hashing | a4684ca2030c2e8e33ae53a1fb08afc960d44fc2 | [
"BSD-3-Clause"
] | null | null | null | modular_hashing-sha1.adb | annexi-strayline/ASAP-Modular_Hashing | a4684ca2030c2e8e33ae53a1fb08afc960d44fc2 | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- Modular Hash Infrastructure --
-- --
-- SHA1 --
-- --
-- - "Reference" Implementation - --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2018-2021, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * Ensi Martini (ANNEXI-STRAYLINE) --
-- --
-- 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 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 --
-- 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. --
-- --
------------------------------------------------------------------------------
package body Modular_Hashing.SHA1 is
pragma Assert (Stream_Element'Size = 8);
-- This implementation makes the assumption that a Stream_Element is 8 bits
-- wide. This is a safe assumption in most common applications. Making this
-- assumption greatly simplifies this reference implementation.
--
-- Internal Subprograms
--
------------------
-- Digest_Chunk --
------------------
-- This procedure is the internal digest that allows for a 512-bit block to
-- be processed without finishing the hash (padding)
--
-- This is the bulk of the SHA1 algorithm, missing only the addition of
-- message size with padding, which is handed by the Digest subprogram
procedure Digest_Chunk (Engine : in out SHA1_Engine) with Inline is
A, B, C, D, E, F, K, Temp : Unsigned_32;
Word_Sequence : array (1 .. 80) of Unsigned_32;
begin
-- Break the chunk into 16 32-bit words, assign to Word_Sequence
for I in 1 .. 16 loop
Word_Sequence(I) :=
Shift_Left(Value => Unsigned_32
(Engine.Buffer(Stream_Element_Offset((I * 4) - 3))),
Amount => 24)
+ Shift_Left(Value => Unsigned_32
(Engine.Buffer(Stream_Element_Offset((I * 4) - 2))),
Amount => 16)
+ Shift_Left(Value => Unsigned_32
(Engine.Buffer(Stream_Element_Offset((I * 4) - 1))),
Amount => 8)
+ Unsigned_32(Engine.Buffer(Stream_Element_Offset(I * 4)));
end loop;
-- Create the values for the rest of Word_Sequence
for I in 17 .. 80 loop
Word_Sequence(I) :=
Rotate_Left (Value =>
Word_Sequence(I - 3)
xor Word_Sequence(I - 8)
xor Word_Sequence(I - 14)
xor Word_Sequence(I - 16),
Amount => 1);
end loop;
A := Engine.H0;
B := Engine.H1;
C := Engine.H2;
D := Engine.H3;
E := Engine.H4;
declare
procedure Operations(Index : Integer) with Inline is
begin
Temp := Rotate_Left (Value => A, Amount => 5)
+ F + E + K + Word_Sequence(Index);
E := D;
D := C;
C := Rotate_Left (Value => B, Amount => 30);
B := A;
A := Temp;
end;
begin
-- The following loops are split-up to avoid persistent if-else
-- statements that is common in many reference implementations.
-- Inlining the operations takes up more code-space, but that is rarely
-- a concern in modern times...
for I in 1 .. 20 loop
F := (B and C) or ((not B) and D);
K := 16#5A827999#;
Operations (I);
end loop;
for I in 21 .. 40 loop
F := B xor C xor D;
K := 16#6ED9EBA1#;
Operations (I);
end loop;
for I in 41 .. 60 loop
F := (B and C) or (B and D) or (C and D);
K := 16#8F1BBCDC#;
Operations (I);
end loop;
for I in 61 .. 80 loop
F := B xor C xor D;
K := 16#CA62C1D6#;
Operations (I);
end loop;
end;
Engine.H0 := Engine.H0 + A;
Engine.H1 := Engine.H1 + B;
Engine.H2 := Engine.H2 + C;
Engine.H3 := Engine.H3 + D;
Engine.H4 := Engine.H4 + E;
Engine.Last_Element_Index := 0;
end Digest_Chunk;
--
-- SHA1_Hash
--
---------
-- "<" --
---------
function "<" (Left, Right: SHA1_Hash) return Boolean is
begin
-- Even though our numbers are split into arrays of Unsigned_32,
-- comparison operators can work on each section individually,
-- as the lower indices have more significance
for I in Message_Digest'Range loop
if Left.Digest(I) < Right.Digest(I) then
return True;
elsif Left.Digest(I) > Right.Digest(I) then
return False;
end if;
end loop;
-- The only way we get here is when Left = Right
return False;
end "<";
---------
-- ">" --
---------
function ">" (Left, Right: SHA1_Hash) return Boolean is
begin
-- Even though our numbers are split into arrays of Unsigned_32,
-- comparison operators can work on each section individually,
-- as the lower indices have more significance
for I in Message_Digest'Range loop
if Left.Digest(I) > Right.Digest(I) then
return True;
elsif Left.Digest(I) < Right.Digest(I) then
return False;
end if;
end loop;
-- The only way we get here is when Left = Right
return False;
end ">";
---------
-- "=" --
---------
function "=" (Left, Right: SHA1_Hash) return Boolean is
begin
for I in Message_Digest'Range loop
if Left.Digest(I) /= Right.Digest(I) then
return False;
end if;
end loop;
return True;
end "=";
------------
-- Binary --
------------
function Binary (Value: SHA1_Hash) return Hash_Binary_Value is
I: Positive;
Register: Unsigned_32;
begin
return Output: Hash_Binary_Value (1 .. SHA1_Hash_Bytes) do
I := Output'First;
for Chunk of reverse Value.Digest loop -- Value.Digest big-endian
Register := Chunk;
for J in 1 .. 4 loop -- Four bytes per digest chunk
Output(I) := Unsigned_8 (Register and 16#FF#);
Register := Shift_Right (Register, 8);
I := I + 1;
end loop;
end loop;
end return;
end Binary;
--
-- SHA1_Engine
--
-----------
-- Write --
-----------
overriding procedure Write (Stream : in out SHA1_Engine;
Item : in Stream_Element_Array)
is
Last_In: Stream_Element_Offset;
begin
-- Check for a null range of Item and discard
if Item'Length = 0 then
return;
end if;
Last_In := Item'First - 1;
-- Finally, we can go ahead and add the message length to the Engine now,
-- since there are early-ending code-paths below, and so we can avoid
-- duplicating code. The only way this can really go wrong is if the
-- entire message is larger than the Message_Size, which SHA1 limits to a
-- 64-bit signed integer. Therefore a message of 16 exabytes will cause
-- an invalid hash, due to a wrap-around of the Message_Size.
-- That's a risk we are willing to take.
Stream.Message_Length
:= Stream.Message_Length + (Stream_Element'Size * Item'Length);
-- Our buffer has a size of 512 (the size of a "chunk" of processing for
-- the SHA-1 algorithm).
-- Our write should be automated so that as soon as that buffer is full
-- (no matter how much of the Item array is written already), the chunk is
-- processed
-- In order to take advantage of any processor vector copy features, we
-- will explicitly copy Item in chunks that are either the full size of
-- Item, 64 elements, or the remaining space in the hash Buffer, whichever
-- is largest
while Last_In < Item'Last loop
declare
subtype Buffer_Slice is Stream_Element_Offset range
Stream.Last_Element_Index + 1 .. Stream.Buffer'Last;
Buffer_Slice_Length: Stream_Element_Offset
:= Buffer_Slice'Last - Buffer_Slice'First + 1;
subtype Item_Slice is Stream_Element_Offset range
Last_In + 1 .. Item'Last;
Item_Slice_Length: Stream_Element_Offset
:= Item_Slice'Last - Item_Slice'First + 1;
begin
if Buffer_Slice_Length > Item_Slice_Length then
-- We can fit the rest in the buffer, with space left-over
declare
-- Set-up a specific slice in the Buffer which can accommodate
-- the remaining elements of Item
subtype Target_Slice is Stream_Element_Offset range
Buffer_Slice'First .. Buffer_Slice'First +
(Item_Slice'Last - Item_Slice'First);
begin
-- Here is the block copy
Stream.Buffer(Target_Slice'Range):= Item (Item_Slice'Range);
Stream.Last_Element_Index := Target_Slice'Last;
end;
-- That's it, we've absorbed the entire Item, no need to waste
-- time updating Last_In.
return;
else
-- This means the buffer space is either equal to or smaller than
-- the remaining Item elements, this means we need process the
-- chunk (digest the buffer) no matter what
-- First step is to copy in as much of the remaining Item
-- elements as possible
declare
subtype Source_Slice is Stream_Element_Offset range
Item_Slice'First
.. Item_Slice'First + Buffer_Slice_Length - 1;
begin
-- Block copy
Stream.Buffer(Buffer_Slice'Range)
:= Item (Source_Slice'Range);
Stream.Last_Element_Index := Buffer_Slice'Last;
Last_In := Source_Slice'Last;
end;
-- Now we digest the currently full buffer
Digest_Chunk (Stream);
end if;
end;
end loop;
end Write;
-----------
-- Reset --
-----------
overriding procedure Reset (Engine : in out SHA1_Engine) is
begin
Engine.Last_Element_Index := 0;
Engine.Message_Length := 0;
Engine.H0 := H0_Initial;
Engine.H1 := H1_Initial;
Engine.H2 := H2_Initial;
Engine.H3 := H3_Initial;
Engine.H4 := H4_Initial;
end Reset;
------------
-- Digest --
------------
overriding function Digest (Engine : in out SHA1_Engine)
return Hash'Class is
-- The core of the message digest algorithm occurs in-line with stream
-- writes through the Digest_Chunk procedure. The role of this function
-- is to append the message size and padding, and then execute the final
-- Digest_Chunk before returning the digest.
-- We work with the data in the Buffer in chunks of 512 bits
-- Once we get to the last section that is < 512 bits, we append
-- the 64 bit length and padding 0's
-- In most cases, this 64 bit + padding will all be in the last section
-- of the buffer
-- We pad up until the 448th bit (56th byte) and then add the length
-- However, we must also keep in mind the fringe case where the data ends
-- at bit position 448 or later (byte 56 or later)
-- In that case, the approach to take is to pad the final chunk, then add
-- a new one that is ONLY padding and the 64 bit length
Message_Length_Spliced : Stream_Element_Array(1 .. 8);
Special_Case_Index : Stream_Element_Offset := 0;
begin
-- Splitting the 64-bit message length into array of bytes
for I in 1 .. 8 loop
Message_Length_Spliced(Stream_Element_Offset(I)) :=
Stream_Element
(Unsigned_8(Shift_Right(Value => Engine.Message_Length,
Amount => 8 * (8 - I)) and 16#ff#));
end loop;
-- This is a while loop but we use an exit condition to make sure that it
-- executes at least once (for the case of empty hash message)
loop
if Special_Case_Index /= 0 then
if Special_Case_Index = 1 then
Engine.Buffer(1) := 2#10000000#;
else
Engine.Buffer(1) := 2#00000000#;
end if;
Engine.Buffer(2 .. 56) := (others => 2#00000000#);
Engine.Buffer(57 .. 64) := Message_Length_Spliced;
Special_Case_Index := 0;
-- If there is less than 512 bits left in the Buffer
else
-- The case where one chunk will hold Buffer + padding + 64 bits
if Engine.Last_Element_Index < 56 then
-- Add the correct amount of padding
Engine.Buffer(Engine.Last_Element_Index + 1) := 2#10000000#;
Engine.Buffer(Engine.Last_Element_Index + 2 .. 56) :=
(others => 2#00000000#);
-- Finish it off with Message_Length
Engine.Buffer(57 .. 64) := Message_Length_Spliced;
-- The case where one chunk will hold Buffer + padding, and
-- another will hold padding + 64 bit message length
else
-- Put what we can of the padding in the current chunk
Engine.Buffer(Engine.Last_Element_Index + 1) := 2#10000000#;
Engine.Buffer(Engine.Last_Element_Index + 2 .. 64) :=
(others => 2#00000000#);
-- Save where we left off in the padding for the next chunk
Special_Case_Index := 65 - Engine.Last_Element_Index;
end if;
end if;
Digest_Chunk (Engine);
exit when Engine.Last_Element_Index = 0 and Special_Case_Index = 0;
end loop;
return Result: SHA1_Hash do
Result.Digest := (1 => Engine.H0,
2 => Engine.H1,
3 => Engine.H2,
4 => Engine.H3,
5 => Engine.H4);
Engine.Reset;
end return;
end Digest;
end Modular_Hashing.SHA1;
| 35.990403 | 80 | 0.477948 |
4adff6d2d07165c4da9d5458ce75d2034cf24819 | 4,552 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cc/cc3125a.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/cc3125a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cc/cc3125a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- CC3125A.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 IF THE INITIAL VALUE OF A
-- GENERIC IN PARAMETER DOES NOT SATISFY ITS SUBTYPE CONSTRAINT.
-- THIS TEST CHECKS PARAMETERS OF A NON-GENERIC TYPE.
-- DAT 8/10/81
-- SPS 4/14/82
WITH REPORT; USE REPORT;
PROCEDURE CC3125A IS
BEGIN
TEST ("CC3125A","GENERIC PARAMETER DEFAULTS OF " &
"NON-GENERIC TYPE EVALUATED AND CHECKED WHEN " &
"DECLARATION IS INSTANTIATED AND DEFAULT USED");
FOR I IN 1 .. 3 LOOP
COMMENT ("LOOP ITERATION");
BEGIN
DECLARE
SUBTYPE T IS INTEGER RANGE 1 .. IDENT_INT(1);
SUBTYPE I_1_2 IS INTEGER RANGE
IDENT_INT (1) .. IDENT_INT (2);
GENERIC
P,Q : T := I_1_2'(I);
PACKAGE PKG IS
R: T := P;
END PKG;
BEGIN
BEGIN
DECLARE
PACKAGE P1 IS NEW PKG;
BEGIN
IF I = IDENT_INT(1) THEN
IF P1.R /= IDENT_INT(1)
THEN FAILED ("BAD INITIAL"&
" VALUE");
END IF;
ELSIF I = 2 THEN
FAILED ("SUBTYPE NOT CHECKED AT " &
"INSTANTIATION");
ELSE
FAILED ("DEFAULT NOT EVALUATED AT " &
"INSTANTIATION");
END IF;
EXCEPTION
WHEN OTHERS => FAILED ("WRONG HANDLER");
END;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
CASE I IS
WHEN 1 =>
FAILED ("INCORRECT EXCEPTION");
WHEN 2 =>
COMMENT ("CONSTRAINT CHECKED" &
" ON INSTANTIATION");
WHEN 3 =>
COMMENT ("DEFAULT EVALUATED " &
"ON INSTANTIATION");
END CASE;
END;
EXCEPTION
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION");
END;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
CASE I IS
WHEN 1 =>
FAILED ("NO EXCEPTION SHOULD BE RAISED");
WHEN 2 =>
FAILED ("DEFAULT CHECKED AGAINST " &
"SUBTYPE AT DECLARATION");
WHEN 3 =>
FAILED ("DEFAULT EVALUATED AT " &
"DECLARATION");
END CASE;
END;
END LOOP;
RESULT;
END CC3125A;
| 40.642857 | 79 | 0.432777 |
4a46590b180423ba1408ad41d7b012b4b492fb41 | 894 | ads | Ada | src/arch/socs/stm32f429/soc-layout-stm32f4.ads | PThierry/ewok-kernel | e9c23cb3fd0afd8378bc27418778e1117d5e16cc | [
"Apache-2.0"
] | 65 | 2018-09-26T09:10:11.000Z | 2022-01-30T21:17:37.000Z | src/arch/socs/stm32f429/soc-layout-stm32f4.ads | PThierry/ewok-kernel | e9c23cb3fd0afd8378bc27418778e1117d5e16cc | [
"Apache-2.0"
] | 22 | 2019-04-07T15:15:54.000Z | 2020-10-15T12:45:54.000Z | src/arch/socs/stm32f429/soc-layout-stm32f4.ads | PThierry/ewok-kernel | e9c23cb3fd0afd8378bc27418778e1117d5e16cc | [
"Apache-2.0"
] | 10 | 2018-09-27T09:43:08.000Z | 2021-01-29T22:50:17.000Z | --
-- Copyright 2018 The wookey project team <wookey@ssi.gouv.fr>
-- - 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.
--
--
package soc.layout.stm32f4
with spark_mode => on
is
NB_MEM_BANK : constant := 1;
end soc.layout.stm32f4;
| 28.83871 | 79 | 0.692394 |
cb39b720164c5a16a577b9178d36a44fc6131d77 | 18,162 | ads | Ada | arch/ARM/STM32/svd/stm32l151/stm32_svd-sdio.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 2 | 2018-05-16T03:56:39.000Z | 2019-07-31T13:53:56.000Z | arch/ARM/STM32/svd/stm32l151/stm32_svd-sdio.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | arch/ARM/STM32/svd/stm32l151/stm32_svd-sdio.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | -- This spec has been automatically generated from STM32L151.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.SDIO is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype POWER_PWRCTRL_Field is HAL.UInt2;
-- power control register
type POWER_Register is record
-- Power supply control bits.
PWRCTRL : POWER_PWRCTRL_Field := 16#0#;
-- unspecified
Reserved_2_31 : HAL.UInt30 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for POWER_Register use record
PWRCTRL at 0 range 0 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
subtype CLKCR_CLKDIV_Field is HAL.UInt8;
subtype CLKCR_WIDBUS_Field is HAL.UInt2;
-- SDI clock control register
type CLKCR_Register is record
-- Clock divide factor
CLKDIV : CLKCR_CLKDIV_Field := 16#0#;
-- Clock enable bit
CLKEN : Boolean := False;
-- Power saving configuration bit
PWRSAV : Boolean := False;
-- Clock divider bypass enable bit
BYPASS : Boolean := False;
-- Wide bus mode enable bit
WIDBUS : CLKCR_WIDBUS_Field := 16#0#;
-- SDIO_CK dephasing selection bit
NEGEDGE : Boolean := False;
-- HW Flow Control enable
HWFC_EN : Boolean := False;
-- unspecified
Reserved_15_31 : HAL.UInt17 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CLKCR_Register use record
CLKDIV at 0 range 0 .. 7;
CLKEN at 0 range 8 .. 8;
PWRSAV at 0 range 9 .. 9;
BYPASS at 0 range 10 .. 10;
WIDBUS at 0 range 11 .. 12;
NEGEDGE at 0 range 13 .. 13;
HWFC_EN at 0 range 14 .. 14;
Reserved_15_31 at 0 range 15 .. 31;
end record;
subtype CMD_CMDINDEX_Field is HAL.UInt6;
subtype CMD_WAITRESP_Field is HAL.UInt2;
-- command register
type CMD_Register is record
-- Command index
CMDINDEX : CMD_CMDINDEX_Field := 16#0#;
-- Wait for response bits
WAITRESP : CMD_WAITRESP_Field := 16#0#;
-- CPSM waits for interrupt request
WAITINT : Boolean := False;
-- CPSM Waits for ends of data transfer (CmdPend internal signal).
WAITPEND : Boolean := False;
-- Command path state machine (CPSM) Enable bit
CPSMEN : Boolean := False;
-- SD I/O suspend command
SDIOSuspend : Boolean := False;
-- Enable CMD completion
ENCMDcompl : Boolean := False;
-- not Interrupt Enable
nIEN : Boolean := False;
-- CE-ATA command
CE_ATACMD : Boolean := False;
-- unspecified
Reserved_15_31 : HAL.UInt17 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CMD_Register use record
CMDINDEX at 0 range 0 .. 5;
WAITRESP at 0 range 6 .. 7;
WAITINT at 0 range 8 .. 8;
WAITPEND at 0 range 9 .. 9;
CPSMEN at 0 range 10 .. 10;
SDIOSuspend at 0 range 11 .. 11;
ENCMDcompl at 0 range 12 .. 12;
nIEN at 0 range 13 .. 13;
CE_ATACMD at 0 range 14 .. 14;
Reserved_15_31 at 0 range 15 .. 31;
end record;
subtype RESPCMD_RESPCMD_Field is HAL.UInt6;
-- command response register
type RESPCMD_Register is record
-- Read-only. Response command index
RESPCMD : RESPCMD_RESPCMD_Field;
-- unspecified
Reserved_6_31 : HAL.UInt26;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RESPCMD_Register use record
RESPCMD at 0 range 0 .. 5;
Reserved_6_31 at 0 range 6 .. 31;
end record;
subtype DLEN_DATALENGTH_Field is HAL.UInt25;
-- data length register
type DLEN_Register is record
-- Data length value
DATALENGTH : DLEN_DATALENGTH_Field := 16#0#;
-- unspecified
Reserved_25_31 : HAL.UInt7 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DLEN_Register use record
DATALENGTH at 0 range 0 .. 24;
Reserved_25_31 at 0 range 25 .. 31;
end record;
subtype DCTRL_DBLOCKSIZE_Field is HAL.UInt4;
-- data control register
type DCTRL_Register is record
-- Data transfer enabled bit
DTEN : Boolean := False;
-- Data transfer direction selection
DTDIR : Boolean := False;
-- Data transfer mode selection 1: Stream or SDIO multibyte data
-- transfer.
DTMODE : Boolean := False;
-- DMA enable bit
DMAEN : Boolean := False;
-- Data block size
DBLOCKSIZE : DCTRL_DBLOCKSIZE_Field := 16#0#;
-- Read wait start
RWSTART : Boolean := False;
-- Read wait stop
RWSTOP : Boolean := False;
-- Read wait mode
RWMOD : Boolean := False;
-- SD I/O enable functions
SDIOEN : Boolean := False;
-- unspecified
Reserved_12_31 : HAL.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DCTRL_Register use record
DTEN at 0 range 0 .. 0;
DTDIR at 0 range 1 .. 1;
DTMODE at 0 range 2 .. 2;
DMAEN at 0 range 3 .. 3;
DBLOCKSIZE at 0 range 4 .. 7;
RWSTART at 0 range 8 .. 8;
RWSTOP at 0 range 9 .. 9;
RWMOD at 0 range 10 .. 10;
SDIOEN at 0 range 11 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
subtype DCOUNT_DATACOUNT_Field is HAL.UInt25;
-- data counter register
type DCOUNT_Register is record
-- Read-only. Data count value
DATACOUNT : DCOUNT_DATACOUNT_Field;
-- unspecified
Reserved_25_31 : HAL.UInt7;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DCOUNT_Register use record
DATACOUNT at 0 range 0 .. 24;
Reserved_25_31 at 0 range 25 .. 31;
end record;
-- status register
type STA_Register is record
-- Read-only. Command response received (CRC check failed)
CCRCFAIL : Boolean;
-- Read-only. Data block sent/received (CRC check failed)
DCRCFAIL : Boolean;
-- Read-only. Command response timeout
CTIMEOUT : Boolean;
-- Read-only. Data timeout
DTIMEOUT : Boolean;
-- Read-only. Transmit FIFO underrun error
TXUNDERR : Boolean;
-- Read-only. Received FIFO overrun error
RXOVERR : Boolean;
-- Read-only. Command response received (CRC check passed)
CMDREND : Boolean;
-- Read-only. Command sent (no response required)
CMDSENT : Boolean;
-- Read-only. Data end (data counter, SDIDCOUNT, is zero)
DATAEND : Boolean;
-- Read-only. Start bit not detected on all data signals in wide bus
-- mode
STBITERR : Boolean;
-- Read-only. Data block sent/received (CRC check passed)
DBCKEND : Boolean;
-- Read-only. Command transfer in progress
CMDACT : Boolean;
-- Read-only. Data transmit in progress
TXACT : Boolean;
-- Read-only. Data receive in progress
RXACT : Boolean;
-- Read-only. Transmit FIFO half empty: at least 8 words can be written
-- into the FIFO
TXFIFOHE : Boolean;
-- Read-only. Receive FIFO half full: there are at least 8 words in the
-- FIFO
RXFIFOHF : Boolean;
-- Read-only. Transmit FIFO full
TXFIFOF : Boolean;
-- Read-only. Receive FIFO full
RXFIFOF : Boolean;
-- Read-only. Transmit FIFO empty
TXFIFOE : Boolean;
-- Read-only. Receive FIFO empty
RXFIFOE : Boolean;
-- Read-only. Data available in transmit FIFO
TXDAVL : Boolean;
-- Read-only. Data available in receive FIFO
RXDAVL : Boolean;
-- Read-only. SDIO interrupt received
SDIOIT : Boolean;
-- Read-only. CE-ATA command completion signal received for CMD61
CEATAEND : Boolean;
-- unspecified
Reserved_24_31 : HAL.UInt8;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for STA_Register use record
CCRCFAIL at 0 range 0 .. 0;
DCRCFAIL at 0 range 1 .. 1;
CTIMEOUT at 0 range 2 .. 2;
DTIMEOUT at 0 range 3 .. 3;
TXUNDERR at 0 range 4 .. 4;
RXOVERR at 0 range 5 .. 5;
CMDREND at 0 range 6 .. 6;
CMDSENT at 0 range 7 .. 7;
DATAEND at 0 range 8 .. 8;
STBITERR at 0 range 9 .. 9;
DBCKEND at 0 range 10 .. 10;
CMDACT at 0 range 11 .. 11;
TXACT at 0 range 12 .. 12;
RXACT at 0 range 13 .. 13;
TXFIFOHE at 0 range 14 .. 14;
RXFIFOHF at 0 range 15 .. 15;
TXFIFOF at 0 range 16 .. 16;
RXFIFOF at 0 range 17 .. 17;
TXFIFOE at 0 range 18 .. 18;
RXFIFOE at 0 range 19 .. 19;
TXDAVL at 0 range 20 .. 20;
RXDAVL at 0 range 21 .. 21;
SDIOIT at 0 range 22 .. 22;
CEATAEND at 0 range 23 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- interrupt clear register
type ICR_Register is record
-- CCRCFAIL flag clear bit
CCRCFAILC : Boolean := False;
-- DCRCFAIL flag clear bit
DCRCFAILC : Boolean := False;
-- CTIMEOUT flag clear bit
CTIMEOUTC : Boolean := False;
-- DTIMEOUT flag clear bit
DTIMEOUTC : Boolean := False;
-- TXUNDERR flag clear bit
TXUNDERRC : Boolean := False;
-- RXOVERR flag clear bit
RXOVERRC : Boolean := False;
-- CMDREND flag clear bit
CMDRENDC : Boolean := False;
-- CMDSENT flag clear bit
CMDSENTC : Boolean := False;
-- DATAEND flag clear bit
DATAENDC : Boolean := False;
-- STBITERR flag clear bit
STBITERRC : Boolean := False;
-- DBCKEND flag clear bit
DBCKENDC : Boolean := False;
-- unspecified
Reserved_11_21 : HAL.UInt11 := 16#0#;
-- SDIOIT flag clear bit
SDIOITC : Boolean := False;
-- CEATAEND flag clear bit
CEATAENDC : Boolean := False;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ICR_Register use record
CCRCFAILC at 0 range 0 .. 0;
DCRCFAILC at 0 range 1 .. 1;
CTIMEOUTC at 0 range 2 .. 2;
DTIMEOUTC at 0 range 3 .. 3;
TXUNDERRC at 0 range 4 .. 4;
RXOVERRC at 0 range 5 .. 5;
CMDRENDC at 0 range 6 .. 6;
CMDSENTC at 0 range 7 .. 7;
DATAENDC at 0 range 8 .. 8;
STBITERRC at 0 range 9 .. 9;
DBCKENDC at 0 range 10 .. 10;
Reserved_11_21 at 0 range 11 .. 21;
SDIOITC at 0 range 22 .. 22;
CEATAENDC at 0 range 23 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-- mask register
type MASK_Register is record
-- Command CRC fail interrupt enable
CCRCFAILIE : Boolean := False;
-- Data CRC fail interrupt enable
DCRCFAILIE : Boolean := False;
-- Command timeout interrupt enable
CTIMEOUTIE : Boolean := False;
-- Data timeout interrupt enable
DTIMEOUTIE : Boolean := False;
-- Tx FIFO underrun error interrupt enable
TXUNDERRIE : Boolean := False;
-- Rx FIFO overrun error interrupt enable
RXOVERRIE : Boolean := False;
-- Command response received interrupt enable
CMDRENDIE : Boolean := False;
-- Command sent interrupt enable
CMDSENTIE : Boolean := False;
-- Data end interrupt enable
DATAENDIE : Boolean := False;
-- Start bit error interrupt enable
STBITERRIE : Boolean := False;
-- Data block end interrupt enable
DBCKENDIE : Boolean := False;
-- Command acting interrupt enable
CMDACTIE : Boolean := False;
-- Data transmit acting interrupt enable
TXACTIE : Boolean := False;
-- Data receive acting interrupt enable
RXACTIE : Boolean := False;
-- Tx FIFO half empty interrupt enable
TXFIFOHEIE : Boolean := False;
-- Rx FIFO half full interrupt enable
RXFIFOHFIE : Boolean := False;
-- Tx FIFO full interrupt enable
TXFIFOFIE : Boolean := False;
-- Rx FIFO full interrupt enable
RXFIFOFIE : Boolean := False;
-- Tx FIFO empty interrupt enable
TXFIFOEIE : Boolean := False;
-- Rx FIFO empty interrupt enable
RXFIFOEIE : Boolean := False;
-- Data available in Tx FIFO interrupt enable
TXDAVLIE : Boolean := False;
-- Data available in Rx FIFO interrupt enable
RXDAVLIE : Boolean := False;
-- SDIO mode interrupt received interrupt enable
SDIOITIE : Boolean := False;
-- CE-ATA command completion signal received interrupt enable
CEATAENDIE : Boolean := False;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for MASK_Register use record
CCRCFAILIE at 0 range 0 .. 0;
DCRCFAILIE at 0 range 1 .. 1;
CTIMEOUTIE at 0 range 2 .. 2;
DTIMEOUTIE at 0 range 3 .. 3;
TXUNDERRIE at 0 range 4 .. 4;
RXOVERRIE at 0 range 5 .. 5;
CMDRENDIE at 0 range 6 .. 6;
CMDSENTIE at 0 range 7 .. 7;
DATAENDIE at 0 range 8 .. 8;
STBITERRIE at 0 range 9 .. 9;
DBCKENDIE at 0 range 10 .. 10;
CMDACTIE at 0 range 11 .. 11;
TXACTIE at 0 range 12 .. 12;
RXACTIE at 0 range 13 .. 13;
TXFIFOHEIE at 0 range 14 .. 14;
RXFIFOHFIE at 0 range 15 .. 15;
TXFIFOFIE at 0 range 16 .. 16;
RXFIFOFIE at 0 range 17 .. 17;
TXFIFOEIE at 0 range 18 .. 18;
RXFIFOEIE at 0 range 19 .. 19;
TXDAVLIE at 0 range 20 .. 20;
RXDAVLIE at 0 range 21 .. 21;
SDIOITIE at 0 range 22 .. 22;
CEATAENDIE at 0 range 23 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype FIFOCNT_FIFOCOUNT_Field is HAL.UInt24;
-- FIFO counter register
type FIFOCNT_Register is record
-- Read-only. Remaining number of words to be written to or read from
-- the FIFO.
FIFOCOUNT : FIFOCNT_FIFOCOUNT_Field;
-- unspecified
Reserved_24_31 : HAL.UInt8;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FIFOCNT_Register use record
FIFOCOUNT at 0 range 0 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Secure digital input/output interface
type SDIO_Peripheral is record
-- power control register
POWER : aliased POWER_Register;
-- SDI clock control register
CLKCR : aliased CLKCR_Register;
-- argument register
ARG : aliased HAL.UInt32;
-- command register
CMD : aliased CMD_Register;
-- command response register
RESPCMD : aliased RESPCMD_Register;
-- response 1..4 register
RESP1 : aliased HAL.UInt32;
-- response 1..4 register
RESP2 : aliased HAL.UInt32;
-- response 1..4 register
RESP3 : aliased HAL.UInt32;
-- response 1..4 register
RESP4 : aliased HAL.UInt32;
-- data timer register
DTIMER : aliased HAL.UInt32;
-- data length register
DLEN : aliased DLEN_Register;
-- data control register
DCTRL : aliased DCTRL_Register;
-- data counter register
DCOUNT : aliased DCOUNT_Register;
-- status register
STA : aliased STA_Register;
-- interrupt clear register
ICR : aliased ICR_Register;
-- mask register
MASK : aliased MASK_Register;
-- FIFO counter register
FIFOCNT : aliased FIFOCNT_Register;
-- data FIFO register
FIFO : aliased HAL.UInt32;
end record
with Volatile;
for SDIO_Peripheral use record
POWER at 16#0# range 0 .. 31;
CLKCR at 16#4# range 0 .. 31;
ARG at 16#8# range 0 .. 31;
CMD at 16#C# range 0 .. 31;
RESPCMD at 16#10# range 0 .. 31;
RESP1 at 16#14# range 0 .. 31;
RESP2 at 16#18# range 0 .. 31;
RESP3 at 16#1C# range 0 .. 31;
RESP4 at 16#20# range 0 .. 31;
DTIMER at 16#24# range 0 .. 31;
DLEN at 16#28# range 0 .. 31;
DCTRL at 16#2C# range 0 .. 31;
DCOUNT at 16#30# range 0 .. 31;
STA at 16#34# range 0 .. 31;
ICR at 16#38# range 0 .. 31;
MASK at 16#3C# range 0 .. 31;
FIFOCNT at 16#48# range 0 .. 31;
FIFO at 16#80# range 0 .. 31;
end record;
-- Secure digital input/output interface
SDIO_Periph : aliased SDIO_Peripheral
with Import, Address => System'To_Address (16#40012C00#);
end STM32_SVD.SDIO;
| 34.99422 | 78 | 0.568109 |
dc78cc15210d67314dc640f10975a2ed2ce8819f | 174 | ads | Ada | tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/generic_package_renaming_declaration.ads | LaudateCorpus1/rose-1 | 5fe906d2a01253130c5de465aded6a917a8476a0 | [
"BSD-3-Clause"
] | 488 | 2015-01-09T08:54:48.000Z | 2022-03-30T07:15:46.000Z | tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/generic_package_renaming_declaration.ads | LaudateCorpus1/rose-1 | 5fe906d2a01253130c5de465aded6a917a8476a0 | [
"BSD-3-Clause"
] | 174 | 2015-01-28T18:41:32.000Z | 2022-03-31T16:51:05.000Z | tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/generic_package_renaming_declaration.ads | LaudateCorpus1/rose-1 | 5fe906d2a01253130c5de465aded6a917a8476a0 | [
"BSD-3-Clause"
] | 146 | 2015-04-27T02:48:34.000Z | 2022-03-04T07:32:53.000Z | with Ada.Text_IO;
package generic_package_renaming_declaration is
generic package Enum_IO renames Ada.Text_IO.Enumeration_IO;
end generic_package_renaming_declaration;
| 29 | 63 | 0.862069 |
c5171f94c941d0fcce2b147a56fc6067b471eeac | 35,295 | adb | Ada | src/parameters.adb | jrmarino/ravenadm | 51f618e43e8d84c1c8a582b45e8c84f9561b5695 | [
"0BSD"
] | 18 | 2017-02-28T08:43:17.000Z | 2022-03-22T21:55:56.000Z | src/parameters.adb | jrmarino/ravenadm | 51f618e43e8d84c1c8a582b45e8c84f9561b5695 | [
"0BSD"
] | 49 | 2017-10-28T11:18:05.000Z | 2022-01-16T16:23:32.000Z | src/parameters.adb | jrmarino/ravenadm | 51f618e43e8d84c1c8a582b45e8c84f9561b5695 | [
"0BSD"
] | 5 | 2017-09-06T14:47:57.000Z | 2021-11-25T08:31:10.000Z | -- This file is covered by the Internet Software Consortium (ISC) License
-- Reference: ../License.txt
with Ada.Directories;
with Ada.Characters.Latin_1;
with Ada.Exceptions;
with Ada.Text_IO;
with INI_File_Manager;
with GNAT.OS_Lib;
with Unix;
package body Parameters is
package EX renames Ada.Exceptions;
package DIR renames Ada.Directories;
package LAT renames Ada.Characters.Latin_1;
package TIO renames Ada.Text_IO;
package OSL renames GNAT.OS_Lib;
package IFM renames INI_File_Manager;
--------------------------------------------------------------------------------------------
-- all_paths_valid
--------------------------------------------------------------------------------------------
function all_paths_valid (skip_mk_check : Boolean) return Boolean
is
function invalid_directory (folder : HT.Text; desc : String) return Boolean;
use type DIR.File_Kind;
localbase : String := HT.USS (configuration.dir_localbase);
function invalid_directory (folder : HT.Text; desc : String) return Boolean
is
dossier : constant String := HT.USS (folder);
errmsg : constant String := "Configuration invalid: ";
begin
if DIR.Exists (dossier) and then DIR.Kind (dossier) = DIR.Directory then
return False;
else
TIO.Put_Line (errmsg & desc & " directory: " & dossier);
return True;
end if;
end invalid_directory;
begin
if HT.USS (configuration.dir_sysroot) = "/" then
TIO.Put_Line ("[A] System root cannot be " & LAT.Quotation & "/" & LAT.Quotation);
return False;
elsif forbidden_localbase (localbase) then
TIO.Put_Line ("[C] Localbase set to standard system folder '" & localbase & "'");
return False;
elsif invalid_directory (configuration.dir_sysroot, "[A] System root") then
return False;
elsif invalid_directory (configuration.dir_toolchain, "[B] Toolchain directory") then
return False;
elsif invalid_directory (configuration.dir_conspiracy, "[D] Conspiracy") then
return False;
elsif invalid_directory (configuration.dir_distfiles, "[F] Distfiles") then
return False;
elsif invalid_directory (configuration.dir_profile, "[G] Profile") then
return False;
end if;
if not (HT.USS (configuration.dir_ccache) = no_ccache) and then
invalid_directory (configuration.dir_ccache, "[H] Compiler cache")
then
return False;
end if;
if not (HT.USS (configuration.dir_unkindness) = no_unkindness) and then
invalid_directory (configuration.dir_unkindness, "[E] Custom ports")
then
return False;
end if;
declare
log_dir : String := HT.USS (configuration.dir_profile) & "/logs/logs";
option_dir : String := HT.USS (configuration.dir_profile) & "/options/defconf_cookies";
pkgs_dir : String := HT.USS (configuration.dir_profile) & "/packages";
mk_dir : String := HT.USS (configuration.dir_conspiracy) & "/Mk";
begin
if HT.equivalent (configuration.dir_packages, pkgs_dir) then
if not DIR.Exists (pkgs_dir) then
DIR.Create_Path (pkgs_dir);
end if;
else
if invalid_directory (configuration.dir_packages, "[H] Packages") then
return False;
end if;
end if;
if not skip_mk_check then
if not DIR.Exists (mk_dir) then
TIO.Put_Line ("Conspiracy directory exists without Mk contents");
TIO.Put_Line ("Try running 'ravenadm update-ports'");
return False;
end if;
end if;
if not DIR.Exists (log_dir) then
DIR.Create_Path (log_dir);
end if;
if not DIR.Exists (option_dir) then
DIR.Create_Path (option_dir);
end if;
end;
return True;
end all_paths_valid;
--------------------------------------------------------------------------------------------
-- configuration_exists
--------------------------------------------------------------------------------------------
function configuration_exists return Boolean
is
use type DIR.File_Kind;
begin
return DIR.Exists (conf_location) and then DIR.Kind (conf_location) = DIR.Ordinary_File;
end configuration_exists;
--------------------------------------------------------------------------------------------
-- load_configuration
--------------------------------------------------------------------------------------------
function load_configuration return Boolean is
begin
set_chroot;
set_cores;
if DIR.Exists (conf_location) then
begin
IFM.scan_file (raven_confdir, ravenadm_ini);
exception
when ini : others =>
TIO.Put_Line (ravenadm_ini & " parse issue: " & EX.Exception_Message (ini));
return False;
end;
declare
selected_profile : String := IFM.show_value (master_section, global_01);
envprofile : String := OSL.Getenv ("RAVENPROFILE").all;
begin
if envprofile /= "" and then IFM.section_exists (envprofile) then
change_active_profile (envprofile);
else
if selected_profile = "" then
TIO.Put_Line (ravenadm_ini & ": missing global profile_selected field.");
return False;
end if;
if not IFM.section_exists (selected_profile) then
TIO.Put_Line (ravenadm_ini & ": profile_selected set to non-existent profile.");
return False;
end if;
end if;
end;
else
insert_profile (default_profile (first_profile));
change_active_profile (first_profile);
rewrite_configuration;
end if;
transfer_configuration;
return True;
end load_configuration;
--------------------------------------------------------------------------------------------
-- forbidden_localbase
--------------------------------------------------------------------------------------------
function forbidden_localbase (candidate : String) return Boolean
is
function downstream (path : String) return Boolean;
function downstream (path : String) return Boolean is
begin
return candidate = path or else HT.leads (candidate, path & "/");
end downstream;
begin
if candidate (candidate'First) /= LAT.Solidus then
return True;
end if;
return
downstream ("/bin") or else
downstream ("/boot") or else
downstream ("/dev") or else
downstream ("/etc") or else
downstream ("/lib") or else
downstream ("/libexec") or else
downstream ("/proc") or else
downstream ("/sbin") or else
downstream ("/sys") or else
downstream ("/tmp") or else
downstream ("/var") or else
downstream ("/usr/bin") or else
downstream ("/usr/dports") or else
downstream ("/usr/games") or else
downstream ("/usr/include") or else
downstream ("/usr/lib") or else
downstream ("/usr/libdata") or else
downstream ("/usr/libexec") or else
downstream ("/usr/obj") or else
downstream ("/usr/pkgsrc") or else
downstream ("/usr/ports") or else
downstream ("/usr/sbin") or else
downstream ("/usr/share") or else
downstream ("/usr/src");
end forbidden_localbase;
--------------------------------------------------------------------------------------------
-- alternative_profiles_exist
--------------------------------------------------------------------------------------------
function alternative_profiles_exist return Boolean is
begin
return IFM.section_count > 2;
end alternative_profiles_exist;
--------------------------------------------------------------------------------------------
-- query_physical_memory
--------------------------------------------------------------------------------------------
procedure query_physical_memory is
-- Works for *BSD, DragonFly, Bitrig
-- DF/Free "hw.physmem: 8525971456" (8G)
-- NetBSD "hw.physmem64 = 17060806656" (16G)
-- MacOS "hw.memsize = 2147483648" (16G)
bsd_command : constant String := "/sbin/sysctl hw.physmem";
net_command : constant String := "/sbin/sysctl hw.physmem64";
mac_command : constant String := "/usr/sbin/sysctl hw.memsize";
content : HT.Text;
status : Integer;
begin
memory_megs := 1024;
case platform_type is
when dragonfly | freebsd | openbsd =>
content := Unix.piped_command (bsd_command, status);
when netbsd =>
content := Unix.piped_command (net_command, status);
when macos =>
content := Unix.piped_command (mac_command, status);
when linux | sunos =>
-- Impossible case
return;
end case;
if status /= 0 then
TIO.Put_Line ("query_physical_memory command failed");
return;
end if;
declare
type styles is (unknown, dragonfly, netbsd);
function get_number_string return String;
style : styles := unknown;
response : constant String :=
HT.USS (content) (1 .. HT.SU.Length (content) - 1);
SP1 : constant String (1 .. 2) := (1 => LAT.Colon,
2 => LAT.Space);
SP2 : constant String (1 .. 2) := (1 => LAT.Equals_Sign,
2 => LAT.Space);
function get_number_string return String is
begin
case style is
when dragonfly => return HT.part_2 (response, SP1);
when netbsd => return HT.part_2 (response, SP2);
when unknown => return "1073741824";
end case;
end get_number_string;
begin
if HT.contains (response, SP1) then
style := dragonfly;
elsif HT.contains (response, SP2) then
style := netbsd;
else
TIO.Put_Line ("Anomaly, unable to detect physical memory");
TIO.Put_Line (response);
return;
end if;
declare
type memtype is mod 2**64;
numbers : String := get_number_string;
bytes : constant memtype := memtype'Value (numbers);
megs : constant memtype := bytes / 1024 / 1024;
begin
memory_megs := Natural (megs);
end;
end;
end query_physical_memory;
--------------------------------------------------------------------------------------------
-- query_physical_memory_linux
--------------------------------------------------------------------------------------------
procedure query_physical_memory_linux
is
-- On linux, MemTotal should be on first line and that's what we're looking for
command : constant String := "/usr/bin/head /proc/meminfo";
found : Boolean := False;
status : Integer;
comres : String := HT.USS (Unix.piped_command (command, status));
markers : HT.Line_Markers;
begin
if status /= 0 then
raise memory_probe with command;
end if;
HT.initialize_markers (comres, markers);
loop
exit when found;
exit when not HT.next_line_present (comres, markers);
declare
line : constant String := HT.trim (HT.extract_line (comres, markers));
begin
if line'Length > 12 and then
line (line'First .. line'First + 8) = "MemTotal:"
then
declare
type memtype is mod 2**64;
sequence : String := HT.trim (line (line'First + 9 .. line'Last));
numbers : String := HT.part_1 (sequence, " ");
kilobytes : constant memtype := memtype'Value (numbers);
megs : constant memtype := kilobytes / 1024;
begin
memory_megs := Natural (megs);
end;
found := True;
end if;
end;
end loop;
end query_physical_memory_linux;
--------------------------------------------------------------------------------------------
-- query_physical_memory_sunos
--------------------------------------------------------------------------------------------
procedure query_physical_memory_sunos
is
-- On Solaris, we're looking for "Memory size" which should be on second line
command : constant String := "/usr/sbin/prtconf";
found : Boolean := False;
status : Integer;
comres : String := HT.USS (Unix.piped_command (command, status));
markers : HT.Line_Markers;
begin
if status /= 0 then
raise memory_probe with command;
end if;
HT.initialize_markers (comres, markers);
loop
exit when found;
exit when not HT.next_line_present (comres, markers);
declare
line : constant String := HT.extract_line (comres, markers);
begin
if line'Length > 15 and then
line (line'First .. line'First + 11) = "Memory size:"
then
declare
type memtype is mod 2**64;
numbers : String := HT.part_1 (line (line'First + 13 .. line'Last), " ");
megabytes : constant memtype := memtype'Value (numbers);
begin
memory_megs := Natural (megabytes);
end;
found := True;
end if;
end;
end loop;
end query_physical_memory_sunos;
--------------------------------------------------------------------------------------------
-- enough_memory
--------------------------------------------------------------------------------------------
function enough_memory (num_builders : builders) return Boolean
is
megs_per_slave : Natural;
begin
if memory_megs = 0 then
case platform_type is
when linux => query_physical_memory_linux;
when sunos => query_physical_memory_sunos;
when dragonfly |
freebsd |
macos |
netbsd |
openbsd => query_physical_memory;
end case;
end if;
megs_per_slave := memory_megs / Positive (num_builders);
return megs_per_slave >= 1280;
end enough_memory;
--------------------------------------------------------------------------------------------
-- default_parallelism
--------------------------------------------------------------------------------------------
procedure default_parallelism
(num_cores : cpu_range;
num_builders : out Integer;
jobs_per_builder : out Integer) is
begin
case num_cores is
when 1 =>
num_builders := 1;
jobs_per_builder := 1;
when 2 | 3 =>
num_builders := 2;
jobs_per_builder := 2;
when 4 | 5 =>
num_builders := 3;
jobs_per_builder := 3;
when 6 | 7 =>
num_builders := 4;
jobs_per_builder := 3;
when 8 | 9 =>
num_builders := 6;
jobs_per_builder := 4;
when 10 | 11 =>
num_builders := 8;
jobs_per_builder := 4;
when others =>
num_builders := (Integer (num_cores) * 3) / 4;
jobs_per_builder := 5;
end case;
end default_parallelism;
--------------------------------------------------------------------------------------------
-- default_profile
--------------------------------------------------------------------------------------------
function default_profile (new_profile : String) return configuration_record
is
result : configuration_record;
def_builders : Integer;
def_jlimit : Integer;
floating : constant HT.Text := HT.SUS (ports_default);
begin
default_parallelism (num_cores => configuration.number_cores,
num_builders => def_builders,
jobs_per_builder => def_jlimit);
result.profile := HT.SUS (new_profile);
result.dir_sysroot := HT.SUS (std_sysroot);
result.dir_toolchain := HT.SUS (std_toolchain);
result.dir_localbase := HT.SUS (std_localbase);
result.dir_conspiracy := HT.SUS (std_conspiracy);
result.dir_unkindness := HT.SUS (no_unkindness);
result.dir_distfiles := HT.SUS (std_distfiles);
result.dir_packages := HT.replace_substring (HT.SUS (pri_packages), "[X]", new_profile);
result.dir_ccache := HT.SUS (no_ccache);
result.dir_buildbase := HT.SUS (pri_buildbase);
result.dir_profile := HT.replace_substring (HT.SUS (pri_profile), "[X]", new_profile);
result.num_builders := builders (def_builders);
result.jobs_limit := builders (def_jlimit);
result.avec_ncurses := True;
result.defer_prebuilt := False;
result.record_options := False;
result.batch_mode := True;
result.def_firebird := floating;
result.def_lua := floating;
result.def_mysql_group := floating;
result.def_perl := floating;
result.def_php := floating;
result.def_postgresql := floating;
result.def_python3 := floating;
result.def_ruby := floating;
result.def_ssl := floating;
result.def_tcl_tk := floating;
case platform_type is
when macos => result.avoid_tmpfs := True;
when openbsd => result.avoid_tmpfs := True;
when others => result.avoid_tmpfs := not enough_memory (builders (def_builders));
end case;
return result;
end default_profile;
--------------------------------------------------------------------------------------------
-- insert_profile
--------------------------------------------------------------------------------------------
procedure insert_profile (confrec : configuration_record)
is
function may_be_disabled (directory : HT.Text; disabled_value : String) return String;
function set_builder (X : builders) return String;
function set_boolean (value : Boolean) return String;
profile_name : constant String := HT.USS (confrec.profile);
function may_be_disabled (directory : HT.Text; disabled_value : String) return String is
begin
if HT.equivalent (directory, HT.blank) then
return disabled_value;
else
return HT.USS (directory);
end if;
end may_be_disabled;
function set_builder (X : builders) return String is
begin
return HT.int2str (Integer (X));
end set_builder;
function set_boolean (value : Boolean) return String is
begin
case value is
when True => return "true";
when False => return "false";
end case;
end set_boolean;
begin
IFM.delete_section (profile_name);
IFM.insert_or_update (profile_name, Field_01, HT.USS (confrec.dir_sysroot));
IFM.insert_or_update (profile_name, Field_16, HT.USS (confrec.dir_toolchain));
IFM.insert_or_update (profile_name, Field_02, HT.USS (confrec.dir_localbase));
IFM.insert_or_update (profile_name, Field_03, HT.USS (confrec.dir_conspiracy));
IFM.insert_or_update (profile_name, Field_04,
may_be_disabled (confrec.dir_unkindness, no_unkindness));
IFM.insert_or_update (profile_name, Field_05, HT.USS (confrec.dir_distfiles));
IFM.insert_or_update (profile_name, Field_06, HT.USS (confrec.dir_profile));
IFM.insert_or_update (profile_name, Field_07, HT.USS (confrec.dir_packages));
IFM.insert_or_update (profile_name, Field_08,
may_be_disabled (confrec.dir_ccache, no_ccache));
IFM.insert_or_update (profile_name, Field_09, HT.USS (confrec.dir_buildbase));
IFM.insert_or_update (profile_name, Field_10, set_builder (confrec.num_builders));
IFM.insert_or_update (profile_name, Field_11, set_builder (confrec.jobs_limit));
IFM.insert_or_update (profile_name, Field_12, set_boolean (confrec.avoid_tmpfs));
IFM.insert_or_update (profile_name, Field_13, set_boolean (confrec.defer_prebuilt));
IFM.insert_or_update (profile_name, Field_14, set_boolean (confrec.avec_ncurses));
IFM.insert_or_update (profile_name, Field_15, set_boolean (confrec.record_options));
IFM.insert_or_update (profile_name, Field_27, set_boolean (confrec.batch_mode));
IFM.insert_or_update (profile_name, Field_17, HT.USS (confrec.def_firebird));
IFM.insert_or_update (profile_name, Field_18, HT.USS (confrec.def_lua));
IFM.insert_or_update (profile_name, Field_19, HT.USS (confrec.def_mysql_group));
IFM.insert_or_update (profile_name, Field_20, HT.USS (confrec.def_perl));
IFM.insert_or_update (profile_name, Field_21, HT.USS (confrec.def_php));
IFM.insert_or_update (profile_name, Field_22, HT.USS (confrec.def_postgresql));
IFM.insert_or_update (profile_name, Field_23, HT.USS (confrec.def_python3));
IFM.insert_or_update (profile_name, Field_24, HT.USS (confrec.def_ruby));
IFM.insert_or_update (profile_name, Field_25, HT.USS (confrec.def_ssl));
IFM.insert_or_update (profile_name, Field_26, HT.USS (confrec.def_tcl_tk));
end insert_profile;
--------------------------------------------------------------------------------------------
-- change_active_profile
--------------------------------------------------------------------------------------------
procedure change_active_profile (new_active_profile : String) is
begin
IFM.insert_or_update (master_section, global_01, new_active_profile);
end change_active_profile;
--------------------------------------------------------------------------------------------
-- rewrite_configuration
--------------------------------------------------------------------------------------------
procedure rewrite_configuration
is
comment : String := "This ravenadm configuration file is automatically generated";
begin
IFM.scribe_file (directory => raven_confdir,
filename => ravenadm_ini,
first_comment => comment);
end rewrite_configuration;
--------------------------------------------------------------------------------------------
-- transfer_configuration
--------------------------------------------------------------------------------------------
procedure transfer_configuration
is
function default_string (field_name : String; default : String) return HT.Text;
function default_builder (field_name : String; default : Integer) return builders;
function default_boolean (field_name : String; default : Boolean) return Boolean;
function tmpfs_transfer return Boolean;
def_builders : Integer;
def_jlimit : Integer;
profile : constant String := IFM.show_value (section => master_section,
name => global_01);
def_profile : constant String :=
HT.USS (HT.replace_substring (HT.SUS (pri_profile), "[X]", profile));
def_packages : constant String := def_profile & "/packages";
function default_string (field_name : String; default : String) return HT.Text
is
value : String := IFM.show_value (profile, field_name);
begin
if value = "" then
return HT.SUS (default);
else
return HT.SUS (value);
end if;
end default_string;
function default_builder (field_name : String; default : Integer) return builders
is
value : String := IFM.show_value (profile, field_name);
converted : Integer;
begin
if value = "" then
return builders (default);
else
converted := Integer'Value (value);
return builders (converted);
end if;
exception
when others =>
return builders (default);
end default_builder;
function default_boolean (field_name : String; default : Boolean) return Boolean
is
value : String := IFM.show_value (profile, field_name);
lower_value : String := HT.lowercase (value);
begin
if value = "" then
return default;
else
if lower_value = "true" then
return True;
elsif lower_value = "false" then
return False;
else
return default;
end if;
end if;
end default_boolean;
function tmpfs_transfer return Boolean
is
value : String := IFM.show_value (profile, Field_12);
lower_value : String := HT.lowercase (value);
begin
if value = "" then
return not enough_memory (builders (def_builders));
else
if lower_value = "true" then
return True;
elsif lower_value = "false" then
return False;
else
return not enough_memory (builders (def_builders));
end if;
end if;
end tmpfs_transfer;
begin
if profile = "" then
raise profile_DNE;
end if;
default_parallelism (num_cores => configuration.number_cores,
num_builders => def_builders,
jobs_per_builder => def_jlimit);
active_profile := HT.SUS (profile);
configuration.profile := active_profile;
configuration.dir_sysroot := default_string (Field_01, std_sysroot);
configuration.dir_toolchain := default_string (Field_16, std_toolchain);
configuration.dir_localbase := default_string (Field_02, std_localbase);
configuration.dir_conspiracy := default_string (Field_03, std_conspiracy);
configuration.dir_unkindness := default_string (Field_04, no_unkindness);
configuration.dir_distfiles := default_string (Field_05, std_distfiles);
configuration.dir_profile := default_string (Field_06, def_profile);
configuration.dir_packages := default_string (Field_07, def_packages);
configuration.dir_ccache := default_string (Field_08, no_ccache);
configuration.dir_buildbase := default_string (Field_09, pri_buildbase);
configuration.num_builders := default_builder (Field_10, def_builders);
configuration.jobs_limit := default_builder (Field_11, def_jlimit);
configuration.avoid_tmpfs := tmpfs_transfer;
configuration.defer_prebuilt := default_boolean (Field_13, False);
configuration.avec_ncurses := default_boolean (Field_14, True);
configuration.record_options := default_boolean (Field_15, False);
configuration.batch_mode := default_boolean (Field_27, True);
configuration.def_firebird := default_string (Field_17, ports_default);
configuration.def_lua := default_string (Field_18, ports_default);
configuration.def_mysql_group := default_string (Field_19, ports_default);
configuration.def_perl := default_string (Field_20, ports_default);
configuration.def_php := default_string (Field_21, ports_default);
configuration.def_postgresql := default_string (Field_22, ports_default);
configuration.def_python3 := default_string (Field_23, ports_default);
configuration.def_ruby := default_string (Field_24, ports_default);
configuration.def_ssl := default_string (Field_25, ports_default);
configuration.def_tcl_tk := default_string (Field_26, ports_default);
-- Derived configuration
configuration.dir_repository := HT.SUS (HT.USS (configuration.dir_packages) & "/All");
configuration.sysroot_pkg8 := HT.SUS (HT.USS (configuration.dir_sysroot) &
"/usr/bin/ravensw");
configuration.dir_logs := HT.SUS (HT.USS (configuration.dir_profile) & "/logs");
configuration.dir_options := HT.SUS (HT.USS (configuration.dir_profile) & "/options");
end transfer_configuration;
--------------------------------------------------------------------------------------------
-- set_cores
--------------------------------------------------------------------------------------------
procedure set_cores
is
number : constant Positive := get_number_cpus;
begin
if number > Positive (cpu_range'Last) then
configuration.number_cores := cpu_range'Last;
else
configuration.number_cores := cpu_range (number);
end if;
end set_cores;
--------------------------------------------------------------------------------------------
-- get_number_cpus
--------------------------------------------------------------------------------------------
function get_number_cpus return Positive
is
bsd_cmd : constant String := "/sbin/sysctl hw.ncpu";
mac_cmd : constant String := "/usr/sbin/sysctl hw.ncpu";
lin_cmd : constant String := "/usr/bin/nproc";
sol_cmd : constant String := "/usr/sbin/psrinfo -pv";
comres : HT.Text;
status : Integer;
start : Positive;
begin
-- DF/Free: expected output: "hw.ncpu: C" where C is integer
-- MacOS: expected output: "hw.ncpu: C"
-- NetBSD: expected output: "hw.ncpu = C"
-- OpenBSD: expected output: "hw.ncpu=C"
-- Linux: expected output: "C"
-- Solaris: expected output:
-- The physical processor has 64 virtual processors (0-63)
-- UltraSPARC-T2+ (cpuid 0 clock 1165 MHz)
-- The physical processor has 64 virtual processors (64-127)
-- UltraSPARC-T2+ (cpuid 64 clock 1165 MHz)
case platform_type is
when dragonfly | freebsd | netbsd | openbsd =>
comres := Unix.piped_command (bsd_cmd, status);
when macos =>
comres := Unix.piped_command (mac_cmd, status);
when linux =>
comres := Unix.piped_command (lin_cmd, status);
when sunos =>
comres := Unix.piped_command (sol_cmd, status);
end case;
if status /= 0 then
return 1;
end if;
case platform_type is
when dragonfly | freebsd | macos => start := 10;
when linux => start := 1;
when netbsd => start := 11;
when openbsd => start := 9;
when sunos =>
declare
markers : HT.Line_Markers;
resstr : constant String := HT.USS (comres);
pattern : constant String := "The physical processor has ";
numcore : Natural := 0;
begin
HT.initialize_markers (resstr, markers);
loop
exit when not HT.next_line_with_content_present (resstr, pattern, markers);
declare
line : constant String := HT.extract_line (resstr, markers);
nvp : constant String := HT.part_1 (HT.part_2 (line, pattern), " ");
begin
numcore := numcore + Natural'Value (nvp);
exception
when others =>
numcore := numcore + 1;
end;
end loop;
if numcore < 1 then
-- Should never happen
return 1;
else
return numcore;
end if;
exception
when others => return 1;
end;
end case;
declare
resstr : String := HT.USS (comres);
ncpu : String := resstr (start .. resstr'Last - 1);
number : Positive := Integer'Value (ncpu);
begin
return number;
exception
when others => return 1;
end;
end get_number_cpus;
--------------------------------------------------------------------------------------------
-- list_profiles
--------------------------------------------------------------------------------------------
function list_profiles return String
is
result : HT.Text;
total_sections : Natural := IFM.section_count;
begin
for index in Positive range 1 .. total_sections loop
declare
section : String := IFM.section_name (index);
begin
if section /= master_section then
HT.SU.Append (result, section & LAT.LF);
end if;
end;
end loop;
return HT.USS (result);
end list_profiles;
--------------------------------------------------------------------------------------------
-- delete_profile
--------------------------------------------------------------------------------------------
procedure delete_profile (profile : String) is
begin
IFM.delete_section (profile);
rewrite_configuration;
end delete_profile;
--------------------------------------------------------------------------------------------
-- switch_profile
--------------------------------------------------------------------------------------------
procedure switch_profile (to_profile : String) is
begin
change_active_profile (new_active_profile => to_profile);
transfer_configuration;
end switch_profile;
--------------------------------------------------------------------------------------------
-- set_chroot
--------------------------------------------------------------------------------------------
procedure set_chroot
is
alternate_chroot : constant String := "/usr/bin/chroot";
begin
if DIR.Exists (HT.trim (chroot_cmd)) then
return;
elsif DIR.Exists (alternate_chroot) then
chroot_cmd := alternate_chroot & " ";
else
TIO.Put_Line ("chroot program not found!");
TIO.Put_Line ("ravenadm will not be able to build any software.");
end if;
end set_chroot;
--------------------------------------------------------------------------------------------
-- ssl_selection
--------------------------------------------------------------------------------------------
function ssl_selection (confrec : in configuration_record) return String
is
nbase : String := HT.USS (confrec.def_ssl);
begin
if nbase = ports_default then
return default_ssl;
else
return nbase;
end if;
end ssl_selection;
end Parameters;
| 40.522388 | 98 | 0.530132 |
4ac93acc84c285cb1dfa23ea0b97af3af3aeef93 | 15,087 | ads | Ada | llvm-gcc-4.2-2.9/gcc/ada/a-stwiun.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/a-stwiun.ads | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | llvm-gcc-4.2-2.9/gcc/ada/a-stwiun.ads | 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 _ U N B O U N D E D --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2005, 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 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_Maps;
with Ada.Finalization;
package Ada.Strings.Wide_Unbounded is
pragma Preelaborate;
type Unbounded_Wide_String is private;
Null_Unbounded_Wide_String : constant Unbounded_Wide_String;
function Length (Source : Unbounded_Wide_String) return Natural;
type Wide_String_Access is access all Wide_String;
procedure Free (X : in out Wide_String_Access);
--------------------------------------------------------
-- Conversion, Concatenation, and Selection Functions --
--------------------------------------------------------
function To_Unbounded_Wide_String
(Source : Wide_String) return Unbounded_Wide_String;
function To_Unbounded_Wide_String
(Length : Natural) return Unbounded_Wide_String;
function To_Wide_String
(Source : Unbounded_Wide_String)
return Wide_String;
procedure Set_Unbounded_Wide_String
(Target : out Unbounded_Wide_String;
Source : Wide_String);
pragma Ada_05 (Set_Unbounded_Wide_String);
procedure Append
(Source : in out Unbounded_Wide_String;
New_Item : Unbounded_Wide_String);
procedure Append
(Source : in out Unbounded_Wide_String;
New_Item : Wide_String);
procedure Append
(Source : in out Unbounded_Wide_String;
New_Item : Wide_Character);
function "&"
(Left : Unbounded_Wide_String;
Right : Unbounded_Wide_String) return Unbounded_Wide_String;
function "&"
(Left : Unbounded_Wide_String;
Right : Wide_String) return Unbounded_Wide_String;
function "&"
(Left : Wide_String;
Right : Unbounded_Wide_String) return Unbounded_Wide_String;
function "&"
(Left : Unbounded_Wide_String;
Right : Wide_Character) return Unbounded_Wide_String;
function "&"
(Left : Wide_Character;
Right : Unbounded_Wide_String) return Unbounded_Wide_String;
function Element
(Source : Unbounded_Wide_String;
Index : Positive) return Wide_Character;
procedure Replace_Element
(Source : in out Unbounded_Wide_String;
Index : Positive;
By : Wide_Character);
function Slice
(Source : Unbounded_Wide_String;
Low : Positive;
High : Natural) return Wide_String;
function Unbounded_Slice
(Source : Unbounded_Wide_String;
Low : Positive;
High : Natural) return Unbounded_Wide_String;
pragma Ada_05 (Unbounded_Slice);
procedure Unbounded_Slice
(Source : Unbounded_Wide_String;
Target : out Unbounded_Wide_String;
Low : Positive;
High : Natural);
pragma Ada_05 (Unbounded_Slice);
function "="
(Left : Unbounded_Wide_String;
Right : Unbounded_Wide_String) return Boolean;
function "="
(Left : Unbounded_Wide_String;
Right : Wide_String) return Boolean;
function "="
(Left : Wide_String;
Right : Unbounded_Wide_String) return Boolean;
function "<"
(Left : Unbounded_Wide_String;
Right : Unbounded_Wide_String) return Boolean;
function "<"
(Left : Unbounded_Wide_String;
Right : Wide_String) return Boolean;
function "<"
(Left : Wide_String;
Right : Unbounded_Wide_String) return Boolean;
function "<="
(Left : Unbounded_Wide_String;
Right : Unbounded_Wide_String) return Boolean;
function "<="
(Left : Unbounded_Wide_String;
Right : Wide_String) return Boolean;
function "<="
(Left : Wide_String;
Right : Unbounded_Wide_String) return Boolean;
function ">"
(Left : Unbounded_Wide_String;
Right : Unbounded_Wide_String) return Boolean;
function ">"
(Left : Unbounded_Wide_String;
Right : Wide_String) return Boolean;
function ">"
(Left : Wide_String;
Right : Unbounded_Wide_String) return Boolean;
function ">="
(Left : Unbounded_Wide_String;
Right : Unbounded_Wide_String) return Boolean;
function ">="
(Left : Unbounded_Wide_String;
Right : Wide_String) return Boolean;
function ">="
(Left : Wide_String;
Right : Unbounded_Wide_String) return Boolean;
------------------------
-- Search Subprograms --
------------------------
function Index
(Source : Unbounded_Wide_String;
Pattern : Wide_String;
Going : Direction := Forward;
Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
return Natural;
function Index
(Source : Unbounded_Wide_String;
Pattern : Wide_String;
Going : Direction := Forward;
Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
function Index
(Source : Unbounded_Wide_String;
Set : Wide_Maps.Wide_Character_Set;
Test : Membership := Inside;
Going : Direction := Forward) return Natural;
function Index
(Source : Unbounded_Wide_String;
Pattern : Wide_String;
From : Positive;
Going : Direction := Forward;
Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
return Natural;
pragma Ada_05 (Index);
function Index
(Source : Unbounded_Wide_String;
Pattern : Wide_String;
From : Positive;
Going : Direction := Forward;
Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
pragma Ada_05 (Index);
function Index
(Source : Unbounded_Wide_String;
Set : Wide_Maps.Wide_Character_Set;
From : Positive;
Test : Membership := Inside;
Going : Direction := Forward) return Natural;
pragma Ada_05 (Index);
function Index_Non_Blank
(Source : Unbounded_Wide_String;
Going : Direction := Forward) return Natural;
function Index_Non_Blank
(Source : Unbounded_Wide_String;
From : Positive;
Going : Direction := Forward) return Natural;
pragma Ada_05 (Index_Non_Blank);
function Count
(Source : Unbounded_Wide_String;
Pattern : Wide_String;
Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
return Natural;
function Count
(Source : Unbounded_Wide_String;
Pattern : Wide_String;
Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
function Count
(Source : Unbounded_Wide_String;
Set : Wide_Maps.Wide_Character_Set) return Natural;
procedure Find_Token
(Source : Unbounded_Wide_String;
Set : Wide_Maps.Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
------------------------------------
-- String Translation Subprograms --
------------------------------------
function Translate
(Source : Unbounded_Wide_String;
Mapping : Wide_Maps.Wide_Character_Mapping)
return Unbounded_Wide_String;
procedure Translate
(Source : in out Unbounded_Wide_String;
Mapping : Wide_Maps.Wide_Character_Mapping);
function Translate
(Source : Unbounded_Wide_String;
Mapping : Wide_Maps.Wide_Character_Mapping_Function)
return Unbounded_Wide_String;
procedure Translate
(Source : in out Unbounded_Wide_String;
Mapping : Wide_Maps.Wide_Character_Mapping_Function);
---------------------------------------
-- String Transformation Subprograms --
---------------------------------------
function Replace_Slice
(Source : Unbounded_Wide_String;
Low : Positive;
High : Natural;
By : Wide_String) return Unbounded_Wide_String;
procedure Replace_Slice
(Source : in out Unbounded_Wide_String;
Low : Positive;
High : Natural;
By : Wide_String);
function Insert
(Source : Unbounded_Wide_String;
Before : Positive;
New_Item : Wide_String) return Unbounded_Wide_String;
procedure Insert
(Source : in out Unbounded_Wide_String;
Before : Positive;
New_Item : Wide_String);
function Overwrite
(Source : Unbounded_Wide_String;
Position : Positive;
New_Item : Wide_String) return Unbounded_Wide_String;
procedure Overwrite
(Source : in out Unbounded_Wide_String;
Position : Positive;
New_Item : Wide_String);
function Delete
(Source : Unbounded_Wide_String;
From : Positive;
Through : Natural) return Unbounded_Wide_String;
procedure Delete
(Source : in out Unbounded_Wide_String;
From : Positive;
Through : Natural);
function Trim
(Source : Unbounded_Wide_String;
Side : Trim_End) return Unbounded_Wide_String;
procedure Trim
(Source : in out Unbounded_Wide_String;
Side : Trim_End);
function Trim
(Source : Unbounded_Wide_String;
Left : Wide_Maps.Wide_Character_Set;
Right : Wide_Maps.Wide_Character_Set) return Unbounded_Wide_String;
procedure Trim
(Source : in out Unbounded_Wide_String;
Left : Wide_Maps.Wide_Character_Set;
Right : Wide_Maps.Wide_Character_Set);
function Head
(Source : Unbounded_Wide_String;
Count : Natural;
Pad : Wide_Character := Wide_Space) return Unbounded_Wide_String;
procedure Head
(Source : in out Unbounded_Wide_String;
Count : Natural;
Pad : Wide_Character := Wide_Space);
function Tail
(Source : Unbounded_Wide_String;
Count : Natural;
Pad : Wide_Character := Wide_Space) return Unbounded_Wide_String;
procedure Tail
(Source : in out Unbounded_Wide_String;
Count : Natural;
Pad : Wide_Character := Wide_Space);
function "*"
(Left : Natural;
Right : Wide_Character) return Unbounded_Wide_String;
function "*"
(Left : Natural;
Right : Wide_String) return Unbounded_Wide_String;
function "*"
(Left : Natural;
Right : Unbounded_Wide_String) return Unbounded_Wide_String;
private
pragma Inline (Length);
package AF renames Ada.Finalization;
Null_Wide_String : aliased Wide_String := "";
function To_Unbounded_Wide (S : Wide_String) return Unbounded_Wide_String
renames To_Unbounded_Wide_String;
type Unbounded_Wide_String is new AF.Controlled with record
Reference : Wide_String_Access := Null_Wide_String'Access;
Last : Natural := 0;
end record;
-- The Unbounded_Wide_String is using a buffered implementation to increase
-- speed of the Append/Delete/Insert procedures. The Reference string
-- pointer above contains the current string value and extra room at the
-- end to be used by the next Append routine. Last is the index of the
-- string ending character. So the current string value is really
-- Reference (1 .. Last).
pragma Stream_Convert
(Unbounded_Wide_String, To_Unbounded_Wide, To_Wide_String);
pragma Finalize_Storage_Only (Unbounded_Wide_String);
-- Finalization is required only for freeing storage
procedure Initialize (Object : in out Unbounded_Wide_String);
procedure Adjust (Object : in out Unbounded_Wide_String);
procedure Finalize (Object : in out Unbounded_Wide_String);
procedure Realloc_For_Chunk
(Source : in out Unbounded_Wide_String;
Chunk_Size : Natural);
-- Adjust the size allocated for the string. Add at least Chunk_Size so it
-- is safe to add a string of this size at the end of the current content.
-- The real size allocated for the string is Chunk_Size + x of the current
-- string size. This buffered handling makes the Append unbounded string
-- routines very fast.
Null_Unbounded_Wide_String : constant Unbounded_Wide_String :=
(AF.Controlled with
Reference => Null_Wide_String'Access,
Last => 0);
-- Note: this declaration is illegal since library level controlled
-- objects are not allowed in preelaborated units. See AI-161 for a
-- discussion of this issue and an attempt to address it. Meanwhile,
-- what happens in GNAT is that this check is omitted for internal
-- implementation units (see check in sem_cat.adb).
end Ada.Strings.Wide_Unbounded;
| 34.133484 | 79 | 0.619805 |
dc1051005a5910fa8371db9efe5603666c0b54b3 | 3,522 | ads | Ada | tests/src/usb_testing-output.ads | Fabien-Chouteau/usb_embedded | 1adf5e9d74d6408ae355dd7cf0311a3529f8a260 | [
"BSD-3-Clause"
] | 14 | 2021-04-22T14:56:07.000Z | 2022-03-07T15:32:09.000Z | tests/src/usb_testing-output.ads | Fabien-Chouteau/usb_embedded | 1adf5e9d74d6408ae355dd7cf0311a3529f8a260 | [
"BSD-3-Clause"
] | 2 | 2021-09-24T21:33:55.000Z | 2021-11-19T13:46:58.000Z | tests/src/usb_testing-output.ads | Fabien-Chouteau/usb_embedded | 1adf5e9d74d6408ae355dd7cf0311a3529f8a260 | [
"BSD-3-Clause"
] | 3 | 2021-09-24T20:53:31.000Z | 2022-03-04T17:37:01.000Z | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2021, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with HAL;
with AAA.Strings;
private with Ada.Strings.Unbounded;
package USB_Testing.Output is
type Text_Output is tagged private;
type Text_Output_Acc is access all Text_Output;
procedure New_Line (This : in out Text_Output);
procedure Put (This : in out Text_Output;
Str : String);
procedure Put_Line (This : in out Text_Output;
Str : String);
procedure Hex_Dump (This : in out Text_Output;
Data : HAL.UInt8_Array;
Base_Addr : HAL.UInt64 := 0);
function Dump (This : Text_Output) return AAA.Strings.Vector;
function Equal (Expected, Actual : AAA.Strings.Vector) return Boolean;
function Diff (A, B : AAA.Strings.Vector;
A_Name : String := "A";
B_Name : String := "B";
Skip_Header : Boolean := False)
return AAA.Strings.Vector;
private
type Text_Output is tagged record
Current_Line : Ada.Strings.Unbounded.Unbounded_String;
Vect : AAA.Strings.Vector;
end record;
end USB_Testing.Output;
| 48.916667 | 78 | 0.532368 |
dce4f1e369334b4054d0ae214176ac1a48e3d4d2 | 10,265 | ads | Ada | Validation/pyFrame3DD-master/gcc-master/gcc/ada/style.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/style.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/style.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S T Y L E --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- This package collects all the routines used for style checking in the
-- compiler, as activated by the relevant command line option. These are
-- gathered in a separate package so that they can more easily be customized.
-- Calls to these subprograms are only made if Opt.Style_Check is set True.
with Errout;
with Styleg;
with Types; use Types;
package Style is
procedure Body_With_No_Spec (N : Node_Id);
-- Called where N is a subprogram body node for a subprogram body
-- for which no spec was given, i.e. a body acting as its own spec.
procedure Check_Array_Attribute_Index
(N : Node_Id;
E1 : Node_Id;
D : Int);
-- Called for an array attribute specifying an index number. N is the
-- node for the attribute, and E1 is the index expression (Empty if none
-- present). If E1 is present, it is known to be a static integer. D is
-- the number of dimensions of the array.
procedure Check_Identifier
(Ref : Node_Or_Entity_Id;
Def : Node_Or_Entity_Id);
-- Check style of identifier occurrence. Ref is an N_Identifier node whose
-- spelling is to be checked against the Chars spelling in identifier node
-- Def (which may be either an N_Identifier, or N_Defining_Identifier node)
procedure Missing_Overriding (N : Node_Id; E : Entity_Id);
-- Called where N is the declaration or body of an overriding operation,
-- and the node does not have an overriding_indicator.
procedure Subprogram_Not_In_Alpha_Order (Name : Node_Id);
-- Called if Name is the name of a subprogram body in a package body
-- that is not in alphabetical order.
-- Remaining style routines come from instantiation of Styleg
package Style_Inst is new Styleg
(Errout.Error_Msg,
Errout.Error_Msg_S,
Errout.Error_Msg_SC,
Errout.Error_Msg_SP);
-- Instantiation of Styleg for compiler use
procedure Check_Abs_Not
renames Style_Inst.Check_Abs_Not;
-- Called after scanning an ABS or NOT operator to check spacing
procedure Check_Apostrophe
renames Style_Inst.Check_Apostrophe;
-- Called after scanning an apostrophe to check spacing
procedure Check_Arrow (Inside_Depends : Boolean := False)
renames Style_Inst.Check_Arrow;
-- Called after scanning out an arrow to check spacing
procedure Check_Attribute_Name (Reserved : Boolean)
renames Style_Inst.Check_Attribute_Name;
-- The current token is an attribute designator. Check that it is
-- capitalized in an appropriate manner. Reserved is set if the attribute
-- designator is a reserved word (access, digits, delta or range) to allow
-- differing rules for the two cases.
procedure Check_Boolean_Operator (Node : Node_Id)
renames Style_Inst.Check_Boolean_Operator;
-- Called after resolving AND or OR node to check short circuit rules
procedure Check_Box
renames Style_Inst.Check_Box;
-- Called after scanning out a box to check spacing
procedure Check_Binary_Operator
renames Style_Inst.Check_Binary_Operator;
-- Called after scanning out a binary operator other than a plus, minus
-- or exponentiation operator. Intended for checking spacing rules.
procedure Check_Exponentiation_Operator
renames Style_Inst.Check_Exponentiation_Operator;
-- Called after scanning out an exponentiation operator. Intended for
-- checking spacing rules.
procedure Check_Colon
renames Style_Inst.Check_Colon;
-- Called after scanning out colon to check spacing
procedure Check_Colon_Equal
renames Style_Inst.Check_Colon_Equal;
-- Called after scanning out colon equal to check spacing
procedure Check_Comma
renames Style_Inst.Check_Comma;
-- Called after scanning out comma to check spacing
procedure Check_Comment
renames Style_Inst.Check_Comment;
-- Called with Scan_Ptr pointing to the first minus sign of a comment.
-- Intended for checking any specific rules for comment placement/format.
procedure Check_Defining_Identifier_Casing
renames Style_Inst.Check_Defining_Identifier_Casing;
procedure Check_Dot_Dot
renames Style_Inst.Check_Dot_Dot;
-- Called after scanning out dot dot to check spacing
procedure Check_EOF
renames Style_Inst.Check_EOF;
-- Called after scanning out end of file mark
procedure Check_HT
renames Style_Inst.Check_HT;
-- Called with Scan_Ptr pointing to a horizontal tab character
procedure Check_Indentation
renames Style_Inst.Check_Indentation;
-- Called at the start of a new statement or declaration, with Token_Ptr
-- pointing to the first token of the statement or declaration. The check
-- is that the starting column is appropriate to the indentation rules if
-- Token_Ptr is the first token on the line.
procedure Check_Left_Paren
renames Style_Inst.Check_Left_Paren;
-- Called after scanning out a left parenthesis to check spacing
procedure Check_Line_Terminator (Len : Int)
renames Style_Inst.Check_Line_Terminator;
-- Called with Scan_Ptr pointing to the first line terminator terminating
-- the current line, used to check for appropriate line terminator and to
-- check the line length (Len is the length of the current line). Note that
-- the terminator may be the EOF character.
procedure Check_Not_In
renames Style_Inst.Check_Not_In;
-- Called with Scan_Ptr pointing to an IN token, and Prev_Token_Ptr
-- pointing to a NOT token. Used to check proper layout of NOT IN.
procedure Check_Pragma_Name
renames Style_Inst.Check_Pragma_Name;
-- The current token is a pragma identifier. Check that it is spelled
-- properly (i.e. with an appropriate casing convention).
procedure Check_Right_Paren
renames Style_Inst.Check_Right_Paren;
-- Called after scanning out a right parenthesis to check spacing
procedure Check_Semicolon
renames Style_Inst.Check_Semicolon;
-- Called after scanning out a semicolon to check spacing
procedure Check_Then (If_Loc : Source_Ptr)
renames Style_Inst.Check_Then;
-- Called to check that THEN and IF keywords are appropriately positioned.
-- The parameters show the first characters of the two keywords. This
-- procedure is called only if THEN appears at the start of a line with
-- Token_Ptr pointing to the THEN keyword.
procedure Check_Unary_Plus_Or_Minus (Inside_Depends : Boolean := False)
renames Style_Inst.Check_Unary_Plus_Or_Minus;
-- Called after scanning a unary plus or minus to check spacing
procedure Check_Vertical_Bar
renames Style_Inst.Check_Vertical_Bar;
-- Called after scanning a vertical bar to check spacing
procedure Check_Xtra_Parens (Loc : Source_Ptr)
renames Style_Inst.Check_Xtra_Parens;
-- Called after scanning an if, case or quantified expression that has at
-- least one level of parentheses around the entire expression.
function Mode_In_Check return Boolean
renames Style_Inst.Mode_In_Check;
-- Determines whether style checking is active and the Mode_In_Check is
-- set, forbidding the explicit use of mode IN.
procedure No_End_Name (Name : Node_Id)
renames Style_Inst.No_End_Name;
-- Called if an END is encountered where a name is allowed but not present.
-- The parameter is the node whose name is the name that is permitted in
-- the END line, and the scan pointer is positioned so that if an error
-- message is to be generated in this situation, it should be generated
-- using Error_Msg_SP.
procedure No_Exit_Name (Name : Node_Id)
renames Style_Inst.No_Exit_Name;
-- Called when exiting a named loop, but a name is not present on the EXIT.
-- The parameter is the node whose name should have followed EXIT, and the
-- scan pointer is positioned so that if an error message is to be
-- generated, it should be generated using Error_Msg_SP.
procedure Non_Lower_Case_Keyword
renames Style_Inst.Non_Lower_Case_Keyword;
-- Called if a reserved keyword is scanned which is not spelled in all
-- lower case letters. On entry Token_Ptr points to the keyword token.
-- This is not used for keywords appearing as attribute designators,
-- where instead Check_Attribute_Name (True) is called.
end Style;
| 45.220264 | 79 | 0.674817 |
d08dd8ea499e83c939a489f1c3e2c8cab7d7089d | 8,757 | ads | Ada | src/Projects/eu_projects-nodes-partners.ads | fintatarta/eugen | 2c384838ff0e81b51172310ce5d0e47d71ffd4fd | [
"MIT"
] | null | null | null | src/Projects/eu_projects-nodes-partners.ads | fintatarta/eugen | 2c384838ff0e81b51172310ce5d0e47d71ffd4fd | [
"MIT"
] | null | null | null | src/Projects/eu_projects-nodes-partners.ads | fintatarta/eugen | 2c384838ff0e81b51172310ce5d0e47d71ffd4fd | [
"MIT"
] | null | null | null | with Ada.Containers.Vectors;
with Ada.Iterator_Interfaces;
with EU_Projects.Node_Tables;
--
-- A partner descriptor keeps some basic information about the
-- partner such as
--
-- * The name (a short version, too)
-- * A label
-- * An index
--
-- Moreover, every partner has
--
-- * One or more roles (name, description and PM cost)
-- * One or more expenses
--
-- Expenses can be divisible or undivisible. Divisible expenses are related
-- to a collections of goods/services where one pays a price per unit.
-- For example, the expense for buying one or more cards is divisible.
-- An example of undivisible expense is the expense for a single service.
-- Honestly, the distintion is quite fuzzy (it is an undivisible expense or
-- it is a divisble one with just one object?), but in some context it
-- could be handy to be able to do this distinction.
--
-- It is possible to iterate over all the roles and all the expenses using
-- All_Expenses and All_Roles.
--
package EU_Projects.Nodes.Partners is
type Partner (<>) is new Nodes.Node_Type with private;
type Partner_Access is access all Partner;
subtype Partner_Index is Node_Index;
No_Partner : constant Extended_Node_Index := No_Index;
type Partner_Label is new Node_Label;
type Partner_Name_Array is array (Partner_Index range <>) of Partner_Label;
type Role_Name is new Dotted_Identifier;
subtype Country_Code is String (1 .. 2)
with Dynamic_Predicate => (for all C of Country_Code => C in 'A' .. 'Z');
function Create (ID : Partner_Label;
Name : String;
Short_Name : String;
Country : Country_Code;
Node_Dir : in out Node_Tables.Node_Table)
return Partner_Access;
procedure Set_Index (Item : in out Partner;
Idx : Partner_Index);
function Country (Item : Partner) return Country_Code;
function Dependency_List (Item : partner)
return Node_Label_Lists.Vector
is (Node_Label_Lists.Empty_Vector);
overriding function Full_Index (Item : Partner;
Prefixed : Boolean) return String;
procedure Add_Role (To : in out Partner;
Role : in Role_Name;
Description : in String;
Monthly_Cost : in Currency);
procedure Add_Undivisible_Expense (To : in out Partner;
Description : in String;
Cost : in Currency);
procedure Add_Divisible_Expense (To : in out Partner;
Description : in String;
Unit_Cost : in Currency;
Amount : in Natural);
type Cursor is private;
function Has_Element (X : Cursor) return Boolean;
package Expense_Iterator_Interfaces is
new Ada.Iterator_Interfaces (Cursor => Cursor,
Has_Element => Has_Element);
function All_Expenses
(Item : Partner)
return Expense_Iterator_Interfaces.Forward_Iterator'Class;
function Is_Divisible (Pos : Cursor) return Boolean;
function Unit_Cost (Pos : Cursor) return Currency
with
Pre => Is_Divisible (Pos);
function Amount (Pos : Cursor) return Natural
with
Pre => Is_Divisible (Pos);
function Total_Cost (Pos : Cursor) return Currency;
function Description (Pos : Cursor) return String;
type Role_Cursor is private;
function Has_Element (X : Role_Cursor) return Boolean;
package Role_Iterator_Interfaces is
new Ada.Iterator_Interfaces (Cursor => Role_Cursor,
Has_Element => Has_Element);
function All_Roles
(Item : Partner)
return Role_Iterator_Interfaces.Forward_Iterator'Class;
function Cost (Pos : Role_Cursor) return Currency;
function Description (Pos : Role_Cursor) return String;
function Name (Pos : Role_Cursor) return String;
pragma Warnings (Off);
overriding function Get_Symbolic_Instant
(X : Partner;
Var : Simple_Identifier)
return Times.Time_Expressions.Symbolic_Instant
is (raise Unknown_Instant_Var);
overriding function Get_Symbolic_Duration
(X : Partner;
Var : Simple_Identifier)
return Times.Time_Expressions.Symbolic_Duration
is (raise Unknown_Duration_Var);
pragma Warnings (On);
private
type Personnel_Cost is
record
Role : Role_Name;
Monthly_Cost : Currency;
Description : Unbounded_String;
end record;
type Expense (Divisible : Boolean := False) is
record
Description : Unbounded_String;
case Divisible is
when True =>
Unit_Cost : Currency;
Amount : Natural;
when False =>
Cost : Currency;
end case;
end record;
package Personnel_Cost_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Personnel_Cost);
package Other_Cost_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Expense);
type Partner is new Nodes.Node_Type
with
record
Personnel_Costs : Personnel_Cost_Vectors.Vector;
Other_Costs : Other_Cost_Vectors.Vector;
Country : Country_Code;
end record;
function Country (Item : Partner) return Country_Code
is (Item.Country);
type Cursor is
record
Pos : Other_Cost_Vectors.Cursor;
end record;
type Role_Cursor is
record
Pos : Personnel_Cost_Vectors.Cursor;
end record;
type Expense_Iterator is
new Expense_Iterator_Interfaces.Forward_Iterator
with
record
Start : Other_Cost_Vectors.Cursor;
end record;
overriding
function Full_Index (Item : Partner;
Prefixed : Boolean) return String
is (Image (Item.Index));
overriding
function First (Object : Expense_Iterator) return Cursor
is (Cursor'(Pos => Object.Start));
overriding
function Next
(Object : Expense_Iterator;
Position : Cursor) return Cursor
is (Cursor'(Pos => Other_Cost_Vectors.Next (Position.Pos)));
function All_Expenses
(Item : Partner)
return Expense_Iterator_Interfaces.Forward_Iterator'Class
is (Expense_Iterator'(Expense_Iterator_Interfaces.Forward_Iterator
with
Start => Item.Other_Costs.First));
function Has_Element (X : Cursor) return Boolean
is (Other_Cost_Vectors.Has_Element (X.Pos));
function Is_Divisible (Pos : Cursor) return Boolean
is (Other_Cost_Vectors.Element (Pos.Pos).Divisible);
function Unit_Cost (Pos : Cursor) return Currency
is (Other_Cost_Vectors.Element (Pos.Pos).Unit_Cost);
function Total_Cost (Pos : Cursor) return Currency
is (
if Is_Divisible (Pos)
then
Unit_Cost (Pos) * Amount (Pos)
else
Other_Cost_Vectors.Element (Pos.Pos).Cost
);
function Amount (Pos : Cursor) return Natural
is (Other_Cost_Vectors.Element (Pos.Pos).Amount);
function Description (Pos : Cursor) return String
is (To_String (Other_Cost_Vectors.Element (Pos.Pos).Description));
type Role_Iterator is
new Role_Iterator_Interfaces.Forward_Iterator
with
record
Start : Personnel_Cost_Vectors.Cursor;
end record;
function First (Object : Role_Iterator) return Role_Cursor
is (Role_Cursor'(Pos => Object.Start));
overriding
function Next
(Object : Role_Iterator;
Position : Role_Cursor) return Role_Cursor
is (Role_Cursor'(Pos => Personnel_Cost_Vectors.Next (Position.Pos)));
function Has_Element (X : Role_Cursor) return Boolean
is (Personnel_Cost_Vectors.Has_Element (X.Pos));
function All_Roles
(Item : Partner)
return Role_Iterator_Interfaces.Forward_Iterator'Class
is (Role_Iterator'(Role_Iterator_Interfaces.Forward_Iterator
with
Start => Item.Personnel_Costs.First));
function Cost (Pos : Role_Cursor) return Currency
is (Personnel_Cost_Vectors.Element (Pos.Pos).Monthly_Cost);
function Description (Pos : Role_Cursor) return String
is (To_String (Personnel_Cost_Vectors.Element (Pos.Pos).Description));
function Name (Pos : Role_Cursor) return String
is (Image (Personnel_Cost_Vectors.Element (Pos.Pos).Role));
end EU_Projects.Nodes.Partners;
| 30.512195 | 82 | 0.643599 |
d02636ddbd2c75779575644f7ea0581f9a3c644a | 2,059 | ads | Ada | source/regions/regions-contexts-environments-nodes.ads | reznikmm/declarative-regions | 2e2072aaf5163b49891b24873d179ea61249dd70 | [
"MIT"
] | null | null | null | source/regions/regions-contexts-environments-nodes.ads | reznikmm/declarative-regions | 2e2072aaf5163b49891b24873d179ea61249dd70 | [
"MIT"
] | null | null | null | source/regions/regions-contexts-environments-nodes.ads | reznikmm/declarative-regions | 2e2072aaf5163b49891b24873d179ea61249dd70 | [
"MIT"
] | null | null | null | -- SPDX-FileCopyrightText: 2022 Max Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Ada.Containers.Hashed_Maps;
with Ada.Unchecked_Deallocation;
with Regions.Entities;
with Regions.Shared_Hashed_Maps;
private
package Regions.Contexts.Environments.Nodes is
pragma Preelaborate;
type Entity_Node is tagged limited null record;
type Entity_Node_Access is access all Entity_Node'Class;
function Hash (List : Selected_Entity_Name) return Ada.Containers.Hash_Type
is (Ada.Containers.Hash_Type'Mod (List));
procedure Free is new Ada.Unchecked_Deallocation
(Entity_Node'Class, Entity_Node_Access);
package Node_Maps is new Regions.Shared_Hashed_Maps
(Selected_Entity_Name,
Entity_Node_Access,
Ada.Containers.Hash_Type,
Regions.Contexts.Change_Count,
Hash,
"=",
"=",
Free);
package Entity_Maps is new Ada.Containers.Hashed_Maps
(Selected_Entity_Name,
Regions.Entities.Entity_Access,
Hash,
"=",
Regions.Entities."=");
type Environment_Node;
function Empty_Map (Self : access Environment_Node) return Node_Maps.Map;
type Environment_Node (Context : access Regions.Contexts.Context) is
tagged limited
record
Counter : Natural := 1;
Nodes : Node_Maps.Map := Empty_Map (Environment_Node'Unchecked_Access);
Cache : Entity_Maps.Map;
Nested : Selected_Entity_Name_Lists.List;
end record;
function Get_Entity
(Self : in out Environment_Node'Class;
Name : Selected_Entity_Name) return Regions.Entities.Entity_Access;
procedure Reference (Self : in out Environment_Node'Class);
procedure Unreference
(Self : in out Environment_Node'Class;
Last : out Boolean);
type Base_Entity (Env : not null Environment_Node_Access) is
abstract limited new Regions.Entities.Entity with
record
Name : Selected_Entity_Name;
end record;
end Regions.Contexts.Environments.Nodes;
| 28.597222 | 79 | 0.699369 |
c5cc4965ed46ed5723fad32065e0f028b6a93e92 | 419,256 | adb | Ada | Validation/pyFrame3DD-master/gcc-master/gcc/ada/exp_ch3.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/exp_ch3.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/exp_ch3.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E X P _ C H 3 --
-- --
-- B o d y --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
with Aspects; use Aspects;
with Atree; use Atree;
with Checks; use Checks;
with Einfo; use Einfo;
with Errout; use Errout;
with Exp_Aggr; use Exp_Aggr;
with Exp_Atag; use Exp_Atag;
with Exp_Ch4; use Exp_Ch4;
with Exp_Ch6; use Exp_Ch6;
with Exp_Ch7; use Exp_Ch7;
with Exp_Ch9; use Exp_Ch9;
with Exp_Dbug; use Exp_Dbug;
with Exp_Disp; use Exp_Disp;
with Exp_Dist; use Exp_Dist;
with Exp_Put_Image;
with Exp_Smem; use Exp_Smem;
with Exp_Strm; use Exp_Strm;
with Exp_Tss; use Exp_Tss;
with Exp_Util; use Exp_Util;
with Freeze; use Freeze;
with Ghost; use Ghost;
with Lib; use Lib;
with Namet; use Namet;
with Nlists; use Nlists;
with Nmake; use Nmake;
with Opt; use Opt;
with Restrict; use Restrict;
with Rident; use Rident;
with Rtsfind; use Rtsfind;
with Sem; use Sem;
with Sem_Aux; use Sem_Aux;
with Sem_Attr; use Sem_Attr;
with Sem_Cat; use Sem_Cat;
with Sem_Ch3; use Sem_Ch3;
with Sem_Ch6; use Sem_Ch6;
with Sem_Ch8; use Sem_Ch8;
with Sem_Disp; use Sem_Disp;
with Sem_Eval; use Sem_Eval;
with Sem_Mech; use Sem_Mech;
with Sem_Res; use Sem_Res;
with Sem_SCIL; use Sem_SCIL;
with Sem_Type; use Sem_Type;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Stand; use Stand;
with Snames; use Snames;
with Tbuild; use Tbuild;
with Ttypes; use Ttypes;
with Validsw; use Validsw;
package body Exp_Ch3 is
-----------------------
-- Local Subprograms --
-----------------------
procedure Adjust_Discriminants (Rtype : Entity_Id);
-- This is used when freezing a record type. It attempts to construct
-- more restrictive subtypes for discriminants so that the max size of
-- the record can be calculated more accurately. See the body of this
-- procedure for details.
procedure Build_Array_Init_Proc (A_Type : Entity_Id; Nod : Node_Id);
-- Build initialization procedure for given array type. Nod is a node
-- used for attachment of any actions required in its construction.
-- It also supplies the source location used for the procedure.
function Build_Discriminant_Formals
(Rec_Id : Entity_Id;
Use_Dl : Boolean) return List_Id;
-- This function uses the discriminants of a type to build a list of
-- formal parameters, used in Build_Init_Procedure among other places.
-- If the flag Use_Dl is set, the list is built using the already
-- defined discriminals of the type, as is the case for concurrent
-- types with discriminants. Otherwise new identifiers are created,
-- with the source names of the discriminants.
function Build_Equivalent_Array_Aggregate (T : Entity_Id) return Node_Id;
-- This function builds a static aggregate that can serve as the initial
-- value for an array type whose bounds are static, and whose component
-- type is a composite type that has a static equivalent aggregate.
-- The equivalent array aggregate is used both for object initialization
-- and for component initialization, when used in the following function.
function Build_Equivalent_Record_Aggregate (T : Entity_Id) return Node_Id;
-- This function builds a static aggregate that can serve as the initial
-- value for a record type whose components are scalar and initialized
-- with compile-time values, or arrays with similar initialization or
-- defaults. When possible, initialization of an object of the type can
-- be achieved by using a copy of the aggregate as an initial value, thus
-- removing the implicit call that would otherwise constitute elaboration
-- code.
procedure Build_Record_Init_Proc (N : Node_Id; Rec_Ent : Entity_Id);
-- Build record initialization procedure. N is the type declaration
-- node, and Rec_Ent is the corresponding entity for the record type.
procedure Build_Slice_Assignment (Typ : Entity_Id);
-- Build assignment procedure for one-dimensional arrays of controlled
-- types. Other array and slice assignments are expanded in-line, but
-- the code expansion for controlled components (when control actions
-- are active) can lead to very large blocks that GCC3 handles poorly.
procedure Build_Untagged_Equality (Typ : Entity_Id);
-- AI05-0123: Equality on untagged records composes. This procedure
-- builds the equality routine for an untagged record that has components
-- of a record type that has user-defined primitive equality operations.
-- The resulting operation is a TSS subprogram.
procedure Check_Stream_Attributes (Typ : Entity_Id);
-- Check that if a limited extension has a parent with user-defined stream
-- attributes, and does not itself have user-defined stream-attributes,
-- then any limited component of the extension also has the corresponding
-- user-defined stream attributes.
procedure Clean_Task_Names
(Typ : Entity_Id;
Proc_Id : Entity_Id);
-- If an initialization procedure includes calls to generate names
-- for task subcomponents, indicate that secondary stack cleanup is
-- needed after an initialization. Typ is the component type, and Proc_Id
-- the initialization procedure for the enclosing composite type.
procedure Expand_Freeze_Array_Type (N : Node_Id);
-- Freeze an array type. Deals with building the initialization procedure,
-- creating the packed array type for a packed array and also with the
-- creation of the controlling procedures for the controlled case. The
-- argument N is the N_Freeze_Entity node for the type.
procedure Expand_Freeze_Class_Wide_Type (N : Node_Id);
-- Freeze a class-wide type. Build routine Finalize_Address for the purpose
-- of finalizing controlled derivations from the class-wide's root type.
procedure Expand_Freeze_Enumeration_Type (N : Node_Id);
-- Freeze enumeration type with non-standard representation. Builds the
-- array and function needed to convert between enumeration pos and
-- enumeration representation values. N is the N_Freeze_Entity node
-- for the type.
procedure Expand_Freeze_Record_Type (N : Node_Id);
-- Freeze record type. Builds all necessary discriminant checking
-- and other ancillary functions, and builds dispatch tables where
-- needed. The argument N is the N_Freeze_Entity node. This processing
-- applies only to E_Record_Type entities, not to class wide types,
-- record subtypes, or private types.
procedure Expand_Tagged_Root (T : Entity_Id);
-- Add a field _Tag at the beginning of the record. This field carries
-- the value of the access to the Dispatch table. This procedure is only
-- called on root type, the _Tag field being inherited by the descendants.
procedure Freeze_Stream_Operations (N : Node_Id; Typ : Entity_Id);
-- Treat user-defined stream operations as renaming_as_body if the
-- subprogram they rename is not frozen when the type is frozen.
procedure Initialization_Warning (E : Entity_Id);
-- If static elaboration of the package is requested, indicate
-- when a type does meet the conditions for static initialization. If
-- E is a type, it has components that have no static initialization.
-- if E is an entity, its initial expression is not compile-time known.
function Init_Formals (Typ : Entity_Id; Proc_Id : Entity_Id) return List_Id;
-- This function builds the list of formals for an initialization routine.
-- The first formal is always _Init with the given type. For task value
-- record types and types containing tasks, three additional formals are
-- added and Proc_Id is decorated with attribute Has_Master_Entity:
--
-- _Master : Master_Id
-- _Chain : in out Activation_Chain
-- _Task_Name : String
--
-- The caller must append additional entries for discriminants if required.
function Inline_Init_Proc (Typ : Entity_Id) return Boolean;
-- Returns true if the initialization procedure of Typ should be inlined
function In_Runtime (E : Entity_Id) return Boolean;
-- Check if E is defined in the RTL (in a child of Ada or System). Used
-- to avoid to bring in the overhead of _Input, _Output for tagged types.
function Is_Null_Statement_List (Stmts : List_Id) return Boolean;
-- Returns true if Stmts is made of null statements only, possibly wrapped
-- in a case statement, recursively. This latter pattern may occur for the
-- initialization procedure of an unchecked union.
function Is_User_Defined_Equality (Prim : Node_Id) return Boolean;
-- Returns true if Prim is a user defined equality function
function Make_Eq_Body
(Typ : Entity_Id;
Eq_Name : Name_Id) return Node_Id;
-- Build the body of a primitive equality operation for a tagged record
-- type, or in Ada 2012 for any record type that has components with a
-- user-defined equality. Factored out of Predefined_Primitive_Bodies.
function Make_Eq_Case
(E : Entity_Id;
CL : Node_Id;
Discrs : Elist_Id := New_Elmt_List) return List_Id;
-- Building block for variant record equality. Defined to share the code
-- between the tagged and untagged case. Given a Component_List node CL,
-- it generates an 'if' followed by a 'case' statement that compares all
-- components of local temporaries named X and Y (that are declared as
-- formals at some upper level). E provides the Sloc to be used for the
-- generated code.
--
-- IF E is an unchecked_union, Discrs is the list of formals created for
-- the inferred discriminants of one operand. These formals are used in
-- the generated case statements for each variant of the unchecked union.
function Make_Eq_If
(E : Entity_Id;
L : List_Id) return Node_Id;
-- Building block for variant record equality. Defined to share the code
-- between the tagged and untagged case. Given the list of components
-- (or discriminants) L, it generates a return statement that compares all
-- components of local temporaries named X and Y (that are declared as
-- formals at some upper level). E provides the Sloc to be used for the
-- generated code.
function Make_Neq_Body (Tag_Typ : Entity_Id) return Node_Id;
-- Search for a renaming of the inequality dispatching primitive of
-- this tagged type. If found then build and return the corresponding
-- rename-as-body inequality subprogram; otherwise return Empty.
procedure Make_Predefined_Primitive_Specs
(Tag_Typ : Entity_Id;
Predef_List : out List_Id;
Renamed_Eq : out Entity_Id);
-- Create a list with the specs of the predefined primitive operations.
-- For tagged types that are interfaces all these primitives are defined
-- abstract.
--
-- The following entries are present for all tagged types, and provide
-- the results of the corresponding attribute applied to the object.
-- Dispatching is required in general, since the result of the attribute
-- will vary with the actual object subtype.
--
-- _size provides result of 'Size attribute
-- typSR provides result of 'Read attribute
-- typSW provides result of 'Write attribute
-- typSI provides result of 'Input attribute
-- typSO provides result of 'Output attribute
-- typPI provides result of 'Put_Image attribute
--
-- The following entries are additionally present for non-limited tagged
-- types, and implement additional dispatching operations for predefined
-- operations:
--
-- _equality implements "=" operator
-- _assign implements assignment operation
-- typDF implements deep finalization
-- typDA implements deep adjust
--
-- The latter two are empty procedures unless the type contains some
-- controlled components that require finalization actions (the deep
-- in the name refers to the fact that the action applies to components).
--
-- The list is returned in Predef_List. The Parameter Renamed_Eq either
-- returns the value Empty, or else the defining unit name for the
-- predefined equality function in the case where the type has a primitive
-- operation that is a renaming of predefined equality (but only if there
-- is also an overriding user-defined equality function). The returned
-- Renamed_Eq will be passed to the corresponding parameter of
-- Predefined_Primitive_Bodies.
function Has_New_Non_Standard_Rep (T : Entity_Id) return Boolean;
-- Returns True if there are representation clauses for type T that are not
-- inherited. If the result is false, the init_proc and the discriminant
-- checking functions of the parent can be reused by a derived type.
procedure Make_Controlling_Function_Wrappers
(Tag_Typ : Entity_Id;
Decl_List : out List_Id;
Body_List : out List_Id);
-- Ada 2005 (AI-391): Makes specs and bodies for the wrapper functions
-- associated with inherited functions with controlling results which
-- are not overridden. The body of each wrapper function consists solely
-- of a return statement whose expression is an extension aggregate
-- invoking the inherited subprogram's parent subprogram and extended
-- with a null association list.
function Make_Null_Procedure_Specs (Tag_Typ : Entity_Id) return List_Id;
-- Ada 2005 (AI-251): Makes specs for null procedures associated with any
-- null procedures inherited from an interface type that have not been
-- overridden. Only one null procedure will be created for a given set of
-- inherited null procedures with homographic profiles.
function Predef_Spec_Or_Body
(Loc : Source_Ptr;
Tag_Typ : Entity_Id;
Name : Name_Id;
Profile : List_Id;
Ret_Type : Entity_Id := Empty;
For_Body : Boolean := False) return Node_Id;
-- This function generates the appropriate expansion for a predefined
-- primitive operation specified by its name, parameter profile and
-- return type (Empty means this is a procedure). If For_Body is false,
-- then the returned node is a subprogram declaration. If For_Body is
-- true, then the returned node is a empty subprogram body containing
-- no declarations and no statements.
function Predef_Stream_Attr_Spec
(Loc : Source_Ptr;
Tag_Typ : Entity_Id;
Name : TSS_Name_Type;
For_Body : Boolean := False) return Node_Id;
-- Specialized version of Predef_Spec_Or_Body that apply to read, write,
-- input and output attribute whose specs are constructed in Exp_Strm.
function Predef_Deep_Spec
(Loc : Source_Ptr;
Tag_Typ : Entity_Id;
Name : TSS_Name_Type;
For_Body : Boolean := False) return Node_Id;
-- Specialized version of Predef_Spec_Or_Body that apply to _deep_adjust
-- and _deep_finalize
function Predefined_Primitive_Bodies
(Tag_Typ : Entity_Id;
Renamed_Eq : Entity_Id) return List_Id;
-- Create the bodies of the predefined primitives that are described in
-- Predefined_Primitive_Specs. When not empty, Renamed_Eq must denote
-- the defining unit name of the type's predefined equality as returned
-- by Make_Predefined_Primitive_Specs.
function Predefined_Primitive_Freeze (Tag_Typ : Entity_Id) return List_Id;
-- Freeze entities of all predefined primitive operations. This is needed
-- because the bodies of these operations do not normally do any freezing.
function Stream_Operation_OK
(Typ : Entity_Id;
Operation : TSS_Name_Type) return Boolean;
-- Check whether the named stream operation must be emitted for a given
-- type. The rules for inheritance of stream attributes by type extensions
-- are enforced by this function. Furthermore, various restrictions prevent
-- the generation of these operations, as a useful optimization or for
-- certification purposes and to save unnecessary generated code.
--------------------------
-- Adjust_Discriminants --
--------------------------
-- This procedure attempts to define subtypes for discriminants that are
-- more restrictive than those declared. Such a replacement is possible if
-- we can demonstrate that values outside the restricted range would cause
-- constraint errors in any case. The advantage of restricting the
-- discriminant types in this way is that the maximum size of the variant
-- record can be calculated more conservatively.
-- An example of a situation in which we can perform this type of
-- restriction is the following:
-- subtype B is range 1 .. 10;
-- type Q is array (B range <>) of Integer;
-- type V (N : Natural) is record
-- C : Q (1 .. N);
-- end record;
-- In this situation, we can restrict the upper bound of N to 10, since
-- any larger value would cause a constraint error in any case.
-- There are many situations in which such restriction is possible, but
-- for now, we just look for cases like the above, where the component
-- in question is a one dimensional array whose upper bound is one of
-- the record discriminants. Also the component must not be part of
-- any variant part, since then the component does not always exist.
procedure Adjust_Discriminants (Rtype : Entity_Id) is
Loc : constant Source_Ptr := Sloc (Rtype);
Comp : Entity_Id;
Ctyp : Entity_Id;
Ityp : Entity_Id;
Lo : Node_Id;
Hi : Node_Id;
P : Node_Id;
Loval : Uint;
Discr : Entity_Id;
Dtyp : Entity_Id;
Dhi : Node_Id;
Dhiv : Uint;
Ahi : Node_Id;
Ahiv : Uint;
Tnn : Entity_Id;
begin
Comp := First_Component (Rtype);
while Present (Comp) loop
-- If our parent is a variant, quit, we do not look at components
-- that are in variant parts, because they may not always exist.
P := Parent (Comp); -- component declaration
P := Parent (P); -- component list
exit when Nkind (Parent (P)) = N_Variant;
-- We are looking for a one dimensional array type
Ctyp := Etype (Comp);
if not Is_Array_Type (Ctyp) or else Number_Dimensions (Ctyp) > 1 then
goto Continue;
end if;
-- The lower bound must be constant, and the upper bound is a
-- discriminant (which is a discriminant of the current record).
Ityp := Etype (First_Index (Ctyp));
Lo := Type_Low_Bound (Ityp);
Hi := Type_High_Bound (Ityp);
if not Compile_Time_Known_Value (Lo)
or else Nkind (Hi) /= N_Identifier
or else No (Entity (Hi))
or else Ekind (Entity (Hi)) /= E_Discriminant
then
goto Continue;
end if;
-- We have an array with appropriate bounds
Loval := Expr_Value (Lo);
Discr := Entity (Hi);
Dtyp := Etype (Discr);
-- See if the discriminant has a known upper bound
Dhi := Type_High_Bound (Dtyp);
if not Compile_Time_Known_Value (Dhi) then
goto Continue;
end if;
Dhiv := Expr_Value (Dhi);
-- See if base type of component array has known upper bound
Ahi := Type_High_Bound (Etype (First_Index (Base_Type (Ctyp))));
if not Compile_Time_Known_Value (Ahi) then
goto Continue;
end if;
Ahiv := Expr_Value (Ahi);
-- The condition for doing the restriction is that the high bound
-- of the discriminant is greater than the low bound of the array,
-- and is also greater than the high bound of the base type index.
if Dhiv > Loval and then Dhiv > Ahiv then
-- We can reset the upper bound of the discriminant type to
-- whichever is larger, the low bound of the component, or
-- the high bound of the base type array index.
-- We build a subtype that is declared as
-- subtype Tnn is discr_type range discr_type'First .. max;
-- And insert this declaration into the tree. The type of the
-- discriminant is then reset to this more restricted subtype.
Tnn := Make_Temporary (Loc, 'T');
Insert_Action (Declaration_Node (Rtype),
Make_Subtype_Declaration (Loc,
Defining_Identifier => Tnn,
Subtype_Indication =>
Make_Subtype_Indication (Loc,
Subtype_Mark => New_Occurrence_Of (Dtyp, Loc),
Constraint =>
Make_Range_Constraint (Loc,
Range_Expression =>
Make_Range (Loc,
Low_Bound =>
Make_Attribute_Reference (Loc,
Attribute_Name => Name_First,
Prefix => New_Occurrence_Of (Dtyp, Loc)),
High_Bound =>
Make_Integer_Literal (Loc,
Intval => UI_Max (Loval, Ahiv)))))));
Set_Etype (Discr, Tnn);
end if;
<<Continue>>
Next_Component (Comp);
end loop;
end Adjust_Discriminants;
------------------------------------------
-- Build_Access_Subprogram_Wrapper_Body --
------------------------------------------
procedure Build_Access_Subprogram_Wrapper_Body
(Decl : Node_Id;
New_Decl : Node_Id)
is
Loc : constant Source_Ptr := Sloc (Decl);
Actuals : constant List_Id := New_List;
Type_Def : constant Node_Id := Type_Definition (Decl);
Type_Id : constant Entity_Id := Defining_Identifier (Decl);
Spec_Node : constant Node_Id :=
Copy_Subprogram_Spec (Specification (New_Decl));
-- This copy creates new identifiers for formals and subprogram.
Act : Node_Id;
Body_Node : Node_Id;
Call_Stmt : Node_Id;
Ptr : Entity_Id;
begin
if not Expander_Active then
return;
end if;
-- Create List of actuals for indirect call. The last parameter of the
-- subprogram declaration is the access value for the indirect call.
Act := First (Parameter_Specifications (Spec_Node));
while Present (Act) loop
exit when Act = Last (Parameter_Specifications (Spec_Node));
Append_To (Actuals,
Make_Identifier (Loc, Chars (Defining_Identifier (Act))));
Next (Act);
end loop;
Ptr :=
Defining_Identifier
(Last (Parameter_Specifications (Specification (New_Decl))));
if Nkind (Type_Def) = N_Access_Procedure_Definition then
Call_Stmt := Make_Procedure_Call_Statement (Loc,
Name =>
Make_Explicit_Dereference
(Loc, New_Occurrence_Of (Ptr, Loc)),
Parameter_Associations => Actuals);
else
Call_Stmt := Make_Simple_Return_Statement (Loc,
Expression =>
Make_Function_Call (Loc,
Name => Make_Explicit_Dereference
(Loc, New_Occurrence_Of (Ptr, Loc)),
Parameter_Associations => Actuals));
end if;
Body_Node := Make_Subprogram_Body (Loc,
Specification => Spec_Node,
Declarations => New_List,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List (Call_Stmt)));
-- Place body in list of freeze actions for the type.
Ensure_Freeze_Node (Type_Id);
Append_Freeze_Actions (Type_Id, New_List (Body_Node));
end Build_Access_Subprogram_Wrapper_Body;
---------------------------
-- Build_Array_Init_Proc --
---------------------------
procedure Build_Array_Init_Proc (A_Type : Entity_Id; Nod : Node_Id) is
Comp_Type : constant Entity_Id := Component_Type (A_Type);
Comp_Simple_Init : constant Boolean :=
Needs_Simple_Initialization
(Typ => Comp_Type,
Consider_IS =>
not (Validity_Check_Copies and Is_Bit_Packed_Array (A_Type)));
-- True if the component needs simple initialization, based on its type,
-- plus the fact that we do not do simple initialization for components
-- of bit-packed arrays when validity checks are enabled, because the
-- initialization with deliberately out-of-range values would raise
-- Constraint_Error.
Body_Stmts : List_Id;
Has_Default_Init : Boolean;
Index_List : List_Id;
Loc : Source_Ptr;
Parameters : List_Id;
Proc_Id : Entity_Id;
function Init_Component return List_Id;
-- Create one statement to initialize one array component, designated
-- by a full set of indexes.
function Init_One_Dimension (N : Int) return List_Id;
-- Create loop to initialize one dimension of the array. The single
-- statement in the loop body initializes the inner dimensions if any,
-- or else the single component. Note that this procedure is called
-- recursively, with N being the dimension to be initialized. A call
-- with N greater than the number of dimensions simply generates the
-- component initialization, terminating the recursion.
--------------------
-- Init_Component --
--------------------
function Init_Component return List_Id is
Comp : Node_Id;
begin
Comp :=
Make_Indexed_Component (Loc,
Prefix => Make_Identifier (Loc, Name_uInit),
Expressions => Index_List);
if Has_Default_Aspect (A_Type) then
Set_Assignment_OK (Comp);
return New_List (
Make_Assignment_Statement (Loc,
Name => Comp,
Expression =>
Convert_To (Comp_Type,
Default_Aspect_Component_Value (First_Subtype (A_Type)))));
elsif Comp_Simple_Init then
Set_Assignment_OK (Comp);
return New_List (
Make_Assignment_Statement (Loc,
Name => Comp,
Expression =>
Get_Simple_Init_Val
(Typ => Comp_Type,
N => Nod,
Size => Component_Size (A_Type))));
else
Clean_Task_Names (Comp_Type, Proc_Id);
return
Build_Initialization_Call
(Loc => Loc,
Id_Ref => Comp,
Typ => Comp_Type,
In_Init_Proc => True,
Enclos_Type => A_Type);
end if;
end Init_Component;
------------------------
-- Init_One_Dimension --
------------------------
function Init_One_Dimension (N : Int) return List_Id is
Index : Entity_Id;
begin
-- If the component does not need initializing, then there is nothing
-- to do here, so we return a null body. This occurs when generating
-- the dummy Init_Proc needed for Initialize_Scalars processing.
if not Has_Non_Null_Base_Init_Proc (Comp_Type)
and then not Comp_Simple_Init
and then not Has_Task (Comp_Type)
and then not Has_Default_Aspect (A_Type)
then
return New_List (Make_Null_Statement (Loc));
-- If all dimensions dealt with, we simply initialize the component
elsif N > Number_Dimensions (A_Type) then
return Init_Component;
-- Here we generate the required loop
else
Index :=
Make_Defining_Identifier (Loc, New_External_Name ('J', N));
Append (New_Occurrence_Of (Index, Loc), Index_List);
return New_List (
Make_Implicit_Loop_Statement (Nod,
Identifier => Empty,
Iteration_Scheme =>
Make_Iteration_Scheme (Loc,
Loop_Parameter_Specification =>
Make_Loop_Parameter_Specification (Loc,
Defining_Identifier => Index,
Discrete_Subtype_Definition =>
Make_Attribute_Reference (Loc,
Prefix =>
Make_Identifier (Loc, Name_uInit),
Attribute_Name => Name_Range,
Expressions => New_List (
Make_Integer_Literal (Loc, N))))),
Statements => Init_One_Dimension (N + 1)));
end if;
end Init_One_Dimension;
-- Start of processing for Build_Array_Init_Proc
begin
-- The init proc is created when analyzing the freeze node for the type,
-- but it properly belongs with the array type declaration. However, if
-- the freeze node is for a subtype of a type declared in another unit
-- it seems preferable to use the freeze node as the source location of
-- the init proc. In any case this is preferable for gcov usage, and
-- the Sloc is not otherwise used by the compiler.
if In_Open_Scopes (Scope (A_Type)) then
Loc := Sloc (A_Type);
else
Loc := Sloc (Nod);
end if;
-- Nothing to generate in the following cases:
-- 1. Initialization is suppressed for the type
-- 2. An initialization already exists for the base type
if Initialization_Suppressed (A_Type)
or else Present (Base_Init_Proc (A_Type))
then
return;
end if;
Index_List := New_List;
-- We need an initialization procedure if any of the following is true:
-- 1. The component type has an initialization procedure
-- 2. The component type needs simple initialization
-- 3. Tasks are present
-- 4. The type is marked as a public entity
-- 5. The array type has a Default_Component_Value aspect
-- The reason for the public entity test is to deal properly with the
-- Initialize_Scalars pragma. This pragma can be set in the client and
-- not in the declaring package, this means the client will make a call
-- to the initialization procedure (because one of conditions 1-3 must
-- apply in this case), and we must generate a procedure (even if it is
-- null) to satisfy the call in this case.
-- Exception: do not build an array init_proc for a type whose root
-- type is Standard.String or Standard.Wide_[Wide_]String, since there
-- is no place to put the code, and in any case we handle initialization
-- of such types (in the Initialize_Scalars case, that's the only time
-- the issue arises) in a special manner anyway which does not need an
-- init_proc.
Has_Default_Init := Has_Non_Null_Base_Init_Proc (Comp_Type)
or else Comp_Simple_Init
or else Has_Task (Comp_Type)
or else Has_Default_Aspect (A_Type);
if Has_Default_Init
or else (not Restriction_Active (No_Initialize_Scalars)
and then Is_Public (A_Type)
and then not Is_Standard_String_Type (A_Type))
then
Proc_Id :=
Make_Defining_Identifier (Loc,
Chars => Make_Init_Proc_Name (A_Type));
-- If No_Default_Initialization restriction is active, then we don't
-- want to build an init_proc, but we need to mark that an init_proc
-- would be needed if this restriction was not active (so that we can
-- detect attempts to call it), so set a dummy init_proc in place.
-- This is only done though when actual default initialization is
-- needed (and not done when only Is_Public is True), since otherwise
-- objects such as arrays of scalars could be wrongly flagged as
-- violating the restriction.
if Restriction_Active (No_Default_Initialization) then
if Has_Default_Init then
Set_Init_Proc (A_Type, Proc_Id);
end if;
return;
end if;
Body_Stmts := Init_One_Dimension (1);
Parameters := Init_Formals (A_Type, Proc_Id);
Discard_Node (
Make_Subprogram_Body (Loc,
Specification =>
Make_Procedure_Specification (Loc,
Defining_Unit_Name => Proc_Id,
Parameter_Specifications => Parameters),
Declarations => New_List,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => Body_Stmts)));
Set_Ekind (Proc_Id, E_Procedure);
Set_Is_Public (Proc_Id, Is_Public (A_Type));
Set_Is_Internal (Proc_Id);
Set_Has_Completion (Proc_Id);
if not Debug_Generated_Code then
Set_Debug_Info_Off (Proc_Id);
end if;
-- Set Inlined on Init_Proc if it is set on the Init_Proc of the
-- component type itself (see also Build_Record_Init_Proc).
Set_Is_Inlined (Proc_Id, Inline_Init_Proc (Comp_Type));
-- Associate Init_Proc with type, and determine if the procedure
-- is null (happens because of the Initialize_Scalars pragma case,
-- where we have to generate a null procedure in case it is called
-- by a client with Initialize_Scalars set). Such procedures have
-- to be generated, but do not have to be called, so we mark them
-- as null to suppress the call. Kill also warnings for the _Init
-- out parameter, which is left entirely uninitialized.
Set_Init_Proc (A_Type, Proc_Id);
if Is_Null_Statement_List (Body_Stmts) then
Set_Is_Null_Init_Proc (Proc_Id);
Set_Warnings_Off (Defining_Identifier (First (Parameters)));
else
-- Try to build a static aggregate to statically initialize
-- objects of the type. This can only be done for constrained
-- one-dimensional arrays with static bounds.
Set_Static_Initialization
(Proc_Id,
Build_Equivalent_Array_Aggregate (First_Subtype (A_Type)));
end if;
end if;
end Build_Array_Init_Proc;
--------------------------------
-- Build_Discr_Checking_Funcs --
--------------------------------
procedure Build_Discr_Checking_Funcs (N : Node_Id) is
Rec_Id : Entity_Id;
Loc : Source_Ptr;
Enclosing_Func_Id : Entity_Id;
Sequence : Nat := 1;
Type_Def : Node_Id;
V : Node_Id;
function Build_Case_Statement
(Case_Id : Entity_Id;
Variant : Node_Id) return Node_Id;
-- Build a case statement containing only two alternatives. The first
-- alternative corresponds exactly to the discrete choices given on the
-- variant with contains the components that we are generating the
-- checks for. If the discriminant is one of these return False. The
-- second alternative is an OTHERS choice that will return True
-- indicating the discriminant did not match.
function Build_Dcheck_Function
(Case_Id : Entity_Id;
Variant : Node_Id) return Entity_Id;
-- Build the discriminant checking function for a given variant
procedure Build_Dcheck_Functions (Variant_Part_Node : Node_Id);
-- Builds the discriminant checking function for each variant of the
-- given variant part of the record type.
--------------------------
-- Build_Case_Statement --
--------------------------
function Build_Case_Statement
(Case_Id : Entity_Id;
Variant : Node_Id) return Node_Id
is
Alt_List : constant List_Id := New_List;
Actuals_List : List_Id;
Case_Node : Node_Id;
Case_Alt_Node : Node_Id;
Choice : Node_Id;
Choice_List : List_Id;
D : Entity_Id;
Return_Node : Node_Id;
begin
Case_Node := New_Node (N_Case_Statement, Loc);
-- Replace the discriminant which controls the variant with the name
-- of the formal of the checking function.
Set_Expression (Case_Node, Make_Identifier (Loc, Chars (Case_Id)));
Choice := First (Discrete_Choices (Variant));
if Nkind (Choice) = N_Others_Choice then
Choice_List := New_Copy_List (Others_Discrete_Choices (Choice));
else
Choice_List := New_Copy_List (Discrete_Choices (Variant));
end if;
if not Is_Empty_List (Choice_List) then
Case_Alt_Node := New_Node (N_Case_Statement_Alternative, Loc);
Set_Discrete_Choices (Case_Alt_Node, Choice_List);
-- In case this is a nested variant, we need to return the result
-- of the discriminant checking function for the immediately
-- enclosing variant.
if Present (Enclosing_Func_Id) then
Actuals_List := New_List;
D := First_Discriminant (Rec_Id);
while Present (D) loop
Append (Make_Identifier (Loc, Chars (D)), Actuals_List);
Next_Discriminant (D);
end loop;
Return_Node :=
Make_Simple_Return_Statement (Loc,
Expression =>
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (Enclosing_Func_Id, Loc),
Parameter_Associations =>
Actuals_List));
else
Return_Node :=
Make_Simple_Return_Statement (Loc,
Expression =>
New_Occurrence_Of (Standard_False, Loc));
end if;
Set_Statements (Case_Alt_Node, New_List (Return_Node));
Append (Case_Alt_Node, Alt_List);
end if;
Case_Alt_Node := New_Node (N_Case_Statement_Alternative, Loc);
Choice_List := New_List (New_Node (N_Others_Choice, Loc));
Set_Discrete_Choices (Case_Alt_Node, Choice_List);
Return_Node :=
Make_Simple_Return_Statement (Loc,
Expression =>
New_Occurrence_Of (Standard_True, Loc));
Set_Statements (Case_Alt_Node, New_List (Return_Node));
Append (Case_Alt_Node, Alt_List);
Set_Alternatives (Case_Node, Alt_List);
return Case_Node;
end Build_Case_Statement;
---------------------------
-- Build_Dcheck_Function --
---------------------------
function Build_Dcheck_Function
(Case_Id : Entity_Id;
Variant : Node_Id) return Entity_Id
is
Body_Node : Node_Id;
Func_Id : Entity_Id;
Parameter_List : List_Id;
Spec_Node : Node_Id;
begin
Body_Node := New_Node (N_Subprogram_Body, Loc);
Sequence := Sequence + 1;
Func_Id :=
Make_Defining_Identifier (Loc,
Chars => New_External_Name (Chars (Rec_Id), 'D', Sequence));
Set_Is_Discriminant_Check_Function (Func_Id);
Spec_Node := New_Node (N_Function_Specification, Loc);
Set_Defining_Unit_Name (Spec_Node, Func_Id);
Parameter_List := Build_Discriminant_Formals (Rec_Id, False);
Set_Parameter_Specifications (Spec_Node, Parameter_List);
Set_Result_Definition (Spec_Node,
New_Occurrence_Of (Standard_Boolean, Loc));
Set_Specification (Body_Node, Spec_Node);
Set_Declarations (Body_Node, New_List);
Set_Handled_Statement_Sequence (Body_Node,
Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List (
Build_Case_Statement (Case_Id, Variant))));
Set_Ekind (Func_Id, E_Function);
Set_Mechanism (Func_Id, Default_Mechanism);
Set_Is_Inlined (Func_Id, True);
Set_Is_Pure (Func_Id, True);
Set_Is_Public (Func_Id, Is_Public (Rec_Id));
Set_Is_Internal (Func_Id, True);
if not Debug_Generated_Code then
Set_Debug_Info_Off (Func_Id);
end if;
Analyze (Body_Node);
Append_Freeze_Action (Rec_Id, Body_Node);
Set_Dcheck_Function (Variant, Func_Id);
return Func_Id;
end Build_Dcheck_Function;
----------------------------
-- Build_Dcheck_Functions --
----------------------------
procedure Build_Dcheck_Functions (Variant_Part_Node : Node_Id) is
Component_List_Node : Node_Id;
Decl : Entity_Id;
Discr_Name : Entity_Id;
Func_Id : Entity_Id;
Variant : Node_Id;
Saved_Enclosing_Func_Id : Entity_Id;
begin
-- Build the discriminant-checking function for each variant, and
-- label all components of that variant with the function's name.
-- We only Generate a discriminant-checking function when the
-- variant is not empty, to prevent the creation of dead code.
Discr_Name := Entity (Name (Variant_Part_Node));
Variant := First_Non_Pragma (Variants (Variant_Part_Node));
while Present (Variant) loop
Component_List_Node := Component_List (Variant);
if not Null_Present (Component_List_Node) then
Func_Id := Build_Dcheck_Function (Discr_Name, Variant);
Decl :=
First_Non_Pragma (Component_Items (Component_List_Node));
while Present (Decl) loop
Set_Discriminant_Checking_Func
(Defining_Identifier (Decl), Func_Id);
Next_Non_Pragma (Decl);
end loop;
if Present (Variant_Part (Component_List_Node)) then
Saved_Enclosing_Func_Id := Enclosing_Func_Id;
Enclosing_Func_Id := Func_Id;
Build_Dcheck_Functions (Variant_Part (Component_List_Node));
Enclosing_Func_Id := Saved_Enclosing_Func_Id;
end if;
end if;
Next_Non_Pragma (Variant);
end loop;
end Build_Dcheck_Functions;
-- Start of processing for Build_Discr_Checking_Funcs
begin
-- Only build if not done already
if not Discr_Check_Funcs_Built (N) then
Type_Def := Type_Definition (N);
if Nkind (Type_Def) = N_Record_Definition then
if No (Component_List (Type_Def)) then -- null record.
return;
else
V := Variant_Part (Component_List (Type_Def));
end if;
else pragma Assert (Nkind (Type_Def) = N_Derived_Type_Definition);
if No (Component_List (Record_Extension_Part (Type_Def))) then
return;
else
V := Variant_Part
(Component_List (Record_Extension_Part (Type_Def)));
end if;
end if;
Rec_Id := Defining_Identifier (N);
if Present (V) and then not Is_Unchecked_Union (Rec_Id) then
Loc := Sloc (N);
Enclosing_Func_Id := Empty;
Build_Dcheck_Functions (V);
end if;
Set_Discr_Check_Funcs_Built (N);
end if;
end Build_Discr_Checking_Funcs;
--------------------------------
-- Build_Discriminant_Formals --
--------------------------------
function Build_Discriminant_Formals
(Rec_Id : Entity_Id;
Use_Dl : Boolean) return List_Id
is
Loc : Source_Ptr := Sloc (Rec_Id);
Parameter_List : constant List_Id := New_List;
D : Entity_Id;
Formal : Entity_Id;
Formal_Type : Entity_Id;
Param_Spec_Node : Node_Id;
begin
if Has_Discriminants (Rec_Id) then
D := First_Discriminant (Rec_Id);
while Present (D) loop
Loc := Sloc (D);
if Use_Dl then
Formal := Discriminal (D);
Formal_Type := Etype (Formal);
else
Formal := Make_Defining_Identifier (Loc, Chars (D));
Formal_Type := Etype (D);
end if;
Param_Spec_Node :=
Make_Parameter_Specification (Loc,
Defining_Identifier => Formal,
Parameter_Type =>
New_Occurrence_Of (Formal_Type, Loc));
Append (Param_Spec_Node, Parameter_List);
Next_Discriminant (D);
end loop;
end if;
return Parameter_List;
end Build_Discriminant_Formals;
--------------------------------------
-- Build_Equivalent_Array_Aggregate --
--------------------------------------
function Build_Equivalent_Array_Aggregate (T : Entity_Id) return Node_Id is
Loc : constant Source_Ptr := Sloc (T);
Comp_Type : constant Entity_Id := Component_Type (T);
Index_Type : constant Entity_Id := Etype (First_Index (T));
Proc : constant Entity_Id := Base_Init_Proc (T);
Lo, Hi : Node_Id;
Aggr : Node_Id;
Expr : Node_Id;
begin
if not Is_Constrained (T)
or else Number_Dimensions (T) > 1
or else No (Proc)
then
Initialization_Warning (T);
return Empty;
end if;
Lo := Type_Low_Bound (Index_Type);
Hi := Type_High_Bound (Index_Type);
if not Compile_Time_Known_Value (Lo)
or else not Compile_Time_Known_Value (Hi)
then
Initialization_Warning (T);
return Empty;
end if;
if Is_Record_Type (Comp_Type)
and then Present (Base_Init_Proc (Comp_Type))
then
Expr := Static_Initialization (Base_Init_Proc (Comp_Type));
if No (Expr) then
Initialization_Warning (T);
return Empty;
end if;
else
Initialization_Warning (T);
return Empty;
end if;
Aggr := Make_Aggregate (Loc, No_List, New_List);
Set_Etype (Aggr, T);
Set_Aggregate_Bounds (Aggr,
Make_Range (Loc,
Low_Bound => New_Copy (Lo),
High_Bound => New_Copy (Hi)));
Set_Parent (Aggr, Parent (Proc));
Append_To (Component_Associations (Aggr),
Make_Component_Association (Loc,
Choices =>
New_List (
Make_Range (Loc,
Low_Bound => New_Copy (Lo),
High_Bound => New_Copy (Hi))),
Expression => Expr));
if Static_Array_Aggregate (Aggr) then
return Aggr;
else
Initialization_Warning (T);
return Empty;
end if;
end Build_Equivalent_Array_Aggregate;
---------------------------------------
-- Build_Equivalent_Record_Aggregate --
---------------------------------------
function Build_Equivalent_Record_Aggregate (T : Entity_Id) return Node_Id is
Agg : Node_Id;
Comp : Entity_Id;
Comp_Type : Entity_Id;
-- Start of processing for Build_Equivalent_Record_Aggregate
begin
if not Is_Record_Type (T)
or else Has_Discriminants (T)
or else Is_Limited_Type (T)
or else Has_Non_Standard_Rep (T)
then
Initialization_Warning (T);
return Empty;
end if;
Comp := First_Component (T);
-- A null record needs no warning
if No (Comp) then
return Empty;
end if;
while Present (Comp) loop
-- Array components are acceptable if initialized by a positional
-- aggregate with static components.
if Is_Array_Type (Etype (Comp)) then
Comp_Type := Component_Type (Etype (Comp));
if Nkind (Parent (Comp)) /= N_Component_Declaration
or else No (Expression (Parent (Comp)))
or else Nkind (Expression (Parent (Comp))) /= N_Aggregate
then
Initialization_Warning (T);
return Empty;
elsif Is_Scalar_Type (Component_Type (Etype (Comp)))
and then
(not Compile_Time_Known_Value (Type_Low_Bound (Comp_Type))
or else
not Compile_Time_Known_Value (Type_High_Bound (Comp_Type)))
then
Initialization_Warning (T);
return Empty;
elsif
not Static_Array_Aggregate (Expression (Parent (Comp)))
then
Initialization_Warning (T);
return Empty;
-- We need to return empty if the type has predicates because
-- this would otherwise duplicate calls to the predicate
-- function. If the type hasn't been frozen before being
-- referenced in the current record, the extraneous call to
-- the predicate function would be inserted somewhere before
-- the predicate function is elaborated, which would result in
-- an invalid tree.
elsif Has_Predicates (Etype (Comp)) then
return Empty;
end if;
elsif Is_Scalar_Type (Etype (Comp)) then
Comp_Type := Etype (Comp);
if Nkind (Parent (Comp)) /= N_Component_Declaration
or else No (Expression (Parent (Comp)))
or else not Compile_Time_Known_Value (Expression (Parent (Comp)))
or else not Compile_Time_Known_Value (Type_Low_Bound (Comp_Type))
or else not
Compile_Time_Known_Value (Type_High_Bound (Comp_Type))
then
Initialization_Warning (T);
return Empty;
end if;
-- For now, other types are excluded
else
Initialization_Warning (T);
return Empty;
end if;
Next_Component (Comp);
end loop;
-- All components have static initialization. Build positional aggregate
-- from the given expressions or defaults.
Agg := Make_Aggregate (Sloc (T), New_List, New_List);
Set_Parent (Agg, Parent (T));
Comp := First_Component (T);
while Present (Comp) loop
Append
(New_Copy_Tree (Expression (Parent (Comp))), Expressions (Agg));
Next_Component (Comp);
end loop;
Analyze_And_Resolve (Agg, T);
return Agg;
end Build_Equivalent_Record_Aggregate;
-------------------------------
-- Build_Initialization_Call --
-------------------------------
-- References to a discriminant inside the record type declaration can
-- appear either in the subtype_indication to constrain a record or an
-- array, or as part of a larger expression given for the initial value
-- of a component. In both of these cases N appears in the record
-- initialization procedure and needs to be replaced by the formal
-- parameter of the initialization procedure which corresponds to that
-- discriminant.
-- In the example below, references to discriminants D1 and D2 in proc_1
-- are replaced by references to formals with the same name
-- (discriminals)
-- A similar replacement is done for calls to any record initialization
-- procedure for any components that are themselves of a record type.
-- type R (D1, D2 : Integer) is record
-- X : Integer := F * D1;
-- Y : Integer := F * D2;
-- end record;
-- procedure proc_1 (Out_2 : out R; D1 : Integer; D2 : Integer) is
-- begin
-- Out_2.D1 := D1;
-- Out_2.D2 := D2;
-- Out_2.X := F * D1;
-- Out_2.Y := F * D2;
-- end;
function Build_Initialization_Call
(Loc : Source_Ptr;
Id_Ref : Node_Id;
Typ : Entity_Id;
In_Init_Proc : Boolean := False;
Enclos_Type : Entity_Id := Empty;
Discr_Map : Elist_Id := New_Elmt_List;
With_Default_Init : Boolean := False;
Constructor_Ref : Node_Id := Empty) return List_Id
is
Res : constant List_Id := New_List;
Full_Type : Entity_Id;
procedure Check_Predicated_Discriminant
(Val : Node_Id;
Discr : Entity_Id);
-- Discriminants whose subtypes have predicates are checked in two
-- cases:
-- a) When an object is default-initialized and assertions are enabled
-- we check that the value of the discriminant obeys the predicate.
-- b) In all cases, if the discriminant controls a variant and the
-- variant has no others_choice, Constraint_Error must be raised if
-- the predicate is violated, because there is no variant covered
-- by the illegal discriminant value.
-----------------------------------
-- Check_Predicated_Discriminant --
-----------------------------------
procedure Check_Predicated_Discriminant
(Val : Node_Id;
Discr : Entity_Id)
is
Typ : constant Entity_Id := Etype (Discr);
procedure Check_Missing_Others (V : Node_Id);
-- ???
--------------------------
-- Check_Missing_Others --
--------------------------
procedure Check_Missing_Others (V : Node_Id) is
Alt : Node_Id;
Choice : Node_Id;
Last_Var : Node_Id;
begin
Last_Var := Last_Non_Pragma (Variants (V));
Choice := First (Discrete_Choices (Last_Var));
-- An others_choice is added during expansion for gcc use, but
-- does not cover the illegality.
if Entity (Name (V)) = Discr then
if Present (Choice)
and then (Nkind (Choice) /= N_Others_Choice
or else not Comes_From_Source (Choice))
then
Check_Expression_Against_Static_Predicate (Val, Typ);
if not Is_Static_Expression (Val) then
Prepend_To (Res,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Op_Not (Loc,
Right_Opnd => Make_Predicate_Call (Typ, Val)),
Reason => CE_Invalid_Data));
end if;
end if;
end if;
-- Check whether some nested variant is ruled by the predicated
-- discriminant.
Alt := First (Variants (V));
while Present (Alt) loop
if Nkind (Alt) = N_Variant
and then Present (Variant_Part (Component_List (Alt)))
then
Check_Missing_Others
(Variant_Part (Component_List (Alt)));
end if;
Next (Alt);
end loop;
end Check_Missing_Others;
-- Local variables
Def : Node_Id;
-- Start of processing for Check_Predicated_Discriminant
begin
if Ekind (Base_Type (Full_Type)) = E_Record_Type then
Def := Type_Definition (Parent (Base_Type (Full_Type)));
else
return;
end if;
if Policy_In_Effect (Name_Assert) = Name_Check
and then not Predicates_Ignored (Etype (Discr))
then
Prepend_To (Res, Make_Predicate_Check (Typ, Val));
end if;
-- If discriminant controls a variant, verify that predicate is
-- obeyed or else an Others_Choice is present.
if Nkind (Def) = N_Record_Definition
and then Present (Variant_Part (Component_List (Def)))
and then Policy_In_Effect (Name_Assert) = Name_Ignore
then
Check_Missing_Others (Variant_Part (Component_List (Def)));
end if;
end Check_Predicated_Discriminant;
-- Local variables
Arg : Node_Id;
Args : List_Id;
Decls : List_Id;
Decl : Node_Id;
Discr : Entity_Id;
First_Arg : Node_Id;
Full_Init_Type : Entity_Id;
Init_Call : Node_Id;
Init_Type : Entity_Id;
Proc : Entity_Id;
-- Start of processing for Build_Initialization_Call
begin
pragma Assert (Constructor_Ref = Empty
or else Is_CPP_Constructor_Call (Constructor_Ref));
if No (Constructor_Ref) then
Proc := Base_Init_Proc (Typ);
else
Proc := Base_Init_Proc (Typ, Entity (Name (Constructor_Ref)));
end if;
pragma Assert (Present (Proc));
Init_Type := Etype (First_Formal (Proc));
Full_Init_Type := Underlying_Type (Init_Type);
-- Nothing to do if the Init_Proc is null, unless Initialize_Scalars
-- is active (in which case we make the call anyway, since in the
-- actual compiled client it may be non null).
if Is_Null_Init_Proc (Proc) and then not Init_Or_Norm_Scalars then
return Empty_List;
-- Nothing to do for an array of controlled components that have only
-- the inherited Initialize primitive. This is a useful optimization
-- for CodePeer.
elsif Is_Trivial_Subprogram (Proc)
and then Is_Array_Type (Full_Init_Type)
then
return New_List (Make_Null_Statement (Loc));
end if;
-- Use the [underlying] full view when dealing with a private type. This
-- may require several steps depending on derivations.
Full_Type := Typ;
loop
if Is_Private_Type (Full_Type) then
if Present (Full_View (Full_Type)) then
Full_Type := Full_View (Full_Type);
elsif Present (Underlying_Full_View (Full_Type)) then
Full_Type := Underlying_Full_View (Full_Type);
-- When a private type acts as a generic actual and lacks a full
-- view, use the base type.
elsif Is_Generic_Actual_Type (Full_Type) then
Full_Type := Base_Type (Full_Type);
elsif Ekind (Full_Type) = E_Private_Subtype
and then (not Has_Discriminants (Full_Type)
or else No (Discriminant_Constraint (Full_Type)))
then
Full_Type := Etype (Full_Type);
-- The loop has recovered the [underlying] full view, stop the
-- traversal.
else
exit;
end if;
-- The type is not private, nothing to do
else
exit;
end if;
end loop;
-- If Typ is derived, the procedure is the initialization procedure for
-- the root type. Wrap the argument in an conversion to make it type
-- honest. Actually it isn't quite type honest, because there can be
-- conflicts of views in the private type case. That is why we set
-- Conversion_OK in the conversion node.
if (Is_Record_Type (Typ)
or else Is_Array_Type (Typ)
or else Is_Private_Type (Typ))
and then Init_Type /= Base_Type (Typ)
then
First_Arg := OK_Convert_To (Etype (Init_Type), Id_Ref);
Set_Etype (First_Arg, Init_Type);
else
First_Arg := Id_Ref;
end if;
Args := New_List (Convert_Concurrent (First_Arg, Typ));
-- In the tasks case, add _Master as the value of the _Master parameter
-- and _Chain as the value of the _Chain parameter. At the outer level,
-- these will be variables holding the corresponding values obtained
-- from GNARL. At inner levels, they will be the parameters passed down
-- through the outer routines.
if Has_Task (Full_Type) then
if Restriction_Active (No_Task_Hierarchy) then
Append_To (Args,
New_Occurrence_Of (RTE (RE_Library_Task_Level), Loc));
else
Append_To (Args, Make_Identifier (Loc, Name_uMaster));
end if;
-- Add _Chain (not done for sequential elaboration policy, see
-- comment for Create_Restricted_Task_Sequential in s-tarest.ads).
if Partition_Elaboration_Policy /= 'S' then
Append_To (Args, Make_Identifier (Loc, Name_uChain));
end if;
-- Ada 2005 (AI-287): In case of default initialized components
-- with tasks, we generate a null string actual parameter.
-- This is just a workaround that must be improved later???
if With_Default_Init then
Append_To (Args,
Make_String_Literal (Loc,
Strval => ""));
else
Decls :=
Build_Task_Image_Decls (Loc, Id_Ref, Enclos_Type, In_Init_Proc);
Decl := Last (Decls);
Append_To (Args,
New_Occurrence_Of (Defining_Identifier (Decl), Loc));
Append_List (Decls, Res);
end if;
else
Decls := No_List;
Decl := Empty;
end if;
-- Handle the optionally generated formal *_skip_null_excluding_checks
-- Look at the associated node for the object we are referencing and
-- verify that we are expanding a call to an Init_Proc for an internally
-- generated object declaration before passing True and skipping the
-- relevant checks.
if Needs_Conditional_Null_Excluding_Check (Full_Init_Type)
and then Nkind (Id_Ref) in N_Has_Entity
and then (Comes_From_Source (Id_Ref)
or else (Present (Associated_Node (Id_Ref))
and then Comes_From_Source
(Associated_Node (Id_Ref))))
then
Append_To (Args, New_Occurrence_Of (Standard_True, Loc));
end if;
-- Add discriminant values if discriminants are present
if Has_Discriminants (Full_Init_Type) then
Discr := First_Discriminant (Full_Init_Type);
while Present (Discr) loop
-- If this is a discriminated concurrent type, the init_proc
-- for the corresponding record is being called. Use that type
-- directly to find the discriminant value, to handle properly
-- intervening renamed discriminants.
declare
T : Entity_Id := Full_Type;
begin
if Is_Protected_Type (T) then
T := Corresponding_Record_Type (T);
end if;
Arg :=
Get_Discriminant_Value (
Discr,
T,
Discriminant_Constraint (Full_Type));
end;
-- If the target has access discriminants, and is constrained by
-- an access to the enclosing construct, i.e. a current instance,
-- replace the reference to the type by a reference to the object.
if Nkind (Arg) = N_Attribute_Reference
and then Is_Access_Type (Etype (Arg))
and then Is_Entity_Name (Prefix (Arg))
and then Is_Type (Entity (Prefix (Arg)))
then
Arg :=
Make_Attribute_Reference (Loc,
Prefix => New_Copy (Prefix (Id_Ref)),
Attribute_Name => Name_Unrestricted_Access);
elsif In_Init_Proc then
-- Replace any possible references to the discriminant in the
-- call to the record initialization procedure with references
-- to the appropriate formal parameter.
if Nkind (Arg) = N_Identifier
and then Ekind (Entity (Arg)) = E_Discriminant
then
Arg := New_Occurrence_Of (Discriminal (Entity (Arg)), Loc);
-- Otherwise make a copy of the default expression. Note that
-- we use the current Sloc for this, because we do not want the
-- call to appear to be at the declaration point. Within the
-- expression, replace discriminants with their discriminals.
else
Arg :=
New_Copy_Tree (Arg, Map => Discr_Map, New_Sloc => Loc);
end if;
else
if Is_Constrained (Full_Type) then
Arg := Duplicate_Subexpr_No_Checks (Arg);
else
-- The constraints come from the discriminant default exps,
-- they must be reevaluated, so we use New_Copy_Tree but we
-- ensure the proper Sloc (for any embedded calls).
-- In addition, if a predicate check is needed on the value
-- of the discriminant, insert it ahead of the call.
Arg := New_Copy_Tree (Arg, New_Sloc => Loc);
end if;
if Has_Predicates (Etype (Discr)) then
Check_Predicated_Discriminant (Arg, Discr);
end if;
end if;
-- Ada 2005 (AI-287): In case of default initialized components,
-- if the component is constrained with a discriminant of the
-- enclosing type, we need to generate the corresponding selected
-- component node to access the discriminant value. In other cases
-- this is not required, either because we are inside the init
-- proc and we use the corresponding formal, or else because the
-- component is constrained by an expression.
if With_Default_Init
and then Nkind (Id_Ref) = N_Selected_Component
and then Nkind (Arg) = N_Identifier
and then Ekind (Entity (Arg)) = E_Discriminant
then
Append_To (Args,
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Prefix (Id_Ref)),
Selector_Name => Arg));
else
Append_To (Args, Arg);
end if;
Next_Discriminant (Discr);
end loop;
end if;
-- If this is a call to initialize the parent component of a derived
-- tagged type, indicate that the tag should not be set in the parent.
if Is_Tagged_Type (Full_Init_Type)
and then not Is_CPP_Class (Full_Init_Type)
and then Nkind (Id_Ref) = N_Selected_Component
and then Chars (Selector_Name (Id_Ref)) = Name_uParent
then
Append_To (Args, New_Occurrence_Of (Standard_False, Loc));
elsif Present (Constructor_Ref) then
Append_List_To (Args,
New_Copy_List (Parameter_Associations (Constructor_Ref)));
end if;
Append_To (Res,
Make_Procedure_Call_Statement (Loc,
Name => New_Occurrence_Of (Proc, Loc),
Parameter_Associations => Args));
if Needs_Finalization (Typ)
and then Nkind (Id_Ref) = N_Selected_Component
then
if Chars (Selector_Name (Id_Ref)) /= Name_uParent then
Init_Call :=
Make_Init_Call
(Obj_Ref => New_Copy_Tree (First_Arg),
Typ => Typ);
-- Guard against a missing [Deep_]Initialize when the type was not
-- properly frozen.
if Present (Init_Call) then
Append_To (Res, Init_Call);
end if;
end if;
end if;
return Res;
exception
when RE_Not_Available =>
return Empty_List;
end Build_Initialization_Call;
----------------------------
-- Build_Record_Init_Proc --
----------------------------
procedure Build_Record_Init_Proc (N : Node_Id; Rec_Ent : Entity_Id) is
Decls : constant List_Id := New_List;
Discr_Map : constant Elist_Id := New_Elmt_List;
Loc : constant Source_Ptr := Sloc (Rec_Ent);
Counter : Nat := 0;
Proc_Id : Entity_Id;
Rec_Type : Entity_Id;
Set_Tag : Entity_Id := Empty;
function Build_Assignment
(Id : Entity_Id;
Default : Node_Id) return List_Id;
-- Build an assignment statement that assigns the default expression to
-- its corresponding record component if defined. The left-hand side of
-- the assignment is marked Assignment_OK so that initialization of
-- limited private records works correctly. This routine may also build
-- an adjustment call if the component is controlled.
procedure Build_Discriminant_Assignments (Statement_List : List_Id);
-- If the record has discriminants, add assignment statements to
-- Statement_List to initialize the discriminant values from the
-- arguments of the initialization procedure.
function Build_Init_Statements (Comp_List : Node_Id) return List_Id;
-- Build a list representing a sequence of statements which initialize
-- components of the given component list. This may involve building
-- case statements for the variant parts. Append any locally declared
-- objects on list Decls.
function Build_Init_Call_Thru (Parameters : List_Id) return List_Id;
-- Given an untagged type-derivation that declares discriminants, e.g.
--
-- type R (R1, R2 : Integer) is record ... end record;
-- type D (D1 : Integer) is new R (1, D1);
--
-- we make the _init_proc of D be
--
-- procedure _init_proc (X : D; D1 : Integer) is
-- begin
-- _init_proc (R (X), 1, D1);
-- end _init_proc;
--
-- This function builds the call statement in this _init_proc.
procedure Build_CPP_Init_Procedure;
-- Build the tree corresponding to the procedure specification and body
-- of the IC procedure that initializes the C++ part of the dispatch
-- table of an Ada tagged type that is a derivation of a CPP type.
-- Install it as the CPP_Init TSS.
procedure Build_Init_Procedure;
-- Build the tree corresponding to the procedure specification and body
-- of the initialization procedure and install it as the _init TSS.
procedure Build_Offset_To_Top_Functions;
-- Ada 2005 (AI-251): Build the tree corresponding to the procedure spec
-- and body of Offset_To_Top, a function used in conjuction with types
-- having secondary dispatch tables.
procedure Build_Record_Checks (S : Node_Id; Check_List : List_Id);
-- Add range checks to components of discriminated records. S is a
-- subtype indication of a record component. Check_List is a list
-- to which the check actions are appended.
function Component_Needs_Simple_Initialization
(T : Entity_Id) return Boolean;
-- Determine if a component needs simple initialization, given its type
-- T. This routine is the same as Needs_Simple_Initialization except for
-- components of type Tag and Interface_Tag. These two access types do
-- not require initialization since they are explicitly initialized by
-- other means.
function Parent_Subtype_Renaming_Discrims return Boolean;
-- Returns True for base types N that rename discriminants, else False
function Requires_Init_Proc (Rec_Id : Entity_Id) return Boolean;
-- Determine whether a record initialization procedure needs to be
-- generated for the given record type.
----------------------
-- Build_Assignment --
----------------------
function Build_Assignment
(Id : Entity_Id;
Default : Node_Id) return List_Id
is
Default_Loc : constant Source_Ptr := Sloc (Default);
Typ : constant Entity_Id := Underlying_Type (Etype (Id));
Adj_Call : Node_Id;
Exp : Node_Id := Default;
Kind : Node_Kind := Nkind (Default);
Lhs : Node_Id;
Res : List_Id;
function Replace_Discr_Ref (N : Node_Id) return Traverse_Result;
-- Analysis of the aggregate has replaced discriminants by their
-- corresponding discriminals, but these are irrelevant when the
-- component has a mutable type and is initialized with an aggregate.
-- Instead, they must be replaced by the values supplied in the
-- aggregate, that will be assigned during the expansion of the
-- assignment.
-----------------------
-- Replace_Discr_Ref --
-----------------------
function Replace_Discr_Ref (N : Node_Id) return Traverse_Result is
Val : Node_Id;
begin
if Is_Entity_Name (N)
and then Present (Entity (N))
and then Is_Formal (Entity (N))
and then Present (Discriminal_Link (Entity (N)))
then
Val :=
Make_Selected_Component (Default_Loc,
Prefix => New_Copy_Tree (Lhs),
Selector_Name =>
New_Occurrence_Of
(Discriminal_Link (Entity (N)), Default_Loc));
if Present (Val) then
Rewrite (N, New_Copy_Tree (Val));
end if;
end if;
return OK;
end Replace_Discr_Ref;
procedure Replace_Discriminant_References is
new Traverse_Proc (Replace_Discr_Ref);
-- Start of processing for Build_Assignment
begin
Lhs :=
Make_Selected_Component (Default_Loc,
Prefix => Make_Identifier (Loc, Name_uInit),
Selector_Name => New_Occurrence_Of (Id, Default_Loc));
Set_Assignment_OK (Lhs);
if Nkind (Exp) = N_Aggregate
and then Has_Discriminants (Typ)
and then not Is_Constrained (Base_Type (Typ))
then
-- The aggregate may provide new values for the discriminants
-- of the component, and other components may depend on those
-- discriminants. Previous analysis of those expressions have
-- replaced the discriminants by the formals of the initialization
-- procedure for the type, but these are irrelevant in the
-- enclosing initialization procedure: those discriminant
-- references must be replaced by the values provided in the
-- aggregate.
Replace_Discriminant_References (Exp);
end if;
-- Case of an access attribute applied to the current instance.
-- Replace the reference to the type by a reference to the actual
-- object. (Note that this handles the case of the top level of
-- the expression being given by such an attribute, but does not
-- cover uses nested within an initial value expression. Nested
-- uses are unlikely to occur in practice, but are theoretically
-- possible.) It is not clear how to handle them without fully
-- traversing the expression. ???
if Kind = N_Attribute_Reference
and then Attribute_Name (Default) in Name_Unchecked_Access
| Name_Unrestricted_Access
and then Is_Entity_Name (Prefix (Default))
and then Is_Type (Entity (Prefix (Default)))
and then Entity (Prefix (Default)) = Rec_Type
then
Exp :=
Make_Attribute_Reference (Default_Loc,
Prefix =>
Make_Identifier (Default_Loc, Name_uInit),
Attribute_Name => Name_Unrestricted_Access);
end if;
-- Take a copy of Exp to ensure that later copies of this component
-- declaration in derived types see the original tree, not a node
-- rewritten during expansion of the init_proc. If the copy contains
-- itypes, the scope of the new itypes is the init_proc being built.
Exp := New_Copy_Tree (Exp, New_Scope => Proc_Id);
Res := New_List (
Make_Assignment_Statement (Loc,
Name => Lhs,
Expression => Exp));
Set_No_Ctrl_Actions (First (Res));
-- Adjust the tag if tagged (because of possible view conversions).
-- Suppress the tag adjustment when not Tagged_Type_Expansion because
-- tags are represented implicitly in objects, and when the record is
-- initialized with a raise expression.
if Is_Tagged_Type (Typ)
and then Tagged_Type_Expansion
and then Nkind (Exp) /= N_Raise_Expression
and then (Nkind (Exp) /= N_Qualified_Expression
or else Nkind (Expression (Exp)) /= N_Raise_Expression)
then
Append_To (Res,
Make_Assignment_Statement (Default_Loc,
Name =>
Make_Selected_Component (Default_Loc,
Prefix =>
New_Copy_Tree (Lhs, New_Scope => Proc_Id),
Selector_Name =>
New_Occurrence_Of
(First_Tag_Component (Typ), Default_Loc)),
Expression =>
Unchecked_Convert_To (RTE (RE_Tag),
New_Occurrence_Of
(Node (First_Elmt (Access_Disp_Table (Underlying_Type
(Typ)))),
Default_Loc))));
end if;
-- Adjust the component if controlled except if it is an aggregate
-- that will be expanded inline.
if Kind = N_Qualified_Expression then
Kind := Nkind (Expression (Default));
end if;
if Needs_Finalization (Typ)
and then Kind not in N_Aggregate | N_Extension_Aggregate
and then not Is_Build_In_Place_Function_Call (Exp)
then
Adj_Call :=
Make_Adjust_Call
(Obj_Ref => New_Copy_Tree (Lhs),
Typ => Etype (Id));
-- Guard against a missing [Deep_]Adjust when the component type
-- was not properly frozen.
if Present (Adj_Call) then
Append_To (Res, Adj_Call);
end if;
end if;
-- If a component type has a predicate, add check to the component
-- assignment. Discriminants are handled at the point of the call,
-- which provides for a better error message.
if Comes_From_Source (Exp)
and then Predicate_Enabled (Typ)
then
Append (Make_Predicate_Check (Typ, Exp), Res);
end if;
return Res;
exception
when RE_Not_Available =>
return Empty_List;
end Build_Assignment;
------------------------------------
-- Build_Discriminant_Assignments --
------------------------------------
procedure Build_Discriminant_Assignments (Statement_List : List_Id) is
Is_Tagged : constant Boolean := Is_Tagged_Type (Rec_Type);
D : Entity_Id;
D_Loc : Source_Ptr;
begin
if Has_Discriminants (Rec_Type)
and then not Is_Unchecked_Union (Rec_Type)
then
D := First_Discriminant (Rec_Type);
while Present (D) loop
-- Don't generate the assignment for discriminants in derived
-- tagged types if the discriminant is a renaming of some
-- ancestor discriminant. This initialization will be done
-- when initializing the _parent field of the derived record.
if Is_Tagged
and then Present (Corresponding_Discriminant (D))
then
null;
else
D_Loc := Sloc (D);
Append_List_To (Statement_List,
Build_Assignment (D,
New_Occurrence_Of (Discriminal (D), D_Loc)));
end if;
Next_Discriminant (D);
end loop;
end if;
end Build_Discriminant_Assignments;
--------------------------
-- Build_Init_Call_Thru --
--------------------------
function Build_Init_Call_Thru (Parameters : List_Id) return List_Id is
Parent_Proc : constant Entity_Id :=
Base_Init_Proc (Etype (Rec_Type));
Parent_Type : constant Entity_Id :=
Etype (First_Formal (Parent_Proc));
Uparent_Type : constant Entity_Id :=
Underlying_Type (Parent_Type);
First_Discr_Param : Node_Id;
Arg : Node_Id;
Args : List_Id;
First_Arg : Node_Id;
Parent_Discr : Entity_Id;
Res : List_Id;
begin
-- First argument (_Init) is the object to be initialized.
-- ??? not sure where to get a reasonable Loc for First_Arg
First_Arg :=
OK_Convert_To (Parent_Type,
New_Occurrence_Of
(Defining_Identifier (First (Parameters)), Loc));
Set_Etype (First_Arg, Parent_Type);
Args := New_List (Convert_Concurrent (First_Arg, Rec_Type));
-- In the tasks case,
-- add _Master as the value of the _Master parameter
-- add _Chain as the value of the _Chain parameter.
-- add _Task_Name as the value of the _Task_Name parameter.
-- At the outer level, these will be variables holding the
-- corresponding values obtained from GNARL or the expander.
--
-- At inner levels, they will be the parameters passed down through
-- the outer routines.
First_Discr_Param := Next (First (Parameters));
if Has_Task (Rec_Type) then
if Restriction_Active (No_Task_Hierarchy) then
Append_To (Args,
New_Occurrence_Of (RTE (RE_Library_Task_Level), Loc));
else
Append_To (Args, Make_Identifier (Loc, Name_uMaster));
end if;
-- Add _Chain (not done for sequential elaboration policy, see
-- comment for Create_Restricted_Task_Sequential in s-tarest.ads).
if Partition_Elaboration_Policy /= 'S' then
Append_To (Args, Make_Identifier (Loc, Name_uChain));
end if;
Append_To (Args, Make_Identifier (Loc, Name_uTask_Name));
First_Discr_Param := Next (Next (Next (First_Discr_Param)));
end if;
-- Append discriminant values
if Has_Discriminants (Uparent_Type) then
pragma Assert (not Is_Tagged_Type (Uparent_Type));
Parent_Discr := First_Discriminant (Uparent_Type);
while Present (Parent_Discr) loop
-- Get the initial value for this discriminant
-- ??? needs to be cleaned up to use parent_Discr_Constr
-- directly.
declare
Discr : Entity_Id :=
First_Stored_Discriminant (Uparent_Type);
Discr_Value : Elmt_Id :=
First_Elmt (Stored_Constraint (Rec_Type));
begin
while Original_Record_Component (Parent_Discr) /= Discr loop
Next_Stored_Discriminant (Discr);
Next_Elmt (Discr_Value);
end loop;
Arg := Node (Discr_Value);
end;
-- Append it to the list
if Nkind (Arg) = N_Identifier
and then Ekind (Entity (Arg)) = E_Discriminant
then
Append_To (Args,
New_Occurrence_Of (Discriminal (Entity (Arg)), Loc));
-- Case of access discriminants. We replace the reference
-- to the type by a reference to the actual object.
-- Is above comment right??? Use of New_Copy below seems mighty
-- suspicious ???
else
Append_To (Args, New_Copy (Arg));
end if;
Next_Discriminant (Parent_Discr);
end loop;
end if;
Res :=
New_List (
Make_Procedure_Call_Statement (Loc,
Name =>
New_Occurrence_Of (Parent_Proc, Loc),
Parameter_Associations => Args));
return Res;
end Build_Init_Call_Thru;
-----------------------------------
-- Build_Offset_To_Top_Functions --
-----------------------------------
procedure Build_Offset_To_Top_Functions is
procedure Build_Offset_To_Top_Function (Iface_Comp : Entity_Id);
-- Generate:
-- function Fxx (O : Address) return Storage_Offset is
-- type Acc is access all <Typ>;
-- begin
-- return Acc!(O).Iface_Comp'Position;
-- end Fxx;
----------------------------------
-- Build_Offset_To_Top_Function --
----------------------------------
procedure Build_Offset_To_Top_Function (Iface_Comp : Entity_Id) is
Body_Node : Node_Id;
Func_Id : Entity_Id;
Spec_Node : Node_Id;
Acc_Type : Entity_Id;
begin
Func_Id := Make_Temporary (Loc, 'F');
Set_DT_Offset_To_Top_Func (Iface_Comp, Func_Id);
-- Generate
-- function Fxx (O : in Rec_Typ) return Storage_Offset;
Spec_Node := New_Node (N_Function_Specification, Loc);
Set_Defining_Unit_Name (Spec_Node, Func_Id);
Set_Parameter_Specifications (Spec_Node, New_List (
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_uO),
In_Present => True,
Parameter_Type =>
New_Occurrence_Of (RTE (RE_Address), Loc))));
Set_Result_Definition (Spec_Node,
New_Occurrence_Of (RTE (RE_Storage_Offset), Loc));
-- Generate
-- function Fxx (O : in Rec_Typ) return Storage_Offset is
-- begin
-- return -O.Iface_Comp'Position;
-- end Fxx;
Body_Node := New_Node (N_Subprogram_Body, Loc);
Set_Specification (Body_Node, Spec_Node);
Acc_Type := Make_Temporary (Loc, 'T');
Set_Declarations (Body_Node, New_List (
Make_Full_Type_Declaration (Loc,
Defining_Identifier => Acc_Type,
Type_Definition =>
Make_Access_To_Object_Definition (Loc,
All_Present => True,
Null_Exclusion_Present => False,
Constant_Present => False,
Subtype_Indication =>
New_Occurrence_Of (Rec_Type, Loc)))));
Set_Handled_Statement_Sequence (Body_Node,
Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List (
Make_Simple_Return_Statement (Loc,
Expression =>
Make_Op_Minus (Loc,
Make_Attribute_Reference (Loc,
Prefix =>
Make_Selected_Component (Loc,
Prefix =>
Make_Explicit_Dereference (Loc,
Unchecked_Convert_To (Acc_Type,
Make_Identifier (Loc, Name_uO))),
Selector_Name =>
New_Occurrence_Of (Iface_Comp, Loc)),
Attribute_Name => Name_Position))))));
Set_Ekind (Func_Id, E_Function);
Set_Mechanism (Func_Id, Default_Mechanism);
Set_Is_Internal (Func_Id, True);
if not Debug_Generated_Code then
Set_Debug_Info_Off (Func_Id);
end if;
Analyze (Body_Node);
Append_Freeze_Action (Rec_Type, Body_Node);
end Build_Offset_To_Top_Function;
-- Local variables
Iface_Comp : Node_Id;
Iface_Comp_Elmt : Elmt_Id;
Ifaces_Comp_List : Elist_Id;
-- Start of processing for Build_Offset_To_Top_Functions
begin
-- Offset_To_Top_Functions are built only for derivations of types
-- with discriminants that cover interface types.
-- Nothing is needed either in case of virtual targets, since
-- interfaces are handled directly by the target.
if not Is_Tagged_Type (Rec_Type)
or else Etype (Rec_Type) = Rec_Type
or else not Has_Discriminants (Etype (Rec_Type))
or else not Tagged_Type_Expansion
then
return;
end if;
Collect_Interface_Components (Rec_Type, Ifaces_Comp_List);
-- For each interface type with secondary dispatch table we generate
-- the Offset_To_Top_Functions (required to displace the pointer in
-- interface conversions)
Iface_Comp_Elmt := First_Elmt (Ifaces_Comp_List);
while Present (Iface_Comp_Elmt) loop
Iface_Comp := Node (Iface_Comp_Elmt);
pragma Assert (Is_Interface (Related_Type (Iface_Comp)));
-- If the interface is a parent of Rec_Type it shares the primary
-- dispatch table and hence there is no need to build the function
if not Is_Ancestor (Related_Type (Iface_Comp), Rec_Type,
Use_Full_View => True)
then
Build_Offset_To_Top_Function (Iface_Comp);
end if;
Next_Elmt (Iface_Comp_Elmt);
end loop;
end Build_Offset_To_Top_Functions;
------------------------------
-- Build_CPP_Init_Procedure --
------------------------------
procedure Build_CPP_Init_Procedure is
Body_Node : Node_Id;
Body_Stmts : List_Id;
Flag_Id : Entity_Id;
Handled_Stmt_Node : Node_Id;
Init_Tags_List : List_Id;
Proc_Id : Entity_Id;
Proc_Spec_Node : Node_Id;
begin
-- Check cases requiring no IC routine
if not Is_CPP_Class (Root_Type (Rec_Type))
or else Is_CPP_Class (Rec_Type)
or else CPP_Num_Prims (Rec_Type) = 0
or else not Tagged_Type_Expansion
or else No_Run_Time_Mode
then
return;
end if;
-- Generate:
-- Flag : Boolean := False;
--
-- procedure Typ_IC is
-- begin
-- if not Flag then
-- Copy C++ dispatch table slots from parent
-- Update C++ slots of overridden primitives
-- end if;
-- end;
Flag_Id := Make_Temporary (Loc, 'F');
Append_Freeze_Action (Rec_Type,
Make_Object_Declaration (Loc,
Defining_Identifier => Flag_Id,
Object_Definition =>
New_Occurrence_Of (Standard_Boolean, Loc),
Expression =>
New_Occurrence_Of (Standard_True, Loc)));
Body_Stmts := New_List;
Body_Node := New_Node (N_Subprogram_Body, Loc);
Proc_Spec_Node := New_Node (N_Procedure_Specification, Loc);
Proc_Id :=
Make_Defining_Identifier (Loc,
Chars => Make_TSS_Name (Rec_Type, TSS_CPP_Init_Proc));
Set_Ekind (Proc_Id, E_Procedure);
Set_Is_Internal (Proc_Id);
Set_Defining_Unit_Name (Proc_Spec_Node, Proc_Id);
Set_Parameter_Specifications (Proc_Spec_Node, New_List);
Set_Specification (Body_Node, Proc_Spec_Node);
Set_Declarations (Body_Node, New_List);
Init_Tags_List := Build_Inherit_CPP_Prims (Rec_Type);
Append_To (Init_Tags_List,
Make_Assignment_Statement (Loc,
Name =>
New_Occurrence_Of (Flag_Id, Loc),
Expression =>
New_Occurrence_Of (Standard_False, Loc)));
Append_To (Body_Stmts,
Make_If_Statement (Loc,
Condition => New_Occurrence_Of (Flag_Id, Loc),
Then_Statements => Init_Tags_List));
Handled_Stmt_Node :=
New_Node (N_Handled_Sequence_Of_Statements, Loc);
Set_Statements (Handled_Stmt_Node, Body_Stmts);
Set_Exception_Handlers (Handled_Stmt_Node, No_List);
Set_Handled_Statement_Sequence (Body_Node, Handled_Stmt_Node);
if not Debug_Generated_Code then
Set_Debug_Info_Off (Proc_Id);
end if;
-- Associate CPP_Init_Proc with type
Set_Init_Proc (Rec_Type, Proc_Id);
end Build_CPP_Init_Procedure;
--------------------------
-- Build_Init_Procedure --
--------------------------
procedure Build_Init_Procedure is
Body_Stmts : List_Id;
Body_Node : Node_Id;
Handled_Stmt_Node : Node_Id;
Init_Tags_List : List_Id;
Parameters : List_Id;
Proc_Spec_Node : Node_Id;
Record_Extension_Node : Node_Id;
begin
Body_Stmts := New_List;
Body_Node := New_Node (N_Subprogram_Body, Loc);
Set_Ekind (Proc_Id, E_Procedure);
Proc_Spec_Node := New_Node (N_Procedure_Specification, Loc);
Set_Defining_Unit_Name (Proc_Spec_Node, Proc_Id);
Parameters := Init_Formals (Rec_Type, Proc_Id);
Append_List_To (Parameters,
Build_Discriminant_Formals (Rec_Type, True));
-- For tagged types, we add a flag to indicate whether the routine
-- is called to initialize a parent component in the init_proc of
-- a type extension. If the flag is false, we do not set the tag
-- because it has been set already in the extension.
if Is_Tagged_Type (Rec_Type) then
Set_Tag := Make_Temporary (Loc, 'P');
Append_To (Parameters,
Make_Parameter_Specification (Loc,
Defining_Identifier => Set_Tag,
Parameter_Type =>
New_Occurrence_Of (Standard_Boolean, Loc),
Expression =>
New_Occurrence_Of (Standard_True, Loc)));
end if;
Set_Parameter_Specifications (Proc_Spec_Node, Parameters);
Set_Specification (Body_Node, Proc_Spec_Node);
Set_Declarations (Body_Node, Decls);
-- N is a Derived_Type_Definition that renames the parameters of the
-- ancestor type. We initialize it by expanding our discriminants and
-- call the ancestor _init_proc with a type-converted object.
if Parent_Subtype_Renaming_Discrims then
Append_List_To (Body_Stmts, Build_Init_Call_Thru (Parameters));
elsif Nkind (Type_Definition (N)) = N_Record_Definition then
Build_Discriminant_Assignments (Body_Stmts);
if not Null_Present (Type_Definition (N)) then
Append_List_To (Body_Stmts,
Build_Init_Statements (Component_List (Type_Definition (N))));
end if;
-- N is a Derived_Type_Definition with a possible non-empty
-- extension. The initialization of a type extension consists in the
-- initialization of the components in the extension.
else
Build_Discriminant_Assignments (Body_Stmts);
Record_Extension_Node :=
Record_Extension_Part (Type_Definition (N));
if not Null_Present (Record_Extension_Node) then
declare
Stmts : constant List_Id :=
Build_Init_Statements (
Component_List (Record_Extension_Node));
begin
-- The parent field must be initialized first because the
-- offset of the new discriminants may depend on it. This is
-- not needed if the parent is an interface type because in
-- such case the initialization of the _parent field was not
-- generated.
if not Is_Interface (Etype (Rec_Ent)) then
declare
Parent_IP : constant Name_Id :=
Make_Init_Proc_Name (Etype (Rec_Ent));
Stmt : Node_Id;
IP_Call : Node_Id;
IP_Stmts : List_Id;
begin
-- Look for a call to the parent IP at the beginning
-- of Stmts associated with the record extension
Stmt := First (Stmts);
IP_Call := Empty;
while Present (Stmt) loop
if Nkind (Stmt) = N_Procedure_Call_Statement
and then Chars (Name (Stmt)) = Parent_IP
then
IP_Call := Stmt;
exit;
end if;
Next (Stmt);
end loop;
-- If found then move it to the beginning of the
-- statements of this IP routine
if Present (IP_Call) then
IP_Stmts := New_List;
loop
Stmt := Remove_Head (Stmts);
Append_To (IP_Stmts, Stmt);
exit when Stmt = IP_Call;
end loop;
Prepend_List_To (Body_Stmts, IP_Stmts);
end if;
end;
end if;
Append_List_To (Body_Stmts, Stmts);
end;
end if;
end if;
-- Add here the assignment to instantiate the Tag
-- The assignment corresponds to the code:
-- _Init._Tag := Typ'Tag;
-- Suppress the tag assignment when not Tagged_Type_Expansion because
-- tags are represented implicitly in objects. It is also suppressed
-- in case of CPP_Class types because in this case the tag is
-- initialized in the C++ side.
if Is_Tagged_Type (Rec_Type)
and then Tagged_Type_Expansion
and then not No_Run_Time_Mode
then
-- Case 1: Ada tagged types with no CPP ancestor. Set the tags of
-- the actual object and invoke the IP of the parent (in this
-- order). The tag must be initialized before the call to the IP
-- of the parent and the assignments to other components because
-- the initial value of the components may depend on the tag (eg.
-- through a dispatching operation on an access to the current
-- type). The tag assignment is not done when initializing the
-- parent component of a type extension, because in that case the
-- tag is set in the extension.
if not Is_CPP_Class (Root_Type (Rec_Type)) then
-- Initialize the primary tag component
Init_Tags_List := New_List (
Make_Assignment_Statement (Loc,
Name =>
Make_Selected_Component (Loc,
Prefix => Make_Identifier (Loc, Name_uInit),
Selector_Name =>
New_Occurrence_Of
(First_Tag_Component (Rec_Type), Loc)),
Expression =>
New_Occurrence_Of
(Node
(First_Elmt (Access_Disp_Table (Rec_Type))), Loc)));
-- Ada 2005 (AI-251): Initialize the secondary tags components
-- located at fixed positions (tags whose position depends on
-- variable size components are initialized later ---see below)
if Ada_Version >= Ada_2005
and then not Is_Interface (Rec_Type)
and then Has_Interfaces (Rec_Type)
then
declare
Elab_Sec_DT_Stmts_List : constant List_Id := New_List;
Elab_List : List_Id := New_List;
begin
Init_Secondary_Tags
(Typ => Rec_Type,
Target => Make_Identifier (Loc, Name_uInit),
Init_Tags_List => Init_Tags_List,
Stmts_List => Elab_Sec_DT_Stmts_List,
Fixed_Comps => True,
Variable_Comps => False);
Elab_List := New_List (
Make_If_Statement (Loc,
Condition => New_Occurrence_Of (Set_Tag, Loc),
Then_Statements => Init_Tags_List));
if Elab_Flag_Needed (Rec_Type) then
Append_To (Elab_Sec_DT_Stmts_List,
Make_Assignment_Statement (Loc,
Name =>
New_Occurrence_Of
(Access_Disp_Table_Elab_Flag (Rec_Type),
Loc),
Expression =>
New_Occurrence_Of (Standard_False, Loc)));
Append_To (Elab_List,
Make_If_Statement (Loc,
Condition =>
New_Occurrence_Of
(Access_Disp_Table_Elab_Flag (Rec_Type), Loc),
Then_Statements => Elab_Sec_DT_Stmts_List));
end if;
Prepend_List_To (Body_Stmts, Elab_List);
end;
else
Prepend_To (Body_Stmts,
Make_If_Statement (Loc,
Condition => New_Occurrence_Of (Set_Tag, Loc),
Then_Statements => Init_Tags_List));
end if;
-- Case 2: CPP type. The imported C++ constructor takes care of
-- tags initialization. No action needed here because the IP
-- is built by Set_CPP_Constructors; in this case the IP is a
-- wrapper that invokes the C++ constructor and copies the C++
-- tags locally. Done to inherit the C++ slots in Ada derivations
-- (see case 3).
elsif Is_CPP_Class (Rec_Type) then
pragma Assert (False);
null;
-- Case 3: Combined hierarchy containing C++ types and Ada tagged
-- type derivations. Derivations of imported C++ classes add a
-- complication, because we cannot inhibit tag setting in the
-- constructor for the parent. Hence we initialize the tag after
-- the call to the parent IP (that is, in reverse order compared
-- with pure Ada hierarchies ---see comment on case 1).
else
-- Initialize the primary tag
Init_Tags_List := New_List (
Make_Assignment_Statement (Loc,
Name =>
Make_Selected_Component (Loc,
Prefix => Make_Identifier (Loc, Name_uInit),
Selector_Name =>
New_Occurrence_Of
(First_Tag_Component (Rec_Type), Loc)),
Expression =>
New_Occurrence_Of
(Node
(First_Elmt (Access_Disp_Table (Rec_Type))), Loc)));
-- Ada 2005 (AI-251): Initialize the secondary tags components
-- located at fixed positions (tags whose position depends on
-- variable size components are initialized later ---see below)
if Ada_Version >= Ada_2005
and then not Is_Interface (Rec_Type)
and then Has_Interfaces (Rec_Type)
then
Init_Secondary_Tags
(Typ => Rec_Type,
Target => Make_Identifier (Loc, Name_uInit),
Init_Tags_List => Init_Tags_List,
Stmts_List => Init_Tags_List,
Fixed_Comps => True,
Variable_Comps => False);
end if;
-- Initialize the tag component after invocation of parent IP.
-- Generate:
-- parent_IP(_init.parent); // Invokes the C++ constructor
-- [ typIC; ] // Inherit C++ slots from parent
-- init_tags
declare
Ins_Nod : Node_Id;
begin
-- Search for the call to the IP of the parent. We assume
-- that the first init_proc call is for the parent.
Ins_Nod := First (Body_Stmts);
while Present (Next (Ins_Nod))
and then (Nkind (Ins_Nod) /= N_Procedure_Call_Statement
or else not Is_Init_Proc (Name (Ins_Nod)))
loop
Next (Ins_Nod);
end loop;
-- The IC routine copies the inherited slots of the C+ part
-- of the dispatch table from the parent and updates the
-- overridden C++ slots.
if CPP_Num_Prims (Rec_Type) > 0 then
declare
Init_DT : Entity_Id;
New_Nod : Node_Id;
begin
Init_DT := CPP_Init_Proc (Rec_Type);
pragma Assert (Present (Init_DT));
New_Nod :=
Make_Procedure_Call_Statement (Loc,
New_Occurrence_Of (Init_DT, Loc));
Insert_After (Ins_Nod, New_Nod);
-- Update location of init tag statements
Ins_Nod := New_Nod;
end;
end if;
Insert_List_After (Ins_Nod, Init_Tags_List);
end;
end if;
-- Ada 2005 (AI-251): Initialize the secondary tag components
-- located at variable positions. We delay the generation of this
-- code until here because the value of the attribute 'Position
-- applied to variable size components of the parent type that
-- depend on discriminants is only safely read at runtime after
-- the parent components have been initialized.
if Ada_Version >= Ada_2005
and then not Is_Interface (Rec_Type)
and then Has_Interfaces (Rec_Type)
and then Has_Discriminants (Etype (Rec_Type))
and then Is_Variable_Size_Record (Etype (Rec_Type))
then
Init_Tags_List := New_List;
Init_Secondary_Tags
(Typ => Rec_Type,
Target => Make_Identifier (Loc, Name_uInit),
Init_Tags_List => Init_Tags_List,
Stmts_List => Init_Tags_List,
Fixed_Comps => False,
Variable_Comps => True);
if Is_Non_Empty_List (Init_Tags_List) then
Append_List_To (Body_Stmts, Init_Tags_List);
end if;
end if;
end if;
Handled_Stmt_Node := New_Node (N_Handled_Sequence_Of_Statements, Loc);
Set_Statements (Handled_Stmt_Node, Body_Stmts);
-- Generate:
-- Deep_Finalize (_init, C1, ..., CN);
-- raise;
if Counter > 0
and then Needs_Finalization (Rec_Type)
and then not Is_Abstract_Type (Rec_Type)
and then not Restriction_Active (No_Exception_Propagation)
then
declare
DF_Call : Node_Id;
DF_Id : Entity_Id;
begin
-- Create a local version of Deep_Finalize which has indication
-- of partial initialization state.
DF_Id :=
Make_Defining_Identifier (Loc,
Chars => New_External_Name (Name_uFinalizer));
Append_To (Decls, Make_Local_Deep_Finalize (Rec_Type, DF_Id));
DF_Call :=
Make_Procedure_Call_Statement (Loc,
Name => New_Occurrence_Of (DF_Id, Loc),
Parameter_Associations => New_List (
Make_Identifier (Loc, Name_uInit),
New_Occurrence_Of (Standard_False, Loc)));
-- Do not emit warnings related to the elaboration order when a
-- controlled object is declared before the body of Finalize is
-- seen.
if Legacy_Elaboration_Checks then
Set_No_Elaboration_Check (DF_Call);
end if;
Set_Exception_Handlers (Handled_Stmt_Node, New_List (
Make_Exception_Handler (Loc,
Exception_Choices => New_List (
Make_Others_Choice (Loc)),
Statements => New_List (
DF_Call,
Make_Raise_Statement (Loc)))));
end;
else
Set_Exception_Handlers (Handled_Stmt_Node, No_List);
end if;
Set_Handled_Statement_Sequence (Body_Node, Handled_Stmt_Node);
if not Debug_Generated_Code then
Set_Debug_Info_Off (Proc_Id);
end if;
-- Associate Init_Proc with type, and determine if the procedure
-- is null (happens because of the Initialize_Scalars pragma case,
-- where we have to generate a null procedure in case it is called
-- by a client with Initialize_Scalars set). Such procedures have
-- to be generated, but do not have to be called, so we mark them
-- as null to suppress the call. Kill also warnings for the _Init
-- out parameter, which is left entirely uninitialized.
Set_Init_Proc (Rec_Type, Proc_Id);
if Is_Null_Statement_List (Body_Stmts) then
Set_Is_Null_Init_Proc (Proc_Id);
Set_Warnings_Off (Defining_Identifier (First (Parameters)));
end if;
end Build_Init_Procedure;
---------------------------
-- Build_Init_Statements --
---------------------------
function Build_Init_Statements (Comp_List : Node_Id) return List_Id is
Checks : constant List_Id := New_List;
Actions : List_Id := No_List;
Counter_Id : Entity_Id := Empty;
Comp_Loc : Source_Ptr;
Decl : Node_Id;
Has_Late_Init_Comp : Boolean;
Id : Entity_Id;
Parent_Stmts : List_Id;
Stmts : List_Id;
Typ : Entity_Id;
procedure Increment_Counter (Loc : Source_Ptr);
-- Generate an "increment by one" statement for the current counter
-- and append it to the list Stmts.
procedure Make_Counter (Loc : Source_Ptr);
-- Create a new counter for the current component list. The routine
-- creates a new defining Id, adds an object declaration and sets
-- the Id generator for the next variant.
function Requires_Late_Initialization
(Decl : Node_Id;
Rec_Type : Entity_Id) return Boolean;
-- Return whether the given Decl requires late initialization, as
-- defined by 3.3.1 (8.1/5).
-----------------------
-- Increment_Counter --
-----------------------
procedure Increment_Counter (Loc : Source_Ptr) is
begin
-- Generate:
-- Counter := Counter + 1;
Append_To (Stmts,
Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (Counter_Id, Loc),
Expression =>
Make_Op_Add (Loc,
Left_Opnd => New_Occurrence_Of (Counter_Id, Loc),
Right_Opnd => Make_Integer_Literal (Loc, 1))));
end Increment_Counter;
------------------
-- Make_Counter --
------------------
procedure Make_Counter (Loc : Source_Ptr) is
begin
-- Increment the Id generator
Counter := Counter + 1;
-- Create the entity and declaration
Counter_Id :=
Make_Defining_Identifier (Loc,
Chars => New_External_Name ('C', Counter));
-- Generate:
-- Cnn : Integer := 0;
Append_To (Decls,
Make_Object_Declaration (Loc,
Defining_Identifier => Counter_Id,
Object_Definition =>
New_Occurrence_Of (Standard_Integer, Loc),
Expression =>
Make_Integer_Literal (Loc, 0)));
end Make_Counter;
----------------------------------
-- Requires_Late_Initialization --
----------------------------------
function Requires_Late_Initialization
(Decl : Node_Id;
Rec_Type : Entity_Id) return Boolean
is
References_Current_Instance : Boolean := False;
Has_Access_Discriminant : Boolean := False;
Has_Internal_Call : Boolean := False;
function Find_Access_Discriminant
(N : Node_Id) return Traverse_Result;
-- Look for a name denoting an access discriminant
function Find_Current_Instance
(N : Node_Id) return Traverse_Result;
-- Look for a reference to the current instance of the type
function Find_Internal_Call
(N : Node_Id) return Traverse_Result;
-- Look for an internal protected function call
------------------------------
-- Find_Access_Discriminant --
------------------------------
function Find_Access_Discriminant
(N : Node_Id) return Traverse_Result is
begin
if Is_Entity_Name (N)
and then Denotes_Discriminant (N)
and then Is_Access_Type (Etype (N))
then
Has_Access_Discriminant := True;
return Abandon;
else
return OK;
end if;
end Find_Access_Discriminant;
---------------------------
-- Find_Current_Instance --
---------------------------
function Find_Current_Instance
(N : Node_Id) return Traverse_Result is
begin
if Nkind (N) = N_Attribute_Reference
and then Is_Access_Type (Etype (N))
and then Is_Entity_Name (Prefix (N))
and then Is_Type (Entity (Prefix (N)))
then
References_Current_Instance := True;
return Abandon;
else
return OK;
end if;
end Find_Current_Instance;
------------------------
-- Find_Internal_Call --
------------------------
function Find_Internal_Call (N : Node_Id) return Traverse_Result is
function Call_Scope (N : Node_Id) return Entity_Id;
-- Return the scope enclosing a given call node N
----------------
-- Call_Scope --
----------------
function Call_Scope (N : Node_Id) return Entity_Id is
Nam : constant Node_Id := Name (N);
begin
if Nkind (Nam) = N_Selected_Component then
return Scope (Entity (Prefix (Nam)));
else
return Scope (Entity (Nam));
end if;
end Call_Scope;
begin
if Nkind (N) = N_Function_Call
and then Call_Scope (N)
= Corresponding_Concurrent_Type (Rec_Type)
then
Has_Internal_Call := True;
return Abandon;
else
return OK;
end if;
end Find_Internal_Call;
procedure Search_Access_Discriminant is new
Traverse_Proc (Find_Access_Discriminant);
procedure Search_Current_Instance is new
Traverse_Proc (Find_Current_Instance);
procedure Search_Internal_Call is new
Traverse_Proc (Find_Internal_Call);
begin
-- A component of an object is said to require late initialization
-- if:
-- it has an access discriminant value constrained by a per-object
-- expression;
if Has_Access_Constraint (Defining_Identifier (Decl))
and then No (Expression (Decl))
then
return True;
elsif Present (Expression (Decl)) then
-- it has an initialization expression that includes a name
-- denoting an access discriminant;
Search_Access_Discriminant (Expression (Decl));
if Has_Access_Discriminant then
return True;
end if;
-- or it has an initialization expression that includes a
-- reference to the current instance of the type either by
-- name...
Search_Current_Instance (Expression (Decl));
if References_Current_Instance then
return True;
end if;
-- ...or implicitly as the target object of a call.
if Is_Protected_Record_Type (Rec_Type) then
Search_Internal_Call (Expression (Decl));
if Has_Internal_Call then
return True;
end if;
end if;
end if;
return False;
end Requires_Late_Initialization;
-- Start of processing for Build_Init_Statements
begin
if Null_Present (Comp_List) then
return New_List (Make_Null_Statement (Loc));
end if;
Parent_Stmts := New_List;
Stmts := New_List;
-- Loop through visible declarations of task types and protected
-- types moving any expanded code from the spec to the body of the
-- init procedure.
if Is_Task_Record_Type (Rec_Type)
or else Is_Protected_Record_Type (Rec_Type)
then
declare
Decl : constant Node_Id :=
Parent (Corresponding_Concurrent_Type (Rec_Type));
Def : Node_Id;
N1 : Node_Id;
N2 : Node_Id;
begin
if Is_Task_Record_Type (Rec_Type) then
Def := Task_Definition (Decl);
else
Def := Protected_Definition (Decl);
end if;
if Present (Def) then
N1 := First (Visible_Declarations (Def));
while Present (N1) loop
N2 := N1;
N1 := Next (N1);
if Nkind (N2) in N_Statement_Other_Than_Procedure_Call
or else Nkind (N2) in N_Raise_xxx_Error
or else Nkind (N2) = N_Procedure_Call_Statement
then
Append_To (Stmts,
New_Copy_Tree (N2, New_Scope => Proc_Id));
Rewrite (N2, Make_Null_Statement (Sloc (N2)));
Analyze (N2);
end if;
end loop;
end if;
end;
end if;
-- Loop through components, skipping pragmas, in 2 steps. The first
-- step deals with regular components. The second step deals with
-- components that require late initialization.
Has_Late_Init_Comp := False;
-- First pass : regular components
Decl := First_Non_Pragma (Component_Items (Comp_List));
while Present (Decl) loop
Comp_Loc := Sloc (Decl);
Build_Record_Checks
(Subtype_Indication (Component_Definition (Decl)), Checks);
Id := Defining_Identifier (Decl);
Typ := Etype (Id);
-- Leave any processing of component requiring late initialization
-- for the second pass.
if Requires_Late_Initialization (Decl, Rec_Type) then
Has_Late_Init_Comp := True;
-- Regular component cases
else
-- In the context of the init proc, references to discriminants
-- resolve to denote the discriminals: this is where we can
-- freeze discriminant dependent component subtypes.
if not Is_Frozen (Typ) then
Append_List_To (Stmts, Freeze_Entity (Typ, N));
end if;
-- Explicit initialization
if Present (Expression (Decl)) then
if Is_CPP_Constructor_Call (Expression (Decl)) then
Actions :=
Build_Initialization_Call
(Comp_Loc,
Id_Ref =>
Make_Selected_Component (Comp_Loc,
Prefix =>
Make_Identifier (Comp_Loc, Name_uInit),
Selector_Name =>
New_Occurrence_Of (Id, Comp_Loc)),
Typ => Typ,
In_Init_Proc => True,
Enclos_Type => Rec_Type,
Discr_Map => Discr_Map,
Constructor_Ref => Expression (Decl));
else
Actions := Build_Assignment (Id, Expression (Decl));
end if;
-- CPU, Dispatching_Domain, Priority, and Secondary_Stack_Size
-- components are filled in with the corresponding rep-item
-- expression of the concurrent type (if any).
elsif Ekind (Scope (Id)) = E_Record_Type
and then Present (Corresponding_Concurrent_Type (Scope (Id)))
and then Chars (Id) in Name_uCPU
| Name_uDispatching_Domain
| Name_uPriority
| Name_uSecondary_Stack_Size
then
declare
Exp : Node_Id;
Nam : Name_Id;
pragma Warnings (Off, Nam);
Ritem : Node_Id;
begin
if Chars (Id) = Name_uCPU then
Nam := Name_CPU;
elsif Chars (Id) = Name_uDispatching_Domain then
Nam := Name_Dispatching_Domain;
elsif Chars (Id) = Name_uPriority then
Nam := Name_Priority;
elsif Chars (Id) = Name_uSecondary_Stack_Size then
Nam := Name_Secondary_Stack_Size;
end if;
-- Get the Rep Item (aspect specification, attribute
-- definition clause or pragma) of the corresponding
-- concurrent type.
Ritem :=
Get_Rep_Item
(Corresponding_Concurrent_Type (Scope (Id)),
Nam,
Check_Parents => False);
if Present (Ritem) then
-- Pragma case
if Nkind (Ritem) = N_Pragma then
Exp := First (Pragma_Argument_Associations (Ritem));
if Nkind (Exp) = N_Pragma_Argument_Association then
Exp := Expression (Exp);
end if;
-- Conversion for Priority expression
if Nam = Name_Priority then
if Pragma_Name (Ritem) = Name_Priority
and then not GNAT_Mode
then
Exp := Convert_To (RTE (RE_Priority), Exp);
else
Exp :=
Convert_To (RTE (RE_Any_Priority), Exp);
end if;
end if;
-- Aspect/Attribute definition clause case
else
Exp := Expression (Ritem);
-- Conversion for Priority expression
if Nam = Name_Priority then
if Chars (Ritem) = Name_Priority
and then not GNAT_Mode
then
Exp := Convert_To (RTE (RE_Priority), Exp);
else
Exp :=
Convert_To (RTE (RE_Any_Priority), Exp);
end if;
end if;
end if;
-- Conversion for Dispatching_Domain value
if Nam = Name_Dispatching_Domain then
Exp :=
Unchecked_Convert_To
(RTE (RE_Dispatching_Domain_Access), Exp);
-- Conversion for Secondary_Stack_Size value
elsif Nam = Name_Secondary_Stack_Size then
Exp := Convert_To (RTE (RE_Size_Type), Exp);
end if;
Actions := Build_Assignment (Id, Exp);
-- Nothing needed if no Rep Item
else
Actions := No_List;
end if;
end;
-- Composite component with its own Init_Proc
elsif not Is_Interface (Typ)
and then Has_Non_Null_Base_Init_Proc (Typ)
then
Actions :=
Build_Initialization_Call
(Comp_Loc,
Make_Selected_Component (Comp_Loc,
Prefix =>
Make_Identifier (Comp_Loc, Name_uInit),
Selector_Name => New_Occurrence_Of (Id, Comp_Loc)),
Typ,
In_Init_Proc => True,
Enclos_Type => Rec_Type,
Discr_Map => Discr_Map);
Clean_Task_Names (Typ, Proc_Id);
-- Simple initialization
elsif Component_Needs_Simple_Initialization (Typ) then
Actions :=
Build_Assignment
(Id => Id,
Default =>
Get_Simple_Init_Val
(Typ => Typ,
N => N,
Size => Esize (Id)));
-- Nothing needed for this case
else
Actions := No_List;
end if;
if Present (Checks) then
if Chars (Id) = Name_uParent then
Append_List_To (Parent_Stmts, Checks);
else
Append_List_To (Stmts, Checks);
end if;
end if;
if Present (Actions) then
if Chars (Id) = Name_uParent then
Append_List_To (Parent_Stmts, Actions);
else
Append_List_To (Stmts, Actions);
-- Preserve initialization state in the current counter
if Needs_Finalization (Typ) then
if No (Counter_Id) then
Make_Counter (Comp_Loc);
end if;
Increment_Counter (Comp_Loc);
end if;
end if;
end if;
end if;
Next_Non_Pragma (Decl);
end loop;
-- The parent field must be initialized first because variable
-- size components of the parent affect the location of all the
-- new components.
Prepend_List_To (Stmts, Parent_Stmts);
-- Set up tasks and protected object support. This needs to be done
-- before any component with a per-object access discriminant
-- constraint, or any variant part (which may contain such
-- components) is initialized, because the initialization of these
-- components may reference the enclosing concurrent object.
-- For a task record type, add the task create call and calls to bind
-- any interrupt (signal) entries.
if Is_Task_Record_Type (Rec_Type) then
-- In the case of the restricted run time the ATCB has already
-- been preallocated.
if Restricted_Profile then
Append_To (Stmts,
Make_Assignment_Statement (Loc,
Name =>
Make_Selected_Component (Loc,
Prefix => Make_Identifier (Loc, Name_uInit),
Selector_Name => Make_Identifier (Loc, Name_uTask_Id)),
Expression =>
Make_Attribute_Reference (Loc,
Prefix =>
Make_Selected_Component (Loc,
Prefix => Make_Identifier (Loc, Name_uInit),
Selector_Name => Make_Identifier (Loc, Name_uATCB)),
Attribute_Name => Name_Unchecked_Access)));
end if;
Append_To (Stmts, Make_Task_Create_Call (Rec_Type));
declare
Task_Type : constant Entity_Id :=
Corresponding_Concurrent_Type (Rec_Type);
Task_Decl : constant Node_Id := Parent (Task_Type);
Task_Def : constant Node_Id := Task_Definition (Task_Decl);
Decl_Loc : Source_Ptr;
Ent : Entity_Id;
Vis_Decl : Node_Id;
begin
if Present (Task_Def) then
Vis_Decl := First (Visible_Declarations (Task_Def));
while Present (Vis_Decl) loop
Decl_Loc := Sloc (Vis_Decl);
if Nkind (Vis_Decl) = N_Attribute_Definition_Clause then
if Get_Attribute_Id (Chars (Vis_Decl)) =
Attribute_Address
then
Ent := Entity (Name (Vis_Decl));
if Ekind (Ent) = E_Entry then
Append_To (Stmts,
Make_Procedure_Call_Statement (Decl_Loc,
Name =>
New_Occurrence_Of (RTE (
RE_Bind_Interrupt_To_Entry), Decl_Loc),
Parameter_Associations => New_List (
Make_Selected_Component (Decl_Loc,
Prefix =>
Make_Identifier (Decl_Loc, Name_uInit),
Selector_Name =>
Make_Identifier
(Decl_Loc, Name_uTask_Id)),
Entry_Index_Expression
(Decl_Loc, Ent, Empty, Task_Type),
Expression (Vis_Decl))));
end if;
end if;
end if;
Next (Vis_Decl);
end loop;
end if;
end;
end if;
-- For a protected type, add statements generated by
-- Make_Initialize_Protection.
if Is_Protected_Record_Type (Rec_Type) then
Append_List_To (Stmts,
Make_Initialize_Protection (Rec_Type));
end if;
-- Second pass: components that require late initialization
if Has_Late_Init_Comp then
Decl := First_Non_Pragma (Component_Items (Comp_List));
while Present (Decl) loop
Comp_Loc := Sloc (Decl);
Id := Defining_Identifier (Decl);
Typ := Etype (Id);
if Requires_Late_Initialization (Decl, Rec_Type) then
if Present (Expression (Decl)) then
Append_List_To (Stmts,
Build_Assignment (Id, Expression (Decl)));
elsif Has_Non_Null_Base_Init_Proc (Typ) then
Append_List_To (Stmts,
Build_Initialization_Call (Comp_Loc,
Make_Selected_Component (Comp_Loc,
Prefix =>
Make_Identifier (Comp_Loc, Name_uInit),
Selector_Name => New_Occurrence_Of (Id, Comp_Loc)),
Typ,
In_Init_Proc => True,
Enclos_Type => Rec_Type,
Discr_Map => Discr_Map));
Clean_Task_Names (Typ, Proc_Id);
-- Preserve initialization state in the current counter
if Needs_Finalization (Typ) then
if No (Counter_Id) then
Make_Counter (Comp_Loc);
end if;
Increment_Counter (Comp_Loc);
end if;
elsif Component_Needs_Simple_Initialization (Typ) then
Append_List_To (Stmts,
Build_Assignment
(Id => Id,
Default =>
Get_Simple_Init_Val
(Typ => Typ,
N => N,
Size => Esize (Id))));
end if;
end if;
Next_Non_Pragma (Decl);
end loop;
end if;
-- Process the variant part
if Present (Variant_Part (Comp_List)) then
declare
Variant_Alts : constant List_Id := New_List;
Var_Loc : Source_Ptr := No_Location;
Variant : Node_Id;
begin
Variant :=
First_Non_Pragma (Variants (Variant_Part (Comp_List)));
while Present (Variant) loop
Var_Loc := Sloc (Variant);
Append_To (Variant_Alts,
Make_Case_Statement_Alternative (Var_Loc,
Discrete_Choices =>
New_Copy_List (Discrete_Choices (Variant)),
Statements =>
Build_Init_Statements (Component_List (Variant))));
Next_Non_Pragma (Variant);
end loop;
-- The expression of the case statement which is a reference
-- to one of the discriminants is replaced by the appropriate
-- formal parameter of the initialization procedure.
Append_To (Stmts,
Make_Case_Statement (Var_Loc,
Expression =>
New_Occurrence_Of (Discriminal (
Entity (Name (Variant_Part (Comp_List)))), Var_Loc),
Alternatives => Variant_Alts));
end;
end if;
-- If no initializations when generated for component declarations
-- corresponding to this Stmts, append a null statement to Stmts to
-- to make it a valid Ada tree.
if Is_Empty_List (Stmts) then
Append (Make_Null_Statement (Loc), Stmts);
end if;
return Stmts;
exception
when RE_Not_Available =>
return Empty_List;
end Build_Init_Statements;
-------------------------
-- Build_Record_Checks --
-------------------------
procedure Build_Record_Checks (S : Node_Id; Check_List : List_Id) is
Subtype_Mark_Id : Entity_Id;
procedure Constrain_Array
(SI : Node_Id;
Check_List : List_Id);
-- Apply a list of index constraints to an unconstrained array type.
-- The first parameter is the entity for the resulting subtype.
-- Check_List is a list to which the check actions are appended.
---------------------
-- Constrain_Array --
---------------------
procedure Constrain_Array
(SI : Node_Id;
Check_List : List_Id)
is
C : constant Node_Id := Constraint (SI);
Number_Of_Constraints : Nat := 0;
Index : Node_Id;
S, T : Entity_Id;
procedure Constrain_Index
(Index : Node_Id;
S : Node_Id;
Check_List : List_Id);
-- Process an index constraint in a constrained array declaration.
-- The constraint can be either a subtype name or a range with or
-- without an explicit subtype mark. Index is the corresponding
-- index of the unconstrained array. S is the range expression.
-- Check_List is a list to which the check actions are appended.
---------------------
-- Constrain_Index --
---------------------
procedure Constrain_Index
(Index : Node_Id;
S : Node_Id;
Check_List : List_Id)
is
T : constant Entity_Id := Etype (Index);
begin
if Nkind (S) = N_Range then
Process_Range_Expr_In_Decl (S, T, Check_List => Check_List);
end if;
end Constrain_Index;
-- Start of processing for Constrain_Array
begin
T := Entity (Subtype_Mark (SI));
if Is_Access_Type (T) then
T := Designated_Type (T);
end if;
S := First (Constraints (C));
while Present (S) loop
Number_Of_Constraints := Number_Of_Constraints + 1;
Next (S);
end loop;
-- In either case, the index constraint must provide a discrete
-- range for each index of the array type and the type of each
-- discrete range must be the same as that of the corresponding
-- index. (RM 3.6.1)
S := First (Constraints (C));
Index := First_Index (T);
Analyze (Index);
-- Apply constraints to each index type
for J in 1 .. Number_Of_Constraints loop
Constrain_Index (Index, S, Check_List);
Next (Index);
Next (S);
end loop;
end Constrain_Array;
-- Start of processing for Build_Record_Checks
begin
if Nkind (S) = N_Subtype_Indication then
Find_Type (Subtype_Mark (S));
Subtype_Mark_Id := Entity (Subtype_Mark (S));
-- Remaining processing depends on type
case Ekind (Subtype_Mark_Id) is
when Array_Kind =>
Constrain_Array (S, Check_List);
when others =>
null;
end case;
end if;
end Build_Record_Checks;
-------------------------------------------
-- Component_Needs_Simple_Initialization --
-------------------------------------------
function Component_Needs_Simple_Initialization
(T : Entity_Id) return Boolean
is
begin
return
Needs_Simple_Initialization (T)
and then not Is_RTE (T, RE_Tag)
-- Ada 2005 (AI-251): Check also the tag of abstract interfaces
and then not Is_RTE (T, RE_Interface_Tag);
end Component_Needs_Simple_Initialization;
--------------------------------------
-- Parent_Subtype_Renaming_Discrims --
--------------------------------------
function Parent_Subtype_Renaming_Discrims return Boolean is
De : Entity_Id;
Dp : Entity_Id;
begin
if Base_Type (Rec_Ent) /= Rec_Ent then
return False;
end if;
if Etype (Rec_Ent) = Rec_Ent
or else not Has_Discriminants (Rec_Ent)
or else Is_Constrained (Rec_Ent)
or else Is_Tagged_Type (Rec_Ent)
then
return False;
end if;
-- If there are no explicit stored discriminants we have inherited
-- the root type discriminants so far, so no renamings occurred.
if First_Discriminant (Rec_Ent) =
First_Stored_Discriminant (Rec_Ent)
then
return False;
end if;
-- Check if we have done some trivial renaming of the parent
-- discriminants, i.e. something like
--
-- type DT (X1, X2: int) is new PT (X1, X2);
De := First_Discriminant (Rec_Ent);
Dp := First_Discriminant (Etype (Rec_Ent));
while Present (De) loop
pragma Assert (Present (Dp));
if Corresponding_Discriminant (De) /= Dp then
return True;
end if;
Next_Discriminant (De);
Next_Discriminant (Dp);
end loop;
return Present (Dp);
end Parent_Subtype_Renaming_Discrims;
------------------------
-- Requires_Init_Proc --
------------------------
function Requires_Init_Proc (Rec_Id : Entity_Id) return Boolean is
Comp_Decl : Node_Id;
Id : Entity_Id;
Typ : Entity_Id;
begin
-- Definitely do not need one if specifically suppressed
if Initialization_Suppressed (Rec_Id) then
return False;
end if;
-- If it is a type derived from a type with unknown discriminants,
-- we cannot build an initialization procedure for it.
if Has_Unknown_Discriminants (Rec_Id)
or else Has_Unknown_Discriminants (Etype (Rec_Id))
then
return False;
end if;
-- Otherwise we need to generate an initialization procedure if
-- Is_CPP_Class is False and at least one of the following applies:
-- 1. Discriminants are present, since they need to be initialized
-- with the appropriate discriminant constraint expressions.
-- However, the discriminant of an unchecked union does not
-- count, since the discriminant is not present.
-- 2. The type is a tagged type, since the implicit Tag component
-- needs to be initialized with a pointer to the dispatch table.
-- 3. The type contains tasks
-- 4. One or more components has an initial value
-- 5. One or more components is for a type which itself requires
-- an initialization procedure.
-- 6. One or more components is a type that requires simple
-- initialization (see Needs_Simple_Initialization), except
-- that types Tag and Interface_Tag are excluded, since fields
-- of these types are initialized by other means.
-- 7. The type is the record type built for a task type (since at
-- the very least, Create_Task must be called)
-- 8. The type is the record type built for a protected type (since
-- at least Initialize_Protection must be called)
-- 9. The type is marked as a public entity. The reason we add this
-- case (even if none of the above apply) is to properly handle
-- Initialize_Scalars. If a package is compiled without an IS
-- pragma, and the client is compiled with an IS pragma, then
-- the client will think an initialization procedure is present
-- and call it, when in fact no such procedure is required, but
-- since the call is generated, there had better be a routine
-- at the other end of the call, even if it does nothing).
-- Note: the reason we exclude the CPP_Class case is because in this
-- case the initialization is performed by the C++ constructors, and
-- the IP is built by Set_CPP_Constructors.
if Is_CPP_Class (Rec_Id) then
return False;
elsif Is_Interface (Rec_Id) then
return False;
elsif (Has_Discriminants (Rec_Id)
and then not Is_Unchecked_Union (Rec_Id))
or else Is_Tagged_Type (Rec_Id)
or else Is_Concurrent_Record_Type (Rec_Id)
or else Has_Task (Rec_Id)
then
return True;
end if;
Id := First_Component (Rec_Id);
while Present (Id) loop
Comp_Decl := Parent (Id);
Typ := Etype (Id);
if Present (Expression (Comp_Decl))
or else Has_Non_Null_Base_Init_Proc (Typ)
or else Component_Needs_Simple_Initialization (Typ)
then
return True;
end if;
Next_Component (Id);
end loop;
-- As explained above, a record initialization procedure is needed
-- for public types in case Initialize_Scalars applies to a client.
-- However, such a procedure is not needed in the case where either
-- of restrictions No_Initialize_Scalars or No_Default_Initialization
-- applies. No_Initialize_Scalars excludes the possibility of using
-- Initialize_Scalars in any partition, and No_Default_Initialization
-- implies that no initialization should ever be done for objects of
-- the type, so is incompatible with Initialize_Scalars.
if not Restriction_Active (No_Initialize_Scalars)
and then not Restriction_Active (No_Default_Initialization)
and then Is_Public (Rec_Id)
then
return True;
end if;
return False;
end Requires_Init_Proc;
-- Start of processing for Build_Record_Init_Proc
begin
Rec_Type := Defining_Identifier (N);
-- This may be full declaration of a private type, in which case
-- the visible entity is a record, and the private entity has been
-- exchanged with it in the private part of the current package.
-- The initialization procedure is built for the record type, which
-- is retrievable from the private entity.
if Is_Incomplete_Or_Private_Type (Rec_Type) then
Rec_Type := Underlying_Type (Rec_Type);
end if;
-- If we have a variant record with restriction No_Implicit_Conditionals
-- in effect, then we skip building the procedure. This is safe because
-- if we can see the restriction, so can any caller, calls to initialize
-- such records are not allowed for variant records if this restriction
-- is active.
if Has_Variant_Part (Rec_Type)
and then Restriction_Active (No_Implicit_Conditionals)
then
return;
end if;
-- If there are discriminants, build the discriminant map to replace
-- discriminants by their discriminals in complex bound expressions.
-- These only arise for the corresponding records of synchronized types.
if Is_Concurrent_Record_Type (Rec_Type)
and then Has_Discriminants (Rec_Type)
then
declare
Disc : Entity_Id;
begin
Disc := First_Discriminant (Rec_Type);
while Present (Disc) loop
Append_Elmt (Disc, Discr_Map);
Append_Elmt (Discriminal (Disc), Discr_Map);
Next_Discriminant (Disc);
end loop;
end;
end if;
-- Derived types that have no type extension can use the initialization
-- procedure of their parent and do not need a procedure of their own.
-- This is only correct if there are no representation clauses for the
-- type or its parent, and if the parent has in fact been frozen so
-- that its initialization procedure exists.
if Is_Derived_Type (Rec_Type)
and then not Is_Tagged_Type (Rec_Type)
and then not Is_Unchecked_Union (Rec_Type)
and then not Has_New_Non_Standard_Rep (Rec_Type)
and then not Parent_Subtype_Renaming_Discrims
and then Present (Base_Init_Proc (Etype (Rec_Type)))
then
Copy_TSS (Base_Init_Proc (Etype (Rec_Type)), Rec_Type);
-- Otherwise if we need an initialization procedure, then build one,
-- mark it as public and inlinable and as having a completion.
elsif Requires_Init_Proc (Rec_Type)
or else Is_Unchecked_Union (Rec_Type)
then
Proc_Id :=
Make_Defining_Identifier (Loc,
Chars => Make_Init_Proc_Name (Rec_Type));
-- If No_Default_Initialization restriction is active, then we don't
-- want to build an init_proc, but we need to mark that an init_proc
-- would be needed if this restriction was not active (so that we can
-- detect attempts to call it), so set a dummy init_proc in place.
if Restriction_Active (No_Default_Initialization) then
Set_Init_Proc (Rec_Type, Proc_Id);
return;
end if;
Build_Offset_To_Top_Functions;
Build_CPP_Init_Procedure;
Build_Init_Procedure;
Set_Is_Public (Proc_Id, Is_Public (Rec_Ent));
Set_Is_Internal (Proc_Id);
Set_Has_Completion (Proc_Id);
if not Debug_Generated_Code then
Set_Debug_Info_Off (Proc_Id);
end if;
Set_Is_Inlined (Proc_Id, Inline_Init_Proc (Rec_Type));
-- Do not build an aggregate if Modify_Tree_For_C, this isn't
-- needed and may generate early references to non frozen types
-- since we expand aggregate much more systematically.
if Modify_Tree_For_C then
return;
end if;
declare
Agg : constant Node_Id :=
Build_Equivalent_Record_Aggregate (Rec_Type);
procedure Collect_Itypes (Comp : Node_Id);
-- Generate references to itypes in the aggregate, because
-- the first use of the aggregate may be in a nested scope.
--------------------
-- Collect_Itypes --
--------------------
procedure Collect_Itypes (Comp : Node_Id) is
Ref : Node_Id;
Sub_Aggr : Node_Id;
Typ : constant Entity_Id := Etype (Comp);
begin
if Is_Array_Type (Typ) and then Is_Itype (Typ) then
Ref := Make_Itype_Reference (Loc);
Set_Itype (Ref, Typ);
Append_Freeze_Action (Rec_Type, Ref);
Ref := Make_Itype_Reference (Loc);
Set_Itype (Ref, Etype (First_Index (Typ)));
Append_Freeze_Action (Rec_Type, Ref);
-- Recurse on nested arrays
Sub_Aggr := First (Expressions (Comp));
while Present (Sub_Aggr) loop
Collect_Itypes (Sub_Aggr);
Next (Sub_Aggr);
end loop;
end if;
end Collect_Itypes;
begin
-- If there is a static initialization aggregate for the type,
-- generate itype references for the types of its (sub)components,
-- to prevent out-of-scope errors in the resulting tree.
-- The aggregate may have been rewritten as a Raise node, in which
-- case there are no relevant itypes.
if Present (Agg) and then Nkind (Agg) = N_Aggregate then
Set_Static_Initialization (Proc_Id, Agg);
declare
Comp : Node_Id;
begin
Comp := First (Component_Associations (Agg));
while Present (Comp) loop
Collect_Itypes (Expression (Comp));
Next (Comp);
end loop;
end;
end if;
end;
end if;
end Build_Record_Init_Proc;
----------------------------
-- Build_Slice_Assignment --
----------------------------
-- Generates the following subprogram:
-- procedure Assign
-- (Source, Target : Array_Type,
-- Left_Lo, Left_Hi : Index;
-- Right_Lo, Right_Hi : Index;
-- Rev : Boolean)
-- is
-- Li1 : Index;
-- Ri1 : Index;
-- begin
-- if Left_Hi < Left_Lo then
-- return;
-- end if;
-- if Rev then
-- Li1 := Left_Hi;
-- Ri1 := Right_Hi;
-- else
-- Li1 := Left_Lo;
-- Ri1 := Right_Lo;
-- end if;
-- loop
-- Target (Li1) := Source (Ri1);
-- if Rev then
-- exit when Li1 = Left_Lo;
-- Li1 := Index'pred (Li1);
-- Ri1 := Index'pred (Ri1);
-- else
-- exit when Li1 = Left_Hi;
-- Li1 := Index'succ (Li1);
-- Ri1 := Index'succ (Ri1);
-- end if;
-- end loop;
-- end Assign;
procedure Build_Slice_Assignment (Typ : Entity_Id) is
Loc : constant Source_Ptr := Sloc (Typ);
Index : constant Entity_Id := Base_Type (Etype (First_Index (Typ)));
Larray : constant Entity_Id := Make_Temporary (Loc, 'A');
Rarray : constant Entity_Id := Make_Temporary (Loc, 'R');
Left_Lo : constant Entity_Id := Make_Temporary (Loc, 'L');
Left_Hi : constant Entity_Id := Make_Temporary (Loc, 'L');
Right_Lo : constant Entity_Id := Make_Temporary (Loc, 'R');
Right_Hi : constant Entity_Id := Make_Temporary (Loc, 'R');
Rev : constant Entity_Id := Make_Temporary (Loc, 'D');
-- Formal parameters of procedure
Proc_Name : constant Entity_Id :=
Make_Defining_Identifier (Loc,
Chars => Make_TSS_Name (Typ, TSS_Slice_Assign));
Lnn : constant Entity_Id := Make_Temporary (Loc, 'L');
Rnn : constant Entity_Id := Make_Temporary (Loc, 'R');
-- Subscripts for left and right sides
Decls : List_Id;
Loops : Node_Id;
Stats : List_Id;
begin
-- Build declarations for indexes
Decls := New_List;
Append_To (Decls,
Make_Object_Declaration (Loc,
Defining_Identifier => Lnn,
Object_Definition =>
New_Occurrence_Of (Index, Loc)));
Append_To (Decls,
Make_Object_Declaration (Loc,
Defining_Identifier => Rnn,
Object_Definition =>
New_Occurrence_Of (Index, Loc)));
Stats := New_List;
-- Build test for empty slice case
Append_To (Stats,
Make_If_Statement (Loc,
Condition =>
Make_Op_Lt (Loc,
Left_Opnd => New_Occurrence_Of (Left_Hi, Loc),
Right_Opnd => New_Occurrence_Of (Left_Lo, Loc)),
Then_Statements => New_List (Make_Simple_Return_Statement (Loc))));
-- Build initializations for indexes
declare
F_Init : constant List_Id := New_List;
B_Init : constant List_Id := New_List;
begin
Append_To (F_Init,
Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (Lnn, Loc),
Expression => New_Occurrence_Of (Left_Lo, Loc)));
Append_To (F_Init,
Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (Rnn, Loc),
Expression => New_Occurrence_Of (Right_Lo, Loc)));
Append_To (B_Init,
Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (Lnn, Loc),
Expression => New_Occurrence_Of (Left_Hi, Loc)));
Append_To (B_Init,
Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (Rnn, Loc),
Expression => New_Occurrence_Of (Right_Hi, Loc)));
Append_To (Stats,
Make_If_Statement (Loc,
Condition => New_Occurrence_Of (Rev, Loc),
Then_Statements => B_Init,
Else_Statements => F_Init));
end;
-- Now construct the assignment statement
Loops :=
Make_Loop_Statement (Loc,
Statements => New_List (
Make_Assignment_Statement (Loc,
Name =>
Make_Indexed_Component (Loc,
Prefix => New_Occurrence_Of (Larray, Loc),
Expressions => New_List (New_Occurrence_Of (Lnn, Loc))),
Expression =>
Make_Indexed_Component (Loc,
Prefix => New_Occurrence_Of (Rarray, Loc),
Expressions => New_List (New_Occurrence_Of (Rnn, Loc))))),
End_Label => Empty);
-- Build the exit condition and increment/decrement statements
declare
F_Ass : constant List_Id := New_List;
B_Ass : constant List_Id := New_List;
begin
Append_To (F_Ass,
Make_Exit_Statement (Loc,
Condition =>
Make_Op_Eq (Loc,
Left_Opnd => New_Occurrence_Of (Lnn, Loc),
Right_Opnd => New_Occurrence_Of (Left_Hi, Loc))));
Append_To (F_Ass,
Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (Lnn, Loc),
Expression =>
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Index, Loc),
Attribute_Name => Name_Succ,
Expressions => New_List (
New_Occurrence_Of (Lnn, Loc)))));
Append_To (F_Ass,
Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (Rnn, Loc),
Expression =>
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Index, Loc),
Attribute_Name => Name_Succ,
Expressions => New_List (
New_Occurrence_Of (Rnn, Loc)))));
Append_To (B_Ass,
Make_Exit_Statement (Loc,
Condition =>
Make_Op_Eq (Loc,
Left_Opnd => New_Occurrence_Of (Lnn, Loc),
Right_Opnd => New_Occurrence_Of (Left_Lo, Loc))));
Append_To (B_Ass,
Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (Lnn, Loc),
Expression =>
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Index, Loc),
Attribute_Name => Name_Pred,
Expressions => New_List (
New_Occurrence_Of (Lnn, Loc)))));
Append_To (B_Ass,
Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (Rnn, Loc),
Expression =>
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Index, Loc),
Attribute_Name => Name_Pred,
Expressions => New_List (
New_Occurrence_Of (Rnn, Loc)))));
Append_To (Statements (Loops),
Make_If_Statement (Loc,
Condition => New_Occurrence_Of (Rev, Loc),
Then_Statements => B_Ass,
Else_Statements => F_Ass));
end;
Append_To (Stats, Loops);
declare
Spec : Node_Id;
Formals : List_Id := New_List;
begin
Formals := New_List (
Make_Parameter_Specification (Loc,
Defining_Identifier => Larray,
Out_Present => True,
Parameter_Type =>
New_Occurrence_Of (Base_Type (Typ), Loc)),
Make_Parameter_Specification (Loc,
Defining_Identifier => Rarray,
Parameter_Type =>
New_Occurrence_Of (Base_Type (Typ), Loc)),
Make_Parameter_Specification (Loc,
Defining_Identifier => Left_Lo,
Parameter_Type =>
New_Occurrence_Of (Index, Loc)),
Make_Parameter_Specification (Loc,
Defining_Identifier => Left_Hi,
Parameter_Type =>
New_Occurrence_Of (Index, Loc)),
Make_Parameter_Specification (Loc,
Defining_Identifier => Right_Lo,
Parameter_Type =>
New_Occurrence_Of (Index, Loc)),
Make_Parameter_Specification (Loc,
Defining_Identifier => Right_Hi,
Parameter_Type =>
New_Occurrence_Of (Index, Loc)));
Append_To (Formals,
Make_Parameter_Specification (Loc,
Defining_Identifier => Rev,
Parameter_Type =>
New_Occurrence_Of (Standard_Boolean, Loc)));
Spec :=
Make_Procedure_Specification (Loc,
Defining_Unit_Name => Proc_Name,
Parameter_Specifications => Formals);
Discard_Node (
Make_Subprogram_Body (Loc,
Specification => Spec,
Declarations => Decls,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => Stats)));
end;
Set_TSS (Typ, Proc_Name);
Set_Is_Pure (Proc_Name);
end Build_Slice_Assignment;
-----------------------------
-- Build_Untagged_Equality --
-----------------------------
procedure Build_Untagged_Equality (Typ : Entity_Id) is
Build_Eq : Boolean;
Comp : Entity_Id;
Decl : Node_Id;
Op : Entity_Id;
Prim : Elmt_Id;
Eq_Op : Entity_Id;
function User_Defined_Eq (T : Entity_Id) return Entity_Id;
-- Check whether the type T has a user-defined primitive equality. If so
-- return it, else return Empty. If true for a component of Typ, we have
-- to build the primitive equality for it.
---------------------
-- User_Defined_Eq --
---------------------
function User_Defined_Eq (T : Entity_Id) return Entity_Id is
Prim : Elmt_Id;
Op : Entity_Id;
begin
Op := TSS (T, TSS_Composite_Equality);
if Present (Op) then
return Op;
end if;
Prim := First_Elmt (Collect_Primitive_Operations (T));
while Present (Prim) loop
Op := Node (Prim);
if Chars (Op) = Name_Op_Eq
and then Etype (Op) = Standard_Boolean
and then Etype (First_Formal (Op)) = T
and then Etype (Next_Formal (First_Formal (Op))) = T
then
return Op;
end if;
Next_Elmt (Prim);
end loop;
return Empty;
end User_Defined_Eq;
-- Start of processing for Build_Untagged_Equality
begin
-- If a record component has a primitive equality operation, we must
-- build the corresponding one for the current type.
Build_Eq := False;
Comp := First_Component (Typ);
while Present (Comp) loop
if Is_Record_Type (Etype (Comp))
and then Present (User_Defined_Eq (Etype (Comp)))
then
Build_Eq := True;
end if;
Next_Component (Comp);
end loop;
-- If there is a user-defined equality for the type, we do not create
-- the implicit one.
Prim := First_Elmt (Collect_Primitive_Operations (Typ));
Eq_Op := Empty;
while Present (Prim) loop
if Chars (Node (Prim)) = Name_Op_Eq
and then Comes_From_Source (Node (Prim))
-- Don't we also need to check formal types and return type as in
-- User_Defined_Eq above???
then
Eq_Op := Node (Prim);
Build_Eq := False;
exit;
end if;
Next_Elmt (Prim);
end loop;
-- If the type is derived, inherit the operation, if present, from the
-- parent type. It may have been declared after the type derivation. If
-- the parent type itself is derived, it may have inherited an operation
-- that has itself been overridden, so update its alias and related
-- flags. Ditto for inequality.
if No (Eq_Op) and then Is_Derived_Type (Typ) then
Prim := First_Elmt (Collect_Primitive_Operations (Etype (Typ)));
while Present (Prim) loop
if Chars (Node (Prim)) = Name_Op_Eq then
Copy_TSS (Node (Prim), Typ);
Build_Eq := False;
declare
Op : constant Entity_Id := User_Defined_Eq (Typ);
Eq_Op : constant Entity_Id := Node (Prim);
NE_Op : constant Entity_Id := Next_Entity (Eq_Op);
begin
if Present (Op) then
Set_Alias (Op, Eq_Op);
Set_Is_Abstract_Subprogram
(Op, Is_Abstract_Subprogram (Eq_Op));
if Chars (Next_Entity (Op)) = Name_Op_Ne then
Set_Is_Abstract_Subprogram
(Next_Entity (Op), Is_Abstract_Subprogram (NE_Op));
end if;
end if;
end;
exit;
end if;
Next_Elmt (Prim);
end loop;
end if;
-- If not inherited and not user-defined, build body as for a type with
-- tagged components.
if Build_Eq then
Decl :=
Make_Eq_Body (Typ, Make_TSS_Name (Typ, TSS_Composite_Equality));
Op := Defining_Entity (Decl);
Set_TSS (Typ, Op);
Set_Is_Pure (Op);
if Is_Library_Level_Entity (Typ) then
Set_Is_Public (Op);
end if;
end if;
end Build_Untagged_Equality;
-----------------------------------
-- Build_Variant_Record_Equality --
-----------------------------------
-- Generates:
-- function <<Body_Id>> (Left, Right : T) return Boolean is
-- [ X : T renames Left; ]
-- [ Y : T renames Right; ]
-- -- The above renamings are generated only if the parameters of
-- -- this built function (which are passed by the caller) are not
-- -- named 'X' and 'Y'; these names are required to reuse several
-- -- expander routines when generating this body.
-- begin
-- -- Compare discriminants
-- if X.D1 /= Y.D1 or else X.D2 /= Y.D2 or else ... then
-- return False;
-- end if;
-- -- Compare components
-- if X.C1 /= Y.C1 or else X.C2 /= Y.C2 or else ... then
-- return False;
-- end if;
-- -- Compare variant part
-- case X.D1 is
-- when V1 =>
-- if X.C2 /= Y.C2 or else X.C3 /= Y.C3 or else ... then
-- return False;
-- end if;
-- ...
-- when Vn =>
-- if X.Cn /= Y.Cn or else ... then
-- return False;
-- end if;
-- end case;
-- return True;
-- end _Equality;
function Build_Variant_Record_Equality
(Typ : Entity_Id;
Body_Id : Entity_Id;
Param_Specs : List_Id) return Node_Id
is
Loc : constant Source_Ptr := Sloc (Typ);
Def : constant Node_Id := Parent (Typ);
Comps : constant Node_Id := Component_List (Type_Definition (Def));
Left : constant Entity_Id := Defining_Identifier (First (Param_Specs));
Right : constant Entity_Id :=
Defining_Identifier (Next (First (Param_Specs)));
Decls : constant List_Id := New_List;
Stmts : constant List_Id := New_List;
Subp_Body : Node_Id;
begin
pragma Assert (not Is_Tagged_Type (Typ));
-- In order to reuse the expander routines Make_Eq_If and Make_Eq_Case
-- the name of the formals must be X and Y; otherwise we generate two
-- renaming declarations for such purpose.
if Chars (Left) /= Name_X then
Append_To (Decls,
Make_Object_Renaming_Declaration (Loc,
Defining_Identifier => Make_Defining_Identifier (Loc, Name_X),
Subtype_Mark => New_Occurrence_Of (Typ, Loc),
Name => Make_Identifier (Loc, Chars (Left))));
end if;
if Chars (Right) /= Name_Y then
Append_To (Decls,
Make_Object_Renaming_Declaration (Loc,
Defining_Identifier => Make_Defining_Identifier (Loc, Name_Y),
Subtype_Mark => New_Occurrence_Of (Typ, Loc),
Name => Make_Identifier (Loc, Chars (Right))));
end if;
-- Unchecked_Unions require additional machinery to support equality.
-- Two extra parameters (A and B) are added to the equality function
-- parameter list for each discriminant of the type, in order to
-- capture the inferred values of the discriminants in equality calls.
-- The names of the parameters match the names of the corresponding
-- discriminant, with an added suffix.
if Is_Unchecked_Union (Typ) then
declare
A : Entity_Id;
B : Entity_Id;
Discr : Entity_Id;
Discr_Type : Entity_Id;
New_Discrs : Elist_Id;
begin
New_Discrs := New_Elmt_List;
Discr := First_Discriminant (Typ);
while Present (Discr) loop
Discr_Type := Etype (Discr);
A :=
Make_Defining_Identifier (Loc,
Chars => New_External_Name (Chars (Discr), 'A'));
B :=
Make_Defining_Identifier (Loc,
Chars => New_External_Name (Chars (Discr), 'B'));
-- Add new parameters to the parameter list
Append_To (Param_Specs,
Make_Parameter_Specification (Loc,
Defining_Identifier => A,
Parameter_Type =>
New_Occurrence_Of (Discr_Type, Loc)));
Append_To (Param_Specs,
Make_Parameter_Specification (Loc,
Defining_Identifier => B,
Parameter_Type =>
New_Occurrence_Of (Discr_Type, Loc)));
Append_Elmt (A, New_Discrs);
-- Generate the following code to compare each of the inferred
-- discriminants:
-- if a /= b then
-- return False;
-- end if;
Append_To (Stmts,
Make_If_Statement (Loc,
Condition =>
Make_Op_Ne (Loc,
Left_Opnd => New_Occurrence_Of (A, Loc),
Right_Opnd => New_Occurrence_Of (B, Loc)),
Then_Statements => New_List (
Make_Simple_Return_Statement (Loc,
Expression =>
New_Occurrence_Of (Standard_False, Loc)))));
Next_Discriminant (Discr);
end loop;
-- Generate component-by-component comparison. Note that we must
-- propagate the inferred discriminants formals to act as the case
-- statement switch. Their value is added when an equality call on
-- unchecked unions is expanded.
Append_List_To (Stmts, Make_Eq_Case (Typ, Comps, New_Discrs));
end;
-- Normal case (not unchecked union)
else
Append_To (Stmts,
Make_Eq_If (Typ, Discriminant_Specifications (Def)));
Append_List_To (Stmts, Make_Eq_Case (Typ, Comps));
end if;
Append_To (Stmts,
Make_Simple_Return_Statement (Loc,
Expression => New_Occurrence_Of (Standard_True, Loc)));
Subp_Body :=
Make_Subprogram_Body (Loc,
Specification =>
Make_Function_Specification (Loc,
Defining_Unit_Name => Body_Id,
Parameter_Specifications => Param_Specs,
Result_Definition =>
New_Occurrence_Of (Standard_Boolean, Loc)),
Declarations => Decls,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => Stmts));
return Subp_Body;
end Build_Variant_Record_Equality;
-----------------------------
-- Check_Stream_Attributes --
-----------------------------
procedure Check_Stream_Attributes (Typ : Entity_Id) is
Comp : Entity_Id;
Par_Read : constant Boolean :=
Stream_Attribute_Available (Typ, TSS_Stream_Read)
and then not Has_Specified_Stream_Read (Typ);
Par_Write : constant Boolean :=
Stream_Attribute_Available (Typ, TSS_Stream_Write)
and then not Has_Specified_Stream_Write (Typ);
procedure Check_Attr (Nam : Name_Id; TSS_Nam : TSS_Name_Type);
-- Check that Comp has a user-specified Nam stream attribute
----------------
-- Check_Attr --
----------------
procedure Check_Attr (Nam : Name_Id; TSS_Nam : TSS_Name_Type) is
begin
-- Move this check to sem???
if not Stream_Attribute_Available (Etype (Comp), TSS_Nam) then
Error_Msg_Name_1 := Nam;
Error_Msg_N
("|component& in limited extension must have% attribute", Comp);
end if;
end Check_Attr;
-- Start of processing for Check_Stream_Attributes
begin
if Par_Read or else Par_Write then
Comp := First_Component (Typ);
while Present (Comp) loop
if Comes_From_Source (Comp)
and then Original_Record_Component (Comp) = Comp
and then Is_Limited_Type (Etype (Comp))
then
if Par_Read then
Check_Attr (Name_Read, TSS_Stream_Read);
end if;
if Par_Write then
Check_Attr (Name_Write, TSS_Stream_Write);
end if;
end if;
Next_Component (Comp);
end loop;
end if;
end Check_Stream_Attributes;
----------------------
-- Clean_Task_Names --
----------------------
procedure Clean_Task_Names
(Typ : Entity_Id;
Proc_Id : Entity_Id)
is
begin
if Has_Task (Typ)
and then not Restriction_Active (No_Implicit_Heap_Allocations)
and then not Global_Discard_Names
and then Tagged_Type_Expansion
then
Set_Uses_Sec_Stack (Proc_Id);
end if;
end Clean_Task_Names;
----------------------------------------
-- Ensure_Activation_Chain_And_Master --
----------------------------------------
procedure Ensure_Activation_Chain_And_Master (Obj_Decl : Node_Id) is
Def_Id : constant Entity_Id := Defining_Identifier (Obj_Decl);
Expr : constant Node_Id := Expression (Obj_Decl);
Expr_Q : Node_Id;
Typ : constant Entity_Id := Etype (Def_Id);
begin
pragma Assert (Nkind (Obj_Decl) = N_Object_Declaration);
if Might_Have_Tasks (Typ) then
Build_Activation_Chain_Entity (Obj_Decl);
if Has_Task (Typ) then
Build_Master_Entity (Def_Id);
-- Handle objects initialized with BIP function calls
elsif Present (Expr) then
if Nkind (Expr) = N_Qualified_Expression then
Expr_Q := Expression (Expr);
else
Expr_Q := Expr;
end if;
if Is_Build_In_Place_Function_Call (Expr_Q)
or else Present (Unqual_BIP_Iface_Function_Call (Expr_Q))
or else
(Nkind (Expr_Q) = N_Reference
and then
Is_Build_In_Place_Function_Call (Prefix (Expr_Q)))
then
Build_Master_Entity (Def_Id);
end if;
end if;
end if;
end Ensure_Activation_Chain_And_Master;
------------------------------
-- Expand_Freeze_Array_Type --
------------------------------
procedure Expand_Freeze_Array_Type (N : Node_Id) is
Typ : constant Entity_Id := Entity (N);
Base : constant Entity_Id := Base_Type (Typ);
Comp_Typ : constant Entity_Id := Component_Type (Typ);
begin
if not Is_Bit_Packed_Array (Typ) then
-- If the component contains tasks, so does the array type. This may
-- not be indicated in the array type because the component may have
-- been a private type at the point of definition. Same if component
-- type is controlled or contains protected objects.
Propagate_Concurrent_Flags (Base, Comp_Typ);
Set_Has_Controlled_Component
(Base, Has_Controlled_Component (Comp_Typ)
or else Is_Controlled (Comp_Typ));
if No (Init_Proc (Base)) then
-- If this is an anonymous array created for a declaration with
-- an initial value, its init_proc will never be called. The
-- initial value itself may have been expanded into assignments,
-- in which case the object declaration is carries the
-- No_Initialization flag.
if Is_Itype (Base)
and then Nkind (Associated_Node_For_Itype (Base)) =
N_Object_Declaration
and then
(Present (Expression (Associated_Node_For_Itype (Base)))
or else No_Initialization (Associated_Node_For_Itype (Base)))
then
null;
-- We do not need an init proc for string or wide [wide] string,
-- since the only time these need initialization in normalize or
-- initialize scalars mode, and these types are treated specially
-- and do not need initialization procedures.
elsif Is_Standard_String_Type (Base) then
null;
-- Otherwise we have to build an init proc for the subtype
else
Build_Array_Init_Proc (Base, N);
end if;
end if;
if Typ = Base and then Has_Controlled_Component (Base) then
Build_Controlling_Procs (Base);
if not Is_Limited_Type (Comp_Typ)
and then Number_Dimensions (Typ) = 1
then
Build_Slice_Assignment (Typ);
end if;
end if;
-- For packed case, default initialization, except if the component type
-- is itself a packed structure with an initialization procedure, or
-- initialize/normalize scalars active, and we have a base type, or the
-- type is public, because in that case a client might specify
-- Normalize_Scalars and there better be a public Init_Proc for it.
elsif (Present (Init_Proc (Component_Type (Base)))
and then No (Base_Init_Proc (Base)))
or else (Init_Or_Norm_Scalars and then Base = Typ)
or else Is_Public (Typ)
then
Build_Array_Init_Proc (Base, N);
end if;
end Expand_Freeze_Array_Type;
-----------------------------------
-- Expand_Freeze_Class_Wide_Type --
-----------------------------------
procedure Expand_Freeze_Class_Wide_Type (N : Node_Id) is
function Is_C_Derivation (Typ : Entity_Id) return Boolean;
-- Given a type, determine whether it is derived from a C or C++ root
---------------------
-- Is_C_Derivation --
---------------------
function Is_C_Derivation (Typ : Entity_Id) return Boolean is
T : Entity_Id;
begin
T := Typ;
loop
if Is_CPP_Class (T)
or else Convention (T) = Convention_C
or else Convention (T) = Convention_CPP
then
return True;
end if;
exit when T = Etype (T);
T := Etype (T);
end loop;
return False;
end Is_C_Derivation;
-- Local variables
Typ : constant Entity_Id := Entity (N);
Root : constant Entity_Id := Root_Type (Typ);
-- Start of processing for Expand_Freeze_Class_Wide_Type
begin
-- Certain run-time configurations and targets do not provide support
-- for controlled types.
if Restriction_Active (No_Finalization) then
return;
-- Do not create TSS routine Finalize_Address when dispatching calls are
-- disabled since the core of the routine is a dispatching call.
elsif Restriction_Active (No_Dispatching_Calls) then
return;
-- Do not create TSS routine Finalize_Address for concurrent class-wide
-- types. Ignore C, C++, CIL and Java types since it is assumed that the
-- non-Ada side will handle their destruction.
elsif Is_Concurrent_Type (Root)
or else Is_C_Derivation (Root)
or else Convention (Typ) = Convention_CPP
then
return;
-- Do not create TSS routine Finalize_Address when compiling in CodePeer
-- mode since the routine contains an Unchecked_Conversion.
elsif CodePeer_Mode then
return;
end if;
-- Create the body of TSS primitive Finalize_Address. This automatically
-- sets the TSS entry for the class-wide type.
Make_Finalize_Address_Body (Typ);
end Expand_Freeze_Class_Wide_Type;
------------------------------------
-- Expand_Freeze_Enumeration_Type --
------------------------------------
procedure Expand_Freeze_Enumeration_Type (N : Node_Id) is
Typ : constant Entity_Id := Entity (N);
Loc : constant Source_Ptr := Sloc (Typ);
Arr : Entity_Id;
Ent : Entity_Id;
Fent : Entity_Id;
Is_Contiguous : Boolean;
Index_Typ : Entity_Id;
Ityp : Entity_Id;
Last_Repval : Uint;
Lst : List_Id;
Num : Nat;
Pos_Expr : Node_Id;
Func : Entity_Id;
pragma Warnings (Off, Func);
begin
-- Various optimizations possible if given representation is contiguous
Is_Contiguous := True;
Ent := First_Literal (Typ);
Last_Repval := Enumeration_Rep (Ent);
Num := 1;
Next_Literal (Ent);
while Present (Ent) loop
if Enumeration_Rep (Ent) - Last_Repval /= 1 then
Is_Contiguous := False;
else
Last_Repval := Enumeration_Rep (Ent);
end if;
Num := Num + 1;
Next_Literal (Ent);
end loop;
if Is_Contiguous then
Set_Has_Contiguous_Rep (Typ);
-- Now build a subtype declaration
-- subtype typI is new Natural range 0 .. num - 1
Index_Typ :=
Make_Defining_Identifier (Loc,
Chars => New_External_Name (Chars (Typ), 'I'));
Append_Freeze_Action (Typ,
Make_Subtype_Declaration (Loc,
Defining_Identifier => Index_Typ,
Subtype_Indication =>
Make_Subtype_Indication (Loc,
Subtype_Mark =>
New_Occurrence_Of (Standard_Natural, Loc),
Constraint =>
Make_Range_Constraint (Loc,
Range_Expression =>
Make_Range (Loc,
Low_Bound =>
Make_Integer_Literal (Loc, 0),
High_Bound =>
Make_Integer_Literal (Loc, Num - 1))))));
Set_Enum_Pos_To_Rep (Typ, Index_Typ);
else
-- Build list of literal references
Lst := New_List;
Ent := First_Literal (Typ);
while Present (Ent) loop
Append_To (Lst, New_Occurrence_Of (Ent, Sloc (Ent)));
Next_Literal (Ent);
end loop;
-- Now build an array declaration
-- typA : constant array (Natural range 0 .. num - 1) of typ :=
-- (v, v, v, v, v, ....)
Arr :=
Make_Defining_Identifier (Loc,
Chars => New_External_Name (Chars (Typ), 'A'));
Append_Freeze_Action (Typ,
Make_Object_Declaration (Loc,
Defining_Identifier => Arr,
Constant_Present => True,
Object_Definition =>
Make_Constrained_Array_Definition (Loc,
Discrete_Subtype_Definitions => New_List (
Make_Subtype_Indication (Loc,
Subtype_Mark =>
New_Occurrence_Of (Standard_Natural, Loc),
Constraint =>
Make_Range_Constraint (Loc,
Range_Expression =>
Make_Range (Loc,
Low_Bound =>
Make_Integer_Literal (Loc, 0),
High_Bound =>
Make_Integer_Literal (Loc, Num - 1))))),
Component_Definition =>
Make_Component_Definition (Loc,
Aliased_Present => False,
Subtype_Indication => New_Occurrence_Of (Typ, Loc))),
Expression =>
Make_Aggregate (Loc,
Expressions => Lst)));
Set_Enum_Pos_To_Rep (Typ, Arr);
end if;
-- Now we build the function that converts representation values to
-- position values. This function has the form:
-- function _Rep_To_Pos (A : etype; F : Boolean) return Integer is
-- begin
-- case ityp!(A) is
-- when enum-lit'Enum_Rep => return posval;
-- when enum-lit'Enum_Rep => return posval;
-- ...
-- when others =>
-- [raise Constraint_Error when F "invalid data"]
-- return -1;
-- end case;
-- end;
-- Note: the F parameter determines whether the others case (no valid
-- representation) raises Constraint_Error or returns a unique value
-- of minus one. The latter case is used, e.g. in 'Valid code.
-- Note: the reason we use Enum_Rep values in the case here is to avoid
-- the code generator making inappropriate assumptions about the range
-- of the values in the case where the value is invalid. ityp is a
-- signed or unsigned integer type of appropriate width.
-- Note: if exceptions are not supported, then we suppress the raise
-- and return -1 unconditionally (this is an erroneous program in any
-- case and there is no obligation to raise Constraint_Error here). We
-- also do this if pragma Restrictions (No_Exceptions) is active.
-- Is this right??? What about No_Exception_Propagation???
-- The underlying type is signed. Reset the Is_Unsigned_Type explicitly
-- because it might have been inherited from the parent type.
if Enumeration_Rep (First_Literal (Typ)) < 0 then
Set_Is_Unsigned_Type (Typ, False);
end if;
Ityp := Integer_Type_For (Esize (Typ), Is_Unsigned_Type (Typ));
-- The body of the function is a case statement. First collect case
-- alternatives, or optimize the contiguous case.
Lst := New_List;
-- If representation is contiguous, Pos is computed by subtracting
-- the representation of the first literal.
if Is_Contiguous then
Ent := First_Literal (Typ);
if Enumeration_Rep (Ent) = Last_Repval then
-- Another special case: for a single literal, Pos is zero
Pos_Expr := Make_Integer_Literal (Loc, Uint_0);
else
Pos_Expr :=
Convert_To (Standard_Integer,
Make_Op_Subtract (Loc,
Left_Opnd =>
Unchecked_Convert_To
(Ityp, Make_Identifier (Loc, Name_uA)),
Right_Opnd =>
Make_Integer_Literal (Loc,
Intval => Enumeration_Rep (First_Literal (Typ)))));
end if;
Append_To (Lst,
Make_Case_Statement_Alternative (Loc,
Discrete_Choices => New_List (
Make_Range (Sloc (Enumeration_Rep_Expr (Ent)),
Low_Bound =>
Make_Integer_Literal (Loc,
Intval => Enumeration_Rep (Ent)),
High_Bound =>
Make_Integer_Literal (Loc, Intval => Last_Repval))),
Statements => New_List (
Make_Simple_Return_Statement (Loc,
Expression => Pos_Expr))));
else
Ent := First_Literal (Typ);
while Present (Ent) loop
Append_To (Lst,
Make_Case_Statement_Alternative (Loc,
Discrete_Choices => New_List (
Make_Integer_Literal (Sloc (Enumeration_Rep_Expr (Ent)),
Intval => Enumeration_Rep (Ent))),
Statements => New_List (
Make_Simple_Return_Statement (Loc,
Expression =>
Make_Integer_Literal (Loc,
Intval => Enumeration_Pos (Ent))))));
Next_Literal (Ent);
end loop;
end if;
-- In normal mode, add the others clause with the test.
-- If Predicates_Ignored is True, validity checks do not apply to
-- the subtype.
if not No_Exception_Handlers_Set
and then not Predicates_Ignored (Typ)
then
Append_To (Lst,
Make_Case_Statement_Alternative (Loc,
Discrete_Choices => New_List (Make_Others_Choice (Loc)),
Statements => New_List (
Make_Raise_Constraint_Error (Loc,
Condition => Make_Identifier (Loc, Name_uF),
Reason => CE_Invalid_Data),
Make_Simple_Return_Statement (Loc,
Expression => Make_Integer_Literal (Loc, -1)))));
-- If either of the restrictions No_Exceptions_Handlers/Propagation is
-- active then return -1 (we cannot usefully raise Constraint_Error in
-- this case). See description above for further details.
else
Append_To (Lst,
Make_Case_Statement_Alternative (Loc,
Discrete_Choices => New_List (Make_Others_Choice (Loc)),
Statements => New_List (
Make_Simple_Return_Statement (Loc,
Expression => Make_Integer_Literal (Loc, -1)))));
end if;
-- Now we can build the function body
Fent :=
Make_Defining_Identifier (Loc, Make_TSS_Name (Typ, TSS_Rep_To_Pos));
Func :=
Make_Subprogram_Body (Loc,
Specification =>
Make_Function_Specification (Loc,
Defining_Unit_Name => Fent,
Parameter_Specifications => New_List (
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_uA),
Parameter_Type => New_Occurrence_Of (Typ, Loc)),
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_uF),
Parameter_Type =>
New_Occurrence_Of (Standard_Boolean, Loc))),
Result_Definition => New_Occurrence_Of (Standard_Integer, Loc)),
Declarations => Empty_List,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List (
Make_Case_Statement (Loc,
Expression =>
Unchecked_Convert_To
(Ityp, Make_Identifier (Loc, Name_uA)),
Alternatives => Lst))));
Set_TSS (Typ, Fent);
-- Set Pure flag (it will be reset if the current context is not Pure).
-- We also pretend there was a pragma Pure_Function so that for purposes
-- of optimization and constant-folding, we will consider the function
-- Pure even if we are not in a Pure context).
Set_Is_Pure (Fent);
Set_Has_Pragma_Pure_Function (Fent);
-- Unless we are in -gnatD mode, where we are debugging generated code,
-- this is an internal entity for which we don't need debug info.
if not Debug_Generated_Code then
Set_Debug_Info_Off (Fent);
end if;
Set_Is_Inlined (Fent);
exception
when RE_Not_Available =>
return;
end Expand_Freeze_Enumeration_Type;
-------------------------------
-- Expand_Freeze_Record_Type --
-------------------------------
procedure Expand_Freeze_Record_Type (N : Node_Id) is
procedure Build_Variant_Record_Equality (Typ : Entity_Id);
-- Create An Equality function for the untagged variant record Typ and
-- attach it to the TSS list.
-----------------------------------
-- Build_Variant_Record_Equality --
-----------------------------------
procedure Build_Variant_Record_Equality (Typ : Entity_Id) is
Loc : constant Source_Ptr := Sloc (Typ);
F : constant Entity_Id :=
Make_Defining_Identifier (Loc,
Chars => Make_TSS_Name (Typ, TSS_Composite_Equality));
begin
-- For a variant record with restriction No_Implicit_Conditionals
-- in effect we skip building the procedure. This is safe because
-- if we can see the restriction, so can any caller, and calls to
-- equality test routines are not allowed for variant records if
-- this restriction is active.
if Restriction_Active (No_Implicit_Conditionals) then
return;
end if;
-- Derived Unchecked_Union types no longer inherit the equality
-- function of their parent.
if Is_Derived_Type (Typ)
and then not Is_Unchecked_Union (Typ)
and then not Has_New_Non_Standard_Rep (Typ)
then
declare
Parent_Eq : constant Entity_Id :=
TSS (Root_Type (Typ), TSS_Composite_Equality);
begin
if Present (Parent_Eq) then
Copy_TSS (Parent_Eq, Typ);
return;
end if;
end;
end if;
Discard_Node (
Build_Variant_Record_Equality
(Typ => Typ,
Body_Id => F,
Param_Specs => New_List (
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_X),
Parameter_Type => New_Occurrence_Of (Typ, Loc)),
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_Y),
Parameter_Type => New_Occurrence_Of (Typ, Loc)))));
Set_TSS (Typ, F);
Set_Is_Pure (F);
if not Debug_Generated_Code then
Set_Debug_Info_Off (F);
end if;
end Build_Variant_Record_Equality;
-- Local variables
Typ : constant Node_Id := Entity (N);
Typ_Decl : constant Node_Id := Parent (Typ);
Comp : Entity_Id;
Comp_Typ : Entity_Id;
Predef_List : List_Id;
Wrapper_Decl_List : List_Id := No_List;
Wrapper_Body_List : List_Id := No_List;
Renamed_Eq : Node_Id := Empty;
-- Defining unit name for the predefined equality function in the case
-- where the type has a primitive operation that is a renaming of
-- predefined equality (but only if there is also an overriding
-- user-defined equality function). Used to pass this entity from
-- Make_Predefined_Primitive_Specs to Predefined_Primitive_Bodies.
-- Start of processing for Expand_Freeze_Record_Type
begin
-- Build discriminant checking functions if not a derived type (for
-- derived types that are not tagged types, always use the discriminant
-- checking functions of the parent type). However, for untagged types
-- the derivation may have taken place before the parent was frozen, so
-- we copy explicitly the discriminant checking functions from the
-- parent into the components of the derived type.
if not Is_Derived_Type (Typ)
or else Has_New_Non_Standard_Rep (Typ)
or else Is_Tagged_Type (Typ)
then
Build_Discr_Checking_Funcs (Typ_Decl);
elsif Is_Derived_Type (Typ)
and then not Is_Tagged_Type (Typ)
-- If we have a derived Unchecked_Union, we do not inherit the
-- discriminant checking functions from the parent type since the
-- discriminants are non existent.
and then not Is_Unchecked_Union (Typ)
and then Has_Discriminants (Typ)
then
declare
Old_Comp : Entity_Id;
begin
Old_Comp :=
First_Component (Base_Type (Underlying_Type (Etype (Typ))));
Comp := First_Component (Typ);
while Present (Comp) loop
if Ekind (Comp) = E_Component
and then Chars (Comp) = Chars (Old_Comp)
then
Set_Discriminant_Checking_Func
(Comp, Discriminant_Checking_Func (Old_Comp));
end if;
Next_Component (Old_Comp);
Next_Component (Comp);
end loop;
end;
end if;
if Is_Derived_Type (Typ)
and then Is_Limited_Type (Typ)
and then Is_Tagged_Type (Typ)
then
Check_Stream_Attributes (Typ);
end if;
-- Update task, protected, and controlled component flags, because some
-- of the component types may have been private at the point of the
-- record declaration. Detect anonymous access-to-controlled components.
Comp := First_Component (Typ);
while Present (Comp) loop
Comp_Typ := Etype (Comp);
Propagate_Concurrent_Flags (Typ, Comp_Typ);
-- Do not set Has_Controlled_Component on a class-wide equivalent
-- type. See Make_CW_Equivalent_Type.
if not Is_Class_Wide_Equivalent_Type (Typ)
and then
(Has_Controlled_Component (Comp_Typ)
or else (Chars (Comp) /= Name_uParent
and then Is_Controlled (Comp_Typ)))
then
Set_Has_Controlled_Component (Typ);
end if;
Next_Component (Comp);
end loop;
-- Handle constructors of untagged CPP_Class types
if not Is_Tagged_Type (Typ) and then Is_CPP_Class (Typ) then
Set_CPP_Constructors (Typ);
end if;
-- Creation of the Dispatch Table. Note that a Dispatch Table is built
-- for regular tagged types as well as for Ada types deriving from a C++
-- Class, but not for tagged types directly corresponding to C++ classes
-- In the later case we assume that it is created in the C++ side and we
-- just use it.
if Is_Tagged_Type (Typ) then
-- Add the _Tag component
if Underlying_Type (Etype (Typ)) = Typ then
Expand_Tagged_Root (Typ);
end if;
if Is_CPP_Class (Typ) then
Set_All_DT_Position (Typ);
-- Create the tag entities with a minimum decoration
if Tagged_Type_Expansion then
Append_Freeze_Actions (Typ, Make_Tags (Typ));
end if;
Set_CPP_Constructors (Typ);
else
if not Building_Static_DT (Typ) then
-- Usually inherited primitives are not delayed but the first
-- Ada extension of a CPP_Class is an exception since the
-- address of the inherited subprogram has to be inserted in
-- the new Ada Dispatch Table and this is a freezing action.
-- Similarly, if this is an inherited operation whose parent is
-- not frozen yet, it is not in the DT of the parent, and we
-- generate an explicit freeze node for the inherited operation
-- so it is properly inserted in the DT of the current type.
declare
Elmt : Elmt_Id;
Subp : Entity_Id;
begin
Elmt := First_Elmt (Primitive_Operations (Typ));
while Present (Elmt) loop
Subp := Node (Elmt);
if Present (Alias (Subp)) then
if Is_CPP_Class (Etype (Typ)) then
Set_Has_Delayed_Freeze (Subp);
elsif Has_Delayed_Freeze (Alias (Subp))
and then not Is_Frozen (Alias (Subp))
then
Set_Is_Frozen (Subp, False);
Set_Has_Delayed_Freeze (Subp);
end if;
end if;
Next_Elmt (Elmt);
end loop;
end;
end if;
-- Unfreeze momentarily the type to add the predefined primitives
-- operations. The reason we unfreeze is so that these predefined
-- operations will indeed end up as primitive operations (which
-- must be before the freeze point).
Set_Is_Frozen (Typ, False);
-- Do not add the spec of predefined primitives in case of
-- CPP tagged type derivations that have convention CPP.
if Is_CPP_Class (Root_Type (Typ))
and then Convention (Typ) = Convention_CPP
then
null;
-- Do not add the spec of the predefined primitives if we are
-- compiling under restriction No_Dispatching_Calls.
elsif not Restriction_Active (No_Dispatching_Calls) then
Make_Predefined_Primitive_Specs (Typ, Predef_List, Renamed_Eq);
Insert_List_Before_And_Analyze (N, Predef_List);
end if;
-- Ada 2005 (AI-391): For a nonabstract null extension, create
-- wrapper functions for each nonoverridden inherited function
-- with a controlling result of the type. The wrapper for such
-- a function returns an extension aggregate that invokes the
-- parent function.
if Ada_Version >= Ada_2005
and then not Is_Abstract_Type (Typ)
and then Is_Null_Extension (Typ)
then
Make_Controlling_Function_Wrappers
(Typ, Wrapper_Decl_List, Wrapper_Body_List);
Insert_List_Before_And_Analyze (N, Wrapper_Decl_List);
end if;
-- Ada 2005 (AI-251): For a nonabstract type extension, build
-- null procedure declarations for each set of homographic null
-- procedures that are inherited from interface types but not
-- overridden. This is done to ensure that the dispatch table
-- entry associated with such null primitives are properly filled.
if Ada_Version >= Ada_2005
and then Etype (Typ) /= Typ
and then not Is_Abstract_Type (Typ)
and then Has_Interfaces (Typ)
then
Insert_Actions (N, Make_Null_Procedure_Specs (Typ));
end if;
Set_Is_Frozen (Typ);
if not Is_Derived_Type (Typ)
or else Is_Tagged_Type (Etype (Typ))
then
Set_All_DT_Position (Typ);
-- If this is a type derived from an untagged private type whose
-- full view is tagged, the type is marked tagged for layout
-- reasons, but it has no dispatch table.
elsif Is_Derived_Type (Typ)
and then Is_Private_Type (Etype (Typ))
and then not Is_Tagged_Type (Etype (Typ))
then
return;
end if;
-- Create and decorate the tags. Suppress their creation when
-- not Tagged_Type_Expansion because the dispatching mechanism is
-- handled internally by the virtual target.
if Tagged_Type_Expansion then
Append_Freeze_Actions (Typ, Make_Tags (Typ));
-- Generate dispatch table of locally defined tagged type.
-- Dispatch tables of library level tagged types are built
-- later (see Analyze_Declarations).
if not Building_Static_DT (Typ) then
Append_Freeze_Actions (Typ, Make_DT (Typ));
end if;
end if;
-- If the type has unknown discriminants, propagate dispatching
-- information to its underlying record view, which does not get
-- its own dispatch table.
if Is_Derived_Type (Typ)
and then Has_Unknown_Discriminants (Typ)
and then Present (Underlying_Record_View (Typ))
then
declare
Rep : constant Entity_Id := Underlying_Record_View (Typ);
begin
Set_Access_Disp_Table
(Rep, Access_Disp_Table (Typ));
Set_Dispatch_Table_Wrappers
(Rep, Dispatch_Table_Wrappers (Typ));
Set_Direct_Primitive_Operations
(Rep, Direct_Primitive_Operations (Typ));
end;
end if;
-- Make sure that the primitives Initialize, Adjust and Finalize
-- are Frozen before other TSS subprograms. We don't want them
-- Frozen inside.
if Is_Controlled (Typ) then
if not Is_Limited_Type (Typ) then
Append_Freeze_Actions (Typ,
Freeze_Entity (Find_Prim_Op (Typ, Name_Adjust), Typ));
end if;
Append_Freeze_Actions (Typ,
Freeze_Entity (Find_Prim_Op (Typ, Name_Initialize), Typ));
Append_Freeze_Actions (Typ,
Freeze_Entity (Find_Prim_Op (Typ, Name_Finalize), Typ));
end if;
-- Freeze rest of primitive operations. There is no need to handle
-- the predefined primitives if we are compiling under restriction
-- No_Dispatching_Calls.
if not Restriction_Active (No_Dispatching_Calls) then
Append_Freeze_Actions (Typ, Predefined_Primitive_Freeze (Typ));
end if;
end if;
-- In the untagged case, ever since Ada 83 an equality function must
-- be provided for variant records that are not unchecked unions.
-- In Ada 2012 the equality function composes, and thus must be built
-- explicitly just as for tagged records.
elsif Has_Discriminants (Typ)
and then not Is_Limited_Type (Typ)
then
declare
Comps : constant Node_Id :=
Component_List (Type_Definition (Typ_Decl));
begin
if Present (Comps)
and then Present (Variant_Part (Comps))
then
Build_Variant_Record_Equality (Typ);
end if;
end;
-- Otherwise create primitive equality operation (AI05-0123)
-- This is done unconditionally to ensure that tools can be linked
-- properly with user programs compiled with older language versions.
-- In addition, this is needed because "=" composes for bounded strings
-- in all language versions (see Exp_Ch4.Expand_Composite_Equality).
elsif Comes_From_Source (Typ)
and then Convention (Typ) = Convention_Ada
and then not Is_Limited_Type (Typ)
then
Build_Untagged_Equality (Typ);
end if;
-- Before building the record initialization procedure, if we are
-- dealing with a concurrent record value type, then we must go through
-- the discriminants, exchanging discriminals between the concurrent
-- type and the concurrent record value type. See the section "Handling
-- of Discriminants" in the Einfo spec for details.
if Is_Concurrent_Record_Type (Typ)
and then Has_Discriminants (Typ)
then
declare
Ctyp : constant Entity_Id :=
Corresponding_Concurrent_Type (Typ);
Conc_Discr : Entity_Id;
Rec_Discr : Entity_Id;
Temp : Entity_Id;
begin
Conc_Discr := First_Discriminant (Ctyp);
Rec_Discr := First_Discriminant (Typ);
while Present (Conc_Discr) loop
Temp := Discriminal (Conc_Discr);
Set_Discriminal (Conc_Discr, Discriminal (Rec_Discr));
Set_Discriminal (Rec_Discr, Temp);
Set_Discriminal_Link (Discriminal (Conc_Discr), Conc_Discr);
Set_Discriminal_Link (Discriminal (Rec_Discr), Rec_Discr);
Next_Discriminant (Conc_Discr);
Next_Discriminant (Rec_Discr);
end loop;
end;
end if;
if Has_Controlled_Component (Typ) then
Build_Controlling_Procs (Typ);
end if;
Adjust_Discriminants (Typ);
-- Do not need init for interfaces on virtual targets since they're
-- abstract.
if Tagged_Type_Expansion or else not Is_Interface (Typ) then
Build_Record_Init_Proc (Typ_Decl, Typ);
end if;
-- For tagged type that are not interfaces, build bodies of primitive
-- operations. Note: do this after building the record initialization
-- procedure, since the primitive operations may need the initialization
-- routine. There is no need to add predefined primitives of interfaces
-- because all their predefined primitives are abstract.
if Is_Tagged_Type (Typ) and then not Is_Interface (Typ) then
-- Do not add the body of predefined primitives in case of CPP tagged
-- type derivations that have convention CPP.
if Is_CPP_Class (Root_Type (Typ))
and then Convention (Typ) = Convention_CPP
then
null;
-- Do not add the body of the predefined primitives if we are
-- compiling under restriction No_Dispatching_Calls or if we are
-- compiling a CPP tagged type.
elsif not Restriction_Active (No_Dispatching_Calls) then
-- Create the body of TSS primitive Finalize_Address. This must
-- be done before the bodies of all predefined primitives are
-- created. If Typ is limited, Stream_Input and Stream_Read may
-- produce build-in-place allocations and for those the expander
-- needs Finalize_Address.
Make_Finalize_Address_Body (Typ);
Predef_List := Predefined_Primitive_Bodies (Typ, Renamed_Eq);
Append_Freeze_Actions (Typ, Predef_List);
end if;
-- Ada 2005 (AI-391): If any wrappers were created for nonoverridden
-- inherited functions, then add their bodies to the freeze actions.
if Present (Wrapper_Body_List) then
Append_Freeze_Actions (Typ, Wrapper_Body_List);
end if;
-- Create extra formals for the primitive operations of the type.
-- This must be done before analyzing the body of the initialization
-- procedure, because a self-referential type might call one of these
-- primitives in the body of the init_proc itself.
declare
Elmt : Elmt_Id;
Subp : Entity_Id;
begin
Elmt := First_Elmt (Primitive_Operations (Typ));
while Present (Elmt) loop
Subp := Node (Elmt);
if not Has_Foreign_Convention (Subp)
and then not Is_Predefined_Dispatching_Operation (Subp)
then
Create_Extra_Formals (Subp);
end if;
Next_Elmt (Elmt);
end loop;
end;
end if;
end Expand_Freeze_Record_Type;
------------------------------------
-- Expand_N_Full_Type_Declaration --
------------------------------------
procedure Expand_N_Full_Type_Declaration (N : Node_Id) is
procedure Build_Master (Ptr_Typ : Entity_Id);
-- Create the master associated with Ptr_Typ
------------------
-- Build_Master --
------------------
procedure Build_Master (Ptr_Typ : Entity_Id) is
Desig_Typ : Entity_Id := Designated_Type (Ptr_Typ);
begin
-- If the designated type is an incomplete view coming from a
-- limited-with'ed package, we need to use the nonlimited view in
-- case it has tasks.
if Is_Incomplete_Type (Desig_Typ)
and then Present (Non_Limited_View (Desig_Typ))
then
Desig_Typ := Non_Limited_View (Desig_Typ);
end if;
-- Anonymous access types are created for the components of the
-- record parameter for an entry declaration. No master is created
-- for such a type.
if Has_Task (Desig_Typ) then
Build_Master_Entity (Ptr_Typ);
Build_Master_Renaming (Ptr_Typ);
-- Create a class-wide master because a Master_Id must be generated
-- for access-to-limited-class-wide types whose root may be extended
-- with task components.
-- Note: This code covers access-to-limited-interfaces because they
-- can be used to reference tasks implementing them.
-- Suppress the master creation for access types created for entry
-- formal parameters (parameter block component types). Seems like
-- suppression should be more general for compiler-generated types,
-- but testing Comes_From_Source may be too general in this case
-- (affects some test output)???
elsif not Is_Param_Block_Component_Type (Ptr_Typ)
and then Is_Limited_Class_Wide_Type (Desig_Typ)
then
Build_Class_Wide_Master (Ptr_Typ);
end if;
end Build_Master;
-- Local declarations
Def_Id : constant Entity_Id := Defining_Identifier (N);
B_Id : constant Entity_Id := Base_Type (Def_Id);
FN : Node_Id;
Par_Id : Entity_Id;
-- Start of processing for Expand_N_Full_Type_Declaration
begin
if Is_Access_Type (Def_Id) then
Build_Master (Def_Id);
if Ekind (Def_Id) = E_Access_Protected_Subprogram_Type then
Expand_Access_Protected_Subprogram_Type (N);
end if;
-- Array of anonymous access-to-task pointers
elsif Ada_Version >= Ada_2005
and then Is_Array_Type (Def_Id)
and then Is_Access_Type (Component_Type (Def_Id))
and then Ekind (Component_Type (Def_Id)) = E_Anonymous_Access_Type
then
Build_Master (Component_Type (Def_Id));
elsif Has_Task (Def_Id) then
Expand_Previous_Access_Type (Def_Id);
-- Check the components of a record type or array of records for
-- anonymous access-to-task pointers.
elsif Ada_Version >= Ada_2005
and then (Is_Record_Type (Def_Id)
or else
(Is_Array_Type (Def_Id)
and then Is_Record_Type (Component_Type (Def_Id))))
then
declare
Comp : Entity_Id;
First : Boolean;
M_Id : Entity_Id := Empty;
Typ : Entity_Id;
begin
if Is_Array_Type (Def_Id) then
Comp := First_Entity (Component_Type (Def_Id));
else
Comp := First_Entity (Def_Id);
end if;
-- Examine all components looking for anonymous access-to-task
-- types.
First := True;
while Present (Comp) loop
Typ := Etype (Comp);
if Ekind (Typ) = E_Anonymous_Access_Type
and then Might_Have_Tasks
(Available_View (Designated_Type (Typ)))
and then No (Master_Id (Typ))
then
-- Ensure that the record or array type have a _master
if First then
Build_Master_Entity (Def_Id);
Build_Master_Renaming (Typ);
M_Id := Master_Id (Typ);
First := False;
-- Reuse the same master to service any additional types
else
pragma Assert (Present (M_Id));
Set_Master_Id (Typ, M_Id);
end if;
end if;
Next_Entity (Comp);
end loop;
end;
end if;
Par_Id := Etype (B_Id);
-- The parent type is private then we need to inherit any TSS operations
-- from the full view.
if Ekind (Par_Id) in Private_Kind
and then Present (Full_View (Par_Id))
then
Par_Id := Base_Type (Full_View (Par_Id));
end if;
if Nkind (Type_Definition (Original_Node (N))) =
N_Derived_Type_Definition
and then not Is_Tagged_Type (Def_Id)
and then Present (Freeze_Node (Par_Id))
and then Present (TSS_Elist (Freeze_Node (Par_Id)))
then
Ensure_Freeze_Node (B_Id);
FN := Freeze_Node (B_Id);
if No (TSS_Elist (FN)) then
Set_TSS_Elist (FN, New_Elmt_List);
end if;
declare
T_E : constant Elist_Id := TSS_Elist (FN);
Elmt : Elmt_Id;
begin
Elmt := First_Elmt (TSS_Elist (Freeze_Node (Par_Id)));
while Present (Elmt) loop
if Chars (Node (Elmt)) /= Name_uInit then
Append_Elmt (Node (Elmt), T_E);
end if;
Next_Elmt (Elmt);
end loop;
-- If the derived type itself is private with a full view, then
-- associate the full view with the inherited TSS_Elist as well.
if Ekind (B_Id) in Private_Kind
and then Present (Full_View (B_Id))
then
Ensure_Freeze_Node (Base_Type (Full_View (B_Id)));
Set_TSS_Elist
(Freeze_Node (Base_Type (Full_View (B_Id))), TSS_Elist (FN));
end if;
end;
end if;
end Expand_N_Full_Type_Declaration;
---------------------------------
-- Expand_N_Object_Declaration --
---------------------------------
procedure Expand_N_Object_Declaration (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Def_Id : constant Entity_Id := Defining_Identifier (N);
Expr : constant Node_Id := Expression (N);
Obj_Def : constant Node_Id := Object_Definition (N);
Typ : constant Entity_Id := Etype (Def_Id);
Base_Typ : constant Entity_Id := Base_Type (Typ);
Expr_Q : Node_Id;
function Build_Equivalent_Aggregate return Boolean;
-- If the object has a constrained discriminated type and no initial
-- value, it may be possible to build an equivalent aggregate instead,
-- and prevent an actual call to the initialization procedure.
procedure Count_Default_Sized_Task_Stacks
(Typ : Entity_Id;
Pri_Stacks : out Int;
Sec_Stacks : out Int);
-- Count the number of default-sized primary and secondary task stacks
-- required for task objects contained within type Typ. If the number of
-- task objects contained within the type is not known at compile time
-- the procedure will return the stack counts of zero.
procedure Default_Initialize_Object (After : Node_Id);
-- Generate all default initialization actions for object Def_Id. Any
-- new code is inserted after node After.
function Rewrite_As_Renaming return Boolean;
-- Indicate whether to rewrite a declaration with initialization into an
-- object renaming declaration (see below).
--------------------------------
-- Build_Equivalent_Aggregate --
--------------------------------
function Build_Equivalent_Aggregate return Boolean is
Aggr : Node_Id;
Comp : Entity_Id;
Discr : Elmt_Id;
Full_Type : Entity_Id;
begin
Full_Type := Typ;
if Is_Private_Type (Typ) and then Present (Full_View (Typ)) then
Full_Type := Full_View (Typ);
end if;
-- Only perform this transformation if Elaboration_Code is forbidden
-- or undesirable, and if this is a global entity of a constrained
-- record type.
-- If Initialize_Scalars might be active this transformation cannot
-- be performed either, because it will lead to different semantics
-- or because elaboration code will in fact be created.
if Ekind (Full_Type) /= E_Record_Subtype
or else not Has_Discriminants (Full_Type)
or else not Is_Constrained (Full_Type)
or else Is_Controlled (Full_Type)
or else Is_Limited_Type (Full_Type)
or else not Restriction_Active (No_Initialize_Scalars)
then
return False;
end if;
if Ekind (Current_Scope) = E_Package
and then
(Restriction_Active (No_Elaboration_Code)
or else Is_Preelaborated (Current_Scope))
then
-- Building a static aggregate is possible if the discriminants
-- have static values and the other components have static
-- defaults or none.
Discr := First_Elmt (Discriminant_Constraint (Full_Type));
while Present (Discr) loop
if not Is_OK_Static_Expression (Node (Discr)) then
return False;
end if;
Next_Elmt (Discr);
end loop;
-- Check that initialized components are OK, and that non-
-- initialized components do not require a call to their own
-- initialization procedure.
Comp := First_Component (Full_Type);
while Present (Comp) loop
if Ekind (Comp) = E_Component
and then Present (Expression (Parent (Comp)))
and then
not Is_OK_Static_Expression (Expression (Parent (Comp)))
then
return False;
elsif Has_Non_Null_Base_Init_Proc (Etype (Comp)) then
return False;
end if;
Next_Component (Comp);
end loop;
-- Everything is static, assemble the aggregate, discriminant
-- values first.
Aggr :=
Make_Aggregate (Loc,
Expressions => New_List,
Component_Associations => New_List);
Discr := First_Elmt (Discriminant_Constraint (Full_Type));
while Present (Discr) loop
Append_To (Expressions (Aggr), New_Copy (Node (Discr)));
Next_Elmt (Discr);
end loop;
-- Now collect values of initialized components
Comp := First_Component (Full_Type);
while Present (Comp) loop
if Ekind (Comp) = E_Component
and then Present (Expression (Parent (Comp)))
then
Append_To (Component_Associations (Aggr),
Make_Component_Association (Loc,
Choices => New_List (New_Occurrence_Of (Comp, Loc)),
Expression => New_Copy_Tree
(Expression (Parent (Comp)))));
end if;
Next_Component (Comp);
end loop;
-- Finally, box-initialize remaining components
Append_To (Component_Associations (Aggr),
Make_Component_Association (Loc,
Choices => New_List (Make_Others_Choice (Loc)),
Expression => Empty));
Set_Box_Present (Last (Component_Associations (Aggr)));
Set_Expression (N, Aggr);
if Typ /= Full_Type then
Analyze_And_Resolve (Aggr, Full_View (Base_Type (Full_Type)));
Rewrite (Aggr, Unchecked_Convert_To (Typ, Aggr));
Analyze_And_Resolve (Aggr, Typ);
else
Analyze_And_Resolve (Aggr, Full_Type);
end if;
return True;
else
return False;
end if;
end Build_Equivalent_Aggregate;
-------------------------------------
-- Count_Default_Sized_Task_Stacks --
-------------------------------------
procedure Count_Default_Sized_Task_Stacks
(Typ : Entity_Id;
Pri_Stacks : out Int;
Sec_Stacks : out Int)
is
Component : Entity_Id;
begin
-- To calculate the number of default-sized task stacks required for
-- an object of Typ, a depth-first recursive traversal of the AST
-- from the Typ entity node is undertaken. Only type nodes containing
-- task objects are visited.
Pri_Stacks := 0;
Sec_Stacks := 0;
if not Has_Task (Typ) then
return;
end if;
case Ekind (Typ) is
when E_Task_Subtype
| E_Task_Type
=>
-- A task type is found marking the bottom of the descent. If
-- the type has no representation aspect for the corresponding
-- stack then that stack is using the default size.
if Present (Get_Rep_Item (Typ, Name_Storage_Size)) then
Pri_Stacks := 0;
else
Pri_Stacks := 1;
end if;
if Present (Get_Rep_Item (Typ, Name_Secondary_Stack_Size)) then
Sec_Stacks := 0;
else
Sec_Stacks := 1;
end if;
when E_Array_Subtype
| E_Array_Type
=>
-- First find the number of default stacks contained within an
-- array component.
Count_Default_Sized_Task_Stacks
(Component_Type (Typ),
Pri_Stacks,
Sec_Stacks);
-- Then multiply the result by the size of the array
declare
Quantity : constant Int := Number_Of_Elements_In_Array (Typ);
-- Number_Of_Elements_In_Array is non-trival, consequently
-- its result is captured as an optimization.
begin
Pri_Stacks := Pri_Stacks * Quantity;
Sec_Stacks := Sec_Stacks * Quantity;
end;
when E_Protected_Subtype
| E_Protected_Type
| E_Record_Subtype
| E_Record_Type
=>
Component := First_Component_Or_Discriminant (Typ);
-- Recursively descend each component of the composite type
-- looking for tasks, but only if the component is marked as
-- having a task.
while Present (Component) loop
if Has_Task (Etype (Component)) then
declare
P : Int;
S : Int;
begin
Count_Default_Sized_Task_Stacks
(Etype (Component), P, S);
Pri_Stacks := Pri_Stacks + P;
Sec_Stacks := Sec_Stacks + S;
end;
end if;
Next_Component_Or_Discriminant (Component);
end loop;
when E_Limited_Private_Subtype
| E_Limited_Private_Type
| E_Record_Subtype_With_Private
| E_Record_Type_With_Private
=>
-- Switch to the full view of the private type to continue
-- search.
Count_Default_Sized_Task_Stacks
(Full_View (Typ), Pri_Stacks, Sec_Stacks);
-- Other types should not contain tasks
when others =>
raise Program_Error;
end case;
end Count_Default_Sized_Task_Stacks;
-------------------------------
-- Default_Initialize_Object --
-------------------------------
procedure Default_Initialize_Object (After : Node_Id) is
function New_Object_Reference return Node_Id;
-- Return a new reference to Def_Id with attributes Assignment_OK and
-- Must_Not_Freeze already set.
function Simple_Initialization_OK
(Init_Typ : Entity_Id) return Boolean;
-- Determine whether object declaration N with entity Def_Id needs
-- simple initialization, assuming that it is of type Init_Typ.
--------------------------
-- New_Object_Reference --
--------------------------
function New_Object_Reference return Node_Id is
Obj_Ref : constant Node_Id := New_Occurrence_Of (Def_Id, Loc);
begin
-- The call to the type init proc or [Deep_]Finalize must not
-- freeze the related object as the call is internally generated.
-- This way legal rep clauses that apply to the object will not be
-- flagged. Note that the initialization call may be removed if
-- pragma Import is encountered or moved to the freeze actions of
-- the object because of an address clause.
Set_Assignment_OK (Obj_Ref);
Set_Must_Not_Freeze (Obj_Ref);
return Obj_Ref;
end New_Object_Reference;
------------------------------
-- Simple_Initialization_OK --
------------------------------
function Simple_Initialization_OK
(Init_Typ : Entity_Id) return Boolean
is
begin
-- Do not consider the object declaration if it comes with an
-- initialization expression, or is internal in which case it
-- will be assigned later.
return
not Is_Internal (Def_Id)
and then not Has_Init_Expression (N)
and then Needs_Simple_Initialization
(Typ => Init_Typ,
Consider_IS =>
Initialize_Scalars
and then No (Following_Address_Clause (N)));
end Simple_Initialization_OK;
-- Local variables
Exceptions_OK : constant Boolean :=
not Restriction_Active (No_Exception_Propagation);
Aggr_Init : Node_Id;
Comp_Init : List_Id := No_List;
Fin_Block : Node_Id;
Fin_Call : Node_Id;
Init_Stmts : List_Id := No_List;
Obj_Init : Node_Id := Empty;
Obj_Ref : Node_Id;
-- Start of processing for Default_Initialize_Object
begin
-- Default initialization is suppressed for objects that are already
-- known to be imported (i.e. whose declaration specifies the Import
-- aspect). Note that for objects with a pragma Import, we generate
-- initialization here, and then remove it downstream when processing
-- the pragma. It is also suppressed for variables for which a pragma
-- Suppress_Initialization has been explicitly given
if Is_Imported (Def_Id) or else Suppress_Initialization (Def_Id) then
return;
-- Nothing to do if the object being initialized is of a task type
-- and restriction No_Tasking is in effect, because this is a direct
-- violation of the restriction.
elsif Is_Task_Type (Base_Typ)
and then Restriction_Active (No_Tasking)
then
return;
end if;
-- The expansion performed by this routine is as follows:
-- begin
-- Abort_Defer;
-- Type_Init_Proc (Obj);
-- begin
-- [Deep_]Initialize (Obj);
-- exception
-- when others =>
-- [Deep_]Finalize (Obj, Self => False);
-- raise;
-- end;
-- at end
-- Abort_Undefer_Direct;
-- end;
-- Initialize the components of the object
if Has_Non_Null_Base_Init_Proc (Typ)
and then not No_Initialization (N)
and then not Initialization_Suppressed (Typ)
then
-- Do not initialize the components if No_Default_Initialization
-- applies as the actual restriction check will occur later when
-- the object is frozen as it is not known yet whether the object
-- is imported or not.
if not Restriction_Active (No_Default_Initialization) then
-- If the values of the components are compile-time known, use
-- their prebuilt aggregate form directly.
Aggr_Init := Static_Initialization (Base_Init_Proc (Typ));
if Present (Aggr_Init) then
Set_Expression (N,
New_Copy_Tree (Aggr_Init, New_Scope => Current_Scope));
-- If type has discriminants, try to build an equivalent
-- aggregate using discriminant values from the declaration.
-- This is a useful optimization, in particular if restriction
-- No_Elaboration_Code is active.
elsif Build_Equivalent_Aggregate then
null;
-- Optimize the default initialization of an array object when
-- pragma Initialize_Scalars or Normalize_Scalars is in effect.
-- Construct an in-place initialization aggregate which may be
-- convert into a fast memset by the backend.
elsif Init_Or_Norm_Scalars
and then Is_Array_Type (Typ)
-- The array must lack atomic components because they are
-- treated as non-static, and as a result the backend will
-- not initialize the memory in one go.
and then not Has_Atomic_Components (Typ)
-- The array must not be packed because the invalid values
-- in System.Scalar_Values are multiples of Storage_Unit.
and then not Is_Packed (Typ)
-- The array must have static non-empty ranges, otherwise
-- the backend cannot initialize the memory in one go.
and then Has_Static_Non_Empty_Array_Bounds (Typ)
-- The optimization is only relevant for arrays of scalar
-- types.
and then Is_Scalar_Type (Component_Type (Typ))
-- Similar to regular array initialization using a type
-- init proc, predicate checks are not performed because the
-- initialization values are intentionally invalid, and may
-- violate the predicate.
and then not Has_Predicates (Component_Type (Typ))
-- The component type must have a single initialization value
and then Simple_Initialization_OK (Component_Type (Typ))
then
Set_No_Initialization (N, False);
Set_Expression (N,
Get_Simple_Init_Val
(Typ => Typ,
N => Obj_Def,
Size => Esize (Def_Id)));
Analyze_And_Resolve
(Expression (N), Typ, Suppress => All_Checks);
-- Otherwise invoke the type init proc, generate:
-- Type_Init_Proc (Obj);
else
Obj_Ref := New_Object_Reference;
if Comes_From_Source (Def_Id) then
Initialization_Warning (Obj_Ref);
end if;
Comp_Init := Build_Initialization_Call (Loc, Obj_Ref, Typ);
end if;
end if;
-- Provide a default value if the object needs simple initialization
elsif Simple_Initialization_OK (Typ) then
Set_No_Initialization (N, False);
Set_Expression (N,
Get_Simple_Init_Val
(Typ => Typ,
N => Obj_Def,
Size => Esize (Def_Id)));
Analyze_And_Resolve (Expression (N), Typ);
end if;
-- Initialize the object, generate:
-- [Deep_]Initialize (Obj);
if Needs_Finalization (Typ) and then not No_Initialization (N) then
Obj_Init :=
Make_Init_Call
(Obj_Ref => New_Occurrence_Of (Def_Id, Loc),
Typ => Typ);
end if;
-- Build a special finalization block when both the object and its
-- controlled components are to be initialized. The block finalizes
-- the components if the object initialization fails. Generate:
-- begin
-- <Obj_Init>
-- exception
-- when others =>
-- <Fin_Call>
-- raise;
-- end;
if Has_Controlled_Component (Typ)
and then Present (Comp_Init)
and then Present (Obj_Init)
and then Exceptions_OK
then
Init_Stmts := Comp_Init;
Fin_Call :=
Make_Final_Call
(Obj_Ref => New_Object_Reference,
Typ => Typ,
Skip_Self => True);
if Present (Fin_Call) then
-- Do not emit warnings related to the elaboration order when a
-- controlled object is declared before the body of Finalize is
-- seen.
if Legacy_Elaboration_Checks then
Set_No_Elaboration_Check (Fin_Call);
end if;
Fin_Block :=
Make_Block_Statement (Loc,
Declarations => No_List,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List (Obj_Init),
Exception_Handlers => New_List (
Make_Exception_Handler (Loc,
Exception_Choices => New_List (
Make_Others_Choice (Loc)),
Statements => New_List (
Fin_Call,
Make_Raise_Statement (Loc))))));
-- Signal the ABE mechanism that the block carries out
-- initialization actions.
Set_Is_Initialization_Block (Fin_Block);
Append_To (Init_Stmts, Fin_Block);
end if;
-- Otherwise finalization is not required, the initialization calls
-- are passed to the abort block building circuitry, generate:
-- Type_Init_Proc (Obj);
-- [Deep_]Initialize (Obj);
else
if Present (Comp_Init) then
Init_Stmts := Comp_Init;
end if;
if Present (Obj_Init) then
if No (Init_Stmts) then
Init_Stmts := New_List;
end if;
Append_To (Init_Stmts, Obj_Init);
end if;
end if;
-- Build an abort block to protect the initialization calls
if Abort_Allowed
and then Present (Comp_Init)
and then Present (Obj_Init)
then
-- Generate:
-- Abort_Defer;
Prepend_To (Init_Stmts, Build_Runtime_Call (Loc, RE_Abort_Defer));
-- When exceptions are propagated, abort deferral must take place
-- in the presence of initialization or finalization exceptions.
-- Generate:
-- begin
-- Abort_Defer;
-- <Init_Stmts>
-- at end
-- Abort_Undefer_Direct;
-- end;
if Exceptions_OK then
Init_Stmts := New_List (
Build_Abort_Undefer_Block (Loc,
Stmts => Init_Stmts,
Context => N));
-- Otherwise exceptions are not propagated. Generate:
-- Abort_Defer;
-- <Init_Stmts>
-- Abort_Undefer;
else
Append_To (Init_Stmts,
Build_Runtime_Call (Loc, RE_Abort_Undefer));
end if;
end if;
-- Insert the whole initialization sequence into the tree. If the
-- object has a delayed freeze, as will be the case when it has
-- aspect specifications, the initialization sequence is part of
-- the freeze actions.
if Present (Init_Stmts) then
if Has_Delayed_Freeze (Def_Id) then
Append_Freeze_Actions (Def_Id, Init_Stmts);
else
Insert_Actions_After (After, Init_Stmts);
end if;
end if;
end Default_Initialize_Object;
-------------------------
-- Rewrite_As_Renaming --
-------------------------
function Rewrite_As_Renaming return Boolean is
Result : constant Boolean :=
-- If the object declaration appears in the form
-- Obj : Ctrl_Typ := Func (...);
-- where Ctrl_Typ is controlled but not immutably limited type, then
-- the expansion of the function call should use a dereference of the
-- result to reference the value on the secondary stack.
-- Obj : Ctrl_Typ renames Func (...).all;
-- As a result, the call avoids an extra copy. This an optimization,
-- but it is required for passing ACATS tests in some cases where it
-- would otherwise make two copies. The RM allows removing redunant
-- Adjust/Finalize calls, but does not allow insertion of extra ones.
-- This part is disabled for now, because it breaks GNAT Studio
-- builds
(False -- ???
and then Nkind (Expr_Q) = N_Explicit_Dereference
and then not Comes_From_Source (Expr_Q)
and then Nkind (Original_Node (Expr_Q)) = N_Function_Call
and then Nkind (Object_Definition (N)) in N_Has_Entity
and then (Needs_Finalization (Entity (Object_Definition (N)))))
-- If the initializing expression is for a variable with attribute
-- OK_To_Rename set, then transform:
-- Obj : Typ := Expr;
-- into
-- Obj : Typ renames Expr;
-- provided that Obj is not aliased. The aliased case has to be
-- excluded in general because Expr will not be aliased in
-- general.
or else
(not Aliased_Present (N)
and then Is_Entity_Name (Expr_Q)
and then Ekind (Entity (Expr_Q)) = E_Variable
and then OK_To_Rename (Entity (Expr_Q))
and then Is_Entity_Name (Obj_Def));
begin
-- Return False if there are any aspect specifications, because
-- otherwise we duplicate that corresponding implicit attribute
-- definition, and call Insert_Action, which has no place to insert
-- the attribute definition. The attribute definition is stored in
-- Aspect_Rep_Item, which is not a list.
return Result and then No (Aspect_Specifications (N));
end Rewrite_As_Renaming;
-- Local variables
Next_N : constant Node_Id := Next (N);
Adj_Call : Node_Id;
Id_Ref : Node_Id;
Tag_Assign : Node_Id;
Init_After : Node_Id := N;
-- Node after which the initialization actions are to be inserted. This
-- is normally N, except for the case of a shared passive variable, in
-- which case the init proc call must be inserted only after the bodies
-- of the shared variable procedures have been seen.
-- Start of processing for Expand_N_Object_Declaration
begin
-- Don't do anything for deferred constants. All proper actions will be
-- expanded during the full declaration.
if No (Expr) and Constant_Present (N) then
return;
end if;
-- The type of the object cannot be abstract. This is diagnosed at the
-- point the object is frozen, which happens after the declaration is
-- fully expanded, so simply return now.
if Is_Abstract_Type (Typ) then
return;
end if;
-- No action needed for the internal imported dummy object added by
-- Make_DT to compute the offset of the components that reference
-- secondary dispatch tables; required to avoid never-ending loop
-- processing this internal object declaration.
if Tagged_Type_Expansion
and then Is_Internal (Def_Id)
and then Is_Imported (Def_Id)
and then Related_Type (Def_Id) = Implementation_Base_Type (Typ)
then
return;
end if;
-- First we do special processing for objects of a tagged type where
-- this is the point at which the type is frozen. The creation of the
-- dispatch table and the initialization procedure have to be deferred
-- to this point, since we reference previously declared primitive
-- subprograms.
-- Force construction of dispatch tables of library level tagged types
if Tagged_Type_Expansion
and then Building_Static_Dispatch_Tables
and then Is_Library_Level_Entity (Def_Id)
and then Is_Library_Level_Tagged_Type (Base_Typ)
and then Ekind (Base_Typ) in E_Record_Type
| E_Protected_Type
| E_Task_Type
and then not Has_Dispatch_Table (Base_Typ)
then
declare
New_Nodes : List_Id := No_List;
begin
if Is_Concurrent_Type (Base_Typ) then
New_Nodes := Make_DT (Corresponding_Record_Type (Base_Typ), N);
else
New_Nodes := Make_DT (Base_Typ, N);
end if;
if not Is_Empty_List (New_Nodes) then
Insert_List_Before (N, New_Nodes);
end if;
end;
end if;
-- Make shared memory routines for shared passive variable
if Is_Shared_Passive (Def_Id) then
Init_After := Make_Shared_Var_Procs (N);
end if;
-- If tasks are being declared, make sure we have an activation chain
-- defined for the tasks (has no effect if we already have one), and
-- also that a Master variable is established (and that the appropriate
-- enclosing construct is established as a task master).
Ensure_Activation_Chain_And_Master (N);
-- If No_Implicit_Heap_Allocations or No_Implicit_Task_Allocations
-- restrictions are active then default-sized secondary stacks are
-- generated by the binder and allocated by SS_Init. To provide the
-- binder the number of stacks to generate, the number of default-sized
-- stacks required for task objects contained within the object
-- declaration N is calculated here as it is at this point where
-- unconstrained types become constrained. The result is stored in the
-- enclosing unit's Unit_Record.
-- Note if N is an array object declaration that has an initialization
-- expression, a second object declaration for the initialization
-- expression is created by the compiler. To prevent double counting
-- of the stacks in this scenario, the stacks of the first array are
-- not counted.
if Might_Have_Tasks (Typ)
and then not Restriction_Active (No_Secondary_Stack)
and then (Restriction_Active (No_Implicit_Heap_Allocations)
or else Restriction_Active (No_Implicit_Task_Allocations))
and then not (Ekind (Typ) in E_Array_Type | E_Array_Subtype
and then (Has_Init_Expression (N)))
then
declare
PS_Count, SS_Count : Int := 0;
begin
Count_Default_Sized_Task_Stacks (Typ, PS_Count, SS_Count);
Increment_Primary_Stack_Count (PS_Count);
Increment_Sec_Stack_Count (SS_Count);
end;
end if;
-- Default initialization required, and no expression present
if No (Expr) then
-- If we have a type with a variant part, the initialization proc
-- will contain implicit tests of the discriminant values, which
-- counts as a violation of the restriction No_Implicit_Conditionals.
if Has_Variant_Part (Typ) then
declare
Msg : Boolean;
begin
Check_Restriction (Msg, No_Implicit_Conditionals, Obj_Def);
if Msg then
Error_Msg_N
("\initialization of variant record tests discriminants",
Obj_Def);
return;
end if;
end;
end if;
-- For the default initialization case, if we have a private type
-- with invariants, and invariant checks are enabled, then insert an
-- invariant check after the object declaration. Note that it is OK
-- to clobber the object with an invalid value since if the exception
-- is raised, then the object will go out of scope. In the case where
-- an array object is initialized with an aggregate, the expression
-- is removed. Check flag Has_Init_Expression to avoid generating a
-- junk invariant check and flag No_Initialization to avoid checking
-- an uninitialized object such as a compiler temporary used for an
-- aggregate.
if Has_Invariants (Base_Typ)
and then Present (Invariant_Procedure (Base_Typ))
and then not Has_Init_Expression (N)
and then not No_Initialization (N)
then
-- If entity has an address clause or aspect, make invariant
-- call into a freeze action for the explicit freeze node for
-- object. Otherwise insert invariant check after declaration.
if Present (Following_Address_Clause (N))
or else Has_Aspect (Def_Id, Aspect_Address)
then
Ensure_Freeze_Node (Def_Id);
Set_Has_Delayed_Freeze (Def_Id);
Set_Is_Frozen (Def_Id, False);
if not Partial_View_Has_Unknown_Discr (Typ) then
Append_Freeze_Action (Def_Id,
Make_Invariant_Call (New_Occurrence_Of (Def_Id, Loc)));
end if;
elsif not Partial_View_Has_Unknown_Discr (Typ) then
Insert_After (N,
Make_Invariant_Call (New_Occurrence_Of (Def_Id, Loc)));
end if;
end if;
Default_Initialize_Object (Init_After);
-- Generate attribute for Persistent_BSS if needed
if Persistent_BSS_Mode
and then Comes_From_Source (N)
and then Is_Potentially_Persistent_Type (Typ)
and then not Has_Init_Expression (N)
and then Is_Library_Level_Entity (Def_Id)
then
declare
Prag : Node_Id;
begin
Prag :=
Make_Linker_Section_Pragma
(Def_Id, Sloc (N), ".persistent.bss");
Insert_After (N, Prag);
Analyze (Prag);
end;
end if;
-- If access type, then we know it is null if not initialized
if Is_Access_Type (Typ) then
Set_Is_Known_Null (Def_Id);
end if;
-- Explicit initialization present
else
-- Obtain actual expression from qualified expression
if Nkind (Expr) = N_Qualified_Expression then
Expr_Q := Expression (Expr);
else
Expr_Q := Expr;
end if;
-- When we have the appropriate type of aggregate in the expression
-- (it has been determined during analysis of the aggregate by
-- setting the delay flag), let's perform in place assignment and
-- thus avoid creating a temporary.
if Is_Delayed_Aggregate (Expr_Q) then
-- An aggregate that must be built in place is not resolved and
-- expanded until the enclosing construct is expanded. This will
-- happen when the aggregate is limited and the declared object
-- has a following address clause; it happens also when generating
-- C code for an aggregate that has an alignment or address clause
-- (see Analyze_Object_Declaration).
if (Is_Limited_Type (Typ) or else Modify_Tree_For_C)
and then not Analyzed (Expr)
then
Resolve (Expr, Typ);
end if;
Convert_Aggr_In_Object_Decl (N);
-- Ada 2005 (AI-318-02): If the initialization expression is a call
-- to a build-in-place function, then access to the declared object
-- must be passed to the function. Currently we limit such functions
-- to those with constrained limited result subtypes, but eventually
-- plan to expand the allowed forms of functions that are treated as
-- build-in-place.
elsif Is_Build_In_Place_Function_Call (Expr_Q) then
Make_Build_In_Place_Call_In_Object_Declaration (N, Expr_Q);
-- The previous call expands the expression initializing the
-- built-in-place object into further code that will be analyzed
-- later. No further expansion needed here.
return;
-- This is the same as the previous 'elsif', except that the call has
-- been transformed by other expansion activities into something like
-- F(...)'Reference.
elsif Nkind (Expr_Q) = N_Reference
and then Is_Build_In_Place_Function_Call (Prefix (Expr_Q))
and then not Is_Expanded_Build_In_Place_Call
(Unqual_Conv (Prefix (Expr_Q)))
then
Make_Build_In_Place_Call_In_Anonymous_Context (Prefix (Expr_Q));
-- The previous call expands the expression initializing the
-- built-in-place object into further code that will be analyzed
-- later. No further expansion needed here.
return;
-- Ada 2005 (AI-318-02): Specialization of the previous case for
-- expressions containing a build-in-place function call whose
-- returned object covers interface types, and Expr_Q has calls to
-- Ada.Tags.Displace to displace the pointer to the returned build-
-- in-place object to reference the secondary dispatch table of a
-- covered interface type.
elsif Present (Unqual_BIP_Iface_Function_Call (Expr_Q)) then
Make_Build_In_Place_Iface_Call_In_Object_Declaration (N, Expr_Q);
-- The previous call expands the expression initializing the
-- built-in-place object into further code that will be analyzed
-- later. No further expansion needed here.
return;
-- Ada 2005 (AI-251): Rewrite the expression that initializes a
-- class-wide interface object to ensure that we copy the full
-- object, unless we are targetting a VM where interfaces are handled
-- by VM itself. Note that if the root type of Typ is an ancestor of
-- Expr's type, both types share the same dispatch table and there is
-- no need to displace the pointer.
elsif Is_Interface (Typ)
-- Avoid never-ending recursion because if Equivalent_Type is set
-- then we've done it already and must not do it again.
and then not
(Nkind (Obj_Def) = N_Identifier
and then Present (Equivalent_Type (Entity (Obj_Def))))
then
pragma Assert (Is_Class_Wide_Type (Typ));
-- If the object is a return object of an inherently limited type,
-- which implies build-in-place treatment, bypass the special
-- treatment of class-wide interface initialization below. In this
-- case, the expansion of the return statement will take care of
-- creating the object (via allocator) and initializing it.
if Is_Return_Object (Def_Id) and then Is_Limited_View (Typ) then
null;
elsif Tagged_Type_Expansion then
declare
Iface : constant Entity_Id := Root_Type (Typ);
Expr_N : Node_Id := Expr;
Expr_Typ : Entity_Id;
New_Expr : Node_Id;
Obj_Id : Entity_Id;
Tag_Comp : Node_Id;
begin
-- If the original node of the expression was a conversion
-- to this specific class-wide interface type then restore
-- the original node because we must copy the object before
-- displacing the pointer to reference the secondary tag
-- component. This code must be kept synchronized with the
-- expansion done by routine Expand_Interface_Conversion
if not Comes_From_Source (Expr_N)
and then Nkind (Expr_N) = N_Explicit_Dereference
and then Nkind (Original_Node (Expr_N)) = N_Type_Conversion
and then Etype (Original_Node (Expr_N)) = Typ
then
Rewrite (Expr_N, Original_Node (Expression (N)));
end if;
-- Avoid expansion of redundant interface conversion
if Is_Interface (Etype (Expr_N))
and then Nkind (Expr_N) = N_Type_Conversion
and then Etype (Expr_N) = Typ
then
Expr_N := Expression (Expr_N);
Set_Expression (N, Expr_N);
end if;
Obj_Id := Make_Temporary (Loc, 'D', Expr_N);
Expr_Typ := Base_Type (Etype (Expr_N));
if Is_Class_Wide_Type (Expr_Typ) then
Expr_Typ := Root_Type (Expr_Typ);
end if;
-- Replace
-- CW : I'Class := Obj;
-- by
-- Tmp : T := Obj;
-- type Ityp is not null access I'Class;
-- CW : I'Class renames Ityp (Tmp.I_Tag'Address).all;
if Comes_From_Source (Expr_N)
and then Nkind (Expr_N) = N_Identifier
and then not Is_Interface (Expr_Typ)
and then Interface_Present_In_Ancestor (Expr_Typ, Typ)
and then (Expr_Typ = Etype (Expr_Typ)
or else not
Is_Variable_Size_Record (Etype (Expr_Typ)))
then
-- Copy the object
Insert_Action (N,
Make_Object_Declaration (Loc,
Defining_Identifier => Obj_Id,
Object_Definition =>
New_Occurrence_Of (Expr_Typ, Loc),
Expression => Relocate_Node (Expr_N)));
-- Statically reference the tag associated with the
-- interface
Tag_Comp :=
Make_Selected_Component (Loc,
Prefix => New_Occurrence_Of (Obj_Id, Loc),
Selector_Name =>
New_Occurrence_Of
(Find_Interface_Tag (Expr_Typ, Iface), Loc));
-- Replace
-- IW : I'Class := Obj;
-- by
-- type Equiv_Record is record ... end record;
-- implicit subtype CW is <Class_Wide_Subtype>;
-- Tmp : CW := CW!(Obj);
-- type Ityp is not null access I'Class;
-- IW : I'Class renames
-- Ityp!(Displace (Temp'Address, I'Tag)).all;
else
-- Generate the equivalent record type and update the
-- subtype indication to reference it.
Expand_Subtype_From_Expr
(N => N,
Unc_Type => Typ,
Subtype_Indic => Obj_Def,
Exp => Expr_N);
if not Is_Interface (Etype (Expr_N)) then
New_Expr := Relocate_Node (Expr_N);
-- For interface types we use 'Address which displaces
-- the pointer to the base of the object (if required)
else
New_Expr :=
Unchecked_Convert_To (Etype (Obj_Def),
Make_Explicit_Dereference (Loc,
Unchecked_Convert_To (RTE (RE_Tag_Ptr),
Make_Attribute_Reference (Loc,
Prefix => Relocate_Node (Expr_N),
Attribute_Name => Name_Address))));
end if;
-- Copy the object
if not Is_Limited_Record (Expr_Typ) then
Insert_Action (N,
Make_Object_Declaration (Loc,
Defining_Identifier => Obj_Id,
Object_Definition =>
New_Occurrence_Of (Etype (Obj_Def), Loc),
Expression => New_Expr));
-- Rename limited type object since they cannot be copied
-- This case occurs when the initialization expression
-- has been previously expanded into a temporary object.
else pragma Assert (not Comes_From_Source (Expr_Q));
Insert_Action (N,
Make_Object_Renaming_Declaration (Loc,
Defining_Identifier => Obj_Id,
Subtype_Mark =>
New_Occurrence_Of (Etype (Obj_Def), Loc),
Name =>
Unchecked_Convert_To
(Etype (Obj_Def), New_Expr)));
end if;
-- Dynamically reference the tag associated with the
-- interface.
Tag_Comp :=
Make_Function_Call (Loc,
Name => New_Occurrence_Of (RTE (RE_Displace), Loc),
Parameter_Associations => New_List (
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Obj_Id, Loc),
Attribute_Name => Name_Address),
New_Occurrence_Of
(Node (First_Elmt (Access_Disp_Table (Iface))),
Loc)));
end if;
Rewrite (N,
Make_Object_Renaming_Declaration (Loc,
Defining_Identifier => Make_Temporary (Loc, 'D'),
Subtype_Mark => New_Occurrence_Of (Typ, Loc),
Name =>
Convert_Tag_To_Interface (Typ, Tag_Comp)));
-- If the original entity comes from source, then mark the
-- new entity as needing debug information, even though it's
-- defined by a generated renaming that does not come from
-- source, so that Materialize_Entity will be set on the
-- entity when Debug_Renaming_Declaration is called during
-- analysis.
if Comes_From_Source (Def_Id) then
Set_Debug_Info_Needed (Defining_Identifier (N));
end if;
Analyze (N, Suppress => All_Checks);
-- Replace internal identifier of rewritten node by the
-- identifier found in the sources. We also have to exchange
-- entities containing their defining identifiers to ensure
-- the correct replacement of the object declaration by this
-- object renaming declaration because these identifiers
-- were previously added by Enter_Name to the current scope.
-- We must preserve the homonym chain of the source entity
-- as well. We must also preserve the kind of the entity,
-- which may be a constant. Preserve entity chain because
-- itypes may have been generated already, and the full
-- chain must be preserved for final freezing. Finally,
-- preserve Comes_From_Source setting, so that debugging
-- and cross-referencing information is properly kept, and
-- preserve source location, to prevent spurious errors when
-- entities are declared (they must have their own Sloc).
declare
New_Id : constant Entity_Id := Defining_Identifier (N);
Next_Temp : constant Entity_Id := Next_Entity (New_Id);
Save_CFS : constant Boolean :=
Comes_From_Source (Def_Id);
Save_SP : constant Node_Id := SPARK_Pragma (Def_Id);
Save_SPI : constant Boolean :=
SPARK_Pragma_Inherited (Def_Id);
begin
Link_Entities (New_Id, Next_Entity (Def_Id));
Link_Entities (Def_Id, Next_Temp);
Set_Chars (Defining_Identifier (N), Chars (Def_Id));
Set_Homonym (Defining_Identifier (N), Homonym (Def_Id));
Set_Ekind (Defining_Identifier (N), Ekind (Def_Id));
Set_Sloc (Defining_Identifier (N), Sloc (Def_Id));
Set_Comes_From_Source (Def_Id, False);
-- ??? This is extremely dangerous!!! Exchanging entities
-- is very low level, and as a result it resets flags and
-- fields which belong to the original Def_Id. Several of
-- these attributes are saved and restored, but there may
-- be many more that need to be preserverd.
Exchange_Entities (Defining_Identifier (N), Def_Id);
-- Restore clobbered attributes
Set_Comes_From_Source (Def_Id, Save_CFS);
Set_SPARK_Pragma (Def_Id, Save_SP);
Set_SPARK_Pragma_Inherited (Def_Id, Save_SPI);
end;
end;
end if;
return;
-- Common case of explicit object initialization
else
-- In most cases, we must check that the initial value meets any
-- constraint imposed by the declared type. However, there is one
-- very important exception to this rule. If the entity has an
-- unconstrained nominal subtype, then it acquired its constraints
-- from the expression in the first place, and not only does this
-- mean that the constraint check is not needed, but an attempt to
-- perform the constraint check can cause order of elaboration
-- problems.
if not Is_Constr_Subt_For_U_Nominal (Typ) then
-- If this is an allocator for an aggregate that has been
-- allocated in place, delay checks until assignments are
-- made, because the discriminants are not initialized.
if Nkind (Expr) = N_Allocator
and then No_Initialization (Expr)
then
null;
-- Otherwise apply a constraint check now if no prev error
elsif Nkind (Expr) /= N_Error then
Apply_Constraint_Check (Expr, Typ);
-- Deal with possible range check
if Do_Range_Check (Expr) then
-- If assignment checks are suppressed, turn off flag
if Suppress_Assignment_Checks (N) then
Set_Do_Range_Check (Expr, False);
-- Otherwise generate the range check
else
Generate_Range_Check
(Expr, Typ, CE_Range_Check_Failed);
end if;
end if;
end if;
end if;
-- If the type is controlled and not inherently limited, then
-- the target is adjusted after the copy and attached to the
-- finalization list. However, no adjustment is done in the case
-- where the object was initialized by a call to a function whose
-- result is built in place, since no copy occurred. Similarly, no
-- adjustment is required if we are going to rewrite the object
-- declaration into a renaming declaration.
if Needs_Finalization (Typ)
and then not Is_Limited_View (Typ)
and then not Rewrite_As_Renaming
then
Adj_Call :=
Make_Adjust_Call (
Obj_Ref => New_Occurrence_Of (Def_Id, Loc),
Typ => Base_Typ);
-- Guard against a missing [Deep_]Adjust when the base type
-- was not properly frozen.
if Present (Adj_Call) then
Insert_Action_After (Init_After, Adj_Call);
end if;
end if;
-- For tagged types, when an init value is given, the tag has to
-- be re-initialized separately in order to avoid the propagation
-- of a wrong tag coming from a view conversion unless the type
-- is class wide (in this case the tag comes from the init value).
-- Suppress the tag assignment when not Tagged_Type_Expansion
-- because tags are represented implicitly in objects. Ditto for
-- types that are CPP_CLASS, and for initializations that are
-- aggregates, because they have to have the right tag.
-- The re-assignment of the tag has to be done even if the object
-- is a constant. The assignment must be analyzed after the
-- declaration. If an address clause follows, this is handled as
-- part of the freeze actions for the object, otherwise insert
-- tag assignment here.
Tag_Assign := Make_Tag_Assignment (N);
if Present (Tag_Assign) then
if Present (Following_Address_Clause (N)) then
Ensure_Freeze_Node (Def_Id);
else
Insert_Action_After (Init_After, Tag_Assign);
end if;
-- Handle C++ constructor calls. Note that we do not check that
-- Typ is a tagged type since the equivalent Ada type of a C++
-- class that has no virtual methods is an untagged limited
-- record type.
elsif Is_CPP_Constructor_Call (Expr) then
-- The call to the initialization procedure does NOT freeze the
-- object being initialized.
Id_Ref := New_Occurrence_Of (Def_Id, Loc);
Set_Must_Not_Freeze (Id_Ref);
Set_Assignment_OK (Id_Ref);
Insert_Actions_After (Init_After,
Build_Initialization_Call (Loc, Id_Ref, Typ,
Constructor_Ref => Expr));
-- We remove here the original call to the constructor
-- to avoid its management in the backend
Set_Expression (N, Empty);
return;
-- Handle initialization of limited tagged types
elsif Is_Tagged_Type (Typ)
and then Is_Class_Wide_Type (Typ)
and then Is_Limited_Record (Typ)
and then not Is_Limited_Interface (Typ)
then
-- Given that the type is limited we cannot perform a copy. If
-- Expr_Q is the reference to a variable we mark the variable
-- as OK_To_Rename to expand this declaration into a renaming
-- declaration (see below).
if Is_Entity_Name (Expr_Q) then
Set_OK_To_Rename (Entity (Expr_Q));
-- If we cannot convert the expression into a renaming we must
-- consider it an internal error because the backend does not
-- have support to handle it. Also, when a raise expression is
-- encountered we ignore it since it doesn't return a value and
-- thus cannot trigger a copy.
elsif Nkind (Original_Node (Expr_Q)) /= N_Raise_Expression then
pragma Assert (False);
raise Program_Error;
end if;
-- For discrete types, set the Is_Known_Valid flag if the
-- initializing value is known to be valid. Only do this for
-- source assignments, since otherwise we can end up turning
-- on the known valid flag prematurely from inserted code.
elsif Comes_From_Source (N)
and then Is_Discrete_Type (Typ)
and then Expr_Known_Valid (Expr)
then
Set_Is_Known_Valid (Def_Id);
elsif Is_Access_Type (Typ) then
-- For access types set the Is_Known_Non_Null flag if the
-- initializing value is known to be non-null. We can also set
-- Can_Never_Be_Null if this is a constant.
if Known_Non_Null (Expr) then
Set_Is_Known_Non_Null (Def_Id, True);
if Constant_Present (N) then
Set_Can_Never_Be_Null (Def_Id);
end if;
end if;
end if;
-- If validity checking on copies, validate initial expression.
-- But skip this if declaration is for a generic type, since it
-- makes no sense to validate generic types. Not clear if this
-- can happen for legal programs, but it definitely can arise
-- from previous instantiation errors.
if Validity_Checks_On
and then Comes_From_Source (N)
and then Validity_Check_Copies
and then not Is_Generic_Type (Etype (Def_Id))
then
Ensure_Valid (Expr);
Set_Is_Known_Valid (Def_Id);
end if;
end if;
-- Cases where the back end cannot handle the initialization
-- directly. In such cases, we expand an assignment that will
-- be appropriately handled by Expand_N_Assignment_Statement.
-- The exclusion of the unconstrained case is wrong, but for now it
-- is too much trouble ???
if (Is_Possibly_Unaligned_Slice (Expr)
or else (Is_Possibly_Unaligned_Object (Expr)
and then not Represented_As_Scalar (Etype (Expr))))
and then not (Is_Array_Type (Etype (Expr))
and then not Is_Constrained (Etype (Expr)))
then
declare
Stat : constant Node_Id :=
Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (Def_Id, Loc),
Expression => Relocate_Node (Expr));
begin
Set_Expression (N, Empty);
Set_No_Initialization (N);
Set_Assignment_OK (Name (Stat));
Set_No_Ctrl_Actions (Stat);
Insert_After_And_Analyze (Init_After, Stat);
end;
end if;
end if;
if Nkind (Obj_Def) = N_Access_Definition
and then not Is_Local_Anonymous_Access (Etype (Def_Id))
then
-- An Ada 2012 stand-alone object of an anonymous access type
declare
Loc : constant Source_Ptr := Sloc (N);
Level : constant Entity_Id :=
Make_Defining_Identifier (Sloc (N),
Chars =>
New_External_Name (Chars (Def_Id), Suffix => "L"));
Level_Decl : Node_Id;
Level_Expr : Node_Id;
begin
Set_Ekind (Level, Ekind (Def_Id));
Set_Etype (Level, Standard_Natural);
Set_Scope (Level, Scope (Def_Id));
-- Set accessibility level of null
if No (Expr) then
Level_Expr :=
Make_Integer_Literal (Loc, Scope_Depth (Standard_Standard));
-- When the expression of the object is a function which returns
-- an anonymous access type the master of the call is the object
-- being initialized instead of the type.
elsif Nkind (Expr) = N_Function_Call
and then Ekind (Etype (Name (Expr))) = E_Anonymous_Access_Type
then
Level_Expr := Make_Integer_Literal (Loc,
Object_Access_Level (Def_Id));
-- General case
else
Level_Expr := Dynamic_Accessibility_Level (Expr);
end if;
Level_Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Level,
Object_Definition =>
New_Occurrence_Of (Standard_Natural, Loc),
Expression => Level_Expr,
Constant_Present => Constant_Present (N),
Has_Init_Expression => True);
Insert_Action_After (Init_After, Level_Decl);
Set_Extra_Accessibility (Def_Id, Level);
end;
end if;
-- If the object is default initialized and its type is subject to
-- pragma Default_Initial_Condition, add a runtime check to verify
-- the assumption of the pragma (SPARK RM 7.3.3). Generate:
-- <Base_Typ>DIC (<Base_Typ> (Def_Id));
-- Note that the check is generated for source objects only
if Comes_From_Source (Def_Id)
and then Has_DIC (Typ)
and then Present (DIC_Procedure (Typ))
and then not Has_Init_Expression (N)
and then not Is_Imported (Def_Id)
then
declare
DIC_Call : constant Node_Id := Build_DIC_Call (Loc, Def_Id, Typ);
begin
if Present (Next_N) then
Insert_Before_And_Analyze (Next_N, DIC_Call);
-- The object declaration is the last node in a declarative or a
-- statement list.
else
Append_To (List_Containing (N), DIC_Call);
Analyze (DIC_Call);
end if;
end;
end if;
-- Final transformation - turn the object declaration into a renaming
-- if appropriate. If this is the completion of a deferred constant
-- declaration, then this transformation generates what would be
-- illegal code if written by hand, but that's OK.
if Present (Expr) then
if Rewrite_As_Renaming then
Rewrite (N,
Make_Object_Renaming_Declaration (Loc,
Defining_Identifier => Defining_Identifier (N),
Subtype_Mark => Obj_Def,
Name => Expr_Q));
-- We do not analyze this renaming declaration, because all its
-- components have already been analyzed, and if we were to go
-- ahead and analyze it, we would in effect be trying to generate
-- another declaration of X, which won't do.
Set_Renamed_Object (Defining_Identifier (N), Expr_Q);
Set_Analyzed (N);
-- We do need to deal with debug issues for this renaming
-- First, if entity comes from source, then mark it as needing
-- debug information, even though it is defined by a generated
-- renaming that does not come from source.
Set_Debug_Info_Defining_Id (N);
-- Now call the routine to generate debug info for the renaming
declare
Decl : constant Node_Id := Debug_Renaming_Declaration (N);
begin
if Present (Decl) then
Insert_Action (N, Decl);
end if;
end;
end if;
end if;
-- Exception on library entity not available
exception
when RE_Not_Available =>
return;
end Expand_N_Object_Declaration;
---------------------------------
-- Expand_N_Subtype_Indication --
---------------------------------
-- Add a check on the range of the subtype and deal with validity checking
procedure Expand_N_Subtype_Indication (N : Node_Id) is
Ran : constant Node_Id := Range_Expression (Constraint (N));
Typ : constant Entity_Id := Entity (Subtype_Mark (N));
begin
if Nkind (Constraint (N)) = N_Range_Constraint then
Validity_Check_Range (Range_Expression (Constraint (N)));
end if;
-- Do not duplicate the work of Process_Range_Expr_In_Decl in Sem_Ch3
if Nkind (Parent (N)) in N_Constrained_Array_Definition | N_Slice
and then Nkind (Parent (Parent (N))) not in
N_Full_Type_Declaration | N_Object_Declaration
then
Apply_Range_Check (Ran, Typ);
end if;
end Expand_N_Subtype_Indication;
---------------------------
-- Expand_N_Variant_Part --
---------------------------
-- Note: this procedure no longer has any effect. It used to be that we
-- would replace the choices in the last variant by a when others, and
-- also expanded static predicates in variant choices here, but both of
-- those activities were being done too early, since we can't check the
-- choices until the statically predicated subtypes are frozen, which can
-- happen as late as the free point of the record, and we can't change the
-- last choice to an others before checking the choices, which is now done
-- at the freeze point of the record.
procedure Expand_N_Variant_Part (N : Node_Id) is
begin
null;
end Expand_N_Variant_Part;
---------------------------------
-- Expand_Previous_Access_Type --
---------------------------------
procedure Expand_Previous_Access_Type (Def_Id : Entity_Id) is
Ptr_Typ : Entity_Id;
begin
-- Find all access types in the current scope whose designated type is
-- Def_Id and build master renamings for them.
Ptr_Typ := First_Entity (Current_Scope);
while Present (Ptr_Typ) loop
if Is_Access_Type (Ptr_Typ)
and then Designated_Type (Ptr_Typ) = Def_Id
and then No (Master_Id (Ptr_Typ))
then
-- Ensure that the designated type has a master
Build_Master_Entity (Def_Id);
-- Private and incomplete types complicate the insertion of master
-- renamings because the access type may precede the full view of
-- the designated type. For this reason, the master renamings are
-- inserted relative to the designated type.
Build_Master_Renaming (Ptr_Typ, Ins_Nod => Parent (Def_Id));
end if;
Next_Entity (Ptr_Typ);
end loop;
end Expand_Previous_Access_Type;
-----------------------------
-- Expand_Record_Extension --
-----------------------------
-- Add a field _parent at the beginning of the record extension. This is
-- used to implement inheritance. Here are some examples of expansion:
-- 1. no discriminants
-- type T2 is new T1 with null record;
-- gives
-- type T2 is new T1 with record
-- _Parent : T1;
-- end record;
-- 2. renamed discriminants
-- type T2 (B, C : Int) is new T1 (A => B) with record
-- _Parent : T1 (A => B);
-- D : Int;
-- end;
-- 3. inherited discriminants
-- type T2 is new T1 with record -- discriminant A inherited
-- _Parent : T1 (A);
-- D : Int;
-- end;
procedure Expand_Record_Extension (T : Entity_Id; Def : Node_Id) is
Indic : constant Node_Id := Subtype_Indication (Def);
Loc : constant Source_Ptr := Sloc (Def);
Rec_Ext_Part : Node_Id := Record_Extension_Part (Def);
Par_Subtype : Entity_Id;
Comp_List : Node_Id;
Comp_Decl : Node_Id;
Parent_N : Node_Id;
D : Entity_Id;
List_Constr : constant List_Id := New_List;
begin
-- Expand_Record_Extension is called directly from the semantics, so
-- we must check to see whether expansion is active before proceeding,
-- because this affects the visibility of selected components in bodies
-- of instances.
if not Expander_Active then
return;
end if;
-- This may be a derivation of an untagged private type whose full
-- view is tagged, in which case the Derived_Type_Definition has no
-- extension part. Build an empty one now.
if No (Rec_Ext_Part) then
Rec_Ext_Part :=
Make_Record_Definition (Loc,
End_Label => Empty,
Component_List => Empty,
Null_Present => True);
Set_Record_Extension_Part (Def, Rec_Ext_Part);
Mark_Rewrite_Insertion (Rec_Ext_Part);
end if;
Comp_List := Component_List (Rec_Ext_Part);
Parent_N := Make_Defining_Identifier (Loc, Name_uParent);
-- If the derived type inherits its discriminants the type of the
-- _parent field must be constrained by the inherited discriminants
if Has_Discriminants (T)
and then Nkind (Indic) /= N_Subtype_Indication
and then not Is_Constrained (Entity (Indic))
then
D := First_Discriminant (T);
while Present (D) loop
Append_To (List_Constr, New_Occurrence_Of (D, Loc));
Next_Discriminant (D);
end loop;
Par_Subtype :=
Process_Subtype (
Make_Subtype_Indication (Loc,
Subtype_Mark => New_Occurrence_Of (Entity (Indic), Loc),
Constraint =>
Make_Index_Or_Discriminant_Constraint (Loc,
Constraints => List_Constr)),
Def);
-- Otherwise the original subtype_indication is just what is needed
else
Par_Subtype := Process_Subtype (New_Copy_Tree (Indic), Def);
end if;
Set_Parent_Subtype (T, Par_Subtype);
Comp_Decl :=
Make_Component_Declaration (Loc,
Defining_Identifier => Parent_N,
Component_Definition =>
Make_Component_Definition (Loc,
Aliased_Present => False,
Subtype_Indication => New_Occurrence_Of (Par_Subtype, Loc)));
if Null_Present (Rec_Ext_Part) then
Set_Component_List (Rec_Ext_Part,
Make_Component_List (Loc,
Component_Items => New_List (Comp_Decl),
Variant_Part => Empty,
Null_Present => False));
Set_Null_Present (Rec_Ext_Part, False);
elsif Null_Present (Comp_List)
or else Is_Empty_List (Component_Items (Comp_List))
then
Set_Component_Items (Comp_List, New_List (Comp_Decl));
Set_Null_Present (Comp_List, False);
else
Insert_Before (First (Component_Items (Comp_List)), Comp_Decl);
end if;
Analyze (Comp_Decl);
end Expand_Record_Extension;
------------------------
-- Expand_Tagged_Root --
------------------------
procedure Expand_Tagged_Root (T : Entity_Id) is
Def : constant Node_Id := Type_Definition (Parent (T));
Comp_List : Node_Id;
Comp_Decl : Node_Id;
Sloc_N : Source_Ptr;
begin
if Null_Present (Def) then
Set_Component_List (Def,
Make_Component_List (Sloc (Def),
Component_Items => Empty_List,
Variant_Part => Empty,
Null_Present => True));
end if;
Comp_List := Component_List (Def);
if Null_Present (Comp_List)
or else Is_Empty_List (Component_Items (Comp_List))
then
Sloc_N := Sloc (Comp_List);
else
Sloc_N := Sloc (First (Component_Items (Comp_List)));
end if;
Comp_Decl :=
Make_Component_Declaration (Sloc_N,
Defining_Identifier => First_Tag_Component (T),
Component_Definition =>
Make_Component_Definition (Sloc_N,
Aliased_Present => False,
Subtype_Indication => New_Occurrence_Of (RTE (RE_Tag), Sloc_N)));
if Null_Present (Comp_List)
or else Is_Empty_List (Component_Items (Comp_List))
then
Set_Component_Items (Comp_List, New_List (Comp_Decl));
Set_Null_Present (Comp_List, False);
else
Insert_Before (First (Component_Items (Comp_List)), Comp_Decl);
end if;
-- We don't Analyze the whole expansion because the tag component has
-- already been analyzed previously. Here we just insure that the tree
-- is coherent with the semantic decoration
Find_Type (Subtype_Indication (Component_Definition (Comp_Decl)));
exception
when RE_Not_Available =>
return;
end Expand_Tagged_Root;
------------------------------
-- Freeze_Stream_Operations --
------------------------------
procedure Freeze_Stream_Operations (N : Node_Id; Typ : Entity_Id) is
Names : constant array (1 .. 4) of TSS_Name_Type :=
(TSS_Stream_Input,
TSS_Stream_Output,
TSS_Stream_Read,
TSS_Stream_Write);
Stream_Op : Entity_Id;
begin
-- Primitive operations of tagged types are frozen when the dispatch
-- table is constructed.
if not Comes_From_Source (Typ) or else Is_Tagged_Type (Typ) then
return;
end if;
for J in Names'Range loop
Stream_Op := TSS (Typ, Names (J));
if Present (Stream_Op)
and then Is_Subprogram (Stream_Op)
and then Nkind (Unit_Declaration_Node (Stream_Op)) =
N_Subprogram_Declaration
and then not Is_Frozen (Stream_Op)
then
Append_Freeze_Actions (Typ, Freeze_Entity (Stream_Op, N));
end if;
end loop;
end Freeze_Stream_Operations;
-----------------
-- Freeze_Type --
-----------------
-- Full type declarations are expanded at the point at which the type is
-- frozen. The formal N is the Freeze_Node for the type. Any statements or
-- declarations generated by the freezing (e.g. the procedure generated
-- for initialization) are chained in the Actions field list of the freeze
-- node using Append_Freeze_Actions.
-- WARNING: This routine manages Ghost regions. Return statements must be
-- replaced by gotos which jump to the end of the routine and restore the
-- Ghost mode.
function Freeze_Type (N : Node_Id) return Boolean is
procedure Process_RACW_Types (Typ : Entity_Id);
-- Validate and generate stubs for all RACW types associated with type
-- Typ.
procedure Process_Pending_Access_Types (Typ : Entity_Id);
-- Associate type Typ's Finalize_Address primitive with the finalization
-- masters of pending access-to-Typ types.
------------------------
-- Process_RACW_Types --
------------------------
procedure Process_RACW_Types (Typ : Entity_Id) is
List : constant Elist_Id := Access_Types_To_Process (N);
E : Elmt_Id;
Seen : Boolean := False;
begin
if Present (List) then
E := First_Elmt (List);
while Present (E) loop
if Is_Remote_Access_To_Class_Wide_Type (Node (E)) then
Validate_RACW_Primitives (Node (E));
Seen := True;
end if;
Next_Elmt (E);
end loop;
end if;
-- If there are RACWs designating this type, make stubs now
if Seen then
Remote_Types_Tagged_Full_View_Encountered (Typ);
end if;
end Process_RACW_Types;
----------------------------------
-- Process_Pending_Access_Types --
----------------------------------
procedure Process_Pending_Access_Types (Typ : Entity_Id) is
E : Elmt_Id;
begin
-- Finalize_Address is not generated in CodePeer mode because the
-- body contains address arithmetic. This processing is disabled.
if CodePeer_Mode then
null;
-- Certain itypes are generated for contexts that cannot allocate
-- objects and should not set primitive Finalize_Address.
elsif Is_Itype (Typ)
and then Nkind (Associated_Node_For_Itype (Typ)) =
N_Explicit_Dereference
then
null;
-- When an access type is declared after the incomplete view of a
-- Taft-amendment type, the access type is considered pending in
-- case the full view of the Taft-amendment type is controlled. If
-- this is indeed the case, associate the Finalize_Address routine
-- of the full view with the finalization masters of all pending
-- access types. This scenario applies to anonymous access types as
-- well.
elsif Needs_Finalization (Typ)
and then Present (Pending_Access_Types (Typ))
then
E := First_Elmt (Pending_Access_Types (Typ));
while Present (E) loop
-- Generate:
-- Set_Finalize_Address
-- (Ptr_Typ, <Typ>FD'Unrestricted_Access);
Append_Freeze_Action (Typ,
Make_Set_Finalize_Address_Call
(Loc => Sloc (N),
Ptr_Typ => Node (E)));
Next_Elmt (E);
end loop;
end if;
end Process_Pending_Access_Types;
-- Local variables
Def_Id : constant Entity_Id := Entity (N);
Saved_GM : constant Ghost_Mode_Type := Ghost_Mode;
Saved_IGR : constant Node_Id := Ignored_Ghost_Region;
-- Save the Ghost-related attributes to restore on exit
Result : Boolean := False;
-- Start of processing for Freeze_Type
begin
-- The type being frozen may be subject to pragma Ghost. Set the mode
-- now to ensure that any nodes generated during freezing are properly
-- marked as Ghost.
Set_Ghost_Mode (Def_Id);
-- Process any remote access-to-class-wide types designating the type
-- being frozen.
Process_RACW_Types (Def_Id);
-- Freeze processing for record types
if Is_Record_Type (Def_Id) then
if Ekind (Def_Id) = E_Record_Type then
Expand_Freeze_Record_Type (N);
elsif Is_Class_Wide_Type (Def_Id) then
Expand_Freeze_Class_Wide_Type (N);
end if;
-- Freeze processing for array types
elsif Is_Array_Type (Def_Id) then
Expand_Freeze_Array_Type (N);
-- Freeze processing for access types
-- For pool-specific access types, find out the pool object used for
-- this type, needs actual expansion of it in some cases. Here are the
-- different cases :
-- 1. Rep Clause "for Def_Id'Storage_Size use 0;"
-- ---> don't use any storage pool
-- 2. Rep Clause : for Def_Id'Storage_Size use Expr.
-- Expand:
-- Def_Id__Pool : Stack_Bounded_Pool (Expr, DT'Size, DT'Alignment);
-- 3. Rep Clause "for Def_Id'Storage_Pool use a_Pool_Object"
-- ---> Storage Pool is the specified one
-- See GNAT Pool packages in the Run-Time for more details
elsif Ekind (Def_Id) in E_Access_Type | E_General_Access_Type then
declare
Loc : constant Source_Ptr := Sloc (N);
Desig_Type : constant Entity_Id := Designated_Type (Def_Id);
Freeze_Action_Typ : Entity_Id;
Pool_Object : Entity_Id;
begin
-- Case 1
-- Rep Clause "for Def_Id'Storage_Size use 0;"
-- ---> don't use any storage pool
if No_Pool_Assigned (Def_Id) then
null;
-- Case 2
-- Rep Clause : for Def_Id'Storage_Size use Expr.
-- ---> Expand:
-- Def_Id__Pool : Stack_Bounded_Pool
-- (Expr, DT'Size, DT'Alignment);
elsif Has_Storage_Size_Clause (Def_Id) then
declare
DT_Align : Node_Id;
DT_Size : Node_Id;
begin
-- For unconstrained composite types we give a size of zero
-- so that the pool knows that it needs a special algorithm
-- for variable size object allocation.
if Is_Composite_Type (Desig_Type)
and then not Is_Constrained (Desig_Type)
then
DT_Size := Make_Integer_Literal (Loc, 0);
DT_Align := Make_Integer_Literal (Loc, Maximum_Alignment);
else
DT_Size :=
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Desig_Type, Loc),
Attribute_Name => Name_Max_Size_In_Storage_Elements);
DT_Align :=
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Desig_Type, Loc),
Attribute_Name => Name_Alignment);
end if;
Pool_Object :=
Make_Defining_Identifier (Loc,
Chars => New_External_Name (Chars (Def_Id), 'P'));
-- We put the code associated with the pools in the entity
-- that has the later freeze node, usually the access type
-- but it can also be the designated_type; because the pool
-- code requires both those types to be frozen
if Is_Frozen (Desig_Type)
and then (No (Freeze_Node (Desig_Type))
or else Analyzed (Freeze_Node (Desig_Type)))
then
Freeze_Action_Typ := Def_Id;
-- A Taft amendment type cannot get the freeze actions
-- since the full view is not there.
elsif Is_Incomplete_Or_Private_Type (Desig_Type)
and then No (Full_View (Desig_Type))
then
Freeze_Action_Typ := Def_Id;
else
Freeze_Action_Typ := Desig_Type;
end if;
Append_Freeze_Action (Freeze_Action_Typ,
Make_Object_Declaration (Loc,
Defining_Identifier => Pool_Object,
Object_Definition =>
Make_Subtype_Indication (Loc,
Subtype_Mark =>
New_Occurrence_Of
(RTE (RE_Stack_Bounded_Pool), Loc),
Constraint =>
Make_Index_Or_Discriminant_Constraint (Loc,
Constraints => New_List (
-- First discriminant is the Pool Size
New_Occurrence_Of (
Storage_Size_Variable (Def_Id), Loc),
-- Second discriminant is the element size
DT_Size,
-- Third discriminant is the alignment
DT_Align)))));
end;
Set_Associated_Storage_Pool (Def_Id, Pool_Object);
-- Case 3
-- Rep Clause "for Def_Id'Storage_Pool use a_Pool_Object"
-- ---> Storage Pool is the specified one
-- When compiling in Ada 2012 mode, ensure that the accessibility
-- level of the subpool access type is not deeper than that of the
-- pool_with_subpools.
elsif Ada_Version >= Ada_2012
and then Present (Associated_Storage_Pool (Def_Id))
and then RTU_Loaded (System_Storage_Pools_Subpools)
then
declare
Loc : constant Source_Ptr := Sloc (Def_Id);
Pool : constant Entity_Id :=
Associated_Storage_Pool (Def_Id);
begin
-- It is known that the accessibility level of the access
-- type is deeper than that of the pool.
if Type_Access_Level (Def_Id) > Object_Access_Level (Pool)
and then Is_Class_Wide_Type (Etype (Pool))
and then not Accessibility_Checks_Suppressed (Def_Id)
and then not Accessibility_Checks_Suppressed (Pool)
then
-- When the pool is of a class-wide type, it may or may
-- not support subpools depending on the path of
-- derivation. Generate:
-- if Def_Id in RSPWS'Class then
-- raise Program_Error;
-- end if;
Append_Freeze_Action (Def_Id,
Make_If_Statement (Loc,
Condition =>
Make_In (Loc,
Left_Opnd => New_Occurrence_Of (Pool, Loc),
Right_Opnd =>
New_Occurrence_Of
(Class_Wide_Type
(RTE
(RE_Root_Storage_Pool_With_Subpools)),
Loc)),
Then_Statements => New_List (
Make_Raise_Program_Error (Loc,
Reason => PE_Accessibility_Check_Failed))));
end if;
end;
end if;
-- For access-to-controlled types (including class-wide types and
-- Taft-amendment types, which potentially have controlled
-- components), expand the list controller object that will store
-- the dynamically allocated objects. Don't do this transformation
-- for expander-generated access types, except do it for types
-- that are the full view of types derived from other private
-- types and for access types used to implement indirect temps.
-- Also suppress the list controller in the case of a designated
-- type with convention Java, since this is used when binding to
-- Java API specs, where there's no equivalent of a finalization
-- list and we don't want to pull in the finalization support if
-- not needed.
if not Comes_From_Source (Def_Id)
and then not Has_Private_Declaration (Def_Id)
and then not Old_Attr_Util.Indirect_Temps
.Is_Access_Type_For_Indirect_Temp (Def_Id)
then
null;
-- An exception is made for types defined in the run-time because
-- Ada.Tags.Tag itself is such a type and cannot afford this
-- unnecessary overhead that would generates a loop in the
-- expansion scheme. Another exception is if Restrictions
-- (No_Finalization) is active, since then we know nothing is
-- controlled.
elsif Restriction_Active (No_Finalization)
or else In_Runtime (Def_Id)
then
null;
-- Create a finalization master for an access-to-controlled type
-- or an access-to-incomplete type. It is assumed that the full
-- view will be controlled.
elsif Needs_Finalization (Desig_Type)
or else (Is_Incomplete_Type (Desig_Type)
and then No (Full_View (Desig_Type)))
then
Build_Finalization_Master (Def_Id);
-- Create a finalization master when the designated type contains
-- a private component. It is assumed that the full view will be
-- controlled.
elsif Has_Private_Component (Desig_Type) then
Build_Finalization_Master
(Typ => Def_Id,
For_Private => True,
Context_Scope => Scope (Def_Id),
Insertion_Node => Declaration_Node (Desig_Type));
end if;
end;
-- Freeze processing for enumeration types
elsif Ekind (Def_Id) = E_Enumeration_Type then
-- We only have something to do if we have a non-standard
-- representation (i.e. at least one literal whose pos value
-- is not the same as its representation)
if Has_Non_Standard_Rep (Def_Id) then
Expand_Freeze_Enumeration_Type (N);
end if;
-- Private types that are completed by a derivation from a private
-- type have an internally generated full view, that needs to be
-- frozen. This must be done explicitly because the two views share
-- the freeze node, and the underlying full view is not visible when
-- the freeze node is analyzed.
elsif Is_Private_Type (Def_Id)
and then Is_Derived_Type (Def_Id)
and then Present (Full_View (Def_Id))
and then Is_Itype (Full_View (Def_Id))
and then Has_Private_Declaration (Full_View (Def_Id))
and then Freeze_Node (Full_View (Def_Id)) = N
then
Set_Entity (N, Full_View (Def_Id));
Result := Freeze_Type (N);
Set_Entity (N, Def_Id);
-- All other types require no expander action. There are such cases
-- (e.g. task types and protected types). In such cases, the freeze
-- nodes are there for use by Gigi.
end if;
-- Complete the initialization of all pending access types' finalization
-- masters now that the designated type has been is frozen and primitive
-- Finalize_Address generated.
Process_Pending_Access_Types (Def_Id);
Freeze_Stream_Operations (N, Def_Id);
-- Generate the [spec and] body of the procedure tasked with the runtime
-- verification of pragma Default_Initial_Condition's expression.
if Has_DIC (Def_Id) then
Build_DIC_Procedure_Body (Def_Id, For_Freeze => True);
end if;
-- Generate the [spec and] body of the invariant procedure tasked with
-- the runtime verification of all invariants that pertain to the type.
-- This includes invariants on the partial and full view, inherited
-- class-wide invariants from parent types or interfaces, and invariants
-- on array elements or record components.
if Is_Interface (Def_Id) then
-- Interfaces are treated as the partial view of a private type in
-- order to achieve uniformity with the general case. As a result, an
-- interface receives only a "partial" invariant procedure which is
-- never called.
if Has_Own_Invariants (Def_Id) then
Build_Invariant_Procedure_Body
(Typ => Def_Id,
Partial_Invariant => Is_Interface (Def_Id));
end if;
-- Non-interface types
-- Do not generate invariant procedure within other assertion
-- subprograms, which may involve local declarations of local
-- subtypes to which these checks do not apply.
elsif Has_Invariants (Def_Id) then
if not Predicate_Check_In_Scope (Def_Id)
or else (Ekind (Current_Scope) = E_Function
and then Is_Predicate_Function (Current_Scope))
then
null;
else
Build_Invariant_Procedure_Body (Def_Id);
end if;
end if;
Restore_Ghost_Region (Saved_GM, Saved_IGR);
return Result;
exception
when RE_Not_Available =>
Restore_Ghost_Region (Saved_GM, Saved_IGR);
return False;
end Freeze_Type;
-------------------------
-- Get_Simple_Init_Val --
-------------------------
function Get_Simple_Init_Val
(Typ : Entity_Id;
N : Node_Id;
Size : Uint := No_Uint) return Node_Id
is
IV_Attribute : constant Boolean :=
Nkind (N) = N_Attribute_Reference
and then Attribute_Name (N) = Name_Invalid_Value;
Loc : constant Source_Ptr := Sloc (N);
procedure Extract_Subtype_Bounds
(Lo_Bound : out Uint;
Hi_Bound : out Uint);
-- Inspect subtype Typ as well its ancestor subtypes and derived types
-- to determine the best known information about the bounds of the type.
-- The output parameters are set as follows:
--
-- * Lo_Bound - Set to No_Unit when there is no information available,
-- or to the known low bound.
--
-- * Hi_Bound - Set to No_Unit when there is no information available,
-- or to the known high bound.
function Simple_Init_Array_Type return Node_Id;
-- Build an expression to initialize array type Typ
function Simple_Init_Defaulted_Type return Node_Id;
-- Build an expression to initialize type Typ which is subject to
-- aspect Default_Value.
function Simple_Init_Initialize_Scalars_Type
(Size_To_Use : Uint) return Node_Id;
-- Build an expression to initialize scalar type Typ which is subject to
-- pragma Initialize_Scalars. Size_To_Use is the size of the object.
function Simple_Init_Normalize_Scalars_Type
(Size_To_Use : Uint) return Node_Id;
-- Build an expression to initialize scalar type Typ which is subject to
-- pragma Normalize_Scalars. Size_To_Use is the size of the object.
function Simple_Init_Private_Type return Node_Id;
-- Build an expression to initialize private type Typ
function Simple_Init_Scalar_Type return Node_Id;
-- Build an expression to initialize scalar type Typ
----------------------------
-- Extract_Subtype_Bounds --
----------------------------
procedure Extract_Subtype_Bounds
(Lo_Bound : out Uint;
Hi_Bound : out Uint)
is
ST1 : Entity_Id;
ST2 : Entity_Id;
Lo : Node_Id;
Hi : Node_Id;
Lo_Val : Uint;
Hi_Val : Uint;
begin
Lo_Bound := No_Uint;
Hi_Bound := No_Uint;
-- Loop to climb ancestor subtypes and derived types
ST1 := Typ;
loop
if not Is_Discrete_Type (ST1) then
return;
end if;
Lo := Type_Low_Bound (ST1);
Hi := Type_High_Bound (ST1);
if Compile_Time_Known_Value (Lo) then
Lo_Val := Expr_Value (Lo);
if Lo_Bound = No_Uint or else Lo_Bound < Lo_Val then
Lo_Bound := Lo_Val;
end if;
end if;
if Compile_Time_Known_Value (Hi) then
Hi_Val := Expr_Value (Hi);
if Hi_Bound = No_Uint or else Hi_Bound > Hi_Val then
Hi_Bound := Hi_Val;
end if;
end if;
ST2 := Ancestor_Subtype (ST1);
if No (ST2) then
ST2 := Etype (ST1);
end if;
exit when ST1 = ST2;
ST1 := ST2;
end loop;
end Extract_Subtype_Bounds;
----------------------------
-- Simple_Init_Array_Type --
----------------------------
function Simple_Init_Array_Type return Node_Id is
Comp_Typ : constant Entity_Id := Component_Type (Typ);
function Simple_Init_Dimension (Index : Node_Id) return Node_Id;
-- Initialize a single array dimension with index constraint Index
--------------------
-- Simple_Init_Dimension --
--------------------
function Simple_Init_Dimension (Index : Node_Id) return Node_Id is
begin
-- Process the current dimension
if Present (Index) then
-- Build a suitable "others" aggregate for the next dimension,
-- or initialize the component itself. Generate:
--
-- (others => ...)
return
Make_Aggregate (Loc,
Component_Associations => New_List (
Make_Component_Association (Loc,
Choices => New_List (Make_Others_Choice (Loc)),
Expression =>
Simple_Init_Dimension (Next_Index (Index)))));
-- Otherwise all dimensions have been processed. Initialize the
-- component itself.
else
return
Get_Simple_Init_Val
(Typ => Comp_Typ,
N => N,
Size => Esize (Comp_Typ));
end if;
end Simple_Init_Dimension;
-- Start of processing for Simple_Init_Array_Type
begin
return Simple_Init_Dimension (First_Index (Typ));
end Simple_Init_Array_Type;
--------------------------------
-- Simple_Init_Defaulted_Type --
--------------------------------
function Simple_Init_Defaulted_Type return Node_Id is
Subtyp : constant Entity_Id := First_Subtype (Typ);
begin
-- Use the Sloc of the context node when constructing the initial
-- value because the expression of Default_Value may come from a
-- different unit. Updating the Sloc will result in accurate error
-- diagnostics.
-- When the first subtype is private, retrieve the expression of the
-- Default_Value from the underlying type.
if Is_Private_Type (Subtyp) then
return
Unchecked_Convert_To
(Typ => Typ,
Expr =>
New_Copy_Tree
(Source => Default_Aspect_Value (Full_View (Subtyp)),
New_Sloc => Loc));
else
return
Convert_To
(Typ => Typ,
Expr =>
New_Copy_Tree
(Source => Default_Aspect_Value (Subtyp),
New_Sloc => Loc));
end if;
end Simple_Init_Defaulted_Type;
-----------------------------------------
-- Simple_Init_Initialize_Scalars_Type --
-----------------------------------------
function Simple_Init_Initialize_Scalars_Type
(Size_To_Use : Uint) return Node_Id
is
Float_Typ : Entity_Id;
Hi_Bound : Uint;
Lo_Bound : Uint;
Scal_Typ : Scalar_Id;
begin
Extract_Subtype_Bounds (Lo_Bound, Hi_Bound);
-- Float types
if Is_Floating_Point_Type (Typ) then
Float_Typ := Root_Type (Typ);
if Float_Typ = Standard_Short_Float then
Scal_Typ := Name_Short_Float;
elsif Float_Typ = Standard_Float then
Scal_Typ := Name_Float;
elsif Float_Typ = Standard_Long_Float then
Scal_Typ := Name_Long_Float;
else pragma Assert (Float_Typ = Standard_Long_Long_Float);
Scal_Typ := Name_Long_Long_Float;
end if;
-- If zero is invalid, it is a convenient value to use that is for
-- sure an appropriate invalid value in all situations.
elsif Lo_Bound /= No_Uint and then Lo_Bound > Uint_0 then
return Make_Integer_Literal (Loc, 0);
-- Unsigned types
elsif Is_Unsigned_Type (Typ) then
if Size_To_Use <= 8 then
Scal_Typ := Name_Unsigned_8;
elsif Size_To_Use <= 16 then
Scal_Typ := Name_Unsigned_16;
elsif Size_To_Use <= 32 then
Scal_Typ := Name_Unsigned_32;
else
Scal_Typ := Name_Unsigned_64;
end if;
-- Signed types
else
if Size_To_Use <= 8 then
Scal_Typ := Name_Signed_8;
elsif Size_To_Use <= 16 then
Scal_Typ := Name_Signed_16;
elsif Size_To_Use <= 32 then
Scal_Typ := Name_Signed_32;
else
Scal_Typ := Name_Signed_64;
end if;
end if;
-- Use the values specified by pragma Initialize_Scalars or the ones
-- provided by the binder. Higher precedence is given to the pragma.
return Invalid_Scalar_Value (Loc, Scal_Typ);
end Simple_Init_Initialize_Scalars_Type;
----------------------------------------
-- Simple_Init_Normalize_Scalars_Type --
----------------------------------------
function Simple_Init_Normalize_Scalars_Type
(Size_To_Use : Uint) return Node_Id
is
Signed_Size : constant Uint := UI_Min (Uint_63, Size_To_Use - 1);
Expr : Node_Id;
Hi_Bound : Uint;
Lo_Bound : Uint;
begin
Extract_Subtype_Bounds (Lo_Bound, Hi_Bound);
-- If zero is invalid, it is a convenient value to use that is for
-- sure an appropriate invalid value in all situations.
if Lo_Bound /= No_Uint and then Lo_Bound > Uint_0 then
Expr := Make_Integer_Literal (Loc, 0);
-- Cases where all one bits is the appropriate invalid value
-- For modular types, all 1 bits is either invalid or valid. If it
-- is valid, then there is nothing that can be done since there are
-- no invalid values (we ruled out zero already).
-- For signed integer types that have no negative values, either
-- there is room for negative values, or there is not. If there
-- is, then all 1-bits may be interpreted as minus one, which is
-- certainly invalid. Alternatively it is treated as the largest
-- positive value, in which case the observation for modular types
-- still applies.
-- For float types, all 1-bits is a NaN (not a number), which is
-- certainly an appropriately invalid value.
elsif Is_Enumeration_Type (Typ)
or else Is_Floating_Point_Type (Typ)
or else Is_Unsigned_Type (Typ)
then
Expr := Make_Integer_Literal (Loc, 2 ** Size_To_Use - 1);
-- Resolve as Long_Long_Unsigned, because the largest number
-- we can generate is out of range of universal integer.
Analyze_And_Resolve (Expr, Standard_Long_Long_Unsigned);
-- Case of signed types
else
-- Normally we like to use the most negative number. The one
-- exception is when this number is in the known subtype range and
-- the largest positive number is not in the known subtype range.
-- For this exceptional case, use largest positive value
if Lo_Bound /= No_Uint and then Hi_Bound /= No_Uint
and then Lo_Bound <= (-(2 ** Signed_Size))
and then Hi_Bound < 2 ** Signed_Size
then
Expr := Make_Integer_Literal (Loc, 2 ** Signed_Size - 1);
-- Normal case of largest negative value
else
Expr := Make_Integer_Literal (Loc, -(2 ** Signed_Size));
end if;
end if;
return Expr;
end Simple_Init_Normalize_Scalars_Type;
------------------------------
-- Simple_Init_Private_Type --
------------------------------
function Simple_Init_Private_Type return Node_Id is
Under_Typ : constant Entity_Id := Underlying_Type (Typ);
Expr : Node_Id;
begin
-- The availability of the underlying view must be checked by routine
-- Needs_Simple_Initialization.
pragma Assert (Present (Under_Typ));
Expr := Get_Simple_Init_Val (Under_Typ, N, Size);
-- If the initial value is null or an aggregate, qualify it with the
-- underlying type in order to provide a proper context.
if Nkind (Expr) in N_Aggregate | N_Null then
Expr :=
Make_Qualified_Expression (Loc,
Subtype_Mark => New_Occurrence_Of (Under_Typ, Loc),
Expression => Expr);
end if;
Expr := Unchecked_Convert_To (Typ, Expr);
-- Do not truncate the result when scalar types are involved and
-- Initialize/Normalize_Scalars is in effect.
if Nkind (Expr) = N_Unchecked_Type_Conversion
and then Is_Scalar_Type (Under_Typ)
then
Set_No_Truncation (Expr);
end if;
return Expr;
end Simple_Init_Private_Type;
-----------------------------
-- Simple_Init_Scalar_Type --
-----------------------------
function Simple_Init_Scalar_Type return Node_Id is
Expr : Node_Id;
Size_To_Use : Uint;
begin
pragma Assert (Init_Or_Norm_Scalars or IV_Attribute);
-- Determine the size of the object. This is either the size provided
-- by the caller, or the Esize of the scalar type.
if Size = No_Uint or else Size <= Uint_0 then
Size_To_Use := UI_Max (Uint_1, Esize (Typ));
else
Size_To_Use := Size;
end if;
-- The maximum size to use is System_Max_Integer_Size bits. This
-- will create values of type Long_Long_Unsigned and the range
-- must fit this type.
if Size_To_Use /= No_Uint
and then Size_To_Use > System_Max_Integer_Size
then
Size_To_Use := UI_From_Int (System_Max_Integer_Size);
end if;
if Normalize_Scalars and then not IV_Attribute then
Expr := Simple_Init_Normalize_Scalars_Type (Size_To_Use);
else
Expr := Simple_Init_Initialize_Scalars_Type (Size_To_Use);
end if;
-- The final expression is obtained by doing an unchecked conversion
-- of this result to the base type of the required subtype. Use the
-- base type to prevent the unchecked conversion from chopping bits,
-- and then we set Kill_Range_Check to preserve the "bad" value.
Expr := Unchecked_Convert_To (Base_Type (Typ), Expr);
-- Ensure that the expression is not truncated since the "bad" bits
-- are desired, and also kill the range checks.
if Nkind (Expr) = N_Unchecked_Type_Conversion then
Set_Kill_Range_Check (Expr);
Set_No_Truncation (Expr);
end if;
return Expr;
end Simple_Init_Scalar_Type;
-- Start of processing for Get_Simple_Init_Val
begin
if Is_Private_Type (Typ) then
return Simple_Init_Private_Type;
elsif Is_Scalar_Type (Typ) then
if Has_Default_Aspect (Typ) then
return Simple_Init_Defaulted_Type;
else
return Simple_Init_Scalar_Type;
end if;
-- Array type with Initialize or Normalize_Scalars
elsif Is_Array_Type (Typ) then
pragma Assert (Init_Or_Norm_Scalars);
return Simple_Init_Array_Type;
-- Access type is initialized to null
elsif Is_Access_Type (Typ) then
return Make_Null (Loc);
-- No other possibilities should arise, since we should only be calling
-- Get_Simple_Init_Val if Needs_Simple_Initialization returned True,
-- indicating one of the above cases held.
else
raise Program_Error;
end if;
exception
when RE_Not_Available =>
return Empty;
end Get_Simple_Init_Val;
------------------------------
-- Has_New_Non_Standard_Rep --
------------------------------
function Has_New_Non_Standard_Rep (T : Entity_Id) return Boolean is
begin
if not Is_Derived_Type (T) then
return Has_Non_Standard_Rep (T)
or else Has_Non_Standard_Rep (Root_Type (T));
-- If Has_Non_Standard_Rep is not set on the derived type, the
-- representation is fully inherited.
elsif not Has_Non_Standard_Rep (T) then
return False;
else
return First_Rep_Item (T) /= First_Rep_Item (Root_Type (T));
-- May need a more precise check here: the First_Rep_Item may be a
-- stream attribute, which does not affect the representation of the
-- type ???
end if;
end Has_New_Non_Standard_Rep;
----------------------
-- Inline_Init_Proc --
----------------------
function Inline_Init_Proc (Typ : Entity_Id) return Boolean is
begin
-- The initialization proc of protected records is not worth inlining.
-- In addition, when compiled for another unit for inlining purposes,
-- it may make reference to entities that have not been elaborated yet.
-- The initialization proc of records that need finalization contains
-- a nested clean-up procedure that makes it impractical to inline as
-- well, except for simple controlled types themselves. And similar
-- considerations apply to task types.
if Is_Concurrent_Type (Typ) then
return False;
elsif Needs_Finalization (Typ) and then not Is_Controlled (Typ) then
return False;
elsif Has_Task (Typ) then
return False;
else
return True;
end if;
end Inline_Init_Proc;
----------------
-- In_Runtime --
----------------
function In_Runtime (E : Entity_Id) return Boolean is
S1 : Entity_Id;
begin
S1 := Scope (E);
while Scope (S1) /= Standard_Standard loop
S1 := Scope (S1);
end loop;
return Is_RTU (S1, System) or else Is_RTU (S1, Ada);
end In_Runtime;
----------------------------
-- Initialization_Warning --
----------------------------
procedure Initialization_Warning (E : Entity_Id) is
Warning_Needed : Boolean;
begin
Warning_Needed := False;
if Ekind (Current_Scope) = E_Package
and then Static_Elaboration_Desired (Current_Scope)
then
if Is_Type (E) then
if Is_Record_Type (E) then
if Has_Discriminants (E)
or else Is_Limited_Type (E)
or else Has_Non_Standard_Rep (E)
then
Warning_Needed := True;
else
-- Verify that at least one component has an initialization
-- expression. No need for a warning on a type if all its
-- components have no initialization.
declare
Comp : Entity_Id;
begin
Comp := First_Component (E);
while Present (Comp) loop
if Ekind (Comp) = E_Discriminant
or else
(Nkind (Parent (Comp)) = N_Component_Declaration
and then Present (Expression (Parent (Comp))))
then
Warning_Needed := True;
exit;
end if;
Next_Component (Comp);
end loop;
end;
end if;
if Warning_Needed then
Error_Msg_N
("Objects of the type cannot be initialized statically "
& "by default??", Parent (E));
end if;
end if;
else
Error_Msg_N ("Object cannot be initialized statically??", E);
end if;
end if;
end Initialization_Warning;
------------------
-- Init_Formals --
------------------
function Init_Formals (Typ : Entity_Id; Proc_Id : Entity_Id) return List_Id
is
Loc : constant Source_Ptr := Sloc (Typ);
Unc_Arr : constant Boolean :=
Is_Array_Type (Typ) and then not Is_Constrained (Typ);
With_Prot : constant Boolean :=
Has_Protected (Typ)
or else (Is_Record_Type (Typ)
and then Is_Protected_Record_Type (Typ));
With_Task : constant Boolean :=
not Global_No_Tasking
and then
(Has_Task (Typ)
or else (Is_Record_Type (Typ)
and then Is_Task_Record_Type (Typ)));
Formals : List_Id;
begin
-- The first parameter is always _Init : [in] out Typ. Note that we need
-- it to be in/out in the case of an unconstrained array, because of the
-- need to have the bounds, and in the case of protected or task record
-- value, because there are default record fields that may be referenced
-- in the generated initialization routine.
Formals := New_List (
Make_Parameter_Specification (Loc,
Defining_Identifier => Make_Defining_Identifier (Loc, Name_uInit),
In_Present => Unc_Arr or else With_Prot or else With_Task,
Out_Present => True,
Parameter_Type => New_Occurrence_Of (Typ, Loc)));
-- For task record value, or type that contains tasks, add two more
-- formals, _Master : Master_Id and _Chain : in out Activation_Chain
-- We also add these parameters for the task record type case.
if With_Task then
Append_To (Formals,
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_uMaster),
Parameter_Type =>
New_Occurrence_Of (RTE (RE_Master_Id), Loc)));
Set_Has_Master_Entity (Proc_Id);
-- Add _Chain (not done for sequential elaboration policy, see
-- comment for Create_Restricted_Task_Sequential in s-tarest.ads).
if Partition_Elaboration_Policy /= 'S' then
Append_To (Formals,
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_uChain),
In_Present => True,
Out_Present => True,
Parameter_Type =>
New_Occurrence_Of (RTE (RE_Activation_Chain), Loc)));
end if;
Append_To (Formals,
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_uTask_Name),
In_Present => True,
Parameter_Type => New_Occurrence_Of (Standard_String, Loc)));
end if;
-- Due to certain edge cases such as arrays with null-excluding
-- components being built with the secondary stack it becomes necessary
-- to add a formal to the Init_Proc which controls whether we raise
-- Constraint_Errors on generated calls for internal object
-- declarations.
if Needs_Conditional_Null_Excluding_Check (Typ) then
Append_To (Formals,
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc,
New_External_Name (Chars
(Component_Type (Typ)), "_skip_null_excluding_check")),
Expression => New_Occurrence_Of (Standard_False, Loc),
In_Present => True,
Parameter_Type =>
New_Occurrence_Of (Standard_Boolean, Loc)));
end if;
return Formals;
exception
when RE_Not_Available =>
return Empty_List;
end Init_Formals;
-------------------------
-- Init_Secondary_Tags --
-------------------------
procedure Init_Secondary_Tags
(Typ : Entity_Id;
Target : Node_Id;
Init_Tags_List : List_Id;
Stmts_List : List_Id;
Fixed_Comps : Boolean := True;
Variable_Comps : Boolean := True)
is
Loc : constant Source_Ptr := Sloc (Target);
-- Inherit the C++ tag of the secondary dispatch table of Typ associated
-- with Iface. Tag_Comp is the component of Typ that stores Iface_Tag.
procedure Initialize_Tag
(Typ : Entity_Id;
Iface : Entity_Id;
Tag_Comp : Entity_Id;
Iface_Tag : Node_Id);
-- Initialize the tag of the secondary dispatch table of Typ associated
-- with Iface. Tag_Comp is the component of Typ that stores Iface_Tag.
-- Compiling under the CPP full ABI compatibility mode, if the ancestor
-- of Typ CPP tagged type we generate code to inherit the contents of
-- the dispatch table directly from the ancestor.
--------------------
-- Initialize_Tag --
--------------------
procedure Initialize_Tag
(Typ : Entity_Id;
Iface : Entity_Id;
Tag_Comp : Entity_Id;
Iface_Tag : Node_Id)
is
Comp_Typ : Entity_Id;
Offset_To_Top_Comp : Entity_Id := Empty;
begin
-- Initialize pointer to secondary DT associated with the interface
if not Is_Ancestor (Iface, Typ, Use_Full_View => True) then
Append_To (Init_Tags_List,
Make_Assignment_Statement (Loc,
Name =>
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Target),
Selector_Name => New_Occurrence_Of (Tag_Comp, Loc)),
Expression =>
New_Occurrence_Of (Iface_Tag, Loc)));
end if;
Comp_Typ := Scope (Tag_Comp);
-- Initialize the entries of the table of interfaces. We generate a
-- different call when the parent of the type has variable size
-- components.
if Comp_Typ /= Etype (Comp_Typ)
and then Is_Variable_Size_Record (Etype (Comp_Typ))
and then Chars (Tag_Comp) /= Name_uTag
then
pragma Assert (Present (DT_Offset_To_Top_Func (Tag_Comp)));
-- Issue error if Set_Dynamic_Offset_To_Top is not available in a
-- configurable run-time environment.
if not RTE_Available (RE_Set_Dynamic_Offset_To_Top) then
Error_Msg_CRT
("variable size record with interface types", Typ);
return;
end if;
-- Generate:
-- Set_Dynamic_Offset_To_Top
-- (This => Init,
-- Prim_T => Typ'Tag,
-- Interface_T => Iface'Tag,
-- Offset_Value => n,
-- Offset_Func => Fn'Address)
Append_To (Stmts_List,
Make_Procedure_Call_Statement (Loc,
Name =>
New_Occurrence_Of (RTE (RE_Set_Dynamic_Offset_To_Top), Loc),
Parameter_Associations => New_List (
Make_Attribute_Reference (Loc,
Prefix => New_Copy_Tree (Target),
Attribute_Name => Name_Address),
Unchecked_Convert_To (RTE (RE_Tag),
New_Occurrence_Of
(Node (First_Elmt (Access_Disp_Table (Typ))), Loc)),
Unchecked_Convert_To (RTE (RE_Tag),
New_Occurrence_Of
(Node (First_Elmt (Access_Disp_Table (Iface))),
Loc)),
Unchecked_Convert_To
(RTE (RE_Storage_Offset),
Make_Op_Minus (Loc,
Make_Attribute_Reference (Loc,
Prefix =>
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Target),
Selector_Name =>
New_Occurrence_Of (Tag_Comp, Loc)),
Attribute_Name => Name_Position))),
Unchecked_Convert_To (RTE (RE_Offset_To_Top_Function_Ptr),
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of
(DT_Offset_To_Top_Func (Tag_Comp), Loc),
Attribute_Name => Name_Address)))));
-- In this case the next component stores the value of the offset
-- to the top.
Offset_To_Top_Comp := Next_Entity (Tag_Comp);
pragma Assert (Present (Offset_To_Top_Comp));
Append_To (Init_Tags_List,
Make_Assignment_Statement (Loc,
Name =>
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Target),
Selector_Name =>
New_Occurrence_Of (Offset_To_Top_Comp, Loc)),
Expression =>
Make_Op_Minus (Loc,
Make_Attribute_Reference (Loc,
Prefix =>
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Target),
Selector_Name => New_Occurrence_Of (Tag_Comp, Loc)),
Attribute_Name => Name_Position))));
-- Normal case: No discriminants in the parent type
else
-- Don't need to set any value if the offset-to-top field is
-- statically set or if this interface shares the primary
-- dispatch table.
if not Building_Static_Secondary_DT (Typ)
and then not Is_Ancestor (Iface, Typ, Use_Full_View => True)
then
Append_To (Stmts_List,
Build_Set_Static_Offset_To_Top (Loc,
Iface_Tag => New_Occurrence_Of (Iface_Tag, Loc),
Offset_Value =>
Unchecked_Convert_To (RTE (RE_Storage_Offset),
Make_Op_Minus (Loc,
Make_Attribute_Reference (Loc,
Prefix =>
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Target),
Selector_Name =>
New_Occurrence_Of (Tag_Comp, Loc)),
Attribute_Name => Name_Position)))));
end if;
-- Generate:
-- Register_Interface_Offset
-- (Prim_T => Typ'Tag,
-- Interface_T => Iface'Tag,
-- Is_Constant => True,
-- Offset_Value => n,
-- Offset_Func => null);
if not Building_Static_Secondary_DT (Typ)
and then RTE_Available (RE_Register_Interface_Offset)
then
Append_To (Stmts_List,
Make_Procedure_Call_Statement (Loc,
Name =>
New_Occurrence_Of
(RTE (RE_Register_Interface_Offset), Loc),
Parameter_Associations => New_List (
Unchecked_Convert_To (RTE (RE_Tag),
New_Occurrence_Of
(Node (First_Elmt (Access_Disp_Table (Typ))), Loc)),
Unchecked_Convert_To (RTE (RE_Tag),
New_Occurrence_Of
(Node (First_Elmt (Access_Disp_Table (Iface))), Loc)),
New_Occurrence_Of (Standard_True, Loc),
Unchecked_Convert_To (RTE (RE_Storage_Offset),
Make_Op_Minus (Loc,
Make_Attribute_Reference (Loc,
Prefix =>
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Target),
Selector_Name =>
New_Occurrence_Of (Tag_Comp, Loc)),
Attribute_Name => Name_Position))),
Make_Null (Loc))));
end if;
end if;
end Initialize_Tag;
-- Local variables
Full_Typ : Entity_Id;
Ifaces_List : Elist_Id;
Ifaces_Comp_List : Elist_Id;
Ifaces_Tag_List : Elist_Id;
Iface_Elmt : Elmt_Id;
Iface_Comp_Elmt : Elmt_Id;
Iface_Tag_Elmt : Elmt_Id;
Tag_Comp : Node_Id;
In_Variable_Pos : Boolean;
-- Start of processing for Init_Secondary_Tags
begin
-- Handle private types
if Present (Full_View (Typ)) then
Full_Typ := Full_View (Typ);
else
Full_Typ := Typ;
end if;
Collect_Interfaces_Info
(Full_Typ, Ifaces_List, Ifaces_Comp_List, Ifaces_Tag_List);
Iface_Elmt := First_Elmt (Ifaces_List);
Iface_Comp_Elmt := First_Elmt (Ifaces_Comp_List);
Iface_Tag_Elmt := First_Elmt (Ifaces_Tag_List);
while Present (Iface_Elmt) loop
Tag_Comp := Node (Iface_Comp_Elmt);
-- Check if parent of record type has variable size components
In_Variable_Pos := Scope (Tag_Comp) /= Etype (Scope (Tag_Comp))
and then Is_Variable_Size_Record (Etype (Scope (Tag_Comp)));
-- If we are compiling under the CPP full ABI compatibility mode and
-- the ancestor is a CPP_Pragma tagged type then we generate code to
-- initialize the secondary tag components from tags that reference
-- secondary tables filled with copy of parent slots.
if Is_CPP_Class (Root_Type (Full_Typ)) then
-- Reject interface components located at variable offset in
-- C++ derivations. This is currently unsupported.
if not Fixed_Comps and then In_Variable_Pos then
-- Locate the first dynamic component of the record. Done to
-- improve the text of the warning.
declare
Comp : Entity_Id;
Comp_Typ : Entity_Id;
begin
Comp := First_Entity (Typ);
while Present (Comp) loop
Comp_Typ := Etype (Comp);
if Ekind (Comp) /= E_Discriminant
and then not Is_Tag (Comp)
then
exit when
(Is_Record_Type (Comp_Typ)
and then
Is_Variable_Size_Record (Base_Type (Comp_Typ)))
or else
(Is_Array_Type (Comp_Typ)
and then Is_Variable_Size_Array (Comp_Typ));
end if;
Next_Entity (Comp);
end loop;
pragma Assert (Present (Comp));
-- Move this check to sem???
Error_Msg_Node_2 := Comp;
Error_Msg_NE
("parent type & with dynamic component & cannot be parent"
& " of 'C'P'P derivation if new interfaces are present",
Typ, Scope (Original_Record_Component (Comp)));
Error_Msg_Sloc :=
Sloc (Scope (Original_Record_Component (Comp)));
Error_Msg_NE
("type derived from 'C'P'P type & defined #",
Typ, Scope (Original_Record_Component (Comp)));
-- Avoid duplicated warnings
exit;
end;
-- Initialize secondary tags
else
Initialize_Tag
(Typ => Full_Typ,
Iface => Node (Iface_Elmt),
Tag_Comp => Tag_Comp,
Iface_Tag => Node (Iface_Tag_Elmt));
end if;
-- Otherwise generate code to initialize the tag
else
if (In_Variable_Pos and then Variable_Comps)
or else (not In_Variable_Pos and then Fixed_Comps)
then
Initialize_Tag
(Typ => Full_Typ,
Iface => Node (Iface_Elmt),
Tag_Comp => Tag_Comp,
Iface_Tag => Node (Iface_Tag_Elmt));
end if;
end if;
Next_Elmt (Iface_Elmt);
Next_Elmt (Iface_Comp_Elmt);
Next_Elmt (Iface_Tag_Elmt);
end loop;
end Init_Secondary_Tags;
----------------------------
-- Is_Null_Statement_List --
----------------------------
function Is_Null_Statement_List (Stmts : List_Id) return Boolean is
Stmt : Node_Id;
begin
-- We must skip SCIL nodes because they may have been added to the list
-- by Insert_Actions.
Stmt := First_Non_SCIL_Node (Stmts);
while Present (Stmt) loop
if Nkind (Stmt) = N_Case_Statement then
declare
Alt : Node_Id;
begin
Alt := First (Alternatives (Stmt));
while Present (Alt) loop
if not Is_Null_Statement_List (Statements (Alt)) then
return False;
end if;
Next (Alt);
end loop;
end;
elsif Nkind (Stmt) /= N_Null_Statement then
return False;
end if;
Stmt := Next_Non_SCIL_Node (Stmt);
end loop;
return True;
end Is_Null_Statement_List;
------------------------------
-- Is_User_Defined_Equality --
------------------------------
function Is_User_Defined_Equality (Prim : Node_Id) return Boolean is
begin
return Chars (Prim) = Name_Op_Eq
and then Etype (First_Formal (Prim)) =
Etype (Next_Formal (First_Formal (Prim)))
and then Base_Type (Etype (Prim)) = Standard_Boolean;
end Is_User_Defined_Equality;
----------------------------------------
-- Make_Controlling_Function_Wrappers --
----------------------------------------
procedure Make_Controlling_Function_Wrappers
(Tag_Typ : Entity_Id;
Decl_List : out List_Id;
Body_List : out List_Id)
is
Loc : constant Source_Ptr := Sloc (Tag_Typ);
Prim_Elmt : Elmt_Id;
Subp : Entity_Id;
Actual_List : List_Id;
Formal_List : List_Id;
Formal : Entity_Id;
Par_Formal : Entity_Id;
Formal_Node : Node_Id;
Func_Body : Node_Id;
Func_Decl : Node_Id;
Func_Spec : Node_Id;
Return_Stmt : Node_Id;
begin
Decl_List := New_List;
Body_List := New_List;
Prim_Elmt := First_Elmt (Primitive_Operations (Tag_Typ));
while Present (Prim_Elmt) loop
Subp := Node (Prim_Elmt);
-- If a primitive function with a controlling result of the type has
-- not been overridden by the user, then we must create a wrapper
-- function here that effectively overrides it and invokes the
-- (non-abstract) parent function. This can only occur for a null
-- extension. Note that functions with anonymous controlling access
-- results don't qualify and must be overridden. We also exclude
-- Input attributes, since each type will have its own version of
-- Input constructed by the expander. The test for Comes_From_Source
-- is needed to distinguish inherited operations from renamings
-- (which also have Alias set). We exclude internal entities with
-- Interface_Alias to avoid generating duplicated wrappers since
-- the primitive which covers the interface is also available in
-- the list of primitive operations.
-- The function may be abstract, or require_Overriding may be set
-- for it, because tests for null extensions may already have reset
-- the Is_Abstract_Subprogram_Flag. If Requires_Overriding is not
-- set, functions that need wrappers are recognized by having an
-- alias that returns the parent type.
if Comes_From_Source (Subp)
or else No (Alias (Subp))
or else Present (Interface_Alias (Subp))
or else Ekind (Subp) /= E_Function
or else not Has_Controlling_Result (Subp)
or else Is_Access_Type (Etype (Subp))
or else Is_Abstract_Subprogram (Alias (Subp))
or else Is_TSS (Subp, TSS_Stream_Input)
then
goto Next_Prim;
elsif Is_Abstract_Subprogram (Subp)
or else Requires_Overriding (Subp)
or else
(Is_Null_Extension (Etype (Subp))
and then Etype (Alias (Subp)) /= Etype (Subp))
then
-- If there is a non-overloadable homonym in the current
-- scope, the implicit declaration remains invisible.
-- We check the current entity with the same name, or its
-- homonym in case the derivation takes place after the
-- hiding object declaration.
if Present (Current_Entity (Subp)) then
declare
Curr : constant Entity_Id := Current_Entity (Subp);
Prev : constant Entity_Id := Homonym (Curr);
begin
if (Comes_From_Source (Curr)
and then Scope (Curr) = Current_Scope
and then not Is_Overloadable (Curr))
or else
(Present (Prev)
and then Comes_From_Source (Prev)
and then Scope (Prev) = Current_Scope
and then not Is_Overloadable (Prev))
then
goto Next_Prim;
end if;
end;
end if;
Formal_List := No_List;
Formal := First_Formal (Subp);
if Present (Formal) then
Formal_List := New_List;
while Present (Formal) loop
Append
(Make_Parameter_Specification
(Loc,
Defining_Identifier =>
Make_Defining_Identifier (Sloc (Formal),
Chars => Chars (Formal)),
In_Present => In_Present (Parent (Formal)),
Out_Present => Out_Present (Parent (Formal)),
Null_Exclusion_Present =>
Null_Exclusion_Present (Parent (Formal)),
Parameter_Type =>
New_Occurrence_Of (Etype (Formal), Loc),
Expression =>
New_Copy_Tree (Expression (Parent (Formal)))),
Formal_List);
Next_Formal (Formal);
end loop;
end if;
Func_Spec :=
Make_Function_Specification (Loc,
Defining_Unit_Name =>
Make_Defining_Identifier (Loc,
Chars => Chars (Subp)),
Parameter_Specifications => Formal_List,
Result_Definition =>
New_Occurrence_Of (Etype (Subp), Loc));
Func_Decl := Make_Subprogram_Declaration (Loc, Func_Spec);
Append_To (Decl_List, Func_Decl);
-- Build a wrapper body that calls the parent function. The body
-- contains a single return statement that returns an extension
-- aggregate whose ancestor part is a call to the parent function,
-- passing the formals as actuals (with any controlling arguments
-- converted to the types of the corresponding formals of the
-- parent function, which might be anonymous access types), and
-- having a null extension.
Formal := First_Formal (Subp);
Par_Formal := First_Formal (Alias (Subp));
Formal_Node := First (Formal_List);
if Present (Formal) then
Actual_List := New_List;
else
Actual_List := No_List;
end if;
while Present (Formal) loop
if Is_Controlling_Formal (Formal) then
Append_To (Actual_List,
Make_Type_Conversion (Loc,
Subtype_Mark =>
New_Occurrence_Of (Etype (Par_Formal), Loc),
Expression =>
New_Occurrence_Of
(Defining_Identifier (Formal_Node), Loc)));
else
Append_To
(Actual_List,
New_Occurrence_Of
(Defining_Identifier (Formal_Node), Loc));
end if;
Next_Formal (Formal);
Next_Formal (Par_Formal);
Next (Formal_Node);
end loop;
Return_Stmt :=
Make_Simple_Return_Statement (Loc,
Expression =>
Make_Extension_Aggregate (Loc,
Ancestor_Part =>
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (Alias (Subp), Loc),
Parameter_Associations => Actual_List),
Null_Record_Present => True));
Func_Body :=
Make_Subprogram_Body (Loc,
Specification => New_Copy_Tree (Func_Spec),
Declarations => Empty_List,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List (Return_Stmt)));
Set_Defining_Unit_Name
(Specification (Func_Body),
Make_Defining_Identifier (Loc, Chars (Subp)));
Append_To (Body_List, Func_Body);
-- Replace the inherited function with the wrapper function in the
-- primitive operations list. We add the minimum decoration needed
-- to override interface primitives.
Set_Ekind (Defining_Unit_Name (Func_Spec), E_Function);
Override_Dispatching_Operation
(Tag_Typ, Subp, New_Op => Defining_Unit_Name (Func_Spec),
Is_Wrapper => True);
end if;
<<Next_Prim>>
Next_Elmt (Prim_Elmt);
end loop;
end Make_Controlling_Function_Wrappers;
------------------
-- Make_Eq_Body --
------------------
function Make_Eq_Body
(Typ : Entity_Id;
Eq_Name : Name_Id) return Node_Id
is
Loc : constant Source_Ptr := Sloc (Parent (Typ));
Decl : Node_Id;
Def : constant Node_Id := Parent (Typ);
Stmts : constant List_Id := New_List;
Variant_Case : Boolean := Has_Discriminants (Typ);
Comps : Node_Id := Empty;
Typ_Def : Node_Id := Type_Definition (Def);
begin
Decl :=
Predef_Spec_Or_Body (Loc,
Tag_Typ => Typ,
Name => Eq_Name,
Profile => New_List (
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_X),
Parameter_Type => New_Occurrence_Of (Typ, Loc)),
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_Y),
Parameter_Type => New_Occurrence_Of (Typ, Loc))),
Ret_Type => Standard_Boolean,
For_Body => True);
if Variant_Case then
if Nkind (Typ_Def) = N_Derived_Type_Definition then
Typ_Def := Record_Extension_Part (Typ_Def);
end if;
if Present (Typ_Def) then
Comps := Component_List (Typ_Def);
end if;
Variant_Case :=
Present (Comps) and then Present (Variant_Part (Comps));
end if;
if Variant_Case then
Append_To (Stmts,
Make_Eq_If (Typ, Discriminant_Specifications (Def)));
Append_List_To (Stmts, Make_Eq_Case (Typ, Comps));
Append_To (Stmts,
Make_Simple_Return_Statement (Loc,
Expression => New_Occurrence_Of (Standard_True, Loc)));
else
Append_To (Stmts,
Make_Simple_Return_Statement (Loc,
Expression =>
Expand_Record_Equality
(Typ,
Typ => Typ,
Lhs => Make_Identifier (Loc, Name_X),
Rhs => Make_Identifier (Loc, Name_Y),
Bodies => Declarations (Decl))));
end if;
Set_Handled_Statement_Sequence
(Decl, Make_Handled_Sequence_Of_Statements (Loc, Stmts));
return Decl;
end Make_Eq_Body;
------------------
-- Make_Eq_Case --
------------------
-- <Make_Eq_If shared components>
-- case X.D1 is
-- when V1 => <Make_Eq_Case> on subcomponents
-- ...
-- when Vn => <Make_Eq_Case> on subcomponents
-- end case;
function Make_Eq_Case
(E : Entity_Id;
CL : Node_Id;
Discrs : Elist_Id := New_Elmt_List) return List_Id
is
Loc : constant Source_Ptr := Sloc (E);
Result : constant List_Id := New_List;
Variant : Node_Id;
Alt_List : List_Id;
function Corresponding_Formal (C : Node_Id) return Entity_Id;
-- Given the discriminant that controls a given variant of an unchecked
-- union, find the formal of the equality function that carries the
-- inferred value of the discriminant.
function External_Name (E : Entity_Id) return Name_Id;
-- The value of a given discriminant is conveyed in the corresponding
-- formal parameter of the equality routine. The name of this formal
-- parameter carries a one-character suffix which is removed here.
--------------------------
-- Corresponding_Formal --
--------------------------
function Corresponding_Formal (C : Node_Id) return Entity_Id is
Discr : constant Entity_Id := Entity (Name (Variant_Part (C)));
Elm : Elmt_Id;
begin
Elm := First_Elmt (Discrs);
while Present (Elm) loop
if Chars (Discr) = External_Name (Node (Elm)) then
return Node (Elm);
end if;
Next_Elmt (Elm);
end loop;
-- A formal of the proper name must be found
raise Program_Error;
end Corresponding_Formal;
-------------------
-- External_Name --
-------------------
function External_Name (E : Entity_Id) return Name_Id is
begin
Get_Name_String (Chars (E));
Name_Len := Name_Len - 1;
return Name_Find;
end External_Name;
-- Start of processing for Make_Eq_Case
begin
Append_To (Result, Make_Eq_If (E, Component_Items (CL)));
if No (Variant_Part (CL)) then
return Result;
end if;
Variant := First_Non_Pragma (Variants (Variant_Part (CL)));
if No (Variant) then
return Result;
end if;
Alt_List := New_List;
while Present (Variant) loop
Append_To (Alt_List,
Make_Case_Statement_Alternative (Loc,
Discrete_Choices => New_Copy_List (Discrete_Choices (Variant)),
Statements =>
Make_Eq_Case (E, Component_List (Variant), Discrs)));
Next_Non_Pragma (Variant);
end loop;
-- If we have an Unchecked_Union, use one of the parameters of the
-- enclosing equality routine that captures the discriminant, to use
-- as the expression in the generated case statement.
if Is_Unchecked_Union (E) then
Append_To (Result,
Make_Case_Statement (Loc,
Expression =>
New_Occurrence_Of (Corresponding_Formal (CL), Loc),
Alternatives => Alt_List));
else
Append_To (Result,
Make_Case_Statement (Loc,
Expression =>
Make_Selected_Component (Loc,
Prefix => Make_Identifier (Loc, Name_X),
Selector_Name => New_Copy (Name (Variant_Part (CL)))),
Alternatives => Alt_List));
end if;
return Result;
end Make_Eq_Case;
----------------
-- Make_Eq_If --
----------------
-- Generates:
-- if
-- X.C1 /= Y.C1
-- or else
-- X.C2 /= Y.C2
-- ...
-- then
-- return False;
-- end if;
-- or a null statement if the list L is empty
-- Equality may be user-defined for a given component type, in which case
-- a function call is constructed instead of an operator node. This is an
-- Ada 2012 change in the composability of equality for untagged composite
-- types.
function Make_Eq_If
(E : Entity_Id;
L : List_Id) return Node_Id
is
Loc : constant Source_Ptr := Sloc (E);
C : Node_Id;
Cond : Node_Id;
Field_Name : Name_Id;
Next_Test : Node_Id;
Typ : Entity_Id;
begin
if No (L) then
return Make_Null_Statement (Loc);
else
Cond := Empty;
C := First_Non_Pragma (L);
while Present (C) loop
Typ := Etype (Defining_Identifier (C));
Field_Name := Chars (Defining_Identifier (C));
-- The tags must not be compared: they are not part of the value.
-- Ditto for parent interfaces because their equality operator is
-- abstract.
-- Note also that in the following, we use Make_Identifier for
-- the component names. Use of New_Occurrence_Of to identify the
-- components would be incorrect because the wrong entities for
-- discriminants could be picked up in the private type case.
if Field_Name = Name_uParent
and then Is_Interface (Typ)
then
null;
elsif Field_Name /= Name_uTag then
declare
Lhs : constant Node_Id :=
Make_Selected_Component (Loc,
Prefix => Make_Identifier (Loc, Name_X),
Selector_Name => Make_Identifier (Loc, Field_Name));
Rhs : constant Node_Id :=
Make_Selected_Component (Loc,
Prefix => Make_Identifier (Loc, Name_Y),
Selector_Name => Make_Identifier (Loc, Field_Name));
Eq_Call : Node_Id;
begin
-- Build equality code with a user-defined operator, if
-- available, and with the predefined "=" otherwise. For
-- compatibility with older Ada versions, we also use the
-- predefined operation if the component-type equality is
-- abstract, rather than raising Program_Error.
if Ada_Version < Ada_2012 then
Next_Test := Make_Op_Ne (Loc, Lhs, Rhs);
else
Eq_Call := Build_Eq_Call (Typ, Loc, Lhs, Rhs);
if No (Eq_Call) then
Next_Test := Make_Op_Ne (Loc, Lhs, Rhs);
-- If a component has a defined abstract equality, its
-- application raises Program_Error on that component
-- and therefore on the current variant.
elsif Nkind (Eq_Call) = N_Raise_Program_Error then
Set_Etype (Eq_Call, Standard_Boolean);
Next_Test := Make_Op_Not (Loc, Eq_Call);
else
Next_Test := Make_Op_Not (Loc, Eq_Call);
end if;
end if;
end;
Evolve_Or_Else (Cond, Next_Test);
end if;
Next_Non_Pragma (C);
end loop;
if No (Cond) then
return Make_Null_Statement (Loc);
else
return
Make_Implicit_If_Statement (E,
Condition => Cond,
Then_Statements => New_List (
Make_Simple_Return_Statement (Loc,
Expression => New_Occurrence_Of (Standard_False, Loc))));
end if;
end if;
end Make_Eq_If;
-------------------
-- Make_Neq_Body --
-------------------
function Make_Neq_Body (Tag_Typ : Entity_Id) return Node_Id is
function Is_Predefined_Neq_Renaming (Prim : Node_Id) return Boolean;
-- Returns true if Prim is a renaming of an unresolved predefined
-- inequality operation.
--------------------------------
-- Is_Predefined_Neq_Renaming --
--------------------------------
function Is_Predefined_Neq_Renaming (Prim : Node_Id) return Boolean is
begin
return Chars (Prim) /= Name_Op_Ne
and then Present (Alias (Prim))
and then Comes_From_Source (Prim)
and then Is_Intrinsic_Subprogram (Alias (Prim))
and then Chars (Alias (Prim)) = Name_Op_Ne;
end Is_Predefined_Neq_Renaming;
-- Local variables
Loc : constant Source_Ptr := Sloc (Parent (Tag_Typ));
Stmts : constant List_Id := New_List;
Decl : Node_Id;
Eq_Prim : Entity_Id;
Left_Op : Entity_Id;
Renaming_Prim : Entity_Id;
Right_Op : Entity_Id;
Target : Entity_Id;
-- Start of processing for Make_Neq_Body
begin
-- For a call on a renaming of a dispatching subprogram that is
-- overridden, if the overriding occurred before the renaming, then
-- the body executed is that of the overriding declaration, even if the
-- overriding declaration is not visible at the place of the renaming;
-- otherwise, the inherited or predefined subprogram is called, see
-- (RM 8.5.4(8))
-- Stage 1: Search for a renaming of the inequality primitive and also
-- search for an overriding of the equality primitive located before the
-- renaming declaration.
declare
Elmt : Elmt_Id;
Prim : Node_Id;
begin
Eq_Prim := Empty;
Renaming_Prim := Empty;
Elmt := First_Elmt (Primitive_Operations (Tag_Typ));
while Present (Elmt) loop
Prim := Node (Elmt);
if Is_User_Defined_Equality (Prim) and then No (Alias (Prim)) then
if No (Renaming_Prim) then
pragma Assert (No (Eq_Prim));
Eq_Prim := Prim;
end if;
elsif Is_Predefined_Neq_Renaming (Prim) then
Renaming_Prim := Prim;
end if;
Next_Elmt (Elmt);
end loop;
end;
-- No further action needed if no renaming was found
if No (Renaming_Prim) then
return Empty;
end if;
-- Stage 2: Replace the renaming declaration by a subprogram declaration
-- (required to add its body)
Decl := Parent (Parent (Renaming_Prim));
Rewrite (Decl,
Make_Subprogram_Declaration (Loc,
Specification => Specification (Decl)));
Set_Analyzed (Decl);
-- Remove the decoration of intrinsic renaming subprogram
Set_Is_Intrinsic_Subprogram (Renaming_Prim, False);
Set_Convention (Renaming_Prim, Convention_Ada);
Set_Alias (Renaming_Prim, Empty);
Set_Has_Completion (Renaming_Prim, False);
-- Stage 3: Build the corresponding body
Left_Op := First_Formal (Renaming_Prim);
Right_Op := Next_Formal (Left_Op);
Decl :=
Predef_Spec_Or_Body (Loc,
Tag_Typ => Tag_Typ,
Name => Chars (Renaming_Prim),
Profile => New_List (
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Chars (Left_Op)),
Parameter_Type => New_Occurrence_Of (Tag_Typ, Loc)),
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Chars (Right_Op)),
Parameter_Type => New_Occurrence_Of (Tag_Typ, Loc))),
Ret_Type => Standard_Boolean,
For_Body => True);
-- If the overriding of the equality primitive occurred before the
-- renaming, then generate:
-- function <Neq_Name> (X : Y : Typ) return Boolean is
-- begin
-- return not Oeq (X, Y);
-- end;
if Present (Eq_Prim) then
Target := Eq_Prim;
-- Otherwise build a nested subprogram which performs the predefined
-- evaluation of the equality operator. That is, generate:
-- function <Neq_Name> (X : Y : Typ) return Boolean is
-- function Oeq (X : Y) return Boolean is
-- begin
-- <<body of default implementation>>
-- end;
-- begin
-- return not Oeq (X, Y);
-- end;
else
declare
Local_Subp : Node_Id;
begin
Local_Subp := Make_Eq_Body (Tag_Typ, Name_Op_Eq);
Set_Declarations (Decl, New_List (Local_Subp));
Target := Defining_Entity (Local_Subp);
end;
end if;
Append_To (Stmts,
Make_Simple_Return_Statement (Loc,
Expression =>
Make_Op_Not (Loc,
Make_Function_Call (Loc,
Name => New_Occurrence_Of (Target, Loc),
Parameter_Associations => New_List (
Make_Identifier (Loc, Chars (Left_Op)),
Make_Identifier (Loc, Chars (Right_Op)))))));
Set_Handled_Statement_Sequence
(Decl, Make_Handled_Sequence_Of_Statements (Loc, Stmts));
return Decl;
end Make_Neq_Body;
-------------------------------
-- Make_Null_Procedure_Specs --
-------------------------------
function Make_Null_Procedure_Specs (Tag_Typ : Entity_Id) return List_Id is
Decl_List : constant List_Id := New_List;
Loc : constant Source_Ptr := Sloc (Tag_Typ);
Formal : Entity_Id;
Formal_List : List_Id;
New_Param_Spec : Node_Id;
Parent_Subp : Entity_Id;
Prim_Elmt : Elmt_Id;
Subp : Entity_Id;
begin
Prim_Elmt := First_Elmt (Primitive_Operations (Tag_Typ));
while Present (Prim_Elmt) loop
Subp := Node (Prim_Elmt);
-- If a null procedure inherited from an interface has not been
-- overridden, then we build a null procedure declaration to
-- override the inherited procedure.
Parent_Subp := Alias (Subp);
if Present (Parent_Subp)
and then Is_Null_Interface_Primitive (Parent_Subp)
then
Formal_List := No_List;
Formal := First_Formal (Subp);
if Present (Formal) then
Formal_List := New_List;
while Present (Formal) loop
-- Copy the parameter spec including default expressions
New_Param_Spec :=
New_Copy_Tree (Parent (Formal), New_Sloc => Loc);
-- Generate a new defining identifier for the new formal.
-- required because New_Copy_Tree does not duplicate
-- semantic fields (except itypes).
Set_Defining_Identifier (New_Param_Spec,
Make_Defining_Identifier (Sloc (Formal),
Chars => Chars (Formal)));
-- For controlling arguments we must change their
-- parameter type to reference the tagged type (instead
-- of the interface type)
if Is_Controlling_Formal (Formal) then
if Nkind (Parameter_Type (Parent (Formal))) = N_Identifier
then
Set_Parameter_Type (New_Param_Spec,
New_Occurrence_Of (Tag_Typ, Loc));
else pragma Assert
(Nkind (Parameter_Type (Parent (Formal))) =
N_Access_Definition);
Set_Subtype_Mark (Parameter_Type (New_Param_Spec),
New_Occurrence_Of (Tag_Typ, Loc));
end if;
end if;
Append (New_Param_Spec, Formal_List);
Next_Formal (Formal);
end loop;
end if;
Append_To (Decl_List,
Make_Subprogram_Declaration (Loc,
Make_Procedure_Specification (Loc,
Defining_Unit_Name =>
Make_Defining_Identifier (Loc, Chars (Subp)),
Parameter_Specifications => Formal_List,
Null_Present => True)));
end if;
Next_Elmt (Prim_Elmt);
end loop;
return Decl_List;
end Make_Null_Procedure_Specs;
-------------------------------------
-- Make_Predefined_Primitive_Specs --
-------------------------------------
procedure Make_Predefined_Primitive_Specs
(Tag_Typ : Entity_Id;
Predef_List : out List_Id;
Renamed_Eq : out Entity_Id)
is
function Is_Predefined_Eq_Renaming (Prim : Node_Id) return Boolean;
-- Returns true if Prim is a renaming of an unresolved predefined
-- equality operation.
-------------------------------
-- Is_Predefined_Eq_Renaming --
-------------------------------
function Is_Predefined_Eq_Renaming (Prim : Node_Id) return Boolean is
begin
return Chars (Prim) /= Name_Op_Eq
and then Present (Alias (Prim))
and then Comes_From_Source (Prim)
and then Is_Intrinsic_Subprogram (Alias (Prim))
and then Chars (Alias (Prim)) = Name_Op_Eq;
end Is_Predefined_Eq_Renaming;
-- Local variables
Loc : constant Source_Ptr := Sloc (Tag_Typ);
Res : constant List_Id := New_List;
Eq_Name : Name_Id := Name_Op_Eq;
Eq_Needed : Boolean;
Eq_Spec : Node_Id;
Prim : Elmt_Id;
Has_Predef_Eq_Renaming : Boolean := False;
-- Set to True if Tag_Typ has a primitive that renames the predefined
-- equality operator. Used to implement (RM 8-5-4(8)).
use Exp_Put_Image;
-- Start of processing for Make_Predefined_Primitive_Specs
begin
Renamed_Eq := Empty;
-- Spec of _Size
Append_To (Res, Predef_Spec_Or_Body (Loc,
Tag_Typ => Tag_Typ,
Name => Name_uSize,
Profile => New_List (
Make_Parameter_Specification (Loc,
Defining_Identifier => Make_Defining_Identifier (Loc, Name_X),
Parameter_Type => New_Occurrence_Of (Tag_Typ, Loc))),
Ret_Type => Standard_Long_Long_Integer));
-- Spec of Put_Image
if Enable_Put_Image (Tag_Typ)
and then No (TSS (Tag_Typ, TSS_Put_Image))
then
Append_To (Res, Predef_Spec_Or_Body (Loc,
Tag_Typ => Tag_Typ,
Name => Make_TSS_Name (Tag_Typ, TSS_Put_Image),
Profile => Build_Put_Image_Profile (Loc, Tag_Typ)));
end if;
-- Specs for dispatching stream attributes
declare
Stream_Op_TSS_Names :
constant array (Positive range <>) of TSS_Name_Type :=
(TSS_Stream_Read,
TSS_Stream_Write,
TSS_Stream_Input,
TSS_Stream_Output);
begin
for Op in Stream_Op_TSS_Names'Range loop
if Stream_Operation_OK (Tag_Typ, Stream_Op_TSS_Names (Op)) then
Append_To (Res,
Predef_Stream_Attr_Spec (Loc, Tag_Typ,
Stream_Op_TSS_Names (Op)));
end if;
end loop;
end;
-- Spec of "=" is expanded if the type is not limited and if a user
-- defined "=" was not already declared for the non-full view of a
-- private extension
if not Is_Limited_Type (Tag_Typ) then
Eq_Needed := True;
Prim := First_Elmt (Primitive_Operations (Tag_Typ));
while Present (Prim) loop
-- If a primitive is encountered that renames the predefined
-- equality operator before reaching any explicit equality
-- primitive, then we still need to create a predefined equality
-- function, because calls to it can occur via the renaming. A
-- new name is created for the equality to avoid conflicting with
-- any user-defined equality. (Note that this doesn't account for
-- renamings of equality nested within subpackages???)
if Is_Predefined_Eq_Renaming (Node (Prim)) then
Has_Predef_Eq_Renaming := True;
Eq_Name := New_External_Name (Chars (Node (Prim)), 'E');
-- User-defined equality
elsif Is_User_Defined_Equality (Node (Prim)) then
if No (Alias (Node (Prim)))
or else Nkind (Unit_Declaration_Node (Node (Prim))) =
N_Subprogram_Renaming_Declaration
then
Eq_Needed := False;
exit;
-- If the parent is not an interface type and has an abstract
-- equality function explicitly defined in the sources, then
-- the inherited equality is abstract as well, and no body can
-- be created for it.
elsif not Is_Interface (Etype (Tag_Typ))
and then Present (Alias (Node (Prim)))
and then Comes_From_Source (Alias (Node (Prim)))
and then Is_Abstract_Subprogram (Alias (Node (Prim)))
then
Eq_Needed := False;
exit;
-- If the type has an equality function corresponding with
-- a primitive defined in an interface type, the inherited
-- equality is abstract as well, and no body can be created
-- for it.
elsif Present (Alias (Node (Prim)))
and then Comes_From_Source (Ultimate_Alias (Node (Prim)))
and then
Is_Interface
(Find_Dispatching_Type (Ultimate_Alias (Node (Prim))))
then
Eq_Needed := False;
exit;
end if;
end if;
Next_Elmt (Prim);
end loop;
-- If a renaming of predefined equality was found but there was no
-- user-defined equality (so Eq_Needed is still true), then set the
-- name back to Name_Op_Eq. But in the case where a user-defined
-- equality was located after such a renaming, then the predefined
-- equality function is still needed, so Eq_Needed must be set back
-- to True.
if Eq_Name /= Name_Op_Eq then
if Eq_Needed then
Eq_Name := Name_Op_Eq;
else
Eq_Needed := True;
end if;
end if;
if Eq_Needed then
Eq_Spec := Predef_Spec_Or_Body (Loc,
Tag_Typ => Tag_Typ,
Name => Eq_Name,
Profile => New_List (
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_X),
Parameter_Type => New_Occurrence_Of (Tag_Typ, Loc)),
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_Y),
Parameter_Type => New_Occurrence_Of (Tag_Typ, Loc))),
Ret_Type => Standard_Boolean);
Append_To (Res, Eq_Spec);
if Has_Predef_Eq_Renaming then
Renamed_Eq := Defining_Unit_Name (Specification (Eq_Spec));
Prim := First_Elmt (Primitive_Operations (Tag_Typ));
while Present (Prim) loop
-- Any renamings of equality that appeared before an
-- overriding equality must be updated to refer to the
-- entity for the predefined equality, otherwise calls via
-- the renaming would get incorrectly resolved to call the
-- user-defined equality function.
if Is_Predefined_Eq_Renaming (Node (Prim)) then
Set_Alias (Node (Prim), Renamed_Eq);
-- Exit upon encountering a user-defined equality
elsif Chars (Node (Prim)) = Name_Op_Eq
and then No (Alias (Node (Prim)))
then
exit;
end if;
Next_Elmt (Prim);
end loop;
end if;
end if;
-- Spec for dispatching assignment
Append_To (Res, Predef_Spec_Or_Body (Loc,
Tag_Typ => Tag_Typ,
Name => Name_uAssign,
Profile => New_List (
Make_Parameter_Specification (Loc,
Defining_Identifier => Make_Defining_Identifier (Loc, Name_X),
Out_Present => True,
Parameter_Type => New_Occurrence_Of (Tag_Typ, Loc)),
Make_Parameter_Specification (Loc,
Defining_Identifier => Make_Defining_Identifier (Loc, Name_Y),
Parameter_Type => New_Occurrence_Of (Tag_Typ, Loc)))));
end if;
-- Ada 2005: Generate declarations for the following primitive
-- operations for limited interfaces and synchronized types that
-- implement a limited interface.
-- Disp_Asynchronous_Select
-- Disp_Conditional_Select
-- Disp_Get_Prim_Op_Kind
-- Disp_Get_Task_Id
-- Disp_Requeue
-- Disp_Timed_Select
-- Disable the generation of these bodies if No_Dispatching_Calls,
-- Ravenscar or ZFP is active.
if Ada_Version >= Ada_2005
and then not Restriction_Active (No_Dispatching_Calls)
and then not Restriction_Active (No_Select_Statements)
and then RTE_Available (RE_Select_Specific_Data)
then
-- These primitives are defined abstract in interface types
if Is_Interface (Tag_Typ)
and then Is_Limited_Record (Tag_Typ)
then
Append_To (Res,
Make_Abstract_Subprogram_Declaration (Loc,
Specification =>
Make_Disp_Asynchronous_Select_Spec (Tag_Typ)));
Append_To (Res,
Make_Abstract_Subprogram_Declaration (Loc,
Specification =>
Make_Disp_Conditional_Select_Spec (Tag_Typ)));
Append_To (Res,
Make_Abstract_Subprogram_Declaration (Loc,
Specification =>
Make_Disp_Get_Prim_Op_Kind_Spec (Tag_Typ)));
Append_To (Res,
Make_Abstract_Subprogram_Declaration (Loc,
Specification =>
Make_Disp_Get_Task_Id_Spec (Tag_Typ)));
Append_To (Res,
Make_Abstract_Subprogram_Declaration (Loc,
Specification =>
Make_Disp_Requeue_Spec (Tag_Typ)));
Append_To (Res,
Make_Abstract_Subprogram_Declaration (Loc,
Specification =>
Make_Disp_Timed_Select_Spec (Tag_Typ)));
-- If ancestor is an interface type, declare non-abstract primitives
-- to override the abstract primitives of the interface type.
-- In VM targets we define these primitives in all root tagged types
-- that are not interface types. Done because in VM targets we don't
-- have secondary dispatch tables and any derivation of Tag_Typ may
-- cover limited interfaces (which always have these primitives since
-- they may be ancestors of synchronized interface types).
elsif (not Is_Interface (Tag_Typ)
and then Is_Interface (Etype (Tag_Typ))
and then Is_Limited_Record (Etype (Tag_Typ)))
or else
(Is_Concurrent_Record_Type (Tag_Typ)
and then Has_Interfaces (Tag_Typ))
or else
(not Tagged_Type_Expansion
and then not Is_Interface (Tag_Typ)
and then Tag_Typ = Root_Type (Tag_Typ))
then
Append_To (Res,
Make_Subprogram_Declaration (Loc,
Specification =>
Make_Disp_Asynchronous_Select_Spec (Tag_Typ)));
Append_To (Res,
Make_Subprogram_Declaration (Loc,
Specification =>
Make_Disp_Conditional_Select_Spec (Tag_Typ)));
Append_To (Res,
Make_Subprogram_Declaration (Loc,
Specification =>
Make_Disp_Get_Prim_Op_Kind_Spec (Tag_Typ)));
Append_To (Res,
Make_Subprogram_Declaration (Loc,
Specification =>
Make_Disp_Get_Task_Id_Spec (Tag_Typ)));
Append_To (Res,
Make_Subprogram_Declaration (Loc,
Specification =>
Make_Disp_Requeue_Spec (Tag_Typ)));
Append_To (Res,
Make_Subprogram_Declaration (Loc,
Specification =>
Make_Disp_Timed_Select_Spec (Tag_Typ)));
end if;
end if;
-- All tagged types receive their own Deep_Adjust and Deep_Finalize
-- regardless of whether they are controlled or may contain controlled
-- components.
-- Do not generate the routines if finalization is disabled
if Restriction_Active (No_Finalization) then
null;
else
if not Is_Limited_Type (Tag_Typ) then
Append_To (Res, Predef_Deep_Spec (Loc, Tag_Typ, TSS_Deep_Adjust));
end if;
Append_To (Res, Predef_Deep_Spec (Loc, Tag_Typ, TSS_Deep_Finalize));
end if;
Predef_List := Res;
end Make_Predefined_Primitive_Specs;
-------------------------
-- Make_Tag_Assignment --
-------------------------
function Make_Tag_Assignment (N : Node_Id) return Node_Id is
Loc : constant Source_Ptr := Sloc (N);
Def_If : constant Entity_Id := Defining_Identifier (N);
Expr : constant Node_Id := Expression (N);
Typ : constant Entity_Id := Etype (Def_If);
Full_Typ : constant Entity_Id := Underlying_Type (Typ);
New_Ref : Node_Id;
begin
-- This expansion activity is called during analysis.
if Is_Tagged_Type (Typ)
and then not Is_Class_Wide_Type (Typ)
and then not Is_CPP_Class (Typ)
and then Tagged_Type_Expansion
and then Nkind (Expr) /= N_Aggregate
and then (Nkind (Expr) /= N_Qualified_Expression
or else Nkind (Expression (Expr)) /= N_Aggregate)
then
New_Ref :=
Make_Selected_Component (Loc,
Prefix => New_Occurrence_Of (Def_If, Loc),
Selector_Name =>
New_Occurrence_Of (First_Tag_Component (Full_Typ), Loc));
Set_Assignment_OK (New_Ref);
return
Make_Assignment_Statement (Loc,
Name => New_Ref,
Expression =>
Unchecked_Convert_To (RTE (RE_Tag),
New_Occurrence_Of (Node
(First_Elmt (Access_Disp_Table (Full_Typ))), Loc)));
else
return Empty;
end if;
end Make_Tag_Assignment;
----------------------
-- Predef_Deep_Spec --
----------------------
function Predef_Deep_Spec
(Loc : Source_Ptr;
Tag_Typ : Entity_Id;
Name : TSS_Name_Type;
For_Body : Boolean := False) return Node_Id
is
Formals : List_Id;
begin
-- V : in out Tag_Typ
Formals := New_List (
Make_Parameter_Specification (Loc,
Defining_Identifier => Make_Defining_Identifier (Loc, Name_V),
In_Present => True,
Out_Present => True,
Parameter_Type => New_Occurrence_Of (Tag_Typ, Loc)));
-- F : Boolean := True
if Name = TSS_Deep_Adjust
or else Name = TSS_Deep_Finalize
then
Append_To (Formals,
Make_Parameter_Specification (Loc,
Defining_Identifier => Make_Defining_Identifier (Loc, Name_F),
Parameter_Type => New_Occurrence_Of (Standard_Boolean, Loc),
Expression => New_Occurrence_Of (Standard_True, Loc)));
end if;
return
Predef_Spec_Or_Body (Loc,
Name => Make_TSS_Name (Tag_Typ, Name),
Tag_Typ => Tag_Typ,
Profile => Formals,
For_Body => For_Body);
exception
when RE_Not_Available =>
return Empty;
end Predef_Deep_Spec;
-------------------------
-- Predef_Spec_Or_Body --
-------------------------
function Predef_Spec_Or_Body
(Loc : Source_Ptr;
Tag_Typ : Entity_Id;
Name : Name_Id;
Profile : List_Id;
Ret_Type : Entity_Id := Empty;
For_Body : Boolean := False) return Node_Id
is
Id : constant Entity_Id := Make_Defining_Identifier (Loc, Name);
Spec : Node_Id;
begin
Set_Is_Public (Id, Is_Public (Tag_Typ));
-- The internal flag is set to mark these declarations because they have
-- specific properties. First, they are primitives even if they are not
-- defined in the type scope (the freezing point is not necessarily in
-- the same scope). Second, the predefined equality can be overridden by
-- a user-defined equality, no body will be generated in this case.
Set_Is_Internal (Id);
if not Debug_Generated_Code then
Set_Debug_Info_Off (Id);
end if;
if No (Ret_Type) then
Spec :=
Make_Procedure_Specification (Loc,
Defining_Unit_Name => Id,
Parameter_Specifications => Profile);
else
Spec :=
Make_Function_Specification (Loc,
Defining_Unit_Name => Id,
Parameter_Specifications => Profile,
Result_Definition => New_Occurrence_Of (Ret_Type, Loc));
end if;
-- Declare an abstract subprogram for primitive subprograms of an
-- interface type (except for "=").
if Is_Interface (Tag_Typ) then
if Name /= Name_Op_Eq then
return Make_Abstract_Subprogram_Declaration (Loc, Spec);
-- The equality function (if any) for an interface type is defined
-- to be nonabstract, so we create an expression function for it that
-- always returns False. Note that the function can never actually be
-- invoked because interface types are abstract, so there aren't any
-- objects of such types (and their equality operation will always
-- dispatch).
else
return Make_Expression_Function
(Loc, Spec, New_Occurrence_Of (Standard_False, Loc));
end if;
-- If body case, return empty subprogram body. Note that this is ill-
-- formed, because there is not even a null statement, and certainly not
-- a return in the function case. The caller is expected to do surgery
-- on the body to add the appropriate stuff.
elsif For_Body then
return Make_Subprogram_Body (Loc, Spec, Empty_List, Empty);
-- For the case of an Input attribute predefined for an abstract type,
-- generate an abstract specification. This will never be called, but we
-- need the slot allocated in the dispatching table so that attributes
-- typ'Class'Input and typ'Class'Output will work properly.
elsif Is_TSS (Name, TSS_Stream_Input)
and then Is_Abstract_Type (Tag_Typ)
then
return Make_Abstract_Subprogram_Declaration (Loc, Spec);
-- Normal spec case, where we return a subprogram declaration
else
return Make_Subprogram_Declaration (Loc, Spec);
end if;
end Predef_Spec_Or_Body;
-----------------------------
-- Predef_Stream_Attr_Spec --
-----------------------------
function Predef_Stream_Attr_Spec
(Loc : Source_Ptr;
Tag_Typ : Entity_Id;
Name : TSS_Name_Type;
For_Body : Boolean := False) return Node_Id
is
Ret_Type : Entity_Id;
begin
if Name = TSS_Stream_Input then
Ret_Type := Tag_Typ;
else
Ret_Type := Empty;
end if;
return
Predef_Spec_Or_Body
(Loc,
Name => Make_TSS_Name (Tag_Typ, Name),
Tag_Typ => Tag_Typ,
Profile => Build_Stream_Attr_Profile (Loc, Tag_Typ, Name),
Ret_Type => Ret_Type,
For_Body => For_Body);
end Predef_Stream_Attr_Spec;
---------------------------------
-- Predefined_Primitive_Bodies --
---------------------------------
function Predefined_Primitive_Bodies
(Tag_Typ : Entity_Id;
Renamed_Eq : Entity_Id) return List_Id
is
Loc : constant Source_Ptr := Sloc (Tag_Typ);
Res : constant List_Id := New_List;
Adj_Call : Node_Id;
Decl : Node_Id;
Fin_Call : Node_Id;
Prim : Elmt_Id;
Eq_Needed : Boolean;
Eq_Name : Name_Id;
Ent : Entity_Id;
pragma Warnings (Off, Ent);
use Exp_Put_Image;
begin
pragma Assert (not Is_Interface (Tag_Typ));
-- See if we have a predefined "=" operator
if Present (Renamed_Eq) then
Eq_Needed := True;
Eq_Name := Chars (Renamed_Eq);
-- If the parent is an interface type then it has defined all the
-- predefined primitives abstract and we need to check if the type
-- has some user defined "=" function which matches the profile of
-- the Ada predefined equality operator to avoid generating it.
elsif Is_Interface (Etype (Tag_Typ)) then
Eq_Needed := True;
Eq_Name := Name_Op_Eq;
Prim := First_Elmt (Primitive_Operations (Tag_Typ));
while Present (Prim) loop
if Chars (Node (Prim)) = Name_Op_Eq
and then not Is_Internal (Node (Prim))
and then Present (First_Entity (Node (Prim)))
-- The predefined equality primitive must have exactly two
-- formals whose type is this tagged type
and then Present (Last_Entity (Node (Prim)))
and then Next_Entity (First_Entity (Node (Prim)))
= Last_Entity (Node (Prim))
and then Etype (First_Entity (Node (Prim))) = Tag_Typ
and then Etype (Last_Entity (Node (Prim))) = Tag_Typ
then
Eq_Needed := False;
Eq_Name := No_Name;
exit;
end if;
Next_Elmt (Prim);
end loop;
else
Eq_Needed := False;
Eq_Name := No_Name;
Prim := First_Elmt (Primitive_Operations (Tag_Typ));
while Present (Prim) loop
if Chars (Node (Prim)) = Name_Op_Eq
and then Is_Internal (Node (Prim))
then
Eq_Needed := True;
Eq_Name := Name_Op_Eq;
exit;
end if;
Next_Elmt (Prim);
end loop;
end if;
-- Body of _Size
Decl := Predef_Spec_Or_Body (Loc,
Tag_Typ => Tag_Typ,
Name => Name_uSize,
Profile => New_List (
Make_Parameter_Specification (Loc,
Defining_Identifier => Make_Defining_Identifier (Loc, Name_X),
Parameter_Type => New_Occurrence_Of (Tag_Typ, Loc))),
Ret_Type => Standard_Long_Long_Integer,
For_Body => True);
Set_Handled_Statement_Sequence (Decl,
Make_Handled_Sequence_Of_Statements (Loc, New_List (
Make_Simple_Return_Statement (Loc,
Expression =>
Make_Attribute_Reference (Loc,
Prefix => Make_Identifier (Loc, Name_X),
Attribute_Name => Name_Size)))));
Append_To (Res, Decl);
-- Body of Put_Image
if Enable_Put_Image (Tag_Typ)
and then No (TSS (Tag_Typ, TSS_Put_Image))
then
Build_Record_Put_Image_Procedure (Loc, Tag_Typ, Decl, Ent);
Append_To (Res, Decl);
end if;
-- Bodies for Dispatching stream IO routines. We need these only for
-- non-limited types (in the limited case there is no dispatching).
-- We also skip them if dispatching or finalization are not available
-- or if stream operations are prohibited by restriction No_Streams or
-- from use of pragma/aspect No_Tagged_Streams.
if Stream_Operation_OK (Tag_Typ, TSS_Stream_Read)
and then No (TSS (Tag_Typ, TSS_Stream_Read))
then
Build_Record_Read_Procedure (Loc, Tag_Typ, Decl, Ent);
Append_To (Res, Decl);
end if;
if Stream_Operation_OK (Tag_Typ, TSS_Stream_Write)
and then No (TSS (Tag_Typ, TSS_Stream_Write))
then
Build_Record_Write_Procedure (Loc, Tag_Typ, Decl, Ent);
Append_To (Res, Decl);
end if;
-- Skip body of _Input for the abstract case, since the corresponding
-- spec is abstract (see Predef_Spec_Or_Body).
if not Is_Abstract_Type (Tag_Typ)
and then Stream_Operation_OK (Tag_Typ, TSS_Stream_Input)
and then No (TSS (Tag_Typ, TSS_Stream_Input))
then
Build_Record_Or_Elementary_Input_Function
(Loc, Tag_Typ, Decl, Ent);
Append_To (Res, Decl);
end if;
if Stream_Operation_OK (Tag_Typ, TSS_Stream_Output)
and then No (TSS (Tag_Typ, TSS_Stream_Output))
then
Build_Record_Or_Elementary_Output_Procedure (Loc, Tag_Typ, Decl, Ent);
Append_To (Res, Decl);
end if;
-- Ada 2005: Generate bodies for the following primitive operations for
-- limited interfaces and synchronized types that implement a limited
-- interface.
-- disp_asynchronous_select
-- disp_conditional_select
-- disp_get_prim_op_kind
-- disp_get_task_id
-- disp_timed_select
-- The interface versions will have null bodies
-- Disable the generation of these bodies if No_Dispatching_Calls,
-- Ravenscar or ZFP is active.
-- In VM targets we define these primitives in all root tagged types
-- that are not interface types. Done because in VM targets we don't
-- have secondary dispatch tables and any derivation of Tag_Typ may
-- cover limited interfaces (which always have these primitives since
-- they may be ancestors of synchronized interface types).
if Ada_Version >= Ada_2005
and then not Is_Interface (Tag_Typ)
and then
((Is_Interface (Etype (Tag_Typ))
and then Is_Limited_Record (Etype (Tag_Typ)))
or else
(Is_Concurrent_Record_Type (Tag_Typ)
and then Has_Interfaces (Tag_Typ))
or else
(not Tagged_Type_Expansion
and then Tag_Typ = Root_Type (Tag_Typ)))
and then not Restriction_Active (No_Dispatching_Calls)
and then not Restriction_Active (No_Select_Statements)
and then RTE_Available (RE_Select_Specific_Data)
then
Append_To (Res, Make_Disp_Asynchronous_Select_Body (Tag_Typ));
Append_To (Res, Make_Disp_Conditional_Select_Body (Tag_Typ));
Append_To (Res, Make_Disp_Get_Prim_Op_Kind_Body (Tag_Typ));
Append_To (Res, Make_Disp_Get_Task_Id_Body (Tag_Typ));
Append_To (Res, Make_Disp_Requeue_Body (Tag_Typ));
Append_To (Res, Make_Disp_Timed_Select_Body (Tag_Typ));
end if;
if not Is_Limited_Type (Tag_Typ) and then not Is_Interface (Tag_Typ) then
-- Body for equality
if Eq_Needed then
Decl := Make_Eq_Body (Tag_Typ, Eq_Name);
Append_To (Res, Decl);
end if;
-- Body for inequality (if required)
Decl := Make_Neq_Body (Tag_Typ);
if Present (Decl) then
Append_To (Res, Decl);
end if;
-- Body for dispatching assignment
Decl :=
Predef_Spec_Or_Body (Loc,
Tag_Typ => Tag_Typ,
Name => Name_uAssign,
Profile => New_List (
Make_Parameter_Specification (Loc,
Defining_Identifier => Make_Defining_Identifier (Loc, Name_X),
Out_Present => True,
Parameter_Type => New_Occurrence_Of (Tag_Typ, Loc)),
Make_Parameter_Specification (Loc,
Defining_Identifier => Make_Defining_Identifier (Loc, Name_Y),
Parameter_Type => New_Occurrence_Of (Tag_Typ, Loc))),
For_Body => True);
Set_Handled_Statement_Sequence (Decl,
Make_Handled_Sequence_Of_Statements (Loc, New_List (
Make_Assignment_Statement (Loc,
Name => Make_Identifier (Loc, Name_X),
Expression => Make_Identifier (Loc, Name_Y)))));
Append_To (Res, Decl);
end if;
-- Generate empty bodies of routines Deep_Adjust and Deep_Finalize for
-- tagged types which do not contain controlled components.
-- Do not generate the routines if finalization is disabled
if Restriction_Active (No_Finalization) then
null;
elsif not Has_Controlled_Component (Tag_Typ) then
if not Is_Limited_Type (Tag_Typ) then
Adj_Call := Empty;
Decl := Predef_Deep_Spec (Loc, Tag_Typ, TSS_Deep_Adjust, True);
if Is_Controlled (Tag_Typ) then
Adj_Call :=
Make_Adjust_Call (
Obj_Ref => Make_Identifier (Loc, Name_V),
Typ => Tag_Typ);
end if;
if No (Adj_Call) then
Adj_Call := Make_Null_Statement (Loc);
end if;
Set_Handled_Statement_Sequence (Decl,
Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List (Adj_Call)));
Append_To (Res, Decl);
end if;
Fin_Call := Empty;
Decl := Predef_Deep_Spec (Loc, Tag_Typ, TSS_Deep_Finalize, True);
if Is_Controlled (Tag_Typ) then
Fin_Call :=
Make_Final_Call
(Obj_Ref => Make_Identifier (Loc, Name_V),
Typ => Tag_Typ);
end if;
if No (Fin_Call) then
Fin_Call := Make_Null_Statement (Loc);
end if;
Set_Handled_Statement_Sequence (Decl,
Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List (Fin_Call)));
Append_To (Res, Decl);
end if;
return Res;
end Predefined_Primitive_Bodies;
---------------------------------
-- Predefined_Primitive_Freeze --
---------------------------------
function Predefined_Primitive_Freeze
(Tag_Typ : Entity_Id) return List_Id
is
Res : constant List_Id := New_List;
Prim : Elmt_Id;
Frnodes : List_Id;
begin
Prim := First_Elmt (Primitive_Operations (Tag_Typ));
while Present (Prim) loop
if Is_Predefined_Dispatching_Operation (Node (Prim)) then
Frnodes := Freeze_Entity (Node (Prim), Tag_Typ);
if Present (Frnodes) then
Append_List_To (Res, Frnodes);
end if;
end if;
Next_Elmt (Prim);
end loop;
return Res;
end Predefined_Primitive_Freeze;
-------------------------
-- Stream_Operation_OK --
-------------------------
function Stream_Operation_OK
(Typ : Entity_Id;
Operation : TSS_Name_Type) return Boolean
is
Has_Predefined_Or_Specified_Stream_Attribute : Boolean := False;
begin
-- Special case of a limited type extension: a default implementation
-- of the stream attributes Read or Write exists if that attribute
-- has been specified or is available for an ancestor type; a default
-- implementation of the attribute Output (resp. Input) exists if the
-- attribute has been specified or Write (resp. Read) is available for
-- an ancestor type. The last condition only applies under Ada 2005.
if Is_Limited_Type (Typ) and then Is_Tagged_Type (Typ) then
if Operation = TSS_Stream_Read then
Has_Predefined_Or_Specified_Stream_Attribute :=
Has_Specified_Stream_Read (Typ);
elsif Operation = TSS_Stream_Write then
Has_Predefined_Or_Specified_Stream_Attribute :=
Has_Specified_Stream_Write (Typ);
elsif Operation = TSS_Stream_Input then
Has_Predefined_Or_Specified_Stream_Attribute :=
Has_Specified_Stream_Input (Typ)
or else
(Ada_Version >= Ada_2005
and then Stream_Operation_OK (Typ, TSS_Stream_Read));
elsif Operation = TSS_Stream_Output then
Has_Predefined_Or_Specified_Stream_Attribute :=
Has_Specified_Stream_Output (Typ)
or else
(Ada_Version >= Ada_2005
and then Stream_Operation_OK (Typ, TSS_Stream_Write));
end if;
-- Case of inherited TSS_Stream_Read or TSS_Stream_Write
if not Has_Predefined_Or_Specified_Stream_Attribute
and then Is_Derived_Type (Typ)
and then (Operation = TSS_Stream_Read
or else Operation = TSS_Stream_Write)
then
Has_Predefined_Or_Specified_Stream_Attribute :=
Present
(Find_Inherited_TSS (Base_Type (Etype (Typ)), Operation));
end if;
end if;
-- If the type is not limited, or else is limited but the attribute is
-- explicitly specified or is predefined for the type, then return True,
-- unless other conditions prevail, such as restrictions prohibiting
-- streams or dispatching operations. We also return True for limited
-- interfaces, because they may be extended by nonlimited types and
-- permit inheritance in this case (addresses cases where an abstract
-- extension doesn't get 'Input declared, as per comments below, but
-- 'Class'Input must still be allowed). Note that attempts to apply
-- stream attributes to a limited interface or its class-wide type
-- (or limited extensions thereof) will still get properly rejected
-- by Check_Stream_Attribute.
-- We exclude the Input operation from being a predefined subprogram in
-- the case where the associated type is an abstract extension, because
-- the attribute is not callable in that case, per 13.13.2(49/2). Also,
-- we don't want an abstract version created because types derived from
-- the abstract type may not even have Input available (for example if
-- derived from a private view of the abstract type that doesn't have
-- a visible Input).
-- Do not generate stream routines for type Finalization_Master because
-- a master may never appear in types and therefore cannot be read or
-- written.
return
(not Is_Limited_Type (Typ)
or else Is_Interface (Typ)
or else Has_Predefined_Or_Specified_Stream_Attribute)
and then
(Operation /= TSS_Stream_Input
or else not Is_Abstract_Type (Typ)
or else not Is_Derived_Type (Typ))
and then not Has_Unknown_Discriminants (Typ)
and then not
(Is_Interface (Typ)
and then
(Is_Task_Interface (Typ)
or else Is_Protected_Interface (Typ)
or else Is_Synchronized_Interface (Typ)))
and then not Restriction_Active (No_Streams)
and then not Restriction_Active (No_Dispatch)
and then No (No_Tagged_Streams_Pragma (Typ))
and then not No_Run_Time_Mode
and then RTE_Available (RE_Tag)
and then No (Type_Without_Stream_Operation (Typ))
and then RTE_Available (RE_Root_Stream_Type)
and then not Is_RTE (Typ, RE_Finalization_Master);
end Stream_Operation_OK;
end Exp_Ch3;
| 37.53747 | 79 | 0.557049 |
dce23634b9ecddddf72342f8b521e54146238060 | 124 | adb | Ada | tests/nonsmoke/functional/CompileTests/experimental_ada_tests/dot_asis_tests/test_units/goto_loop.adb | passlab/rexompiler | 5494df3766ab606e230c5f1785b438a019c9e353 | [
"BSD-3-Clause"
] | null | null | null | tests/nonsmoke/functional/CompileTests/experimental_ada_tests/dot_asis_tests/test_units/goto_loop.adb | passlab/rexompiler | 5494df3766ab606e230c5f1785b438a019c9e353 | [
"BSD-3-Clause"
] | 65 | 2020-10-16T17:58:15.000Z | 2022-03-23T17:59:44.000Z | tests/nonsmoke/functional/CompileTests/experimental_ada_tests/dot_asis_tests/test_units/goto_loop.adb | passlab/rexompiler | 5494df3766ab606e230c5f1785b438a019c9e353 | [
"BSD-3-Clause"
] | null | null | null | with Ada.Text_IO;
procedure Goto_Loop is
begin
<<Start>>
Ada.Text_IO.Put_Line ("Goto Loop!");
goto Start;
end Goto_Loop;
| 15.5 | 39 | 0.733871 |
d03e7c99b4844f6be814c9ac71e8c31cb2ff78cb | 264 | ads | Ada | examples/arinc653-threads/sample-ada/cpu/part1/main.ads | sduverger/pok | fd45369eebe4b25242b49ff44030bea891237dbf | [
"BSD-2-Clause"
] | 2 | 2021-01-08T16:46:27.000Z | 2021-12-03T06:40:37.000Z | examples/arinc653-threads/sample-ada/cpu/part1/main.ads | sduverger/pok | fd45369eebe4b25242b49ff44030bea891237dbf | [
"BSD-2-Clause"
] | null | null | null | examples/arinc653-threads/sample-ada/cpu/part1/main.ads | sduverger/pok | fd45369eebe4b25242b49ff44030bea891237dbf | [
"BSD-2-Clause"
] | 1 | 2019-11-29T06:05:19.000Z | 2019-11-29T06:05:19.000Z | pragma No_Run_Time;
with Interfaces.C;
with APEX;
use APEX;
with APEX.Processes;
use APEX.Processes;
with APEX.Partitions;
use APEX.Partitions;
with Activity;
package Main is
procedure Compute;
procedure Main;
pragma Export (C, Main, "main");
end Main;
| 15.529412 | 35 | 0.746212 |
4a183a3b68f81e89ec9c84069b4be488ba1eebc9 | 18,969 | adb | Ada | boards/MicroBit/src/microbit-display.adb | WickedShell/Ada_Drivers_Library | 391866ad37a599347df40a4dbb3bf0721bedabea | [
"BSD-3-Clause"
] | 6 | 2017-05-28T04:37:11.000Z | 2020-11-22T11:26:19.000Z | boards/MicroBit/src/microbit-display.adb | WickedShell/Ada_Drivers_Library | 391866ad37a599347df40a4dbb3bf0721bedabea | [
"BSD-3-Clause"
] | 2 | 2019-08-30T10:57:40.000Z | 2020-02-11T21:34:14.000Z | boards/MicroBit/src/microbit-display.adb | WickedShell/Ada_Drivers_Library | 391866ad37a599347df40a4dbb3bf0721bedabea | [
"BSD-3-Clause"
] | 2 | 2017-02-07T19:42:02.000Z | 2020-11-22T11:26:20.000Z | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2016-2017, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with HAL; use HAL;
with nRF51.GPIO; use nRF51.GPIO;
with nRF51.Device; use nRF51.Device;
with MicroBit.Time; use MicroBit.Time;
with System.Machine_Code; use System.Machine_Code;
package body MicroBit.Display is
type Animation_Mode is (None, Scroll_Text);
Animation_Step_Duration_Ms : Natural := 200;
-- How many milliseconds between two animation steps
Animation_Elapsed : Natural := 0;
-- How many milliseconds since the last animation step
Animation_State : Animation_Mode := None;
-- Current animation
subtype Width is Natural range
Coord'First .. Coord'First + Coord'Range_Length * 2;
Bitmap : array (Width, Coord) of Boolean := (others => (others => False));
-- The bitmap width is 2 time the display size so we can instert hidden
-- characters to the right of the screen and scroll them in with the
-- Shift_Left procedure.
Current_X, Current_Y : Coord := 0;
-- Current coordinate in LED matrix scan
----------------------
-- Pixel to IO Pins --
----------------------
subtype Row_Range is Natural range 1 .. 3;
subtype Column_Range is Natural range 1 .. 9;
type LED_Point is record
Row_Id : Row_Range;
Column_Id : Column_Range;
end record;
Row_Points : array (Row_Range) of GPIO_Point :=
(P13, P14, P15);
Column_Points : array (Column_Range) of GPIO_Point :=
(P04, P05, P06, P07, P08, P09, P10, P11, P12);
Map : constant array (Coord, Coord) of LED_Point :=
(((1, 1), (3, 4), (2, 2), (1, 8), (3, 3)),
((2, 4), (3, 5), (1, 9), (1, 7), (2, 7)),
((1, 2), (3, 6), (2, 3), (1, 6), (3, 1)),
((2, 5), (3, 7), (3, 9), (1, 5), (2, 6)),
((1, 3), (3, 8), (2, 1), (1, 4), (3, 2))
);
--
--------------------
-- Text scrolling --
--------------------
Scroll_Text_Buffer : String (1 .. Scroll_Text_Max_Length) :=
(others => ASCII.NUL);
-- Buffer to stored the scroll text
Scroll_Text_Length : Natural := 0;
-- Length of the text stored in the Scroll_Text_Buffer
Scroll_Text_Index : Natural := 0;
-- Index of the character to display next
Scroll_Position : Natural := 0;
-- Scroll position in the screen
----------
-- Font --
----------
type Glyph is array (0 .. 4) of UInt5;
Font : constant array (0 .. 93) of Glyph :=
((2#00100#, -- !
2#00100#,
2#00100#,
2#00000#,
2#00100#),
(2#01010#, -- "
2#01010#,
2#00000#,
2#00000#,
2#00000#),
(2#01010#, -- #
2#11111#,
2#01010#,
2#11111#,
2#01010#),
(2#11110#, -- $
2#00101#,
2#01110#,
2#00100#,
2#01111#),
(2#10001#, -- %
2#01000#,
2#00100#,
2#00010#,
2#10001#),
(2#00100#, -- &
2#01010#,
2#00100#,
2#01010#,
2#10100#),
(2#01000#, -- '
2#00100#,
2#00000#,
2#00000#,
2#00000#),
(2#01000#, -- (
2#00100#,
2#00100#,
2#00100#,
2#01000#),
(2#00010#, -- )
2#00100#,
2#00100#,
2#00100#,
2#00010#),
(2#00000#, -- *
2#00100#,
2#01010#,
2#00100#,
2#00000#),
(2#00000#, -- +
2#00100#,
2#01110#,
2#00100#,
2#00000#),
(2#00000#, -- ,
2#00000#,
2#00000#,
2#00100#,
2#00010#),
(2#00000#, -- -
2#00000#,
2#01110#,
2#00000#,
2#00000#),
(2#00000#, -- .
2#00000#,
2#00000#,
2#00000#,
2#00010#),
(2#10000#, -- /
2#01000#,
2#00100#,
2#00010#,
2#00001#),
(2#01110#, -- 0
2#10001#,
2#10001#,
2#10001#,
2#01110#),
(2#00100#, -- 1
2#00110#,
2#00100#,
2#00100#,
2#00100#),
(2#01110#, -- 2
2#10001#,
2#01000#,
2#00100#,
2#11111#),
(2#01111#, -- 3
2#10000#,
2#01111#,
2#10000#,
2#01111#),
(2#01000#, -- 4
2#01010#,
2#01001#,
2#11111#,
2#01000#),
(2#11111#, -- 5
2#00001#,
2#01111#,
2#10000#,
2#01111#),
(2#01110#, -- 6
2#00001#,
2#00111#,
2#01001#,
2#01110#),
(2#01110#, -- 7
2#01000#,
2#00100#,
2#00100#,
2#00100#),
(2#01110#, -- 8
2#10001#,
2#01110#,
2#10001#,
2#01110#),
(2#01110#, -- 9
2#10001#,
2#11110#,
2#10000#,
2#01110#),
(2#00000#, -- :
2#00100#,
2#00000#,
2#00100#,
2#00000#),
(2#00000#, -- ;
2#00100#,
2#00000#,
2#00100#,
2#00010#),
(2#00000#, -- <
2#00100#,
2#00010#,
2#00100#,
2#00000#),
(2#00000#, -- =
2#01110#,
2#00000#,
2#01110#,
2#00000#),
(2#00000#, -- >
2#00100#,
2#01000#,
2#00100#,
2#00000#),
(2#00100#, -- ?
2#01000#,
2#00100#,
2#00000#,
2#00100#),
(2#01110#, -- @
2#10001#,
2#10101#,
2#10001#,
2#00110#),
(2#01110#, -- A
2#10001#,
2#11111#,
2#10001#,
2#10001#),
(2#01111#, -- B
2#10001#,
2#01111#,
2#10001#,
2#01111#),
(2#11110#, -- C
2#00001#,
2#00001#,
2#00001#,
2#11110#),
(2#01111#, -- D
2#10001#,
2#10001#,
2#10001#,
2#01111#),
(2#11111#, -- E
2#00001#,
2#00111#,
2#00001#,
2#11111#),
(2#11111#, -- F
2#00001#,
2#00111#,
2#00001#,
2#00001#),
(2#11110#, -- G
2#00001#,
2#11101#,
2#10001#,
2#01110#),
(2#10001#, -- H
2#10001#,
2#11111#,
2#10001#,
2#10001#),
(2#00100#, -- I
2#00100#,
2#00100#,
2#00100#,
2#00100#),
(2#10000#, -- J
2#10000#,
2#10000#,
2#10001#,
2#01110#),
(2#01001#, -- K
2#00101#,
2#00011#,
2#00101#,
2#01001#),
(2#00001#, -- L
2#00001#,
2#00001#,
2#00001#,
2#11111#),
(2#10001#, -- M
2#11011#,
2#10101#,
2#10001#,
2#10001#),
(2#10001#, -- N
2#10011#,
2#10101#,
2#11001#,
2#10001#),
(2#01110#, -- O
2#10001#,
2#10001#,
2#10001#,
2#01110#),
(2#01111#, -- P
2#10001#,
2#01111#,
2#00001#,
2#00001#),
(2#01110#, -- Q
2#10001#,
2#10001#,
2#11001#,
2#11110#),
(2#01111#, -- R
2#10001#,
2#01111#,
2#01001#,
2#10001#),
(2#11110#, -- S
2#00001#,
2#01110#,
2#10000#,
2#01111#),
(2#11111#, -- T
2#00100#,
2#00100#,
2#00100#,
2#00100#),
(2#10001#, -- U
2#10001#,
2#10001#,
2#10001#,
2#01110#),
(2#10001#, -- V
2#10001#,
2#01010#,
2#01010#,
2#00100#),
(2#10101#, -- W
2#10101#,
2#10101#,
2#01010#,
2#01010#),
(2#10001#, -- X
2#01010#,
2#00100#,
2#01010#,
2#10001#),
(2#10001#, -- Y
2#01010#,
2#00100#,
2#00100#,
2#00100#),
(2#11111#, -- Z
2#01000#,
2#00100#,
2#00010#,
2#11111#),
(2#01110#, -- [
2#00010#,
2#00010#,
2#00010#,
2#01110#),
(2#00001#, -- \
2#00010#,
2#00100#,
2#01000#,
2#10000#),
(2#01110#, -- ]
2#01000#,
2#01000#,
2#01000#,
2#01110#),
(2#00100#, -- ^
2#01010#,
2#10001#,
2#00000#,
2#00000#),
(2#00000#, -- _
2#00000#,
2#00000#,
2#00000#,
2#11111#),
(2#00010#, -- `
2#00100#,
2#00000#,
2#00000#,
2#00000#),
(2#01111#, -- a
2#10000#,
2#11110#,
2#10001#,
2#11110#),
(2#00001#, -- b
2#01111#,
2#10001#,
2#10001#,
2#01111#),
(2#01110#, -- c
2#10001#,
2#00001#,
2#10001#,
2#01110#),
(2#10000#, -- d
2#11110#,
2#10001#,
2#10001#,
2#11110#),
(2#01110#, -- e
2#10001#,
2#11111#,
2#00001#,
2#11110#),
(2#11110#, -- f
2#00001#,
2#00111#,
2#00001#,
2#00001#),
(2#01110#, -- g
2#10001#,
2#11110#,
2#10000#,
2#01111#),
(2#00001#, -- h
2#01111#,
2#10001#,
2#10001#,
2#10001#),
(2#00100#, -- i
2#00000#,
2#00100#,
2#00100#,
2#00100#),
(2#10000#, -- j
2#10000#,
2#10000#,
2#10000#,
2#01111#),
(2#10001#, -- k
2#01001#,
2#00111#,
2#01001#,
2#10001#),
(2#00001#, -- l
2#00001#,
2#00001#,
2#00001#,
2#11110#),
(2#01010#, -- m
2#10101#,
2#10101#,
2#10101#,
2#10101#),
(2#01111#, -- n
2#10001#,
2#10001#,
2#10001#,
2#10001#),
(2#01110#, -- o
2#10001#,
2#10001#,
2#10001#,
2#01110#),
(2#01111#, -- p
2#10001#,
2#10001#,
2#01111#,
2#00001#),
(2#11110#, -- q
2#10001#,
2#10001#,
2#11110#,
2#10000#),
(2#01101#, -- r
2#10011#,
2#00001#,
2#00001#,
2#00001#),
(2#11110#, -- s
2#00001#,
2#01110#,
2#10000#,
2#01111#),
(2#00001#, -- t
2#00111#,
2#00001#,
2#10001#,
2#01110#),
(2#10001#, -- u
2#10001#,
2#10001#,
2#11001#,
2#10110#),
(2#10001#, -- v
2#10001#,
2#01010#,
2#01010#,
2#00100#),
(2#10101#, -- w
2#10101#,
2#10101#,
2#10101#,
2#01010#),
(2#10001#, -- x
2#10001#,
2#01110#,
2#10001#,
2#10001#),
(2#10001#, -- y
2#10001#,
2#11110#,
2#10000#,
2#01111#),
(2#11111#, -- z
2#01000#,
2#00100#,
2#00010#,
2#11111#),
(2#00100#, -- {
2#00100#,
2#00010#,
2#00100#,
2#00100#),
(2#00100#, -- |
2#00100#,
2#00100#,
2#00100#,
2#00100#),
(2#00100#, -- }
2#00100#,
2#01000#,
2#00100#,
2#00100#),
(2#00000#, -- ~
2#00000#,
2#01010#,
2#10101#,
2#00000#)
);
procedure Print_C (X_Org : Width;
C : Character);
procedure Initialize;
procedure Tick_Handler;
procedure Update_Animation;
-------------
-- Print_C --
-------------
procedure Print_C (X_Org : Width;
C : Character)
is
C_Index : constant Integer := Character'Pos (C) - Character'Pos ('!');
begin
if C_Index not in Font'Range then
return;
end if;
for X in Coord loop
for Y in Coord loop
if X_Org + X in Width then
if (Font (C_Index) (Y) and 2**X) /= 0 then
Bitmap (X_Org + X, Y) := True;
end if;
end if;
end loop;
end loop;
end Print_C;
----------------
-- Initialize --
----------------
procedure Initialize is
Conf : GPIO_Configuration;
begin
Conf.Mode := Mode_Out;
Conf.Resistors := Pull_Up;
for Point of Row_Points loop
Point.Configure_IO (Conf);
Point.Clear;
end loop;
for Point of Column_Points loop
Point.Configure_IO (Conf);
Point.Set;
end loop;
if not Tick_Subscribe (Tick_Handler'Access) then
raise Program_Error;
end if;
end Initialize;
------------------
-- Tick_Handler --
------------------
procedure Tick_Handler is
begin
-- Turn Off
-- Row source current
Row_Points (Map (Current_X, Current_Y).Row_Id).Clear;
-- Column sink current
Column_Points (Map (Current_X, Current_Y).Column_Id).Set;
if Current_X = Coord'Last then
Current_X := Coord'First;
if Current_Y = Coord'Last then
Current_Y := Coord'First;
else
Current_Y := Current_Y + 1;
end if;
else
Current_X := Current_X + 1;
end if;
-- Turn on?
if Bitmap (Current_X, Current_Y) then
-- Row source current
Row_Points (Map (Current_X, Current_Y).Row_Id).Set;
-- Column sink current
Column_Points (Map (Current_X, Current_Y).Column_Id).Clear;
end if;
-- Animation
if Animation_Elapsed = Animation_Step_Duration_Ms then
Animation_Elapsed := 0;
Update_Animation;
else
Animation_Elapsed := Animation_Elapsed + 1;
end if;
end Tick_Handler;
----------------------
-- Update_Animation --
----------------------
procedure Update_Animation is
begin
case Animation_State is
when None =>
null;
when Scroll_Text =>
Shift_Left;
Scroll_Position := Scroll_Position + 1;
if Scroll_Position >= Coord'Range_Length + 1 then
-- We finished scrolling the current character
Scroll_Position := 0;
if Scroll_Text_Index > Scroll_Text_Length + 1 then
Animation_State := None;
elsif Scroll_Text_Index = Scroll_Text_Length + 1 then
null; -- Leave the screen empty until the character is flushed
else
-- Print new char
Print_C (5, Scroll_Text_Buffer (Scroll_Text_Index));
end if;
Scroll_Text_Index := Scroll_Text_Index + 1;
end if;
end case;
end Update_Animation;
---------
-- Set --
---------
procedure Set (X, Y : Coord) is
begin
Bitmap (X, Y) := True;
end Set;
-----------
-- Clear --
-----------
procedure Clear (X, Y : Coord) is
begin
Bitmap (X, Y) := False;
end Clear;
-----------
-- Clear --
-----------
procedure Clear is
begin
Bitmap := (others => (others => False));
end Clear;
-------------
-- Display --
-------------
procedure Display (C : Character) is
begin
Print_C (0, C);
end Display;
-------------
-- Display --
-------------
procedure Display (Str : String) is
begin
Display_Async (Str);
while Animation_State /= None loop
Asm (Template => "wfi", -- Wait for interrupt
Volatile => True);
end loop;
end Display;
-------------------
-- Display_Async --
-------------------
procedure Display_Async (Str : String) is
begin
Scroll_Text_Buffer (Scroll_Text_Buffer'First .. Scroll_Text_Buffer'First + Str'Length - 1) := Str;
Animation_State := Scroll_Text;
Scroll_Text_Length := Str'Length;
Scroll_Text_Index := Scroll_Text_Buffer'First;
Scroll_Position := Coord'Last + 1;
end Display_Async;
----------------
-- Shift_Left --
----------------
procedure Shift_Left is
begin
-- Shift pixel columns to the left, erasing the left most one
for X in Bitmap'First (1) .. Bitmap'Last (1) - 1 loop
for Y in Bitmap'Range (2) loop
Bitmap (X, Y) := Bitmap (X + 1, Y);
end loop;
end loop;
-- Insert black pixels to the right most column
for Y in Bitmap'Range (2) loop
Bitmap (Bitmap'Last (1), Y) := False;
end loop;
end Shift_Left;
---------------------------------
-- Set_Animation_Step_Duration --
---------------------------------
procedure Set_Animation_Step_Duration (Ms : Natural) is
begin
Animation_Step_Duration_Ms := Ms;
end Set_Animation_Step_Duration;
---------------------------
-- Animation_In_Progress --
---------------------------
function Animation_In_Progress return Boolean
is (Animation_State /= None);
begin
Initialize;
end MicroBit.Display;
| 23.274847 | 105 | 0.442459 |
cba292cbed8e466ca8b366d7fe8d4b7d8e247d0d | 1,067 | ads | Ada | src/fltk-widgets-valuators-adjusters.ads | micahwelf/FLTK-Ada | 83e0c58ea98e5ede2cbbb158b42eae44196c3ba7 | [
"Unlicense"
] | 1 | 2020-12-18T15:20:13.000Z | 2020-12-18T15:20:13.000Z | src/fltk-widgets-valuators-adjusters.ads | micahwelf/FLTK-Ada | 83e0c58ea98e5ede2cbbb158b42eae44196c3ba7 | [
"Unlicense"
] | null | null | null | src/fltk-widgets-valuators-adjusters.ads | micahwelf/FLTK-Ada | 83e0c58ea98e5ede2cbbb158b42eae44196c3ba7 | [
"Unlicense"
] | null | null | null |
package FLTK.Widgets.Valuators.Adjusters is
type Adjuster is new Valuator with private;
type Adjuster_Reference (Data : not null access Adjuster'Class) is
limited null record with Implicit_Dereference => Data;
package Forge is
function Create
(X, Y, W, H : in Integer;
Text : in String)
return Adjuster;
end Forge;
function Is_Soft
(This : in Adjuster)
return Boolean;
procedure Set_Soft
(This : in out Adjuster;
To : in Boolean);
procedure Draw
(This : in out Adjuster);
function Handle
(This : in out Adjuster;
Event : in Event_Kind)
return Event_Outcome;
private
type Adjuster is new Valuator with null record;
overriding procedure Finalize
(This : in out Adjuster);
pragma Inline (Is_Soft);
pragma Inline (Set_Soft);
pragma Inline (Draw);
pragma Inline (Handle);
end FLTK.Widgets.Valuators.Adjusters;
| 15.925373 | 70 | 0.587629 |
cbde531e4dfb2ecf72e9f9bf6dcd6f25328d3a30 | 4,982 | ads | Ada | source/league/ucd/matreshka-internals-unicode-ucd-core_0102.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_0102.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_0102.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 <vgodunko@gmail.com> --
-- 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_0102 is
pragma Preelaborate;
Group_0102 : aliased constant Core_Second_Stage
:= (16#80# .. 16#9C# => -- 010280 .. 01029C
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#A0# .. 16#D0# => -- 0102A0 .. 0102D0
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#E0# => -- 0102E0
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#E1# .. 16#FB# => -- 0102E1 .. 0102FB
(Other_Number, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
others =>
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)));
end Matreshka.Internals.Unicode.Ucd.Core_0102;
| 53 | 78 | 0.437776 |
cbdd5c460c9071e1d714115be956f79d54f239cf | 1,280 | ads | Ada | src/norx3261.ads | jhumphry/SPARK_NORX | 898c3842b4445db41cd851206e82336100f768b8 | [
"0BSD"
] | 9 | 2016-05-10T17:58:15.000Z | 2020-10-14T08:40:14.000Z | src/norx3261.ads | jhumphry/SPARK_NORX | 898c3842b4445db41cd851206e82336100f768b8 | [
"0BSD"
] | null | null | null | src/norx3261.ads | jhumphry/SPARK_NORX | 898c3842b4445db41cd851206e82336100f768b8 | [
"0BSD"
] | null | null | null | -- NORX3261
-- an Ada implementation of the NORX Authenticated Encryption Algorithm
-- created by Jean-Philippe Aumasson, Philipp Jovanovic and Samuel Neves
-- This instantiation words on 32-bit words, with 6 rounds and a parallelism
-- degree of 1
-- Copyright (c) 2016, James Humphry - see LICENSE file for details
pragma SPARK_Mode (On);
with Interfaces;
with NORX;
with NORX_Load_Store;
pragma Elaborate_All(NORX);
use all type Interfaces.Unsigned_32;
package NORX3261 is new NORX(w => 32,
Word => Interfaces.Unsigned_32,
Storage_Array_To_Word => NORX_Load_Store.Storage_Array_To_Unsigned_32,
Word_To_Storage_Array => NORX_Load_Store.Unsigned_32_To_Storage_Array,
l => 6,
k => 128,
Key_Position => 4,
t => 128,
n => 128,
rot => (8, 11, 16, 31),
r => 384,
c => 128);
| 40 | 99 | 0.45625 |
cb6ab3e5eb5937e5785ca945f0569e8c98b3558d | 3,126 | adb | Ada | Parser_Tools/src/implementation/text-pool.adb | robdaemon/AdaYaml | 2cb52c5e7eee3a2d9951945d5ddb4eeddc088f6e | [
"MIT"
] | 32 | 2017-08-02T16:45:34.000Z | 2021-08-18T20:12:57.000Z | Parser_Tools/src/implementation/text-pool.adb | robdaemon/AdaYaml | 2cb52c5e7eee3a2d9951945d5ddb4eeddc088f6e | [
"MIT"
] | 15 | 2017-09-13T09:43:38.000Z | 2022-01-20T23:21:47.000Z | Parser_Tools/src/implementation/text-pool.adb | robdaemon/AdaYaml | 2cb52c5e7eee3a2d9951945d5ddb4eeddc088f6e | [
"MIT"
] | 5 | 2017-09-19T16:54:22.000Z | 2020-04-09T07:17:02.000Z | -- part of ParserTools, (c) 2017 Felix Krause
-- released under the terms of the MIT license, see the file "copying.txt"
package body Text.Pool is
procedure Create (P : in out Reference'Class;
Initial_Size : Pool_Offset := Default_Size)
is
Initial_Chunk : constant Chunk := new Pool_Array
(Pool_Offset (1) .. Round_To_Header_Size (Initial_Size));
begin
if P.Data /= null then
Finalize (P);
end if;
P.Data := new Pool_Data;
P.Data.Chunks (1) := Initial_Chunk;
P.Data.Pos := 1;
declare
H : Header with Import;
for H'Address use Initial_Chunk.all (1)'Address;
begin
H.Refcount := 0;
H.Last := Pool_Offset (Initial_Chunk'Last) - Header_Size;
end;
end Create;
function With_Capacity (Size : Pool_Offset) return Reference is
begin
return Ret : Reference do
Create (Ret, Size);
end return;
end With_Capacity;
function From_String (P : Reference'Class; Data : String)
return Text.Reference is
New_String_Address : constant System.Address :=
Fitting_Position (Data'Length, P.Data);
Target_Data : constant UTF_8_String_Access :=
To_UTF_8_String_Access (New_String_Address);
Null_Terminator : Character with Import;
for Null_Terminator'Address use New_String_Address + Data'Length;
begin
Null_Terminator := Character'Val (0);
Target_Data.all := UTF_8_String (Data);
return (Ada.Finalization.Controlled with Data => Target_Data);
end From_String;
function With_Length (P : Reference'Class; Length : Positive)
return Text.Reference is
use System.Storage_Elements;
New_String_Address : constant System.Address :=
Fitting_Position (Storage_Offset (Length), P.Data);
Target_Data : constant UTF_8_String_Access :=
To_UTF_8_String_Access (New_String_Address);
Null_Terminator : Character with Import;
for Null_Terminator'Address use New_String_Address + Storage_Offset (Length);
begin
Null_Terminator := Character'Val (0);
return (Ada.Finalization.Controlled with Data => Target_Data);
end With_Length;
procedure Adjust (Object : in out Reference) is
begin
if Object.Data /= null then
Object.Data.Refcount := Object.Data.Refcount + 1;
end if;
end Adjust;
procedure Finalize (Object : in out Reference) is
Reference : Pool_Data_Access := Object.Data;
begin
Object.Data := null;
if Reference /= null then
Reference.Refcount := Reference.Refcount - 1;
if Reference.Refcount = 0 then
-- no reference around; take away Usage + 1 from the current Chunk.
-- this enables the whole pool data to be freed once all Content
-- references vanish.
Decrease_Usage (Reference, Reference.Cur);
end if;
end if;
end Finalize;
function Current_Chunk_As_String (P : Reference) return String is
(As_String (P.Data.Chunks (P.Data.Cur)));
end Text.Pool;
| 36.348837 | 83 | 0.648752 |
4a21747616dfb4e348be6e334258d993a5f18404 | 63,318 | adb | Ada | apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_shifts/sharpen/sharpen/hls_target/.autopilot/db/linebuffer_Loop_1_pr.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_32_shifts/sharpen/sharpen/hls_target/.autopilot/db/linebuffer_Loop_1_pr.adb | dillonhuff/Halide-HLS | e9f4c3ac7915e5a52f211ce65004ae17890515a0 | [
"MIT"
] | null | null | null | apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_shifts/sharpen/sharpen/hls_target/.autopilot/db/linebuffer_Loop_1_pr.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/>
<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/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo class_id="6" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>stream&lt;AxiPackedStencil&lt;unsigned int, 1, 1, 1, 1&gt; &gt;.V.value.V</originalName>
<rtlName/>
<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/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>stream&lt;AxiPackedStencil&lt;unsigned int, 1, 1, 1, 1&gt; &gt;.V.last.V</originalName>
<rtlName/>
<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/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<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/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<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/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<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/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName>exitcond_flatten_fu_74_p2</rtlName>
<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/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName>indvar_flatten_next_fu_80_p2</rtlName>
<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/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<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>..</fileDirectory>
<lineNumber>554</lineNumber>
<contextFuncName>linebuffer&lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&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_32_shifts/sharpen</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&lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&gt;</second>
</first>
<second>554</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<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>..</fileDirectory>
<lineNumber>554</lineNumber>
<contextFuncName>linebuffer&lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&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_32_shifts/sharpen</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer&lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&gt;</second>
</first>
<second>554</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>tmp.value.V</originalName>
<rtlName/>
<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/>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>554</lineNumber>
<contextFuncName>linebuffer&lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&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_32_shifts/sharpen</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer&lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&gt;</second>
</first>
<second>554</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<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/>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>552</lineNumber>
<contextFuncName>linebuffer&lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&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_32_shifts/sharpen</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer&lt;1920, 1080, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned int&gt;</second>
</first>
<second>552</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<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/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<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/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<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/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<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/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<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/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<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/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<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/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<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/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<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"/>
</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"/>
</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"/>
</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"/>
</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="36" tracking_level="1" version="0" object_id="_72">
<dp_component_resource class_id="37" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_component_resource>
<dp_expression_resource>
<count>9</count>
<item_version>0</item_version>
<item class_id="38" tracking_level="0" version="0">
<first>ap_block_pp0_stage0_flag00001001 ( or ) </first>
<second class_id="39" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="40" tracking_level="0" version="0">
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_block_state1 ( or ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_block_state2_pp0_stage0_iter0 ( and ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_block_state3_pp0_stage0_iter1 ( and ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_enable_pp0 ( xor ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>2</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_enable_reg_pp0_iter1 ( xor ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>2</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>exitcond_flatten_fu_74_p2 ( icmp ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>21</second>
</item>
<item>
<first>(1P1)</first>
<second>16</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>13</second>
</item>
</second>
</item>
<item>
<first>indvar_flatten_next_fu_80_p2 ( + ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>21</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>68</second>
</item>
<item>
<first>LUT</first>
<second>26</second>
</item>
</second>
</item>
<item>
<first>start_write ( and ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
</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>8</count>
<item_version>0</item_version>
<item>
<first>ap_NS_fsm</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>4</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>4</second>
</item>
<item>
<first>LUT</first>
<second>21</second>
</item>
</second>
</item>
<item>
<first>ap_done</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>ap_enable_reg_pp0_iter1</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>3</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>3</second>
</item>
<item>
<first>LUT</first>
<second>15</second>
</item>
</second>
</item>
<item>
<first>in_axi_stream_V_last_V_blk_n</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>in_axi_stream_V_value_V_blk_n</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>in_stream_V_value_V_blk_n</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>indvar_flatten_reg_63</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>21</second>
</item>
<item>
<first>(2Count)</first>
<second>42</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>real_start</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
</dp_multiplexer_resource>
<dp_register_resource>
<count>10</count>
<item_version>0</item_version>
<item>
<first>ap_CS_fsm</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>3</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>3</second>
</item>
</second>
</item>
<item>
<first>ap_done_reg</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>ap_enable_reg_pp0_iter0</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>ap_enable_reg_pp0_iter1</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>exitcond_flatten_reg_90</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>indvar_flatten_reg_63</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>21</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>21</second>
</item>
</second>
</item>
<item>
<first>real_start_status_reg</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>start_control_reg</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>start_once_reg</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>tmp_value_V_reg_99</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>32</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>32</second>
</item>
</second>
</item>
</dp_register_resource>
<dp_component_map class_id="41" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_component_map>
<dp_expression_map>
<count>2</count>
<item_version>0</item_version>
<item class_id="42" tracking_level="0" version="0">
<first>exitcond_flatten_fu_74_p2 ( icmp ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>9</item>
</second>
</item>
<item>
<first>indvar_flatten_next_fu_80_p2 ( + ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>10</item>
</second>
</item>
</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="43" tracking_level="0" version="0">
<count>10</count>
<item_version>0</item_version>
<item class_id="44" tracking_level="0" version="0">
<first>6</first>
<second class_id="45" 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="46" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="47" tracking_level="0" version="0">
<first>7</first>
<second class_id="48" 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="49" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="50" tracking_level="1" version="0" object_id="_73">
<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="51" tracking_level="0" version="0">
<count>6</count>
<item_version>0</item_version>
<item class_id="52" 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="54" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="55" 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="56" 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="57" tracking_level="0" version="0">
<count>3</count>
<item_version>0</item_version>
<item class_id="58" 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="59" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="60" 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>
| 30.26673 | 133 | 0.449619 |
185ca1ac09bdff5e5919844484f83ba378c6c100 | 25,524 | ads | Ada | bb-runtimes/arm/nordic/nrf51/svd/i-nrf51-uart.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/arm/nordic/nrf51/svd/i-nrf51-uart.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/arm/nordic/nrf51/svd/i-nrf51-uart.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | --
-- Copyright (C) 2018, AdaCore
--
-- Copyright (c) 2013, 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:
--
-- * 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 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.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
--
-- This spec has been automatically generated from nrf51.svd
pragma Ada_2012;
pragma Style_Checks (Off);
with System;
package Interfaces.NRF51.UART is
pragma Preelaborate;
pragma No_Elaboration_Code_All;
---------------
-- Registers --
---------------
-- Shortcut between CTS event and STARTRX task.
type SHORTS_CTS_STARTRX_Field is
(
-- Shortcut disabled.
Disabled,
-- Shortcut enabled.
Enabled)
with Size => 1;
for SHORTS_CTS_STARTRX_Field use
(Disabled => 0,
Enabled => 1);
-- Shortcut between NCTS event and STOPRX task.
type SHORTS_NCTS_STOPRX_Field is
(
-- Shortcut disabled.
Disabled,
-- Shortcut enabled.
Enabled)
with Size => 1;
for SHORTS_NCTS_STOPRX_Field use
(Disabled => 0,
Enabled => 1);
-- Shortcuts for UART.
type SHORTS_Register is record
-- unspecified
Reserved_0_2 : Interfaces.NRF51.UInt3 := 16#0#;
-- Shortcut between CTS event and STARTRX task.
CTS_STARTRX : SHORTS_CTS_STARTRX_Field :=
Interfaces.NRF51.UART.Disabled;
-- Shortcut between NCTS event and STOPRX task.
NCTS_STOPRX : SHORTS_NCTS_STOPRX_Field :=
Interfaces.NRF51.UART.Disabled;
-- unspecified
Reserved_5_31 : Interfaces.NRF51.UInt27 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SHORTS_Register use record
Reserved_0_2 at 0 range 0 .. 2;
CTS_STARTRX at 0 range 3 .. 3;
NCTS_STOPRX at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
-- Enable interrupt on CTS event.
type INTENSET_CTS_Field is
(
-- Interrupt disabled.
Disabled,
-- Interrupt enabled.
Enabled)
with Size => 1;
for INTENSET_CTS_Field use
(Disabled => 0,
Enabled => 1);
-- Enable interrupt on CTS event.
type INTENSET_CTS_Field_1 is
(
-- Reset value for the field
Intenset_Cts_Field_Reset,
-- Enable interrupt on write.
Set)
with Size => 1;
for INTENSET_CTS_Field_1 use
(Intenset_Cts_Field_Reset => 0,
Set => 1);
-- Enable interrupt on NCTS event.
type INTENSET_NCTS_Field is
(
-- Interrupt disabled.
Disabled,
-- Interrupt enabled.
Enabled)
with Size => 1;
for INTENSET_NCTS_Field use
(Disabled => 0,
Enabled => 1);
-- Enable interrupt on NCTS event.
type INTENSET_NCTS_Field_1 is
(
-- Reset value for the field
Intenset_Ncts_Field_Reset,
-- Enable interrupt on write.
Set)
with Size => 1;
for INTENSET_NCTS_Field_1 use
(Intenset_Ncts_Field_Reset => 0,
Set => 1);
-- Enable interrupt on RXRDY event.
type INTENSET_RXDRDY_Field is
(
-- Interrupt disabled.
Disabled,
-- Interrupt enabled.
Enabled)
with Size => 1;
for INTENSET_RXDRDY_Field use
(Disabled => 0,
Enabled => 1);
-- Enable interrupt on RXRDY event.
type INTENSET_RXDRDY_Field_1 is
(
-- Reset value for the field
Intenset_Rxdrdy_Field_Reset,
-- Enable interrupt on write.
Set)
with Size => 1;
for INTENSET_RXDRDY_Field_1 use
(Intenset_Rxdrdy_Field_Reset => 0,
Set => 1);
-- Enable interrupt on TXRDY event.
type INTENSET_TXDRDY_Field is
(
-- Interrupt disabled.
Disabled,
-- Interrupt enabled.
Enabled)
with Size => 1;
for INTENSET_TXDRDY_Field use
(Disabled => 0,
Enabled => 1);
-- Enable interrupt on TXRDY event.
type INTENSET_TXDRDY_Field_1 is
(
-- Reset value for the field
Intenset_Txdrdy_Field_Reset,
-- Enable interrupt on write.
Set)
with Size => 1;
for INTENSET_TXDRDY_Field_1 use
(Intenset_Txdrdy_Field_Reset => 0,
Set => 1);
-- Enable interrupt on ERROR event.
type INTENSET_ERROR_Field is
(
-- Interrupt disabled.
Disabled,
-- Interrupt enabled.
Enabled)
with Size => 1;
for INTENSET_ERROR_Field use
(Disabled => 0,
Enabled => 1);
-- Enable interrupt on ERROR event.
type INTENSET_ERROR_Field_1 is
(
-- Reset value for the field
Intenset_Error_Field_Reset,
-- Enable interrupt on write.
Set)
with Size => 1;
for INTENSET_ERROR_Field_1 use
(Intenset_Error_Field_Reset => 0,
Set => 1);
-- Enable interrupt on RXTO event.
type INTENSET_RXTO_Field is
(
-- Interrupt disabled.
Disabled,
-- Interrupt enabled.
Enabled)
with Size => 1;
for INTENSET_RXTO_Field use
(Disabled => 0,
Enabled => 1);
-- Enable interrupt on RXTO event.
type INTENSET_RXTO_Field_1 is
(
-- Reset value for the field
Intenset_Rxto_Field_Reset,
-- Enable interrupt on write.
Set)
with Size => 1;
for INTENSET_RXTO_Field_1 use
(Intenset_Rxto_Field_Reset => 0,
Set => 1);
-- Interrupt enable set register.
type INTENSET_Register is record
-- Enable interrupt on CTS event.
CTS : INTENSET_CTS_Field_1 := Intenset_Cts_Field_Reset;
-- Enable interrupt on NCTS event.
NCTS : INTENSET_NCTS_Field_1 := Intenset_Ncts_Field_Reset;
-- Enable interrupt on RXRDY event.
RXDRDY : INTENSET_RXDRDY_Field_1 := Intenset_Rxdrdy_Field_Reset;
-- unspecified
Reserved_3_6 : Interfaces.NRF51.UInt4 := 16#0#;
-- Enable interrupt on TXRDY event.
TXDRDY : INTENSET_TXDRDY_Field_1 := Intenset_Txdrdy_Field_Reset;
-- unspecified
Reserved_8_8 : Interfaces.NRF51.Bit := 16#0#;
-- Enable interrupt on ERROR event.
ERROR : INTENSET_ERROR_Field_1 := Intenset_Error_Field_Reset;
-- unspecified
Reserved_10_16 : Interfaces.NRF51.UInt7 := 16#0#;
-- Enable interrupt on RXTO event.
RXTO : INTENSET_RXTO_Field_1 := Intenset_Rxto_Field_Reset;
-- unspecified
Reserved_18_31 : Interfaces.NRF51.UInt14 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for INTENSET_Register use record
CTS at 0 range 0 .. 0;
NCTS at 0 range 1 .. 1;
RXDRDY at 0 range 2 .. 2;
Reserved_3_6 at 0 range 3 .. 6;
TXDRDY at 0 range 7 .. 7;
Reserved_8_8 at 0 range 8 .. 8;
ERROR at 0 range 9 .. 9;
Reserved_10_16 at 0 range 10 .. 16;
RXTO at 0 range 17 .. 17;
Reserved_18_31 at 0 range 18 .. 31;
end record;
-- Disable interrupt on CTS event.
type INTENCLR_CTS_Field is
(
-- Interrupt disabled.
Disabled,
-- Interrupt enabled.
Enabled)
with Size => 1;
for INTENCLR_CTS_Field use
(Disabled => 0,
Enabled => 1);
-- Disable interrupt on CTS event.
type INTENCLR_CTS_Field_1 is
(
-- Reset value for the field
Intenclr_Cts_Field_Reset,
-- Disable interrupt on write.
Clear)
with Size => 1;
for INTENCLR_CTS_Field_1 use
(Intenclr_Cts_Field_Reset => 0,
Clear => 1);
-- Disable interrupt on NCTS event.
type INTENCLR_NCTS_Field is
(
-- Interrupt disabled.
Disabled,
-- Interrupt enabled.
Enabled)
with Size => 1;
for INTENCLR_NCTS_Field use
(Disabled => 0,
Enabled => 1);
-- Disable interrupt on NCTS event.
type INTENCLR_NCTS_Field_1 is
(
-- Reset value for the field
Intenclr_Ncts_Field_Reset,
-- Disable interrupt on write.
Clear)
with Size => 1;
for INTENCLR_NCTS_Field_1 use
(Intenclr_Ncts_Field_Reset => 0,
Clear => 1);
-- Disable interrupt on RXRDY event.
type INTENCLR_RXDRDY_Field is
(
-- Interrupt disabled.
Disabled,
-- Interrupt enabled.
Enabled)
with Size => 1;
for INTENCLR_RXDRDY_Field use
(Disabled => 0,
Enabled => 1);
-- Disable interrupt on RXRDY event.
type INTENCLR_RXDRDY_Field_1 is
(
-- Reset value for the field
Intenclr_Rxdrdy_Field_Reset,
-- Disable interrupt on write.
Clear)
with Size => 1;
for INTENCLR_RXDRDY_Field_1 use
(Intenclr_Rxdrdy_Field_Reset => 0,
Clear => 1);
-- Disable interrupt on TXRDY event.
type INTENCLR_TXDRDY_Field is
(
-- Interrupt disabled.
Disabled,
-- Interrupt enabled.
Enabled)
with Size => 1;
for INTENCLR_TXDRDY_Field use
(Disabled => 0,
Enabled => 1);
-- Disable interrupt on TXRDY event.
type INTENCLR_TXDRDY_Field_1 is
(
-- Reset value for the field
Intenclr_Txdrdy_Field_Reset,
-- Disable interrupt on write.
Clear)
with Size => 1;
for INTENCLR_TXDRDY_Field_1 use
(Intenclr_Txdrdy_Field_Reset => 0,
Clear => 1);
-- Disable interrupt on ERROR event.
type INTENCLR_ERROR_Field is
(
-- Interrupt disabled.
Disabled,
-- Interrupt enabled.
Enabled)
with Size => 1;
for INTENCLR_ERROR_Field use
(Disabled => 0,
Enabled => 1);
-- Disable interrupt on ERROR event.
type INTENCLR_ERROR_Field_1 is
(
-- Reset value for the field
Intenclr_Error_Field_Reset,
-- Disable interrupt on write.
Clear)
with Size => 1;
for INTENCLR_ERROR_Field_1 use
(Intenclr_Error_Field_Reset => 0,
Clear => 1);
-- Disable interrupt on RXTO event.
type INTENCLR_RXTO_Field is
(
-- Interrupt disabled.
Disabled,
-- Interrupt enabled.
Enabled)
with Size => 1;
for INTENCLR_RXTO_Field use
(Disabled => 0,
Enabled => 1);
-- Disable interrupt on RXTO event.
type INTENCLR_RXTO_Field_1 is
(
-- Reset value for the field
Intenclr_Rxto_Field_Reset,
-- Disable interrupt on write.
Clear)
with Size => 1;
for INTENCLR_RXTO_Field_1 use
(Intenclr_Rxto_Field_Reset => 0,
Clear => 1);
-- Interrupt enable clear register.
type INTENCLR_Register is record
-- Disable interrupt on CTS event.
CTS : INTENCLR_CTS_Field_1 := Intenclr_Cts_Field_Reset;
-- Disable interrupt on NCTS event.
NCTS : INTENCLR_NCTS_Field_1 := Intenclr_Ncts_Field_Reset;
-- Disable interrupt on RXRDY event.
RXDRDY : INTENCLR_RXDRDY_Field_1 := Intenclr_Rxdrdy_Field_Reset;
-- unspecified
Reserved_3_6 : Interfaces.NRF51.UInt4 := 16#0#;
-- Disable interrupt on TXRDY event.
TXDRDY : INTENCLR_TXDRDY_Field_1 := Intenclr_Txdrdy_Field_Reset;
-- unspecified
Reserved_8_8 : Interfaces.NRF51.Bit := 16#0#;
-- Disable interrupt on ERROR event.
ERROR : INTENCLR_ERROR_Field_1 := Intenclr_Error_Field_Reset;
-- unspecified
Reserved_10_16 : Interfaces.NRF51.UInt7 := 16#0#;
-- Disable interrupt on RXTO event.
RXTO : INTENCLR_RXTO_Field_1 := Intenclr_Rxto_Field_Reset;
-- unspecified
Reserved_18_31 : Interfaces.NRF51.UInt14 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for INTENCLR_Register use record
CTS at 0 range 0 .. 0;
NCTS at 0 range 1 .. 1;
RXDRDY at 0 range 2 .. 2;
Reserved_3_6 at 0 range 3 .. 6;
TXDRDY at 0 range 7 .. 7;
Reserved_8_8 at 0 range 8 .. 8;
ERROR at 0 range 9 .. 9;
Reserved_10_16 at 0 range 10 .. 16;
RXTO at 0 range 17 .. 17;
Reserved_18_31 at 0 range 18 .. 31;
end record;
-- A start bit is received while the previous data still lies in RXD. (Data
-- loss).
type ERRORSRC_OVERRUN_Field is
(
-- Error not present.
Notpresent,
-- Error present.
Present)
with Size => 1;
for ERRORSRC_OVERRUN_Field use
(Notpresent => 0,
Present => 1);
-- A start bit is received while the previous data still lies in RXD. (Data
-- loss).
type ERRORSRC_OVERRUN_Field_1 is
(
-- Reset value for the field
Errorsrc_Overrun_Field_Reset,
-- Clear error on write.
Clear)
with Size => 1;
for ERRORSRC_OVERRUN_Field_1 use
(Errorsrc_Overrun_Field_Reset => 0,
Clear => 1);
-- A character with bad parity is received. Only checked if HW parity
-- control is enabled.
type ERRORSRC_PARITY_Field is
(
-- Error not present.
Notpresent,
-- Error present.
Present)
with Size => 1;
for ERRORSRC_PARITY_Field use
(Notpresent => 0,
Present => 1);
-- A character with bad parity is received. Only checked if HW parity
-- control is enabled.
type ERRORSRC_PARITY_Field_1 is
(
-- Reset value for the field
Errorsrc_Parity_Field_Reset,
-- Clear error on write.
Clear)
with Size => 1;
for ERRORSRC_PARITY_Field_1 use
(Errorsrc_Parity_Field_Reset => 0,
Clear => 1);
-- A valid stop bit is not detected on the serial data input after all bits
-- in a character have been received.
type ERRORSRC_FRAMING_Field is
(
-- Error not present.
Notpresent,
-- Error present.
Present)
with Size => 1;
for ERRORSRC_FRAMING_Field use
(Notpresent => 0,
Present => 1);
-- A valid stop bit is not detected on the serial data input after all bits
-- in a character have been received.
type ERRORSRC_FRAMING_Field_1 is
(
-- Reset value for the field
Errorsrc_Framing_Field_Reset,
-- Clear error on write.
Clear)
with Size => 1;
for ERRORSRC_FRAMING_Field_1 use
(Errorsrc_Framing_Field_Reset => 0,
Clear => 1);
-- The serial data input is '0' for longer than the length of a data frame.
type ERRORSRC_BREAK_Field is
(
-- Error not present.
Notpresent,
-- Error present.
Present)
with Size => 1;
for ERRORSRC_BREAK_Field use
(Notpresent => 0,
Present => 1);
-- The serial data input is '0' for longer than the length of a data frame.
type ERRORSRC_BREAK_Field_1 is
(
-- Reset value for the field
Errorsrc_Break_Field_Reset,
-- Clear error on write.
Clear)
with Size => 1;
for ERRORSRC_BREAK_Field_1 use
(Errorsrc_Break_Field_Reset => 0,
Clear => 1);
-- Error source. Write error field to 1 to clear error.
type ERRORSRC_Register is record
-- A start bit is received while the previous data still lies in RXD.
-- (Data loss).
OVERRUN : ERRORSRC_OVERRUN_Field_1 :=
Errorsrc_Overrun_Field_Reset;
-- A character with bad parity is received. Only checked if HW parity
-- control is enabled.
PARITY : ERRORSRC_PARITY_Field_1 := Errorsrc_Parity_Field_Reset;
-- A valid stop bit is not detected on the serial data input after all
-- bits in a character have been received.
FRAMING : ERRORSRC_FRAMING_Field_1 :=
Errorsrc_Framing_Field_Reset;
-- The serial data input is '0' for longer than the length of a data
-- frame.
BREAK : ERRORSRC_BREAK_Field_1 := Errorsrc_Break_Field_Reset;
-- unspecified
Reserved_4_31 : Interfaces.NRF51.UInt28 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ERRORSRC_Register use record
OVERRUN at 0 range 0 .. 0;
PARITY at 0 range 1 .. 1;
FRAMING at 0 range 2 .. 2;
BREAK at 0 range 3 .. 3;
Reserved_4_31 at 0 range 4 .. 31;
end record;
-- Enable or disable UART and acquire IOs.
type ENABLE_ENABLE_Field is
(
-- UART disabled.
Disabled,
-- UART enabled.
Enabled)
with Size => 3;
for ENABLE_ENABLE_Field use
(Disabled => 0,
Enabled => 4);
-- Enable UART and acquire IOs.
type ENABLE_Register is record
-- Enable or disable UART and acquire IOs.
ENABLE : ENABLE_ENABLE_Field := Interfaces.NRF51.UART.Disabled;
-- unspecified
Reserved_3_31 : Interfaces.NRF51.UInt29 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ENABLE_Register use record
ENABLE at 0 range 0 .. 2;
Reserved_3_31 at 0 range 3 .. 31;
end record;
subtype RXD_RXD_Field is Interfaces.NRF51.Byte;
-- RXD register. On read action the buffer pointer is displaced. Once read
-- the character is consumed. If read when no character available, the UART
-- will stop working.
type RXD_Register is record
-- Read-only. *** Reading this field has side effects on other resources
-- ***. RX data from previous transfer. Double buffered.
RXD : RXD_RXD_Field;
-- unspecified
Reserved_8_31 : Interfaces.NRF51.UInt24;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RXD_Register use record
RXD at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype TXD_TXD_Field is Interfaces.NRF51.Byte;
-- TXD register.
type TXD_Register is record
-- Write-only. TX data for transfer.
TXD : TXD_TXD_Field := 16#0#;
-- unspecified
Reserved_8_31 : Interfaces.NRF51.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TXD_Register use record
TXD at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
-- Hardware flow control.
type CONFIG_HWFC_Field is
(
-- Hardware flow control disabled.
Disabled,
-- Hardware flow control enabled.
Enabled)
with Size => 1;
for CONFIG_HWFC_Field use
(Disabled => 0,
Enabled => 1);
-- Include parity bit.
type CONFIG_PARITY_Field is
(
-- Parity bit excluded.
Excluded,
-- Parity bit included.
Included)
with Size => 3;
for CONFIG_PARITY_Field use
(Excluded => 0,
Included => 7);
-- Configuration of parity and hardware flow control register.
type CONFIG_Register is record
-- Hardware flow control.
HWFC : CONFIG_HWFC_Field := Interfaces.NRF51.UART.Disabled;
-- Include parity bit.
PARITY : CONFIG_PARITY_Field := Interfaces.NRF51.UART.Excluded;
-- unspecified
Reserved_4_31 : Interfaces.NRF51.UInt28 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CONFIG_Register use record
HWFC at 0 range 0 .. 0;
PARITY at 0 range 1 .. 3;
Reserved_4_31 at 0 range 4 .. 31;
end record;
-- Peripheral power control.
type POWER_POWER_Field is
(
-- Module power disabled.
Disabled,
-- Module power enabled.
Enabled)
with Size => 1;
for POWER_POWER_Field use
(Disabled => 0,
Enabled => 1);
-- Peripheral power control.
type POWER_Register is record
-- Peripheral power control.
POWER : POWER_POWER_Field := Interfaces.NRF51.UART.Disabled;
-- unspecified
Reserved_1_31 : Interfaces.NRF51.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for POWER_Register use record
POWER at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Universal Asynchronous Receiver/Transmitter.
type UART_Peripheral is record
-- Start UART receiver.
TASKS_STARTRX : aliased Interfaces.NRF51.UInt32;
-- Stop UART receiver.
TASKS_STOPRX : aliased Interfaces.NRF51.UInt32;
-- Start UART transmitter.
TASKS_STARTTX : aliased Interfaces.NRF51.UInt32;
-- Stop UART transmitter.
TASKS_STOPTX : aliased Interfaces.NRF51.UInt32;
-- Suspend UART.
TASKS_SUSPEND : aliased Interfaces.NRF51.UInt32;
-- CTS activated.
EVENTS_CTS : aliased Interfaces.NRF51.UInt32;
-- CTS deactivated.
EVENTS_NCTS : aliased Interfaces.NRF51.UInt32;
-- Data received in RXD.
EVENTS_RXDRDY : aliased Interfaces.NRF51.UInt32;
-- Data sent from TXD.
EVENTS_TXDRDY : aliased Interfaces.NRF51.UInt32;
-- Error detected.
EVENTS_ERROR : aliased Interfaces.NRF51.UInt32;
-- Receiver timeout.
EVENTS_RXTO : aliased Interfaces.NRF51.UInt32;
-- Shortcuts for UART.
SHORTS : aliased SHORTS_Register;
-- Interrupt enable set register.
INTENSET : aliased INTENSET_Register;
-- Interrupt enable clear register.
INTENCLR : aliased INTENCLR_Register;
-- Error source. Write error field to 1 to clear error.
ERRORSRC : aliased ERRORSRC_Register;
-- Enable UART and acquire IOs.
ENABLE : aliased ENABLE_Register;
-- Pin select for RTS.
PSELRTS : aliased Interfaces.NRF51.UInt32;
-- Pin select for TXD.
PSELTXD : aliased Interfaces.NRF51.UInt32;
-- Pin select for CTS.
PSELCTS : aliased Interfaces.NRF51.UInt32;
-- Pin select for RXD.
PSELRXD : aliased Interfaces.NRF51.UInt32;
-- RXD register. On read action the buffer pointer is displaced. Once
-- read the character is consumed. If read when no character available,
-- the UART will stop working.
RXD : aliased RXD_Register;
-- TXD register.
TXD : aliased TXD_Register;
-- UART Baudrate.
BAUDRATE : aliased Interfaces.NRF51.UInt32;
-- Configuration of parity and hardware flow control register.
CONFIG : aliased CONFIG_Register;
-- Peripheral power control.
POWER : aliased POWER_Register;
end record
with Volatile;
for UART_Peripheral use record
TASKS_STARTRX at 16#0# range 0 .. 31;
TASKS_STOPRX at 16#4# range 0 .. 31;
TASKS_STARTTX at 16#8# range 0 .. 31;
TASKS_STOPTX at 16#C# range 0 .. 31;
TASKS_SUSPEND at 16#1C# range 0 .. 31;
EVENTS_CTS at 16#100# range 0 .. 31;
EVENTS_NCTS at 16#104# range 0 .. 31;
EVENTS_RXDRDY at 16#108# range 0 .. 31;
EVENTS_TXDRDY at 16#11C# range 0 .. 31;
EVENTS_ERROR at 16#124# range 0 .. 31;
EVENTS_RXTO at 16#144# range 0 .. 31;
SHORTS at 16#200# range 0 .. 31;
INTENSET at 16#304# range 0 .. 31;
INTENCLR at 16#308# range 0 .. 31;
ERRORSRC at 16#480# range 0 .. 31;
ENABLE at 16#500# range 0 .. 31;
PSELRTS at 16#508# range 0 .. 31;
PSELTXD at 16#50C# range 0 .. 31;
PSELCTS at 16#510# range 0 .. 31;
PSELRXD at 16#514# range 0 .. 31;
RXD at 16#518# range 0 .. 31;
TXD at 16#51C# range 0 .. 31;
BAUDRATE at 16#524# range 0 .. 31;
CONFIG at 16#56C# range 0 .. 31;
POWER at 16#FFC# range 0 .. 31;
end record;
-- Universal Asynchronous Receiver/Transmitter.
UART0_Periph : aliased UART_Peripheral
with Import, Address => System'To_Address (16#40002000#);
end Interfaces.NRF51.UART;
| 31.051095 | 79 | 0.61926 |
dc2f585122f5da61fba1519498409fbd2fbc8777 | 35,501 | adb | Ada | src/el-expressions-nodes.adb | Letractively/ada-el | 43b155ed10b48e1cbba619fb8fd0d170da138653 | [
"Apache-2.0"
] | null | null | null | src/el-expressions-nodes.adb | Letractively/ada-el | 43b155ed10b48e1cbba619fb8fd0d170da138653 | [
"Apache-2.0"
] | null | null | null | src/el-expressions-nodes.adb | Letractively/ada-el | 43b155ed10b48e1cbba619fb8fd0d170da138653 | [
"Apache-2.0"
] | null | null | null | -----------------------------------------------------------------------
-- EL.Expressions -- Expression Nodes
-- Copyright (C) 2009, 2010, 2011, 2012, 2013 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- 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.Unchecked_Deallocation;
with Ada.Characters.Conversions;
with EL.Variables;
with Util.Beans.Methods;
with Util.Strings;
package body EL.Expressions.Nodes is
use EL.Variables;
use Util.Concurrent;
-- ------------------------------
-- Evaluate a node on a given context. If
-- ------------------------------
function Get_Safe_Value (Expr : in ELNode;
Context : in ELContext'Class) return Object is
begin
return ELNode'Class (Expr).Get_Value (Context);
exception
when E : others =>
Context.Handle_Exception (E);
return EL.Objects.Null_Object;
end Get_Safe_Value;
-- ------------------------------
-- Evaluate a node on a given context.
-- ------------------------------
function Get_Value (Expr : ELUnary;
Context : ELContext'Class) return Object is
begin
declare
Value : constant Object := Expr.Node.Get_Value (Context);
begin
case Expr.Kind is
when EL_NOT =>
return To_Object (not To_Boolean (Value));
when EL_MINUS =>
return -Value;
when EL_EMPTY =>
return To_Object (Is_Empty (Value));
when others =>
return Value;
end case;
end;
exception
when E : EL.Variables.No_Variable =>
-- If we can't find the variable, empty predicate must return true.
if Expr.Kind = EL_EMPTY then
return To_Object (True);
end if;
-- For others, this is an error.
Context.Handle_Exception (E);
return EL.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Reduce the expression by eliminating variables which are known
-- and computing constant expressions. Returns either a new expression
-- tree or a constant value.
-- ------------------------------
overriding
function Reduce (Expr : access ELUnary;
Context : in ELContext'Class) return Reduction is
Value : Reduction := Expr.Node.Reduce (Context);
begin
if Value.Node /= null then
Value.Node := Create_Node (Expr.Kind, Value.Node);
else
case Expr.Kind is
when EL_NOT =>
Value.Value := To_Object (not To_Boolean (Value.Value));
when EL_MINUS =>
Value.Value := -Value.Value;
when EL_EMPTY =>
Value.Value := To_Object (Is_Empty (Value.Value));
when others =>
null;
end case;
end if;
return Value;
end Reduce;
-- ------------------------------
-- Delete the expression tree (calls Delete (ELNode_Access) recursively).
-- ------------------------------
overriding
procedure Delete (Node : in out ELUnary) is
begin
Delete (Node.Node);
end Delete;
-- ------------------------------
-- Evaluate a node on a given context.
-- ------------------------------
function Get_Value (Expr : ELBinary;
Context : ELContext'Class) return Object is
Left : constant Object := Expr.Left.Get_Safe_Value (Context);
Right : constant Object := Expr.Right.Get_Safe_Value (Context);
begin
case Expr.Kind is
when EL_EQ =>
return To_Object (Left = Right);
when EL_NE =>
return To_Object (Left /= Right);
when EL_LE =>
return To_Object (Left <= Right);
when EL_LT =>
return To_Object (Left < Right);
when EL_GE =>
return To_Object (Left >= Right);
when EL_GT =>
return To_Object (Left > Right);
when EL_ADD =>
return Left + Right;
when EL_SUB =>
return Left - Right;
when EL_MUL =>
return Left * Right;
when EL_DIV =>
return Left / Right;
when EL_MOD =>
return Left mod Right;
when EL_LAND =>
return To_Object (To_Boolean (Left) and To_Boolean (Right));
when EL_LOR | EL_OR =>
return To_Object (To_Boolean (Left) or To_Boolean (Right));
when EL_CONCAT =>
-- If one of the object is null, ignore it.
if Is_Null (Left) then
return Right;
end if;
if Is_Null (Right) then
return Left;
end if;
if Get_Type (Left) = TYPE_WIDE_STRING
or Get_Type (Right) = TYPE_WIDE_STRING then
return To_Object (To_Wide_Wide_String (Left)
& To_Wide_Wide_String (Right));
else
return To_Object (To_String (Left) & To_String (Right));
end if;
when EL_AND =>
return Left & Right;
end case;
end Get_Value;
-- ------------------------------
-- Reduce the expression by eliminating variables which are known
-- and computing constant expressions. Returns either a new expression
-- tree or a constant value.
-- ------------------------------
overriding
function Reduce (Expr : access ELBinary;
Context : in ELContext'Class) return Reduction is
Left : Reduction := Expr.Left.Reduce (Context);
Right : Reduction := Expr.Right.Reduce (Context);
begin
-- If at least one value is not constant, return an expression.
if Left.Node /= null or Right.Node /= null then
if Left.Node = null then
Left.Node := new ELObject '(Value => Left.Value,
Ref_Counter => Counters.ONE);
elsif Right.Node = null then
Right.Node := new ELObject '(Value => Right.Value,
Ref_Counter => Counters.ONE);
end if;
Left.Node := Create_Node (Expr.Kind, Left.Node, Right.Node);
else
-- Both values are known, compute the result.
case Expr.Kind is
when EL_EQ =>
Left.Value := To_Object (Left.Value = Right.Value);
when EL_NE =>
Left.Value := To_Object (Left.Value /= Right.Value);
when EL_LE =>
Left.Value := To_Object (Left.Value <= Right.Value);
when EL_LT =>
Left.Value := To_Object (Left.Value < Right.Value);
when EL_GE =>
Left.Value := To_Object (Left.Value >= Right.Value);
when EL_GT =>
Left.Value := To_Object (Left.Value > Right.Value);
when EL_ADD =>
Left.Value := Left.Value + Right.Value;
when EL_SUB =>
Left.Value := Left.Value - Right.Value;
when EL_MUL =>
Left.Value := Left.Value * Right.Value;
when EL_DIV =>
Left.Value := Left.Value / Right.Value;
when EL_MOD =>
Left.Value := Left.Value mod Right.Value;
when EL_LAND =>
Left.Value := To_Object (To_Boolean (Left.Value)
and To_Boolean (Right.Value));
when EL_LOR | EL_OR =>
Left.Value := To_Object (To_Boolean (Left.Value)
or To_Boolean (Right.Value));
when EL_CONCAT =>
if Get_Type (Left.Value) = TYPE_WIDE_STRING
or Get_Type (Right.Value) = TYPE_WIDE_STRING then
Left.Value := To_Object (To_Wide_Wide_String (Left.Value)
& To_Wide_Wide_String (Right.Value));
else
Left.Value := To_Object (To_String (Left.Value)
& To_String (Right.Value));
end if;
when EL_AND =>
Left.Value := Left.Value & Right.Value;
end case;
end if;
return Left;
end Reduce;
-- ------------------------------
-- Delete the expression tree (calls Delete (ELNode_Access) recursively).
-- ------------------------------
procedure Delete (Node : in out ELBinary) is
begin
Delete (Node.Left);
Delete (Node.Right);
end Delete;
-- ------------------------------
-- Evaluate a node on a given context.
-- ------------------------------
function Get_Value (Expr : ELTernary;
Context : ELContext'Class) return Object is
Cond : constant Object := Expr.Cond.Get_Safe_Value (Context);
begin
if To_Boolean (Cond) then
return Expr.Left.Get_Safe_Value (Context);
else
return Expr.Right.Get_Safe_Value (Context);
end if;
end Get_Value;
-- ------------------------------
-- Reduce the expression by eliminating variables which are known
-- and computing constant expressions. Returns either a new expression
-- tree or a constant value.
-- ------------------------------
overriding
function Reduce (Expr : access ELTernary;
Context : in ELContext'Class) return Reduction is
Cond : constant Reduction := Expr.Cond.Reduce (Context);
begin
-- Condition value is known, evaluate one or the other part.
if Cond.Node = null then
if To_Boolean (Cond.Value) then
return Expr.Left.Reduce (Context);
else
return Expr.Right.Reduce (Context);
end if;
end if;
declare
Left : Reduction := Expr.Left.Reduce (Context);
Right : Reduction := Expr.Right.Reduce (Context);
begin
if Left.Node = null then
Left.Node := new ELObject '(Value => Left.Value,
Ref_Counter => Counters.ONE);
end if;
if Right.Node = null then
Right.Node := new ELObject '(Value => Right.Value,
Ref_Counter => Counters.ONE);
end if;
Left.Node := Create_Node (Cond.Node, Left.Node, Right.Node);
return Left;
end;
end Reduce;
-- ------------------------------
-- Delete the expression tree. Free the memory allocated by nodes
-- of the expression tree. Clears the node pointer.
-- ------------------------------
overriding
procedure Delete (Node : in out ELTernary) is
begin
Delete (Node.Right);
Delete (Node.Left);
Delete (Node.Cond);
end Delete;
-- ------------------------------
-- Variable to be looked at in the expression context
-- ------------------------------
-- ------------------------------
-- Evaluate a node on a given context.
-- ------------------------------
function Get_Value (Expr : ELVariable;
Context : ELContext'Class) return Object is
Mapper : constant access Variable_Mapper'Class := Context.Get_Variable_Mapper;
Resolver : constant ELResolver_Access := Context.Get_Resolver;
begin
-- Resolve using the variable mapper first. If an exception is raised,
-- use the context Handle_Exception to give a chance to report custom errors (See ASF).
-- If the value can't be found and the Handle_Exception did not raised any exception,
-- return the Null object.
if Mapper /= null then
begin
declare
Value : constant Expression := Mapper.Get_Variable (Expr.Name);
begin
-- If the returned expression is null, assume the variable was not found.
-- A variable mapper that returns a null expression is faster than raising
-- the No_Variable exception (arround 30us on Intel Core @ 2.6Ghz!).
if not Value.Is_Null then
return Value.Get_Value (Context);
end if;
end;
exception
when No_Variable =>
if Resolver = null then
raise;
end if;
end;
end if;
if Resolver = null then
raise Invalid_Variable
with "Cannot resolve variable: '" & To_String (Expr.Name) & "'";
end if;
return Resolver.all.Get_Value (Context, null, Expr.Name);
end Get_Value;
-- ------------------------------
-- Reduce the expression by eliminating variables which are known
-- and computing constant expressions. Returns either a new expression
-- tree or a constant value.
-- ------------------------------
overriding
function Reduce (Expr : access ELVariable;
Context : in ELContext'Class) return Reduction is
Mapper : constant access Variable_Mapper'Class := Context.Get_Variable_Mapper;
begin
if Mapper /= null then
declare
Value : constant Expression := Mapper.Get_Variable (Expr.Name);
begin
if Value.Node /= null then
return Value.Node.Reduce (Context);
elsif not EL.Objects.Is_Null (Value.Value) then
return Reduction '(Value => Value.Value,
Node => null);
end if;
exception
when others =>
-- An exception such as Invalid_Variable can be raised if the value expression
-- defined in <b>Value</b> refers to a variable which is not yet defined.
-- We want to keep the resolution we did (hence Expr.Name) and still refer
-- to the new expression so that it can be resolved later on. Typical case in
-- ASF:
-- <h:list value="#{list}" var="item">
-- <ui:include src="item.xhtml">
-- <ui:param name="c" value="#{item.components.data}"/>
-- </ui:include>
-- </h:list>
--
-- Here, the <b>Value</b> will refer to the EL expression #{item.components.data}
-- which is not known at the time of reduction.
if Value.Node /= null then
Util.Concurrent.Counters.Increment (Value.Node.Ref_Counter);
return Reduction '(Value => EL.Objects.Null_Object,
Node => Value.Node.all'Access);
end if;
end;
end if;
Util.Concurrent.Counters.Increment (Expr.Ref_Counter);
return Reduction '(Value => EL.Objects.Null_Object,
Node => Expr.all'Access);
exception
when others =>
Util.Concurrent.Counters.Increment (Expr.Ref_Counter);
return Reduction '(Value => EL.Objects.Null_Object,
Node => Expr.all'Access);
end Reduce;
-- ------------------------------
-- Delete the expression tree (calls Delete (ELNode_Access) recursively).
-- ------------------------------
overriding
procedure Delete (Node : in out ELVariable) is
begin
null;
end Delete;
overriding
function Get_Value (Expr : ELValue;
Context : ELContext'Class) return Object is
Var : constant Object := Expr.Variable.Get_Value (Context);
Bean : constant access Util.Beans.Basic.Readonly_Bean'Class := To_Bean (Var);
begin
if Bean /= null then
return Bean.Get_Value (Expr.Name);
else
return Var;
end if;
end Get_Value;
-- ------------------------------
-- Check if the target bean is a readonly bean.
-- ------------------------------
function Is_Readonly (Node : in ELValue;
Context : in ELContext'Class) return Boolean is
Var : constant Object := Node.Variable.Get_Value (Context);
Bean : constant access Util.Beans.Basic.Readonly_Bean'Class := To_Bean (Var);
begin
return Bean = null or else not (Bean.all in Util.Beans.Basic.Bean'Class);
end Is_Readonly;
-- ------------------------------
-- Evaluate the node and return a method info with
-- the bean object and the method binding.
-- ------------------------------
function Get_Method_Info (Node : in ELValue;
Context : in ELContext'Class) return Method_Info is
use Util.Beans.Methods;
use type Util.Strings.Name_Access;
Var : constant Object := Node.Variable.Get_Value (Context);
Bean : constant access Util.Beans.Basic.Readonly_Bean'Class := To_Bean (Var);
begin
if Bean = null then
raise Invalid_Variable;
end if;
-- If the bean is a method bean, get the methods that it exposes
-- and look for the binding that matches our method name.
if Bean.all in Method_Bean'Class then
declare
MBean : constant access Method_Bean'Class := Method_Bean (Bean.all)'Access;
Bindings : constant Method_Binding_Array_Access := MBean.Get_Method_Bindings;
Result : Method_Info;
begin
for I in Bindings'Range loop
if Bindings (I) /= null and then Bindings (I).Name /= null
and then Node.Name = Bindings (I).Name.all then
Result.Object := Bean;
Result.Binding := Bindings (I);
return Result;
end if;
end loop;
end;
end if;
raise Invalid_Method with "Method '" & Node.Name & "' not found";
end Get_Method_Info;
-- ------------------------------
-- Evaluate the node and set the value on the associated bean.
-- Raises Invalid_Variable if the target object is not a bean.
-- Raises Invalid_Expression if the target bean is not writeable.
-- ------------------------------
procedure Set_Value (Node : in ELValue;
Context : in ELContext'Class;
Value : in Objects.Object) is
use Util.Beans;
use type Util.Strings.Name_Access;
Var : constant Object := Node.Variable.Get_Value (Context);
Bean : constant access Basic.Readonly_Bean'Class := To_Bean (Var);
begin
if Bean = null then
raise Invalid_Variable;
end if;
-- If the bean is a method bean, get the methods that it exposes
-- and look for the binding that matches our method name.
if not (Bean.all in Basic.Bean'Class) then
raise Invalid_Method with "Method '" & Node.Name & "' not found";
end if;
declare
VBean : constant access Basic.Bean'Class := Basic.Bean'Class (Bean.all)'Unchecked_Access;
begin
VBean.Set_Value (Node.Name, Value);
end;
end Set_Value;
-- ------------------------------
-- Reduce the expression by eliminating variables which are known
-- and computing constant expressions. Returns either a new expression
-- tree or a constant value.
-- ------------------------------
overriding
function Reduce (Expr : access ELValue;
Context : in ELContext'Class) return Reduction is
Var : Reduction := Expr.Variable.Reduce (Context);
begin
if Var.Node = null then
declare
Bean : constant access Util.Beans.Basic.Readonly_Bean'Class
:= To_Bean (Var.Value);
begin
if Bean /= null then
Var.Value := Bean.Get_Value (Expr.Name);
Var.Node := null;
return Var;
end if;
end;
end if;
-- If the reduction returned the same variable, return the same ELvalue.
-- Release the counter for the returned variable and increment the other one.
if Var.Node = Expr.Variable then
Util.Concurrent.Counters.Decrement (Var.Node.Ref_Counter);
Util.Concurrent.Counters.Increment (Expr.Ref_Counter);
return Reduction '(Node => Expr.all'Access,
Value => EL.Objects.Null_Object);
else
-- Otherwise, replace the variable.
return Reduction '(Node => new ELValue '(Variable => Var.Node,
Len => Expr.Len,
Name => Expr.Name,
Ref_Counter => Counters.ONE),
Value => EL.Objects.Null_Object);
end if;
end Reduce;
-- ------------------------------
-- Delete the expression tree (calls Delete (ELNode_Access) recursively).
-- ------------------------------
overriding
procedure Delete (Node : in out ELValue) is
begin
Delete (Node.Variable);
end Delete;
-- ------------------------------
-- Literal object (integer, boolean, float, string)
-- ------------------------------
-- ------------------------------
-- Evaluate a node on a given context.
-- ------------------------------
function Get_Value (Expr : ELObject;
Context : ELContext'Class) return Object is
pragma Unreferenced (Context);
begin
return Expr.Value;
end Get_Value;
-- ------------------------------
-- Reduce the expression by eliminating variables which are known
-- and computing constant expressions. Returns either a new expression
-- tree or a constant value.
-- ------------------------------
overriding
function Reduce (Expr : access ELObject;
Context : in ELContext'Class) return Reduction is
pragma Unreferenced (Context);
begin
return Reduction '(Value => Expr.Value,
Node => null);
end Reduce;
overriding
procedure Delete (Node : in out ELObject) is
begin
null;
end Delete;
-- ------------------------------
-- Evaluate a node on a given context.
-- ------------------------------
overriding
function Get_Value (Expr : ELFunction;
Context : ELContext'Class) return Object is
Arg1, Arg2, Arg3, Arg4 : Object;
begin
if Expr.Arg1 = null then
raise Missing_Argument with "Missing argument 1";
end if;
Arg1 := Expr.Arg1.Get_Safe_Value (Context);
if Expr.Func.Of_Type = F_1_ARG then
return Expr.Func.Func1 (Arg1);
end if;
if Expr.Arg2 = null then
raise Missing_Argument with "Missing argument 2";
end if;
Arg2 := Expr.Arg2.Get_Safe_Value (Context);
if Expr.Func.Of_Type = F_2_ARG then
return Expr.Func.Func2 (Arg1, Arg2);
end if;
if Expr.Arg3 = null then
raise Missing_Argument with "Missing argument 3";
end if;
Arg3 := Expr.Arg3.Get_Safe_Value (Context);
if Expr.Func.Of_Type = F_3_ARG then
return Expr.Func.Func3 (Arg1, Arg2, Arg3);
end if;
if Expr.Arg4 = null then
raise Missing_Argument with "Missing argument 4";
end if;
Arg4 := Expr.Arg4.Get_Safe_Value (Context);
return Expr.Func.Func4 (Arg1, Arg2, Arg3, Arg4);
end Get_Value;
-- ------------------------------
-- Reduce the expression by eliminating variables which are known
-- and computing constant expressions. Returns either a new expression
-- tree or a constant value.
-- ------------------------------
overriding
function Reduce (Expr : access ELFunction;
Context : in ELContext'Class) return Reduction is
Arg1, Arg2, Arg3, Arg4 : Reduction;
begin
if Expr.Arg1 /= null then
Arg1 := Expr.Arg1.Reduce (Context);
end if;
if Expr.Func.Of_Type = F_1_ARG then
if Arg1.Node = null and Expr.Func.Optimize and Expr.Func.Func1 /= null then
Arg1.Value := Expr.Func.Func1 (Arg1.Value);
return Arg1;
end if;
if Arg1.Node = null then
Arg1.Node := new ELObject '(Value => Arg1.Value,
Ref_Counter => Counters.ONE);
end if;
Arg1.Node := Create_Node (Expr.Func, Arg1.Node);
return Arg1;
end if;
if Expr.Arg2 /= null then
Arg2 := Expr.Arg2.Reduce (Context);
end if;
if Expr.Func.Of_Type = F_2_ARG then
if Arg1.Node = null and Arg2.Node = null and Expr.Func.Optimize
and Expr.Func.Func2 /= null then
Arg1.Value := Expr.Func.Func2 (Arg1.Value, Arg2.Value);
return Arg1;
end if;
if Arg1.Node = null then
Arg1.Node := new ELObject '(Value => Arg1.Value,
Ref_Counter => Counters.ONE);
end if;
if Arg2.Node = null then
Arg2.Node := new ELObject '(Value => Arg2.Value,
Ref_Counter => Counters.ONE);
end if;
Arg1.Node := Create_Node (Expr.Func,
Arg1.Node, Arg2.Node);
return Arg1;
end if;
if Expr.Arg3 /= null then
Arg3 := Expr.Arg3.Reduce (Context);
end if;
if Expr.Func.Of_Type = F_3_ARG then
if Arg1.Node = null and Arg2.Node = null and Arg3.Node = null and Expr.Func.Optimize
and Expr.Func.Func3 /= null then
Arg1.Value := Expr.Func.Func3 (Arg1.Value, Arg2.Value, Arg3.Value);
return Arg1;
end if;
if Arg1.Node = null then
Arg1.Node := new ELObject '(Value => Arg1.Value,
Ref_Counter => Counters.ONE);
end if;
if Arg2.Node = null then
Arg2.Node := new ELObject '(Value => Arg2.Value,
Ref_Counter => Counters.ONE);
end if;
if Arg3.Node = null then
Arg3.Node := new ELObject '(Value => Arg3.Value,
Ref_Counter => Counters.ONE);
end if;
Arg1.Node := Create_Node (Expr.Func,
Arg1.Node, Arg2.Node, Arg3.Node);
return Arg1;
end if;
if Expr.Arg4 /= null then
Arg4 := Expr.Arg4.Reduce (Context);
end if;
if Arg1.Node = null and Arg2.Node = null and Arg3.Node = null
and Arg4.Node = null and Expr.Func.Optimize and Expr.Func.Func4 /= null then
Arg1.Value := Expr.Func.Func4 (Arg1.Value, Arg2.Value, Arg3.Value, Arg4.Value);
return Arg1;
end if;
if Arg1.Node = null then
Arg1.Node := new ELObject '(Value => Arg1.Value,
Ref_Counter => Counters.ONE);
end if;
if Arg2.Node = null then
Arg2.Node := new ELObject '(Value => Arg2.Value,
Ref_Counter => Counters.ONE);
end if;
if Arg3.Node = null then
Arg3.Node := new ELObject '(Value => Arg3.Value,
Ref_Counter => Counters.ONE);
end if;
if Arg4.Node = null then
Arg4.Node := new ELObject '(Value => Arg4.Value,
Ref_Counter => Counters.ONE);
end if;
Arg1.Node := Create_Node (Expr.Func,
Arg1.Node, Arg2.Node, Arg3.Node, Arg4.Node);
return Arg1;
end Reduce;
overriding
procedure Delete (Node : in out ELFunction) is
begin
if Node.Arg1 /= null then
Delete (Node.Arg1);
end if;
if Node.Arg2 /= null then
Delete (Node.Arg2);
end if;
if Node.Arg3 /= null then
Delete (Node.Arg3);
end if;
if Node.Arg4 /= null then
Delete (Node.Arg4);
end if;
end Delete;
-- ------------------------------
-- Create a literal number
-- ------------------------------
function Create_Node (Value : Boolean) return ELNode_Access is
begin
return new ELObject '(Value => To_Object (Value), Ref_Counter => Counters.ONE);
end Create_Node;
-- ------------------------------
-- Create a literal number
-- ------------------------------
function Create_Node (Value : Long_Long_Integer) return ELNode_Access is
begin
return new ELObject '(Value => To_Object (Value), Ref_Counter => Counters.ONE);
end Create_Node;
function Create_Node (Value : String) return ELNode_Access is
begin
return new ELObject '(Value => To_Object (Value), Ref_Counter => Counters.ONE);
end Create_Node;
function Create_Node (Value : Wide_Wide_String) return ELNode_Access is
begin
return new ELObject '(Value => To_Object (Value), Ref_Counter => Counters.ONE);
end Create_Node;
function Create_Node (Value : Unbounded_Wide_Wide_String) return ELNode_Access is
begin
return new ELObject '(Value => To_Object (Value), Ref_Counter => Counters.ONE);
end Create_Node;
function Create_Node (Value : Long_Float) return ELNode_Access is
begin
return new ELObject '(Value => To_Object (Value), Ref_Counter => Counters.ONE);
end Create_Node;
function Create_Variable (Name : in Wide_Wide_String) return ELNode_Access is
Result : constant ELVariable_Access := new ELVariable '(Name => Null_Unbounded_String,
Ref_Counter => Counters.ONE);
begin
Append (Result.Name, Ada.Characters.Conversions.To_String (Name));
return Result.all'Access;
end Create_Variable;
function Create_Value (Variable : in ELNode_Access;
Name : in Wide_Wide_String) return ELNode_Access is
Result : constant ELValue_Access := new ELValue '(Len => Name'Length,
Variable => Variable,
Ref_Counter => Counters.ONE,
Name => (others => <>));
Pos : Positive := 1;
begin
for I in Name'Range loop
Result.Name (Pos) := Ada.Characters.Conversions.To_Character (Name (I));
Pos := Pos + 1;
end loop;
return Result.all'Access;
end Create_Value;
-- ------------------------------
-- Create unary expressions
-- ------------------------------
function Create_Node (Of_Type : Unary_Node;
Expr : ELNode_Access) return ELNode_Access is
begin
return new ELUnary '(Kind => Of_Type, Node => Expr, Ref_Counter => Counters.ONE);
end Create_Node;
-- ------------------------------
-- Create binary expressions
-- ------------------------------
function Create_Node (Of_Type : Binary_Node;
Left : ELNode_Access;
Right : ELNode_Access) return ELNode_Access is
begin
return new ELBinary '(Kind => Of_Type, Left => Left, Right => Right,
Ref_Counter => Counters.ONE);
end Create_Node;
-- ------------------------------
-- Create a ternary expression.
-- ------------------------------
function Create_Node (Cond : ELNode_Access;
Left : ELNode_Access;
Right : ELNode_Access) return ELNode_Access is
begin
return new ELTernary '(Cond => Cond, Left => Left, Right => Right,
Ref_Counter => Counters.ONE);
end Create_Node;
-- ------------------------------
-- Create a function call expression
-- ------------------------------
function Create_Node (Func : Function_Access;
Arg1 : ELNode_Access) return ELNode_Access is
begin
return new ELFunction '(Ref_Counter => Counters.ONE,
Func => Func,
Arg1 => Arg1,
others => null);
end Create_Node;
-- ------------------------------
-- Create a function call expression
-- ------------------------------
function Create_Node (Func : Function_Access;
Arg1 : ELNode_Access;
Arg2 : ELNode_Access) return ELNode_Access is
begin
return new ELFunction '(Ref_Counter => Counters.ONE,
Func => Func,
Arg1 => Arg1,
Arg2 => Arg2,
others => null);
end Create_Node;
-- ------------------------------
-- Create a function call expression
-- ------------------------------
function Create_Node (Func : Function_Access;
Arg1 : ELNode_Access;
Arg2 : ELNode_Access;
Arg3 : ELNode_Access) return ELNode_Access is
begin
return new ELFunction '(Ref_Counter => Counters.ONE,
Func => Func,
Arg1 => Arg1,
Arg2 => Arg2,
Arg3 => Arg3,
others => null);
end Create_Node;
-- ------------------------------
-- Create a function call expression
-- ------------------------------
function Create_Node (Func : Function_Access;
Arg1 : ELNode_Access;
Arg2 : ELNode_Access;
Arg3 : ELNode_Access;
Arg4 : ELNode_Access) return ELNode_Access is
begin
return new ELFunction '(Ref_Counter => Counters.ONE,
Func => Func,
Arg1 => Arg1,
Arg2 => Arg2,
Arg3 => Arg3,
Arg4 => Arg4);
end Create_Node;
-- ------------------------------
-- Delete the expression tree. Free the memory allocated by nodes
-- of the expression tree. Clears the node pointer.
-- ------------------------------
procedure Delete (Node : in out ELNode_Access) is
procedure Free is new Ada.Unchecked_Deallocation (Object => ELNode'Class,
Name => ELNode_Access);
Is_Zero : Boolean;
begin
if Node /= null then
Util.Concurrent.Counters.Decrement (Node.Ref_Counter, Is_Zero);
if Is_Zero then
Delete (Node.all);
Free (Node);
end if;
end if;
end Delete;
end EL.Expressions.Nodes;
| 37.487856 | 99 | 0.515901 |
18186cbc3a2546d9002fe2f63f0d6906e41750db | 4,547 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c97201a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c97201a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c97201a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- C97201A.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 A RENDEZVOUS REQUESTED BY A CONDITIONAL_ENTRY_CALL
-- IS PERFORMED ONLY IF IMMEDIATELY POSSIBLE.
-- CASE A: THE TASK TO BE CALLED IS NOT YET ACTIVE AS OF THE
-- MOMENT OF CALL (CONDITIONAL_ENTRY_CALL),
-- AND THIS FACT CAN BE DETERMINED STATICALLY.
-- RM 4/20/82
WITH REPORT; USE REPORT;
PROCEDURE C97201A IS
ELSE_BRANCH_TAKEN : INTEGER := 3 ;
BEGIN
TEST ("C97201A", "CHECK THAT NO RENDEZVOUS REQUESTED BY" &
" A CONDITIONAL_ENTRY_CALL CAN OCCUR WHILE" &
" THE CALLED TASK IS NOT YET ACTIVE" );
-------------------------------------------------------------------
DECLARE
TASK T IS
ENTRY DO_IT_NOW_ORELSE ( AUTHORIZED : IN BOOLEAN ) ;
END T ;
TASK BODY T IS
PACKAGE SECOND_ATTEMPT IS END SECOND_ATTEMPT ;
PACKAGE BODY SECOND_ATTEMPT IS
BEGIN
SELECT
DO_IT_NOW_ORELSE (FALSE) ;--CALLING (OWN) ENTRY
ELSE -- (I.E. CALLER ADOPTS A NO-WAIT POLICY)
-- THEREFORE THIS BRANCH MUST BE CHOSEN
ELSE_BRANCH_TAKEN := 2 * ELSE_BRANCH_TAKEN ;
COMMENT( "ELSE_BRANCH TAKEN (#2)" );
END SELECT;
END SECOND_ATTEMPT ;
BEGIN
ACCEPT DO_IT_NOW_ORELSE ( AUTHORIZED : IN BOOLEAN ) DO
IF AUTHORIZED THEN
COMMENT( "AUTHORIZED ENTRY_CALL" );
ELSE
FAILED( "UNAUTHORIZED ENTRY_CALL" );
END IF;
END DO_IT_NOW_ORELSE ;
END T ;
PACKAGE FIRST_ATTEMPT IS END FIRST_ATTEMPT ;
PACKAGE BODY FIRST_ATTEMPT IS
BEGIN
SELECT
T.DO_IT_NOW_ORELSE (FALSE) ;
ELSE -- (I.E. CALLER ADOPTS A NO-WAIT POLICY)
-- THEREFORE THIS BRANCH MUST BE CHOSEN
ELSE_BRANCH_TAKEN := 1 + ELSE_BRANCH_TAKEN ;
COMMENT( "ELSE_BRANCH TAKEN (#1)" );
END SELECT;
END FIRST_ATTEMPT ;
BEGIN
T.DO_IT_NOW_ORELSE ( TRUE ); -- TO SATISFY THE SERVER'S
-- WAIT FOR SUCH A CALL
EXCEPTION
WHEN TASKING_ERROR =>
FAILED( "TASKING ERROR" );
END ;
-------------------------------------------------------------------
-- BY NOW, THE TASK IS TERMINATED (AND THE NONLOCALS UPDATED)
CASE ELSE_BRANCH_TAKEN IS
WHEN 3 =>
FAILED( "NO 'ELSE'; BOTH (?) RENDEZVOUS ATTEMPTED?" );
WHEN 4 =>
FAILED( "'ELSE' #1 ONLY; RENDEZVOUS (#2) ATTEMPTED?" );
WHEN 6 =>
FAILED( "'ELSE' #2 ONLY; RENDEZVOUS (#1) ATTEMPTED?" );
WHEN 7 =>
FAILED( "WRONG ORDER FOR 'ELSE': #2,#1 " );
WHEN 8 =>
NULL ;
WHEN OTHERS =>
FAILED( "WRONG CASE_VALUE" );
END CASE;
RESULT;
END C97201A ;
| 29.914474 | 79 | 0.516824 |
c56b711ef6219c23defec30217248e0ef3e31739 | 855 | ads | Ada | source/setup.ads | jquorning/iDoNu | 1618b679f7d0895729dded62f22b0826e7da7cb1 | [
"blessing"
] | 1 | 2016-08-09T20:47:23.000Z | 2016-08-09T20:47:23.000Z | source/setup.ads | jquorning/iDoNu | 1618b679f7d0895729dded62f22b0826e7da7cb1 | [
"blessing"
] | null | null | null | source/setup.ads | jquorning/iDoNu | 1618b679f7d0895729dded62f22b0826e7da7cb1 | [
"blessing"
] | null | null | null | pragma License (Restricted);
--
-- Copyright (C) 2020 Jesper Quorning All Rights Reserved.
--
-- The author disclaims copyright to this source code. In place of
-- a legal notice, here is a blessing:
--
-- May you do good and not evil.
-- May you find forgiveness for yourself and forgive others.
-- May you share freely, not taking more than you give.
--
package Setup is
function Program_Name return String;
function Program_Version return String;
function Build_ISO8601_UTC return String;
function Uname_M return String;
function Uname_N return String;
function Uname_P return String;
function Uname_R return String;
function Uname_S return String;
Database_Others : constant String := "others";
Database_Extension : constant String := "idonu";
type Configuration is null record;
end Setup;
| 28.5 | 68 | 0.725146 |
dc6f20a45f698d311e09e4dcb58133889d8db3db | 4,694 | adb | Ada | src/sdl-rwops-streams.adb | rveenker/sdlada | 2ef55d2100b248db44c89cb3a9f20038e453f330 | [
"Zlib"
] | 1 | 2021-10-30T14:41:56.000Z | 2021-10-30T14:41:56.000Z | src/sdl-rwops-streams.adb | rveenker/sdlada | 2ef55d2100b248db44c89cb3a9f20038e453f330 | [
"Zlib"
] | null | null | null | src/sdl-rwops-streams.adb | rveenker/sdlada | 2ef55d2100b248db44c89cb3a9f20038e453f330 | [
"Zlib"
] | null | null | null | --------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2020, 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 SDL.Error;
package body SDL.RWops.Streams is
use type Interfaces.C.unsigned_long;
function Open (Op : in RWops) return RWops_Stream is
begin
return (Ada.Streams.Root_Stream_Type with Context => Op);
end Open;
procedure Open (Op : in RWops; Stream : out RWops_Stream) is
begin
Stream.Context := Op;
end Open;
overriding
procedure Read (Stream : in out RWops_Stream;
Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset)
is
Objects_Read : Interfaces.C.unsigned_long := 0;
function SDL_Read (Context : in RWops_Pointer;
Ptr : in System.Address;
Size : in C.unsigned_long;
Max_Num : in C.unsigned_long
) return C.unsigned_long;
pragma Import (C, SDL_Read, "read_wrap");
begin
-- Re-implemented c-macro:
-- #define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n)
-- Read : access function
-- (context : RWops_Pointer;
-- ptr : System.Address;
-- size : Interfaces.C.unsigned_long;
-- maxnum : Interfaces.C.unsigned_long) return Interfaces.C.unsigned_long;
Objects_Read := SDL_Read (Context => RWops_Pointer (Stream.Context),
Ptr => Item'Address,
Size => C.unsigned_long (Item'Length),
Max_Num => 1);
if Objects_Read = 0 then
raise RWops_Error with SDL.Error.Get;
end if;
Last := Ada.Streams.Stream_Element_Offset (Objects_Read);
end Read;
overriding
procedure Write (Stream : in out RWops_Stream; Item : Ada.Streams.Stream_Element_Array)
is
Objects_Written : Interfaces.C.unsigned_long := 0;
function SDL_Write (Context : in RWops_Pointer;
Ptr : in System.Address;
Size : in C.unsigned_long;
Num : in C.unsigned_long
) return C.unsigned_long;
pragma Import (C, SDL_Write, "write_wrap");
begin
-- Re-implemented c-macro:
-- #define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n)
-- Write : access function
-- (Context : RWops_Pointer;
-- Ptr : System.Address;
-- Size : Interfaces.C.unsigned_long;
-- Num : Interfaces.C.unsigned_long) return Interfaces.C.unsigned_long;
Objects_Written := SDL_Write
(Context => RWops_Pointer (Stream.Context),
Ptr => Item'Address,
Size => C.unsigned_long (Item'Length),
Num => 1);
if Objects_Written = 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Write;
procedure Close (Stream : in out RWops_Stream)
is
use type C.int;
Res : C.int := 0;
function SDL_Close (Context : in RWops_Pointer) return C.int;
pragma Import (C, SDL_Close, "close_wrap");
begin
-- Re-implemented c-macro:
-- #define SDL_RWclose(ctx) (ctx)->close(ctx)
-- Close : access function
-- (Context : RWops_Pointer) return Interfaces.C.int;
Res := SDL_Close (Context => RWops_Pointer (Stream.Context));
if Res /= 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Close;
end SDL.RWops.Streams;
| 36.671875 | 116 | 0.569663 |
cb62ff2496fd11edeb36289d4ba051530c3e54cf | 3,790 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c95085l.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c95085l.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c95085l.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- C95085L.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 UNDER THE APPROPRIATE
-- CIRCUMSTANCES FOR ACCESS PARAMETERS IN ENTRY CALLS, NAMELY WHEN
-- THE ACTUAL INDEX BOUNDS OR DISCRIMINANTS ARE NOT EQUAL
-- TO THE FORMAL CONSTRAINTS BEFORE THE CALL (FOR IN AND IN OUT
-- MODES), AND WHEN THE FORMAL CONSTRAINTS ARE NOT EQUAL TO THE
-- ACTUAL CONSTRAINTS UPON RETURN (FOR IN OUT AND OUT MODES).
-- (I) AFTER RETURN, OUT MODE, CONSTRAINED FORMAL, STATIC
-- PRIVATE DISCRIMINANTS.
-- JWC 10/24/85
WITH REPORT; USE REPORT;
PROCEDURE C95085L IS
BEGIN
TEST ("C95085L", "CHECK THAT CONSTRAINT_ERROR IS RAISED " &
"APPROPRIATELY FOR ACCESS PARAMETERS");
--------------------------------------------------
DECLARE
CALLED : BOOLEAN := FALSE;
PACKAGE PKG IS
TYPE E IS (E1, E2, E3);
TYPE T (D : E := E1; B : BOOLEAN := FALSE) IS
PRIVATE;
PRIVATE
TYPE ARR IS ARRAY (E RANGE <>) OF INTEGER;
TYPE T (D : E := E1; B : BOOLEAN := FALSE) IS
RECORD
I : INTEGER;
CASE B IS
WHEN FALSE =>
J : INTEGER;
WHEN TRUE =>
A : ARR (E1 .. D);
END CASE;
END RECORD;
END PKG;
USE PKG;
TYPE A IS ACCESS T;
SUBTYPE SA IS A (E2, TRUE);
V : A (E2, FALSE) := NEW T (E2, FALSE);
TASK TSK IS
ENTRY E (X : OUT SA);
END TSK;
TASK BODY TSK IS
BEGIN
SELECT
ACCEPT E (X : OUT SA) DO
CALLED := TRUE;
X := NEW T (E2, TRUE);
END E;
OR
TERMINATE;
END SELECT;
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN TASK BODY");
END TSK;
BEGIN
TSK.E (V);
FAILED ("EXCEPTION NOT RAISED AFTER RETURN");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
IF NOT CALLED THEN
FAILED ("EXCEPTION RAISED BEFORE CALL");
END IF;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED");
END;
------------------------------------------------
RESULT;
END C95085L;
| 34.454545 | 79 | 0.516359 |
dc37d563f9b5d0878c16739a3f6534743d3b476b | 10,486 | adb | Ada | .emacs.d/elpa/wisi-2.1.1/wisitoken-bnf.adb | caqg/linux-home | eed631aae6f5e59e4f46e14f1dff443abca5fa28 | [
"Linux-OpenIB"
] | null | null | null | .emacs.d/elpa/wisi-2.1.1/wisitoken-bnf.adb | caqg/linux-home | eed631aae6f5e59e4f46e14f1dff443abca5fa28 | [
"Linux-OpenIB"
] | null | null | null | .emacs.d/elpa/wisi-2.1.1/wisitoken-bnf.adb | caqg/linux-home | eed631aae6f5e59e4f46e14f1dff443abca5fa28 | [
"Linux-OpenIB"
] | null | null | null | -- Abstract :
--
-- see spec
--
-- Copyright (C) 2012 - 2015, 2017 - 2019 Free Software Foundation, Inc.
--
-- This program 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. 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
-- distributed with this program; see file COPYING. If not, write to
-- the Free Software Foundation, 51 Franklin Street, Suite 500, Boston,
-- MA 02110-1335, USA.
pragma License (GPL);
with Ada.Command_Line;
with Ada.Directories;
with Ada.Text_IO;
with Ada.Strings.Fixed;
package body WisiToken.BNF is
procedure Add
(Set : in out Generate_Set_Access;
Tuple : in Generate_Tuple)
is
Prev : Generate_Set_Access := Set;
Last : constant Integer := (if Prev = null then 1 else Prev.all'Length + 1);
begin
Set := new Generate_Set (1 .. Last);
for I in 1 .. Last - 1 loop
Set (I) := Prev (I);
end loop;
Set (Last) := Tuple;
Free (Prev);
end Add;
function To_Generate_Algorithm (Item : in String) return Generate_Algorithm
is begin
for I in Generate_Algorithm loop
if To_Lower (Generate_Algorithm_Image (I).all) = To_Lower (Item) then
return I;
end if;
end loop;
raise User_Error with "invalid generate algorithm name: '" & Item & "'";
end To_Generate_Algorithm;
function To_Output_Language (Item : in String) return Output_Language
is begin
for I in Output_Language loop
if To_Lower (Output_Language_Image (I).all) = To_Lower (Item) then
return I;
end if;
end loop;
raise User_Error with "invalid output language name: '" & Item & "'";
end To_Output_Language;
function To_Lexer (Item : in String) return Lexer_Type
is begin
for I in Valid_Lexer loop
if Lexer_Image (I).all = To_Lower (Item) then
return I;
end if;
end loop;
raise User_Error with "invalid lexer name: '" & Item & "'";
end To_Lexer;
function Split_Lines (Item : in String) return String_Lists.List
is
CR : Character renames ASCII.CR;
LF : Character renames ASCII.LF;
Result : WisiToken.BNF.String_Lists.List;
I : Integer := Item'First;
First : Integer := Item'First;
Last_Char : Character := ' ';
begin
loop
exit when I > Item'Last;
if Item (I) = LF then
Result.Append (Item (First .. I - (if Last_Char = CR then 2 else 1)));
First := I + 1;
elsif I = Item'Last then
Result.Append (Item (First .. I));
end if;
Last_Char := Item (I);
I := I + 1;
end loop;
return Result;
end Split_Lines;
function Trim (Item : in String_Lists.List; Comment_Start : in String) return String_Lists.List
is
use Ada.Strings;
use Ada.Strings.Fixed;
Result : String_Lists.List;
Comment : Integer;
procedure Maybe_Append (Line : in String)
is begin
if Line'Length > 0 then
Result.Append (Line);
end if;
end Maybe_Append;
begin
for Line of Item loop
Comment := Index (Line, Comment_Start, Going => Backward);
if Comment /= 0 then
Maybe_Append (Trim (Line (Line'First .. Comment - 1), Both));
else
Maybe_Append (Trim (Line, Both));
end if;
end loop;
return Result;
end Trim;
procedure Put_Raw_Code
(Comment_Syntax : in String_2;
Code : in String_Lists.List;
Comment_Only : in Boolean := False)
is
use Ada.Text_IO;
Real_Comment_Only : Boolean := Comment_Only;
begin
for Line of Code loop
if Line'Length >= 2 and then
((Line (Line'First) = Line (Line'First + 1)) and
Line (Line'First) /= ' ')
then
-- The line is a comment.
Real_Comment_Only := Real_Comment_Only or Line (Line'First .. Line'First + 1) /= Comment_Syntax;
Put_Line (Comment_Syntax & Line (Line'First + 2 .. Line'Last));
elsif Comment_Syntax = Elisp_Comment and (Line'Length > 0 and then Line (Line'First) /= '(') then
null;
elsif not Comment_Only then
Put_Line (Line);
end if;
end loop;
end Put_Raw_Code;
procedure Put_File_Header
(Comment_Syntax : in String_2;
Emacs_Mode : in String := "";
Use_Tuple : in Boolean := False;
Tuple : in Generate_Tuple := (others => <>))
is
use Ada.Text_IO;
begin
Put_Line (Comment_Syntax & " generated parser support file." & Emacs_Mode);
Put_Command_Line (Comment_Syntax & " ", Use_Tuple, Tuple);
Put_Line (Comment_Syntax);
end Put_File_Header;
function Is_Present (List : in WisiToken.BNF.String_Pair_Lists.List; Name : in String) return Boolean
is
use all type Ada.Strings.Unbounded.Unbounded_String;
begin
for Pair of List loop
if Pair.Name = Name then
return True;
end if;
end loop;
return False;
end Is_Present;
function Value (List : in WisiToken.BNF.String_Pair_Lists.List; Name : in String) return String
is
use all type Ada.Strings.Unbounded.Unbounded_String;
begin
for Pair of List loop
if Pair.Name = Name then
return -Pair.Value;
end if;
end loop;
raise Not_Found;
end Value;
function Is_Present (List : in Elisp_Action_Maps.Map; Name : in String) return Boolean
is
use Elisp_Action_Maps;
begin
return No_Element /= List.Find (+Name);
end Is_Present;
function Count (Tokens : in Token_Lists.List) return Integer
is
Result : Integer := 0;
begin
for Kind of Tokens loop
Result := Result + Integer (Kind.Tokens.Length);
end loop;
return Result;
end Count;
procedure Add_Token
(Tokens : in out Token_Lists.List;
Kind : in String;
Name : in String;
Value : in String)
is
use type Ada.Strings.Unbounded.Unbounded_String;
begin
for Token_Kind of Tokens loop
if Token_Kind.Kind = Kind then
Token_Kind.Tokens.Append ((+Name, +Value));
return;
end if;
end loop;
-- Kind not found; add it
declare
Temp : String_Pair_Lists.List;
begin
Temp.Append ((+Name, +Value));
Tokens.Append ((+Kind, Temp));
end;
end Add_Token;
function Is_In (Tokens : in Token_Lists.List; Kind : in String) return Boolean
is begin
for Token of Tokens loop
if -Token.Kind = Kind then
return True;
end if;
end loop;
return False;
end Is_In;
function Is_In
(Tokens : in Token_Lists.List;
Kind : in String;
Value : in String)
return Boolean
is begin
for Token of Tokens loop
if -Token.Kind = Kind then
for Item of Token.Tokens loop
if -Item.Value = Value then
return True;
end if;
end loop;
end if;
end loop;
return False;
end Is_In;
function Is_Present (Rules : in Rule_Lists.List; LHS : in String) return Boolean
is
use Rule_Lists;
Found : Boolean := False;
procedure Process (Position : in Cursor)
is begin
if -Rules (Position).Left_Hand_Side = LHS then
Found := True;
end if;
end Process;
begin
Rules.Iterate (Process'Access);
return Found;
end Is_Present;
function "+" (List : in String_Lists.List; Item : in String) return String_Lists.List
is
Result : String_Lists.List := List;
begin
Result.Append (Item);
return Result;
end "+";
function String_To_String_List (Item : in String) return String_Lists.List
is
Result : String_Lists.List;
begin
Result.Append (Item);
return Result;
end String_To_String_List;
function RHS_To_RHS_List (Item : in RHS_Type) return RHS_Lists.List
is
Result : RHS_Lists.List;
begin
Result.Append (Item);
return Result;
end RHS_To_RHS_List;
function "+" (List : in RHS_Lists.List; Item : in RHS_Type) return RHS_Lists.List
is
Result : RHS_Lists.List := List;
begin
Result.Append (Item);
return Result;
end "+";
procedure Put_Command_Line
(Comment_Prefix : in String;
Use_Tuple : in Boolean := False;
Tuple : in Generate_Tuple := (others => <>))
is
use Ada.Command_Line;
use Ada.Text_IO;
Max_Line_Length : constant := 120;
Col : Integer := 0;
procedure Put (Item : in String; Leading_Space : in Boolean)
is begin
if Col > 0 and Col + Item'Length + 1 > Max_Line_Length then
New_Line;
Col := Comment_Prefix'Length;
Put (Comment_Prefix);
else
if Leading_Space then
Put (" ");
Col := Col + 1;
end if;
end if;
Col := Col + Item'Length;
Put (Item);
end Put;
begin
Put (Comment_Prefix & "command line:", False);
Put (Ada.Directories.Simple_Name (Command_Name), True);
if Use_Tuple then
Put (" --generate " & Generate_Algorithm'Image (Tuple.Gen_Alg) & " " &
Output_Language_Image (Tuple.Out_Lang).all &
(if Tuple.Lexer /= None then " " & Lexer_Image (Tuple.Lexer).all else "") &
(if Tuple.Interface_Kind /= None then " " & Interface_Type'Image (Tuple.Interface_Kind) else "") &
(if Tuple.Text_Rep then " text_rep" else "") &
" " & Argument (Argument_Count), -- .wy file
True);
else
for I in 1 .. Argument_Count loop
Put (Argument (I), True);
end loop;
end if;
New_Line;
end Put_Command_Line;
end WisiToken.BNF;
| 29.538028 | 114 | 0.591837 |
dc4cb185530866c53dd2d0c6b65d01af440afcc9 | 9,252 | ads | Ada | src/security-policies-roles.ads | jquorning/ada-security | b9aa8e7deffaf71d50d501e284b821b8b0f942c3 | [
"Apache-2.0"
] | 19 | 2015-01-18T23:04:59.000Z | 2021-11-30T10:39:10.000Z | src/security-policies-roles.ads | jquorning/ada-security | b9aa8e7deffaf71d50d501e284b821b8b0f942c3 | [
"Apache-2.0"
] | 4 | 2020-08-06T15:37:51.000Z | 2022-02-04T20:19:39.000Z | src/security-policies-roles.ads | jquorning/ada-security | b9aa8e7deffaf71d50d501e284b821b8b0f942c3 | [
"Apache-2.0"
] | 3 | 2021-01-04T10:23:22.000Z | 2022-01-30T21:45:49.000Z | -----------------------------------------------------------------------
-- security-policies-roles -- Role based policies
-- Copyright (C) 2010, 2011, 2012, 2017, 2018 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- 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;
-- == Role Based Security Policy ==
-- The `Security.Policies.Roles` package implements a role based security policy.
-- In this policy, users are assigned one or several roles and permissions are
-- associated with roles. A permission is granted if the user has one of the roles required
-- by the permission.
--
-- === Policy creation ===
-- An instance of the `Role_Policy` must be created and registered in the policy manager.
-- Get or declare the following variables:
--
-- Manager : Security.Policies.Policy_Manager;
-- Policy : Security.Policies.Roles.Role_Policy_Access;
--
-- Create the role policy and register it in the policy manager as follows:
--
-- Policy := new Role_Policy;
-- Manager.Add_Policy (Policy.all'Access);
--
-- === Policy Configuration ===
-- A role is represented by a name in security configuration files. A role based permission
-- is associated with a list of roles. The permission is granted if the user has one of these
-- roles. When the role based policy is registered in the policy manager, the following
-- XML configuration is used:
--
-- <policy-rules>
-- <security-role>
-- <role-name>admin</role-name>
-- </security-role>
-- <security-role>
-- <role-name>manager</role-name>
-- </security-role>
-- <role-permission>
-- <name>create-workspace</name>
-- <role>admin</role>
-- <role>manager</role>
-- </role-permission>
-- ...
-- </policy-rules>
--
-- This definition declares two roles: `admin` and `manager`
-- It defines a permission `create-workspace` that will be granted if the
-- user has either the `admin` or the `manager` role.
--
-- Each role is identified by a name in the configuration file. It is represented by
-- a `Role_Type`. To provide an efficient implementation, the `Role_Type`
-- is represented as an integer with a limit of 64 different roles.
--
-- === Assigning roles to users ===
-- A `Security_Context` must be associated with a set of roles before checking the
-- permission. This is done by using the `Set_Role_Context` operation:
--
-- Security.Policies.Roles.Set_Role_Context (Security.Contexts.Current, "admin");
--
package Security.Policies.Roles is
NAME : constant String := "Role-Policy";
-- Each role is represented by a <b>Role_Type</b> number to provide a fast
-- and efficient role check.
type Role_Type is new Natural range 0 .. 63;
for Role_Type'Size use 8;
type Role_Type_Array is array (Positive range <>) of Role_Type;
type Role_Name_Array is array (Positive range <>) of Ada.Strings.Unbounded.String_Access;
-- The <b>Role_Map</b> represents a set of roles which are assigned to a user.
-- Each role is represented by a boolean in the map. The implementation is limited
-- to 64 roles (the number of different permissions can be higher).
type Role_Map is array (Role_Type'Range) of Boolean;
pragma Pack (Role_Map);
-- Get the number of roles set in the map.
function Get_Count (Map : in Role_Map) return Natural;
-- Return the list of role names separated by ','.
function To_String (List : in Role_Name_Array) return String;
-- ------------------------------
-- Role principal context
-- ------------------------------
-- The <tt>Role_Principal_Context</tt> interface must be implemented by the user
-- <tt>Principal</tt> to be able to use the role based policy. The role based policy
-- controller will first check that the <tt>Principal</tt> implements that interface.
-- It uses the <tt>Get_Roles</tt> function to get the current roles assigned to the user.
type Role_Principal_Context is limited interface;
function Get_Roles (User : in Role_Principal_Context) return Role_Map is abstract;
-- ------------------------------
-- Policy context
-- ------------------------------
-- The <b>Role_Policy_Context</b> gives security context information that the role
-- based policy can use to verify the permission.
type Role_Policy_Context is new Policy_Context with record
Roles : Role_Map;
end record;
type Role_Policy_Context_Access is access all Role_Policy_Context'Class;
-- Set the roles which are assigned to the user in the security context.
-- The role policy will use these roles to verify a permission.
procedure Set_Role_Context (Context : in out Security.Contexts.Security_Context'Class;
Roles : in Role_Map);
-- Set the roles which are assigned to the user in the security context.
-- The role policy will use these roles to verify a permission.
procedure Set_Role_Context (Context : in out Security.Contexts.Security_Context'Class;
Roles : in String);
-- ------------------------------
-- Role based policy
-- ------------------------------
type Role_Policy is new Policy with private;
type Role_Policy_Access is access all Role_Policy'Class;
Invalid_Name : exception;
-- Get the policy name.
overriding
function Get_Name (From : in Role_Policy) return String;
-- Find the role type associated with the role name identified by <b>Name</b>.
-- Raises <b>Invalid_Name</b> if there is no role type.
function Find_Role (Manager : in Role_Policy;
Name : in String) return Role_Type;
-- Get the role name.
function Get_Role_Name (Manager : in Role_Policy;
Role : in Role_Type) return String;
-- Get the roles that grant the given permission.
function Get_Grants (Manager : in Role_Policy;
Permission : in Permissions.Permission_Index) return Role_Map;
-- Get the list of role names that are defined by the role map.
function Get_Role_Names (Manager : in Role_Policy;
Map : in Role_Map) return Role_Name_Array;
-- Create a role
procedure Create_Role (Manager : in out Role_Policy;
Name : in String;
Role : out Role_Type);
-- Get or add a role type for the given name.
procedure Add_Role_Type (Manager : in out Role_Policy;
Name : in String;
Result : out Role_Type);
-- Set the roles specified in the <tt>Roles</tt> parameter. Each role is represented by
-- its name and multiple roles are separated by ','.
-- Raises Invalid_Name if a role was not found.
procedure Set_Roles (Manager : in Role_Policy;
Roles : in String;
Into : out Role_Map);
-- Setup the XML parser to read the <b>role-permission</b> description.
overriding
procedure Prepare_Config (Policy : in out Role_Policy;
Mapper : in out Util.Serialize.Mappers.Processing);
-- Finalize the policy manager.
overriding
procedure Finalize (Policy : in out Role_Policy);
-- Get the role policy associated with the given policy manager.
-- Returns the role policy instance or null if it was not registered in the policy manager.
function Get_Role_Policy (Manager : in Security.Policies.Policy_Manager'Class)
return Role_Policy_Access;
private
-- Array to map a permission index to a list of roles that are granted the permission.
type Permission_Role_Array is array (Permission_Index) of Role_Map;
type Role_Map_Name_Array is array (Role_Type'Range) of Ada.Strings.Unbounded.String_Access;
type Role_Policy is new Policy with record
Names : Role_Map_Name_Array := (others => null);
Next_Role : Role_Type := Role_Type'First;
Name : Util.Beans.Objects.Object;
Roles : Role_Type_Array (1 .. Integer (Role_Type'Last)) := (others => 0);
Count : Natural := 0;
-- The Grants array indicates for each permission the list of roles
-- that are granted the permission. This array allows a O(1) lookup.
-- The implementation is limited to 256 permissions and 64 roles so this array uses 2K.
-- The default is that no role is assigned to the permission.
Grants : Permission_Role_Array := (others => (others => False));
end record;
end Security.Policies.Roles;
| 43.848341 | 95 | 0.651859 |
4a37aa71a1b66d05d516bbc2b83009f42f6cb53f | 852 | adb | Ada | gdb/testsuite/gdb.ada/small_reg_param/pck.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/small_reg_param/pck.adb | greyblue9/binutils-gdb | 05377632b124fe7600eea7f4ee0e9a35d1b0cbdc | [
"BSD-3-Clause"
] | null | null | null | gdb/testsuite/gdb.ada/small_reg_param/pck.adb | greyblue9/binutils-gdb | 05377632b124fe7600eea7f4ee0e9a35d1b0cbdc | [
"BSD-3-Clause"
] | null | null | null | -- Copyright 2011-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 body Pck is
Last_Word : Word := 0;
procedure Call_Me (W : Word) is
begin
Last_Word := W;
end Call_Me;
end Pck;
| 37.043478 | 73 | 0.71831 |
dcf584efcfd09373409a95374c7b612d1844f1aa | 15,167 | adb | Ada | runtime/ravenscar-sfp-stm32f427/gnarl-common/s-bbbosu.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 12 | 2017-06-08T14:19:57.000Z | 2022-03-09T02:48:59.000Z | runtime/ravenscar-sfp-stm32f427/gnarl-common/s-bbbosu.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 6 | 2017-06-08T13:13:50.000Z | 2020-05-15T09:32:43.000Z | runtime/ravenscar-sfp-stm32f427/gnarl-common/s-bbbosu.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 3 | 2017-06-30T14:05:06.000Z | 2022-02-17T12:20:45.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . B B . B O A R D _ S U P P O R T --
-- --
-- B o d y --
-- --
-- Copyright (C) 1999-2002 Universidad Politecnica de Madrid --
-- Copyright (C) 2003-2005 The European Space Agency --
-- Copyright (C) 2003-2016, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
-- The port of GNARL to bare board targets was initially developed by the --
-- Real-Time Systems Group at the Technical University of Madrid. --
-- --
------------------------------------------------------------------------------
with System.Machine_Code;
with System.BB.Parameters; use System.BB.Parameters;
package body System.BB.Board_Support is
use CPU_Primitives, Interrupts, Machine_Code;
Sys_Tick_Vector : constant Vector_Id := 15;
Interrupt_Request_Vector : constant Vector_Id := 16;
-- See vector definitions in ARMv7-M version of System.BB.CPU_Primitives.
-- Defined by ARMv7-M specifications.
First_IRQ : constant Interrupt_ID := 2;
-- This corresponds to the first IRQ number (handled by the NVIC). This
-- offset is present so that the Sys_Tick exception can be handled like
-- other interrupts, and because interrupt id 0 is reserved.
Alarm_Time : Timer_Interval;
pragma Volatile (Alarm_Time);
pragma Export (C, Alarm_Time, "__gnat_alarm_time");
---------------------------
-- System control and ID --
---------------------------
ICSR : Word with Volatile, Address => 16#E000_ED04#;
-- Interrupt Control State (part of the System Control Block - SCB)
ICSR_Pend_ST_Set : constant := 2**26; -- Set pending Sys_Tick (RW)
ICSR_Pend_ST_Clr : constant := 2**25; -- Clear pending Sys_Tick (W)
-----------------------
-- Sys_Tick Handling --
-----------------------
-- We use the Sys_Tick timer as a periodic timer with 1 kHz rate. This
-- is a trade-off between accurate delays, limited overhead and maximum
-- time that interrupts may be disabled.
Tick_Period : constant Timer_Interval := Clock_Frequency / 1000;
type Sys_Tick_Registers is record
SYST_CSR : Word;
SYST_RVR : Word;
SYST_CVR : Word;
SYST_CALIB : Word;
end record;
CSR_Count_Flag : constant := 2**16;
CSR_Clk_Source : constant := 2**2;
CSR_Tick_Int : constant := 2**1;
CSR_Enable : constant := 2**0;
RVR_Last : constant := 2**24 - 1;
pragma Assert (Tick_Period <= RVR_Last + 1);
SYST : Sys_Tick_Registers with Volatile, Address => 16#E000_E010#;
-- SysTick control and status register (Part of SYST).
Next_Tick_Time : Timer_Interval with Volatile;
-- Time when systick will expire. This gives the high digits of the time
----------------------------------------------
-- New Vectored Interrupt Controller (NVIC) --
----------------------------------------------
NVIC_Base : constant := 16#E000_E000#;
-- Nested Vectored Interrupt Controller (NVIC) base.
NVIC_ISER0 : constant Address := NVIC_Base + 16#100#;
-- Writing a bit mask to this register enables the corresponding interrupts
type PRI is mod 2**8;
-- Type for ARMv7-M interrupt priorities. Note that 0 is the highest
-- priority, which is reserved for the kernel and has no corresponding
-- Interrupt_Priority value, and 255 is the lowest. We assume the PRIGROUP
-- setting is such that the 4 most significant bits determine the priority
-- group used for preemption. However, if less bits are implemented, this
-- should still work.
function To_PRI (P : Integer) return PRI is
(if P not in Interrupt_Priority then 0
else PRI (Interrupt_Priority'Last - P + 1) * 16);
-- Return the BASEPRI mask for the given Ada priority. Note that the zero
-- value here means no mask, so no interrupts are masked.
function To_Priority (P : PRI) return Interrupt_Priority is
(if P = 0 then Interrupt_Priority'Last
else (Interrupt_Priority'Last - Any_Priority'Base (P / 16) + 1));
-- Given an ARM interrupt priority (PRI value), determine the Ada priority
-- While the value 0 is reserved for the kernel and has no Ada priority
-- that represents it, Interrupt_Priority'Last is closest.
IP : array (Interrupt_ID) of PRI with Volatile, Address => 16#E000_E400#;
-- Local utility functions
procedure Enable_Interrupt_Request
(Interrupt : Interrupt_ID;
Prio : Interrupt_Priority);
-- Enable interrupt requests for the given interrupt
----------------------
-- Initialize_Board --
----------------------
procedure Initialize_Board is
begin
-- Mask interrupts
Disable_Interrupts;
-- Because we operate the SysTick clock as a periodic timer, and 24 bits
-- at 168 MHz is sufficient for that, use the unscaled system clock.
-- To initialize the Sys_Tick timer, first disable the clock, then
-- program it and finally enable it. This way an accidentally
-- misconfigured timer will not cause pending interrupt while
-- reprogramming.
SYST.SYST_CSR := CSR_Clk_Source; -- disable clock
SYST.SYST_RVR := Word (Tick_Period - 1);
SYST.SYST_CVR := 0;
SYST.SYST_CSR := CSR_Clk_Source or CSR_Enable;
Next_Tick_Time := Tick_Period;
Set_Alarm (Timer_Interval'Last);
Clear_Alarm_Interrupt;
Enable_Interrupts (Priority'Last);
end Initialize_Board;
------------------------
-- Max_Timer_Interval --
------------------------
function Max_Timer_Interval return Timer_Interval is (2**32 - 1);
----------------
-- Read_Clock --
----------------
function Read_Clock return Timer_Interval is
PRIMASK : Word;
Flag : Boolean;
Count : Timer_Interval;
Res : Timer_Interval;
begin
-- As several registers and variables need to be read or modified, do
-- it atomically.
Asm ("mrs %0, PRIMASK",
Outputs => Word'Asm_Output ("=&r", PRIMASK),
Volatile => True);
Asm ("msr PRIMASK, %0",
Inputs => Word'Asm_Input ("r", 1),
Volatile => True);
-- We must read the counter register before the flag
Count := Timer_Interval (SYST.SYST_CVR);
-- If we read the flag first, a reload can occur just after the read and
-- the count register would wrap around. We'd end up with a Count value
-- close to the Tick_Period value but a flag at zero and therefore miss
-- the reload and return a wrong clock value.
-- This flag is set when the counter has reached zero. Next_Tick_Time
-- has to be incremented. This will trigger an interrupt very soon (or
-- has just triggered the interrupt), so count is either zero or not far
-- from Tick_Period.
Flag := (SYST.SYST_CSR and CSR_Count_Flag) /= 0;
if Flag then
-- Systick counter has just reached zero, pretend it is still zero
-- This function is called by the interrupt handler that is executed
-- when the counter reaches zero. Therefore, we signal that the next
-- interrupt will happen within a period. Note that reading the
-- Control and Status register (SYST_CSR) clears the COUNTFLAG bit,
-- so even if we have sequential calls to this function, the
-- increment of Next_Tick_Time will happen only once.
Res := Next_Tick_Time;
Next_Tick_Time := Next_Tick_Time + Tick_Period;
else
-- The counter is decremented, so compute the actual time
Res := Next_Tick_Time - Count;
end if;
-- Restore interrupt mask
Asm ("msr PRIMASK, %0",
Inputs => Word'Asm_Input ("r", PRIMASK),
Volatile => True);
return Res;
end Read_Clock;
---------------------------
-- Clear_Alarm_Interrupt --
---------------------------
procedure Clear_Alarm_Interrupt is
begin
ICSR := ICSR_Pend_ST_Clr;
end Clear_Alarm_Interrupt;
--------------------------
-- Clear_Poke_Interrupt --
--------------------------
procedure Clear_Poke_Interrupt is
begin
null;
end Clear_Poke_Interrupt;
---------------
-- Set_Alarm --
---------------
procedure Set_Alarm (Ticks : Timer_Interval) is
Now : constant Timer_Interval := Read_Clock;
begin
-- As we will have periodic interrupts for alarms regardless, the only
-- thing to do is force an interrupt if the alarm has already expired.
Alarm_Time := Now + Timer_Interval'Min (Timer_Interval'Last / 2, Ticks);
if Ticks = 0 then
ICSR := ICSR_Pend_ST_Set;
end if;
end Set_Alarm;
------------------------
-- Alarm_Interrupt_ID --
------------------------
function Alarm_Interrupt_ID return Interrupt_ID is (1);
-- Return the interrupt level to use for the alarm clock handler. Note that
-- we use a "fake" Interrupt_ID for the alarm interrupt, as it is handled
-- specially (not through the NVIC).
-----------------------
-- Poke_Interrupt_ID --
-----------------------
function Poke_Interrupt_ID return Interrupt_ID is (No_Interrupt);
---------------------------
-- Get_Interrupt_Request --
---------------------------
function Get_Interrupt_Request
(Vector : Vector_Id) return Interrupt_ID
is
Res : Word;
begin
if Vector = Sys_Tick_Vector then
return Alarm_Interrupt_ID;
end if;
Asm ("mrs %0, ipsr",
Word'Asm_Output ("=r", Res),
Volatile => True);
Res := Res and 16#FF#;
-- The exception number is read from the IPSR, convert it to IRQ
-- number by substracting 16 (number of cpu exceptions) and then
-- convert it to GNAT interrupt_id by adding First_IRQ.
return Interrupt_ID'Base (Res) - 16 + First_IRQ;
end Get_Interrupt_Request;
------------------------------
-- Enable_Interrupt_Request --
------------------------------
procedure Enable_Interrupt_Request
(Interrupt : Interrupt_ID;
Prio : Interrupt_Priority)
is
begin
if Interrupt = Alarm_Interrupt_ID then
-- Consistency check with Priority_Of_Interrupt
pragma Assert (Prio = Interrupt_Priority'Last);
Clear_Alarm_Interrupt;
SYST.SYST_CSR := SYST.SYST_CSR or CSR_Tick_Int;
else
declare
pragma Assert (Interrupt >= First_IRQ);
IRQ : constant Natural := Interrupt - First_IRQ;
Regofs : constant Natural := IRQ / 32;
Regbit : constant Word := 2** (IRQ mod 32);
NVIC_ISER : array (0 .. 15) of Word
with Volatile, Address => NVIC_ISER0;
-- Many NVIC registers use 16 words of 32 bits each to serve as a
-- bitmap for all interrupt channels. Regofs indicates register
-- offset (0 .. 15), and Regbit indicates the mask required for
-- addressing the bit.
begin
NVIC_ISER (Regofs) := Regbit;
end;
end if;
end Enable_Interrupt_Request;
-------------------------------
-- Install_Interrupt_Handler --
-------------------------------
procedure Install_Interrupt_Handler
(Handler : Address;
Interrupt : Interrupts.Interrupt_ID;
Prio : Interrupt_Priority)
is
begin
if Interrupt = Alarm_Interrupt_ID then
Install_Trap_Handler (Handler, Sys_Tick_Vector);
else
IP (Interrupt - First_IRQ) := To_PRI (Prio);
Install_Trap_Handler (Handler, Interrupt_Request_Vector);
end if;
Enable_Interrupt_Request (Interrupt, Prio);
end Install_Interrupt_Handler;
---------------------------
-- Priority_Of_Interrupt --
---------------------------
function Priority_Of_Interrupt
(Interrupt : Interrupt_ID) return Any_Priority
is
-- Interrupt 2 .. 83 correspond to IRQ0 .. IRQ81
(if Interrupt = Alarm_Interrupt_ID then Interrupt_Priority'Last
else To_Priority (IP (Interrupt - First_IRQ)));
----------------
-- Power_Down --
----------------
procedure Power_Down is
begin
Asm ("wfi", Volatile => True);
end Power_Down;
-----------------------------
-- Clear_Interrupt_Request --
-----------------------------
procedure Clear_Interrupt_Request (Interrupt : Interrupts.Interrupt_ID)
is null;
--------------------------
-- Set_Current_Priority --
--------------------------
procedure Set_Current_Priority (Priority : Integer) is
begin
-- Writing a 0 to BASEPRI disables interrupt masking, while values
-- 15 .. 1 correspond to interrupt priorities 255 .. 241 in that order.
Asm ("msr BASEPRI, %0",
Inputs => PRI'Asm_Input ("r", To_PRI (Priority)),
Volatile => True);
end Set_Current_Priority;
end System.BB.Board_Support;
| 36.284689 | 79 | 0.553241 |
4accf88a95535aa2b332eebf415097a4ca2bd905 | 3,112 | ads | Ada | tools-src/gnu/gcc/gcc/ada/g-cgideb.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/g-cgideb.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/g-cgideb.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 69 | 2015-01-02T10:45:56.000Z | 2021-09-06T07:52:13.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . C G I . D E B U G --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 2000 Ada Core Technologies, 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 is maintained by Ada Core Technologies Inc (http://www.gnat.com). --
-- --
------------------------------------------------------------------------------
-- This is a package to help debugging CGI (Common Gateway Interface)
-- programs written in Ada.
package GNAT.CGI.Debug is
-- Both functions below output all possible CGI parameters set. These
-- are the form field and all CGI environment variables which make the
-- CGI environment at runtime.
function Text_Output return String;
-- Returns a plain text version of the CGI runtime environment
function HTML_Output return String;
-- Returns an HTML version of the CGI runtime environment
end GNAT.CGI.Debug;
| 61.019608 | 78 | 0.439589 |
c5d6800c3132f9f45600adcad92d53ebb387b432 | 1,299 | adb | Ada | day02/tests/day-test.adb | jwarwick/aoc_2020 | b88e5a69f7ce035c4bc0a2474e0e0cdbb7b43377 | [
"MIT"
] | 3 | 2020-12-26T23:44:33.000Z | 2021-12-06T16:00:54.000Z | day02/tests/day-test.adb | jwarwick/aoc_2020 | b88e5a69f7ce035c4bc0a2474e0e0cdbb7b43377 | [
"MIT"
] | null | null | null | day02/tests/day-test.adb | jwarwick/aoc_2020 | b88e5a69f7ce035c4bc0a2474e0e0cdbb7b43377 | [
"MIT"
] | null | null | null | with AUnit.Assertions; use AUnit.Assertions;
with Ada.Containers; use Ada.Containers;
package body Day.Test is
procedure Test_Part1 (T : in out AUnit.Test_Cases.Test_Case'Class) is
pragma Unreferenced (T);
passwords : constant Password_Vector.Vector := load_passwords("test1.txt");
count : constant Count_Type := count_valid(passwords);
begin
Assert(count = 2, "Wrong valid password count, expected 2, got " & Count_Type'IMAGE(count));
end Test_Part1;
procedure Test_Part2 (T : in out AUnit.Test_Cases.Test_Case'Class) is
pragma Unreferenced (T);
passwords : constant Password_Vector.Vector := load_passwords("test1.txt");
count : constant Count_Type := count_valid_positions(passwords);
begin
Assert(count = 1, "Wrong valid password position count, expected 1, got " & Count_Type'IMAGE(count));
end Test_Part2;
function Name (T : Test) return AUnit.Message_String is
pragma Unreferenced (T);
begin
return AUnit.Format ("Test Day package");
end Name;
procedure Register_Tests (T : in out Test) is
use AUnit.Test_Cases.Registration;
begin
Register_Routine (T, Test_Part1'Access, "Test Part 1");
Register_Routine (T, Test_Part2'Access, "Test Part 2");
end Register_Tests;
end Day.Test;
| 36.083333 | 106 | 0.709007 |
d0c230d1f285e646c11be595dbccd212cb216352 | 5,577 | ads | Ada | llvm-gcc-4.2-2.9/gcc/ada/s-tasdeb.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-tasdeb.ads | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | llvm-gcc-4.2-2.9/gcc/ada/s-tasdeb.ads | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T A S K I N G . D E B U G --
-- --
-- S p e c --
-- --
-- Copyright (C) 1997-2005, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This package encapsulates all direct interfaces to task debugging services
-- that are needed by gdb with gnat mode.
with System.Tasking;
with System.OS_Interface;
package System.Tasking.Debug is
pragma Preelaborate;
------------------------------------------
-- Application-level debugging routines --
------------------------------------------
procedure List_Tasks;
-- Print a list of all the known Ada tasks with abbreviated state
-- information, one-per-line, to the standard error file.
procedure Print_Current_Task;
-- Write information about current task, in hexadecimal, as one line, to
-- the standard error file.
procedure Print_Task_Info (T : Task_Id);
-- Similar to Print_Current_Task, for a given task.
procedure Set_User_State (Value : Long_Integer);
-- Set user state value in the current task.
-- This state will be displayed when calling List_Tasks or
-- Print_Current_Task. It is useful for setting task specific state.
function Get_User_State return Long_Integer;
-- Return the user state for the current task.
-------------------------
-- General GDB support --
-------------------------
Known_Tasks : array (0 .. 999) of Task_Id := (others => null);
-- Global array of tasks read by gdb, and updated by
-- Create_Task and Finalize_TCB
----------------------------------
-- VxWorks specific GDB support --
----------------------------------
-- Although the following routines are implemented in a target independent
-- manner, only VxWorks currently uses them.
procedure Task_Creation_Hook (Thread : OS_Interface.Thread_Id);
-- This procedure is used to notify GDB of task's creation.
-- It must be called by the task's creator.
procedure Task_Termination_Hook;
-- This procedure is used to notify GDB of task's termination.
procedure Suspend_All_Tasks (Thread_Self : OS_Interface.Thread_Id);
-- Suspend all the tasks except the one whose associated thread is
-- Thread_Self by traversing All_Tasks_Lists and calling
-- System.Task_Primitives.Operations.Suspend_Task.
procedure Resume_All_Tasks (Thread_Self : OS_Interface.Thread_Id);
-- Resume all the tasks except the one whose associated thread is
-- Thread_Self by traversing All_Tasks_Lists and calling
-- System.Task_Primitives.Operations.Continue_Task.
-------------------------------
-- Run-time tracing routines --
-------------------------------
procedure Trace
(Self_Id : Task_Id;
Msg : String;
Flag : Character;
Other_Id : Task_Id := null);
-- If traces for Flag are enabled, display on Standard_Error a given
-- message for the current task. Other_Id is an optional second task id
-- to display.
procedure Set_Trace
(Flag : Character;
Value : Boolean := True);
-- Enable or disable tracing for Flag.
-- By default, flags in the range 'A' .. 'Z' are disabled, others are
-- enabled.
end System.Tasking.Debug;
| 46.865546 | 78 | 0.539896 |
dccfdd240cd70251c2e72b15051c5a686686caff | 2,496 | ads | Ada | tools/xml2ayacc/encoding/auto/encodings-maps-iso_8859_15.ads | faelys/gela-asis | 48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253 | [
"BSD-3-Clause"
] | 4 | 2016-02-05T15:51:56.000Z | 2022-03-25T20:38:32.000Z | tools/xml2ayacc/encoding/auto/encodings-maps-iso_8859_15.ads | faelys/gela-asis | 48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253 | [
"BSD-3-Clause"
] | null | null | null | tools/xml2ayacc/encoding/auto/encodings-maps-iso_8859_15.ads | faelys/gela-asis | 48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253 | [
"BSD-3-Clause"
] | null | null | null | -- Auto generated file. Don't edit
-- Read copyright and license at the end of this file
package Encodings.Maps.ISO_8859_15 is
function Decode (Char : Character) return Wide_Character;
pragma Inline (Decode);
procedure Encode
(Text : in Wide_String;
Text_Last : out Natural;
Result : out Raw_String;
Result_Last : out Natural;
Map : in Encoding := Encodings.ISO_8859_15);
procedure Decode
(Text : in Raw_String;
Text_Last : out Natural;
Result : out Wide_String;
Result_Last : out Natural;
Map : in Encoding := Encodings.ISO_8859_15);
end Encodings.Maps.ISO_8859_15;
------------------------------------------------------------------------------
-- Copyright (c) 2006-2013, Maxim Reznik
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- * Neither the name of the Maxim Reznik, IE nor the names of its
-- contributors may be used to endorse or promote products derived from
-- this software without specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
| 46.222222 | 79 | 0.660657 |
4acabd8b0838594285645520d86db567c1c197ba | 199 | ada | Ada | Task/Percentage-difference-between-images/Ada/percentage-difference-between-images-2.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:38.000Z | 2018-11-09T22:08:38.000Z | Task/Percentage-difference-between-images/Ada/percentage-difference-between-images-2.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | null | null | null | Task/Percentage-difference-between-images/Ada/percentage-difference-between-images-2.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:40.000Z | 2018-11-09T22:08:40.000Z | function "-" (Left, Right : Luminance) return Count is
begin
if Left > Right then
return Count (Left) - Count (Right);
else
return Count (Right) - Count (Left);
end if;
end "-";
| 22.111111 | 54 | 0.60804 |
183c5b83f60e6f8f94abf630e1facbfe677bd4cf | 29,731 | ads | Ada | gcc-gcc-7_3_0-release/gcc/ada/s-osinte-gnu.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/ada/s-osinte-gnu.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/ada/s-osinte-gnu.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | ------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . O S _ I N T E R F A C E --
-- --
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This is the GNU/Hurd (POSIX Threads) version of this package
-- This package encapsulates all direct interfaces to OS services
-- that are needed by children of System.
-- PLEASE DO NOT add any with-clauses to this package or remove the pragma
-- Preelaborate. This package is designed to be a bottom-level (leaf) package
with Interfaces.C;
with Unchecked_Conversion;
package System.OS_Interface is
pragma Preelaborate;
pragma Linker_Options ("-lpthread");
pragma Linker_Options ("-lrt");
subtype int is Interfaces.C.int;
subtype char is Interfaces.C.char;
subtype short is Interfaces.C.short;
subtype long is Interfaces.C.long;
subtype unsigned is Interfaces.C.unsigned;
subtype unsigned_short is Interfaces.C.unsigned_short;
subtype unsigned_long is Interfaces.C.unsigned_long;
subtype unsigned_char is Interfaces.C.unsigned_char;
subtype plain_char is Interfaces.C.plain_char;
subtype size_t is Interfaces.C.size_t;
-----------
-- Errno --
-----------
-- From /usr/include/i386-gnu/bits/errno.h
function errno return int;
pragma Import (C, errno, "__get_errno");
EAGAIN : constant := 1073741859;
EINTR : constant := 1073741828;
EINVAL : constant := 1073741846;
ENOMEM : constant := 1073741836;
EPERM : constant := 1073741825;
ETIMEDOUT : constant := 1073741884;
-------------
-- Signals --
-------------
-- From /usr/include/i386-gnu/bits/signum.h
Max_Interrupt : constant := 32;
type Signal is new int range 0 .. Max_Interrupt;
for Signal'Size use int'Size;
SIGHUP : constant := 1; -- hangup
SIGINT : constant := 2; -- interrupt (rubout)
SIGQUIT : constant := 3; -- quit (ASCD FS)
SIGILL : constant := 4; -- illegal instruction (not reset)
SIGTRAP : constant := 5; -- trace trap (not reset)
SIGIOT : constant := 6; -- IOT instruction
SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
SIGEMT : constant := 7; -- EMT instruction
SIGFPE : constant := 8; -- floating point exception
SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
SIGBUS : constant := 10; -- bus error
SIGSEGV : constant := 11; -- segmentation violation
SIGSYS : constant := 12; -- bad argument to system call
SIGPIPE : constant := 13; -- write on a pipe with no one to read it
SIGALRM : constant := 14; -- alarm clock
SIGTERM : constant := 15; -- software termination signal from kill
SIGURG : constant := 16; -- urgent condition on IO channel
SIGSTOP : constant := 17; -- stop (cannot be caught or ignored)
SIGTSTP : constant := 18; -- user stop requested from tty
SIGCONT : constant := 19; -- stopped process has been continued
SIGCLD : constant := 20; -- alias for SIGCHLD
SIGCHLD : constant := 20; -- child status change
SIGTTIN : constant := 21; -- background tty read attempted
SIGTTOU : constant := 22; -- background tty write attempted
SIGIO : constant := 23; -- I/O possible (Solaris SIGPOLL alias)
SIGPOLL : constant := 23; -- I/O possible (same as SIGIO?)
SIGXCPU : constant := 24; -- CPU time limit exceeded
SIGXFSZ : constant := 25; -- filesize limit exceeded
SIGVTALRM : constant := 26; -- virtual timer expired
SIGPROF : constant := 27; -- profiling timer expired
SIGWINCH : constant := 28; -- window size change
SIGINFO : constant := 29; -- information request (NetBSD/FreeBSD)
SIGUSR1 : constant := 30; -- user defined signal 1
SIGUSR2 : constant := 31; -- user defined signal 2
SIGLOST : constant := 32; -- Resource lost (Sun); server died (GNU)
SIGADAABORT : constant := SIGABRT;
-- Change this if you want to use another signal for task abort.
-- SIGTERM might be a good one.
type Signal_Set is array (Natural range <>) of Signal;
Unmasked : constant Signal_Set := (
SIGTRAP,
-- To enable debugging on multithreaded applications, mark SIGTRAP to
-- be kept unmasked.
SIGBUS,
SIGTTIN, SIGTTOU, SIGTSTP,
-- Keep these three signals unmasked so that background processes
-- and IO behaves as normal "C" applications
SIGPROF,
-- To avoid confusing the profiler
SIGKILL, SIGSTOP);
-- These two signals actually cannot be masked;
-- POSIX simply won't allow it.
Reserved : constant Signal_Set :=
-- I am not sure why the following signal is reserved.
-- I guess they are not supported by this version of GNU/Hurd.
(0 .. 0 => SIGVTALRM);
type sigset_t is private;
-- From /usr/include/signal.h /usr/include/i386-gnu/bits/sigset.h
function sigaddset (set : access sigset_t; sig : Signal) return int;
pragma Import (C, sigaddset, "sigaddset");
function sigdelset (set : access sigset_t; sig : Signal) return int;
pragma Import (C, sigdelset, "sigdelset");
function sigfillset (set : access sigset_t) return int;
pragma Import (C, sigfillset, "sigfillset");
function sigismember (set : access sigset_t; sig : Signal) return int;
pragma Import (C, sigismember, "sigismember");
function sigemptyset (set : access sigset_t) return int;
pragma Import (C, sigemptyset, "sigemptyset");
-- sigcontext is architecture dependent, so define it private
type struct_sigcontext is private;
-- From /usr/include/i386-gnu/bits/sigaction.h: Note: arg. order differs
type struct_sigaction is record
sa_handler : System.Address;
sa_mask : sigset_t;
sa_flags : int;
end record;
pragma Convention (C, struct_sigaction);
type struct_sigaction_ptr is access all struct_sigaction;
-- From /usr/include/i386-gnu/bits/sigaction.h
SIG_BLOCK : constant := 1;
SIG_UNBLOCK : constant := 2;
SIG_SETMASK : constant := 3;
-- From /usr/include/i386-gnu/bits/signum.h
SIG_ERR : constant := 1;
SIG_DFL : constant := 0;
SIG_IGN : constant := 1;
SIG_HOLD : constant := 2;
-- From /usr/include/i386-gnu/bits/sigaction.h
SA_SIGINFO : constant := 16#0040#;
SA_ONSTACK : constant := 16#0001#;
function sigaction
(sig : Signal;
act : struct_sigaction_ptr;
oact : struct_sigaction_ptr) return int;
pragma Import (C, sigaction, "sigaction");
----------
-- Time --
----------
Time_Slice_Supported : constant Boolean := True;
-- Indicates whether time slicing is supported (i.e SCHED_RR is supported)
type timespec is private;
function nanosleep (rqtp, rmtp : access timespec) return int;
pragma Import (C, nanosleep, "nanosleep");
type clockid_t is new int;
CLOCK_REALTIME : constant clockid_t := 0;
-- From: /usr/include/time.h
function clock_gettime
(clock_id : clockid_t;
tp : access timespec)
return int;
pragma Import (C, clock_gettime, "clock_gettime");
function clock_getres
(clock_id : clockid_t;
res : access timespec) return int;
pragma Import (C, clock_getres, "clock_getres");
function To_Duration (TS : timespec) return Duration;
pragma Inline (To_Duration);
function To_Timespec (D : Duration) return timespec;
pragma Inline (To_Timespec);
-- From: /usr/include/unistd.h
function sysconf (name : int) return long;
pragma Import (C, sysconf);
-- From /usr/include/i386-gnu/bits/confname.h
SC_CLK_TCK : constant := 2;
SC_NPROCESSORS_ONLN : constant := 84;
-------------------------
-- Priority Scheduling --
-------------------------
-- From /usr/include/i386-gnu/bits/sched.h
SCHED_OTHER : constant := 0;
SCHED_FIFO : constant := 1;
SCHED_RR : constant := 2;
function To_Target_Priority
(Prio : System.Any_Priority) return Interfaces.C.int;
-- Maps System.Any_Priority to a POSIX priority.
-------------
-- Process --
-------------
type pid_t is private;
-- From: /usr/include/signal.h
function kill (pid : pid_t; sig : Signal) return int;
pragma Import (C, kill, "kill");
-- From: /usr/include/unistd.h
function getpid return pid_t;
pragma Import (C, getpid, "getpid");
---------
-- LWP --
---------
-- From: /usr/include/pthread/pthread.h
function lwp_self return System.Address;
-- lwp_self does not exist on this thread library, revert to pthread_self
-- which is the closest approximation (with getpid). This function is
-- needed to share 7staprop.adb across POSIX-like targets.
pragma Import (C, lwp_self, "pthread_self");
-------------
-- Threads --
-------------
type Thread_Body is access
function (arg : System.Address) return System.Address;
pragma Convention (C, Thread_Body);
function Thread_Body_Access is new
Unchecked_Conversion (System.Address, Thread_Body);
-- From: /usr/include/bits/pthread.h:typedef int __pthread_t;
-- /usr/include/pthread/pthreadtypes.h:typedef __pthread_t pthread_t;
type pthread_t is new unsigned_long;
subtype Thread_Id is pthread_t;
function To_pthread_t is new Unchecked_Conversion
(unsigned_long, pthread_t);
type pthread_mutex_t is limited private;
type pthread_rwlock_t is limited private;
type pthread_cond_t is limited private;
type pthread_attr_t is limited private;
type pthread_mutexattr_t is limited private;
type pthread_rwlockattr_t is limited private;
type pthread_condattr_t is limited private;
type pthread_key_t is private;
-- From /usr/include/pthread/pthreadtypes.h
PTHREAD_CREATE_DETACHED : constant := 1;
PTHREAD_CREATE_JOINABLE : constant := 0;
PTHREAD_SCOPE_PROCESS : constant := 1;
PTHREAD_SCOPE_SYSTEM : constant := 0;
-----------
-- Stack --
-----------
-- From: /usr/include/i386-gnu/bits/sigstack.h
type stack_t is record
ss_sp : System.Address;
ss_size : size_t;
ss_flags : int;
end record;
pragma Convention (C, stack_t);
function sigaltstack
(ss : not null access stack_t;
oss : access stack_t) return int;
pragma Import (C, sigaltstack, "sigaltstack");
Alternate_Stack : aliased System.Address;
-- This is a dummy definition, never used (Alternate_Stack_Size is null)
Alternate_Stack_Size : constant := 0;
-- No alternate signal stack is used on this platform
Stack_Base_Available : constant Boolean := False;
-- Indicates whether the stack base is available on this target
function Get_Stack_Base (thread : pthread_t) return Address;
pragma Inline (Get_Stack_Base);
-- returns the stack base of the specified thread. Only call this function
-- when Stack_Base_Available is True.
-- From: /usr/include/i386-gnu/bits/shm.h
function Get_Page_Size return int;
pragma Import (C, Get_Page_Size, "getpagesize");
-- Returns the size of a page
-- From /usr/include/i386-gnu/bits/mman.h
PROT_NONE : constant := 0;
PROT_READ : constant := 4;
PROT_WRITE : constant := 2;
PROT_EXEC : constant := 1;
PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC;
PROT_ON : constant := PROT_NONE;
PROT_OFF : constant := PROT_ALL;
-- From /usr/include/i386-gnu/bits/mman.h
function mprotect (addr : Address; len : size_t; prot : int) return int;
pragma Import (C, mprotect);
---------------------------------------
-- Nonstandard Thread Initialization --
---------------------------------------
procedure pthread_init;
pragma Inline (pthread_init);
-- This is a dummy procedure to share some GNULLI files
-------------------------
-- POSIX.1c Section 3 --
-------------------------
-- From: /usr/include/signal.h:
-- sigwait (__const sigset_t *__restrict __set, int *__restrict __sig)
function sigwait (set : access sigset_t; sig : access Signal) return int;
pragma Import (C, sigwait, "sigwait");
-- From: /usr/include/pthread/pthread.h:
-- extern int pthread_kill (pthread_t thread, int signo);
function pthread_kill (thread : pthread_t; sig : Signal) return int;
pragma Import (C, pthread_kill, "pthread_kill");
-- From: /usr/include/i386-gnu/bits/sigthread.h
-- extern int pthread_sigmask (int __how, __const __sigset_t *__newmask,
-- __sigset_t *__oldmask) __THROW;
function pthread_sigmask
(how : int;
set : access sigset_t;
oset : access sigset_t) return int;
pragma Import (C, pthread_sigmask, "pthread_sigmask");
--------------------------
-- POSIX.1c Section 11 --
--------------------------
-- From: /usr/include/pthread/pthread.h and
-- /usr/include/pthread/pthreadtypes.h
function pthread_mutexattr_init
(attr : access pthread_mutexattr_t) return int;
pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
function pthread_mutexattr_destroy
(attr : access pthread_mutexattr_t) return int;
pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
function pthread_mutex_init
(mutex : access pthread_mutex_t;
attr : access pthread_mutexattr_t) return int;
pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int;
pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
function pthread_mutex_lock (mutex : access pthread_mutex_t) return int;
pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock");
function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock");
function pthread_rwlockattr_init
(attr : access pthread_rwlockattr_t) return int;
pragma Import (C, pthread_rwlockattr_init, "pthread_rwlockattr_init");
function pthread_rwlockattr_destroy
(attr : access pthread_rwlockattr_t) return int;
pragma Import (C, pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy");
PTHREAD_RWLOCK_PREFER_READER_NP : constant := 0;
PTHREAD_RWLOCK_PREFER_WRITER_NP : constant := 1;
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP : constant := 2;
function pthread_rwlockattr_setkind_np
(attr : access pthread_rwlockattr_t;
pref : int) return int;
pragma Import
(C, pthread_rwlockattr_setkind_np, "pthread_rwlockattr_setkind_np");
function pthread_rwlock_init
(mutex : access pthread_rwlock_t;
attr : access pthread_rwlockattr_t) return int;
pragma Import (C, pthread_rwlock_init, "pthread_rwlock_init");
function pthread_rwlock_destroy
(mutex : access pthread_rwlock_t) return int;
pragma Import (C, pthread_rwlock_destroy, "pthread_rwlock_destroy");
function pthread_rwlock_rdlock (mutex : access pthread_rwlock_t) return int;
pragma Import (C, pthread_rwlock_rdlock, "pthread_rwlock_rdlock");
function pthread_rwlock_wrlock (mutex : access pthread_rwlock_t) return int;
pragma Import (C, pthread_rwlock_wrlock, "pthread_rwlock_wrlock");
function pthread_rwlock_unlock (mutex : access pthread_rwlock_t) return int;
pragma Import (C, pthread_rwlock_unlock, "pthread_rwlock_unlock");
function pthread_condattr_init
(attr : access pthread_condattr_t) return int;
pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
function pthread_condattr_destroy
(attr : access pthread_condattr_t) return int;
pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
function pthread_cond_init
(cond : access pthread_cond_t;
attr : access pthread_condattr_t) return int;
pragma Import (C, pthread_cond_init, "pthread_cond_init");
function pthread_cond_destroy (cond : access pthread_cond_t) return int;
pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
function pthread_cond_signal (cond : access pthread_cond_t) return int;
pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
function pthread_cond_wait
(cond : access pthread_cond_t;
mutex : access pthread_mutex_t) return int;
pragma Import (C, pthread_cond_wait, "pthread_cond_wait");
function pthread_cond_timedwait
(cond : access pthread_cond_t;
mutex : access pthread_mutex_t;
abstime : access timespec) return int;
pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
Relative_Timed_Wait : constant Boolean := False;
-- pthread_cond_timedwait requires an absolute delay time
--------------------------
-- POSIX.1c Section 13 --
--------------------------
-- From /usr/include/pthread/pthreadtypes.h
PTHREAD_PRIO_NONE : constant := 0;
PTHREAD_PRIO_PROTECT : constant := 2;
PTHREAD_PRIO_INHERIT : constant := 1;
-- GNU/Hurd does not support Thread Priority Protection or Thread
-- Priority Inheritance and lacks some pthread_mutexattr_* functions.
-- Replace them with dummy versions.
-- From: /usr/include/pthread/pthread.h
function pthread_mutexattr_setprotocol
(attr : access pthread_mutexattr_t;
protocol : int) return int;
pragma Import (C, pthread_mutexattr_setprotocol,
"pthread_mutexattr_setprotocol");
function pthread_mutexattr_getprotocol
(attr : access pthread_mutexattr_t;
protocol : access int) return int;
pragma Import (C, pthread_mutexattr_getprotocol,
"pthread_mutexattr_getprotocol");
function pthread_mutexattr_setprioceiling
(attr : access pthread_mutexattr_t;
prioceiling : int) return int;
function pthread_mutexattr_getprioceiling
(attr : access pthread_mutexattr_t;
prioceiling : access int) return int;
type struct_sched_param is record
sched_priority : int; -- scheduling priority
end record;
pragma Convention (C, struct_sched_param);
function pthread_setschedparam
(thread : pthread_t;
policy : int;
param : access struct_sched_param) return int;
function pthread_attr_setscope
(attr : access pthread_attr_t;
contentionscope : int) return int;
pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope");
function pthread_attr_getscope
(attr : access pthread_attr_t;
contentionscope : access int) return int;
pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope");
function pthread_attr_setinheritsched
(attr : access pthread_attr_t;
inheritsched : int) return int;
pragma Import (C, pthread_attr_setinheritsched,
"pthread_attr_setinheritsched");
function pthread_attr_getinheritsched
(attr : access pthread_attr_t;
inheritsched : access int) return int;
pragma Import (C, pthread_attr_getinheritsched,
"pthread_attr_getinheritsched");
function pthread_attr_setschedpolicy
(attr : access pthread_attr_t;
policy : int) return int;
pragma Import (C, pthread_attr_setschedpolicy, "pthread_setschedpolicy");
function sched_yield return int;
pragma Import (C, sched_yield, "sched_yield");
---------------------------
-- P1003.1c - Section 16 --
---------------------------
function pthread_attr_init
(attributes : access pthread_attr_t) return int;
pragma Import (C, pthread_attr_init, "pthread_attr_init");
function pthread_attr_destroy
(attributes : access pthread_attr_t) return int;
pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
function pthread_attr_setdetachstate
(attr : access pthread_attr_t;
detachstate : int) return int;
pragma Import
(C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate");
function pthread_attr_setstacksize
(attr : access pthread_attr_t;
stacksize : size_t) return int;
pragma Import (C, pthread_attr_setstacksize, "pthread_attr_setstacksize");
-- From: /usr/include/pthread/pthread.h
function pthread_create
(thread : access pthread_t;
attributes : access pthread_attr_t;
start_routine : Thread_Body;
arg : System.Address) return int;
pragma Import (C, pthread_create, "pthread_create");
procedure pthread_exit (status : System.Address);
pragma Import (C, pthread_exit, "pthread_exit");
function pthread_self return pthread_t;
pragma Import (C, pthread_self, "pthread_self");
--------------------------
-- POSIX.1c Section 17 --
--------------------------
function pthread_setspecific
(key : pthread_key_t;
value : System.Address) return int;
pragma Import (C, pthread_setspecific, "pthread_setspecific");
function pthread_getspecific (key : pthread_key_t) return System.Address;
pragma Import (C, pthread_getspecific, "pthread_getspecific");
type destructor_pointer is access procedure (arg : System.Address);
pragma Convention (C, destructor_pointer);
function pthread_key_create
(key : access pthread_key_t;
destructor : destructor_pointer) return int;
pragma Import (C, pthread_key_create, "pthread_key_create");
-- From /usr/include/i386-gnu/bits/sched.h
CPU_SETSIZE : constant := 1_024;
type bit_field is array (1 .. CPU_SETSIZE) of Boolean;
for bit_field'Size use CPU_SETSIZE;
pragma Pack (bit_field);
pragma Convention (C, bit_field);
type cpu_set_t is record
bits : bit_field;
end record;
pragma Convention (C, cpu_set_t);
private
type sigset_t is array (1 .. 4) of unsigned;
-- In GNU/Hurd the component sa_handler turns out to
-- be one a union type, and the selector is a macro:
-- #define sa_handler __sigaction_handler.sa_handler
-- #define sa_sigaction __sigaction_handler.sa_sigaction
-- Should we add a signal_context type here ?
-- How could it be done independent of the CPU architecture ?
-- sigcontext type is opaque, so it is architecturally neutral.
-- It is always passed as an access type, so define it as an empty record
-- since the contents are not used anywhere.
type struct_sigcontext is null record;
pragma Convention (C, struct_sigcontext);
type pid_t is new int;
type time_t is new long;
type timespec is record
tv_sec : time_t;
tv_nsec : long;
end record;
pragma Convention (C, timespec);
-- From: /usr/include/pthread/pthreadtypes.h:
-- typedef struct __pthread_attr pthread_attr_t;
-- /usr/include/i386-gnu/bits/thread-attr.h: struct __pthread_attr...
-- /usr/include/pthread/pthreadtypes.h: enum __pthread_contentionscope
-- enum __pthread_detachstate detachstate;
-- enum __pthread_inheritsched inheritsched;
-- enum __pthread_contentionscope contentionscope;
-- Not used: schedpolicy : int;
type pthread_attr_t is record
schedparam : struct_sched_param;
stackaddr : System.Address;
stacksize : size_t;
guardsize : size_t;
detachstate : int;
inheritsched : int;
contentionscope : int;
schedpolicy : int;
end record;
pragma Convention (C, pthread_attr_t);
-- From: /usr/include/pthread/pthreadtypes.h:
-- typedef struct __pthread_condattr pthread_condattr_t;
-- From: /usr/include/i386-gnu/bits/condition-attr.h:
-- struct __pthread_condattr {
-- enum __pthread_process_shared pshared;
-- __Clockid_T Clock;}
-- From: /usr/include/pthread/pthreadtypes.h:
-- enum __pthread_process_shared
type pthread_condattr_t is record
pshared : int;
clock : clockid_t;
end record;
pragma Convention (C, pthread_condattr_t);
-- From: /usr/include/pthread/pthreadtypes.h:
-- typedef struct __pthread_mutexattr pthread_mutexattr_t; and
-- /usr/include/i386-gnu/bits/mutex-attr.h
-- struct __pthread_mutexattr {
-- int prioceiling;
-- enum __pthread_mutex_protocol protocol;
-- enum __pthread_process_shared pshared;
-- enum __pthread_mutex_type mutex_type;};
type pthread_mutexattr_t is record
prioceiling : int;
protocol : int;
pshared : int;
mutex_type : int;
end record;
pragma Convention (C, pthread_mutexattr_t);
-- From: /usr/include/pthread/pthreadtypes.h
-- typedef struct __pthread_mutex pthread_mutex_t; and
-- /usr/include/i386-gnu/bits/mutex.h:
-- struct __pthread_mutex {
-- __pthread_spinlock_t __held;
-- __pthread_spinlock_t __lock;
-- /* in cthreads, mutex_init does not initialized the third
-- pointer, as such, we cannot rely on its value for anything. */
-- char *cthreadscompat1;
-- struct __pthread *__queue;
-- struct __pthread_mutexattr *attr;
-- void *data;
-- /* up to this point, we are completely compatible with cthreads
-- and what libc expects. */
-- void *owner;
-- unsigned locks;
-- /* if null then the default attributes apply. */
-- };
type pthread_mutex_t is record
held : int;
lock : int;
cthreadcompat : System.Address;
queue : System.Address;
attr : System.Address;
data : System.Address;
owner : System.Address;
locks : unsigned;
end record;
pragma Convention (C, pthread_mutex_t);
-- pointer needed?
-- type pthread_mutex_t_ptr is access pthread_mutex_t;
-- From: /usr/include/pthread/pthreadtypes.h:
-- typedef struct __pthread_cond pthread_cond_t;
-- typedef struct __pthread_condattr pthread_condattr_t;
-- /usr/include/i386-gnu/bits/condition.h:struct __pthread_cond{}
-- pthread_condattr_t: see above!
-- /usr/include/i386-gnu/bits/condition.h:
-- struct __pthread_condimpl *__impl;
type pthread_cond_t is record
lock : int;
queue : System.Address;
condattr : System.Address;
impl : System.Address;
data : System.Address;
end record;
pragma Convention (C, pthread_cond_t);
-- From: /usr/include/pthread/pthreadtypes.h:
-- typedef __pthread_key pthread_key_t; and
-- /usr/include/i386-gnu/bits/thread-specific.h:
-- typedef int __pthread_key;
type pthread_key_t is new int;
-- From: /usr/include/i386-gnu/bits/rwlock-attr.h:
-- struct __pthread_rwlockattr {
-- enum __pthread_process_shared pshared; };
type pthread_rwlockattr_t is record
pshared : int;
end record;
pragma Convention (C, pthread_rwlockattr_t);
-- From: /usr/include/i386-gnu/bits/rwlock.h:
-- struct __pthread_rwlock {
-- __pthread_spinlock_t __held;
-- __pthread_spinlock_t __lock;
-- int readers;
-- struct __pthread *readerqueue;
-- struct __pthread *writerqueue;
-- struct __pthread_rwlockattr *__attr;
-- void *__data; };
type pthread_rwlock_t is record
held : int;
lock : int;
readers : int;
readerqueue : System.Address;
writerqueue : System.Address;
attr : pthread_rwlockattr_t;
data : int;
end record;
pragma Convention (C, pthread_rwlock_t);
end System.OS_Interface;
| 37.117353 | 79 | 0.648044 |
4a7ce12cdb7a4e3bd47b4e980b9d75eb7e29ebdd | 2,339 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c8/c87b09c.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c8/c87b09c.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c8/c87b09c.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- C87B09C.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT OVERLOADING RESOLUTION USES THE RULE THAT:
--
-- IN A FLOATING POINT TYPE DEFINITION, THE DIGITS EXPRESSION MUST
-- BE OF SOME INTEGRAL TYPE. SIMILARLY, THE DELTA EXPRESSION IN A
-- FIXED POINT TYPE DEFINITION MUST BE OF SOME REAL TYPE.
-- TRH 30 JUNE 82
WITH REPORT; USE REPORT;
PROCEDURE C87B09C IS
FUNCTION "+" (X : INTEGER) RETURN FLOAT IS
BEGIN
FAILED ("DIGITS EXPRESSION MUST BE OF AN INTEGRAL TYPE");
RETURN 2.0;
END "+";
FUNCTION "+" (X : FLOAT) RETURN INTEGER IS
BEGIN
FAILED ("DELTA EXPRESSION MUST BE OF A REAL TYPE");
RETURN 2;
END "+";
BEGIN
TEST ("C87B09C","OVERLOADED DIGITS/DELTA EXPRESSIONS IN " &
"REAL TYPE DEFINITIONS");
DECLARE
TYPE EXACT IS DIGITS "+" (4);
TYPE CENTI IS DELTA "+" (0.01) RANGE -2.0 .. 2.0;
TYPE CLOSE IS DIGITS "+" (2) RANGE -1.0 .. 1.0;
TYPE DECI IS DELTA "+" (0.1) RANGE -1.0 .. 1.0;
BEGIN
NULL;
END;
RESULT;
END C87B09C;
| 35.984615 | 79 | 0.627191 |
dc45e3393bad2aa7c9975e0647d235f025b267ab | 275 | ads | Ada | ImgAnnealing/src/imageops.ads | kochab/simulatedannealing-ada | ed1f2d15b0aadd31d8ca474b67ac02ae380aaf71 | [
"MIT"
] | null | null | null | ImgAnnealing/src/imageops.ads | kochab/simulatedannealing-ada | ed1f2d15b0aadd31d8ca474b67ac02ae380aaf71 | [
"MIT"
] | null | null | null | ImgAnnealing/src/imageops.ads | kochab/simulatedannealing-ada | ed1f2d15b0aadd31d8ca474b67ac02ae380aaf71 | [
"MIT"
] | null | null | null | with Bitmaps.RGB;
package ImageOps is
function Manhattan_Distance (A, B : in Bitmaps.RGB.Pixel) return Natural;
function Adj_Distance_Sum
(Source : in Bitmaps.RGB.Image) return Long_Integer;
procedure Noise (Target : in out Bitmaps.RGB.Image);
end ImageOps;
| 25 | 76 | 0.745455 |
c53f7cb83d8dc7da27f986b1d167d3a6023e9dce | 42,869 | adb | Ada | Validation/pyFrame3DD-master/gcc-master/gcc/ada/par-ch12.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/par-ch12.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/par-ch12.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- P A R . C H 1 2 --
-- --
-- B o d y --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
pragma Style_Checks (All_Checks);
-- Turn off subprogram body ordering check. Subprograms are in order
-- by RM section rather than alphabetical
separate (Par)
package body Ch12 is
-- Local functions, used only in this chapter
function P_Formal_Derived_Type_Definition return Node_Id;
function P_Formal_Discrete_Type_Definition return Node_Id;
function P_Formal_Fixed_Point_Definition return Node_Id;
function P_Formal_Floating_Point_Definition return Node_Id;
function P_Formal_Modular_Type_Definition return Node_Id;
function P_Formal_Package_Declaration return Node_Id;
function P_Formal_Private_Type_Definition return Node_Id;
function P_Formal_Signed_Integer_Type_Definition return Node_Id;
function P_Formal_Subprogram_Declaration return Node_Id;
function P_Formal_Type_Declaration return Node_Id;
function P_Formal_Type_Definition return Node_Id;
function P_Generic_Association return Node_Id;
procedure P_Formal_Object_Declarations (Decls : List_Id);
-- Scans one or more formal object declarations and appends them to
-- Decls. Scans more than one declaration only in the case where the
-- source has a declaration with multiple defining identifiers.
--------------------------------
-- 12.1 Generic (also 8.5.5) --
--------------------------------
-- This routine parses either one of the forms of a generic declaration
-- or a generic renaming declaration.
-- GENERIC_DECLARATION ::=
-- GENERIC_SUBPROGRAM_DECLARATION | GENERIC_PACKAGE_DECLARATION
-- GENERIC_SUBPROGRAM_DECLARATION ::=
-- GENERIC_FORMAL_PART SUBPROGRAM_SPECIFICATION
-- [ASPECT_SPECIFICATIONS];
-- GENERIC_PACKAGE_DECLARATION ::=
-- GENERIC_FORMAL_PART PACKAGE_SPECIFICATION
-- [ASPECT_SPECIFICATIONS];
-- GENERIC_FORMAL_PART ::=
-- generic {GENERIC_FORMAL_PARAMETER_DECLARATION | USE_CLAUSE}
-- GENERIC_RENAMING_DECLARATION ::=
-- generic package DEFINING_PROGRAM_UNIT_NAME
-- renames generic_package_NAME
-- [ASPECT_SPECIFICATIONS];
-- | generic procedure DEFINING_PROGRAM_UNIT_NAME
-- renames generic_procedure_NAME
-- [ASPECT_SPECIFICATIONS];
-- | generic function DEFINING_PROGRAM_UNIT_NAME
-- renames generic_function_NAME
-- [ASPECT_SPECIFICATIONS];
-- GENERIC_FORMAL_PARAMETER_DECLARATION ::=
-- FORMAL_OBJECT_DECLARATION
-- | FORMAL_TYPE_DECLARATION
-- | FORMAL_SUBPROGRAM_DECLARATION
-- | FORMAL_PACKAGE_DECLARATION
-- The caller has checked that the initial token is GENERIC
-- Error recovery: can raise Error_Resync
function P_Generic return Node_Id is
Gen_Sloc : constant Source_Ptr := Token_Ptr;
Gen_Decl : Node_Id;
Decl_Node : Node_Id;
Decls : List_Id;
Def_Unit : Node_Id;
Ren_Token : Token_Type;
Scan_State : Saved_Scan_State;
begin
Scan; -- past GENERIC
if Token = Tok_Private then
Error_Msg_SC -- CODEFIX
("PRIVATE goes before GENERIC, not after");
Scan; -- past junk PRIVATE token
end if;
Save_Scan_State (Scan_State); -- at token past GENERIC
-- Check for generic renaming declaration case
if Token = Tok_Package
or else Token = Tok_Function
or else Token = Tok_Procedure
then
Ren_Token := Token;
Scan; -- scan past PACKAGE, FUNCTION or PROCEDURE
if Token = Tok_Identifier then
Def_Unit := P_Defining_Program_Unit_Name;
Check_Misspelling_Of (Tok_Renames);
if Token = Tok_Renames then
if Ren_Token = Tok_Package then
Decl_Node := New_Node
(N_Generic_Package_Renaming_Declaration, Gen_Sloc);
elsif Ren_Token = Tok_Procedure then
Decl_Node := New_Node
(N_Generic_Procedure_Renaming_Declaration, Gen_Sloc);
else -- Ren_Token = Tok_Function then
Decl_Node := New_Node
(N_Generic_Function_Renaming_Declaration, Gen_Sloc);
end if;
Scan; -- past RENAMES
Set_Defining_Unit_Name (Decl_Node, Def_Unit);
Set_Name (Decl_Node, P_Name);
P_Aspect_Specifications (Decl_Node, Semicolon => False);
TF_Semicolon;
return Decl_Node;
end if;
end if;
end if;
-- Fall through if this is *not* a generic renaming declaration
Restore_Scan_State (Scan_State);
Decls := New_List;
-- Loop through generic parameter declarations and use clauses
Decl_Loop : loop
P_Pragmas_Opt (Decls);
if Token = Tok_Private then
Error_Msg_S ("generic private child packages not permitted");
Scan; -- past PRIVATE
end if;
if Token = Tok_Use then
P_Use_Clause (Decls);
else
-- Parse a generic parameter declaration
if Token = Tok_Identifier then
P_Formal_Object_Declarations (Decls);
elsif Token = Tok_Type then
Append (P_Formal_Type_Declaration, Decls);
elsif Token = Tok_With then
Scan; -- past WITH
if Token = Tok_Package then
Append (P_Formal_Package_Declaration, Decls);
elsif Token = Tok_Procedure or Token = Tok_Function then
Append (P_Formal_Subprogram_Declaration, Decls);
else
Error_Msg_BC -- CODEFIX
("FUNCTION, PROCEDURE or PACKAGE expected here");
Resync_Past_Semicolon;
end if;
elsif Token = Tok_Subtype then
Error_Msg_SC ("subtype declaration not allowed " &
"as generic parameter declaration!");
Resync_Past_Semicolon;
else
exit Decl_Loop;
end if;
end if;
end loop Decl_Loop;
-- Generic formal part is scanned, scan out subprogram or package spec
if Token = Tok_Package then
Gen_Decl := New_Node (N_Generic_Package_Declaration, Gen_Sloc);
Set_Specification (Gen_Decl, P_Package (Pf_Spcn));
-- Aspects have been parsed by the package spec. Move them to the
-- generic declaration where they belong.
Move_Aspects (Specification (Gen_Decl), Gen_Decl);
else
Gen_Decl := New_Node (N_Generic_Subprogram_Declaration, Gen_Sloc);
Set_Specification (Gen_Decl, P_Subprogram_Specification);
if Nkind (Defining_Unit_Name (Specification (Gen_Decl))) =
N_Defining_Program_Unit_Name
and then Scope.Last > 0
then
Error_Msg_SP ("child unit allowed only at library level");
end if;
P_Aspect_Specifications (Gen_Decl);
end if;
Set_Generic_Formal_Declarations (Gen_Decl, Decls);
return Gen_Decl;
end P_Generic;
-------------------------------
-- 12.1 Generic Declaration --
-------------------------------
-- Parsed by P_Generic (12.1)
------------------------------------------
-- 12.1 Generic Subprogram Declaration --
------------------------------------------
-- Parsed by P_Generic (12.1)
---------------------------------------
-- 12.1 Generic Package Declaration --
---------------------------------------
-- Parsed by P_Generic (12.1)
-------------------------------
-- 12.1 Generic Formal Part --
-------------------------------
-- Parsed by P_Generic (12.1)
-------------------------------------------------
-- 12.1 Generic Formal Parameter Declaration --
-------------------------------------------------
-- Parsed by P_Generic (12.1)
---------------------------------
-- 12.3 Generic Instantiation --
---------------------------------
-- Generic package instantiation parsed by P_Package (7.1)
-- Generic procedure instantiation parsed by P_Subprogram (6.1)
-- Generic function instantiation parsed by P_Subprogram (6.1)
-------------------------------
-- 12.3 Generic Actual Part --
-------------------------------
-- GENERIC_ACTUAL_PART ::=
-- (GENERIC_ASSOCIATION {, GENERIC_ASSOCIATION})
-- Returns a list of generic associations, or Empty if none are present
-- Error recovery: cannot raise Error_Resync
function P_Generic_Actual_Part_Opt return List_Id is
Association_List : List_Id;
begin
-- Figure out if a generic actual part operation is present. Clearly
-- there is no generic actual part if the current token is semicolon
-- or if we have aspect specifications present.
if Token = Tok_Semicolon or else Aspect_Specifications_Present then
return No_List;
-- If we don't have a left paren, then we have an error, and the job
-- is to figure out whether a left paren or semicolon was intended.
-- We assume a missing left paren (and hence a generic actual part
-- present) if the current token is not on a new line, or if it is
-- indented from the subprogram token. Otherwise assume missing
-- semicolon (which will be diagnosed by caller) and no generic part
elsif Token /= Tok_Left_Paren
and then Token_Is_At_Start_Of_Line
and then Start_Column <= Scopes (Scope.Last).Ecol
then
return No_List;
-- Otherwise we have a generic actual part (either a left paren is
-- present, or we have decided that there must be a missing left paren)
else
Association_List := New_List;
T_Left_Paren;
loop
Append (P_Generic_Association, Association_List);
exit when not Comma_Present;
end loop;
T_Right_Paren;
return Association_List;
end if;
end P_Generic_Actual_Part_Opt;
-------------------------------
-- 12.3 Generic Association --
-------------------------------
-- GENERIC_ASSOCIATION ::=
-- [generic_formal_parameter_SELECTOR_NAME =>]
-- EXPLICIT_GENERIC_ACTUAL_PARAMETER
-- EXPLICIT_GENERIC_ACTUAL_PARAMETER ::=
-- EXPRESSION | variable_NAME | subprogram_NAME
-- | entry_NAME | SUBTYPE_MARK | package_instance_NAME
-- Error recovery: cannot raise Error_Resync
function P_Generic_Association return Node_Id is
Scan_State : Saved_Scan_State;
Param_Name_Node : Node_Id;
Generic_Assoc_Node : Node_Id;
begin
Generic_Assoc_Node := New_Node (N_Generic_Association, Token_Ptr);
-- Ada 2005: an association can be given by: others => <>
if Token = Tok_Others then
if Ada_Version < Ada_2005 then
Error_Msg_SP
("partial parameterization of formal packages"
& " is an Ada 2005 extension");
Error_Msg_SP
("\unit must be compiled with -gnat05 switch");
end if;
Scan; -- past OTHERS
if Token /= Tok_Arrow then
Error_Msg_BC ("expect arrow after others");
else
Scan; -- past arrow
end if;
if Token /= Tok_Box then
Error_Msg_BC ("expect Box after arrow");
else
Scan; -- past box
end if;
-- Source position of the others choice is beginning of construct
return New_Node (N_Others_Choice, Sloc (Generic_Assoc_Node));
end if;
if Token in Token_Class_Desig then
Param_Name_Node := Token_Node;
Save_Scan_State (Scan_State); -- at designator
Scan; -- past simple name or operator symbol
if Token = Tok_Arrow then
Scan; -- past arrow
Set_Selector_Name (Generic_Assoc_Node, Param_Name_Node);
else
Restore_Scan_State (Scan_State); -- to designator
end if;
end if;
-- In Ada 2005 the actual can be a box
if Token = Tok_Box then
Scan;
Set_Box_Present (Generic_Assoc_Node);
Set_Explicit_Generic_Actual_Parameter (Generic_Assoc_Node, Empty);
else
Set_Explicit_Generic_Actual_Parameter
(Generic_Assoc_Node, P_Expression);
end if;
return Generic_Assoc_Node;
end P_Generic_Association;
---------------------------------------------
-- 12.3 Explicit Generic Actual Parameter --
---------------------------------------------
-- Parsed by P_Generic_Association (12.3)
--------------------------------------
-- 12.4 Formal Object Declarations --
--------------------------------------
-- FORMAL_OBJECT_DECLARATION ::=
-- DEFINING_IDENTIFIER_LIST :
-- MODE [NULL_EXCLUSION] SUBTYPE_MARK [:= DEFAULT_EXPRESSION]
-- [ASPECT_SPECIFICATIONS];
-- | DEFINING_IDENTIFIER_LIST :
-- MODE ACCESS_DEFINITION [:= DEFAULT_EXPRESSION];
-- [ASPECT_SPECIFICATIONS];
-- The caller has checked that the initial token is an identifier
-- Error recovery: cannot raise Error_Resync
procedure P_Formal_Object_Declarations (Decls : List_Id) is
Decl_Node : Node_Id;
Ident : Nat;
Not_Null_Present : Boolean := False;
Num_Idents : Nat;
Scan_State : Saved_Scan_State;
Idents : array (Int range 1 .. 4096) of Entity_Id;
-- This array holds the list of defining identifiers. The upper bound
-- of 4096 is intended to be essentially infinite, and we do not even
-- bother to check for it being exceeded.
begin
Idents (1) := P_Defining_Identifier (C_Comma_Colon);
Num_Idents := 1;
while Comma_Present loop
Num_Idents := Num_Idents + 1;
Idents (Num_Idents) := P_Defining_Identifier (C_Comma_Colon);
end loop;
T_Colon;
-- If there are multiple identifiers, we repeatedly scan the
-- type and initialization expression information by resetting
-- the scan pointer (so that we get completely separate trees
-- for each occurrence).
if Num_Idents > 1 then
Save_Scan_State (Scan_State);
end if;
-- Loop through defining identifiers in list
Ident := 1;
Ident_Loop : loop
Decl_Node := New_Node (N_Formal_Object_Declaration, Token_Ptr);
Set_Defining_Identifier (Decl_Node, Idents (Ident));
P_Mode (Decl_Node);
Not_Null_Present := P_Null_Exclusion; -- Ada 2005 (AI-423)
-- Ada 2005 (AI-423): Formal object with an access definition
if Token = Tok_Access then
-- The access definition is still parsed and set even though
-- the compilation may not use the proper switch. This action
-- ensures the required local error recovery.
Set_Access_Definition (Decl_Node,
P_Access_Definition (Not_Null_Present));
if Ada_Version < Ada_2005 then
Error_Msg_SP
("access definition not allowed in formal object " &
"declaration");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
end if;
-- Formal object with a subtype mark
else
Set_Null_Exclusion_Present (Decl_Node, Not_Null_Present);
Set_Subtype_Mark (Decl_Node, P_Subtype_Mark_Resync);
end if;
No_Constraint;
Set_Default_Expression (Decl_Node, Init_Expr_Opt);
P_Aspect_Specifications (Decl_Node);
if Ident > 1 then
Set_Prev_Ids (Decl_Node, True);
end if;
if Ident < Num_Idents then
Set_More_Ids (Decl_Node, True);
end if;
Append (Decl_Node, Decls);
exit Ident_Loop when Ident = Num_Idents;
Ident := Ident + 1;
Restore_Scan_State (Scan_State);
end loop Ident_Loop;
end P_Formal_Object_Declarations;
-----------------------------------
-- 12.5 Formal Type Declaration --
-----------------------------------
-- FORMAL_TYPE_DECLARATION ::=
-- type DEFINING_IDENTIFIER [DISCRIMINANT_PART]
-- is FORMAL_TYPE_DEFINITION
-- [ASPECT_SPECIFICATIONS];
-- The caller has checked that the initial token is TYPE
-- Error recovery: cannot raise Error_Resync
function P_Formal_Type_Declaration return Node_Id is
Decl_Node : Node_Id;
Def_Node : Node_Id;
begin
Decl_Node := New_Node (N_Formal_Type_Declaration, Token_Ptr);
Scan; -- past TYPE
Set_Defining_Identifier (Decl_Node, P_Defining_Identifier);
if P_Unknown_Discriminant_Part_Opt then
Set_Unknown_Discriminants_Present (Decl_Node, True);
else
Set_Discriminant_Specifications
(Decl_Node, P_Known_Discriminant_Part_Opt);
end if;
if Token = Tok_Semicolon then
-- Ada 2012: Incomplete formal type
Scan; -- past semicolon
Error_Msg_Ada_2012_Feature
("formal incomplete type", Sloc (Decl_Node));
Set_Formal_Type_Definition
(Decl_Node,
New_Node (N_Formal_Incomplete_Type_Definition, Token_Ptr));
return Decl_Node;
else
T_Is;
end if;
Def_Node := P_Formal_Type_Definition;
if Nkind (Def_Node) = N_Formal_Incomplete_Type_Definition then
Error_Msg_Ada_2012_Feature
("formal incomplete type", Sloc (Decl_Node));
end if;
if Def_Node /= Error then
Set_Formal_Type_Definition (Decl_Node, Def_Node);
P_Aspect_Specifications (Decl_Node);
else
Decl_Node := Error;
-- If we have aspect specifications, skip them
if Aspect_Specifications_Present then
P_Aspect_Specifications (Error);
-- If we have semicolon, skip it to avoid cascaded errors
elsif Token = Tok_Semicolon then
Scan; -- past semicolon
end if;
end if;
return Decl_Node;
end P_Formal_Type_Declaration;
----------------------------------
-- 12.5 Formal Type Definition --
----------------------------------
-- FORMAL_TYPE_DEFINITION ::=
-- FORMAL_PRIVATE_TYPE_DEFINITION
-- | FORMAL_INCOMPLETE_TYPE_DEFINITION
-- | FORMAL_DERIVED_TYPE_DEFINITION
-- | FORMAL_DISCRETE_TYPE_DEFINITION
-- | FORMAL_SIGNED_INTEGER_TYPE_DEFINITION
-- | FORMAL_MODULAR_TYPE_DEFINITION
-- | FORMAL_FLOATING_POINT_DEFINITION
-- | FORMAL_ORDINARY_FIXED_POINT_DEFINITION
-- | FORMAL_DECIMAL_FIXED_POINT_DEFINITION
-- | FORMAL_ARRAY_TYPE_DEFINITION
-- | FORMAL_ACCESS_TYPE_DEFINITION
-- | FORMAL_INTERFACE_TYPE_DEFINITION
-- FORMAL_ARRAY_TYPE_DEFINITION ::= ARRAY_TYPE_DEFINITION
-- FORMAL_ACCESS_TYPE_DEFINITION ::= ACCESS_TYPE_DEFINITION
-- FORMAL_INTERFACE_TYPE_DEFINITION ::= INTERFACE_TYPE_DEFINITION
function P_Formal_Type_Definition return Node_Id is
Scan_State : Saved_Scan_State;
Typedef_Node : Node_Id;
begin
if Token_Name = Name_Abstract then
Check_95_Keyword (Tok_Abstract, Tok_Tagged);
end if;
if Token_Name = Name_Tagged then
Check_95_Keyword (Tok_Tagged, Tok_Private);
Check_95_Keyword (Tok_Tagged, Tok_Limited);
end if;
case Token is
-- Mostly we can tell what we have from the initial token. The one
-- exception is ABSTRACT, where we have to scan ahead to see if we
-- have a formal derived type or a formal private type definition.
-- In addition, in Ada 2005 LIMITED may appear after abstract, so
-- that the lookahead must be extended by one more token.
when Tok_Abstract =>
Save_Scan_State (Scan_State);
Scan; -- past ABSTRACT
if Token = Tok_New then
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Derived_Type_Definition;
elsif Token = Tok_Limited then
Scan; -- past LIMITED
if Token = Tok_New then
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Derived_Type_Definition;
else
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Private_Type_Definition;
end if;
-- Ada 2005 (AI-443): Abstract synchronized formal derived type
elsif Token = Tok_Synchronized then
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Derived_Type_Definition;
else
Restore_Scan_State (Scan_State); -- to ABSTRACT
return P_Formal_Private_Type_Definition;
end if;
when Tok_Access =>
return P_Access_Type_Definition;
when Tok_Array =>
return P_Array_Type_Definition;
when Tok_Delta =>
return P_Formal_Fixed_Point_Definition;
when Tok_Digits =>
return P_Formal_Floating_Point_Definition;
when Tok_Interface => -- Ada 2005 (AI-251)
return P_Interface_Type_Definition (Abstract_Present => False);
when Tok_Left_Paren =>
return P_Formal_Discrete_Type_Definition;
when Tok_Limited =>
Save_Scan_State (Scan_State);
Scan; -- past LIMITED
if Token = Tok_Interface then
Typedef_Node :=
P_Interface_Type_Definition (Abstract_Present => False);
Set_Limited_Present (Typedef_Node);
return Typedef_Node;
elsif Token = Tok_New then
Restore_Scan_State (Scan_State); -- to LIMITED
return P_Formal_Derived_Type_Definition;
else
if Token = Tok_Abstract then
Error_Msg_SC -- CODEFIX
("ABSTRACT must come before LIMITED");
Scan; -- past improper ABSTRACT
if Token = Tok_New then
Restore_Scan_State (Scan_State); -- to LIMITED
return P_Formal_Derived_Type_Definition;
else
Restore_Scan_State (Scan_State);
return P_Formal_Private_Type_Definition;
end if;
end if;
Restore_Scan_State (Scan_State);
return P_Formal_Private_Type_Definition;
end if;
when Tok_Mod =>
return P_Formal_Modular_Type_Definition;
when Tok_New =>
return P_Formal_Derived_Type_Definition;
when Tok_Not =>
if P_Null_Exclusion then
Typedef_Node := P_Access_Type_Definition;
Set_Null_Exclusion_Present (Typedef_Node);
return Typedef_Node;
else
Error_Msg_SC ("expect valid formal access definition!");
Resync_Past_Semicolon;
return Error;
end if;
when Tok_Private =>
return P_Formal_Private_Type_Definition;
when Tok_Tagged =>
if Next_Token_Is (Tok_Semicolon) then
Typedef_Node :=
New_Node (N_Formal_Incomplete_Type_Definition, Token_Ptr);
Set_Tagged_Present (Typedef_Node);
Scan; -- past tagged
return Typedef_Node;
else
return P_Formal_Private_Type_Definition;
end if;
when Tok_Range =>
return P_Formal_Signed_Integer_Type_Definition;
when Tok_Record =>
Error_Msg_SC ("record not allowed in generic type definition!");
Discard_Junk_Node (P_Record_Definition);
return Error;
-- Ada 2005 (AI-345): Task, Protected or Synchronized interface or
-- (AI-443): Synchronized formal derived type declaration.
when Tok_Protected
| Tok_Synchronized
| Tok_Task
=>
declare
Saved_Token : constant Token_Type := Token;
begin
Scan; -- past TASK, PROTECTED or SYNCHRONIZED
-- Synchronized derived type
if Token = Tok_New then
Typedef_Node := P_Formal_Derived_Type_Definition;
if Saved_Token = Tok_Synchronized then
Set_Synchronized_Present (Typedef_Node);
else
Error_Msg_SC ("invalid kind of formal derived type");
end if;
-- Interface
else
Typedef_Node :=
P_Interface_Type_Definition (Abstract_Present => False);
case Saved_Token is
when Tok_Task =>
Set_Task_Present (Typedef_Node);
when Tok_Protected =>
Set_Protected_Present (Typedef_Node);
when Tok_Synchronized =>
Set_Synchronized_Present (Typedef_Node);
when others =>
null;
end case;
end if;
return Typedef_Node;
end;
when others =>
Error_Msg_BC ("expecting generic type definition here");
Resync_Past_Semicolon;
return Error;
end case;
end P_Formal_Type_Definition;
--------------------------------------------
-- 12.5.1 Formal Private Type Definition --
--------------------------------------------
-- FORMAL_PRIVATE_TYPE_DEFINITION ::=
-- [[abstract] tagged] [limited] private
-- The caller has checked the initial token is PRIVATE, ABSTRACT,
-- TAGGED or LIMITED
-- Error recovery: cannot raise Error_Resync
function P_Formal_Private_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node := New_Node (N_Formal_Private_Type_Definition, Token_Ptr);
if Token = Tok_Abstract then
Scan; -- past ABSTRACT
if Token_Name = Name_Tagged then
Check_95_Keyword (Tok_Tagged, Tok_Private);
Check_95_Keyword (Tok_Tagged, Tok_Limited);
end if;
if Token /= Tok_Tagged then
Error_Msg_SP ("ABSTRACT must be followed by TAGGED");
else
Set_Abstract_Present (Def_Node, True);
end if;
end if;
if Token = Tok_Tagged then
Set_Tagged_Present (Def_Node, True);
Scan; -- past TAGGED
end if;
if Token = Tok_Limited then
Set_Limited_Present (Def_Node, True);
Scan; -- past LIMITED
end if;
if Token = Tok_Abstract then
if Prev_Token = Tok_Tagged then
Error_Msg_SC -- CODEFIX
("ABSTRACT must come before TAGGED");
elsif Prev_Token = Tok_Limited then
Error_Msg_SC -- CODEFIX
("ABSTRACT must come before LIMITED");
end if;
Resync_Past_Semicolon;
elsif Token = Tok_Tagged then
Error_Msg_SC -- CODEFIX
("TAGGED must come before LIMITED");
Resync_Past_Semicolon;
end if;
Set_Sloc (Def_Node, Token_Ptr);
T_Private;
if Token = Tok_Tagged then -- CODEFIX
Error_Msg_SC ("TAGGED must come before PRIVATE");
Scan; -- past TAGGED
elsif Token = Tok_Abstract then -- CODEFIX
Error_Msg_SC ("`ABSTRACT TAGGED` must come before PRIVATE");
Scan; -- past ABSTRACT
if Token = Tok_Tagged then
Scan; -- past TAGGED
end if;
end if;
return Def_Node;
end P_Formal_Private_Type_Definition;
--------------------------------------------
-- 12.5.1 Formal Derived Type Definition --
--------------------------------------------
-- FORMAL_DERIVED_TYPE_DEFINITION ::=
-- [abstract] [limited | synchronized]
-- new SUBTYPE_MARK [[and INTERFACE_LIST] with private]
-- The caller has checked the initial token(s) is/are NEW, ABSTRACT NEW,
-- or LIMITED NEW, ABSTRACT LIMITED NEW, SYNCHRONIZED NEW or ABSTRACT
-- SYNCHRONIZED NEW.
-- Error recovery: cannot raise Error_Resync
function P_Formal_Derived_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node := New_Node (N_Formal_Derived_Type_Definition, Token_Ptr);
if Token = Tok_Abstract then
Set_Abstract_Present (Def_Node);
Scan; -- past ABSTRACT
end if;
if Token = Tok_Limited then
Set_Limited_Present (Def_Node);
Scan; -- past LIMITED
if Ada_Version < Ada_2005 then
Error_Msg_SP
("LIMITED in derived type is an Ada 2005 extension");
Error_Msg_SP
("\unit must be compiled with -gnat05 switch");
end if;
elsif Token = Tok_Synchronized then
Set_Synchronized_Present (Def_Node);
Scan; -- past SYNCHRONIZED
if Ada_Version < Ada_2005 then
Error_Msg_SP
("SYNCHRONIZED in derived type is an Ada 2005 extension");
Error_Msg_SP
("\unit must be compiled with -gnat05 switch");
end if;
end if;
if Token = Tok_Abstract then
Scan; -- past ABSTRACT, diagnosed already in caller.
end if;
Scan; -- past NEW;
Set_Subtype_Mark (Def_Node, P_Subtype_Mark);
No_Constraint;
-- Ada 2005 (AI-251): Deal with interfaces
if Token = Tok_And then
Scan; -- past AND
if Ada_Version < Ada_2005 then
Error_Msg_SP
("abstract interface is an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
end if;
Set_Interface_List (Def_Node, New_List);
loop
Append (P_Qualified_Simple_Name, Interface_List (Def_Node));
exit when Token /= Tok_And;
Scan; -- past AND
end loop;
end if;
if Token = Tok_With then
if Ada_Version >= Ada_2020 and not Next_Token_Is (Tok_Private) then
-- Formal type has aspect specifications, parsed later.
-- Otherwise this is a formal derived type. Note that it may
-- also include later aspect specifications, as in:
-- type DT is new T with private with atomic;
return Def_Node;
else
Scan; -- past WITH
Set_Private_Present (Def_Node, True);
T_Private;
end if;
elsif Token = Tok_Tagged then
Scan;
if Token = Tok_Private then
Error_Msg_SC -- CODEFIX
("TAGGED should be WITH");
Set_Private_Present (Def_Node, True);
T_Private;
else
Ignore (Tok_Tagged);
end if;
end if;
return Def_Node;
end P_Formal_Derived_Type_Definition;
---------------------------------------------
-- 12.5.2 Formal Discrete Type Definition --
---------------------------------------------
-- FORMAL_DISCRETE_TYPE_DEFINITION ::= (<>)
-- The caller has checked the initial token is left paren
-- Error recovery: cannot raise Error_Resync
function P_Formal_Discrete_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node := New_Node (N_Formal_Discrete_Type_Definition, Token_Ptr);
Scan; -- past left paren
T_Box;
T_Right_Paren;
return Def_Node;
end P_Formal_Discrete_Type_Definition;
---------------------------------------------------
-- 12.5.2 Formal Signed Integer Type Definition --
---------------------------------------------------
-- FORMAL_SIGNED_INTEGER_TYPE_DEFINITION ::= range <>
-- The caller has checked the initial token is RANGE
-- Error recovery: cannot raise Error_Resync
function P_Formal_Signed_Integer_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node :=
New_Node (N_Formal_Signed_Integer_Type_Definition, Token_Ptr);
Scan; -- past RANGE
T_Box;
return Def_Node;
end P_Formal_Signed_Integer_Type_Definition;
--------------------------------------------
-- 12.5.2 Formal Modular Type Definition --
--------------------------------------------
-- FORMAL_MODULAR_TYPE_DEFINITION ::= mod <>
-- The caller has checked the initial token is MOD
-- Error recovery: cannot raise Error_Resync
function P_Formal_Modular_Type_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node :=
New_Node (N_Formal_Modular_Type_Definition, Token_Ptr);
Scan; -- past MOD
T_Box;
return Def_Node;
end P_Formal_Modular_Type_Definition;
----------------------------------------------
-- 12.5.2 Formal Floating Point Definition --
----------------------------------------------
-- FORMAL_FLOATING_POINT_DEFINITION ::= digits <>
-- The caller has checked the initial token is DIGITS
-- Error recovery: cannot raise Error_Resync
function P_Formal_Floating_Point_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node :=
New_Node (N_Formal_Floating_Point_Definition, Token_Ptr);
Scan; -- past DIGITS
T_Box;
return Def_Node;
end P_Formal_Floating_Point_Definition;
-------------------------------------------
-- 12.5.2 Formal Fixed Point Definition --
-------------------------------------------
-- This routine parses either a formal ordinary fixed point definition
-- or a formal decimal fixed point definition:
-- FORMAL_ORDINARY_FIXED_POINT_DEFINITION ::= delta <>
-- FORMAL_DECIMAL_FIXED_POINT_DEFINITION ::= delta <> digits <>
-- The caller has checked the initial token is DELTA
-- Error recovery: cannot raise Error_Resync
function P_Formal_Fixed_Point_Definition return Node_Id is
Def_Node : Node_Id;
Delta_Sloc : Source_Ptr;
begin
Delta_Sloc := Token_Ptr;
Scan; -- past DELTA
T_Box;
if Token = Tok_Digits then
Def_Node :=
New_Node (N_Formal_Decimal_Fixed_Point_Definition, Delta_Sloc);
Scan; -- past DIGITS
T_Box;
else
Def_Node :=
New_Node (N_Formal_Ordinary_Fixed_Point_Definition, Delta_Sloc);
end if;
return Def_Node;
end P_Formal_Fixed_Point_Definition;
----------------------------------------------------
-- 12.5.2 Formal Ordinary Fixed Point Definition --
----------------------------------------------------
-- Parsed by P_Formal_Fixed_Point_Definition (12.5.2)
---------------------------------------------------
-- 12.5.2 Formal Decimal Fixed Point Definition --
---------------------------------------------------
-- Parsed by P_Formal_Fixed_Point_Definition (12.5.2)
------------------------------------------
-- 12.5.3 Formal Array Type Definition --
------------------------------------------
-- Parsed by P_Formal_Type_Definition (12.5)
-------------------------------------------
-- 12.5.4 Formal Access Type Definition --
-------------------------------------------
-- Parsed by P_Formal_Type_Definition (12.5)
-----------------------------------------
-- 12.6 Formal Subprogram Declaration --
-----------------------------------------
-- FORMAL_SUBPROGRAM_DECLARATION ::=
-- FORMAL_CONCRETE_SUBPROGRAM_DECLARATION
-- | FORMAL_ABSTRACT_SUBPROGRAM_DECLARATION
-- FORMAL_CONCRETE_SUBPROGRAM_DECLARATION ::=
-- with SUBPROGRAM_SPECIFICATION [is SUBPROGRAM_DEFAULT]
-- [ASPECT_SPECIFICATIONS];
-- FORMAL_ABSTRACT_SUBPROGRAM_DECLARATION ::=
-- with SUBPROGRAM_SPECIFICATION is abstract [SUBPROGRAM_DEFAULT]
-- [ASPECT_SPECIFICATIONS];
-- SUBPROGRAM_DEFAULT ::= DEFAULT_NAME | <>
-- DEFAULT_NAME ::= NAME | null
-- The caller has checked that the initial tokens are WITH FUNCTION or
-- WITH PROCEDURE, and the initial WITH has been scanned out.
-- A null default is an Ada 2005 feature
-- Error recovery: cannot raise Error_Resync
function P_Formal_Subprogram_Declaration return Node_Id is
Prev_Sloc : constant Source_Ptr := Prev_Token_Ptr;
Spec_Node : constant Node_Id := P_Subprogram_Specification;
Def_Node : Node_Id;
begin
if Token = Tok_Is then
T_Is; -- past IS, skip extra IS or ";"
if Token = Tok_Abstract then
Def_Node :=
New_Node (N_Formal_Abstract_Subprogram_Declaration, Prev_Sloc);
Scan; -- past ABSTRACT
if Ada_Version < Ada_2005 then
Error_Msg_SP
("formal abstract subprograms are an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
end if;
else
Def_Node :=
New_Node (N_Formal_Concrete_Subprogram_Declaration, Prev_Sloc);
end if;
Set_Specification (Def_Node, Spec_Node);
if Token = Tok_Semicolon then
null;
elsif Aspect_Specifications_Present then
null;
elsif Token = Tok_Box then
Set_Box_Present (Def_Node, True);
Scan; -- past <>
elsif Token = Tok_Null then
if Ada_Version < Ada_2005 then
Error_Msg_SP
("null default subprograms are an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
end if;
if Nkind (Spec_Node) = N_Procedure_Specification then
Set_Null_Present (Spec_Node);
else
Error_Msg_SP ("only procedures can be null");
end if;
Scan; -- past NULL
else
Set_Default_Name (Def_Node, P_Name);
end if;
else
Def_Node :=
New_Node (N_Formal_Concrete_Subprogram_Declaration, Prev_Sloc);
Set_Specification (Def_Node, Spec_Node);
end if;
P_Aspect_Specifications (Def_Node);
return Def_Node;
end P_Formal_Subprogram_Declaration;
------------------------------
-- 12.6 Subprogram Default --
------------------------------
-- Parsed by P_Formal_Procedure_Declaration (12.6)
------------------------
-- 12.6 Default Name --
------------------------
-- Parsed by P_Formal_Procedure_Declaration (12.6)
--------------------------------------
-- 12.7 Formal Package Declaration --
--------------------------------------
-- FORMAL_PACKAGE_DECLARATION ::=
-- with package DEFINING_IDENTIFIER
-- is new generic_package_NAME FORMAL_PACKAGE_ACTUAL_PART
-- [ASPECT_SPECIFICATIONS];
-- FORMAL_PACKAGE_ACTUAL_PART ::=
-- ([OTHERS =>] <>) |
-- [GENERIC_ACTUAL_PART]
-- (FORMAL_PACKAGE_ASSOCIATION {, FORMAL_PACKAGE_ASSOCIATION}
-- [, OTHERS => <>)
-- FORMAL_PACKAGE_ASSOCIATION ::=
-- GENERIC_ASSOCIATION
-- | GENERIC_FORMAL_PARAMETER_SELECTOR_NAME => <>
-- The caller has checked that the initial tokens are WITH PACKAGE,
-- and the initial WITH has been scanned out (so Token = Tok_Package).
-- Error recovery: cannot raise Error_Resync
function P_Formal_Package_Declaration return Node_Id is
Def_Node : Node_Id;
Scan_State : Saved_Scan_State;
begin
Def_Node := New_Node (N_Formal_Package_Declaration, Prev_Token_Ptr);
Scan; -- past PACKAGE
Set_Defining_Identifier (Def_Node, P_Defining_Identifier (C_Is));
T_Is;
T_New;
Set_Name (Def_Node, P_Qualified_Simple_Name);
if Token = Tok_Left_Paren then
Save_Scan_State (Scan_State); -- at the left paren
Scan; -- past the left paren
if Token = Tok_Box then
Set_Box_Present (Def_Node, True);
Scan; -- past box
T_Right_Paren;
else
Restore_Scan_State (Scan_State); -- to the left paren
Set_Generic_Associations (Def_Node, P_Generic_Actual_Part_Opt);
end if;
end if;
P_Aspect_Specifications (Def_Node);
return Def_Node;
end P_Formal_Package_Declaration;
--------------------------------------
-- 12.7 Formal Package Actual Part --
--------------------------------------
-- Parsed by P_Formal_Package_Declaration (12.7)
end Ch12;
| 32.501137 | 78 | 0.573725 |
cb6b62326d0de5f33bbc5a445d0689e37c9cebea | 2,065 | ads | Ada | src/kafka-topic.ads | Latence-Technologies/Kafka-Ada | c11a99bb57e174ec1025d3db46154d124efa2222 | [
"MIT"
] | null | null | null | src/kafka-topic.ads | Latence-Technologies/Kafka-Ada | c11a99bb57e174ec1025d3db46154d124efa2222 | [
"MIT"
] | 3 | 2022-03-30T19:02:53.000Z | 2022-03-30T19:03:45.000Z | src/kafka-topic.ads | Latence-Technologies/Kafka-Ada | c11a99bb57e174ec1025d3db46154d124efa2222 | [
"MIT"
] | null | null | null | --
-- Provides kafka functionality to interact with Topics
--
package Kafka.Topic is
--
-- Creates a handle for a given topic. Does not perform the admin command
-- to create a topic
--
-- librdkafka equivalent: rd_kafka_topic_new
--
function Create_Topic_Handle(Handle : Handle_Type;
Topic : String;
Config : Topic_Config_Type) return Topic_Type;
--
-- Creates a handle for a given topic. Does not perform the admin command
-- to create a topic
--
-- librdkafka equivalent: rd_kafka_topic_new
--
function Create_Topic_Handle(Handle : Handle_Type;
Topic : String) return Topic_Type;
--
-- Destroys the specified topic handle
--
-- librdkafka equivalent: rd_kafka_topic_destroy
--
procedure Destroy_Topic_Handle(Topic : Topic_Type)
with Import => True,
Convention => C,
External_Name => "rd_kafka_topic_destroy";
--
-- Returns the name of a given topic
--
-- librdkafka equivalent: rd_kafka_topic_name
--
function Get_Name(Topic : Topic_Type) return String;
--
-- Returns the opaque for a given topic
--
-- librdkafka equivalent: rd_kafka_topic_opaque
--
function Get_Opaque(Topic : Topic_Type) return System.Address
with Import => True,
Convention => C,
External_Name => "rd_kafka_topic_opaque";
private
function rd_kafka_topic_new(Handle : Handle_Type;
Topic : chars_ptr;
Config : Topic_Config_Type) return Topic_Type
with Import => True,
Convention => C,
External_Name => "rd_kafka_topic_new";
function rd_kafka_topic_name(Topic : Topic_Type) return chars_ptr
with Import => True,
Convention => C,
External_Name => "rd_kafka_topic_name";
end Kafka.Topic;
| 30.367647 | 79 | 0.582082 |
d0455887a482c28d63aa9fdf6aab25568570e140 | 133,188 | adb | Ada | apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d/conv2d/hls_target/.autopilot/db/call_Loop_LB2D_buf_p.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/call_Loop_LB2D_buf_p.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/call_Loop_LB2D_buf_p.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>call_Loop_LB2D_buf_p</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>in_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&lt;PackedStencil&lt;unsigned int, 1, 1, 1, 1&gt; &gt;.V.value.V</originalName>
<rtlName></rtlName>
<coreName>FIFO_SRL</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>3</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>slice_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>96</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>43</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_3">
<Value>
<Obj>
<type>0</type>
<id>7</id>
<name>buffer_0_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>168</lineNumber>
<contextFuncName>call</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/big_apps_8_shifts/conv2d</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>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>168</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>buffer[0].value.V</originalName>
<rtlName></rtlName>
<coreName>RAM</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>71</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_4">
<Value>
<Obj>
<type>0</type>
<id>8</id>
<name>buffer_1_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>168</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>168</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>buffer[1].value.V</originalName>
<rtlName></rtlName>
<coreName>RAM</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>72</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_5">
<Value>
<Obj>
<type>0</type>
<id>9</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>73</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_6">
<Value>
<Obj>
<type>0</type>
<id>11</id>
<name>write_idx_1</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>write_idx_1</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>75</item>
<item>76</item>
<item>77</item>
<item>78</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_7">
<Value>
<Obj>
<type>0</type>
<id>12</id>
<name>row</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>row</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>11</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>80</item>
<item>81</item>
<item>82</item>
<item>83</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_8">
<Value>
<Obj>
<type>0</type>
<id>13</id>
<name>tmp</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>177</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>177</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>84</item>
<item>86</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_9">
<Value>
<Obj>
<type>0</type>
<id>15</id>
<name>row_1</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>177</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>177</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>row</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>11</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>87</item>
<item>89</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_10">
<Value>
<Obj>
<type>0</type>
<id>16</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>177</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>177</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>90</item>
<item>91</item>
<item>92</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_11">
<Value>
<Obj>
<type>0</type>
<id>20</id>
<name>tmp_6</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>187</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>187</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>10</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>113</item>
<item>114</item>
<item>116</item>
<item>118</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_12">
<Value>
<Obj>
<type>0</type>
<id>21</id>
<name>icmp</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>187</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>187</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>119</item>
<item>121</item>
</oprand_edges>
<opcode>icmp</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>../../../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>179</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>179</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>122</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_14">
<Value>
<Obj>
<type>0</type>
<id>24</id>
<name>write_idx_1_1</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>211</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>211</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>96</item>
<item>97</item>
<item>98</item>
<item>99</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_15">
<Value>
<Obj>
<type>0</type>
<id>25</id>
<name>col</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>col</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>11</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>100</item>
<item>101</item>
<item>102</item>
<item>103</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_16">
<Value>
<Obj>
<type>0</type>
<id>26</id>
<name>tmp_1</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>179</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>179</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>104</item>
<item>106</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>27</id>
<name>col_1</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>179</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>179</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>col</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>11</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>107</item>
<item>108</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>28</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>179</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>179</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>109</item>
<item>110</item>
<item>111</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>30</id>
<name>col_cast</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>179</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>179</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>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>34</id>
<name>tmp_7</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>183</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>183</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>63</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>133</item>
<item>134</item>
<item>135</item>
<item>137</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>35</id>
<name>icmp1</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>183</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>183</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>138</item>
<item>140</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_22">
<Value>
<Obj>
<type>0</type>
<id>36</id>
<name>write_idx_1_3</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>184</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>184</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>write_idx_1</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>141</item>
<item>143</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>37</id>
<name>p_write_idx_1_1</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>183</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>183</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>144</item>
<item>145</item>
<item>146</item>
</oprand_edges>
<opcode>select</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_24">
<Value>
<Obj>
<type>0</type>
<id>38</id>
<name>tmp_value_V_2</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>186</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>186</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>tmp.value.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>148</item>
<item>149</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_25">
<Value>
<Obj>
<type>0</type>
<id>39</id>
<name>buffer_0_value_V_ad</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>179</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>179</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>11</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>150</item>
<item>151</item>
<item>152</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_26">
<Value>
<Obj>
<type>0</type>
<id>40</id>
<name>buffer_0_value_V_lo</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>198</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>198</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>153</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_27">
<Value>
<Obj>
<type>0</type>
<id>41</id>
<name>buffer_1_value_V_ad</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>179</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>179</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>11</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>154</item>
<item>155</item>
<item>156</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_28">
<Value>
<Obj>
<type>0</type>
<id>42</id>
<name>buffer_1_value_V_lo</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>198</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>198</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>157</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_29">
<Value>
<Obj>
<type>0</type>
<id>43</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>187</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>187</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>158</item>
<item>159</item>
<item>160</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_30">
<Value>
<Obj>
<type>0</type>
<id>45</id>
<name>tmp_8</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>183</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>183</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>161</item>
</oprand_edges>
<opcode>trunc</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_31">
<Value>
<Obj>
<type>0</type>
<id>46</id>
<name>p_Val2_2_0_phi</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>198</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>198</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>162</item>
<item>163</item>
<item>164</item>
</oprand_edges>
<opcode>select</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_32">
<Value>
<Obj>
<type>0</type>
<id>47</id>
<name>p_Val2_2_1_phi</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>198</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>198</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>165</item>
<item>166</item>
<item>167</item>
</oprand_edges>
<opcode>select</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_33">
<Value>
<Obj>
<type>0</type>
<id>48</id>
<name>p_Result_s</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>206</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>206</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>__Result__</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>96</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>169</item>
<item>170</item>
<item>171</item>
<item>172</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_34">
<Value>
<Obj>
<type>0</type>
<id>49</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>207</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>207</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>174</item>
<item>175</item>
<item>176</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_35">
<Value>
<Obj>
<type>0</type>
<id>50</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>208</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>208</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>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_36">
<Value>
<Obj>
<type>0</type>
<id>52</id>
<name>tmp_9</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>183</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>183</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>127</item>
</oprand_edges>
<opcode>trunc</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_37">
<Value>
<Obj>
<type>0</type>
<id>53</id>
<name></name>
<fileName>../../../lib_files/Stencil.h</fileName>
<fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d</fileDirectory>
<lineNumber>75</lineNumber>
<contextFuncName>operator=</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>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>209</second>
</item>
<item>
<first>
<first>../../../lib_files/Stencil.h</first>
<second>operator=</second>
</first>
<second>75</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>128</item>
<item>129</item>
<item>130</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_38">
<Value>
<Obj>
<type>0</type>
<id>55</id>
<name></name>
<fileName>../../../lib_files/Stencil.h</fileName>
<fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d</fileDirectory>
<lineNumber>75</lineNumber>
<contextFuncName>operator=</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>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>209</second>
</item>
<item>
<first>
<first>../../../lib_files/Stencil.h</first>
<second>operator=</second>
</first>
<second>75</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>124</item>
<item>125</item>
<item>297</item>
</oprand_edges>
<opcode>store</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_39">
<Value>
<Obj>
<type>0</type>
<id>56</id>
<name></name>
<fileName>../../../lib_files/Stencil.h</fileName>
<fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d</fileDirectory>
<lineNumber>75</lineNumber>
<contextFuncName>operator=</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>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>209</second>
</item>
<item>
<first>
<first>../../../lib_files/Stencil.h</first>
<second>operator=</second>
</first>
<second>75</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>126</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_40">
<Value>
<Obj>
<type>0</type>
<id>58</id>
<name></name>
<fileName>../../../lib_files/Stencil.h</fileName>
<fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d</fileDirectory>
<lineNumber>75</lineNumber>
<contextFuncName>operator=</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>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>209</second>
</item>
<item>
<first>
<first>../../../lib_files/Stencil.h</first>
<second>operator=</second>
</first>
<second>75</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>178</item>
<item>179</item>
<item>296</item>
</oprand_edges>
<opcode>store</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_41">
<Value>
<Obj>
<type>0</type>
<id>59</id>
<name></name>
<fileName>../../../lib_files/Stencil.h</fileName>
<fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d</fileDirectory>
<lineNumber>75</lineNumber>
<contextFuncName>operator=</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>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>209</second>
</item>
<item>
<first>
<first>../../../lib_files/Stencil.h</first>
<second>operator=</second>
</first>
<second>75</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>180</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_42">
<Value>
<Obj>
<type>0</type>
<id>62</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>179</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>179</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>123</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_43">
<Value>
<Obj>
<type>0</type>
<id>64</id>
<name>write_idx_1_2</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>211</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>211</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>write_idx_1</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>93</item>
<item>94</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_44">
<Value>
<Obj>
<type>0</type>
<id>66</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>177</lineNumber>
<contextFuncName>call</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>call</second>
</first>
<second>177</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>95</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_45">
<Value>
<Obj>
<type>0</type>
<id>68</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>12</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_46">
<Value>
<Obj>
<type>2</type>
<id>70</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="_47">
<Value>
<Obj>
<type>2</type>
<id>74</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="_48">
<Value>
<Obj>
<type>2</type>
<id>79</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>11</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_49">
<Value>
<Obj>
<type>2</type>
<id>85</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>11</bitwidth>
</Value>
<const_type>0</const_type>
<content>1080</content>
</item>
<item class_id_reference="16" object_id="_50">
<Value>
<Obj>
<type>2</type>
<id>88</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>11</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_51">
<Value>
<Obj>
<type>2</type>
<id>105</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>11</bitwidth>
</Value>
<const_type>0</const_type>
<content>1920</content>
</item>
<item class_id_reference="16" object_id="_52">
<Value>
<Obj>
<type>2</type>
<id>115</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>1</content>
</item>
<item class_id_reference="16" object_id="_53">
<Value>
<Obj>
<type>2</type>
<id>117</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>10</content>
</item>
<item class_id_reference="16" object_id="_54">
<Value>
<Obj>
<type>2</type>
<id>120</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>10</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>136</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>63</content>
</item>
<item class_id_reference="16" object_id="_56">
<Value>
<Obj>
<type>2</type>
<id>139</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>63</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_57">
<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>64</bitwidth>
</Value>
<const_type>0</const_type>
<content>18446744073709551614</content>
</item>
</consts>
<blocks class_id="17" tracking_level="0" version="0">
<count>12</count>
<item_version>0</item_version>
<item class_id="18" tracking_level="1" version="0" object_id="_58">
<Obj>
<type>3</type>
<id>10</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>3</count>
<item_version>0</item_version>
<item>7</item>
<item>8</item>
<item>9</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_59">
<Obj>
<type>3</type>
<id>17</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>5</count>
<item_version>0</item_version>
<item>11</item>
<item>12</item>
<item>13</item>
<item>15</item>
<item>16</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_60">
<Obj>
<type>3</type>
<id>23</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>3</count>
<item_version>0</item_version>
<item>20</item>
<item>21</item>
<item>22</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_61">
<Obj>
<type>3</type>
<id>29</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>5</count>
<item_version>0</item_version>
<item>24</item>
<item>25</item>
<item>26</item>
<item>27</item>
<item>28</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_62">
<Obj>
<type>3</type>
<id>44</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>11</count>
<item_version>0</item_version>
<item>30</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>
</node_objs>
</item>
<item class_id_reference="18" object_id="_63">
<Obj>
<type>3</type>
<id>51</id>
<name>.preheader56.preheader.critedge.0</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>6</count>
<item_version>0</item_version>
<item>45</item>
<item>46</item>
<item>47</item>
<item>48</item>
<item>49</item>
<item>50</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_64">
<Obj>
<type>3</type>
<id>54</id>
<name>._crit_edge</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="_65">
<Obj>
<type>3</type>
<id>57</id>
<name>branch4</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>55</item>
<item>56</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_66">
<Obj>
<type>3</type>
<id>60</id>
<name>branch5</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>58</item>
<item>59</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_67">
<Obj>
<type>3</type>
<id>63</id>
<name>._crit_edge33</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>62</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_68">
<Obj>
<type>3</type>
<id>67</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>64</item>
<item>66</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_69">
<Obj>
<type>3</type>
<id>69</id>
<name>.preheader.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>68</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>106</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_70">
<id>71</id>
<edge_type>1</edge_type>
<source_obj>70</source_obj>
<sink_obj>7</sink_obj>
</item>
<item class_id_reference="20" object_id="_71">
<id>72</id>
<edge_type>1</edge_type>
<source_obj>70</source_obj>
<sink_obj>8</sink_obj>
</item>
<item class_id_reference="20" object_id="_72">
<id>73</id>
<edge_type>2</edge_type>
<source_obj>17</source_obj>
<sink_obj>9</sink_obj>
</item>
<item class_id_reference="20" object_id="_73">
<id>75</id>
<edge_type>1</edge_type>
<source_obj>74</source_obj>
<sink_obj>11</sink_obj>
</item>
<item class_id_reference="20" object_id="_74">
<id>76</id>
<edge_type>2</edge_type>
<source_obj>10</source_obj>
<sink_obj>11</sink_obj>
</item>
<item class_id_reference="20" object_id="_75">
<id>77</id>
<edge_type>1</edge_type>
<source_obj>64</source_obj>
<sink_obj>11</sink_obj>
</item>
<item class_id_reference="20" object_id="_76">
<id>78</id>
<edge_type>2</edge_type>
<source_obj>67</source_obj>
<sink_obj>11</sink_obj>
</item>
<item class_id_reference="20" object_id="_77">
<id>80</id>
<edge_type>1</edge_type>
<source_obj>79</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_78">
<id>81</id>
<edge_type>2</edge_type>
<source_obj>10</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_79">
<id>82</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_80">
<id>83</id>
<edge_type>2</edge_type>
<source_obj>67</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_81">
<id>84</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>13</sink_obj>
</item>
<item class_id_reference="20" object_id="_82">
<id>86</id>
<edge_type>1</edge_type>
<source_obj>85</source_obj>
<sink_obj>13</sink_obj>
</item>
<item class_id_reference="20" object_id="_83">
<id>87</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>15</sink_obj>
</item>
<item class_id_reference="20" object_id="_84">
<id>89</id>
<edge_type>1</edge_type>
<source_obj>88</source_obj>
<sink_obj>15</sink_obj>
</item>
<item class_id_reference="20" object_id="_85">
<id>90</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>16</sink_obj>
</item>
<item class_id_reference="20" object_id="_86">
<id>91</id>
<edge_type>2</edge_type>
<source_obj>23</source_obj>
<sink_obj>16</sink_obj>
</item>
<item class_id_reference="20" object_id="_87">
<id>92</id>
<edge_type>2</edge_type>
<source_obj>69</source_obj>
<sink_obj>16</sink_obj>
</item>
<item class_id_reference="20" object_id="_88">
<id>93</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>64</sink_obj>
</item>
<item class_id_reference="20" object_id="_89">
<id>94</id>
<edge_type>1</edge_type>
<source_obj>70</source_obj>
<sink_obj>64</sink_obj>
</item>
<item class_id_reference="20" object_id="_90">
<id>95</id>
<edge_type>2</edge_type>
<source_obj>17</source_obj>
<sink_obj>66</sink_obj>
</item>
<item class_id_reference="20" object_id="_91">
<id>96</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="20" object_id="_92">
<id>97</id>
<edge_type>2</edge_type>
<source_obj>23</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="20" object_id="_93">
<id>98</id>
<edge_type>1</edge_type>
<source_obj>37</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="20" object_id="_94">
<id>99</id>
<edge_type>2</edge_type>
<source_obj>63</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="20" object_id="_95">
<id>100</id>
<edge_type>1</edge_type>
<source_obj>79</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_96">
<id>101</id>
<edge_type>2</edge_type>
<source_obj>23</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_97">
<id>102</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_98">
<id>103</id>
<edge_type>2</edge_type>
<source_obj>63</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_99">
<id>104</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>26</sink_obj>
</item>
<item class_id_reference="20" object_id="_100">
<id>106</id>
<edge_type>1</edge_type>
<source_obj>105</source_obj>
<sink_obj>26</sink_obj>
</item>
<item class_id_reference="20" object_id="_101">
<id>107</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>27</sink_obj>
</item>
<item class_id_reference="20" object_id="_102">
<id>108</id>
<edge_type>1</edge_type>
<source_obj>88</source_obj>
<sink_obj>27</sink_obj>
</item>
<item class_id_reference="20" object_id="_103">
<id>109</id>
<edge_type>1</edge_type>
<source_obj>26</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="20" object_id="_104">
<id>110</id>
<edge_type>2</edge_type>
<source_obj>44</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="20" object_id="_105">
<id>111</id>
<edge_type>2</edge_type>
<source_obj>67</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="20" object_id="_106">
<id>114</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>20</sink_obj>
</item>
<item class_id_reference="20" object_id="_107">
<id>116</id>
<edge_type>1</edge_type>
<source_obj>115</source_obj>
<sink_obj>20</sink_obj>
</item>
<item class_id_reference="20" object_id="_108">
<id>118</id>
<edge_type>1</edge_type>
<source_obj>117</source_obj>
<sink_obj>20</sink_obj>
</item>
<item class_id_reference="20" object_id="_109">
<id>119</id>
<edge_type>1</edge_type>
<source_obj>20</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="20" object_id="_110">
<id>121</id>
<edge_type>1</edge_type>
<source_obj>120</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="20" object_id="_111">
<id>122</id>
<edge_type>2</edge_type>
<source_obj>29</source_obj>
<sink_obj>22</sink_obj>
</item>
<item class_id_reference="20" object_id="_112">
<id>123</id>
<edge_type>2</edge_type>
<source_obj>29</source_obj>
<sink_obj>62</sink_obj>
</item>
<item class_id_reference="20" object_id="_113">
<id>124</id>
<edge_type>1</edge_type>
<source_obj>38</source_obj>
<sink_obj>55</sink_obj>
</item>
<item class_id_reference="20" object_id="_114">
<id>125</id>
<edge_type>1</edge_type>
<source_obj>39</source_obj>
<sink_obj>55</sink_obj>
</item>
<item class_id_reference="20" object_id="_115">
<id>126</id>
<edge_type>2</edge_type>
<source_obj>63</source_obj>
<sink_obj>56</sink_obj>
</item>
<item class_id_reference="20" object_id="_116">
<id>127</id>
<edge_type>1</edge_type>
<source_obj>37</source_obj>
<sink_obj>52</sink_obj>
</item>
<item class_id_reference="20" object_id="_117">
<id>128</id>
<edge_type>1</edge_type>
<source_obj>52</source_obj>
<sink_obj>53</sink_obj>
</item>
<item class_id_reference="20" object_id="_118">
<id>129</id>
<edge_type>2</edge_type>
<source_obj>57</source_obj>
<sink_obj>53</sink_obj>
</item>
<item class_id_reference="20" object_id="_119">
<id>130</id>
<edge_type>2</edge_type>
<source_obj>60</source_obj>
<sink_obj>53</sink_obj>
</item>
<item class_id_reference="20" object_id="_120">
<id>131</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="20" object_id="_121">
<id>134</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_122">
<id>135</id>
<edge_type>1</edge_type>
<source_obj>115</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_123">
<id>137</id>
<edge_type>1</edge_type>
<source_obj>136</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_124">
<id>138</id>
<edge_type>1</edge_type>
<source_obj>34</source_obj>
<sink_obj>35</sink_obj>
</item>
<item class_id_reference="20" object_id="_125">
<id>140</id>
<edge_type>1</edge_type>
<source_obj>139</source_obj>
<sink_obj>35</sink_obj>
</item>
<item class_id_reference="20" object_id="_126">
<id>141</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>36</sink_obj>
</item>
<item class_id_reference="20" object_id="_127">
<id>143</id>
<edge_type>1</edge_type>
<source_obj>142</source_obj>
<sink_obj>36</sink_obj>
</item>
<item class_id_reference="20" object_id="_128">
<id>144</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_129">
<id>145</id>
<edge_type>1</edge_type>
<source_obj>36</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_130">
<id>146</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_131">
<id>149</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>38</sink_obj>
</item>
<item class_id_reference="20" object_id="_132">
<id>150</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>39</sink_obj>
</item>
<item class_id_reference="20" object_id="_133">
<id>151</id>
<edge_type>1</edge_type>
<source_obj>74</source_obj>
<sink_obj>39</sink_obj>
</item>
<item class_id_reference="20" object_id="_134">
<id>152</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>39</sink_obj>
</item>
<item class_id_reference="20" object_id="_135">
<id>153</id>
<edge_type>1</edge_type>
<source_obj>39</source_obj>
<sink_obj>40</sink_obj>
</item>
<item class_id_reference="20" object_id="_136">
<id>154</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>41</sink_obj>
</item>
<item class_id_reference="20" object_id="_137">
<id>155</id>
<edge_type>1</edge_type>
<source_obj>74</source_obj>
<sink_obj>41</sink_obj>
</item>
<item class_id_reference="20" object_id="_138">
<id>156</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>41</sink_obj>
</item>
<item class_id_reference="20" object_id="_139">
<id>157</id>
<edge_type>1</edge_type>
<source_obj>41</source_obj>
<sink_obj>42</sink_obj>
</item>
<item class_id_reference="20" object_id="_140">
<id>158</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_141">
<id>159</id>
<edge_type>2</edge_type>
<source_obj>51</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_142">
<id>160</id>
<edge_type>2</edge_type>
<source_obj>54</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_143">
<id>161</id>
<edge_type>1</edge_type>
<source_obj>37</source_obj>
<sink_obj>45</sink_obj>
</item>
<item class_id_reference="20" object_id="_144">
<id>162</id>
<edge_type>1</edge_type>
<source_obj>45</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_145">
<id>163</id>
<edge_type>1</edge_type>
<source_obj>42</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_146">
<id>164</id>
<edge_type>1</edge_type>
<source_obj>40</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_147">
<id>165</id>
<edge_type>1</edge_type>
<source_obj>45</source_obj>
<sink_obj>47</sink_obj>
</item>
<item class_id_reference="20" object_id="_148">
<id>166</id>
<edge_type>1</edge_type>
<source_obj>40</source_obj>
<sink_obj>47</sink_obj>
</item>
<item class_id_reference="20" object_id="_149">
<id>167</id>
<edge_type>1</edge_type>
<source_obj>42</source_obj>
<sink_obj>47</sink_obj>
</item>
<item class_id_reference="20" object_id="_150">
<id>170</id>
<edge_type>1</edge_type>
<source_obj>38</source_obj>
<sink_obj>48</sink_obj>
</item>
<item class_id_reference="20" object_id="_151">
<id>171</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>48</sink_obj>
</item>
<item class_id_reference="20" object_id="_152">
<id>172</id>
<edge_type>1</edge_type>
<source_obj>46</source_obj>
<sink_obj>48</sink_obj>
</item>
<item class_id_reference="20" object_id="_153">
<id>175</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>49</sink_obj>
</item>
<item class_id_reference="20" object_id="_154">
<id>176</id>
<edge_type>1</edge_type>
<source_obj>48</source_obj>
<sink_obj>49</sink_obj>
</item>
<item class_id_reference="20" object_id="_155">
<id>177</id>
<edge_type>2</edge_type>
<source_obj>54</source_obj>
<sink_obj>50</sink_obj>
</item>
<item class_id_reference="20" object_id="_156">
<id>178</id>
<edge_type>1</edge_type>
<source_obj>38</source_obj>
<sink_obj>58</sink_obj>
</item>
<item class_id_reference="20" object_id="_157">
<id>179</id>
<edge_type>1</edge_type>
<source_obj>41</source_obj>
<sink_obj>58</sink_obj>
</item>
<item class_id_reference="20" object_id="_158">
<id>180</id>
<edge_type>2</edge_type>
<source_obj>63</source_obj>
<sink_obj>59</sink_obj>
</item>
<item class_id_reference="20" object_id="_159">
<id>281</id>
<edge_type>2</edge_type>
<source_obj>10</source_obj>
<sink_obj>17</sink_obj>
</item>
<item class_id_reference="20" object_id="_160">
<id>282</id>
<edge_type>2</edge_type>
<source_obj>17</source_obj>
<sink_obj>69</sink_obj>
</item>
<item class_id_reference="20" object_id="_161">
<id>283</id>
<edge_type>2</edge_type>
<source_obj>17</source_obj>
<sink_obj>23</sink_obj>
</item>
<item class_id_reference="20" object_id="_162">
<id>284</id>
<edge_type>2</edge_type>
<source_obj>23</source_obj>
<sink_obj>29</sink_obj>
</item>
<item class_id_reference="20" object_id="_163">
<id>285</id>
<edge_type>2</edge_type>
<source_obj>29</source_obj>
<sink_obj>67</sink_obj>
</item>
<item class_id_reference="20" object_id="_164">
<id>286</id>
<edge_type>2</edge_type>
<source_obj>29</source_obj>
<sink_obj>44</sink_obj>
</item>
<item class_id_reference="20" object_id="_165">
<id>287</id>
<edge_type>2</edge_type>
<source_obj>44</source_obj>
<sink_obj>54</sink_obj>
</item>
<item class_id_reference="20" object_id="_166">
<id>288</id>
<edge_type>2</edge_type>
<source_obj>44</source_obj>
<sink_obj>51</sink_obj>
</item>
<item class_id_reference="20" object_id="_167">
<id>289</id>
<edge_type>2</edge_type>
<source_obj>51</source_obj>
<sink_obj>54</sink_obj>
</item>
<item class_id_reference="20" object_id="_168">
<id>290</id>
<edge_type>2</edge_type>
<source_obj>54</source_obj>
<sink_obj>60</sink_obj>
</item>
<item class_id_reference="20" object_id="_169">
<id>291</id>
<edge_type>2</edge_type>
<source_obj>54</source_obj>
<sink_obj>57</sink_obj>
</item>
<item class_id_reference="20" object_id="_170">
<id>292</id>
<edge_type>2</edge_type>
<source_obj>57</source_obj>
<sink_obj>63</sink_obj>
</item>
<item class_id_reference="20" object_id="_171">
<id>293</id>
<edge_type>2</edge_type>
<source_obj>60</source_obj>
<sink_obj>63</sink_obj>
</item>
<item class_id_reference="20" object_id="_172">
<id>294</id>
<edge_type>2</edge_type>
<source_obj>63</source_obj>
<sink_obj>29</sink_obj>
</item>
<item class_id_reference="20" object_id="_173">
<id>295</id>
<edge_type>2</edge_type>
<source_obj>67</source_obj>
<sink_obj>17</sink_obj>
</item>
<item class_id_reference="20" object_id="_174">
<id>296</id>
<edge_type>4</edge_type>
<source_obj>42</source_obj>
<sink_obj>58</sink_obj>
</item>
<item class_id_reference="20" object_id="_175">
<id>297</id>
<edge_type>4</edge_type>
<source_obj>40</source_obj>
<sink_obj>55</sink_obj>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="21" tracking_level="0" version="0">
<count>7</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="1" version="0" object_id="_176">
<mId>1</mId>
<mTag>call_Loop_LB2D_buf_p</mTag>
<mType>0</mType>
<sub_regions>
<count>3</count>
<item_version>0</item_version>
<item>2</item>
<item>3</item>
<item>7</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>2077921</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_177">
<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>10</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="_178">
<mId>3</mId>
<mTag>LB2D_buf</mTag>
<mType>1</mType>
<sub_regions>
<count>3</count>
<item_version>0</item_version>
<item>4</item>
<item>5</item>
<item>6</item>
</sub_regions>
<basic_blocks>
<count>0</count>
<item_version>0</item_version>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>1080</mMinTripCount>
<mMaxTripCount>1080</mMaxTripCount>
<mMinLatency>2077920</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_179">
<mId>4</mId>
<mTag>Region 1</mTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>2</count>
<item_version>0</item_version>
<item>17</item>
<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>
<item class_id_reference="22" object_id="_180">
<mId>5</mId>
<mTag>LB2D_buf.1</mTag>
<mType>1</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>7</count>
<item_version>0</item_version>
<item>29</item>
<item>44</item>
<item>51</item>
<item>54</item>
<item>57</item>
<item>60</item>
<item>63</item>
</basic_blocks>
<mII>1</mII>
<mDepth>3</mDepth>
<mMinTripCount>1920</mMinTripCount>
<mMaxTripCount>1920</mMaxTripCount>
<mMinLatency>1921</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_181">
<mId>6</mId>
<mTag>Region 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>67</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="_182">
<mId>7</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>69</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="_183">
<states class_id="25" tracking_level="0" version="0">
<count>6</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>7</count>
<item_version>0</item_version>
<item class_id="28" tracking_level="1" version="0" object_id="_185">
<id>3</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_186">
<id>4</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_187">
<id>5</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_188">
<id>6</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_189">
<id>7</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_190">
<id>8</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_191">
<id>9</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_192">
<id>2</id>
<operations>
<count>12</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_193">
<id>11</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_194">
<id>12</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_195">
<id>13</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_196">
<id>14</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_197">
<id>15</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_198">
<id>16</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_199">
<id>18</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_200">
<id>19</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_201">
<id>20</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_202">
<id>21</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_203">
<id>22</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_204">
<id>68</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_205">
<id>3</id>
<operations>
<count>13</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_206">
<id>24</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_207">
<id>25</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_208">
<id>26</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_209">
<id>27</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_210">
<id>28</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_211">
<id>30</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_212">
<id>34</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_213">
<id>35</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_214">
<id>39</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_215">
<id>40</id>
<stage>2</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_216">
<id>41</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_217">
<id>42</id>
<stage>2</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_218">
<id>43</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_219">
<id>4</id>
<operations>
<count>8</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_220">
<id>36</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_221">
<id>37</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_222">
<id>38</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_223">
<id>40</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_224">
<id>42</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="28" object_id="_225">
<id>45</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_226">
<id>52</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_227">
<id>53</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_228">
<id>5</id>
<operations>
<count>14</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_229">
<id>31</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_230">
<id>32</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_231">
<id>33</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_232">
<id>46</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_233">
<id>47</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_234">
<id>48</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_235">
<id>49</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_236">
<id>50</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_237">
<id>55</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_238">
<id>56</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_239">
<id>58</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_240">
<id>59</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>62</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_243">
<id>6</id>
<operations>
<count>3</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_244">
<id>64</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_245">
<id>65</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_246">
<id>66</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
</states>
<transitions class_id="29" tracking_level="0" version="0">
<count>7</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="1" version="0" object_id="_247">
<inState>1</inState>
<outState>2</outState>
<condition class_id="31" tracking_level="0" version="0">
<id>55</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="_248">
<inState>2</inState>
<outState>3</outState>
<condition>
<id>57</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>13</first>
<second>0</second>
</first>
<second>1</second>
</item>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_249">
<inState>6</inState>
<outState>2</outState>
<condition>
<id>68</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>4</inState>
<outState>5</outState>
<condition>
<id>70</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>5</inState>
<outState>3</outState>
<condition>
<id>71</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="_252">
<inState>3</inState>
<outState>6</outState>
<condition>
<id>69</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>26</first>
<second>0</second>
</first>
<second>0</second>
</item>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_253">
<inState>3</inState>
<outState>4</outState>
<condition>
<id>72</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>26</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>43</count>
<item_version>0</item_version>
<item class_id="38" tracking_level="0" version="0">
<first>7</first>
<second class_id="39" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>8</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>9</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>11</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>12</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>13</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>15</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>20</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>21</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>22</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>24</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>25</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>26</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>27</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>28</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>30</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>34</first>
<second>
<first>2</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>3</first>
<second>0</second>
</second>
</item>
<item>
<first>37</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>38</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>39</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>40</first>
<second>
<first>2</first>
<second>1</second>
</second>
</item>
<item>
<first>41</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>42</first>
<second>
<first>2</first>
<second>1</second>
</second>
</item>
<item>
<first>43</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>45</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>46</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>47</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>48</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>49</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>50</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>52</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>53</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>55</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>56</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>58</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>59</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>62</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>64</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>66</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>68</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="40" tracking_level="0" version="0">
<count>12</count>
<item_version>0</item_version>
<item class_id="41" tracking_level="0" version="0">
<first>10</first>
<second class_id="42" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>17</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>23</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>29</first>
<second>
<first>2</first>
<second>2</second>
</second>
</item>
<item>
<first>44</first>
<second>
<first>2</first>
<second>4</second>
</second>
</item>
<item>
<first>51</first>
<second>
<first>3</first>
<second>4</second>
</second>
</item>
<item>
<first>54</first>
<second>
<first>3</first>
<second>3</second>
</second>
</item>
<item>
<first>57</first>
<second>
<first>4</first>
<second>4</second>
</second>
</item>
<item>
<first>60</first>
<second>
<first>4</first>
<second>4</second>
</second>
</item>
<item>
<first>63</first>
<second>
<first>4</first>
<second>4</second>
</second>
</item>
<item>
<first>67</first>
<second>
<first>3</first>
<second>3</second>
</second>
</item>
<item>
<first>69</first>
<second>
<first>1</first>
<second>1</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="_254">
<region_name>LB2D_buf.1</region_name>
<basic_blocks>
<count>7</count>
<item_version>0</item_version>
<item>29</item>
<item>44</item>
<item>51</item>
<item>54</item>
<item>57</item>
<item>60</item>
<item>63</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>
</item>
</regions>
<dp_fu_nodes class_id="45" tracking_level="0" version="0">
<count>29</count>
<item_version>0</item_version>
<item class_id="46" tracking_level="0" version="0">
<first>74</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>7</item>
</second>
</item>
<item>
<first>78</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>8</item>
</second>
</item>
<item>
<first>82</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>38</item>
</second>
</item>
<item>
<first>88</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>49</item>
</second>
</item>
<item>
<first>95</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
<item>
<first>101</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>40</item>
<item>40</item>
<item>55</item>
</second>
</item>
<item>
<first>106</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</second>
</item>
<item>
<first>112</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>42</item>
<item>42</item>
<item>58</item>
</second>
</item>
<item>
<first>127</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>139</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>149</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>161</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>168</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
<item>
<first>174</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>180</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>20</item>
</second>
</item>
<item>
<first>190</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>196</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>202</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>208</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>214</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>224</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>35</item>
</second>
</item>
<item>
<first>230</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>236</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>243</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>247</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>52</item>
</second>
</item>
<item>
<first>251</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
<item>
<first>256</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>261</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>48</item>
</second>
</item>
<item>
<first>271</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</second>
</item>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="48" tracking_level="0" version="0">
<count>25</count>
<item_version>0</item_version>
<item class_id="49" tracking_level="0" version="0">
<first>buffer_0_value_V_ad_gep_fu_95</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
<item>
<first>buffer_0_value_V_alloca_fu_74</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>7</item>
</second>
</item>
<item>
<first>buffer_1_value_V_ad_gep_fu_106</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</second>
</item>
<item>
<first>buffer_1_value_V_alloca_fu_78</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>8</item>
</second>
</item>
<item>
<first>col_1_fu_202</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>col_cast_fu_208</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>col_phi_fu_161</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>icmp1_fu_224</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>35</item>
</second>
</item>
<item>
<first>icmp_fu_190</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>p_Result_s_fu_261</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>48</item>
</second>
</item>
<item>
<first>p_Val2_2_0_phi_fu_251</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
<item>
<first>p_Val2_2_1_phi_fu_256</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>p_write_idx_1_1_fu_236</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>row_1_fu_174</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>row_phi_fu_139</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>tmp_1_fu_196</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>tmp_6_fu_180</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>20</item>
</second>
</item>
<item>
<first>tmp_7_fu_214</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>tmp_8_fu_243</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>tmp_9_fu_247</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>52</item>
</second>
</item>
<item>
<first>tmp_fu_168</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
<item>
<first>write_idx_1_1_phi_fu_149</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>write_idx_1_2_fu_271</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</second>
</item>
<item>
<first>write_idx_1_3_fu_230</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>write_idx_1_phi_fu_127</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</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_53_write_fu_88</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>49</item>
</second>
</item>
<item>
<first>tmp_value_V_2_read_fu_82</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>38</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>4</count>
<item_version>0</item_version>
<item class_id="51" tracking_level="0" version="0">
<first class_id="52" tracking_level="0" version="0">
<first>buffer_0_value_V</first>
<second>0</second>
</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>40</item>
<item>40</item>
</second>
</item>
<item>
<first>
<first>buffer_0_value_V</first>
<second>1</second>
</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>55</item>
</second>
</item>
<item>
<first>
<first>buffer_1_value_V</first>
<second>0</second>
</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>42</item>
<item>42</item>
</second>
</item>
<item>
<first>
<first>buffer_1_value_V</first>
<second>1</second>
</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>58</item>
</second>
</item>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>19</count>
<item_version>0</item_version>
<item>
<first>123</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>135</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>146</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>157</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>277</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
<item>
<first>281</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>286</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>290</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>27</item>
</second>
</item>
<item>
<first>299</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>35</item>
</second>
</item>
<item>
<first>304</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
<item>
<first>310</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</second>
</item>
<item>
<first>316</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>321</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>38</item>
</second>
</item>
<item>
<first>328</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>40</item>
</second>
</item>
<item>
<first>334</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>42</item>
</second>
</item>
<item>
<first>340</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>346</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>52</item>
</second>
</item>
<item>
<first>350</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</second>
</item>
</dp_reg_nodes>
<dp_regname_nodes>
<count>19</count>
<item_version>0</item_version>
<item>
<first>buffer_0_value_V_ad_reg_304</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
<item>
<first>buffer_0_value_V_lo_reg_328</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>40</item>
</second>
</item>
<item>
<first>buffer_1_value_V_ad_reg_310</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</second>
</item>
<item>
<first>buffer_1_value_V_lo_reg_334</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>42</item>
</second>
</item>
<item>
<first>col_1_reg_294</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>col_reg_157</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>icmp1_reg_299</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>35</item>
</second>
</item>
<item>
<first>icmp_reg_286</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>p_write_idx_1_1_reg_316</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>row_1_reg_281</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>row_reg_135</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>tmp_1_reg_290</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>tmp_8_reg_340</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>tmp_9_reg_346</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>52</item>
</second>
</item>
<item>
<first>tmp_reg_277</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
<item>
<first>tmp_value_V_2_reg_321</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>38</item>
</second>
</item>
<item>
<first>write_idx_1_1_reg_146</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>write_idx_1_2_reg_350</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</second>
</item>
<item>
<first>write_idx_1_reg_123</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
</dp_regname_nodes>
<dp_reg_phi>
<count>4</count>
<item_version>0</item_version>
<item>
<first>123</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>135</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>146</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>157</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
</dp_reg_phi>
<dp_regname_phi>
<count>4</count>
<item_version>0</item_version>
<item>
<first>col_reg_157</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>row_reg_135</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>write_idx_1_1_reg_146</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>write_idx_1_reg_123</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
</dp_regname_phi>
<dp_port_io_nodes class_id="53" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="54" tracking_level="0" version="0">
<first>in_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>38</item>
</second>
</item>
</second>
</item>
<item>
<first>slice_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>49</item>
</second>
</item>
</second>
</item>
</dp_port_io_nodes>
<port2core class_id="55" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="56" tracking_level="0" version="0">
<first>1</first>
<second>FIFO_SRL</second>
</item>
<item>
<first>2</first>
<second>FIFO_SRL</second>
</item>
</port2core>
<node2core>
<count>2</count>
<item_version>0</item_version>
<item>
<first>7</first>
<second>RAM</second>
</item>
<item>
<first>8</first>
<second>RAM</second>
</item>
</node2core>
</syndb>
</boost_serialization>
| 25.86677 | 135 | 0.591375 |
d0cc6ffc8baed280f1b08043b2b5cef48dbebacd | 53,752 | adb | Ada | Validation/pyFrame3DD-master/gcc-master/gcc/ada/erroutc.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/erroutc.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/erroutc.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E R R O U T C --
-- --
-- B o d y --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- Warning: Error messages can be generated during Gigi processing by direct
-- calls to error message routines, so it is essential that the processing
-- in this body be consistent with the requirements for the Gigi processing
-- environment, and that in particular, no disallowed table expansion is
-- allowed to occur.
with Atree; use Atree;
with Casing; use Casing;
with Csets; use Csets;
with Debug; use Debug;
with Err_Vars; use Err_Vars;
with Fname; use Fname;
with Namet; use Namet;
with Opt; use Opt;
with Output; use Output;
with Sinput; use Sinput;
with Snames; use Snames;
with Stringt; use Stringt;
with Targparm;
with Uintp; use Uintp;
with Widechar; use Widechar;
package body Erroutc is
-----------------------
-- Local Subprograms --
-----------------------
function Matches (S : String; P : String) return Boolean;
-- Returns true if the String S matches the pattern P, which can contain
-- wildcard chars (*). The entire pattern must match the entire string.
-- Case is ignored in the comparison (so X matches x).
function Sloc_In_Range (Loc, Start, Stop : Source_Ptr) return Boolean;
-- Return whether Loc is in the range Start .. Stop, taking instantiation
-- locations of Loc into account. This is useful for suppressing warnings
-- from generic instantiations by using pragma Warnings around generic
-- instances, as needed in GNATprove.
---------------
-- Add_Class --
---------------
procedure Add_Class is
begin
if Class_Flag then
Class_Flag := False;
Set_Msg_Char (''');
Get_Name_String (Name_Class);
Set_Casing (Identifier_Casing (Flag_Source));
Set_Msg_Name_Buffer;
end if;
end Add_Class;
----------------------
-- Buffer_Ends_With --
----------------------
function Buffer_Ends_With (C : Character) return Boolean is
begin
return Msglen > 0 and then Msg_Buffer (Msglen) = C;
end Buffer_Ends_With;
function Buffer_Ends_With (S : String) return Boolean is
Len : constant Natural := S'Length;
begin
return Msglen > Len
and then Msg_Buffer (Msglen - Len) = ' '
and then Msg_Buffer (Msglen - Len + 1 .. Msglen) = S;
end Buffer_Ends_With;
-------------------
-- Buffer_Remove --
-------------------
procedure Buffer_Remove (C : Character) is
begin
if Buffer_Ends_With (C) then
Msglen := Msglen - 1;
end if;
end Buffer_Remove;
procedure Buffer_Remove (S : String) is
begin
if Buffer_Ends_With (S) then
Msglen := Msglen - S'Length;
end if;
end Buffer_Remove;
-----------------------------
-- Check_Duplicate_Message --
-----------------------------
procedure Check_Duplicate_Message (M1, M2 : Error_Msg_Id) is
L1, L2 : Error_Msg_Id;
N1, N2 : Error_Msg_Id;
procedure Delete_Msg (Delete, Keep : Error_Msg_Id);
-- Called to delete message Delete, keeping message Keep. Marks msg
-- Delete and all its continuations with deleted flag set to True.
-- Also makes sure that for the error messages that are retained the
-- preferred message is the one retained (we prefer the shorter one in
-- the case where one has an Instance tag). Note that we always know
-- that Keep has at least as many continuations as Delete (since we
-- always delete the shorter sequence).
----------------
-- Delete_Msg --
----------------
procedure Delete_Msg (Delete, Keep : Error_Msg_Id) is
D, K : Error_Msg_Id;
begin
D := Delete;
K := Keep;
loop
Errors.Table (D).Deleted := True;
-- Adjust error message count
if Errors.Table (D).Info then
if Errors.Table (D).Warn then
Warning_Info_Messages := Warning_Info_Messages - 1;
Warnings_Detected := Warnings_Detected - 1;
else
Report_Info_Messages := Report_Info_Messages - 1;
end if;
elsif Errors.Table (D).Warn or else Errors.Table (D).Style then
Warnings_Detected := Warnings_Detected - 1;
-- Note: we do not need to decrement Warnings_Treated_As_Errors
-- because this only gets incremented if we actually output the
-- message, which we won't do if we are deleting it here!
elsif Errors.Table (D).Check then
Check_Messages := Check_Messages - 1;
else
Total_Errors_Detected := Total_Errors_Detected - 1;
if Errors.Table (D).Serious then
Serious_Errors_Detected := Serious_Errors_Detected - 1;
end if;
end if;
-- Substitute shorter of the two error messages
if Errors.Table (K).Text'Length > Errors.Table (D).Text'Length then
Errors.Table (K).Text := Errors.Table (D).Text;
end if;
D := Errors.Table (D).Next;
K := Errors.Table (K).Next;
if D = No_Error_Msg or else not Errors.Table (D).Msg_Cont then
return;
end if;
end loop;
end Delete_Msg;
-- Start of processing for Check_Duplicate_Message
begin
-- Both messages must be non-continuation messages and not deleted
if Errors.Table (M1).Msg_Cont
or else Errors.Table (M2).Msg_Cont
or else Errors.Table (M1).Deleted
or else Errors.Table (M2).Deleted
then
return;
end if;
-- Definitely not equal if message text does not match
if not Same_Error (M1, M2) then
return;
end if;
-- Same text. See if all continuations are also identical
L1 := M1;
L2 := M2;
loop
N1 := Errors.Table (L1).Next;
N2 := Errors.Table (L2).Next;
-- If M1 continuations have run out, we delete M1, either the
-- messages have the same number of continuations, or M2 has
-- more and we prefer the one with more anyway.
if N1 = No_Error_Msg or else not Errors.Table (N1).Msg_Cont then
Delete_Msg (M1, M2);
return;
-- If M2 continuations have run out, we delete M2
elsif N2 = No_Error_Msg or else not Errors.Table (N2).Msg_Cont then
Delete_Msg (M2, M1);
return;
-- Otherwise see if continuations are the same, if not, keep both
-- sequences, a curious case, but better to keep everything.
elsif not Same_Error (N1, N2) then
return;
-- If continuations are the same, continue scan
else
L1 := N1;
L2 := N2;
end if;
end loop;
end Check_Duplicate_Message;
------------------------
-- Compilation_Errors --
------------------------
function Compilation_Errors return Boolean is
Warnings_Count : constant Int
:= Warnings_Detected - Warning_Info_Messages;
begin
if Total_Errors_Detected /= 0 then
return True;
elsif Warnings_Treated_As_Errors /= 0 then
return True;
-- We should never treat warnings that originate from a
-- Compile_Time_Warning pragma as an error. Warnings_Count is the sum
-- of both "normal" and Compile_Time_Warning warnings. This means that
-- there are only one or more non-Compile_Time_Warning warnings when
-- Warnings_Count is greater than Count_Compile_Time_Pragma_Warnings.
elsif Warning_Mode = Treat_As_Error
and then Warnings_Count > Count_Compile_Time_Pragma_Warnings
then
return True;
end if;
return False;
end Compilation_Errors;
----------------------------------------
-- Count_Compile_Time_Pragma_Warnings --
----------------------------------------
function Count_Compile_Time_Pragma_Warnings return Int is
Result : Int := 0;
begin
for J in 1 .. Errors.Last loop
begin
if Errors.Table (J).Warn and Errors.Table (J).Compile_Time_Pragma
then
Result := Result + 1;
end if;
end;
end loop;
return Result;
end Count_Compile_Time_Pragma_Warnings;
------------------
-- Debug_Output --
------------------
procedure Debug_Output (N : Node_Id) is
begin
if Debug_Flag_1 then
Write_Str ("*** following error message posted on node id = #");
Write_Int (Int (N));
Write_Str (" ***");
Write_Eol;
end if;
end Debug_Output;
----------
-- dmsg --
----------
procedure dmsg (Id : Error_Msg_Id) is
E : Error_Msg_Object renames Errors.Table (Id);
begin
w ("Dumping error message, Id = ", Int (Id));
w (" Text = ", E.Text.all);
w (" Next = ", Int (E.Next));
w (" Prev = ", Int (E.Prev));
w (" Sfile = ", Int (E.Sfile));
Write_Str
(" Sptr = ");
Write_Location (E.Sptr);
Write_Eol;
Write_Str
(" Optr = ");
Write_Location (E.Optr);
Write_Eol;
w (" Line = ", Int (E.Line));
w (" Col = ", Int (E.Col));
w (" Warn = ", E.Warn);
w (" Warn_Err = ", E.Warn_Err);
w (" Warn_Chr = '" & E.Warn_Chr & ''');
w (" Style = ", E.Style);
w (" Serious = ", E.Serious);
w (" Uncond = ", E.Uncond);
w (" Msg_Cont = ", E.Msg_Cont);
w (" Deleted = ", E.Deleted);
w (" Node = ", Int (E.Node));
Write_Eol;
end dmsg;
------------------
-- Get_Location --
------------------
function Get_Location (E : Error_Msg_Id) return Source_Ptr is
begin
return Errors.Table (E).Sptr;
end Get_Location;
----------------
-- Get_Msg_Id --
----------------
function Get_Msg_Id return Error_Msg_Id is
begin
return Cur_Msg;
end Get_Msg_Id;
---------------------
-- Get_Warning_Tag --
---------------------
function Get_Warning_Tag (Id : Error_Msg_Id) return String is
Warn : constant Boolean := Errors.Table (Id).Warn;
Warn_Chr : constant Character := Errors.Table (Id).Warn_Chr;
begin
if Warn and then Warn_Chr /= ' ' then
if Warn_Chr = '?' then
return "[enabled by default]";
elsif Warn_Chr = '*' then
return "[restriction warning]";
elsif Warn_Chr = '$' then
return "[-gnatel]";
elsif Warn_Chr in 'a' .. 'z' then
return "[-gnatw" & Warn_Chr & ']';
else pragma Assert (Warn_Chr in 'A' .. 'Z');
return "[-gnatw." & Fold_Lower (Warn_Chr) & ']';
end if;
else
return "";
end if;
end Get_Warning_Tag;
-------------
-- Matches --
-------------
function Matches (S : String; P : String) return Boolean is
Slast : constant Natural := S'Last;
PLast : constant Natural := P'Last;
SPtr : Natural := S'First;
PPtr : Natural := P'First;
begin
-- Loop advancing through characters of string and pattern
SPtr := S'First;
PPtr := P'First;
loop
-- Return True if pattern is a single asterisk
if PPtr = PLast and then P (PPtr) = '*' then
return True;
-- Return True if both pattern and string exhausted
elsif PPtr > PLast and then SPtr > Slast then
return True;
-- Return False, if one exhausted and not the other
elsif PPtr > PLast or else SPtr > Slast then
return False;
-- Case where pattern starts with asterisk
elsif P (PPtr) = '*' then
-- Try all possible starting positions in S for match with the
-- remaining characters of the pattern. This is the recursive
-- call that implements the scanner backup.
for J in SPtr .. Slast loop
if Matches (S (J .. Slast), P (PPtr + 1 .. PLast)) then
return True;
end if;
end loop;
return False;
-- Dealt with end of string and *, advance if we have a match
elsif Fold_Lower (S (SPtr)) = Fold_Lower (P (PPtr)) then
SPtr := SPtr + 1;
PPtr := PPtr + 1;
-- If first characters do not match, that's decisive
else
return False;
end if;
end loop;
end Matches;
-----------------------
-- Output_Error_Msgs --
-----------------------
procedure Output_Error_Msgs (E : in out Error_Msg_Id) is
P : Source_Ptr;
T : Error_Msg_Id;
S : Error_Msg_Id;
Flag_Num : Pos;
Mult_Flags : Boolean := False;
begin
S := E;
-- Skip deleted messages at start
if Errors.Table (S).Deleted then
Set_Next_Non_Deleted_Msg (S);
end if;
-- Figure out if we will place more than one error flag on this line
T := S;
while T /= No_Error_Msg
and then Errors.Table (T).Line = Errors.Table (E).Line
and then Errors.Table (T).Sfile = Errors.Table (E).Sfile
loop
if Errors.Table (T).Sptr > Errors.Table (E).Sptr then
Mult_Flags := True;
end if;
Set_Next_Non_Deleted_Msg (T);
end loop;
-- Output the error flags. The circuit here makes sure that the tab
-- characters in the original line are properly accounted for. The
-- eight blanks at the start are to match the line number.
if not Debug_Flag_2 then
Write_Str (" ");
P := Line_Start (Errors.Table (E).Sptr);
Flag_Num := 1;
-- Loop through error messages for this line to place flags
T := S;
while T /= No_Error_Msg
and then Errors.Table (T).Line = Errors.Table (E).Line
and then Errors.Table (T).Sfile = Errors.Table (E).Sfile
loop
declare
Src : Source_Buffer_Ptr
renames Source_Text (Errors.Table (T).Sfile);
begin
-- Loop to output blanks till current flag position
while P < Errors.Table (T).Sptr loop
-- Horizontal tab case, just echo the tab
if Src (P) = ASCII.HT then
Write_Char (ASCII.HT);
P := P + 1;
-- Deal with wide character case, but don't include brackets
-- notation in this circuit, since we know that this will
-- display unencoded (no one encodes brackets notation).
elsif Src (P) /= '['
and then Is_Start_Of_Wide_Char (Src, P)
then
Skip_Wide (Src, P);
Write_Char (' ');
-- Normal non-wide character case (or bracket)
else
P := P + 1;
Write_Char (' ');
end if;
end loop;
-- Output flag (unless already output, this happens if more
-- than one error message occurs at the same flag position).
if P = Errors.Table (T).Sptr then
if (Flag_Num = 1 and then not Mult_Flags)
or else Flag_Num > 9
then
Write_Char ('|');
else
Write_Char
(Character'Val (Character'Pos ('0') + Flag_Num));
end if;
-- Skip past the corresponding source text character
-- Horizontal tab case, we output a flag at the tab position
-- so now we output a tab to match up with the text.
if Src (P) = ASCII.HT then
Write_Char (ASCII.HT);
P := P + 1;
-- Skip wide character other than left bracket
elsif Src (P) /= '['
and then Is_Start_Of_Wide_Char (Src, P)
then
Skip_Wide (Src, P);
-- Skip normal non-wide character case (or bracket)
else
P := P + 1;
end if;
end if;
end;
Set_Next_Non_Deleted_Msg (T);
Flag_Num := Flag_Num + 1;
end loop;
Write_Eol;
end if;
-- Now output the error messages
T := S;
while T /= No_Error_Msg
and then Errors.Table (T).Line = Errors.Table (E).Line
and then Errors.Table (T).Sfile = Errors.Table (E).Sfile
loop
Write_Str (" >>> ");
Output_Msg_Text (T);
if Debug_Flag_2 then
while Column < 74 loop
Write_Char (' ');
end loop;
Write_Str (" <<<");
end if;
Write_Eol;
Set_Next_Non_Deleted_Msg (T);
end loop;
E := T;
end Output_Error_Msgs;
------------------------
-- Output_Line_Number --
------------------------
procedure Output_Line_Number (L : Logical_Line_Number) is
D : Int; -- next digit
C : Character; -- next character
Z : Boolean; -- flag for zero suppress
N, M : Int; -- temporaries
begin
if L = No_Line_Number then
Write_Str (" ");
else
Z := False;
N := Int (L);
M := 100_000;
while M /= 0 loop
D := Int (N / M);
N := N rem M;
M := M / 10;
if D = 0 then
if Z then
C := '0';
else
C := ' ';
end if;
else
Z := True;
C := Character'Val (D + 48);
end if;
Write_Char (C);
end loop;
Write_Str (". ");
end if;
end Output_Line_Number;
---------------------
-- Output_Msg_Text --
---------------------
procedure Output_Msg_Text (E : Error_Msg_Id) is
Offs : constant Nat := Column - 1;
-- Offset to start of message, used for continuations
Max : Integer;
-- Maximum characters to output on next line
Length : Nat;
-- Maximum total length of lines
E_Msg : Error_Msg_Object renames Errors.Table (E);
Text : constant String_Ptr := E_Msg.Text;
Ptr : Natural;
Split : Natural;
Start : Natural;
Tag : constant String := Get_Warning_Tag (E);
Txt : String_Ptr;
Len : Natural;
begin
-- Postfix warning tag to message if needed
if Tag /= "" and then Warning_Doc_Switch then
if Include_Subprogram_In_Messages then
Txt :=
new String'
(Subprogram_Name_Ptr (E_Msg.Node) &
": " & Text.all & ' ' & Tag);
else
Txt := new String'(Text.all & ' ' & Tag);
end if;
elsif Include_Subprogram_In_Messages
and then (E_Msg.Warn or else E_Msg.Style)
then
Txt :=
new String'(Subprogram_Name_Ptr (E_Msg.Node) & ": " & Text.all);
else
Txt := Text;
end if;
-- If -gnatdF is used, continuation messages follow the main message
-- with only an indentation of two space characters, without repeating
-- any prefix.
if Debug_Flag_FF and then E_Msg.Msg_Cont then
null;
-- For info messages, prefix message with "info: "
elsif E_Msg.Info then
Txt := new String'("info: " & Txt.all);
-- Warning treated as error
elsif E_Msg.Warn_Err then
-- We prefix with "error:" rather than warning: and postfix
-- [warning-as-error] at the end.
Warnings_Treated_As_Errors := Warnings_Treated_As_Errors + 1;
Txt := new String'("error: " & Txt.all & " [warning-as-error]");
-- Normal warning, prefix with "warning: "
elsif E_Msg.Warn then
Txt := new String'("warning: " & Txt.all);
-- No prefix needed for style message, "(style)" is there already
elsif E_Msg.Style then
null;
-- No prefix needed for check message, severity is there already
elsif E_Msg.Check then
null;
-- All other cases, add "error: " if unique error tag set
elsif Opt.Unique_Error_Tag then
Txt := new String'("error: " & Txt.all);
end if;
-- Set error message line length and length of message
if Error_Msg_Line_Length = 0 then
Length := Nat'Last;
else
Length := Error_Msg_Line_Length;
end if;
Max := Integer (Length - Column + 1);
Len := Txt'Length;
-- Here we have to split the message up into multiple lines
Ptr := 1;
loop
-- Make sure we do not have ludicrously small line
Max := Integer'Max (Max, 20);
-- If remaining text fits, output it respecting LF and we are done
if Len - Ptr < Max then
for J in Ptr .. Len loop
if Txt (J) = ASCII.LF then
Write_Eol;
Write_Spaces (Offs);
else
Write_Char (Txt (J));
end if;
end loop;
return;
-- Line does not fit
else
Start := Ptr;
-- First scan forward looking for a hard end of line
for Scan in Ptr .. Ptr + Max - 1 loop
if Txt (Scan) = ASCII.LF then
Split := Scan - 1;
Ptr := Scan + 1;
goto Continue;
end if;
end loop;
-- Otherwise scan backwards looking for a space
for Scan in reverse Ptr .. Ptr + Max - 1 loop
if Txt (Scan) = ' ' then
Split := Scan - 1;
Ptr := Scan + 1;
goto Continue;
end if;
end loop;
-- If we fall through, no space, so split line arbitrarily
Split := Ptr + Max - 1;
Ptr := Split + 1;
end if;
<<Continue>>
if Start <= Split then
Write_Line (Txt (Start .. Split));
Write_Spaces (Offs);
end if;
Max := Integer (Length - Column + 1);
end loop;
end Output_Msg_Text;
---------------------
-- Prescan_Message --
---------------------
procedure Prescan_Message (Msg : String) is
J : Natural;
begin
-- Nothing to do for continuation line, unless -gnatdF is set
if not Debug_Flag_FF and then Msg (Msg'First) = '\' then
return;
-- Some global variables are not set for continuation messages, as they
-- only make sense for the initial mesage.
elsif Msg (Msg'First) /= '\' then
-- Set initial values of globals (may be changed during scan)
Is_Serious_Error := True;
Is_Unconditional_Msg := False;
Is_Warning_Msg := False;
-- Check style message
Is_Style_Msg :=
Msg'Length > 7
and then Msg (Msg'First .. Msg'First + 6) = "(style)";
-- Check info message
Is_Info_Msg :=
Msg'Length > 6
and then Msg (Msg'First .. Msg'First + 5) = "info: ";
-- Check check message
Is_Check_Msg :=
(Msg'Length > 8
and then Msg (Msg'First .. Msg'First + 7) = "medium: ")
or else
(Msg'Length > 6
and then Msg (Msg'First .. Msg'First + 5) = "high: ")
or else
(Msg'Length > 5
and then Msg (Msg'First .. Msg'First + 4) = "low: ");
end if;
Has_Double_Exclam := False;
Has_Insertion_Line := False;
-- Loop through message looking for relevant insertion sequences
J := Msg'First;
while J <= Msg'Last loop
-- If we have a quote, don't look at following character
if Msg (J) = ''' then
J := J + 2;
-- Warning message (? or < insertion sequence)
elsif Msg (J) = '?' or else Msg (J) = '<' then
Is_Warning_Msg := Msg (J) = '?' or else Error_Msg_Warn;
Warning_Msg_Char := ' ';
J := J + 1;
if Is_Warning_Msg then
declare
C : constant Character := Msg (J - 1);
begin
if J <= Msg'Last then
if Msg (J) = C then
Warning_Msg_Char := '?';
J := J + 1;
elsif J < Msg'Last and then Msg (J + 1) = C
and then (Msg (J) in 'a' .. 'z' or else
Msg (J) in 'A' .. 'Z' or else
Msg (J) = '*' or else
Msg (J) = '$')
then
Warning_Msg_Char := Msg (J);
J := J + 2;
end if;
end if;
end;
end if;
-- Bomb if untagged warning message. This code can be uncommented
-- for debugging when looking for untagged warning messages.
-- if Is_Warning_Msg and then Warning_Msg_Char = ' ' then
-- raise Program_Error;
-- end if;
-- Unconditional message (! insertion)
elsif Msg (J) = '!' then
Is_Unconditional_Msg := True;
J := J + 1;
if J <= Msg'Last and then Msg (J) = '!' then
Has_Double_Exclam := True;
J := J + 1;
end if;
-- Insertion line (# insertion)
elsif Msg (J) = '#' then
Has_Insertion_Line := True;
J := J + 1;
-- Non-serious error (| insertion)
elsif Msg (J) = '|' then
Is_Serious_Error := False;
J := J + 1;
else
J := J + 1;
end if;
end loop;
if Is_Info_Msg or Is_Warning_Msg or Is_Style_Msg or Is_Check_Msg then
Is_Serious_Error := False;
end if;
end Prescan_Message;
--------------------
-- Purge_Messages --
--------------------
procedure Purge_Messages (From : Source_Ptr; To : Source_Ptr) is
E : Error_Msg_Id;
function To_Be_Purged (E : Error_Msg_Id) return Boolean;
-- Returns True for a message that is to be purged. Also adjusts
-- error counts appropriately.
------------------
-- To_Be_Purged --
------------------
function To_Be_Purged (E : Error_Msg_Id) return Boolean is
begin
if E /= No_Error_Msg
and then Errors.Table (E).Sptr > From
and then Errors.Table (E).Sptr < To
then
if Errors.Table (E).Warn or else Errors.Table (E).Style then
Warnings_Detected := Warnings_Detected - 1;
else
Total_Errors_Detected := Total_Errors_Detected - 1;
if Errors.Table (E).Serious then
Serious_Errors_Detected := Serious_Errors_Detected - 1;
end if;
end if;
return True;
else
return False;
end if;
end To_Be_Purged;
-- Start of processing for Purge_Messages
begin
while To_Be_Purged (First_Error_Msg) loop
First_Error_Msg := Errors.Table (First_Error_Msg).Next;
end loop;
E := First_Error_Msg;
while E /= No_Error_Msg loop
while To_Be_Purged (Errors.Table (E).Next) loop
Errors.Table (E).Next :=
Errors.Table (Errors.Table (E).Next).Next;
end loop;
E := Errors.Table (E).Next;
end loop;
end Purge_Messages;
----------------
-- Same_Error --
----------------
function Same_Error (M1, M2 : Error_Msg_Id) return Boolean is
Msg1 : constant String_Ptr := Errors.Table (M1).Text;
Msg2 : constant String_Ptr := Errors.Table (M2).Text;
Msg2_Len : constant Integer := Msg2'Length;
Msg1_Len : constant Integer := Msg1'Length;
begin
return
Msg1.all = Msg2.all
or else
(Msg1_Len - 10 > Msg2_Len
and then
Msg2.all = Msg1.all (1 .. Msg2_Len)
and then
Msg1 (Msg2_Len + 1 .. Msg2_Len + 10) = ", instance")
or else
(Msg2_Len - 10 > Msg1_Len
and then
Msg1.all = Msg2.all (1 .. Msg1_Len)
and then
Msg2 (Msg1_Len + 1 .. Msg1_Len + 10) = ", instance");
end Same_Error;
-------------------
-- Set_Msg_Blank --
-------------------
procedure Set_Msg_Blank is
begin
if Msglen > 0
and then Msg_Buffer (Msglen) /= ' '
and then Msg_Buffer (Msglen) /= '('
and then Msg_Buffer (Msglen) /= '-'
and then not Manual_Quote_Mode
then
Set_Msg_Char (' ');
end if;
end Set_Msg_Blank;
-------------------------------
-- Set_Msg_Blank_Conditional --
-------------------------------
procedure Set_Msg_Blank_Conditional is
begin
if Msglen > 0
and then Msg_Buffer (Msglen) /= ' '
and then Msg_Buffer (Msglen) /= '('
and then Msg_Buffer (Msglen) /= '"'
and then not Manual_Quote_Mode
then
Set_Msg_Char (' ');
end if;
end Set_Msg_Blank_Conditional;
------------------
-- Set_Msg_Char --
------------------
procedure Set_Msg_Char (C : Character) is
begin
-- The check for message buffer overflow is needed to deal with cases
-- where insertions get too long (in particular a child unit name can
-- be very long).
if Msglen < Max_Msg_Length then
Msglen := Msglen + 1;
Msg_Buffer (Msglen) := C;
end if;
end Set_Msg_Char;
---------------------------------
-- Set_Msg_Insertion_File_Name --
---------------------------------
procedure Set_Msg_Insertion_File_Name is
begin
if Error_Msg_File_1 = No_File then
null;
elsif Error_Msg_File_1 = Error_File_Name then
Set_Msg_Blank;
Set_Msg_Str ("<error>");
else
Set_Msg_Blank;
Get_Name_String (Error_Msg_File_1);
Set_Msg_Quote;
Set_Msg_Name_Buffer;
Set_Msg_Quote;
end if;
-- The following assignments ensure that the second and third {
-- insertion characters will correspond to the Error_Msg_File_2 and
-- Error_Msg_File_3 values and We suppress possible validity checks in
-- case operating in -gnatVa mode, and Error_Msg_File_2 or
-- Error_Msg_File_3 is not needed and has not been set.
declare
pragma Suppress (Range_Check);
begin
Error_Msg_File_1 := Error_Msg_File_2;
Error_Msg_File_2 := Error_Msg_File_3;
end;
end Set_Msg_Insertion_File_Name;
-----------------------------------
-- Set_Msg_Insertion_Line_Number --
-----------------------------------
procedure Set_Msg_Insertion_Line_Number (Loc, Flag : Source_Ptr) is
Sindex_Loc : Source_File_Index;
Sindex_Flag : Source_File_Index;
Fname : File_Name_Type;
Int_File : Boolean;
procedure Set_At;
-- Outputs "at " unless last characters in buffer are " from ". Certain
-- messages read better with from than at.
------------
-- Set_At --
------------
procedure Set_At is
begin
if Msglen < 6
or else Msg_Buffer (Msglen - 5 .. Msglen) /= " from "
then
Set_Msg_Str ("at ");
end if;
end Set_At;
-- Start of processing for Set_Msg_Insertion_Line_Number
begin
Set_Msg_Blank;
if Loc = No_Location then
Set_At;
Set_Msg_Str ("unknown location");
elsif Loc = System_Location then
Set_Msg_Str ("in package System");
Set_Msg_Insertion_Run_Time_Name;
elsif Loc = Standard_Location then
Set_Msg_Str ("in package Standard");
elsif Loc = Standard_ASCII_Location then
Set_Msg_Str ("in package Standard.ASCII");
else
-- Add "at file-name:" if reference is to other than the source
-- file in which the error message is placed. Note that we check
-- full file names, rather than just the source indexes, to
-- deal with generic instantiations from the current file.
Sindex_Loc := Get_Source_File_Index (Loc);
Sindex_Flag := Get_Source_File_Index (Flag);
if Full_File_Name (Sindex_Loc) /= Full_File_Name (Sindex_Flag) then
Set_At;
Fname := Reference_Name (Get_Source_File_Index (Loc));
Int_File := Is_Internal_File_Name (Fname);
Get_Name_String (Fname);
Set_Msg_Name_Buffer;
if not (Int_File and Debug_Flag_Dot_K) then
Set_Msg_Char (':');
Set_Msg_Int (Int (Get_Logical_Line_Number (Loc)));
end if;
-- If in current file, add text "at line "
else
Set_At;
Set_Msg_Str ("line ");
Int_File := False;
Set_Msg_Int (Int (Get_Logical_Line_Number (Loc)));
end if;
-- Deal with the instantiation case. We may have a reference to,
-- e.g. a type, that is declared within a generic template, and
-- what we are really referring to is the occurrence in an instance.
-- In this case, the line number of the instantiation is also of
-- interest, and we add a notation:
-- , instance at xxx
-- where xxx is a line number output using this same routine (and
-- the recursion can go further if the instantiation is itself in
-- a generic template).
-- The flag location passed to us in this situation is indeed the
-- line number within the template, but as described in Sinput.L
-- (file sinput-l.ads, section "Handling Generic Instantiations")
-- we can retrieve the location of the instantiation itself from
-- this flag location value.
-- Note: this processing is suppressed if Suppress_Instance_Location
-- is set True. This is used to prevent redundant annotations of the
-- location of the instantiation in the case where we are placing
-- the messages on the instantiation in any case.
if Instantiation (Sindex_Loc) /= No_Location
and then not Suppress_Instance_Location
then
Set_Msg_Str (", instance ");
Set_Msg_Insertion_Line_Number (Instantiation (Sindex_Loc), Flag);
end if;
end if;
end Set_Msg_Insertion_Line_Number;
----------------------------
-- Set_Msg_Insertion_Name --
----------------------------
procedure Set_Msg_Insertion_Name is
begin
if Error_Msg_Name_1 = No_Name then
null;
elsif Error_Msg_Name_1 = Error_Name then
Set_Msg_Blank;
Set_Msg_Str ("<error>");
else
Set_Msg_Blank_Conditional;
Get_Unqualified_Decoded_Name_String (Error_Msg_Name_1);
-- Remove %s or %b at end. These come from unit names. If the
-- caller wanted the (unit) or (body), then they would have used
-- the $ insertion character. Certainly no error message should
-- ever have %b or %s explicitly occurring.
if Name_Len > 2
and then Name_Buffer (Name_Len - 1) = '%'
and then (Name_Buffer (Name_Len) = 'b'
or else
Name_Buffer (Name_Len) = 's')
then
Name_Len := Name_Len - 2;
end if;
-- Remove upper case letter at end, again, we should not be getting
-- such names, and what we hope is that the remainder makes sense.
if Name_Len > 1 and then Name_Buffer (Name_Len) in 'A' .. 'Z' then
Name_Len := Name_Len - 1;
end if;
-- If operator name or character literal name, just print it as is
-- Also print as is if it ends in a right paren (case of x'val(nnn))
if Name_Buffer (1) = '"'
or else Name_Buffer (1) = '''
or else Name_Buffer (Name_Len) = ')'
then
Set_Msg_Name_Buffer;
-- Else output with surrounding quotes in proper casing mode
else
Set_Casing (Identifier_Casing (Flag_Source));
Set_Msg_Quote;
Set_Msg_Name_Buffer;
Set_Msg_Quote;
end if;
end if;
-- The following assignments ensure that the second and third percent
-- insertion characters will correspond to the Error_Msg_Name_2 and
-- Error_Msg_Name_3 as required. We suppress possible validity checks in
-- case operating in -gnatVa mode, and Error_Msg_Name_1/2 is not needed
-- and has not been set.
declare
pragma Suppress (Range_Check);
begin
Error_Msg_Name_1 := Error_Msg_Name_2;
Error_Msg_Name_2 := Error_Msg_Name_3;
end;
end Set_Msg_Insertion_Name;
------------------------------------
-- Set_Msg_Insertion_Name_Literal --
------------------------------------
procedure Set_Msg_Insertion_Name_Literal is
begin
if Error_Msg_Name_1 = No_Name then
null;
elsif Error_Msg_Name_1 = Error_Name then
Set_Msg_Blank;
Set_Msg_Str ("<error>");
else
Set_Msg_Blank;
Get_Name_String (Error_Msg_Name_1);
Set_Msg_Quote;
Set_Msg_Name_Buffer;
Set_Msg_Quote;
end if;
-- The following assignments ensure that the second and third % or %%
-- insertion characters will correspond to the Error_Msg_Name_2 and
-- Error_Msg_Name_3 values and We suppress possible validity checks in
-- case operating in -gnatVa mode, and Error_Msg_Name_2 or
-- Error_Msg_Name_3 is not needed and has not been set.
declare
pragma Suppress (Range_Check);
begin
Error_Msg_Name_1 := Error_Msg_Name_2;
Error_Msg_Name_2 := Error_Msg_Name_3;
end;
end Set_Msg_Insertion_Name_Literal;
-------------------------------------
-- Set_Msg_Insertion_Reserved_Name --
-------------------------------------
procedure Set_Msg_Insertion_Reserved_Name is
begin
Set_Msg_Blank_Conditional;
Get_Name_String (Error_Msg_Name_1);
Set_Msg_Quote;
Set_Casing (Keyword_Casing (Flag_Source), All_Lower_Case);
Set_Msg_Name_Buffer;
Set_Msg_Quote;
end Set_Msg_Insertion_Reserved_Name;
-------------------------------------
-- Set_Msg_Insertion_Reserved_Word --
-------------------------------------
procedure Set_Msg_Insertion_Reserved_Word
(Text : String;
J : in out Integer)
is
begin
Set_Msg_Blank_Conditional;
Name_Len := 0;
while J <= Text'Last and then Text (J) in 'A' .. 'Z' loop
Add_Char_To_Name_Buffer (Text (J));
J := J + 1;
end loop;
-- Here is where we make the special exception for RM
if Name_Len = 2 and then Name_Buffer (1 .. 2) = "RM" then
Set_Msg_Name_Buffer;
-- We make a similar exception for SPARK
elsif Name_Len = 5 and then Name_Buffer (1 .. 5) = "SPARK" then
Set_Msg_Name_Buffer;
-- Neither RM nor SPARK: case appropriately and add surrounding quotes
else
Set_Casing (Keyword_Casing (Flag_Source), All_Lower_Case);
Set_Msg_Quote;
Set_Msg_Name_Buffer;
Set_Msg_Quote;
end if;
end Set_Msg_Insertion_Reserved_Word;
-------------------------------------
-- Set_Msg_Insertion_Run_Time_Name --
-------------------------------------
procedure Set_Msg_Insertion_Run_Time_Name is
begin
if Targparm.Run_Time_Name_On_Target /= No_Name then
Set_Msg_Blank_Conditional;
Set_Msg_Char ('(');
Get_Name_String (Targparm.Run_Time_Name_On_Target);
Set_Casing (Mixed_Case);
Set_Msg_Str (Name_Buffer (1 .. Name_Len));
Set_Msg_Char (')');
end if;
end Set_Msg_Insertion_Run_Time_Name;
----------------------------
-- Set_Msg_Insertion_Uint --
----------------------------
procedure Set_Msg_Insertion_Uint is
begin
Set_Msg_Blank;
UI_Image (Error_Msg_Uint_1);
for J in 1 .. UI_Image_Length loop
Set_Msg_Char (UI_Image_Buffer (J));
end loop;
-- The following assignment ensures that a second caret insertion
-- character will correspond to the Error_Msg_Uint_2 parameter. We
-- suppress possible validity checks in case operating in -gnatVa mode,
-- and Error_Msg_Uint_2 is not needed and has not been set.
declare
pragma Suppress (Range_Check);
begin
Error_Msg_Uint_1 := Error_Msg_Uint_2;
end;
end Set_Msg_Insertion_Uint;
-----------------
-- Set_Msg_Int --
-----------------
procedure Set_Msg_Int (Line : Int) is
begin
if Line > 9 then
Set_Msg_Int (Line / 10);
end if;
Set_Msg_Char (Character'Val (Character'Pos ('0') + (Line rem 10)));
end Set_Msg_Int;
-------------------------
-- Set_Msg_Name_Buffer --
-------------------------
procedure Set_Msg_Name_Buffer is
begin
Set_Msg_Str (Name_Buffer (1 .. Name_Len));
end Set_Msg_Name_Buffer;
-------------------
-- Set_Msg_Quote --
-------------------
procedure Set_Msg_Quote is
begin
if not Manual_Quote_Mode then
Set_Msg_Char ('"');
end if;
end Set_Msg_Quote;
-----------------
-- Set_Msg_Str --
-----------------
procedure Set_Msg_Str (Text : String) is
begin
-- Do replacement for special x'Class aspect names
if Text = "_Pre" then
Set_Msg_Str ("Pre'Class");
elsif Text = "_Post" then
Set_Msg_Str ("Post'Class");
elsif Text = "_Type_Invariant" then
Set_Msg_Str ("Type_Invariant'Class");
elsif Text = "_pre" then
Set_Msg_Str ("pre'class");
elsif Text = "_post" then
Set_Msg_Str ("post'class");
elsif Text = "_type_invariant" then
Set_Msg_Str ("type_invariant'class");
elsif Text = "_PRE" then
Set_Msg_Str ("PRE'CLASS");
elsif Text = "_POST" then
Set_Msg_Str ("POST'CLASS");
elsif Text = "_TYPE_INVARIANT" then
Set_Msg_Str ("TYPE_INVARIANT'CLASS");
-- Normal case with no replacement
else
for J in Text'Range loop
Set_Msg_Char (Text (J));
end loop;
end if;
end Set_Msg_Str;
------------------------------
-- Set_Next_Non_Deleted_Msg --
------------------------------
procedure Set_Next_Non_Deleted_Msg (E : in out Error_Msg_Id) is
begin
if E = No_Error_Msg then
return;
else
loop
E := Errors.Table (E).Next;
exit when E = No_Error_Msg or else not Errors.Table (E).Deleted;
end loop;
end if;
end Set_Next_Non_Deleted_Msg;
------------------------------
-- Set_Specific_Warning_Off --
------------------------------
procedure Set_Specific_Warning_Off
(Loc : Source_Ptr;
Msg : String;
Reason : String_Id;
Config : Boolean;
Used : Boolean := False)
is
begin
Specific_Warnings.Append
((Start => Loc,
Msg => new String'(Msg),
Stop => Source_Last (Get_Source_File_Index (Loc)),
Reason => Reason,
Open => True,
Used => Used,
Config => Config));
end Set_Specific_Warning_Off;
-----------------------------
-- Set_Specific_Warning_On --
-----------------------------
procedure Set_Specific_Warning_On
(Loc : Source_Ptr;
Msg : String;
Err : out Boolean)
is
begin
for J in 1 .. Specific_Warnings.Last loop
declare
SWE : Specific_Warning_Entry renames Specific_Warnings.Table (J);
begin
if Msg = SWE.Msg.all
and then Loc > SWE.Start
and then SWE.Open
and then Get_Source_File_Index (SWE.Start) =
Get_Source_File_Index (Loc)
then
SWE.Stop := Loc;
SWE.Open := False;
Err := False;
-- If a config pragma is specifically cancelled, consider
-- that it is no longer active as a configuration pragma.
SWE.Config := False;
return;
end if;
end;
end loop;
Err := True;
end Set_Specific_Warning_On;
---------------------------
-- Set_Warnings_Mode_Off --
---------------------------
procedure Set_Warnings_Mode_Off (Loc : Source_Ptr; Reason : String_Id) is
begin
-- Don't bother with entries from instantiation copies, since we will
-- already have a copy in the template, which is what matters.
if Instantiation (Get_Source_File_Index (Loc)) /= No_Location then
return;
end if;
-- If all warnings are suppressed by command line switch, this can
-- be ignored, unless we are in GNATprove_Mode which requires pragma
-- Warnings to be stored for the formal verification backend.
if Warning_Mode = Suppress
and then not GNATprove_Mode
then
return;
end if;
-- If last entry in table already covers us, this is a redundant pragma
-- Warnings (Off) and can be ignored.
if Warnings.Last >= Warnings.First
and then Warnings.Table (Warnings.Last).Start <= Loc
and then Loc <= Warnings.Table (Warnings.Last).Stop
then
return;
end if;
-- If none of those special conditions holds, establish a new entry,
-- extending from the location of the pragma to the end of the current
-- source file. This ending point will be adjusted by a subsequent
-- corresponding pragma Warnings (On).
Warnings.Append
((Start => Loc,
Stop => Source_Last (Get_Source_File_Index (Loc)),
Reason => Reason));
end Set_Warnings_Mode_Off;
--------------------------
-- Set_Warnings_Mode_On --
--------------------------
procedure Set_Warnings_Mode_On (Loc : Source_Ptr) is
begin
-- Don't bother with entries from instantiation copies, since we will
-- already have a copy in the template, which is what matters.
if Instantiation (Get_Source_File_Index (Loc)) /= No_Location then
return;
end if;
-- If all warnings are suppressed by command line switch, this can
-- be ignored, unless we are in GNATprove_Mode which requires pragma
-- Warnings to be stored for the formal verification backend.
if Warning_Mode = Suppress
and then not GNATprove_Mode
then
return;
end if;
-- If the last entry in the warnings table covers this pragma, then
-- we adjust the end point appropriately.
if Warnings.Last >= Warnings.First
and then Warnings.Table (Warnings.Last).Start <= Loc
and then Loc <= Warnings.Table (Warnings.Last).Stop
then
Warnings.Table (Warnings.Last).Stop := Loc;
end if;
end Set_Warnings_Mode_On;
-------------------
-- Sloc_In_Range --
-------------------
function Sloc_In_Range (Loc, Start, Stop : Source_Ptr) return Boolean is
Cur_Loc : Source_Ptr := Loc;
begin
while Cur_Loc /= No_Location loop
if Start <= Cur_Loc and then Cur_Loc <= Stop then
return True;
end if;
Cur_Loc := Instantiation_Location (Cur_Loc);
end loop;
return False;
end Sloc_In_Range;
--------------------------------
-- Validate_Specific_Warnings --
--------------------------------
procedure Validate_Specific_Warnings (Eproc : Error_Msg_Proc) is
begin
if not Warn_On_Warnings_Off then
return;
end if;
for J in Specific_Warnings.First .. Specific_Warnings.Last loop
declare
SWE : Specific_Warning_Entry renames Specific_Warnings.Table (J);
begin
if not SWE.Config then
-- Warn for unmatched Warnings (Off, ...)
if SWE.Open then
Eproc.all
("?W?pragma Warnings Off with no matching Warnings On",
SWE.Start);
-- Warn for ineffective Warnings (Off, ..)
elsif not SWE.Used
-- Do not issue this warning for -Wxxx messages since the
-- back-end doesn't report the information. Note that there
-- is always an asterisk at the start of every message.
and then not
(SWE.Msg'Length > 3 and then SWE.Msg (2 .. 3) = "-W")
then
Eproc.all
("?W?no warning suppressed by this pragma", SWE.Start);
end if;
end if;
end;
end loop;
end Validate_Specific_Warnings;
-------------------------------------
-- Warning_Specifically_Suppressed --
-------------------------------------
function Warning_Specifically_Suppressed
(Loc : Source_Ptr;
Msg : String_Ptr;
Tag : String := "") return String_Id
is
begin
-- Loop through specific warning suppression entries
for J in Specific_Warnings.First .. Specific_Warnings.Last loop
declare
SWE : Specific_Warning_Entry renames Specific_Warnings.Table (J);
begin
-- Pragma applies if it is a configuration pragma, or if the
-- location is in range of a specific non-configuration pragma.
if SWE.Config
or else Sloc_In_Range (Loc, SWE.Start, SWE.Stop)
then
if Matches (Msg.all, SWE.Msg.all)
or else Matches (Tag, SWE.Msg.all)
then
SWE.Used := True;
return SWE.Reason;
end if;
end if;
end;
end loop;
return No_String;
end Warning_Specifically_Suppressed;
------------------------------
-- Warning_Treated_As_Error --
------------------------------
function Warning_Treated_As_Error (Msg : String) return Boolean is
begin
for J in 1 .. Warnings_As_Errors_Count loop
if Matches (Msg, Warnings_As_Errors (J).all) then
return True;
end if;
end loop;
return False;
end Warning_Treated_As_Error;
-------------------------
-- Warnings_Suppressed --
-------------------------
function Warnings_Suppressed (Loc : Source_Ptr) return String_Id is
begin
-- Loop through table of ON/OFF warnings
for J in Warnings.First .. Warnings.Last loop
if Sloc_In_Range (Loc, Warnings.Table (J).Start,
Warnings.Table (J).Stop)
then
return Warnings.Table (J).Reason;
end if;
end loop;
if Warning_Mode = Suppress then
return Null_String_Id;
else
return No_String;
end if;
end Warnings_Suppressed;
end Erroutc;
| 30.146943 | 79 | 0.531124 |
1843b78bf11b443a2a17e18ce4730da6e194f582 | 31,444 | adb | Ada | gcc-gcc-7_3_0-release/gcc/ada/a-crbtgo.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-crbtgo.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/ada/a-crbtgo.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- ADA.CONTAINERS.RED_BLACK_TREES.GENERIC_OPERATIONS --
-- --
-- B o d y --
-- --
-- Copyright (C) 2004-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------
-- The references below to "CLR" refer to the following book, from which
-- several of the algorithms here were adapted:
-- Introduction to Algorithms
-- by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
-- Publisher: The MIT Press (June 18, 1990)
-- ISBN: 0262031418
with System; use type System.Address;
package body Ada.Containers.Red_Black_Trees.Generic_Operations is
pragma Warnings (Off, "variable ""Busy*"" is not referenced");
pragma Warnings (Off, "variable ""Lock*"" is not referenced");
-- See comment in Ada.Containers.Helpers
-----------------------
-- Local Subprograms --
-----------------------
procedure Delete_Fixup (Tree : in out Tree_Type; Node : Node_Access);
procedure Delete_Swap (Tree : in out Tree_Type; Z, Y : Node_Access);
procedure Left_Rotate (Tree : in out Tree_Type; X : Node_Access);
procedure Right_Rotate (Tree : in out Tree_Type; Y : Node_Access);
-- Why is all the following code commented out ???
-- ---------------------
-- -- Check_Invariant --
-- ---------------------
-- procedure Check_Invariant (Tree : Tree_Type) is
-- Root : constant Node_Access := Tree.Root;
--
-- function Check (Node : Node_Access) return Natural;
--
-- -----------
-- -- Check --
-- -----------
--
-- function Check (Node : Node_Access) return Natural is
-- begin
-- if Node = null then
-- return 0;
-- end if;
--
-- if Color (Node) = Red then
-- declare
-- L : constant Node_Access := Left (Node);
-- begin
-- pragma Assert (L = null or else Color (L) = Black);
-- null;
-- end;
--
-- declare
-- R : constant Node_Access := Right (Node);
-- begin
-- pragma Assert (R = null or else Color (R) = Black);
-- null;
-- end;
--
-- declare
-- NL : constant Natural := Check (Left (Node));
-- NR : constant Natural := Check (Right (Node));
-- begin
-- pragma Assert (NL = NR);
-- return NL;
-- end;
-- end if;
--
-- declare
-- NL : constant Natural := Check (Left (Node));
-- NR : constant Natural := Check (Right (Node));
-- begin
-- pragma Assert (NL = NR);
-- return NL + 1;
-- end;
-- end Check;
--
-- -- Start of processing for Check_Invariant
--
-- begin
-- if Root = null then
-- pragma Assert (Tree.First = null);
-- pragma Assert (Tree.Last = null);
-- pragma Assert (Tree.Length = 0);
-- null;
--
-- else
-- pragma Assert (Color (Root) = Black);
-- pragma Assert (Tree.Length > 0);
-- pragma Assert (Tree.Root /= null);
-- pragma Assert (Tree.First /= null);
-- pragma Assert (Tree.Last /= null);
-- pragma Assert (Parent (Tree.Root) = null);
-- pragma Assert ((Tree.Length > 1)
-- or else (Tree.First = Tree.Last
-- and Tree.First = Tree.Root));
-- pragma Assert (Left (Tree.First) = null);
-- pragma Assert (Right (Tree.Last) = null);
--
-- declare
-- L : constant Node_Access := Left (Root);
-- R : constant Node_Access := Right (Root);
-- NL : constant Natural := Check (L);
-- NR : constant Natural := Check (R);
-- begin
-- pragma Assert (NL = NR);
-- null;
-- end;
-- end if;
-- end Check_Invariant;
------------------
-- Delete_Fixup --
------------------
procedure Delete_Fixup (Tree : in out Tree_Type; Node : Node_Access) is
-- CLR p274
X : Node_Access := Node;
W : Node_Access;
begin
while X /= Tree.Root
and then Color (X) = Black
loop
if X = Left (Parent (X)) then
W := Right (Parent (X));
if Color (W) = Red then
Set_Color (W, Black);
Set_Color (Parent (X), Red);
Left_Rotate (Tree, Parent (X));
W := Right (Parent (X));
end if;
if (Left (W) = null or else Color (Left (W)) = Black)
and then
(Right (W) = null or else Color (Right (W)) = Black)
then
Set_Color (W, Red);
X := Parent (X);
else
if Right (W) = null
or else Color (Right (W)) = Black
then
-- As a condition for setting the color of the left child to
-- black, the left child access value must be non-null. A
-- truth table analysis shows that if we arrive here, that
-- condition holds, so there's no need for an explicit test.
-- The assertion is here to document what we know is true.
pragma Assert (Left (W) /= null);
Set_Color (Left (W), Black);
Set_Color (W, Red);
Right_Rotate (Tree, W);
W := Right (Parent (X));
end if;
Set_Color (W, Color (Parent (X)));
Set_Color (Parent (X), Black);
Set_Color (Right (W), Black);
Left_Rotate (Tree, Parent (X));
X := Tree.Root;
end if;
else
pragma Assert (X = Right (Parent (X)));
W := Left (Parent (X));
if Color (W) = Red then
Set_Color (W, Black);
Set_Color (Parent (X), Red);
Right_Rotate (Tree, Parent (X));
W := Left (Parent (X));
end if;
if (Left (W) = null or else Color (Left (W)) = Black)
and then
(Right (W) = null or else Color (Right (W)) = Black)
then
Set_Color (W, Red);
X := Parent (X);
else
if Left (W) = null or else Color (Left (W)) = Black then
-- As a condition for setting the color of the right child
-- to black, the right child access value must be non-null.
-- A truth table analysis shows that if we arrive here, that
-- condition holds, so there's no need for an explicit test.
-- The assertion is here to document what we know is true.
pragma Assert (Right (W) /= null);
Set_Color (Right (W), Black);
Set_Color (W, Red);
Left_Rotate (Tree, W);
W := Left (Parent (X));
end if;
Set_Color (W, Color (Parent (X)));
Set_Color (Parent (X), Black);
Set_Color (Left (W), Black);
Right_Rotate (Tree, Parent (X));
X := Tree.Root;
end if;
end if;
end loop;
Set_Color (X, Black);
end Delete_Fixup;
---------------------------
-- Delete_Node_Sans_Free --
---------------------------
procedure Delete_Node_Sans_Free
(Tree : in out Tree_Type;
Node : Node_Access)
is
-- CLR p273
X, Y : Node_Access;
Z : constant Node_Access := Node;
pragma Assert (Z /= null);
begin
TC_Check (Tree.TC);
-- Why are these all commented out ???
-- pragma Assert (Tree.Length > 0);
-- pragma Assert (Tree.Root /= null);
-- pragma Assert (Tree.First /= null);
-- pragma Assert (Tree.Last /= null);
-- pragma Assert (Parent (Tree.Root) = null);
-- pragma Assert ((Tree.Length > 1)
-- or else (Tree.First = Tree.Last
-- and then Tree.First = Tree.Root));
-- pragma Assert ((Left (Node) = null)
-- or else (Parent (Left (Node)) = Node));
-- pragma Assert ((Right (Node) = null)
-- or else (Parent (Right (Node)) = Node));
-- pragma Assert (((Parent (Node) = null) and then (Tree.Root = Node))
-- or else ((Parent (Node) /= null) and then
-- ((Left (Parent (Node)) = Node)
-- or else (Right (Parent (Node)) = Node))));
if Left (Z) = null then
if Right (Z) = null then
if Z = Tree.First then
Tree.First := Parent (Z);
end if;
if Z = Tree.Last then
Tree.Last := Parent (Z);
end if;
if Color (Z) = Black then
Delete_Fixup (Tree, Z);
end if;
pragma Assert (Left (Z) = null);
pragma Assert (Right (Z) = null);
if Z = Tree.Root then
pragma Assert (Tree.Length = 1);
pragma Assert (Parent (Z) = null);
Tree.Root := null;
elsif Z = Left (Parent (Z)) then
Set_Left (Parent (Z), null);
else
pragma Assert (Z = Right (Parent (Z)));
Set_Right (Parent (Z), null);
end if;
else
pragma Assert (Z /= Tree.Last);
X := Right (Z);
if Z = Tree.First then
Tree.First := Min (X);
end if;
if Z = Tree.Root then
Tree.Root := X;
elsif Z = Left (Parent (Z)) then
Set_Left (Parent (Z), X);
else
pragma Assert (Z = Right (Parent (Z)));
Set_Right (Parent (Z), X);
end if;
Set_Parent (X, Parent (Z));
if Color (Z) = Black then
Delete_Fixup (Tree, X);
end if;
end if;
elsif Right (Z) = null then
pragma Assert (Z /= Tree.First);
X := Left (Z);
if Z = Tree.Last then
Tree.Last := Max (X);
end if;
if Z = Tree.Root then
Tree.Root := X;
elsif Z = Left (Parent (Z)) then
Set_Left (Parent (Z), X);
else
pragma Assert (Z = Right (Parent (Z)));
Set_Right (Parent (Z), X);
end if;
Set_Parent (X, Parent (Z));
if Color (Z) = Black then
Delete_Fixup (Tree, X);
end if;
else
pragma Assert (Z /= Tree.First);
pragma Assert (Z /= Tree.Last);
Y := Next (Z);
pragma Assert (Left (Y) = null);
X := Right (Y);
if X = null then
if Y = Left (Parent (Y)) then
pragma Assert (Parent (Y) /= Z);
Delete_Swap (Tree, Z, Y);
Set_Left (Parent (Z), Z);
else
pragma Assert (Y = Right (Parent (Y)));
pragma Assert (Parent (Y) = Z);
Set_Parent (Y, Parent (Z));
if Z = Tree.Root then
Tree.Root := Y;
elsif Z = Left (Parent (Z)) then
Set_Left (Parent (Z), Y);
else
pragma Assert (Z = Right (Parent (Z)));
Set_Right (Parent (Z), Y);
end if;
Set_Left (Y, Left (Z));
Set_Parent (Left (Y), Y);
Set_Right (Y, Z);
Set_Parent (Z, Y);
Set_Left (Z, null);
Set_Right (Z, null);
declare
Y_Color : constant Color_Type := Color (Y);
begin
Set_Color (Y, Color (Z));
Set_Color (Z, Y_Color);
end;
end if;
if Color (Z) = Black then
Delete_Fixup (Tree, Z);
end if;
pragma Assert (Left (Z) = null);
pragma Assert (Right (Z) = null);
if Z = Right (Parent (Z)) then
Set_Right (Parent (Z), null);
else
pragma Assert (Z = Left (Parent (Z)));
Set_Left (Parent (Z), null);
end if;
else
if Y = Left (Parent (Y)) then
pragma Assert (Parent (Y) /= Z);
Delete_Swap (Tree, Z, Y);
Set_Left (Parent (Z), X);
Set_Parent (X, Parent (Z));
else
pragma Assert (Y = Right (Parent (Y)));
pragma Assert (Parent (Y) = Z);
Set_Parent (Y, Parent (Z));
if Z = Tree.Root then
Tree.Root := Y;
elsif Z = Left (Parent (Z)) then
Set_Left (Parent (Z), Y);
else
pragma Assert (Z = Right (Parent (Z)));
Set_Right (Parent (Z), Y);
end if;
Set_Left (Y, Left (Z));
Set_Parent (Left (Y), Y);
declare
Y_Color : constant Color_Type := Color (Y);
begin
Set_Color (Y, Color (Z));
Set_Color (Z, Y_Color);
end;
end if;
if Color (Z) = Black then
Delete_Fixup (Tree, X);
end if;
end if;
end if;
Tree.Length := Tree.Length - 1;
end Delete_Node_Sans_Free;
-----------------
-- Delete_Swap --
-----------------
procedure Delete_Swap
(Tree : in out Tree_Type;
Z, Y : Node_Access)
is
pragma Assert (Z /= Y);
pragma Assert (Parent (Y) /= Z);
Y_Parent : constant Node_Access := Parent (Y);
Y_Color : constant Color_Type := Color (Y);
begin
Set_Parent (Y, Parent (Z));
Set_Left (Y, Left (Z));
Set_Right (Y, Right (Z));
Set_Color (Y, Color (Z));
if Tree.Root = Z then
Tree.Root := Y;
elsif Right (Parent (Y)) = Z then
Set_Right (Parent (Y), Y);
else
pragma Assert (Left (Parent (Y)) = Z);
Set_Left (Parent (Y), Y);
end if;
if Right (Y) /= null then
Set_Parent (Right (Y), Y);
end if;
if Left (Y) /= null then
Set_Parent (Left (Y), Y);
end if;
Set_Parent (Z, Y_Parent);
Set_Color (Z, Y_Color);
Set_Left (Z, null);
Set_Right (Z, null);
end Delete_Swap;
--------------------
-- Generic_Adjust --
--------------------
procedure Generic_Adjust (Tree : in out Tree_Type) is
N : constant Count_Type := Tree.Length;
Root : constant Node_Access := Tree.Root;
use type Helpers.Tamper_Counts;
begin
-- If the counts are nonzero, execution is technically erroneous, but
-- it seems friendly to allow things like concurrent "=" on shared
-- constants.
Zero_Counts (Tree.TC);
if N = 0 then
pragma Assert (Root = null);
return;
end if;
Tree.Root := null;
Tree.First := null;
Tree.Last := null;
Tree.Length := 0;
Tree.Root := Copy_Tree (Root);
Tree.First := Min (Tree.Root);
Tree.Last := Max (Tree.Root);
Tree.Length := N;
end Generic_Adjust;
-------------------
-- Generic_Clear --
-------------------
procedure Generic_Clear (Tree : in out Tree_Type) is
Root : Node_Access := Tree.Root;
begin
TC_Check (Tree.TC);
Tree := (First => null,
Last => null,
Root => null,
Length => 0,
TC => <>);
Delete_Tree (Root);
end Generic_Clear;
-----------------------
-- Generic_Copy_Tree --
-----------------------
function Generic_Copy_Tree (Source_Root : Node_Access) return Node_Access is
Target_Root : Node_Access := Copy_Node (Source_Root);
P, X : Node_Access;
begin
if Right (Source_Root) /= null then
Set_Right
(Node => Target_Root,
Right => Generic_Copy_Tree (Right (Source_Root)));
Set_Parent
(Node => Right (Target_Root),
Parent => Target_Root);
end if;
P := Target_Root;
X := Left (Source_Root);
while X /= null loop
declare
Y : constant Node_Access := Copy_Node (X);
begin
Set_Left (Node => P, Left => Y);
Set_Parent (Node => Y, Parent => P);
if Right (X) /= null then
Set_Right
(Node => Y,
Right => Generic_Copy_Tree (Right (X)));
Set_Parent
(Node => Right (Y),
Parent => Y);
end if;
P := Y;
X := Left (X);
end;
end loop;
return Target_Root;
exception
when others =>
Delete_Tree (Target_Root);
raise;
end Generic_Copy_Tree;
-------------------------
-- Generic_Delete_Tree --
-------------------------
procedure Generic_Delete_Tree (X : in out Node_Access) is
Y : Node_Access;
pragma Warnings (Off, Y);
begin
while X /= null loop
Y := Right (X);
Generic_Delete_Tree (Y);
Y := Left (X);
Free (X);
X := Y;
end loop;
end Generic_Delete_Tree;
-------------------
-- Generic_Equal --
-------------------
function Generic_Equal (Left, Right : Tree_Type) return Boolean is
begin
if Left.Length /= Right.Length then
return False;
end if;
-- If the containers are empty, return a result immediately, so as to
-- not manipulate the tamper bits unnecessarily.
if Left.Length = 0 then
return True;
end if;
declare
Lock_Left : With_Lock (Left.TC'Unrestricted_Access);
Lock_Right : With_Lock (Right.TC'Unrestricted_Access);
L_Node : Node_Access := Left.First;
R_Node : Node_Access := Right.First;
begin
while L_Node /= null loop
if not Is_Equal (L_Node, R_Node) then
return False;
end if;
L_Node := Next (L_Node);
R_Node := Next (R_Node);
end loop;
end;
return True;
end Generic_Equal;
-----------------------
-- Generic_Iteration --
-----------------------
procedure Generic_Iteration (Tree : Tree_Type) is
procedure Iterate (P : Node_Access);
-------------
-- Iterate --
-------------
procedure Iterate (P : Node_Access) is
X : Node_Access := P;
begin
while X /= null loop
Iterate (Left (X));
Process (X);
X := Right (X);
end loop;
end Iterate;
-- Start of processing for Generic_Iteration
begin
Iterate (Tree.Root);
end Generic_Iteration;
------------------
-- Generic_Move --
------------------
procedure Generic_Move (Target, Source : in out Tree_Type) is
begin
if Target'Address = Source'Address then
return;
end if;
TC_Check (Source.TC);
Clear (Target);
Target := Source;
Source := (First => null,
Last => null,
Root => null,
Length => 0,
TC => <>);
end Generic_Move;
------------------
-- Generic_Read --
------------------
procedure Generic_Read
(Stream : not null access Root_Stream_Type'Class;
Tree : in out Tree_Type)
is
N : Count_Type'Base;
Node, Last_Node : Node_Access;
begin
Clear (Tree);
Count_Type'Base'Read (Stream, N);
pragma Assert (N >= 0);
if N = 0 then
return;
end if;
Node := Read_Node (Stream);
pragma Assert (Node /= null);
pragma Assert (Color (Node) = Red);
Set_Color (Node, Black);
Tree.Root := Node;
Tree.First := Node;
Tree.Last := Node;
Tree.Length := 1;
for J in Count_Type range 2 .. N loop
Last_Node := Node;
pragma Assert (Last_Node = Tree.Last);
Node := Read_Node (Stream);
pragma Assert (Node /= null);
pragma Assert (Color (Node) = Red);
Set_Right (Node => Last_Node, Right => Node);
Tree.Last := Node;
Set_Parent (Node => Node, Parent => Last_Node);
Rebalance_For_Insert (Tree, Node);
Tree.Length := Tree.Length + 1;
end loop;
end Generic_Read;
-------------------------------
-- Generic_Reverse_Iteration --
-------------------------------
procedure Generic_Reverse_Iteration (Tree : Tree_Type)
is
procedure Iterate (P : Node_Access);
-------------
-- Iterate --
-------------
procedure Iterate (P : Node_Access) is
X : Node_Access := P;
begin
while X /= null loop
Iterate (Right (X));
Process (X);
X := Left (X);
end loop;
end Iterate;
-- Start of processing for Generic_Reverse_Iteration
begin
Iterate (Tree.Root);
end Generic_Reverse_Iteration;
-------------------
-- Generic_Write --
-------------------
procedure Generic_Write
(Stream : not null access Root_Stream_Type'Class;
Tree : Tree_Type)
is
procedure Process (Node : Node_Access);
pragma Inline (Process);
procedure Iterate is
new Generic_Iteration (Process);
-------------
-- Process --
-------------
procedure Process (Node : Node_Access) is
begin
Write_Node (Stream, Node);
end Process;
-- Start of processing for Generic_Write
begin
Count_Type'Base'Write (Stream, Tree.Length);
Iterate (Tree);
end Generic_Write;
-----------------
-- Left_Rotate --
-----------------
procedure Left_Rotate (Tree : in out Tree_Type; X : Node_Access) is
-- CLR p266
Y : constant Node_Access := Right (X);
pragma Assert (Y /= null);
begin
Set_Right (X, Left (Y));
if Left (Y) /= null then
Set_Parent (Left (Y), X);
end if;
Set_Parent (Y, Parent (X));
if X = Tree.Root then
Tree.Root := Y;
elsif X = Left (Parent (X)) then
Set_Left (Parent (X), Y);
else
pragma Assert (X = Right (Parent (X)));
Set_Right (Parent (X), Y);
end if;
Set_Left (Y, X);
Set_Parent (X, Y);
end Left_Rotate;
---------
-- Max --
---------
function Max (Node : Node_Access) return Node_Access is
-- CLR p248
X : Node_Access := Node;
Y : Node_Access;
begin
loop
Y := Right (X);
if Y = null then
return X;
end if;
X := Y;
end loop;
end Max;
---------
-- Min --
---------
function Min (Node : Node_Access) return Node_Access is
-- CLR p248
X : Node_Access := Node;
Y : Node_Access;
begin
loop
Y := Left (X);
if Y = null then
return X;
end if;
X := Y;
end loop;
end Min;
----------
-- Next --
----------
function Next (Node : Node_Access) return Node_Access is
begin
-- CLR p249
if Node = null then
return null;
end if;
if Right (Node) /= null then
return Min (Right (Node));
end if;
declare
X : Node_Access := Node;
Y : Node_Access := Parent (Node);
begin
while Y /= null
and then X = Right (Y)
loop
X := Y;
Y := Parent (Y);
end loop;
return Y;
end;
end Next;
--------------
-- Previous --
--------------
function Previous (Node : Node_Access) return Node_Access is
begin
if Node = null then
return null;
end if;
if Left (Node) /= null then
return Max (Left (Node));
end if;
declare
X : Node_Access := Node;
Y : Node_Access := Parent (Node);
begin
while Y /= null
and then X = Left (Y)
loop
X := Y;
Y := Parent (Y);
end loop;
return Y;
end;
end Previous;
--------------------------
-- Rebalance_For_Insert --
--------------------------
procedure Rebalance_For_Insert
(Tree : in out Tree_Type;
Node : Node_Access)
is
-- CLR p.268
X : Node_Access := Node;
pragma Assert (X /= null);
pragma Assert (Color (X) = Red);
Y : Node_Access;
begin
while X /= Tree.Root and then Color (Parent (X)) = Red loop
if Parent (X) = Left (Parent (Parent (X))) then
Y := Right (Parent (Parent (X)));
if Y /= null and then Color (Y) = Red then
Set_Color (Parent (X), Black);
Set_Color (Y, Black);
Set_Color (Parent (Parent (X)), Red);
X := Parent (Parent (X));
else
if X = Right (Parent (X)) then
X := Parent (X);
Left_Rotate (Tree, X);
end if;
Set_Color (Parent (X), Black);
Set_Color (Parent (Parent (X)), Red);
Right_Rotate (Tree, Parent (Parent (X)));
end if;
else
pragma Assert (Parent (X) = Right (Parent (Parent (X))));
Y := Left (Parent (Parent (X)));
if Y /= null and then Color (Y) = Red then
Set_Color (Parent (X), Black);
Set_Color (Y, Black);
Set_Color (Parent (Parent (X)), Red);
X := Parent (Parent (X));
else
if X = Left (Parent (X)) then
X := Parent (X);
Right_Rotate (Tree, X);
end if;
Set_Color (Parent (X), Black);
Set_Color (Parent (Parent (X)), Red);
Left_Rotate (Tree, Parent (Parent (X)));
end if;
end if;
end loop;
Set_Color (Tree.Root, Black);
end Rebalance_For_Insert;
------------------
-- Right_Rotate --
------------------
procedure Right_Rotate (Tree : in out Tree_Type; Y : Node_Access) is
X : constant Node_Access := Left (Y);
pragma Assert (X /= null);
begin
Set_Left (Y, Right (X));
if Right (X) /= null then
Set_Parent (Right (X), Y);
end if;
Set_Parent (X, Parent (Y));
if Y = Tree.Root then
Tree.Root := X;
elsif Y = Left (Parent (Y)) then
Set_Left (Parent (Y), X);
else
pragma Assert (Y = Right (Parent (Y)));
Set_Right (Parent (Y), X);
end if;
Set_Right (X, Y);
Set_Parent (Y, X);
end Right_Rotate;
---------
-- Vet --
---------
function Vet (Tree : Tree_Type; Node : Node_Access) return Boolean is
begin
if Node = null then
return True;
end if;
if Parent (Node) = Node
or else Left (Node) = Node
or else Right (Node) = Node
then
return False;
end if;
if Tree.Length = 0
or else Tree.Root = null
or else Tree.First = null
or else Tree.Last = null
then
return False;
end if;
if Parent (Tree.Root) /= null then
return False;
end if;
if Left (Tree.First) /= null then
return False;
end if;
if Right (Tree.Last) /= null then
return False;
end if;
if Tree.Length = 1 then
if Tree.First /= Tree.Last
or else Tree.First /= Tree.Root
then
return False;
end if;
if Node /= Tree.First then
return False;
end if;
if Parent (Node) /= null
or else Left (Node) /= null
or else Right (Node) /= null
then
return False;
end if;
return True;
end if;
if Tree.First = Tree.Last then
return False;
end if;
if Tree.Length = 2 then
if Tree.First /= Tree.Root
and then Tree.Last /= Tree.Root
then
return False;
end if;
if Tree.First /= Node
and then Tree.Last /= Node
then
return False;
end if;
end if;
if Left (Node) /= null
and then Parent (Left (Node)) /= Node
then
return False;
end if;
if Right (Node) /= null
and then Parent (Right (Node)) /= Node
then
return False;
end if;
if Parent (Node) = null then
if Tree.Root /= Node then
return False;
end if;
elsif Left (Parent (Node)) /= Node
and then Right (Parent (Node)) /= Node
then
return False;
end if;
return True;
end Vet;
end Ada.Containers.Red_Black_Trees.Generic_Operations;
| 27.106897 | 79 | 0.454936 |
c5d58aacbffdd66cd898179d7c4e690e665ff8a7 | 2,777 | adb | Ada | UNIT_TESTS/efx_002.adb | io7m/coreland-openal-ada | dd320bf0cc42759d4b041ba660a4b3e0c7507da5 | [
"0BSD"
] | 1 | 2017-10-07T05:53:55.000Z | 2017-10-07T05:53:55.000Z | UNIT_TESTS/efx_002.adb | io7m/coreland-openal-ada | dd320bf0cc42759d4b041ba660a4b3e0c7507da5 | [
"0BSD"
] | null | null | null | UNIT_TESTS/efx_002.adb | io7m/coreland-openal-ada | dd320bf0cc42759d4b041ba660a4b3e0c7507da5 | [
"0BSD"
] | null | null | null | with OpenAL.Context.Error;
with OpenAL.Context;
with OpenAL.Extension.EFX;
with Test;
procedure efx_002 is
package ALC renames OpenAL.Context;
package ALC_Error renames OpenAL.Context.Error;
package AL_EFX renames OpenAL.Extension.EFX;
Device : ALC.Device_t;
Context : ALC.Context_t;
OK : Boolean;
EFX : AL_EFX.Extension_t;
TC : Test.Context_t;
use type ALC.Device_t;
use type ALC.Context_t;
use type ALC_Error.Error_t;
procedure Finish is
begin
ALC.Destroy_Context (Context);
ALC.Close_Device (Device);
end Finish;
procedure Init is
begin
Device := ALC.Open_Default_Device;
pragma Assert (Device /= ALC.Invalid_Device);
Context := ALC.Create_Context (Device);
pragma Assert (Context /= ALC.Invalid_Context);
OK := ALC.Make_Context_Current (Context);
pragma Assert (OK);
end Init;
Effects : AL_EFX.Effect_Array_t (1 .. 2);
Filters : AL_EFX.Filter_Array_t (1 .. 2);
begin
Test.Initialize
(Test_Context => TC,
Program => "efx_002",
Test_DB => "TEST_DB",
Test_Results => "TEST_RESULTS");
Init;
OK := True;
if AL_EFX.Is_Present (Device) then
EFX := AL_EFX.Load_Extension;
AL_EFX.Generate_Effects (EFX, Effects);
Test.Check (TC, 56, AL_EFX.Effect_Is_Valid (EFX, Effects (1)),
"AL_EFX.Effect_Is_Valid (EFX, Effects (1))");
Test.Check (TC, 57, AL_EFX.Effect_Is_Valid (EFX, Effects (2)),
"AL_EFX.Effect_Is_Valid (EFX, Effects (2))");
AL_EFX.Delete_Effects (EFX, Effects);
Test.Check (TC, 58, not AL_EFX.Effect_Is_Valid (EFX, Effects (1)),
"not AL_EFX.Effect_Is_Valid (EFX, Effects (1))");
Test.Check (TC, 59, not AL_EFX.Effect_Is_Valid (EFX, Effects (2)),
"not AL_EFX.Effect_Is_Valid (EFX, Effects (2))");
AL_EFX.Generate_Filters (EFX, Filters);
Test.Check (TC, 60, AL_EFX.Filter_Is_Valid (EFX, Filters (1)),
"AL_EFX.Filter_Is_Valid (EFX, Filters (1))");
Test.Check (TC, 61, AL_EFX.Filter_Is_Valid (EFX, Filters (2)),
"AL_EFX.Filter_Is_Valid (EFX, Filters (2))");
AL_EFX.Delete_Filters (EFX, Filters);
Test.Check (TC, 62, not AL_EFX.Filter_Is_Valid (EFX, Filters (1)),
"not AL_EFX.Filter_Is_Valid (EFX, Filters (1))");
Test.Check (TC, 63, not AL_EFX.Filter_Is_Valid (EFX, Filters (2)),
"not AL_EFX.Filter_Is_Valid (EFX, Filters (2))");
else
Test.Satisfy (TC, 56, Test.Unsupported);
Test.Satisfy (TC, 57, Test.Unsupported);
Test.Satisfy (TC, 58, Test.Unsupported);
Test.Satisfy (TC, 59, Test.Unsupported);
Test.Satisfy (TC, 60, Test.Unsupported);
Test.Satisfy (TC, 61, Test.Unsupported);
Test.Satisfy (TC, 62, Test.Unsupported);
Test.Satisfy (TC, 63, Test.Unsupported);
end if;
Finish;
end efx_002;
| 29.860215 | 70 | 0.665826 |
cb3670b8c5cd358b6c09a2363d26fb83218857c2 | 21,455 | adb | Ada | ADL/drivers/stm32g474/stm32-usarts.adb | JCGobbi/Nucleo-STM32G474RE | 8dc1c4948ffeb11841eed10f1c3708f00fa1d832 | [
"BSD-3-Clause"
] | null | null | null | ADL/drivers/stm32g474/stm32-usarts.adb | JCGobbi/Nucleo-STM32G474RE | 8dc1c4948ffeb11841eed10f1c3708f00fa1d832 | [
"BSD-3-Clause"
] | null | null | null | ADL/drivers/stm32g474/stm32-usarts.adb | JCGobbi/Nucleo-STM32G474RE | 8dc1c4948ffeb11841eed10f1c3708f00fa1d832 | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015-2017, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of STMicroelectronics nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
-- --
-- This file is based on: --
-- --
-- @file stm32f4xx_hal_usart.c --
-- @author MCD Application Team --
-- @version V1.1.0 --
-- @date 19-June-2014 --
-- @brief USARTS HAL module driver. --
-- --
-- COPYRIGHT(c) 2014 STMicroelectronics --
------------------------------------------------------------------------------
with System; use System;
with STM32_SVD.USART; use STM32_SVD.USART, STM32_SVD;
with STM32.Device;
package body STM32.USARTs is
------------
-- Enable --
------------
procedure Enable (This : in out USART) is
begin
This.Periph.CR1.UE := True;
end Enable;
-------------
-- Disable --
-------------
procedure Disable (This : in out USART) is
begin
This.Periph.CR1.UE := False;
end Disable;
-------------
-- Enabled --
-------------
function Enabled (This : USART) return Boolean is
(This.Periph.CR1.UE);
-------------------
-- Set_Stop_Bits --
-------------------
procedure Set_Stop_Bits (This : in out USART; To : Stop_Bits)
is
begin
This.Periph.CR2.STOP := Stop_Bits'Enum_Rep (To);
end Set_Stop_Bits;
---------------------
-- Set_Word_Length --
---------------------
procedure Set_Word_Length
(This : in out USART;
To : Word_Lengths)
is
begin
case To is
when Word_Length_7 =>
This.Periph.CR1.M0 := False;
This.Periph.CR1.M1 := True;
when Word_Length_8 =>
This.Periph.CR1.M0 := False;
This.Periph.CR1.M1 := False;
when Word_Length_9 =>
This.Periph.CR1.M0 := True;
This.Periph.CR1.M1 := False;
end case;
end Set_Word_Length;
----------------
-- Set_Parity --
----------------
procedure Set_Parity (This : in out USART; To : Parities) is
begin
case To is
when No_Parity =>
This.Periph.CR1.PCE := False;
This.Periph.CR1.PS := False;
when Even_Parity =>
This.Periph.CR1.PCE := True;
This.Periph.CR1.PS := False;
when Odd_Parity =>
This.Periph.CR1.PCE := True;
This.Periph.CR1.PS := True;
end case;
end Set_Parity;
-------------------
-- Set_Baud_Rate --
-------------------
procedure Set_Baud_Rate (This : in out USART; To : Baud_Rates)
is
Clock : constant UInt32 := STM32.Device.Get_Clock_Frequency (This);
Over_By_8 : constant Boolean := This.Periph.CR1.OVER8;
Int_Scale : constant UInt32 := (if Over_By_8 then 2 else 4);
Int_Divider : constant UInt32 := (25 * Clock) / (Int_Scale * To);
Frac_Divider : constant UInt32 := Int_Divider rem 100;
begin
-- the integer part of the divi
if Over_By_8 then
This.Periph.BRR.DIV_Fraction :=
BRR_DIV_Fraction_Field (((Frac_Divider * 8) + 50) / 100 mod 8);
else
This.Periph.BRR.DIV_Fraction :=
BRR_DIV_Fraction_Field (((Frac_Divider * 16) + 50) / 100 mod 16);
end if;
This.Periph.BRR.DIV_Mantissa :=
BRR_DIV_Mantissa_Field (Int_Divider / 100);
end Set_Baud_Rate;
---------------------------
-- Set_Oversampling_Mode --
---------------------------
procedure Set_Oversampling_Mode
(This : in out USART;
To : Oversampling_Modes)
is
begin
This.Periph.CR1.OVER8 := To = Oversampling_By_8;
end Set_Oversampling_Mode;
--------------
-- Set_Mode --
--------------
procedure Set_Mode (This : in out USART; To : UART_Modes) is
begin
This.Periph.CR1.RE := To /= Tx_Mode;
This.Periph.CR1.TE := To /= Rx_Mode;
end Set_Mode;
----------------------
-- Set_Flow_Control --
----------------------
procedure Set_Flow_Control (This : in out USART; To : Flow_Control) is
begin
case To is
when No_Flow_Control =>
This.Periph.CR3.RTSE := False;
This.Periph.CR3.CTSE := False;
when RTS_Flow_Control =>
This.Periph.CR3.RTSE := True;
This.Periph.CR3.CTSE := False;
when CTS_Flow_Control =>
This.Periph.CR3.RTSE := False;
This.Periph.CR3.CTSE := True;
when RTS_CTS_Flow_Control =>
This.Periph.CR3.RTSE := True;
This.Periph.CR3.CTSE := True;
end case;
end Set_Flow_Control;
---------
-- Put --
---------
procedure Transmit (This : in out USART; Data : UInt9) is
begin
This.Periph.TDR.TDR := Data;
end Transmit;
---------
-- Get --
---------
procedure Receive (This : USART; Data : out UInt9) is
begin
Data := Current_Input (This);
end Receive;
-------------------
-- Current_Input --
-------------------
function Current_Input (This : USART) return UInt9 is (This.Periph.RDR.RDR);
--------------
-- Tx_Ready --
--------------
function Tx_Ready (This : USART) return Boolean is
begin
return This.Periph.ISR.TXE;
end Tx_Ready;
--------------
-- Rx_Ready --
--------------
function Rx_Ready (This : USART) return Boolean is
begin
return This.Periph.ISR.RXNE;
end Rx_Ready;
-----------------------
-- Enable_USART_Mode --
-----------------------
procedure Enable_USART_Mode
(This : in out USART;
Mode : USART_Mode;
Data : UInt32 := 16#0000#)
is
begin
case Mode is
when Modbus_RTU =>
-- Set 2-character timeout
This.Periph.RTOR.RTO := UInt24 (Data);
This.Periph.CR2.RTOEN := True;
when Modbus_ASCII =>
-- Set LF ASCII character (16#0A#)
This.Periph.CR2.ADD.Val := UInt8 (Data);
when LIN =>
-- Disable USART
This.Periph.CR1.UE := False;
-- 1 stop bit
This.Periph.CR2.STOP := Stopbits_1'Enum_Rep;
-- Disable CK pin
This.Periph.CR2.CLKEN := False;
-- Disable smartcard mode
This.Periph.CR3.SCEN := False;
-- Disable half-duplex mode
This.Periph.CR3.HDSEL := False;
-- Disable IrDA mode
This.Periph.CR3.IREN := False;
-- Enable LIN mode
This.Periph.CR2.LINEN := True;
-- Enable USART
This.Periph.CR1.UE := True;
end case;
end Enable_USART_Mode;
------------------------
-- Disable_USART_Mode --
------------------------
procedure Disable_USART_Mode (This : in out USART; Mode : USART_Mode) is
begin
case Mode is
when Modbus_RTU =>
This.Periph.CR2.RTOEN := False;
when Modbus_ASCII =>
null;
when LIN =>
This.Periph.CR2.LINEN := False;
end case;
end Disable_USART_Mode;
-----------------------
-- Enable_Interrupts --
-----------------------
procedure Enable_Interrupts
(This : in out USART;
Source : USART_Interrupt)
is
begin
case Source is
when End_Of_Block =>
This.Periph.CR1.EOBIE := True;
when Receiver_Timeout =>
This.Periph.CR1.RTOIE := True;
when Character_Match =>
This.Periph.CR1.CMIE := True;
when Parity_Error =>
This.Periph.CR1.PEIE := True;
when Transmit_Data_Register_Empty =>
This.Periph.CR1.TXEIE := True;
when Transmission_Complete =>
This.Periph.CR1.TCIE := True;
when Received_Data_Not_Empty =>
This.Periph.CR1.RXNEIE := True;
when Idle_Line_Detection =>
This.Periph.CR1.IDLEIE := True;
when LIN_Break_Detection =>
This.Periph.CR2.LBDIE := True;
when Clear_To_Send =>
This.Periph.CR3.CTSIE := True;
when Error =>
This.Periph.CR3.EIE := True;
end case;
end Enable_Interrupts;
------------------------
-- Disable_Interrupts --
------------------------
procedure Disable_Interrupts
(This : in out USART;
Source : USART_Interrupt)
is
begin
case Source is
when End_Of_Block =>
This.Periph.CR1.EOBIE := False;
when Receiver_Timeout =>
This.Periph.CR1.RTOIE := False;
when Character_Match =>
This.Periph.CR1.CMIE := False;
when Parity_Error =>
This.Periph.CR1.PEIE := False;
when Transmit_Data_Register_Empty =>
This.Periph.CR1.TXEIE := False;
when Transmission_Complete =>
This.Periph.CR1.TCIE := False;
when Received_Data_Not_Empty =>
This.Periph.CR1.RXNEIE := False;
when Idle_Line_Detection =>
This.Periph.CR1.IDLEIE := False;
when LIN_Break_Detection =>
This.Periph.CR2.LBDIE := False;
when Clear_To_Send =>
This.Periph.CR3.CTSIE := False;
when Error =>
This.Periph.CR3.EIE := False;
end case;
end Disable_Interrupts;
-----------------------
-- Interrupt_Enabled --
-----------------------
function Interrupt_Enabled
(This : USART;
Source : USART_Interrupt)
return Boolean
is
begin
case Source is
when End_Of_Block =>
return This.Periph.CR1.EOBIE;
when Receiver_Timeout =>
return This.Periph.CR1.RTOIE;
when Character_Match =>
return This.Periph.CR1.CMIE;
when Parity_Error =>
return This.Periph.CR1.PEIE;
when Transmit_Data_Register_Empty =>
return This.Periph.CR1.TXEIE;
when Transmission_Complete =>
return This.Periph.CR1.TCIE;
when Received_Data_Not_Empty =>
return This.Periph.CR1.RXNEIE;
when Idle_Line_Detection =>
return This.Periph.CR1.IDLEIE;
when LIN_Break_Detection =>
return This.Periph.CR2.LBDIE;
when Clear_To_Send =>
return This.Periph.CR3.CTSIE;
when Error =>
return This.Periph.CR3.EIE;
end case;
end Interrupt_Enabled;
------------
-- Status --
------------
function Status (This : USART; Flag : USART_Status_Flag) return Boolean is
begin
case Flag is
when End_Of_Block_Indicated =>
return This.Periph.ISR.EOBF;
when Receiver_Timeout_Indicated =>
return This.Periph.ISR.RTOF;
when Character_Match_Indicated =>
return This.Periph.ISR.CMF;
when Parity_Error_Indicated =>
return This.Periph.ISR.PE;
when Framing_Error_Indicated =>
return This.Periph.ISR.FE;
when USART_Noise_Error_Indicated =>
return This.Periph.ISR.NF;
when Overrun_Error_Indicated =>
return This.Periph.ISR.ORE;
when Idle_Line_Detection_Indicated =>
return This.Periph.ISR.IDLE;
when Read_Data_Register_Not_Empty =>
return This.Periph.ISR.RXNE;
when Transmission_Complete_Indicated =>
return This.Periph.ISR.TC;
when Transmit_Data_Register_Empty =>
return This.Periph.ISR.TXE;
when LIN_Break_Detection_Indicated =>
return This.Periph.ISR.LBDF;
when Clear_To_Send_Indicated =>
return This.Periph.ISR.CTS;
end case;
end Status;
------------------
-- Clear_Status --
------------------
procedure Clear_Status (This : in out USART; Flag : USART_Status_Flag) is
begin
case Flag is
when End_Of_Block_Indicated =>
This.Periph.ICR.EOBCF := True;
when Receiver_Timeout_Indicated =>
This.Periph.ICR.RTOCF := True;
when Character_Match_Indicated =>
This.Periph.ICR.CMCF := True;
when Parity_Error_Indicated =>
This.Periph.ICR.PECF := True;
when Framing_Error_Indicated =>
This.Periph.ICR.FECF := True;
when USART_Noise_Error_Indicated =>
This.Periph.ICR.NCF := True;
when Overrun_Error_Indicated =>
This.Periph.ICR.ORECF := True;
when Idle_Line_Detection_Indicated =>
This.Periph.ICR.IDLECF := True;
when Read_Data_Register_Not_Empty =>
null; -- Cleared by a read to the RDR register
when Transmission_Complete_Indicated =>
This.Periph.ICR.TCCF := True;
when Transmit_Data_Register_Empty =>
null; -- Cleared by a write to TDR register
when LIN_Break_Detection_Indicated =>
This.Periph.ICR.LBDCF := True;
when Clear_To_Send_Indicated =>
This.Periph.ICR.CTSCF := True;
end case;
end Clear_Status;
----------------------------------
-- Enable_DMA_Transmit_Requests --
----------------------------------
procedure Enable_DMA_Transmit_Requests (This : in out USART) is
begin
This.Periph.CR3.DMAT := True;
end Enable_DMA_Transmit_Requests;
---------------------------------
-- Enable_DMA_Receive_Requests --
---------------------------------
procedure Enable_DMA_Receive_Requests (This : in out USART) is
begin
This.Periph.CR3.DMAR := True;
end Enable_DMA_Receive_Requests;
-----------------------------------
-- Disable_DMA_Transmit_Requests --
-----------------------------------
procedure Disable_DMA_Transmit_Requests (This : in out USART) is
begin
This.Periph.CR3.DMAT := False;
end Disable_DMA_Transmit_Requests;
----------------------------------
-- Disable_DMA_Receive_Requests --
----------------------------------
procedure Disable_DMA_Receive_Requests (This : in out USART) is
begin
This.Periph.CR3.DMAR := False;
end Disable_DMA_Receive_Requests;
-----------------------------------
-- DMA_Transmit_Requests_Enabled --
-----------------------------------
function DMA_Transmit_Requests_Enabled (This : USART) return Boolean is
(This.Periph.CR3.DMAT);
----------------------------------
-- DMA_Receive_Requests_Enabled --
----------------------------------
function DMA_Receive_Requests_Enabled (This : USART) return Boolean is
(This.Periph.CR3.DMAR);
-----------------------------
-- Resume_DMA_Transmission --
-----------------------------
procedure Resume_DMA_Transmission (This : in out USART) is
begin
Enable_DMA_Transmit_Requests (This);
if not Enabled (This) then
Enable (This);
end if;
end Resume_DMA_Transmission;
--------------------------
-- Resume_DMA_Reception --
--------------------------
procedure Resume_DMA_Reception (This : in out USART) is
begin
Enable_DMA_Receive_Requests (This);
if not Enabled (This) then
Enable (This);
end if;
end Resume_DMA_Reception;
--------------------------------
-- Read_Data_Register_Address --
--------------------------------
function Read_Data_Register_Address (This : USART) return System.Address is
(This.Periph.RDR'Address);
------------------------------------
-- Transmit_Data_Register_Address --
------------------------------------
function Transmit_Data_Register_Address (This : USART) return System.Address is
(This.Periph.TDR'Address);
---------------
-- Data_Size --
---------------
overriding
function Data_Size (This : USART) return HAL.UART.UART_Data_Size
is
begin
if not This.Periph.CR1.M1 and not This.Periph.CR1.M0
then
return Data_Size_8b;
elsif not This.Periph.CR1.M1 and This.Periph.CR1.M0
then
return Data_Size_9b;
else
return Data_Size_7b;
end if;
end Data_Size;
--------------
-- Transmit --
--------------
overriding
procedure Transmit
(This : in out USART;
Data : UART_Data_7b;
Status : out UART_Status;
Timeout : Natural := 1000)
is
pragma Unreferenced (Status, Timeout);
begin
for Elt of Data loop
loop
exit when This.Tx_Ready;
end loop;
This.Transmit (UInt9 (Elt));
end loop;
Status := Ok;
end Transmit;
--------------
-- Transmit --
--------------
overriding
procedure Transmit
(This : in out USART;
Data : UART_Data_8b;
Status : out UART_Status;
Timeout : Natural := 1000)
is
pragma Unreferenced (Status, Timeout);
begin
for Elt of Data loop
loop
exit when This.Tx_Ready;
end loop;
This.Transmit (UInt9 (Elt));
end loop;
Status := Ok;
end Transmit;
--------------
-- Transmit --
--------------
overriding
procedure Transmit
(This : in out USART;
Data : UART_Data_9b;
Status : out UART_Status;
Timeout : Natural := 1000)
is
pragma Unreferenced (Status, Timeout);
begin
for Elt of Data loop
loop
exit when This.Tx_Ready;
end loop;
This.Transmit (Elt);
end loop;
Status := Ok;
end Transmit;
-------------
-- Receive --
-------------
overriding
procedure Receive
(This : in out USART;
Data : out UART_Data_7b;
Status : out UART_Status;
Timeout : Natural := 1000)
is
pragma Unreferenced (Status, Timeout);
begin
for Elt of Data loop
loop
exit when This.Rx_Ready;
end loop;
This.Receive (UInt9 (Elt));
end loop;
Status := Ok;
end Receive;
-------------
-- Receive --
-------------
overriding
procedure Receive
(This : in out USART;
Data : out UART_Data_8b;
Status : out UART_Status;
Timeout : Natural := 1000)
is
pragma Unreferenced (Status, Timeout);
begin
for Elt of Data loop
loop
exit when This.Rx_Ready;
end loop;
This.Receive (UInt9 (Elt));
end loop;
Status := Ok;
end Receive;
-------------
-- Receive --
-------------
overriding
procedure Receive
(This : in out USART;
Data : out UART_Data_9b;
Status : out UART_Status;
Timeout : Natural := 1000)
is
pragma Unreferenced (Status, Timeout);
begin
for Elt of Data loop
loop
exit when This.Rx_Ready;
end loop;
This.Receive (Elt);
end loop;
Status := Ok;
end Receive;
end STM32.USARTs;
| 30.04902 | 82 | 0.514332 |
c59c9983ca457af62210c631132f6a5307b42cb4 | 67,092 | adb | Ada | src/model/jason-tickets-models.adb | stcarrez/jason | eee21b84fb6bab2e05b1f4df408d8f9ed34cbccc | [
"Apache-2.0"
] | 2 | 2019-01-26T22:14:55.000Z | 2019-01-28T10:49:46.000Z | src/model/jason-tickets-models.adb | stcarrez/jason | eee21b84fb6bab2e05b1f4df408d8f9ed34cbccc | [
"Apache-2.0"
] | null | null | null | src/model/jason-tickets-models.adb | stcarrez/jason | eee21b84fb6bab2e05b1f4df408d8f9ed34cbccc | [
"Apache-2.0"
] | null | null | null | -----------------------------------------------------------------------
-- Jason.Tickets.Models -- Jason.Tickets.Models
-----------------------------------------------------------------------
-- File generated by ada-gen DO NOT MODIFY
-- Template used: templates/model/package-body.xhtml
-- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095
-----------------------------------------------------------------------
-- Copyright (C) 2020 Stephane.Carrez
-- Written by Stephane.Carrez (Stephane.Carrez@gmail.com)
--
-- 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.Unchecked_Deallocation;
with Util.Beans.Objects.Time;
with ASF.Events.Faces.Actions;
package body Jason.Tickets.Models is
use type ADO.Objects.Object_Record_Access;
use type ADO.Objects.Object_Ref;
pragma Warnings (Off, "formal parameter * is not referenced");
function Ticket_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => TICKET_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Ticket_Key;
function Ticket_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => TICKET_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Ticket_Key;
function "=" (Left, Right : Ticket_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out Ticket_Ref'Class;
Impl : out Ticket_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := Ticket_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out Ticket_Ref) is
Impl : Ticket_Access;
begin
Impl := new Ticket_Impl;
Impl.Version := 0;
Impl.Ident := 0;
Impl.Create_Date := ADO.DEFAULT_TIME;
Impl.Priority := 0;
Impl.Status := Jason.Tickets.Models.Status_Type'First;
Impl.Update_Date := ADO.DEFAULT_TIME;
Impl.Ticket_Type := Jason.Tickets.Models.Ticket_Type'First;
Impl.Duration := 0;
Impl.Progress := 0;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: Ticket
-- ----------------------------------------
procedure Set_Id (Object : in out Ticket_Ref;
Value : in ADO.Identifier) is
Impl : Ticket_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value);
end Set_Id;
function Get_Id (Object : in Ticket_Ref)
return ADO.Identifier is
Impl : constant Ticket_Access
:= Ticket_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
function Get_Version (Object : in Ticket_Ref)
return Integer is
Impl : constant Ticket_Access
:= Ticket_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Version;
end Get_Version;
procedure Set_Summary (Object : in out Ticket_Ref;
Value : in String) is
Impl : Ticket_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 3, Impl.Summary, Value);
end Set_Summary;
procedure Set_Summary (Object : in out Ticket_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Ticket_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 3, Impl.Summary, Value);
end Set_Summary;
function Get_Summary (Object : in Ticket_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Summary);
end Get_Summary;
function Get_Summary (Object : in Ticket_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Ticket_Access
:= Ticket_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Summary;
end Get_Summary;
procedure Set_Ident (Object : in out Ticket_Ref;
Value : in Integer) is
Impl : Ticket_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Integer (Impl.all, 4, Impl.Ident, Value);
end Set_Ident;
function Get_Ident (Object : in Ticket_Ref)
return Integer is
Impl : constant Ticket_Access
:= Ticket_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Ident;
end Get_Ident;
procedure Set_Create_Date (Object : in out Ticket_Ref;
Value : in Ada.Calendar.Time) is
Impl : Ticket_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Time (Impl.all, 5, Impl.Create_Date, Value);
end Set_Create_Date;
function Get_Create_Date (Object : in Ticket_Ref)
return Ada.Calendar.Time is
Impl : constant Ticket_Access
:= Ticket_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Create_Date;
end Get_Create_Date;
procedure Set_Priority (Object : in out Ticket_Ref;
Value : in Integer) is
Impl : Ticket_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Integer (Impl.all, 6, Impl.Priority, Value);
end Set_Priority;
function Get_Priority (Object : in Ticket_Ref)
return Integer is
Impl : constant Ticket_Access
:= Ticket_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Priority;
end Get_Priority;
procedure Set_Status (Object : in out Ticket_Ref;
Value : in Jason.Tickets.Models.Status_Type) is
procedure Set_Field_Enum is
new ADO.Objects.Set_Field_Operation (Status_Type);
Impl : Ticket_Access;
begin
Set_Field (Object, Impl);
Set_Field_Enum (Impl.all, 7, Impl.Status, Value);
end Set_Status;
function Get_Status (Object : in Ticket_Ref)
return Jason.Tickets.Models.Status_Type is
Impl : constant Ticket_Access
:= Ticket_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Status;
end Get_Status;
procedure Set_Description (Object : in out Ticket_Ref;
Value : in String) is
Impl : Ticket_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 8, Impl.Description, Value);
end Set_Description;
procedure Set_Description (Object : in out Ticket_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Ticket_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 8, Impl.Description, Value);
end Set_Description;
function Get_Description (Object : in Ticket_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Description);
end Get_Description;
function Get_Description (Object : in Ticket_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Ticket_Access
:= Ticket_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Description;
end Get_Description;
procedure Set_Update_Date (Object : in out Ticket_Ref;
Value : in Ada.Calendar.Time) is
Impl : Ticket_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Time (Impl.all, 9, Impl.Update_Date, Value);
end Set_Update_Date;
function Get_Update_Date (Object : in Ticket_Ref)
return Ada.Calendar.Time is
Impl : constant Ticket_Access
:= Ticket_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Update_Date;
end Get_Update_Date;
procedure Set_Ticket_Type (Object : in out Ticket_Ref;
Value : in Jason.Tickets.Models.Ticket_Type) is
procedure Set_Field_Enum is
new ADO.Objects.Set_Field_Operation (Ticket_Type);
Impl : Ticket_Access;
begin
Set_Field (Object, Impl);
Set_Field_Enum (Impl.all, 10, Impl.Ticket_Type, Value);
end Set_Ticket_Type;
function Get_Ticket_Type (Object : in Ticket_Ref)
return Jason.Tickets.Models.Ticket_Type is
Impl : constant Ticket_Access
:= Ticket_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Ticket_Type;
end Get_Ticket_Type;
procedure Set_Duration (Object : in out Ticket_Ref;
Value : in Integer) is
Impl : Ticket_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Integer (Impl.all, 11, Impl.Duration, Value);
end Set_Duration;
function Get_Duration (Object : in Ticket_Ref)
return Integer is
Impl : constant Ticket_Access
:= Ticket_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Duration;
end Get_Duration;
procedure Set_Progress (Object : in out Ticket_Ref;
Value : in Integer) is
Impl : Ticket_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Integer (Impl.all, 12, Impl.Progress, Value);
end Set_Progress;
function Get_Progress (Object : in Ticket_Ref)
return Integer is
Impl : constant Ticket_Access
:= Ticket_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Progress;
end Get_Progress;
procedure Set_Project (Object : in out Ticket_Ref;
Value : in Jason.Projects.Models.Project_Ref'Class) is
Impl : Ticket_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 13, Impl.Project, Value);
end Set_Project;
function Get_Project (Object : in Ticket_Ref)
return Jason.Projects.Models.Project_Ref'Class is
Impl : constant Ticket_Access
:= Ticket_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Project;
end Get_Project;
procedure Set_Creator (Object : in out Ticket_Ref;
Value : in AWA.Users.Models.User_Ref'Class) is
Impl : Ticket_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 14, Impl.Creator, Value);
end Set_Creator;
function Get_Creator (Object : in Ticket_Ref)
return AWA.Users.Models.User_Ref'Class is
Impl : constant Ticket_Access
:= Ticket_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Creator;
end Get_Creator;
-- Copy of the object.
procedure Copy (Object : in Ticket_Ref;
Into : in out Ticket_Ref) is
Result : Ticket_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Ticket_Access
:= Ticket_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Ticket_Access
:= new Ticket_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Version := Impl.Version;
Copy.Summary := Impl.Summary;
Copy.Ident := Impl.Ident;
Copy.Create_Date := Impl.Create_Date;
Copy.Priority := Impl.Priority;
Copy.Status := Impl.Status;
Copy.Description := Impl.Description;
Copy.Update_Date := Impl.Update_Date;
Copy.Ticket_Type := Impl.Ticket_Type;
Copy.Duration := Impl.Duration;
Copy.Progress := Impl.Progress;
Copy.Project := Impl.Project;
Copy.Creator := Impl.Creator;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out Ticket_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant Ticket_Access := new Ticket_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out Ticket_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant Ticket_Access := new Ticket_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out Ticket_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant Ticket_Access := new Ticket_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out Ticket_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new Ticket_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out Ticket_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access Ticket_Impl) is
type Ticket_Impl_Ptr is access all Ticket_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Ticket_Impl, Ticket_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Ticket_Impl_Ptr := Ticket_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Ticket_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, TICKET_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Ticket_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out Ticket_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (TICKET_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_1_NAME, -- id
Value => Object.Get_Key);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (3) then
Stmt.Save_Field (Name => COL_2_1_NAME, -- summary
Value => Object.Summary);
Object.Clear_Modified (3);
end if;
if Object.Is_Modified (4) then
Stmt.Save_Field (Name => COL_3_1_NAME, -- ident
Value => Object.Ident);
Object.Clear_Modified (4);
end if;
if Object.Is_Modified (5) then
Stmt.Save_Field (Name => COL_4_1_NAME, -- create_date
Value => Object.Create_Date);
Object.Clear_Modified (5);
end if;
if Object.Is_Modified (6) then
Stmt.Save_Field (Name => COL_5_1_NAME, -- priority
Value => Object.Priority);
Object.Clear_Modified (6);
end if;
if Object.Is_Modified (7) then
Stmt.Save_Field (Name => COL_6_1_NAME, -- status
Value => Integer (Status_Type'Pos (Object.Status)));
Object.Clear_Modified (7);
end if;
if Object.Is_Modified (8) then
Stmt.Save_Field (Name => COL_7_1_NAME, -- description
Value => Object.Description);
Object.Clear_Modified (8);
end if;
if Object.Is_Modified (9) then
Stmt.Save_Field (Name => COL_8_1_NAME, -- update_date
Value => Object.Update_Date);
Object.Clear_Modified (9);
end if;
if Object.Is_Modified (10) then
Stmt.Save_Field (Name => COL_9_1_NAME, -- ticket_type
Value => Integer (Ticket_Type'Pos (Object.Ticket_Type)));
Object.Clear_Modified (10);
end if;
if Object.Is_Modified (11) then
Stmt.Save_Field (Name => COL_10_1_NAME, -- duration
Value => Object.Duration);
Object.Clear_Modified (11);
end if;
if Object.Is_Modified (12) then
Stmt.Save_Field (Name => COL_11_1_NAME, -- progress
Value => Object.Progress);
Object.Clear_Modified (12);
end if;
if Object.Is_Modified (13) then
Stmt.Save_Field (Name => COL_12_1_NAME, -- project_id
Value => Object.Project);
Object.Clear_Modified (13);
end if;
if Object.Is_Modified (14) then
Stmt.Save_Field (Name => COL_13_1_NAME, -- creator_id
Value => Object.Creator);
Object.Clear_Modified (14);
end if;
if Stmt.Has_Save_Fields then
Object.Version := Object.Version + 1;
Stmt.Save_Field (Name => "version",
Value => Object.Version);
Stmt.Set_Filter (Filter => "id = ? and version = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Add_Param (Value => Object.Version - 1);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
else
raise ADO.Objects.LAZY_LOCK;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out Ticket_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (TICKET_DEF'Access);
Result : Integer;
begin
Object.Version := 1;
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_0_1_NAME, -- id
Value => Object.Get_Key);
Query.Save_Field (Name => COL_1_1_NAME, -- version
Value => Object.Version);
Query.Save_Field (Name => COL_2_1_NAME, -- summary
Value => Object.Summary);
Query.Save_Field (Name => COL_3_1_NAME, -- ident
Value => Object.Ident);
Query.Save_Field (Name => COL_4_1_NAME, -- create_date
Value => Object.Create_Date);
Query.Save_Field (Name => COL_5_1_NAME, -- priority
Value => Object.Priority);
Query.Save_Field (Name => COL_6_1_NAME, -- status
Value => Integer (Status_Type'Pos (Object.Status)));
Query.Save_Field (Name => COL_7_1_NAME, -- description
Value => Object.Description);
Query.Save_Field (Name => COL_8_1_NAME, -- update_date
Value => Object.Update_Date);
Query.Save_Field (Name => COL_9_1_NAME, -- ticket_type
Value => Integer (Ticket_Type'Pos (Object.Ticket_Type)));
Query.Save_Field (Name => COL_10_1_NAME, -- duration
Value => Object.Duration);
Query.Save_Field (Name => COL_11_1_NAME, -- progress
Value => Object.Progress);
Query.Save_Field (Name => COL_12_1_NAME, -- project_id
Value => Object.Project);
Query.Save_Field (Name => COL_13_1_NAME, -- creator_id
Value => Object.Creator);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
end Create;
procedure Delete (Object : in out Ticket_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (TICKET_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Ticket_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access Ticket_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := Ticket_Impl (Obj.all)'Access;
if Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
elsif Name = "summary" then
return Util.Beans.Objects.To_Object (Impl.Summary);
elsif Name = "ident" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Ident));
elsif Name = "create_date" then
return Util.Beans.Objects.Time.To_Object (Impl.Create_Date);
elsif Name = "priority" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Priority));
elsif Name = "status" then
return Jason.Tickets.Models.Status_Type_Objects.To_Object (Impl.Status);
elsif Name = "description" then
return Util.Beans.Objects.To_Object (Impl.Description);
elsif Name = "update_date" then
return Util.Beans.Objects.Time.To_Object (Impl.Update_Date);
elsif Name = "ticket_type" then
return Jason.Tickets.Models.Ticket_Type_Objects.To_Object (Impl.Ticket_Type);
elsif Name = "duration" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Duration));
elsif Name = "progress" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Progress));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
procedure List (Object : in out Ticket_Vector;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, TICKET_DEF'Access);
begin
Stmt.Execute;
Ticket_Vectors.Clear (Object);
while Stmt.Has_Elements loop
declare
Item : Ticket_Ref;
Impl : constant Ticket_Access := new Ticket_Impl;
begin
Impl.Load (Stmt, Session);
ADO.Objects.Set_Object (Item, Impl.all'Access);
Object.Append (Item);
end;
Stmt.Next;
end loop;
end List;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Ticket_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
begin
Object.Set_Key_Value (Stmt.Get_Identifier (0));
Object.Summary := Stmt.Get_Unbounded_String (2);
Object.Ident := Stmt.Get_Integer (3);
Object.Create_Date := Stmt.Get_Time (4);
Object.Priority := Stmt.Get_Integer (5);
Object.Status := Status_Type'Val (Stmt.Get_Integer (6));
Object.Description := Stmt.Get_Unbounded_String (7);
Object.Update_Date := Stmt.Get_Time (8);
Object.Ticket_Type := Ticket_Type'Val (Stmt.Get_Integer (9));
Object.Duration := Stmt.Get_Integer (10);
Object.Progress := Stmt.Get_Integer (11);
if not Stmt.Is_Null (12) then
Object.Project.Set_Key_Value (Stmt.Get_Identifier (12), Session);
end if;
if not Stmt.Is_Null (13) then
Object.Creator.Set_Key_Value (Stmt.Get_Identifier (13), Session);
end if;
Object.Version := Stmt.Get_Integer (1);
ADO.Objects.Set_Created (Object);
end Load;
function Attribute_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => ATTRIBUTE_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Attribute_Key;
function Attribute_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => ATTRIBUTE_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Attribute_Key;
function "=" (Left, Right : Attribute_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out Attribute_Ref'Class;
Impl : out Attribute_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := Attribute_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out Attribute_Ref) is
Impl : Attribute_Access;
begin
Impl := new Attribute_Impl;
Impl.Version := 0;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: Attribute
-- ----------------------------------------
procedure Set_Id (Object : in out Attribute_Ref;
Value : in ADO.Identifier) is
Impl : Attribute_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value);
end Set_Id;
function Get_Id (Object : in Attribute_Ref)
return ADO.Identifier is
Impl : constant Attribute_Access
:= Attribute_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
procedure Set_Value (Object : in out Attribute_Ref;
Value : in String) is
Impl : Attribute_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 2, Impl.Value, Value);
end Set_Value;
procedure Set_Value (Object : in out Attribute_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Attribute_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 2, Impl.Value, Value);
end Set_Value;
function Get_Value (Object : in Attribute_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Value);
end Get_Value;
function Get_Value (Object : in Attribute_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Attribute_Access
:= Attribute_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Value;
end Get_Value;
function Get_Version (Object : in Attribute_Ref)
return Integer is
Impl : constant Attribute_Access
:= Attribute_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Version;
end Get_Version;
procedure Set_Definition (Object : in out Attribute_Ref;
Value : in Jason.Projects.Models.Attribute_Definition_Ref'Class) is
Impl : Attribute_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 4, Impl.Definition, Value);
end Set_Definition;
function Get_Definition (Object : in Attribute_Ref)
return Jason.Projects.Models.Attribute_Definition_Ref'Class is
Impl : constant Attribute_Access
:= Attribute_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Definition;
end Get_Definition;
procedure Set_Ticket (Object : in out Attribute_Ref;
Value : in Jason.Tickets.Models.Ticket_Ref'Class) is
Impl : Attribute_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 5, Impl.Ticket, Value);
end Set_Ticket;
function Get_Ticket (Object : in Attribute_Ref)
return Jason.Tickets.Models.Ticket_Ref'Class is
Impl : constant Attribute_Access
:= Attribute_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Ticket;
end Get_Ticket;
-- Copy of the object.
procedure Copy (Object : in Attribute_Ref;
Into : in out Attribute_Ref) is
Result : Attribute_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Attribute_Access
:= Attribute_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Attribute_Access
:= new Attribute_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Value := Impl.Value;
Copy.Version := Impl.Version;
Copy.Definition := Impl.Definition;
Copy.Ticket := Impl.Ticket;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out Attribute_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant Attribute_Access := new Attribute_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out Attribute_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant Attribute_Access := new Attribute_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out Attribute_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant Attribute_Access := new Attribute_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out Attribute_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new Attribute_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out Attribute_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access Attribute_Impl) is
type Attribute_Impl_Ptr is access all Attribute_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Attribute_Impl, Attribute_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Attribute_Impl_Ptr := Attribute_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Attribute_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, ATTRIBUTE_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Attribute_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out Attribute_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (ATTRIBUTE_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_2_NAME, -- id
Value => Object.Get_Key);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (2) then
Stmt.Save_Field (Name => COL_1_2_NAME, -- value
Value => Object.Value);
Object.Clear_Modified (2);
end if;
if Object.Is_Modified (4) then
Stmt.Save_Field (Name => COL_3_2_NAME, -- definition_id
Value => Object.Definition);
Object.Clear_Modified (4);
end if;
if Object.Is_Modified (5) then
Stmt.Save_Field (Name => COL_4_2_NAME, -- ticket_id
Value => Object.Ticket);
Object.Clear_Modified (5);
end if;
if Stmt.Has_Save_Fields then
Object.Version := Object.Version + 1;
Stmt.Save_Field (Name => "version",
Value => Object.Version);
Stmt.Set_Filter (Filter => "id = ? and version = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Add_Param (Value => Object.Version - 1);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
else
raise ADO.Objects.LAZY_LOCK;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out Attribute_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (ATTRIBUTE_DEF'Access);
Result : Integer;
begin
Object.Version := 1;
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_0_2_NAME, -- id
Value => Object.Get_Key);
Query.Save_Field (Name => COL_1_2_NAME, -- value
Value => Object.Value);
Query.Save_Field (Name => COL_2_2_NAME, -- version
Value => Object.Version);
Query.Save_Field (Name => COL_3_2_NAME, -- definition_id
Value => Object.Definition);
Query.Save_Field (Name => COL_4_2_NAME, -- ticket_id
Value => Object.Ticket);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
end Create;
procedure Delete (Object : in out Attribute_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (ATTRIBUTE_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Attribute_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access Attribute_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := Attribute_Impl (Obj.all)'Access;
if Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
elsif Name = "value" then
return Util.Beans.Objects.To_Object (Impl.Value);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
procedure List (Object : in out Attribute_Vector;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, ATTRIBUTE_DEF'Access);
begin
Stmt.Execute;
Attribute_Vectors.Clear (Object);
while Stmt.Has_Elements loop
declare
Item : Attribute_Ref;
Impl : constant Attribute_Access := new Attribute_Impl;
begin
Impl.Load (Stmt, Session);
ADO.Objects.Set_Object (Item, Impl.all'Access);
Object.Append (Item);
end;
Stmt.Next;
end loop;
end List;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Attribute_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
begin
Object.Set_Key_Value (Stmt.Get_Identifier (0));
Object.Value := Stmt.Get_Unbounded_String (1);
if not Stmt.Is_Null (3) then
Object.Definition.Set_Key_Value (Stmt.Get_Identifier (3), Session);
end if;
if not Stmt.Is_Null (4) then
Object.Ticket.Set_Key_Value (Stmt.Get_Identifier (4), Session);
end if;
Object.Version := Stmt.Get_Integer (2);
ADO.Objects.Set_Created (Object);
end Load;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in List_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Id));
elsif Name = "ident" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Ident));
elsif Name = "summary" then
return Util.Beans.Objects.To_Object (From.Summary);
elsif Name = "priority" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Priority));
elsif Name = "create_date" then
return Util.Beans.Objects.Time.To_Object (From.Create_Date);
elsif Name = "update_date" then
return Util.Beans.Objects.Time.To_Object (From.Update_Date);
elsif Name = "status" then
return Jason.Tickets.Models.Status_Type_Objects.To_Object (From.Status);
elsif Name = "ticket_type" then
return Jason.Tickets.Models.Ticket_Type_Objects.To_Object (From.Ticket_Type);
elsif Name = "duration" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Duration));
elsif Name = "progress" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Progress));
elsif Name = "creator" then
return Util.Beans.Objects.To_Object (From.Creator);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out List_Info;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "id" then
Item.Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "ident" then
Item.Ident := Util.Beans.Objects.To_Integer (Value);
elsif Name = "summary" then
Item.Summary := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "priority" then
Item.Priority := Util.Beans.Objects.To_Integer (Value);
elsif Name = "create_date" then
Item.Create_Date := Util.Beans.Objects.Time.To_Time (Value);
elsif Name = "update_date" then
Item.Update_Date := Util.Beans.Objects.Time.To_Time (Value);
elsif Name = "status" then
Item.Status := Jason.Tickets.Models.Status_Type_Objects.To_Value (Value);
elsif Name = "ticket_type" then
Item.Ticket_Type := Jason.Tickets.Models.Ticket_Type_Objects.To_Value (Value);
elsif Name = "duration" then
Item.Duration := Util.Beans.Objects.To_Integer (Value);
elsif Name = "progress" then
Item.Progress := Util.Beans.Objects.To_Integer (Value);
elsif Name = "creator" then
Item.Creator := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
end Set_Value;
-- --------------------
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
-- --------------------
procedure List (Object : in out List_Info_List_Bean'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
begin
List (Object.List, Session, Context);
end List;
-- --------------------
-- The list of tickets.
-- --------------------
procedure List (Object : in out List_Info_Vector;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
procedure Read (Into : in out List_Info);
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Context);
Pos : Positive := 1;
procedure Read (Into : in out List_Info) is
begin
Into.Id := Stmt.Get_Identifier (0);
Into.Ident := Stmt.Get_Integer (1);
Into.Summary := Stmt.Get_Unbounded_String (2);
Into.Priority := Stmt.Get_Integer (3);
Into.Create_Date := Stmt.Get_Time (4);
Into.Update_Date := Stmt.Get_Time (5);
Into.Status := Jason.Tickets.Models.Status_Type'Val (Stmt.Get_Integer (6));
Into.Ticket_Type := Jason.Tickets.Models.Ticket_Type'Val (Stmt.Get_Integer (7));
Into.Duration := Stmt.Get_Integer (8);
Into.Progress := Stmt.Get_Integer (9);
Into.Creator := Stmt.Get_Unbounded_String (10);
end Read;
begin
Stmt.Execute;
List_Info_Vectors.Clear (Object);
while Stmt.Has_Elements loop
Object.Insert_Space (Before => Pos);
Object.Update_Element (Index => Pos, Process => Read'Access);
Pos := Pos + 1;
Stmt.Next;
end loop;
end List;
procedure Op_Load (Bean : in out Ticket_Info;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load (Bean : in out Ticket_Info;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Ticket_Info'Class (Bean).Load (Outcome);
end Op_Load;
package Binding_Ticket_Info_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Ticket_Info,
Method => Op_Load,
Name => "load");
Binding_Ticket_Info_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Ticket_Info_1.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Ticket_Info)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Ticket_Info_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Ticket_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Id));
elsif Name = "ident" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Ident));
elsif Name = "summary" then
return Util.Beans.Objects.To_Object (From.Summary);
elsif Name = "description" then
return Util.Beans.Objects.To_Object (From.Description);
elsif Name = "priority" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Priority));
elsif Name = "create_date" then
return Util.Beans.Objects.Time.To_Object (From.Create_Date);
elsif Name = "update_date" then
return Util.Beans.Objects.Time.To_Object (From.Update_Date);
elsif Name = "status" then
return Jason.Tickets.Models.Status_Type_Objects.To_Object (From.Status);
elsif Name = "project_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Project_Id));
elsif Name = "project_name" then
return Util.Beans.Objects.To_Object (From.Project_Name);
elsif Name = "creator" then
return Util.Beans.Objects.To_Object (From.Creator);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Ticket_Info;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "id" then
Item.Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "ident" then
Item.Ident := Util.Beans.Objects.To_Integer (Value);
elsif Name = "summary" then
Item.Summary := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "description" then
Item.Description := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "priority" then
Item.Priority := Util.Beans.Objects.To_Integer (Value);
elsif Name = "create_date" then
Item.Create_Date := Util.Beans.Objects.Time.To_Time (Value);
elsif Name = "update_date" then
Item.Update_Date := Util.Beans.Objects.Time.To_Time (Value);
elsif Name = "status" then
Item.Status := Jason.Tickets.Models.Status_Type_Objects.To_Value (Value);
elsif Name = "project_id" then
Item.Project_Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "project_name" then
Item.Project_Name := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "creator" then
Item.Creator := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
end Set_Value;
-- --------------------
-- Read in the object the data from the query result and prepare to read the next row.
-- If there is no row, raise the ADO.NOT_FOUND exception.
-- --------------------
procedure Read (Into : in out Ticket_Info;
Stmt : in out ADO.Statements.Query_Statement'Class) is
begin
if not Stmt.Has_Elements then
raise ADO.Objects.NOT_FOUND;
end if;
Into.Id := Stmt.Get_Identifier (0);
Into.Ident := Stmt.Get_Integer (1);
Into.Summary := Stmt.Get_Unbounded_String (2);
Into.Description := Stmt.Get_Unbounded_String (3);
Into.Priority := Stmt.Get_Integer (4);
Into.Create_Date := Stmt.Get_Time (5);
Into.Update_Date := Stmt.Get_Time (6);
Into.Status := Jason.Tickets.Models.Status_Type'Val (Stmt.Get_Integer (7));
Into.Project_Id := Stmt.Get_Identifier (8);
Into.Project_Name := Stmt.Get_Unbounded_String (9);
Into.Creator := Stmt.Get_Unbounded_String (10);
Stmt.Next;
end Read;
-- --------------------
-- Run the query controlled by <b>Context</b> and load the result in <b>Object</b>.
-- --------------------
procedure Load (Object : in out Ticket_Info'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Context);
begin
Stmt.Execute;
Read (Object, Stmt);
if Stmt.Has_Elements then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Op_Load (Bean : in out Ticket_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load (Bean : in out Ticket_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Ticket_Bean'Class (Bean).Load (Outcome);
end Op_Load;
package Binding_Ticket_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Ticket_Bean,
Method => Op_Load,
Name => "load");
procedure Op_Create (Bean : in out Ticket_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Create (Bean : in out Ticket_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Ticket_Bean'Class (Bean).Create (Outcome);
end Op_Create;
package Binding_Ticket_Bean_2 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Ticket_Bean,
Method => Op_Create,
Name => "create");
procedure Op_Save (Bean : in out Ticket_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Save (Bean : in out Ticket_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Ticket_Bean'Class (Bean).Save (Outcome);
end Op_Save;
package Binding_Ticket_Bean_3 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Ticket_Bean,
Method => Op_Save,
Name => "save");
procedure Op_Save_Status (Bean : in out Ticket_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Save_Status (Bean : in out Ticket_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Ticket_Bean'Class (Bean).Save_Status (Outcome);
end Op_Save_Status;
package Binding_Ticket_Bean_4 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Ticket_Bean,
Method => Op_Save_Status,
Name => "save_status");
Binding_Ticket_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Ticket_Bean_1.Proxy'Access,
2 => Binding_Ticket_Bean_2.Proxy'Access,
3 => Binding_Ticket_Bean_3.Proxy'Access,
4 => Binding_Ticket_Bean_4.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Ticket_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Ticket_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Ticket_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "comment" then
return Util.Beans.Objects.To_Object (From.Comment);
end if;
return Jason.Tickets.Models.Ticket_Ref (From).Get_Value (Name);
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Ticket_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "comment" then
Item.Comment := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "summary" then
Item.Set_Summary (Util.Beans.Objects.To_String (Value));
elsif Name = "ident" then
Item.Set_Ident (Util.Beans.Objects.To_Integer (Value));
elsif Name = "create_date" then
Item.Set_Create_Date (Util.Beans.Objects.Time.To_Time (Value));
elsif Name = "priority" then
Item.Set_Priority (Util.Beans.Objects.To_Integer (Value));
elsif Name = "status" then
Item.Set_Status (Status_Type_Objects.To_Value (Value));
elsif Name = "description" then
Item.Set_Description (Util.Beans.Objects.To_String (Value));
elsif Name = "update_date" then
Item.Set_Update_Date (Util.Beans.Objects.Time.To_Time (Value));
elsif Name = "ticket_type" then
Item.Set_Ticket_Type (Ticket_Type_Objects.To_Value (Value));
elsif Name = "duration" then
Item.Set_Duration (Util.Beans.Objects.To_Integer (Value));
elsif Name = "progress" then
Item.Set_Progress (Util.Beans.Objects.To_Integer (Value));
end if;
end Set_Value;
procedure Op_Load (Bean : in out Ticket_List_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load (Bean : in out Ticket_List_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Ticket_List_Bean'Class (Bean).Load (Outcome);
end Op_Load;
package Binding_Ticket_List_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Ticket_List_Bean,
Method => Op_Load,
Name => "load");
Binding_Ticket_List_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Ticket_List_Bean_1.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Ticket_List_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Ticket_List_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Ticket_List_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "project_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Project_Id));
elsif Name = "page" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Page));
elsif Name = "count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Count));
elsif Name = "tag" then
return Util.Beans.Objects.To_Object (From.Tag);
elsif Name = "page_size" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Page_Size));
elsif Name = "sort" then
return Util.Beans.Objects.To_Object (From.Sort);
elsif Name = "status" then
return Status_Type_Objects.To_Object (From.Status);
elsif Name = "priority" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Priority));
elsif Name = "ticket_kind" then
return Ticket_Type_Objects.To_Object (From.Ticket_Kind);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Ticket_List_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "project_id" then
Item.Project_Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "page" then
Item.Page := Util.Beans.Objects.To_Integer (Value);
elsif Name = "count" then
Item.Count := Util.Beans.Objects.To_Integer (Value);
elsif Name = "tag" then
Item.Tag := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "page_size" then
Item.Page_Size := Util.Beans.Objects.To_Integer (Value);
elsif Name = "sort" then
Item.Sort := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "status" then
Item.Status := Status_Type_Objects.To_Value (Value);
elsif Name = "priority" then
Item.Priority := Util.Beans.Objects.To_Integer (Value);
elsif Name = "ticket_kind" then
Item.Ticket_Kind := Ticket_Type_Objects.To_Value (Value);
end if;
end Set_Value;
procedure Op_Load (Bean : in out Ticket_Info_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load (Bean : in out Ticket_Info_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Ticket_Info_Bean'Class (Bean).Load (Outcome);
end Op_Load;
package Binding_Ticket_Info_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Ticket_Info_Bean,
Method => Op_Load,
Name => "load");
Binding_Ticket_Info_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Ticket_Info_Bean_1.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Ticket_Info_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Ticket_Info_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Ticket_Info_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "ticket_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Ticket_Id));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Ticket_Info_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "ticket_id" then
Item.Ticket_Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
end if;
end Set_Value;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Stat_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "kind" then
return Ticket_Type_Objects.To_Object (From.Kind);
elsif Name = "priority" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Priority));
elsif Name = "count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Count));
elsif Name = "time" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Time));
elsif Name = "remain" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Remain));
elsif Name = "done" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Done));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Stat_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "kind" then
Item.Kind := Ticket_Type_Objects.To_Value (Value);
elsif Name = "priority" then
Item.Priority := Util.Beans.Objects.To_Integer (Value);
elsif Name = "count" then
Item.Count := Util.Beans.Objects.To_Integer (Value);
elsif Name = "time" then
Item.Time := Util.Beans.Objects.To_Integer (Value);
elsif Name = "remain" then
Item.Remain := Util.Beans.Objects.To_Integer (Value);
elsif Name = "done" then
Item.Done := Util.Beans.Objects.To_Integer (Value);
end if;
end Set_Value;
procedure Op_Load (Bean : in out Report_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load (Bean : in out Report_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Report_Bean'Class (Bean).Load (Outcome);
end Op_Load;
package Binding_Report_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Report_Bean,
Method => Op_Load,
Name => "load");
Binding_Report_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Report_Bean_1.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Report_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Report_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Report_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Report_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
null;
end Set_Value;
end Jason.Tickets.Models;
| 38.580794 | 97 | 0.59408 |
188076e141f33d667339295448ad11b04698921a | 4,964 | ads | Ada | source/amf/uml/amf-uml-time_events-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-time_events-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-time_events-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 <vgodunko@gmail.com> --
-- 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.Time_Events.Collections is
pragma Preelaborate;
package UML_Time_Event_Collections is
new AMF.Generic_Collections
(UML_Time_Event,
UML_Time_Event_Access);
type Set_Of_UML_Time_Event is
new UML_Time_Event_Collections.Set with null record;
Empty_Set_Of_UML_Time_Event : constant Set_Of_UML_Time_Event;
type Ordered_Set_Of_UML_Time_Event is
new UML_Time_Event_Collections.Ordered_Set with null record;
Empty_Ordered_Set_Of_UML_Time_Event : constant Ordered_Set_Of_UML_Time_Event;
type Bag_Of_UML_Time_Event is
new UML_Time_Event_Collections.Bag with null record;
Empty_Bag_Of_UML_Time_Event : constant Bag_Of_UML_Time_Event;
type Sequence_Of_UML_Time_Event is
new UML_Time_Event_Collections.Sequence with null record;
Empty_Sequence_Of_UML_Time_Event : constant Sequence_Of_UML_Time_Event;
private
Empty_Set_Of_UML_Time_Event : constant Set_Of_UML_Time_Event
:= (UML_Time_Event_Collections.Set with null record);
Empty_Ordered_Set_Of_UML_Time_Event : constant Ordered_Set_Of_UML_Time_Event
:= (UML_Time_Event_Collections.Ordered_Set with null record);
Empty_Bag_Of_UML_Time_Event : constant Bag_Of_UML_Time_Event
:= (UML_Time_Event_Collections.Bag with null record);
Empty_Sequence_Of_UML_Time_Event : constant Sequence_Of_UML_Time_Event
:= (UML_Time_Event_Collections.Sequence with null record);
end AMF.UML.Time_Events.Collections;
| 53.956522 | 80 | 0.512691 |
4aee19d0c26cbcad71a95a3729c96827ab54f8d2 | 14,131 | adb | Ada | awa/src/awa-modules.adb | Letractively/ada-awa | 3c82a4d29ed6c1209a2ac7d5fe123c142f3cffbe | [
"Apache-2.0"
] | null | null | null | awa/src/awa-modules.adb | Letractively/ada-awa | 3c82a4d29ed6c1209a2ac7d5fe123c142f3cffbe | [
"Apache-2.0"
] | null | null | null | awa/src/awa-modules.adb | Letractively/ada-awa | 3c82a4d29ed6c1209a2ac7d5fe123c142f3cffbe | [
"Apache-2.0"
] | null | null | null | -----------------------------------------------------------------------
-- awa -- Ada Web Application
-- Copyright (C) 2009, 2010, 2011, 2012 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- 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 ASF.Requests;
with ASF.Responses;
with ASF.Server;
with Ada.IO_Exceptions;
with Util.Files;
with Util.Properties;
with EL.Contexts.Default;
with AWA.Modules.Reader;
with AWA.Applications;
package body AWA.Modules is
-- ------------------------------
-- Get the module name
-- ------------------------------
function Get_Name (Plugin : in Module) return String is
begin
return To_String (Plugin.Name);
end Get_Name;
-- ------------------------------
-- Get the base URI for this module
-- ------------------------------
function Get_URI (Plugin : in Module) return String is
begin
return To_String (Plugin.URI);
end Get_URI;
-- ------------------------------
-- Get the application in which this module is registered.
-- ------------------------------
function Get_Application (Plugin : in Module) return Application_Access is
begin
return Plugin.App;
end Get_Application;
-- ------------------------------
-- Get the module configuration property identified by the name.
-- If the configuration property does not exist, returns the default value.
-- ------------------------------
function Get_Config (Plugin : Module;
Name : String;
Default : String := "") return String is
begin
return Plugin.Config.Get (Name, Default);
end Get_Config;
-- ------------------------------
-- Get the module configuration property identified by the name.
-- If the configuration property does not exist, returns the default value.
-- ------------------------------
function Get_Config (Plugin : in Module;
Name : in String;
Default : in Integer := -1) return Integer is
Value : constant String := Plugin.Config.Get (Name, Integer'Image (Default));
begin
return Integer'Value (Value);
exception
when Constraint_Error =>
return Default;
end Get_Config;
-- ------------------------------
-- Get the module configuration property identified by the <tt>Config</tt> parameter.
-- If the property does not exist, the default configuration value is returned.
-- ------------------------------
function Get_Config (Plugin : in Module;
Config : in ASF.Applications.Config_Param) return String is
begin
return Plugin.Config.Get (Config);
end Get_Config;
-- ------------------------------
-- Send the event to the module
-- ------------------------------
procedure Send_Event (Plugin : in Module;
Content : in AWA.Events.Module_Event'Class) is
begin
Plugin.App.Send_Event (Content);
end Send_Event;
-- ------------------------------
-- Find the module with the given name
-- ------------------------------
function Find_Module (Plugin : Module;
Name : String) return Module_Access is
begin
if Plugin.Registry = null then
return null;
end if;
return Find_By_Name (Plugin.Registry.all, Name);
end Find_Module;
-- ------------------------------
-- Register under the given name a function to create the bean instance when
-- it is accessed for a first time. The scope defines the scope of the bean.
-- bean
-- ------------------------------
procedure Register (Plugin : in out Module;
Name : in String;
Bind : in ASF.Beans.Class_Binding_Access) is
begin
Plugin.App.Register_Class (Name, Bind);
end Register;
-- ------------------------------
-- Finalize the module.
-- ------------------------------
overriding
procedure Finalize (Plugin : in out Module) is
begin
null;
end Finalize;
procedure Initialize (Manager : in out Module_Manager;
Module : in AWA.Modules.Module'Class) is
begin
Manager.Module := Module.Self;
end Initialize;
function Get_Value (Manager : in Module_Manager;
Name : in String) return Util.Beans.Objects.Object is
pragma Unreferenced (Manager, Name);
begin
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- Module manager
--
-- ------------------------------
-- Get the database connection for reading
-- ------------------------------
function Get_Session (Manager : Module_Manager)
return ADO.Sessions.Session is
begin
return Manager.Module.Get_Session;
end Get_Session;
-- ------------------------------
-- Get the database connection for writing
-- ------------------------------
function Get_Master_Session (Manager : Module_Manager)
return ADO.Sessions.Master_Session is
begin
return Manager.Module.Get_Master_Session;
end Get_Master_Session;
-- ------------------------------
-- Send the event to the module. The module identified by <b>To</b> is
-- found and the event is posted on its event channel.
-- ------------------------------
procedure Send_Event (Manager : in Module_Manager;
Content : in AWA.Events.Module_Event'Class) is
begin
Manager.Module.Send_Event (Content);
end Send_Event;
procedure Initialize (Plugin : in out Module;
App : in Application_Access;
Props : in ASF.Applications.Config) is
pragma Unreferenced (Props);
begin
Plugin.Self := Plugin'Unchecked_Access;
Plugin.App := App;
end Initialize;
-- ------------------------------
-- Initialize the registry
-- ------------------------------
procedure Initialize (Registry : in out Module_Registry;
Config : in ASF.Applications.Config) is
begin
Registry.Config := Config;
end Initialize;
-- ------------------------------
-- Register the module in the registry.
-- ------------------------------
procedure Register (Registry : in Module_Registry_Access;
App : in Application_Access;
Plugin : in Module_Access;
Name : in String;
URI : in String) is
procedure Copy (Params : in Util.Properties.Manager'Class);
procedure Copy (Params : in Util.Properties.Manager'Class) is
begin
Plugin.Config.Copy (From => Params, Prefix => Name & ".", Strip => True);
end Copy;
Paths : constant String := Registry.Config.Get (Applications.P_Module_Dir.P);
begin
Log.Info ("Register module '{0}' under URI '{1}'", Name, URI);
if Plugin.Registry /= null then
Log.Error ("Module '{0}' is already attached to a registry", Name);
raise Program_Error with "Module '" & Name & "' already registered";
end if;
Plugin.App := App;
Plugin.Registry := Registry;
Plugin.Name := To_Unbounded_String (Name);
Plugin.URI := To_Unbounded_String (URI);
Plugin.Registry.Name_Map.Insert (Name, Plugin);
if URI /= "" then
Plugin.Registry.URI_Map.Insert (URI, Plugin);
end if;
-- Load the module configuration file
Log.Debug ("Module search path: {0}", Paths);
declare
Base : constant String := Name & ".properties";
Path : constant String := Util.Files.Find_File_Path (Base, Paths);
begin
Plugin.Config.Load_Properties (Path => Path, Prefix => Name & ".", Strip => True);
exception
when Ada.IO_Exceptions.Name_Error =>
Log.Info ("Module configuration file '{0}' does not exist", Path);
end;
Plugin.Initialize (App, Plugin.Config);
-- Read the module XML configuration file if there is one.
declare
Base : constant String := Plugin.Config.Get ("config", Name & ".xml");
Path : constant String := Util.Files.Find_File_Path (Base, Paths);
Ctx : aliased EL.Contexts.Default.Default_Context;
begin
AWA.Modules.Reader.Read_Configuration (Plugin.all, Path, Ctx'Unchecked_Access);
exception
when Ada.IO_Exceptions.Name_Error =>
Log.Warn ("Module configuration file '{0}' does not exist", Path);
end;
-- Override the module configuration with the application configuration
App.Get_Init_Parameters (Copy'Access);
Plugin.Configure (Plugin.Config);
exception
when Constraint_Error =>
Log.Error ("Another module is already registered "
& "under name '{0}' or URI '{1}'", Name, URI);
raise;
end Register;
-- ------------------------------
-- Find the module with the given name
-- ------------------------------
function Find_By_Name (Registry : Module_Registry;
Name : String) return Module_Access is
Pos : constant Module_Maps.Cursor := Module_Maps.Find (Registry.Name_Map, Name);
begin
if Module_Maps.Has_Element (Pos) then
return Module_Maps.Element (Pos);
end if;
return null;
end Find_By_Name;
-- ------------------------------
-- Find the module mapped to a given URI
-- ------------------------------
function Find_By_URI (Registry : Module_Registry;
URI : String) return Module_Access is
Pos : constant Module_Maps.Cursor := Module_Maps.Find (Registry.URI_Map, URI);
begin
if Module_Maps.Has_Element (Pos) then
return Module_Maps.Element (Pos);
end if;
return null;
end Find_By_URI;
-- ------------------------------
-- Iterate over the modules that have been registered and execute the <b>Process</b>
-- procedure on each of the module instance.
-- ------------------------------
procedure Iterate (Registry : in Module_Registry;
Process : access procedure (Plugin : in out Module'Class)) is
Iter : Module_Maps.Cursor := Registry.Name_Map.First;
begin
while Module_Maps.Has_Element (Iter) loop
Process (Module_Maps.Element (Iter).all);
Module_Maps.Next (Iter);
end loop;
end Iterate;
-- ------------------------------
-- Get the database connection for reading
-- ------------------------------
function Get_Session (Manager : Module)
return ADO.Sessions.Session is
begin
return Manager.App.Get_Session;
end Get_Session;
-- ------------------------------
-- Get the database connection for writing
-- ------------------------------
function Get_Master_Session (Manager : Module)
return ADO.Sessions.Master_Session is
begin
return Manager.App.Get_Master_Session;
end Get_Master_Session;
-- ------------------------------
-- Add a listener to the module listner list. The module will invoke the listner
-- depending on events or actions that occur in the module.
-- ------------------------------
procedure Add_Listener (Into : in out Module;
Item : in Util.Listeners.Listener_Access) is
begin
Util.Listeners.Add_Listener (Into.Listeners, Item);
end Add_Listener;
-- ------------------------------
-- Remove a listener from the module listener list.
-- ------------------------------
procedure Remove_Listener (Into : in out Module;
Item : in Util.Listeners.Listener_Access) is
begin
Util.Listeners.Remove_Listener (Into.Listeners, Item);
end Remove_Listener;
-- Get per request manager => look in Request
-- Get per session manager => look in Request.Get_Session
-- Get per application manager => look in Application
-- Get per pool manager => look in pool attached to Application
function Get_Manager return Manager_Type_Access is
procedure Process (Request : in out ASF.Requests.Request'Class;
Response : in out ASF.Responses.Response'Class);
Value : Util.Beans.Objects.Object;
procedure Process (Request : in out ASF.Requests.Request'Class;
Response : in out ASF.Responses.Response'Class) is
pragma Unreferenced (Response);
begin
Value := Request.Get_Attribute (Name);
if Util.Beans.Objects.Is_Null (Value) then
declare
M : constant Manager_Type_Access := new Manager_Type;
begin
Value := Util.Beans.Objects.To_Object (M.all'Unchecked_Access);
Request.Set_Attribute (Name, Value);
end;
end if;
end Process;
begin
ASF.Server.Update_Context (Process'Access);
if Util.Beans.Objects.Is_Null (Value) then
return null;
end if;
declare
B : constant access Util.Beans.Basic.Readonly_Bean'Class
:= Util.Beans.Objects.To_Bean (Value);
begin
if not (B.all in Manager_Type'Class) then
return null;
end if;
return Manager_Type'Class (B.all)'Unchecked_Access;
end;
end Get_Manager;
end AWA.Modules;
| 36.233333 | 91 | 0.554596 |
4a47e2fe3918b08ba94047c688626509f5ac394a | 372 | adb | Ada | tests/syntax_examples/src/test_call_filtering.adb | TNO/Dependency_Graph_Extractor-Ada | cfcc9132cf181e4db5139c14150f221efa69a6d6 | [
"BSD-3-Clause"
] | 1 | 2022-03-08T13:00:47.000Z | 2022-03-08T13:00:47.000Z | src/tools/Dependency_Graph_Extractor/tests/Syntax_Examples/src/test_call_filtering.adb | selroc/Renaissance-Ada | 39230b34aced4a9d83831be346ca103136c53715 | [
"BSD-3-Clause"
] | null | null | null | src/tools/Dependency_Graph_Extractor/tests/Syntax_Examples/src/test_call_filtering.adb | selroc/Renaissance-Ada | 39230b34aced4a9d83831be346ca103136c53715 | [
"BSD-3-Clause"
] | null | null | null | package body Test_Call_Filtering is
type T is tagged
null record;
function P(Self : T) return T is
begin
return Self;
end P;
function Q(Self : T; I : Integer) return T is
begin
return Self;
end Q;
procedure Test is
E : T;
begin
E := E.P.P;
E := E.Q(1).Q(2);
end Test;
end Test_Call_Filtering;
| 15.5 | 48 | 0.55914 |
dc23f70ebcb84aade89356cef689c3dba24e495a | 4,448 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c6/c64104b.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/c6/c64104b.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c6/c64104b.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- C64104B.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 UNDER APPROPRIATE CIRCUMSTANCES
-- WITH RESPECT TO PARAMETERS OF RECORD TYPES. SUBTESTS INVOLVE
-- ACTUAL RECORD PARAMETERS WHOSE CONSTRAINT VALUES ARE NOT EQUAL
-- TO THE CONSTRAINTS ON THEIR CORRESPONDING FORMAL PARAMETERS:
-- (A) IN PARAMETER, STATIC AGGREGATE.
-- (B) IN PARAMETER, DYNAMIC AGGREGATE.
-- (C) IN PARAMETER, VARIABLE.
-- (D) IN OUT PARAMETER, EXCEPTION RAISED ON CALL.
-- (E) OUT PARAMETER, EXCEPTION RAISED ON CALL.
-- DAS 2/11/81
-- SPS 10/26/82
WITH REPORT;
PROCEDURE C64104B IS
USE REPORT;
SUBTYPE INT IS INTEGER RANGE 0..10;
TYPE REC (N : INT := 0) IS
RECORD
A : STRING (1..N);
END RECORD;
SUBTYPE SREC IS REC(N=>3);
PROCEDURE P1 (R : IN SREC) IS
BEGIN
FAILED ("EXCEPTION NOT RAISED ON CALL TO P1");
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN PROCEDURE P1");
END P1;
PROCEDURE P2 (R : IN OUT SREC) IS
BEGIN
FAILED ("EXCEPTION NOT RAISED ON CALL TO P2");
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN PROCEDURE P2");
END P2;
PROCEDURE P3 (R : OUT SREC) IS
BEGIN
FAILED ("EXCEPTION NOT RAISED ON CALL TO P3");
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN PROCEDURE P3");
END P3;
BEGIN
TEST ("C64104B", "CHECK RAISING OF CONSTRAINT_ERROR FOR " &
"PARAMETERS OF RECORD TYPES");
BEGIN -- (A)
P1 ((2,"AA"));
FAILED ("EXCEPTION NOT RAISED IN SUBTEST (A)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED IN SUBTEST (A)");
END; -- (A)
BEGIN -- (B)
P1 ((IDENT_INT(2), "AA"));
FAILED ("EXCEPTION NOT RAISED IN SUBTEST (B)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED IN SUBTEST (B)");
END; -- (B)
DECLARE -- (C)
R : REC := (IDENT_INT(2), "AA");
BEGIN -- (C)
P1 (R);
FAILED ("EXCEPTION NOT RAISED IN SUBTEST (C)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED IN SUBTEST (C)");
END; -- (C)
DECLARE -- (D)
R : REC := (IDENT_INT(2), "AA");
BEGIN -- (D)
P2 (R);
FAILED ("EXCEPTION NOT RAISED IN SUBTEST (D)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED IN SUBTEST (D)");
END; -- (D)
DECLARE -- (E)
R : REC;
BEGIN -- (E)
P3 (R);
FAILED ("EXCEPTION NOT RAISED IN SUBTEST (E)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED IN SUBTEST (E)");
END; -- (E)
RESULT;
END C64104B;
| 32.467153 | 79 | 0.56205 |
4a728f04858b5c5d0df83628d7263cb2a0f8d123 | 5,031 | adb | Ada | PP-Semaphores/src/lab1.adb | JackShen1/parallel-programming | 9682d035559147fd493d54e956af7e5ab0dff228 | [
"MIT"
] | 3 | 2021-02-28T18:45:06.000Z | 2021-05-12T22:36:23.000Z | PP-Semaphores/src/lab1.adb | JackShen1/parallel-programming | 9682d035559147fd493d54e956af7e5ab0dff228 | [
"MIT"
] | null | null | null | PP-Semaphores/src/lab1.adb | JackShen1/parallel-programming | 9682d035559147fd493d54e956af7e5ab0dff228 | [
"MIT"
] | null | null | null | ------------------------------------------------------
--| Semaphores |
------------------------------------------------------
--| Author | Jack (Yevhenii) Shendrikov |
--| Group | IO-82 |
--| Variant | #25 |
--| Date | 29.11.2020 |
------------------------------------------------------
--| Function 1 | D = SORT(A)+SORT(B)+SORT(C)*(MA*ME) |
--| Function 2 | MF = (MG*MH)*TRANS(MK) |
--| Function 3 | S = (MO*MP)*V+t*MR*(O+P) |
------------------------------------------------------
with Data;
with Ada.Integer_Text_IO, Ada.Text_IO, Ada.Characters.Latin_1;
use Ada.Integer_Text_IO, Ada.Text_IO, Ada.Characters.Latin_1;
with System.Multiprocessors; use System.Multiprocessors;
with Semaphores;
use Semaphores;
procedure Lab1 is
N: Integer;
MY_SIMA : SIMA (1,2);
procedure Tasks is
package My_Data is new Data(N);
use My_Data;
CPU_0: CPU_Range := 0;
CPU_1: CPU_Range := 1;
CPU_2: CPU_Range := 2;
task T1 is
pragma Task_Name("T1");
pragma Priority(4);
pragma Storage_Size(500000000);
pragma CPU (CPU_0);
end T1;
task T2 is
pragma Task_Name("T2");
pragma Priority(3);
pragma Storage_Size(500000000);
pragma CPU (CPU_1);
end T2;
task T3 is
pragma Task_Name("T3");
pragma Priority(7);
pragma Storage_Size(500000000);
pragma CPU (CPU_2);
end T3;
task body T1 is
A,B,C,D: Vector;
MA,ME: Matrix;
begin
Put_Line("Task T1 started");
delay 0.7;
Put_Line("T1 is waiting for a permit.");
-- Generate Input Values
MY_SIMA.P; -- Acquire the semaphore
New_Line; Put_Line("T1 gets a permit.");
delay 1.0;
Input_Val_F1(A,B,C,MA,ME);
Put_Line("T1 releases the permit.");
MY_SIMA.V; -- Release the semaphore
New_Line; Put_Line("T1 is waiting for a permit.");
-- Calculate The Result
D := Func1(A,B,C,MA,ME);
delay 1.0;
-- Output
MY_SIMA.P; -- Acquire the semaphore
Put_Line("T1 gets a permit.");
Put("T1 | ");
Vector_Output(D, "D");
Put_Line("T1 releases the permit."); New_Line;
MY_SIMA.V; -- Release the semaphore
Put_Line("Task T1 finished"); New_Line;
end T1;
task body T2 is
MG,MH,MK,MF: Matrix;
begin
Put_Line("Task T2 started");
delay 1.0;
Put_Line("T2 is waiting for a permit.");
-- Generate Input Values
MY_SIMA.P; -- Acquire the semaphore
New_Line; Put_Line("T2 gets a permit.");
delay 1.0;
Input_Val_F2(MG,MH,MK);
Put_Line("T2 releases the permit."); New_Line;
MY_SIMA.V; -- Release the semaphore
New_Line; Put_Line("T2 is waiting for a permit.");
-- Calculate The Result
MF := Func2(MG,MH,MK);
delay 1.0;
-- Output
MY_SIMA.P; -- Acquire the semaphore
Put_Line("T2 gets a permit.");
Put_Line("T2 | ");
Matrix_Output(MF, "MF");
Put_Line("T2 releases the permit.");
MY_SIMA.V; -- Release the semaphore
Put_Line("Task T2 finished"); New_Line;
end T2;
task body T3 is
t: Integer;
V,O,P,S: Vector;
MO,MP,MR: Matrix;
begin
Put_Line("Task T3 started");
delay 0.5;
Put_Line("T3 is waiting for a permit.");
-- Generate Input Values
MY_SIMA.P; -- Acquire the semaphore
New_Line; Put_Line("T3 gets a permit.");
delay 1.0;
Input_Val_F3(t,V,O,P,MO,MP,MR);
Put_Line("T3 releases the permit.");
MY_SIMA.V; -- Release the semaphore
New_Line; Put_Line("T3 is waiting for a permit.");
-- Calculate The Result
S := Func3(t,V,O,P,MO,MP,MR);
delay 1.0;
-- Output
MY_SIMA.P; -- Acquire the semaphore
Put_Line("T3 gets a permit.");
Put("T3 | ");
Vector_Output(S, "S");
Put_Line("T3 releases the permit."); New_Line;
MY_SIMA.V; -- Release the semaphore
Put_Line("Task T3 finished"); New_Line;
end T3;
begin
Put_Line("Calculations started");
New_Line;
end Tasks;
begin
Put_Line("Function 1: D = SORT(A)+SORT(B)+SORT(C)*(MA*ME)" & CR & LF
& "Function 2: MF = (MG*MH)*TRANS(MK)" & CR & LF
& "Function 3: S = (MO*MP)*V+t*MR*(O+P)" & CR & LF);
Put_Line("!!! Note that if the value of N > 10 -> the result will not be displayed !!!" & CR & LF
& "!!! If you enter N <= 0 - execution will be terminated !!!" & CR & LF);
Put("Enter N: ");
Get(N);
New_Line;
Tasks;
Put_Line("All task finished");
end Lab1;
| 28.913793 | 100 | 0.500696 |
dc004895d10a1b10a92a365a4576c08d966edd93 | 7,268 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ce/ce3410c.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ce/ce3410c.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ce/ce3410c.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- CE3410C.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 SET_LINE SETS THE CURRENT LINE NUMBER TO THE VALUE
-- SPECIFIED BY TO FOR FILES OF MODES IN_FILE AND OUT_FILE.
-- CHECK THAT IT HAS NO EFFECT IF THE VALUE SPECIFIED BY TO IS
-- EQUAL TO THE CURRENT LINE NUMBER FOR BOTH IN_FILE AND OUT_FILE.
-- APPLICABILITY CRITERIA:
-- THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
-- TEXT FILES.
-- HISTORY:
-- ABW 08/26/82
-- SPS 09/20/82
-- JBG 01/27/83
-- EG 05/22/85
-- TBN 11/10/86 REVISED TEST TO OUTPUT A NOT_APPLICABLE
-- RESULT WHEN FILES ARE NOT SUPPORTED.
-- JLH 09/01/87 REMOVED DEPENDENCE ON RESET, ADDED MORE TEST
-- CASES, AND CHECKED FOR USE_ERROR ON DELETE.
-- JRL 02/29/96 Added File parameter to call to Set_Page_Length.
WITH REPORT; USE REPORT;
WITH TEXT_IO; USE TEXT_IO;
WITH CHECK_FILE;
PROCEDURE CE3410C IS
INCOMPLETE : EXCEPTION;
BEGIN
TEST ("CE3410C", "CHECK THAT SET_LINE SETS LINE " &
"NUMBER CORRECTLY");
DECLARE
FILE : FILE_TYPE;
CHAR : CHARACTER := ('C');
ITEM_CHAR : CHARACTER;
ONE : POSITIVE_COUNT := POSITIVE_COUNT (IDENT_INT(1));
TWO : POSITIVE_COUNT := POSITIVE_COUNT (IDENT_INT(2));
THREE : POSITIVE_COUNT := POSITIVE_COUNT (IDENT_INT(3));
FOUR : POSITIVE_COUNT := POSITIVE_COUNT (IDENT_INT(4));
BEGIN
BEGIN
CREATE (FILE, OUT_FILE, LEGAL_FILE_NAME);
EXCEPTION
WHEN USE_ERROR =>
NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT CREATE " &
"WITH OUT_FILE MODE");
RAISE INCOMPLETE;
WHEN NAME_ERROR =>
NOT_APPLICABLE ("NAME_ERROR RAISED ON TEXT " &
"CREATE WITH OUT_FILE MODE");
RAISE INCOMPLETE;
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED ON TEXT " &
"CREATE");
RAISE INCOMPLETE;
END;
SET_LINE (FILE, FOUR);
IF LINE (FILE) /= FOUR THEN
FAILED ("FOR OUT_FILE LINE NOT FOUR");
ELSE
PUT (FILE, 'C');
NEW_LINE (FILE);
SET_LINE (FILE, 5);
IF LINE (FILE) /= FOUR+1 THEN
FAILED ("FOR OUT_FILE LINE UNNECESSARILY " &
"CHANGED FROM FOUR");
ELSE
SET_LINE (FILE, 8);
PUT (FILE, "DE");
SET_LINE (FILE, TWO+1);
IF LINE (FILE) /= TWO+ONE THEN
FAILED ("FOR OUT_FILE LINE NOT THREE");
END IF;
SET_LINE (FILE, TWO);
IF PAGE (FILE) /= ONE+TWO THEN
FAILED ("PAGE TERMINATOR NOT OUTPUT - 2");
END IF;
IF LINE (FILE) /= TWO THEN
FAILED ("LINE NOT TWO; IS" &
COUNT'IMAGE(LINE(FILE)));
END IF;
SET_PAGE_LENGTH (FILE, TWO);
PUT (FILE, 'X');
SET_LINE (FILE, TWO);
PUT (FILE, 'Y');
IF LINE (FILE) /= TWO THEN
FAILED ("LINE NOT TWO; IS " &
COUNT'IMAGE(LINE(FILE)));
END IF;
IF PAGE (FILE) /= THREE THEN
FAILED ("PAGE NOT THREE; IS " &
COUNT'IMAGE(PAGE(FILE)));
END IF;
END IF;
END IF;
CHECK_FILE (FILE, "###C####DE#@##@#XY#@%");
CLOSE (FILE);
BEGIN
OPEN (FILE, IN_FILE, LEGAL_FILE_NAME);
EXCEPTION
WHEN USE_ERROR =>
NOT_APPLICABLE ("USE_ERROR RAISED FOR TEXT OPEN " &
"WITH IN_FILE MODE");
RAISE INCOMPLETE;
END;
SET_LINE (FILE, FOUR);
IF LINE (FILE) /= FOUR THEN
FAILED ("FOR IN_FILE LINE NOT FOUR");
ELSE
GET (FILE, ITEM_CHAR);
IF ITEM_CHAR /= 'C' THEN
FAILED ("SET_LINE FOR READ; ACTUALLY READ '" &
ITEM_CHAR & "'");
END IF;
SKIP_LINE (FILE);
SET_LINE (FILE, 5);
IF LINE (FILE) /= FOUR+1 OR PAGE (FILE) /= ONE THEN
FAILED ("INCORRECT LINE OR PAGE");
ELSE
SET_LINE (FILE, 8);
GET (FILE, ITEM_CHAR);
IF ITEM_CHAR /= 'D' THEN
FAILED ("SET_LINE FOR READ 2; ACTUALLY READ '"&
ITEM_CHAR & "'");
END IF;
SET_LINE (FILE, TWO);
IF PAGE (FILE) /= TWO THEN
FAILED ("FOR IN_FILE PAGE NOT TWO");
END IF;
SET_LINE (FILE, TWO);
IF PAGE (FILE) /= TWO OR LINE (FILE) /= TWO THEN
FAILED ("FOR IN_FILE PAGE NOT 2");
END IF;
SKIP_LINE (FILE);
SET_LINE (FILE, TWO);
GET (FILE, ITEM_CHAR);
IF ITEM_CHAR /= 'X' THEN
FAILED ("SET_LINE FOR READ 3; ACTUALLY READ '"&
ITEM_CHAR & "'");
END IF;
END IF;
END IF;
BEGIN
DELETE (FILE);
EXCEPTION
WHEN USE_ERROR =>
NULL;
END;
EXCEPTION
WHEN INCOMPLETE =>
NULL;
END;
RESULT;
END CE3410C;
| 35.281553 | 79 | 0.474546 |
dc26affd854167e68e0d227d1e1e6f17a0ffe449 | 1,085 | ads | Ada | ordinary/pc_1_interface.ads | jscparker/math_packages | b112a90338014d5c2dfae3f7265ee30841fb6cfd | [
"ISC",
"MIT"
] | 30 | 2018-12-09T01:15:04.000Z | 2022-03-20T16:14:54.000Z | ordinary/pc_1_interface.ads | jscparker/math_packages | b112a90338014d5c2dfae3f7265ee30841fb6cfd | [
"ISC",
"MIT"
] | null | null | null | ordinary/pc_1_interface.ads | jscparker/math_packages | b112a90338014d5c2dfae3f7265ee30841fb6cfd | [
"ISC",
"MIT"
] | null | null | null |
-- PACKAGE pc_1_interface
--
-- The 17th order coefficients are almost always the best choice.
--
-- The Predictor-Corrector method uses least-squares to fit a 17th
-- order polynomial to the 33 previous values of F in dY/dt = F(t,Y).
-- The least-squares-fit polynomial is used to predict the next
-- values of F and Y.
with pc_1_coeff_16;
with pc_1_coeff_17;
with pc_1_coeff_18;
package pc_1_interface is
-- predictor_Coeff_16 (16th order) gives bit better stability.
-- predictor_Coeff_17 (17th order) is usually best for numerical
-- accuracy, and best choice for general use.
-- predictor_Coeff_18 (18th order) gives a bit better numerical
-- accuracy when larger stepsizes are used (and when
-- desired accuracy is well below machine's ultimate).
--generic package Predictor_Corrector_Rules renames pc_1_coeff_16;
generic package Predictor_Corrector_Rules renames pc_1_coeff_17; --use this
--generic package Predictor_Corrector_Rules renames pc_1_coeff_18;
end pc_1_interface;
| 35 | 78 | 0.720737 |
c55258dcce0dc5a57f3cea983a2d30e277a5b4dc | 5,066 | adb | Ada | source/nodes/program-nodes-derived_types.adb | optikos/oasis | 9f64d46d26d964790d69f9db681c874cfb3bf96d | [
"MIT"
] | null | null | null | source/nodes/program-nodes-derived_types.adb | optikos/oasis | 9f64d46d26d964790d69f9db681c874cfb3bf96d | [
"MIT"
] | null | null | null | source/nodes/program-nodes-derived_types.adb | optikos/oasis | 9f64d46d26d964790d69f9db681c874cfb3bf96d | [
"MIT"
] | 2 | 2019-09-14T23:18:50.000Z | 2019-10-02T10:11:40.000Z | -- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
package body Program.Nodes.Derived_Types is
function Create
(Abstract_Token : Program.Lexical_Elements.Lexical_Element_Access;
Limited_Token : Program.Lexical_Elements.Lexical_Element_Access;
New_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Parent : not null Program.Elements.Expressions.Expression_Access)
return Derived_Type is
begin
return Result : Derived_Type :=
(Abstract_Token => Abstract_Token, Limited_Token => Limited_Token,
New_Token => New_Token, Parent => Parent, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
function Create
(Parent : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False;
Has_Abstract : Boolean := False;
Has_Limited : Boolean := False)
return Implicit_Derived_Type is
begin
return Result : Implicit_Derived_Type :=
(Parent => Parent, Is_Part_Of_Implicit => Is_Part_Of_Implicit,
Is_Part_Of_Inherited => Is_Part_Of_Inherited,
Is_Part_Of_Instance => Is_Part_Of_Instance,
Has_Abstract => Has_Abstract, Has_Limited => Has_Limited,
Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
overriding function Parent
(Self : Base_Derived_Type)
return not null Program.Elements.Expressions.Expression_Access is
begin
return Self.Parent;
end Parent;
overriding function Abstract_Token
(Self : Derived_Type)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Abstract_Token;
end Abstract_Token;
overriding function Limited_Token
(Self : Derived_Type)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Limited_Token;
end Limited_Token;
overriding function New_Token
(Self : Derived_Type)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.New_Token;
end New_Token;
overriding function Has_Abstract (Self : Derived_Type) return Boolean is
begin
return Self.Abstract_Token.Assigned;
end Has_Abstract;
overriding function Has_Limited (Self : Derived_Type) return Boolean is
begin
return Self.Limited_Token.Assigned;
end Has_Limited;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Derived_Type)
return Boolean is
begin
return Self.Is_Part_Of_Implicit;
end Is_Part_Of_Implicit;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Derived_Type)
return Boolean is
begin
return Self.Is_Part_Of_Inherited;
end Is_Part_Of_Inherited;
overriding function Is_Part_Of_Instance
(Self : Implicit_Derived_Type)
return Boolean is
begin
return Self.Is_Part_Of_Instance;
end Is_Part_Of_Instance;
overriding function Has_Abstract
(Self : Implicit_Derived_Type)
return Boolean is
begin
return Self.Has_Abstract;
end Has_Abstract;
overriding function Has_Limited
(Self : Implicit_Derived_Type)
return Boolean is
begin
return Self.Has_Limited;
end Has_Limited;
procedure Initialize (Self : aliased in out Base_Derived_Type'Class) is
begin
Set_Enclosing_Element (Self.Parent, Self'Unchecked_Access);
null;
end Initialize;
overriding function Is_Derived_Type_Element
(Self : Base_Derived_Type)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Derived_Type_Element;
overriding function Is_Type_Definition_Element
(Self : Base_Derived_Type)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Type_Definition_Element;
overriding function Is_Definition_Element
(Self : Base_Derived_Type)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Definition_Element;
overriding procedure Visit
(Self : not null access Base_Derived_Type;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is
begin
Visitor.Derived_Type (Self);
end Visit;
overriding function To_Derived_Type_Text
(Self : aliased in out Derived_Type)
return Program.Elements.Derived_Types.Derived_Type_Text_Access is
begin
return Self'Unchecked_Access;
end To_Derived_Type_Text;
overriding function To_Derived_Type_Text
(Self : aliased in out Implicit_Derived_Type)
return Program.Elements.Derived_Types.Derived_Type_Text_Access is
pragma Unreferenced (Self);
begin
return null;
end To_Derived_Type_Text;
end Program.Nodes.Derived_Types;
| 29.625731 | 79 | 0.708448 |
4ac4210e336f50be8a7786ae1df18f99e4a9d2fb | 6,003 | ads | Ada | arch/ARM/STM32/driversF1/stm32-crc-dma.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 2 | 2018-05-16T03:56:39.000Z | 2019-07-31T13:53:56.000Z | arch/ARM/STM32/driversF1/stm32-crc-dma.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | arch/ARM/STM32/driversF1/stm32-crc-dma.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2017, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- A driver for the Cyclic Redundancy Check CRC-32 calculation processor,
-- using DMA to transfer the data to the CRC unit (instead of the CPU).
-- Note this API is for the STM32 F4x family. Other STM MCUs have additional
-- CRC capabilities.
-- See also app note AN4187 "Using CRC through DMA"
-- Example usage, assuming prior clock enabling for the CRC unit:
-- Checksum_DMA : UInt32 := 0;
--
-- Data : constant Block_32 := ( .... );
--
-- ...
--
-- Enable_Clock (Controller);
--
-- Reset (Controller);
--
-- Reset_Calculator (CRC_Unit); -- if need be
--
-- Update_CRC (CRC_Unit, Controller'Access, Stream, Input => Data);
--
-- DMA_IRQ_Handler.Await_Event (Next_DMA_Interrupt);
--
-- if Next_DMA_Interrupt /= Transfer_Complete_Interrupt then
-- Panic;
-- end if;
--
-- Checksum_DMA := Value (CRC_Unit);
with STM32.DMA; use STM32.DMA;
with System;
package STM32.CRC.DMA is
pragma Elaborate_Body;
-- These routines use the specified controller and stream to transfer
-- all of the Input data components to This CRC unit, updating the
-- CRC value accordingly. At the end of the transfer the DMA interrupt
-- Transfer_Complete_Interrupt is triggered. Clients are expected to have
-- an application-defined handler for that interrupt, in order to await
-- completion of the transfer.
-- These routines can be called multiple times, back-to-back, presumably
-- with different input blocks, in order to update the value of the
-- calculated CRC checksum within the CRC processor. Each call will
-- result in a Transfer_Complete_Interrupt event.
-- Note that you can use a slice if the entire block is not intended for
-- transfer, but beware alignment boundaries to prevent copying of the
-- actual parameter into a temporary.
procedure Update_CRC
(This : in out CRC_32;
Controller : access DMA_Controller;
Channel : DMA_Channel_Selector;
Input : Block_32);
-- Update the calculated CRC value based on all of the 32-bit components
-- of Input. Triggers the Transfer_Complete_Interrupt on completion.
procedure Update_CRC
(This : in out CRC_32;
Controller : access DMA_Controller;
Channel : DMA_Channel_Selector;
Input : Block_16);
-- Update the calculated CRC value based on all of the 16-bit components
-- of Input. Triggers the Transfer_Complete_Interrupt on completion.
procedure Update_CRC
(This : in out CRC_32;
Controller : access DMA_Controller;
Channel : DMA_Channel_Selector;
Input : Block_8);
-- Update the calculated CRC value based on all of the 8-bit components
-- of Input. Triggers the Transfer_Complete_Interrupt on completion.
private
procedure Transfer_Input_To_CRC
(This : in out CRC_32;
Controller : access DMA_Controller;
Channel : DMA_Channel_Selector;
Input_Address : System.Address;
Input_Length : UInt16;
Data_Width : DMA_Data_Transfer_Widths);
-- Configures the DMA controller and stream for transfering memory blocks,
-- of the width specified by Data_Width, to This CRC processor. Then uses
-- the controller and stream to transfer the data starting at Input_Address
-- to This CRC unit, updating the CRC value accordingly. The number of
-- Input memory items (of Data_Width size) to be transferred is specified
-- by Input_Length. At the end of the transfer the DMA interrupt
-- Transfer_Complete_Interrupt is triggered.
end STM32.CRC.DMA;
| 46.898438 | 79 | 0.617691 |
dcb1fe1e12c7eda70c02ceb4ea44bf96351075b2 | 2,820 | ads | Ada | SVD2ada/svd/stm32_svd-crc.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | SVD2ada/svd/stm32_svd-crc.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | SVD2ada/svd/stm32_svd-crc.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.CRC is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- IDR array element
subtype IDR_Element is HAL.UInt8;
-- IDR array
type IDR_Field_Array is array (1 .. 4) of IDR_Element
with Component_Size => 8, Size => 32;
-- Independent data register
type IDR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- IDR as a value
Val : HAL.UInt32;
when True =>
-- IDR as an array
Arr : IDR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for IDR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype CR_POLYSIZE_Field is HAL.UInt2;
subtype CR_REV_IN_Field is HAL.UInt2;
-- Control register
type CR_Register is record
-- reset bit
RESET : Boolean := False;
-- unspecified
Reserved_1_2 : HAL.UInt2 := 16#0#;
-- Polynomial size
POLYSIZE : CR_POLYSIZE_Field := 16#0#;
-- Reverse input data
REV_IN : CR_REV_IN_Field := 16#0#;
-- Reverse output data
REV_OUT : Boolean := False;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CR_Register use record
RESET at 0 range 0 .. 0;
Reserved_1_2 at 0 range 1 .. 2;
POLYSIZE at 0 range 3 .. 4;
REV_IN at 0 range 5 .. 6;
REV_OUT at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- cyclic redundancy check calculation unit
type CRC_Peripheral is record
-- Data register
DR : aliased HAL.UInt32;
-- Independent data register
IDR : aliased IDR_Register;
-- Control register
CR : aliased CR_Register;
-- Initial CRC value
INIT : aliased HAL.UInt32;
-- CRC polynomial
POL : aliased HAL.UInt32;
end record
with Volatile;
for CRC_Peripheral use record
DR at 16#0# range 0 .. 31;
IDR at 16#4# range 0 .. 31;
CR at 16#8# range 0 .. 31;
INIT at 16#10# range 0 .. 31;
POL at 16#14# range 0 .. 31;
end record;
-- cyclic redundancy check calculation unit
CRC_Periph : aliased CRC_Peripheral
with Import, Address => CRC_Base;
end STM32_SVD.CRC;
| 26.35514 | 79 | 0.58156 |
dcbbae56f79265580f5fdfe9061ffe07ce450910 | 2,775 | ads | Ada | gcc-gcc-7_3_0-release/gcc/ada/s-exnllf.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/ada/s-exnllf.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/ada/s-exnllf.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 . E X N _ L L F --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- [Long_[Long_]]Float exponentiation (checks off)
package System.Exn_LLF is
pragma Pure;
function Exn_Float
(Left : Float;
Right : Integer) return Float;
function Exn_Long_Float
(Left : Long_Float;
Right : Integer) return Long_Float;
function Exn_Long_Long_Float
(Left : Long_Long_Float;
Right : Integer) return Long_Long_Float;
end System.Exn_LLF;
| 55.5 | 78 | 0.411532 |
cb1bf8b0bb411b71ba26737b9c4524d120b039df | 3,831 | ads | Ada | Validation/pyFrame3DD-master/gcc-master/gcc/ada/sem_elim.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/sem_elim.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/sem_elim.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S E M _ E L I M --
-- --
-- S p e c --
-- --
-- Copyright (C) 1997-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. --
-- --
------------------------------------------------------------------------------
-- This package contains the routines used to process the Eliminate pragma
with Types; use Types;
package Sem_Elim is
procedure Initialize;
-- Initialize for new main source program
procedure Process_Eliminate_Pragma
(Pragma_Node : Node_Id;
Arg_Unit_Name : Node_Id;
Arg_Entity : Node_Id;
Arg_Parameter_Types : Node_Id;
Arg_Result_Type : Node_Id;
Arg_Source_Location : Node_Id);
-- Process eliminate pragma (given by Pragma_Node). The number of
-- arguments has been checked, as well as possible optional identifiers,
-- but no other checks have been made. This subprogram completes the
-- checking, and then if the pragma is well formed, makes appropriate
-- entries in the internal tables used to keep track of Eliminate pragmas.
-- The other five arguments are expressions (rather than pragma argument
-- associations) for the possible pragma arguments. A parameter that
-- is not present is set to Empty.
procedure Check_Eliminated (E : Entity_Id);
-- Checks if entity E is eliminated, and if so sets the Is_Eliminated
-- flag on the given entity.
procedure Check_For_Eliminated_Subprogram (N : Node_Id; S : Entity_Id);
-- Check that the subprogram S (or its ultimate parent in the case of a
-- derived subprogram or renaming) has not been eliminated. An error will
-- be flagged if the subprogram has been eliminated, unless the node N
-- occurs within an eliminated subprogram or within a generic unit. The
-- error will be posted on N.
procedure Eliminate_Error_Msg (N : Node_Id; E : Entity_Id);
-- Called by the front-end on encountering a reference to an eliminated
-- subprogram. N is the node for the reference (such as occurs in a call,
-- a protected call or an attribute), and E is the entity of the
-- subprogram that has been eliminated.
end Sem_Elim;
| 55.521739 | 78 | 0.541112 |
1842ce83e131557c3de2272495ab7d1df4abde1a | 1,744 | ada | Ada | Task/Non-decimal-radices-Convert/Ada/non-decimal-radices-convert.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:38.000Z | 2018-11-09T22:08:38.000Z | Task/Non-decimal-radices-Convert/Ada/non-decimal-radices-convert.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | null | null | null | Task/Non-decimal-radices-Convert/Ada/non-decimal-radices-convert.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 Ada.Strings.Fixed;
With Ada.Strings.Unbounded;
procedure Number_Base_Conversion is
Max_Base : constant := 36;
subtype Base_Type is Integer range 2..Max_Base;
Num_Digits : constant String := "0123456789abcdefghijklmnopqrstuvwxyz";
Invalid_Digit : exception;
function To_Decimal(Value : String; Base : Base_Type) return Integer is
use Ada.Strings.Fixed;
Result : Integer := 0;
Decimal_Value : Integer;
Radix_Offset : Natural := 0;
begin
for I in reverse Value'range loop
Decimal_Value := Index(Num_Digits, Value(I..I)) - 1;
if Decimal_Value < 0 then
raise Invalid_Digit;
end if;
Result := Result + (Base**Radix_Offset * Decimal_Value);
Radix_Offset := Radix_Offset + 1;
end loop;
return Result;
end To_Decimal;
function To_Base(Value : Natural; Base : Base_Type) return String is
use Ada.Strings.Unbounded;
Result : Unbounded_String := Null_Unbounded_String;
Temp : Natural := Value;
Base_Digit : String(1..1);
begin
if Temp = 0 then
return "0";
end if;
while Temp > 0 loop
Base_Digit(1) := Num_Digits((Temp mod Base) + 1);
if Result = Null_Unbounded_String then
Append(Result, Base_Digit);
else
Insert(Source => Result,
Before => 1,
New_Item => Base_Digit);
end if;
Temp := Temp / Base;
end loop;
return To_String(Result);
end To_Base;
begin
Put_Line("26 converted to base 16 is " & To_Base(26, 16));
Put_line("1a (base 16) is decimal" & Integer'image(To_Decimal("1a", 16)));
end Number_Base_Conversion;
| 31.709091 | 77 | 0.622133 |
183e8c57a953276d2794017f9e48404e074a4edf | 5,857 | adb | Ada | source/amf/uml/amf-internals-uml_classifiers.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/amf/uml/amf-internals-uml_classifiers.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/amf/uml/amf-internals-uml_classifiers.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Internals.Tables.UML_Attributes;
with AMF.UML.Generalizations.Collections;
package body AMF.Internals.UML_Classifiers is
-----------------
-- All_Parents --
-----------------
overriding function All_Parents
(Self : not null access constant UML_Classifier_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier
is
-- [UML241] 7.3.8 Classifier
--
-- [3] The query allParents() gives all of the direct and indirect
-- ancestors of a generalized Classifier.
--
-- Classifier::allParents(): Set(Classifier);
--
-- allParents =
-- self.parents()->union(self.parents()->collect(p | p.allParents()))
P : constant AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier
:= Self.Parents;
begin
return Result : AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier
:= P
do
for J in 1 .. P.Length loop
Result.Union (P.Element (J).All_Parents);
end loop;
end return;
end All_Parents;
-------------
-- Parents --
-------------
overriding function Parents
(Self : not null access constant UML_Classifier_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier
is
-- [UML241] 7.3.8 Classifier
--
-- [2] The query parents() gives all of the immediate ancestors of a
-- generalized Classifier.
--
-- Classifier::parents(): Set(Classifier);
--
-- parents = generalization.general
begin
return Result : AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier do
declare
G : constant
AMF.UML.Generalizations.Collections.Set_Of_UML_Generalization
:= UML_Classifier_Proxy'Class (Self.all).Get_Generalization;
X : AMF.UML.Classifiers.UML_Classifier_Access;
-- GNAT FSF 4.6: X is used to workaround crash of compiler.
begin
for J in 1 .. G.Length loop
X := G.Element (J).Get_General;
Result.Add (X);
end loop;
end;
end return;
end Parents;
---------------------
-- Set_Is_Abstract --
---------------------
overriding procedure Set_Is_Abstract
(Self : not null access UML_Classifier_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Abstract
(Self.Element, To);
end Set_Is_Abstract;
end AMF.Internals.UML_Classifiers;
| 45.757813 | 78 | 0.480963 |
d06f60d96257aef6d10db63276d4c04d9836f91e | 108 | ads | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/layered_abstraction_p.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/layered_abstraction_p.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/layered_abstraction_p.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | generic
type T is private;
Obj : T;
package Layered_Abstraction_P is
Obj2 : T := Obj;
end;
| 15.428571 | 32 | 0.611111 |
dc6f42e43999a34bcbaa1bffe77b987491a2dad7 | 699 | ada | Ada | Task/Generator-Exponential/Ada/generator-exponential-1.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:38.000Z | 2018-11-09T22:08:38.000Z | Task/Generator-Exponential/Ada/generator-exponential-1.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | null | null | null | Task/Generator-Exponential/Ada/generator-exponential-1.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:40.000Z | 2018-11-09T22:08:40.000Z | package Generator is
type Generator is tagged private;
procedure Reset (Gen : in out Generator);
function Get_Next (Gen : access Generator) return Natural;
type Generator_Function is access function (X : Natural) return Natural;
procedure Set_Generator_Function (Gen : in out Generator;
Func : Generator_Function);
procedure Skip (Gen : access Generator'Class; Count : Positive := 1);
private
function Identity (X : Natural) return Natural;
type Generator is tagged record
Last_Source : Natural := 0;
Last_Value : Natural := 0;
Gen_Func : Generator_Function := Identity'Access;
end record;
end Generator;
| 29.125 | 75 | 0.67525 |
d033c9abce2b78c57fbad189e07d7250a7e25b72 | 243 | adb | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/renaming1.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/renaming1.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/renaming1.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- { dg-do compile}
-- { dg-options "-gnatwa" }
with Text_IO;
use Text_IO;
package body renaming1 is
procedure Fo (A : Text_IO.File_Access) is
begin
if A = Text_IO.Standard_Output then
null;
end if;
end Fo;
end;
| 17.357143 | 44 | 0.625514 |
dca1b413f70f7c4d9a163858dd2f542a6a84a2ac | 5,957 | adb | Ada | llvm-gcc-4.2-2.9/gcc/ada/s-pooloc.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-pooloc.adb | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | llvm-gcc-4.2-2.9/gcc/ada/s-pooloc.adb | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . P O O L _ L O C A L --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.Memory;
with Unchecked_Conversion;
package body System.Pool_Local is
package SSE renames System.Storage_Elements;
use type SSE.Storage_Offset;
Pointer_Size : constant SSE.Storage_Offset := Address'Size / Storage_Unit;
Pointers_Size : constant SSE.Storage_Offset := 2 * Pointer_Size;
type Acc_Address is access all Address;
function To_Acc_Address is new Unchecked_Conversion (Address, Acc_Address);
-----------------------
-- Local Subprograms --
-----------------------
function Next (A : Address) return Acc_Address;
pragma Inline (Next);
-- Given an address of a block, return an access to the next block
function Prev (A : Address) return Acc_Address;
pragma Inline (Prev);
-- Given an address of a block, return an access to the previous block
--------------
-- Allocate --
--------------
procedure Allocate
(Pool : in out Unbounded_Reclaim_Pool;
Address : out System.Address;
Storage_Size : SSE.Storage_Count;
Alignment : SSE.Storage_Count)
is
pragma Warnings (Off, Alignment);
Allocated : constant System.Address :=
Memory.Alloc
(Memory.size_t (Storage_Size + Pointers_Size));
begin
-- The call to Alloc returns an address whose alignment is compatible
-- with the worst case alignment requirement for the machine; thus the
-- Alignment argument can be safely ignored.
if Allocated = Null_Address then
raise Storage_Error;
else
Address := Allocated + Pointers_Size;
Next (Allocated).all := Pool.First;
Prev (Allocated).all := Null_Address;
if Pool.First /= Null_Address then
Prev (Pool.First).all := Allocated;
end if;
Pool.First := Allocated;
end if;
end Allocate;
----------------
-- Deallocate --
----------------
procedure Deallocate
(Pool : in out Unbounded_Reclaim_Pool;
Address : System.Address;
Storage_Size : SSE.Storage_Count;
Alignment : SSE.Storage_Count)
is
pragma Warnings (Off, Storage_Size);
pragma Warnings (Off, Alignment);
Allocated : constant System.Address := Address - Pointers_Size;
begin
if Prev (Allocated).all = Null_Address then
Pool.First := Next (Allocated).all;
Prev (Pool.First).all := Null_Address;
else
Next (Prev (Allocated).all).all := Next (Allocated).all;
end if;
if Next (Allocated).all /= Null_Address then
Prev (Next (Allocated).all).all := Prev (Allocated).all;
end if;
Memory.Free (Allocated);
end Deallocate;
--------------
-- Finalize --
--------------
procedure Finalize (Pool : in out Unbounded_Reclaim_Pool) is
N : System.Address := Pool.First;
Allocated : System.Address;
begin
while N /= Null_Address loop
Allocated := N;
N := Next (N).all;
Memory.Free (Allocated);
end loop;
end Finalize;
----------
-- Next --
----------
function Next (A : Address) return Acc_Address is
begin
return To_Acc_Address (A);
end Next;
----------
-- Prev --
----------
function Prev (A : Address) return Acc_Address is
begin
return To_Acc_Address (A + Pointer_Size);
end Prev;
end System.Pool_Local;
| 36.771605 | 78 | 0.515864 |
c5a208d0bef6c37b1bc494b37f748daab4dac3cf | 5,405 | adb | Ada | testsuite/sql/TN-138/test_138.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | testsuite/sql/TN-138/test_138.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | testsuite/sql/TN-138/test_138.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- SQL Database Access --
-- --
-- Testsuite Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with League.Strings;
with League.Holders.Integers;
with SQL.Databases;
with SQL.Options;
with SQL.Queries;
with Matreshka.Internals.SQL_Drivers.SQLite3.Factory;
pragma Unreferenced (Matreshka.Internals.SQL_Drivers.SQLite3.Factory);
procedure Test_138 is
use type League.Strings.Universal_String;
function "+"
(Item : Wide_Wide_String) return League.Strings.Universal_String
renames League.Strings.To_Universal_String;
DB_Driver : constant League.Strings.Universal_String := +"SQLITE3";
DB_Options : SQL.Options.SQL_Options;
DB : SQL.Databases.SQL_Database
:= SQL.Databases.Create (DB_Driver, DB_Options);
Query : SQL.Queries.SQL_Query := DB.Query;
Result_1 : League.Strings.Universal_String;
Result_2 : League.Strings.Universal_String;
begin
DB.Open;
-- Create database schema.
Query.Prepare
(+"CREATE TABLE test138 (x INTEGER, y CHARACTER VARYING)");
Query.Execute;
-- Fill initial data.
Query.Prepare (+"INSERT INTO test138 (x, y) VALUES (:x, :y)");
Query.Bind_Value (+":y", League.Holders.To_Holder (+"xyz"));
Query.Bind_Value (+":x", League.Holders.Integers.To_Holder (5));
Query.Execute;
Query.Bind_Value (+":y", League.Holders.To_Holder (+"abc"));
Query.Bind_Value (+":x", League.Holders.Integers.To_Holder (6));
Query.Execute;
-- Retrieve first value.
Query.Prepare (+"SELECT y FROM test138 WHERE x=:x");
Query.Bind_Value (+":x", League.Holders.Integers.To_Holder (5));
Query.Execute;
if Query.Next then
Result_1 := League.Holders.Element (Query.Value (1));
else
raise Program_Error;
end if;
-- Retrieve second value.
Query.Bind_Value (+":x", League.Holders.Integers.To_Holder (6));
Query.Execute;
if Query.Next then
Result_2 := League.Holders.Element (Query.Value (1));
else
raise Program_Error;
end if;
-- Compare values was retrieved, they should be different.
if Result_1 = Result_2 then
raise Program_Error;
end if;
DB.Close;
end Test_138;
| 43.943089 | 78 | 0.501203 |
d0c534b21ef8c75e5e0ddfda8ff77e77f7208deb | 6,907 | ads | Ada | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnarl/s-tpobop.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnarl/s-tpobop.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnarl/s-tpobop.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- SYSTEM.TASKING.PROTECTED_OBJECTS.OPERATIONS --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2021, 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. --
-- --
-- --
-- --
-- --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- This package contains all the extended primitives related to protected
-- objects with entries.
-- The handling of protected objects with no entries is done in
-- System.Tasking.Protected_Objects, the simple routines for protected
-- objects with entries in System.Tasking.Protected_Objects.Entries. The
-- split between Entries and Operations is needed to break circular
-- dependencies inside the run time.
-- Note: the compiler generates direct calls to this interface, via Rtsfind.
-- Any changes to this interface may require corresponding compiler changes.
with Ada.Exceptions;
with System.Tasking.Protected_Objects.Entries;
package System.Tasking.Protected_Objects.Operations is
pragma Elaborate_Body;
type Communication_Block is private;
-- Objects of this type are passed between GNARL calls to allow RTS
-- information to be preserved.
procedure Protected_Entry_Call
(Object : Entries.Protection_Entries_Access;
E : Protected_Entry_Index;
Uninterpreted_Data : System.Address;
Mode : Call_Modes;
Block : out Communication_Block);
-- Make 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.
--
-- E
-- The index representing the entry to be called.
--
-- 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
--
-- Block
-- Information passed between runtime calls by the compiler
procedure Service_Entries (Object : Entries.Protection_Entries_Access);
pragma Inline (Service_Entries);
-- Service all entry queues of the specified object, executing the
-- corresponding bodies of any queued entry calls that are waiting
-- on True barriers. 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.
--
-- Note that servicing an entry may change the value of one or more
-- barriers, so this routine keeps checking barriers until all of
-- them are closed.
procedure Complete_Entry_Body (Object : Entries.Protection_Entries_Access);
-- Called from within an entry body procedure, indicates that the
-- corresponding entry call has been serviced.
procedure Exceptional_Complete_Entry_Body
(Object : Entries.Protection_Entries_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
(Object : Entries.Protection_Entries;
E : Protected_Entry_Index)
return Natural;
-- Return the number of entry calls to E on Object
function Protected_Entry_Caller
(Object : Entries.Protection_Entries) 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 Communication_Block is record
Self : Task_Id;
end record;
pragma Volatile (Communication_Block);
-- When a program contains limited interfaces, the compiler generates the
-- predefined primitives associated with dispatching selects. One of the
-- parameters of these routines is of type Communication_Block. Even if
-- the program lacks implementing concurrent types, the tasking runtime is
-- dragged in unconditionally because of Communication_Block. To avoid this
-- case, the compiler uses type Dummy_Communication_Block which defined in
-- System.Soft_Links. If the structure of Communication_Block is changed,
-- the corresponding dummy type must be changed as well.
-- The Communication_Block seems to be a relic. At the moment, the
-- compiler seems to be generating unnecessary conditional code based on
-- this block. See the code generated for async. select with task entry
-- call for another way of solving this ???
end System.Tasking.Protected_Objects.Operations;
| 51.162963 | 79 | 0.58057 |
4afbf75a76f7cc39ee8a52089e477d7140321aca | 8,373 | ads | Ada | source/amf/mof/cmof/amf-cmof-multiplicity_elements.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/amf/mof/cmof/amf-cmof-multiplicity_elements.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/amf/mof/cmof/amf-cmof-multiplicity_elements.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, Vadim Godunko <vgodunko@gmail.com> --
-- 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.
------------------------------------------------------------------------------
-- A multiplicity is a definition of an inclusive interval of non-negative
-- integers beginning with a lower bound and ending with a (possibly
-- infinite) upper bound. A multiplicity element embeds this information to
-- specify the allowable cardinalities for an instantiation of this element.
------------------------------------------------------------------------------
with AMF.CMOF.Elements;
package AMF.CMOF.Multiplicity_Elements is
pragma Preelaborate;
type CMOF_Multiplicity_Element is limited interface
and AMF.CMOF.Elements.CMOF_Element;
type CMOF_Multiplicity_Element_Access is
access all CMOF_Multiplicity_Element'Class;
for CMOF_Multiplicity_Element_Access'Storage_Size use 0;
not overriding function Get_Is_Ordered
(Self : not null access constant CMOF_Multiplicity_Element)
return Boolean is abstract;
-- Getter of MultiplicityElement::isOrdered.
--
-- For a multivalued multiplicity, this attribute specifies whether the
-- values in an instantiation of this element are sequentially ordered.
not overriding procedure Set_Is_Ordered
(Self : not null access CMOF_Multiplicity_Element;
To : Boolean) is abstract;
-- Setter of MultiplicityElement::isOrdered.
--
-- For a multivalued multiplicity, this attribute specifies whether the
-- values in an instantiation of this element are sequentially ordered.
not overriding function Get_Is_Unique
(Self : not null access constant CMOF_Multiplicity_Element)
return Boolean is abstract;
-- Getter of MultiplicityElement::isUnique.
--
-- For a multivalued multiplicity, this attributes specifies whether the
-- values in an instantiation of this element are unique.
not overriding procedure Set_Is_Unique
(Self : not null access CMOF_Multiplicity_Element;
To : Boolean) is abstract;
-- Setter of MultiplicityElement::isUnique.
--
-- For a multivalued multiplicity, this attributes specifies whether the
-- values in an instantiation of this element are unique.
not overriding function Get_Lower
(Self : not null access constant CMOF_Multiplicity_Element)
return AMF.Optional_Integer is abstract;
-- Getter of MultiplicityElement::lower.
--
-- Specifies the lower bound of the multiplicity interval.
not overriding procedure Set_Lower
(Self : not null access CMOF_Multiplicity_Element;
To : AMF.Optional_Integer) is abstract;
-- Setter of MultiplicityElement::lower.
--
-- Specifies the lower bound of the multiplicity interval.
not overriding function Get_Upper
(Self : not null access constant CMOF_Multiplicity_Element)
return AMF.Optional_Unlimited_Natural is abstract;
-- Getter of MultiplicityElement::upper.
--
-- Specifies the upper bound of the multiplicity interval.
not overriding procedure Set_Upper
(Self : not null access CMOF_Multiplicity_Element;
To : AMF.Optional_Unlimited_Natural) is abstract;
-- Setter of MultiplicityElement::upper.
--
-- Specifies the upper bound of the multiplicity interval.
not overriding function Is_Multivalued
(Self : not null access constant CMOF_Multiplicity_Element)
return Boolean is abstract;
-- Operation MultiplicityElement::isMultivalued.
--
-- The query isMultivalued() checks whether this multiplicity has an upper
-- bound greater than one.
not overriding function Includes_Multiplicity
(Self : not null access constant CMOF_Multiplicity_Element;
M : AMF.CMOF.Multiplicity_Elements.CMOF_Multiplicity_Element_Access)
return Boolean is abstract;
-- Operation MultiplicityElement::includesMultiplicity.
--
-- The query includesMultiplicity() checks whether this multiplicity
-- includes all the cardinalities allowed by the specified multiplicity.
not overriding function Includes_Cardinality
(Self : not null access constant CMOF_Multiplicity_Element;
C : Integer)
return Boolean is abstract;
-- Operation MultiplicityElement::includesCardinality.
--
-- The query includesCardinality() checks whether the specified
-- cardinality is valid for this multiplicity.
not overriding function Lower_Bound
(Self : not null access constant CMOF_Multiplicity_Element)
return Integer is abstract;
-- Operation MultiplicityElement::lowerBound.
--
-- The query lowerBound() returns the lower bound of the multiplicity as
-- an integer.
not overriding function Upper_Bound
(Self : not null access constant CMOF_Multiplicity_Element)
return AMF.Unlimited_Natural is abstract;
-- Operation MultiplicityElement::upperBound.
--
-- The query upperBound() returns the upper bound of the multiplicity for
-- a bounded multiplicity as an unlimited natural.
end AMF.CMOF.Multiplicity_Elements;
| 50.137725 | 79 | 0.588797 |
cbb15d3ac1d2a2914d99db48c1a4a107a6ec8327 | 12,236 | ads | Ada | src/gnat/mlib-tgt.ads | Letractively/ada-gen | d06d03821057f9177f2350e32dd09e467df08612 | [
"Apache-2.0"
] | null | null | null | src/gnat/mlib-tgt.ads | Letractively/ada-gen | d06d03821057f9177f2350e32dd09e467df08612 | [
"Apache-2.0"
] | null | null | null | src/gnat/mlib-tgt.ads | Letractively/ada-gen | d06d03821057f9177f2350e32dd09e467df08612 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- M L I B . T G T --
-- --
-- S p e c --
-- --
-- Copyright (C) 2001-2009, 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. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package provides a set of target dependent routines to build static,
-- dynamic and shared libraries. There are several packages providing
-- the actual routines. This package calls them indirectly by means of
-- access-to-subprogram values. Each target-dependent package initializes
-- these values in its elaboration block.
with Prj; use Prj;
package MLib.Tgt is
function Support_For_Libraries return Library_Support;
-- Indicates how building libraries by gnatmake is supported by the GNAT
-- implementation for the platform.
function Standalone_Library_Auto_Init_Is_Supported return Boolean;
-- Indicates if when building a dynamic Standalone Library,
-- automatic initialization is supported. If it is, then it is the default,
-- unless attribute Library_Auto_Init has the value "false".
function Archive_Builder return String;
-- Returns the name of the archive builder program, usually "ar"
function Archive_Builder_Options return String_List_Access;
-- A list of options to invoke the Archive_Builder, usually "cr" for "ar"
function Archive_Builder_Append_Options return String_List_Access;
-- A list of options to use with the archive builder to append object
-- files ("q", for example).
function Archive_Indexer return String;
-- Returns the name of the program, if any, that generates an index to the
-- contents of an archive, usually "ranlib". If there is no archive indexer
-- to be used, returns an empty string.
function Archive_Indexer_Options return String_List_Access;
-- A list of options to invoke the Archive_Indexer, usually empty
function Dynamic_Option return String;
-- gcc option to create a dynamic library.
-- For Unix, returns "-shared", for Windows returns "-mdll".
function Libgnat return String;
-- System dependent static GNAT library
function Archive_Ext return String;
-- System dependent static library extension, without leading dot.
-- For Unix and Windows, return "a".
function Object_Ext return String;
-- System dependent object extension, without leading dot.
-- On Unix, returns "o".
function DLL_Prefix return String;
-- System dependent dynamic library prefix.
-- On Windows, returns "". On other platforms, returns "lib".
function DLL_Ext return String;
-- System dependent dynamic library extension, without leading dot.
-- On Windows, returns "dll". On Unix, usually returns "so", but not
-- always, e.g. on HP-UX the extension for shared libraries is "sl".
function PIC_Option return String;
-- Position independent code option
function Is_Object_Ext (Ext : String) return Boolean;
-- Returns True iff Ext is an object file extension
function Is_C_Ext (Ext : String) return Boolean;
-- Returns True iff Ext is a C file extension
function Is_Archive_Ext (Ext : String) return Boolean;
-- Returns True iff Ext is an extension for a library
function Default_Symbol_File_Name return String;
-- Returns the name of the symbol file when Library_Symbol_File is not
-- specified. Return the empty string when symbol files are not supported.
procedure Build_Dynamic_Library
(Ofiles : Argument_List;
Options : Argument_List;
Interfaces : Argument_List;
Lib_Filename : String;
Lib_Dir : String;
Symbol_Data : Symbol_Record;
Driver_Name : Name_Id := No_Name;
Lib_Version : String := "";
Auto_Init : Boolean := False);
-- Build a dynamic/relocatable library
--
-- Ofiles is the list of all object files in the library
--
-- Options is a list of options to be passed to the tool
-- (gcc or other) that effectively builds the dynamic library.
--
-- Interfaces is the list of ALI files for the interfaces of a SAL.
-- It is empty if the library is not a SAL.
--
-- Lib_Filename is the name of the library, without any prefix or
-- extension. For example, on Unix, if Lib_Filename is "toto", the
-- name of the library file will be "libtoto.so".
--
-- Lib_Dir is the directory path where the library will be located
--
-- For OSes that support symbolic links, Lib_Version, if non null,
-- is the actual file name of the library. For example on Unix, if
-- Lib_Filename is "toto" and Lib_Version is "libtoto.so.2.1",
-- "libtoto.so" will be a symbolic link to "libtoto.so.2.1" which
-- will be the actual library file.
--
-- Symbol_Data is used for some platforms, including VMS, to generate
-- the symbols to be exported by the library.
--
-- Note: Depending on the OS, some of the parameters may not be taken into
-- account. For example, on Linux, Interfaces, Symbol_Data and Auto_Init
-- are ignored.
function Library_Exists_For
(Project : Project_Id;
In_Tree : Project_Tree_Ref) return Boolean;
-- Return True if the library file for a library project already exists.
-- This function can only be called for library projects.
function Library_File_Name_For
(Project : Project_Id;
In_Tree : Project_Tree_Ref) return File_Name_Type;
-- Returns the file name of the library file of a library project.
-- This function can only be called for library projects.
function Library_Major_Minor_Id_Supported return Boolean;
-- Indicates if major and minor ids are supported for libraries.
-- If they are supported, then a Library_Version such as libtoto.so.1.2
-- will have a major id of 1 and a minor id of 2. Then libtoto.so,
-- libtoto.so.1 and libtoto.so.1.2 will be created, all three designating
-- the same file.
private
No_Argument_List : constant Argument_List := (1 .. 0 => null);
-- Access to subprogram types for indirection
type String_Function is access function return String;
type Is_Ext_Function is access function (Ext : String) return Boolean;
type String_List_Access_Function is access function
return String_List_Access;
type Build_Dynamic_Library_Function is access procedure
(Ofiles : Argument_List;
Options : Argument_List;
Interfaces : Argument_List;
Lib_Filename : String;
Lib_Dir : String;
Symbol_Data : Symbol_Record;
Driver_Name : Name_Id := No_Name;
Lib_Version : String := "";
Auto_Init : Boolean := False);
type Library_Exists_For_Function is access function
(Project : Project_Id;
In_Tree : Project_Tree_Ref) return Boolean;
type Library_File_Name_For_Function is access function
(Project : Project_Id;
In_Tree : Project_Tree_Ref) return File_Name_Type;
type Boolean_Function is access function return Boolean;
type Library_Support_Function is access function return Library_Support;
function Archive_Builder_Default return String;
Archive_Builder_Ptr : String_Function := Archive_Builder_Default'Access;
function Archive_Builder_Options_Default return String_List_Access;
Archive_Builder_Options_Ptr : String_List_Access_Function :=
Archive_Builder_Options_Default'Access;
function Archive_Builder_Append_Options_Default return String_List_Access;
Archive_Builder_Append_Options_Ptr : String_List_Access_Function :=
Archive_Builder_Append_Options_Default'Access;
function Archive_Ext_Default return String;
Archive_Ext_Ptr : String_Function := Archive_Ext_Default'Access;
function Archive_Indexer_Default return String;
Archive_Indexer_Ptr : String_Function := Archive_Indexer_Default'Access;
function Archive_Indexer_Options_Default return String_List_Access;
Archive_Indexer_Options_Ptr : String_List_Access_Function :=
Archive_Indexer_Options_Default'Access;
function Default_Symbol_File_Name_Default return String;
Default_Symbol_File_Name_Ptr : String_Function :=
Default_Symbol_File_Name_Default'Access;
Build_Dynamic_Library_Ptr : Build_Dynamic_Library_Function;
function DLL_Ext_Default return String;
DLL_Ext_Ptr : String_Function := DLL_Ext_Default'Access;
function DLL_Prefix_Default return String;
DLL_Prefix_Ptr : String_Function := DLL_Prefix_Default'Access;
function Dynamic_Option_Default return String;
Dynamic_Option_Ptr : String_Function := Dynamic_Option_Default'Access;
function Is_Object_Ext_Default (Ext : String) return Boolean;
Is_Object_Ext_Ptr : Is_Ext_Function := Is_Object_Ext_Default'Access;
function Is_C_Ext_Default (Ext : String) return Boolean;
Is_C_Ext_Ptr : Is_Ext_Function := Is_C_Ext_Default'Access;
function Is_Archive_Ext_Default (Ext : String) return Boolean;
Is_Archive_Ext_Ptr : Is_Ext_Function := Is_Archive_Ext_Default'Access;
function Libgnat_Default return String;
Libgnat_Ptr : String_Function := Libgnat_Default'Access;
function Library_Exists_For_Default
(Project : Project_Id;
In_Tree : Project_Tree_Ref) return Boolean;
Library_Exists_For_Ptr : Library_Exists_For_Function :=
Library_Exists_For_Default'Access;
function Library_File_Name_For_Default
(Project : Project_Id;
In_Tree : Project_Tree_Ref) return File_Name_Type;
Library_File_Name_For_Ptr : Library_File_Name_For_Function :=
Library_File_Name_For_Default'Access;
function Object_Ext_Default return String;
Object_Ext_Ptr : String_Function := Object_Ext_Default'Access;
function PIC_Option_Default return String;
PIC_Option_Ptr : String_Function := PIC_Option_Default'Access;
function Standalone_Library_Auto_Init_Is_Supported_Default return Boolean;
Standalone_Library_Auto_Init_Is_Supported_Ptr : Boolean_Function :=
Standalone_Library_Auto_Init_Is_Supported_Default'Access;
function Support_For_Libraries_Default return Library_Support;
Support_For_Libraries_Ptr : Library_Support_Function :=
Support_For_Libraries_Default'Access;
function Library_Major_Minor_Id_Supported_Default return Boolean;
Library_Major_Minor_Id_Supported_Ptr : Boolean_Function :=
Library_Major_Minor_Id_Supported_Default'Access;
end MLib.Tgt;
| 45.151292 | 79 | 0.674485 |
c5dea39da60b275bd1f94ba21327e257093cdf53 | 4,035 | adb | Ada | gcc-gcc-7_3_0-release/gcc/ada/a-wtenio.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-wtenio.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/ada/a-wtenio.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . W I D E _ T E X T _ I O . E N U M E R A T I O N _ I O --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-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 Ada.Wide_Text_IO.Enumeration_Aux;
package body Ada.Wide_Text_IO.Enumeration_IO is
package Aux renames Ada.Wide_Text_IO.Enumeration_Aux;
---------
-- Get --
---------
procedure Get (File : File_Type; Item : out Enum) is
Buf : Wide_String (1 .. Enum'Width);
Buflen : Natural;
begin
Aux.Get_Enum_Lit (File, Buf, Buflen);
Item := Enum'Wide_Value (Buf (1 .. Buflen));
exception
when Constraint_Error => raise Data_Error;
end Get;
procedure Get (Item : out Enum) is
begin
Get (Current_Input, Item);
end Get;
procedure Get
(From : Wide_String;
Item : out Enum;
Last : out Positive)
is
Start : Natural;
begin
Aux.Scan_Enum_Lit (From, Start, Last);
Item := Enum'Wide_Value (From (Start .. Last));
exception
when Constraint_Error => raise Data_Error;
end Get;
---------
-- Put --
---------
procedure Put
(File : File_Type;
Item : Enum;
Width : Field := Default_Width;
Set : Type_Set := Default_Setting)
is
Image : constant Wide_String := Enum'Wide_Image (Item);
begin
Aux.Put (File, Image, Width, Set);
end Put;
procedure Put
(Item : Enum;
Width : Field := Default_Width;
Set : Type_Set := Default_Setting)
is
begin
Put (Current_Output, Item, Width, Set);
end Put;
procedure Put
(To : out Wide_String;
Item : Enum;
Set : Type_Set := Default_Setting)
is
Image : constant Wide_String := Enum'Wide_Image (Item);
begin
Aux.Puts (To, Image, Set);
end Put;
end Ada.Wide_Text_IO.Enumeration_IO;
| 38.428571 | 78 | 0.463445 |
c5edc86f091ac924ac801606c8ab955eae742920 | 3,632 | ads | Ada | source/amf/uml/amf-uml-protocol_transitions-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-protocol_transitions-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-protocol_transitions-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 <vgodunko@gmail.com> --
-- 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.Protocol_Transitions.Hash is
new AMF.Elements.Generic_Hash (UML_Protocol_Transition, UML_Protocol_Transition_Access);
| 72.64 | 90 | 0.405837 |
4a81b9d2726cfe2325e93ee4f6be0b8f573375cf | 47,922 | adb | Ada | src/portscan-buildcycle.adb | jfouquart/synth | cf9f4e394723266805799807ca9dd422e333cb2e | [
"0BSD"
] | null | null | null | src/portscan-buildcycle.adb | jfouquart/synth | cf9f4e394723266805799807ca9dd422e333cb2e | [
"0BSD"
] | null | null | null | src/portscan-buildcycle.adb | jfouquart/synth | cf9f4e394723266805799807ca9dd422e333cb2e | [
"0BSD"
] | null | null | null | -- This file is covered by the Internet Software Consortium (ISC) License
-- Reference: ../License.txt
with Ada.Calendar.Arithmetic;
with Ada.Calendar.Formatting;
with Ada.Direct_IO;
with Replicant.Platform;
package body PortScan.Buildcycle is
package ACA renames Ada.Calendar.Arithmetic;
package ACF renames Ada.Calendar.Formatting;
package REP renames Replicant;
----------------------
-- initialize_log --
----------------------
function initialize_log (id : builders) return Boolean
is
FA : access TIO.File_Type;
H_ENV : constant String := "Environment";
H_OPT : constant String := "Options";
CFG1 : constant String := "/etc/make.conf";
CFG2 : constant String := "/etc/mk.conf";
UNAME : constant String := JT.USS (uname_mrv);
BENV : constant String := get_environment (id);
COPTS : constant String := get_options_configuration (id);
PTVAR : JT.Text := get_port_variables (id);
begin
trackers (id).dynlink.Clear;
trackers (id).head_time := CAL.Clock;
declare
log_path : constant String := log_name (trackers (id).seq_id);
begin
-- Try to defend malicious symlink: https://en.wikipedia.org/wiki/Symlink_race
if AD.Exists (log_path) then
AD.Delete_File (log_path);
end if;
TIO.Create (File => trackers (id).log_handle,
Mode => TIO.Out_File,
Name => log_path);
FA := trackers (id).log_handle'Access;
exception
when error : others =>
raise cycle_log_error
with "failed to create log " & log_path;
end;
TIO.Put_Line (FA.all, "=> Building " &
get_catport (all_ports (trackers (id).seq_id)));
TIO.Put_Line (FA.all, "Started : " & timestamp (trackers (id).head_time));
TIO.Put (FA.all, "Platform: " & UNAME);
if BENV = discerr then
TIO.Put_Line (FA.all, LAT.LF & "Environment definition failed, " &
"aborting entire build");
return False;
end if;
TIO.Put_Line (FA.all, LAT.LF & log_section (H_ENV, True));
TIO.Put (FA.all, BENV);
TIO.Put_Line (FA.all, log_section (H_ENV, False) & LAT.LF);
TIO.Put_Line (FA.all, log_section (H_OPT, True));
TIO.Put (FA.all, COPTS);
TIO.Put_Line (FA.all, log_section (H_OPT, False) & LAT.LF);
dump_port_variables (id => id, content => PTVAR);
case software_framework is
when ports_collection =>
TIO.Put_Line (FA.all, log_section (CFG1, True));
TIO.Put (FA.all, dump_make_conf (id, CFG1));
TIO.Put_Line (FA.all, log_section (CFG1, False) & LAT.LF);
when pkgsrc =>
TIO.Put_Line (FA.all, log_section (CFG2, True));
TIO.Put (FA.all, dump_make_conf (id, CFG2));
TIO.Put_Line (FA.all, log_section (CFG2, False) & LAT.LF);
end case;
return True;
end initialize_log;
--------------------
-- finalize_log --
--------------------
procedure finalize_log (id : builders) is
begin
TIO.Put_Line (trackers (id).log_handle, log_section ("Termination", True));
trackers (id).tail_time := CAL.Clock;
TIO.Put_Line (trackers (id).log_handle,
"Finished: " & timestamp (trackers (id).tail_time));
TIO.Put_Line (trackers (id).log_handle,
log_duration (start => trackers (id).head_time,
stop => trackers (id).tail_time));
TIO.Close (trackers (id).log_handle);
end finalize_log;
--------------------
-- log_duration --
--------------------
function log_duration (start, stop : CAL.Time) return String
is
raw : JT.Text := JT.SUS ("Duration:");
diff_days : ACA.Day_Count;
diff_secs : Duration;
leap_secs : ACA.Leap_Seconds_Count;
use type ACA.Day_Count;
begin
ACA.Difference (Left => stop,
Right => start,
Days => diff_days,
Seconds => diff_secs,
Leap_Seconds => leap_secs);
if diff_days > 0 then
if diff_days = 1 then
JT.SU.Append (raw, " 1 day and " &
ACF.Image (Elapsed_Time => diff_secs));
else
JT.SU.Append (raw, diff_days'Img & " days and " &
ACF.Image (Elapsed_Time => diff_secs));
end if;
else
JT.SU.Append (raw, " " & ACF.Image (Elapsed_Time => diff_secs));
end if;
return JT.USS (raw);
end log_duration;
------------------------
-- elapsed_HH_MM_SS --
------------------------
function elapsed_HH_MM_SS (start, stop : CAL.Time) return String
is
diff_days : ACA.Day_Count;
diff_secs : Duration;
leap_secs : ACA.Leap_Seconds_Count;
secs_per_hour : constant Integer := 3600;
total_hours : Integer;
total_minutes : Integer;
work_hours : Integer;
work_seconds : Integer;
use type ACA.Day_Count;
begin
ACA.Difference (Left => stop,
Right => start,
Days => diff_days,
Seconds => diff_secs,
Leap_Seconds => leap_secs);
-- Seems the ACF image is shit, so let's roll our own. If more than
-- 100 hours, change format to "HHH:MM.M"
work_seconds := Integer (diff_secs);
total_hours := work_seconds / secs_per_hour;
total_hours := total_hours + Integer (diff_days) * 24;
if total_hours < 24 then
if work_seconds < 0 then
return "--:--:--";
else
work_seconds := work_seconds - (total_hours * secs_per_hour);
total_minutes := work_seconds / 60;
work_seconds := work_seconds - (total_minutes * 60);
return
JT.zeropad (total_hours, 2) & LAT.Colon &
JT.zeropad (total_minutes, 2) & LAT.Colon &
JT.zeropad (work_seconds, 2);
end if;
elsif total_hours < 100 then
if work_seconds < 0 then
return JT.zeropad (total_hours, 2) & ":00:00";
else
work_hours := work_seconds / secs_per_hour;
work_seconds := work_seconds - (work_hours * secs_per_hour);
total_minutes := work_seconds / 60;
work_seconds := work_seconds - (total_minutes * 60);
return
JT.zeropad (total_hours, 2) & LAT.Colon &
JT.zeropad (total_minutes, 2) & LAT.Colon &
JT.zeropad (work_seconds, 2);
end if;
else
if work_seconds < 0 then
return JT.zeropad (total_hours, 3) & ":00.0";
else
work_hours := work_seconds / secs_per_hour;
work_seconds := work_seconds - (work_hours * secs_per_hour);
total_minutes := work_seconds / 60;
work_seconds := (work_seconds - (total_minutes * 60)) * 10 / 60;
return
JT.zeropad (total_hours, 3) & LAT.Colon &
JT.zeropad (total_minutes, 2) & '.' &
JT.int2str (work_seconds);
end if;
end if;
end elapsed_HH_MM_SS;
-------------------
-- elapsed_now --
-------------------
function elapsed_now return String is
begin
return elapsed_HH_MM_SS (start => start_time, stop => CAL.Clock);
end elapsed_now;
-----------------------------
-- generic_system_command --
-----------------------------
function generic_system_command (command : String) return JT.Text
is
content : JT.Text;
status : Integer;
begin
content := Unix.piped_command (command, status);
if status /= 0 then
raise cycle_cmd_error with "cmd: " & command &
" (return code =" & status'Img & ")";
end if;
return content;
end generic_system_command;
---------------------
-- set_uname_mrv --
---------------------
procedure set_uname_mrv
is
-- valid for all platforms
command : constant String := "/usr/bin/uname -mrv";
begin
uname_mrv := generic_system_command (command);
exception
when others =>
uname_mrv := JT.SUS (discerr);
end set_uname_mrv;
----------------
-- get_root --
----------------
function get_root (id : builders) return String
is
id_image : constant String := Integer (id)'Img;
suffix : String := "/SL00";
begin
if id < 10 then
suffix (5) := id_image (2);
else
suffix (4 .. 5) := id_image (2 .. 3);
end if;
return JT.USS (PM.configuration.dir_buildbase) & suffix;
end get_root;
-----------------------
-- get_environment --
-----------------------
function get_environment (id : builders) return String
is
root : constant String := get_root (id);
command : constant String := chroot & root & environment_override;
begin
return JT.USS (generic_system_command (command));
exception
when others =>
return discerr;
end get_environment;
---------------------------------
-- get_options_configuration --
---------------------------------
function get_options_configuration (id : builders) return String
is
root : constant String := get_root (id);
catport : constant String := get_catport (all_ports (trackers (id).seq_id));
command : constant String := chroot & root & environment_override &
chroot_make_program & " -C " & port_specification (catport);
begin
case software_framework is
when ports_collection =>
return JT.USS (generic_system_command (command & " showconfig"));
when pkgsrc =>
return JT.USS (generic_system_command (command & " show-options"));
end case;
exception
when others =>
return discerr;
end get_options_configuration;
------------------------
-- split_collection --
------------------------
function split_collection (line : JT.Text; title : String) return String
is
-- Support spaces in two ways
-- 1) quoted, e.g. TYPING="The Quick Brown Fox"
-- 2) Escaped, e.g. TYPING=The\ Quick\ Brown\ Fox
meat : JT.Text;
waiting : Boolean := True;
escaped : Boolean := False;
quoted : Boolean := False;
keepit : Boolean;
counter : Natural := 0;
meatlen : Natural := 0;
linelen : Natural := JT.SU.Length (line);
onechar : String (1 .. 1);
meatstr : String (1 .. linelen);
begin
loop
counter := counter + 1;
exit when counter > linelen;
keepit := True;
onechar := JT.SU.Slice (Source => line,
Low => counter,
High => counter);
if onechar (1) = LAT.Reverse_Solidus then
-- A) if inside quotes, it's literal
-- B) if it's first RS, don't keep but mark escaped
-- C) If it's second RS, it's literal, remove escaped
-- D) RS can never start a new NV pair
if not quoted then
if not escaped then
keepit := False;
end if;
escaped := not escaped;
end if;
elsif escaped then
-- E) by definition, next character after an escape is literal
-- We know it's not inside quotes. Keep this (could be a space)
waiting := False;
escaped := not escaped;
elsif onechar (1) = LAT.Space then
if waiting then
keepit := False;
else
if not quoted then
-- name-pair ended, reset
waiting := True;
quoted := False;
onechar (1) := LAT.LF;
end if;
end if;
else
waiting := False;
if onechar (1) = LAT.Quotation then
quoted := not quoted;
end if;
end if;
if keepit then
meatlen := meatlen + 1;
meatstr (meatlen) := onechar (1);
end if;
end loop;
return log_section (title, True) & LAT.LF &
meatstr (1 .. meatlen) & LAT.LF &
log_section (title, False) & LAT.LF;
end split_collection;
--------------------------
-- get_port_variables --
--------------------------
function get_port_variables (id : builders) return JT.Text
is
root : constant String := get_root (id);
catport : constant String := get_catport (all_ports (trackers (id).seq_id));
command : constant String := chroot & root & environment_override &
chroot_make_program & " -C " & port_specification (catport);
cmd_fpc : constant String := command &
" -VCONFIGURE_ENV -VCONFIGURE_ARGS -VMAKE_ENV -VMAKE_ARGS" &
" -VPLIST_SUB -VSUB_LIST";
cmd_nps : constant String := command &
" .MAKE.EXPAND_VARIABLES=yes -VCONFIGURE_ENV -VCONFIGURE_ARGS" &
" -VMAKE_ENV -VMAKE_FLAGS -VBUILD_MAKE_FLAGS -VPLIST_SUBST" &
" -VFILES_SUBST";
begin
case software_framework is
when ports_collection =>
return generic_system_command (cmd_fpc);
when pkgsrc =>
return generic_system_command (cmd_nps);
end case;
exception
when others =>
return JT.SUS (discerr);
end get_port_variables;
---------------------------
-- dump_port_variables --
---------------------------
procedure dump_port_variables (id : builders; content : JT.Text)
is
LA : access TIO.File_Type := trackers (id).log_handle'Access;
topline : JT.Text;
concopy : JT.Text := content;
type result_range_fpc is range 1 .. 6;
type result_range_nps is range 1 .. 7;
begin
case software_framework is
when ports_collection =>
for k in result_range_fpc loop
JT.nextline (lineblock => concopy, firstline => topline);
case k is
when 1 => TIO.Put_Line
(LA.all, split_collection (topline, "CONFIGURE_ENV"));
when 2 => TIO.Put_Line
(LA.all, split_collection (topline, "CONFIGURE_ARGS"));
when 3 => TIO.Put_Line
(LA.all, split_collection (topline, "MAKE_ENV"));
when 4 => TIO.Put_Line
(LA.all, split_collection (topline, "MAKE_ARGS"));
when 5 => TIO.Put_Line
(LA.all, split_collection (topline, "PLIST_SUB"));
when 6 => TIO.Put_Line
(LA.all, split_collection (topline, "SUB_LIST"));
end case;
end loop;
when pkgsrc =>
for k in result_range_nps loop
JT.nextline (lineblock => concopy, firstline => topline);
case k is
when 1 => TIO.Put_Line
(LA.all, split_collection (topline, "CONFIGURE_ENV"));
when 2 => TIO.Put_Line
(LA.all, split_collection (topline, "CONFIGURE_ARGS"));
when 3 => TIO.Put_Line
(LA.all, split_collection (topline, "MAKE_ENV"));
when 4 => TIO.Put_Line
(LA.all, split_collection (topline, "MAKE_FLAGS"));
when 5 => TIO.Put_Line
(LA.all, split_collection (topline, "BUILD_MAKE_FLAGS"));
when 6 => TIO.Put_Line
(LA.all, split_collection (topline, "PLIST_SUBST"));
when 7 => TIO.Put_Line
(LA.all, split_collection (topline, "FILES_SUBST"));
end case;
end loop;
end case;
end dump_port_variables;
----------------
-- log_name --
----------------
function log_name (sid : port_id) return String
is
catport : constant String := get_catport (all_ports (sid));
begin
return JT.USS (PM.configuration.dir_logs) & "/" &
JT.part_1 (catport) & "___" & JT.part_2 (catport) & ".log";
end log_name;
-----------------
-- dump_file --
-----------------
function dump_file (filename : String) return String
is
File_Size : Natural := Natural (AD.Size (filename));
subtype File_String is String (1 .. File_Size);
package File_String_IO is new Ada.Direct_IO (File_String);
File : File_String_IO.File_Type;
Contents : File_String;
begin
File_String_IO.Open (File, Mode => File_String_IO.In_File,
Name => filename);
File_String_IO.Read (File, Item => Contents);
File_String_IO.Close (File);
return String (Contents);
end dump_file;
----------------------
-- dump_make_conf --
----------------------
function dump_make_conf (id : builders; conf_file : String) return String
is
root : constant String := get_root (id);
filename : constant String := root & conf_file;
begin
return dump_file (filename);
end dump_make_conf;
------------------
-- initialize --
------------------
procedure initialize (test_mode : Boolean; jail_env : JT.Text) is
begin
set_uname_mrv;
testing := test_mode;
lock_localbase := testing and then Unix.env_variable_defined ("LOCK");
slave_env := jail_env;
declare
logdir : constant String := JT.USS (PM.configuration.dir_logs);
begin
if not AD.Exists (logdir) then
AD.Create_Path (New_Directory => logdir);
end if;
exception
when error : others =>
raise cycle_log_error
with "failed to create " & logdir;
end;
obtain_custom_environment;
end initialize;
-------------------
-- log_section --
-------------------
function log_section (title : String; header : Boolean) return String
is
hyphens : constant String := (1 .. 50 => '-');
begin
if header then
return LAT.LF & hyphens & LAT.LF & "-- " & title & LAT.LF & hyphens;
else
return "";
end if;
end log_section;
---------------------
-- log_phase_end --
---------------------
procedure log_phase_end (id : builders)
is
begin
TIO.Put_Line (trackers (id).log_handle, "" & LAT.LF);
end log_phase_end;
-----------------------
-- log_phase_begin --
-----------------------
procedure log_phase_begin (phase : String; id : builders)
is
hyphens : constant String := (1 .. 80 => '-');
middle : constant String := "-- Phase: " & phase;
begin
TIO.Put_Line (trackers (id).log_handle,
LAT.LF & hyphens & LAT.LF & middle & LAT.LF & hyphens);
end log_phase_begin;
-----------------------
-- generic_execute --
-----------------------
function generic_execute (id : builders; command : String;
dogbite : out Boolean;
time_limit : execution_limit) return Boolean
is
subtype time_cycle is execution_limit range 1 .. time_limit;
subtype one_minute is Positive range 1 .. 230; -- lose 10 in rounding
type dim_watchdog is array (time_cycle) of Natural;
use type Unix.process_exit;
watchdog : dim_watchdog;
squirrel : time_cycle := time_cycle'First;
cycle_done : Boolean := False;
pid : Unix.pid_t;
status : Unix.process_exit;
lock_lines : Natural;
quartersec : one_minute := one_minute'First;
hangmonitor : constant Boolean := True;
synthexec : constant String := host_localbase & "/libexec/synthexec";
truecommand : constant String := synthexec & " " &
log_name (trackers (id).seq_id) & " " & command;
begin
dogbite := False;
watchdog (squirrel) := trackers (id).loglines;
pid := Unix.launch_process (truecommand);
if Unix.fork_failed (pid) then
return False;
end if;
loop
delay 0.25;
if quartersec = one_minute'Last then
quartersec := one_minute'First;
-- increment squirrel
if squirrel = time_cycle'Last then
squirrel := time_cycle'First;
cycle_done := True;
else
squirrel := squirrel + 1;
end if;
if hangmonitor then
lock_lines := trackers (id).loglines;
if cycle_done then
if watchdog (squirrel) = lock_lines then
-- Log hasn't advanced in a full cycle so bail out
dogbite := True;
Unix.kill_process_tree (process_group => pid);
delay 5.0; -- Give some time for error to write to log
return False;
end if;
end if;
watchdog (squirrel) := lock_lines;
end if;
else
quartersec := quartersec + 1;
end if;
status := Unix.process_status (pid);
if status = Unix.exited_normally then
return True;
end if;
if status = Unix.exited_with_error then
return False;
end if;
end loop;
end generic_execute;
------------------------------
-- stack_linked_libraries --
------------------------------
procedure stack_linked_libraries (id : builders; base, filename : String)
is
command : String := chroot & base & " /usr/bin/objdump -p " & filename;
comres : JT.Text;
topline : JT.Text;
crlen1 : Natural;
crlen2 : Natural;
begin
comres := generic_system_command (command);
crlen1 := JT.SU.Length (comres);
loop
JT.nextline (lineblock => comres, firstline => topline);
crlen2 := JT.SU.Length (comres);
exit when crlen1 = crlen2;
crlen1 := crlen2;
if not JT.IsBlank (topline) then
if JT.contains (topline, "NEEDED") then
if not trackers (id).dynlink.Contains (topline) then
trackers (id).dynlink.Append (topline);
end if;
end if;
end if;
end loop;
exception
-- the command result was not zero, so it was an expected format
-- or static file. Just skip it. (Should never happen)
when bad_result : others => null;
end stack_linked_libraries;
----------------------------
-- log_linked_libraries --
----------------------------
procedure log_linked_libraries (id : builders)
is
procedure log_dump (cursor : string_crate.Cursor);
comres : JT.Text;
topline : JT.Text;
crlen1 : Natural;
crlen2 : Natural;
pkgfile : constant String := JT.USS
(all_ports (trackers (id).seq_id).package_name);
pkgname : constant String := pkgfile (1 .. pkgfile'Last - 4);
root : constant String := get_root (id);
command : constant String := chroot & root & environment_override &
REP.root_localbase & "/sbin/pkg-static query %Fp " & pkgname;
procedure log_dump (cursor : string_crate.Cursor) is
begin
TIO.Put_Line (trackers (id).log_handle,
JT.USS (string_crate.Element (Position => cursor)));
end log_dump;
begin
TIO.Put_Line (trackers (id).log_handle,
"=> Checking shared library dependencies");
comres := generic_system_command (command);
crlen1 := JT.SU.Length (comres);
loop
JT.nextline (lineblock => comres, firstline => topline);
crlen2 := JT.SU.Length (comres);
exit when crlen1 = crlen2;
crlen1 := crlen2;
if REP.Platform.dynamically_linked (root, JT.USS (topline)) then
stack_linked_libraries (id, root, JT.USS (topline));
end if;
end loop;
trackers (id).dynlink.Iterate (log_dump'Access);
exception
when others => null;
end log_linked_libraries;
----------------------------
-- environment_override --
----------------------------
function environment_override (enable_tty : Boolean := False) return String
is
function set_terminal (enable_tty : Boolean) return String;
function set_terminal (enable_tty : Boolean) return String is
begin
if enable_tty then
return "TERM=cons25 ";
end if;
return "TERM=dumb ";
end set_terminal;
PATH : constant String := "PATH=/sbin:/bin:/usr/sbin:/usr/bin:"
& REP.root_localbase & "/sbin:" & REP.root_localbase & "/bin ";
TERM : constant String := set_terminal (enable_tty);
USER : constant String := "USER=root ";
HOME : constant String := "HOME=/root ";
LANG : constant String := "LANG=C ";
FTP : constant String := "SSL_NO_VERIFY_PEER=1 ";
PKG8 : constant String := "PORTSDIR=" & dir_ports & " " &
"PKG_DBDIR=/var/db/pkg8 " &
"PKG_CACHEDIR=/var/cache/pkg8 ";
CENV : constant String := JT.USS (customenv);
JENV : constant String := JT.USS (slave_env);
begin
return " /usr/bin/env -i " &
USER & HOME & LANG & PKG8 & TERM & FTP & PATH & JENV & CENV;
end environment_override;
---------------------
-- set_log_lines --
---------------------
procedure set_log_lines (id : builders)
is
log_path : constant String := log_name (trackers (id).seq_id);
command : constant String := "/usr/bin/wc -l " & log_path;
comres : JT.Text;
begin
if not uselog then
trackers (id).loglines := 0;
return;
end if;
comres := JT.trim (generic_system_command (command));
declare
numtext : constant String :=
JT.part_1 (S => JT.USS (comres), separator => " ");
begin
trackers (id).loglines := Natural'Value (numtext);
end;
exception
when others => null; -- just skip this cycle
end set_log_lines;
-----------------------
-- format_loglines --
-----------------------
function format_loglines (numlines : Natural) return String
is
begin
if numlines < 10000000 then -- 10 million
return JT.int2str (numlines);
end if;
declare
kilo : constant Natural := numlines / 1000;
kilotxt : constant String := JT.int2str (kilo);
begin
if numlines < 100000000 then -- 100 million
return kilotxt (1 .. 2) & "." & kilotxt (3 .. 5) & 'M';
elsif numlines < 1000000000 then -- 1 billion
return kilotxt (1 .. 3) & "." & kilotxt (3 .. 4) & 'M';
else
return kilotxt (1 .. 4) & "." & kilotxt (3 .. 3) & 'M';
end if;
end;
end format_loglines;
---------------------
-- elapsed_build --
---------------------
function elapsed_build (id : builders) return String is
begin
return elapsed_HH_MM_SS (start => trackers (id).head_time,
stop => trackers (id).tail_time);
end elapsed_build;
-----------------------------
-- get_packages_per_hour --
-----------------------------
function get_packages_per_hour (packages_done : Natural;
from_when : CAL.Time)
return Natural
is
diff_days : ACA.Day_Count;
diff_secs : Duration;
leap_secs : ACA.Leap_Seconds_Count;
result : Natural;
rightnow : CAL.Time := CAL.Clock;
work_seconds : Integer;
work_days : Integer;
use type ACA.Day_Count;
begin
if packages_done = 0 then
return 0;
end if;
ACA.Difference (Left => rightnow,
Right => from_when,
Days => diff_days,
Seconds => diff_secs,
Leap_Seconds => leap_secs);
work_seconds := Integer (diff_secs);
work_days := Integer (diff_days);
work_seconds := work_seconds + (work_days * 3600 * 24);
if work_seconds < 0 then
-- should be impossible to get here.
return 0;
end if;
result := packages_done * 3600;
result := result / work_seconds;
return result;
exception
when others => return 0;
end get_packages_per_hour;
------------------------
-- mark_file_system --
------------------------
procedure mark_file_system (id : builders; action : String)
is
function attributes (action : String) return String;
function attributes (action : String) return String
is
core : constant String := "uid,gid,mode,md5digest";
begin
if action = "preconfig" then
return core & ",time";
else
return core;
end if;
end attributes;
path_mm : String := JT.USS (PM.configuration.dir_buildbase) & "/Base";
path_sm : String := JT.USS (PM.configuration.dir_buildbase) & "/SL" &
JT.zeropad (Natural (id), 2);
mtfile : constant String := path_mm & "/mtree." & action & ".exclude";
command : constant String := "/usr/sbin/mtree -X " & mtfile &
" -cn -k " & attributes (action) & " -p " & path_sm;
filename : constant String := path_sm & "/tmp/mtree." & action;
result : JT.Text;
resfile : TIO.File_Type;
begin
result := generic_system_command (command);
-- Try to defend malicious symlink: https://en.wikipedia.org/wiki/Symlink_race
if AD.Exists (filename) then
AD.Delete_File (filename);
end if;
TIO.Create (File => resfile, Mode => TIO.Out_File, Name => filename);
TIO.Put (resfile, JT.USS (result));
TIO.Close (resfile);
exception
when others =>
if TIO.Is_Open (resfile) then
TIO.Close (resfile);
end if;
end mark_file_system;
--------------------------------
-- detect_leftovers_and_MIA --
--------------------------------
function detect_leftovers_and_MIA (id : builders; action : String;
description : String) return Boolean
is
package crate is new AC.Vectors (Index_Type => Positive,
Element_Type => JT.Text,
"=" => JT.SU."=");
package sorter is new crate.Generic_Sorting ("<" => JT.SU."<");
function ignore_modifications return Boolean;
procedure print (cursor : crate.Cursor);
procedure close_active_modifications;
path_mm : String := JT.USS (PM.configuration.dir_buildbase) & "/Base";
path_sm : String := JT.USS (PM.configuration.dir_buildbase) & "/SL" &
JT.zeropad (Natural (id), 2);
mtfile : constant String := path_mm & "/mtree." & action & ".exclude";
filename : constant String := path_sm & "/tmp/mtree." & action;
command : constant String := "/usr/sbin/mtree -X " & mtfile & " -f " &
filename & " -p " & path_sm;
status : Integer;
comres : JT.Text;
topline : JT.Text;
crlen1 : Natural;
crlen2 : Natural;
toplen : Natural;
skiprest : Boolean;
passed : Boolean := True;
activemod : Boolean := False;
modport : JT.Text := JT.blank;
reasons : JT.Text := JT.blank;
leftover : crate.Vector;
missing : crate.Vector;
changed : crate.Vector;
function ignore_modifications return Boolean
is
-- Some modifications need to be ignored
-- A) */ls-R
-- #ls-R files from texmf are often regenerated
-- B) share/xml/catalog.ports
-- # xmlcatmgr is constantly updating catalog.ports, ignore
-- C) share/octave/octave_packages
-- # Octave packages database, blank lines can be inserted
-- # between pre-install and post-deinstall
-- D) info/dir | */info/dir
-- E) lib/gio/modules/giomodule.cache
-- # gio modules cache could be modified for any gio modules
-- F) etc/gconf/gconf.xml.defaults/%gconf-tree*.xml
-- # gconftool-2 --makefile-uninstall-rule is unpredictable
-- G) %%PEARDIR%%/.depdb | %%PEARDIR%%/.filemap
-- # The is pear database cache
-- H) "." with timestamp modification
-- # this happens when ./tmp or ./var is used, which is legal
filename : constant String := JT.USS (modport);
fnlen : constant Natural := filename'Length;
begin
if filename = "usr/local/share/xml/catalog.ports" or else
filename = "usr/local/share/octave/octave_packages" or else
filename = "usr/local/info/dir" or else
filename = "usr/local/lib/gio/modules/giomodule.cache" or else
filename = "usr/local/share/pear/.depdb" or else
filename = "usr/local/share/pear/.filemap"
then
return True;
end if;
if filename = "." and then JT.equivalent (reasons, "modification") then
return True;
end if;
if fnlen > 17 and then filename (1 .. 10) = "usr/local/"
then
if filename (fnlen - 4 .. fnlen) = "/ls-R" or else
filename (fnlen - 8 .. fnlen) = "/info/dir"
then
return True;
end if;
end if;
if fnlen > 56 and then filename (1 .. 39) =
"usr/local/etc/gconf/gconf.xml.defaults/" and then
filename (fnlen - 3 .. fnlen) = ".xml"
then
if JT.contains (filename, "/%gconf-tree") then
return True;
end if;
end if;
return False;
end ignore_modifications;
procedure close_active_modifications is
begin
if activemod and then not ignore_modifications then
JT.SU.Append (modport, " [ ");
JT.SU.Append (modport, reasons);
JT.SU.Append (modport, " ]");
if not changed.Contains (modport) then
changed.Append (modport);
end if;
end if;
activemod := False;
reasons := JT.blank;
modport := JT.blank;
end close_active_modifications;
procedure print (cursor : crate.Cursor)
is
dossier : constant String := JT.USS (crate.Element (cursor));
begin
TIO.Put_Line (trackers (id).log_handle, LAT.HT & dossier);
end print;
begin
-- we can't use generic_system_command because exit code /= 0 normally
comres := Unix.piped_command (command, status);
crlen1 := JT.SU.Length (comres);
loop
skiprest := False;
JT.nextline (lineblock => comres, firstline => topline);
crlen2 := JT.SU.Length (comres);
exit when crlen1 = crlen2;
crlen1 := crlen2;
toplen := JT.SU.Length (topline);
if not skiprest and then JT.SU.Length (topline) > 6 then
declare
sx : constant Natural := toplen - 5;
caboose : constant String := JT.SU.Slice (topline, sx, toplen);
filename : JT.Text := JT.SUS (JT.SU.Slice (topline, 1, sx - 1));
begin
if caboose = " extra" then
close_active_modifications;
if not leftover.Contains (filename) then
leftover.Append (filename);
end if;
skiprest := True;
end if;
end;
end if;
if not skiprest and then JT.SU.Length (topline) > 7 then
declare
canopy : constant String := JT.SU.Slice (topline, 1, 7);
filename : JT.Text := JT.SUS (JT.SU.Slice (topline, 8, toplen));
begin
if canopy = "extra: " then
close_active_modifications;
if not leftover.Contains (filename) then
leftover.Append (filename);
end if;
skiprest := True;
end if;
end;
end if;
if not skiprest and then JT.SU.Length (topline) > 10 then
declare
sx : constant Natural := toplen - 7;
caboose : constant String := JT.SU.Slice (topline, sx, toplen);
filename : JT.Text := JT.SUS (JT.SU.Slice (topline, 3, sx - 1));
begin
if caboose = " missing" then
close_active_modifications;
if not missing.Contains (filename) then
missing.Append (filename);
end if;
skiprest := True;
end if;
end;
end if;
if not skiprest then
declare
line : constant String := JT.USS (topline);
blank8 : constant String := " ";
sx : constant Natural := toplen - 7;
begin
if toplen > 5 and then line (1) = LAT.HT then
-- reason, but only valid if modification is active
if activemod then
if JT.IsBlank (reasons) then
reasons := JT.SUS (JT.part_1 (line (2 .. toplen), " "));
else
JT.SU.Append (reasons, " | ");
JT.SU.Append (reasons, JT.part_1
(line (2 .. toplen), " "));
end if;
end if;
skiprest := True;
end if;
if not skiprest and then line (toplen) = LAT.Colon then
close_active_modifications;
activemod := True;
modport := JT.SUS (line (1 .. toplen - 1));
skiprest := True;
end if;
if not skiprest and then
JT.SU.Slice (topline, sx, toplen) = " changed"
then
close_active_modifications;
activemod := True;
modport := JT.SUS (line (1 .. toplen - 8));
skiprest := True;
end if;
end;
end if;
end loop;
close_active_modifications;
sorter.Sort (Container => changed);
sorter.Sort (Container => missing);
sorter.Sort (Container => leftover);
TIO.Put_Line (trackers (id).log_handle, LAT.LF & "=> Checking for " &
"system changes " & description);
if not leftover.Is_Empty then
passed := False;
TIO.Put_Line (trackers (id).log_handle, LAT.LF &
" Left over files/directories:");
leftover.Iterate (Process => print'Access);
end if;
if not missing.Is_Empty then
passed := False;
TIO.Put_Line (trackers (id).log_handle, LAT.LF &
" Missing files/directories:");
missing.Iterate (Process => print'Access);
end if;
if not changed.Is_Empty then
passed := False;
TIO.Put_Line (trackers (id).log_handle, LAT.LF &
" Modified files/directories:");
changed.Iterate (Process => print'Access);
end if;
if passed then
TIO.Put_Line (trackers (id).log_handle, "Everything is fine.");
end if;
return passed;
end detect_leftovers_and_MIA;
-----------------------------
-- interact_with_builder --
-----------------------------
procedure interact_with_builder (id : builders)
is
root : constant String := get_root (id);
command : constant String := chroot & root &
environment_override (enable_tty => True) &
REP.Platform.interactive_shell;
result : Boolean;
begin
TIO.Put_Line ("Entering interactive test mode at the builder root " &
"directory.");
TIO.Put_Line ("Type 'exit' when done exploring.");
result := Unix.external_command (command);
end interact_with_builder;
---------------------------------
-- obtain_custom_environment --
---------------------------------
procedure obtain_custom_environment
is
target_name : constant String := PM.synth_confdir & "/" &
JT.USS (PM.configuration.profile) & "-environment";
fragment : TIO.File_Type;
begin
customenv := JT.blank;
if AD.Exists (target_name) then
TIO.Open (File => fragment, Mode => TIO.In_File, Name => target_name);
while not TIO.End_Of_File (fragment) loop
declare
Line : String := TIO.Get_Line (fragment);
begin
if JT.contains (Line, "=") then
JT.SU.Append (customenv, JT.trim (Line) & " ");
end if;
end;
end loop;
TIO.Close (fragment);
end if;
exception
when others =>
if TIO.Is_Open (fragment) then
TIO.Close (fragment);
end if;
end obtain_custom_environment;
--------------------------------
-- set_localbase_protection --
--------------------------------
procedure set_localbase_protection (id : builders; lock : Boolean)
is
procedure remount (readonly : Boolean);
procedure dismount;
smount : constant String := get_root (id);
slave_local : constant String := smount & "_localbase";
procedure remount (readonly : Boolean)
is
cmd_freebsd : String := "/sbin/mount_nullfs ";
cmd_dragonfly : String := "/sbin/mount_null ";
points : String := slave_local & " " & smount & REP.root_localbase;
options : String := "-o ro ";
cmd : JT.Text;
cmd_output : JT.Text;
begin
if JT.equivalent (PM.configuration.operating_sys, "FreeBSD") then
cmd := JT.SUS (cmd_freebsd);
else
cmd := JT.SUS (cmd_dragonfly);
end if;
if readonly then
JT.SU.Append (cmd, options);
end if;
JT.SU.Append (cmd, points);
if not Unix.piped_mute_command (JT.USS (cmd), cmd_output) then
if uselog then
TIO.Put_Line (trackers (id).log_handle,
"command failed: " & JT.USS (cmd));
if not JT.IsBlank (cmd_output) then
TIO.Put_Line (trackers (id).log_handle, JT.USS (cmd_output));
end if;
end if;
end if;
end remount;
procedure dismount
is
cmd_unmount : constant String := "/sbin/umount " & smount & REP.root_localbase;
cmd_output : JT.Text;
begin
if not Unix.piped_mute_command (cmd_unmount, cmd_output) then
if uselog then
TIO.Put_Line (trackers (id).log_handle,
"command failed: " & cmd_unmount);
if not JT.IsBlank (cmd_output) then
TIO.Put_Line (trackers (id).log_handle, JT.USS (cmd_output));
end if;
end if;
end if;
end dismount;
begin
if lock then
dismount;
remount (readonly => True);
else
dismount;
remount (readonly => False);
end if;
end set_localbase_protection;
------------------------------
-- timeout_multiplier_x10 --
------------------------------
function timeout_multiplier_x10 return Positive
is
average5 : constant Float := REP.Platform.get_5_minute_load;
avefloat : constant Float := average5 / Float (number_cores);
begin
if avefloat <= 1.0 then
return 10;
else
return Integer (avefloat * 10.0);
end if;
exception
when others => return 10;
end timeout_multiplier_x10;
---------------------------
-- valid_test_phase #2 --
---------------------------
function valid_test_phase (afterphase : String) return Boolean is
begin
if afterphase = "extract" or else
afterphase = "patch" or else
afterphase = "configure" or else
afterphase = "build" or else
afterphase = "stage" or else
afterphase = "install" or else
afterphase = "deinstall"
then
return True;
else
return False;
end if;
end valid_test_phase;
---------------------------
-- builder_status_core --
---------------------------
function builder_status_core (id : builders;
shutdown : Boolean := False;
idle : Boolean := False;
phasestr : String)
return Display.builder_rec
is
result : Display.builder_rec;
phaselen : constant Positive := phasestr'Length;
begin
-- 123456789 123456789 123456789 123456789 1234
-- SL elapsed phase lines origin
-- 01 00:00:00 extract-depends 9999999 www/joe
result.id := id;
result.slavid := JT.zeropad (Natural (id), 2);
result.LLines := (others => ' ');
result.phase := (others => ' ');
result.origin := (others => ' ');
result.shutdown := False;
result.idle := False;
if shutdown then
-- Overrides "idle" if both Shutdown and Idle are True
result.Elapsed := "Shutdown";
result.shutdown := True;
return result;
end if;
if idle then
result.Elapsed := "Idle ";
result.idle := True;
return result;
end if;
declare
catport : constant String :=
get_catport (all_ports (trackers (id).seq_id));
numlines : constant String := format_loglines (trackers (id).loglines);
linehead : constant Natural := 8 - numlines'Length;
begin
result.Elapsed := elapsed_HH_MM_SS (start => trackers (id).head_time,
stop => CAL.Clock);
result.LLines (linehead .. 7) := numlines;
if phaselen <= result.phase'Length then
result.phase (1 .. phasestr'Length) := phasestr;
else
-- special handling for long descriptions
if phasestr = "bootstrap-depends" then
result.phase (1 .. 14) := "bootstrap-deps";
else
result.phase := phasestr
(phasestr'First .. phasestr'First + result.phase'Length - 1);
end if;
end if;
if catport'Length > 37 then
result.origin (1 .. 36) := catport (1 .. 36);
result.origin (37) := LAT.Asterisk;
else
result.origin (1 .. catport'Length) := catport;
end if;
end;
return result;
end builder_status_core;
------------------------
-- port_specification --
------------------------
function port_specification (catport : String) return String is
begin
if JT.contains (catport, "@") then
return dir_ports & "/" & JT.part_1 (catport, "@") &
" FLAVOR=" & JT.part_2 (catport, "@");
else
return dir_ports & "/" & catport;
end if;
end port_specification;
end PortScan.Buildcycle;
| 35.471503 | 88 | 0.524728 |
4a6c284eaa47947ab1960f1942bb7e7e95bfd0bf | 3,690 | adb | Ada | src/console/agate-console__fe310.adb | Fabien-Chouteau/AGATE | cd8dbc54c1c70379c833e7cd710e2326ad6e9a91 | [
"BSD-3-Clause"
] | 3 | 2017-12-23T10:25:07.000Z | 2021-06-09T13:47:19.000Z | src/console/agate-console__fe310.adb | Fabien-Chouteau/AGATE | cd8dbc54c1c70379c833e7cd710e2326ad6e9a91 | [
"BSD-3-Clause"
] | null | null | null | src/console/agate-console__fe310.adb | Fabien-Chouteau/AGATE | cd8dbc54c1c70379c833e7cd710e2326ad6e9a91 | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2018, Fabien Chouteau --
-- --
-- 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 FE310_SVD.GPIO; use FE310_SVD.GPIO;
with FE310_SVD.UART; use FE310_SVD.UART;
with AGATE.Arch.RISCV; use AGATE.Arch.RISCV;
package body AGATE.Console is
procedure Initialize;
----------------
-- Initialize --
----------------
procedure Initialize is
begin
GPIO0_Periph.IO_FUNC_SEL.Arr (17) := False;
GPIO0_Periph.IO_FUNC_SEL.Arr (18) := False;
GPIO0_Periph.IO_FUNC_EN.Arr (18) := True;
GPIO0_Periph.IO_FUNC_EN.Arr (17) := True;
UART0_Periph.DIV.DIV := UInt16 ((CPU_Frequency / 115200)) - 1;
UART0_Periph.TXCTRL.ENABLE := True;
for I in 1 .. 1_000 loop
null;
end loop;
end Initialize;
-----------
-- Print --
-----------
procedure Print (C : Character) is
begin
while UART0_Periph.TXDATA.FULL loop
null;
end loop;
UART0_Periph.TXDATA.DATA := Character'Pos (C);
end Print;
-----------
-- Print --
-----------
procedure Print (Str : String) is
begin
for C of Str loop
Print (C);
end loop;
end Print;
----------------
-- Print_Line --
----------------
procedure Print_Line (Str : String) is
begin
Print (Str);
Print (ASCII.CR);
Print (ASCII.LF);
end Print_Line;
begin
Initialize;
end AGATE.Console;
| 37.653061 | 78 | 0.522764 |
186273a062f21093a4087b8d6f453c3af3d5204c | 1,689 | ads | Ada | 1A/S5/PIM/tps/tp5/piles.ads | MOUDDENEHamza/ENSEEIHT | a90b1dee0c8d18a9578153a357278d99405bb534 | [
"Apache-2.0"
] | 4 | 2020-05-02T12:32:32.000Z | 2022-01-12T20:20:35.000Z | 1A/S5/PIM/tps/tp5/piles.ads | MOUDDENEHamza/ENSEEIHT | a90b1dee0c8d18a9578153a357278d99405bb534 | [
"Apache-2.0"
] | 2 | 2021-01-14T20:03:26.000Z | 2022-01-30T01:10:00.000Z | 1A/S5/PIM/tps/tp5/piles.ads | MOUDDENEHamza/ENSEEIHT | a90b1dee0c8d18a9578153a357278d99405bb534 | [
"Apache-2.0"
] | 13 | 2020-11-11T21:28:11.000Z | 2022-02-19T13:54:22.000Z | -- Spécification du module Piles.
generic
Capacite : Integer; -- Nombre maximal d'éléments qu'une pile peut contenir
type T_Element is private; -- Type des éléments de la pile
package Piles is
type T_Pile is limited private; --// "très privé" en Algorithmique !
--// Sur un type privé, on a droit à l'affectation (:=) et l'égalité (=).
--// On perd ces opérations avec un type "limited private" (très privé).
-- Initilaiser une pile. La pile est vide.
procedure Initialiser (Pile : out T_Pile) with
Post => Est_Vide (Pile);
-- Est-ce que la pile est vide ?
function Est_Vide (Pile : in T_Pile) return Boolean;
-- Est-ce que la pile est pleine ?
function Est_Pleine (Pile : in T_Pile) return Boolean;
-- L'élément en sommet de la pile.
function Sommet (Pile : in T_Pile) return T_Element with
Pre => not Est_Vide (Pile);
-- Empiler l'élément en somment de la pile.
procedure Empiler (Pile : in out T_Pile; Element : in T_Element) with
Pre => not Est_Pleine (Pile),
Post => Sommet (Pile) = Element;
-- Supprimer l'élément en sommet de pile
procedure Depiler (Pile : in out T_Pile) with
Pre => not Est_Vide (Pile);
-- Afficher les éléments de la pile
generic
with procedure Afficher_Element (Un_Element: in T_Element);
procedure Afficher (Pile : in T_Pile);
private
type T_Tab_Elements is array (1..Capacite) of T_Element;
type T_Pile is
record
Elements : T_Tab_Elements; -- les éléments de la pile
Taille: Integer; -- Nombre d'éléments dans la pile
end record;
end Piles;
| 28.15 | 81 | 0.642392 |
dc7fc908a1a1ee9e863bcbb1cfc3af5136506c8d | 1,045 | ads | Ada | resources/scripts/scrape/gists.ads | marcostolosa/Amass | 7a48ddae82eeac76fd6447de908f6b27002eace7 | [
"Apache-2.0"
] | 7,053 | 2018-07-13T09:40:12.000Z | 2022-03-31T15:26:10.000Z | resources/scripts/scrape/gists.ads | marcostolosa/Amass | 7a48ddae82eeac76fd6447de908f6b27002eace7 | [
"Apache-2.0"
] | 624 | 2018-07-17T12:01:23.000Z | 2022-03-28T13:59:17.000Z | resources/scripts/scrape/gists.ads | marcostolosa/Amass | 7a48ddae82eeac76fd6447de908f6b27002eace7 | [
"Apache-2.0"
] | 1,470 | 2018-07-17T06:01:21.000Z | 2022-03-31T18:02:17.000Z | -- Copyright 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 url = require("url")
name = "Gists"
type = "scrape"
function start()
set_rate_limit(1)
end
function vertical(ctx, domain)
local gist_re = "https://gist[.]github[.]com/[a-zA-Z0-9-]{1,39}/[a-z0-9]{32}"
for i=1,20 do
local resp, err = request(ctx, {['url']=build_url(domain, i)})
if (err ~= nil and err ~= "") then
log(ctx, "vertical request to service failed: " .. err)
break
end
local gists = find(resp, gist_re)
if (gists == nil or #gists == 0) then
break
end
for _, gist in pairs(gists) do
scrape(ctx, {['url']=gist})
end
end
end
function build_url(domain, pagenum)
local params = {
['ref']="searchresults",
['q']=domain,
['p']=pagenum,
}
return "https://gist.github.com/search?" .. url.build_query_string(params)
end
| 25.487805 | 97 | 0.57512 |
c54c2171730c319564ce71b4053eed9ea09c6367 | 131 | adb | Ada | regression/symtab2gb/multiple_symtabs/library.adb | gsingh93/cbmc | f81c8c0c744b1c422fe9b4278764a22f8727724e | [
"BSD-4-Clause"
] | 412 | 2016-04-02T01:14:27.000Z | 2022-03-27T09:24:09.000Z | regression/symtab2gb/multiple_symtabs/library.adb | gsingh93/cbmc | f81c8c0c744b1c422fe9b4278764a22f8727724e | [
"BSD-4-Clause"
] | 4,671 | 2016-02-25T13:52:16.000Z | 2022-03-31T22:14:46.000Z | regression/symtab2gb/multiple_symtabs/library.adb | gsingh93/cbmc | f81c8c0c744b1c422fe9b4278764a22f8727724e | [
"BSD-4-Clause"
] | 266 | 2016-02-23T12:48:00.000Z | 2022-03-22T18:15:51.000Z | procedure Library (X : Integer) is
begin
-- Failure
pragma Assert (X < 10);
-- Success
pragma Assert (X > 0);
end Library;
| 16.375 | 34 | 0.641221 |
d0da7d7f6c189800de04d790c9ed9e7e7fb31dc0 | 1,333 | ads | Ada | src/dw1000.ads | SALLYPEMDAS/DW1000 | ce2906596e479c83ce64673e8e7cf03856c45523 | [
"MIT"
] | 9 | 2016-07-06T21:26:41.000Z | 2020-11-22T11:21:58.000Z | src/dw1000.ads | hao122065175/DW1000 | ce2906596e479c83ce64673e8e7cf03856c45523 | [
"MIT"
] | 1 | 2018-06-19T15:20:41.000Z | 2018-06-19T21:14:31.000Z | src/dw1000.ads | hao122065175/DW1000 | ce2906596e479c83ce64673e8e7cf03856c45523 | [
"MIT"
] | 4 | 2018-07-18T03:35:25.000Z | 2020-11-22T11:21:59.000Z | -------------------------------------------------------------------------------
-- Copyright (c) 2016 Daniel King
--
-- 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.
-------------------------------------------------------------------------------
package DW1000
is
pragma Pure;
end DW1000;
| 47.607143 | 79 | 0.663166 |
c57792d9fa12ef74c9dfc44c7e02fb1ce4a9833f | 181 | ads | Ada | tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/generic_procedure_renaming_declaration.ads | LaudateCorpus1/rose-1 | 5fe906d2a01253130c5de465aded6a917a8476a0 | [
"BSD-3-Clause"
] | 488 | 2015-01-09T08:54:48.000Z | 2022-03-30T07:15:46.000Z | tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/generic_procedure_renaming_declaration.ads | LaudateCorpus1/rose-1 | 5fe906d2a01253130c5de465aded6a917a8476a0 | [
"BSD-3-Clause"
] | 174 | 2015-01-28T18:41:32.000Z | 2022-03-31T16:51:05.000Z | tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/generic_procedure_renaming_declaration.ads | LaudateCorpus1/rose-1 | 5fe906d2a01253130c5de465aded6a917a8476a0 | [
"BSD-3-Clause"
] | 146 | 2015-04-27T02:48:34.000Z | 2022-03-04T07:32:53.000Z | package generic_procedure_renaming_declaration is
generic
procedure test(X : Integer);
generic procedure newtest renames test;
end generic_procedure_renaming_declaration;
| 22.625 | 49 | 0.828729 |
18b7beade82596ee6dbefca0ee93a9a2da305c1f | 4,476 | ads | Ada | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-stache.ads | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-stache.ads | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-stache.ads | orb-zhuchen/Orb | 6da2404b949ac28bde786e08bf4debe4a27cd3a0 | [
"CNRI-Python-GPL-Compatible",
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . S T A C K _ C H E C K I N G --
-- --
-- S p e c --
-- --
-- Copyright (C) 1999-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. --
-- --
------------------------------------------------------------------------------
-- This package provides a system-independent implementation of stack
-- checking using comparison with stack base and limit.
-- This package defines basic types and objects. Operations related to
-- stack checking can be found in package System.Stack_Checking.Operations.
pragma Compiler_Unit_Warning;
with System.Storage_Elements;
package System.Stack_Checking is
pragma Preelaborate;
pragma Elaborate_Body;
-- This unit has a junk null body. The reason is that historically we
-- used to have a real body, and it causes bootstrapping path problems
-- to eliminate it, since the old body may still be present in the
-- compilation environment for a build.
type Stack_Info is record
Limit : System.Address := System.Null_Address;
Base : System.Address := System.Null_Address;
Size : System.Storage_Elements.Storage_Offset := 0;
end record;
-- This record may be part of a larger data structure like the
-- task control block in the tasking case.
-- This specific layout has the advantage of being compatible with the
-- Intel x86 BOUNDS instruction.
type Stack_Access is access all Stack_Info;
-- Unique local storage associated with a specific task. This storage is
-- used for the stack base and limit, and is returned by Checked_Self.
-- Only self may write this information, it may be read by any task.
-- At no time the address range Limit .. Base (or Base .. Limit for
-- upgrowing stack) may contain any address that is part of another stack.
-- The Stack_Access may be part of a larger data structure.
Multi_Processor : constant Boolean := False; -- Not supported yet
private
Null_Stack_Info : aliased Stack_Info :=
(Limit => System.Null_Address,
Base => System.Null_Address,
Size => 0);
-- Use explicit assignment to avoid elaboration code (call to init proc)
Null_Stack : constant Stack_Access := Null_Stack_Info'Access;
-- Stack_Access value that will return a Stack_Base and Stack_Limit
-- that fail any stack check.
end System.Stack_Checking;
| 53.927711 | 78 | 0.539097 |
c5552ebc035849ce66a79d0dbd33bd303312d595 | 4,013 | adb | Ada | llvm-gcc-4.2-2.9/gcc/ada/s-strops.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-strops.adb | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | llvm-gcc-4.2-2.9/gcc/ada/s-strops.adb | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . S T R I N G _ O P S --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
package body System.String_Ops is
----------------
-- Str_Concat --
----------------
function Str_Concat (X, Y : String) return String is
begin
if X'Length <= 0 then
return Y;
else
declare
L : constant Natural := X'Length + Y'Length;
R : String (X'First .. X'First + L - 1);
begin
R (X'Range) := X;
R (X'First + X'Length .. R'Last) := Y;
return R;
end;
end if;
end Str_Concat;
-------------------
-- Str_Concat_CC --
-------------------
function Str_Concat_CC (X, Y : Character) return String is
R : String (1 .. 2);
begin
R (1) := X;
R (2) := Y;
return R;
end Str_Concat_CC;
-------------------
-- Str_Concat_CS --
-------------------
function Str_Concat_CS (X : Character; Y : String) return String is
R : String (1 .. Y'Length + 1);
begin
R (1) := X;
R (2 .. R'Last) := Y;
return R;
end Str_Concat_CS;
-------------------
-- Str_Concat_SC --
-------------------
function Str_Concat_SC (X : String; Y : Character) return String is
begin
if X'Length <= 0 then
return (1 => Y);
else
declare
R : String (X'First .. X'Last + 1);
begin
R (X'Range) := X;
R (R'Last) := Y;
return R;
end;
end if;
end Str_Concat_SC;
end System.String_Ops;
| 37.858491 | 78 | 0.420633 |
4a4442c6bbe0b8b0ec1045c4d642ccf7e6a54f8f | 2,574 | adb | Ada | src/render.adb | Fabien-Chouteau/GESTE-Numworks-examples | a250fc1a2859732ed784994f2588c93e80aabf46 | [
"BSD-3-Clause"
] | null | null | null | src/render.adb | Fabien-Chouteau/GESTE-Numworks-examples | a250fc1a2859732ed784994f2588c93e80aabf46 | [
"BSD-3-Clause"
] | null | null | null | src/render.adb | Fabien-Chouteau/GESTE-Numworks-examples | a250fc1a2859732ed784994f2588c93e80aabf46 | [
"BSD-3-Clause"
] | null | null | null | with Numworks.Display;
with Numworks.Backlight;
with HAL; use HAL;
with Bitmap_Color_Conversion;
with HAL.Bitmap; use HAL.Bitmap;
package body Render is
Buffer : aliased GESTE.Output_Buffer :=
(1 .. Numworks.Display.Width * 10 => 0);
Screen_Pt : GESTE.Point := (0, 0);
---------
-- Put --
---------
procedure Push_Pixels (Buffer : GESTE.Output_Buffer) is
Temp : UInt16_Array (Buffer'Range)
with Address => Buffer'Address;
begin
Numworks.Display.Push_Pixels (Temp, DMA_Theshold => 5000);
Numworks.Display.Wait_End_Of_Push;
end Push_Pixels;
----------------------
-- Set_Drawing_Area --
----------------------
procedure Set_Drawing_Area (Area : GESTE.Rect) is
begin
Numworks.Display.Set_Drawing_Area (((Area.TL.X - Screen_Pt.X,
Area.TL.Y - Screen_Pt.Y),
Area.BR.X - Area.TL.X + 1,
Area.BR.Y - Area.TL.Y + 1));
Numworks.Display.Start_Pixel_Write;
end Set_Drawing_Area;
-----------------------
-- Set_Screen_Offset --
-----------------------
procedure Set_Screen_Offset (Pt : GESTE.Point) is
begin
Screen_Pt := Pt;
end Set_Screen_Offset;
----------------
-- Render_All --
----------------
procedure Render_All (Background : GESTE_Config.Output_Color) is
begin
GESTE.Render_All
((Screen_Pt,
(Screen_Pt.X + Numworks.Display.Width - 1,
Screen_Pt.Y + Numworks.Display.Height - 1)),
Background,
Buffer,
Push_Pixels'Access,
Set_Drawing_Area'Access);
end Render_All;
------------------
-- Render_Dirty --
------------------
procedure Render_Dirty (Background : GESTE_Config.Output_Color) is
begin
GESTE.Render_Dirty
((Screen_Pt,
(Screen_Pt.X + Numworks.Display.Width - 1,
Screen_Pt.Y + Numworks.Display.Height - 1)),
Background,
Buffer,
Push_Pixels'Access,
Set_Drawing_Area'Access);
end Render_Dirty;
---------------
-- Dark_Cyan --
---------------
function Dark_Cyan return GESTE_Config.Output_Color
is (GESTE_Config.Output_Color (Bitmap_Color_Conversion.Bitmap_Color_To_Word
(RGB_565, HAL.Bitmap.Dark_Cyan)));
-----------
-- Black --
-----------
function Black return GESTE_Config.Output_Color
is (0);
begin
Numworks.Backlight.Set_Level (16);
end Render;
| 25.485149 | 78 | 0.542735 |
cb6067c059d546031a1b91df7a7c2d36b383ae01 | 490 | ada | Ada | Task/Constrained-genericity/Ada/constrained-genericity-1.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:38.000Z | 2018-11-09T22:08:38.000Z | Task/Constrained-genericity/Ada/constrained-genericity-1.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | null | null | null | Task/Constrained-genericity/Ada/constrained-genericity-1.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:40.000Z | 2018-11-09T22:08:40.000Z | with Ada.Containers.Indefinite_Vectors;
package Nutrition is
type Food is interface;
procedure Eat (Object : in out Food) is abstract;
end Nutrition;
with Ada.Containers;
with Nutrition;
generic
type New_Food is new Nutrition.Food;
package Food_Boxes is
package Food_Vectors is
new Ada.Containers.Indefinite_Vectors
( Index_Type => Positive,
Element_Type => New_Food
);
subtype Food_Box is Food_Vectors.Vector;
end Food_Boxes;
| 19.6 | 52 | 0.710204 |
d05b0a0c50506acfae94a3b45a9fcda1afff55b6 | 1,855 | ads | Ada | resources/scripts/api/commoncrawl.ads | shelld3v/Amass | a80e0619b3a96142b8980bb443fddb8c41a7e606 | [
"Apache-2.0"
] | null | null | null | resources/scripts/api/commoncrawl.ads | shelld3v/Amass | a80e0619b3a96142b8980bb443fddb8c41a7e606 | [
"Apache-2.0"
] | null | null | null | resources/scripts/api/commoncrawl.ads | shelld3v/Amass | a80e0619b3a96142b8980bb443fddb8c41a7e606 | [
"Apache-2.0"
] | null | null | null | -- Copyright 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 = "CommonCrawl"
type = "api"
local urls = {}
function start()
setratelimit(1)
end
function vertical(ctx, domain)
-- Check that the index URLs have been obtained
if (urls == nil or #urls == 0) then
urls = indexurls(ctx)
if (urls == nil or #urls == 0) then
return
end
checkratelimit()
end
for i, url in pairs(urls) do
scrape(ctx, {
['url']=buildurl(url, domain),
headers={['Content-Type']="application/json"},
})
checkratelimit()
end
end
function buildurl(url, domain)
return url .. "?url=*." .. domain .. "&output=json&fl=url"
end
function indexurls(ctx)
local resp
local cfg = datasrc_config()
local iurl = "https://index.commoncrawl.org/collinfo.json"
-- Check if the response data is in the graph database
if (cfg.ttl ~= nil and cfg.ttl > 0) then
resp = obtain_response(iurl, cfg.ttl)
end
if (resp == nil or resp == "") then
local err
resp, err = request({
url=iurl,
headers={['Content-Type']="application/json"},
})
if (err ~= nil and err ~= "") then
log(ctx, err .. ": " .. resp)
return nil
end
if (cfg.ttl ~= nil and cfg.ttl > 0) then
cache_response(iurl, resp)
end
end
local data = json.decode(resp)
if (data == nil or #data == 0) then
return nil
end
local urls = {}
for i, u in pairs(data) do
local url = u["cdx-api"]
if (url ~= nil and url ~= "") then
table.insert(urls, url)
end
end
return urls
end
| 22.901235 | 97 | 0.552561 |
dc84a126df2898fba25e173e89719aaac23c281a | 19,139 | ads | Ada | include/sf-graphics-rectangleshape.ads | Fabien-Chouteau/ASFML | 52a013554bcfb6150e0d6391871356c1443a6b93 | [
"Zlib"
] | null | null | null | include/sf-graphics-rectangleshape.ads | Fabien-Chouteau/ASFML | 52a013554bcfb6150e0d6391871356c1443a6b93 | [
"Zlib"
] | null | null | null | include/sf-graphics-rectangleshape.ads | Fabien-Chouteau/ASFML | 52a013554bcfb6150e0d6391871356c1443a6b93 | [
"Zlib"
] | null | null | null | -- SFML - Simple and Fast Multimedia Library
-- Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
-- 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 Sf.System.Vector2;
with Sf.Graphics.Transform;
with Sf.Graphics.Rect;
with Sf.Graphics.Color;
package Sf.Graphics.RectangleShape is
--//////////////////////////////////////////////////////////
--/ @brief Create a new rectangle shape
--/
--/ @return A new sfRectangleShape object, or NULL if it failed
--/
--//////////////////////////////////////////////////////////
function create return sfRectangleShape_Ptr;
--//////////////////////////////////////////////////////////
--/ @brief Copy an existing rectangle shape
--/
--/ @param shape Shape to copy
--/
--/ @return Copied object
--/
--//////////////////////////////////////////////////////////
function copy (shape : sfRectangleShape_Ptr) return sfRectangleShape_Ptr;
--//////////////////////////////////////////////////////////
--/ @brief Destroy an existing rectangle shape
--/
--/ @param shape Shape to delete
--/
--//////////////////////////////////////////////////////////
procedure destroy (shape : sfRectangleShape_Ptr);
--//////////////////////////////////////////////////////////
--/ @brief Set the position of a rectangle shape
--/
--/ This function completely overwrites the previous position.
--/ See sfRectangleShape_move to apply an offset based on the previous position instead.
--/ The default position of a circle Shape object is (0, 0).
--/
--/ @param shape Shape object
--/ @param position New position
--/
--//////////////////////////////////////////////////////////
procedure setPosition (shape : sfRectangleShape_Ptr; position : Sf.System.Vector2.sfVector2f);
--//////////////////////////////////////////////////////////
--/ @brief Set the orientation of a rectangle shape
--/
--/ This function completely overwrites the previous rotation.
--/ See sfRectangleShape_rotate to add an angle based on the previous rotation instead.
--/ The default rotation of a circle Shape object is 0.
--/
--/ @param shape Shape object
--/ @param angle New rotation, in degrees
--/
--//////////////////////////////////////////////////////////
procedure setRotation (shape : sfRectangleShape_Ptr; angle : float);
--//////////////////////////////////////////////////////////
--/ @brief Set the scale factors of a rectangle shape
--/
--/ This function completely overwrites the previous scale.
--/ See sfRectangleShape_scale to add a factor based on the previous scale instead.
--/ The default scale of a circle Shape object is (1, 1).
--/
--/ @param shape Shape object
--/ @param scale New scale factors
--/
--//////////////////////////////////////////////////////////
procedure setScale (shape : sfRectangleShape_Ptr; scale : Sf.System.Vector2.sfVector2f);
--//////////////////////////////////////////////////////////
--/ @brief Set the local origin of a rectangle shape
--/
--/ The origin of an object defines the center point for
--/ all transformations (position, scale, rotation).
--/ The coordinates of this point must be relative to the
--/ top-left corner of the object, and ignore all
--/ transformations (position, scale, rotation).
--/ The default origin of a circle Shape object is (0, 0).
--/
--/ @param shape Shape object
--/ @param origin New origin
--/
--//////////////////////////////////////////////////////////
procedure setOrigin (shape : sfRectangleShape_Ptr; origin : Sf.System.Vector2.sfVector2f);
--//////////////////////////////////////////////////////////
--/ @brief Get the position of a rectangle shape
--/
--/ @param shape Shape object
--/
--/ @return Current position
--/
--//////////////////////////////////////////////////////////
function getPosition (shape : sfRectangleShape_Ptr) return Sf.System.Vector2.sfVector2f;
--//////////////////////////////////////////////////////////
--/ @brief Get the orientation of a rectangle shape
--/
--/ The rotation is always in the range [0, 360].
--/
--/ @param shape Shape object
--/
--/ @return Current rotation, in degrees
--/
--//////////////////////////////////////////////////////////
function getRotation (shape : sfRectangleShape_Ptr) return float;
--//////////////////////////////////////////////////////////
--/ @brief Get the current scale of a rectangle shape
--/
--/ @param shape Shape object
--/
--/ @return Current scale factors
--/
--//////////////////////////////////////////////////////////
function getScale (shape : sfRectangleShape_Ptr) return Sf.System.Vector2.sfVector2f;
--//////////////////////////////////////////////////////////
--/ @brief Get the local origin of a rectangle shape
--/
--/ @param shape Shape object
--/
--/ @return Current origin
--/
--//////////////////////////////////////////////////////////
function getOrigin (shape : sfRectangleShape_Ptr) return Sf.System.Vector2.sfVector2f;
--//////////////////////////////////////////////////////////
--/ @brief Move a rectangle shape by a given offset
--/
--/ This function adds to the current position of the object,
--/ unlike sfRectangleShape_setPosition which overwrites it.
--/
--/ @param shape Shape object
--/ @param offset Offset
--/
--//////////////////////////////////////////////////////////
procedure move (shape : sfRectangleShape_Ptr; offset : Sf.System.Vector2.sfVector2f);
--//////////////////////////////////////////////////////////
--/ @brief Rotate a rectangle shape
--/
--/ This function adds to the current rotation of the object,
--/ unlike sfRectangleShape_setRotation which overwrites it.
--/
--/ @param shape Shape object
--/ @param angle Angle of rotation, in degrees
--/
--//////////////////////////////////////////////////////////
procedure rotate (shape : sfRectangleShape_Ptr; angle : float);
--//////////////////////////////////////////////////////////
--/ @brief Scale a rectangle shape
--/
--/ This function multiplies the current scale of the object,
--/ unlike sfRectangleShape_setScale which overwrites it.
--/
--/ @param shape Shape object
--/ @param factors Scale factors
--/
--//////////////////////////////////////////////////////////
procedure scale (shape : sfRectangleShape_Ptr; factors : Sf.System.Vector2.sfVector2f);
--//////////////////////////////////////////////////////////
--/ @brief Get the combined transform of a rectangle shape
--/
--/ @param shape shape object
--/
--/ @return Transform combining the position/rotation/scale/origin of the object
--/
--//////////////////////////////////////////////////////////
function getTransform (shape : sfRectangleShape_Ptr) return Sf.Graphics.Transform.sfTransform;
--//////////////////////////////////////////////////////////
--/ @brief Get the inverse of the combined transform of a rectangle shape
--/
--/ @param shape shape object
--/
--/ @return Inverse of the combined transformations applied to the object
--/
--//////////////////////////////////////////////////////////
function getInverseTransform (shape : sfRectangleShape_Ptr) return Sf.Graphics.Transform.sfTransform;
--//////////////////////////////////////////////////////////
--/ @brief Change the source texture of a rectangle shape
--/
--/ The @a texture argument refers to a texture that must
--/ exist as long as the shape uses it. Indeed, the shape
--/ doesn't store its own copy of the texture, but rather keeps
--/ a pointer to the one that you passed to this function.
--/ If the source texture is destroyed and the shape tries to
--/ use it, the behaviour is undefined.
--/ @a texture can be NULL to disable texturing.
--/ If @a resetRect is true, the TextureRect property of
--/ the shape is automatically adjusted to the size of the new
--/ texture. If it is false, the texture rect is left unchanged.
--/
--/ @param shape Shape object
--/ @param texture New texture
--/ @param resetRect Should the texture rect be reset to the size of the new texture?
--/
--//////////////////////////////////////////////////////////
procedure setTexture
(shape : sfRectangleShape_Ptr;
texture : sfTexture_Ptr;
resetRect : sfBool);
--//////////////////////////////////////////////////////////
--/ @brief Set the sub-rectangle of the texture that a rectangle shape will display
--/
--/ The texture rect is useful when you don't want to display
--/ the whole texture, but rather a part of it.
--/ By default, the texture rect covers the entire texture.
--/
--/ @param shape Shape object
--/ @param rect Rectangle defining the region of the texture to display
--/
--//////////////////////////////////////////////////////////
procedure setTextureRect (shape : sfRectangleShape_Ptr; rect : Sf.Graphics.Rect.sfIntRect);
--//////////////////////////////////////////////////////////
--/ @brief Set the fill color of a rectangle shape
--/
--/ This color is modulated (multiplied) with the shape's
--/ texture if any. It can be used to colorize the shape,
--/ or change its global opacity.
--/ You can use sfTransparent to make the inside of
--/ the shape transparent, and have the outline alone.
--/ By default, the shape's fill color is opaque white.
--/
--/ @param shape Shape object
--/ @param color New color of the shape
--/
--//////////////////////////////////////////////////////////
procedure setFillColor (shape : sfRectangleShape_Ptr; color : Sf.Graphics.Color.sfColor);
--//////////////////////////////////////////////////////////
--/ @brief Set the outline color of a rectangle shape
--/
--/ You can use sfTransparent to disable the outline.
--/ By default, the shape's outline color is opaque white.
--/
--/ @param shape Shape object
--/ @param color New outline color of the shape
--/
--//////////////////////////////////////////////////////////
procedure setOutlineColor (shape : sfRectangleShape_Ptr; color : Sf.Graphics.Color.sfColor);
--//////////////////////////////////////////////////////////
--/ @brief Set the thickness of a rectangle shape's outline
--/
--/ This number cannot be negative. Using zero disables
--/ the outline.
--/ By default, the outline thickness is 0.
--/
--/ @param shape Shape object
--/ @param thickness New outline thickness
--/
--//////////////////////////////////////////////////////////
procedure setOutlineThickness (shape : sfRectangleShape_Ptr; thickness : float);
--//////////////////////////////////////////////////////////
--/ @brief Get the source texture of a rectangle shape
--/
--/ If the shape has no source texture, a NULL pointer is returned.
--/ The returned pointer is const, which means that you can't
--/ modify the texture when you retrieve it with this function.
--/
--/ @param shape Shape object
--/
--/ @return Pointer to the shape's texture
--/
--//////////////////////////////////////////////////////////
function getTexture (shape : sfRectangleShape_Ptr) return sfTexture_Ptr;
--//////////////////////////////////////////////////////////
--/ @brief Get the sub-rectangle of the texture displayed by a rectangle shape
--/
--/ @param shape Shape object
--/
--/ @return Texture rectangle of the shape
--/
--//////////////////////////////////////////////////////////
function getTextureRect (shape : sfRectangleShape_Ptr) return Sf.Graphics.Rect.sfIntRect;
--//////////////////////////////////////////////////////////
--/ @brief Get the fill color of a rectangle shape
--/
--/ @param shape Shape object
--/
--/ @return Fill color of the shape
--/
--//////////////////////////////////////////////////////////
function getFillColor (shape : sfRectangleShape_Ptr) return Sf.Graphics.Color.sfColor;
--//////////////////////////////////////////////////////////
--/ @brief Get the outline color of a rectangle shape
--/
--/ @param shape Shape object
--/
--/ @return Outline color of the shape
--/
--//////////////////////////////////////////////////////////
function getOutlineColor (shape : sfRectangleShape_Ptr) return Sf.Graphics.Color.sfColor;
--//////////////////////////////////////////////////////////
--/ @brief Get the outline thickness of a rectangle shape
--/
--/ @param shape Shape object
--/
--/ @return Outline thickness of the shape
--/
--//////////////////////////////////////////////////////////
function getOutlineThickness (shape : sfRectangleShape_Ptr) return float;
--//////////////////////////////////////////////////////////
--/ @brief Get the total number of points of a rectangle shape
--/
--/ @param shape Shape object
--/
--/ @return Number of points of the shape
--/
--//////////////////////////////////////////////////////////
function getPointCount (shape : sfRectangleShape_Ptr) return sfSize_t;
--//////////////////////////////////////////////////////////
--/ @brief Get a point of a rectangle shape
--/
--/ The result is undefined if @a index is out of the valid range.
--/
--/ @param shape Shape object
--/ @param index Index of the point to get, in range [0 .. getPointCount() - 1]
--/
--/ @return Index-th point of the shape
--/
--//////////////////////////////////////////////////////////
function getPoint (shape : sfRectangleShape_Ptr; index : sfSize_t) return Sf.System.Vector2.sfVector2f;
--//////////////////////////////////////////////////////////
--/ @brief Set the size of a rectangle shape
--/
--/ @param shape Shape object
--/ @param size New size of the rectangle
--/
--//////////////////////////////////////////////////////////
procedure setSize (shape : sfRectangleShape_Ptr; size : Sf.System.Vector2.sfVector2f);
--//////////////////////////////////////////////////////////
--/ @brief Get the size of a rectangle shape
--/
--/ @param shape Shape object
--/ @return height Size of the rectangle
--/
--//////////////////////////////////////////////////////////
function getSize (shape : sfRectangleShape_Ptr) return Sf.System.Vector2.sfVector2f;
--//////////////////////////////////////////////////////////
--/ @brief Get the local bounding rectangle of a rectangle shape
--/
--/ The returned rectangle is in local coordinates, which means
--/ that it ignores the transformations (translation, rotation,
--/ scale, ...) that are applied to the entity.
--/ In other words, this function returns the bounds of the
--/ entity in the entity's coordinate system.
--/
--/ @param shape Shape object
--/
--/ @return Local bounding rectangle of the entity
--/
--//////////////////////////////////////////////////////////
function getLocalBounds (shape : sfRectangleShape_Ptr) return Sf.Graphics.Rect.sfFloatRect;
--//////////////////////////////////////////////////////////
--/ @brief Get the global bounding rectangle of a rectangle shape
--/
--/ The returned rectangle is in global coordinates, which means
--/ that it takes in account the transformations (translation,
--/ rotation, scale, ...) that are applied to the entity.
--/ In other words, this function returns the bounds of the
--/ sprite in the global 2D world's coordinate system.
--/
--/ @param shape Shape object
--/
--/ @return Global bounding rectangle of the entity
--/
--//////////////////////////////////////////////////////////
function getGlobalBounds (shape : sfRectangleShape_Ptr) return Sf.Graphics.Rect.sfFloatRect;
private
pragma Import (C, create, "sfRectangleShape_create");
pragma Import (C, copy, "sfRectangleShape_copy");
pragma Import (C, destroy, "sfRectangleShape_destroy");
pragma Import (C, setPosition, "sfRectangleShape_setPosition");
pragma Import (C, setRotation, "sfRectangleShape_setRotation");
pragma Import (C, setScale, "sfRectangleShape_setScale");
pragma Import (C, setOrigin, "sfRectangleShape_setOrigin");
pragma Import (C, getPosition, "sfRectangleShape_getPosition");
pragma Import (C, getRotation, "sfRectangleShape_getRotation");
pragma Import (C, getScale, "sfRectangleShape_getScale");
pragma Import (C, getOrigin, "sfRectangleShape_getOrigin");
pragma Import (C, move, "sfRectangleShape_move");
pragma Import (C, rotate, "sfRectangleShape_rotate");
pragma Import (C, scale, "sfRectangleShape_scale");
pragma Import (C, getTransform, "sfRectangleShape_getTransform");
pragma Import (C, getInverseTransform, "sfRectangleShape_getInverseTransform");
pragma Import (C, setTexture, "sfRectangleShape_setTexture");
pragma Import (C, setTextureRect, "sfRectangleShape_setTextureRect");
pragma Import (C, setFillColor, "sfRectangleShape_setFillColor");
pragma Import (C, setOutlineColor, "sfRectangleShape_setOutlineColor");
pragma Import (C, setOutlineThickness, "sfRectangleShape_setOutlineThickness");
pragma Import (C, getTexture, "sfRectangleShape_getTexture");
pragma Import (C, getTextureRect, "sfRectangleShape_getTextureRect");
pragma Import (C, getFillColor, "sfRectangleShape_getFillColor");
pragma Import (C, getOutlineColor, "sfRectangleShape_getOutlineColor");
pragma Import (C, getOutlineThickness, "sfRectangleShape_getOutlineThickness");
pragma Import (C, getPointCount, "sfRectangleShape_getPointCount");
pragma Import (C, getPoint, "sfRectangleShape_getPoint");
pragma Import (C, setSize, "sfRectangleShape_setSize");
pragma Import (C, getSize, "sfRectangleShape_getSize");
pragma Import (C, getLocalBounds, "sfRectangleShape_getLocalBounds");
pragma Import (C, getGlobalBounds, "sfRectangleShape_getGlobalBounds");
end Sf.Graphics.RectangleShape;
| 42.720982 | 106 | 0.543602 |
dcf6f54a52345ae09c690660665fa639de368810 | 135,788 | adb | Ada | Vivado_HLS_Tutorial/Interface_Synthesis/lab4/axi_interfaces_prj/solution1/.autopilot/db/axi_interfaces.sched.adb | williambong/Vivado | 68efafbc44b65c0bb047dbafc0ff7f1b56ee36bb | [
"MIT"
] | null | null | null | Vivado_HLS_Tutorial/Interface_Synthesis/lab4/axi_interfaces_prj/solution1/.autopilot/db/axi_interfaces.sched.adb | williambong/Vivado | 68efafbc44b65c0bb047dbafc0ff7f1b56ee36bb | [
"MIT"
] | null | null | null | Vivado_HLS_Tutorial/Interface_Synthesis/lab4/axi_interfaces_prj/solution1/.autopilot/db/axi_interfaces.sched.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>axi_interfaces</name>
<ret_bitwidth>0</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>16</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>d_o_0</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>d_o[0]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>1</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>d_o_1</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>d_o[1]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</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="_3">
<Value>
<Obj>
<type>1</type>
<id>3</id>
<name>d_o_2</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>d_o[2]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</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>d_o_3</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>d_o[3]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</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="_5">
<Value>
<Obj>
<type>1</type>
<id>5</id>
<name>d_o_4</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>d_o[4]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</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="_6">
<Value>
<Obj>
<type>1</type>
<id>6</id>
<name>d_o_5</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>d_o[5]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</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="_7">
<Value>
<Obj>
<type>1</type>
<id>7</id>
<name>d_o_6</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>d_o[6]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</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="_8">
<Value>
<Obj>
<type>1</type>
<id>8</id>
<name>d_o_7</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>d_o[7]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</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="_9">
<Value>
<Obj>
<type>1</type>
<id>9</id>
<name>d_i_0</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>d_i[0]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</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="_10">
<Value>
<Obj>
<type>1</type>
<id>10</id>
<name>d_i_1</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>d_i[1]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</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="_11">
<Value>
<Obj>
<type>1</type>
<id>11</id>
<name>d_i_2</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>d_i[2]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</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="_12">
<Value>
<Obj>
<type>1</type>
<id>12</id>
<name>d_i_3</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>d_i[3]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</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="_13">
<Value>
<Obj>
<type>1</type>
<id>13</id>
<name>d_i_4</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>d_i[4]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</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="_14">
<Value>
<Obj>
<type>1</type>
<id>14</id>
<name>d_i_5</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>d_i[5]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</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="_15">
<Value>
<Obj>
<type>1</type>
<id>15</id>
<name>d_i_6</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>d_i[6]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</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="_16">
<Value>
<Obj>
<type>1</type>
<id>16</id>
<name>d_i_7</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>d_i[7]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</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>
</ports>
<nodes class_id="8" tracking_level="0" version="0">
<count>68</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>41</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>64</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="10" tracking_level="0" version="0">
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</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>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>64</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>136</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>43</id>
<name>do_init</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>6</count>
<item_version>0</item_version>
<item>251</item>
<item>252</item>
<item>254</item>
<item>255</item>
<item>256</item>
<item>257</item>
</oprand_edges>
<opcode>phi</opcode>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>44</id>
<name>i1</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>64</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>64</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>5</bitwidth>
</Value>
<oprand_edges>
<count>6</count>
<item_version>0</item_version>
<item>259</item>
<item>260</item>
<item>261</item>
<item>262</item>
<item>263</item>
<item>264</item>
</oprand_edges>
<opcode>phi</opcode>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>45</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>265</item>
<item>266</item>
<item>267</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>64</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>64</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>64</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>249</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_22">
<Value>
<Obj>
<type>0</type>
<id>66</id>
<name>i1_cast</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>64</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>64</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>137</item>
</oprand_edges>
<opcode>zext</opcode>
</item>
<item class_id_reference="9" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>71</id>
<name>acc_0_load</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>138</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_24">
<Value>
<Obj>
<type>0</type>
<id>72</id>
<name>d_i_0_read</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>140</item>
<item>141</item>
</oprand_edges>
<opcode>read</opcode>
</item>
<item class_id_reference="9" object_id="_25">
<Value>
<Obj>
<type>0</type>
<id>73</id>
<name>tmp_2</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>142</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_26">
<Value>
<Obj>
<type>0</type>
<id>74</id>
<name>tmp_3</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>143</item>
<item>144</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_27">
<Value>
<Obj>
<type>0</type>
<id>75</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</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>145</item>
<item>146</item>
<item>508</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_28">
<Value>
<Obj>
<type>0</type>
<id>76</id>
<name>tmp_1</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>67</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>67</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>147</item>
</oprand_edges>
<opcode>trunc</opcode>
</item>
<item class_id_reference="9" object_id="_29">
<Value>
<Obj>
<type>0</type>
<id>77</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>67</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>67</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>149</item>
<item>150</item>
<item>151</item>
</oprand_edges>
<opcode>write</opcode>
</item>
<item class_id_reference="9" object_id="_30">
<Value>
<Obj>
<type>0</type>
<id>79</id>
<name>acc_1_load</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>152</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_31">
<Value>
<Obj>
<type>0</type>
<id>80</id>
<name>d_i_1_read</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>153</item>
<item>154</item>
</oprand_edges>
<opcode>read</opcode>
</item>
<item class_id_reference="9" object_id="_32">
<Value>
<Obj>
<type>0</type>
<id>81</id>
<name>tmp_2_1</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>155</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_33">
<Value>
<Obj>
<type>0</type>
<id>82</id>
<name>tmp_3_1</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>156</item>
<item>157</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_34">
<Value>
<Obj>
<type>0</type>
<id>83</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</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>158</item>
<item>159</item>
<item>507</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_35">
<Value>
<Obj>
<type>0</type>
<id>84</id>
<name>tmp_4</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>67</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>67</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>160</item>
</oprand_edges>
<opcode>trunc</opcode>
</item>
<item class_id_reference="9" object_id="_36">
<Value>
<Obj>
<type>0</type>
<id>85</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>67</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>67</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>161</item>
<item>162</item>
<item>163</item>
</oprand_edges>
<opcode>write</opcode>
</item>
<item class_id_reference="9" object_id="_37">
<Value>
<Obj>
<type>0</type>
<id>86</id>
<name>acc_2_load</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>164</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_38">
<Value>
<Obj>
<type>0</type>
<id>87</id>
<name>d_i_2_read</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>165</item>
<item>166</item>
</oprand_edges>
<opcode>read</opcode>
</item>
<item class_id_reference="9" object_id="_39">
<Value>
<Obj>
<type>0</type>
<id>88</id>
<name>tmp_2_2</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>167</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_40">
<Value>
<Obj>
<type>0</type>
<id>89</id>
<name>tmp_3_2</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>168</item>
<item>169</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_41">
<Value>
<Obj>
<type>0</type>
<id>90</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</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>170</item>
<item>171</item>
<item>506</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_42">
<Value>
<Obj>
<type>0</type>
<id>91</id>
<name>tmp_5</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>67</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>67</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>172</item>
</oprand_edges>
<opcode>trunc</opcode>
</item>
<item class_id_reference="9" object_id="_43">
<Value>
<Obj>
<type>0</type>
<id>92</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>67</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>67</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>173</item>
<item>174</item>
<item>175</item>
</oprand_edges>
<opcode>write</opcode>
</item>
<item class_id_reference="9" object_id="_44">
<Value>
<Obj>
<type>0</type>
<id>93</id>
<name>acc_3_load</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>176</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_45">
<Value>
<Obj>
<type>0</type>
<id>94</id>
<name>d_i_3_read</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>177</item>
<item>178</item>
</oprand_edges>
<opcode>read</opcode>
</item>
<item class_id_reference="9" object_id="_46">
<Value>
<Obj>
<type>0</type>
<id>95</id>
<name>tmp_2_3</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>179</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_47">
<Value>
<Obj>
<type>0</type>
<id>96</id>
<name>tmp_3_3</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>180</item>
<item>181</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_48">
<Value>
<Obj>
<type>0</type>
<id>97</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</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>182</item>
<item>183</item>
<item>505</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_49">
<Value>
<Obj>
<type>0</type>
<id>98</id>
<name>tmp_6</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>67</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>67</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>184</item>
</oprand_edges>
<opcode>trunc</opcode>
</item>
<item class_id_reference="9" object_id="_50">
<Value>
<Obj>
<type>0</type>
<id>99</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>67</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>67</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>185</item>
<item>186</item>
<item>187</item>
</oprand_edges>
<opcode>write</opcode>
</item>
<item class_id_reference="9" object_id="_51">
<Value>
<Obj>
<type>0</type>
<id>100</id>
<name>acc_4_load</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>188</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_52">
<Value>
<Obj>
<type>0</type>
<id>101</id>
<name>d_i_4_read</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>189</item>
<item>190</item>
</oprand_edges>
<opcode>read</opcode>
</item>
<item class_id_reference="9" object_id="_53">
<Value>
<Obj>
<type>0</type>
<id>102</id>
<name>tmp_2_4</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>191</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_54">
<Value>
<Obj>
<type>0</type>
<id>103</id>
<name>tmp_3_4</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>192</item>
<item>193</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_55">
<Value>
<Obj>
<type>0</type>
<id>104</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</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>194</item>
<item>195</item>
<item>504</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_56">
<Value>
<Obj>
<type>0</type>
<id>105</id>
<name>tmp_7</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>67</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>67</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>196</item>
</oprand_edges>
<opcode>trunc</opcode>
</item>
<item class_id_reference="9" object_id="_57">
<Value>
<Obj>
<type>0</type>
<id>106</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>67</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>67</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>197</item>
<item>198</item>
<item>199</item>
</oprand_edges>
<opcode>write</opcode>
</item>
<item class_id_reference="9" object_id="_58">
<Value>
<Obj>
<type>0</type>
<id>107</id>
<name>acc_5_load</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>200</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_59">
<Value>
<Obj>
<type>0</type>
<id>108</id>
<name>d_i_5_read</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>201</item>
<item>202</item>
</oprand_edges>
<opcode>read</opcode>
</item>
<item class_id_reference="9" object_id="_60">
<Value>
<Obj>
<type>0</type>
<id>109</id>
<name>tmp_2_5</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>203</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_61">
<Value>
<Obj>
<type>0</type>
<id>110</id>
<name>tmp_3_5</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>204</item>
<item>205</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_62">
<Value>
<Obj>
<type>0</type>
<id>111</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</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>206</item>
<item>207</item>
<item>503</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_63">
<Value>
<Obj>
<type>0</type>
<id>112</id>
<name>tmp_8</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>67</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>67</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>208</item>
</oprand_edges>
<opcode>trunc</opcode>
</item>
<item class_id_reference="9" object_id="_64">
<Value>
<Obj>
<type>0</type>
<id>113</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>67</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>67</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>209</item>
<item>210</item>
<item>211</item>
</oprand_edges>
<opcode>write</opcode>
</item>
<item class_id_reference="9" object_id="_65">
<Value>
<Obj>
<type>0</type>
<id>114</id>
<name>acc_6_load</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>212</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_66">
<Value>
<Obj>
<type>0</type>
<id>115</id>
<name>d_i_6_read</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>213</item>
<item>214</item>
</oprand_edges>
<opcode>read</opcode>
</item>
<item class_id_reference="9" object_id="_67">
<Value>
<Obj>
<type>0</type>
<id>116</id>
<name>tmp_2_6</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>215</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_68">
<Value>
<Obj>
<type>0</type>
<id>117</id>
<name>tmp_3_6</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>216</item>
<item>217</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_69">
<Value>
<Obj>
<type>0</type>
<id>118</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</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>218</item>
<item>219</item>
<item>502</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_70">
<Value>
<Obj>
<type>0</type>
<id>119</id>
<name>tmp_9</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>67</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>67</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>220</item>
</oprand_edges>
<opcode>trunc</opcode>
</item>
<item class_id_reference="9" object_id="_71">
<Value>
<Obj>
<type>0</type>
<id>120</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>67</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>67</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>221</item>
<item>222</item>
<item>223</item>
</oprand_edges>
<opcode>write</opcode>
</item>
<item class_id_reference="9" object_id="_72">
<Value>
<Obj>
<type>0</type>
<id>121</id>
<name>acc_7_load</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>224</item>
</oprand_edges>
<opcode>load</opcode>
</item>
<item class_id_reference="9" object_id="_73">
<Value>
<Obj>
<type>0</type>
<id>122</id>
<name>d_i_7_read</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>225</item>
<item>226</item>
</oprand_edges>
<opcode>read</opcode>
</item>
<item class_id_reference="9" object_id="_74">
<Value>
<Obj>
<type>0</type>
<id>123</id>
<name>tmp_2_7</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>227</item>
</oprand_edges>
<opcode>sext</opcode>
</item>
<item class_id_reference="9" object_id="_75">
<Value>
<Obj>
<type>0</type>
<id>124</id>
<name>tmp_3_7</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>228</item>
<item>229</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_76">
<Value>
<Obj>
<type>0</type>
<id>125</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>66</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>66</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>230</item>
<item>231</item>
<item>501</item>
</oprand_edges>
<opcode>store</opcode>
</item>
<item class_id_reference="9" object_id="_77">
<Value>
<Obj>
<type>0</type>
<id>126</id>
<name>tmp_10</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>67</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>67</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>232</item>
</oprand_edges>
<opcode>trunc</opcode>
</item>
<item class_id_reference="9" object_id="_78">
<Value>
<Obj>
<type>0</type>
<id>127</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>67</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>67</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>233</item>
<item>234</item>
<item>235</item>
</oprand_edges>
<opcode>write</opcode>
</item>
<item class_id_reference="9" object_id="_79">
<Value>
<Obj>
<type>0</type>
<id>128</id>
<name>i_1_7</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>64</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>64</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>237</item>
<item>238</item>
</oprand_edges>
<opcode>add</opcode>
</item>
<item class_id_reference="9" object_id="_80">
<Value>
<Obj>
<type>0</type>
<id>129</id>
<name>tmp_11</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>64</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>64</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>5</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>239</item>
</oprand_edges>
<opcode>trunc</opcode>
</item>
<item class_id_reference="9" object_id="_81">
<Value>
<Obj>
<type>0</type>
<id>130</id>
<name>exitcond</name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>64</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>64</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>240</item>
<item>242</item>
</oprand_edges>
<opcode>icmp</opcode>
</item>
<item class_id_reference="9" object_id="_82">
<Value>
<Obj>
<type>0</type>
<id>131</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>64</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>64</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>243</item>
<item>244</item>
<item>245</item>
</oprand_edges>
<opcode>br</opcode>
</item>
<item class_id_reference="9" object_id="_83">
<Value>
<Obj>
<type>0</type>
<id>133</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>69</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>69</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>247</item>
</oprand_edges>
<opcode>return</opcode>
</item>
<item class_id_reference="9" object_id="_84">
<Value>
<Obj>
<type>0</type>
<id>134</id>
<name></name>
<fileName>axi_interfaces.c</fileName>
<fileDirectory>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</fileDirectory>
<lineNumber>69</lineNumber>
<contextFuncName>axi_interfaces</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>d:/opt/source/Vivado/Vivado_HLS_Tutorial/Interface_Synthesis/lab4</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>axi_interfaces.c</first>
<second>axi_interfaces</second>
</first>
<second>69</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>248</item>
</oprand_edges>
<opcode>br</opcode>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>5</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_85">
<Value>
<Obj>
<type>2</type>
<id>236</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<const_type>0</const_type>
<content>8</content>
</item>
<item class_id_reference="16" object_id="_86">
<Value>
<Obj>
<type>2</type>
<id>241</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<const_type>0</const_type>
<content>32</content>
</item>
<item class_id_reference="16" object_id="_87">
<Value>
<Obj>
<type>2</type>
<id>250</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_88">
<Value>
<Obj>
<type>2</type>
<id>253</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="_89">
<Value>
<Obj>
<type>2</type>
<id>258</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>5</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
</consts>
<blocks class_id="17" tracking_level="0" version="0">
<count>5</count>
<item_version>0</item_version>
<item class_id="18" tracking_level="1" version="0" object_id="_90">
<Obj>
<type>3</type>
<id>42</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_91">
<Obj>
<type>3</type>
<id>46</id>
<name>rewind_header</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>43</item>
<item>44</item>
<item>45</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_92">
<Obj>
<type>3</type>
<id>65</id>
<name>rewind_init</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>64</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_93">
<Obj>
<type>3</type>
<id>132</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>61</count>
<item_version>0</item_version>
<item>66</item>
<item>71</item>
<item>72</item>
<item>73</item>
<item>74</item>
<item>75</item>
<item>76</item>
<item>77</item>
<item>79</item>
<item>80</item>
<item>81</item>
<item>82</item>
<item>83</item>
<item>84</item>
<item>85</item>
<item>86</item>
<item>87</item>
<item>88</item>
<item>89</item>
<item>90</item>
<item>91</item>
<item>92</item>
<item>93</item>
<item>94</item>
<item>95</item>
<item>96</item>
<item>97</item>
<item>98</item>
<item>99</item>
<item>100</item>
<item>101</item>
<item>102</item>
<item>103</item>
<item>104</item>
<item>105</item>
<item>106</item>
<item>107</item>
<item>108</item>
<item>109</item>
<item>110</item>
<item>111</item>
<item>112</item>
<item>113</item>
<item>114</item>
<item>115</item>
<item>116</item>
<item>117</item>
<item>118</item>
<item>119</item>
<item>120</item>
<item>121</item>
<item>122</item>
<item>123</item>
<item>124</item>
<item>125</item>
<item>126</item>
<item>127</item>
<item>128</item>
<item>129</item>
<item>130</item>
<item>131</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_94">
<Obj>
<type>3</type>
<id>135</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>133</item>
<item>134</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>122</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_95">
<id>136</id>
<edge_type>2</edge_type>
<source_obj>46</source_obj>
<sink_obj>41</sink_obj>
</item>
<item class_id_reference="20" object_id="_96">
<id>137</id>
<edge_type>1</edge_type>
<source_obj>44</source_obj>
<sink_obj>66</sink_obj>
</item>
<item class_id_reference="20" object_id="_97">
<id>138</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>71</sink_obj>
</item>
<item class_id_reference="20" object_id="_98">
<id>141</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>72</sink_obj>
</item>
<item class_id_reference="20" object_id="_99">
<id>142</id>
<edge_type>1</edge_type>
<source_obj>72</source_obj>
<sink_obj>73</sink_obj>
</item>
<item class_id_reference="20" object_id="_100">
<id>143</id>
<edge_type>1</edge_type>
<source_obj>73</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_101">
<id>144</id>
<edge_type>1</edge_type>
<source_obj>71</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_102">
<id>145</id>
<edge_type>1</edge_type>
<source_obj>74</source_obj>
<sink_obj>75</sink_obj>
</item>
<item class_id_reference="20" object_id="_103">
<id>146</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>75</sink_obj>
</item>
<item class_id_reference="20" object_id="_104">
<id>147</id>
<edge_type>1</edge_type>
<source_obj>74</source_obj>
<sink_obj>76</sink_obj>
</item>
<item class_id_reference="20" object_id="_105">
<id>150</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>77</sink_obj>
</item>
<item class_id_reference="20" object_id="_106">
<id>151</id>
<edge_type>1</edge_type>
<source_obj>76</source_obj>
<sink_obj>77</sink_obj>
</item>
<item class_id_reference="20" object_id="_107">
<id>152</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>79</sink_obj>
</item>
<item class_id_reference="20" object_id="_108">
<id>154</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>80</sink_obj>
</item>
<item class_id_reference="20" object_id="_109">
<id>155</id>
<edge_type>1</edge_type>
<source_obj>80</source_obj>
<sink_obj>81</sink_obj>
</item>
<item class_id_reference="20" object_id="_110">
<id>156</id>
<edge_type>1</edge_type>
<source_obj>81</source_obj>
<sink_obj>82</sink_obj>
</item>
<item class_id_reference="20" object_id="_111">
<id>157</id>
<edge_type>1</edge_type>
<source_obj>79</source_obj>
<sink_obj>82</sink_obj>
</item>
<item class_id_reference="20" object_id="_112">
<id>158</id>
<edge_type>1</edge_type>
<source_obj>82</source_obj>
<sink_obj>83</sink_obj>
</item>
<item class_id_reference="20" object_id="_113">
<id>159</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>83</sink_obj>
</item>
<item class_id_reference="20" object_id="_114">
<id>160</id>
<edge_type>1</edge_type>
<source_obj>82</source_obj>
<sink_obj>84</sink_obj>
</item>
<item class_id_reference="20" object_id="_115">
<id>162</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>85</sink_obj>
</item>
<item class_id_reference="20" object_id="_116">
<id>163</id>
<edge_type>1</edge_type>
<source_obj>84</source_obj>
<sink_obj>85</sink_obj>
</item>
<item class_id_reference="20" object_id="_117">
<id>164</id>
<edge_type>1</edge_type>
<source_obj>19</source_obj>
<sink_obj>86</sink_obj>
</item>
<item class_id_reference="20" object_id="_118">
<id>166</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>87</sink_obj>
</item>
<item class_id_reference="20" object_id="_119">
<id>167</id>
<edge_type>1</edge_type>
<source_obj>87</source_obj>
<sink_obj>88</sink_obj>
</item>
<item class_id_reference="20" object_id="_120">
<id>168</id>
<edge_type>1</edge_type>
<source_obj>88</source_obj>
<sink_obj>89</sink_obj>
</item>
<item class_id_reference="20" object_id="_121">
<id>169</id>
<edge_type>1</edge_type>
<source_obj>86</source_obj>
<sink_obj>89</sink_obj>
</item>
<item class_id_reference="20" object_id="_122">
<id>170</id>
<edge_type>1</edge_type>
<source_obj>89</source_obj>
<sink_obj>90</sink_obj>
</item>
<item class_id_reference="20" object_id="_123">
<id>171</id>
<edge_type>1</edge_type>
<source_obj>19</source_obj>
<sink_obj>90</sink_obj>
</item>
<item class_id_reference="20" object_id="_124">
<id>172</id>
<edge_type>1</edge_type>
<source_obj>89</source_obj>
<sink_obj>91</sink_obj>
</item>
<item class_id_reference="20" object_id="_125">
<id>174</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>92</sink_obj>
</item>
<item class_id_reference="20" object_id="_126">
<id>175</id>
<edge_type>1</edge_type>
<source_obj>91</source_obj>
<sink_obj>92</sink_obj>
</item>
<item class_id_reference="20" object_id="_127">
<id>176</id>
<edge_type>1</edge_type>
<source_obj>20</source_obj>
<sink_obj>93</sink_obj>
</item>
<item class_id_reference="20" object_id="_128">
<id>178</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>94</sink_obj>
</item>
<item class_id_reference="20" object_id="_129">
<id>179</id>
<edge_type>1</edge_type>
<source_obj>94</source_obj>
<sink_obj>95</sink_obj>
</item>
<item class_id_reference="20" object_id="_130">
<id>180</id>
<edge_type>1</edge_type>
<source_obj>95</source_obj>
<sink_obj>96</sink_obj>
</item>
<item class_id_reference="20" object_id="_131">
<id>181</id>
<edge_type>1</edge_type>
<source_obj>93</source_obj>
<sink_obj>96</sink_obj>
</item>
<item class_id_reference="20" object_id="_132">
<id>182</id>
<edge_type>1</edge_type>
<source_obj>96</source_obj>
<sink_obj>97</sink_obj>
</item>
<item class_id_reference="20" object_id="_133">
<id>183</id>
<edge_type>1</edge_type>
<source_obj>20</source_obj>
<sink_obj>97</sink_obj>
</item>
<item class_id_reference="20" object_id="_134">
<id>184</id>
<edge_type>1</edge_type>
<source_obj>96</source_obj>
<sink_obj>98</sink_obj>
</item>
<item class_id_reference="20" object_id="_135">
<id>186</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>99</sink_obj>
</item>
<item class_id_reference="20" object_id="_136">
<id>187</id>
<edge_type>1</edge_type>
<source_obj>98</source_obj>
<sink_obj>99</sink_obj>
</item>
<item class_id_reference="20" object_id="_137">
<id>188</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>100</sink_obj>
</item>
<item class_id_reference="20" object_id="_138">
<id>190</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>101</sink_obj>
</item>
<item class_id_reference="20" object_id="_139">
<id>191</id>
<edge_type>1</edge_type>
<source_obj>101</source_obj>
<sink_obj>102</sink_obj>
</item>
<item class_id_reference="20" object_id="_140">
<id>192</id>
<edge_type>1</edge_type>
<source_obj>102</source_obj>
<sink_obj>103</sink_obj>
</item>
<item class_id_reference="20" object_id="_141">
<id>193</id>
<edge_type>1</edge_type>
<source_obj>100</source_obj>
<sink_obj>103</sink_obj>
</item>
<item class_id_reference="20" object_id="_142">
<id>194</id>
<edge_type>1</edge_type>
<source_obj>103</source_obj>
<sink_obj>104</sink_obj>
</item>
<item class_id_reference="20" object_id="_143">
<id>195</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>104</sink_obj>
</item>
<item class_id_reference="20" object_id="_144">
<id>196</id>
<edge_type>1</edge_type>
<source_obj>103</source_obj>
<sink_obj>105</sink_obj>
</item>
<item class_id_reference="20" object_id="_145">
<id>198</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>106</sink_obj>
</item>
<item class_id_reference="20" object_id="_146">
<id>199</id>
<edge_type>1</edge_type>
<source_obj>105</source_obj>
<sink_obj>106</sink_obj>
</item>
<item class_id_reference="20" object_id="_147">
<id>200</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>107</sink_obj>
</item>
<item class_id_reference="20" object_id="_148">
<id>202</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>108</sink_obj>
</item>
<item class_id_reference="20" object_id="_149">
<id>203</id>
<edge_type>1</edge_type>
<source_obj>108</source_obj>
<sink_obj>109</sink_obj>
</item>
<item class_id_reference="20" object_id="_150">
<id>204</id>
<edge_type>1</edge_type>
<source_obj>109</source_obj>
<sink_obj>110</sink_obj>
</item>
<item class_id_reference="20" object_id="_151">
<id>205</id>
<edge_type>1</edge_type>
<source_obj>107</source_obj>
<sink_obj>110</sink_obj>
</item>
<item class_id_reference="20" object_id="_152">
<id>206</id>
<edge_type>1</edge_type>
<source_obj>110</source_obj>
<sink_obj>111</sink_obj>
</item>
<item class_id_reference="20" object_id="_153">
<id>207</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>111</sink_obj>
</item>
<item class_id_reference="20" object_id="_154">
<id>208</id>
<edge_type>1</edge_type>
<source_obj>110</source_obj>
<sink_obj>112</sink_obj>
</item>
<item class_id_reference="20" object_id="_155">
<id>210</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>113</sink_obj>
</item>
<item class_id_reference="20" object_id="_156">
<id>211</id>
<edge_type>1</edge_type>
<source_obj>112</source_obj>
<sink_obj>113</sink_obj>
</item>
<item class_id_reference="20" object_id="_157">
<id>212</id>
<edge_type>1</edge_type>
<source_obj>23</source_obj>
<sink_obj>114</sink_obj>
</item>
<item class_id_reference="20" object_id="_158">
<id>214</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>115</sink_obj>
</item>
<item class_id_reference="20" object_id="_159">
<id>215</id>
<edge_type>1</edge_type>
<source_obj>115</source_obj>
<sink_obj>116</sink_obj>
</item>
<item class_id_reference="20" object_id="_160">
<id>216</id>
<edge_type>1</edge_type>
<source_obj>116</source_obj>
<sink_obj>117</sink_obj>
</item>
<item class_id_reference="20" object_id="_161">
<id>217</id>
<edge_type>1</edge_type>
<source_obj>114</source_obj>
<sink_obj>117</sink_obj>
</item>
<item class_id_reference="20" object_id="_162">
<id>218</id>
<edge_type>1</edge_type>
<source_obj>117</source_obj>
<sink_obj>118</sink_obj>
</item>
<item class_id_reference="20" object_id="_163">
<id>219</id>
<edge_type>1</edge_type>
<source_obj>23</source_obj>
<sink_obj>118</sink_obj>
</item>
<item class_id_reference="20" object_id="_164">
<id>220</id>
<edge_type>1</edge_type>
<source_obj>117</source_obj>
<sink_obj>119</sink_obj>
</item>
<item class_id_reference="20" object_id="_165">
<id>222</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>120</sink_obj>
</item>
<item class_id_reference="20" object_id="_166">
<id>223</id>
<edge_type>1</edge_type>
<source_obj>119</source_obj>
<sink_obj>120</sink_obj>
</item>
<item class_id_reference="20" object_id="_167">
<id>224</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>121</sink_obj>
</item>
<item class_id_reference="20" object_id="_168">
<id>226</id>
<edge_type>1</edge_type>
<source_obj>16</source_obj>
<sink_obj>122</sink_obj>
</item>
<item class_id_reference="20" object_id="_169">
<id>227</id>
<edge_type>1</edge_type>
<source_obj>122</source_obj>
<sink_obj>123</sink_obj>
</item>
<item class_id_reference="20" object_id="_170">
<id>228</id>
<edge_type>1</edge_type>
<source_obj>123</source_obj>
<sink_obj>124</sink_obj>
</item>
<item class_id_reference="20" object_id="_171">
<id>229</id>
<edge_type>1</edge_type>
<source_obj>121</source_obj>
<sink_obj>124</sink_obj>
</item>
<item class_id_reference="20" object_id="_172">
<id>230</id>
<edge_type>1</edge_type>
<source_obj>124</source_obj>
<sink_obj>125</sink_obj>
</item>
<item class_id_reference="20" object_id="_173">
<id>231</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>125</sink_obj>
</item>
<item class_id_reference="20" object_id="_174">
<id>232</id>
<edge_type>1</edge_type>
<source_obj>124</source_obj>
<sink_obj>126</sink_obj>
</item>
<item class_id_reference="20" object_id="_175">
<id>234</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>127</sink_obj>
</item>
<item class_id_reference="20" object_id="_176">
<id>235</id>
<edge_type>1</edge_type>
<source_obj>126</source_obj>
<sink_obj>127</sink_obj>
</item>
<item class_id_reference="20" object_id="_177">
<id>237</id>
<edge_type>1</edge_type>
<source_obj>236</source_obj>
<sink_obj>128</sink_obj>
</item>
<item class_id_reference="20" object_id="_178">
<id>238</id>
<edge_type>1</edge_type>
<source_obj>66</source_obj>
<sink_obj>128</sink_obj>
</item>
<item class_id_reference="20" object_id="_179">
<id>239</id>
<edge_type>1</edge_type>
<source_obj>128</source_obj>
<sink_obj>129</sink_obj>
</item>
<item class_id_reference="20" object_id="_180">
<id>240</id>
<edge_type>1</edge_type>
<source_obj>128</source_obj>
<sink_obj>130</sink_obj>
</item>
<item class_id_reference="20" object_id="_181">
<id>242</id>
<edge_type>1</edge_type>
<source_obj>241</source_obj>
<sink_obj>130</sink_obj>
</item>
<item class_id_reference="20" object_id="_182">
<id>243</id>
<edge_type>1</edge_type>
<source_obj>130</source_obj>
<sink_obj>131</sink_obj>
</item>
<item class_id_reference="20" object_id="_183">
<id>244</id>
<edge_type>2</edge_type>
<source_obj>46</source_obj>
<sink_obj>131</sink_obj>
</item>
<item class_id_reference="20" object_id="_184">
<id>245</id>
<edge_type>2</edge_type>
<source_obj>135</source_obj>
<sink_obj>131</sink_obj>
</item>
<item class_id_reference="20" object_id="_185">
<id>248</id>
<edge_type>2</edge_type>
<source_obj>46</source_obj>
<sink_obj>134</sink_obj>
</item>
<item class_id_reference="20" object_id="_186">
<id>249</id>
<edge_type>2</edge_type>
<source_obj>132</source_obj>
<sink_obj>64</sink_obj>
</item>
<item class_id_reference="20" object_id="_187">
<id>251</id>
<edge_type>1</edge_type>
<source_obj>250</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_188">
<id>252</id>
<edge_type>2</edge_type>
<source_obj>42</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_189">
<id>254</id>
<edge_type>1</edge_type>
<source_obj>253</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_190">
<id>255</id>
<edge_type>2</edge_type>
<source_obj>132</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_191">
<id>256</id>
<edge_type>1</edge_type>
<source_obj>250</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_192">
<id>257</id>
<edge_type>2</edge_type>
<source_obj>135</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_193">
<id>259</id>
<edge_type>1</edge_type>
<source_obj>258</source_obj>
<sink_obj>44</sink_obj>
</item>
<item class_id_reference="20" object_id="_194">
<id>260</id>
<edge_type>2</edge_type>
<source_obj>42</source_obj>
<sink_obj>44</sink_obj>
</item>
<item class_id_reference="20" object_id="_195">
<id>261</id>
<edge_type>1</edge_type>
<source_obj>129</source_obj>
<sink_obj>44</sink_obj>
</item>
<item class_id_reference="20" object_id="_196">
<id>262</id>
<edge_type>2</edge_type>
<source_obj>132</source_obj>
<sink_obj>44</sink_obj>
</item>
<item class_id_reference="20" object_id="_197">
<id>263</id>
<edge_type>1</edge_type>
<source_obj>258</source_obj>
<sink_obj>44</sink_obj>
</item>
<item class_id_reference="20" object_id="_198">
<id>264</id>
<edge_type>2</edge_type>
<source_obj>135</source_obj>
<sink_obj>44</sink_obj>
</item>
<item class_id_reference="20" object_id="_199">
<id>265</id>
<edge_type>1</edge_type>
<source_obj>43</source_obj>
<sink_obj>45</sink_obj>
</item>
<item class_id_reference="20" object_id="_200">
<id>266</id>
<edge_type>2</edge_type>
<source_obj>132</source_obj>
<sink_obj>45</sink_obj>
</item>
<item class_id_reference="20" object_id="_201">
<id>267</id>
<edge_type>2</edge_type>
<source_obj>65</source_obj>
<sink_obj>45</sink_obj>
</item>
<item class_id_reference="20" object_id="_202">
<id>494</id>
<edge_type>2</edge_type>
<source_obj>42</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_203">
<id>495</id>
<edge_type>2</edge_type>
<source_obj>46</source_obj>
<sink_obj>65</sink_obj>
</item>
<item class_id_reference="20" object_id="_204">
<id>496</id>
<edge_type>2</edge_type>
<source_obj>46</source_obj>
<sink_obj>132</sink_obj>
</item>
<item class_id_reference="20" object_id="_205">
<id>497</id>
<edge_type>2</edge_type>
<source_obj>65</source_obj>
<sink_obj>132</sink_obj>
</item>
<item class_id_reference="20" object_id="_206">
<id>498</id>
<edge_type>2</edge_type>
<source_obj>132</source_obj>
<sink_obj>135</sink_obj>
</item>
<item class_id_reference="20" object_id="_207">
<id>499</id>
<edge_type>2</edge_type>
<source_obj>132</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_208">
<id>500</id>
<edge_type>2</edge_type>
<source_obj>135</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_209">
<id>501</id>
<edge_type>4</edge_type>
<source_obj>121</source_obj>
<sink_obj>125</sink_obj>
</item>
<item class_id_reference="20" object_id="_210">
<id>502</id>
<edge_type>4</edge_type>
<source_obj>114</source_obj>
<sink_obj>118</sink_obj>
</item>
<item class_id_reference="20" object_id="_211">
<id>503</id>
<edge_type>4</edge_type>
<source_obj>107</source_obj>
<sink_obj>111</sink_obj>
</item>
<item class_id_reference="20" object_id="_212">
<id>504</id>
<edge_type>4</edge_type>
<source_obj>100</source_obj>
<sink_obj>104</sink_obj>
</item>
<item class_id_reference="20" object_id="_213">
<id>505</id>
<edge_type>4</edge_type>
<source_obj>93</source_obj>
<sink_obj>97</sink_obj>
</item>
<item class_id_reference="20" object_id="_214">
<id>506</id>
<edge_type>4</edge_type>
<source_obj>86</source_obj>
<sink_obj>90</sink_obj>
</item>
<item class_id_reference="20" object_id="_215">
<id>507</id>
<edge_type>4</edge_type>
<source_obj>79</source_obj>
<sink_obj>83</sink_obj>
</item>
<item class_id_reference="20" object_id="_216">
<id>508</id>
<edge_type>4</edge_type>
<source_obj>71</source_obj>
<sink_obj>75</sink_obj>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="21" tracking_level="0" version="0">
<count>3</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="1" version="0" object_id="_217">
<mId>1</mId>
<mTag>axi_interfaces</mTag>
<mType>0</mType>
<sub_regions>
<count>2</count>
<item_version>0</item_version>
<item>2</item>
<item>3</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>4</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_218">
<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>42</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="_219">
<mId>3</mId>
<mTag>For_Loop</mTag>
<mType>1</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>4</count>
<item_version>0</item_version>
<item>46</item>
<item>65</item>
<item>132</item>
<item>135</item>
</basic_blocks>
<mII>1</mII>
<mDepth>1</mDepth>
<mMinTripCount>4</mMinTripCount>
<mMaxTripCount>4</mMaxTripCount>
<mMinLatency>3</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
</cdfg_regions>
<fsm class_id="-1"></fsm>
<res class_id="25" tracking_level="1" version="0" object_id="_220">
<dp_component_resource class_id="26" 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="27" 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="28" tracking_level="0" version="0">
<count>68</count>
<item_version>0</item_version>
<item class_id="29" tracking_level="0" version="0">
<first>41</first>
<second class_id="30" tracking_level="0" version="0">
<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>64</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>66</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>71</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>72</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>73</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>74</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>75</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>76</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>77</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>79</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>80</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>81</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>82</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>83</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>84</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>85</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>86</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>87</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>88</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>89</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>90</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>91</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>92</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>93</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>94</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>95</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>96</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>97</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>98</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>99</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>100</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>101</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>102</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>103</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>104</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>105</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>106</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>107</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>108</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>109</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>110</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>111</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>112</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>113</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>114</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>115</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>116</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>117</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>118</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>119</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>120</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>121</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>122</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>123</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>124</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>125</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>126</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>127</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>128</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>129</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>130</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>131</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>133</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>134</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="31" tracking_level="0" version="0">
<count>5</count>
<item_version>0</item_version>
<item class_id="32" tracking_level="0" version="0">
<first>42</first>
<second class_id="33" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>46</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>65</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>132</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>135</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="34" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="35" tracking_level="1" version="0" object_id="_221">
<region_name>For_Loop</region_name>
<basic_blocks>
<count>4</count>
<item_version>0</item_version>
<item>46</item>
<item>65</item>
<item>132</item>
<item>135</item>
</basic_blocks>
<nodes>
<count>0</count>
<item_version>0</item_version>
</nodes>
<anchor_node>-1</anchor_node>
<region_type>8</region_type>
<interval>1</interval>
<pipe_depth>1</pipe_depth>
</item>
</regions>
<dp_fu_nodes class_id="36" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="37" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</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>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="38" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</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="39" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_port_io_nodes>
<port2core class_id="40" 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>
| 26.931376 | 102 | 0.593234 |
d0257ebacfbe2033530b494e9a79a2669ba95ffa | 825 | ads | Ada | memsim-master/src/memory-trace.ads | strenkml/EE368 | 00f15bce9e65badddc613355643b1061fd4a8195 | [
"MIT"
] | null | null | null | memsim-master/src/memory-trace.ads | strenkml/EE368 | 00f15bce9e65badddc613355643b1061fd4a8195 | [
"MIT"
] | null | null | null | memsim-master/src/memory-trace.ads | strenkml/EE368 | 00f15bce9e65badddc613355643b1061fd4a8195 | [
"MIT"
] | null | null | null |
with Memory.Container; use Memory.Container;
package Memory.Trace is
type Trace_Type is new Container_Type with private;
type Trace_Pointer is access all Trace_Type'Class;
function Create_Trace(mem : Memory_Pointer) return Trace_Pointer;
overriding
function Clone(mem : Trace_Type) return Memory_Pointer;
overriding
procedure Read(mem : in out Trace_Type;
address : in Address_Type;
size : in Positive);
overriding
procedure Write(mem : in out Trace_Type;
address : in Address_Type;
size : in Positive);
overriding
procedure Idle(mem : in out Trace_Type;
cycles : in Time_Type);
private
type Trace_Type is new Container_Type with null record;
end Memory.Trace;
| 24.264706 | 68 | 0.648485 |
dc970b39b069df94fcee6376616c4760ec8d9a1b | 4,278 | ads | Ada | source/oasis/program-elements-function_renaming_declarations.ads | reznikmm/gela | 20134f1d154fb763812e73860c6f4b04f353df79 | [
"MIT"
] | null | null | null | source/oasis/program-elements-function_renaming_declarations.ads | reznikmm/gela | 20134f1d154fb763812e73860c6f4b04f353df79 | [
"MIT"
] | null | null | null | source/oasis/program-elements-function_renaming_declarations.ads | reznikmm/gela | 20134f1d154fb763812e73860c6f4b04f353df79 | [
"MIT"
] | 1 | 2019-10-16T09:05:27.000Z | 2019-10-16T09:05:27.000Z | -- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Elements.Declarations;
with Program.Lexical_Elements;
with Program.Elements.Defining_Names;
with Program.Elements.Parameter_Specifications;
with Program.Elements.Expressions;
with Program.Elements.Aspect_Specifications;
package Program.Elements.Function_Renaming_Declarations is
pragma Pure (Program.Elements.Function_Renaming_Declarations);
type Function_Renaming_Declaration is
limited interface and Program.Elements.Declarations.Declaration;
type Function_Renaming_Declaration_Access is
access all Function_Renaming_Declaration'Class with Storage_Size => 0;
not overriding function Name
(Self : Function_Renaming_Declaration)
return not null Program.Elements.Defining_Names.Defining_Name_Access
is abstract;
not overriding function Parameters
(Self : Function_Renaming_Declaration)
return Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access is abstract;
not overriding function Result_Subtype
(Self : Function_Renaming_Declaration)
return not null Program.Elements.Element_Access is abstract;
not overriding function Renamed_Function
(Self : Function_Renaming_Declaration)
return Program.Elements.Expressions.Expression_Access is abstract;
not overriding function Aspects
(Self : Function_Renaming_Declaration)
return Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access is abstract;
not overriding function Has_Not
(Self : Function_Renaming_Declaration)
return Boolean is abstract;
not overriding function Has_Overriding
(Self : Function_Renaming_Declaration)
return Boolean is abstract;
not overriding function Has_Not_Null
(Self : Function_Renaming_Declaration)
return Boolean is abstract;
type Function_Renaming_Declaration_Text is limited interface;
type Function_Renaming_Declaration_Text_Access is
access all Function_Renaming_Declaration_Text'Class
with Storage_Size => 0;
not overriding function To_Function_Renaming_Declaration_Text
(Self : in out Function_Renaming_Declaration)
return Function_Renaming_Declaration_Text_Access is abstract;
not overriding function Not_Token
(Self : Function_Renaming_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Overriding_Token
(Self : Function_Renaming_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Function_Token
(Self : Function_Renaming_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Left_Bracket_Token
(Self : Function_Renaming_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Right_Bracket_Token
(Self : Function_Renaming_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Return_Token
(Self : Function_Renaming_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Not_Token_2
(Self : Function_Renaming_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Null_Token
(Self : Function_Renaming_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Renames_Token
(Self : Function_Renaming_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function With_Token
(Self : Function_Renaming_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Semicolon_Token
(Self : Function_Renaming_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
end Program.Elements.Function_Renaming_Declarations;
| 36.87931 | 75 | 0.791024 |
cbf6e2a73082d20ed879e87c63931e5e1f3629c5 | 2,892 | ads | Ada | tools-src/gnu/gcc/gcc/ada/s-exnlli.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-exnlli.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-exnlli.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 69 | 2015-01-02T10:45:56.000Z | 2021-09-06T07:52:13.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- S Y S T E M . E X N _ L L I --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992,1993 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. --
-- --
------------------------------------------------------------------------------
-- Long_Long_Integer exponentiation (checks off)
with System.Exn_Gen;
package System.Exn_LLI is
pragma Pure (Exn_LLI);
function Exn_Long_Long_Integer is
new System.Exn_Gen.Exn_Integer_Type (Long_Long_Integer);
end System.Exn_LLI;
| 61.531915 | 78 | 0.423928 |
d00670e59a057be5334efc2585bf7d27ad0edc81 | 13,489 | adb | Ada | awa/plugins/awa-tags/src/awa-tags-modules.adb | My-Colaborations/ada-awa | cc2dee291a14e4df0dbc9c10285bf284a7f1caa8 | [
"Apache-2.0"
] | 81 | 2015-01-18T23:02:30.000Z | 2022-03-19T17:34:57.000Z | awa/plugins/awa-tags/src/awa-tags-modules.adb | My-Colaborations/ada-awa | cc2dee291a14e4df0dbc9c10285bf284a7f1caa8 | [
"Apache-2.0"
] | 20 | 2015-12-09T19:26:19.000Z | 2022-03-23T14:32:43.000Z | awa/plugins/awa-tags/src/awa-tags-modules.adb | My-Colaborations/ada-awa | cc2dee291a14e4df0dbc9c10285bf284a7f1caa8 | [
"Apache-2.0"
] | 16 | 2015-06-29T02:44:06.000Z | 2021-09-23T18:47:50.000Z | -----------------------------------------------------------------------
-- awa-tags-modules -- Module awa-tags
-- Copyright (C) 2013, 2016 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- 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 ADO.Sessions.Entities;
with ADO.Statements;
with ADO.Queries;
with ADO.SQL;
with Security.Permissions;
with AWA.Permissions;
with AWA.Services.Contexts;
with AWA.Modules.Get;
with AWA.Modules.Beans;
with AWA.Users.Models;
with AWA.Tags.Models;
with AWA.Tags.Beans;
with AWA.Tags.Components;
with Util.Log.Loggers;
package body AWA.Tags.Modules is
package ASC renames AWA.Services.Contexts;
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("AWA.Tags.Module");
package Register is new AWA.Modules.Beans (Module => Tag_Module,
Module_Access => Tag_Module_Access);
-- Add a tag on the database entity referenced by <tt>Id</tt> in the table identified
-- by <tt>Entity_Type</tt>.
procedure Add_Tag (Session : in out ADO.Sessions.Master_Session;
Id : in ADO.Identifier;
Entity_Type : in ADO.Entity_Type;
Tag : in String);
-- Remove the tag identified by <tt>Tag</tt> and associated with the database entity
-- referenced by <tt>Id</tt> in the table identified by <tt>Entity_Type</tt>.
procedure Remove_Tag (Session : in out ADO.Sessions.Master_Session;
Id : in ADO.Identifier;
Entity_Type : in ADO.Entity_Type;
Tag : in String);
-- ------------------------------
-- Initialize the tags module.
-- ------------------------------
overriding
procedure Initialize (Plugin : in out Tag_Module;
App : in AWA.Modules.Application_Access;
Props : in ASF.Applications.Config) is
begin
Log.Info ("Initializing the awa-tags module");
App.Add_Components (AWA.Tags.Components.Definition);
-- Register the tag list bean.
Register.Register (Plugin => Plugin,
Name => "AWA.Tags.Beans.Tag_List_Bean",
Handler => AWA.Tags.Beans.Create_Tag_List_Bean'Access);
-- Register the tag search bean.
Register.Register (Plugin => Plugin,
Name => "AWA.Tags.Beans.Tag_Search_Bean",
Handler => AWA.Tags.Beans.Create_Tag_Search_Bean'Access);
-- Register the tag info list bean.
Register.Register (Plugin => Plugin,
Name => "AWA.Tags.Beans.Tag_Info_List_Bean",
Handler => AWA.Tags.Beans.Create_Tag_Info_List_Bean'Access);
AWA.Modules.Module (Plugin).Initialize (App, Props);
-- Add here the creation of manager instances.
end Initialize;
-- ------------------------------
-- Get the tags module.
-- ------------------------------
function Get_Tag_Module return Tag_Module_Access is
function Get is new AWA.Modules.Get (Tag_Module, Tag_Module_Access, NAME);
begin
return Get;
end Get_Tag_Module;
-- ------------------------------
-- Add a tag on the database entity referenced by <tt>Id</tt> in the table identified
-- by <tt>Entity_Type</tt>. The permission represented by <tt>Permission</tt> is checked
-- to make sure the current user can add the tag. If the permission is granted, the
-- tag represented by <tt>Tag</tt> is associated with the said database entity.
-- ------------------------------
procedure Add_Tag (Model : in Tag_Module;
Id : in ADO.Identifier;
Entity_Type : in String;
Permission : in String;
Tag : in String) is
pragma Unreferenced (Model);
Ctx : constant ASC.Service_Context_Access := ASC.Current;
User : constant AWA.Users.Models.User_Ref := Ctx.Get_User;
Ident : constant String := Entity_Type & ADO.Identifier'Image (Id);
DB : ADO.Sessions.Master_Session := AWA.Services.Contexts.Get_Master_Session (Ctx);
Kind : ADO.Entity_Type;
begin
-- Check that the user has the permission on the given object.
AWA.Permissions.Check (Permission => Security.Permissions.Get_Permission_Index (Permission),
Entity => Id);
Log.Info ("User {0} add tag {1} on {2}",
ADO.Identifier'Image (User.Get_Id), Tag, Ident);
Ctx.Start;
Kind := ADO.Sessions.Entities.Find_Entity_Type (DB, Entity_Type);
Add_Tag (DB, Id, Kind, Tag);
Ctx.Commit;
end Add_Tag;
-- ------------------------------
-- Remove the tag identified by <tt>Tag</tt> and associated with the database entity
-- referenced by <tt>Id</tt> in the table identified by <tt>Entity_Type</tt>.
-- The permission represented by <tt>Permission</tt> is checked to make sure the current user
-- can remove the tag.
-- ------------------------------
procedure Remove_Tag (Model : in Tag_Module;
Id : in ADO.Identifier;
Entity_Type : in String;
Permission : in String;
Tag : in String) is
pragma Unreferenced (Model);
Ctx : constant ASC.Service_Context_Access := ASC.Current;
User : constant AWA.Users.Models.User_Ref := Ctx.Get_User;
Ident : constant String := Entity_Type & ADO.Identifier'Image (Id);
DB : ADO.Sessions.Master_Session := AWA.Services.Contexts.Get_Master_Session (Ctx);
Kind : ADO.Entity_Type;
begin
-- Check that the user has the permission on the given object.
AWA.Permissions.Check (Permission => Security.Permissions.Get_Permission_Index (Permission),
Entity => Id);
Log.Info ("User {0} removes tag {1} on {2}",
ADO.Identifier'Image (User.Get_Id), Tag, Ident);
Ctx.Start;
Kind := ADO.Sessions.Entities.Find_Entity_Type (DB, Entity_Type);
Remove_Tag (DB, Id, Kind, Tag);
Ctx.Commit;
end Remove_Tag;
-- ------------------------------
-- Remove the tags defined by the <tt>Deleted</tt> tag list and add the tags defined
-- in the <tt>Added</tt> tag list. The tags are associated with the database entity
-- referenced by <tt>Id</tt> in the table identified by <tt>Entity_Type</tt>.
-- The permission represented by <tt>Permission</tt> is checked to make sure the current user
-- can remove or add the tag.
-- ------------------------------
procedure Update_Tags (Model : in Tag_Module;
Id : in ADO.Identifier;
Entity_Type : in String;
Permission : in String;
Added : in Util.Strings.Vectors.Vector;
Deleted : in Util.Strings.Vectors.Vector) is
pragma Unreferenced (Model);
Ctx : constant ASC.Service_Context_Access := ASC.Current;
User : constant AWA.Users.Models.User_Ref := Ctx.Get_User;
Ident : constant String := Entity_Type & ADO.Identifier'Image (Id);
DB : ADO.Sessions.Master_Session := AWA.Services.Contexts.Get_Master_Session (Ctx);
Kind : ADO.Entity_Type;
Iter : Util.Strings.Vectors.Cursor;
begin
-- Check that the user has the permission on the given object.
AWA.Permissions.Check (Permission => Security.Permissions.Get_Permission_Index (Permission),
Entity => Id);
Ctx.Start;
Kind := ADO.Sessions.Entities.Find_Entity_Type (DB, Entity_Type);
-- Delete the tags that have been removed.
Iter := Deleted.First;
while Util.Strings.Vectors.Has_Element (Iter) loop
declare
Tag : constant String := Util.Strings.Vectors.Element (Iter);
begin
Log.Info ("User {0} removes tag {1} on {2}",
ADO.Identifier'Image (User.Get_Id), Tag, Ident);
Remove_Tag (DB, Id, Kind, Tag);
end;
Util.Strings.Vectors.Next (Iter);
end loop;
-- And add the new ones.
Iter := Added.First;
while Util.Strings.Vectors.Has_Element (Iter) loop
declare
Tag : constant String := Util.Strings.Vectors.Element (Iter);
begin
Log.Info ("User {0} adds tag {1} on {2}",
ADO.Identifier'Image (User.Get_Id), Tag, Ident);
Add_Tag (DB, Id, Kind, Tag);
end;
Util.Strings.Vectors.Next (Iter);
end loop;
Ctx.Commit;
end Update_Tags;
-- ------------------------------
-- Add a tag on the database entity referenced by <tt>Id</tt> in the table identified
-- by <tt>Entity_Type</tt>.
-- ------------------------------
procedure Add_Tag (Session : in out ADO.Sessions.Master_Session;
Id : in ADO.Identifier;
Entity_Type : in ADO.Entity_Type;
Tag : in String) is
Query : ADO.Queries.Context;
Tag_Info : AWA.Tags.Models.Tag_Ref;
Tag_Link : AWA.Tags.Models.Tagged_Entity_Ref;
begin
Query.Set_Query (AWA.Tags.Models.Query_Check_Tag);
declare
Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Query);
begin
-- Build the query.
Stmt.Bind_Param (Name => "entity_type", Value => Entity_Type);
Stmt.Bind_Param (Name => "entity_id", Value => Id);
Stmt.Bind_Param (Name => "tag", Value => Tag);
-- Run the query.
Stmt.Execute;
if not Stmt.Has_Elements then
-- The tag is not defined in the database.
-- Create it and link it to the entity.
Tag_Info.Set_Name (Tag);
Tag_Link.Set_Tag (Tag_Info);
Tag_Link.Set_For_Entity_Id (Id);
Tag_Link.Set_Entity_Type (Entity_Type);
Tag_Info.Save (Session);
Tag_Link.Save (Session);
elsif Stmt.Is_Null (1) then
-- The tag is defined but the entity is not linked with it.
Tag_Info.Set_Id (Stmt.Get_Identifier (0));
Tag_Link.Set_Tag (Tag_Info);
Tag_Link.Set_For_Entity_Id (Id);
Tag_Link.Set_Entity_Type (Entity_Type);
Tag_Link.Save (Session);
end if;
end;
end Add_Tag;
-- ------------------------------
-- Remove the tag identified by <tt>Tag</tt> and associated with the database entity
-- referenced by <tt>Id</tt> in the table identified by <tt>Entity_Type</tt>.
-- ------------------------------
procedure Remove_Tag (Session : in out ADO.Sessions.Master_Session;
Id : in ADO.Identifier;
Entity_Type : in ADO.Entity_Type;
Tag : in String) is
Query : ADO.SQL.Query;
Tag_Link : AWA.Tags.Models.Tagged_Entity_Ref;
Found : Boolean;
begin
Query.Set_Join ("INNER JOIN awa_tag AS tag ON tag.id = o.tag_id");
Query.Set_Filter ("tag.name = :tag AND o.for_entity_id = :entity_id "
& "AND o.entity_type = :entity_type");
-- Build the query.
Query.Bind_Param (Name => "entity_type", Value => Entity_Type);
Query.Bind_Param (Name => "entity_id", Value => Id);
Query.Bind_Param (Name => "tag", Value => Tag);
Tag_Link.Find (Session, Query, Found);
if Found then
Tag_Link.Delete (Session);
end if;
end Remove_Tag;
-- ------------------------------
-- Find the tag identifier associated with the given tag.
-- Return NO_IDENTIFIER if there is no such tag.
-- ------------------------------
procedure Find_Tag_Id (Session : in out ADO.Sessions.Session'Class;
Tag : in String;
Result : out ADO.Identifier) is
begin
if Tag'Length = 0 then
Result := ADO.NO_IDENTIFIER;
else
declare
Query : ADO.SQL.Query;
Found : Boolean;
Tag_Info : AWA.Tags.Models.Tag_Ref;
begin
Query.Set_Filter ("o.name = ?");
Query.Bind_Param (1, Tag);
Tag_Info.Find (Session => Session,
Query => Query,
Found => Found);
if not Found then
Result := ADO.NO_IDENTIFIER;
else
Result := Tag_Info.Get_Id;
end if;
end;
end if;
end Find_Tag_Id;
end AWA.Tags.Modules;
| 41.125 | 98 | 0.559641 |
dc53ec01a8b508bfbab9830e5624bcc6b77e3b9d | 169,454 | adb | Ada | llvm-gcc-4.2-2.9/gcc/ada/sinfo.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/sinfo.adb | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | llvm-gcc-4.2-2.9/gcc/ada/sinfo.adb | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S I N F O --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
pragma Style_Checks (All_Checks);
-- No subprogram ordering check, due to logical grouping
with Atree; use Atree;
package body Sinfo is
use Atree.Unchecked_Access;
-- This package is one of the few packages which is allowed to make direct
-- references to tree nodes (since it is in the business of providing a
-- higher level of tree access which other clients are expected to use and
-- which implements checks).
use Atree_Private_Part;
-- The only reason that we ask for direct access to the private part of
-- the tree package is so that we can directly reference the Nkind field
-- of nodes table entries. We do this since it helps the efficiency of
-- the Sinfo debugging checks considerably (note that when we are checking
-- Nkind values, we don't need to check for a valid node reference, because
-- we will check that anyway when we reference the field).
NT : Nodes.Table_Ptr renames Nodes.Table;
-- A short hand abbreviation, useful for the debugging checks
----------------------------
-- Field Access Functions --
----------------------------
function ABE_Is_Certain
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Package_Declaration
or else NT (N).Nkind = N_Function_Call
or else NT (N).Nkind = N_Function_Instantiation
or else NT (N).Nkind = N_Package_Instantiation
or else NT (N).Nkind = N_Procedure_Call_Statement
or else NT (N).Nkind = N_Procedure_Instantiation);
return Flag18 (N);
end ABE_Is_Certain;
function Abort_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Requeue_Statement);
return Flag15 (N);
end Abort_Present;
function Abortable_Part
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Asynchronous_Select);
return Node2 (N);
end Abortable_Part;
function Abstract_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Formal_Derived_Type_Definition
or else NT (N).Nkind = N_Formal_Private_Type_Definition
or else NT (N).Nkind = N_Private_Extension_Declaration
or else NT (N).Nkind = N_Private_Type_Declaration
or else NT (N).Nkind = N_Record_Definition);
return Flag4 (N);
end Abstract_Present;
function Accept_Handler_Records
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Alternative);
return List5 (N);
end Accept_Handler_Records;
function Accept_Statement
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Alternative);
return Node2 (N);
end Accept_Statement;
function Access_Definition
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Definition
or else NT (N).Nkind = N_Object_Renaming_Declaration);
return Node3 (N);
end Access_Definition;
function Access_To_Subprogram_Definition
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Access_Definition);
return Node3 (N);
end Access_To_Subprogram_Definition;
function Access_Types_To_Process
(N : Node_Id) return Elist_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Freeze_Entity);
return Elist2 (N);
end Access_Types_To_Process;
function Actions
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_And_Then
or else NT (N).Nkind = N_Compilation_Unit_Aux
or else NT (N).Nkind = N_Freeze_Entity
or else NT (N).Nkind = N_Or_Else);
return List1 (N);
end Actions;
function Activation_Chain_Entity
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Block_Statement
or else NT (N).Nkind = N_Entry_Body
or else NT (N).Nkind = N_Generic_Package_Declaration
or else NT (N).Nkind = N_Package_Declaration
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Task_Body);
return Node3 (N);
end Activation_Chain_Entity;
function Acts_As_Spec
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit
or else NT (N).Nkind = N_Subprogram_Body);
return Flag4 (N);
end Acts_As_Spec;
function Actual_Designated_Subtype
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Explicit_Dereference
or else NT (N).Nkind = N_Free_Statement);
return Node2 (N);
end Actual_Designated_Subtype;
function Aggregate_Bounds
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Aggregate);
return Node3 (N);
end Aggregate_Bounds;
function Aliased_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Definition
or else NT (N).Nkind = N_Object_Declaration);
return Flag4 (N);
end Aliased_Present;
function All_Others
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Others_Choice);
return Flag11 (N);
end All_Others;
function All_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Access_Definition
or else NT (N).Nkind = N_Access_To_Object_Definition);
return Flag15 (N);
end All_Present;
function Alternatives
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Case_Statement);
return List4 (N);
end Alternatives;
function Ancestor_Part
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Extension_Aggregate);
return Node3 (N);
end Ancestor_Part;
function Array_Aggregate
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Enumeration_Representation_Clause);
return Node3 (N);
end Array_Aggregate;
function Assignment_OK
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind in N_Subexpr);
return Flag15 (N);
end Assignment_OK;
function Associated_Node
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind in N_Has_Entity
or else NT (N).Nkind = N_Aggregate
or else NT (N).Nkind = N_Extension_Aggregate
or else NT (N).Nkind = N_Selected_Component);
return Node4 (N);
end Associated_Node;
function At_End_Proc
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Handled_Sequence_Of_Statements);
return Node1 (N);
end At_End_Proc;
function Attribute_Name
(N : Node_Id) return Name_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Attribute_Reference);
return Name2 (N);
end Attribute_Name;
function Aux_Decls_Node
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit);
return Node5 (N);
end Aux_Decls_Node;
function Backwards_OK
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Assignment_Statement);
return Flag6 (N);
end Backwards_OK;
function Bad_Is_Detected
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subprogram_Body);
return Flag15 (N);
end Bad_Is_Detected;
function Body_Required
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit);
return Flag13 (N);
end Body_Required;
function Body_To_Inline
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subprogram_Declaration);
return Node3 (N);
end Body_To_Inline;
function Box_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Association
or else NT (N).Nkind = N_Formal_Abstract_Subprogram_Declaration
or else NT (N).Nkind = N_Formal_Concrete_Subprogram_Declaration
or else NT (N).Nkind = N_Formal_Package_Declaration);
return Flag15 (N);
end Box_Present;
function By_Ref
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Return_Statement);
return Flag5 (N);
end By_Ref;
function Char_Literal_Value
(N : Node_Id) return Uint is
begin
pragma Assert (False
or else NT (N).Nkind = N_Character_Literal);
return Uint2 (N);
end Char_Literal_Value;
function Chars
(N : Node_Id) return Name_Id is
begin
pragma Assert (False
or else NT (N).Nkind in N_Has_Chars);
return Name1 (N);
end Chars;
function Check_Address_Alignment
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Attribute_Definition_Clause);
return Flag11 (N);
end Check_Address_Alignment;
function Choice_Parameter
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Exception_Handler);
return Node2 (N);
end Choice_Parameter;
function Choices
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Association);
return List1 (N);
end Choices;
function Compile_Time_Known_Aggregate
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Aggregate);
return Flag18 (N);
end Compile_Time_Known_Aggregate;
function Component_Associations
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Aggregate
or else NT (N).Nkind = N_Extension_Aggregate);
return List2 (N);
end Component_Associations;
function Component_Clauses
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Record_Representation_Clause);
return List3 (N);
end Component_Clauses;
function Component_Definition
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Declaration
or else NT (N).Nkind = N_Constrained_Array_Definition
or else NT (N).Nkind = N_Unconstrained_Array_Definition);
return Node4 (N);
end Component_Definition;
function Component_Items
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_List);
return List3 (N);
end Component_Items;
function Component_List
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Record_Definition
or else NT (N).Nkind = N_Variant);
return Node1 (N);
end Component_List;
function Component_Name
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Clause);
return Node1 (N);
end Component_Name;
function Condition
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Alternative
or else NT (N).Nkind = N_Delay_Alternative
or else NT (N).Nkind = N_Elsif_Part
or else NT (N).Nkind = N_Entry_Body_Formal_Part
or else NT (N).Nkind = N_Exit_Statement
or else NT (N).Nkind = N_If_Statement
or else NT (N).Nkind = N_Iteration_Scheme
or else NT (N).Nkind = N_Raise_Constraint_Error
or else NT (N).Nkind = N_Raise_Program_Error
or else NT (N).Nkind = N_Raise_Storage_Error
or else NT (N).Nkind = N_Terminate_Alternative);
return Node1 (N);
end Condition;
function Condition_Actions
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Elsif_Part
or else NT (N).Nkind = N_Iteration_Scheme);
return List3 (N);
end Condition_Actions;
function Config_Pragmas
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit_Aux);
return List4 (N);
end Config_Pragmas;
function Constant_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Access_Definition
or else NT (N).Nkind = N_Access_To_Object_Definition
or else NT (N).Nkind = N_Object_Declaration);
return Flag17 (N);
end Constant_Present;
function Constraint
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subtype_Indication);
return Node3 (N);
end Constraint;
function Constraints
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Index_Or_Discriminant_Constraint);
return List1 (N);
end Constraints;
function Context_Installed
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
return Flag13 (N);
end Context_Installed;
function Context_Items
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit);
return List1 (N);
end Context_Items;
function Controlling_Argument
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Call
or else NT (N).Nkind = N_Procedure_Call_Statement);
return Node1 (N);
end Controlling_Argument;
function Conversion_OK
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Type_Conversion);
return Flag14 (N);
end Conversion_OK;
function Corresponding_Body
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Declaration
or else NT (N).Nkind = N_Generic_Package_Declaration
or else NT (N).Nkind = N_Generic_Subprogram_Declaration
or else NT (N).Nkind = N_Package_Body_Stub
or else NT (N).Nkind = N_Package_Declaration
or else NT (N).Nkind = N_Protected_Body_Stub
or else NT (N).Nkind = N_Protected_Type_Declaration
or else NT (N).Nkind = N_Subprogram_Body_Stub
or else NT (N).Nkind = N_Subprogram_Declaration
or else NT (N).Nkind = N_Task_Body_Stub
or else NT (N).Nkind = N_Task_Type_Declaration);
return Node5 (N);
end Corresponding_Body;
function Corresponding_Formal_Spec
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subprogram_Renaming_Declaration);
return Node3 (N);
end Corresponding_Formal_Spec;
function Corresponding_Generic_Association
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind = N_Object_Renaming_Declaration);
return Node5 (N);
end Corresponding_Generic_Association;
function Corresponding_Integer_Value
(N : Node_Id) return Uint is
begin
pragma Assert (False
or else NT (N).Nkind = N_Real_Literal);
return Uint4 (N);
end Corresponding_Integer_Value;
function Corresponding_Spec
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Package_Body
or else NT (N).Nkind = N_Protected_Body
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Subprogram_Renaming_Declaration
or else NT (N).Nkind = N_Task_Body
or else NT (N).Nkind = N_With_Clause);
return Node5 (N);
end Corresponding_Spec;
function Corresponding_Stub
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subunit);
return Node3 (N);
end Corresponding_Stub;
function Dcheck_Function
(N : Node_Id) return Entity_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Variant);
return Node5 (N);
end Dcheck_Function;
function Debug_Statement
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Pragma);
return Node3 (N);
end Debug_Statement;
function Declarations
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Statement
or else NT (N).Nkind = N_Block_Statement
or else NT (N).Nkind = N_Compilation_Unit_Aux
or else NT (N).Nkind = N_Entry_Body
or else NT (N).Nkind = N_Package_Body
or else NT (N).Nkind = N_Protected_Body
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Task_Body);
return List2 (N);
end Declarations;
function Default_Expression
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Parameter_Specification);
return Node5 (N);
end Default_Expression;
function Default_Name
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Abstract_Subprogram_Declaration
or else NT (N).Nkind = N_Formal_Concrete_Subprogram_Declaration);
return Node2 (N);
end Default_Name;
function Defining_Identifier
(N : Node_Id) return Entity_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Declaration
or else NT (N).Nkind = N_Defining_Program_Unit_Name
or else NT (N).Nkind = N_Discriminant_Specification
or else NT (N).Nkind = N_Entry_Body
or else NT (N).Nkind = N_Entry_Declaration
or else NT (N).Nkind = N_Entry_Index_Specification
or else NT (N).Nkind = N_Exception_Declaration
or else NT (N).Nkind = N_Exception_Renaming_Declaration
or else NT (N).Nkind = N_Formal_Object_Declaration
or else NT (N).Nkind = N_Formal_Package_Declaration
or else NT (N).Nkind = N_Formal_Type_Declaration
or else NT (N).Nkind = N_Full_Type_Declaration
or else NT (N).Nkind = N_Implicit_Label_Declaration
or else NT (N).Nkind = N_Incomplete_Type_Declaration
or else NT (N).Nkind = N_Loop_Parameter_Specification
or else NT (N).Nkind = N_Number_Declaration
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind = N_Object_Renaming_Declaration
or else NT (N).Nkind = N_Package_Body_Stub
or else NT (N).Nkind = N_Parameter_Specification
or else NT (N).Nkind = N_Private_Extension_Declaration
or else NT (N).Nkind = N_Private_Type_Declaration
or else NT (N).Nkind = N_Protected_Body
or else NT (N).Nkind = N_Protected_Body_Stub
or else NT (N).Nkind = N_Protected_Type_Declaration
or else NT (N).Nkind = N_Single_Protected_Declaration
or else NT (N).Nkind = N_Single_Task_Declaration
or else NT (N).Nkind = N_Subtype_Declaration
or else NT (N).Nkind = N_Task_Body
or else NT (N).Nkind = N_Task_Body_Stub
or else NT (N).Nkind = N_Task_Type_Declaration);
return Node1 (N);
end Defining_Identifier;
function Defining_Unit_Name
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Instantiation
or else NT (N).Nkind = N_Function_Specification
or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration
or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration
or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration
or else NT (N).Nkind = N_Package_Body
or else NT (N).Nkind = N_Package_Instantiation
or else NT (N).Nkind = N_Package_Renaming_Declaration
or else NT (N).Nkind = N_Package_Specification
or else NT (N).Nkind = N_Procedure_Instantiation
or else NT (N).Nkind = N_Procedure_Specification);
return Node1 (N);
end Defining_Unit_Name;
function Delay_Alternative
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Timed_Entry_Call);
return Node4 (N);
end Delay_Alternative;
function Delay_Finalize_Attach
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Object_Declaration);
return Flag14 (N);
end Delay_Finalize_Attach;
function Delay_Statement
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Delay_Alternative);
return Node2 (N);
end Delay_Statement;
function Delta_Expression
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition
or else NT (N).Nkind = N_Delta_Constraint
or else NT (N).Nkind = N_Ordinary_Fixed_Point_Definition);
return Node3 (N);
end Delta_Expression;
function Digits_Expression
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition
or else NT (N).Nkind = N_Digits_Constraint
or else NT (N).Nkind = N_Floating_Point_Definition);
return Node2 (N);
end Digits_Expression;
function Discr_Check_Funcs_Built
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Full_Type_Declaration);
return Flag11 (N);
end Discr_Check_Funcs_Built;
function Discrete_Choices
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Case_Statement_Alternative
or else NT (N).Nkind = N_Variant);
return List4 (N);
end Discrete_Choices;
function Discrete_Range
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Slice);
return Node4 (N);
end Discrete_Range;
function Discrete_Subtype_Definition
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Declaration
or else NT (N).Nkind = N_Entry_Index_Specification
or else NT (N).Nkind = N_Loop_Parameter_Specification);
return Node4 (N);
end Discrete_Subtype_Definition;
function Discrete_Subtype_Definitions
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Constrained_Array_Definition);
return List2 (N);
end Discrete_Subtype_Definitions;
function Discriminant_Specifications
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Type_Declaration
or else NT (N).Nkind = N_Full_Type_Declaration
or else NT (N).Nkind = N_Incomplete_Type_Declaration
or else NT (N).Nkind = N_Private_Extension_Declaration
or else NT (N).Nkind = N_Private_Type_Declaration
or else NT (N).Nkind = N_Protected_Type_Declaration
or else NT (N).Nkind = N_Task_Type_Declaration);
return List4 (N);
end Discriminant_Specifications;
function Discriminant_Type
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Discriminant_Specification);
return Node5 (N);
end Discriminant_Type;
function Do_Accessibility_Check
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Parameter_Specification);
return Flag13 (N);
end Do_Accessibility_Check;
function Do_Discriminant_Check
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Selected_Component);
return Flag13 (N);
end Do_Discriminant_Check;
function Do_Division_Check
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Op_Divide
or else NT (N).Nkind = N_Op_Mod
or else NT (N).Nkind = N_Op_Rem);
return Flag13 (N);
end Do_Division_Check;
function Do_Length_Check
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Assignment_Statement
or else NT (N).Nkind = N_Op_And
or else NT (N).Nkind = N_Op_Or
or else NT (N).Nkind = N_Op_Xor
or else NT (N).Nkind = N_Type_Conversion);
return Flag4 (N);
end Do_Length_Check;
function Do_Overflow_Check
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind in N_Op
or else NT (N).Nkind = N_Attribute_Reference
or else NT (N).Nkind = N_Type_Conversion);
return Flag17 (N);
end Do_Overflow_Check;
function Do_Range_Check
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind in N_Subexpr);
return Flag9 (N);
end Do_Range_Check;
function Do_Storage_Check
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Allocator
or else NT (N).Nkind = N_Subprogram_Body);
return Flag17 (N);
end Do_Storage_Check;
function Do_Tag_Check
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Assignment_Statement
or else NT (N).Nkind = N_Function_Call
or else NT (N).Nkind = N_Procedure_Call_Statement
or else NT (N).Nkind = N_Return_Statement
or else NT (N).Nkind = N_Type_Conversion);
return Flag13 (N);
end Do_Tag_Check;
function Elaborate_All_Desirable
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
return Flag9 (N);
end Elaborate_All_Desirable;
function Elaborate_All_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
return Flag14 (N);
end Elaborate_All_Present;
function Elaborate_Desirable
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
return Flag11 (N);
end Elaborate_Desirable;
function Elaborate_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
return Flag4 (N);
end Elaborate_Present;
function Elaboration_Boolean
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Specification
or else NT (N).Nkind = N_Procedure_Specification);
return Node2 (N);
end Elaboration_Boolean;
function Else_Actions
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Conditional_Expression);
return List3 (N);
end Else_Actions;
function Else_Statements
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Conditional_Entry_Call
or else NT (N).Nkind = N_If_Statement
or else NT (N).Nkind = N_Selective_Accept);
return List4 (N);
end Else_Statements;
function Elsif_Parts
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_If_Statement);
return List3 (N);
end Elsif_Parts;
function Enclosing_Variant
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Variant);
return Node2 (N);
end Enclosing_Variant;
function End_Label
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Enumeration_Type_Definition
or else NT (N).Nkind = N_Handled_Sequence_Of_Statements
or else NT (N).Nkind = N_Loop_Statement
or else NT (N).Nkind = N_Package_Specification
or else NT (N).Nkind = N_Protected_Body
or else NT (N).Nkind = N_Protected_Definition
or else NT (N).Nkind = N_Record_Definition
or else NT (N).Nkind = N_Task_Definition);
return Node4 (N);
end End_Label;
function End_Span
(N : Node_Id) return Uint is
begin
pragma Assert (False
or else NT (N).Nkind = N_Case_Statement
or else NT (N).Nkind = N_If_Statement);
return Uint5 (N);
end End_Span;
function Entity
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind in N_Has_Entity
or else NT (N).Nkind = N_Freeze_Entity);
return Node4 (N);
end Entity;
function Entity_Or_Associated_Node
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind in N_Has_Entity
or else NT (N).Nkind = N_Freeze_Entity);
return Node4 (N);
end Entity_Or_Associated_Node;
function Entry_Body_Formal_Part
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Body);
return Node5 (N);
end Entry_Body_Formal_Part;
function Entry_Call_Alternative
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Conditional_Entry_Call
or else NT (N).Nkind = N_Timed_Entry_Call);
return Node1 (N);
end Entry_Call_Alternative;
function Entry_Call_Statement
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Call_Alternative);
return Node1 (N);
end Entry_Call_Statement;
function Entry_Direct_Name
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Statement);
return Node1 (N);
end Entry_Direct_Name;
function Entry_Index
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Statement);
return Node5 (N);
end Entry_Index;
function Entry_Index_Specification
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Body_Formal_Part);
return Node4 (N);
end Entry_Index_Specification;
function Etype
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind in N_Has_Etype);
return Node5 (N);
end Etype;
function Exception_Choices
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Exception_Handler);
return List4 (N);
end Exception_Choices;
function Exception_Handlers
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Handled_Sequence_Of_Statements);
return List5 (N);
end Exception_Handlers;
function Exception_Junk
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Goto_Statement
or else NT (N).Nkind = N_Label
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind = N_Subtype_Declaration);
return Flag7 (N);
end Exception_Junk;
function Expansion_Delayed
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Aggregate
or else NT (N).Nkind = N_Extension_Aggregate);
return Flag11 (N);
end Expansion_Delayed;
function Explicit_Actual_Parameter
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Parameter_Association);
return Node3 (N);
end Explicit_Actual_Parameter;
function Explicit_Generic_Actual_Parameter
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Generic_Association);
return Node1 (N);
end Explicit_Generic_Actual_Parameter;
function Expression
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Allocator
or else NT (N).Nkind = N_Assignment_Statement
or else NT (N).Nkind = N_At_Clause
or else NT (N).Nkind = N_Attribute_Definition_Clause
or else NT (N).Nkind = N_Case_Statement
or else NT (N).Nkind = N_Code_Statement
or else NT (N).Nkind = N_Component_Association
or else NT (N).Nkind = N_Component_Declaration
or else NT (N).Nkind = N_Delay_Relative_Statement
or else NT (N).Nkind = N_Delay_Until_Statement
or else NT (N).Nkind = N_Discriminant_Association
or else NT (N).Nkind = N_Discriminant_Specification
or else NT (N).Nkind = N_Exception_Declaration
or else NT (N).Nkind = N_Formal_Object_Declaration
or else NT (N).Nkind = N_Free_Statement
or else NT (N).Nkind = N_Mod_Clause
or else NT (N).Nkind = N_Modular_Type_Definition
or else NT (N).Nkind = N_Number_Declaration
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind = N_Parameter_Specification
or else NT (N).Nkind = N_Pragma_Argument_Association
or else NT (N).Nkind = N_Qualified_Expression
or else NT (N).Nkind = N_Raise_Statement
or else NT (N).Nkind = N_Return_Statement
or else NT (N).Nkind = N_Type_Conversion
or else NT (N).Nkind = N_Unchecked_Expression
or else NT (N).Nkind = N_Unchecked_Type_Conversion);
return Node3 (N);
end Expression;
function Expressions
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Aggregate
or else NT (N).Nkind = N_Attribute_Reference
or else NT (N).Nkind = N_Conditional_Expression
or else NT (N).Nkind = N_Extension_Aggregate
or else NT (N).Nkind = N_Indexed_Component);
return List1 (N);
end Expressions;
function First_Bit
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Clause);
return Node3 (N);
end First_Bit;
function First_Inlined_Subprogram
(N : Node_Id) return Entity_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit);
return Node3 (N);
end First_Inlined_Subprogram;
function First_Name
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
return Flag5 (N);
end First_Name;
function First_Named_Actual
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Call_Statement
or else NT (N).Nkind = N_Function_Call
or else NT (N).Nkind = N_Procedure_Call_Statement);
return Node4 (N);
end First_Named_Actual;
function First_Real_Statement
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Handled_Sequence_Of_Statements);
return Node2 (N);
end First_Real_Statement;
function First_Subtype_Link
(N : Node_Id) return Entity_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Freeze_Entity);
return Node5 (N);
end First_Subtype_Link;
function Float_Truncate
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Type_Conversion);
return Flag11 (N);
end Float_Truncate;
function Formal_Type_Definition
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Type_Declaration);
return Node3 (N);
end Formal_Type_Definition;
function Forwards_OK
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Assignment_Statement);
return Flag5 (N);
end Forwards_OK;
function From_At_Mod
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Attribute_Definition_Clause);
return Flag4 (N);
end From_At_Mod;
function From_Default
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subprogram_Renaming_Declaration);
return Flag6 (N);
end From_Default;
function Generic_Associations
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Package_Declaration
or else NT (N).Nkind = N_Function_Instantiation
or else NT (N).Nkind = N_Package_Instantiation
or else NT (N).Nkind = N_Procedure_Instantiation);
return List3 (N);
end Generic_Associations;
function Generic_Formal_Declarations
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Generic_Package_Declaration
or else NT (N).Nkind = N_Generic_Subprogram_Declaration);
return List2 (N);
end Generic_Formal_Declarations;
function Generic_Parent
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Specification
or else NT (N).Nkind = N_Package_Specification
or else NT (N).Nkind = N_Procedure_Specification);
return Node5 (N);
end Generic_Parent;
function Generic_Parent_Type
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subtype_Declaration);
return Node4 (N);
end Generic_Parent_Type;
function Handled_Statement_Sequence
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Statement
or else NT (N).Nkind = N_Block_Statement
or else NT (N).Nkind = N_Entry_Body
or else NT (N).Nkind = N_Package_Body
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Task_Body);
return Node4 (N);
end Handled_Statement_Sequence;
function Handler_List_Entry
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Object_Declaration);
return Node2 (N);
end Handler_List_Entry;
function Has_Created_Identifier
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Block_Statement
or else NT (N).Nkind = N_Loop_Statement);
return Flag15 (N);
end Has_Created_Identifier;
function Has_Dynamic_Length_Check
(N : Node_Id) return Boolean is
begin
return Flag10 (N);
end Has_Dynamic_Length_Check;
function Has_Dynamic_Range_Check
(N : Node_Id) return Boolean is
begin
return Flag12 (N);
end Has_Dynamic_Range_Check;
function Has_No_Elaboration_Code
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit);
return Flag17 (N);
end Has_No_Elaboration_Code;
function Has_Priority_Pragma
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Protected_Definition
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Task_Definition);
return Flag6 (N);
end Has_Priority_Pragma;
function Has_Private_View
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind in N_Op
or else NT (N).Nkind = N_Character_Literal
or else NT (N).Nkind = N_Expanded_Name
or else NT (N).Nkind = N_Identifier
or else NT (N).Nkind = N_Operator_Symbol);
return Flag11 (N);
end Has_Private_View;
function Has_Storage_Size_Pragma
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Task_Definition);
return Flag5 (N);
end Has_Storage_Size_Pragma;
function Has_Task_Info_Pragma
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Task_Definition);
return Flag7 (N);
end Has_Task_Info_Pragma;
function Has_Task_Name_Pragma
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Task_Definition);
return Flag8 (N);
end Has_Task_Name_Pragma;
function Has_Wide_Character
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_String_Literal);
return Flag11 (N);
end Has_Wide_Character;
function Hidden_By_Use_Clause
(N : Node_Id) return Elist_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Use_Package_Clause
or else NT (N).Nkind = N_Use_Type_Clause);
return Elist4 (N);
end Hidden_By_Use_Clause;
function High_Bound
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Range
or else NT (N).Nkind = N_Real_Range_Specification
or else NT (N).Nkind = N_Signed_Integer_Type_Definition);
return Node2 (N);
end High_Bound;
function Identifier
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_At_Clause
or else NT (N).Nkind = N_Block_Statement
or else NT (N).Nkind = N_Designator
or else NT (N).Nkind = N_Enumeration_Representation_Clause
or else NT (N).Nkind = N_Label
or else NT (N).Nkind = N_Loop_Statement
or else NT (N).Nkind = N_Record_Representation_Clause
or else NT (N).Nkind = N_Subprogram_Info);
return Node1 (N);
end Identifier;
function Implicit_With
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
return Flag16 (N);
end Implicit_With;
function Interface_List
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Formal_Derived_Type_Definition
or else NT (N).Nkind = N_Private_Extension_Declaration
or else NT (N).Nkind = N_Protected_Type_Declaration
or else NT (N).Nkind = N_Record_Definition
or else NT (N).Nkind = N_Single_Protected_Declaration
or else NT (N).Nkind = N_Single_Task_Declaration
or else NT (N).Nkind = N_Task_Type_Declaration);
return List2 (N);
end Interface_List;
function Interface_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Record_Definition);
return Flag16 (N);
end Interface_Present;
function In_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Object_Declaration
or else NT (N).Nkind = N_Parameter_Specification);
return Flag15 (N);
end In_Present;
function Includes_Infinities
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Range);
return Flag11 (N);
end Includes_Infinities;
function Instance_Spec
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Package_Declaration
or else NT (N).Nkind = N_Function_Instantiation
or else NT (N).Nkind = N_Package_Instantiation
or else NT (N).Nkind = N_Procedure_Instantiation);
return Node5 (N);
end Instance_Spec;
function Intval
(N : Node_Id) return Uint is
begin
pragma Assert (False
or else NT (N).Nkind = N_Integer_Literal);
return Uint3 (N);
end Intval;
function Is_Asynchronous_Call_Block
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Block_Statement);
return Flag7 (N);
end Is_Asynchronous_Call_Block;
function Is_Component_Left_Opnd
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Op_Concat);
return Flag13 (N);
end Is_Component_Left_Opnd;
function Is_Component_Right_Opnd
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Op_Concat);
return Flag14 (N);
end Is_Component_Right_Opnd;
function Is_Controlling_Actual
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind in N_Subexpr);
return Flag16 (N);
end Is_Controlling_Actual;
function Is_In_Discriminant_Check
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Selected_Component);
return Flag11 (N);
end Is_In_Discriminant_Check;
function Is_Machine_Number
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Real_Literal);
return Flag11 (N);
end Is_Machine_Number;
function Is_Null_Loop
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Loop_Statement);
return Flag16 (N);
end Is_Null_Loop;
function Is_Overloaded
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind in N_Subexpr);
return Flag5 (N);
end Is_Overloaded;
function Is_Power_Of_2_For_Shift
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Op_Expon);
return Flag13 (N);
end Is_Power_Of_2_For_Shift;
function Is_Protected_Subprogram_Body
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subprogram_Body);
return Flag7 (N);
end Is_Protected_Subprogram_Body;
function Is_Static_Expression
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind in N_Subexpr);
return Flag6 (N);
end Is_Static_Expression;
function Is_Subprogram_Descriptor
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Object_Declaration);
return Flag16 (N);
end Is_Subprogram_Descriptor;
function Is_Task_Allocation_Block
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Block_Statement);
return Flag6 (N);
end Is_Task_Allocation_Block;
function Is_Task_Master
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Block_Statement
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Task_Body);
return Flag5 (N);
end Is_Task_Master;
function Iteration_Scheme
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Loop_Statement);
return Node2 (N);
end Iteration_Scheme;
function Itype
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Itype_Reference);
return Node1 (N);
end Itype;
function Kill_Range_Check
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Unchecked_Type_Conversion);
return Flag11 (N);
end Kill_Range_Check;
function Label_Construct
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Implicit_Label_Declaration);
return Node2 (N);
end Label_Construct;
function Last_Bit
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Clause);
return Node4 (N);
end Last_Bit;
function Last_Name
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
return Flag6 (N);
end Last_Name;
function Left_Opnd
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_And_Then
or else NT (N).Nkind = N_In
or else NT (N).Nkind = N_Not_In
or else NT (N).Nkind = N_Or_Else
or else NT (N).Nkind in N_Binary_Op);
return Node2 (N);
end Left_Opnd;
function Library_Unit
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit
or else NT (N).Nkind = N_Package_Body_Stub
or else NT (N).Nkind = N_Protected_Body_Stub
or else NT (N).Nkind = N_Subprogram_Body_Stub
or else NT (N).Nkind = N_Task_Body_Stub
or else NT (N).Nkind = N_With_Clause);
return Node4 (N);
end Library_Unit;
function Limited_View_Installed
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Package_Specification
or else NT (N).Nkind = N_With_Clause);
return Flag18 (N);
end Limited_View_Installed;
function Limited_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Formal_Derived_Type_Definition
or else NT (N).Nkind = N_Formal_Private_Type_Definition
or else NT (N).Nkind = N_Private_Extension_Declaration
or else NT (N).Nkind = N_Private_Type_Declaration
or else NT (N).Nkind = N_Record_Definition
or else NT (N).Nkind = N_With_Clause);
return Flag17 (N);
end Limited_Present;
function Literals
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Enumeration_Type_Definition);
return List1 (N);
end Literals;
function Loop_Actions
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Association);
return List2 (N);
end Loop_Actions;
function Loop_Parameter_Specification
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Iteration_Scheme);
return Node4 (N);
end Loop_Parameter_Specification;
function Low_Bound
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Range
or else NT (N).Nkind = N_Real_Range_Specification
or else NT (N).Nkind = N_Signed_Integer_Type_Definition);
return Node1 (N);
end Low_Bound;
function Mod_Clause
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Record_Representation_Clause);
return Node2 (N);
end Mod_Clause;
function More_Ids
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Declaration
or else NT (N).Nkind = N_Discriminant_Specification
or else NT (N).Nkind = N_Exception_Declaration
or else NT (N).Nkind = N_Formal_Object_Declaration
or else NT (N).Nkind = N_Number_Declaration
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind = N_Parameter_Specification);
return Flag5 (N);
end More_Ids;
function Must_Be_Byte_Aligned
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Attribute_Reference);
return Flag14 (N);
end Must_Be_Byte_Aligned;
function Must_Not_Freeze
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subtype_Indication
or else NT (N).Nkind in N_Subexpr);
return Flag8 (N);
end Must_Not_Freeze;
function Must_Not_Override
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Declaration
or else NT (N).Nkind = N_Function_Instantiation
or else NT (N).Nkind = N_Function_Specification
or else NT (N).Nkind = N_Procedure_Instantiation
or else NT (N).Nkind = N_Procedure_Specification);
return Flag15 (N);
end Must_Not_Override;
function Must_Override
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Declaration
or else NT (N).Nkind = N_Function_Instantiation
or else NT (N).Nkind = N_Function_Specification
or else NT (N).Nkind = N_Procedure_Instantiation
or else NT (N).Nkind = N_Procedure_Specification);
return Flag14 (N);
end Must_Override;
function Name
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Assignment_Statement
or else NT (N).Nkind = N_Attribute_Definition_Clause
or else NT (N).Nkind = N_Defining_Program_Unit_Name
or else NT (N).Nkind = N_Designator
or else NT (N).Nkind = N_Entry_Call_Statement
or else NT (N).Nkind = N_Exception_Renaming_Declaration
or else NT (N).Nkind = N_Exit_Statement
or else NT (N).Nkind = N_Formal_Package_Declaration
or else NT (N).Nkind = N_Function_Call
or else NT (N).Nkind = N_Function_Instantiation
or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration
or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration
or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration
or else NT (N).Nkind = N_Goto_Statement
or else NT (N).Nkind = N_Object_Renaming_Declaration
or else NT (N).Nkind = N_Package_Instantiation
or else NT (N).Nkind = N_Package_Renaming_Declaration
or else NT (N).Nkind = N_Procedure_Call_Statement
or else NT (N).Nkind = N_Procedure_Instantiation
or else NT (N).Nkind = N_Raise_Statement
or else NT (N).Nkind = N_Requeue_Statement
or else NT (N).Nkind = N_Subprogram_Renaming_Declaration
or else NT (N).Nkind = N_Subunit
or else NT (N).Nkind = N_Variant_Part
or else NT (N).Nkind = N_With_Clause
or else NT (N).Nkind = N_With_Type_Clause);
return Node2 (N);
end Name;
function Names
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Abort_Statement
or else NT (N).Nkind = N_Use_Package_Clause);
return List2 (N);
end Names;
function Next_Entity
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Defining_Character_Literal
or else NT (N).Nkind = N_Defining_Identifier
or else NT (N).Nkind = N_Defining_Operator_Symbol);
return Node2 (N);
end Next_Entity;
function Next_Named_Actual
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Parameter_Association);
return Node4 (N);
end Next_Named_Actual;
function Next_Rep_Item
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Attribute_Definition_Clause
or else NT (N).Nkind = N_Enumeration_Representation_Clause
or else NT (N).Nkind = N_Pragma
or else NT (N).Nkind = N_Record_Representation_Clause);
return Node4 (N);
end Next_Rep_Item;
function Next_Use_Clause
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Use_Package_Clause
or else NT (N).Nkind = N_Use_Type_Clause);
return Node3 (N);
end Next_Use_Clause;
function No_Ctrl_Actions
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Assignment_Statement);
return Flag7 (N);
end No_Ctrl_Actions;
function No_Elaboration_Check
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Call
or else NT (N).Nkind = N_Procedure_Call_Statement);
return Flag14 (N);
end No_Elaboration_Check;
function No_Entities_Ref_In_Spec
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
return Flag8 (N);
end No_Entities_Ref_In_Spec;
function No_Initialization
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Allocator
or else NT (N).Nkind = N_Object_Declaration);
return Flag13 (N);
end No_Initialization;
function No_Truncation
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Unchecked_Type_Conversion);
return Flag17 (N);
end No_Truncation;
function Null_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_List
or else NT (N).Nkind = N_Procedure_Specification
or else NT (N).Nkind = N_Record_Definition);
return Flag13 (N);
end Null_Present;
function Null_Exclusion_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Access_Definition
or else NT (N).Nkind = N_Access_Function_Definition
or else NT (N).Nkind = N_Access_Procedure_Definition
or else NT (N).Nkind = N_Access_To_Object_Definition
or else NT (N).Nkind = N_Allocator
or else NT (N).Nkind = N_Component_Definition
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Discriminant_Specification
or else NT (N).Nkind = N_Function_Specification
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind = N_Parameter_Specification
or else NT (N).Nkind = N_Subtype_Declaration);
return Flag11 (N);
end Null_Exclusion_Present;
function Null_Record_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Aggregate
or else NT (N).Nkind = N_Extension_Aggregate);
return Flag17 (N);
end Null_Record_Present;
function Object_Definition
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Object_Declaration);
return Node4 (N);
end Object_Definition;
function Original_Discriminant
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Identifier);
return Node2 (N);
end Original_Discriminant;
function Original_Entity
(N : Node_Id) return Entity_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Integer_Literal
or else NT (N).Nkind = N_Real_Literal);
return Node2 (N);
end Original_Entity;
function Others_Discrete_Choices
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Others_Choice);
return List1 (N);
end Others_Discrete_Choices;
function Out_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Object_Declaration
or else NT (N).Nkind = N_Parameter_Specification);
return Flag17 (N);
end Out_Present;
function Parameter_Associations
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Call_Statement
or else NT (N).Nkind = N_Function_Call
or else NT (N).Nkind = N_Procedure_Call_Statement);
return List3 (N);
end Parameter_Associations;
function Parameter_List_Truncated
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Call
or else NT (N).Nkind = N_Procedure_Call_Statement);
return Flag17 (N);
end Parameter_List_Truncated;
function Parameter_Specifications
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Statement
or else NT (N).Nkind = N_Access_Function_Definition
or else NT (N).Nkind = N_Access_Procedure_Definition
or else NT (N).Nkind = N_Entry_Body_Formal_Part
or else NT (N).Nkind = N_Entry_Declaration
or else NT (N).Nkind = N_Function_Specification
or else NT (N).Nkind = N_Procedure_Specification);
return List3 (N);
end Parameter_Specifications;
function Parameter_Type
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Parameter_Specification);
return Node2 (N);
end Parameter_Type;
function Parent_Spec
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Instantiation
or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration
or else NT (N).Nkind = N_Generic_Package_Declaration
or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration
or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration
or else NT (N).Nkind = N_Generic_Subprogram_Declaration
or else NT (N).Nkind = N_Package_Declaration
or else NT (N).Nkind = N_Package_Instantiation
or else NT (N).Nkind = N_Package_Renaming_Declaration
or else NT (N).Nkind = N_Procedure_Instantiation
or else NT (N).Nkind = N_Subprogram_Declaration
or else NT (N).Nkind = N_Subprogram_Renaming_Declaration);
return Node4 (N);
end Parent_Spec;
function Position
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Clause);
return Node2 (N);
end Position;
function Pragma_Argument_Associations
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Pragma);
return List2 (N);
end Pragma_Argument_Associations;
function Pragmas_After
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit_Aux
or else NT (N).Nkind = N_Terminate_Alternative);
return List5 (N);
end Pragmas_After;
function Pragmas_Before
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Alternative
or else NT (N).Nkind = N_Delay_Alternative
or else NT (N).Nkind = N_Entry_Call_Alternative
or else NT (N).Nkind = N_Mod_Clause
or else NT (N).Nkind = N_Terminate_Alternative
or else NT (N).Nkind = N_Triggering_Alternative);
return List4 (N);
end Pragmas_Before;
function Prefix
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Attribute_Reference
or else NT (N).Nkind = N_Expanded_Name
or else NT (N).Nkind = N_Explicit_Dereference
or else NT (N).Nkind = N_Indexed_Component
or else NT (N).Nkind = N_Reference
or else NT (N).Nkind = N_Selected_Component
or else NT (N).Nkind = N_Slice);
return Node3 (N);
end Prefix;
function Present_Expr
(N : Node_Id) return Uint is
begin
pragma Assert (False
or else NT (N).Nkind = N_Variant);
return Uint3 (N);
end Present_Expr;
function Prev_Ids
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Declaration
or else NT (N).Nkind = N_Discriminant_Specification
or else NT (N).Nkind = N_Exception_Declaration
or else NT (N).Nkind = N_Formal_Object_Declaration
or else NT (N).Nkind = N_Number_Declaration
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind = N_Parameter_Specification);
return Flag6 (N);
end Prev_Ids;
function Print_In_Hex
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Integer_Literal);
return Flag13 (N);
end Print_In_Hex;
function Private_Declarations
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Package_Specification
or else NT (N).Nkind = N_Protected_Definition
or else NT (N).Nkind = N_Task_Definition);
return List3 (N);
end Private_Declarations;
function Private_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit
or else NT (N).Nkind = N_Formal_Derived_Type_Definition
or else NT (N).Nkind = N_With_Clause);
return Flag15 (N);
end Private_Present;
function Procedure_To_Call
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Allocator
or else NT (N).Nkind = N_Free_Statement
or else NT (N).Nkind = N_Return_Statement);
return Node4 (N);
end Procedure_To_Call;
function Proper_Body
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subunit);
return Node1 (N);
end Proper_Body;
function Protected_Definition
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Protected_Type_Declaration
or else NT (N).Nkind = N_Single_Protected_Declaration);
return Node3 (N);
end Protected_Definition;
function Protected_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Access_Function_Definition
or else NT (N).Nkind = N_Access_Procedure_Definition
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Record_Definition);
return Flag6 (N);
end Protected_Present;
function Raises_Constraint_Error
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind in N_Subexpr);
return Flag7 (N);
end Raises_Constraint_Error;
function Range_Constraint
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Delta_Constraint
or else NT (N).Nkind = N_Digits_Constraint);
return Node4 (N);
end Range_Constraint;
function Range_Expression
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Range_Constraint);
return Node4 (N);
end Range_Expression;
function Real_Range_Specification
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition
or else NT (N).Nkind = N_Floating_Point_Definition
or else NT (N).Nkind = N_Ordinary_Fixed_Point_Definition);
return Node4 (N);
end Real_Range_Specification;
function Realval
(N : Node_Id) return Ureal is
begin
pragma Assert (False
or else NT (N).Nkind = N_Real_Literal);
return Ureal3 (N);
end Realval;
function Reason
(N : Node_Id) return Uint is
begin
pragma Assert (False
or else NT (N).Nkind = N_Raise_Constraint_Error
or else NT (N).Nkind = N_Raise_Program_Error
or else NT (N).Nkind = N_Raise_Storage_Error);
return Uint3 (N);
end Reason;
function Record_Extension_Part
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Derived_Type_Definition);
return Node3 (N);
end Record_Extension_Part;
function Redundant_Use
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Attribute_Reference
or else NT (N).Nkind = N_Expanded_Name
or else NT (N).Nkind = N_Identifier);
return Flag13 (N);
end Redundant_Use;
function Result_Definition
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Access_Function_Definition
or else NT (N).Nkind = N_Function_Specification);
return Node4 (N);
end Result_Definition;
function Return_Type
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Return_Statement);
return Node2 (N);
end Return_Type;
function Reverse_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Loop_Parameter_Specification);
return Flag15 (N);
end Reverse_Present;
function Right_Opnd
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind in N_Op
or else NT (N).Nkind = N_And_Then
or else NT (N).Nkind = N_In
or else NT (N).Nkind = N_Not_In
or else NT (N).Nkind = N_Or_Else);
return Node3 (N);
end Right_Opnd;
function Rounded_Result
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Op_Divide
or else NT (N).Nkind = N_Op_Multiply
or else NT (N).Nkind = N_Type_Conversion);
return Flag18 (N);
end Rounded_Result;
function Scope
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Defining_Character_Literal
or else NT (N).Nkind = N_Defining_Identifier
or else NT (N).Nkind = N_Defining_Operator_Symbol);
return Node3 (N);
end Scope;
function Select_Alternatives
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Selective_Accept);
return List1 (N);
end Select_Alternatives;
function Selector_Name
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Expanded_Name
or else NT (N).Nkind = N_Generic_Association
or else NT (N).Nkind = N_Parameter_Association
or else NT (N).Nkind = N_Selected_Component);
return Node2 (N);
end Selector_Name;
function Selector_Names
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Discriminant_Association);
return List1 (N);
end Selector_Names;
function Shift_Count_OK
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Op_Rotate_Left
or else NT (N).Nkind = N_Op_Rotate_Right
or else NT (N).Nkind = N_Op_Shift_Left
or else NT (N).Nkind = N_Op_Shift_Right
or else NT (N).Nkind = N_Op_Shift_Right_Arithmetic);
return Flag4 (N);
end Shift_Count_OK;
function Source_Type
(N : Node_Id) return Entity_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Validate_Unchecked_Conversion);
return Node1 (N);
end Source_Type;
function Specification
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Abstract_Subprogram_Declaration
or else NT (N).Nkind = N_Formal_Abstract_Subprogram_Declaration
or else NT (N).Nkind = N_Formal_Concrete_Subprogram_Declaration
or else NT (N).Nkind = N_Generic_Package_Declaration
or else NT (N).Nkind = N_Generic_Subprogram_Declaration
or else NT (N).Nkind = N_Package_Declaration
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Subprogram_Body_Stub
or else NT (N).Nkind = N_Subprogram_Declaration
or else NT (N).Nkind = N_Subprogram_Renaming_Declaration);
return Node1 (N);
end Specification;
function Statements
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Abortable_Part
or else NT (N).Nkind = N_Accept_Alternative
or else NT (N).Nkind = N_Case_Statement_Alternative
or else NT (N).Nkind = N_Delay_Alternative
or else NT (N).Nkind = N_Entry_Call_Alternative
or else NT (N).Nkind = N_Exception_Handler
or else NT (N).Nkind = N_Handled_Sequence_Of_Statements
or else NT (N).Nkind = N_Loop_Statement
or else NT (N).Nkind = N_Triggering_Alternative);
return List3 (N);
end Statements;
function Static_Processing_OK
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Aggregate);
return Flag4 (N);
end Static_Processing_OK;
function Storage_Pool
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Allocator
or else NT (N).Nkind = N_Free_Statement
or else NT (N).Nkind = N_Return_Statement);
return Node1 (N);
end Storage_Pool;
function Strval
(N : Node_Id) return String_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Operator_Symbol
or else NT (N).Nkind = N_String_Literal);
return Str3 (N);
end Strval;
function Subtype_Indication
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Access_To_Object_Definition
or else NT (N).Nkind = N_Component_Definition
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Private_Extension_Declaration
or else NT (N).Nkind = N_Subtype_Declaration);
return Node5 (N);
end Subtype_Indication;
function Subtype_Mark
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Access_Definition
or else NT (N).Nkind = N_Formal_Derived_Type_Definition
or else NT (N).Nkind = N_Formal_Object_Declaration
or else NT (N).Nkind = N_Object_Renaming_Declaration
or else NT (N).Nkind = N_Qualified_Expression
or else NT (N).Nkind = N_Subtype_Indication
or else NT (N).Nkind = N_Type_Conversion
or else NT (N).Nkind = N_Unchecked_Type_Conversion);
return Node4 (N);
end Subtype_Mark;
function Subtype_Marks
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Unconstrained_Array_Definition
or else NT (N).Nkind = N_Use_Type_Clause);
return List2 (N);
end Subtype_Marks;
function Synchronized_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Record_Definition);
return Flag7 (N);
end Synchronized_Present;
function Tagged_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Private_Type_Definition
or else NT (N).Nkind = N_Incomplete_Type_Declaration
or else NT (N).Nkind = N_Private_Type_Declaration
or else NT (N).Nkind = N_Record_Definition
or else NT (N).Nkind = N_With_Type_Clause);
return Flag15 (N);
end Tagged_Present;
function Target_Type
(N : Node_Id) return Entity_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Validate_Unchecked_Conversion);
return Node2 (N);
end Target_Type;
function Task_Definition
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Single_Task_Declaration
or else NT (N).Nkind = N_Task_Type_Declaration);
return Node3 (N);
end Task_Definition;
function Task_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Record_Definition);
return Flag5 (N);
end Task_Present;
function Then_Actions
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Conditional_Expression);
return List2 (N);
end Then_Actions;
function Then_Statements
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Elsif_Part
or else NT (N).Nkind = N_If_Statement);
return List2 (N);
end Then_Statements;
function Treat_Fixed_As_Integer
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Op_Divide
or else NT (N).Nkind = N_Op_Mod
or else NT (N).Nkind = N_Op_Multiply
or else NT (N).Nkind = N_Op_Rem);
return Flag14 (N);
end Treat_Fixed_As_Integer;
function Triggering_Alternative
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Asynchronous_Select);
return Node1 (N);
end Triggering_Alternative;
function Triggering_Statement
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Triggering_Alternative);
return Node1 (N);
end Triggering_Statement;
function TSS_Elist
(N : Node_Id) return Elist_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Freeze_Entity);
return Elist3 (N);
end TSS_Elist;
function Type_Definition
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Full_Type_Declaration);
return Node3 (N);
end Type_Definition;
function Unit
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit);
return Node2 (N);
end Unit;
function Unknown_Discriminants_Present
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Type_Declaration
or else NT (N).Nkind = N_Incomplete_Type_Declaration
or else NT (N).Nkind = N_Private_Extension_Declaration
or else NT (N).Nkind = N_Private_Type_Declaration);
return Flag13 (N);
end Unknown_Discriminants_Present;
function Unreferenced_In_Spec
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
return Flag7 (N);
end Unreferenced_In_Spec;
function Variant_Part
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_List);
return Node4 (N);
end Variant_Part;
function Variants
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Variant_Part);
return List1 (N);
end Variants;
function Visible_Declarations
(N : Node_Id) return List_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Package_Specification
or else NT (N).Nkind = N_Protected_Definition
or else NT (N).Nkind = N_Task_Definition);
return List2 (N);
end Visible_Declarations;
function Was_Originally_Stub
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Package_Body
or else NT (N).Nkind = N_Protected_Body
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Task_Body);
return Flag13 (N);
end Was_Originally_Stub;
function Zero_Cost_Handling
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Exception_Handler
or else NT (N).Nkind = N_Handled_Sequence_Of_Statements);
return Flag5 (N);
end Zero_Cost_Handling;
--------------------------
-- Field Set Procedures --
--------------------------
procedure Set_ABE_Is_Certain
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Package_Declaration
or else NT (N).Nkind = N_Function_Call
or else NT (N).Nkind = N_Function_Instantiation
or else NT (N).Nkind = N_Package_Instantiation
or else NT (N).Nkind = N_Procedure_Call_Statement
or else NT (N).Nkind = N_Procedure_Instantiation);
Set_Flag18 (N, Val);
end Set_ABE_Is_Certain;
procedure Set_Abort_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Requeue_Statement);
Set_Flag15 (N, Val);
end Set_Abort_Present;
procedure Set_Abortable_Part
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Asynchronous_Select);
Set_Node2_With_Parent (N, Val);
end Set_Abortable_Part;
procedure Set_Abstract_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Formal_Derived_Type_Definition
or else NT (N).Nkind = N_Formal_Private_Type_Definition
or else NT (N).Nkind = N_Private_Extension_Declaration
or else NT (N).Nkind = N_Private_Type_Declaration
or else NT (N).Nkind = N_Record_Definition);
Set_Flag4 (N, Val);
end Set_Abstract_Present;
procedure Set_Accept_Handler_Records
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Alternative);
Set_List5 (N, Val); -- semantic field, no parent set
end Set_Accept_Handler_Records;
procedure Set_Accept_Statement
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Alternative);
Set_Node2_With_Parent (N, Val);
end Set_Accept_Statement;
procedure Set_Access_Definition
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Definition
or else NT (N).Nkind = N_Object_Renaming_Declaration);
Set_Node3_With_Parent (N, Val);
end Set_Access_Definition;
procedure Set_Access_To_Subprogram_Definition
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Access_Definition);
Set_Node3_With_Parent (N, Val);
end Set_Access_To_Subprogram_Definition;
procedure Set_Access_Types_To_Process
(N : Node_Id; Val : Elist_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Freeze_Entity);
Set_Elist2 (N, Val); -- semantic field, no parent set
end Set_Access_Types_To_Process;
procedure Set_Actions
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_And_Then
or else NT (N).Nkind = N_Compilation_Unit_Aux
or else NT (N).Nkind = N_Freeze_Entity
or else NT (N).Nkind = N_Or_Else);
Set_List1_With_Parent (N, Val);
end Set_Actions;
procedure Set_Activation_Chain_Entity
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Block_Statement
or else NT (N).Nkind = N_Entry_Body
or else NT (N).Nkind = N_Generic_Package_Declaration
or else NT (N).Nkind = N_Package_Declaration
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Task_Body);
Set_Node3 (N, Val); -- semantic field, no parent set
end Set_Activation_Chain_Entity;
procedure Set_Acts_As_Spec
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit
or else NT (N).Nkind = N_Subprogram_Body);
Set_Flag4 (N, Val);
end Set_Acts_As_Spec;
procedure Set_Actual_Designated_Subtype
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Explicit_Dereference
or else NT (N).Nkind = N_Free_Statement);
Set_Node2 (N, Val);
end Set_Actual_Designated_Subtype;
procedure Set_Aggregate_Bounds
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Aggregate);
Set_Node3 (N, Val); -- semantic field, no parent set
end Set_Aggregate_Bounds;
procedure Set_Aliased_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Definition
or else NT (N).Nkind = N_Object_Declaration);
Set_Flag4 (N, Val);
end Set_Aliased_Present;
procedure Set_All_Others
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Others_Choice);
Set_Flag11 (N, Val);
end Set_All_Others;
procedure Set_All_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Access_Definition
or else NT (N).Nkind = N_Access_To_Object_Definition);
Set_Flag15 (N, Val);
end Set_All_Present;
procedure Set_Alternatives
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Case_Statement);
Set_List4_With_Parent (N, Val);
end Set_Alternatives;
procedure Set_Ancestor_Part
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Extension_Aggregate);
Set_Node3_With_Parent (N, Val);
end Set_Ancestor_Part;
procedure Set_Array_Aggregate
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Enumeration_Representation_Clause);
Set_Node3_With_Parent (N, Val);
end Set_Array_Aggregate;
procedure Set_Assignment_OK
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind in N_Subexpr);
Set_Flag15 (N, Val);
end Set_Assignment_OK;
procedure Set_Associated_Node
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind in N_Has_Entity
or else NT (N).Nkind = N_Aggregate
or else NT (N).Nkind = N_Extension_Aggregate
or else NT (N).Nkind = N_Selected_Component);
Set_Node4 (N, Val); -- semantic field, no parent set
end Set_Associated_Node;
procedure Set_At_End_Proc
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Handled_Sequence_Of_Statements);
Set_Node1 (N, Val);
end Set_At_End_Proc;
procedure Set_Attribute_Name
(N : Node_Id; Val : Name_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Attribute_Reference);
Set_Name2 (N, Val);
end Set_Attribute_Name;
procedure Set_Aux_Decls_Node
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit);
Set_Node5_With_Parent (N, Val);
end Set_Aux_Decls_Node;
procedure Set_Backwards_OK
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Assignment_Statement);
Set_Flag6 (N, Val);
end Set_Backwards_OK;
procedure Set_Bad_Is_Detected
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subprogram_Body);
Set_Flag15 (N, Val);
end Set_Bad_Is_Detected;
procedure Set_Body_Required
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit);
Set_Flag13 (N, Val);
end Set_Body_Required;
procedure Set_Body_To_Inline
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subprogram_Declaration);
Set_Node3 (N, Val);
end Set_Body_To_Inline;
procedure Set_Box_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Association
or else NT (N).Nkind = N_Formal_Abstract_Subprogram_Declaration
or else NT (N).Nkind = N_Formal_Concrete_Subprogram_Declaration
or else NT (N).Nkind = N_Formal_Package_Declaration);
Set_Flag15 (N, Val);
end Set_Box_Present;
procedure Set_By_Ref
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Return_Statement);
Set_Flag5 (N, Val);
end Set_By_Ref;
procedure Set_Char_Literal_Value
(N : Node_Id; Val : Uint) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Character_Literal);
Set_Uint2 (N, Val);
end Set_Char_Literal_Value;
procedure Set_Chars
(N : Node_Id; Val : Name_Id) is
begin
pragma Assert (False
or else NT (N).Nkind in N_Has_Chars);
Set_Name1 (N, Val);
end Set_Chars;
procedure Set_Check_Address_Alignment
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Attribute_Definition_Clause);
Set_Flag11 (N, Val);
end Set_Check_Address_Alignment;
procedure Set_Choice_Parameter
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Exception_Handler);
Set_Node2_With_Parent (N, Val);
end Set_Choice_Parameter;
procedure Set_Choices
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Association);
Set_List1_With_Parent (N, Val);
end Set_Choices;
procedure Set_Compile_Time_Known_Aggregate
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Aggregate);
Set_Flag18 (N, Val);
end Set_Compile_Time_Known_Aggregate;
procedure Set_Component_Associations
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Aggregate
or else NT (N).Nkind = N_Extension_Aggregate);
Set_List2_With_Parent (N, Val);
end Set_Component_Associations;
procedure Set_Component_Clauses
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Record_Representation_Clause);
Set_List3_With_Parent (N, Val);
end Set_Component_Clauses;
procedure Set_Component_Definition
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Declaration
or else NT (N).Nkind = N_Constrained_Array_Definition
or else NT (N).Nkind = N_Unconstrained_Array_Definition);
Set_Node4_With_Parent (N, Val);
end Set_Component_Definition;
procedure Set_Component_Items
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_List);
Set_List3_With_Parent (N, Val);
end Set_Component_Items;
procedure Set_Component_List
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Record_Definition
or else NT (N).Nkind = N_Variant);
Set_Node1_With_Parent (N, Val);
end Set_Component_List;
procedure Set_Component_Name
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Clause);
Set_Node1_With_Parent (N, Val);
end Set_Component_Name;
procedure Set_Condition
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Alternative
or else NT (N).Nkind = N_Delay_Alternative
or else NT (N).Nkind = N_Elsif_Part
or else NT (N).Nkind = N_Entry_Body_Formal_Part
or else NT (N).Nkind = N_Exit_Statement
or else NT (N).Nkind = N_If_Statement
or else NT (N).Nkind = N_Iteration_Scheme
or else NT (N).Nkind = N_Raise_Constraint_Error
or else NT (N).Nkind = N_Raise_Program_Error
or else NT (N).Nkind = N_Raise_Storage_Error
or else NT (N).Nkind = N_Terminate_Alternative);
Set_Node1_With_Parent (N, Val);
end Set_Condition;
procedure Set_Condition_Actions
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Elsif_Part
or else NT (N).Nkind = N_Iteration_Scheme);
Set_List3 (N, Val); -- semantic field, no parent set
end Set_Condition_Actions;
procedure Set_Config_Pragmas
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit_Aux);
Set_List4_With_Parent (N, Val);
end Set_Config_Pragmas;
procedure Set_Constant_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Access_Definition
or else NT (N).Nkind = N_Access_To_Object_Definition
or else NT (N).Nkind = N_Object_Declaration);
Set_Flag17 (N, Val);
end Set_Constant_Present;
procedure Set_Constraint
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subtype_Indication);
Set_Node3_With_Parent (N, Val);
end Set_Constraint;
procedure Set_Constraints
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Index_Or_Discriminant_Constraint);
Set_List1_With_Parent (N, Val);
end Set_Constraints;
procedure Set_Context_Installed
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
Set_Flag13 (N, Val);
end Set_Context_Installed;
procedure Set_Context_Items
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit);
Set_List1_With_Parent (N, Val);
end Set_Context_Items;
procedure Set_Controlling_Argument
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Call
or else NT (N).Nkind = N_Procedure_Call_Statement);
Set_Node1 (N, Val); -- semantic field, no parent set
end Set_Controlling_Argument;
procedure Set_Conversion_OK
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Type_Conversion);
Set_Flag14 (N, Val);
end Set_Conversion_OK;
procedure Set_Corresponding_Body
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Declaration
or else NT (N).Nkind = N_Generic_Package_Declaration
or else NT (N).Nkind = N_Generic_Subprogram_Declaration
or else NT (N).Nkind = N_Package_Body_Stub
or else NT (N).Nkind = N_Package_Declaration
or else NT (N).Nkind = N_Protected_Body_Stub
or else NT (N).Nkind = N_Protected_Type_Declaration
or else NT (N).Nkind = N_Subprogram_Body_Stub
or else NT (N).Nkind = N_Subprogram_Declaration
or else NT (N).Nkind = N_Task_Body_Stub
or else NT (N).Nkind = N_Task_Type_Declaration);
Set_Node5 (N, Val); -- semantic field, no parent set
end Set_Corresponding_Body;
procedure Set_Corresponding_Formal_Spec
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subprogram_Renaming_Declaration);
Set_Node3 (N, Val); -- semantic field, no parent set
end Set_Corresponding_Formal_Spec;
procedure Set_Corresponding_Generic_Association
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind = N_Object_Renaming_Declaration);
Set_Node5 (N, Val); -- semantic field, no parent set
end Set_Corresponding_Generic_Association;
procedure Set_Corresponding_Integer_Value
(N : Node_Id; Val : Uint) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Real_Literal);
Set_Uint4 (N, Val); -- semantic field, no parent set
end Set_Corresponding_Integer_Value;
procedure Set_Corresponding_Spec
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Package_Body
or else NT (N).Nkind = N_Protected_Body
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Subprogram_Renaming_Declaration
or else NT (N).Nkind = N_Task_Body
or else NT (N).Nkind = N_With_Clause);
Set_Node5 (N, Val); -- semantic field, no parent set
end Set_Corresponding_Spec;
procedure Set_Corresponding_Stub
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subunit);
Set_Node3 (N, Val);
end Set_Corresponding_Stub;
procedure Set_Dcheck_Function
(N : Node_Id; Val : Entity_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Variant);
Set_Node5 (N, Val); -- semantic field, no parent set
end Set_Dcheck_Function;
procedure Set_Debug_Statement
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Pragma);
Set_Node3_With_Parent (N, Val);
end Set_Debug_Statement;
procedure Set_Declarations
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Statement
or else NT (N).Nkind = N_Block_Statement
or else NT (N).Nkind = N_Compilation_Unit_Aux
or else NT (N).Nkind = N_Entry_Body
or else NT (N).Nkind = N_Package_Body
or else NT (N).Nkind = N_Protected_Body
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Task_Body);
Set_List2_With_Parent (N, Val);
end Set_Declarations;
procedure Set_Default_Expression
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Parameter_Specification);
Set_Node5 (N, Val); -- semantic field, no parent set
end Set_Default_Expression;
procedure Set_Default_Name
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Abstract_Subprogram_Declaration
or else NT (N).Nkind = N_Formal_Concrete_Subprogram_Declaration);
Set_Node2_With_Parent (N, Val);
end Set_Default_Name;
procedure Set_Defining_Identifier
(N : Node_Id; Val : Entity_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Declaration
or else NT (N).Nkind = N_Defining_Program_Unit_Name
or else NT (N).Nkind = N_Discriminant_Specification
or else NT (N).Nkind = N_Entry_Body
or else NT (N).Nkind = N_Entry_Declaration
or else NT (N).Nkind = N_Entry_Index_Specification
or else NT (N).Nkind = N_Exception_Declaration
or else NT (N).Nkind = N_Exception_Renaming_Declaration
or else NT (N).Nkind = N_Formal_Object_Declaration
or else NT (N).Nkind = N_Formal_Package_Declaration
or else NT (N).Nkind = N_Formal_Type_Declaration
or else NT (N).Nkind = N_Full_Type_Declaration
or else NT (N).Nkind = N_Implicit_Label_Declaration
or else NT (N).Nkind = N_Incomplete_Type_Declaration
or else NT (N).Nkind = N_Loop_Parameter_Specification
or else NT (N).Nkind = N_Number_Declaration
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind = N_Object_Renaming_Declaration
or else NT (N).Nkind = N_Package_Body_Stub
or else NT (N).Nkind = N_Parameter_Specification
or else NT (N).Nkind = N_Private_Extension_Declaration
or else NT (N).Nkind = N_Private_Type_Declaration
or else NT (N).Nkind = N_Protected_Body
or else NT (N).Nkind = N_Protected_Body_Stub
or else NT (N).Nkind = N_Protected_Type_Declaration
or else NT (N).Nkind = N_Single_Protected_Declaration
or else NT (N).Nkind = N_Single_Task_Declaration
or else NT (N).Nkind = N_Subtype_Declaration
or else NT (N).Nkind = N_Task_Body
or else NT (N).Nkind = N_Task_Body_Stub
or else NT (N).Nkind = N_Task_Type_Declaration);
Set_Node1_With_Parent (N, Val);
end Set_Defining_Identifier;
procedure Set_Defining_Unit_Name
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Instantiation
or else NT (N).Nkind = N_Function_Specification
or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration
or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration
or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration
or else NT (N).Nkind = N_Package_Body
or else NT (N).Nkind = N_Package_Instantiation
or else NT (N).Nkind = N_Package_Renaming_Declaration
or else NT (N).Nkind = N_Package_Specification
or else NT (N).Nkind = N_Procedure_Instantiation
or else NT (N).Nkind = N_Procedure_Specification);
Set_Node1_With_Parent (N, Val);
end Set_Defining_Unit_Name;
procedure Set_Delay_Alternative
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Timed_Entry_Call);
Set_Node4_With_Parent (N, Val);
end Set_Delay_Alternative;
procedure Set_Delay_Finalize_Attach
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Object_Declaration);
Set_Flag14 (N, Val);
end Set_Delay_Finalize_Attach;
procedure Set_Delay_Statement
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Delay_Alternative);
Set_Node2_With_Parent (N, Val);
end Set_Delay_Statement;
procedure Set_Delta_Expression
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition
or else NT (N).Nkind = N_Delta_Constraint
or else NT (N).Nkind = N_Ordinary_Fixed_Point_Definition);
Set_Node3_With_Parent (N, Val);
end Set_Delta_Expression;
procedure Set_Digits_Expression
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition
or else NT (N).Nkind = N_Digits_Constraint
or else NT (N).Nkind = N_Floating_Point_Definition);
Set_Node2_With_Parent (N, Val);
end Set_Digits_Expression;
procedure Set_Discr_Check_Funcs_Built
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Full_Type_Declaration);
Set_Flag11 (N, Val);
end Set_Discr_Check_Funcs_Built;
procedure Set_Discrete_Choices
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Case_Statement_Alternative
or else NT (N).Nkind = N_Variant);
Set_List4_With_Parent (N, Val);
end Set_Discrete_Choices;
procedure Set_Discrete_Range
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Slice);
Set_Node4_With_Parent (N, Val);
end Set_Discrete_Range;
procedure Set_Discrete_Subtype_Definition
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Declaration
or else NT (N).Nkind = N_Entry_Index_Specification
or else NT (N).Nkind = N_Loop_Parameter_Specification);
Set_Node4_With_Parent (N, Val);
end Set_Discrete_Subtype_Definition;
procedure Set_Discrete_Subtype_Definitions
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Constrained_Array_Definition);
Set_List2_With_Parent (N, Val);
end Set_Discrete_Subtype_Definitions;
procedure Set_Discriminant_Specifications
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Type_Declaration
or else NT (N).Nkind = N_Full_Type_Declaration
or else NT (N).Nkind = N_Incomplete_Type_Declaration
or else NT (N).Nkind = N_Private_Extension_Declaration
or else NT (N).Nkind = N_Private_Type_Declaration
or else NT (N).Nkind = N_Protected_Type_Declaration
or else NT (N).Nkind = N_Task_Type_Declaration);
Set_List4_With_Parent (N, Val);
end Set_Discriminant_Specifications;
procedure Set_Discriminant_Type
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Discriminant_Specification);
Set_Node5_With_Parent (N, Val);
end Set_Discriminant_Type;
procedure Set_Do_Accessibility_Check
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Parameter_Specification);
Set_Flag13 (N, Val);
end Set_Do_Accessibility_Check;
procedure Set_Do_Discriminant_Check
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Selected_Component);
Set_Flag13 (N, Val);
end Set_Do_Discriminant_Check;
procedure Set_Do_Division_Check
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Op_Divide
or else NT (N).Nkind = N_Op_Mod
or else NT (N).Nkind = N_Op_Rem);
Set_Flag13 (N, Val);
end Set_Do_Division_Check;
procedure Set_Do_Length_Check
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Assignment_Statement
or else NT (N).Nkind = N_Op_And
or else NT (N).Nkind = N_Op_Or
or else NT (N).Nkind = N_Op_Xor
or else NT (N).Nkind = N_Type_Conversion);
Set_Flag4 (N, Val);
end Set_Do_Length_Check;
procedure Set_Do_Overflow_Check
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind in N_Op
or else NT (N).Nkind = N_Attribute_Reference
or else NT (N).Nkind = N_Type_Conversion);
Set_Flag17 (N, Val);
end Set_Do_Overflow_Check;
procedure Set_Do_Range_Check
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind in N_Subexpr);
Set_Flag9 (N, Val);
end Set_Do_Range_Check;
procedure Set_Do_Storage_Check
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Allocator
or else NT (N).Nkind = N_Subprogram_Body);
Set_Flag17 (N, Val);
end Set_Do_Storage_Check;
procedure Set_Do_Tag_Check
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Assignment_Statement
or else NT (N).Nkind = N_Function_Call
or else NT (N).Nkind = N_Procedure_Call_Statement
or else NT (N).Nkind = N_Return_Statement
or else NT (N).Nkind = N_Type_Conversion);
Set_Flag13 (N, Val);
end Set_Do_Tag_Check;
procedure Set_Elaborate_All_Desirable
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
Set_Flag9 (N, Val);
end Set_Elaborate_All_Desirable;
procedure Set_Elaborate_All_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
Set_Flag14 (N, Val);
end Set_Elaborate_All_Present;
procedure Set_Elaborate_Desirable
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
Set_Flag11 (N, Val);
end Set_Elaborate_Desirable;
procedure Set_Elaborate_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
Set_Flag4 (N, Val);
end Set_Elaborate_Present;
procedure Set_Elaboration_Boolean
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Specification
or else NT (N).Nkind = N_Procedure_Specification);
Set_Node2 (N, Val);
end Set_Elaboration_Boolean;
procedure Set_Else_Actions
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Conditional_Expression);
Set_List3 (N, Val); -- semantic field, no parent set
end Set_Else_Actions;
procedure Set_Else_Statements
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Conditional_Entry_Call
or else NT (N).Nkind = N_If_Statement
or else NT (N).Nkind = N_Selective_Accept);
Set_List4_With_Parent (N, Val);
end Set_Else_Statements;
procedure Set_Elsif_Parts
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_If_Statement);
Set_List3_With_Parent (N, Val);
end Set_Elsif_Parts;
procedure Set_Enclosing_Variant
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Variant);
Set_Node2 (N, Val); -- semantic field, no parent set
end Set_Enclosing_Variant;
procedure Set_End_Label
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Enumeration_Type_Definition
or else NT (N).Nkind = N_Handled_Sequence_Of_Statements
or else NT (N).Nkind = N_Loop_Statement
or else NT (N).Nkind = N_Package_Specification
or else NT (N).Nkind = N_Protected_Body
or else NT (N).Nkind = N_Protected_Definition
or else NT (N).Nkind = N_Record_Definition
or else NT (N).Nkind = N_Task_Definition);
Set_Node4_With_Parent (N, Val);
end Set_End_Label;
procedure Set_End_Span
(N : Node_Id; Val : Uint) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Case_Statement
or else NT (N).Nkind = N_If_Statement);
Set_Uint5 (N, Val);
end Set_End_Span;
procedure Set_Entity
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind in N_Has_Entity
or else NT (N).Nkind = N_Freeze_Entity);
Set_Node4 (N, Val); -- semantic field, no parent set
end Set_Entity;
procedure Set_Entry_Body_Formal_Part
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Body);
Set_Node5_With_Parent (N, Val);
end Set_Entry_Body_Formal_Part;
procedure Set_Entry_Call_Alternative
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Conditional_Entry_Call
or else NT (N).Nkind = N_Timed_Entry_Call);
Set_Node1_With_Parent (N, Val);
end Set_Entry_Call_Alternative;
procedure Set_Entry_Call_Statement
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Call_Alternative);
Set_Node1_With_Parent (N, Val);
end Set_Entry_Call_Statement;
procedure Set_Entry_Direct_Name
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Statement);
Set_Node1_With_Parent (N, Val);
end Set_Entry_Direct_Name;
procedure Set_Entry_Index
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Statement);
Set_Node5_With_Parent (N, Val);
end Set_Entry_Index;
procedure Set_Entry_Index_Specification
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Body_Formal_Part);
Set_Node4_With_Parent (N, Val);
end Set_Entry_Index_Specification;
procedure Set_Etype
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind in N_Has_Etype);
Set_Node5 (N, Val); -- semantic field, no parent set
end Set_Etype;
procedure Set_Exception_Choices
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Exception_Handler);
Set_List4_With_Parent (N, Val);
end Set_Exception_Choices;
procedure Set_Exception_Handlers
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Handled_Sequence_Of_Statements);
Set_List5_With_Parent (N, Val);
end Set_Exception_Handlers;
procedure Set_Exception_Junk
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Goto_Statement
or else NT (N).Nkind = N_Label
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind = N_Subtype_Declaration);
Set_Flag7 (N, Val);
end Set_Exception_Junk;
procedure Set_Expansion_Delayed
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Aggregate
or else NT (N).Nkind = N_Extension_Aggregate);
Set_Flag11 (N, Val);
end Set_Expansion_Delayed;
procedure Set_Explicit_Actual_Parameter
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Parameter_Association);
Set_Node3_With_Parent (N, Val);
end Set_Explicit_Actual_Parameter;
procedure Set_Explicit_Generic_Actual_Parameter
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Generic_Association);
Set_Node1_With_Parent (N, Val);
end Set_Explicit_Generic_Actual_Parameter;
procedure Set_Expression
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Allocator
or else NT (N).Nkind = N_Assignment_Statement
or else NT (N).Nkind = N_At_Clause
or else NT (N).Nkind = N_Attribute_Definition_Clause
or else NT (N).Nkind = N_Case_Statement
or else NT (N).Nkind = N_Code_Statement
or else NT (N).Nkind = N_Component_Association
or else NT (N).Nkind = N_Component_Declaration
or else NT (N).Nkind = N_Delay_Relative_Statement
or else NT (N).Nkind = N_Delay_Until_Statement
or else NT (N).Nkind = N_Discriminant_Association
or else NT (N).Nkind = N_Discriminant_Specification
or else NT (N).Nkind = N_Exception_Declaration
or else NT (N).Nkind = N_Formal_Object_Declaration
or else NT (N).Nkind = N_Free_Statement
or else NT (N).Nkind = N_Mod_Clause
or else NT (N).Nkind = N_Modular_Type_Definition
or else NT (N).Nkind = N_Number_Declaration
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind = N_Parameter_Specification
or else NT (N).Nkind = N_Pragma_Argument_Association
or else NT (N).Nkind = N_Qualified_Expression
or else NT (N).Nkind = N_Raise_Statement
or else NT (N).Nkind = N_Return_Statement
or else NT (N).Nkind = N_Type_Conversion
or else NT (N).Nkind = N_Unchecked_Expression
or else NT (N).Nkind = N_Unchecked_Type_Conversion);
Set_Node3_With_Parent (N, Val);
end Set_Expression;
procedure Set_Expressions
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Aggregate
or else NT (N).Nkind = N_Attribute_Reference
or else NT (N).Nkind = N_Conditional_Expression
or else NT (N).Nkind = N_Extension_Aggregate
or else NT (N).Nkind = N_Indexed_Component);
Set_List1_With_Parent (N, Val);
end Set_Expressions;
procedure Set_First_Bit
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Clause);
Set_Node3_With_Parent (N, Val);
end Set_First_Bit;
procedure Set_First_Inlined_Subprogram
(N : Node_Id; Val : Entity_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit);
Set_Node3 (N, Val); -- semantic field, no parent set
end Set_First_Inlined_Subprogram;
procedure Set_First_Name
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
Set_Flag5 (N, Val);
end Set_First_Name;
procedure Set_First_Named_Actual
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Call_Statement
or else NT (N).Nkind = N_Function_Call
or else NT (N).Nkind = N_Procedure_Call_Statement);
Set_Node4 (N, Val); -- semantic field, no parent set
end Set_First_Named_Actual;
procedure Set_First_Real_Statement
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Handled_Sequence_Of_Statements);
Set_Node2 (N, Val); -- semantic field, no parent set
end Set_First_Real_Statement;
procedure Set_First_Subtype_Link
(N : Node_Id; Val : Entity_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Freeze_Entity);
Set_Node5 (N, Val); -- semantic field, no parent set
end Set_First_Subtype_Link;
procedure Set_Float_Truncate
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Type_Conversion);
Set_Flag11 (N, Val);
end Set_Float_Truncate;
procedure Set_Formal_Type_Definition
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Type_Declaration);
Set_Node3_With_Parent (N, Val);
end Set_Formal_Type_Definition;
procedure Set_Forwards_OK
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Assignment_Statement);
Set_Flag5 (N, Val);
end Set_Forwards_OK;
procedure Set_From_At_Mod
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Attribute_Definition_Clause);
Set_Flag4 (N, Val);
end Set_From_At_Mod;
procedure Set_From_Default
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subprogram_Renaming_Declaration);
Set_Flag6 (N, Val);
end Set_From_Default;
procedure Set_Generic_Associations
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Package_Declaration
or else NT (N).Nkind = N_Function_Instantiation
or else NT (N).Nkind = N_Package_Instantiation
or else NT (N).Nkind = N_Procedure_Instantiation);
Set_List3_With_Parent (N, Val);
end Set_Generic_Associations;
procedure Set_Generic_Formal_Declarations
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Generic_Package_Declaration
or else NT (N).Nkind = N_Generic_Subprogram_Declaration);
Set_List2_With_Parent (N, Val);
end Set_Generic_Formal_Declarations;
procedure Set_Generic_Parent
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Specification
or else NT (N).Nkind = N_Package_Specification
or else NT (N).Nkind = N_Procedure_Specification);
Set_Node5 (N, Val);
end Set_Generic_Parent;
procedure Set_Generic_Parent_Type
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subtype_Declaration);
Set_Node4 (N, Val);
end Set_Generic_Parent_Type;
procedure Set_Handled_Statement_Sequence
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Statement
or else NT (N).Nkind = N_Block_Statement
or else NT (N).Nkind = N_Entry_Body
or else NT (N).Nkind = N_Package_Body
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Task_Body);
Set_Node4_With_Parent (N, Val);
end Set_Handled_Statement_Sequence;
procedure Set_Handler_List_Entry
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Object_Declaration);
Set_Node2 (N, Val);
end Set_Handler_List_Entry;
procedure Set_Has_Created_Identifier
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Block_Statement
or else NT (N).Nkind = N_Loop_Statement);
Set_Flag15 (N, Val);
end Set_Has_Created_Identifier;
procedure Set_Has_Dynamic_Length_Check
(N : Node_Id; Val : Boolean := True) is
begin
Set_Flag10 (N, Val);
end Set_Has_Dynamic_Length_Check;
procedure Set_Has_Dynamic_Range_Check
(N : Node_Id; Val : Boolean := True) is
begin
Set_Flag12 (N, Val);
end Set_Has_Dynamic_Range_Check;
procedure Set_Has_No_Elaboration_Code
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit);
Set_Flag17 (N, Val);
end Set_Has_No_Elaboration_Code;
procedure Set_Has_Priority_Pragma
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Protected_Definition
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Task_Definition);
Set_Flag6 (N, Val);
end Set_Has_Priority_Pragma;
procedure Set_Has_Private_View
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind in N_Op
or else NT (N).Nkind = N_Character_Literal
or else NT (N).Nkind = N_Expanded_Name
or else NT (N).Nkind = N_Identifier
or else NT (N).Nkind = N_Operator_Symbol);
Set_Flag11 (N, Val);
end Set_Has_Private_View;
procedure Set_Has_Storage_Size_Pragma
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Task_Definition);
Set_Flag5 (N, Val);
end Set_Has_Storage_Size_Pragma;
procedure Set_Has_Task_Info_Pragma
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Task_Definition);
Set_Flag7 (N, Val);
end Set_Has_Task_Info_Pragma;
procedure Set_Has_Task_Name_Pragma
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Task_Definition);
Set_Flag8 (N, Val);
end Set_Has_Task_Name_Pragma;
procedure Set_Has_Wide_Character
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_String_Literal);
Set_Flag11 (N, Val);
end Set_Has_Wide_Character;
procedure Set_Hidden_By_Use_Clause
(N : Node_Id; Val : Elist_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Use_Package_Clause
or else NT (N).Nkind = N_Use_Type_Clause);
Set_Elist4 (N, Val);
end Set_Hidden_By_Use_Clause;
procedure Set_High_Bound
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Range
or else NT (N).Nkind = N_Real_Range_Specification
or else NT (N).Nkind = N_Signed_Integer_Type_Definition);
Set_Node2_With_Parent (N, Val);
end Set_High_Bound;
procedure Set_Identifier
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_At_Clause
or else NT (N).Nkind = N_Block_Statement
or else NT (N).Nkind = N_Designator
or else NT (N).Nkind = N_Enumeration_Representation_Clause
or else NT (N).Nkind = N_Label
or else NT (N).Nkind = N_Loop_Statement
or else NT (N).Nkind = N_Record_Representation_Clause
or else NT (N).Nkind = N_Subprogram_Info);
Set_Node1_With_Parent (N, Val);
end Set_Identifier;
procedure Set_Implicit_With
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
Set_Flag16 (N, Val);
end Set_Implicit_With;
procedure Set_Interface_List
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Formal_Derived_Type_Definition
or else NT (N).Nkind = N_Private_Extension_Declaration
or else NT (N).Nkind = N_Protected_Type_Declaration
or else NT (N).Nkind = N_Record_Definition
or else NT (N).Nkind = N_Single_Protected_Declaration
or else NT (N).Nkind = N_Single_Task_Declaration
or else NT (N).Nkind = N_Task_Type_Declaration);
Set_List2_With_Parent (N, Val);
end Set_Interface_List;
procedure Set_Interface_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Record_Definition);
Set_Flag16 (N, Val);
end Set_Interface_Present;
procedure Set_In_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Object_Declaration
or else NT (N).Nkind = N_Parameter_Specification);
Set_Flag15 (N, Val);
end Set_In_Present;
procedure Set_Includes_Infinities
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Range);
Set_Flag11 (N, Val);
end Set_Includes_Infinities;
procedure Set_Instance_Spec
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Package_Declaration
or else NT (N).Nkind = N_Function_Instantiation
or else NT (N).Nkind = N_Package_Instantiation
or else NT (N).Nkind = N_Procedure_Instantiation);
Set_Node5 (N, Val); -- semantic field, no Parent set
end Set_Instance_Spec;
procedure Set_Intval
(N : Node_Id; Val : Uint) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Integer_Literal);
Set_Uint3 (N, Val);
end Set_Intval;
procedure Set_Is_Asynchronous_Call_Block
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Block_Statement);
Set_Flag7 (N, Val);
end Set_Is_Asynchronous_Call_Block;
procedure Set_Is_Component_Left_Opnd
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Op_Concat);
Set_Flag13 (N, Val);
end Set_Is_Component_Left_Opnd;
procedure Set_Is_Component_Right_Opnd
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Op_Concat);
Set_Flag14 (N, Val);
end Set_Is_Component_Right_Opnd;
procedure Set_Is_Controlling_Actual
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind in N_Subexpr);
Set_Flag16 (N, Val);
end Set_Is_Controlling_Actual;
procedure Set_Is_In_Discriminant_Check
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Selected_Component);
Set_Flag11 (N, Val);
end Set_Is_In_Discriminant_Check;
procedure Set_Is_Machine_Number
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Real_Literal);
Set_Flag11 (N, Val);
end Set_Is_Machine_Number;
procedure Set_Is_Null_Loop
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Loop_Statement);
Set_Flag16 (N, Val);
end Set_Is_Null_Loop;
procedure Set_Is_Overloaded
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind in N_Subexpr);
Set_Flag5 (N, Val);
end Set_Is_Overloaded;
procedure Set_Is_Power_Of_2_For_Shift
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Op_Expon);
Set_Flag13 (N, Val);
end Set_Is_Power_Of_2_For_Shift;
procedure Set_Is_Protected_Subprogram_Body
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subprogram_Body);
Set_Flag7 (N, Val);
end Set_Is_Protected_Subprogram_Body;
procedure Set_Is_Static_Expression
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind in N_Subexpr);
Set_Flag6 (N, Val);
end Set_Is_Static_Expression;
procedure Set_Is_Subprogram_Descriptor
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Object_Declaration);
Set_Flag16 (N, Val);
end Set_Is_Subprogram_Descriptor;
procedure Set_Is_Task_Allocation_Block
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Block_Statement);
Set_Flag6 (N, Val);
end Set_Is_Task_Allocation_Block;
procedure Set_Is_Task_Master
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Block_Statement
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Task_Body);
Set_Flag5 (N, Val);
end Set_Is_Task_Master;
procedure Set_Iteration_Scheme
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Loop_Statement);
Set_Node2_With_Parent (N, Val);
end Set_Iteration_Scheme;
procedure Set_Itype
(N : Node_Id; Val : Entity_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Itype_Reference);
Set_Node1 (N, Val); -- no parent, semantic field
end Set_Itype;
procedure Set_Kill_Range_Check
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Unchecked_Type_Conversion);
Set_Flag11 (N, Val);
end Set_Kill_Range_Check;
procedure Set_Label_Construct
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Implicit_Label_Declaration);
Set_Node2 (N, Val); -- semantic field, no parent set
end Set_Label_Construct;
procedure Set_Last_Bit
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Clause);
Set_Node4_With_Parent (N, Val);
end Set_Last_Bit;
procedure Set_Last_Name
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
Set_Flag6 (N, Val);
end Set_Last_Name;
procedure Set_Left_Opnd
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_And_Then
or else NT (N).Nkind = N_In
or else NT (N).Nkind = N_Not_In
or else NT (N).Nkind = N_Or_Else
or else NT (N).Nkind in N_Binary_Op);
Set_Node2_With_Parent (N, Val);
end Set_Left_Opnd;
procedure Set_Library_Unit
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit
or else NT (N).Nkind = N_Package_Body_Stub
or else NT (N).Nkind = N_Protected_Body_Stub
or else NT (N).Nkind = N_Subprogram_Body_Stub
or else NT (N).Nkind = N_Task_Body_Stub
or else NT (N).Nkind = N_With_Clause);
Set_Node4 (N, Val); -- semantic field, no parent set
end Set_Library_Unit;
procedure Set_Limited_View_Installed
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Package_Specification
or else NT (N).Nkind = N_With_Clause);
Set_Flag18 (N, Val);
end Set_Limited_View_Installed;
procedure Set_Limited_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Formal_Derived_Type_Definition
or else NT (N).Nkind = N_Formal_Private_Type_Definition
or else NT (N).Nkind = N_Private_Extension_Declaration
or else NT (N).Nkind = N_Private_Type_Declaration
or else NT (N).Nkind = N_Record_Definition
or else NT (N).Nkind = N_With_Clause);
Set_Flag17 (N, Val);
end Set_Limited_Present;
procedure Set_Literals
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Enumeration_Type_Definition);
Set_List1_With_Parent (N, Val);
end Set_Literals;
procedure Set_Loop_Actions
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Association);
Set_List2 (N, Val); -- semantic field, no parent set
end Set_Loop_Actions;
procedure Set_Loop_Parameter_Specification
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Iteration_Scheme);
Set_Node4_With_Parent (N, Val);
end Set_Loop_Parameter_Specification;
procedure Set_Low_Bound
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Range
or else NT (N).Nkind = N_Real_Range_Specification
or else NT (N).Nkind = N_Signed_Integer_Type_Definition);
Set_Node1_With_Parent (N, Val);
end Set_Low_Bound;
procedure Set_Mod_Clause
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Record_Representation_Clause);
Set_Node2_With_Parent (N, Val);
end Set_Mod_Clause;
procedure Set_More_Ids
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Declaration
or else NT (N).Nkind = N_Discriminant_Specification
or else NT (N).Nkind = N_Exception_Declaration
or else NT (N).Nkind = N_Formal_Object_Declaration
or else NT (N).Nkind = N_Number_Declaration
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind = N_Parameter_Specification);
Set_Flag5 (N, Val);
end Set_More_Ids;
procedure Set_Must_Be_Byte_Aligned
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Attribute_Reference);
Set_Flag14 (N, Val);
end Set_Must_Be_Byte_Aligned;
procedure Set_Must_Not_Freeze
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subtype_Indication
or else NT (N).Nkind in N_Subexpr);
Set_Flag8 (N, Val);
end Set_Must_Not_Freeze;
procedure Set_Must_Not_Override
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Declaration
or else NT (N).Nkind = N_Function_Instantiation
or else NT (N).Nkind = N_Function_Specification
or else NT (N).Nkind = N_Procedure_Instantiation
or else NT (N).Nkind = N_Procedure_Specification);
Set_Flag15 (N, Val);
end Set_Must_Not_Override;
procedure Set_Must_Override
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Declaration
or else NT (N).Nkind = N_Function_Instantiation
or else NT (N).Nkind = N_Function_Specification
or else NT (N).Nkind = N_Procedure_Instantiation
or else NT (N).Nkind = N_Procedure_Specification);
Set_Flag14 (N, Val);
end Set_Must_Override;
procedure Set_Name
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Assignment_Statement
or else NT (N).Nkind = N_Attribute_Definition_Clause
or else NT (N).Nkind = N_Defining_Program_Unit_Name
or else NT (N).Nkind = N_Designator
or else NT (N).Nkind = N_Entry_Call_Statement
or else NT (N).Nkind = N_Exception_Renaming_Declaration
or else NT (N).Nkind = N_Exit_Statement
or else NT (N).Nkind = N_Formal_Package_Declaration
or else NT (N).Nkind = N_Function_Call
or else NT (N).Nkind = N_Function_Instantiation
or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration
or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration
or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration
or else NT (N).Nkind = N_Goto_Statement
or else NT (N).Nkind = N_Object_Renaming_Declaration
or else NT (N).Nkind = N_Package_Instantiation
or else NT (N).Nkind = N_Package_Renaming_Declaration
or else NT (N).Nkind = N_Procedure_Call_Statement
or else NT (N).Nkind = N_Procedure_Instantiation
or else NT (N).Nkind = N_Raise_Statement
or else NT (N).Nkind = N_Requeue_Statement
or else NT (N).Nkind = N_Subprogram_Renaming_Declaration
or else NT (N).Nkind = N_Subunit
or else NT (N).Nkind = N_Variant_Part
or else NT (N).Nkind = N_With_Clause
or else NT (N).Nkind = N_With_Type_Clause);
Set_Node2_With_Parent (N, Val);
end Set_Name;
procedure Set_Names
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Abort_Statement
or else NT (N).Nkind = N_Use_Package_Clause);
Set_List2_With_Parent (N, Val);
end Set_Names;
procedure Set_Next_Entity
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Defining_Character_Literal
or else NT (N).Nkind = N_Defining_Identifier
or else NT (N).Nkind = N_Defining_Operator_Symbol);
Set_Node2 (N, Val); -- semantic field, no parent set
end Set_Next_Entity;
procedure Set_Next_Named_Actual
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Parameter_Association);
Set_Node4 (N, Val); -- semantic field, no parent set
end Set_Next_Named_Actual;
procedure Set_Next_Rep_Item
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Attribute_Definition_Clause
or else NT (N).Nkind = N_Enumeration_Representation_Clause
or else NT (N).Nkind = N_Pragma
or else NT (N).Nkind = N_Record_Representation_Clause);
Set_Node4 (N, Val); -- semantic field, no parent set
end Set_Next_Rep_Item;
procedure Set_Next_Use_Clause
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Use_Package_Clause
or else NT (N).Nkind = N_Use_Type_Clause);
Set_Node3 (N, Val); -- semantic field, no parent set
end Set_Next_Use_Clause;
procedure Set_No_Ctrl_Actions
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Assignment_Statement);
Set_Flag7 (N, Val);
end Set_No_Ctrl_Actions;
procedure Set_No_Elaboration_Check
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Call
or else NT (N).Nkind = N_Procedure_Call_Statement);
Set_Flag14 (N, Val);
end Set_No_Elaboration_Check;
procedure Set_No_Entities_Ref_In_Spec
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
Set_Flag8 (N, Val);
end Set_No_Entities_Ref_In_Spec;
procedure Set_No_Initialization
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Allocator
or else NT (N).Nkind = N_Object_Declaration);
Set_Flag13 (N, Val);
end Set_No_Initialization;
procedure Set_No_Truncation
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Unchecked_Type_Conversion);
Set_Flag17 (N, Val);
end Set_No_Truncation;
procedure Set_Null_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_List
or else NT (N).Nkind = N_Procedure_Specification
or else NT (N).Nkind = N_Record_Definition);
Set_Flag13 (N, Val);
end Set_Null_Present;
procedure Set_Null_Exclusion_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Access_Definition
or else NT (N).Nkind = N_Access_Function_Definition
or else NT (N).Nkind = N_Access_Procedure_Definition
or else NT (N).Nkind = N_Access_To_Object_Definition
or else NT (N).Nkind = N_Allocator
or else NT (N).Nkind = N_Component_Definition
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Discriminant_Specification
or else NT (N).Nkind = N_Function_Specification
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind = N_Parameter_Specification
or else NT (N).Nkind = N_Subtype_Declaration);
Set_Flag11 (N, Val);
end Set_Null_Exclusion_Present;
procedure Set_Null_Record_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Aggregate
or else NT (N).Nkind = N_Extension_Aggregate);
Set_Flag17 (N, Val);
end Set_Null_Record_Present;
procedure Set_Object_Definition
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Object_Declaration);
Set_Node4_With_Parent (N, Val);
end Set_Object_Definition;
procedure Set_Original_Discriminant
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Identifier);
Set_Node2 (N, Val); -- semantic field, no parent set
end Set_Original_Discriminant;
procedure Set_Original_Entity
(N : Node_Id; Val : Entity_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Integer_Literal
or else NT (N).Nkind = N_Real_Literal);
Set_Node2 (N, Val); -- semantic field, no parent set
end Set_Original_Entity;
procedure Set_Others_Discrete_Choices
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Others_Choice);
Set_List1_With_Parent (N, Val);
end Set_Others_Discrete_Choices;
procedure Set_Out_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Object_Declaration
or else NT (N).Nkind = N_Parameter_Specification);
Set_Flag17 (N, Val);
end Set_Out_Present;
procedure Set_Parameter_Associations
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Entry_Call_Statement
or else NT (N).Nkind = N_Function_Call
or else NT (N).Nkind = N_Procedure_Call_Statement);
Set_List3_With_Parent (N, Val);
end Set_Parameter_Associations;
procedure Set_Parameter_List_Truncated
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Call
or else NT (N).Nkind = N_Procedure_Call_Statement);
Set_Flag17 (N, Val);
end Set_Parameter_List_Truncated;
procedure Set_Parameter_Specifications
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Statement
or else NT (N).Nkind = N_Access_Function_Definition
or else NT (N).Nkind = N_Access_Procedure_Definition
or else NT (N).Nkind = N_Entry_Body_Formal_Part
or else NT (N).Nkind = N_Entry_Declaration
or else NT (N).Nkind = N_Function_Specification
or else NT (N).Nkind = N_Procedure_Specification);
Set_List3_With_Parent (N, Val);
end Set_Parameter_Specifications;
procedure Set_Parameter_Type
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Parameter_Specification);
Set_Node2_With_Parent (N, Val);
end Set_Parameter_Type;
procedure Set_Parent_Spec
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Instantiation
or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration
or else NT (N).Nkind = N_Generic_Package_Declaration
or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration
or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration
or else NT (N).Nkind = N_Generic_Subprogram_Declaration
or else NT (N).Nkind = N_Package_Declaration
or else NT (N).Nkind = N_Package_Instantiation
or else NT (N).Nkind = N_Package_Renaming_Declaration
or else NT (N).Nkind = N_Procedure_Instantiation
or else NT (N).Nkind = N_Subprogram_Declaration
or else NT (N).Nkind = N_Subprogram_Renaming_Declaration);
Set_Node4 (N, Val); -- semantic field, no parent set
end Set_Parent_Spec;
procedure Set_Position
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Clause);
Set_Node2_With_Parent (N, Val);
end Set_Position;
procedure Set_Pragma_Argument_Associations
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Pragma);
Set_List2_With_Parent (N, Val);
end Set_Pragma_Argument_Associations;
procedure Set_Pragmas_After
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit_Aux
or else NT (N).Nkind = N_Terminate_Alternative);
Set_List5_With_Parent (N, Val);
end Set_Pragmas_After;
procedure Set_Pragmas_Before
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Accept_Alternative
or else NT (N).Nkind = N_Delay_Alternative
or else NT (N).Nkind = N_Entry_Call_Alternative
or else NT (N).Nkind = N_Mod_Clause
or else NT (N).Nkind = N_Terminate_Alternative
or else NT (N).Nkind = N_Triggering_Alternative);
Set_List4_With_Parent (N, Val);
end Set_Pragmas_Before;
procedure Set_Prefix
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Attribute_Reference
or else NT (N).Nkind = N_Expanded_Name
or else NT (N).Nkind = N_Explicit_Dereference
or else NT (N).Nkind = N_Indexed_Component
or else NT (N).Nkind = N_Reference
or else NT (N).Nkind = N_Selected_Component
or else NT (N).Nkind = N_Slice);
Set_Node3_With_Parent (N, Val);
end Set_Prefix;
procedure Set_Present_Expr
(N : Node_Id; Val : Uint) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Variant);
Set_Uint3 (N, Val);
end Set_Present_Expr;
procedure Set_Prev_Ids
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_Declaration
or else NT (N).Nkind = N_Discriminant_Specification
or else NT (N).Nkind = N_Exception_Declaration
or else NT (N).Nkind = N_Formal_Object_Declaration
or else NT (N).Nkind = N_Number_Declaration
or else NT (N).Nkind = N_Object_Declaration
or else NT (N).Nkind = N_Parameter_Specification);
Set_Flag6 (N, Val);
end Set_Prev_Ids;
procedure Set_Print_In_Hex
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Integer_Literal);
Set_Flag13 (N, Val);
end Set_Print_In_Hex;
procedure Set_Private_Declarations
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Package_Specification
or else NT (N).Nkind = N_Protected_Definition
or else NT (N).Nkind = N_Task_Definition);
Set_List3_With_Parent (N, Val);
end Set_Private_Declarations;
procedure Set_Private_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit
or else NT (N).Nkind = N_Formal_Derived_Type_Definition
or else NT (N).Nkind = N_With_Clause);
Set_Flag15 (N, Val);
end Set_Private_Present;
procedure Set_Procedure_To_Call
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Allocator
or else NT (N).Nkind = N_Free_Statement
or else NT (N).Nkind = N_Return_Statement);
Set_Node4 (N, Val); -- semantic field, no parent set
end Set_Procedure_To_Call;
procedure Set_Proper_Body
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subunit);
Set_Node1_With_Parent (N, Val);
end Set_Proper_Body;
procedure Set_Protected_Definition
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Protected_Type_Declaration
or else NT (N).Nkind = N_Single_Protected_Declaration);
Set_Node3_With_Parent (N, Val);
end Set_Protected_Definition;
procedure Set_Protected_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Access_Function_Definition
or else NT (N).Nkind = N_Access_Procedure_Definition
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Record_Definition);
Set_Flag6 (N, Val);
end Set_Protected_Present;
procedure Set_Raises_Constraint_Error
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind in N_Subexpr);
Set_Flag7 (N, Val);
end Set_Raises_Constraint_Error;
procedure Set_Range_Constraint
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Delta_Constraint
or else NT (N).Nkind = N_Digits_Constraint);
Set_Node4_With_Parent (N, Val);
end Set_Range_Constraint;
procedure Set_Range_Expression
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Range_Constraint);
Set_Node4_With_Parent (N, Val);
end Set_Range_Expression;
procedure Set_Real_Range_Specification
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition
or else NT (N).Nkind = N_Floating_Point_Definition
or else NT (N).Nkind = N_Ordinary_Fixed_Point_Definition);
Set_Node4_With_Parent (N, Val);
end Set_Real_Range_Specification;
procedure Set_Realval
(N : Node_Id; Val : Ureal) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Real_Literal);
Set_Ureal3 (N, Val);
end Set_Realval;
procedure Set_Reason
(N : Node_Id; Val : Uint) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Raise_Constraint_Error
or else NT (N).Nkind = N_Raise_Program_Error
or else NT (N).Nkind = N_Raise_Storage_Error);
Set_Uint3 (N, Val);
end Set_Reason;
procedure Set_Record_Extension_Part
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Derived_Type_Definition);
Set_Node3_With_Parent (N, Val);
end Set_Record_Extension_Part;
procedure Set_Redundant_Use
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Attribute_Reference
or else NT (N).Nkind = N_Expanded_Name
or else NT (N).Nkind = N_Identifier);
Set_Flag13 (N, Val);
end Set_Redundant_Use;
procedure Set_Result_Definition
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Access_Function_Definition
or else NT (N).Nkind = N_Function_Specification);
Set_Node4_With_Parent (N, Val);
end Set_Result_Definition;
procedure Set_Return_Type
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Return_Statement);
Set_Node2 (N, Val); -- semantic field, no parent set
end Set_Return_Type;
procedure Set_Reverse_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Loop_Parameter_Specification);
Set_Flag15 (N, Val);
end Set_Reverse_Present;
procedure Set_Right_Opnd
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind in N_Op
or else NT (N).Nkind = N_And_Then
or else NT (N).Nkind = N_In
or else NT (N).Nkind = N_Not_In
or else NT (N).Nkind = N_Or_Else);
Set_Node3_With_Parent (N, Val);
end Set_Right_Opnd;
procedure Set_Rounded_Result
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Op_Divide
or else NT (N).Nkind = N_Op_Multiply
or else NT (N).Nkind = N_Type_Conversion);
Set_Flag18 (N, Val);
end Set_Rounded_Result;
procedure Set_Scope
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Defining_Character_Literal
or else NT (N).Nkind = N_Defining_Identifier
or else NT (N).Nkind = N_Defining_Operator_Symbol);
Set_Node3 (N, Val); -- semantic field, no parent set
end Set_Scope;
procedure Set_Select_Alternatives
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Selective_Accept);
Set_List1_With_Parent (N, Val);
end Set_Select_Alternatives;
procedure Set_Selector_Name
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Expanded_Name
or else NT (N).Nkind = N_Generic_Association
or else NT (N).Nkind = N_Parameter_Association
or else NT (N).Nkind = N_Selected_Component);
Set_Node2_With_Parent (N, Val);
end Set_Selector_Name;
procedure Set_Selector_Names
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Discriminant_Association);
Set_List1_With_Parent (N, Val);
end Set_Selector_Names;
procedure Set_Shift_Count_OK
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Op_Rotate_Left
or else NT (N).Nkind = N_Op_Rotate_Right
or else NT (N).Nkind = N_Op_Shift_Left
or else NT (N).Nkind = N_Op_Shift_Right
or else NT (N).Nkind = N_Op_Shift_Right_Arithmetic);
Set_Flag4 (N, Val);
end Set_Shift_Count_OK;
procedure Set_Source_Type
(N : Node_Id; Val : Entity_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Validate_Unchecked_Conversion);
Set_Node1 (N, Val); -- semantic field, no parent set
end Set_Source_Type;
procedure Set_Specification
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Abstract_Subprogram_Declaration
or else NT (N).Nkind = N_Formal_Abstract_Subprogram_Declaration
or else NT (N).Nkind = N_Formal_Concrete_Subprogram_Declaration
or else NT (N).Nkind = N_Generic_Package_Declaration
or else NT (N).Nkind = N_Generic_Subprogram_Declaration
or else NT (N).Nkind = N_Package_Declaration
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Subprogram_Body_Stub
or else NT (N).Nkind = N_Subprogram_Declaration
or else NT (N).Nkind = N_Subprogram_Renaming_Declaration);
Set_Node1_With_Parent (N, Val);
end Set_Specification;
procedure Set_Statements
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Abortable_Part
or else NT (N).Nkind = N_Accept_Alternative
or else NT (N).Nkind = N_Case_Statement_Alternative
or else NT (N).Nkind = N_Delay_Alternative
or else NT (N).Nkind = N_Entry_Call_Alternative
or else NT (N).Nkind = N_Exception_Handler
or else NT (N).Nkind = N_Handled_Sequence_Of_Statements
or else NT (N).Nkind = N_Loop_Statement
or else NT (N).Nkind = N_Triggering_Alternative);
Set_List3_With_Parent (N, Val);
end Set_Statements;
procedure Set_Static_Processing_OK
(N : Node_Id; Val : Boolean) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Aggregate);
Set_Flag4 (N, Val);
end Set_Static_Processing_OK;
procedure Set_Storage_Pool
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Allocator
or else NT (N).Nkind = N_Free_Statement
or else NT (N).Nkind = N_Return_Statement);
Set_Node1 (N, Val); -- semantic field, no parent set
end Set_Storage_Pool;
procedure Set_Strval
(N : Node_Id; Val : String_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Operator_Symbol
or else NT (N).Nkind = N_String_Literal);
Set_Str3 (N, Val);
end Set_Strval;
procedure Set_Subtype_Indication
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Access_To_Object_Definition
or else NT (N).Nkind = N_Component_Definition
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Private_Extension_Declaration
or else NT (N).Nkind = N_Subtype_Declaration);
Set_Node5_With_Parent (N, Val);
end Set_Subtype_Indication;
procedure Set_Subtype_Mark
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Access_Definition
or else NT (N).Nkind = N_Formal_Derived_Type_Definition
or else NT (N).Nkind = N_Formal_Object_Declaration
or else NT (N).Nkind = N_Object_Renaming_Declaration
or else NT (N).Nkind = N_Qualified_Expression
or else NT (N).Nkind = N_Subtype_Indication
or else NT (N).Nkind = N_Type_Conversion
or else NT (N).Nkind = N_Unchecked_Type_Conversion);
Set_Node4_With_Parent (N, Val);
end Set_Subtype_Mark;
procedure Set_Subtype_Marks
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Unconstrained_Array_Definition
or else NT (N).Nkind = N_Use_Type_Clause);
Set_List2_With_Parent (N, Val);
end Set_Subtype_Marks;
procedure Set_Synchronized_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Record_Definition);
Set_Flag7 (N, Val);
end Set_Synchronized_Present;
procedure Set_Tagged_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Private_Type_Definition
or else NT (N).Nkind = N_Incomplete_Type_Declaration
or else NT (N).Nkind = N_Private_Type_Declaration
or else NT (N).Nkind = N_Record_Definition
or else NT (N).Nkind = N_With_Type_Clause);
Set_Flag15 (N, Val);
end Set_Tagged_Present;
procedure Set_Target_Type
(N : Node_Id; Val : Entity_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Validate_Unchecked_Conversion);
Set_Node2 (N, Val); -- semantic field, no parent set
end Set_Target_Type;
procedure Set_Task_Definition
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Single_Task_Declaration
or else NT (N).Nkind = N_Task_Type_Declaration);
Set_Node3_With_Parent (N, Val);
end Set_Task_Definition;
procedure Set_Task_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Derived_Type_Definition
or else NT (N).Nkind = N_Record_Definition);
Set_Flag5 (N, Val);
end Set_Task_Present;
procedure Set_Then_Actions
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Conditional_Expression);
Set_List2 (N, Val); -- semantic field, no parent set
end Set_Then_Actions;
procedure Set_Then_Statements
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Elsif_Part
or else NT (N).Nkind = N_If_Statement);
Set_List2_With_Parent (N, Val);
end Set_Then_Statements;
procedure Set_Treat_Fixed_As_Integer
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Op_Divide
or else NT (N).Nkind = N_Op_Mod
or else NT (N).Nkind = N_Op_Multiply
or else NT (N).Nkind = N_Op_Rem);
Set_Flag14 (N, Val);
end Set_Treat_Fixed_As_Integer;
procedure Set_Triggering_Alternative
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Asynchronous_Select);
Set_Node1_With_Parent (N, Val);
end Set_Triggering_Alternative;
procedure Set_Triggering_Statement
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Triggering_Alternative);
Set_Node1_With_Parent (N, Val);
end Set_Triggering_Statement;
procedure Set_TSS_Elist
(N : Node_Id; Val : Elist_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Freeze_Entity);
Set_Elist3 (N, Val); -- semantic field, no parent set
end Set_TSS_Elist;
procedure Set_Type_Definition
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Full_Type_Declaration);
Set_Node3_With_Parent (N, Val);
end Set_Type_Definition;
procedure Set_Unit
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Compilation_Unit);
Set_Node2_With_Parent (N, Val);
end Set_Unit;
procedure Set_Unknown_Discriminants_Present
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Formal_Type_Declaration
or else NT (N).Nkind = N_Incomplete_Type_Declaration
or else NT (N).Nkind = N_Private_Extension_Declaration
or else NT (N).Nkind = N_Private_Type_Declaration);
Set_Flag13 (N, Val);
end Set_Unknown_Discriminants_Present;
procedure Set_Unreferenced_In_Spec
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_With_Clause);
Set_Flag7 (N, Val);
end Set_Unreferenced_In_Spec;
procedure Set_Variant_Part
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Component_List);
Set_Node4_With_Parent (N, Val);
end Set_Variant_Part;
procedure Set_Variants
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Variant_Part);
Set_List1_With_Parent (N, Val);
end Set_Variants;
procedure Set_Visible_Declarations
(N : Node_Id; Val : List_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Package_Specification
or else NT (N).Nkind = N_Protected_Definition
or else NT (N).Nkind = N_Task_Definition);
Set_List2_With_Parent (N, Val);
end Set_Visible_Declarations;
procedure Set_Was_Originally_Stub
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Package_Body
or else NT (N).Nkind = N_Protected_Body
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Task_Body);
Set_Flag13 (N, Val);
end Set_Was_Originally_Stub;
procedure Set_Zero_Cost_Handling
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Exception_Handler
or else NT (N).Nkind = N_Handled_Sequence_Of_Statements);
Set_Flag5 (N, Val);
end Set_Zero_Cost_Handling;
-------------------------
-- Iterator Procedures --
-------------------------
procedure Next_Entity (N : in out Node_Id) is
begin
N := Next_Entity (N);
end Next_Entity;
procedure Next_Named_Actual (N : in out Node_Id) is
begin
N := Next_Named_Actual (N);
end Next_Named_Actual;
procedure Next_Rep_Item (N : in out Node_Id) is
begin
N := Next_Rep_Item (N);
end Next_Rep_Item;
procedure Next_Use_Clause (N : in out Node_Id) is
begin
N := Next_Use_Clause (N);
end Next_Use_Clause;
------------------
-- End_Location --
------------------
function End_Location (N : Node_Id) return Source_Ptr is
L : constant Uint := End_Span (N);
begin
if L = No_Uint then
return No_Location;
else
return Source_Ptr (Int (Sloc (N)) + UI_To_Int (L));
end if;
end End_Location;
----------------------
-- Set_End_Location --
----------------------
procedure Set_End_Location (N : Node_Id; S : Source_Ptr) is
begin
Set_End_Span (N,
UI_From_Int (Int (S) - Int (Sloc (N))));
end Set_End_Location;
end Sinfo;
| 32.026838 | 79 | 0.650761 |
c56a6d9c38ef9d7d523035a7d7c23407c9322140 | 497 | ads | Ada | Ada/inc/Problem_50.ads | Tim-Tom/project-euler | 177e0043ee93409742ec596c4379251f681b4275 | [
"Unlicense"
] | null | null | null | Ada/inc/Problem_50.ads | Tim-Tom/project-euler | 177e0043ee93409742ec596c4379251f681b4275 | [
"Unlicense"
] | null | null | null | Ada/inc/Problem_50.ads | Tim-Tom/project-euler | 177e0043ee93409742ec596c4379251f681b4275 | [
"Unlicense"
] | null | null | null | package Problem_50 is
-- The prime 41, can be written as the sum of six consecutive primes:
-- 41 = 2 + 3 + 5 + 7 + 11 + 13
-- This is the longest sum of consecutive primes that adds to a prime below
-- one-hundred. The longest sum of consecutive primes below one-thousand that
-- adds to a prime, contains 21 terms, and is equal to 953.
--
-- Which prime, below one-million, can be written as the sum of the most
-- consecutive primes?
procedure Solve;
end Problem_50;
| 41.416667 | 80 | 0.688129 |
c548709b73acdf84928bc1239d495bd95764ad30 | 1,016 | ads | Ada | state.ads | fsivan58/str-distracciones | c8201b1394f8952ead590cf4bb102ac13a2a2943 | [
"MIT"
] | null | null | null | state.ads | fsivan58/str-distracciones | c8201b1394f8952ead590cf4bb102ac13a2a2943 | [
"MIT"
] | null | null | null | state.ads | fsivan58/str-distracciones | c8201b1394f8952ead590cf4bb102ac13a2a2943 | [
"MIT"
] | null | null | null | -- Gonzalo Martin Rodriguez
-- Ivan Fernandez Samaniego
with Priorities; use Priorities;
with devices; use devices;
with Ada.Interrupts.Names;
with System; use System;
package State is
task Display is
pragma Priority (Display_Priority);
end Display;
task Risks is
pragma Priority (Risk_Priority);
end Risks;
task Sporadic_Task is
pragma Priority (Sporadic_Priority);
end Sporadic_Task;
protected Operation_Mode is
pragma Priority (Risk_Priority);
procedure Write_Mode (Value: in integer);
procedure Read_Mode (Value: out integer);
private
Mode: integer := 1;
end Operation_Mode;
protected Interruption_Handler is
pragma Priority (System.Interrupt_Priority'First + 10);
procedure Validate_Entry;
pragma Attach_Handler (Validate_Entry, Ada.Interrupts.Names.External_Interrupt_2);
entry Change_Mode;
private
Enter: Boolean := False;
end Interruption_Handler;
end State;
| 24.780488 | 90 | 0.69685 |
dc33b1c9dcded7518d55404f21a315dca2000da3 | 1,554 | ads | Ada | src/util/spat-gpr_support.ads | HeisenbugLtd/spat | c3ec2b7675a12bdbe5378862b1ec6b17805d5a6c | [
"WTFPL"
] | 20 | 2020-05-17T18:55:16.000Z | 2021-05-26T14:53:53.000Z | src/util/spat-gpr_support.ads | selroc/spat | c3ec2b7675a12bdbe5378862b1ec6b17805d5a6c | [
"WTFPL"
] | 33 | 2020-04-03T13:08:50.000Z | 2020-10-17T04:26:34.000Z | src/util/spat-gpr_support.ads | selroc/spat | c3ec2b7675a12bdbe5378862b1ec6b17805d5a6c | [
"WTFPL"
] | 4 | 2020-06-12T12:17:27.000Z | 2021-09-09T14:19:31.000Z | ------------------------------------------------------------------------------
-- Copyright (C) 2020 by Heisenbug Ltd. (gh+spat@heisenbug.eu)
--
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the LICENSE file for more details.
------------------------------------------------------------------------------
pragma License (Unrestricted);
------------------------------------------------------------------------------
--
-- SPARK Proof Analysis Tool
--
-- S.P.A.T. - GNAT project file (.gpr) support.
--
------------------------------------------------------------------------------
limited with Ada.Containers.Hashed_Maps;
limited with GNATCOLL.VFS;
package SPAT.GPR_Support is
package SPARK_Source_Maps is new
Ada.Containers.Hashed_Maps (Key_Type => SPARK_File_Name,
Element_Type => Source_File_Name,
Hash => SPAT.Hash,
Equivalent_Keys => "=",
"=" => "=");
---------------------------------------------------------------------------
-- Get_SPARK_Files
--
-- Retrieve all (existing) .spark files from the project.
---------------------------------------------------------------------------
function Get_SPARK_Files
(GPR_File : GNATCOLL.VFS.Filesystem_String) return SPARK_Source_Maps.Map;
end SPAT.GPR_Support;
| 39.846154 | 78 | 0.422136 |
dce4321ab3b64c38374fc6ecd761c26e5dcbc1df | 1,139 | ada | Ada | demos/pi.ada | daveshields/AdaEd | 57daecfb7ccadfd9aaf13b4d54f51065affbe599 | [
"BSD-4-Clause",
"BSD-3-Clause"
] | 3 | 2019-05-11T04:11:33.000Z | 2021-04-18T14:55:43.000Z | demos/pi.ada | daveshields/AdaEd | 57daecfb7ccadfd9aaf13b4d54f51065affbe599 | [
"BSD-4-Clause",
"BSD-3-Clause"
] | null | null | null | demos/pi.ada | daveshields/AdaEd | 57daecfb7ccadfd9aaf13b4d54f51065affbe599 | [
"BSD-4-Clause",
"BSD-3-Clause"
] | 2 | 2016-10-29T22:52:56.000Z | 2021-04-18T14:55:45.000Z | generic
type real is digits <>;
function sqrt(y : real) return real;
function sqrt(y : real) return real is
x, t : real := y;
begin
if y < 0.0 then
raise NUMERIC_ERROR;
else
loop
t := (x + y / x)/ 2.0;
exit when abs(x - t) <= real'epsilon;
x := t;
end loop;
return x;
end if;
end sqrt;
with sqrt;
with text_io; use text_io;
procedure main is
package real_io is new FLOAT_IO(float);
use real_io;
package int_io is new INTEGER_IO(integer);
use int_io;
epsilon : constant := float'epsilon;
function sqrt is new sqrt(float);
procedure pi_comp is
pi : float := 1.0;
n : integer := 1;
temp : float;
sum : float := 1.0;
begin
loop
n := n + 2;
temp := 1.0 / float(n) ** 4;
put("Term number ");
put((n + 1)/2);
put(" is: ");
put(temp);
new_line;
exit when temp <= epsilon;
sum := sum + temp;
end loop;
put("The sum is: ");
put(sum);
new_line;
pi := sqrt(sqrt(96.0 * sum));
put("The value of PI is ");
put(pi);
new_line;
end pi_comp;
begin
pi_comp;
end main;
| 15.391892 | 45 | 0.546093 |
4a8f3cb1ada75ab33ea2f55899d4c1dc788ad73a | 62,546 | ads | Ada | arch/ARM/STM32/svd/stm32l4x6/stm32_svd-can.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 2 | 2018-05-16T03:56:39.000Z | 2019-07-31T13:53:56.000Z | arch/ARM/STM32/svd/stm32l4x6/stm32_svd-can.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | arch/ARM/STM32/svd/stm32l4x6/stm32_svd-can.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | -- This spec has been automatically generated from STM32L4x6.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.CAN is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- master control register
type MCR_Register is record
-- INRQ
INRQ : Boolean := False;
-- SLEEP
SLEEP : Boolean := True;
-- TXFP
TXFP : Boolean := False;
-- RFLM
RFLM : Boolean := False;
-- NART
NART : Boolean := False;
-- AWUM
AWUM : Boolean := False;
-- ABOM
ABOM : Boolean := False;
-- TTCM
TTCM : Boolean := False;
-- unspecified
Reserved_8_14 : HAL.UInt7 := 16#0#;
-- RESET
RESET : Boolean := False;
-- DBF
DBF : Boolean := True;
-- unspecified
Reserved_17_31 : HAL.UInt15 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for MCR_Register use record
INRQ at 0 range 0 .. 0;
SLEEP at 0 range 1 .. 1;
TXFP at 0 range 2 .. 2;
RFLM at 0 range 3 .. 3;
NART at 0 range 4 .. 4;
AWUM at 0 range 5 .. 5;
ABOM at 0 range 6 .. 6;
TTCM at 0 range 7 .. 7;
Reserved_8_14 at 0 range 8 .. 14;
RESET at 0 range 15 .. 15;
DBF at 0 range 16 .. 16;
Reserved_17_31 at 0 range 17 .. 31;
end record;
-- master status register
type MSR_Register is record
-- Read-only. INAK
INAK : Boolean := False;
-- Read-only. SLAK
SLAK : Boolean := True;
-- ERRI
ERRI : Boolean := False;
-- WKUI
WKUI : Boolean := False;
-- SLAKI
SLAKI : Boolean := False;
-- unspecified
Reserved_5_7 : HAL.UInt3 := 16#0#;
-- Read-only. TXM
TXM : Boolean := False;
-- Read-only. RXM
RXM : Boolean := False;
-- Read-only. SAMP
SAMP : Boolean := True;
-- Read-only. RX
RX : Boolean := True;
-- unspecified
Reserved_12_31 : HAL.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for MSR_Register use record
INAK at 0 range 0 .. 0;
SLAK at 0 range 1 .. 1;
ERRI at 0 range 2 .. 2;
WKUI at 0 range 3 .. 3;
SLAKI at 0 range 4 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
TXM at 0 range 8 .. 8;
RXM at 0 range 9 .. 9;
SAMP at 0 range 10 .. 10;
RX at 0 range 11 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
subtype TSR_CODE_Field is HAL.UInt2;
-- TSR_TME array
type TSR_TME_Field_Array is array (0 .. 2) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for TSR_TME
type TSR_TME_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TME as a value
Val : HAL.UInt3;
when True =>
-- TME as an array
Arr : TSR_TME_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for TSR_TME_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- TSR_LOW array
type TSR_LOW_Field_Array is array (0 .. 2) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for TSR_LOW
type TSR_LOW_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- LOW as a value
Val : HAL.UInt3;
when True =>
-- LOW as an array
Arr : TSR_LOW_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for TSR_LOW_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- transmit status register
type TSR_Register is record
-- RQCP0
RQCP0 : Boolean := False;
-- TXOK0
TXOK0 : Boolean := False;
-- ALST0
ALST0 : Boolean := False;
-- TERR0
TERR0 : Boolean := False;
-- unspecified
Reserved_4_6 : HAL.UInt3 := 16#0#;
-- ABRQ0
ABRQ0 : Boolean := False;
-- RQCP1
RQCP1 : Boolean := False;
-- TXOK1
TXOK1 : Boolean := False;
-- ALST1
ALST1 : Boolean := False;
-- TERR1
TERR1 : Boolean := False;
-- unspecified
Reserved_12_14 : HAL.UInt3 := 16#0#;
-- ABRQ1
ABRQ1 : Boolean := False;
-- RQCP2
RQCP2 : Boolean := False;
-- TXOK2
TXOK2 : Boolean := False;
-- ALST2
ALST2 : Boolean := False;
-- TERR2
TERR2 : Boolean := False;
-- unspecified
Reserved_20_22 : HAL.UInt3 := 16#0#;
-- ABRQ2
ABRQ2 : Boolean := False;
-- Read-only. CODE
CODE : TSR_CODE_Field := 16#0#;
-- Read-only. Lowest priority flag for mailbox 0
TME : TSR_TME_Field := (As_Array => False, Val => 16#1#);
-- Read-only. Lowest priority flag for mailbox 0
LOW : TSR_LOW_Field := (As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TSR_Register use record
RQCP0 at 0 range 0 .. 0;
TXOK0 at 0 range 1 .. 1;
ALST0 at 0 range 2 .. 2;
TERR0 at 0 range 3 .. 3;
Reserved_4_6 at 0 range 4 .. 6;
ABRQ0 at 0 range 7 .. 7;
RQCP1 at 0 range 8 .. 8;
TXOK1 at 0 range 9 .. 9;
ALST1 at 0 range 10 .. 10;
TERR1 at 0 range 11 .. 11;
Reserved_12_14 at 0 range 12 .. 14;
ABRQ1 at 0 range 15 .. 15;
RQCP2 at 0 range 16 .. 16;
TXOK2 at 0 range 17 .. 17;
ALST2 at 0 range 18 .. 18;
TERR2 at 0 range 19 .. 19;
Reserved_20_22 at 0 range 20 .. 22;
ABRQ2 at 0 range 23 .. 23;
CODE at 0 range 24 .. 25;
TME at 0 range 26 .. 28;
LOW at 0 range 29 .. 31;
end record;
subtype RF0R_FMP0_Field is HAL.UInt2;
-- receive FIFO 0 register
type RF0R_Register is record
-- Read-only. FMP0
FMP0 : RF0R_FMP0_Field := 16#0#;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- FULL0
FULL0 : Boolean := False;
-- FOVR0
FOVR0 : Boolean := False;
-- RFOM0
RFOM0 : 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 RF0R_Register use record
FMP0 at 0 range 0 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
FULL0 at 0 range 3 .. 3;
FOVR0 at 0 range 4 .. 4;
RFOM0 at 0 range 5 .. 5;
Reserved_6_31 at 0 range 6 .. 31;
end record;
subtype RF1R_FMP1_Field is HAL.UInt2;
-- receive FIFO 1 register
type RF1R_Register is record
-- Read-only. FMP1
FMP1 : RF1R_FMP1_Field := 16#0#;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- FULL1
FULL1 : Boolean := False;
-- FOVR1
FOVR1 : Boolean := False;
-- RFOM1
RFOM1 : 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 RF1R_Register use record
FMP1 at 0 range 0 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
FULL1 at 0 range 3 .. 3;
FOVR1 at 0 range 4 .. 4;
RFOM1 at 0 range 5 .. 5;
Reserved_6_31 at 0 range 6 .. 31;
end record;
-- interrupt enable register
type IER_Register is record
-- TMEIE
TMEIE : Boolean := False;
-- FMPIE0
FMPIE0 : Boolean := False;
-- FFIE0
FFIE0 : Boolean := False;
-- FOVIE0
FOVIE0 : Boolean := False;
-- FMPIE1
FMPIE1 : Boolean := False;
-- FFIE1
FFIE1 : Boolean := False;
-- FOVIE1
FOVIE1 : Boolean := False;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- EWGIE
EWGIE : Boolean := False;
-- EPVIE
EPVIE : Boolean := False;
-- BOFIE
BOFIE : Boolean := False;
-- LECIE
LECIE : Boolean := False;
-- unspecified
Reserved_12_14 : HAL.UInt3 := 16#0#;
-- ERRIE
ERRIE : Boolean := False;
-- WKUIE
WKUIE : Boolean := False;
-- SLKIE
SLKIE : Boolean := False;
-- unspecified
Reserved_18_31 : HAL.UInt14 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IER_Register use record
TMEIE at 0 range 0 .. 0;
FMPIE0 at 0 range 1 .. 1;
FFIE0 at 0 range 2 .. 2;
FOVIE0 at 0 range 3 .. 3;
FMPIE1 at 0 range 4 .. 4;
FFIE1 at 0 range 5 .. 5;
FOVIE1 at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
EWGIE at 0 range 8 .. 8;
EPVIE at 0 range 9 .. 9;
BOFIE at 0 range 10 .. 10;
LECIE at 0 range 11 .. 11;
Reserved_12_14 at 0 range 12 .. 14;
ERRIE at 0 range 15 .. 15;
WKUIE at 0 range 16 .. 16;
SLKIE at 0 range 17 .. 17;
Reserved_18_31 at 0 range 18 .. 31;
end record;
subtype ESR_LEC_Field is HAL.UInt3;
subtype ESR_TEC_Field is HAL.UInt8;
subtype ESR_REC_Field is HAL.UInt8;
-- interrupt enable register
type ESR_Register is record
-- Read-only. EWGF
EWGF : Boolean := False;
-- Read-only. EPVF
EPVF : Boolean := False;
-- Read-only. BOFF
BOFF : Boolean := False;
-- unspecified
Reserved_3_3 : HAL.Bit := 16#0#;
-- LEC
LEC : ESR_LEC_Field := 16#0#;
-- unspecified
Reserved_7_15 : HAL.UInt9 := 16#0#;
-- Read-only. TEC
TEC : ESR_TEC_Field := 16#0#;
-- Read-only. REC
REC : ESR_REC_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ESR_Register use record
EWGF at 0 range 0 .. 0;
EPVF at 0 range 1 .. 1;
BOFF at 0 range 2 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
LEC at 0 range 4 .. 6;
Reserved_7_15 at 0 range 7 .. 15;
TEC at 0 range 16 .. 23;
REC at 0 range 24 .. 31;
end record;
subtype BTR_BRP_Field is HAL.UInt10;
subtype BTR_TS1_Field is HAL.UInt4;
subtype BTR_TS2_Field is HAL.UInt3;
subtype BTR_SJW_Field is HAL.UInt2;
-- bit timing register
type BTR_Register is record
-- BRP
BRP : BTR_BRP_Field := 16#0#;
-- unspecified
Reserved_10_15 : HAL.UInt6 := 16#0#;
-- TS1
TS1 : BTR_TS1_Field := 16#0#;
-- TS2
TS2 : BTR_TS2_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- SJW
SJW : BTR_SJW_Field := 16#0#;
-- unspecified
Reserved_26_29 : HAL.UInt4 := 16#0#;
-- LBKM
LBKM : Boolean := False;
-- SILM
SILM : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BTR_Register use record
BRP at 0 range 0 .. 9;
Reserved_10_15 at 0 range 10 .. 15;
TS1 at 0 range 16 .. 19;
TS2 at 0 range 20 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
SJW at 0 range 24 .. 25;
Reserved_26_29 at 0 range 26 .. 29;
LBKM at 0 range 30 .. 30;
SILM at 0 range 31 .. 31;
end record;
subtype TI0R_EXID_Field is HAL.UInt18;
subtype TI0R_STID_Field is HAL.UInt11;
-- TX mailbox identifier register
type TI0R_Register is record
-- TXRQ
TXRQ : Boolean := False;
-- RTR
RTR : Boolean := False;
-- IDE
IDE : Boolean := False;
-- EXID
EXID : TI0R_EXID_Field := 16#0#;
-- STID
STID : TI0R_STID_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TI0R_Register use record
TXRQ at 0 range 0 .. 0;
RTR at 0 range 1 .. 1;
IDE at 0 range 2 .. 2;
EXID at 0 range 3 .. 20;
STID at 0 range 21 .. 31;
end record;
subtype TDT0R_DLC_Field is HAL.UInt4;
subtype TDT0R_TIME_Field is HAL.UInt16;
-- mailbox data length control and time stamp register
type TDT0R_Register is record
-- DLC
DLC : TDT0R_DLC_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- TGT
TGT : Boolean := False;
-- unspecified
Reserved_9_15 : HAL.UInt7 := 16#0#;
-- TIME
TIME : TDT0R_TIME_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TDT0R_Register use record
DLC at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
TGT at 0 range 8 .. 8;
Reserved_9_15 at 0 range 9 .. 15;
TIME at 0 range 16 .. 31;
end record;
-- TDL0R_DATA array element
subtype TDL0R_DATA_Element is HAL.UInt8;
-- TDL0R_DATA array
type TDL0R_DATA_Field_Array is array (0 .. 3) of TDL0R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data low register
type TDL0R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : TDL0R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for TDL0R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- TDH0R_DATA array element
subtype TDH0R_DATA_Element is HAL.UInt8;
-- TDH0R_DATA array
type TDH0R_DATA_Field_Array is array (4 .. 7) of TDH0R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data high register
type TDH0R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : TDH0R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for TDH0R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype TI1R_EXID_Field is HAL.UInt18;
subtype TI1R_STID_Field is HAL.UInt11;
-- mailbox identifier register
type TI1R_Register is record
-- TXRQ
TXRQ : Boolean := False;
-- RTR
RTR : Boolean := False;
-- IDE
IDE : Boolean := False;
-- EXID
EXID : TI1R_EXID_Field := 16#0#;
-- STID
STID : TI1R_STID_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TI1R_Register use record
TXRQ at 0 range 0 .. 0;
RTR at 0 range 1 .. 1;
IDE at 0 range 2 .. 2;
EXID at 0 range 3 .. 20;
STID at 0 range 21 .. 31;
end record;
subtype TDT1R_DLC_Field is HAL.UInt4;
subtype TDT1R_TIME_Field is HAL.UInt16;
-- mailbox data length control and time stamp register
type TDT1R_Register is record
-- DLC
DLC : TDT1R_DLC_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- TGT
TGT : Boolean := False;
-- unspecified
Reserved_9_15 : HAL.UInt7 := 16#0#;
-- TIME
TIME : TDT1R_TIME_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TDT1R_Register use record
DLC at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
TGT at 0 range 8 .. 8;
Reserved_9_15 at 0 range 9 .. 15;
TIME at 0 range 16 .. 31;
end record;
-- TDL1R_DATA array element
subtype TDL1R_DATA_Element is HAL.UInt8;
-- TDL1R_DATA array
type TDL1R_DATA_Field_Array is array (0 .. 3) of TDL1R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data low register
type TDL1R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : TDL1R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for TDL1R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- TDH1R_DATA array element
subtype TDH1R_DATA_Element is HAL.UInt8;
-- TDH1R_DATA array
type TDH1R_DATA_Field_Array is array (4 .. 7) of TDH1R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data high register
type TDH1R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : TDH1R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for TDH1R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype TI2R_EXID_Field is HAL.UInt18;
subtype TI2R_STID_Field is HAL.UInt11;
-- mailbox identifier register
type TI2R_Register is record
-- TXRQ
TXRQ : Boolean := False;
-- RTR
RTR : Boolean := False;
-- IDE
IDE : Boolean := False;
-- EXID
EXID : TI2R_EXID_Field := 16#0#;
-- STID
STID : TI2R_STID_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TI2R_Register use record
TXRQ at 0 range 0 .. 0;
RTR at 0 range 1 .. 1;
IDE at 0 range 2 .. 2;
EXID at 0 range 3 .. 20;
STID at 0 range 21 .. 31;
end record;
subtype TDT2R_DLC_Field is HAL.UInt4;
subtype TDT2R_TIME_Field is HAL.UInt16;
-- mailbox data length control and time stamp register
type TDT2R_Register is record
-- DLC
DLC : TDT2R_DLC_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- TGT
TGT : Boolean := False;
-- unspecified
Reserved_9_15 : HAL.UInt7 := 16#0#;
-- TIME
TIME : TDT2R_TIME_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TDT2R_Register use record
DLC at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
TGT at 0 range 8 .. 8;
Reserved_9_15 at 0 range 9 .. 15;
TIME at 0 range 16 .. 31;
end record;
-- TDL2R_DATA array element
subtype TDL2R_DATA_Element is HAL.UInt8;
-- TDL2R_DATA array
type TDL2R_DATA_Field_Array is array (0 .. 3) of TDL2R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data low register
type TDL2R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : TDL2R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for TDL2R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- TDH2R_DATA array element
subtype TDH2R_DATA_Element is HAL.UInt8;
-- TDH2R_DATA array
type TDH2R_DATA_Field_Array is array (4 .. 7) of TDH2R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data high register
type TDH2R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : TDH2R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for TDH2R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype RI0R_EXID_Field is HAL.UInt18;
subtype RI0R_STID_Field is HAL.UInt11;
-- receive FIFO mailbox identifier register
type RI0R_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit;
-- Read-only. RTR
RTR : Boolean;
-- Read-only. IDE
IDE : Boolean;
-- Read-only. EXID
EXID : RI0R_EXID_Field;
-- Read-only. STID
STID : RI0R_STID_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RI0R_Register use record
Reserved_0_0 at 0 range 0 .. 0;
RTR at 0 range 1 .. 1;
IDE at 0 range 2 .. 2;
EXID at 0 range 3 .. 20;
STID at 0 range 21 .. 31;
end record;
subtype RDT0R_DLC_Field is HAL.UInt4;
subtype RDT0R_FMI_Field is HAL.UInt8;
subtype RDT0R_TIME_Field is HAL.UInt16;
-- mailbox data high register
type RDT0R_Register is record
-- Read-only. DLC
DLC : RDT0R_DLC_Field;
-- unspecified
Reserved_4_7 : HAL.UInt4;
-- Read-only. FMI
FMI : RDT0R_FMI_Field;
-- Read-only. TIME
TIME : RDT0R_TIME_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RDT0R_Register use record
DLC at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
FMI at 0 range 8 .. 15;
TIME at 0 range 16 .. 31;
end record;
-- RDL0R_DATA array element
subtype RDL0R_DATA_Element is HAL.UInt8;
-- RDL0R_DATA array
type RDL0R_DATA_Field_Array is array (0 .. 3) of RDL0R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data high register
type RDL0R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : RDL0R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for RDL0R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- RDH0R_DATA array element
subtype RDH0R_DATA_Element is HAL.UInt8;
-- RDH0R_DATA array
type RDH0R_DATA_Field_Array is array (4 .. 7) of RDH0R_DATA_Element
with Component_Size => 8, Size => 32;
-- receive FIFO mailbox data high register
type RDH0R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : RDH0R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for RDH0R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype RI1R_EXID_Field is HAL.UInt18;
subtype RI1R_STID_Field is HAL.UInt11;
-- mailbox data high register
type RI1R_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit;
-- Read-only. RTR
RTR : Boolean;
-- Read-only. IDE
IDE : Boolean;
-- Read-only. EXID
EXID : RI1R_EXID_Field;
-- Read-only. STID
STID : RI1R_STID_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RI1R_Register use record
Reserved_0_0 at 0 range 0 .. 0;
RTR at 0 range 1 .. 1;
IDE at 0 range 2 .. 2;
EXID at 0 range 3 .. 20;
STID at 0 range 21 .. 31;
end record;
subtype RDT1R_DLC_Field is HAL.UInt4;
subtype RDT1R_FMI_Field is HAL.UInt8;
subtype RDT1R_TIME_Field is HAL.UInt16;
-- mailbox data high register
type RDT1R_Register is record
-- Read-only. DLC
DLC : RDT1R_DLC_Field;
-- unspecified
Reserved_4_7 : HAL.UInt4;
-- Read-only. FMI
FMI : RDT1R_FMI_Field;
-- Read-only. TIME
TIME : RDT1R_TIME_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RDT1R_Register use record
DLC at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
FMI at 0 range 8 .. 15;
TIME at 0 range 16 .. 31;
end record;
-- RDL1R_DATA array element
subtype RDL1R_DATA_Element is HAL.UInt8;
-- RDL1R_DATA array
type RDL1R_DATA_Field_Array is array (0 .. 3) of RDL1R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data high register
type RDL1R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : RDL1R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for RDL1R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- RDH1R_DATA array element
subtype RDH1R_DATA_Element is HAL.UInt8;
-- RDH1R_DATA array
type RDH1R_DATA_Field_Array is array (4 .. 7) of RDH1R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data high register
type RDH1R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : RDH1R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for RDH1R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype FMR_CANSB_Field is HAL.UInt6;
-- filter master register
type FMR_Register is record
-- Filter initialization mode
FINIT : Boolean := True;
-- unspecified
Reserved_1_7 : HAL.UInt7 := 16#0#;
-- CAN start bank
CANSB : FMR_CANSB_Field := 16#E#;
-- unspecified
Reserved_14_31 : HAL.UInt18 := 16#A870#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FMR_Register use record
FINIT at 0 range 0 .. 0;
Reserved_1_7 at 0 range 1 .. 7;
CANSB at 0 range 8 .. 13;
Reserved_14_31 at 0 range 14 .. 31;
end record;
-- FM1R_FBM array
type FM1R_FBM_Field_Array is array (0 .. 27) of Boolean
with Component_Size => 1, Size => 28;
-- Type definition for FM1R_FBM
type FM1R_FBM_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FBM as a value
Val : HAL.UInt28;
when True =>
-- FBM as an array
Arr : FM1R_FBM_Field_Array;
end case;
end record
with Unchecked_Union, Size => 28;
for FM1R_FBM_Field use record
Val at 0 range 0 .. 27;
Arr at 0 range 0 .. 27;
end record;
-- filter mode register
type FM1R_Register is record
-- Filter mode
FBM : FM1R_FBM_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FM1R_Register use record
FBM at 0 range 0 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-- FS1R_FSC array
type FS1R_FSC_Field_Array is array (0 .. 27) of Boolean
with Component_Size => 1, Size => 28;
-- Type definition for FS1R_FSC
type FS1R_FSC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FSC as a value
Val : HAL.UInt28;
when True =>
-- FSC as an array
Arr : FS1R_FSC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 28;
for FS1R_FSC_Field use record
Val at 0 range 0 .. 27;
Arr at 0 range 0 .. 27;
end record;
-- filter scale register
type FS1R_Register is record
-- Filter scale configuration
FSC : FS1R_FSC_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS1R_Register use record
FSC at 0 range 0 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-- FFA1R_FFA array
type FFA1R_FFA_Field_Array is array (0 .. 27) of Boolean
with Component_Size => 1, Size => 28;
-- Type definition for FFA1R_FFA
type FFA1R_FFA_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FFA as a value
Val : HAL.UInt28;
when True =>
-- FFA as an array
Arr : FFA1R_FFA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 28;
for FFA1R_FFA_Field use record
Val at 0 range 0 .. 27;
Arr at 0 range 0 .. 27;
end record;
-- filter FIFO assignment register
type FFA1R_Register is record
-- Filter FIFO assignment for filter 0
FFA : FFA1R_FFA_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FFA1R_Register use record
FFA at 0 range 0 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-- FA1R_FACT array
type FA1R_FACT_Field_Array is array (0 .. 27) of Boolean
with Component_Size => 1, Size => 28;
-- Type definition for FA1R_FACT
type FA1R_FACT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FACT as a value
Val : HAL.UInt28;
when True =>
-- FACT as an array
Arr : FA1R_FACT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 28;
for FA1R_FACT_Field use record
Val at 0 range 0 .. 27;
Arr at 0 range 0 .. 27;
end record;
-- filter activation register
type FA1R_Register is record
-- Filter active
FACT : FA1R_FACT_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FA1R_Register use record
FACT at 0 range 0 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-- F0R_FB array
type F0R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 0 register 1
type F0R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F0R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F0R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F1R_FB array
type F1R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 1 register 1
type F1R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F1R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F1R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F2R_FB array
type F2R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 2 register 1
type F2R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F2R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F2R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F3R_FB array
type F3R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 3 register 1
type F3R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F3R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F3R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F4R_FB array
type F4R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 4 register 1
type F4R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F4R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F4R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F5R_FB array
type F5R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 5 register 1
type F5R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F5R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F5R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F6R_FB array
type F6R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 6 register 1
type F6R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F6R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F6R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F7R_FB array
type F7R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 7 register 1
type F7R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F7R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F7R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F8R_FB array
type F8R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 8 register 1
type F8R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F8R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F8R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F9R_FB array
type F9R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 9 register 1
type F9R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F9R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F9R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F10R_FB array
type F10R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 10 register 1
type F10R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F10R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F10R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F11R_FB array
type F11R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 11 register 1
type F11R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F11R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F11R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F12R_FB array
type F12R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 4 register 1
type F12R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F12R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F12R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F13R_FB array
type F13R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 13 register 1
type F13R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F13R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F13R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F14R_FB array
type F14R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 14 register 1
type F14R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F14R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F14R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F15R_FB array
type F15R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 15 register 1
type F15R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F15R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F15R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F16R_FB array
type F16R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 16 register 1
type F16R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F16R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F16R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F17R_FB array
type F17R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 17 register 1
type F17R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F17R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F17R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F18R_FB array
type F18R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 18 register 1
type F18R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F18R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F18R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F19R_FB array
type F19R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 19 register 1
type F19R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F19R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F19R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F20R_FB array
type F20R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 20 register 1
type F20R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F20R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F20R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F21R_FB array
type F21R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 21 register 1
type F21R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F21R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F21R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F22R_FB array
type F22R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 22 register 1
type F22R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F22R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F22R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F23R_FB array
type F23R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 23 register 1
type F23R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F23R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F23R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F24R_FB array
type F24R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 24 register 1
type F24R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F24R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F24R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F25R_FB array
type F25R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 25 register 1
type F25R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F25R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F25R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F26R_FB array
type F26R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 26 register 1
type F26R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F26R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F26R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F27R_FB array
type F27R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 27 register 1
type F27R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F27R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F27R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Controller area network
type CAN_Peripheral is record
-- master control register
MCR : aliased MCR_Register;
-- master status register
MSR : aliased MSR_Register;
-- transmit status register
TSR : aliased TSR_Register;
-- receive FIFO 0 register
RF0R : aliased RF0R_Register;
-- receive FIFO 1 register
RF1R : aliased RF1R_Register;
-- interrupt enable register
IER : aliased IER_Register;
-- interrupt enable register
ESR : aliased ESR_Register;
-- bit timing register
BTR : aliased BTR_Register;
-- TX mailbox identifier register
TI0R : aliased TI0R_Register;
-- mailbox data length control and time stamp register
TDT0R : aliased TDT0R_Register;
-- mailbox data low register
TDL0R : aliased TDL0R_Register;
-- mailbox data high register
TDH0R : aliased TDH0R_Register;
-- mailbox identifier register
TI1R : aliased TI1R_Register;
-- mailbox data length control and time stamp register
TDT1R : aliased TDT1R_Register;
-- mailbox data low register
TDL1R : aliased TDL1R_Register;
-- mailbox data high register
TDH1R : aliased TDH1R_Register;
-- mailbox identifier register
TI2R : aliased TI2R_Register;
-- mailbox data length control and time stamp register
TDT2R : aliased TDT2R_Register;
-- mailbox data low register
TDL2R : aliased TDL2R_Register;
-- mailbox data high register
TDH2R : aliased TDH2R_Register;
-- receive FIFO mailbox identifier register
RI0R : aliased RI0R_Register;
-- mailbox data high register
RDT0R : aliased RDT0R_Register;
-- mailbox data high register
RDL0R : aliased RDL0R_Register;
-- receive FIFO mailbox data high register
RDH0R : aliased RDH0R_Register;
-- mailbox data high register
RI1R : aliased RI1R_Register;
-- mailbox data high register
RDT1R : aliased RDT1R_Register;
-- mailbox data high register
RDL1R : aliased RDL1R_Register;
-- mailbox data high register
RDH1R : aliased RDH1R_Register;
-- filter master register
FMR : aliased FMR_Register;
-- filter mode register
FM1R : aliased FM1R_Register;
-- filter scale register
FS1R : aliased FS1R_Register;
-- filter FIFO assignment register
FFA1R : aliased FFA1R_Register;
-- filter activation register
FA1R : aliased FA1R_Register;
-- Filter bank 0 register 1
F0R1 : aliased F0R_Register;
-- Filter bank 0 register 2
F0R2 : aliased F0R_Register;
-- Filter bank 1 register 1
F1R1 : aliased F1R_Register;
-- Filter bank 1 register 2
F1R2 : aliased F1R_Register;
-- Filter bank 2 register 1
F2R1 : aliased F2R_Register;
-- Filter bank 2 register 2
F2R2 : aliased F2R_Register;
-- Filter bank 3 register 1
F3R1 : aliased F3R_Register;
-- Filter bank 3 register 2
F3R2 : aliased F3R_Register;
-- Filter bank 4 register 1
F4R1 : aliased F4R_Register;
-- Filter bank 4 register 2
F4R2 : aliased F4R_Register;
-- Filter bank 5 register 1
F5R1 : aliased F5R_Register;
-- Filter bank 5 register 2
F5R2 : aliased F5R_Register;
-- Filter bank 6 register 1
F6R1 : aliased F6R_Register;
-- Filter bank 6 register 2
F6R2 : aliased F6R_Register;
-- Filter bank 7 register 1
F7R1 : aliased F7R_Register;
-- Filter bank 7 register 2
F7R2 : aliased F7R_Register;
-- Filter bank 8 register 1
F8R1 : aliased F8R_Register;
-- Filter bank 8 register 2
F8R2 : aliased F8R_Register;
-- Filter bank 9 register 1
F9R1 : aliased F9R_Register;
-- Filter bank 9 register 2
F9R2 : aliased F9R_Register;
-- Filter bank 10 register 1
F10R1 : aliased F10R_Register;
-- Filter bank 10 register 2
F10R2 : aliased F10R_Register;
-- Filter bank 11 register 1
F11R1 : aliased F11R_Register;
-- Filter bank 11 register 2
F11R2 : aliased F11R_Register;
-- Filter bank 4 register 1
F12R1 : aliased F12R_Register;
-- Filter bank 12 register 2
F12R2 : aliased F12R_Register;
-- Filter bank 13 register 1
F13R1 : aliased F13R_Register;
-- Filter bank 13 register 2
F13R2 : aliased F13R_Register;
-- Filter bank 14 register 1
F14R1 : aliased F14R_Register;
-- Filter bank 14 register 2
F14R2 : aliased F14R_Register;
-- Filter bank 15 register 1
F15R1 : aliased F15R_Register;
-- Filter bank 15 register 2
F15R2 : aliased F15R_Register;
-- Filter bank 16 register 1
F16R1 : aliased F16R_Register;
-- Filter bank 16 register 2
F16R2 : aliased F16R_Register;
-- Filter bank 17 register 1
F17R1 : aliased F17R_Register;
-- Filter bank 17 register 2
F17R2 : aliased F17R_Register;
-- Filter bank 18 register 1
F18R1 : aliased F18R_Register;
-- Filter bank 18 register 2
F18R2 : aliased F18R_Register;
-- Filter bank 19 register 1
F19R1 : aliased F19R_Register;
-- Filter bank 19 register 2
F19R2 : aliased F19R_Register;
-- Filter bank 20 register 1
F20R1 : aliased F20R_Register;
-- Filter bank 20 register 2
F20R2 : aliased F20R_Register;
-- Filter bank 21 register 1
F21R1 : aliased F21R_Register;
-- Filter bank 21 register 2
F21R2 : aliased F21R_Register;
-- Filter bank 22 register 1
F22R1 : aliased F22R_Register;
-- Filter bank 22 register 2
F22R2 : aliased F22R_Register;
-- Filter bank 23 register 1
F23R1 : aliased F23R_Register;
-- Filter bank 23 register 2
F23R2 : aliased F23R_Register;
-- Filter bank 24 register 1
F24R1 : aliased F24R_Register;
-- Filter bank 24 register 2
F24R2 : aliased F24R_Register;
-- Filter bank 25 register 1
F25R1 : aliased F25R_Register;
-- Filter bank 25 register 2
F25R2 : aliased F25R_Register;
-- Filter bank 26 register 1
F26R1 : aliased F26R_Register;
-- Filter bank 26 register 2
F26R2 : aliased F26R_Register;
-- Filter bank 27 register 1
F27R1 : aliased F27R_Register;
-- Filter bank 27 register 2
F27R2 : aliased F27R_Register;
end record
with Volatile;
for CAN_Peripheral use record
MCR at 16#0# range 0 .. 31;
MSR at 16#4# range 0 .. 31;
TSR at 16#8# range 0 .. 31;
RF0R at 16#C# range 0 .. 31;
RF1R at 16#10# range 0 .. 31;
IER at 16#14# range 0 .. 31;
ESR at 16#18# range 0 .. 31;
BTR at 16#1C# range 0 .. 31;
TI0R at 16#180# range 0 .. 31;
TDT0R at 16#184# range 0 .. 31;
TDL0R at 16#188# range 0 .. 31;
TDH0R at 16#18C# range 0 .. 31;
TI1R at 16#190# range 0 .. 31;
TDT1R at 16#194# range 0 .. 31;
TDL1R at 16#198# range 0 .. 31;
TDH1R at 16#19C# range 0 .. 31;
TI2R at 16#1A0# range 0 .. 31;
TDT2R at 16#1A4# range 0 .. 31;
TDL2R at 16#1A8# range 0 .. 31;
TDH2R at 16#1AC# range 0 .. 31;
RI0R at 16#1B0# range 0 .. 31;
RDT0R at 16#1B4# range 0 .. 31;
RDL0R at 16#1B8# range 0 .. 31;
RDH0R at 16#1BC# range 0 .. 31;
RI1R at 16#1C0# range 0 .. 31;
RDT1R at 16#1C4# range 0 .. 31;
RDL1R at 16#1C8# range 0 .. 31;
RDH1R at 16#1CC# range 0 .. 31;
FMR at 16#200# range 0 .. 31;
FM1R at 16#204# range 0 .. 31;
FS1R at 16#20C# range 0 .. 31;
FFA1R at 16#214# range 0 .. 31;
FA1R at 16#21C# range 0 .. 31;
F0R1 at 16#240# range 0 .. 31;
F0R2 at 16#244# range 0 .. 31;
F1R1 at 16#248# range 0 .. 31;
F1R2 at 16#24C# range 0 .. 31;
F2R1 at 16#250# range 0 .. 31;
F2R2 at 16#254# range 0 .. 31;
F3R1 at 16#258# range 0 .. 31;
F3R2 at 16#25C# range 0 .. 31;
F4R1 at 16#260# range 0 .. 31;
F4R2 at 16#264# range 0 .. 31;
F5R1 at 16#268# range 0 .. 31;
F5R2 at 16#26C# range 0 .. 31;
F6R1 at 16#270# range 0 .. 31;
F6R2 at 16#274# range 0 .. 31;
F7R1 at 16#278# range 0 .. 31;
F7R2 at 16#27C# range 0 .. 31;
F8R1 at 16#280# range 0 .. 31;
F8R2 at 16#284# range 0 .. 31;
F9R1 at 16#288# range 0 .. 31;
F9R2 at 16#28C# range 0 .. 31;
F10R1 at 16#290# range 0 .. 31;
F10R2 at 16#294# range 0 .. 31;
F11R1 at 16#298# range 0 .. 31;
F11R2 at 16#29C# range 0 .. 31;
F12R1 at 16#2A0# range 0 .. 31;
F12R2 at 16#2A4# range 0 .. 31;
F13R1 at 16#2A8# range 0 .. 31;
F13R2 at 16#2AC# range 0 .. 31;
F14R1 at 16#2B0# range 0 .. 31;
F14R2 at 16#2B4# range 0 .. 31;
F15R1 at 16#2B8# range 0 .. 31;
F15R2 at 16#2BC# range 0 .. 31;
F16R1 at 16#2C0# range 0 .. 31;
F16R2 at 16#2C4# range 0 .. 31;
F17R1 at 16#2C8# range 0 .. 31;
F17R2 at 16#2CC# range 0 .. 31;
F18R1 at 16#2D0# range 0 .. 31;
F18R2 at 16#2D4# range 0 .. 31;
F19R1 at 16#2D8# range 0 .. 31;
F19R2 at 16#2DC# range 0 .. 31;
F20R1 at 16#2E0# range 0 .. 31;
F20R2 at 16#2E4# range 0 .. 31;
F21R1 at 16#2E8# range 0 .. 31;
F21R2 at 16#2EC# range 0 .. 31;
F22R1 at 16#2F0# range 0 .. 31;
F22R2 at 16#2F4# range 0 .. 31;
F23R1 at 16#2F8# range 0 .. 31;
F23R2 at 16#2FC# range 0 .. 31;
F24R1 at 16#300# range 0 .. 31;
F24R2 at 16#304# range 0 .. 31;
F25R1 at 16#308# range 0 .. 31;
F25R2 at 16#30C# range 0 .. 31;
F26R1 at 16#310# range 0 .. 31;
F26R2 at 16#314# range 0 .. 31;
F27R1 at 16#318# range 0 .. 31;
F27R2 at 16#31C# range 0 .. 31;
end record;
-- Controller area network
CAN1_Periph : aliased CAN_Peripheral
with Import, Address => System'To_Address (16#40006400#);
-- Controller area network
CAN2_Periph : aliased CAN_Peripheral
with Import, Address => System'To_Address (16#40006800#);
end STM32_SVD.CAN;
| 29.29555 | 76 | 0.561555 |