CombinedText stringlengths 4 3.42M |
|---|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 3 7 --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.Storage_Elements;
with System.Unsigned_Types;
with Unchecked_Conversion;
package body System.Pack_37 is
subtype Ofs is System.Storage_Elements.Storage_Offset;
subtype Uns is System.Unsigned_Types.Unsigned;
subtype N07 is System.Unsigned_Types.Unsigned range 0 .. 7;
use type System.Storage_Elements.Storage_Offset;
use type System.Unsigned_Types.Unsigned;
type Cluster is record
E0, E1, E2, E3, E4, E5, E6, E7 : Bits_37;
end record;
for Cluster use record
E0 at 0 range 0 * Bits .. 0 * Bits + Bits - 1;
E1 at 0 range 1 * Bits .. 1 * Bits + Bits - 1;
E2 at 0 range 2 * Bits .. 2 * Bits + Bits - 1;
E3 at 0 range 3 * Bits .. 3 * Bits + Bits - 1;
E4 at 0 range 4 * Bits .. 4 * Bits + Bits - 1;
E5 at 0 range 5 * Bits .. 5 * Bits + Bits - 1;
E6 at 0 range 6 * Bits .. 6 * Bits + Bits - 1;
E7 at 0 range 7 * Bits .. 7 * Bits + Bits - 1;
end record;
for Cluster'Size use Bits * 8;
for Cluster'Alignment use Integer'Min (Standard'Maximum_Alignment,
1 +
1 * Boolean'Pos (Bits mod 2 = 0) +
2 * Boolean'Pos (Bits mod 4 = 0));
-- Use maximum possible alignment, given the bit field size, since this
-- will result in the most efficient code possible for the field.
type Cluster_Ref is access Cluster;
function To_Ref is new
Unchecked_Conversion (System.Address, Cluster_Ref);
------------
-- Get_37 --
------------
function Get_37 (Arr : System.Address; N : Natural) return Bits_37 is
C : constant Cluster_Ref := To_Ref (Arr + Bits * Ofs (Uns (N) / 8));
begin
case N07 (Uns (N) mod 8) is
when 0 => return C.E0;
when 1 => return C.E1;
when 2 => return C.E2;
when 3 => return C.E3;
when 4 => return C.E4;
when 5 => return C.E5;
when 6 => return C.E6;
when 7 => return C.E7;
end case;
end Get_37;
------------
-- Set_37 --
------------
procedure Set_37 (Arr : System.Address; N : Natural; E : Bits_37) is
C : constant Cluster_Ref := To_Ref (Arr + Bits * Ofs (Uns (N) / 8));
begin
case N07 (Uns (N) mod 8) is
when 0 => C.E0 := E;
when 1 => C.E1 := E;
when 2 => C.E2 := E;
when 3 => C.E3 := E;
when 4 => C.E4 := E;
when 5 => C.E5 := E;
when 6 => C.E6 := E;
when 7 => C.E7 := E;
end case;
end Set_37;
end System.Pack_37;
|
------------------------------------------------------------------------------
-- --
-- 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.CMOF.Value_Specifications.Hash is
new AMF.Elements.Generic_Hash (CMOF_Value_Specification, CMOF_Value_Specification_Access);
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E X P _ A G G R --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Checks; use Checks;
with Debug; use Debug;
with Einfo; use Einfo;
with Elists; use Elists;
with Errout; use Errout;
with Expander; use Expander;
with Exp_Util; use Exp_Util;
with Exp_Ch3; use Exp_Ch3;
with Exp_Ch6; use Exp_Ch6;
with Exp_Ch7; use Exp_Ch7;
with Exp_Ch9; use Exp_Ch9;
with Exp_Disp; use Exp_Disp;
with Exp_Tss; use Exp_Tss;
with Fname; use Fname;
with Freeze; use Freeze;
with Itypes; use Itypes;
with Lib; use Lib;
with Namet; use Namet;
with Nmake; use Nmake;
with Nlists; use Nlists;
with Opt; use Opt;
with Restrict; use Restrict;
with Rident; use Rident;
with Rtsfind; use Rtsfind;
with Ttypes; use Ttypes;
with Sem; use Sem;
with Sem_Aggr; use Sem_Aggr;
with Sem_Aux; use Sem_Aux;
with Sem_Ch3; use Sem_Ch3;
with Sem_Eval; use Sem_Eval;
with Sem_Res; use Sem_Res;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Snames; use Snames;
with Stand; use Stand;
with Stringt; use Stringt;
with Targparm; use Targparm;
with Tbuild; use Tbuild;
with Uintp; use Uintp;
package body Exp_Aggr is
type Case_Bounds is record
Choice_Lo : Node_Id;
Choice_Hi : Node_Id;
Choice_Node : Node_Id;
end record;
type Case_Table_Type is array (Nat range <>) of Case_Bounds;
-- Table type used by Check_Case_Choices procedure
procedure Collect_Initialization_Statements
(Obj : Entity_Id;
N : Node_Id;
Node_After : Node_Id);
-- If Obj is not frozen, collect actions inserted after N until, but not
-- including, Node_After, for initialization of Obj, and move them to an
-- expression with actions, which becomes the Initialization_Statements for
-- Obj.
procedure Expand_Delta_Array_Aggregate (N : Node_Id; Deltas : List_Id);
procedure Expand_Delta_Record_Aggregate (N : Node_Id; Deltas : List_Id);
function Has_Default_Init_Comps (N : Node_Id) return Boolean;
-- N is an aggregate (record or array). Checks the presence of default
-- initialization (<>) in any component (Ada 2005: AI-287).
function In_Object_Declaration (N : Node_Id) return Boolean;
-- Return True if N is part of an object declaration, False otherwise
function Is_Static_Dispatch_Table_Aggregate (N : Node_Id) return Boolean;
-- Returns true if N is an aggregate used to initialize the components
-- of a statically allocated dispatch table.
function Late_Expansion
(N : Node_Id;
Typ : Entity_Id;
Target : Node_Id) return List_Id;
-- This routine implements top-down expansion of nested aggregates. In
-- doing so, it avoids the generation of temporaries at each level. N is
-- a nested record or array aggregate with the Expansion_Delayed flag.
-- Typ is the expected type of the aggregate. Target is a (duplicatable)
-- expression that will hold the result of the aggregate expansion.
function Make_OK_Assignment_Statement
(Sloc : Source_Ptr;
Name : Node_Id;
Expression : Node_Id) return Node_Id;
-- This is like Make_Assignment_Statement, except that Assignment_OK
-- is set in the left operand. All assignments built by this unit use
-- this routine. This is needed to deal with assignments to initialized
-- constants that are done in place.
function Must_Slide
(Obj_Type : Entity_Id;
Typ : Entity_Id) return Boolean;
-- A static array aggregate in an object declaration can in most cases be
-- expanded in place. The one exception is when the aggregate is given
-- with component associations that specify different bounds from those of
-- the type definition in the object declaration. In this pathological
-- case the aggregate must slide, and we must introduce an intermediate
-- temporary to hold it.
--
-- The same holds in an assignment to one-dimensional array of arrays,
-- when a component may be given with bounds that differ from those of the
-- component type.
function Number_Of_Choices (N : Node_Id) return Nat;
-- Returns the number of discrete choices (not including the others choice
-- if present) contained in (sub-)aggregate N.
procedure Process_Transient_Component
(Loc : Source_Ptr;
Comp_Typ : Entity_Id;
Init_Expr : Node_Id;
Fin_Call : out Node_Id;
Hook_Clear : out Node_Id;
Aggr : Node_Id := Empty;
Stmts : List_Id := No_List);
-- Subsidiary to the expansion of array and record aggregates. Generate
-- part of the necessary code to finalize a transient component. Comp_Typ
-- is the component type. Init_Expr is the initialization expression of the
-- component which is always a function call. Fin_Call is the finalization
-- call used to clean up the transient function result. Hook_Clear is the
-- hook reset statement. Aggr and Stmts both control the placement of the
-- generated code. Aggr is the related aggregate. If present, all code is
-- inserted prior to Aggr using Insert_Action. Stmts is the initialization
-- statements of the component. If present, all code is added to Stmts.
procedure Process_Transient_Component_Completion
(Loc : Source_Ptr;
Aggr : Node_Id;
Fin_Call : Node_Id;
Hook_Clear : Node_Id;
Stmts : List_Id);
-- Subsidiary to the expansion of array and record aggregates. Generate
-- part of the necessary code to finalize a transient component. Aggr is
-- the related aggregate. Fin_Clear is the finalization call used to clean
-- up the transient component. Hook_Clear is the hook reset statment. Stmts
-- is the initialization statement list for the component. All generated
-- code is added to Stmts.
procedure Sort_Case_Table (Case_Table : in out Case_Table_Type);
-- Sort the Case Table using the Lower Bound of each Choice as the key.
-- A simple insertion sort is used since the number of choices in a case
-- statement of variant part will usually be small and probably in near
-- sorted order.
------------------------------------------------------
-- Local subprograms for Record Aggregate Expansion --
------------------------------------------------------
function Build_Record_Aggr_Code
(N : Node_Id;
Typ : Entity_Id;
Lhs : Node_Id) return List_Id;
-- N is an N_Aggregate or an N_Extension_Aggregate. Typ is the type of the
-- aggregate. Target is an expression containing the location on which the
-- component by component assignments will take place. Returns the list of
-- assignments plus all other adjustments needed for tagged and controlled
-- types.
procedure Convert_To_Assignments (N : Node_Id; Typ : Entity_Id);
-- N is an N_Aggregate or an N_Extension_Aggregate. Typ is the type of the
-- aggregate (which can only be a record type, this procedure is only used
-- for record types). Transform the given aggregate into a sequence of
-- assignments performed component by component.
procedure Expand_Record_Aggregate
(N : Node_Id;
Orig_Tag : Node_Id := Empty;
Parent_Expr : Node_Id := Empty);
-- This is the top level procedure for record aggregate expansion.
-- Expansion for record aggregates needs expand aggregates for tagged
-- record types. Specifically Expand_Record_Aggregate adds the Tag
-- field in front of the Component_Association list that was created
-- during resolution by Resolve_Record_Aggregate.
--
-- N is the record aggregate node.
-- Orig_Tag is the value of the Tag that has to be provided for this
-- specific aggregate. It carries the tag corresponding to the type
-- of the outermost aggregate during the recursive expansion
-- Parent_Expr is the ancestor part of the original extension
-- aggregate
function Has_Mutable_Components (Typ : Entity_Id) return Boolean;
-- Return true if one of the components is of a discriminated type with
-- defaults. An aggregate for a type with mutable components must be
-- expanded into individual assignments.
procedure Initialize_Discriminants (N : Node_Id; Typ : Entity_Id);
-- If the type of the aggregate is a type extension with renamed discrimi-
-- nants, we must initialize the hidden discriminants of the parent.
-- Otherwise, the target object must not be initialized. The discriminants
-- are initialized by calling the initialization procedure for the type.
-- This is incorrect if the initialization of other components has any
-- side effects. We restrict this call to the case where the parent type
-- has a variant part, because this is the only case where the hidden
-- discriminants are accessed, namely when calling discriminant checking
-- functions of the parent type, and when applying a stream attribute to
-- an object of the derived type.
-----------------------------------------------------
-- Local Subprograms for Array Aggregate Expansion --
-----------------------------------------------------
function Aggr_Size_OK (N : Node_Id; Typ : Entity_Id) return Boolean;
-- Very large static aggregates present problems to the back-end, and are
-- transformed into assignments and loops. This function verifies that the
-- total number of components of an aggregate is acceptable for rewriting
-- into a purely positional static form. Aggr_Size_OK must be called before
-- calling Flatten.
--
-- This function also detects and warns about one-component aggregates that
-- appear in a non-static context. Even if the component value is static,
-- such an aggregate must be expanded into an assignment.
function Backend_Processing_Possible (N : Node_Id) return Boolean;
-- This function checks if array aggregate N can be processed directly
-- by the backend. If this is the case, True is returned.
function Build_Array_Aggr_Code
(N : Node_Id;
Ctype : Entity_Id;
Index : Node_Id;
Into : Node_Id;
Scalar_Comp : Boolean;
Indexes : List_Id := No_List) return List_Id;
-- This recursive routine returns a list of statements containing the
-- loops and assignments that are needed for the expansion of the array
-- aggregate N.
--
-- N is the (sub-)aggregate node to be expanded into code. This node has
-- been fully analyzed, and its Etype is properly set.
--
-- Index is the index node corresponding to the array subaggregate N
--
-- Into is the target expression into which we are copying the aggregate.
-- Note that this node may not have been analyzed yet, and so the Etype
-- field may not be set.
--
-- Scalar_Comp is True if the component type of the aggregate is scalar
--
-- Indexes is the current list of expressions used to index the object we
-- are writing into.
procedure Convert_Array_Aggr_In_Allocator
(Decl : Node_Id;
Aggr : Node_Id;
Target : Node_Id);
-- If the aggregate appears within an allocator and can be expanded in
-- place, this routine generates the individual assignments to components
-- of the designated object. This is an optimization over the general
-- case, where a temporary is first created on the stack and then used to
-- construct the allocated object on the heap.
procedure Convert_To_Positional
(N : Node_Id;
Max_Others_Replicate : Nat := 5;
Handle_Bit_Packed : Boolean := False);
-- If possible, convert named notation to positional notation. This
-- conversion is possible only in some static cases. If the conversion is
-- possible, then N is rewritten with the analyzed converted aggregate.
-- The parameter Max_Others_Replicate controls the maximum number of
-- values corresponding to an others choice that will be converted to
-- positional notation (the default of 5 is the normal limit, and reflects
-- the fact that normally the loop is better than a lot of separate
-- assignments). Note that this limit gets overridden in any case if
-- either of the restrictions No_Elaboration_Code or No_Implicit_Loops is
-- set. The parameter Handle_Bit_Packed is usually set False (since we do
-- not expect the back end to handle bit packed arrays, so the normal case
-- of conversion is pointless), but in the special case of a call from
-- Packed_Array_Aggregate_Handled, we set this parameter to True, since
-- these are cases we handle in there.
-- It would seem useful to have a higher default for Max_Others_Replicate,
-- but aggregates in the compiler make this impossible: the compiler
-- bootstrap fails if Max_Others_Replicate is greater than 25. This
-- is unexpected ???
procedure Expand_Array_Aggregate (N : Node_Id);
-- This is the top-level routine to perform array aggregate expansion.
-- N is the N_Aggregate node to be expanded.
function Is_Two_Dim_Packed_Array (Typ : Entity_Id) return Boolean;
-- For two-dimensional packed aggregates with constant bounds and constant
-- components, it is preferable to pack the inner aggregates because the
-- whole matrix can then be presented to the back-end as a one-dimensional
-- list of literals. This is much more efficient than expanding into single
-- component assignments. This function determines if the type Typ is for
-- an array that is suitable for this optimization: it returns True if Typ
-- is a two dimensional bit packed array with component size 1, 2, or 4.
function Packed_Array_Aggregate_Handled (N : Node_Id) return Boolean;
-- Given an array aggregate, this function handles the case of a packed
-- array aggregate with all constant values, where the aggregate can be
-- evaluated at compile time. If this is possible, then N is rewritten
-- to be its proper compile time value with all the components properly
-- assembled. The expression is analyzed and resolved and True is returned.
-- If this transformation is not possible, N is unchanged and False is
-- returned.
function Two_Dim_Packed_Array_Handled (N : Node_Id) return Boolean;
-- If the type of the aggregate is a two-dimensional bit_packed array
-- it may be transformed into an array of bytes with constant values,
-- and presented to the back-end as a static value. The function returns
-- false if this transformation cannot be performed. THis is similar to,
-- and reuses part of the machinery in Packed_Array_Aggregate_Handled.
------------------
-- Aggr_Size_OK --
------------------
function Aggr_Size_OK (N : Node_Id; Typ : Entity_Id) return Boolean is
Lo : Node_Id;
Hi : Node_Id;
Indx : Node_Id;
Siz : Int;
Lov : Uint;
Hiv : Uint;
Max_Aggr_Size : Nat;
-- Determines the maximum size of an array aggregate produced by
-- converting named to positional notation (e.g. from others clauses).
-- This avoids running away with attempts to convert huge aggregates,
-- which hit memory limits in the backend.
function Component_Count (T : Entity_Id) return Nat;
-- The limit is applied to the total number of components that the
-- aggregate will have, which is the number of static expressions
-- that will appear in the flattened array. This requires a recursive
-- computation of the number of scalar components of the structure.
---------------------
-- Component_Count --
---------------------
function Component_Count (T : Entity_Id) return Nat is
Res : Nat := 0;
Comp : Entity_Id;
begin
if Is_Scalar_Type (T) then
return 1;
elsif Is_Record_Type (T) then
Comp := First_Component (T);
while Present (Comp) loop
Res := Res + Component_Count (Etype (Comp));
Next_Component (Comp);
end loop;
return Res;
elsif Is_Array_Type (T) then
declare
Lo : constant Node_Id :=
Type_Low_Bound (Etype (First_Index (T)));
Hi : constant Node_Id :=
Type_High_Bound (Etype (First_Index (T)));
Siz : constant Nat := Component_Count (Component_Type (T));
begin
-- Check for superflat arrays, i.e. arrays with such bounds
-- as 4 .. 2, to insure that this function never returns a
-- meaningless negative value.
if not Compile_Time_Known_Value (Lo)
or else not Compile_Time_Known_Value (Hi)
or else Expr_Value (Hi) < Expr_Value (Lo)
then
return 0;
else
return
Siz * UI_To_Int (Expr_Value (Hi) - Expr_Value (Lo) + 1);
end if;
end;
else
-- Can only be a null for an access type
return 1;
end if;
end Component_Count;
-- Start of processing for Aggr_Size_OK
begin
-- The normal aggregate limit is 50000, but we increase this limit to
-- 2**24 (about 16 million) if Restrictions (No_Elaboration_Code) or
-- Restrictions (No_Implicit_Loops) is specified, since in either case
-- we are at risk of declaring the program illegal because of this
-- limit. We also increase the limit when Static_Elaboration_Desired,
-- given that this means that objects are intended to be placed in data
-- memory.
-- We also increase the limit if the aggregate is for a packed two-
-- dimensional array, because if components are static it is much more
-- efficient to construct a one-dimensional equivalent array with static
-- components.
-- Conversely, we decrease the maximum size if none of the above
-- requirements apply, and if the aggregate has a single component
-- association, which will be more efficient if implemented with a loop.
-- Finally, we use a small limit in CodePeer mode where we favor loops
-- instead of thousands of single assignments (from large aggregates).
Max_Aggr_Size := 50000;
if CodePeer_Mode then
Max_Aggr_Size := 100;
elsif Restriction_Active (No_Elaboration_Code)
or else Restriction_Active (No_Implicit_Loops)
or else Is_Two_Dim_Packed_Array (Typ)
or else (Ekind (Current_Scope) = E_Package
and then Static_Elaboration_Desired (Current_Scope))
then
Max_Aggr_Size := 2 ** 24;
elsif No (Expressions (N))
and then No (Next (First (Component_Associations (N))))
then
Max_Aggr_Size := 5000;
end if;
Siz := Component_Count (Component_Type (Typ));
Indx := First_Index (Typ);
while Present (Indx) loop
Lo := Type_Low_Bound (Etype (Indx));
Hi := Type_High_Bound (Etype (Indx));
-- Bounds need to be known at compile time
if not Compile_Time_Known_Value (Lo)
or else not Compile_Time_Known_Value (Hi)
then
return False;
end if;
Lov := Expr_Value (Lo);
Hiv := Expr_Value (Hi);
-- A flat array is always safe
if Hiv < Lov then
return True;
end if;
-- One-component aggregates are suspicious, and if the context type
-- is an object declaration with non-static bounds it will trip gcc;
-- such an aggregate must be expanded into a single assignment.
if Hiv = Lov and then Nkind (Parent (N)) = N_Object_Declaration then
declare
Index_Type : constant Entity_Id :=
Etype
(First_Index (Etype (Defining_Identifier (Parent (N)))));
Indx : Node_Id;
begin
if not Compile_Time_Known_Value (Type_Low_Bound (Index_Type))
or else not Compile_Time_Known_Value
(Type_High_Bound (Index_Type))
then
if Present (Component_Associations (N)) then
Indx :=
First
(Choice_List (First (Component_Associations (N))));
if Is_Entity_Name (Indx)
and then not Is_Type (Entity (Indx))
then
Error_Msg_N
("single component aggregate in "
& "non-static context??", Indx);
Error_Msg_N ("\maybe subtype name was meant??", Indx);
end if;
end if;
return False;
end if;
end;
end if;
declare
Rng : constant Uint := Hiv - Lov + 1;
begin
-- Check if size is too large
if not UI_Is_In_Int_Range (Rng) then
return False;
end if;
Siz := Siz * UI_To_Int (Rng);
end;
if Siz <= 0
or else Siz > Max_Aggr_Size
then
return False;
end if;
-- Bounds must be in integer range, for later array construction
if not UI_Is_In_Int_Range (Lov)
or else
not UI_Is_In_Int_Range (Hiv)
then
return False;
end if;
Next_Index (Indx);
end loop;
return True;
end Aggr_Size_OK;
---------------------------------
-- Backend_Processing_Possible --
---------------------------------
-- Backend processing by Gigi/gcc is possible only if all the following
-- conditions are met:
-- 1. N is fully positional
-- 2. N is not a bit-packed array aggregate;
-- 3. The size of N's array type must be known at compile time. Note
-- that this implies that the component size is also known
-- 4. The array type of N does not follow the Fortran layout convention
-- or if it does it must be 1 dimensional.
-- 5. The array component type may not be tagged (which could necessitate
-- reassignment of proper tags).
-- 6. The array component type must not have unaligned bit components
-- 7. None of the components of the aggregate may be bit unaligned
-- components.
-- 8. There cannot be delayed components, since we do not know enough
-- at this stage to know if back end processing is possible.
-- 9. There cannot be any discriminated record components, since the
-- back end cannot handle this complex case.
-- 10. No controlled actions need to be generated for components
-- 11. When generating C code, N must be part of a N_Object_Declaration
-- 12. When generating C code, N must not include function calls
function Backend_Processing_Possible (N : Node_Id) return Boolean is
Typ : constant Entity_Id := Etype (N);
-- Typ is the correct constrained array subtype of the aggregate
function Component_Check (N : Node_Id; Index : Node_Id) return Boolean;
-- This routine checks components of aggregate N, enforcing checks
-- 1, 7, 8, 9, 11, and 12. In the multidimensional case, these checks
-- are performed on subaggregates. The Index value is the current index
-- being checked in the multidimensional case.
---------------------
-- Component_Check --
---------------------
function Component_Check (N : Node_Id; Index : Node_Id) return Boolean is
function Ultimate_Original_Expression (N : Node_Id) return Node_Id;
-- Given a type conversion or an unchecked type conversion N, return
-- its innermost original expression.
----------------------------------
-- Ultimate_Original_Expression --
----------------------------------
function Ultimate_Original_Expression (N : Node_Id) return Node_Id is
Expr : Node_Id := Original_Node (N);
begin
while Nkind_In (Expr, N_Type_Conversion,
N_Unchecked_Type_Conversion)
loop
Expr := Original_Node (Expression (Expr));
end loop;
return Expr;
end Ultimate_Original_Expression;
-- Local variables
Expr : Node_Id;
-- Start of processing for Component_Check
begin
-- Checks 1: (no component associations)
if Present (Component_Associations (N)) then
return False;
end if;
-- Checks 11: (part of an object declaration)
if Modify_Tree_For_C
and then Nkind (Parent (N)) /= N_Object_Declaration
and then
(Nkind (Parent (N)) /= N_Qualified_Expression
or else Nkind (Parent (Parent (N))) /= N_Object_Declaration)
then
return False;
end if;
-- Checks on components
-- Recurse to check subaggregates, which may appear in qualified
-- expressions. If delayed, the front-end will have to expand.
-- If the component is a discriminated record, treat as non-static,
-- as the back-end cannot handle this properly.
Expr := First (Expressions (N));
while Present (Expr) loop
-- Checks 8: (no delayed components)
if Is_Delayed_Aggregate (Expr) then
return False;
end if;
-- Checks 9: (no discriminated records)
if Present (Etype (Expr))
and then Is_Record_Type (Etype (Expr))
and then Has_Discriminants (Etype (Expr))
then
return False;
end if;
-- Checks 7. Component must not be bit aligned component
if Possible_Bit_Aligned_Component (Expr) then
return False;
end if;
-- Checks 12: (no function call)
if Modify_Tree_For_C
and then
Nkind (Ultimate_Original_Expression (Expr)) = N_Function_Call
then
return False;
end if;
-- Recursion to following indexes for multiple dimension case
if Present (Next_Index (Index))
and then not Component_Check (Expr, Next_Index (Index))
then
return False;
end if;
-- All checks for that component finished, on to next
Next (Expr);
end loop;
return True;
end Component_Check;
-- Start of processing for Backend_Processing_Possible
begin
-- Checks 2 (array not bit packed) and 10 (no controlled actions)
if Is_Bit_Packed_Array (Typ) or else Needs_Finalization (Typ) then
return False;
end if;
-- If component is limited, aggregate must be expanded because each
-- component assignment must be built in place.
if Is_Limited_View (Component_Type (Typ)) then
return False;
end if;
-- Checks 4 (array must not be multidimensional Fortran case)
if Convention (Typ) = Convention_Fortran
and then Number_Dimensions (Typ) > 1
then
return False;
end if;
-- Checks 3 (size of array must be known at compile time)
if not Size_Known_At_Compile_Time (Typ) then
return False;
end if;
-- Checks on components
if not Component_Check (N, First_Index (Typ)) then
return False;
end if;
-- Checks 5 (if the component type is tagged, then we may need to do
-- tag adjustments. Perhaps this should be refined to check for any
-- component associations that actually need tag adjustment, similar
-- to the test in Component_Not_OK_For_Backend for record aggregates
-- with tagged components, but not clear whether it's worthwhile ???;
-- in the case of virtual machines (no Tagged_Type_Expansion), object
-- tags are handled implicitly).
if Is_Tagged_Type (Component_Type (Typ))
and then Tagged_Type_Expansion
then
return False;
end if;
-- Checks 6 (component type must not have bit aligned components)
if Type_May_Have_Bit_Aligned_Components (Component_Type (Typ)) then
return False;
end if;
-- Backend processing is possible
Set_Size_Known_At_Compile_Time (Etype (N), True);
return True;
end Backend_Processing_Possible;
---------------------------
-- Build_Array_Aggr_Code --
---------------------------
-- The code that we generate from a one dimensional aggregate is
-- 1. If the subaggregate contains discrete choices we
-- (a) Sort the discrete choices
-- (b) Otherwise for each discrete choice that specifies a range we
-- emit a loop. If a range specifies a maximum of three values, or
-- we are dealing with an expression we emit a sequence of
-- assignments instead of a loop.
-- (c) Generate the remaining loops to cover the others choice if any
-- 2. If the aggregate contains positional elements we
-- (a) translate the positional elements in a series of assignments
-- (b) Generate a final loop to cover the others choice if any.
-- Note that this final loop has to be a while loop since the case
-- L : Integer := Integer'Last;
-- H : Integer := Integer'Last;
-- A : array (L .. H) := (1, others =>0);
-- cannot be handled by a for loop. Thus for the following
-- array (L .. H) := (.. positional elements.., others =>E);
-- we always generate something like:
-- J : Index_Type := Index_Of_Last_Positional_Element;
-- while J < H loop
-- J := Index_Base'Succ (J)
-- Tmp (J) := E;
-- end loop;
function Build_Array_Aggr_Code
(N : Node_Id;
Ctype : Entity_Id;
Index : Node_Id;
Into : Node_Id;
Scalar_Comp : Boolean;
Indexes : List_Id := No_List) return List_Id
is
Loc : constant Source_Ptr := Sloc (N);
Index_Base : constant Entity_Id := Base_Type (Etype (Index));
Index_Base_L : constant Node_Id := Type_Low_Bound (Index_Base);
Index_Base_H : constant Node_Id := Type_High_Bound (Index_Base);
function Add (Val : Int; To : Node_Id) return Node_Id;
-- Returns an expression where Val is added to expression To, unless
-- To+Val is provably out of To's base type range. To must be an
-- already analyzed expression.
function Empty_Range (L, H : Node_Id) return Boolean;
-- Returns True if the range defined by L .. H is certainly empty
function Equal (L, H : Node_Id) return Boolean;
-- Returns True if L = H for sure
function Index_Base_Name return Node_Id;
-- Returns a new reference to the index type name
function Gen_Assign
(Ind : Node_Id;
Expr : Node_Id;
In_Loop : Boolean := False) return List_Id;
-- Ind must be a side-effect-free expression. If the input aggregate N
-- to Build_Loop contains no subaggregates, then this function returns
-- the assignment statement:
--
-- Into (Indexes, Ind) := Expr;
--
-- Otherwise we call Build_Code recursively. Flag In_Loop should be set
-- when the assignment appears within a generated loop.
--
-- Ada 2005 (AI-287): In case of default initialized component, Expr
-- is empty and we generate a call to the corresponding IP subprogram.
function Gen_Loop (L, H : Node_Id; Expr : Node_Id) return List_Id;
-- Nodes L and H must be side-effect-free expressions. If the input
-- aggregate N to Build_Loop contains no subaggregates, this routine
-- returns the for loop statement:
--
-- for J in Index_Base'(L) .. Index_Base'(H) loop
-- Into (Indexes, J) := Expr;
-- end loop;
--
-- Otherwise we call Build_Code recursively. As an optimization if the
-- loop covers 3 or fewer scalar elements we generate a sequence of
-- assignments.
-- If the component association that generates the loop comes from an
-- Iterated_Component_Association, the loop parameter has the name of
-- the corresponding parameter in the original construct.
function Gen_While (L, H : Node_Id; Expr : Node_Id) return List_Id;
-- Nodes L and H must be side-effect-free expressions. If the input
-- aggregate N to Build_Loop contains no subaggregates, this routine
-- returns the while loop statement:
--
-- J : Index_Base := L;
-- while J < H loop
-- J := Index_Base'Succ (J);
-- Into (Indexes, J) := Expr;
-- end loop;
--
-- Otherwise we call Build_Code recursively
function Get_Assoc_Expr (Assoc : Node_Id) return Node_Id;
-- For an association with a box, use value given by aspect
-- Default_Component_Value of array type if specified, else use
-- value given by aspect Default_Value for component type itself
-- if specified, else return Empty.
function Local_Compile_Time_Known_Value (E : Node_Id) return Boolean;
function Local_Expr_Value (E : Node_Id) return Uint;
-- These two Local routines are used to replace the corresponding ones
-- in sem_eval because while processing the bounds of an aggregate with
-- discrete choices whose index type is an enumeration, we build static
-- expressions not recognized by Compile_Time_Known_Value as such since
-- they have not yet been analyzed and resolved. All the expressions in
-- question are things like Index_Base_Name'Val (Const) which we can
-- easily recognize as being constant.
---------
-- Add --
---------
function Add (Val : Int; To : Node_Id) return Node_Id is
Expr_Pos : Node_Id;
Expr : Node_Id;
To_Pos : Node_Id;
U_To : Uint;
U_Val : constant Uint := UI_From_Int (Val);
begin
-- Note: do not try to optimize the case of Val = 0, because
-- we need to build a new node with the proper Sloc value anyway.
-- First test if we can do constant folding
if Local_Compile_Time_Known_Value (To) then
U_To := Local_Expr_Value (To) + Val;
-- Determine if our constant is outside the range of the index.
-- If so return an Empty node. This empty node will be caught
-- by Empty_Range below.
if Compile_Time_Known_Value (Index_Base_L)
and then U_To < Expr_Value (Index_Base_L)
then
return Empty;
elsif Compile_Time_Known_Value (Index_Base_H)
and then U_To > Expr_Value (Index_Base_H)
then
return Empty;
end if;
Expr_Pos := Make_Integer_Literal (Loc, U_To);
Set_Is_Static_Expression (Expr_Pos);
if not Is_Enumeration_Type (Index_Base) then
Expr := Expr_Pos;
-- If we are dealing with enumeration return
-- Index_Base'Val (Expr_Pos)
else
Expr :=
Make_Attribute_Reference
(Loc,
Prefix => Index_Base_Name,
Attribute_Name => Name_Val,
Expressions => New_List (Expr_Pos));
end if;
return Expr;
end if;
-- If we are here no constant folding possible
if not Is_Enumeration_Type (Index_Base) then
Expr :=
Make_Op_Add (Loc,
Left_Opnd => Duplicate_Subexpr (To),
Right_Opnd => Make_Integer_Literal (Loc, U_Val));
-- If we are dealing with enumeration return
-- Index_Base'Val (Index_Base'Pos (To) + Val)
else
To_Pos :=
Make_Attribute_Reference
(Loc,
Prefix => Index_Base_Name,
Attribute_Name => Name_Pos,
Expressions => New_List (Duplicate_Subexpr (To)));
Expr_Pos :=
Make_Op_Add (Loc,
Left_Opnd => To_Pos,
Right_Opnd => Make_Integer_Literal (Loc, U_Val));
Expr :=
Make_Attribute_Reference
(Loc,
Prefix => Index_Base_Name,
Attribute_Name => Name_Val,
Expressions => New_List (Expr_Pos));
end if;
return Expr;
end Add;
-----------------
-- Empty_Range --
-----------------
function Empty_Range (L, H : Node_Id) return Boolean is
Is_Empty : Boolean := False;
Low : Node_Id;
High : Node_Id;
begin
-- First check if L or H were already detected as overflowing the
-- index base range type by function Add above. If this is so Add
-- returns the empty node.
if No (L) or else No (H) then
return True;
end if;
for J in 1 .. 3 loop
case J is
-- L > H range is empty
when 1 =>
Low := L;
High := H;
-- B_L > H range must be empty
when 2 =>
Low := Index_Base_L;
High := H;
-- L > B_H range must be empty
when 3 =>
Low := L;
High := Index_Base_H;
end case;
if Local_Compile_Time_Known_Value (Low)
and then
Local_Compile_Time_Known_Value (High)
then
Is_Empty :=
UI_Gt (Local_Expr_Value (Low), Local_Expr_Value (High));
end if;
exit when Is_Empty;
end loop;
return Is_Empty;
end Empty_Range;
-----------
-- Equal --
-----------
function Equal (L, H : Node_Id) return Boolean is
begin
if L = H then
return True;
elsif Local_Compile_Time_Known_Value (L)
and then
Local_Compile_Time_Known_Value (H)
then
return UI_Eq (Local_Expr_Value (L), Local_Expr_Value (H));
end if;
return False;
end Equal;
----------------
-- Gen_Assign --
----------------
function Gen_Assign
(Ind : Node_Id;
Expr : Node_Id;
In_Loop : Boolean := False) return List_Id
is
function Add_Loop_Actions (Lis : List_Id) return List_Id;
-- Collect insert_actions generated in the construction of a loop,
-- and prepend them to the sequence of assignments to complete the
-- eventual body of the loop.
procedure Initialize_Array_Component
(Arr_Comp : Node_Id;
Comp_Typ : Node_Id;
Init_Expr : Node_Id;
Stmts : List_Id);
-- Perform the initialization of array component Arr_Comp with
-- expected type Comp_Typ. Init_Expr denotes the initialization
-- expression of the array component. All generated code is added
-- to list Stmts.
procedure Initialize_Ctrl_Array_Component
(Arr_Comp : Node_Id;
Comp_Typ : Entity_Id;
Init_Expr : Node_Id;
Stmts : List_Id);
-- Perform the initialization of array component Arr_Comp when its
-- expected type Comp_Typ needs finalization actions. Init_Expr is
-- the initialization expression of the array component. All hook-
-- related declarations are inserted prior to aggregate N. Remaining
-- code is added to list Stmts.
----------------------
-- Add_Loop_Actions --
----------------------
function Add_Loop_Actions (Lis : List_Id) return List_Id is
Res : List_Id;
begin
-- Ada 2005 (AI-287): Do nothing else in case of default
-- initialized component.
if No (Expr) then
return Lis;
elsif Nkind (Parent (Expr)) = N_Component_Association
and then Present (Loop_Actions (Parent (Expr)))
then
Append_List (Lis, Loop_Actions (Parent (Expr)));
Res := Loop_Actions (Parent (Expr));
Set_Loop_Actions (Parent (Expr), No_List);
return Res;
else
return Lis;
end if;
end Add_Loop_Actions;
--------------------------------
-- Initialize_Array_Component --
--------------------------------
procedure Initialize_Array_Component
(Arr_Comp : Node_Id;
Comp_Typ : Node_Id;
Init_Expr : Node_Id;
Stmts : List_Id)
is
Exceptions_OK : constant Boolean :=
not Restriction_Active
(No_Exception_Propagation);
Finalization_OK : constant Boolean :=
Present (Comp_Typ)
and then Needs_Finalization (Comp_Typ);
Full_Typ : constant Entity_Id := Underlying_Type (Comp_Typ);
Adj_Call : Node_Id;
Blk_Stmts : List_Id;
Init_Stmt : Node_Id;
begin
-- Protect the initialization statements from aborts. Generate:
-- Abort_Defer;
if Finalization_OK and Abort_Allowed then
if Exceptions_OK then
Blk_Stmts := New_List;
else
Blk_Stmts := Stmts;
end if;
Append_To (Blk_Stmts, Build_Runtime_Call (Loc, RE_Abort_Defer));
-- Otherwise aborts are not allowed. All generated code is added
-- directly to the input list.
else
Blk_Stmts := Stmts;
end if;
-- Initialize the array element. Generate:
-- Arr_Comp := Init_Expr;
-- Note that the initialization expression is replicated because
-- it has to be reevaluated within a generated loop.
Init_Stmt :=
Make_OK_Assignment_Statement (Loc,
Name => New_Copy_Tree (Arr_Comp),
Expression => New_Copy_Tree (Init_Expr));
Set_No_Ctrl_Actions (Init_Stmt);
-- If this is an aggregate for an array of arrays, each
-- subaggregate will be expanded as well, and even with
-- No_Ctrl_Actions the assignments of inner components will
-- require attachment in their assignments to temporaries. These
-- temporaries must be finalized for each subaggregate. Generate:
-- begin
-- Arr_Comp := Init_Expr;
-- end;
if Finalization_OK and then Is_Array_Type (Comp_Typ) then
Init_Stmt :=
Make_Block_Statement (Loc,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List (Init_Stmt)));
end if;
Append_To (Blk_Stmts, Init_Stmt);
-- Adjust the tag due to a possible view conversion. Generate:
-- Arr_Comp._tag := Full_TypP;
if Tagged_Type_Expansion
and then Present (Comp_Typ)
and then Is_Tagged_Type (Comp_Typ)
then
Append_To (Blk_Stmts,
Make_OK_Assignment_Statement (Loc,
Name =>
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Arr_Comp),
Selector_Name =>
New_Occurrence_Of
(First_Tag_Component (Full_Typ), Loc)),
Expression =>
Unchecked_Convert_To (RTE (RE_Tag),
New_Occurrence_Of
(Node (First_Elmt (Access_Disp_Table (Full_Typ))),
Loc))));
end if;
-- Adjust the array component. Controlled subaggregates are not
-- considered because each of their individual elements will
-- receive an adjustment of its own. Generate:
-- [Deep_]Adjust (Arr_Comp);
if Finalization_OK
and then not Is_Limited_Type (Comp_Typ)
and then not
(Is_Array_Type (Comp_Typ)
and then Is_Controlled (Component_Type (Comp_Typ))
and then Nkind (Expr) = N_Aggregate)
then
Adj_Call :=
Make_Adjust_Call
(Obj_Ref => New_Copy_Tree (Arr_Comp),
Typ => Comp_Typ);
-- Guard against a missing [Deep_]Adjust when the component
-- type was not frozen properly.
if Present (Adj_Call) then
Append_To (Blk_Stmts, Adj_Call);
end if;
end if;
-- Complete the protection of the initialization statements
if Finalization_OK and Abort_Allowed then
-- Wrap the initialization statements in a block to catch a
-- potential exception. Generate:
-- begin
-- Abort_Defer;
-- Arr_Comp := Init_Expr;
-- Arr_Comp._tag := Full_TypP;
-- [Deep_]Adjust (Arr_Comp);
-- at end
-- Abort_Undefer_Direct;
-- end;
if Exceptions_OK then
Append_To (Stmts,
Build_Abort_Undefer_Block (Loc,
Stmts => Blk_Stmts,
Context => N));
-- Otherwise exceptions are not propagated. Generate:
-- Abort_Defer;
-- Arr_Comp := Init_Expr;
-- Arr_Comp._tag := Full_TypP;
-- [Deep_]Adjust (Arr_Comp);
-- Abort_Undefer;
else
Append_To (Blk_Stmts,
Build_Runtime_Call (Loc, RE_Abort_Undefer));
end if;
end if;
end Initialize_Array_Component;
-------------------------------------
-- Initialize_Ctrl_Array_Component --
-------------------------------------
procedure Initialize_Ctrl_Array_Component
(Arr_Comp : Node_Id;
Comp_Typ : Entity_Id;
Init_Expr : Node_Id;
Stmts : List_Id)
is
Act_Aggr : Node_Id;
Act_Stmts : List_Id;
Expr : Node_Id;
Fin_Call : Node_Id;
Hook_Clear : Node_Id;
In_Place_Expansion : Boolean;
-- Flag set when a nonlimited controlled function call requires
-- in-place expansion.
begin
-- Duplicate the initialization expression in case the context is
-- a multi choice list or an "others" choice which plugs various
-- holes in the aggregate. As a result the expression is no longer
-- shared between the various components and is reevaluated for
-- each such component.
Expr := New_Copy_Tree (Init_Expr);
Set_Parent (Expr, Parent (Init_Expr));
-- Perform a preliminary analysis and resolution to determine what
-- the initialization expression denotes. An unanalyzed function
-- call may appear as an identifier or an indexed component.
if Nkind_In (Expr, N_Function_Call,
N_Identifier,
N_Indexed_Component)
and then not Analyzed (Expr)
then
Preanalyze_And_Resolve (Expr, Comp_Typ);
end if;
In_Place_Expansion :=
Nkind (Expr) = N_Function_Call
and then not Is_Limited_Type (Comp_Typ);
-- The initialization expression is a controlled function call.
-- Perform in-place removal of side effects to avoid creating a
-- transient scope, which leads to premature finalization.
-- This in-place expansion is not performed for limited transient
-- objects because the initialization is already done in-place.
if In_Place_Expansion then
-- Suppress the removal of side effects by general analysis
-- because this behavior is emulated here. This avoids the
-- generation of a transient scope, which leads to out-of-order
-- adjustment and finalization.
Set_No_Side_Effect_Removal (Expr);
-- When the transient component initialization is related to a
-- range or an "others", keep all generated statements within
-- the enclosing loop. This way the controlled function call
-- will be evaluated at each iteration, and its result will be
-- finalized at the end of each iteration.
if In_Loop then
Act_Aggr := Empty;
Act_Stmts := Stmts;
-- Otherwise this is a single component initialization. Hook-
-- related statements are inserted prior to the aggregate.
else
Act_Aggr := N;
Act_Stmts := No_List;
end if;
-- Install all hook-related declarations and prepare the clean
-- up statements.
Process_Transient_Component
(Loc => Loc,
Comp_Typ => Comp_Typ,
Init_Expr => Expr,
Fin_Call => Fin_Call,
Hook_Clear => Hook_Clear,
Aggr => Act_Aggr,
Stmts => Act_Stmts);
end if;
-- Use the noncontrolled component initialization circuitry to
-- assign the result of the function call to the array element.
-- This also performs subaggregate wrapping, tag adjustment, and
-- [deep] adjustment of the array element.
Initialize_Array_Component
(Arr_Comp => Arr_Comp,
Comp_Typ => Comp_Typ,
Init_Expr => Expr,
Stmts => Stmts);
-- At this point the array element is fully initialized. Complete
-- the processing of the controlled array component by finalizing
-- the transient function result.
if In_Place_Expansion then
Process_Transient_Component_Completion
(Loc => Loc,
Aggr => N,
Fin_Call => Fin_Call,
Hook_Clear => Hook_Clear,
Stmts => Stmts);
end if;
end Initialize_Ctrl_Array_Component;
-- Local variables
Stmts : constant List_Id := New_List;
Comp_Typ : Entity_Id := Empty;
Expr_Q : Node_Id;
Indexed_Comp : Node_Id;
Init_Call : Node_Id;
New_Indexes : List_Id;
-- Start of processing for Gen_Assign
begin
if No (Indexes) then
New_Indexes := New_List;
else
New_Indexes := New_Copy_List_Tree (Indexes);
end if;
Append_To (New_Indexes, Ind);
if Present (Next_Index (Index)) then
return
Add_Loop_Actions (
Build_Array_Aggr_Code
(N => Expr,
Ctype => Ctype,
Index => Next_Index (Index),
Into => Into,
Scalar_Comp => Scalar_Comp,
Indexes => New_Indexes));
end if;
-- If we get here then we are at a bottom-level (sub-)aggregate
Indexed_Comp :=
Checks_Off
(Make_Indexed_Component (Loc,
Prefix => New_Copy_Tree (Into),
Expressions => New_Indexes));
Set_Assignment_OK (Indexed_Comp);
-- Ada 2005 (AI-287): In case of default initialized component, Expr
-- is not present (and therefore we also initialize Expr_Q to empty).
if No (Expr) then
Expr_Q := Empty;
elsif Nkind (Expr) = N_Qualified_Expression then
Expr_Q := Expression (Expr);
else
Expr_Q := Expr;
end if;
if Present (Etype (N)) and then Etype (N) /= Any_Composite then
Comp_Typ := Component_Type (Etype (N));
pragma Assert (Comp_Typ = Ctype); -- AI-287
elsif Present (Next (First (New_Indexes))) then
-- Ada 2005 (AI-287): Do nothing in case of default initialized
-- component because we have received the component type in
-- the formal parameter Ctype.
-- ??? Some assert pragmas have been added to check if this new
-- formal can be used to replace this code in all cases.
if Present (Expr) then
-- This is a multidimensional array. Recover the component type
-- from the outermost aggregate, because subaggregates do not
-- have an assigned type.
declare
P : Node_Id;
begin
P := Parent (Expr);
while Present (P) loop
if Nkind (P) = N_Aggregate
and then Present (Etype (P))
then
Comp_Typ := Component_Type (Etype (P));
exit;
else
P := Parent (P);
end if;
end loop;
pragma Assert (Comp_Typ = Ctype); -- AI-287
end;
end if;
end if;
-- Ada 2005 (AI-287): We only analyze the expression in case of non-
-- default initialized components (otherwise Expr_Q is not present).
if Present (Expr_Q)
and then Nkind_In (Expr_Q, N_Aggregate, N_Extension_Aggregate)
then
-- At this stage the Expression may not have been analyzed yet
-- because the array aggregate code has not been updated to use
-- the Expansion_Delayed flag and avoid analysis altogether to
-- solve the same problem (see Resolve_Aggr_Expr). So let us do
-- the analysis of non-array aggregates now in order to get the
-- value of Expansion_Delayed flag for the inner aggregate ???
if Present (Comp_Typ) and then not Is_Array_Type (Comp_Typ) then
Analyze_And_Resolve (Expr_Q, Comp_Typ);
end if;
if Is_Delayed_Aggregate (Expr_Q) then
-- This is either a subaggregate of a multidimensional array,
-- or a component of an array type whose component type is
-- also an array. In the latter case, the expression may have
-- component associations that provide different bounds from
-- those of the component type, and sliding must occur. Instead
-- of decomposing the current aggregate assignment, force the
-- reanalysis of the assignment, so that a temporary will be
-- generated in the usual fashion, and sliding will take place.
if Nkind (Parent (N)) = N_Assignment_Statement
and then Is_Array_Type (Comp_Typ)
and then Present (Component_Associations (Expr_Q))
and then Must_Slide (Comp_Typ, Etype (Expr_Q))
then
Set_Expansion_Delayed (Expr_Q, False);
Set_Analyzed (Expr_Q, False);
else
return
Add_Loop_Actions (
Late_Expansion (Expr_Q, Etype (Expr_Q), Indexed_Comp));
end if;
end if;
end if;
if Present (Expr) then
-- Handle an initialization expression of a controlled type in
-- case it denotes a function call. In general such a scenario
-- will produce a transient scope, but this will lead to wrong
-- order of initialization, adjustment, and finalization in the
-- context of aggregates.
-- Target (1) := Ctrl_Func_Call;
-- begin -- scope
-- Trans_Obj : ... := Ctrl_Func_Call; -- object
-- Target (1) := Trans_Obj;
-- Finalize (Trans_Obj);
-- end;
-- Target (1)._tag := ...;
-- Adjust (Target (1));
-- In the example above, the call to Finalize occurs too early
-- and as a result it may leave the array component in a bad
-- state. Finalization of the transient object should really
-- happen after adjustment.
-- To avoid this scenario, perform in-place side-effect removal
-- of the function call. This eliminates the transient property
-- of the function result and ensures correct order of actions.
-- Res : ... := Ctrl_Func_Call;
-- Target (1) := Res;
-- Target (1)._tag := ...;
-- Adjust (Target (1));
-- Finalize (Res);
if Present (Comp_Typ)
and then Needs_Finalization (Comp_Typ)
and then Nkind (Expr) /= N_Aggregate
then
Initialize_Ctrl_Array_Component
(Arr_Comp => Indexed_Comp,
Comp_Typ => Comp_Typ,
Init_Expr => Expr,
Stmts => Stmts);
-- Otherwise perform simple component initialization
else
Initialize_Array_Component
(Arr_Comp => Indexed_Comp,
Comp_Typ => Comp_Typ,
Init_Expr => Expr,
Stmts => Stmts);
end if;
-- Ada 2005 (AI-287): In case of default initialized component, call
-- the initialization subprogram associated with the component type.
-- If the component type is an access type, add an explicit null
-- assignment, because for the back-end there is an initialization
-- present for the whole aggregate, and no default initialization
-- will take place.
-- In addition, if the component type is controlled, we must call
-- its Initialize procedure explicitly, because there is no explicit
-- object creation that will invoke it otherwise.
else
if Present (Base_Init_Proc (Base_Type (Ctype)))
or else Has_Task (Base_Type (Ctype))
then
Append_List_To (Stmts,
Build_Initialization_Call (Loc,
Id_Ref => Indexed_Comp,
Typ => Ctype,
With_Default_Init => True));
-- If the component type has invariants, add an invariant
-- check after the component is default-initialized. It will
-- be analyzed and resolved before the code for initialization
-- of other components.
if Has_Invariants (Ctype) then
Set_Etype (Indexed_Comp, Ctype);
Append_To (Stmts, Make_Invariant_Call (Indexed_Comp));
end if;
elsif Is_Access_Type (Ctype) then
Append_To (Stmts,
Make_Assignment_Statement (Loc,
Name => New_Copy_Tree (Indexed_Comp),
Expression => Make_Null (Loc)));
end if;
if Needs_Finalization (Ctype) then
Init_Call :=
Make_Init_Call
(Obj_Ref => New_Copy_Tree (Indexed_Comp),
Typ => Ctype);
-- Guard against a missing [Deep_]Initialize when the component
-- type was not properly frozen.
if Present (Init_Call) then
Append_To (Stmts, Init_Call);
end if;
end if;
end if;
return Add_Loop_Actions (Stmts);
end Gen_Assign;
--------------
-- Gen_Loop --
--------------
function Gen_Loop (L, H : Node_Id; Expr : Node_Id) return List_Id is
Is_Iterated_Component : constant Boolean :=
Nkind (Parent (Expr)) = N_Iterated_Component_Association;
L_J : Node_Id;
L_L : Node_Id;
-- Index_Base'(L)
L_H : Node_Id;
-- Index_Base'(H)
L_Range : Node_Id;
-- Index_Base'(L) .. Index_Base'(H)
L_Iteration_Scheme : Node_Id;
-- L_J in Index_Base'(L) .. Index_Base'(H)
L_Body : List_Id;
-- The statements to execute in the loop
S : constant List_Id := New_List;
-- List of statements
Tcopy : Node_Id;
-- Copy of expression tree, used for checking purposes
begin
-- If loop bounds define an empty range return the null statement
if Empty_Range (L, H) then
Append_To (S, Make_Null_Statement (Loc));
-- Ada 2005 (AI-287): Nothing else need to be done in case of
-- default initialized component.
if No (Expr) then
null;
else
-- The expression must be type-checked even though no component
-- of the aggregate will have this value. This is done only for
-- actual components of the array, not for subaggregates. Do
-- the check on a copy, because the expression may be shared
-- among several choices, some of which might be non-null.
if Present (Etype (N))
and then Is_Array_Type (Etype (N))
and then No (Next_Index (Index))
then
Expander_Mode_Save_And_Set (False);
Tcopy := New_Copy_Tree (Expr);
Set_Parent (Tcopy, N);
Analyze_And_Resolve (Tcopy, Component_Type (Etype (N)));
Expander_Mode_Restore;
end if;
end if;
return S;
-- If loop bounds are the same then generate an assignment, unless
-- the parent construct is an Iterated_Component_Association.
elsif Equal (L, H) and then not Is_Iterated_Component then
return Gen_Assign (New_Copy_Tree (L), Expr);
-- If H - L <= 2 then generate a sequence of assignments when we are
-- processing the bottom most aggregate and it contains scalar
-- components.
elsif No (Next_Index (Index))
and then Scalar_Comp
and then Local_Compile_Time_Known_Value (L)
and then Local_Compile_Time_Known_Value (H)
and then Local_Expr_Value (H) - Local_Expr_Value (L) <= 2
and then not Is_Iterated_Component
then
Append_List_To (S, Gen_Assign (New_Copy_Tree (L), Expr));
Append_List_To (S, Gen_Assign (Add (1, To => L), Expr));
if Local_Expr_Value (H) - Local_Expr_Value (L) = 2 then
Append_List_To (S, Gen_Assign (Add (2, To => L), Expr));
end if;
return S;
end if;
-- Otherwise construct the loop, starting with the loop index L_J
if Is_Iterated_Component then
L_J :=
Make_Defining_Identifier (Loc,
Chars => (Chars (Defining_Identifier (Parent (Expr)))));
else
L_J := Make_Temporary (Loc, 'J', L);
end if;
-- Construct "L .. H" in Index_Base. We use a qualified expression
-- for the bound to convert to the index base, but we don't need
-- to do that if we already have the base type at hand.
if Etype (L) = Index_Base then
L_L := L;
else
L_L :=
Make_Qualified_Expression (Loc,
Subtype_Mark => Index_Base_Name,
Expression => New_Copy_Tree (L));
end if;
if Etype (H) = Index_Base then
L_H := H;
else
L_H :=
Make_Qualified_Expression (Loc,
Subtype_Mark => Index_Base_Name,
Expression => New_Copy_Tree (H));
end if;
L_Range :=
Make_Range (Loc,
Low_Bound => L_L,
High_Bound => L_H);
-- Construct "for L_J in Index_Base range L .. H"
L_Iteration_Scheme :=
Make_Iteration_Scheme
(Loc,
Loop_Parameter_Specification =>
Make_Loop_Parameter_Specification
(Loc,
Defining_Identifier => L_J,
Discrete_Subtype_Definition => L_Range));
-- Construct the statements to execute in the loop body
L_Body :=
Gen_Assign (New_Occurrence_Of (L_J, Loc), Expr, In_Loop => True);
-- Construct the final loop
Append_To (S,
Make_Implicit_Loop_Statement
(Node => N,
Identifier => Empty,
Iteration_Scheme => L_Iteration_Scheme,
Statements => L_Body));
-- A small optimization: if the aggregate is initialized with a box
-- and the component type has no initialization procedure, remove the
-- useless empty loop.
if Nkind (First (S)) = N_Loop_Statement
and then Is_Empty_List (Statements (First (S)))
then
return New_List (Make_Null_Statement (Loc));
else
return S;
end if;
end Gen_Loop;
---------------
-- Gen_While --
---------------
-- The code built is
-- W_J : Index_Base := L;
-- while W_J < H loop
-- W_J := Index_Base'Succ (W);
-- L_Body;
-- end loop;
function Gen_While (L, H : Node_Id; Expr : Node_Id) return List_Id is
W_J : Node_Id;
W_Decl : Node_Id;
-- W_J : Base_Type := L;
W_Iteration_Scheme : Node_Id;
-- while W_J < H
W_Index_Succ : Node_Id;
-- Index_Base'Succ (J)
W_Increment : Node_Id;
-- W_J := Index_Base'Succ (W)
W_Body : constant List_Id := New_List;
-- The statements to execute in the loop
S : constant List_Id := New_List;
-- list of statement
begin
-- If loop bounds define an empty range or are equal return null
if Empty_Range (L, H) or else Equal (L, H) then
Append_To (S, Make_Null_Statement (Loc));
return S;
end if;
-- Build the decl of W_J
W_J := Make_Temporary (Loc, 'J', L);
W_Decl :=
Make_Object_Declaration
(Loc,
Defining_Identifier => W_J,
Object_Definition => Index_Base_Name,
Expression => L);
-- Theoretically we should do a New_Copy_Tree (L) here, but we know
-- that in this particular case L is a fresh Expr generated by
-- Add which we are the only ones to use.
Append_To (S, W_Decl);
-- Construct " while W_J < H"
W_Iteration_Scheme :=
Make_Iteration_Scheme
(Loc,
Condition => Make_Op_Lt
(Loc,
Left_Opnd => New_Occurrence_Of (W_J, Loc),
Right_Opnd => New_Copy_Tree (H)));
-- Construct the statements to execute in the loop body
W_Index_Succ :=
Make_Attribute_Reference
(Loc,
Prefix => Index_Base_Name,
Attribute_Name => Name_Succ,
Expressions => New_List (New_Occurrence_Of (W_J, Loc)));
W_Increment :=
Make_OK_Assignment_Statement
(Loc,
Name => New_Occurrence_Of (W_J, Loc),
Expression => W_Index_Succ);
Append_To (W_Body, W_Increment);
Append_List_To (W_Body,
Gen_Assign (New_Occurrence_Of (W_J, Loc), Expr, In_Loop => True));
-- Construct the final loop
Append_To (S,
Make_Implicit_Loop_Statement
(Node => N,
Identifier => Empty,
Iteration_Scheme => W_Iteration_Scheme,
Statements => W_Body));
return S;
end Gen_While;
--------------------
-- Get_Assoc_Expr --
--------------------
function Get_Assoc_Expr (Assoc : Node_Id) return Node_Id is
Typ : constant Entity_Id := Base_Type (Etype (N));
begin
if Box_Present (Assoc) then
if Is_Scalar_Type (Ctype) then
if Present (Default_Aspect_Component_Value (Typ)) then
return Default_Aspect_Component_Value (Typ);
elsif Present (Default_Aspect_Value (Ctype)) then
return Default_Aspect_Value (Ctype);
else
return Empty;
end if;
else
return Empty;
end if;
else
return Expression (Assoc);
end if;
end Get_Assoc_Expr;
---------------------
-- Index_Base_Name --
---------------------
function Index_Base_Name return Node_Id is
begin
return New_Occurrence_Of (Index_Base, Sloc (N));
end Index_Base_Name;
------------------------------------
-- Local_Compile_Time_Known_Value --
------------------------------------
function Local_Compile_Time_Known_Value (E : Node_Id) return Boolean is
begin
return Compile_Time_Known_Value (E)
or else
(Nkind (E) = N_Attribute_Reference
and then Attribute_Name (E) = Name_Val
and then Compile_Time_Known_Value (First (Expressions (E))));
end Local_Compile_Time_Known_Value;
----------------------
-- Local_Expr_Value --
----------------------
function Local_Expr_Value (E : Node_Id) return Uint is
begin
if Compile_Time_Known_Value (E) then
return Expr_Value (E);
else
return Expr_Value (First (Expressions (E)));
end if;
end Local_Expr_Value;
-- Local variables
New_Code : constant List_Id := New_List;
Aggr_L : constant Node_Id := Low_Bound (Aggregate_Bounds (N));
Aggr_H : constant Node_Id := High_Bound (Aggregate_Bounds (N));
-- The aggregate bounds of this specific subaggregate. Note that if the
-- code generated by Build_Array_Aggr_Code is executed then these bounds
-- are OK. Otherwise a Constraint_Error would have been raised.
Aggr_Low : constant Node_Id := Duplicate_Subexpr_No_Checks (Aggr_L);
Aggr_High : constant Node_Id := Duplicate_Subexpr_No_Checks (Aggr_H);
-- After Duplicate_Subexpr these are side-effect free
Assoc : Node_Id;
Choice : Node_Id;
Expr : Node_Id;
High : Node_Id;
Low : Node_Id;
Typ : Entity_Id;
Nb_Choices : Nat := 0;
Table : Case_Table_Type (1 .. Number_Of_Choices (N));
-- Used to sort all the different choice values
Nb_Elements : Int;
-- Number of elements in the positional aggregate
Others_Assoc : Node_Id := Empty;
-- Start of processing for Build_Array_Aggr_Code
begin
-- First before we start, a special case. if we have a bit packed
-- array represented as a modular type, then clear the value to
-- zero first, to ensure that unused bits are properly cleared.
Typ := Etype (N);
if Present (Typ)
and then Is_Bit_Packed_Array (Typ)
and then Is_Modular_Integer_Type (Packed_Array_Impl_Type (Typ))
then
Append_To (New_Code,
Make_Assignment_Statement (Loc,
Name => New_Copy_Tree (Into),
Expression =>
Unchecked_Convert_To (Typ,
Make_Integer_Literal (Loc, Uint_0))));
end if;
-- If the component type contains tasks, we need to build a Master
-- entity in the current scope, because it will be needed if build-
-- in-place functions are called in the expanded code.
if Nkind (Parent (N)) = N_Object_Declaration and then Has_Task (Typ) then
Build_Master_Entity (Defining_Identifier (Parent (N)));
end if;
-- STEP 1: Process component associations
-- For those associations that may generate a loop, initialize
-- Loop_Actions to collect inserted actions that may be crated.
-- Skip this if no component associations
if No (Expressions (N)) then
-- STEP 1 (a): Sort the discrete choices
Assoc := First (Component_Associations (N));
while Present (Assoc) loop
Choice := First (Choice_List (Assoc));
while Present (Choice) loop
if Nkind (Choice) = N_Others_Choice then
Set_Loop_Actions (Assoc, New_List);
Others_Assoc := Assoc;
exit;
end if;
Get_Index_Bounds (Choice, Low, High);
if Low /= High then
Set_Loop_Actions (Assoc, New_List);
end if;
Nb_Choices := Nb_Choices + 1;
Table (Nb_Choices) :=
(Choice_Lo => Low,
Choice_Hi => High,
Choice_Node => Get_Assoc_Expr (Assoc));
Next (Choice);
end loop;
Next (Assoc);
end loop;
-- If there is more than one set of choices these must be static
-- and we can therefore sort them. Remember that Nb_Choices does not
-- account for an others choice.
if Nb_Choices > 1 then
Sort_Case_Table (Table);
end if;
-- STEP 1 (b): take care of the whole set of discrete choices
for J in 1 .. Nb_Choices loop
Low := Table (J).Choice_Lo;
High := Table (J).Choice_Hi;
Expr := Table (J).Choice_Node;
Append_List (Gen_Loop (Low, High, Expr), To => New_Code);
end loop;
-- STEP 1 (c): generate the remaining loops to cover others choice
-- We don't need to generate loops over empty gaps, but if there is
-- a single empty range we must analyze the expression for semantics
if Present (Others_Assoc) then
declare
First : Boolean := True;
begin
for J in 0 .. Nb_Choices loop
if J = 0 then
Low := Aggr_Low;
else
Low := Add (1, To => Table (J).Choice_Hi);
end if;
if J = Nb_Choices then
High := Aggr_High;
else
High := Add (-1, To => Table (J + 1).Choice_Lo);
end if;
-- If this is an expansion within an init proc, make
-- sure that discriminant references are replaced by
-- the corresponding discriminal.
if Inside_Init_Proc then
if Is_Entity_Name (Low)
and then Ekind (Entity (Low)) = E_Discriminant
then
Set_Entity (Low, Discriminal (Entity (Low)));
end if;
if Is_Entity_Name (High)
and then Ekind (Entity (High)) = E_Discriminant
then
Set_Entity (High, Discriminal (Entity (High)));
end if;
end if;
if First
or else not Empty_Range (Low, High)
then
First := False;
Append_List
(Gen_Loop (Low, High,
Get_Assoc_Expr (Others_Assoc)), To => New_Code);
end if;
end loop;
end;
end if;
-- STEP 2: Process positional components
else
-- STEP 2 (a): Generate the assignments for each positional element
-- Note that here we have to use Aggr_L rather than Aggr_Low because
-- Aggr_L is analyzed and Add wants an analyzed expression.
Expr := First (Expressions (N));
Nb_Elements := -1;
while Present (Expr) loop
Nb_Elements := Nb_Elements + 1;
Append_List (Gen_Assign (Add (Nb_Elements, To => Aggr_L), Expr),
To => New_Code);
Next (Expr);
end loop;
-- STEP 2 (b): Generate final loop if an others choice is present
-- Here Nb_Elements gives the offset of the last positional element.
if Present (Component_Associations (N)) then
Assoc := Last (Component_Associations (N));
-- Ada 2005 (AI-287)
Append_List (Gen_While (Add (Nb_Elements, To => Aggr_L),
Aggr_High,
Get_Assoc_Expr (Assoc)), -- AI-287
To => New_Code);
end if;
end if;
return New_Code;
end Build_Array_Aggr_Code;
----------------------------
-- Build_Record_Aggr_Code --
----------------------------
function Build_Record_Aggr_Code
(N : Node_Id;
Typ : Entity_Id;
Lhs : Node_Id) return List_Id
is
Loc : constant Source_Ptr := Sloc (N);
L : constant List_Id := New_List;
N_Typ : constant Entity_Id := Etype (N);
Comp : Node_Id;
Instr : Node_Id;
Ref : Node_Id;
Target : Entity_Id;
Comp_Type : Entity_Id;
Selector : Entity_Id;
Comp_Expr : Node_Id;
Expr_Q : Node_Id;
-- If this is an internal aggregate, the External_Final_List is an
-- expression for the controller record of the enclosing type.
-- If the current aggregate has several controlled components, this
-- expression will appear in several calls to attach to the finali-
-- zation list, and it must not be shared.
Ancestor_Is_Expression : Boolean := False;
Ancestor_Is_Subtype_Mark : Boolean := False;
Init_Typ : Entity_Id := Empty;
Finalization_Done : Boolean := False;
-- True if Generate_Finalization_Actions has already been called; calls
-- after the first do nothing.
function Ancestor_Discriminant_Value (Disc : Entity_Id) return Node_Id;
-- Returns the value that the given discriminant of an ancestor type
-- should receive (in the absence of a conflict with the value provided
-- by an ancestor part of an extension aggregate).
procedure Check_Ancestor_Discriminants (Anc_Typ : Entity_Id);
-- Check that each of the discriminant values defined by the ancestor
-- part of an extension aggregate match the corresponding values
-- provided by either an association of the aggregate or by the
-- constraint imposed by a parent type (RM95-4.3.2(8)).
function Compatible_Int_Bounds
(Agg_Bounds : Node_Id;
Typ_Bounds : Node_Id) return Boolean;
-- Return true if Agg_Bounds are equal or within Typ_Bounds. It is
-- assumed that both bounds are integer ranges.
procedure Generate_Finalization_Actions;
-- Deal with the various controlled type data structure initializations
-- (but only if it hasn't been done already).
function Get_Constraint_Association (T : Entity_Id) return Node_Id;
-- Returns the first discriminant association in the constraint
-- associated with T, if any, otherwise returns Empty.
function Get_Explicit_Discriminant_Value (D : Entity_Id) return Node_Id;
-- If the ancestor part is an unconstrained type and further ancestors
-- do not provide discriminants for it, check aggregate components for
-- values of the discriminants.
procedure Init_Hidden_Discriminants (Typ : Entity_Id; List : List_Id);
-- If Typ is derived, and constrains discriminants of the parent type,
-- these discriminants are not components of the aggregate, and must be
-- initialized. The assignments are appended to List. The same is done
-- if Typ derives fron an already constrained subtype of a discriminated
-- parent type.
procedure Init_Stored_Discriminants;
-- If the type is derived and has inherited discriminants, generate
-- explicit assignments for each, using the store constraint of the
-- type. Note that both visible and stored discriminants must be
-- initialized in case the derived type has some renamed and some
-- constrained discriminants.
procedure Init_Visible_Discriminants;
-- If type has discriminants, retrieve their values from aggregate,
-- and generate explicit assignments for each. This does not include
-- discriminants inherited from ancestor, which are handled above.
-- The type of the aggregate is a subtype created ealier using the
-- given values of the discriminant components of the aggregate.
procedure Initialize_Ctrl_Record_Component
(Rec_Comp : Node_Id;
Comp_Typ : Entity_Id;
Init_Expr : Node_Id;
Stmts : List_Id);
-- Perform the initialization of controlled record component Rec_Comp.
-- Comp_Typ is the component type. Init_Expr is the initialization
-- expression for the record component. Hook-related declarations are
-- inserted prior to aggregate N using Insert_Action. All remaining
-- generated code is added to list Stmts.
procedure Initialize_Record_Component
(Rec_Comp : Node_Id;
Comp_Typ : Entity_Id;
Init_Expr : Node_Id;
Stmts : List_Id);
-- Perform the initialization of record component Rec_Comp. Comp_Typ
-- is the component type. Init_Expr is the initialization expression
-- of the record component. All generated code is added to list Stmts.
function Is_Int_Range_Bounds (Bounds : Node_Id) return Boolean;
-- Check whether Bounds is a range node and its lower and higher bounds
-- are integers literals.
function Replace_Type (Expr : Node_Id) return Traverse_Result;
-- If the aggregate contains a self-reference, traverse each expression
-- to replace a possible self-reference with a reference to the proper
-- component of the target of the assignment.
function Rewrite_Discriminant (Expr : Node_Id) return Traverse_Result;
-- If default expression of a component mentions a discriminant of the
-- type, it must be rewritten as the discriminant of the target object.
---------------------------------
-- Ancestor_Discriminant_Value --
---------------------------------
function Ancestor_Discriminant_Value (Disc : Entity_Id) return Node_Id is
Assoc : Node_Id;
Assoc_Elmt : Elmt_Id;
Aggr_Comp : Entity_Id;
Corresp_Disc : Entity_Id;
Current_Typ : Entity_Id := Base_Type (Typ);
Parent_Typ : Entity_Id;
Parent_Disc : Entity_Id;
Save_Assoc : Node_Id := Empty;
begin
-- First check any discriminant associations to see if any of them
-- provide a value for the discriminant.
if Present (Discriminant_Specifications (Parent (Current_Typ))) then
Assoc := First (Component_Associations (N));
while Present (Assoc) loop
Aggr_Comp := Entity (First (Choices (Assoc)));
if Ekind (Aggr_Comp) = E_Discriminant then
Save_Assoc := Expression (Assoc);
Corresp_Disc := Corresponding_Discriminant (Aggr_Comp);
while Present (Corresp_Disc) loop
-- If found a corresponding discriminant then return the
-- value given in the aggregate. (Note: this is not
-- correct in the presence of side effects. ???)
if Disc = Corresp_Disc then
return Duplicate_Subexpr (Expression (Assoc));
end if;
Corresp_Disc := Corresponding_Discriminant (Corresp_Disc);
end loop;
end if;
Next (Assoc);
end loop;
end if;
-- No match found in aggregate, so chain up parent types to find
-- a constraint that defines the value of the discriminant.
Parent_Typ := Etype (Current_Typ);
while Current_Typ /= Parent_Typ loop
if Has_Discriminants (Parent_Typ)
and then not Has_Unknown_Discriminants (Parent_Typ)
then
Parent_Disc := First_Discriminant (Parent_Typ);
-- We either get the association from the subtype indication
-- of the type definition itself, or from the discriminant
-- constraint associated with the type entity (which is
-- preferable, but it's not always present ???)
if Is_Empty_Elmt_List (Discriminant_Constraint (Current_Typ))
then
Assoc := Get_Constraint_Association (Current_Typ);
Assoc_Elmt := No_Elmt;
else
Assoc_Elmt :=
First_Elmt (Discriminant_Constraint (Current_Typ));
Assoc := Node (Assoc_Elmt);
end if;
-- Traverse the discriminants of the parent type looking
-- for one that corresponds.
while Present (Parent_Disc) and then Present (Assoc) loop
Corresp_Disc := Parent_Disc;
while Present (Corresp_Disc)
and then Disc /= Corresp_Disc
loop
Corresp_Disc := Corresponding_Discriminant (Corresp_Disc);
end loop;
if Disc = Corresp_Disc then
if Nkind (Assoc) = N_Discriminant_Association then
Assoc := Expression (Assoc);
end if;
-- If the located association directly denotes
-- a discriminant, then use the value of a saved
-- association of the aggregate. This is an approach
-- used to handle certain cases involving multiple
-- discriminants mapped to a single discriminant of
-- a descendant. It's not clear how to locate the
-- appropriate discriminant value for such cases. ???
if Is_Entity_Name (Assoc)
and then Ekind (Entity (Assoc)) = E_Discriminant
then
Assoc := Save_Assoc;
end if;
return Duplicate_Subexpr (Assoc);
end if;
Next_Discriminant (Parent_Disc);
if No (Assoc_Elmt) then
Next (Assoc);
else
Next_Elmt (Assoc_Elmt);
if Present (Assoc_Elmt) then
Assoc := Node (Assoc_Elmt);
else
Assoc := Empty;
end if;
end if;
end loop;
end if;
Current_Typ := Parent_Typ;
Parent_Typ := Etype (Current_Typ);
end loop;
-- In some cases there's no ancestor value to locate (such as
-- when an ancestor part given by an expression defines the
-- discriminant value).
return Empty;
end Ancestor_Discriminant_Value;
----------------------------------
-- Check_Ancestor_Discriminants --
----------------------------------
procedure Check_Ancestor_Discriminants (Anc_Typ : Entity_Id) is
Discr : Entity_Id;
Disc_Value : Node_Id;
Cond : Node_Id;
begin
Discr := First_Discriminant (Base_Type (Anc_Typ));
while Present (Discr) loop
Disc_Value := Ancestor_Discriminant_Value (Discr);
if Present (Disc_Value) then
Cond := Make_Op_Ne (Loc,
Left_Opnd =>
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Target),
Selector_Name => New_Occurrence_Of (Discr, Loc)),
Right_Opnd => Disc_Value);
Append_To (L,
Make_Raise_Constraint_Error (Loc,
Condition => Cond,
Reason => CE_Discriminant_Check_Failed));
end if;
Next_Discriminant (Discr);
end loop;
end Check_Ancestor_Discriminants;
---------------------------
-- Compatible_Int_Bounds --
---------------------------
function Compatible_Int_Bounds
(Agg_Bounds : Node_Id;
Typ_Bounds : Node_Id) return Boolean
is
Agg_Lo : constant Uint := Intval (Low_Bound (Agg_Bounds));
Agg_Hi : constant Uint := Intval (High_Bound (Agg_Bounds));
Typ_Lo : constant Uint := Intval (Low_Bound (Typ_Bounds));
Typ_Hi : constant Uint := Intval (High_Bound (Typ_Bounds));
begin
return Typ_Lo <= Agg_Lo and then Agg_Hi <= Typ_Hi;
end Compatible_Int_Bounds;
-----------------------------------
-- Generate_Finalization_Actions --
-----------------------------------
procedure Generate_Finalization_Actions is
begin
-- Do the work only the first time this is called
if Finalization_Done then
return;
end if;
Finalization_Done := True;
-- Determine the external finalization list. It is either the
-- finalization list of the outer scope or the one coming from an
-- outer aggregate. When the target is not a temporary, the proper
-- scope is the scope of the target rather than the potentially
-- transient current scope.
if Is_Controlled (Typ) and then Ancestor_Is_Subtype_Mark then
Ref := Convert_To (Init_Typ, New_Copy_Tree (Target));
Set_Assignment_OK (Ref);
Append_To (L,
Make_Procedure_Call_Statement (Loc,
Name =>
New_Occurrence_Of
(Find_Prim_Op (Init_Typ, Name_Initialize), Loc),
Parameter_Associations => New_List (New_Copy_Tree (Ref))));
end if;
end Generate_Finalization_Actions;
--------------------------------
-- Get_Constraint_Association --
--------------------------------
function Get_Constraint_Association (T : Entity_Id) return Node_Id is
Indic : Node_Id;
Typ : Entity_Id;
begin
Typ := T;
-- If type is private, get constraint from full view. This was
-- previously done in an instance context, but is needed whenever
-- the ancestor part has a discriminant, possibly inherited through
-- multiple derivations.
if Is_Private_Type (Typ) and then Present (Full_View (Typ)) then
Typ := Full_View (Typ);
end if;
Indic := Subtype_Indication (Type_Definition (Parent (Typ)));
-- Verify that the subtype indication carries a constraint
if Nkind (Indic) = N_Subtype_Indication
and then Present (Constraint (Indic))
then
return First (Constraints (Constraint (Indic)));
end if;
return Empty;
end Get_Constraint_Association;
-------------------------------------
-- Get_Explicit_Discriminant_Value --
-------------------------------------
function Get_Explicit_Discriminant_Value
(D : Entity_Id) return Node_Id
is
Assoc : Node_Id;
Choice : Node_Id;
Val : Node_Id;
begin
-- The aggregate has been normalized and all associations have a
-- single choice.
Assoc := First (Component_Associations (N));
while Present (Assoc) loop
Choice := First (Choices (Assoc));
if Chars (Choice) = Chars (D) then
Val := Expression (Assoc);
Remove (Assoc);
return Val;
end if;
Next (Assoc);
end loop;
return Empty;
end Get_Explicit_Discriminant_Value;
-------------------------------
-- Init_Hidden_Discriminants --
-------------------------------
procedure Init_Hidden_Discriminants (Typ : Entity_Id; List : List_Id) is
function Is_Completely_Hidden_Discriminant
(Discr : Entity_Id) return Boolean;
-- Determine whether Discr is a completely hidden discriminant of
-- type Typ.
---------------------------------------
-- Is_Completely_Hidden_Discriminant --
---------------------------------------
function Is_Completely_Hidden_Discriminant
(Discr : Entity_Id) return Boolean
is
Item : Entity_Id;
begin
-- Use First/Next_Entity as First/Next_Discriminant do not yield
-- completely hidden discriminants.
Item := First_Entity (Typ);
while Present (Item) loop
if Ekind (Item) = E_Discriminant
and then Is_Completely_Hidden (Item)
and then Chars (Original_Record_Component (Item)) =
Chars (Discr)
then
return True;
end if;
Next_Entity (Item);
end loop;
return False;
end Is_Completely_Hidden_Discriminant;
-- Local variables
Base_Typ : Entity_Id;
Discr : Entity_Id;
Discr_Constr : Elmt_Id;
Discr_Init : Node_Id;
Discr_Val : Node_Id;
In_Aggr_Type : Boolean;
Par_Typ : Entity_Id;
-- Start of processing for Init_Hidden_Discriminants
begin
-- The constraints on the hidden discriminants, if present, are kept
-- in the Stored_Constraint list of the type itself, or in that of
-- the base type. If not in the constraints of the aggregate itself,
-- we examine ancestors to find discriminants that are not renamed
-- by other discriminants but constrained explicitly.
In_Aggr_Type := True;
Base_Typ := Base_Type (Typ);
while Is_Derived_Type (Base_Typ)
and then
(Present (Stored_Constraint (Base_Typ))
or else
(In_Aggr_Type and then Present (Stored_Constraint (Typ))))
loop
Par_Typ := Etype (Base_Typ);
if not Has_Discriminants (Par_Typ) then
return;
end if;
Discr := First_Discriminant (Par_Typ);
-- We know that one of the stored-constraint lists is present
if Present (Stored_Constraint (Base_Typ)) then
Discr_Constr := First_Elmt (Stored_Constraint (Base_Typ));
-- For private extension, stored constraint may be on full view
elsif Is_Private_Type (Base_Typ)
and then Present (Full_View (Base_Typ))
and then Present (Stored_Constraint (Full_View (Base_Typ)))
then
Discr_Constr :=
First_Elmt (Stored_Constraint (Full_View (Base_Typ)));
else
Discr_Constr := First_Elmt (Stored_Constraint (Typ));
end if;
while Present (Discr) and then Present (Discr_Constr) loop
Discr_Val := Node (Discr_Constr);
-- The parent discriminant is renamed in the derived type,
-- nothing to initialize.
-- type Deriv_Typ (Discr : ...)
-- is new Parent_Typ (Discr => Discr);
if Is_Entity_Name (Discr_Val)
and then Ekind (Entity (Discr_Val)) = E_Discriminant
then
null;
-- When the parent discriminant is constrained at the type
-- extension level, it does not appear in the derived type.
-- type Deriv_Typ (Discr : ...)
-- is new Parent_Typ (Discr => Discr,
-- Hidden_Discr => Expression);
elsif Is_Completely_Hidden_Discriminant (Discr) then
null;
-- Otherwise initialize the discriminant
else
Discr_Init :=
Make_OK_Assignment_Statement (Loc,
Name =>
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Target),
Selector_Name => New_Occurrence_Of (Discr, Loc)),
Expression => New_Copy_Tree (Discr_Val));
Set_No_Ctrl_Actions (Discr_Init);
Append_To (List, Discr_Init);
end if;
Next_Elmt (Discr_Constr);
Next_Discriminant (Discr);
end loop;
In_Aggr_Type := False;
Base_Typ := Base_Type (Par_Typ);
end loop;
end Init_Hidden_Discriminants;
--------------------------------
-- Init_Visible_Discriminants --
--------------------------------
procedure Init_Visible_Discriminants is
Discriminant : Entity_Id;
Discriminant_Value : Node_Id;
begin
Discriminant := First_Discriminant (Typ);
while Present (Discriminant) loop
Comp_Expr :=
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Target),
Selector_Name => New_Occurrence_Of (Discriminant, Loc));
Discriminant_Value :=
Get_Discriminant_Value
(Discriminant, Typ, Discriminant_Constraint (N_Typ));
Instr :=
Make_OK_Assignment_Statement (Loc,
Name => Comp_Expr,
Expression => New_Copy_Tree (Discriminant_Value));
Set_No_Ctrl_Actions (Instr);
Append_To (L, Instr);
Next_Discriminant (Discriminant);
end loop;
end Init_Visible_Discriminants;
-------------------------------
-- Init_Stored_Discriminants --
-------------------------------
procedure Init_Stored_Discriminants is
Discriminant : Entity_Id;
Discriminant_Value : Node_Id;
begin
Discriminant := First_Stored_Discriminant (Typ);
while Present (Discriminant) loop
Comp_Expr :=
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Target),
Selector_Name => New_Occurrence_Of (Discriminant, Loc));
Discriminant_Value :=
Get_Discriminant_Value
(Discriminant, N_Typ, Discriminant_Constraint (N_Typ));
Instr :=
Make_OK_Assignment_Statement (Loc,
Name => Comp_Expr,
Expression => New_Copy_Tree (Discriminant_Value));
Set_No_Ctrl_Actions (Instr);
Append_To (L, Instr);
Next_Stored_Discriminant (Discriminant);
end loop;
end Init_Stored_Discriminants;
--------------------------------------
-- Initialize_Ctrl_Record_Component --
--------------------------------------
procedure Initialize_Ctrl_Record_Component
(Rec_Comp : Node_Id;
Comp_Typ : Entity_Id;
Init_Expr : Node_Id;
Stmts : List_Id)
is
Fin_Call : Node_Id;
Hook_Clear : Node_Id;
In_Place_Expansion : Boolean;
-- Flag set when a nonlimited controlled function call requires
-- in-place expansion.
begin
-- Perform a preliminary analysis and resolution to determine what
-- the initialization expression denotes. Unanalyzed function calls
-- may appear as identifiers or indexed components.
if Nkind_In (Init_Expr, N_Function_Call,
N_Identifier,
N_Indexed_Component)
and then not Analyzed (Init_Expr)
then
Preanalyze_And_Resolve (Init_Expr, Comp_Typ);
end if;
In_Place_Expansion :=
Nkind (Init_Expr) = N_Function_Call
and then not Is_Limited_Type (Comp_Typ);
-- The initialization expression is a controlled function call.
-- Perform in-place removal of side effects to avoid creating a
-- transient scope.
-- This in-place expansion is not performed for limited transient
-- objects because the initialization is already done in place.
if In_Place_Expansion then
-- Suppress the removal of side effects by general analysis
-- because this behavior is emulated here. This avoids the
-- generation of a transient scope, which leads to out-of-order
-- adjustment and finalization.
Set_No_Side_Effect_Removal (Init_Expr);
-- Install all hook-related declarations and prepare the clean up
-- statements.
Process_Transient_Component
(Loc => Loc,
Comp_Typ => Comp_Typ,
Init_Expr => Init_Expr,
Fin_Call => Fin_Call,
Hook_Clear => Hook_Clear,
Aggr => N);
end if;
-- Use the noncontrolled component initialization circuitry to
-- assign the result of the function call to the record component.
-- This also performs tag adjustment and [deep] adjustment of the
-- record component.
Initialize_Record_Component
(Rec_Comp => Rec_Comp,
Comp_Typ => Comp_Typ,
Init_Expr => Init_Expr,
Stmts => Stmts);
-- At this point the record component is fully initialized. Complete
-- the processing of the controlled record component by finalizing
-- the transient function result.
if In_Place_Expansion then
Process_Transient_Component_Completion
(Loc => Loc,
Aggr => N,
Fin_Call => Fin_Call,
Hook_Clear => Hook_Clear,
Stmts => Stmts);
end if;
end Initialize_Ctrl_Record_Component;
---------------------------------
-- Initialize_Record_Component --
---------------------------------
procedure Initialize_Record_Component
(Rec_Comp : Node_Id;
Comp_Typ : Entity_Id;
Init_Expr : Node_Id;
Stmts : List_Id)
is
Exceptions_OK : constant Boolean :=
not Restriction_Active (No_Exception_Propagation);
Finalization_OK : constant Boolean := Needs_Finalization (Comp_Typ);
Full_Typ : constant Entity_Id := Underlying_Type (Comp_Typ);
Adj_Call : Node_Id;
Blk_Stmts : List_Id;
Init_Stmt : Node_Id;
begin
-- Protect the initialization statements from aborts. Generate:
-- Abort_Defer;
if Finalization_OK and Abort_Allowed then
if Exceptions_OK then
Blk_Stmts := New_List;
else
Blk_Stmts := Stmts;
end if;
Append_To (Blk_Stmts, Build_Runtime_Call (Loc, RE_Abort_Defer));
-- Otherwise aborts are not allowed. All generated code is added
-- directly to the input list.
else
Blk_Stmts := Stmts;
end if;
-- Initialize the record component. Generate:
-- Rec_Comp := Init_Expr;
-- Note that the initialization expression is NOT replicated because
-- only a single component may be initialized by it.
Init_Stmt :=
Make_OK_Assignment_Statement (Loc,
Name => New_Copy_Tree (Rec_Comp),
Expression => Init_Expr);
Set_No_Ctrl_Actions (Init_Stmt);
Append_To (Blk_Stmts, Init_Stmt);
-- Adjust the tag due to a possible view conversion. Generate:
-- Rec_Comp._tag := Full_TypeP;
if Tagged_Type_Expansion and then Is_Tagged_Type (Comp_Typ) then
Append_To (Blk_Stmts,
Make_OK_Assignment_Statement (Loc,
Name =>
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Rec_Comp),
Selector_Name =>
New_Occurrence_Of
(First_Tag_Component (Full_Typ), Loc)),
Expression =>
Unchecked_Convert_To (RTE (RE_Tag),
New_Occurrence_Of
(Node (First_Elmt (Access_Disp_Table (Full_Typ))),
Loc))));
end if;
-- Adjust the component. Generate:
-- [Deep_]Adjust (Rec_Comp);
if Finalization_OK and then not Is_Limited_Type (Comp_Typ) then
Adj_Call :=
Make_Adjust_Call
(Obj_Ref => New_Copy_Tree (Rec_Comp),
Typ => Comp_Typ);
-- Guard against a missing [Deep_]Adjust when the component type
-- was not properly frozen.
if Present (Adj_Call) then
Append_To (Blk_Stmts, Adj_Call);
end if;
end if;
-- Complete the protection of the initialization statements
if Finalization_OK and Abort_Allowed then
-- Wrap the initialization statements in a block to catch a
-- potential exception. Generate:
-- begin
-- Abort_Defer;
-- Rec_Comp := Init_Expr;
-- Rec_Comp._tag := Full_TypP;
-- [Deep_]Adjust (Rec_Comp);
-- at end
-- Abort_Undefer_Direct;
-- end;
if Exceptions_OK then
Append_To (Stmts,
Build_Abort_Undefer_Block (Loc,
Stmts => Blk_Stmts,
Context => N));
-- Otherwise exceptions are not propagated. Generate:
-- Abort_Defer;
-- Rec_Comp := Init_Expr;
-- Rec_Comp._tag := Full_TypP;
-- [Deep_]Adjust (Rec_Comp);
-- Abort_Undefer;
else
Append_To (Blk_Stmts,
Build_Runtime_Call (Loc, RE_Abort_Undefer));
end if;
end if;
end Initialize_Record_Component;
-------------------------
-- Is_Int_Range_Bounds --
-------------------------
function Is_Int_Range_Bounds (Bounds : Node_Id) return Boolean is
begin
return Nkind (Bounds) = N_Range
and then Nkind (Low_Bound (Bounds)) = N_Integer_Literal
and then Nkind (High_Bound (Bounds)) = N_Integer_Literal;
end Is_Int_Range_Bounds;
------------------
-- Replace_Type --
------------------
function Replace_Type (Expr : Node_Id) return Traverse_Result is
begin
-- Note regarding the Root_Type test below: Aggregate components for
-- self-referential types include attribute references to the current
-- instance, of the form: Typ'access, etc.. These references are
-- rewritten as references to the target of the aggregate: the
-- left-hand side of an assignment, the entity in a declaration,
-- or a temporary. Without this test, we would improperly extended
-- this rewriting to attribute references whose prefix was not the
-- type of the aggregate.
if Nkind (Expr) = N_Attribute_Reference
and then Is_Entity_Name (Prefix (Expr))
and then Is_Type (Entity (Prefix (Expr)))
and then Root_Type (Etype (N)) = Root_Type (Entity (Prefix (Expr)))
then
if Is_Entity_Name (Lhs) then
Rewrite (Prefix (Expr),
New_Occurrence_Of (Entity (Lhs), Loc));
elsif Nkind (Lhs) = N_Selected_Component then
Rewrite (Expr,
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Unrestricted_Access,
Prefix => New_Copy_Tree (Lhs)));
Set_Analyzed (Parent (Expr), False);
else
Rewrite (Expr,
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Unrestricted_Access,
Prefix => New_Copy_Tree (Lhs)));
Set_Analyzed (Parent (Expr), False);
end if;
end if;
return OK;
end Replace_Type;
--------------------------
-- Rewrite_Discriminant --
--------------------------
function Rewrite_Discriminant (Expr : Node_Id) return Traverse_Result is
begin
if Is_Entity_Name (Expr)
and then Present (Entity (Expr))
and then Ekind (Entity (Expr)) = E_In_Parameter
and then Present (Discriminal_Link (Entity (Expr)))
and then Scope (Discriminal_Link (Entity (Expr))) =
Base_Type (Etype (N))
then
Rewrite (Expr,
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Lhs),
Selector_Name => Make_Identifier (Loc, Chars (Expr))));
end if;
return OK;
end Rewrite_Discriminant;
procedure Replace_Discriminants is
new Traverse_Proc (Rewrite_Discriminant);
procedure Replace_Self_Reference is
new Traverse_Proc (Replace_Type);
-- Start of processing for Build_Record_Aggr_Code
begin
if Has_Self_Reference (N) then
Replace_Self_Reference (N);
end if;
-- If the target of the aggregate is class-wide, we must convert it
-- to the actual type of the aggregate, so that the proper components
-- are visible. We know already that the types are compatible.
if Present (Etype (Lhs))
and then Is_Class_Wide_Type (Etype (Lhs))
then
Target := Unchecked_Convert_To (Typ, Lhs);
else
Target := Lhs;
end if;
-- Deal with the ancestor part of extension aggregates or with the
-- discriminants of the root type.
if Nkind (N) = N_Extension_Aggregate then
declare
Ancestor : constant Node_Id := Ancestor_Part (N);
Adj_Call : Node_Id;
Assign : List_Id;
begin
-- If the ancestor part is a subtype mark "T", we generate
-- init-proc (T (tmp)); if T is constrained and
-- init-proc (S (tmp)); where S applies an appropriate
-- constraint if T is unconstrained
if Is_Entity_Name (Ancestor)
and then Is_Type (Entity (Ancestor))
then
Ancestor_Is_Subtype_Mark := True;
if Is_Constrained (Entity (Ancestor)) then
Init_Typ := Entity (Ancestor);
-- For an ancestor part given by an unconstrained type mark,
-- create a subtype constrained by appropriate corresponding
-- discriminant values coming from either associations of the
-- aggregate or a constraint on a parent type. The subtype will
-- be used to generate the correct default value for the
-- ancestor part.
elsif Has_Discriminants (Entity (Ancestor)) then
declare
Anc_Typ : constant Entity_Id := Entity (Ancestor);
Anc_Constr : constant List_Id := New_List;
Discrim : Entity_Id;
Disc_Value : Node_Id;
New_Indic : Node_Id;
Subt_Decl : Node_Id;
begin
Discrim := First_Discriminant (Anc_Typ);
while Present (Discrim) loop
Disc_Value := Ancestor_Discriminant_Value (Discrim);
-- If no usable discriminant in ancestors, check
-- whether aggregate has an explicit value for it.
if No (Disc_Value) then
Disc_Value :=
Get_Explicit_Discriminant_Value (Discrim);
end if;
Append_To (Anc_Constr, Disc_Value);
Next_Discriminant (Discrim);
end loop;
New_Indic :=
Make_Subtype_Indication (Loc,
Subtype_Mark => New_Occurrence_Of (Anc_Typ, Loc),
Constraint =>
Make_Index_Or_Discriminant_Constraint (Loc,
Constraints => Anc_Constr));
Init_Typ := Create_Itype (Ekind (Anc_Typ), N);
Subt_Decl :=
Make_Subtype_Declaration (Loc,
Defining_Identifier => Init_Typ,
Subtype_Indication => New_Indic);
-- Itypes must be analyzed with checks off Declaration
-- must have a parent for proper handling of subsidiary
-- actions.
Set_Parent (Subt_Decl, N);
Analyze (Subt_Decl, Suppress => All_Checks);
end;
end if;
Ref := Convert_To (Init_Typ, New_Copy_Tree (Target));
Set_Assignment_OK (Ref);
if not Is_Interface (Init_Typ) then
Append_List_To (L,
Build_Initialization_Call (Loc,
Id_Ref => Ref,
Typ => Init_Typ,
In_Init_Proc => Within_Init_Proc,
With_Default_Init => Has_Default_Init_Comps (N)
or else
Has_Task (Base_Type (Init_Typ))));
if Is_Constrained (Entity (Ancestor))
and then Has_Discriminants (Entity (Ancestor))
then
Check_Ancestor_Discriminants (Entity (Ancestor));
end if;
end if;
-- Handle calls to C++ constructors
elsif Is_CPP_Constructor_Call (Ancestor) then
Init_Typ := Etype (Ancestor);
Ref := Convert_To (Init_Typ, New_Copy_Tree (Target));
Set_Assignment_OK (Ref);
Append_List_To (L,
Build_Initialization_Call (Loc,
Id_Ref => Ref,
Typ => Init_Typ,
In_Init_Proc => Within_Init_Proc,
With_Default_Init => Has_Default_Init_Comps (N),
Constructor_Ref => Ancestor));
-- Ada 2005 (AI-287): If the ancestor part is an aggregate of
-- limited type, a recursive call expands the ancestor. Note that
-- in the limited case, the ancestor part must be either a
-- function call (possibly qualified, or wrapped in an unchecked
-- conversion) or aggregate (definitely qualified).
-- The ancestor part can also be a function call (that may be
-- transformed into an explicit dereference) or a qualification
-- of one such.
elsif Is_Limited_Type (Etype (Ancestor))
and then Nkind_In (Unqualify (Ancestor), N_Aggregate,
N_Extension_Aggregate)
then
Ancestor_Is_Expression := True;
-- Set up finalization data for enclosing record, because
-- controlled subcomponents of the ancestor part will be
-- attached to it.
Generate_Finalization_Actions;
Append_List_To (L,
Build_Record_Aggr_Code
(N => Unqualify (Ancestor),
Typ => Etype (Unqualify (Ancestor)),
Lhs => Target));
-- If the ancestor part is an expression "E", we generate
-- T (tmp) := E;
-- In Ada 2005, this includes the case of a (possibly qualified)
-- limited function call. The assignment will turn into a
-- build-in-place function call (for further details, see
-- Make_Build_In_Place_Call_In_Assignment).
else
Ancestor_Is_Expression := True;
Init_Typ := Etype (Ancestor);
-- If the ancestor part is an aggregate, force its full
-- expansion, which was delayed.
if Nkind_In (Unqualify (Ancestor), N_Aggregate,
N_Extension_Aggregate)
then
Set_Analyzed (Ancestor, False);
Set_Analyzed (Expression (Ancestor), False);
end if;
Ref := Convert_To (Init_Typ, New_Copy_Tree (Target));
Set_Assignment_OK (Ref);
-- Make the assignment without usual controlled actions, since
-- we only want to Adjust afterwards, but not to Finalize
-- beforehand. Add manual Adjust when necessary.
Assign := New_List (
Make_OK_Assignment_Statement (Loc,
Name => Ref,
Expression => Ancestor));
Set_No_Ctrl_Actions (First (Assign));
-- Assign the tag now to make sure that the dispatching call in
-- the subsequent deep_adjust works properly (unless
-- Tagged_Type_Expansion where tags are implicit).
if Tagged_Type_Expansion then
Instr :=
Make_OK_Assignment_Statement (Loc,
Name =>
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Target),
Selector_Name =>
New_Occurrence_Of
(First_Tag_Component (Base_Type (Typ)), Loc)),
Expression =>
Unchecked_Convert_To (RTE (RE_Tag),
New_Occurrence_Of
(Node (First_Elmt
(Access_Disp_Table (Base_Type (Typ)))),
Loc)));
Set_Assignment_OK (Name (Instr));
Append_To (Assign, Instr);
-- Ada 2005 (AI-251): If tagged type has progenitors we must
-- also initialize tags of the secondary dispatch tables.
if Has_Interfaces (Base_Type (Typ)) then
Init_Secondary_Tags
(Typ => Base_Type (Typ),
Target => Target,
Stmts_List => Assign);
end if;
end if;
-- Call Adjust manually
if Needs_Finalization (Etype (Ancestor))
and then not Is_Limited_Type (Etype (Ancestor))
then
Adj_Call :=
Make_Adjust_Call
(Obj_Ref => New_Copy_Tree (Ref),
Typ => Etype (Ancestor));
-- Guard against a missing [Deep_]Adjust when the ancestor
-- type was not properly frozen.
if Present (Adj_Call) then
Append_To (Assign, Adj_Call);
end if;
end if;
Append_To (L,
Make_Unsuppress_Block (Loc, Name_Discriminant_Check, Assign));
if Has_Discriminants (Init_Typ) then
Check_Ancestor_Discriminants (Init_Typ);
end if;
end if;
end;
-- Generate assignments of hidden discriminants. If the base type is
-- an unchecked union, the discriminants are unknown to the back-end
-- and absent from a value of the type, so assignments for them are
-- not emitted.
if Has_Discriminants (Typ)
and then not Is_Unchecked_Union (Base_Type (Typ))
then
Init_Hidden_Discriminants (Typ, L);
end if;
-- Normal case (not an extension aggregate)
else
-- Generate the discriminant expressions, component by component.
-- If the base type is an unchecked union, the discriminants are
-- unknown to the back-end and absent from a value of the type, so
-- assignments for them are not emitted.
if Has_Discriminants (Typ)
and then not Is_Unchecked_Union (Base_Type (Typ))
then
Init_Hidden_Discriminants (Typ, L);
-- Generate discriminant init values for the visible discriminants
Init_Visible_Discriminants;
if Is_Derived_Type (N_Typ) then
Init_Stored_Discriminants;
end if;
end if;
end if;
-- For CPP types we generate an implicit call to the C++ default
-- constructor to ensure the proper initialization of the _Tag
-- component.
if Is_CPP_Class (Root_Type (Typ)) and then CPP_Num_Prims (Typ) > 0 then
Invoke_Constructor : declare
CPP_Parent : constant Entity_Id := Enclosing_CPP_Parent (Typ);
procedure Invoke_IC_Proc (T : Entity_Id);
-- Recursive routine used to climb to parents. Required because
-- parents must be initialized before descendants to ensure
-- propagation of inherited C++ slots.
--------------------
-- Invoke_IC_Proc --
--------------------
procedure Invoke_IC_Proc (T : Entity_Id) is
begin
-- Avoid generating extra calls. Initialization required
-- only for types defined from the level of derivation of
-- type of the constructor and the type of the aggregate.
if T = CPP_Parent then
return;
end if;
Invoke_IC_Proc (Etype (T));
-- Generate call to the IC routine
if Present (CPP_Init_Proc (T)) then
Append_To (L,
Make_Procedure_Call_Statement (Loc,
Name => New_Occurrence_Of (CPP_Init_Proc (T), Loc)));
end if;
end Invoke_IC_Proc;
-- Start of processing for Invoke_Constructor
begin
-- Implicit invocation of the C++ constructor
if Nkind (N) = N_Aggregate then
Append_To (L,
Make_Procedure_Call_Statement (Loc,
Name =>
New_Occurrence_Of (Base_Init_Proc (CPP_Parent), Loc),
Parameter_Associations => New_List (
Unchecked_Convert_To (CPP_Parent,
New_Copy_Tree (Lhs)))));
end if;
Invoke_IC_Proc (Typ);
end Invoke_Constructor;
end if;
-- Generate the assignments, component by component
-- tmp.comp1 := Expr1_From_Aggr;
-- tmp.comp2 := Expr2_From_Aggr;
-- ....
Comp := First (Component_Associations (N));
while Present (Comp) loop
Selector := Entity (First (Choices (Comp)));
-- C++ constructors
if Is_CPP_Constructor_Call (Expression (Comp)) then
Append_List_To (L,
Build_Initialization_Call (Loc,
Id_Ref =>
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Target),
Selector_Name => New_Occurrence_Of (Selector, Loc)),
Typ => Etype (Selector),
Enclos_Type => Typ,
With_Default_Init => True,
Constructor_Ref => Expression (Comp)));
-- Ada 2005 (AI-287): For each default-initialized component generate
-- a call to the corresponding IP subprogram if available.
elsif Box_Present (Comp)
and then Has_Non_Null_Base_Init_Proc (Etype (Selector))
then
if Ekind (Selector) /= E_Discriminant then
Generate_Finalization_Actions;
end if;
-- Ada 2005 (AI-287): If the component type has tasks then
-- generate the activation chain and master entities (except
-- in case of an allocator because in that case these entities
-- are generated by Build_Task_Allocate_Block_With_Init_Stmts).
declare
Ctype : constant Entity_Id := Etype (Selector);
Inside_Allocator : Boolean := False;
P : Node_Id := Parent (N);
begin
if Is_Task_Type (Ctype) or else Has_Task (Ctype) then
while Present (P) loop
if Nkind (P) = N_Allocator then
Inside_Allocator := True;
exit;
end if;
P := Parent (P);
end loop;
if not Inside_Init_Proc and not Inside_Allocator then
Build_Activation_Chain_Entity (N);
end if;
end if;
end;
Append_List_To (L,
Build_Initialization_Call (Loc,
Id_Ref => Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Target),
Selector_Name =>
New_Occurrence_Of (Selector, Loc)),
Typ => Etype (Selector),
Enclos_Type => Typ,
With_Default_Init => True));
-- Prepare for component assignment
elsif Ekind (Selector) /= E_Discriminant
or else Nkind (N) = N_Extension_Aggregate
then
-- All the discriminants have now been assigned
-- This is now a good moment to initialize and attach all the
-- controllers. Their position may depend on the discriminants.
if Ekind (Selector) /= E_Discriminant then
Generate_Finalization_Actions;
end if;
Comp_Type := Underlying_Type (Etype (Selector));
Comp_Expr :=
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Target),
Selector_Name => New_Occurrence_Of (Selector, Loc));
if Nkind (Expression (Comp)) = N_Qualified_Expression then
Expr_Q := Expression (Expression (Comp));
else
Expr_Q := Expression (Comp);
end if;
-- Now either create the assignment or generate the code for the
-- inner aggregate top-down.
if Is_Delayed_Aggregate (Expr_Q) then
-- We have the following case of aggregate nesting inside
-- an object declaration:
-- type Arr_Typ is array (Integer range <>) of ...;
-- type Rec_Typ (...) is record
-- Obj_Arr_Typ : Arr_Typ (A .. B);
-- end record;
-- Obj_Rec_Typ : Rec_Typ := (...,
-- Obj_Arr_Typ => (X => (...), Y => (...)));
-- The length of the ranges of the aggregate and Obj_Add_Typ
-- are equal (B - A = Y - X), but they do not coincide (X /=
-- A and B /= Y). This case requires array sliding which is
-- performed in the following manner:
-- subtype Arr_Sub is Arr_Typ (X .. Y);
-- Temp : Arr_Sub;
-- Temp (X) := (...);
-- ...
-- Temp (Y) := (...);
-- Obj_Rec_Typ.Obj_Arr_Typ := Temp;
if Ekind (Comp_Type) = E_Array_Subtype
and then Is_Int_Range_Bounds (Aggregate_Bounds (Expr_Q))
and then Is_Int_Range_Bounds (First_Index (Comp_Type))
and then not
Compatible_Int_Bounds
(Agg_Bounds => Aggregate_Bounds (Expr_Q),
Typ_Bounds => First_Index (Comp_Type))
then
-- Create the array subtype with bounds equal to those of
-- the corresponding aggregate.
declare
SubE : constant Entity_Id := Make_Temporary (Loc, 'T');
SubD : constant Node_Id :=
Make_Subtype_Declaration (Loc,
Defining_Identifier => SubE,
Subtype_Indication =>
Make_Subtype_Indication (Loc,
Subtype_Mark =>
New_Occurrence_Of (Etype (Comp_Type), Loc),
Constraint =>
Make_Index_Or_Discriminant_Constraint
(Loc,
Constraints => New_List (
New_Copy_Tree
(Aggregate_Bounds (Expr_Q))))));
-- Create a temporary array of the above subtype which
-- will be used to capture the aggregate assignments.
TmpE : constant Entity_Id := Make_Temporary (Loc, 'A', N);
TmpD : constant Node_Id :=
Make_Object_Declaration (Loc,
Defining_Identifier => TmpE,
Object_Definition => New_Occurrence_Of (SubE, Loc));
begin
Set_No_Initialization (TmpD);
Append_To (L, SubD);
Append_To (L, TmpD);
-- Expand aggregate into assignments to the temp array
Append_List_To (L,
Late_Expansion (Expr_Q, Comp_Type,
New_Occurrence_Of (TmpE, Loc)));
-- Slide
Append_To (L,
Make_Assignment_Statement (Loc,
Name => New_Copy_Tree (Comp_Expr),
Expression => New_Occurrence_Of (TmpE, Loc)));
end;
-- Normal case (sliding not required)
else
Append_List_To (L,
Late_Expansion (Expr_Q, Comp_Type, Comp_Expr));
end if;
-- Expr_Q is not delayed aggregate
else
if Has_Discriminants (Typ) then
Replace_Discriminants (Expr_Q);
-- If the component is an array type that depends on
-- discriminants, and the expression is a single Others
-- clause, create an explicit subtype for it because the
-- backend has troubles recovering the actual bounds.
if Nkind (Expr_Q) = N_Aggregate
and then Is_Array_Type (Comp_Type)
and then Present (Component_Associations (Expr_Q))
then
declare
Assoc : constant Node_Id :=
First (Component_Associations (Expr_Q));
Decl : Node_Id;
begin
if Nkind (First (Choices (Assoc))) = N_Others_Choice
then
Decl :=
Build_Actual_Subtype_Of_Component
(Comp_Type, Comp_Expr);
-- If the component type does not in fact depend on
-- discriminants, the subtype declaration is empty.
if Present (Decl) then
Append_To (L, Decl);
Set_Etype (Comp_Expr, Defining_Entity (Decl));
end if;
end if;
end;
end if;
end if;
if Modify_Tree_For_C
and then Nkind (Expr_Q) = N_Aggregate
and then Is_Array_Type (Etype (Expr_Q))
and then Present (First_Index (Etype (Expr_Q)))
then
declare
Expr_Q_Type : constant Node_Id := Etype (Expr_Q);
begin
Append_List_To (L,
Build_Array_Aggr_Code
(N => Expr_Q,
Ctype => Component_Type (Expr_Q_Type),
Index => First_Index (Expr_Q_Type),
Into => Comp_Expr,
Scalar_Comp =>
Is_Scalar_Type (Component_Type (Expr_Q_Type))));
end;
else
-- Handle an initialization expression of a controlled type
-- in case it denotes a function call. In general such a
-- scenario will produce a transient scope, but this will
-- lead to wrong order of initialization, adjustment, and
-- finalization in the context of aggregates.
-- Target.Comp := Ctrl_Func_Call;
-- begin -- scope
-- Trans_Obj : ... := Ctrl_Func_Call; -- object
-- Target.Comp := Trans_Obj;
-- Finalize (Trans_Obj);
-- end
-- Target.Comp._tag := ...;
-- Adjust (Target.Comp);
-- In the example above, the call to Finalize occurs too
-- early and as a result it may leave the record component
-- in a bad state. Finalization of the transient object
-- should really happen after adjustment.
-- To avoid this scenario, perform in-place side-effect
-- removal of the function call. This eliminates the
-- transient property of the function result and ensures
-- correct order of actions.
-- Res : ... := Ctrl_Func_Call;
-- Target.Comp := Res;
-- Target.Comp._tag := ...;
-- Adjust (Target.Comp);
-- Finalize (Res);
if Needs_Finalization (Comp_Type)
and then Nkind (Expr_Q) /= N_Aggregate
then
Initialize_Ctrl_Record_Component
(Rec_Comp => Comp_Expr,
Comp_Typ => Etype (Selector),
Init_Expr => Expr_Q,
Stmts => L);
-- Otherwise perform single component initialization
else
Initialize_Record_Component
(Rec_Comp => Comp_Expr,
Comp_Typ => Etype (Selector),
Init_Expr => Expr_Q,
Stmts => L);
end if;
end if;
end if;
-- comment would be good here ???
elsif Ekind (Selector) = E_Discriminant
and then Nkind (N) /= N_Extension_Aggregate
and then Nkind (Parent (N)) = N_Component_Association
and then Is_Constrained (Typ)
then
-- We must check that the discriminant value imposed by the
-- context is the same as the value given in the subaggregate,
-- because after the expansion into assignments there is no
-- record on which to perform a regular discriminant check.
declare
D_Val : Elmt_Id;
Disc : Entity_Id;
begin
D_Val := First_Elmt (Discriminant_Constraint (Typ));
Disc := First_Discriminant (Typ);
while Chars (Disc) /= Chars (Selector) loop
Next_Discriminant (Disc);
Next_Elmt (D_Val);
end loop;
pragma Assert (Present (D_Val));
-- This check cannot performed for components that are
-- constrained by a current instance, because this is not a
-- value that can be compared with the actual constraint.
if Nkind (Node (D_Val)) /= N_Attribute_Reference
or else not Is_Entity_Name (Prefix (Node (D_Val)))
or else not Is_Type (Entity (Prefix (Node (D_Val))))
then
Append_To (L,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Op_Ne (Loc,
Left_Opnd => New_Copy_Tree (Node (D_Val)),
Right_Opnd => Expression (Comp)),
Reason => CE_Discriminant_Check_Failed));
else
-- Find self-reference in previous discriminant assignment,
-- and replace with proper expression.
declare
Ass : Node_Id;
begin
Ass := First (L);
while Present (Ass) loop
if Nkind (Ass) = N_Assignment_Statement
and then Nkind (Name (Ass)) = N_Selected_Component
and then Chars (Selector_Name (Name (Ass))) =
Chars (Disc)
then
Set_Expression
(Ass, New_Copy_Tree (Expression (Comp)));
exit;
end if;
Next (Ass);
end loop;
end;
end if;
end;
end if;
Next (Comp);
end loop;
-- If the type is tagged, the tag needs to be initialized (unless we
-- are in VM-mode where tags are implicit). It is done late in the
-- initialization process because in some cases, we call the init
-- proc of an ancestor which will not leave out the right tag.
if Ancestor_Is_Expression then
null;
-- For CPP types we generated a call to the C++ default constructor
-- before the components have been initialized to ensure the proper
-- initialization of the _Tag component (see above).
elsif Is_CPP_Class (Typ) then
null;
elsif Is_Tagged_Type (Typ) and then Tagged_Type_Expansion then
Instr :=
Make_OK_Assignment_Statement (Loc,
Name =>
Make_Selected_Component (Loc,
Prefix => New_Copy_Tree (Target),
Selector_Name =>
New_Occurrence_Of
(First_Tag_Component (Base_Type (Typ)), Loc)),
Expression =>
Unchecked_Convert_To (RTE (RE_Tag),
New_Occurrence_Of
(Node (First_Elmt (Access_Disp_Table (Base_Type (Typ)))),
Loc)));
Append_To (L, Instr);
-- Ada 2005 (AI-251): If the tagged type has been derived from an
-- abstract interfaces we must also initialize the tags of the
-- secondary dispatch tables.
if Has_Interfaces (Base_Type (Typ)) then
Init_Secondary_Tags
(Typ => Base_Type (Typ),
Target => Target,
Stmts_List => L);
end if;
end if;
-- If the controllers have not been initialized yet (by lack of non-
-- discriminant components), let's do it now.
Generate_Finalization_Actions;
return L;
end Build_Record_Aggr_Code;
---------------------------------------
-- Collect_Initialization_Statements --
---------------------------------------
procedure Collect_Initialization_Statements
(Obj : Entity_Id;
N : Node_Id;
Node_After : Node_Id)
is
Loc : constant Source_Ptr := Sloc (N);
Init_Actions : constant List_Id := New_List;
Init_Node : Node_Id;
Comp_Stmt : Node_Id;
begin
-- Nothing to do if Obj is already frozen, as in this case we known we
-- won't need to move the initialization statements about later on.
if Is_Frozen (Obj) then
return;
end if;
Init_Node := N;
while Next (Init_Node) /= Node_After loop
Append_To (Init_Actions, Remove_Next (Init_Node));
end loop;
if not Is_Empty_List (Init_Actions) then
Comp_Stmt := Make_Compound_Statement (Loc, Actions => Init_Actions);
Insert_Action_After (Init_Node, Comp_Stmt);
Set_Initialization_Statements (Obj, Comp_Stmt);
end if;
end Collect_Initialization_Statements;
-------------------------------
-- Convert_Aggr_In_Allocator --
-------------------------------
procedure Convert_Aggr_In_Allocator
(Alloc : Node_Id;
Decl : Node_Id;
Aggr : Node_Id)
is
Loc : constant Source_Ptr := Sloc (Aggr);
Typ : constant Entity_Id := Etype (Aggr);
Temp : constant Entity_Id := Defining_Identifier (Decl);
Occ : constant Node_Id :=
Unchecked_Convert_To (Typ,
Make_Explicit_Dereference (Loc, New_Occurrence_Of (Temp, Loc)));
begin
if Is_Array_Type (Typ) then
Convert_Array_Aggr_In_Allocator (Decl, Aggr, Occ);
elsif Has_Default_Init_Comps (Aggr) then
declare
L : constant List_Id := New_List;
Init_Stmts : List_Id;
begin
Init_Stmts := Late_Expansion (Aggr, Typ, Occ);
if Has_Task (Typ) then
Build_Task_Allocate_Block_With_Init_Stmts (L, Aggr, Init_Stmts);
Insert_Actions (Alloc, L);
else
Insert_Actions (Alloc, Init_Stmts);
end if;
end;
else
Insert_Actions (Alloc, Late_Expansion (Aggr, Typ, Occ));
end if;
end Convert_Aggr_In_Allocator;
--------------------------------
-- Convert_Aggr_In_Assignment --
--------------------------------
procedure Convert_Aggr_In_Assignment (N : Node_Id) is
Aggr : Node_Id := Expression (N);
Typ : constant Entity_Id := Etype (Aggr);
Occ : constant Node_Id := New_Copy_Tree (Name (N));
begin
if Nkind (Aggr) = N_Qualified_Expression then
Aggr := Expression (Aggr);
end if;
Insert_Actions_After (N, Late_Expansion (Aggr, Typ, Occ));
end Convert_Aggr_In_Assignment;
---------------------------------
-- Convert_Aggr_In_Object_Decl --
---------------------------------
procedure Convert_Aggr_In_Object_Decl (N : Node_Id) is
Obj : constant Entity_Id := Defining_Identifier (N);
Aggr : Node_Id := Expression (N);
Loc : constant Source_Ptr := Sloc (Aggr);
Typ : constant Entity_Id := Etype (Aggr);
Occ : constant Node_Id := New_Occurrence_Of (Obj, Loc);
function Discriminants_Ok return Boolean;
-- If the object type is constrained, the discriminants in the
-- aggregate must be checked against the discriminants of the subtype.
-- This cannot be done using Apply_Discriminant_Checks because after
-- expansion there is no aggregate left to check.
----------------------
-- Discriminants_Ok --
----------------------
function Discriminants_Ok return Boolean is
Cond : Node_Id := Empty;
Check : Node_Id;
D : Entity_Id;
Disc1 : Elmt_Id;
Disc2 : Elmt_Id;
Val1 : Node_Id;
Val2 : Node_Id;
begin
D := First_Discriminant (Typ);
Disc1 := First_Elmt (Discriminant_Constraint (Typ));
Disc2 := First_Elmt (Discriminant_Constraint (Etype (Obj)));
while Present (Disc1) and then Present (Disc2) loop
Val1 := Node (Disc1);
Val2 := Node (Disc2);
if not Is_OK_Static_Expression (Val1)
or else not Is_OK_Static_Expression (Val2)
then
Check := Make_Op_Ne (Loc,
Left_Opnd => Duplicate_Subexpr (Val1),
Right_Opnd => Duplicate_Subexpr (Val2));
if No (Cond) then
Cond := Check;
else
Cond := Make_Or_Else (Loc,
Left_Opnd => Cond,
Right_Opnd => Check);
end if;
elsif Expr_Value (Val1) /= Expr_Value (Val2) then
Apply_Compile_Time_Constraint_Error (Aggr,
Msg => "incorrect value for discriminant&??",
Reason => CE_Discriminant_Check_Failed,
Ent => D);
return False;
end if;
Next_Discriminant (D);
Next_Elmt (Disc1);
Next_Elmt (Disc2);
end loop;
-- If any discriminant constraint is non-static, emit a check
if Present (Cond) then
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition => Cond,
Reason => CE_Discriminant_Check_Failed));
end if;
return True;
end Discriminants_Ok;
-- Start of processing for Convert_Aggr_In_Object_Decl
begin
Set_Assignment_OK (Occ);
if Nkind (Aggr) = N_Qualified_Expression then
Aggr := Expression (Aggr);
end if;
if Has_Discriminants (Typ)
and then Typ /= Etype (Obj)
and then Is_Constrained (Etype (Obj))
and then not Discriminants_Ok
then
return;
end if;
-- If the context is an extended return statement, it has its own
-- finalization machinery (i.e. works like a transient scope) and
-- we do not want to create an additional one, because objects on
-- the finalization list of the return must be moved to the caller's
-- finalization list to complete the return.
-- However, if the aggregate is limited, it is built in place, and the
-- controlled components are not assigned to intermediate temporaries
-- so there is no need for a transient scope in this case either.
if Requires_Transient_Scope (Typ)
and then Ekind (Current_Scope) /= E_Return_Statement
and then not Is_Limited_Type (Typ)
then
Establish_Transient_Scope
(Aggr,
Sec_Stack =>
Is_Controlled (Typ) or else Has_Controlled_Component (Typ));
end if;
declare
Node_After : constant Node_Id := Next (N);
begin
Insert_Actions_After (N, Late_Expansion (Aggr, Typ, Occ));
Collect_Initialization_Statements (Obj, N, Node_After);
end;
Set_No_Initialization (N);
Initialize_Discriminants (N, Typ);
end Convert_Aggr_In_Object_Decl;
-------------------------------------
-- Convert_Array_Aggr_In_Allocator --
-------------------------------------
procedure Convert_Array_Aggr_In_Allocator
(Decl : Node_Id;
Aggr : Node_Id;
Target : Node_Id)
is
Aggr_Code : List_Id;
Typ : constant Entity_Id := Etype (Aggr);
Ctyp : constant Entity_Id := Component_Type (Typ);
begin
-- The target is an explicit dereference of the allocated object.
-- Generate component assignments to it, as for an aggregate that
-- appears on the right-hand side of an assignment statement.
Aggr_Code :=
Build_Array_Aggr_Code (Aggr,
Ctype => Ctyp,
Index => First_Index (Typ),
Into => Target,
Scalar_Comp => Is_Scalar_Type (Ctyp));
Insert_Actions_After (Decl, Aggr_Code);
end Convert_Array_Aggr_In_Allocator;
----------------------------
-- Convert_To_Assignments --
----------------------------
procedure Convert_To_Assignments (N : Node_Id; Typ : Entity_Id) is
Loc : constant Source_Ptr := Sloc (N);
T : Entity_Id;
Temp : Entity_Id;
Aggr_Code : List_Id;
Instr : Node_Id;
Target_Expr : Node_Id;
Parent_Kind : Node_Kind;
Unc_Decl : Boolean := False;
Parent_Node : Node_Id;
begin
pragma Assert (not Is_Static_Dispatch_Table_Aggregate (N));
pragma Assert (Is_Record_Type (Typ));
Parent_Node := Parent (N);
Parent_Kind := Nkind (Parent_Node);
if Parent_Kind = N_Qualified_Expression then
-- Check if we are in a unconstrained declaration because in this
-- case the current delayed expansion mechanism doesn't work when
-- the declared object size depend on the initializing expr.
Parent_Node := Parent (Parent_Node);
Parent_Kind := Nkind (Parent_Node);
if Parent_Kind = N_Object_Declaration then
Unc_Decl :=
not Is_Entity_Name (Object_Definition (Parent_Node))
or else Has_Discriminants
(Entity (Object_Definition (Parent_Node)))
or else Is_Class_Wide_Type
(Entity (Object_Definition (Parent_Node)));
end if;
end if;
-- Just set the Delay flag in the cases where the transformation will be
-- done top down from above.
if False
-- Internal aggregate (transformed when expanding the parent)
or else Parent_Kind = N_Aggregate
or else Parent_Kind = N_Extension_Aggregate
or else Parent_Kind = N_Component_Association
-- Allocator (see Convert_Aggr_In_Allocator)
or else Parent_Kind = N_Allocator
-- Object declaration (see Convert_Aggr_In_Object_Decl)
or else (Parent_Kind = N_Object_Declaration and then not Unc_Decl)
-- Safe assignment (see Convert_Aggr_Assignments). So far only the
-- assignments in init procs are taken into account.
or else (Parent_Kind = N_Assignment_Statement
and then Inside_Init_Proc)
-- (Ada 2005) An inherently limited type in a return statement, which
-- will be handled in a build-in-place fashion, and may be rewritten
-- as an extended return and have its own finalization machinery.
-- In the case of a simple return, the aggregate needs to be delayed
-- until the scope for the return statement has been created, so
-- that any finalization chain will be associated with that scope.
-- For extended returns, we delay expansion to avoid the creation
-- of an unwanted transient scope that could result in premature
-- finalization of the return object (which is built in place
-- within the caller's scope).
or else
(Is_Limited_View (Typ)
and then
(Nkind (Parent (Parent_Node)) = N_Extended_Return_Statement
or else Nkind (Parent_Node) = N_Simple_Return_Statement))
then
Set_Expansion_Delayed (N);
return;
end if;
-- Otherwise, if a transient scope is required, create it now. If we
-- are within an initialization procedure do not create such, because
-- the target of the assignment must not be declared within a local
-- block, and because cleanup will take place on return from the
-- initialization procedure.
-- Should the condition be more restrictive ???
if Requires_Transient_Scope (Typ) and then not Inside_Init_Proc then
Establish_Transient_Scope (N, Sec_Stack => Needs_Finalization (Typ));
end if;
-- If the aggregate is nonlimited, create a temporary. If it is limited
-- and context is an assignment, this is a subaggregate for an enclosing
-- aggregate being expanded. It must be built in place, so use target of
-- the current assignment.
if Is_Limited_Type (Typ)
and then Nkind (Parent (N)) = N_Assignment_Statement
then
Target_Expr := New_Copy_Tree (Name (Parent (N)));
Insert_Actions (Parent (N),
Build_Record_Aggr_Code (N, Typ, Target_Expr));
Rewrite (Parent (N), Make_Null_Statement (Loc));
else
Temp := Make_Temporary (Loc, 'A', N);
-- If the type inherits unknown discriminants, use the view with
-- known discriminants if available.
if Has_Unknown_Discriminants (Typ)
and then Present (Underlying_Record_View (Typ))
then
T := Underlying_Record_View (Typ);
else
T := Typ;
end if;
Instr :=
Make_Object_Declaration (Loc,
Defining_Identifier => Temp,
Object_Definition => New_Occurrence_Of (T, Loc));
Set_No_Initialization (Instr);
Insert_Action (N, Instr);
Initialize_Discriminants (Instr, T);
Target_Expr := New_Occurrence_Of (Temp, Loc);
Aggr_Code := Build_Record_Aggr_Code (N, T, Target_Expr);
-- Save the last assignment statement associated with the aggregate
-- when building a controlled object. This reference is utilized by
-- the finalization machinery when marking an object as successfully
-- initialized.
if Needs_Finalization (T) then
Set_Last_Aggregate_Assignment (Temp, Last (Aggr_Code));
end if;
Insert_Actions (N, Aggr_Code);
Rewrite (N, New_Occurrence_Of (Temp, Loc));
Analyze_And_Resolve (N, T);
end if;
end Convert_To_Assignments;
---------------------------
-- Convert_To_Positional --
---------------------------
procedure Convert_To_Positional
(N : Node_Id;
Max_Others_Replicate : Nat := 5;
Handle_Bit_Packed : Boolean := False)
is
Typ : constant Entity_Id := Etype (N);
Static_Components : Boolean := True;
procedure Check_Static_Components;
-- Check whether all components of the aggregate are compile-time known
-- values, and can be passed as is to the back-end without further
-- expansion.
-- An Iterated_component_Association is treated as non-static, but there
-- are possibilities for optimization here.
function Flatten
(N : Node_Id;
Ix : Node_Id;
Ixb : Node_Id) return Boolean;
-- Convert the aggregate into a purely positional form if possible. On
-- entry the bounds of all dimensions are known to be static, and the
-- total number of components is safe enough to expand.
function Is_Flat (N : Node_Id; Dims : Int) return Boolean;
-- Return True iff the array N is flat (which is not trivial in the case
-- of multidimensional aggregates).
-----------------------------
-- Check_Static_Components --
-----------------------------
-- Could use some comments in this body ???
procedure Check_Static_Components is
Expr : Node_Id;
begin
Static_Components := True;
if Nkind (N) = N_String_Literal then
null;
elsif Present (Expressions (N)) then
Expr := First (Expressions (N));
while Present (Expr) loop
if Nkind (Expr) /= N_Aggregate
or else not Compile_Time_Known_Aggregate (Expr)
or else Expansion_Delayed (Expr)
then
Static_Components := False;
exit;
end if;
Next (Expr);
end loop;
end if;
if Nkind (N) = N_Aggregate
and then Present (Component_Associations (N))
then
Expr := First (Component_Associations (N));
while Present (Expr) loop
if Nkind_In (Expression (Expr), N_Integer_Literal,
N_Real_Literal)
then
null;
elsif Is_Entity_Name (Expression (Expr))
and then Present (Entity (Expression (Expr)))
and then Ekind (Entity (Expression (Expr))) =
E_Enumeration_Literal
then
null;
elsif Nkind (Expression (Expr)) /= N_Aggregate
or else not Compile_Time_Known_Aggregate (Expression (Expr))
or else Expansion_Delayed (Expression (Expr))
or else Nkind (Expr) = N_Iterated_Component_Association
then
Static_Components := False;
exit;
end if;
Next (Expr);
end loop;
end if;
end Check_Static_Components;
-------------
-- Flatten --
-------------
function Flatten
(N : Node_Id;
Ix : Node_Id;
Ixb : Node_Id) return Boolean
is
Loc : constant Source_Ptr := Sloc (N);
Blo : constant Node_Id := Type_Low_Bound (Etype (Ixb));
Lo : constant Node_Id := Type_Low_Bound (Etype (Ix));
Hi : constant Node_Id := Type_High_Bound (Etype (Ix));
Lov : Uint;
Hiv : Uint;
Others_Present : Boolean := False;
begin
if Nkind (Original_Node (N)) = N_String_Literal then
return True;
end if;
if not Compile_Time_Known_Value (Lo)
or else not Compile_Time_Known_Value (Hi)
then
return False;
end if;
Lov := Expr_Value (Lo);
Hiv := Expr_Value (Hi);
-- Check if there is an others choice
if Present (Component_Associations (N)) then
declare
Assoc : Node_Id;
Choice : Node_Id;
begin
Assoc := First (Component_Associations (N));
while Present (Assoc) loop
-- If this is a box association, flattening is in general
-- not possible because at this point we cannot tell if the
-- default is static or even exists.
if Box_Present (Assoc) then
return False;
elsif Nkind (Assoc) = N_Iterated_Component_Association then
return False;
end if;
Choice := First (Choice_List (Assoc));
while Present (Choice) loop
if Nkind (Choice) = N_Others_Choice then
Others_Present := True;
end if;
Next (Choice);
end loop;
Next (Assoc);
end loop;
end;
end if;
-- If the low bound is not known at compile time and others is not
-- present we can proceed since the bounds can be obtained from the
-- aggregate.
if Hiv < Lov
or else (not Compile_Time_Known_Value (Blo) and then Others_Present)
then
return False;
end if;
-- Determine if set of alternatives is suitable for conversion and
-- build an array containing the values in sequence.
declare
Vals : array (UI_To_Int (Lov) .. UI_To_Int (Hiv))
of Node_Id := (others => Empty);
-- The values in the aggregate sorted appropriately
Vlist : List_Id;
-- Same data as Vals in list form
Rep_Count : Nat;
-- Used to validate Max_Others_Replicate limit
Elmt : Node_Id;
Num : Int := UI_To_Int (Lov);
Choice_Index : Int;
Choice : Node_Id;
Lo, Hi : Node_Id;
begin
if Present (Expressions (N)) then
Elmt := First (Expressions (N));
while Present (Elmt) loop
if Nkind (Elmt) = N_Aggregate
and then Present (Next_Index (Ix))
and then
not Flatten (Elmt, Next_Index (Ix), Next_Index (Ixb))
then
return False;
end if;
Vals (Num) := Relocate_Node (Elmt);
Num := Num + 1;
Next (Elmt);
end loop;
end if;
if No (Component_Associations (N)) then
return True;
end if;
Elmt := First (Component_Associations (N));
if Nkind (Expression (Elmt)) = N_Aggregate then
if Present (Next_Index (Ix))
and then
not Flatten
(Expression (Elmt), Next_Index (Ix), Next_Index (Ixb))
then
return False;
end if;
end if;
Component_Loop : while Present (Elmt) loop
Choice := First (Choice_List (Elmt));
Choice_Loop : while Present (Choice) loop
-- If we have an others choice, fill in the missing elements
-- subject to the limit established by Max_Others_Replicate.
if Nkind (Choice) = N_Others_Choice then
Rep_Count := 0;
for J in Vals'Range loop
if No (Vals (J)) then
Vals (J) := New_Copy_Tree (Expression (Elmt));
Rep_Count := Rep_Count + 1;
-- Check for maximum others replication. Note that
-- we skip this test if either of the restrictions
-- No_Elaboration_Code or No_Implicit_Loops is
-- active, if this is a preelaborable unit or
-- a predefined unit, or if the unit must be
-- placed in data memory. This also ensures that
-- predefined units get the same level of constant
-- folding in Ada 95 and Ada 2005, where their
-- categorization has changed.
declare
P : constant Entity_Id :=
Cunit_Entity (Current_Sem_Unit);
begin
-- Check if duplication OK and if so continue
-- processing.
if Restriction_Active (No_Elaboration_Code)
or else Restriction_Active (No_Implicit_Loops)
or else
(Ekind (Current_Scope) = E_Package
and then Static_Elaboration_Desired
(Current_Scope))
or else Is_Preelaborated (P)
or else (Ekind (P) = E_Package_Body
and then
Is_Preelaborated (Spec_Entity (P)))
or else
Is_Predefined_File_Name
(Unit_File_Name (Get_Source_Unit (P)))
then
null;
-- If duplication not OK, then we return False
-- if the replication count is too high
elsif Rep_Count > Max_Others_Replicate then
return False;
-- Continue on if duplication not OK, but the
-- replication count is not excessive.
else
null;
end if;
end;
end if;
end loop;
exit Component_Loop;
-- Case of a subtype mark, identifier or expanded name
elsif Is_Entity_Name (Choice)
and then Is_Type (Entity (Choice))
then
Lo := Type_Low_Bound (Etype (Choice));
Hi := Type_High_Bound (Etype (Choice));
-- Case of subtype indication
elsif Nkind (Choice) = N_Subtype_Indication then
Lo := Low_Bound (Range_Expression (Constraint (Choice)));
Hi := High_Bound (Range_Expression (Constraint (Choice)));
-- Case of a range
elsif Nkind (Choice) = N_Range then
Lo := Low_Bound (Choice);
Hi := High_Bound (Choice);
-- Normal subexpression case
else pragma Assert (Nkind (Choice) in N_Subexpr);
if not Compile_Time_Known_Value (Choice) then
return False;
else
Choice_Index := UI_To_Int (Expr_Value (Choice));
if Choice_Index in Vals'Range then
Vals (Choice_Index) :=
New_Copy_Tree (Expression (Elmt));
goto Continue;
-- Choice is statically out-of-range, will be
-- rewritten to raise Constraint_Error.
else
return False;
end if;
end if;
end if;
-- Range cases merge with Lo,Hi set
if not Compile_Time_Known_Value (Lo)
or else
not Compile_Time_Known_Value (Hi)
then
return False;
else
for J in UI_To_Int (Expr_Value (Lo)) ..
UI_To_Int (Expr_Value (Hi))
loop
Vals (J) := New_Copy_Tree (Expression (Elmt));
end loop;
end if;
<<Continue>>
Next (Choice);
end loop Choice_Loop;
Next (Elmt);
end loop Component_Loop;
-- If we get here the conversion is possible
Vlist := New_List;
for J in Vals'Range loop
Append (Vals (J), Vlist);
end loop;
Rewrite (N, Make_Aggregate (Loc, Expressions => Vlist));
Set_Aggregate_Bounds (N, Aggregate_Bounds (Original_Node (N)));
return True;
end;
end Flatten;
-------------
-- Is_Flat --
-------------
function Is_Flat (N : Node_Id; Dims : Int) return Boolean is
Elmt : Node_Id;
begin
if Dims = 0 then
return True;
elsif Nkind (N) = N_Aggregate then
if Present (Component_Associations (N)) then
return False;
else
Elmt := First (Expressions (N));
while Present (Elmt) loop
if not Is_Flat (Elmt, Dims - 1) then
return False;
end if;
Next (Elmt);
end loop;
return True;
end if;
else
return True;
end if;
end Is_Flat;
-- Start of processing for Convert_To_Positional
begin
-- Only convert to positional when generating C in case of an
-- object declaration, this is the only case where aggregates are
-- supported in C.
if Modify_Tree_For_C and then not In_Object_Declaration (N) then
return;
end if;
-- Ada 2005 (AI-287): Do not convert in case of default initialized
-- components because in this case will need to call the corresponding
-- IP procedure.
if Has_Default_Init_Comps (N) then
return;
end if;
if Is_Flat (N, Number_Dimensions (Typ)) then
return;
end if;
if Is_Bit_Packed_Array (Typ) and then not Handle_Bit_Packed then
return;
end if;
-- Do not convert to positional if controlled components are involved
-- since these require special processing
if Has_Controlled_Component (Typ) then
return;
end if;
Check_Static_Components;
-- If the size is known, or all the components are static, try to
-- build a fully positional aggregate.
-- The size of the type may not be known for an aggregate with
-- discriminated array components, but if the components are static
-- it is still possible to verify statically that the length is
-- compatible with the upper bound of the type, and therefore it is
-- worth flattening such aggregates as well.
-- For now the back-end expands these aggregates into individual
-- assignments to the target anyway, but it is conceivable that
-- it will eventually be able to treat such aggregates statically???
if Aggr_Size_OK (N, Typ)
and then Flatten (N, First_Index (Typ), First_Index (Base_Type (Typ)))
then
if Static_Components then
Set_Compile_Time_Known_Aggregate (N);
Set_Expansion_Delayed (N, False);
end if;
Analyze_And_Resolve (N, Typ);
end if;
-- If Static_Elaboration_Desired has been specified, diagnose aggregates
-- that will still require initialization code.
if (Ekind (Current_Scope) = E_Package
and then Static_Elaboration_Desired (Current_Scope))
and then Nkind (Parent (N)) = N_Object_Declaration
then
declare
Expr : Node_Id;
begin
if Nkind (N) = N_Aggregate and then Present (Expressions (N)) then
Expr := First (Expressions (N));
while Present (Expr) loop
if Nkind_In (Expr, N_Integer_Literal, N_Real_Literal)
or else
(Is_Entity_Name (Expr)
and then Ekind (Entity (Expr)) = E_Enumeration_Literal)
then
null;
else
Error_Msg_N
("non-static object requires elaboration code??", N);
exit;
end if;
Next (Expr);
end loop;
if Present (Component_Associations (N)) then
Error_Msg_N ("object requires elaboration code??", N);
end if;
end if;
end;
end if;
end Convert_To_Positional;
----------------------------
-- Expand_Array_Aggregate --
----------------------------
-- Array aggregate expansion proceeds as follows:
-- 1. If requested we generate code to perform all the array aggregate
-- bound checks, specifically
-- (a) Check that the index range defined by aggregate bounds is
-- compatible with corresponding index subtype.
-- (b) If an others choice is present check that no aggregate
-- index is outside the bounds of the index constraint.
-- (c) For multidimensional arrays make sure that all subaggregates
-- corresponding to the same dimension have the same bounds.
-- 2. Check for packed array aggregate which can be converted to a
-- constant so that the aggregate disappears completely.
-- 3. Check case of nested aggregate. Generally nested aggregates are
-- handled during the processing of the parent aggregate.
-- 4. Check if the aggregate can be statically processed. If this is the
-- case pass it as is to Gigi. Note that a necessary condition for
-- static processing is that the aggregate be fully positional.
-- 5. If in place aggregate expansion is possible (i.e. no need to create
-- a temporary) then mark the aggregate as such and return. Otherwise
-- create a new temporary and generate the appropriate initialization
-- code.
procedure Expand_Array_Aggregate (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
Ctyp : constant Entity_Id := Component_Type (Typ);
-- Typ is the correct constrained array subtype of the aggregate
-- Ctyp is the corresponding component type.
Aggr_Dimension : constant Pos := Number_Dimensions (Typ);
-- Number of aggregate index dimensions
Aggr_Low : array (1 .. Aggr_Dimension) of Node_Id;
Aggr_High : array (1 .. Aggr_Dimension) of Node_Id;
-- Low and High bounds of the constraint for each aggregate index
Aggr_Index_Typ : array (1 .. Aggr_Dimension) of Entity_Id;
-- The type of each index
In_Place_Assign_OK_For_Declaration : Boolean := False;
-- True if we are to generate an in place assignment for a declaration
Maybe_In_Place_OK : Boolean;
-- If the type is neither controlled nor packed and the aggregate
-- is the expression in an assignment, assignment in place may be
-- possible, provided other conditions are met on the LHS.
Others_Present : array (1 .. Aggr_Dimension) of Boolean :=
(others => False);
-- If Others_Present (J) is True, then there is an others choice in one
-- of the subaggregates of N at dimension J.
function Aggr_Assignment_OK_For_Backend (N : Node_Id) return Boolean;
-- Returns true if an aggregate assignment can be done by the back end
procedure Build_Constrained_Type (Positional : Boolean);
-- If the subtype is not static or unconstrained, build a constrained
-- type using the computable sizes of the aggregate and its sub-
-- aggregates.
procedure Check_Bounds (Aggr_Bounds : Node_Id; Index_Bounds : Node_Id);
-- Checks that the bounds of Aggr_Bounds are within the bounds defined
-- by Index_Bounds.
procedure Check_Same_Aggr_Bounds (Sub_Aggr : Node_Id; Dim : Pos);
-- Checks that in a multidimensional array aggregate all subaggregates
-- corresponding to the same dimension have the same bounds. Sub_Aggr is
-- an array subaggregate. Dim is the dimension corresponding to the
-- subaggregate.
procedure Compute_Others_Present (Sub_Aggr : Node_Id; Dim : Pos);
-- Computes the values of array Others_Present. Sub_Aggr is the array
-- subaggregate we start the computation from. Dim is the dimension
-- corresponding to the subaggregate.
function In_Place_Assign_OK return Boolean;
-- Simple predicate to determine whether an aggregate assignment can
-- be done in place, because none of the new values can depend on the
-- components of the target of the assignment.
procedure Others_Check (Sub_Aggr : Node_Id; Dim : Pos);
-- Checks that if an others choice is present in any subaggregate, no
-- aggregate index is outside the bounds of the index constraint.
-- Sub_Aggr is an array subaggregate. Dim is the dimension corresponding
-- to the subaggregate.
function Safe_Left_Hand_Side (N : Node_Id) return Boolean;
-- In addition to Maybe_In_Place_OK, in order for an aggregate to be
-- built directly into the target of the assignment it must be free
-- of side effects.
------------------------------------
-- Aggr_Assignment_OK_For_Backend --
------------------------------------
-- Backend processing by Gigi/gcc is possible only if all the following
-- conditions are met:
-- 1. N consists of a single OTHERS choice, possibly recursively
-- 2. The array type is not packed
-- 3. The array type has no atomic components
-- 4. The array type has no null ranges (the purpose of this is to
-- avoid a bogus warning for an out-of-range value).
-- 5. The component type is discrete
-- 6. The component size is Storage_Unit or the value is of the form
-- M * (1 + A**1 + A**2 + .. A**(K-1)) where A = 2**(Storage_Unit)
-- and M in 1 .. A-1. This can also be viewed as K occurrences of
-- the 8-bit value M, concatenated together.
-- The ultimate goal is to generate a call to a fast memset routine
-- specifically optimized for the target.
function Aggr_Assignment_OK_For_Backend (N : Node_Id) return Boolean is
Ctyp : Entity_Id;
Index : Entity_Id;
Expr : Node_Id := N;
Low : Node_Id;
High : Node_Id;
Remainder : Uint;
Value : Uint;
Nunits : Nat;
begin
-- Recurse as far as possible to find the innermost component type
Ctyp := Etype (N);
while Is_Array_Type (Ctyp) loop
if Nkind (Expr) /= N_Aggregate
or else not Is_Others_Aggregate (Expr)
then
return False;
end if;
if Present (Packed_Array_Impl_Type (Ctyp)) then
return False;
end if;
if Has_Atomic_Components (Ctyp) then
return False;
end if;
Index := First_Index (Ctyp);
while Present (Index) loop
Get_Index_Bounds (Index, Low, High);
if Is_Null_Range (Low, High) then
return False;
end if;
Next_Index (Index);
end loop;
Expr := Expression (First (Component_Associations (Expr)));
for J in 1 .. Number_Dimensions (Ctyp) - 1 loop
if Nkind (Expr) /= N_Aggregate
or else not Is_Others_Aggregate (Expr)
then
return False;
end if;
Expr := Expression (First (Component_Associations (Expr)));
end loop;
Ctyp := Component_Type (Ctyp);
if Is_Atomic_Or_VFA (Ctyp) then
return False;
end if;
end loop;
-- An Iterated_Component_Association involves a loop (in most cases)
-- and is never static.
if Nkind (Parent (Expr)) = N_Iterated_Component_Association then
return False;
end if;
if not Is_Discrete_Type (Ctyp) then
return False;
end if;
-- The expression needs to be analyzed if True is returned
Analyze_And_Resolve (Expr, Ctyp);
-- The back end uses the Esize as the precision of the type
Nunits := UI_To_Int (Esize (Ctyp)) / System_Storage_Unit;
if Nunits = 1 then
return True;
end if;
if not Compile_Time_Known_Value (Expr) then
return False;
end if;
Value := Expr_Value (Expr);
if Has_Biased_Representation (Ctyp) then
Value := Value - Expr_Value (Type_Low_Bound (Ctyp));
end if;
-- Values 0 and -1 immediately satisfy the last check
if Value = Uint_0 or else Value = Uint_Minus_1 then
return True;
end if;
-- We need to work with an unsigned value
if Value < 0 then
Value := Value + 2**(System_Storage_Unit * Nunits);
end if;
Remainder := Value rem 2**System_Storage_Unit;
for J in 1 .. Nunits - 1 loop
Value := Value / 2**System_Storage_Unit;
if Value rem 2**System_Storage_Unit /= Remainder then
return False;
end if;
end loop;
return True;
end Aggr_Assignment_OK_For_Backend;
----------------------------
-- Build_Constrained_Type --
----------------------------
procedure Build_Constrained_Type (Positional : Boolean) is
Loc : constant Source_Ptr := Sloc (N);
Agg_Type : constant Entity_Id := Make_Temporary (Loc, 'A');
Comp : Node_Id;
Decl : Node_Id;
Typ : constant Entity_Id := Etype (N);
Indexes : constant List_Id := New_List;
Num : Nat;
Sub_Agg : Node_Id;
begin
-- If the aggregate is purely positional, all its subaggregates
-- have the same size. We collect the dimensions from the first
-- subaggregate at each level.
if Positional then
Sub_Agg := N;
for D in 1 .. Number_Dimensions (Typ) loop
Sub_Agg := First (Expressions (Sub_Agg));
Comp := Sub_Agg;
Num := 0;
while Present (Comp) loop
Num := Num + 1;
Next (Comp);
end loop;
Append_To (Indexes,
Make_Range (Loc,
Low_Bound => Make_Integer_Literal (Loc, 1),
High_Bound => Make_Integer_Literal (Loc, Num)));
end loop;
else
-- We know the aggregate type is unconstrained and the aggregate
-- is not processable by the back end, therefore not necessarily
-- positional. Retrieve each dimension bounds (computed earlier).
for D in 1 .. Number_Dimensions (Typ) loop
Append_To (Indexes,
Make_Range (Loc,
Low_Bound => Aggr_Low (D),
High_Bound => Aggr_High (D)));
end loop;
end if;
Decl :=
Make_Full_Type_Declaration (Loc,
Defining_Identifier => Agg_Type,
Type_Definition =>
Make_Constrained_Array_Definition (Loc,
Discrete_Subtype_Definitions => Indexes,
Component_Definition =>
Make_Component_Definition (Loc,
Aliased_Present => False,
Subtype_Indication =>
New_Occurrence_Of (Component_Type (Typ), Loc))));
Insert_Action (N, Decl);
Analyze (Decl);
Set_Etype (N, Agg_Type);
Set_Is_Itype (Agg_Type);
Freeze_Itype (Agg_Type, N);
end Build_Constrained_Type;
------------------
-- Check_Bounds --
------------------
procedure Check_Bounds (Aggr_Bounds : Node_Id; Index_Bounds : Node_Id) is
Aggr_Lo : Node_Id;
Aggr_Hi : Node_Id;
Ind_Lo : Node_Id;
Ind_Hi : Node_Id;
Cond : Node_Id := Empty;
begin
Get_Index_Bounds (Aggr_Bounds, Aggr_Lo, Aggr_Hi);
Get_Index_Bounds (Index_Bounds, Ind_Lo, Ind_Hi);
-- Generate the following test:
-- [constraint_error when
-- Aggr_Lo <= Aggr_Hi and then
-- (Aggr_Lo < Ind_Lo or else Aggr_Hi > Ind_Hi)]
-- As an optimization try to see if some tests are trivially vacuous
-- because we are comparing an expression against itself.
if Aggr_Lo = Ind_Lo and then Aggr_Hi = Ind_Hi then
Cond := Empty;
elsif Aggr_Hi = Ind_Hi then
Cond :=
Make_Op_Lt (Loc,
Left_Opnd => Duplicate_Subexpr_Move_Checks (Aggr_Lo),
Right_Opnd => Duplicate_Subexpr_Move_Checks (Ind_Lo));
elsif Aggr_Lo = Ind_Lo then
Cond :=
Make_Op_Gt (Loc,
Left_Opnd => Duplicate_Subexpr_Move_Checks (Aggr_Hi),
Right_Opnd => Duplicate_Subexpr_Move_Checks (Ind_Hi));
else
Cond :=
Make_Or_Else (Loc,
Left_Opnd =>
Make_Op_Lt (Loc,
Left_Opnd => Duplicate_Subexpr_Move_Checks (Aggr_Lo),
Right_Opnd => Duplicate_Subexpr_Move_Checks (Ind_Lo)),
Right_Opnd =>
Make_Op_Gt (Loc,
Left_Opnd => Duplicate_Subexpr (Aggr_Hi),
Right_Opnd => Duplicate_Subexpr (Ind_Hi)));
end if;
if Present (Cond) then
Cond :=
Make_And_Then (Loc,
Left_Opnd =>
Make_Op_Le (Loc,
Left_Opnd => Duplicate_Subexpr_Move_Checks (Aggr_Lo),
Right_Opnd => Duplicate_Subexpr_Move_Checks (Aggr_Hi)),
Right_Opnd => Cond);
Set_Analyzed (Left_Opnd (Left_Opnd (Cond)), False);
Set_Analyzed (Right_Opnd (Left_Opnd (Cond)), False);
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition => Cond,
Reason => CE_Range_Check_Failed));
end if;
end Check_Bounds;
----------------------------
-- Check_Same_Aggr_Bounds --
----------------------------
procedure Check_Same_Aggr_Bounds (Sub_Aggr : Node_Id; Dim : Pos) is
Sub_Lo : constant Node_Id := Low_Bound (Aggregate_Bounds (Sub_Aggr));
Sub_Hi : constant Node_Id := High_Bound (Aggregate_Bounds (Sub_Aggr));
-- The bounds of this specific subaggregate
Aggr_Lo : constant Node_Id := Aggr_Low (Dim);
Aggr_Hi : constant Node_Id := Aggr_High (Dim);
-- The bounds of the aggregate for this dimension
Ind_Typ : constant Entity_Id := Aggr_Index_Typ (Dim);
-- The index type for this dimension.xxx
Cond : Node_Id := Empty;
Assoc : Node_Id;
Expr : Node_Id;
begin
-- If index checks are on generate the test
-- [constraint_error when
-- Aggr_Lo /= Sub_Lo or else Aggr_Hi /= Sub_Hi]
-- As an optimization try to see if some tests are trivially vacuos
-- because we are comparing an expression against itself. Also for
-- the first dimension the test is trivially vacuous because there
-- is just one aggregate for dimension 1.
if Index_Checks_Suppressed (Ind_Typ) then
Cond := Empty;
elsif Dim = 1 or else (Aggr_Lo = Sub_Lo and then Aggr_Hi = Sub_Hi)
then
Cond := Empty;
elsif Aggr_Hi = Sub_Hi then
Cond :=
Make_Op_Ne (Loc,
Left_Opnd => Duplicate_Subexpr_Move_Checks (Aggr_Lo),
Right_Opnd => Duplicate_Subexpr_Move_Checks (Sub_Lo));
elsif Aggr_Lo = Sub_Lo then
Cond :=
Make_Op_Ne (Loc,
Left_Opnd => Duplicate_Subexpr_Move_Checks (Aggr_Hi),
Right_Opnd => Duplicate_Subexpr_Move_Checks (Sub_Hi));
else
Cond :=
Make_Or_Else (Loc,
Left_Opnd =>
Make_Op_Ne (Loc,
Left_Opnd => Duplicate_Subexpr_Move_Checks (Aggr_Lo),
Right_Opnd => Duplicate_Subexpr_Move_Checks (Sub_Lo)),
Right_Opnd =>
Make_Op_Ne (Loc,
Left_Opnd => Duplicate_Subexpr (Aggr_Hi),
Right_Opnd => Duplicate_Subexpr (Sub_Hi)));
end if;
if Present (Cond) then
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition => Cond,
Reason => CE_Length_Check_Failed));
end if;
-- Now look inside the subaggregate to see if there is more work
if Dim < Aggr_Dimension then
-- Process positional components
if Present (Expressions (Sub_Aggr)) then
Expr := First (Expressions (Sub_Aggr));
while Present (Expr) loop
Check_Same_Aggr_Bounds (Expr, Dim + 1);
Next (Expr);
end loop;
end if;
-- Process component associations
if Present (Component_Associations (Sub_Aggr)) then
Assoc := First (Component_Associations (Sub_Aggr));
while Present (Assoc) loop
Expr := Expression (Assoc);
Check_Same_Aggr_Bounds (Expr, Dim + 1);
Next (Assoc);
end loop;
end if;
end if;
end Check_Same_Aggr_Bounds;
----------------------------
-- Compute_Others_Present --
----------------------------
procedure Compute_Others_Present (Sub_Aggr : Node_Id; Dim : Pos) is
Assoc : Node_Id;
Expr : Node_Id;
begin
if Present (Component_Associations (Sub_Aggr)) then
Assoc := Last (Component_Associations (Sub_Aggr));
if Nkind (First (Choice_List (Assoc))) = N_Others_Choice then
Others_Present (Dim) := True;
end if;
end if;
-- Now look inside the subaggregate to see if there is more work
if Dim < Aggr_Dimension then
-- Process positional components
if Present (Expressions (Sub_Aggr)) then
Expr := First (Expressions (Sub_Aggr));
while Present (Expr) loop
Compute_Others_Present (Expr, Dim + 1);
Next (Expr);
end loop;
end if;
-- Process component associations
if Present (Component_Associations (Sub_Aggr)) then
Assoc := First (Component_Associations (Sub_Aggr));
while Present (Assoc) loop
Expr := Expression (Assoc);
Compute_Others_Present (Expr, Dim + 1);
Next (Assoc);
end loop;
end if;
end if;
end Compute_Others_Present;
------------------------
-- In_Place_Assign_OK --
------------------------
function In_Place_Assign_OK return Boolean is
Aggr_In : Node_Id;
Aggr_Lo : Node_Id;
Aggr_Hi : Node_Id;
Obj_In : Node_Id;
Obj_Lo : Node_Id;
Obj_Hi : Node_Id;
function Safe_Aggregate (Aggr : Node_Id) return Boolean;
-- Check recursively that each component of a (sub)aggregate does not
-- depend on the variable being assigned to.
function Safe_Component (Expr : Node_Id) return Boolean;
-- Verify that an expression cannot depend on the variable being
-- assigned to. Room for improvement here (but less than before).
--------------------
-- Safe_Aggregate --
--------------------
function Safe_Aggregate (Aggr : Node_Id) return Boolean is
Expr : Node_Id;
begin
if Present (Expressions (Aggr)) then
Expr := First (Expressions (Aggr));
while Present (Expr) loop
if Nkind (Expr) = N_Aggregate then
if not Safe_Aggregate (Expr) then
return False;
end if;
elsif not Safe_Component (Expr) then
return False;
end if;
Next (Expr);
end loop;
end if;
if Present (Component_Associations (Aggr)) then
Expr := First (Component_Associations (Aggr));
while Present (Expr) loop
if Nkind (Expression (Expr)) = N_Aggregate then
if not Safe_Aggregate (Expression (Expr)) then
return False;
end if;
-- If association has a box, no way to determine yet
-- whether default can be assigned in place.
elsif Box_Present (Expr) then
return False;
elsif not Safe_Component (Expression (Expr)) then
return False;
end if;
Next (Expr);
end loop;
end if;
return True;
end Safe_Aggregate;
--------------------
-- Safe_Component --
--------------------
function Safe_Component (Expr : Node_Id) return Boolean is
Comp : Node_Id := Expr;
function Check_Component (Comp : Node_Id) return Boolean;
-- Do the recursive traversal, after copy
---------------------
-- Check_Component --
---------------------
function Check_Component (Comp : Node_Id) return Boolean is
begin
if Is_Overloaded (Comp) then
return False;
end if;
return Compile_Time_Known_Value (Comp)
or else (Is_Entity_Name (Comp)
and then Present (Entity (Comp))
and then No (Renamed_Object (Entity (Comp))))
or else (Nkind (Comp) = N_Attribute_Reference
and then Check_Component (Prefix (Comp)))
or else (Nkind (Comp) in N_Binary_Op
and then Check_Component (Left_Opnd (Comp))
and then Check_Component (Right_Opnd (Comp)))
or else (Nkind (Comp) in N_Unary_Op
and then Check_Component (Right_Opnd (Comp)))
or else (Nkind (Comp) = N_Selected_Component
and then Check_Component (Prefix (Comp)))
or else (Nkind (Comp) = N_Unchecked_Type_Conversion
and then Check_Component (Expression (Comp)));
end Check_Component;
-- Start of processing for Safe_Component
begin
-- If the component appears in an association that may correspond
-- to more than one element, it is not analyzed before expansion
-- into assignments, to avoid side effects. We analyze, but do not
-- resolve the copy, to obtain sufficient entity information for
-- the checks that follow. If component is overloaded we assume
-- an unsafe function call.
if not Analyzed (Comp) then
if Is_Overloaded (Expr) then
return False;
elsif Nkind (Expr) = N_Aggregate
and then not Is_Others_Aggregate (Expr)
then
return False;
elsif Nkind (Expr) = N_Allocator then
-- For now, too complex to analyze
return False;
end if;
Comp := New_Copy_Tree (Expr);
Set_Parent (Comp, Parent (Expr));
Analyze (Comp);
end if;
if Nkind (Comp) = N_Aggregate then
return Safe_Aggregate (Comp);
else
return Check_Component (Comp);
end if;
end Safe_Component;
-- Start of processing for In_Place_Assign_OK
begin
if Present (Component_Associations (N)) then
-- On assignment, sliding can take place, so we cannot do the
-- assignment in place unless the bounds of the aggregate are
-- statically equal to those of the target.
-- If the aggregate is given by an others choice, the bounds are
-- derived from the left-hand side, and the assignment is safe if
-- the expression is.
if Is_Others_Aggregate (N) then
return
Safe_Component
(Expression (First (Component_Associations (N))));
end if;
Aggr_In := First_Index (Etype (N));
if Nkind (Parent (N)) = N_Assignment_Statement then
Obj_In := First_Index (Etype (Name (Parent (N))));
else
-- Context is an allocator. Check bounds of aggregate against
-- given type in qualified expression.
pragma Assert (Nkind (Parent (Parent (N))) = N_Allocator);
Obj_In :=
First_Index (Etype (Entity (Subtype_Mark (Parent (N)))));
end if;
while Present (Aggr_In) loop
Get_Index_Bounds (Aggr_In, Aggr_Lo, Aggr_Hi);
Get_Index_Bounds (Obj_In, Obj_Lo, Obj_Hi);
if not Compile_Time_Known_Value (Aggr_Lo)
or else not Compile_Time_Known_Value (Aggr_Hi)
or else not Compile_Time_Known_Value (Obj_Lo)
or else not Compile_Time_Known_Value (Obj_Hi)
or else Expr_Value (Aggr_Lo) /= Expr_Value (Obj_Lo)
or else Expr_Value (Aggr_Hi) /= Expr_Value (Obj_Hi)
then
return False;
end if;
Next_Index (Aggr_In);
Next_Index (Obj_In);
end loop;
end if;
-- Now check the component values themselves
return Safe_Aggregate (N);
end In_Place_Assign_OK;
------------------
-- Others_Check --
------------------
procedure Others_Check (Sub_Aggr : Node_Id; Dim : Pos) is
Aggr_Lo : constant Node_Id := Aggr_Low (Dim);
Aggr_Hi : constant Node_Id := Aggr_High (Dim);
-- The bounds of the aggregate for this dimension
Ind_Typ : constant Entity_Id := Aggr_Index_Typ (Dim);
-- The index type for this dimension
Need_To_Check : Boolean := False;
Choices_Lo : Node_Id := Empty;
Choices_Hi : Node_Id := Empty;
-- The lowest and highest discrete choices for a named subaggregate
Nb_Choices : Int := -1;
-- The number of discrete non-others choices in this subaggregate
Nb_Elements : Uint := Uint_0;
-- The number of elements in a positional aggregate
Cond : Node_Id := Empty;
Assoc : Node_Id;
Choice : Node_Id;
Expr : Node_Id;
begin
-- Check if we have an others choice. If we do make sure that this
-- subaggregate contains at least one element in addition to the
-- others choice.
if Range_Checks_Suppressed (Ind_Typ) then
Need_To_Check := False;
elsif Present (Expressions (Sub_Aggr))
and then Present (Component_Associations (Sub_Aggr))
then
Need_To_Check := True;
elsif Present (Component_Associations (Sub_Aggr)) then
Assoc := Last (Component_Associations (Sub_Aggr));
if Nkind (First (Choice_List (Assoc))) /= N_Others_Choice then
Need_To_Check := False;
else
-- Count the number of discrete choices. Start with -1 because
-- the others choice does not count.
-- Is there some reason we do not use List_Length here ???
Nb_Choices := -1;
Assoc := First (Component_Associations (Sub_Aggr));
while Present (Assoc) loop
Choice := First (Choice_List (Assoc));
while Present (Choice) loop
Nb_Choices := Nb_Choices + 1;
Next (Choice);
end loop;
Next (Assoc);
end loop;
-- If there is only an others choice nothing to do
Need_To_Check := (Nb_Choices > 0);
end if;
else
Need_To_Check := False;
end if;
-- If we are dealing with a positional subaggregate with an others
-- choice then compute the number or positional elements.
if Need_To_Check and then Present (Expressions (Sub_Aggr)) then
Expr := First (Expressions (Sub_Aggr));
Nb_Elements := Uint_0;
while Present (Expr) loop
Nb_Elements := Nb_Elements + 1;
Next (Expr);
end loop;
-- If the aggregate contains discrete choices and an others choice
-- compute the smallest and largest discrete choice values.
elsif Need_To_Check then
Compute_Choices_Lo_And_Choices_Hi : declare
Table : Case_Table_Type (1 .. Nb_Choices);
-- Used to sort all the different choice values
J : Pos := 1;
Low : Node_Id;
High : Node_Id;
begin
Assoc := First (Component_Associations (Sub_Aggr));
while Present (Assoc) loop
Choice := First (Choice_List (Assoc));
while Present (Choice) loop
if Nkind (Choice) = N_Others_Choice then
exit;
end if;
Get_Index_Bounds (Choice, Low, High);
Table (J).Choice_Lo := Low;
Table (J).Choice_Hi := High;
J := J + 1;
Next (Choice);
end loop;
Next (Assoc);
end loop;
-- Sort the discrete choices
Sort_Case_Table (Table);
Choices_Lo := Table (1).Choice_Lo;
Choices_Hi := Table (Nb_Choices).Choice_Hi;
end Compute_Choices_Lo_And_Choices_Hi;
end if;
-- If no others choice in this subaggregate, or the aggregate
-- comprises only an others choice, nothing to do.
if not Need_To_Check then
Cond := Empty;
-- If we are dealing with an aggregate containing an others choice
-- and positional components, we generate the following test:
-- if Ind_Typ'Pos (Aggr_Lo) + (Nb_Elements - 1) >
-- Ind_Typ'Pos (Aggr_Hi)
-- then
-- raise Constraint_Error;
-- end if;
elsif Nb_Elements > Uint_0 then
Cond :=
Make_Op_Gt (Loc,
Left_Opnd =>
Make_Op_Add (Loc,
Left_Opnd =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Ind_Typ, Loc),
Attribute_Name => Name_Pos,
Expressions =>
New_List
(Duplicate_Subexpr_Move_Checks (Aggr_Lo))),
Right_Opnd => Make_Integer_Literal (Loc, Nb_Elements - 1)),
Right_Opnd =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Ind_Typ, Loc),
Attribute_Name => Name_Pos,
Expressions => New_List (
Duplicate_Subexpr_Move_Checks (Aggr_Hi))));
-- If we are dealing with an aggregate containing an others choice
-- and discrete choices we generate the following test:
-- [constraint_error when
-- Choices_Lo < Aggr_Lo or else Choices_Hi > Aggr_Hi];
else
Cond :=
Make_Or_Else (Loc,
Left_Opnd =>
Make_Op_Lt (Loc,
Left_Opnd => Duplicate_Subexpr_Move_Checks (Choices_Lo),
Right_Opnd => Duplicate_Subexpr_Move_Checks (Aggr_Lo)),
Right_Opnd =>
Make_Op_Gt (Loc,
Left_Opnd => Duplicate_Subexpr (Choices_Hi),
Right_Opnd => Duplicate_Subexpr (Aggr_Hi)));
end if;
if Present (Cond) then
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition => Cond,
Reason => CE_Length_Check_Failed));
-- Questionable reason code, shouldn't that be a
-- CE_Range_Check_Failed ???
end if;
-- Now look inside the subaggregate to see if there is more work
if Dim < Aggr_Dimension then
-- Process positional components
if Present (Expressions (Sub_Aggr)) then
Expr := First (Expressions (Sub_Aggr));
while Present (Expr) loop
Others_Check (Expr, Dim + 1);
Next (Expr);
end loop;
end if;
-- Process component associations
if Present (Component_Associations (Sub_Aggr)) then
Assoc := First (Component_Associations (Sub_Aggr));
while Present (Assoc) loop
Expr := Expression (Assoc);
Others_Check (Expr, Dim + 1);
Next (Assoc);
end loop;
end if;
end if;
end Others_Check;
-------------------------
-- Safe_Left_Hand_Side --
-------------------------
function Safe_Left_Hand_Side (N : Node_Id) return Boolean is
function Is_Safe_Index (Indx : Node_Id) return Boolean;
-- If the left-hand side includes an indexed component, check that
-- the indexes are free of side effects.
-------------------
-- Is_Safe_Index --
-------------------
function Is_Safe_Index (Indx : Node_Id) return Boolean is
begin
if Is_Entity_Name (Indx) then
return True;
elsif Nkind (Indx) = N_Integer_Literal then
return True;
elsif Nkind (Indx) = N_Function_Call
and then Is_Entity_Name (Name (Indx))
and then Has_Pragma_Pure_Function (Entity (Name (Indx)))
then
return True;
elsif Nkind (Indx) = N_Type_Conversion
and then Is_Safe_Index (Expression (Indx))
then
return True;
else
return False;
end if;
end Is_Safe_Index;
-- Start of processing for Safe_Left_Hand_Side
begin
if Is_Entity_Name (N) then
return True;
elsif Nkind_In (N, N_Explicit_Dereference, N_Selected_Component)
and then Safe_Left_Hand_Side (Prefix (N))
then
return True;
elsif Nkind (N) = N_Indexed_Component
and then Safe_Left_Hand_Side (Prefix (N))
and then Is_Safe_Index (First (Expressions (N)))
then
return True;
elsif Nkind (N) = N_Unchecked_Type_Conversion then
return Safe_Left_Hand_Side (Expression (N));
else
return False;
end if;
end Safe_Left_Hand_Side;
-- Local variables
Tmp : Entity_Id;
-- Holds the temporary aggregate value
Tmp_Decl : Node_Id;
-- Holds the declaration of Tmp
Aggr_Code : List_Id;
Parent_Node : Node_Id;
Parent_Kind : Node_Kind;
-- Start of processing for Expand_Array_Aggregate
begin
-- Do not touch the special aggregates of attributes used for Asm calls
if Is_RTE (Ctyp, RE_Asm_Input_Operand)
or else Is_RTE (Ctyp, RE_Asm_Output_Operand)
then
return;
-- Do not expand an aggregate for an array type which contains tasks if
-- the aggregate is associated with an unexpanded return statement of a
-- build-in-place function. The aggregate is expanded when the related
-- return statement (rewritten into an extended return) is processed.
-- This delay ensures that any temporaries and initialization code
-- generated for the aggregate appear in the proper return block and
-- use the correct _chain and _master.
elsif Has_Task (Base_Type (Etype (N)))
and then Nkind (Parent (N)) = N_Simple_Return_Statement
and then Is_Build_In_Place_Function
(Return_Applies_To (Return_Statement_Entity (Parent (N))))
then
return;
-- Do not attempt expansion if error already detected. We may reach this
-- point in spite of previous errors when compiling with -gnatq, to
-- force all possible errors (this is the usual ACATS mode).
elsif Error_Posted (N) then
return;
end if;
-- If the semantic analyzer has determined that aggregate N will raise
-- Constraint_Error at run time, then the aggregate node has been
-- replaced with an N_Raise_Constraint_Error node and we should
-- never get here.
pragma Assert (not Raises_Constraint_Error (N));
-- STEP 1a
-- Check that the index range defined by aggregate bounds is
-- compatible with corresponding index subtype.
Index_Compatibility_Check : declare
Aggr_Index_Range : Node_Id := First_Index (Typ);
-- The current aggregate index range
Index_Constraint : Node_Id := First_Index (Etype (Typ));
-- The corresponding index constraint against which we have to
-- check the above aggregate index range.
begin
Compute_Others_Present (N, 1);
for J in 1 .. Aggr_Dimension loop
-- There is no need to emit a check if an others choice is present
-- for this array aggregate dimension since in this case one of
-- N's subaggregates has taken its bounds from the context and
-- these bounds must have been checked already. In addition all
-- subaggregates corresponding to the same dimension must all have
-- the same bounds (checked in (c) below).
if not Range_Checks_Suppressed (Etype (Index_Constraint))
and then not Others_Present (J)
then
-- We don't use Checks.Apply_Range_Check here because it emits
-- a spurious check. Namely it checks that the range defined by
-- the aggregate bounds is nonempty. But we know this already
-- if we get here.
Check_Bounds (Aggr_Index_Range, Index_Constraint);
end if;
-- Save the low and high bounds of the aggregate index as well as
-- the index type for later use in checks (b) and (c) below.
Aggr_Low (J) := Low_Bound (Aggr_Index_Range);
Aggr_High (J) := High_Bound (Aggr_Index_Range);
Aggr_Index_Typ (J) := Etype (Index_Constraint);
Next_Index (Aggr_Index_Range);
Next_Index (Index_Constraint);
end loop;
end Index_Compatibility_Check;
-- STEP 1b
-- If an others choice is present check that no aggregate index is
-- outside the bounds of the index constraint.
Others_Check (N, 1);
-- STEP 1c
-- For multidimensional arrays make sure that all subaggregates
-- corresponding to the same dimension have the same bounds.
if Aggr_Dimension > 1 then
Check_Same_Aggr_Bounds (N, 1);
end if;
-- STEP 1d
-- If we have a default component value, or simple initialization is
-- required for the component type, then we replace <> in component
-- associations by the required default value.
declare
Default_Val : Node_Id;
Assoc : Node_Id;
begin
if (Present (Default_Aspect_Component_Value (Typ))
or else Needs_Simple_Initialization (Ctyp))
and then Present (Component_Associations (N))
then
Assoc := First (Component_Associations (N));
while Present (Assoc) loop
if Nkind (Assoc) = N_Component_Association
and then Box_Present (Assoc)
then
Set_Box_Present (Assoc, False);
if Present (Default_Aspect_Component_Value (Typ)) then
Default_Val := Default_Aspect_Component_Value (Typ);
else
Default_Val := Get_Simple_Init_Val (Ctyp, N);
end if;
Set_Expression (Assoc, New_Copy_Tree (Default_Val));
Analyze_And_Resolve (Expression (Assoc), Ctyp);
end if;
Next (Assoc);
end loop;
end if;
end;
-- STEP 2
-- Here we test for is packed array aggregate that we can handle at
-- compile time. If so, return with transformation done. Note that we do
-- this even if the aggregate is nested, because once we have done this
-- processing, there is no more nested aggregate.
if Packed_Array_Aggregate_Handled (N) then
return;
end if;
-- At this point we try to convert to positional form
if Ekind (Current_Scope) = E_Package
and then Static_Elaboration_Desired (Current_Scope)
then
Convert_To_Positional (N, Max_Others_Replicate => 100);
else
Convert_To_Positional (N);
end if;
-- if the result is no longer an aggregate (e.g. it may be a string
-- literal, or a temporary which has the needed value), then we are
-- done, since there is no longer a nested aggregate.
if Nkind (N) /= N_Aggregate then
return;
-- We are also done if the result is an analyzed aggregate, indicating
-- that Convert_To_Positional succeeded and reanalyzed the rewritten
-- aggregate.
elsif Analyzed (N) and then N /= Original_Node (N) then
return;
end if;
-- If all aggregate components are compile-time known and the aggregate
-- has been flattened, nothing left to do. The same occurs if the
-- aggregate is used to initialize the components of a statically
-- allocated dispatch table.
if Compile_Time_Known_Aggregate (N)
or else Is_Static_Dispatch_Table_Aggregate (N)
then
Set_Expansion_Delayed (N, False);
return;
end if;
-- Now see if back end processing is possible
if Backend_Processing_Possible (N) then
-- If the aggregate is static but the constraints are not, build
-- a static subtype for the aggregate, so that Gigi can place it
-- in static memory. Perform an unchecked_conversion to the non-
-- static type imposed by the context.
declare
Itype : constant Entity_Id := Etype (N);
Index : Node_Id;
Needs_Type : Boolean := False;
begin
Index := First_Index (Itype);
while Present (Index) loop
if not Is_OK_Static_Subtype (Etype (Index)) then
Needs_Type := True;
exit;
else
Next_Index (Index);
end if;
end loop;
if Needs_Type then
Build_Constrained_Type (Positional => True);
Rewrite (N, Unchecked_Convert_To (Itype, N));
Analyze (N);
end if;
end;
return;
end if;
-- STEP 3
-- Delay expansion for nested aggregates: it will be taken care of when
-- the parent aggregate is expanded.
Parent_Node := Parent (N);
Parent_Kind := Nkind (Parent_Node);
if Parent_Kind = N_Qualified_Expression then
Parent_Node := Parent (Parent_Node);
Parent_Kind := Nkind (Parent_Node);
end if;
if Parent_Kind = N_Aggregate
or else Parent_Kind = N_Extension_Aggregate
or else Parent_Kind = N_Component_Association
or else (Parent_Kind = N_Object_Declaration
and then Needs_Finalization (Typ))
or else (Parent_Kind = N_Assignment_Statement
and then Inside_Init_Proc)
then
if Static_Array_Aggregate (N)
or else Compile_Time_Known_Aggregate (N)
then
Set_Expansion_Delayed (N, False);
return;
else
Set_Expansion_Delayed (N);
return;
end if;
end if;
-- STEP 4
-- Look if in place aggregate expansion is possible
-- For object declarations we build the aggregate in place, unless
-- the array is bit-packed or the component is controlled.
-- For assignments we do the assignment in place if all the component
-- associations have compile-time known values. For other cases we
-- create a temporary. The analysis for safety of on-line assignment
-- is delicate, i.e. we don't know how to do it fully yet ???
-- For allocators we assign to the designated object in place if the
-- aggregate meets the same conditions as other in-place assignments.
-- In this case the aggregate may not come from source but was created
-- for default initialization, e.g. with Initialize_Scalars.
if Requires_Transient_Scope (Typ) then
Establish_Transient_Scope
(N, Sec_Stack => Has_Controlled_Component (Typ));
end if;
if Has_Default_Init_Comps (N) then
Maybe_In_Place_OK := False;
elsif Is_Bit_Packed_Array (Typ)
or else Has_Controlled_Component (Typ)
then
Maybe_In_Place_OK := False;
else
Maybe_In_Place_OK :=
(Nkind (Parent (N)) = N_Assignment_Statement
and then In_Place_Assign_OK)
or else
(Nkind (Parent (Parent (N))) = N_Allocator
and then In_Place_Assign_OK);
end if;
-- If this is an array of tasks, it will be expanded into build-in-place
-- assignments. Build an activation chain for the tasks now.
if Has_Task (Etype (N)) then
Build_Activation_Chain_Entity (N);
end if;
-- Perform in-place expansion of aggregate in an object declaration.
-- Note: actions generated for the aggregate will be captured in an
-- expression-with-actions statement so that they can be transferred
-- to freeze actions later if there is an address clause for the
-- object. (Note: we don't use a block statement because this would
-- cause generated freeze nodes to be elaborated in the wrong scope).
-- Do not perform in-place expansion for SPARK 05 because aggregates are
-- expected to appear in qualified form. In-place expansion eliminates
-- the qualification and eventually violates this SPARK 05 restiction.
-- Should document the rest of the guards ???
if not Has_Default_Init_Comps (N)
and then Comes_From_Source (Parent_Node)
and then Parent_Kind = N_Object_Declaration
and then Present (Expression (Parent_Node))
and then not
Must_Slide (Etype (Defining_Identifier (Parent_Node)), Typ)
and then not Has_Controlled_Component (Typ)
and then not Is_Bit_Packed_Array (Typ)
and then not Restriction_Check_Required (SPARK_05)
then
In_Place_Assign_OK_For_Declaration := True;
Tmp := Defining_Identifier (Parent_Node);
Set_No_Initialization (Parent_Node);
Set_Expression (Parent_Node, Empty);
-- Set kind and type of the entity, for use in the analysis
-- of the subsequent assignments. If the nominal type is not
-- constrained, build a subtype from the known bounds of the
-- aggregate. If the declaration has a subtype mark, use it,
-- otherwise use the itype of the aggregate.
Set_Ekind (Tmp, E_Variable);
if not Is_Constrained (Typ) then
Build_Constrained_Type (Positional => False);
elsif Is_Entity_Name (Object_Definition (Parent_Node))
and then Is_Constrained (Entity (Object_Definition (Parent_Node)))
then
Set_Etype (Tmp, Entity (Object_Definition (Parent_Node)));
else
Set_Size_Known_At_Compile_Time (Typ, False);
Set_Etype (Tmp, Typ);
end if;
elsif Maybe_In_Place_OK
and then Nkind (Parent (N)) = N_Qualified_Expression
and then Nkind (Parent (Parent (N))) = N_Allocator
then
Set_Expansion_Delayed (N);
return;
-- In the remaining cases the aggregate is the RHS of an assignment
elsif Maybe_In_Place_OK
and then Safe_Left_Hand_Side (Name (Parent (N)))
then
Tmp := Name (Parent (N));
if Etype (Tmp) /= Etype (N) then
Apply_Length_Check (N, Etype (Tmp));
if Nkind (N) = N_Raise_Constraint_Error then
-- Static error, nothing further to expand
return;
end if;
end if;
-- If a slice assignment has an aggregate with a single others_choice,
-- the assignment can be done in place even if bounds are not static,
-- by converting it into a loop over the discrete range of the slice.
elsif Maybe_In_Place_OK
and then Nkind (Name (Parent (N))) = N_Slice
and then Is_Others_Aggregate (N)
then
Tmp := Name (Parent (N));
-- Set type of aggregate to be type of lhs in assignment, in order
-- to suppress redundant length checks.
Set_Etype (N, Etype (Tmp));
-- Step 5
-- In place aggregate expansion is not possible
else
Maybe_In_Place_OK := False;
Tmp := Make_Temporary (Loc, 'A', N);
Tmp_Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Tmp,
Object_Definition => New_Occurrence_Of (Typ, Loc));
Set_No_Initialization (Tmp_Decl, True);
-- If we are within a loop, the temporary will be pushed on the
-- stack at each iteration. If the aggregate is the expression for an
-- allocator, it will be immediately copied to the heap and can
-- be reclaimed at once. We create a transient scope around the
-- aggregate for this purpose.
if Ekind (Current_Scope) = E_Loop
and then Nkind (Parent (Parent (N))) = N_Allocator
then
Establish_Transient_Scope (N, False);
end if;
Insert_Action (N, Tmp_Decl);
end if;
-- Construct and insert the aggregate code. We can safely suppress index
-- checks because this code is guaranteed not to raise CE on index
-- checks. However we should *not* suppress all checks.
declare
Target : Node_Id;
begin
if Nkind (Tmp) = N_Defining_Identifier then
Target := New_Occurrence_Of (Tmp, Loc);
else
if Has_Default_Init_Comps (N) then
-- Ada 2005 (AI-287): This case has not been analyzed???
raise Program_Error;
end if;
-- Name in assignment is explicit dereference
Target := New_Copy (Tmp);
end if;
-- If we are to generate an in place assignment for a declaration or
-- an assignment statement, and the assignment can be done directly
-- by the back end, then do not expand further.
-- ??? We can also do that if in place expansion is not possible but
-- then we could go into an infinite recursion.
if (In_Place_Assign_OK_For_Declaration or else Maybe_In_Place_OK)
and then not AAMP_On_Target
and then not CodePeer_Mode
and then not Modify_Tree_For_C
and then not Possible_Bit_Aligned_Component (Target)
and then not Is_Possibly_Unaligned_Slice (Target)
and then Aggr_Assignment_OK_For_Backend (N)
then
if Maybe_In_Place_OK then
return;
end if;
Aggr_Code :=
New_List (
Make_Assignment_Statement (Loc,
Name => Target,
Expression => New_Copy (N)));
else
Aggr_Code :=
Build_Array_Aggr_Code (N,
Ctype => Ctyp,
Index => First_Index (Typ),
Into => Target,
Scalar_Comp => Is_Scalar_Type (Ctyp));
end if;
-- Save the last assignment statement associated with the aggregate
-- when building a controlled object. This reference is utilized by
-- the finalization machinery when marking an object as successfully
-- initialized.
if Needs_Finalization (Typ)
and then Is_Entity_Name (Target)
and then Present (Entity (Target))
and then Ekind_In (Entity (Target), E_Constant, E_Variable)
then
Set_Last_Aggregate_Assignment (Entity (Target), Last (Aggr_Code));
end if;
end;
-- If the aggregate is the expression in a declaration, the expanded
-- code must be inserted after it. The defining entity might not come
-- from source if this is part of an inlined body, but the declaration
-- itself will.
if Comes_From_Source (Tmp)
or else
(Nkind (Parent (N)) = N_Object_Declaration
and then Comes_From_Source (Parent (N))
and then Tmp = Defining_Entity (Parent (N)))
then
declare
Node_After : constant Node_Id := Next (Parent_Node);
begin
Insert_Actions_After (Parent_Node, Aggr_Code);
if Parent_Kind = N_Object_Declaration then
Collect_Initialization_Statements
(Obj => Tmp, N => Parent_Node, Node_After => Node_After);
end if;
end;
else
Insert_Actions (N, Aggr_Code);
end if;
-- If the aggregate has been assigned in place, remove the original
-- assignment.
if Nkind (Parent (N)) = N_Assignment_Statement
and then Maybe_In_Place_OK
then
Rewrite (Parent (N), Make_Null_Statement (Loc));
elsif Nkind (Parent (N)) /= N_Object_Declaration
or else Tmp /= Defining_Identifier (Parent (N))
then
Rewrite (N, New_Occurrence_Of (Tmp, Loc));
Analyze_And_Resolve (N, Typ);
end if;
end Expand_Array_Aggregate;
------------------------
-- Expand_N_Aggregate --
------------------------
procedure Expand_N_Aggregate (N : Node_Id) is
begin
-- Record aggregate case
if Is_Record_Type (Etype (N)) then
Expand_Record_Aggregate (N);
-- Array aggregate case
else
-- A special case, if we have a string subtype with bounds 1 .. N,
-- where N is known at compile time, and the aggregate is of the
-- form (others => 'x'), with a single choice and no expressions,
-- and N is less than 80 (an arbitrary limit for now), then replace
-- the aggregate by the equivalent string literal (but do not mark
-- it as static since it is not).
-- Note: this entire circuit is redundant with respect to code in
-- Expand_Array_Aggregate that collapses others choices to positional
-- form, but there are two problems with that circuit:
-- a) It is limited to very small cases due to ill-understood
-- interactions with bootstrapping. That limit is removed by
-- use of the No_Implicit_Loops restriction.
-- b) It incorrectly ends up with the resulting expressions being
-- considered static when they are not. For example, the
-- following test should fail:
-- pragma Restrictions (No_Implicit_Loops);
-- package NonSOthers4 is
-- B : constant String (1 .. 6) := (others => 'A');
-- DH : constant String (1 .. 8) := B & "BB";
-- X : Integer;
-- pragma Export (C, X, Link_Name => DH);
-- end;
-- But it succeeds (DH looks static to pragma Export)
-- To be sorted out ???
if Present (Component_Associations (N)) then
declare
CA : constant Node_Id := First (Component_Associations (N));
MX : constant := 80;
begin
if Nkind (First (Choice_List (CA))) = N_Others_Choice
and then Nkind (Expression (CA)) = N_Character_Literal
and then No (Expressions (N))
then
declare
T : constant Entity_Id := Etype (N);
X : constant Node_Id := First_Index (T);
EC : constant Node_Id := Expression (CA);
CV : constant Uint := Char_Literal_Value (EC);
CC : constant Int := UI_To_Int (CV);
begin
if Nkind (X) = N_Range
and then Compile_Time_Known_Value (Low_Bound (X))
and then Expr_Value (Low_Bound (X)) = 1
and then Compile_Time_Known_Value (High_Bound (X))
then
declare
Hi : constant Uint := Expr_Value (High_Bound (X));
begin
if Hi <= MX then
Start_String;
for J in 1 .. UI_To_Int (Hi) loop
Store_String_Char (Char_Code (CC));
end loop;
Rewrite (N,
Make_String_Literal (Sloc (N),
Strval => End_String));
if CC >= Int (2 ** 16) then
Set_Has_Wide_Wide_Character (N);
elsif CC >= Int (2 ** 8) then
Set_Has_Wide_Character (N);
end if;
Analyze_And_Resolve (N, T);
Set_Is_Static_Expression (N, False);
return;
end if;
end;
end if;
end;
end if;
end;
end if;
-- Not that special case, so normal expansion of array aggregate
Expand_Array_Aggregate (N);
end if;
exception
when RE_Not_Available =>
return;
end Expand_N_Aggregate;
------------------------------
-- Expand_N_Delta_Aggregate --
------------------------------
procedure Expand_N_Delta_Aggregate (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
Decl : Node_Id;
begin
Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Make_Temporary (Loc, 'T'),
Object_Definition => New_Occurrence_Of (Typ, Loc),
Expression => New_Copy_Tree (Expression (N)));
if Is_Array_Type (Etype (N)) then
Expand_Delta_Array_Aggregate (N, New_List (Decl));
else
Expand_Delta_Record_Aggregate (N, New_List (Decl));
end if;
end Expand_N_Delta_Aggregate;
----------------------------------
-- Expand_Delta_Array_Aggregate --
----------------------------------
procedure Expand_Delta_Array_Aggregate (N : Node_Id; Deltas : List_Id) is
Loc : constant Source_Ptr := Sloc (N);
Temp : constant Entity_Id := Defining_Identifier (First (Deltas));
Assoc : Node_Id;
function Generate_Loop (C : Node_Id) return Node_Id;
-- Generate a loop containing individual component assignments for
-- choices that are ranges, subtype indications, subtype names, and
-- iterated component associations.
-------------------
-- Generate_Loop --
-------------------
function Generate_Loop (C : Node_Id) return Node_Id is
Sl : constant Source_Ptr := Sloc (C);
Ix : Entity_Id;
begin
if Nkind (Parent (C)) = N_Iterated_Component_Association then
Ix :=
Make_Defining_Identifier (Loc,
Chars => (Chars (Defining_Identifier (Parent (C)))));
else
Ix := Make_Temporary (Sl, 'I');
end if;
return
Make_Loop_Statement (Loc,
Iteration_Scheme =>
Make_Iteration_Scheme (Sl,
Loop_Parameter_Specification =>
Make_Loop_Parameter_Specification (Sl,
Defining_Identifier => Ix,
Discrete_Subtype_Definition => New_Copy_Tree (C))),
Statements => New_List (
Make_Assignment_Statement (Sl,
Name =>
Make_Indexed_Component (Sl,
Prefix => New_Occurrence_Of (Temp, Sl),
Expressions => New_List (New_Occurrence_Of (Ix, Sl))),
Expression => New_Copy_Tree (Expression (Assoc)))),
End_Label => Empty);
end Generate_Loop;
-- Local variables
Choice : Node_Id;
-- Start of processing for Expand_Delta_Array_Aggregate
begin
Assoc := First (Component_Associations (N));
while Present (Assoc) loop
Choice := First (Choice_List (Assoc));
if Nkind (Assoc) = N_Iterated_Component_Association then
while Present (Choice) loop
Append_To (Deltas, Generate_Loop (Choice));
Next (Choice);
end loop;
else
while Present (Choice) loop
-- Choice can be given by a range, a subtype indication, a
-- subtype name, a scalar value, or an entity.
if Nkind (Choice) = N_Range
or else (Is_Entity_Name (Choice)
and then Is_Type (Entity (Choice)))
then
Append_To (Deltas, Generate_Loop (Choice));
elsif Nkind (Choice) = N_Subtype_Indication then
Append_To (Deltas,
Generate_Loop (Range_Expression (Constraint (Choice))));
else
Append_To (Deltas,
Make_Assignment_Statement (Sloc (Choice),
Name =>
Make_Indexed_Component (Sloc (Choice),
Prefix => New_Occurrence_Of (Temp, Loc),
Expressions => New_List (New_Copy_Tree (Choice))),
Expression => New_Copy_Tree (Expression (Assoc))));
end if;
Next (Choice);
end loop;
end if;
Next (Assoc);
end loop;
Insert_Actions (N, Deltas);
Rewrite (N, New_Occurrence_Of (Temp, Loc));
end Expand_Delta_Array_Aggregate;
-----------------------------------
-- Expand_Delta_Record_Aggregate --
-----------------------------------
procedure Expand_Delta_Record_Aggregate (N : Node_Id; Deltas : List_Id) is
Loc : constant Source_Ptr := Sloc (N);
Temp : constant Entity_Id := Defining_Identifier (First (Deltas));
Assoc : Node_Id;
Choice : Node_Id;
begin
Assoc := First (Component_Associations (N));
while Present (Assoc) loop
Choice := First (Choice_List (Assoc));
while Present (Choice) loop
Append_To (Deltas,
Make_Assignment_Statement (Sloc (Choice),
Name =>
Make_Selected_Component (Sloc (Choice),
Prefix => New_Occurrence_Of (Temp, Loc),
Selector_Name => Make_Identifier (Loc, Chars (Choice))),
Expression => New_Copy_Tree (Expression (Assoc))));
Next (Choice);
end loop;
Next (Assoc);
end loop;
Insert_Actions (N, Deltas);
Rewrite (N, New_Occurrence_Of (Temp, Loc));
end Expand_Delta_Record_Aggregate;
----------------------------------
-- Expand_N_Extension_Aggregate --
----------------------------------
-- If the ancestor part is an expression, add a component association for
-- the parent field. If the type of the ancestor part is not the direct
-- parent of the expected type, build recursively the needed ancestors.
-- If the ancestor part is a subtype_mark, replace aggregate with a decla-
-- ration for a temporary of the expected type, followed by individual
-- assignments to the given components.
procedure Expand_N_Extension_Aggregate (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
A : constant Node_Id := Ancestor_Part (N);
Typ : constant Entity_Id := Etype (N);
begin
-- If the ancestor is a subtype mark, an init proc must be called
-- on the resulting object which thus has to be materialized in
-- the front-end
if Is_Entity_Name (A) and then Is_Type (Entity (A)) then
Convert_To_Assignments (N, Typ);
-- The extension aggregate is transformed into a record aggregate
-- of the following form (c1 and c2 are inherited components)
-- (Exp with c3 => a, c4 => b)
-- ==> (c1 => Exp.c1, c2 => Exp.c2, c3 => a, c4 => b)
else
Set_Etype (N, Typ);
if Tagged_Type_Expansion then
Expand_Record_Aggregate (N,
Orig_Tag =>
New_Occurrence_Of
(Node (First_Elmt (Access_Disp_Table (Typ))), Loc),
Parent_Expr => A);
-- No tag is needed in the case of a VM
else
Expand_Record_Aggregate (N, Parent_Expr => A);
end if;
end if;
exception
when RE_Not_Available =>
return;
end Expand_N_Extension_Aggregate;
-----------------------------
-- Expand_Record_Aggregate --
-----------------------------
procedure Expand_Record_Aggregate
(N : Node_Id;
Orig_Tag : Node_Id := Empty;
Parent_Expr : Node_Id := Empty)
is
Loc : constant Source_Ptr := Sloc (N);
Comps : constant List_Id := Component_Associations (N);
Typ : constant Entity_Id := Etype (N);
Base_Typ : constant Entity_Id := Base_Type (Typ);
Static_Components : Boolean := True;
-- Flag to indicate whether all components are compile-time known,
-- and the aggregate can be constructed statically and handled by
-- the back-end.
procedure Build_Back_End_Aggregate;
-- Build a proper aggregate to be handled by the back-end
function Compile_Time_Known_Composite_Value (N : Node_Id) return Boolean;
-- Returns true if N is an expression of composite type which can be
-- fully evaluated at compile time without raising constraint error.
-- Such expressions can be passed as is to Gigi without any expansion.
--
-- This returns true for N_Aggregate with Compile_Time_Known_Aggregate
-- set and constants whose expression is such an aggregate, recursively.
function Component_Not_OK_For_Backend return Boolean;
-- Check for presence of a component which makes it impossible for the
-- backend to process the aggregate, thus requiring the use of a series
-- of assignment statements. Cases checked for are a nested aggregate
-- needing Late_Expansion, the presence of a tagged component which may
-- need tag adjustment, and a bit unaligned component reference.
--
-- We also force expansion into assignments if a component is of a
-- mutable type (including a private type with discriminants) because
-- in that case the size of the component to be copied may be smaller
-- than the side of the target, and there is no simple way for gigi
-- to compute the size of the object to be copied.
--
-- NOTE: This is part of the ongoing work to define precisely the
-- interface between front-end and back-end handling of aggregates.
-- In general it is desirable to pass aggregates as they are to gigi,
-- in order to minimize elaboration code. This is one case where the
-- semantics of Ada complicate the analysis and lead to anomalies in
-- the gcc back-end if the aggregate is not expanded into assignments.
function Has_Per_Object_Constraint (L : List_Id) return Boolean;
-- Return True if any element of L has Has_Per_Object_Constraint set.
-- L should be the Choices component of an N_Component_Association.
function Has_Visible_Private_Ancestor (Id : E) return Boolean;
-- If any ancestor of the current type is private, the aggregate
-- cannot be built in place. We cannot rely on Has_Private_Ancestor,
-- because it will not be set when type and its parent are in the
-- same scope, and the parent component needs expansion.
function Top_Level_Aggregate (N : Node_Id) return Node_Id;
-- For nested aggregates return the ultimate enclosing aggregate; for
-- non-nested aggregates return N.
------------------------------
-- Build_Back_End_Aggregate --
------------------------------
procedure Build_Back_End_Aggregate is
Comp : Entity_Id;
New_Comp : Node_Id;
Tag_Value : Node_Id;
begin
if Nkind (N) = N_Aggregate then
-- If the aggregate is static and can be handled by the back-end,
-- nothing left to do.
if Static_Components then
Set_Compile_Time_Known_Aggregate (N);
Set_Expansion_Delayed (N, False);
end if;
end if;
-- If no discriminants, nothing special to do
if not Has_Discriminants (Typ) then
null;
-- Case of discriminants present
elsif Is_Derived_Type (Typ) then
-- For untagged types, non-stored discriminants are replaced with
-- stored discriminants, which are the ones that gigi uses to
-- describe the type and its components.
Generate_Aggregate_For_Derived_Type : declare
procedure Prepend_Stored_Values (T : Entity_Id);
-- Scan the list of stored discriminants of the type, and add
-- their values to the aggregate being built.
---------------------------
-- Prepend_Stored_Values --
---------------------------
procedure Prepend_Stored_Values (T : Entity_Id) is
Discr : Entity_Id;
First_Comp : Node_Id := Empty;
begin
Discr := First_Stored_Discriminant (T);
while Present (Discr) loop
New_Comp :=
Make_Component_Association (Loc,
Choices => New_List (
New_Occurrence_Of (Discr, Loc)),
Expression =>
New_Copy_Tree
(Get_Discriminant_Value
(Discr,
Typ,
Discriminant_Constraint (Typ))));
if No (First_Comp) then
Prepend_To (Component_Associations (N), New_Comp);
else
Insert_After (First_Comp, New_Comp);
end if;
First_Comp := New_Comp;
Next_Stored_Discriminant (Discr);
end loop;
end Prepend_Stored_Values;
-- Local variables
Constraints : constant List_Id := New_List;
Discr : Entity_Id;
Decl : Node_Id;
Num_Disc : Nat := 0;
Num_Gird : Nat := 0;
-- Start of processing for Generate_Aggregate_For_Derived_Type
begin
-- Remove the associations for the discriminant of derived type
declare
First_Comp : Node_Id;
begin
First_Comp := First (Component_Associations (N));
while Present (First_Comp) loop
Comp := First_Comp;
Next (First_Comp);
if Ekind (Entity (First (Choices (Comp)))) =
E_Discriminant
then
Remove (Comp);
Num_Disc := Num_Disc + 1;
end if;
end loop;
end;
-- Insert stored discriminant associations in the correct
-- order. If there are more stored discriminants than new
-- discriminants, there is at least one new discriminant that
-- constrains more than one of the stored discriminants. In
-- this case we need to construct a proper subtype of the
-- parent type, in order to supply values to all the
-- components. Otherwise there is one-one correspondence
-- between the constraints and the stored discriminants.
Discr := First_Stored_Discriminant (Base_Type (Typ));
while Present (Discr) loop
Num_Gird := Num_Gird + 1;
Next_Stored_Discriminant (Discr);
end loop;
-- Case of more stored discriminants than new discriminants
if Num_Gird > Num_Disc then
-- Create a proper subtype of the parent type, which is the
-- proper implementation type for the aggregate, and convert
-- it to the intended target type.
Discr := First_Stored_Discriminant (Base_Type (Typ));
while Present (Discr) loop
New_Comp :=
New_Copy_Tree
(Get_Discriminant_Value
(Discr,
Typ,
Discriminant_Constraint (Typ)));
Append (New_Comp, Constraints);
Next_Stored_Discriminant (Discr);
end loop;
Decl :=
Make_Subtype_Declaration (Loc,
Defining_Identifier => Make_Temporary (Loc, 'T'),
Subtype_Indication =>
Make_Subtype_Indication (Loc,
Subtype_Mark =>
New_Occurrence_Of (Etype (Base_Type (Typ)), Loc),
Constraint =>
Make_Index_Or_Discriminant_Constraint
(Loc, Constraints)));
Insert_Action (N, Decl);
Prepend_Stored_Values (Base_Type (Typ));
Set_Etype (N, Defining_Identifier (Decl));
Set_Analyzed (N);
Rewrite (N, Unchecked_Convert_To (Typ, N));
Analyze (N);
-- Case where we do not have fewer new discriminants than
-- stored discriminants, so in this case we can simply use the
-- stored discriminants of the subtype.
else
Prepend_Stored_Values (Typ);
end if;
end Generate_Aggregate_For_Derived_Type;
end if;
if Is_Tagged_Type (Typ) then
-- In the tagged case, _parent and _tag component must be created
-- Reset Null_Present unconditionally. Tagged records always have
-- at least one field (the tag or the parent).
Set_Null_Record_Present (N, False);
-- When the current aggregate comes from the expansion of an
-- extension aggregate, the parent expr is replaced by an
-- aggregate formed by selected components of this expr.
if Present (Parent_Expr) and then Is_Empty_List (Comps) then
Comp := First_Component_Or_Discriminant (Typ);
while Present (Comp) loop
-- Skip all expander-generated components
if not Comes_From_Source (Original_Record_Component (Comp))
then
null;
else
New_Comp :=
Make_Selected_Component (Loc,
Prefix =>
Unchecked_Convert_To (Typ,
Duplicate_Subexpr (Parent_Expr, True)),
Selector_Name => New_Occurrence_Of (Comp, Loc));
Append_To (Comps,
Make_Component_Association (Loc,
Choices => New_List (
New_Occurrence_Of (Comp, Loc)),
Expression => New_Comp));
Analyze_And_Resolve (New_Comp, Etype (Comp));
end if;
Next_Component_Or_Discriminant (Comp);
end loop;
end if;
-- Compute the value for the Tag now, if the type is a root it
-- will be included in the aggregate right away, otherwise it will
-- be propagated to the parent aggregate.
if Present (Orig_Tag) then
Tag_Value := Orig_Tag;
elsif not Tagged_Type_Expansion then
Tag_Value := Empty;
else
Tag_Value :=
New_Occurrence_Of
(Node (First_Elmt (Access_Disp_Table (Typ))), Loc);
end if;
-- For a derived type, an aggregate for the parent is formed with
-- all the inherited components.
if Is_Derived_Type (Typ) then
declare
First_Comp : Node_Id;
Parent_Comps : List_Id;
Parent_Aggr : Node_Id;
Parent_Name : Node_Id;
begin
-- Remove the inherited component association from the
-- aggregate and store them in the parent aggregate
First_Comp := First (Component_Associations (N));
Parent_Comps := New_List;
while Present (First_Comp)
and then
Scope (Original_Record_Component
(Entity (First (Choices (First_Comp))))) /=
Base_Typ
loop
Comp := First_Comp;
Next (First_Comp);
Remove (Comp);
Append (Comp, Parent_Comps);
end loop;
Parent_Aggr :=
Make_Aggregate (Loc,
Component_Associations => Parent_Comps);
Set_Etype (Parent_Aggr, Etype (Base_Type (Typ)));
-- Find the _parent component
Comp := First_Component (Typ);
while Chars (Comp) /= Name_uParent loop
Comp := Next_Component (Comp);
end loop;
Parent_Name := New_Occurrence_Of (Comp, Loc);
-- Insert the parent aggregate
Prepend_To (Component_Associations (N),
Make_Component_Association (Loc,
Choices => New_List (Parent_Name),
Expression => Parent_Aggr));
-- Expand recursively the parent propagating the right Tag
Expand_Record_Aggregate
(Parent_Aggr, Tag_Value, Parent_Expr);
-- The ancestor part may be a nested aggregate that has
-- delayed expansion: recheck now.
if Component_Not_OK_For_Backend then
Convert_To_Assignments (N, Typ);
end if;
end;
-- For a root type, the tag component is added (unless compiling
-- for the VMs, where tags are implicit).
elsif Tagged_Type_Expansion then
declare
Tag_Name : constant Node_Id :=
New_Occurrence_Of
(First_Tag_Component (Typ), Loc);
Typ_Tag : constant Entity_Id := RTE (RE_Tag);
Conv_Node : constant Node_Id :=
Unchecked_Convert_To (Typ_Tag, Tag_Value);
begin
Set_Etype (Conv_Node, Typ_Tag);
Prepend_To (Component_Associations (N),
Make_Component_Association (Loc,
Choices => New_List (Tag_Name),
Expression => Conv_Node));
end;
end if;
end if;
end Build_Back_End_Aggregate;
----------------------------------------
-- Compile_Time_Known_Composite_Value --
----------------------------------------
function Compile_Time_Known_Composite_Value
(N : Node_Id) return Boolean
is
begin
-- If we have an entity name, then see if it is the name of a
-- constant and if so, test the corresponding constant value.
if Is_Entity_Name (N) then
declare
E : constant Entity_Id := Entity (N);
V : Node_Id;
begin
if Ekind (E) /= E_Constant then
return False;
else
V := Constant_Value (E);
return Present (V)
and then Compile_Time_Known_Composite_Value (V);
end if;
end;
-- We have a value, see if it is compile time known
else
if Nkind (N) = N_Aggregate then
return Compile_Time_Known_Aggregate (N);
end if;
-- All other types of values are not known at compile time
return False;
end if;
end Compile_Time_Known_Composite_Value;
----------------------------------
-- Component_Not_OK_For_Backend --
----------------------------------
function Component_Not_OK_For_Backend return Boolean is
C : Node_Id;
Expr_Q : Node_Id;
begin
if No (Comps) then
return False;
end if;
C := First (Comps);
while Present (C) loop
-- If the component has box initialization, expansion is needed
-- and component is not ready for backend.
if Box_Present (C) then
return True;
end if;
if Nkind (Expression (C)) = N_Qualified_Expression then
Expr_Q := Expression (Expression (C));
else
Expr_Q := Expression (C);
end if;
-- Return true if the aggregate has any associations for tagged
-- components that may require tag adjustment.
-- These are cases where the source expression may have a tag that
-- could differ from the component tag (e.g., can occur for type
-- conversions and formal parameters). (Tag adjustment not needed
-- if Tagged_Type_Expansion because object tags are implicit in
-- the machine.)
if Is_Tagged_Type (Etype (Expr_Q))
and then (Nkind (Expr_Q) = N_Type_Conversion
or else (Is_Entity_Name (Expr_Q)
and then
Ekind (Entity (Expr_Q)) in Formal_Kind))
and then Tagged_Type_Expansion
then
Static_Components := False;
return True;
elsif Is_Delayed_Aggregate (Expr_Q) then
Static_Components := False;
return True;
elsif Possible_Bit_Aligned_Component (Expr_Q) then
Static_Components := False;
return True;
elsif Modify_Tree_For_C
and then Nkind (C) = N_Component_Association
and then Has_Per_Object_Constraint (Choices (C))
then
Static_Components := False;
return True;
elsif Modify_Tree_For_C
and then Nkind (Expr_Q) = N_Identifier
and then Is_Array_Type (Etype (Expr_Q))
then
Static_Components := False;
return True;
end if;
if Is_Elementary_Type (Etype (Expr_Q)) then
if not Compile_Time_Known_Value (Expr_Q) then
Static_Components := False;
end if;
elsif not Compile_Time_Known_Composite_Value (Expr_Q) then
Static_Components := False;
if Is_Private_Type (Etype (Expr_Q))
and then Has_Discriminants (Etype (Expr_Q))
then
return True;
end if;
end if;
Next (C);
end loop;
return False;
end Component_Not_OK_For_Backend;
-------------------------------
-- Has_Per_Object_Constraint --
-------------------------------
function Has_Per_Object_Constraint (L : List_Id) return Boolean is
N : Node_Id := First (L);
begin
while Present (N) loop
if Is_Entity_Name (N)
and then Present (Entity (N))
and then Has_Per_Object_Constraint (Entity (N))
then
return True;
end if;
Next (N);
end loop;
return False;
end Has_Per_Object_Constraint;
-----------------------------------
-- Has_Visible_Private_Ancestor --
-----------------------------------
function Has_Visible_Private_Ancestor (Id : E) return Boolean is
R : constant Entity_Id := Root_Type (Id);
T1 : Entity_Id := Id;
begin
loop
if Is_Private_Type (T1) then
return True;
elsif T1 = R then
return False;
else
T1 := Etype (T1);
end if;
end loop;
end Has_Visible_Private_Ancestor;
-------------------------
-- Top_Level_Aggregate --
-------------------------
function Top_Level_Aggregate (N : Node_Id) return Node_Id is
Aggr : Node_Id;
begin
Aggr := N;
while Present (Parent (Aggr))
and then Nkind_In (Parent (Aggr), N_Aggregate,
N_Component_Association)
loop
Aggr := Parent (Aggr);
end loop;
return Aggr;
end Top_Level_Aggregate;
-- Local variables
Top_Level_Aggr : constant Node_Id := Top_Level_Aggregate (N);
-- Start of processing for Expand_Record_Aggregate
begin
-- If the aggregate is to be assigned to an atomic/VFA variable, we have
-- to prevent a piecemeal assignment even if the aggregate is to be
-- expanded. We create a temporary for the aggregate, and assign the
-- temporary instead, so that the back end can generate an atomic move
-- for it.
if Is_Atomic_VFA_Aggregate (N) then
return;
-- No special management required for aggregates used to initialize
-- statically allocated dispatch tables
elsif Is_Static_Dispatch_Table_Aggregate (N) then
return;
end if;
-- Ada 2005 (AI-318-2): We need to convert to assignments if components
-- are build-in-place function calls. The assignments will each turn
-- into a build-in-place function call. If components are all static,
-- we can pass the aggregate to the backend regardless of limitedness.
-- Extension aggregates, aggregates in extended return statements, and
-- aggregates for C++ imported types must be expanded.
if Ada_Version >= Ada_2005 and then Is_Limited_View (Typ) then
if not Nkind_In (Parent (N), N_Component_Association,
N_Object_Declaration)
then
Convert_To_Assignments (N, Typ);
elsif Nkind (N) = N_Extension_Aggregate
or else Convention (Typ) = Convention_CPP
then
Convert_To_Assignments (N, Typ);
elsif not Size_Known_At_Compile_Time (Typ)
or else Component_Not_OK_For_Backend
or else not Static_Components
then
Convert_To_Assignments (N, Typ);
-- In all other cases, build a proper aggregate to be handled by
-- the back-end
else
Build_Back_End_Aggregate;
end if;
-- Gigi doesn't properly handle temporaries of variable size so we
-- generate it in the front-end
elsif not Size_Known_At_Compile_Time (Typ)
and then Tagged_Type_Expansion
then
Convert_To_Assignments (N, Typ);
-- An aggregate used to initialize a controlled object must be turned
-- into component assignments as the components themselves may require
-- finalization actions such as adjustment.
elsif Needs_Finalization (Typ) then
Convert_To_Assignments (N, Typ);
-- Ada 2005 (AI-287): In case of default initialized components we
-- convert the aggregate into assignments.
elsif Has_Default_Init_Comps (N) then
Convert_To_Assignments (N, Typ);
-- Check components
elsif Component_Not_OK_For_Backend then
Convert_To_Assignments (N, Typ);
-- If an ancestor is private, some components are not inherited and we
-- cannot expand into a record aggregate.
elsif Has_Visible_Private_Ancestor (Typ) then
Convert_To_Assignments (N, Typ);
-- ??? The following was done to compile fxacc00.ads in the ACVCs. Gigi
-- is not able to handle the aggregate for Late_Request.
elsif Is_Tagged_Type (Typ) and then Has_Discriminants (Typ) then
Convert_To_Assignments (N, Typ);
-- If the tagged types covers interface types we need to initialize all
-- hidden components containing pointers to secondary dispatch tables.
elsif Is_Tagged_Type (Typ) and then Has_Interfaces (Typ) then
Convert_To_Assignments (N, Typ);
-- If some components are mutable, the size of the aggregate component
-- may be distinct from the default size of the type component, so
-- we need to expand to insure that the back-end copies the proper
-- size of the data. However, if the aggregate is the initial value of
-- a constant, the target is immutable and might be built statically
-- if components are appropriate.
elsif Has_Mutable_Components (Typ)
and then
(Nkind (Parent (Top_Level_Aggr)) /= N_Object_Declaration
or else not Constant_Present (Parent (Top_Level_Aggr))
or else not Static_Components)
then
Convert_To_Assignments (N, Typ);
-- If the type involved has bit aligned components, then we are not sure
-- that the back end can handle this case correctly.
elsif Type_May_Have_Bit_Aligned_Components (Typ) then
Convert_To_Assignments (N, Typ);
-- When generating C, only generate an aggregate when declaring objects
-- since C does not support aggregates in e.g. assignment statements.
elsif Modify_Tree_For_C and then not In_Object_Declaration (N) then
Convert_To_Assignments (N, Typ);
-- In all other cases, build a proper aggregate to be handled by gigi
else
Build_Back_End_Aggregate;
end if;
end Expand_Record_Aggregate;
----------------------------
-- Has_Default_Init_Comps --
----------------------------
function Has_Default_Init_Comps (N : Node_Id) return Boolean is
Comps : constant List_Id := Component_Associations (N);
C : Node_Id;
Expr : Node_Id;
begin
pragma Assert (Nkind_In (N, N_Aggregate, N_Extension_Aggregate));
if No (Comps) then
return False;
end if;
if Has_Self_Reference (N) then
return True;
end if;
-- Check if any direct component has default initialized components
C := First (Comps);
while Present (C) loop
if Box_Present (C) then
return True;
end if;
Next (C);
end loop;
-- Recursive call in case of aggregate expression
C := First (Comps);
while Present (C) loop
Expr := Expression (C);
if Present (Expr)
and then Nkind_In (Expr, N_Aggregate, N_Extension_Aggregate)
and then Has_Default_Init_Comps (Expr)
then
return True;
end if;
Next (C);
end loop;
return False;
end Has_Default_Init_Comps;
--------------------------
-- Is_Delayed_Aggregate --
--------------------------
function Is_Delayed_Aggregate (N : Node_Id) return Boolean is
Node : Node_Id := N;
Kind : Node_Kind := Nkind (Node);
begin
if Kind = N_Qualified_Expression then
Node := Expression (Node);
Kind := Nkind (Node);
end if;
if not Nkind_In (Kind, N_Aggregate, N_Extension_Aggregate) then
return False;
else
return Expansion_Delayed (Node);
end if;
end Is_Delayed_Aggregate;
---------------------------
-- In_Object_Declaration --
---------------------------
function In_Object_Declaration (N : Node_Id) return Boolean is
P : Node_Id := Parent (N);
begin
while Present (P) loop
if Nkind (P) = N_Object_Declaration then
return True;
end if;
P := Parent (P);
end loop;
return False;
end In_Object_Declaration;
----------------------------------------
-- Is_Static_Dispatch_Table_Aggregate --
----------------------------------------
function Is_Static_Dispatch_Table_Aggregate (N : Node_Id) return Boolean is
Typ : constant Entity_Id := Base_Type (Etype (N));
begin
return Static_Dispatch_Tables
and then Tagged_Type_Expansion
and then RTU_Loaded (Ada_Tags)
-- Avoid circularity when rebuilding the compiler
and then Cunit_Entity (Get_Source_Unit (N)) /= RTU_Entity (Ada_Tags)
and then (Typ = RTE (RE_Dispatch_Table_Wrapper)
or else
Typ = RTE (RE_Address_Array)
or else
Typ = RTE (RE_Type_Specific_Data)
or else
Typ = RTE (RE_Tag_Table)
or else
(RTE_Available (RE_Interface_Data)
and then Typ = RTE (RE_Interface_Data))
or else
(RTE_Available (RE_Interfaces_Array)
and then Typ = RTE (RE_Interfaces_Array))
or else
(RTE_Available (RE_Interface_Data_Element)
and then Typ = RTE (RE_Interface_Data_Element)));
end Is_Static_Dispatch_Table_Aggregate;
-----------------------------
-- Is_Two_Dim_Packed_Array --
-----------------------------
function Is_Two_Dim_Packed_Array (Typ : Entity_Id) return Boolean is
C : constant Int := UI_To_Int (Component_Size (Typ));
begin
return Number_Dimensions (Typ) = 2
and then Is_Bit_Packed_Array (Typ)
and then (C = 1 or else C = 2 or else C = 4);
end Is_Two_Dim_Packed_Array;
--------------------
-- Late_Expansion --
--------------------
function Late_Expansion
(N : Node_Id;
Typ : Entity_Id;
Target : Node_Id) return List_Id
is
Aggr_Code : List_Id;
begin
if Is_Array_Type (Etype (N)) then
Aggr_Code :=
Build_Array_Aggr_Code
(N => N,
Ctype => Component_Type (Etype (N)),
Index => First_Index (Typ),
Into => Target,
Scalar_Comp => Is_Scalar_Type (Component_Type (Typ)),
Indexes => No_List);
-- Directly or indirectly (e.g. access protected procedure) a record
else
Aggr_Code := Build_Record_Aggr_Code (N, Typ, Target);
end if;
-- Save the last assignment statement associated with the aggregate
-- when building a controlled object. This reference is utilized by
-- the finalization machinery when marking an object as successfully
-- initialized.
if Needs_Finalization (Typ)
and then Is_Entity_Name (Target)
and then Present (Entity (Target))
and then Ekind_In (Entity (Target), E_Constant, E_Variable)
then
Set_Last_Aggregate_Assignment (Entity (Target), Last (Aggr_Code));
end if;
return Aggr_Code;
end Late_Expansion;
----------------------------------
-- Make_OK_Assignment_Statement --
----------------------------------
function Make_OK_Assignment_Statement
(Sloc : Source_Ptr;
Name : Node_Id;
Expression : Node_Id) return Node_Id
is
begin
Set_Assignment_OK (Name);
return Make_Assignment_Statement (Sloc, Name, Expression);
end Make_OK_Assignment_Statement;
-----------------------
-- Number_Of_Choices --
-----------------------
function Number_Of_Choices (N : Node_Id) return Nat is
Assoc : Node_Id;
Choice : Node_Id;
Nb_Choices : Nat := 0;
begin
if Present (Expressions (N)) then
return 0;
end if;
Assoc := First (Component_Associations (N));
while Present (Assoc) loop
Choice := First (Choice_List (Assoc));
while Present (Choice) loop
if Nkind (Choice) /= N_Others_Choice then
Nb_Choices := Nb_Choices + 1;
end if;
Next (Choice);
end loop;
Next (Assoc);
end loop;
return Nb_Choices;
end Number_Of_Choices;
------------------------------------
-- Packed_Array_Aggregate_Handled --
------------------------------------
-- The current version of this procedure will handle at compile time
-- any array aggregate that meets these conditions:
-- One and two dimensional, bit packed
-- Underlying packed type is modular type
-- Bounds are within 32-bit Int range
-- All bounds and values are static
-- Note: for now, in the 2-D case, we only handle component sizes of
-- 1, 2, 4 (cases where an integral number of elements occupies a byte).
function Packed_Array_Aggregate_Handled (N : Node_Id) return Boolean is
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
Ctyp : constant Entity_Id := Component_Type (Typ);
Not_Handled : exception;
-- Exception raised if this aggregate cannot be handled
begin
-- Handle one- or two dimensional bit packed array
if not Is_Bit_Packed_Array (Typ)
or else Number_Dimensions (Typ) > 2
then
return False;
end if;
-- If two-dimensional, check whether it can be folded, and transformed
-- into a one-dimensional aggregate for the Packed_Array_Impl_Type of
-- the original type.
if Number_Dimensions (Typ) = 2 then
return Two_Dim_Packed_Array_Handled (N);
end if;
if not Is_Modular_Integer_Type (Packed_Array_Impl_Type (Typ)) then
return False;
end if;
if not Is_Scalar_Type (Component_Type (Typ))
and then Has_Non_Standard_Rep (Component_Type (Typ))
then
return False;
end if;
declare
Csiz : constant Nat := UI_To_Int (Component_Size (Typ));
Lo : Node_Id;
Hi : Node_Id;
-- Bounds of index type
Lob : Uint;
Hib : Uint;
-- Values of bounds if compile time known
function Get_Component_Val (N : Node_Id) return Uint;
-- Given a expression value N of the component type Ctyp, returns a
-- value of Csiz (component size) bits representing this value. If
-- the value is non-static or any other reason exists why the value
-- cannot be returned, then Not_Handled is raised.
-----------------------
-- Get_Component_Val --
-----------------------
function Get_Component_Val (N : Node_Id) return Uint is
Val : Uint;
begin
-- We have to analyze the expression here before doing any further
-- processing here. The analysis of such expressions is deferred
-- till expansion to prevent some problems of premature analysis.
Analyze_And_Resolve (N, Ctyp);
-- Must have a compile time value. String literals have to be
-- converted into temporaries as well, because they cannot easily
-- be converted into their bit representation.
if not Compile_Time_Known_Value (N)
or else Nkind (N) = N_String_Literal
then
raise Not_Handled;
end if;
Val := Expr_Rep_Value (N);
-- Adjust for bias, and strip proper number of bits
if Has_Biased_Representation (Ctyp) then
Val := Val - Expr_Value (Type_Low_Bound (Ctyp));
end if;
return Val mod Uint_2 ** Csiz;
end Get_Component_Val;
-- Here we know we have a one dimensional bit packed array
begin
Get_Index_Bounds (First_Index (Typ), Lo, Hi);
-- Cannot do anything if bounds are dynamic
if not Compile_Time_Known_Value (Lo)
or else
not Compile_Time_Known_Value (Hi)
then
return False;
end if;
-- Or are silly out of range of int bounds
Lob := Expr_Value (Lo);
Hib := Expr_Value (Hi);
if not UI_Is_In_Int_Range (Lob)
or else
not UI_Is_In_Int_Range (Hib)
then
return False;
end if;
-- At this stage we have a suitable aggregate for handling at compile
-- time. The only remaining checks are that the values of expressions
-- in the aggregate are compile-time known (checks are performed by
-- Get_Component_Val), and that any subtypes or ranges are statically
-- known.
-- If the aggregate is not fully positional at this stage, then
-- convert it to positional form. Either this will fail, in which
-- case we can do nothing, or it will succeed, in which case we have
-- succeeded in handling the aggregate and transforming it into a
-- modular value, or it will stay an aggregate, in which case we
-- have failed to create a packed value for it.
if Present (Component_Associations (N)) then
Convert_To_Positional
(N, Max_Others_Replicate => 64, Handle_Bit_Packed => True);
return Nkind (N) /= N_Aggregate;
end if;
-- Otherwise we are all positional, so convert to proper value
declare
Lov : constant Int := UI_To_Int (Lob);
Hiv : constant Int := UI_To_Int (Hib);
Len : constant Nat := Int'Max (0, Hiv - Lov + 1);
-- The length of the array (number of elements)
Aggregate_Val : Uint;
-- Value of aggregate. The value is set in the low order bits of
-- this value. For the little-endian case, the values are stored
-- from low-order to high-order and for the big-endian case the
-- values are stored from high-order to low-order. Note that gigi
-- will take care of the conversions to left justify the value in
-- the big endian case (because of left justified modular type
-- processing), so we do not have to worry about that here.
Lit : Node_Id;
-- Integer literal for resulting constructed value
Shift : Nat;
-- Shift count from low order for next value
Incr : Int;
-- Shift increment for loop
Expr : Node_Id;
-- Next expression from positional parameters of aggregate
Left_Justified : Boolean;
-- Set True if we are filling the high order bits of the target
-- value (i.e. the value is left justified).
begin
-- For little endian, we fill up the low order bits of the target
-- value. For big endian we fill up the high order bits of the
-- target value (which is a left justified modular value).
Left_Justified := Bytes_Big_Endian;
-- Switch justification if using -gnatd8
if Debug_Flag_8 then
Left_Justified := not Left_Justified;
end if;
-- Switch justfification if reverse storage order
if Reverse_Storage_Order (Base_Type (Typ)) then
Left_Justified := not Left_Justified;
end if;
if Left_Justified then
Shift := Csiz * (Len - 1);
Incr := -Csiz;
else
Shift := 0;
Incr := +Csiz;
end if;
-- Loop to set the values
if Len = 0 then
Aggregate_Val := Uint_0;
else
Expr := First (Expressions (N));
Aggregate_Val := Get_Component_Val (Expr) * Uint_2 ** Shift;
for J in 2 .. Len loop
Shift := Shift + Incr;
Next (Expr);
Aggregate_Val :=
Aggregate_Val + Get_Component_Val (Expr) * Uint_2 ** Shift;
end loop;
end if;
-- Now we can rewrite with the proper value
Lit := Make_Integer_Literal (Loc, Intval => Aggregate_Val);
Set_Print_In_Hex (Lit);
-- Construct the expression using this literal. Note that it is
-- important to qualify the literal with its proper modular type
-- since universal integer does not have the required range and
-- also this is a left justified modular type, which is important
-- in the big-endian case.
Rewrite (N,
Unchecked_Convert_To (Typ,
Make_Qualified_Expression (Loc,
Subtype_Mark =>
New_Occurrence_Of (Packed_Array_Impl_Type (Typ), Loc),
Expression => Lit)));
Analyze_And_Resolve (N, Typ);
return True;
end;
end;
exception
when Not_Handled =>
return False;
end Packed_Array_Aggregate_Handled;
----------------------------
-- Has_Mutable_Components --
----------------------------
function Has_Mutable_Components (Typ : Entity_Id) return Boolean is
Comp : Entity_Id;
begin
Comp := First_Component (Typ);
while Present (Comp) loop
if Is_Record_Type (Etype (Comp))
and then Has_Discriminants (Etype (Comp))
and then not Is_Constrained (Etype (Comp))
then
return True;
end if;
Next_Component (Comp);
end loop;
return False;
end Has_Mutable_Components;
------------------------------
-- Initialize_Discriminants --
------------------------------
procedure Initialize_Discriminants (N : Node_Id; Typ : Entity_Id) is
Loc : constant Source_Ptr := Sloc (N);
Bas : constant Entity_Id := Base_Type (Typ);
Par : constant Entity_Id := Etype (Bas);
Decl : constant Node_Id := Parent (Par);
Ref : Node_Id;
begin
if Is_Tagged_Type (Bas)
and then Is_Derived_Type (Bas)
and then Has_Discriminants (Par)
and then Has_Discriminants (Bas)
and then Number_Discriminants (Bas) /= Number_Discriminants (Par)
and then Nkind (Decl) = N_Full_Type_Declaration
and then Nkind (Type_Definition (Decl)) = N_Record_Definition
and then
Present (Variant_Part (Component_List (Type_Definition (Decl))))
and then Nkind (N) /= N_Extension_Aggregate
then
-- Call init proc to set discriminants.
-- There should eventually be a special procedure for this ???
Ref := New_Occurrence_Of (Defining_Identifier (N), Loc);
Insert_Actions_After (N,
Build_Initialization_Call (Sloc (N), Ref, Typ));
end if;
end Initialize_Discriminants;
----------------
-- Must_Slide --
----------------
function Must_Slide
(Obj_Type : Entity_Id;
Typ : Entity_Id) return Boolean
is
L1, L2, H1, H2 : Node_Id;
begin
-- No sliding if the type of the object is not established yet, if it is
-- an unconstrained type whose actual subtype comes from the aggregate,
-- or if the two types are identical.
if not Is_Array_Type (Obj_Type) then
return False;
elsif not Is_Constrained (Obj_Type) then
return False;
elsif Typ = Obj_Type then
return False;
else
-- Sliding can only occur along the first dimension
Get_Index_Bounds (First_Index (Typ), L1, H1);
Get_Index_Bounds (First_Index (Obj_Type), L2, H2);
if not Is_OK_Static_Expression (L1) or else
not Is_OK_Static_Expression (L2) or else
not Is_OK_Static_Expression (H1) or else
not Is_OK_Static_Expression (H2)
then
return False;
else
return Expr_Value (L1) /= Expr_Value (L2)
or else
Expr_Value (H1) /= Expr_Value (H2);
end if;
end if;
end Must_Slide;
---------------------------------
-- Process_Transient_Component --
---------------------------------
procedure Process_Transient_Component
(Loc : Source_Ptr;
Comp_Typ : Entity_Id;
Init_Expr : Node_Id;
Fin_Call : out Node_Id;
Hook_Clear : out Node_Id;
Aggr : Node_Id := Empty;
Stmts : List_Id := No_List)
is
procedure Add_Item (Item : Node_Id);
-- Insert arbitrary node Item into the tree depending on the values of
-- Aggr and Stmts.
--------------
-- Add_Item --
--------------
procedure Add_Item (Item : Node_Id) is
begin
if Present (Aggr) then
Insert_Action (Aggr, Item);
else
pragma Assert (Present (Stmts));
Append_To (Stmts, Item);
end if;
end Add_Item;
-- Local variables
Hook_Assign : Node_Id;
Hook_Decl : Node_Id;
Ptr_Decl : Node_Id;
Res_Decl : Node_Id;
Res_Id : Entity_Id;
Res_Typ : Entity_Id;
-- Start of processing for Process_Transient_Component
begin
-- Add the access type, which provides a reference to the function
-- result. Generate:
-- type Res_Typ is access all Comp_Typ;
Res_Typ := Make_Temporary (Loc, 'A');
Set_Ekind (Res_Typ, E_General_Access_Type);
Set_Directly_Designated_Type (Res_Typ, Comp_Typ);
Add_Item
(Make_Full_Type_Declaration (Loc,
Defining_Identifier => Res_Typ,
Type_Definition =>
Make_Access_To_Object_Definition (Loc,
All_Present => True,
Subtype_Indication => New_Occurrence_Of (Comp_Typ, Loc))));
-- Add the temporary which captures the result of the function call.
-- Generate:
-- Res : constant Res_Typ := Init_Expr'Reference;
-- Note that this temporary is effectively a transient object because
-- its lifetime is bounded by the current array or record component.
Res_Id := Make_Temporary (Loc, 'R');
Set_Ekind (Res_Id, E_Constant);
Set_Etype (Res_Id, Res_Typ);
-- Mark the transient object as successfully processed to avoid double
-- finalization.
Set_Is_Finalized_Transient (Res_Id);
-- Signal the general finalization machinery that this transient object
-- should not be considered for finalization actions because its cleanup
-- will be performed by Process_Transient_Component_Completion.
Set_Is_Ignored_Transient (Res_Id);
Res_Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Res_Id,
Constant_Present => True,
Object_Definition => New_Occurrence_Of (Res_Typ, Loc),
Expression =>
Make_Reference (Loc, New_Copy_Tree (Init_Expr)));
Add_Item (Res_Decl);
-- Construct all pieces necessary to hook and finalize the transient
-- result.
Build_Transient_Object_Statements
(Obj_Decl => Res_Decl,
Fin_Call => Fin_Call,
Hook_Assign => Hook_Assign,
Hook_Clear => Hook_Clear,
Hook_Decl => Hook_Decl,
Ptr_Decl => Ptr_Decl);
-- Add the access type which provides a reference to the transient
-- result. Generate:
-- type Ptr_Typ is access all Comp_Typ;
Add_Item (Ptr_Decl);
-- Add the temporary which acts as a hook to the transient result.
-- Generate:
-- Hook : Ptr_Typ := null;
Add_Item (Hook_Decl);
-- Attach the transient result to the hook. Generate:
-- Hook := Ptr_Typ (Res);
Add_Item (Hook_Assign);
-- The original initialization expression now references the value of
-- the temporary function result. Generate:
-- Res.all
Rewrite (Init_Expr,
Make_Explicit_Dereference (Loc,
Prefix => New_Occurrence_Of (Res_Id, Loc)));
end Process_Transient_Component;
--------------------------------------------
-- Process_Transient_Component_Completion --
--------------------------------------------
procedure Process_Transient_Component_Completion
(Loc : Source_Ptr;
Aggr : Node_Id;
Fin_Call : Node_Id;
Hook_Clear : Node_Id;
Stmts : List_Id)
is
Exceptions_OK : constant Boolean :=
not Restriction_Active (No_Exception_Propagation);
begin
pragma Assert (Present (Hook_Clear));
-- Generate the following code if exception propagation is allowed:
-- declare
-- Abort : constant Boolean := Triggered_By_Abort;
-- <or>
-- Abort : constant Boolean := False; -- no abort
-- E : Exception_Occurrence;
-- Raised : Boolean := False;
-- begin
-- [Abort_Defer;]
-- begin
-- Hook := null;
-- [Deep_]Finalize (Res.all);
-- exception
-- when others =>
-- if not Raised then
-- Raised := True;
-- Save_Occurrence (E,
-- Get_Curent_Excep.all.all);
-- end if;
-- end;
-- [Abort_Undefer;]
-- if Raised and then not Abort then
-- Raise_From_Controlled_Operation (E);
-- end if;
-- end;
if Exceptions_OK then
Abort_And_Exception : declare
Blk_Decls : constant List_Id := New_List;
Blk_Stmts : constant List_Id := New_List;
Fin_Stmts : constant List_Id := New_List;
Fin_Data : Finalization_Exception_Data;
begin
-- Create the declarations of the two flags and the exception
-- occurrence.
Build_Object_Declarations (Fin_Data, Blk_Decls, Loc);
-- Generate:
-- Abort_Defer;
if Abort_Allowed then
Append_To (Blk_Stmts,
Build_Runtime_Call (Loc, RE_Abort_Defer));
end if;
-- Wrap the hook clear and the finalization call in order to trap
-- a potential exception.
Append_To (Fin_Stmts, Hook_Clear);
if Present (Fin_Call) then
Append_To (Fin_Stmts, Fin_Call);
end if;
Append_To (Blk_Stmts,
Make_Block_Statement (Loc,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => Fin_Stmts,
Exception_Handlers => New_List (
Build_Exception_Handler (Fin_Data)))));
-- Generate:
-- Abort_Undefer;
if Abort_Allowed then
Append_To (Blk_Stmts,
Build_Runtime_Call (Loc, RE_Abort_Undefer));
end if;
-- Reraise the potential exception with a proper "upgrade" to
-- Program_Error if needed.
Append_To (Blk_Stmts, Build_Raise_Statement (Fin_Data));
-- Wrap everything in a block
Append_To (Stmts,
Make_Block_Statement (Loc,
Declarations => Blk_Decls,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => Blk_Stmts)));
end Abort_And_Exception;
-- Generate the following code if exception propagation is not allowed
-- and aborts are allowed:
-- begin
-- Abort_Defer;
-- Hook := null;
-- [Deep_]Finalize (Res.all);
-- at end
-- Abort_Undefer_Direct;
-- end;
elsif Abort_Allowed then
Abort_Only : declare
Blk_Stmts : constant List_Id := New_List;
begin
Append_To (Blk_Stmts, Build_Runtime_Call (Loc, RE_Abort_Defer));
Append_To (Blk_Stmts, Hook_Clear);
if Present (Fin_Call) then
Append_To (Blk_Stmts, Fin_Call);
end if;
Append_To (Stmts,
Build_Abort_Undefer_Block (Loc,
Stmts => Blk_Stmts,
Context => Aggr));
end Abort_Only;
-- Otherwise generate:
-- Hook := null;
-- [Deep_]Finalize (Res.all);
else
Append_To (Stmts, Hook_Clear);
if Present (Fin_Call) then
Append_To (Stmts, Fin_Call);
end if;
end if;
end Process_Transient_Component_Completion;
---------------------
-- Sort_Case_Table --
---------------------
procedure Sort_Case_Table (Case_Table : in out Case_Table_Type) is
L : constant Int := Case_Table'First;
U : constant Int := Case_Table'Last;
K : Int;
J : Int;
T : Case_Bounds;
begin
K := L;
while K /= U loop
T := Case_Table (K + 1);
J := K + 1;
while J /= L
and then Expr_Value (Case_Table (J - 1).Choice_Lo) >
Expr_Value (T.Choice_Lo)
loop
Case_Table (J) := Case_Table (J - 1);
J := J - 1;
end loop;
Case_Table (J) := T;
K := K + 1;
end loop;
end Sort_Case_Table;
----------------------------
-- Static_Array_Aggregate --
----------------------------
function Static_Array_Aggregate (N : Node_Id) return Boolean is
Bounds : constant Node_Id := Aggregate_Bounds (N);
Typ : constant Entity_Id := Etype (N);
Comp_Type : constant Entity_Id := Component_Type (Typ);
Agg : Node_Id;
Expr : Node_Id;
Lo : Node_Id;
Hi : Node_Id;
begin
if Is_Tagged_Type (Typ)
or else Is_Controlled (Typ)
or else Is_Packed (Typ)
then
return False;
end if;
if Present (Bounds)
and then Nkind (Bounds) = N_Range
and then Nkind (Low_Bound (Bounds)) = N_Integer_Literal
and then Nkind (High_Bound (Bounds)) = N_Integer_Literal
then
Lo := Low_Bound (Bounds);
Hi := High_Bound (Bounds);
if No (Component_Associations (N)) then
-- Verify that all components are static integers
Expr := First (Expressions (N));
while Present (Expr) loop
if Nkind (Expr) /= N_Integer_Literal then
return False;
end if;
Next (Expr);
end loop;
return True;
else
-- We allow only a single named association, either a static
-- range or an others_clause, with a static expression.
Expr := First (Component_Associations (N));
if Present (Expressions (N)) then
return False;
elsif Present (Next (Expr)) then
return False;
elsif Present (Next (First (Choice_List (Expr)))) then
return False;
else
-- The aggregate is static if all components are literals,
-- or else all its components are static aggregates for the
-- component type. We also limit the size of a static aggregate
-- to prevent runaway static expressions.
if Is_Array_Type (Comp_Type)
or else Is_Record_Type (Comp_Type)
then
if Nkind (Expression (Expr)) /= N_Aggregate
or else
not Compile_Time_Known_Aggregate (Expression (Expr))
then
return False;
end if;
elsif Nkind (Expression (Expr)) /= N_Integer_Literal then
return False;
end if;
if not Aggr_Size_OK (N, Typ) then
return False;
end if;
-- Create a positional aggregate with the right number of
-- copies of the expression.
Agg := Make_Aggregate (Sloc (N), New_List, No_List);
for I in UI_To_Int (Intval (Lo)) .. UI_To_Int (Intval (Hi))
loop
Append_To (Expressions (Agg), New_Copy (Expression (Expr)));
-- The copied expression must be analyzed and resolved.
-- Besides setting the type, this ensures that static
-- expressions are appropriately marked as such.
Analyze_And_Resolve
(Last (Expressions (Agg)), Component_Type (Typ));
end loop;
Set_Aggregate_Bounds (Agg, Bounds);
Set_Etype (Agg, Typ);
Set_Analyzed (Agg);
Rewrite (N, Agg);
Set_Compile_Time_Known_Aggregate (N);
return True;
end if;
end if;
else
return False;
end if;
end Static_Array_Aggregate;
----------------------------------
-- Two_Dim_Packed_Array_Handled --
----------------------------------
function Two_Dim_Packed_Array_Handled (N : Node_Id) return Boolean is
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
Ctyp : constant Entity_Id := Component_Type (Typ);
Comp_Size : constant Int := UI_To_Int (Component_Size (Typ));
Packed_Array : constant Entity_Id :=
Packed_Array_Impl_Type (Base_Type (Typ));
One_Comp : Node_Id;
-- Expression in original aggregate
One_Dim : Node_Id;
-- One-dimensional subaggregate
begin
-- For now, only deal with cases where an integral number of elements
-- fit in a single byte. This includes the most common boolean case.
if not (Comp_Size = 1 or else
Comp_Size = 2 or else
Comp_Size = 4)
then
return False;
end if;
Convert_To_Positional
(N, Max_Others_Replicate => 64, Handle_Bit_Packed => True);
-- Verify that all components are static
if Nkind (N) = N_Aggregate
and then Compile_Time_Known_Aggregate (N)
then
null;
-- The aggregate may have been reanalyzed and converted already
elsif Nkind (N) /= N_Aggregate then
return True;
-- If component associations remain, the aggregate is not static
elsif Present (Component_Associations (N)) then
return False;
else
One_Dim := First (Expressions (N));
while Present (One_Dim) loop
if Present (Component_Associations (One_Dim)) then
return False;
end if;
One_Comp := First (Expressions (One_Dim));
while Present (One_Comp) loop
if not Is_OK_Static_Expression (One_Comp) then
return False;
end if;
Next (One_Comp);
end loop;
Next (One_Dim);
end loop;
end if;
-- Two-dimensional aggregate is now fully positional so pack one
-- dimension to create a static one-dimensional array, and rewrite
-- as an unchecked conversion to the original type.
declare
Byte_Size : constant Int := UI_To_Int (Component_Size (Packed_Array));
-- The packed array type is a byte array
Packed_Num : Nat;
-- Number of components accumulated in current byte
Comps : List_Id;
-- Assembled list of packed values for equivalent aggregate
Comp_Val : Uint;
-- Integer value of component
Incr : Int;
-- Step size for packing
Init_Shift : Int;
-- Endian-dependent start position for packing
Shift : Int;
-- Current insertion position
Val : Int;
-- Component of packed array being assembled
begin
Comps := New_List;
Val := 0;
Packed_Num := 0;
-- Account for endianness. See corresponding comment in
-- Packed_Array_Aggregate_Handled concerning the following.
if Bytes_Big_Endian
xor Debug_Flag_8
xor Reverse_Storage_Order (Base_Type (Typ))
then
Init_Shift := Byte_Size - Comp_Size;
Incr := -Comp_Size;
else
Init_Shift := 0;
Incr := +Comp_Size;
end if;
-- Iterate over each subaggregate
Shift := Init_Shift;
One_Dim := First (Expressions (N));
while Present (One_Dim) loop
One_Comp := First (Expressions (One_Dim));
while Present (One_Comp) loop
if Packed_Num = Byte_Size / Comp_Size then
-- Byte is complete, add to list of expressions
Append (Make_Integer_Literal (Sloc (One_Dim), Val), Comps);
Val := 0;
Shift := Init_Shift;
Packed_Num := 0;
else
Comp_Val := Expr_Rep_Value (One_Comp);
-- Adjust for bias, and strip proper number of bits
if Has_Biased_Representation (Ctyp) then
Comp_Val := Comp_Val - Expr_Value (Type_Low_Bound (Ctyp));
end if;
Comp_Val := Comp_Val mod Uint_2 ** Comp_Size;
Val := UI_To_Int (Val + Comp_Val * Uint_2 ** Shift);
Shift := Shift + Incr;
One_Comp := Next (One_Comp);
Packed_Num := Packed_Num + 1;
end if;
end loop;
One_Dim := Next (One_Dim);
end loop;
if Packed_Num > 0 then
-- Add final incomplete byte if present
Append (Make_Integer_Literal (Sloc (One_Dim), Val), Comps);
end if;
Rewrite (N,
Unchecked_Convert_To (Typ,
Make_Qualified_Expression (Loc,
Subtype_Mark => New_Occurrence_Of (Packed_Array, Loc),
Expression => Make_Aggregate (Loc, Expressions => Comps))));
Analyze_And_Resolve (N);
return True;
end;
end Two_Dim_Packed_Array_Handled;
end Exp_Aggr;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000,2004 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
-- $Revision: 1.4 $
-- $Date: 2004/08/21 21:37:00 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
with Terminal_Interface.Curses.Panels.User_Data;
with ncurses2.genericPuts;
procedure ncurses2.demo_panels (nap_mseci : Integer) is
use Int_IO;
function mkpanel (color : Color_Number;
rows : Line_Count;
cols : Column_Count;
tly : Line_Position;
tlx : Column_Position) return Panel;
procedure rmpanel (pan : in out Panel);
procedure pflush;
procedure wait_a_while (msec : Integer);
procedure saywhat (text : String);
procedure fill_panel (pan : Panel);
nap_msec : Integer := nap_mseci;
function mkpanel (color : Color_Number;
rows : Line_Count;
cols : Column_Count;
tly : Line_Position;
tlx : Column_Position) return Panel is
win : Window;
pan : Panel := Null_Panel;
begin
win := New_Window (rows, cols, tly, tlx);
if Null_Window /= win then
pan := New_Panel (win);
if pan = Null_Panel then
Delete (win);
elsif Has_Colors then
declare
fg, bg : Color_Number;
begin
if color = Blue then
fg := White;
else
fg := Black;
end if;
bg := color;
Init_Pair (Color_Pair (color), fg, bg);
Set_Background (win, (Ch => ' ',
Attr => Normal_Video,
Color => Color_Pair (color)));
end;
else
Set_Background (win, (Ch => ' ',
Attr => (Bold_Character => True,
others => False),
Color => Color_Pair (color)));
end if;
end if;
return pan;
end mkpanel;
procedure rmpanel (pan : in out Panel) is
win : Window := Panel_Window (pan);
begin
Delete (pan);
Delete (win);
end rmpanel;
procedure pflush is
begin
Update_Panels;
Update_Screen;
end pflush;
procedure wait_a_while (msec : Integer) is
begin
-- The C version had some #ifdef blocks here
if msec = 1 then
Getchar;
else
Nap_Milli_Seconds (msec);
end if;
end wait_a_while;
procedure saywhat (text : String) is
begin
Move_Cursor (Line => Lines - 1, Column => 0);
Clear_To_End_Of_Line;
Add (Str => text);
end saywhat;
-- from sample-curses_demo.adb
type User_Data is new String (1 .. 2);
type User_Data_Access is access all User_Data;
package PUD is new Panels.User_Data (User_Data, User_Data_Access);
use PUD;
procedure fill_panel (pan : Panel) is
win : constant Window := Panel_Window (pan);
num : constant Character := Get_User_Data (pan) (2);
tmp6 : String (1 .. 6) := "-panx-";
maxy : Line_Count;
maxx : Column_Count;
begin
Move_Cursor (win, 1, 1);
tmp6 (5) := num;
Add (win, Str => tmp6);
Clear_To_End_Of_Line (win);
Box (win);
Get_Size (win, maxy, maxx);
for y in 2 .. maxy - 2 loop
for x in 1 .. maxx - 2 loop
Move_Cursor (win, y, x);
Add (win, num);
end loop;
end loop;
end fill_panel;
modstr : constant array (0 .. 5) of String (1 .. 5) :=
("test ",
"TEST ",
"(**) ",
"*()* ",
"<--> ",
"LAST "
);
package p is new ncurses2.genericPuts (1024);
use p;
use p.BS;
-- the C version said register int y, x;
tmpb : BS.Bounded_String;
begin
Refresh;
for y in 0 .. Integer (Lines - 2) loop
for x in 0 .. Integer (Columns - 1) loop
myPut (tmpb, (y + x) mod 10);
myAdd (Str => tmpb);
end loop;
end loop;
for y in 0 .. 4 loop
declare
p1, p2, p3, p4, p5 : Panel;
U1 : constant User_Data_Access := new User_Data'("p1");
U2 : constant User_Data_Access := new User_Data'("p2");
U3 : constant User_Data_Access := new User_Data'("p3");
U4 : constant User_Data_Access := new User_Data'("p4");
U5 : constant User_Data_Access := new User_Data'("p5");
begin
p1 := mkpanel (Red, Lines / 2 - 2, Columns / 8 + 1, 0, 0);
Set_User_Data (p1, U1);
p2 := mkpanel (Green, Lines / 2 + 1, Columns / 7, Lines / 4,
Columns / 10);
Set_User_Data (p2, U2);
p3 := mkpanel (Yellow, Lines / 4, Columns / 10, Lines / 2,
Columns / 9);
Set_User_Data (p3, U3);
p4 := mkpanel (Blue, Lines / 2 - 2, Columns / 8, Lines / 2 - 2,
Columns / 3);
Set_User_Data (p4, U4);
p5 := mkpanel (Magenta, Lines / 2 - 2, Columns / 8, Lines / 2,
Columns / 2 - 2);
Set_User_Data (p5, U5);
fill_panel (p1);
fill_panel (p2);
fill_panel (p3);
fill_panel (p4);
fill_panel (p5);
Hide (p4);
Hide (p5);
pflush;
saywhat ("press any key to continue");
wait_a_while (nap_msec);
saywhat ("h3 s1 s2 s4 s5; press any key to continue");
Move (p1, 0, 0);
Hide (p3);
Show (p1);
Show (p2);
Show (p4);
Show (p5);
pflush;
wait_a_while (nap_msec);
saywhat ("s1; press any key to continue");
Show (p1);
pflush;
wait_a_while (nap_msec);
saywhat ("s2; press any key to continue");
Show (p2);
pflush;
wait_a_while (nap_msec);
saywhat ("m2; press any key to continue");
Move (p2, Lines / 3 + 1, Columns / 8);
pflush;
wait_a_while (nap_msec);
saywhat ("s3;");
Show (p3);
pflush;
wait_a_while (nap_msec);
saywhat ("m3; press any key to continue");
Move (p3, Lines / 4 + 1, Columns / 15);
pflush;
wait_a_while (nap_msec);
saywhat ("b3; press any key to continue");
Bottom (p3);
pflush;
wait_a_while (nap_msec);
saywhat ("s4; press any key to continue");
Show (p4);
pflush;
wait_a_while (nap_msec);
saywhat ("s5; press any key to continue");
Show (p5);
pflush;
wait_a_while (nap_msec);
saywhat ("t3; press any key to continue");
Top (p3);
pflush;
wait_a_while (nap_msec);
saywhat ("t1; press any key to continue");
Top (p1);
pflush;
wait_a_while (nap_msec);
saywhat ("t2; press any key to continue");
Top (p2);
pflush;
wait_a_while (nap_msec);
saywhat ("t3; press any key to continue");
Top (p3);
pflush;
wait_a_while (nap_msec);
saywhat ("t4; press any key to continue");
Top (p4);
pflush;
wait_a_while (nap_msec);
for itmp in 0 .. 5 loop
declare
w4 : constant Window := Panel_Window (p4);
w5 : constant Window := Panel_Window (p5);
begin
saywhat ("m4; press any key to continue");
Move_Cursor (w4, Lines / 8, 1);
Add (w4, modstr (itmp));
Move (p4, Lines / 6, Column_Position (itmp) * (Columns / 8));
Move_Cursor (w5, Lines / 6, 1);
Add (w5, modstr (itmp));
pflush;
wait_a_while (nap_msec);
saywhat ("m5; press any key to continue");
Move_Cursor (w4, Lines / 6, 1);
Add (w4, modstr (itmp));
Move (p5, Lines / 3 - 1, (Column_Position (itmp) * 10) + 6);
Move_Cursor (w5, Lines / 8, 1);
Add (w5, modstr (itmp));
pflush;
wait_a_while (nap_msec);
end;
end loop;
saywhat ("m4; press any key to continue");
Move (p4, Lines / 6, 6 * (Columns / 8));
-- Move(p4, Lines / 6, itmp * (Columns / 8));
pflush;
wait_a_while (nap_msec);
saywhat ("t5; press any key to continue");
Top (p5);
pflush;
wait_a_while (nap_msec);
saywhat ("t2; press any key to continue");
Top (p2);
pflush;
wait_a_while (nap_msec);
saywhat ("t1; press any key to continue");
Top (p1);
pflush;
wait_a_while (nap_msec);
saywhat ("d2; press any key to continue");
rmpanel (p2);
pflush;
wait_a_while (nap_msec);
saywhat ("h3; press any key to continue");
Hide (p3);
pflush;
wait_a_while (nap_msec);
saywhat ("d1; press any key to continue");
rmpanel (p1);
pflush;
wait_a_while (nap_msec);
saywhat ("d4; press any key to continue");
rmpanel (p4);
pflush;
wait_a_while (nap_msec);
saywhat ("d5; press any key to continue");
rmpanel (p5);
pflush;
wait_a_while (nap_msec);
if nap_msec = 1 then
exit;
else
nap_msec := 100;
end if;
end;
end loop;
Erase;
End_Windows;
end ncurses2.demo_panels;
|
pragma License (Unrestricted);
-- implementation unit specialized for FreeBSD (or Linux)
with Ada.IO_Exceptions;
with Ada.Streams;
with C.iconv;
package System.Native_Environment_Encoding is
-- Platform-depended text encoding.
pragma Preelaborate;
use type C.char_array;
-- max length of one multi-byte character
Max_Substitute_Length : constant := 6; -- UTF-8
-- encoding identifier
type Encoding_Id is access constant C.char;
for Encoding_Id'Storage_Size use 0;
function Get_Image (Encoding : Encoding_Id) return String;
function Get_Default_Substitute (Encoding : Encoding_Id)
return Ada.Streams.Stream_Element_Array;
function Get_Min_Size_In_Stream_Elements (Encoding : Encoding_Id)
return Ada.Streams.Stream_Element_Offset;
UTF_8_Name : aliased constant C.char_array (0 .. 5) :=
"UTF-8" & C.char'Val (0);
UTF_8 : constant Encoding_Id := UTF_8_Name (0)'Access;
UTF_16_Names : aliased constant
array (Bit_Order) of aliased C.char_array (0 .. 8) := (
High_Order_First => "UTF-16BE" & C.char'Val (0),
Low_Order_First => "UTF-16LE" & C.char'Val (0));
UTF_16 : constant Encoding_Id := UTF_16_Names (Default_Bit_Order)(0)'Access;
UTF_16BE : constant Encoding_Id :=
UTF_16_Names (High_Order_First)(0)'Access;
UTF_16LE : constant Encoding_Id :=
UTF_16_Names (Low_Order_First)(0)'Access;
UTF_32_Names : aliased constant
array (Bit_Order) of aliased C.char_array (0 .. 8) := (
High_Order_First => "UTF-32BE" & C.char'Val (0),
Low_Order_First => "UTF-32LE" & C.char'Val (0));
UTF_32 : constant Encoding_Id := UTF_32_Names (Default_Bit_Order)(0)'Access;
UTF_32BE : constant Encoding_Id :=
UTF_32_Names (High_Order_First)(0)'Access;
UTF_32LE : constant Encoding_Id :=
UTF_32_Names (Low_Order_First)(0)'Access;
function Get_Current_Encoding return Encoding_Id;
-- Returns UTF-8. In POSIX, The system encoding is assumed as UTF-8.
pragma Inline (Get_Current_Encoding);
-- subsidiary types to converter
type Subsequence_Status_Type is (
Finished,
Success,
Overflow, -- the output buffer is not large enough
Illegal_Sequence, -- a input character could not be mapped to the output
Truncated); -- the input buffer is broken off at a multi-byte character
pragma Discard_Names (Subsequence_Status_Type);
type Continuing_Status_Type is
new Subsequence_Status_Type range
Success ..
Subsequence_Status_Type'Last;
type Finishing_Status_Type is
new Subsequence_Status_Type range
Finished ..
Overflow;
type Status_Type is
new Subsequence_Status_Type range
Finished ..
Illegal_Sequence;
type Substituting_Status_Type is
new Status_Type range
Finished ..
Overflow;
subtype True_Only is Boolean range True .. True;
-- converter
type Converter is record
iconv : C.iconv.iconv_t := C.void_ptr (Null_Address);
-- about "From"
Min_Size_In_From_Stream_Elements : Ada.Streams.Stream_Element_Offset;
-- about "To"
Substitute_Length : Ada.Streams.Stream_Element_Offset;
Substitute : Ada.Streams.Stream_Element_Array (
1 ..
Max_Substitute_Length);
end record;
pragma Suppress_Initialization (Converter);
Disable_Controlled : constant Boolean := False;
procedure Open (Object : in out Converter; From, To : Encoding_Id);
procedure Close (Object : in out Converter);
function Is_Open (Object : Converter) return Boolean;
pragma Inline (Is_Open);
function Min_Size_In_From_Stream_Elements_No_Check (Object : Converter)
return Ada.Streams.Stream_Element_Offset;
function Substitute_No_Check (Object : Converter)
return Ada.Streams.Stream_Element_Array;
procedure Set_Substitute_No_Check (
Object : in out Converter;
Substitute : Ada.Streams.Stream_Element_Array);
-- convert subsequence
procedure Convert_No_Check (
Object : Converter;
Item : Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset;
Out_Item : out Ada.Streams.Stream_Element_Array;
Out_Last : out Ada.Streams.Stream_Element_Offset;
Finish : Boolean;
Status : out Subsequence_Status_Type);
procedure Convert_No_Check (
Object : Converter;
Item : Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset;
Out_Item : out Ada.Streams.Stream_Element_Array;
Out_Last : out Ada.Streams.Stream_Element_Offset;
Status : out Continuing_Status_Type);
procedure Convert_No_Check (
Object : Converter;
Out_Item : out Ada.Streams.Stream_Element_Array;
Out_Last : out Ada.Streams.Stream_Element_Offset;
Finish : True_Only;
Status : out Finishing_Status_Type);
-- convert all character sequence
-- procedure Convert_No_Check (
-- Object : Converter;
-- Item : Ada.Streams.Stream_Element_Array;
-- Last : out Ada.Streams.Stream_Element_Offset;
-- Out_Item : out Ada.Streams.Stream_Element_Array;
-- Out_Last : out Ada.Streams.Stream_Element_Offset;
-- Finish : True_Only;
-- Status : out Status_Type);
-- convert all character sequence with substitute
procedure Convert_No_Check (
Object : Converter;
Item : Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset;
Out_Item : out Ada.Streams.Stream_Element_Array;
Out_Last : out Ada.Streams.Stream_Element_Offset;
Finish : True_Only;
Status : out Substituting_Status_Type);
procedure Put_Substitute (
Object : Converter;
Out_Item : out Ada.Streams.Stream_Element_Array;
Out_Last : out Ada.Streams.Stream_Element_Offset;
Is_Overflow : out Boolean);
-- exceptions
Name_Error : exception
renames Ada.IO_Exceptions.Name_Error;
Use_Error : exception
renames Ada.IO_Exceptions.Use_Error;
end System.Native_Environment_Encoding;
|
--
-- 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.
--
---------------------------------------------------------------------------
--
-- This module implements routines use to construct the yy_action[] table.
--
-- The state of the yy_action table under construction is an instance of
-- the following structure.
--
-- The yy_action table maps the pair (state_number, lookahead) into an
-- action_number. The table is an array of integers pairs. The state_number
-- determines an initial offset into the yy_action array. The lookahead
-- value is then added to this initial offset to get an index X into the
-- yy_action array. If the aAction[X].lookahead equals the value of the
-- of the lookahead input, then the value of the action_number output is
-- aAction[X].action. If the lookaheads do not match then the
-- default action for the state_number is returned.
--
-- All actions associated with a single state_number are first entered
-- into aLookahead[] using multiple calls to acttab_action(). Then the
-- actions for that single state_number are placed into the aAction[]
-- array with a single call to acttab_insert(). The acttab_insert() call
-- also resets the aLookahead[] array in preparation for the next
-- state number.
with Auxiliary;
package body Action_Tables is
--------------------
-- Lookahead_Size --
--------------------
function Lookahead_Size (Table : in Table_Type) return Integer is
begin
return Table.Num_Action;
end Lookahead_Size;
-- /* The value for the N-th entry in yy_action */
-- #define acttab_yyaction(X,N) ((X)->aAction[N].action)
-- /* The value for the N-th entry in yy_lookahead */
-- #define acttab_yylookahead(X,N) ((X)->aAction[N].lookahead)
-- /* Free all memory associated with the given acttab */
-- void acttab_free(acttab *p){
-- free( p->aAction );
-- free( p->aLookahead );
-- free( p );
-- }
-----------
-- Alloc --
-----------
function Alloc (N_Symbol : in Integer;
N_Terminal : in Integer) return Table_Access
is
P : constant Table_Access := new Table_Type;
begin
P.Num_Symbol := N_Symbol;
P.Num_Terminal := N_Terminal;
return P;
end Alloc;
-------------------
-- Acttab_Action --
-------------------
procedure Acttab_Action (Table : in out Table_Type;
Lookahead : Lookahead_Type;
Action : Action_Value)
is
Additional : constant := 25;
begin
if Table.Num_Lookahead > Table.Lookahead'Last then
declare
New_Lookahead : constant Action_Array_Access :=
new Action_Array'(0 .. Table.Lookahead'Last + Additional
=> Lookahead_Action'(0, 0));
begin
-- Copy
New_Lookahead.all (0 .. Table.Num_Lookahead - 1) :=
Table.Lookahead.all;
-- Fill last part
New_Lookahead.all (Table.Num_Lookahead ..
New_Lookahead'Last) :=
(others => Lookahead_Action'(0, 0));
-- Assing
Table.Lookahead := New_Lookahead;
end;
end if;
if Table.Num_Lookahead = 0 then
Table.Max_Lookahead := Lookahead;
Table.Min_Lookahead := Lookahead;
Table.Min_Action := Action;
else
if Table.Max_Lookahead < Lookahead then
Table.Max_Lookahead := Lookahead;
end if;
if Table.Min_Lookahead > Lookahead then
Table.Min_Lookahead := Lookahead;
Table.Min_Action := Action;
end if;
end if;
Table.Lookahead (Table.Num_Lookahead) := (Lookahead, Action);
Table.Num_Lookahead := Table.Num_Lookahead + 1;
end Acttab_Action;
-------------------
-- Acttab_Insert --
-------------------
procedure Acttab_Insert (Table : in out Table_Type;
Make_It_Safe : Boolean;
Offset : out Integer)
is
-- use type Actions.Action_Value;
P : Table_Type renames Table;
I, J, K, N, Endd : Integer;
begin
pragma Assert (P.Num_Lookahead > 0);
-- Make sure we have enough space to hold the expanded action table
-- in the worst case. The worst case occurs if the transaction set
-- must be appended to the current action table
N := P.Num_Symbol + 1;
if P.Num_Action + N > P.Action'Last then
declare
Additional : constant := 20;
procedure Realloc is
new Auxiliary.Resize_Array (Index_Type => Natural,
Element_Type => Lookahead_Action,
Array_Type => Action_Array,
Array_Access => Action_Array_Access);
begin
Realloc (Item => P.Action,
New_Last => P.Action'Last + Additional,
Default => (-1, -1));
end;
end if;
-- Scan the existing action table looking for an offset that is a
-- duplicate of the current transaction set. Fall out of the loop
-- if and when the duplicate is found.
--
-- i is the index in p.aAction[] where p.mnLookahead is inserted.
Endd := (if Make_It_Safe then Integer (P.Min_Lookahead) else 0);
I := P.Num_Action - 1;
while I >= Endd loop
if P.Action (I).Lookahead = P.Min_Lookahead then
-- All lookaheads and actions in the aLookahead[] transaction
-- must match against the candidate aAction[i] entry.
if P.Action (I).Action /= P.Min_Action then
goto Continue_1;
end if;
J := 0;
while J < P.Num_Lookahead - 1 loop
K := Integer (P.Lookahead (J).Lookahead - P.Min_Lookahead) + I;
exit when K not in 0 .. P.Num_Action - 1;
exit when P.Lookahead (J).Lookahead /= P.Action (K).Lookahead;
exit when P.Lookahead (J).Action /= P.Action (K).Action;
J := J + 1;
end loop;
if J < P.Num_Lookahead then
goto Continue_1;
end if;
-- No possible lookahead value that is not in the aLookahead[]
-- transaction is allowed to match aAction[i] */
N := 0;
for J in 0 .. P.Num_Action - 1 loop
if P.Action (J).Lookahead < 0 then goto Continue_2; end if;
if
P.Action (J).Lookahead =
Lookahead_Type (J + Integer (P.Min_Lookahead) - I)
then
N := N + 1;
end if;
<<Continue_2>>
end loop;
exit when N = P.Num_Lookahead; -- An exact match is found at offset i
end if;
<<Continue_1>>
I := I - 1;
end loop;
-- If no existing offsets exactly match the current transaction, find an
-- an empty offset in the aAction[] table in which we can add the
-- aLookahead[] transaction.
if I < Endd then
-- Look for holes in the aAction[] table that fit the current
-- aLookahead[] transaction. Leave i set to the offset of the hole.
-- If no holes are found, i is left at p.nAction, which means the
-- transaction will be appended.
I := (if Make_It_Safe then Integer (P.Min_Lookahead) else 0);
while I < P.Action'Last + 1 - Integer (P.Max_Lookahead) loop -- + 1 ?
if P.Action (I).Lookahead < 0 then
for J in 0 .. P.Num_Lookahead - 1 loop
K := Integer (P.Lookahead (J).Lookahead - P.Min_Lookahead) + I;
exit when K < 0;
exit when P.Action (K).Lookahead >= 0;
end loop;
if J < P.Num_Lookahead then
goto Continue_3;
end if;
for J in 0 .. P.Num_Action - 1 loop
exit when P.Action (J).Lookahead =
Lookahead_Type (J + Integer (P.Min_Lookahead) - I);
end loop;
exit when J = P.Num_Action; -- Fits in empty slots
end if;
<<Continue_3>>
I := I + 1;
end loop;
end if;
-- Insert transaction set at index i.
for J in 0 .. P.Num_Lookahead - 1 loop
K := Integer (P.Lookahead (J).Lookahead - P.Min_Lookahead) + I;
P.Action (K) := P.Lookahead (J);
if K >= P.Num_Action then
P.Num_Action := K + 1;
end if;
end loop;
if Make_It_Safe and I + P.Num_Terminal >= P.Num_Action then
P.Num_Action := I + P.Num_Terminal + 1;
end if;
P.Num_Lookahead := 0;
-- Return the offset that is added to the lookahead in order to get the
-- index into yy_action of the action
Offset := I - Integer (P.Min_Lookahead);
end Acttab_Insert;
-----------------
-- Action_Size --
-----------------
function Action_Size (Table : in Table_Type) return Integer is
begin
for N in reverse 1 .. Table.Num_Action loop
if Table.Action (N - 1).Lookahead < 0 then
return N;
end if;
end loop;
return 0;
end Action_Size;
end Action_Tables;
|
-- Copyright 2005-2017 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/>.
procedure Dummy is
begin
null; -- START
end Dummy;
|
-- C74206A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT IF A COMPOSITE TYPE IS DECLARED IN THE PACKAGE AS A
-- PRIVATE TYPE AND CONTAINS A COMPONENT OF THE PRIVATE TYPE, OPERATIONS
-- OF THE COMPOSITE TYPE WHICH DO NOT DEPEND ON CHARACTERISTICS OF THE
-- PRIVATE TYPE ARE AVAILABLE AFTER THE FULL DECLARATION OF THE PRIVATE
-- TYPE, BUT BEFORE THE EARLIEST PLACE WITHIN THE IMMEDIATE SCOPE OF THE
-- DECLARATION OF THE COMPOSITE TYPE THAT IS AFTER THE FULL DECLARATION
-- OF THE PRIVATE TYPE. IN PARTICULAR, CHECK FOR THE FOLLOWING :
-- 'FIRST, 'LAST, 'RANGE, AND 'LENGTH FOR ARRAY TYPES
-- SELECTED COMPONENTS FOR DISCRIMINANTS AND COMPONENTS OF RECORDS
-- INDEXED COMPONENTS AND SLICES FOR ARRAYS
-- DSJ 5/5/83
-- JBG 3/8/84
WITH REPORT;
PROCEDURE C74206A IS
USE REPORT;
BEGIN
TEST("C74206A", "CHECK THAT ADDITIONAL OPERATIONS FOR "
& "COMPOSITE TYPES OF PRIVATE TYPES ARE "
& "AVAILABLE AT THE EARLIEST PLACE AFTER THE "
& "FULL DECLARATION OF THE PRIVATE TYPE EVEN "
& "IF BEFORE THE EARLIEST PLACE WITHIN THE "
& "IMMEDIATE SCOPE OF THE COMPOSITE TYPE");
DECLARE
PACKAGE PACK1 IS
TYPE P1 IS PRIVATE;
TYPE LP1 IS LIMITED PRIVATE;
PACKAGE PACK_LP IS
TYPE LP_ARR IS ARRAY (1 .. 2) OF LP1;
TYPE LP_REC (D : INTEGER) IS
RECORD
C1, C2 : LP1;
END RECORD;
END PACK_LP;
PACKAGE PACK2 IS
TYPE ARR IS ARRAY ( 1 .. 2 ) OF P1;
TYPE REC (D : INTEGER) IS
RECORD
C1, C2 : P1;
END RECORD;
END PACK2;
PRIVATE
TYPE P1 IS NEW BOOLEAN;
TYPE LP1 IS NEW BOOLEAN;
END PACK1;
PACKAGE BODY PACK1 IS
USE PACK_LP;
USE PACK2;
A1 : ARR;
L1 : LP_ARR;
N1 : INTEGER := ARR'FIRST; -- LEGAL
N2 : INTEGER := ARR'LAST; -- LEGAL
N3 : INTEGER := A1'LENGTH; -- LEGAL
N4 : INTEGER := LP_ARR'FIRST; -- LEGAL
N5 : INTEGER := LP_ARR'LAST; -- LEGAL
N6 : INTEGER := L1'LENGTH; -- LEGAL
B1 : BOOLEAN := 1 IN ARR'RANGE; -- LEGAL
B2 : BOOLEAN := 5 IN LP_ARR'RANGE; -- LEGAL
N7 : INTEGER := A1(1)'SIZE; -- LEGAL: A1(1)
N8 : INTEGER := L1(2)'SIZE; -- LEGAL: L1(2)
R1 : REC(1);
Q1 : LP_REC(1);
K1 : INTEGER := R1.D'SIZE; -- LEGAL: R1.D
K2 : INTEGER := R1.C1'SIZE; -- LEGAL: R1.C1
K3 : INTEGER := Q1.D'SIZE; -- LEGAL: Q1.D
K4 : INTEGER := Q1.C2'SIZE; -- LEGAL: Q1.C2
BEGIN
IF N1 /= 1 OR N4 /= 1 THEN
FAILED ("WRONG VALUE FOR 'FIRST");
END IF;
IF N2 /= 2 OR N5 /= 2 THEN
FAILED ("WRONG VALUE FOR 'LAST");
END IF;
IF N3 /= 2 OR N6 /= 2 THEN
FAILED ("WRONG VALUE FOR 'LENGTH");
END IF;
IF B1 /= TRUE OR B2 /= FALSE THEN
FAILED ("INCORRECT RANGE TEST");
END IF;
IF N7 /= N8 THEN
FAILED ("INCORRECT INDEXED COMPONENTS");
END IF;
IF K1 /= K3 OR K2 /= K4 THEN
FAILED ("INCORRECT COMPONENT SELECTION");
END IF;
END PACK1;
BEGIN
NULL;
END;
RESULT;
END C74206A;
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="15">
<syndb class_id="0" tracking_level="0" version="0">
<userIPLatency>-1</userIPLatency>
<userIPName/>
<cdfg class_id="1" tracking_level="1" version="0" object_id="_0">
<name>Loop_loop_height_pro_2</name>
<ret_bitwidth>0</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>8</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>img_input_cols_V_c20</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/>
<rtlName/>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>12</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>extLd_loc_channel</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>12</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>img_input_data_strea</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<direction>0</direction>
<if_type>3</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>img_input_data_strea_1</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<direction>0</direction>
<if_type>3</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>img_input_data_strea_2</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<direction>0</direction>
<if_type>3</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>img_crop_data_stream</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>8</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>
<item class_id_reference="3" object_id="_7">
<Value>
<Obj>
<type>1</type>
<id>7</id>
<name>img_crop_data_stream_1</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>8</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>
<item class_id_reference="3" object_id="_8">
<Value>
<Obj>
<type>1</type>
<id>8</id>
<name>img_crop_data_stream_2</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>8</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>28</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_9">
<Value>
<Obj>
<type>0</type>
<id>9</id>
<name>extLd_loc_channel_re</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>12</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>69</item>
<item>70</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>1</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_10">
<Value>
<Obj>
<type>0</type>
<id>10</id>
<name>p_read_cast_i</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName>p_read_cast_i_fu_144_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>71</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>2</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_11">
<Value>
<Obj>
<type>0</type>
<id>18</id>
<name>img_input_cols_V_c20_1</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>12</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>73</item>
<item>74</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.88</m_delay>
<m_topoIndex>3</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_12">
<Value>
<Obj>
<type>0</type>
<id>19</id>
<name>cols_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>cols.V</originalName>
<rtlName>cols_V_fu_148_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>75</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>4</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_13">
<Value>
<Obj>
<type>0</type>
<id>20</id>
<name/>
<fileName>hls_video_processor/hls_video_processor.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>235</lineNumber>
<contextFuncName>video_crop</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="11" tracking_level="0" version="0">
<first>C:\Users\byronxu\Documents\6.S193</first>
<second class_id="12" tracking_level="0" version="0">
<count>2</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>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>235</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>76</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.76</m_delay>
<m_topoIndex>5</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_14">
<Value>
<Obj>
<type>0</type>
<id>22</id>
<name>t_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>r.V</originalName>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>78</item>
<item>79</item>
<item>80</item>
<item>81</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>6</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_15">
<Value>
<Obj>
<type>0</type>
<id>23</id>
<name>exitcond89_i_i_i_i</name>
<fileName>hls_video_processor/hls_video_processor.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>235</lineNumber>
<contextFuncName>video_crop</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>235</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>exitcond89_i_i_i_i_fu_152_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>82</item>
<item>83</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.47</m_delay>
<m_topoIndex>7</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_16">
<Value>
<Obj>
<type>0</type>
<id>24</id>
<name>r_V</name>
<fileName>hls_video_processor/hls_video_processor.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>235</lineNumber>
<contextFuncName>video_crop</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>235</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>r.V</originalName>
<rtlName>r_V_fu_157_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>84</item>
<item>86</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.55</m_delay>
<m_topoIndex>8</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>25</id>
<name/>
<fileName>hls_video_processor/hls_video_processor.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>235</lineNumber>
<contextFuncName>video_crop</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>235</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>87</item>
<item>88</item>
<item>89</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>9</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>30</id>
<name>tmp_i_i_i</name>
<fileName>hls_video_processor/hls_video_processor.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>244</lineNumber>
<contextFuncName>video_crop</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>244</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_i_i_i_fu_163_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>102</item>
<item>104</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.47</m_delay>
<m_topoIndex>10</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>31</id>
<name>tmp_i_i_i_59</name>
<fileName>hls_video_processor/hls_video_processor.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>244</lineNumber>
<contextFuncName>video_crop</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>244</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_i_i_i_59_fu_169_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>105</item>
<item>107</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.47</m_delay>
<m_topoIndex>11</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>32</id>
<name>or_cond_i_i_i_i</name>
<fileName>hls_video_processor/hls_video_processor.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>244</lineNumber>
<contextFuncName>video_crop</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>244</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>or_cond_i_i_i_i_fu_175_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>108</item>
<item>109</item>
</oprand_edges>
<opcode>and</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.97</m_delay>
<m_topoIndex>12</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>33</id>
<name/>
<fileName>hls_video_processor/hls_video_processor.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>237</lineNumber>
<contextFuncName>video_crop</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>237</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>110</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.76</m_delay>
<m_topoIndex>13</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_22">
<Value>
<Obj>
<type>0</type>
<id>35</id>
<name>t_V_4</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>c.V</originalName>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>91</item>
<item>92</item>
<item>93</item>
<item>94</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>15</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>36</id>
<name>exitcond_i_i_i_i</name>
<fileName>hls_video_processor/hls_video_processor.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>237</lineNumber>
<contextFuncName>video_crop</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>237</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>exitcond_i_i_i_i_fu_181_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>95</item>
<item>96</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.47</m_delay>
<m_topoIndex>16</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_24">
<Value>
<Obj>
<type>0</type>
<id>37</id>
<name>c_V</name>
<fileName>hls_video_processor/hls_video_processor.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>237</lineNumber>
<contextFuncName>video_crop</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>237</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>c.V</originalName>
<rtlName>c_V_fu_186_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>97</item>
<item>98</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.55</m_delay>
<m_topoIndex>17</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_25">
<Value>
<Obj>
<type>0</type>
<id>38</id>
<name/>
<fileName>hls_video_processor/hls_video_processor.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>237</lineNumber>
<contextFuncName>video_crop</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>237</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>99</item>
<item>100</item>
<item>101</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>18</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_26">
<Value>
<Obj>
<type>0</type>
<id>46</id>
<name>tmp_39</name>
<fileName>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>679</lineNumber>
<contextFuncName>read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>
<first>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</first>
<second>operator&gt;&gt;</second>
</first>
<second>711</second>
</item>
<item>
<first>
<first>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</first>
<second>read</second>
</first>
<second>679</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>242</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>tmp</originalName>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>113</item>
<item>114</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.88</m_delay>
<m_topoIndex>20</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_27">
<Value>
<Obj>
<type>0</type>
<id>47</id>
<name>tmp_40</name>
<fileName>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>679</lineNumber>
<contextFuncName>read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>
<first>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</first>
<second>operator&gt;&gt;</second>
</first>
<second>711</second>
</item>
<item>
<first>
<first>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</first>
<second>read</second>
</first>
<second>679</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>242</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>tmp</originalName>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>115</item>
<item>116</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.88</m_delay>
<m_topoIndex>21</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_28">
<Value>
<Obj>
<type>0</type>
<id>48</id>
<name>tmp</name>
<fileName>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>679</lineNumber>
<contextFuncName>read</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>
<first>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</first>
<second>operator&gt;&gt;</second>
</first>
<second>711</second>
</item>
<item>
<first>
<first>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</first>
<second>read</second>
</first>
<second>679</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>242</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>tmp</originalName>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>117</item>
<item>118</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.88</m_delay>
<m_topoIndex>22</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_29">
<Value>
<Obj>
<type>0</type>
<id>50</id>
<name/>
<fileName>hls_video_processor/hls_video_processor.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>244</lineNumber>
<contextFuncName>video_crop</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>244</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>119</item>
<item>120</item>
<item>121</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>19</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_30">
<Value>
<Obj>
<type>0</type>
<id>54</id>
<name/>
<fileName>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>703</lineNumber>
<contextFuncName>write</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>
<first>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</first>
<second>operator&lt;&lt;</second>
</first>
<second>717</second>
</item>
<item>
<first>
<first>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</first>
<second>write</second>
</first>
<second>703</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>245</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>123</item>
<item>124</item>
<item>125</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.88</m_delay>
<m_topoIndex>23</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_31">
<Value>
<Obj>
<type>0</type>
<id>55</id>
<name/>
<fileName>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>703</lineNumber>
<contextFuncName>write</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>
<first>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</first>
<second>operator&lt;&lt;</second>
</first>
<second>717</second>
</item>
<item>
<first>
<first>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</first>
<second>write</second>
</first>
<second>703</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>245</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>126</item>
<item>127</item>
<item>128</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.88</m_delay>
<m_topoIndex>24</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_32">
<Value>
<Obj>
<type>0</type>
<id>56</id>
<name/>
<fileName>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>703</lineNumber>
<contextFuncName>write</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>
<first>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</first>
<second>operator&lt;&lt;</second>
</first>
<second>717</second>
</item>
<item>
<first>
<first>C:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/hls_video_core.h</first>
<second>write</second>
</first>
<second>703</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>245</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>129</item>
<item>130</item>
<item>131</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>2.88</m_delay>
<m_topoIndex>25</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_33">
<Value>
<Obj>
<type>0</type>
<id>58</id>
<name/>
<fileName>hls_video_processor/hls_video_processor.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>246</lineNumber>
<contextFuncName>video_crop</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>246</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>132</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>26</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_34">
<Value>
<Obj>
<type>0</type>
<id>61</id>
<name/>
<fileName>hls_video_processor/hls_video_processor.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>237</lineNumber>
<contextFuncName>video_crop</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>237</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>111</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>27</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_35">
<Value>
<Obj>
<type>0</type>
<id>64</id>
<name/>
<fileName>hls_video_processor/hls_video_processor.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>235</lineNumber>
<contextFuncName>video_crop</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\byronxu\Documents\6.S193</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>hls_video_processor</second>
</first>
<second>419</second>
</item>
<item>
<first>
<first>hls_video_processor/hls_video_processor.cpp</first>
<second>video_crop</second>
</first>
<second>235</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>90</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>28</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_36">
<Value>
<Obj>
<type>0</type>
<id>66</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>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>14</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_37">
<Value>
<Obj>
<type>2</type>
<id>77</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>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_38">
<Value>
<Obj>
<type>2</type>
<id>85</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>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_39">
<Value>
<Obj>
<type>2</type>
<id>103</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>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>59</content>
</item>
<item class_id_reference="16" object_id="_40">
<Value>
<Obj>
<type>2</type>
<id>106</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>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>1020</content>
</item>
</consts>
<blocks class_id="17" tracking_level="0" version="0">
<count>9</count>
<item_version>0</item_version>
<item class_id="18" tracking_level="1" version="0" object_id="_41">
<Obj>
<type>3</type>
<id>21</id>
<name>entry</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<node_objs>
<count>5</count>
<item_version>0</item_version>
<item>9</item>
<item>10</item>
<item>18</item>
<item>19</item>
<item>20</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_42">
<Obj>
<type>3</type>
<id>26</id>
<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>22</item>
<item>23</item>
<item>24</item>
<item>25</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_43">
<Obj>
<type>3</type>
<id>34</id>
<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>30</item>
<item>31</item>
<item>32</item>
<item>33</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_44">
<Obj>
<type>3</type>
<id>39</id>
<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>35</item>
<item>36</item>
<item>37</item>
<item>38</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_45">
<Obj>
<type>3</type>
<id>51</id>
<name>operator>>.exit.i.i.i.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>46</item>
<item>47</item>
<item>48</item>
<item>50</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_46">
<Obj>
<type>3</type>
<id>59</id>
<name>operator<<.exit.i.i.i.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>54</item>
<item>55</item>
<item>56</item>
<item>58</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_47">
<Obj>
<type>3</type>
<id>62</id>
<name>._crit_edge.i.i.i.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>1</count>
<item_version>0</item_version>
<item>61</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_48">
<Obj>
<type>3</type>
<id>65</id>
<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>64</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_49">
<Obj>
<type>3</type>
<id>67</id>
<name>Loop_loop_height_pro.2.exit</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>66</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>60</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_50">
<id>70</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>9</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_51">
<id>71</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>10</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_52">
<id>74</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_53">
<id>75</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>19</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_54">
<id>76</id>
<edge_type>2</edge_type>
<source_obj>26</source_obj>
<sink_obj>20</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_55">
<id>78</id>
<edge_type>1</edge_type>
<source_obj>77</source_obj>
<sink_obj>22</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_56">
<id>79</id>
<edge_type>2</edge_type>
<source_obj>21</source_obj>
<sink_obj>22</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_57">
<id>80</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>22</sink_obj>
<is_back_edge>1</is_back_edge>
</item>
<item class_id_reference="20" object_id="_58">
<id>81</id>
<edge_type>2</edge_type>
<source_obj>65</source_obj>
<sink_obj>22</sink_obj>
<is_back_edge>1</is_back_edge>
</item>
<item class_id_reference="20" object_id="_59">
<id>82</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>23</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_60">
<id>83</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>23</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_61">
<id>84</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>24</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_62">
<id>86</id>
<edge_type>1</edge_type>
<source_obj>85</source_obj>
<sink_obj>24</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_63">
<id>87</id>
<edge_type>1</edge_type>
<source_obj>23</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_64">
<id>88</id>
<edge_type>2</edge_type>
<source_obj>34</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_65">
<id>89</id>
<edge_type>2</edge_type>
<source_obj>67</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_66">
<id>90</id>
<edge_type>2</edge_type>
<source_obj>26</source_obj>
<sink_obj>64</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_67">
<id>91</id>
<edge_type>1</edge_type>
<source_obj>77</source_obj>
<sink_obj>35</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_68">
<id>92</id>
<edge_type>2</edge_type>
<source_obj>34</source_obj>
<sink_obj>35</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_69">
<id>93</id>
<edge_type>1</edge_type>
<source_obj>37</source_obj>
<sink_obj>35</sink_obj>
<is_back_edge>1</is_back_edge>
</item>
<item class_id_reference="20" object_id="_70">
<id>94</id>
<edge_type>2</edge_type>
<source_obj>62</source_obj>
<sink_obj>35</sink_obj>
<is_back_edge>1</is_back_edge>
</item>
<item class_id_reference="20" object_id="_71">
<id>95</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>36</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_72">
<id>96</id>
<edge_type>1</edge_type>
<source_obj>19</source_obj>
<sink_obj>36</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_73">
<id>97</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>37</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_74">
<id>98</id>
<edge_type>1</edge_type>
<source_obj>85</source_obj>
<sink_obj>37</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_75">
<id>99</id>
<edge_type>1</edge_type>
<source_obj>36</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_76">
<id>100</id>
<edge_type>2</edge_type>
<source_obj>51</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_77">
<id>101</id>
<edge_type>2</edge_type>
<source_obj>65</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_78">
<id>102</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>30</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_79">
<id>104</id>
<edge_type>1</edge_type>
<source_obj>103</source_obj>
<sink_obj>30</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_80">
<id>105</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>31</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_81">
<id>107</id>
<edge_type>1</edge_type>
<source_obj>106</source_obj>
<sink_obj>31</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_82">
<id>108</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>32</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_83">
<id>109</id>
<edge_type>1</edge_type>
<source_obj>31</source_obj>
<sink_obj>32</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_84">
<id>110</id>
<edge_type>2</edge_type>
<source_obj>39</source_obj>
<sink_obj>33</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_85">
<id>111</id>
<edge_type>2</edge_type>
<source_obj>39</source_obj>
<sink_obj>61</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_86">
<id>114</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>46</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_87">
<id>116</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>47</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_88">
<id>118</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>48</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_89">
<id>119</id>
<edge_type>1</edge_type>
<source_obj>32</source_obj>
<sink_obj>50</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_90">
<id>120</id>
<edge_type>2</edge_type>
<source_obj>62</source_obj>
<sink_obj>50</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_91">
<id>121</id>
<edge_type>2</edge_type>
<source_obj>59</source_obj>
<sink_obj>50</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_92">
<id>124</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>54</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_93">
<id>125</id>
<edge_type>1</edge_type>
<source_obj>46</source_obj>
<sink_obj>54</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_94">
<id>127</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>55</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_95">
<id>128</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>55</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_96">
<id>130</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>56</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_97">
<id>131</id>
<edge_type>1</edge_type>
<source_obj>48</source_obj>
<sink_obj>56</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_98">
<id>132</id>
<edge_type>2</edge_type>
<source_obj>62</source_obj>
<sink_obj>58</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_99">
<id>316</id>
<edge_type>2</edge_type>
<source_obj>21</source_obj>
<sink_obj>26</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_100">
<id>317</id>
<edge_type>2</edge_type>
<source_obj>26</source_obj>
<sink_obj>67</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_101">
<id>318</id>
<edge_type>2</edge_type>
<source_obj>26</source_obj>
<sink_obj>34</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_102">
<id>319</id>
<edge_type>2</edge_type>
<source_obj>34</source_obj>
<sink_obj>39</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_103">
<id>320</id>
<edge_type>2</edge_type>
<source_obj>39</source_obj>
<sink_obj>65</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_104">
<id>321</id>
<edge_type>2</edge_type>
<source_obj>39</source_obj>
<sink_obj>51</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_105">
<id>322</id>
<edge_type>2</edge_type>
<source_obj>51</source_obj>
<sink_obj>59</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_106">
<id>323</id>
<edge_type>2</edge_type>
<source_obj>51</source_obj>
<sink_obj>62</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_107">
<id>324</id>
<edge_type>2</edge_type>
<source_obj>59</source_obj>
<sink_obj>62</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_108">
<id>325</id>
<edge_type>2</edge_type>
<source_obj>62</source_obj>
<sink_obj>39</sink_obj>
<is_back_edge>1</is_back_edge>
</item>
<item class_id_reference="20" object_id="_109">
<id>326</id>
<edge_type>2</edge_type>
<source_obj>65</source_obj>
<sink_obj>26</sink_obj>
<is_back_edge>1</is_back_edge>
</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="_110">
<mId>1</mId>
<mTag>Loop_loop_height_pro.2</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>2076841</mMinLatency>
<mMaxLatency>2076841</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"/>
</item>
<item class_id_reference="22" object_id="_111">
<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>21</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>0</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"/>
</item>
<item class_id_reference="22" object_id="_112">
<mId>3</mId>
<mTag>loop_height</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>2076840</mMinLatency>
<mMaxLatency>2076840</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"/>
</item>
<item class_id_reference="22" object_id="_113">
<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>26</item>
<item>34</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>0</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"/>
</item>
<item class_id_reference="22" object_id="_114">
<mId>5</mId>
<mTag>loop_width</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>39</item>
<item>51</item>
<item>59</item>
<item>62</item>
</basic_blocks>
<mII>1</mII>
<mDepth>2</mDepth>
<mMinTripCount>1920</mMinTripCount>
<mMaxTripCount>1920</mMaxTripCount>
<mMinLatency>1920</mMinLatency>
<mMaxLatency>1920</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"/>
</item>
<item class_id_reference="22" object_id="_115">
<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>65</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>0</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"/>
</item>
<item class_id_reference="22" object_id="_116">
<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>67</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>0</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"/>
</item>
</cdfg_regions>
<fsm class_id="24" tracking_level="1" version="0" object_id="_117">
<states class_id="25" tracking_level="0" version="0">
<count>5</count>
<item_version>0</item_version>
<item class_id="26" tracking_level="1" version="0" object_id="_118">
<id>1</id>
<operations class_id="27" tracking_level="0" version="0">
<count>12</count>
<item_version>0</item_version>
<item class_id="28" tracking_level="1" version="0" object_id="_119">
<id>9</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_120">
<id>10</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_121">
<id>11</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_122">
<id>12</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_123">
<id>13</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_124">
<id>14</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_125">
<id>15</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_126">
<id>16</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_127">
<id>17</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_128">
<id>18</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_129">
<id>19</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_130">
<id>20</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_131">
<id>2</id>
<operations>
<count>12</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_132">
<id>22</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_133">
<id>23</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_134">
<id>24</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_135">
<id>25</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_136">
<id>27</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_137">
<id>28</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_138">
<id>29</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_139">
<id>30</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_140">
<id>31</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_141">
<id>32</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_142">
<id>33</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_143">
<id>66</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_144">
<id>3</id>
<operations>
<count>5</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_145">
<id>35</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_146">
<id>36</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_147">
<id>37</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_148">
<id>38</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_149">
<id>50</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_150">
<id>4</id>
<operations>
<count>19</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_151">
<id>40</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_152">
<id>41</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_153">
<id>42</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_154">
<id>43</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_155">
<id>44</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_156">
<id>45</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_157">
<id>46</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_158">
<id>47</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_159">
<id>48</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_160">
<id>49</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_161">
<id>52</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_162">
<id>53</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_163">
<id>54</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_164">
<id>55</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_165">
<id>56</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_166">
<id>57</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_167">
<id>58</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_168">
<id>60</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_169">
<id>61</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_170">
<id>5</id>
<operations>
<count>2</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_171">
<id>63</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_172">
<id>64</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
</states>
<transitions class_id="29" tracking_level="0" version="0">
<count>6</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="1" version="0" object_id="_173">
<inState>1</inState>
<outState>2</outState>
<condition class_id="31" tracking_level="0" version="0">
<id>-1</id>
<sop class_id="32" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="33" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_174">
<inState>2</inState>
<outState>3</outState>
<condition>
<id>-1</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>1</count>
<item_version>0</item_version>
<item class_id="34" tracking_level="0" version="0">
<first class_id="35" tracking_level="0" version="0">
<first>23</first>
<second>0</second>
</first>
<second>1</second>
</item>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_175">
<inState>5</inState>
<outState>2</outState>
<condition>
<id>-1</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_176">
<inState>4</inState>
<outState>3</outState>
<condition>
<id>-1</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_177">
<inState>3</inState>
<outState>5</outState>
<condition>
<id>-1</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>36</first>
<second>0</second>
</first>
<second>0</second>
</item>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_178">
<inState>3</inState>
<outState>4</outState>
<condition>
<id>-1</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>36</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="_179">
<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>12</count>
<item_version>0</item_version>
<item class_id="38" tracking_level="0" version="0">
<first>ap_block_pp0_stage0_01001 ( and ) </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_state4_pp0_stage0_iter1 ( 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_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>2</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>c_V_fu_186_p2 ( + ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>32</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>39</second>
</item>
</second>
</item>
<item>
<first>exitcond89_i_i_i_i_fu_152_p2 ( icmp ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>32</second>
</item>
<item>
<first>(1P1)</first>
<second>32</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>18</second>
</item>
</second>
</item>
<item>
<first>exitcond_i_i_i_i_fu_181_p2 ( icmp ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>32</second>
</item>
<item>
<first>(1P1)</first>
<second>32</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>18</second>
</item>
</second>
</item>
<item>
<first>or_cond_i_i_i_i_fu_175_p2 ( 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>r_V_fu_157_p2 ( + ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>32</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>39</second>
</item>
</second>
</item>
<item>
<first>tmp_i_i_i_59_fu_169_p2 ( icmp ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>32</second>
</item>
<item>
<first>(1P1)</first>
<second>10</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>18</second>
</item>
</second>
</item>
<item>
<first>tmp_i_i_i_fu_163_p2 ( icmp ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>32</second>
</item>
<item>
<first>(1P1)</first>
<second>6</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>18</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>13</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>5</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>5</second>
</item>
<item>
<first>LUT</first>
<second>27</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>img_crop_data_stream_1_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>img_crop_data_stream_2_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>img_crop_data_stream_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>img_input_cols_V_c20_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>img_input_data_strea_1_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>img_input_data_strea_2_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>img_input_data_strea_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>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>
<item>
<first>t_V_4_reg_133</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>32</second>
</item>
<item>
<first>(2Count)</first>
<second>64</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>t_V_reg_122</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>32</second>
</item>
<item>
<first>(2Count)</first>
<second>64</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
</dp_multiplexer_resource>
<dp_register_resource>
<count>11</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>4</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>4</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>cols_V_reg_197</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>
<item>
<first>or_cond_i_i_i_i_reg_211</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>p_read_cast_i_reg_192</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>
<item>
<first>r_V_reg_206</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>
<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>t_V_4_reg_133</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>
<item>
<first>t_V_reg_122</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_dsp_resource>
<count>0</count>
<item_version>0</item_version>
</dp_dsp_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>7</count>
<item_version>0</item_version>
<item class_id="42" tracking_level="0" version="0">
<first>c_V_fu_186_p2 ( + ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>exitcond89_i_i_i_i_fu_152_p2 ( icmp ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
<item>
<first>exitcond_i_i_i_i_fu_181_p2 ( icmp ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>or_cond_i_i_i_i_fu_175_p2 ( and ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>r_V_fu_157_p2 ( + ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>tmp_i_i_i_59_fu_169_p2 ( icmp ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>tmp_i_i_i_fu_163_p2 ( icmp ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</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>28</count>
<item_version>0</item_version>
<item class_id="44" tracking_level="0" version="0">
<first>9</first>
<second class_id="45" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>10</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>18</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>19</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>20</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>22</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>23</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>24</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>25</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>30</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>31</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>32</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>33</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>35</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>36</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>37</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>38</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>46</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>47</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>48</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>50</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>54</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>55</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>56</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>58</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>61</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>64</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>66</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="46" tracking_level="0" version="0">
<count>9</count>
<item_version>0</item_version>
<item class_id="47" tracking_level="0" version="0">
<first>21</first>
<second class_id="48" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>26</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>34</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>39</first>
<second>
<first>2</first>
<second>2</second>
</second>
</item>
<item>
<first>51</first>
<second>
<first>2</first>
<second>3</second>
</second>
</item>
<item>
<first>59</first>
<second>
<first>3</first>
<second>3</second>
</second>
</item>
<item>
<first>62</first>
<second>
<first>3</first>
<second>3</second>
</second>
</item>
<item>
<first>65</first>
<second>
<first>3</first>
<second>3</second>
</second>
</item>
<item>
<first>67</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="49" tracking_level="0" version="0">
<count>3</count>
<item_version>0</item_version>
<item class_id="50" tracking_level="1" version="0" object_id="_180">
<region_name>loop_width</region_name>
<basic_blocks>
<count>4</count>
<item_version>0</item_version>
<item>39</item>
<item>51</item>
<item>59</item>
<item>62</item>
</basic_blocks>
<nodes>
<count>0</count>
<item_version>0</item_version>
</nodes>
<anchor_node>-1</anchor_node>
<region_type>8</region_type>
<interval>1</interval>
<pipe_depth>2</pipe_depth>
</item>
<item class_id_reference="50" object_id="_181">
<region_name>hls_label_0</region_name>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>51</item>
</basic_blocks>
<nodes>
<count>6</count>
<item_version>0</item_version>
<item>44</item>
<item>45</item>
<item>46</item>
<item>47</item>
<item>48</item>
<item>49</item>
</nodes>
<anchor_node>44</anchor_node>
<region_type>1</region_type>
<interval>0</interval>
<pipe_depth>0</pipe_depth>
</item>
<item class_id_reference="50" object_id="_182">
<region_name>hls_label_6</region_name>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>59</item>
</basic_blocks>
<nodes>
<count>6</count>
<item_version>0</item_version>
<item>52</item>
<item>53</item>
<item>54</item>
<item>55</item>
<item>56</item>
<item>57</item>
</nodes>
<anchor_node>52</anchor_node>
<region_type>1</region_type>
<interval>0</interval>
<pipe_depth>0</pipe_depth>
</item>
</regions>
<dp_fu_nodes class_id="51" tracking_level="0" version="0">
<count>19</count>
<item_version>0</item_version>
<item class_id="52" tracking_level="0" version="0">
<first>68</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>9</item>
</second>
</item>
<item>
<first>74</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>80</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
<item>
<first>86</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>92</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>48</item>
</second>
</item>
<item>
<first>98</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>54</item>
</second>
</item>
<item>
<first>106</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>55</item>
</second>
</item>
<item>
<first>114</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>56</item>
</second>
</item>
<item>
<first>126</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>137</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>35</item>
</second>
</item>
<item>
<first>144</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>10</item>
</second>
</item>
<item>
<first>148</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</second>
</item>
<item>
<first>152</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
<item>
<first>157</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>163</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>169</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>175</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>181</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>186</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="54" tracking_level="0" version="0">
<count>11</count>
<item_version>0</item_version>
<item class_id="55" tracking_level="0" version="0">
<first>c_V_fu_186</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>cols_V_fu_148</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</second>
</item>
<item>
<first>exitcond89_i_i_i_i_fu_152</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
<item>
<first>exitcond_i_i_i_i_fu_181</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>or_cond_i_i_i_i_fu_175</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>p_read_cast_i_fu_144</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>10</item>
</second>
</item>
<item>
<first>r_V_fu_157</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>t_V_4_phi_fu_137</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>35</item>
</second>
</item>
<item>
<first>t_V_phi_fu_126</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>tmp_i_i_i_59_fu_169</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>tmp_i_i_i_fu_163</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</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>8</count>
<item_version>0</item_version>
<item>
<first>StgValue_47_write_fu_98</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>54</item>
</second>
</item>
<item>
<first>StgValue_48_write_fu_106</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>55</item>
</second>
</item>
<item>
<first>StgValue_49_write_fu_114</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>56</item>
</second>
</item>
<item>
<first>extLd_loc_channel_re_read_fu_68</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>9</item>
</second>
</item>
<item>
<first>img_input_cols_V_c20_1_read_fu_74</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>tmp_39_read_fu_80</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
<item>
<first>tmp_40_read_fu_86</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>tmp_read_fu_92</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>48</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>9</count>
<item_version>0</item_version>
<item>
<first>122</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>133</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>35</item>
</second>
</item>
<item>
<first>192</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>10</item>
</second>
</item>
<item>
<first>197</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</second>
</item>
<item>
<first>202</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
<item>
<first>206</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>211</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>215</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>219</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
</dp_reg_nodes>
<dp_regname_nodes>
<count>9</count>
<item_version>0</item_version>
<item>
<first>c_V_reg_219</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>cols_V_reg_197</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</second>
</item>
<item>
<first>exitcond89_i_i_i_i_reg_202</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
<item>
<first>exitcond_i_i_i_i_reg_215</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>or_cond_i_i_i_i_reg_211</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>p_read_cast_i_reg_192</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>10</item>
</second>
</item>
<item>
<first>r_V_reg_206</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>t_V_4_reg_133</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>35</item>
</second>
</item>
<item>
<first>t_V_reg_122</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
</dp_regname_nodes>
<dp_reg_phi>
<count>2</count>
<item_version>0</item_version>
<item>
<first>122</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>133</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>35</item>
</second>
</item>
</dp_reg_phi>
<dp_regname_phi>
<count>2</count>
<item_version>0</item_version>
<item>
<first>t_V_4_reg_133</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>35</item>
</second>
</item>
<item>
<first>t_V_reg_122</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
</dp_regname_phi>
<dp_port_io_nodes class_id="57" tracking_level="0" version="0">
<count>8</count>
<item_version>0</item_version>
<item class_id="58" tracking_level="0" version="0">
<first>extLd_loc_channel</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>9</item>
</second>
</item>
</second>
</item>
<item>
<first>img_crop_data_stream</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>write</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>54</item>
</second>
</item>
</second>
</item>
<item>
<first>img_crop_data_stream_1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>write</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>55</item>
</second>
</item>
</second>
</item>
<item>
<first>img_crop_data_stream_2</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>write</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>56</item>
</second>
</item>
</second>
</item>
<item>
<first>img_input_cols_V_c20</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
</second>
</item>
<item>
<first>img_input_data_strea</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
</second>
</item>
<item>
<first>img_input_data_strea_1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
</second>
</item>
<item>
<first>img_input_data_strea_2</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>48</item>
</second>
</item>
</second>
</item>
</dp_port_io_nodes>
<port2core class_id="59" tracking_level="0" version="0">
<count>7</count>
<item_version>0</item_version>
<item class_id="60" tracking_level="0" version="0">
<first>1</first>
<second>FIFO</second>
</item>
<item>
<first>3</first>
<second>FIFO</second>
</item>
<item>
<first>4</first>
<second>FIFO</second>
</item>
<item>
<first>5</first>
<second>FIFO</second>
</item>
<item>
<first>6</first>
<second>FIFO</second>
</item>
<item>
<first>7</first>
<second>FIFO</second>
</item>
<item>
<first>8</first>
<second>FIFO</second>
</item>
</port2core>
<node2core>
<count>0</count>
<item_version>0</item_version>
</node2core>
</syndb>
</boost_serialization>
|
-- MIT License
-- Copyright (c) 2021 Stephen Merrony
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
with Ada.Real_Time; use Ada.Real_Time;
with Ada.Strings.Fixed;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
with Ada.Text_IO;
with Ada.Text_IO.Editing;
with Interfaces; use Interfaces;
with DG_Types; use DG_Types;
with Memory; use Memory;
-- Status_Monitor maintains a near real-time status screen available on STAT_PORT.
--
-- The screen uses DG DASHER control codes for formatting, so a DASHER terminal emulator
-- should be attached to it for good results.
--
-- The Monitor task waits for status updates
-- from known senders and upon receiving an update refreshes the display of that status
-- on the monitor page. It is therefore the responsibility of the sender to update the
-- status as often as it sees fit.
package body Status_Monitor is
type MIPS_T is delta 0.01 digits 5;
package MIPS_IO is new Ada.Text_IO.Editing.Decimal_Output ( MIPS_T );
MIPS_Format : constant Ada.Text_IO.Editing.Picture := Ada.Text_IO.Editing.To_Picture ("ZZ9.99");
function To_Float(TS : Time_Span) return Float is
SC1, SC2, SC3 : Seconds_Count;
TS1, TS2, TS3 : Time_Span;
begin
-- Use Split(Time_Of()) to split time span into seconds and fraction
-- Repeat twice to get microseconds and fraction thereof
Split(Time_Of(0, TS), SC1, TS1);
Split(Time_Of(0, TS1*1000), SC2, TS2);
Split(Time_Of(0, TS2*1000), SC3, TS3);
-- NOTE: it is safe to multiply by 1000 because RM95 D.8(31)
-- guarantees that Time_Span'Last is >= 3600 seconds.
-- Finally do the conversion of the remaining time-span to duration
-- and add to other pieces.
return (Float(SC1)*1.0E9 + Float(SC2)*1.0E6 + Float(SC3)*1.0E3 + Float(To_Duration(TS3*1000))) / 1.0E9;
end To_Float;
task body Monitor is
Receiver : GNAT.Sockets.Socket_Type;
Connection : GNAT.Sockets.Socket_Type;
Client : GNAT.Sockets.Sock_Addr_Type;
Channel : GNAT.Sockets.Stream_Access;
Radix : Number_Base_T := Octal;
CPU_Stats : Processor.CPU_Monitor_Rec;
DPF_Stats : Devices.Disk6061.Status_Rec;
MTB_Stats : Devices.Magtape6026.Status_Rec;
Now,
Last_CPU_Time,
Last_DPF_Time : Time := Clock;
CPU_Elapsed,
DPF_Elapsed : Time_Span;
I_Count, Last_I_Count : Unsigned_64 := 0;
MIPS : Float;
MIPS_Fixed : MIPS_T;
DPF_IO_Count, Last_DPF_IO_Count : Unsigned_64 := 0;
DPF_IOPS : Float;
DPF_IOPS_I : Natural;
begin
loop
select
accept Start (Port : in GNAT.Sockets.Port_Type) do
GNAT.Sockets.Create_Socket (Socket => Receiver);
GNAT.Sockets.Set_Socket_Option
(Socket => Receiver, Level => GNAT.Sockets.Socket_Level,
Option =>
(Name => GNAT.Sockets.Reuse_Address, Enabled => True));
GNAT.Sockets.Bind_Socket
(Socket => Receiver,
Address =>
(Family => GNAT.Sockets.Family_Inet,
Addr => GNAT.Sockets.Inet_Addr ("127.0.0.1"),
Port => Port));
GNAT.Sockets.Listen_Socket (Socket => Receiver);
end Start;
GNAT.Sockets.Accept_Socket
(Server => Receiver, Socket => Connection, Address => Client);
Ada.Text_IO.Put_Line
("INFO: Status Monitor connected from " & GNAT.Sockets.Image (Client));
Channel := GNAT.Sockets.Stream (Connection);
String'Write
(Channel,
Dasher_Erase_Page & " " &
Dasher_Underline & "MV/Emua Status" & Dasher_Normal &
Dasher_NL);
or
accept CPU_Update (Stats : in Processor.CPU_Monitor_Rec) do
CPU_Stats := Stats;
end CPU_Update;
Now := Clock;
I_Count := CPU_Stats.Instruction_Count - Last_I_Count;
Last_I_Count := CPU_Stats.Instruction_Count;
CPU_Elapsed := Now - Last_CPU_Time;
MIPS := Float (I_Count) / To_Float(CPU_Elapsed);
MIPS_Fixed := MIPS_T(MIPS / 1_000_000.0);
Last_CPU_Time := Now;
String'Write
(Channel,
Dasher_Write_Window_Addr & Character'Val (0) &
Character'Val (CPU_Row_1) & Dasher_Erase_EOL);
String'Write (Channel, "PC: " & Dword_To_String (Dword_T(CPU_Stats.PC), Radix, 11, true) &
" Interrupts: " & Boolean_To_YN (CPU_Stats.ION) &
" ATU: " & Boolean_To_YN (CPU_Stats.ATU) &
" MIPS: " & MIPS_Fixed'Image );
String'Write
(Channel,
Dasher_Write_Window_Addr & Character'Val (0) &
Character'Val (CPU_Row_2) & Dasher_Erase_EOL);
String'Write (Channel, "AC0: " & Dword_To_String (CPU_Stats.AC(0), Radix, 11, true) &
" AC1: " & Dword_To_String (CPU_Stats.AC(1), Radix, 11, true) &
" AC2: " & Dword_To_String (CPU_Stats.AC(2), Radix, 11, true) &
" AC3: " & Dword_To_String (CPU_Stats.AC(3), Radix, 11, true));
or
accept DPF_Update (Stats : in Devices.Disk6061.Status_Rec) do
DPF_Stats := Stats;
end DPF_Update;
Now := Clock;
DPF_IO_Count := DPF_Stats.Reads + DPF_Stats.Writes - Last_DPF_IO_Count;
Last_DPF_IO_Count := DPF_Stats.Reads + DPF_Stats.Writes;
DPF_Elapsed := Now - Last_DPF_Time;
DPF_IOPS := Float(DPF_IO_Count) / To_Float(DPF_Elapsed);
DPF_IOPS_I := Natural(DPF_IOPS) / 1000;
Last_DPF_Time := Now;
String'Write
(Channel,
Dasher_Write_Window_Addr & Character'Val (0) &
Character'Val (DPF_Row_1) & Dasher_Erase_EOL);
String'Write
(Channel,
"DPF: (DPF0) - Attached: " & Boolean_To_YN (DPF_Stats.Image_Attached) &
" Cyl: " & DPF_Stats.Cylinder'Image &
" Surf: " & DPF_Stats.Surface'Image &
" Sect: " & DPF_Stats.Sector'Image &
" KIOPS: " & DPF_IOPS_I'Image);
or
accept MTB_Update (Stats : in Devices.Magtape6026.Status_Rec) do
MTB_Stats := Stats;
end MTB_Update;
String'Write
(Channel,
Dasher_Write_Window_Addr & Character'Val (0) &
Character'Val (MTB_Row_1) & Dasher_Erase_EOL);
String'Write
(Channel,
"MTA: (MTC0) - Attached: " & Boolean_To_YN (MTB_Stats.Image_Attached(0)) &
" Mem Addr: " & Dword_To_String (Dword_T(MTB_Stats.Mem_Addr_Reg), Radix, 12, true) &
" Curr Cmd: " & MTB_Stats.Current_Cmd'Image);
String'Write
(Channel,
Dasher_Write_Window_Addr & Character'Val (0) &
Character'Val (MTB_Row_2) & Dasher_Erase_EOL);
String'Write
(Channel,
" Image file: " & To_String(MTB_Stats.Image_Filename(0)));
or
accept Stop do
GNAT.Sockets.Close_Socket (Connection);
Ada.Text_IO.Put_Line ("INFO: Status Monitor stoppped");
end Stop;
or
terminate;
end select;
end loop;
end Monitor;
end Status_Monitor;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . M A C H I N E _ R E S E T --
-- --
-- B o d y --
-- --
-- Copyright (C) 2011-2017, 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. --
-- --
------------------------------------------------------------------------------
-- Reset for Ultrascale+
with Interfaces;
package body System.Machine_Reset is
procedure Os_Exit (Status : Integer);
pragma No_Return (Os_Exit);
pragma Export (Ada, Os_Exit, "_exit");
-- Shutdown or restart the board
procedure Os_Abort;
pragma No_Return (Os_Abort);
pragma Export (Ada, Os_Abort, "abort");
-- Likewise
--------------
-- Os_Abort --
--------------
procedure Os_Abort is
begin
Os_Exit (1);
end Os_Abort;
-------------
-- Os_Exit --
-------------
procedure Os_Exit (Status : Integer) is
pragma Unreferenced (Status);
-- The parameter is just for ISO-C compatibility
CRL_APB_CRL_WPROT : Interfaces.Unsigned_32
with Volatile, Import, Address => System'To_Address (16#FF5E001C#);
CRL_APB_RESET_CTRL : Interfaces.Unsigned_32
with Volatile, Import, Address => System'To_Address (16#FF5E0218#);
begin
CRL_APB_CRL_WPROT := 0;
loop
CRL_APB_RESET_CTRL := 16;
end loop;
end Os_Exit;
----------
-- Stop --
----------
procedure Stop is
begin
Os_Exit (0);
end Stop;
end System.Machine_Reset;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- N L I S T S --
-- --
-- B o d y --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- WARNING: There is a C version of this package. Any changes to this source
-- file must be properly reflected in the corresponding C header a-nlists.h
with Alloc;
with Atree; use Atree;
with Debug; use Debug;
with Output; use Output;
with Sinfo; use Sinfo;
with Table;
package body Nlists is
use Atree_Private_Part;
-- Get access to Nodes table
----------------------------------
-- Implementation of Node Lists --
----------------------------------
-- A node list is represented by a list header which contains
-- three fields:
type List_Header is record
First : Node_Id;
-- Pointer to first node in list. Empty if list is empty
Last : Node_Id;
-- Pointer to last node in list. Empty if list is empty
Parent : Node_Id;
-- Pointer to parent of list. Empty if list has no parent
end record;
-- The node lists are stored in a table indexed by List_Id values
package Lists is new Table.Table (
Table_Component_Type => List_Header,
Table_Index_Type => List_Id,
Table_Low_Bound => First_List_Id,
Table_Initial => Alloc.Lists_Initial,
Table_Increment => Alloc.Lists_Increment,
Table_Name => "Lists");
-- The nodes in the list all have the In_List flag set, and their Link
-- fields (which otherwise point to the parent) contain the List_Id of
-- the list header giving immediate access to the list containing the
-- node, and its parent and first and last elements.
-- Two auxiliary tables, indexed by Node_Id values and built in parallel
-- with the main nodes table and always having the same size contain the
-- list link values that allow locating the previous and next node in a
-- list. The entries in these tables are valid only if the In_List flag
-- is set in the corresponding node. Next_Node is Empty at the end of a
-- list and Prev_Node is Empty at the start of a list.
package Next_Node is new Table.Table (
Table_Component_Type => Node_Id,
Table_Index_Type => Node_Id,
Table_Low_Bound => First_Node_Id,
Table_Initial => Alloc.Orig_Nodes_Initial,
Table_Increment => Alloc.Orig_Nodes_Increment,
Table_Name => "Next_Node");
package Prev_Node is new Table.Table (
Table_Component_Type => Node_Id,
Table_Index_Type => Node_Id,
Table_Low_Bound => First_Node_Id,
Table_Initial => Alloc.Orig_Nodes_Initial,
Table_Increment => Alloc.Orig_Nodes_Increment,
Table_Name => "Prev_Node");
-----------------------
-- Local Subprograms --
-----------------------
procedure Prepend_Debug (Node : Node_Id; To : List_Id);
pragma Inline (Prepend_Debug);
-- Output debug information if Debug_Flag_N set
procedure Remove_Next_Debug (Node : Node_Id);
pragma Inline (Remove_Next_Debug);
-- Output debug information if Debug_Flag_N set
procedure Set_First (List : List_Id; To : Node_Id);
pragma Inline (Set_First);
-- Sets First field of list header List to reference To
procedure Set_Last (List : List_Id; To : Node_Id);
pragma Inline (Set_Last);
-- Sets Last field of list header List to reference To
procedure Set_List_Link (Node : Node_Id; To : List_Id);
pragma Inline (Set_List_Link);
-- Sets list link of Node to list header To
procedure Set_Next (Node : Node_Id; To : Node_Id);
pragma Inline (Set_Next);
-- Sets the Next_Node pointer for Node to reference To
procedure Set_Prev (Node : Node_Id; To : Node_Id);
pragma Inline (Set_Prev);
-- Sets the Prev_Node pointer for Node to reference To
--------------------------
-- Allocate_List_Tables --
--------------------------
procedure Allocate_List_Tables (N : Node_Id) is
begin
Next_Node.Set_Last (N);
Prev_Node.Set_Last (N);
end Allocate_List_Tables;
------------
-- Append --
------------
procedure Append (Node : Node_Id; To : List_Id) is
L : constant Node_Id := Last (To);
procedure Append_Debug;
pragma Inline (Append_Debug);
-- Output debug information if Debug_Flag_N set
procedure Append_Debug is
begin
if Debug_Flag_N then
Write_Str ("Append node ");
Write_Int (Int (Node));
Write_Str (" to list ");
Write_Int (Int (To));
Write_Eol;
end if;
end Append_Debug;
-- Start of processing for Append
begin
pragma Assert (not Is_List_Member (Node));
if Node = Error then
return;
end if;
pragma Debug (Append_Debug);
if No (L) then
Set_First (To, Node);
else
Set_Next (L, Node);
end if;
Set_Last (To, Node);
Nodes.Table (Node).In_List := True;
Set_Next (Node, Empty);
Set_Prev (Node, L);
Set_List_Link (Node, To);
end Append;
-----------------
-- Append_List --
-----------------
procedure Append_List (List : List_Id; To : List_Id) is
procedure Append_List_Debug;
pragma Inline (Append_List_Debug);
-- Output debug information if Debug_Flag_N set
procedure Append_List_Debug is
begin
if Debug_Flag_N then
Write_Str ("Append list ");
Write_Int (Int (List));
Write_Str (" to list ");
Write_Int (Int (To));
Write_Eol;
end if;
end Append_List_Debug;
-- Start of processing for Append_List
begin
if Is_Empty_List (List) then
return;
else
declare
L : constant Node_Id := Last (To);
F : constant Node_Id := First (List);
N : Node_Id;
begin
pragma Debug (Append_List_Debug);
N := F;
loop
Set_List_Link (N, To);
N := Next (N);
exit when No (N);
end loop;
if No (L) then
Set_First (To, F);
else
Set_Next (L, F);
end if;
Set_Prev (F, L);
Set_Last (To, Last (List));
Set_First (List, Empty);
Set_Last (List, Empty);
end;
end if;
end Append_List;
--------------------
-- Append_List_To --
--------------------
procedure Append_List_To (To : List_Id; List : List_Id) is
begin
Append_List (List, To);
end Append_List_To;
---------------
-- Append_To --
---------------
procedure Append_To (To : List_Id; Node : Node_Id) is
begin
Append (Node, To);
end Append_To;
-----------------
-- Delete_List --
-----------------
procedure Delete_List (L : List_Id) is
N : Node_Id;
begin
while Is_Non_Empty_List (L) loop
N := Remove_Head (L);
Delete_Tree (N);
end loop;
-- Should recycle list header???
end Delete_List;
-----------
-- First --
-----------
-- This subprogram is deliberately placed early on, out of alphabetical
-- order, so that it can be properly inlined from within this unit.
function First (List : List_Id) return Node_Id is
begin
if List = No_List then
return Empty;
else
pragma Assert (List in First_List_Id .. Lists.Last);
return Lists.Table (List).First;
end if;
end First;
----------------------
-- First_Non_Pragma --
----------------------
function First_Non_Pragma (List : List_Id) return Node_Id is
N : constant Node_Id := First (List);
begin
if Nkind (N) /= N_Pragma
and then
Nkind (N) /= N_Null_Statement
then
return N;
else
return Next_Non_Pragma (N);
end if;
end First_Non_Pragma;
----------------
-- Initialize --
----------------
procedure Initialize is
E : constant List_Id := Error_List;
begin
Lists.Init;
Next_Node.Init;
Prev_Node.Init;
-- Allocate Error_List list header
Lists.Increment_Last;
Set_Parent (E, Empty);
Set_First (E, Empty);
Set_Last (E, Empty);
end Initialize;
------------------
-- Insert_After --
------------------
procedure Insert_After (After : Node_Id; Node : Node_Id) is
procedure Insert_After_Debug;
pragma Inline (Insert_After_Debug);
-- Output debug information if Debug_Flag_N set
procedure Insert_After_Debug is
begin
if Debug_Flag_N then
Write_Str ("Insert node");
Write_Int (Int (Node));
Write_Str (" after node ");
Write_Int (Int (After));
Write_Eol;
end if;
end Insert_After_Debug;
-- Start of processing for Insert_After
begin
pragma Assert
(Is_List_Member (After) and then not Is_List_Member (Node));
if Node = Error then
return;
end if;
pragma Debug (Insert_After_Debug);
declare
Before : constant Node_Id := Next (After);
LC : constant List_Id := List_Containing (After);
begin
if Present (Before) then
Set_Prev (Before, Node);
else
Set_Last (LC, Node);
end if;
Set_Next (After, Node);
Nodes.Table (Node).In_List := True;
Set_Prev (Node, After);
Set_Next (Node, Before);
Set_List_Link (Node, LC);
end;
end Insert_After;
-------------------
-- Insert_Before --
-------------------
procedure Insert_Before (Before : Node_Id; Node : Node_Id) is
procedure Insert_Before_Debug;
pragma Inline (Insert_Before_Debug);
-- Output debug information if Debug_Flag_N set
procedure Insert_Before_Debug is
begin
if Debug_Flag_N then
Write_Str ("Insert node");
Write_Int (Int (Node));
Write_Str (" before node ");
Write_Int (Int (Before));
Write_Eol;
end if;
end Insert_Before_Debug;
-- Start of processing for Insert_Before
begin
pragma Assert
(Is_List_Member (Before) and then not Is_List_Member (Node));
if Node = Error then
return;
end if;
pragma Debug (Insert_Before_Debug);
declare
After : constant Node_Id := Prev (Before);
LC : constant List_Id := List_Containing (Before);
begin
if Present (After) then
Set_Next (After, Node);
else
Set_First (LC, Node);
end if;
Set_Prev (Before, Node);
Nodes.Table (Node).In_List := True;
Set_Prev (Node, After);
Set_Next (Node, Before);
Set_List_Link (Node, LC);
end;
end Insert_Before;
-----------------------
-- Insert_List_After --
-----------------------
procedure Insert_List_After (After : Node_Id; List : List_Id) is
procedure Insert_List_After_Debug;
pragma Inline (Insert_List_After_Debug);
-- Output debug information if Debug_Flag_N set
procedure Insert_List_After_Debug is
begin
if Debug_Flag_N then
Write_Str ("Insert list ");
Write_Int (Int (List));
Write_Str (" after node ");
Write_Int (Int (After));
Write_Eol;
end if;
end Insert_List_After_Debug;
-- Start of processing for Insert_List_After
begin
pragma Assert (Is_List_Member (After));
if Is_Empty_List (List) then
return;
else
declare
Before : constant Node_Id := Next (After);
LC : constant List_Id := List_Containing (After);
F : constant Node_Id := First (List);
L : constant Node_Id := Last (List);
N : Node_Id;
begin
pragma Debug (Insert_List_After_Debug);
N := F;
loop
Set_List_Link (N, LC);
exit when N = L;
N := Next (N);
end loop;
if Present (Before) then
Set_Prev (Before, L);
else
Set_Last (LC, L);
end if;
Set_Next (After, F);
Set_Prev (F, After);
Set_Next (L, Before);
Set_First (List, Empty);
Set_Last (List, Empty);
end;
end if;
end Insert_List_After;
------------------------
-- Insert_List_Before --
------------------------
procedure Insert_List_Before (Before : Node_Id; List : List_Id) is
procedure Insert_List_Before_Debug;
pragma Inline (Insert_List_Before_Debug);
-- Output debug information if Debug_Flag_N set
procedure Insert_List_Before_Debug is
begin
if Debug_Flag_N then
Write_Str ("Insert list ");
Write_Int (Int (List));
Write_Str (" before node ");
Write_Int (Int (Before));
Write_Eol;
end if;
end Insert_List_Before_Debug;
-- Start of prodcessing for Insert_List_Before
begin
pragma Assert (Is_List_Member (Before));
if Is_Empty_List (List) then
return;
else
declare
After : constant Node_Id := Prev (Before);
LC : constant List_Id := List_Containing (Before);
F : constant Node_Id := First (List);
L : constant Node_Id := Last (List);
N : Node_Id;
begin
pragma Debug (Insert_List_Before_Debug);
N := F;
loop
Set_List_Link (N, LC);
exit when N = L;
N := Next (N);
end loop;
if Present (After) then
Set_Next (After, F);
else
Set_First (LC, F);
end if;
Set_Prev (Before, L);
Set_Prev (F, After);
Set_Next (L, Before);
Set_First (List, Empty);
Set_Last (List, Empty);
end;
end if;
end Insert_List_Before;
-------------------
-- Is_Empty_List --
-------------------
function Is_Empty_List (List : List_Id) return Boolean is
begin
return First (List) = Empty;
end Is_Empty_List;
--------------------
-- Is_List_Member --
--------------------
function Is_List_Member (Node : Node_Id) return Boolean is
begin
return Nodes.Table (Node).In_List;
end Is_List_Member;
-----------------------
-- Is_Non_Empty_List --
-----------------------
function Is_Non_Empty_List (List : List_Id) return Boolean is
begin
return List /= No_List and then First (List) /= Empty;
end Is_Non_Empty_List;
----------
-- Last --
----------
-- This subprogram is deliberately placed early on, out of alphabetical
-- order, so that it can be properly inlined from within this unit.
function Last (List : List_Id) return Node_Id is
begin
pragma Assert (List in First_List_Id .. Lists.Last);
return Lists.Table (List).Last;
end Last;
------------------
-- Last_List_Id --
------------------
function Last_List_Id return List_Id is
begin
return Lists.Last;
end Last_List_Id;
---------------------
-- Last_Non_Pragma --
---------------------
function Last_Non_Pragma (List : List_Id) return Node_Id is
N : constant Node_Id := Last (List);
begin
if Nkind (N) /= N_Pragma then
return N;
else
return Prev_Non_Pragma (N);
end if;
end Last_Non_Pragma;
---------------------
-- List_Containing --
---------------------
function List_Containing (Node : Node_Id) return List_Id is
begin
pragma Assert (Is_List_Member (Node));
return List_Id (Nodes.Table (Node).Link);
end List_Containing;
-----------------
-- List_Length --
-----------------
function List_Length (List : List_Id) return Nat is
Result : Nat;
Node : Node_Id;
begin
Result := 0;
Node := First (List);
while Present (Node) loop
Result := Result + 1;
Node := Next (Node);
end loop;
return Result;
end List_Length;
-------------------
-- Lists_Address --
-------------------
function Lists_Address return System.Address is
begin
return Lists.Table (First_List_Id)'Address;
end Lists_Address;
----------
-- Lock --
----------
procedure Lock is
begin
Lists.Locked := True;
Lists.Release;
Prev_Node.Locked := True;
Next_Node.Locked := True;
Prev_Node.Release;
Next_Node.Release;
end Lock;
-------------------
-- New_Copy_List --
-------------------
function New_Copy_List (List : List_Id) return List_Id is
NL : List_Id;
E : Node_Id;
begin
if List = No_List then
return No_List;
else
NL := New_List;
E := First (List);
while Present (E) loop
Append (New_Copy (E), NL);
E := Next (E);
end loop;
return NL;
end if;
end New_Copy_List;
----------------------------
-- New_Copy_List_Original --
----------------------------
function New_Copy_List_Original (List : List_Id) return List_Id is
NL : List_Id;
E : Node_Id;
begin
if List = No_List then
return No_List;
else
NL := New_List;
E := First (List);
while Present (E) loop
if Comes_From_Source (E) then
Append (New_Copy (E), NL);
end if;
E := Next (E);
end loop;
return NL;
end if;
end New_Copy_List_Original;
------------------------
-- New_Copy_List_Tree --
------------------------
function New_Copy_List_Tree (List : List_Id) return List_Id is
NL : List_Id;
E : Node_Id;
begin
if List = No_List then
return No_List;
else
NL := New_List;
E := First (List);
while Present (E) loop
Append (New_Copy_Tree (E), NL);
E := Next (E);
end loop;
return NL;
end if;
end New_Copy_List_Tree;
--------------
-- New_List --
--------------
function New_List return List_Id is
procedure New_List_Debug;
pragma Inline (New_List_Debug);
-- Output debugging information if Debug_Flag_N is set
procedure New_List_Debug is
begin
if Debug_Flag_N then
Write_Str ("Allocate new list, returned ID = ");
Write_Int (Int (Lists.Last));
Write_Eol;
end if;
end New_List_Debug;
-- Start of processing for New_List
begin
Lists.Increment_Last;
declare
List : constant List_Id := Lists.Last;
begin
Set_Parent (List, Empty);
Set_First (List, Empty);
Set_Last (List, Empty);
pragma Debug (New_List_Debug);
return (List);
end;
end New_List;
-- Since the one argument case is common, we optimize to build the right
-- list directly, rather than first building an empty list and then doing
-- the insertion, which results in some unnecessary work.
function New_List (Node : Node_Id) return List_Id is
procedure New_List_Debug;
pragma Inline (New_List_Debug);
-- Output debugging information if Debug_Flag_N is set
procedure New_List_Debug is
begin
if Debug_Flag_N then
Write_Str ("Allocate new list, returned ID = ");
Write_Int (Int (Lists.Last));
Write_Eol;
end if;
end New_List_Debug;
-- Start of processing for New_List
begin
if Node = Error then
return New_List;
else
pragma Assert (not Is_List_Member (Node));
Lists.Increment_Last;
declare
List : constant List_Id := Lists.Last;
begin
Set_Parent (List, Empty);
Set_First (List, Node);
Set_Last (List, Node);
Nodes.Table (Node).In_List := True;
Set_List_Link (Node, List);
Set_Prev (Node, Empty);
Set_Next (Node, Empty);
pragma Debug (New_List_Debug);
return List;
end;
end if;
end New_List;
function New_List (Node1, Node2 : Node_Id) return List_Id is
L : constant List_Id := New_List (Node1);
begin
Append (Node2, L);
return L;
end New_List;
function New_List (Node1, Node2, Node3 : Node_Id) return List_Id is
L : constant List_Id := New_List (Node1);
begin
Append (Node2, L);
Append (Node3, L);
return L;
end New_List;
function New_List (Node1, Node2, Node3, Node4 : Node_Id) return List_Id is
L : constant List_Id := New_List (Node1);
begin
Append (Node2, L);
Append (Node3, L);
Append (Node4, L);
return L;
end New_List;
function New_List
(Node1 : Node_Id;
Node2 : Node_Id;
Node3 : Node_Id;
Node4 : Node_Id;
Node5 : Node_Id)
return List_Id
is
L : constant List_Id := New_List (Node1);
begin
Append (Node2, L);
Append (Node3, L);
Append (Node4, L);
Append (Node5, L);
return L;
end New_List;
function New_List
(Node1 : Node_Id;
Node2 : Node_Id;
Node3 : Node_Id;
Node4 : Node_Id;
Node5 : Node_Id;
Node6 : Node_Id)
return List_Id
is
L : constant List_Id := New_List (Node1);
begin
Append (Node2, L);
Append (Node3, L);
Append (Node4, L);
Append (Node5, L);
Append (Node6, L);
return L;
end New_List;
----------
-- Next --
----------
-- This subprogram is deliberately placed early on, out of alphabetical
-- order, so that it can be properly inlined from within this unit.
function Next (Node : Node_Id) return Node_Id is
begin
pragma Assert (Is_List_Member (Node));
return Next_Node.Table (Node);
end Next;
procedure Next (Node : in out Node_Id) is
begin
Node := Next (Node);
end Next;
-----------------------
-- Next_Node_Address --
-----------------------
function Next_Node_Address return System.Address is
begin
return Next_Node.Table (First_Node_Id)'Address;
end Next_Node_Address;
---------------------
-- Next_Non_Pragma --
---------------------
function Next_Non_Pragma (Node : Node_Id) return Node_Id is
N : Node_Id;
begin
N := Node;
loop
N := Next (N);
exit when Nkind (N) /= N_Pragma
and then
Nkind (N) /= N_Null_Statement;
end loop;
return N;
end Next_Non_Pragma;
procedure Next_Non_Pragma (Node : in out Node_Id) is
begin
Node := Next_Non_Pragma (Node);
end Next_Non_Pragma;
--------
-- No --
--------
-- This subprogram is deliberately placed early on, out of alphabetical
-- order, so that it can be properly inlined from within this unit.
function No (List : List_Id) return Boolean is
begin
return List = No_List;
end No;
---------------
-- Num_Lists --
---------------
function Num_Lists return Nat is
begin
return Int (Lists.Last) - Int (Lists.First) + 1;
end Num_Lists;
-------
-- p --
-------
function p (U : Union_Id) return Node_Id is
begin
if U in Node_Range then
return Parent (Node_Id (U));
elsif U in List_Range then
return Parent (List_Id (U));
else
return 99_999_999;
end if;
end p;
------------
-- Parent --
------------
function Parent (List : List_Id) return Node_Id is
begin
pragma Assert (List in First_List_Id .. Lists.Last);
return Lists.Table (List).Parent;
end Parent;
----------
-- Pick --
----------
function Pick (List : List_Id; Index : Pos) return Node_Id is
Elmt : Node_Id;
begin
Elmt := First (List);
for J in 1 .. Index - 1 loop
Elmt := Next (Elmt);
end loop;
return Elmt;
end Pick;
-------------
-- Prepend --
-------------
procedure Prepend (Node : Node_Id; To : List_Id) is
F : constant Node_Id := First (To);
begin
pragma Assert (not Is_List_Member (Node));
if Node = Error then
return;
end if;
pragma Debug (Prepend_Debug (Node, To));
if No (F) then
Set_Last (To, Node);
else
Set_Prev (F, Node);
end if;
Set_First (To, Node);
Nodes.Table (Node).In_List := True;
Set_Next (Node, F);
Set_Prev (Node, Empty);
Set_List_Link (Node, To);
end Prepend;
-------------------
-- Prepend_Debug --
-------------------
procedure Prepend_Debug (Node : Node_Id; To : List_Id) is
begin
if Debug_Flag_N then
Write_Str ("Prepend node ");
Write_Int (Int (Node));
Write_Str (" to list ");
Write_Int (Int (To));
Write_Eol;
end if;
end Prepend_Debug;
----------------
-- Prepend_To --
----------------
procedure Prepend_To (To : List_Id; Node : Node_Id) is
begin
Prepend (Node, To);
end Prepend_To;
-------------
-- Present --
-------------
function Present (List : List_Id) return Boolean is
begin
return List /= No_List;
end Present;
----------
-- Prev --
----------
-- This subprogram is deliberately placed early on, out of alphabetical
-- order, so that it can be properly inlined from within this unit.
function Prev (Node : Node_Id) return Node_Id is
begin
pragma Assert (Is_List_Member (Node));
return Prev_Node.Table (Node);
end Prev;
procedure Prev (Node : in out Node_Id) is
begin
Node := Prev (Node);
end Prev;
-----------------------
-- Prev_Node_Address --
-----------------------
function Prev_Node_Address return System.Address is
begin
return Prev_Node.Table (First_Node_Id)'Address;
end Prev_Node_Address;
---------------------
-- Prev_Non_Pragma --
---------------------
function Prev_Non_Pragma (Node : Node_Id) return Node_Id is
N : Node_Id;
begin
N := Node;
loop
N := Prev (N);
exit when Nkind (N) /= N_Pragma;
end loop;
return N;
end Prev_Non_Pragma;
procedure Prev_Non_Pragma (Node : in out Node_Id) is
begin
Node := Prev_Non_Pragma (Node);
end Prev_Non_Pragma;
------------
-- Remove --
------------
procedure Remove (Node : Node_Id) is
Lst : constant List_Id := List_Containing (Node);
Prv : constant Node_Id := Prev (Node);
Nxt : constant Node_Id := Next (Node);
procedure Remove_Debug;
pragma Inline (Remove_Debug);
-- Output debug information if Debug_Flag_N set
procedure Remove_Debug is
begin
if Debug_Flag_N then
Write_Str ("Remove node ");
Write_Int (Int (Node));
Write_Eol;
end if;
end Remove_Debug;
-- Start of processing for Remove
begin
pragma Debug (Remove_Debug);
if No (Prv) then
Set_First (Lst, Nxt);
else
Set_Next (Prv, Nxt);
end if;
if No (Nxt) then
Set_Last (Lst, Prv);
else
Set_Prev (Nxt, Prv);
end if;
Nodes.Table (Node).In_List := False;
Set_Parent (Node, Empty);
end Remove;
-----------------
-- Remove_Head --
-----------------
function Remove_Head (List : List_Id) return Node_Id is
Frst : constant Node_Id := First (List);
procedure Remove_Head_Debug;
pragma Inline (Remove_Head_Debug);
-- Output debug information if Debug_Flag_N set
procedure Remove_Head_Debug is
begin
if Debug_Flag_N then
Write_Str ("Remove head of list ");
Write_Int (Int (List));
Write_Eol;
end if;
end Remove_Head_Debug;
-- Start of processing for Remove_Head
begin
pragma Debug (Remove_Head_Debug);
if Frst = Empty then
return Empty;
else
declare
Nxt : constant Node_Id := Next (Frst);
begin
Set_First (List, Nxt);
if No (Nxt) then
Set_Last (List, Empty);
else
Set_Prev (Nxt, Empty);
end if;
Nodes.Table (Frst).In_List := False;
Set_Parent (Frst, Empty);
return Frst;
end;
end if;
end Remove_Head;
-----------------
-- Remove_Next --
-----------------
function Remove_Next (Node : Node_Id) return Node_Id is
Nxt : constant Node_Id := Next (Node);
begin
if Present (Nxt) then
declare
Nxt2 : constant Node_Id := Next (Nxt);
LC : constant List_Id := List_Containing (Node);
begin
pragma Debug (Remove_Next_Debug (Node));
Set_Next (Node, Nxt2);
if No (Nxt2) then
Set_Last (LC, Node);
else
Set_Prev (Nxt2, Node);
end if;
Nodes.Table (Nxt).In_List := False;
Set_Parent (Nxt, Empty);
end;
end if;
return Nxt;
end Remove_Next;
-----------------------
-- Remove_Next_Debug --
-----------------------
procedure Remove_Next_Debug (Node : Node_Id) is
begin
if Debug_Flag_N then
Write_Str ("Remove next node after ");
Write_Int (Int (Node));
Write_Eol;
end if;
end Remove_Next_Debug;
---------------
-- Set_First --
---------------
-- This subprogram is deliberately placed early on, out of alphabetical
-- order, so that it can be properly inlined from within this unit.
procedure Set_First (List : List_Id; To : Node_Id) is
begin
Lists.Table (List).First := To;
end Set_First;
--------------
-- Set_Last --
--------------
-- This subprogram is deliberately placed early on, out of alphabetical
-- order, so that it can be properly inlined from within this unit.
procedure Set_Last (List : List_Id; To : Node_Id) is
begin
Lists.Table (List).Last := To;
end Set_Last;
-------------------
-- Set_List_Link --
-------------------
-- This subprogram is deliberately placed early on, out of alphabetical
-- order, so that it can be properly inlined from within this unit.
procedure Set_List_Link (Node : Node_Id; To : List_Id) is
begin
Nodes.Table (Node).Link := Union_Id (To);
end Set_List_Link;
--------------
-- Set_Next --
--------------
-- This subprogram is deliberately placed early on, out of alphabetical
-- order, so that it can be properly inlined from within this unit.
procedure Set_Next (Node : Node_Id; To : Node_Id) is
begin
Next_Node.Table (Node) := To;
end Set_Next;
----------------
-- Set_Parent --
----------------
procedure Set_Parent (List : List_Id; Node : Node_Id) is
begin
pragma Assert (List in First_List_Id .. Lists.Last);
Lists.Table (List).Parent := Node;
end Set_Parent;
--------------
-- Set_Prev --
--------------
-- This subprogram is deliberately placed early on, out of alphabetical
-- order, so that it can be properly inlined from within this unit.
procedure Set_Prev (Node : Node_Id; To : Node_Id) is
begin
Prev_Node.Table (Node) := To;
end Set_Prev;
---------------
-- Tree_Read --
---------------
procedure Tree_Read is
begin
Lists.Tree_Read;
Next_Node.Tree_Read;
Prev_Node.Tree_Read;
end Tree_Read;
----------------
-- Tree_Write --
----------------
procedure Tree_Write is
begin
Lists.Tree_Write;
Next_Node.Tree_Write;
Prev_Node.Tree_Write;
end Tree_Write;
end Nlists;
|
------------------------------------------------------------------------------
-- --
-- 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_0112 is
pragma Preelaborate;
Group_0112 : aliased constant Core_Second_Stage
:= (16#00# .. 16#11# => -- 011200 .. 011211
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#13# .. 16#2B# => -- 011213 .. 01122B
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#2C# .. 16#2E# => -- 01122C .. 01122E
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#2F# .. 16#31# => -- 01122F .. 011231
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#32# .. 16#33# => -- 011232 .. 011233
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#34# => -- 011234
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#35# => -- 011235
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Combining_Mark,
(Diacritic
| Grapheme_Base
| Grapheme_Link
| ID_Continue
| XID_Continue => True,
others => False)),
16#36# => -- 011236
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#37# => -- 011237
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#38# .. 16#39# => -- 011238 .. 011239
(Other_Punctuation, Neutral,
Other, Other, S_Term, Break_After,
(STerm
| Terminal_Punctuation
| Grapheme_Base => True,
others => False)),
16#3A# => -- 01123A
(Other_Punctuation, Neutral,
Other, Other, Other, Alphabetic,
(Terminal_Punctuation
| Grapheme_Base => True,
others => False)),
16#3B# .. 16#3C# => -- 01123B .. 01123C
(Other_Punctuation, Neutral,
Other, Other, S_Term, Break_After,
(STerm
| Terminal_Punctuation
| Grapheme_Base => True,
others => False)),
16#3D# => -- 01123D
(Other_Punctuation, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#B0# .. 16#DE# => -- 0112B0 .. 0112DE
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#DF# => -- 0112DF
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#E0# .. 16#E2# => -- 0112E0 .. 0112E2
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#E3# .. 16#E8# => -- 0112E3 .. 0112E8
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#E9# => -- 0112E9
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#EA# => -- 0112EA
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| Grapheme_Link
| ID_Continue
| XID_Continue => True,
others => False)),
16#F0# .. 16#F9# => -- 0112F0 .. 0112F9
(Decimal_Number, Neutral,
Other, Numeric, Numeric, Numeric,
(Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
others =>
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)));
end Matreshka.Internals.Unicode.Ucd.Core_0112;
|
pragma License (Unrestricted);
with Ada.Text_IO;
package Ada.Long_Integer_Text_IO is new Text_IO.Integer_IO (Long_Integer);
|
-- 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 = "BGPView"
type = "api"
function start()
setratelimit(1)
end
function asn(ctx, addr, asn)
local cfg = datasrc_config()
if (cfg == nil) then
return
end
local prefix
if (asn == 0) then
if (addr == "") then
return
end
local ip, prefix = getcidr(ctx, addr, cfg.ttl)
if (ip == "") then
return
end
asn = getasn(ctx, ip, prefix, cfg.ttl)
if (asn == 0) then
return
end
end
local a = asinfo(ctx, asn, cfg.ttl)
if (a == nil) then
return
end
local cidrs = netblocks(ctx, asn, cfg.ttl)
if (cidrs == nil or #cidrs == 0) then
return
end
if (prefix == "") then
prefix = cidrs[1]
parts = split(prefix, "/")
addr = parts[1]
end
newasn(ctx, {
['addr']=addr,
['asn']=asn,
['prefix']=prefix,
['cc']=a.cc,
['registry']=a.registry,
['desc']=a.desc,
['netblocks']=cidrs,
})
end
function getcidr(ctx, addr, ttl)
local resp = cacherequest(ctx, "https://api.bgpview.io/ip/" .. addr, ttl)
if (resp == "") then
return "", 0
end
local j = json.decode(resp)
if (j == nil or j.status ~= "ok" or j.status_message ~= "Query was successful") then
return "", 0
end
local ip = j.data.rir_allocation.ip
local cidr = j.data.rir_allocation.cidr
return ip, cidr
end
function getasn(ctx, ip, cidr, ttl)
local u = "https://api.bgpview.io/prefix/" .. ip .. "/" .. tostring(cidr)
local resp = cacherequest(ctx, u, ttl)
if resp == "" then
return 0
end
local j = json.decode(resp)
if (j == nil or j.status ~= "ok" or j.status_message ~= "Query was successful") then
return 0
end
local last = #(j.data.asns)
if (last == 0) then
return 0
end
return j.data.asns[last].asn
end
function asinfo(ctx, asn, ttl)
resp = cacherequest(ctx, "https://api.bgpview.io/asn/" .. tostring(asn), ttl)
if (resp == "") then
return nil
end
j = json.decode(resp)
if (j == nil or j.status ~= "ok" or j.status_message ~= "Query was successful") then
return nil
end
local registry = ""
if (#(j.data.rir_allocation) > 0) then
registry = j.data.rir_allocation.rir_name
end
local name = ""
if (j.data.name ~= nil) then
name = name .. j.data.name
end
if (j.data.description_full ~= nil) then
name = name .. " -"
for _, desc in pairs(j.data.description_full) do
name = name .. " " .. desc
end
end
return {
['asn']=asn,
desc=name,
cc=j.data.country_code,
['registry']=registry,
}
end
function netblocks(ctx, asn, ttl)
local u = "https://api.bgpview.io/asn/" .. tostring(asn) .. "/prefixes"
local resp = cacherequest(ctx, u, ttl)
if (resp == "") then
return nil
end
local j = json.decode(resp)
if (j == nil or j.status ~= "ok" or j.status_message ~= "Query was successful") then
return nil
end
local netblocks = {}
for i, p in pairs(j.data.ipv4_prefixes) do
table.insert(netblocks, p.ip .. "/" .. tostring(p.cidr))
end
for i, p in pairs(j.data.ipv6_prefixes) do
table.insert(netblocks, p.ip .. "/" .. tostring(p.cidr))
end
return netblocks
end
function cacherequest(ctx, url, ttl)
local resp, err = request(ctx, {
['url']=url,
headers={['Content-Type']="application/json"},
})
if (err ~= nil and err ~= "") then
return ""
end
return resp
end
function split(str, delim)
local result = {}
local pattern = "[^%" .. delim .. "]+"
local matches = find(str, pattern)
if (matches == nil or #matches == 0) then
return result
end
for i, match in pairs(matches) do
table.insert(result, match)
end
return result
end
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 2 --
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains a procedure for runtime concatenation of two string
-- operands. It is used when we want to save space in the generated code.
pragma Compiler_Unit_Warning;
package System.Concat_2 is
procedure Str_Concat_2 (R : out String; S1, S2 : String);
-- Performs the operation R := S1 & S2. The bounds of R are known to be
-- correct (usually set by a call to the Str_Concat_Bounds_2 procedure
-- below), so no bounds checks are required, and it is known that none of
-- the input operands overlaps R. No assumptions can be made about the
-- lower bounds of any of the operands.
procedure Str_Concat_Bounds_2
(Lo, Hi : out Natural;
S1, S2 : String);
-- Assigns to Lo..Hi the bounds of the result of concatenating the two
-- given strings, following the rules in the RM regarding null operands.
end System.Concat_2;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S P R I N T --
-- --
-- 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. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Casing; use Casing;
with Csets; use Csets;
with Debug; use Debug;
with Einfo; use Einfo;
with Fname; use Fname;
with Lib; use Lib;
with Namet; use Namet;
with Nlists; use Nlists;
with Opt; use Opt;
with Output; use Output;
with Rtsfind; use Rtsfind;
with Sinfo; use Sinfo;
with Sinput; use Sinput;
with Sinput.D; use Sinput.D;
with Snames; use Snames;
with Stand; use Stand;
with Stringt; use Stringt;
with Uintp; use Uintp;
with Uname; use Uname;
with Urealp; use Urealp;
package body Sprint is
Debug_Node : Node_Id := Empty;
-- If we are in Debug_Generated_Code mode, then this location is set
-- to the current node requiring Sloc fixup, until Set_Debug_Sloc is
-- called to set the proper value. The call clears it back to Empty.
Debug_Sloc : Source_Ptr;
-- Sloc of first byte of line currently being written if we are
-- generating a source debug file.
Dump_Original_Only : Boolean;
-- Set True if the -gnatdo (dump original tree) flag is set
Dump_Generated_Only : Boolean;
-- Set True if the -gnatG (dump generated tree) debug flag is set
-- or for Print_Generated_Code (-gnatG) or Dump_Generated_Code (-gnatD).
Dump_Freeze_Null : Boolean;
-- Set True if freeze nodes and non-source null statements output
Indent : Int := 0;
-- Number of columns for current line output indentation
Indent_Annull_Flag : Boolean := False;
-- Set True if subsequent Write_Indent call to be ignored, gets reset
-- by this call, so it is only active to suppress a single indent call.
Line_Limit : constant := 72;
-- Limit value for chopping long lines
Freeze_Indent : Int := 0;
-- Keep track of freeze indent level (controls blank lines before
-- procedures within expression freeze actions)
-------------------------------
-- Operator Precedence Table --
-------------------------------
-- This table is used to decide whether a subexpression needs to be
-- parenthesized. The rule is that if an operand of an operator (which
-- for this purpose includes AND THEN and OR ELSE) is itself an operator
-- with a lower precedence than the operator (or equal precedence if
-- appearing as the right operand), then parentheses are required.
Op_Prec : constant array (N_Subexpr) of Short_Short_Integer :=
(N_Op_And => 1,
N_Op_Or => 1,
N_Op_Xor => 1,
N_And_Then => 1,
N_Or_Else => 1,
N_In => 2,
N_Not_In => 2,
N_Op_Eq => 2,
N_Op_Ge => 2,
N_Op_Gt => 2,
N_Op_Le => 2,
N_Op_Lt => 2,
N_Op_Ne => 2,
N_Op_Add => 3,
N_Op_Concat => 3,
N_Op_Subtract => 3,
N_Op_Plus => 3,
N_Op_Minus => 3,
N_Op_Divide => 4,
N_Op_Mod => 4,
N_Op_Rem => 4,
N_Op_Multiply => 4,
N_Op_Expon => 5,
N_Op_Abs => 5,
N_Op_Not => 5,
others => 6);
procedure Sprint_Left_Opnd (N : Node_Id);
-- Print left operand of operator, parenthesizing if necessary
procedure Sprint_Right_Opnd (N : Node_Id);
-- Print right operand of operator, parenthesizing if necessary
-----------------------
-- Local Subprograms --
-----------------------
procedure Col_Check (N : Nat);
-- Check that at least N characters remain on current line, and if not,
-- then start an extra line with two characters extra indentation for
-- continuing text on the next line.
procedure Indent_Annull;
-- Causes following call to Write_Indent to be ignored. This is used when
-- a higher level node wants to stop a lower level node from starting a
-- new line, when it would otherwise be inclined to do so (e.g. the case
-- of an accept statement called from an accept alternative with a guard)
procedure Indent_Begin;
-- Increase indentation level
procedure Indent_End;
-- Decrease indentation level
procedure Note_Implicit_Run_Time_Call (N : Node_Id);
-- N is the Name field of a function call or procedure statement call.
-- The effect of the call is to output a $ if the call is identified as
-- an implicit call to a run time routine.
procedure Print_Debug_Line (S : String);
-- Used to print output lines in Debug_Generated_Code mode (this is used
-- as the argument for a call to Set_Special_Output in package Output).
procedure Process_TFAI_RR_Flags (Nod : Node_Id);
-- Given a divide, multiplication or division node, check the flags
-- Treat_Fixed_As_Integer and Rounded_Flags, and if set, output the
-- appropriate special syntax characters (# and @).
procedure Set_Debug_Sloc;
-- If Debug_Node is non-empty, this routine sets the appropriate value
-- in its Sloc field, from the current location in the debug source file
-- that is currently being written. Note that Debug_Node is always empty
-- if a debug source file is not being written.
procedure Sprint_And_List (List : List_Id);
-- Print the given list with items separated by vertical "and"
procedure Sprint_Bar_List (List : List_Id);
-- Print the given list with items separated by vertical bars
procedure Sprint_Node_Actual (Node : Node_Id);
-- This routine prints its node argument. It is a lower level routine than
-- Sprint_Node, in that it does not bother about rewritten trees.
procedure Sprint_Node_Sloc (Node : Node_Id);
-- Like Sprint_Node, but in addition, in Debug_Generated_Code mode,
-- sets the Sloc of the current debug node to be a copy of the Sloc
-- of the sprinted node Node. Note that this is done after printing
-- Node, so that the Sloc is the proper updated value for the debug file.
procedure Write_Char_Sloc (C : Character);
-- Like Write_Char, except that if C is non-blank, Set_Debug_Sloc is
-- called to ensure that the current node has a proper Sloc set.
procedure Write_Condition_And_Reason (Node : Node_Id);
-- Write Condition and Reason codes of Raise_xxx_Error node
procedure Write_Discr_Specs (N : Node_Id);
-- Ouput discriminant specification for node, which is any of the type
-- declarations that can have discriminants.
procedure Write_Ekind (E : Entity_Id);
-- Write the String corresponding to the Ekind without "E_"
procedure Write_Id (N : Node_Id);
-- N is a node with a Chars field. This procedure writes the name that
-- will be used in the generated code associated with the name. For a
-- node with no associated entity, this is simply the Chars field. For
-- the case where there is an entity associated with the node, we print
-- the name associated with the entity (since it may have been encoded).
-- One other special case is that an entity has an active external name
-- (i.e. an external name present with no address clause), then this
-- external name is output. This procedure also deals with outputting
-- declarations of referenced itypes, if not output earlier.
function Write_Identifiers (Node : Node_Id) return Boolean;
-- Handle node where the grammar has a list of defining identifiers, but
-- the tree has a separate declaration for each identifier. Handles the
-- printing of the defining identifier, and returns True if the type and
-- initialization information is to be printed, False if it is to be
-- skipped (the latter case happens when printing defining identifiers
-- other than the first in the original tree output case).
procedure Write_Implicit_Def (E : Entity_Id);
pragma Warnings (Off, Write_Implicit_Def);
-- Write the definition of the implicit type E according to its Ekind
-- For now a debugging procedure, but might be used in the future.
procedure Write_Indent;
-- Start a new line and write indentation spacing
function Write_Indent_Identifiers (Node : Node_Id) return Boolean;
-- Like Write_Identifiers except that each new printed declaration
-- is at the start of a new line.
function Write_Indent_Identifiers_Sloc (Node : Node_Id) return Boolean;
-- Like Write_Indent_Identifiers except that in Debug_Generated_Code
-- mode, the Sloc of the current debug node is set to point ot the
-- first output identifier.
procedure Write_Indent_Str (S : String);
-- Start a new line and write indent spacing followed by given string
procedure Write_Indent_Str_Sloc (S : String);
-- Like Write_Indent_Str, but in addition, in Debug_Generated_Code mode,
-- the Sloc of the current node is set to the first non-blank character
-- in the string S.
procedure Write_Itype (Typ : Entity_Id);
-- If Typ is an Itype that has not been written yet, write it. If Typ is
-- any other kind of entity or tree node, the call is ignored.
procedure Write_Name_With_Col_Check (N : Name_Id);
-- Write name (using Write_Name) with initial column check, and possible
-- initial Write_Indent (to get new line) if current line is too full.
procedure Write_Name_With_Col_Check_Sloc (N : Name_Id);
-- Like Write_Name_With_Col_Check but in addition, in Debug_Generated_Code
-- mode, sets Sloc of current debug node to first character of name.
procedure Write_Operator (N : Node_Id; S : String);
-- Like Write_Str_Sloc, used for operators, encloses the string in
-- characters {} if the Do_Overflow flag is set on the node N.
procedure Write_Param_Specs (N : Node_Id);
-- Output parameter specifications for node (which is either a function
-- or procedure specification with a Parameter_Specifications field)
procedure Write_Rewrite_Str (S : String);
-- Writes out a string (typically containing <<< or >>>}) for a node
-- created by rewriting the tree. Suppressed if we are outputting the
-- generated code only, since in this case we don't specially mark nodes
-- created by rewriting).
procedure Write_Str_Sloc (S : String);
-- Like Write_Str, but sets debug Sloc of current debug node to first
-- non-blank character if a current debug node is active.
procedure Write_Str_With_Col_Check (S : String);
-- Write string (using Write_Str) with initial column check, and possible
-- initial Write_Indent (to get new line) if current line is too full.
procedure Write_Str_With_Col_Check_Sloc (S : String);
-- Like Write_Str_WIth_Col_Check, but sets debug Sloc of current debug
-- node to first non-blank character if a current debug node is active.
procedure Write_Uint_With_Col_Check (U : Uint; Format : UI_Format);
-- Write Uint (using UI_Write) with initial column check, and possible
-- initial Write_Indent (to get new line) if current line is too full.
-- The format parameter determines the output format (see UI_Write).
procedure Write_Uint_With_Col_Check_Sloc (U : Uint; Format : UI_Format);
-- Write Uint (using UI_Write) with initial column check, and possible
-- initial Write_Indent (to get new line) if current line is too full.
-- The format parameter determines the output format (see UI_Write).
-- In addition, in Debug_Generated_Code mode, sets the current node
-- Sloc to the first character of the output value.
procedure Write_Ureal_With_Col_Check_Sloc (U : Ureal);
-- Write Ureal (using same output format as UR_Write) with column checks
-- and a possible initial Write_Indent (to get new line) if current line
-- is too full. In addition, in Debug_Generated_Code mode, sets the
-- current node Sloc to the first character of the output value.
---------------
-- Col_Check --
---------------
procedure Col_Check (N : Nat) is
begin
if N + Column > Line_Limit then
Write_Indent_Str (" ");
end if;
end Col_Check;
-------------------
-- Indent_Annull --
-------------------
procedure Indent_Annull is
begin
Indent_Annull_Flag := True;
end Indent_Annull;
------------------
-- Indent_Begin --
------------------
procedure Indent_Begin is
begin
Indent := Indent + 3;
end Indent_Begin;
----------------
-- Indent_End --
----------------
procedure Indent_End is
begin
Indent := Indent - 3;
end Indent_End;
---------------------------------
-- Note_Implicit_Run_Time_Call --
---------------------------------
procedure Note_Implicit_Run_Time_Call (N : Node_Id) is
begin
if not Comes_From_Source (N)
and then Is_Entity_Name (N)
then
declare
Ent : constant Entity_Id := Entity (N);
begin
if not In_Extended_Main_Source_Unit (Ent)
and then
Is_Predefined_File_Name
(Unit_File_Name (Get_Source_Unit (Ent)))
then
Col_Check (Length_Of_Name (Chars (Ent)));
Write_Char ('$');
end if;
end;
end if;
end Note_Implicit_Run_Time_Call;
--------
-- pg --
--------
procedure pg (Node : Node_Id) is
begin
Dump_Generated_Only := True;
Dump_Original_Only := False;
Sprint_Node (Node);
Write_Eol;
end pg;
--------
-- po --
--------
procedure po (Node : Node_Id) is
begin
Dump_Generated_Only := False;
Dump_Original_Only := True;
Sprint_Node (Node);
Write_Eol;
end po;
----------------------
-- Print_Debug_Line --
----------------------
procedure Print_Debug_Line (S : String) is
begin
Write_Debug_Line (S, Debug_Sloc);
end Print_Debug_Line;
---------------------------
-- Process_TFAI_RR_Flags --
---------------------------
procedure Process_TFAI_RR_Flags (Nod : Node_Id) is
begin
if Treat_Fixed_As_Integer (Nod) then
Write_Char ('#');
end if;
if Rounded_Result (Nod) then
Write_Char ('@');
end if;
end Process_TFAI_RR_Flags;
--------
-- ps --
--------
procedure ps (Node : Node_Id) is
begin
Dump_Generated_Only := False;
Dump_Original_Only := False;
Sprint_Node (Node);
Write_Eol;
end ps;
--------------------
-- Set_Debug_Sloc --
--------------------
procedure Set_Debug_Sloc is
begin
if Present (Debug_Node) then
Set_Sloc (Debug_Node, Debug_Sloc + Source_Ptr (Column - 1));
Debug_Node := Empty;
end if;
end Set_Debug_Sloc;
-----------------
-- Source_Dump --
-----------------
procedure Source_Dump is
procedure Underline;
-- Put underline under string we just printed
procedure Underline is
Col : constant Int := Column;
begin
Write_Eol;
while Col > Column loop
Write_Char ('-');
end loop;
Write_Eol;
end Underline;
-- Start of processing for Tree_Dump
begin
Dump_Generated_Only := Debug_Flag_G or
Print_Generated_Code or
Debug_Generated_Code;
Dump_Original_Only := Debug_Flag_O;
Dump_Freeze_Null := Debug_Flag_S or Debug_Flag_G;
-- Note that we turn off the tree dump flags immediately, before
-- starting the dump. This avoids generating two copies of the dump
-- if an abort occurs after printing the dump, and more importantly,
-- avoids an infinite loop if an abort occurs during the dump.
if Debug_Flag_Z then
Debug_Flag_Z := False;
Write_Eol;
Write_Eol;
Write_Str ("Source recreated from tree of Standard (spec)");
Underline;
Sprint_Node (Standard_Package_Node);
Write_Eol;
Write_Eol;
end if;
if Debug_Flag_S or Dump_Generated_Only or Dump_Original_Only then
Debug_Flag_G := False;
Debug_Flag_O := False;
Debug_Flag_S := False;
-- Dump requested units
for U in Main_Unit .. Last_Unit loop
-- Dump all units if -gnatdf set, otherwise we dump only
-- the source files that are in the extended main source.
if Debug_Flag_F
or else In_Extended_Main_Source_Unit (Cunit_Entity (U))
then
-- If we are generating debug files, setup to write them
if Debug_Generated_Code then
Set_Special_Output (Print_Debug_Line'Access);
Create_Debug_Source (Source_Index (U), Debug_Sloc);
Sprint_Node (Cunit (U));
Write_Eol;
Close_Debug_Source;
Set_Special_Output (null);
-- Normal output to standard output file
else
Write_Str ("Source recreated from tree for ");
Write_Unit_Name (Unit_Name (U));
Underline;
Sprint_Node (Cunit (U));
Write_Eol;
Write_Eol;
end if;
end if;
end loop;
end if;
end Source_Dump;
---------------------
-- Sprint_And_List --
---------------------
procedure Sprint_And_List (List : List_Id) is
Node : Node_Id;
begin
if Is_Non_Empty_List (List) then
Node := First (List);
loop
Sprint_Node (Node);
Next (Node);
exit when Node = Empty;
Write_Str (" and ");
end loop;
end if;
end Sprint_And_List;
---------------------
-- Sprint_Bar_List --
---------------------
procedure Sprint_Bar_List (List : List_Id) is
Node : Node_Id;
begin
if Is_Non_Empty_List (List) then
Node := First (List);
loop
Sprint_Node (Node);
Next (Node);
exit when Node = Empty;
Write_Str (" | ");
end loop;
end if;
end Sprint_Bar_List;
-----------------------
-- Sprint_Comma_List --
-----------------------
procedure Sprint_Comma_List (List : List_Id) is
Node : Node_Id;
begin
if Is_Non_Empty_List (List) then
Node := First (List);
loop
Sprint_Node (Node);
Next (Node);
exit when Node = Empty;
if not Is_Rewrite_Insertion (Node)
or else not Dump_Original_Only
then
Write_Str (", ");
end if;
end loop;
end if;
end Sprint_Comma_List;
--------------------------
-- Sprint_Indented_List --
--------------------------
procedure Sprint_Indented_List (List : List_Id) is
begin
Indent_Begin;
Sprint_Node_List (List);
Indent_End;
end Sprint_Indented_List;
---------------------
-- Sprint_Left_Opnd --
---------------------
procedure Sprint_Left_Opnd (N : Node_Id) is
Opnd : constant Node_Id := Left_Opnd (N);
begin
if Paren_Count (Opnd) /= 0
or else Op_Prec (Nkind (Opnd)) >= Op_Prec (Nkind (N))
then
Sprint_Node (Opnd);
else
Write_Char ('(');
Sprint_Node (Opnd);
Write_Char (')');
end if;
end Sprint_Left_Opnd;
-----------------
-- Sprint_Node --
-----------------
procedure Sprint_Node (Node : Node_Id) is
begin
if Is_Rewrite_Insertion (Node) then
if not Dump_Original_Only then
-- For special cases of nodes that always output <<< >>>
-- do not duplicate the output at this point.
if Nkind (Node) = N_Freeze_Entity
or else Nkind (Node) = N_Implicit_Label_Declaration
then
Sprint_Node_Actual (Node);
-- Normal case where <<< >>> may be required
else
Write_Rewrite_Str ("<<<");
Sprint_Node_Actual (Node);
Write_Rewrite_Str (">>>");
end if;
end if;
elsif Is_Rewrite_Substitution (Node) then
-- Case of dump generated only
if Dump_Generated_Only then
Sprint_Node_Actual (Node);
-- Case of dump original only
elsif Dump_Original_Only then
Sprint_Node_Actual (Original_Node (Node));
-- Case of both being dumped
else
Sprint_Node_Actual (Original_Node (Node));
Write_Rewrite_Str ("<<<");
Sprint_Node_Actual (Node);
Write_Rewrite_Str (">>>");
end if;
else
Sprint_Node_Actual (Node);
end if;
end Sprint_Node;
------------------------
-- Sprint_Node_Actual --
------------------------
procedure Sprint_Node_Actual (Node : Node_Id) is
Save_Debug_Node : constant Node_Id := Debug_Node;
begin
if Node = Empty then
return;
end if;
for J in 1 .. Paren_Count (Node) loop
Write_Str_With_Col_Check ("(");
end loop;
-- Setup node for Sloc fixup if writing a debug source file. Note
-- that we take care of any previous node not yet properly set.
if Debug_Generated_Code then
Debug_Node := Node;
end if;
if Nkind (Node) in N_Subexpr
and then Do_Range_Check (Node)
then
Write_Str_With_Col_Check ("{");
end if;
-- Select print circuit based on node kind
case Nkind (Node) is
when N_Abort_Statement =>
Write_Indent_Str_Sloc ("abort ");
Sprint_Comma_List (Names (Node));
Write_Char (';');
when N_Abortable_Part =>
Set_Debug_Sloc;
Write_Str_Sloc ("abort ");
Sprint_Indented_List (Statements (Node));
when N_Abstract_Subprogram_Declaration =>
Write_Indent;
Sprint_Node (Specification (Node));
Write_Str_With_Col_Check (" is ");
Write_Str_Sloc ("abstract;");
when N_Accept_Alternative =>
Sprint_Node_List (Pragmas_Before (Node));
if Present (Condition (Node)) then
Write_Indent_Str ("when ");
Sprint_Node (Condition (Node));
Write_Str (" => ");
Indent_Annull;
end if;
Sprint_Node_Sloc (Accept_Statement (Node));
Sprint_Node_List (Statements (Node));
when N_Accept_Statement =>
Write_Indent_Str_Sloc ("accept ");
Write_Id (Entry_Direct_Name (Node));
if Present (Entry_Index (Node)) then
Write_Str_With_Col_Check (" (");
Sprint_Node (Entry_Index (Node));
Write_Char (')');
end if;
Write_Param_Specs (Node);
if Present (Handled_Statement_Sequence (Node)) then
Write_Str_With_Col_Check (" do");
Sprint_Node (Handled_Statement_Sequence (Node));
Write_Indent_Str ("end ");
Write_Id (Entry_Direct_Name (Node));
end if;
Write_Char (';');
when N_Access_Definition =>
-- Ada 2005 (AI-254)
if Present (Access_To_Subprogram_Definition (Node)) then
Sprint_Node (Access_To_Subprogram_Definition (Node));
else
-- Ada 2005 (AI-231)
if Null_Exclusion_Present (Node) then
Write_Str ("not null ");
end if;
Write_Str_With_Col_Check_Sloc ("access ");
if All_Present (Node) then
Write_Str ("all ");
elsif Constant_Present (Node) then
Write_Str ("constant ");
end if;
Sprint_Node (Subtype_Mark (Node));
end if;
when N_Access_Function_Definition =>
-- Ada 2005 (AI-231)
if Null_Exclusion_Present (Node) then
Write_Str ("not null ");
end if;
Write_Str_With_Col_Check_Sloc ("access ");
if Protected_Present (Node) then
Write_Str_With_Col_Check ("protected ");
end if;
Write_Str_With_Col_Check ("function");
Write_Param_Specs (Node);
Write_Str_With_Col_Check (" return ");
Sprint_Node (Result_Definition (Node));
when N_Access_Procedure_Definition =>
-- Ada 2005 (AI-231)
if Null_Exclusion_Present (Node) then
Write_Str ("not null ");
end if;
Write_Str_With_Col_Check_Sloc ("access ");
if Protected_Present (Node) then
Write_Str_With_Col_Check ("protected ");
end if;
Write_Str_With_Col_Check ("procedure");
Write_Param_Specs (Node);
when N_Access_To_Object_Definition =>
Write_Str_With_Col_Check_Sloc ("access ");
if All_Present (Node) then
Write_Str_With_Col_Check ("all ");
elsif Constant_Present (Node) then
Write_Str_With_Col_Check ("constant ");
end if;
-- Ada 2005 (AI-231)
if Null_Exclusion_Present (Node) then
Write_Str ("not null ");
end if;
Sprint_Node (Subtype_Indication (Node));
when N_Aggregate =>
if Null_Record_Present (Node) then
Write_Str_With_Col_Check_Sloc ("(null record)");
else
Write_Str_With_Col_Check_Sloc ("(");
if Present (Expressions (Node)) then
Sprint_Comma_List (Expressions (Node));
if Present (Component_Associations (Node)) then
Write_Str (", ");
end if;
end if;
if Present (Component_Associations (Node)) then
Indent_Begin;
declare
Nd : Node_Id;
begin
Nd := First (Component_Associations (Node));
loop
Write_Indent;
Sprint_Node (Nd);
Next (Nd);
exit when No (Nd);
if not Is_Rewrite_Insertion (Nd)
or else not Dump_Original_Only
then
Write_Str (", ");
end if;
end loop;
end;
Indent_End;
end if;
Write_Char (')');
end if;
when N_Allocator =>
Write_Str_With_Col_Check_Sloc ("new ");
-- Ada 2005 (AI-231)
if Null_Exclusion_Present (Node) then
Write_Str ("not null ");
end if;
Sprint_Node (Expression (Node));
if Present (Storage_Pool (Node)) then
Write_Str_With_Col_Check ("[storage_pool = ");
Sprint_Node (Storage_Pool (Node));
Write_Char (']');
end if;
when N_And_Then =>
Sprint_Left_Opnd (Node);
Write_Str_Sloc (" and then ");
Sprint_Right_Opnd (Node);
when N_At_Clause =>
Write_Indent_Str_Sloc ("for ");
Write_Id (Identifier (Node));
Write_Str_With_Col_Check (" use at ");
Sprint_Node (Expression (Node));
Write_Char (';');
when N_Assignment_Statement =>
Write_Indent;
Sprint_Node (Name (Node));
Write_Str_Sloc (" := ");
Sprint_Node (Expression (Node));
Write_Char (';');
when N_Asynchronous_Select =>
Write_Indent_Str_Sloc ("select");
Indent_Begin;
Sprint_Node (Triggering_Alternative (Node));
Indent_End;
-- Note: let the printing of Abortable_Part handle outputting
-- the ABORT keyword, so that the Slco can be set correctly.
Write_Indent_Str ("then ");
Sprint_Node (Abortable_Part (Node));
Write_Indent_Str ("end select;");
when N_Attribute_Definition_Clause =>
Write_Indent_Str_Sloc ("for ");
Sprint_Node (Name (Node));
Write_Char (''');
Write_Name_With_Col_Check (Chars (Node));
Write_Str_With_Col_Check (" use ");
Sprint_Node (Expression (Node));
Write_Char (';');
when N_Attribute_Reference =>
if Is_Procedure_Attribute_Name (Attribute_Name (Node)) then
Write_Indent;
end if;
Sprint_Node (Prefix (Node));
Write_Char_Sloc (''');
Write_Name_With_Col_Check (Attribute_Name (Node));
Sprint_Paren_Comma_List (Expressions (Node));
if Is_Procedure_Attribute_Name (Attribute_Name (Node)) then
Write_Char (';');
end if;
when N_Block_Statement =>
Write_Indent;
if Present (Identifier (Node))
and then (not Has_Created_Identifier (Node)
or else not Dump_Original_Only)
then
Write_Rewrite_Str ("<<<");
Write_Id (Identifier (Node));
Write_Str (" : ");
Write_Rewrite_Str (">>>");
end if;
if Present (Declarations (Node)) then
Write_Str_With_Col_Check_Sloc ("declare");
Sprint_Indented_List (Declarations (Node));
Write_Indent;
end if;
Write_Str_With_Col_Check_Sloc ("begin");
Sprint_Node (Handled_Statement_Sequence (Node));
Write_Indent_Str ("end");
if Present (Identifier (Node))
and then (not Has_Created_Identifier (Node)
or else not Dump_Original_Only)
then
Write_Rewrite_Str ("<<<");
Write_Char (' ');
Write_Id (Identifier (Node));
Write_Rewrite_Str (">>>");
end if;
Write_Char (';');
when N_Case_Statement =>
Write_Indent_Str_Sloc ("case ");
Sprint_Node (Expression (Node));
Write_Str (" is");
Sprint_Indented_List (Alternatives (Node));
Write_Indent_Str ("end case;");
when N_Case_Statement_Alternative =>
Write_Indent_Str_Sloc ("when ");
Sprint_Bar_List (Discrete_Choices (Node));
Write_Str (" => ");
Sprint_Indented_List (Statements (Node));
when N_Character_Literal =>
if Column > 70 then
Write_Indent_Str (" ");
end if;
Write_Char_Sloc (''');
Write_Char_Code (UI_To_CC (Char_Literal_Value (Node)));
Write_Char (''');
when N_Code_Statement =>
Write_Indent;
Set_Debug_Sloc;
Sprint_Node (Expression (Node));
Write_Char (';');
when N_Compilation_Unit =>
Sprint_Node_List (Context_Items (Node));
Sprint_Opt_Node_List (Declarations (Aux_Decls_Node (Node)));
if Private_Present (Node) then
Write_Indent_Str ("private ");
Indent_Annull;
end if;
Sprint_Node_Sloc (Unit (Node));
if Present (Actions (Aux_Decls_Node (Node)))
or else
Present (Pragmas_After (Aux_Decls_Node (Node)))
then
Write_Indent;
end if;
Sprint_Opt_Node_List (Actions (Aux_Decls_Node (Node)));
Sprint_Opt_Node_List (Pragmas_After (Aux_Decls_Node (Node)));
when N_Compilation_Unit_Aux =>
null; -- nothing to do, never used, see above
when N_Component_Association =>
Set_Debug_Sloc;
Sprint_Bar_List (Choices (Node));
Write_Str (" => ");
-- Ada 2005 (AI-287): Print the box if present
if Box_Present (Node) then
Write_Str_With_Col_Check ("<>");
else
Sprint_Node (Expression (Node));
end if;
when N_Component_Clause =>
Write_Indent;
Sprint_Node (Component_Name (Node));
Write_Str_Sloc (" at ");
Sprint_Node (Position (Node));
Write_Char (' ');
Write_Str_With_Col_Check ("range ");
Sprint_Node (First_Bit (Node));
Write_Str (" .. ");
Sprint_Node (Last_Bit (Node));
Write_Char (';');
when N_Component_Definition =>
Set_Debug_Sloc;
-- Ada 2005 (AI-230): Access definition components
if Present (Access_Definition (Node)) then
Sprint_Node (Access_Definition (Node));
elsif Present (Subtype_Indication (Node)) then
if Aliased_Present (Node) then
Write_Str_With_Col_Check ("aliased ");
end if;
-- Ada 2005 (AI-231)
if Null_Exclusion_Present (Node) then
Write_Str (" not null ");
end if;
Sprint_Node (Subtype_Indication (Node));
else
Write_Str (" ??? ");
end if;
when N_Component_Declaration =>
if Write_Indent_Identifiers_Sloc (Node) then
Write_Str (" : ");
Sprint_Node (Component_Definition (Node));
if Present (Expression (Node)) then
Write_Str (" := ");
Sprint_Node (Expression (Node));
end if;
Write_Char (';');
end if;
when N_Component_List =>
if Null_Present (Node) then
Indent_Begin;
Write_Indent_Str_Sloc ("null");
Write_Char (';');
Indent_End;
else
Set_Debug_Sloc;
Sprint_Indented_List (Component_Items (Node));
Sprint_Node (Variant_Part (Node));
end if;
when N_Conditional_Entry_Call =>
Write_Indent_Str_Sloc ("select");
Indent_Begin;
Sprint_Node (Entry_Call_Alternative (Node));
Indent_End;
Write_Indent_Str ("else");
Sprint_Indented_List (Else_Statements (Node));
Write_Indent_Str ("end select;");
when N_Conditional_Expression =>
declare
Condition : constant Node_Id := First (Expressions (Node));
Then_Expr : constant Node_Id := Next (Condition);
Else_Expr : constant Node_Id := Next (Then_Expr);
begin
Write_Str_With_Col_Check_Sloc ("(if ");
Sprint_Node (Condition);
Write_Str_With_Col_Check (" then ");
Sprint_Node (Then_Expr);
Write_Str_With_Col_Check (" else ");
Sprint_Node (Else_Expr);
Write_Char (')');
end;
when N_Constrained_Array_Definition =>
Write_Str_With_Col_Check_Sloc ("array ");
Sprint_Paren_Comma_List (Discrete_Subtype_Definitions (Node));
Write_Str (" of ");
Sprint_Node (Component_Definition (Node));
when N_Decimal_Fixed_Point_Definition =>
Write_Str_With_Col_Check_Sloc (" delta ");
Sprint_Node (Delta_Expression (Node));
Write_Str_With_Col_Check ("digits ");
Sprint_Node (Digits_Expression (Node));
Sprint_Opt_Node (Real_Range_Specification (Node));
when N_Defining_Character_Literal =>
Write_Name_With_Col_Check_Sloc (Chars (Node));
when N_Defining_Identifier =>
Set_Debug_Sloc;
Write_Id (Node);
when N_Defining_Operator_Symbol =>
Write_Name_With_Col_Check_Sloc (Chars (Node));
when N_Defining_Program_Unit_Name =>
Set_Debug_Sloc;
Sprint_Node (Name (Node));
Write_Char ('.');
Write_Id (Defining_Identifier (Node));
when N_Delay_Alternative =>
Sprint_Node_List (Pragmas_Before (Node));
if Present (Condition (Node)) then
Write_Indent;
Write_Str_With_Col_Check ("when ");
Sprint_Node (Condition (Node));
Write_Str (" => ");
Indent_Annull;
end if;
Sprint_Node_Sloc (Delay_Statement (Node));
Sprint_Node_List (Statements (Node));
when N_Delay_Relative_Statement =>
Write_Indent_Str_Sloc ("delay ");
Sprint_Node (Expression (Node));
Write_Char (';');
when N_Delay_Until_Statement =>
Write_Indent_Str_Sloc ("delay until ");
Sprint_Node (Expression (Node));
Write_Char (';');
when N_Delta_Constraint =>
Write_Str_With_Col_Check_Sloc ("delta ");
Sprint_Node (Delta_Expression (Node));
Sprint_Opt_Node (Range_Constraint (Node));
when N_Derived_Type_Definition =>
if Abstract_Present (Node) then
Write_Str_With_Col_Check ("abstract ");
end if;
Write_Str_With_Col_Check_Sloc ("new ");
-- Ada 2005 (AI-231)
if Null_Exclusion_Present (Node) then
Write_Str_With_Col_Check ("not null ");
end if;
Sprint_Node (Subtype_Indication (Node));
if Present (Interface_List (Node)) then
Sprint_And_List (Interface_List (Node));
Write_Str_With_Col_Check (" with ");
end if;
if Present (Record_Extension_Part (Node)) then
if No (Interface_List (Node)) then
Write_Str_With_Col_Check (" with ");
end if;
Sprint_Node (Record_Extension_Part (Node));
end if;
when N_Designator =>
Sprint_Node (Name (Node));
Write_Char_Sloc ('.');
Write_Id (Identifier (Node));
when N_Digits_Constraint =>
Write_Str_With_Col_Check_Sloc ("digits ");
Sprint_Node (Digits_Expression (Node));
Sprint_Opt_Node (Range_Constraint (Node));
when N_Discriminant_Association =>
Set_Debug_Sloc;
if Present (Selector_Names (Node)) then
Sprint_Bar_List (Selector_Names (Node));
Write_Str (" => ");
end if;
Set_Debug_Sloc;
Sprint_Node (Expression (Node));
when N_Discriminant_Specification =>
Set_Debug_Sloc;
if Write_Identifiers (Node) then
Write_Str (" : ");
if Null_Exclusion_Present (Node) then
Write_Str ("not null ");
end if;
Sprint_Node (Discriminant_Type (Node));
if Present (Expression (Node)) then
Write_Str (" := ");
Sprint_Node (Expression (Node));
end if;
else
Write_Str (", ");
end if;
when N_Elsif_Part =>
Write_Indent_Str_Sloc ("elsif ");
Sprint_Node (Condition (Node));
Write_Str_With_Col_Check (" then");
Sprint_Indented_List (Then_Statements (Node));
when N_Empty =>
null;
when N_Entry_Body =>
Write_Indent_Str_Sloc ("entry ");
Write_Id (Defining_Identifier (Node));
Sprint_Node (Entry_Body_Formal_Part (Node));
Write_Str_With_Col_Check (" is");
Sprint_Indented_List (Declarations (Node));
Write_Indent_Str ("begin");
Sprint_Node (Handled_Statement_Sequence (Node));
Write_Indent_Str ("end ");
Write_Id (Defining_Identifier (Node));
Write_Char (';');
when N_Entry_Body_Formal_Part =>
if Present (Entry_Index_Specification (Node)) then
Write_Str_With_Col_Check_Sloc (" (");
Sprint_Node (Entry_Index_Specification (Node));
Write_Char (')');
end if;
Write_Param_Specs (Node);
Write_Str_With_Col_Check_Sloc (" when ");
Sprint_Node (Condition (Node));
when N_Entry_Call_Alternative =>
Sprint_Node_List (Pragmas_Before (Node));
Sprint_Node_Sloc (Entry_Call_Statement (Node));
Sprint_Node_List (Statements (Node));
when N_Entry_Call_Statement =>
Write_Indent;
Sprint_Node_Sloc (Name (Node));
Sprint_Opt_Paren_Comma_List (Parameter_Associations (Node));
Write_Char (';');
when N_Entry_Declaration =>
Write_Indent_Str_Sloc ("entry ");
Write_Id (Defining_Identifier (Node));
if Present (Discrete_Subtype_Definition (Node)) then
Write_Str_With_Col_Check (" (");
Sprint_Node (Discrete_Subtype_Definition (Node));
Write_Char (')');
end if;
Write_Param_Specs (Node);
Write_Char (';');
when N_Entry_Index_Specification =>
Write_Str_With_Col_Check_Sloc ("for ");
Write_Id (Defining_Identifier (Node));
Write_Str_With_Col_Check (" in ");
Sprint_Node (Discrete_Subtype_Definition (Node));
when N_Enumeration_Representation_Clause =>
Write_Indent_Str_Sloc ("for ");
Write_Id (Identifier (Node));
Write_Str_With_Col_Check (" use ");
Sprint_Node (Array_Aggregate (Node));
Write_Char (';');
when N_Enumeration_Type_Definition =>
Set_Debug_Sloc;
-- Skip attempt to print Literals field if it's not there and
-- we are in package Standard (case of Character, which is
-- handled specially (without an explicit literals list).
if Sloc (Node) > Standard_Location
or else Present (Literals (Node))
then
Sprint_Paren_Comma_List (Literals (Node));
end if;
when N_Error =>
Write_Str_With_Col_Check_Sloc ("<error>");
when N_Exception_Declaration =>
if Write_Indent_Identifiers (Node) then
Write_Str_With_Col_Check (" : ");
Write_Str_Sloc ("exception;");
end if;
when N_Exception_Handler =>
Write_Indent_Str_Sloc ("when ");
if Present (Choice_Parameter (Node)) then
Sprint_Node (Choice_Parameter (Node));
Write_Str (" : ");
end if;
Sprint_Bar_List (Exception_Choices (Node));
Write_Str (" => ");
Sprint_Indented_List (Statements (Node));
when N_Exception_Renaming_Declaration =>
Write_Indent;
Set_Debug_Sloc;
Sprint_Node (Defining_Identifier (Node));
Write_Str_With_Col_Check (" : exception renames ");
Sprint_Node (Name (Node));
Write_Char (';');
when N_Exit_Statement =>
Write_Indent_Str_Sloc ("exit");
Sprint_Opt_Node (Name (Node));
if Present (Condition (Node)) then
Write_Str_With_Col_Check (" when ");
Sprint_Node (Condition (Node));
end if;
Write_Char (';');
when N_Expanded_Name =>
Sprint_Node (Prefix (Node));
Write_Char_Sloc ('.');
Sprint_Node (Selector_Name (Node));
when N_Explicit_Dereference =>
Sprint_Node (Prefix (Node));
Write_Char_Sloc ('.');
Write_Str_Sloc ("all");
when N_Extension_Aggregate =>
Write_Str_With_Col_Check_Sloc ("(");
Sprint_Node (Ancestor_Part (Node));
Write_Str_With_Col_Check (" with ");
if Null_Record_Present (Node) then
Write_Str_With_Col_Check ("null record");
else
if Present (Expressions (Node)) then
Sprint_Comma_List (Expressions (Node));
if Present (Component_Associations (Node)) then
Write_Str (", ");
end if;
end if;
if Present (Component_Associations (Node)) then
Sprint_Comma_List (Component_Associations (Node));
end if;
end if;
Write_Char (')');
when N_Floating_Point_Definition =>
Write_Str_With_Col_Check_Sloc ("digits ");
Sprint_Node (Digits_Expression (Node));
Sprint_Opt_Node (Real_Range_Specification (Node));
when N_Formal_Decimal_Fixed_Point_Definition =>
Write_Str_With_Col_Check_Sloc ("delta <> digits <>");
when N_Formal_Derived_Type_Definition =>
Write_Str_With_Col_Check_Sloc ("new ");
Sprint_Node (Subtype_Mark (Node));
if Private_Present (Node) then
Write_Str_With_Col_Check (" with private");
end if;
when N_Formal_Abstract_Subprogram_Declaration =>
Write_Indent_Str_Sloc ("with ");
Sprint_Node (Specification (Node));
Write_Str_With_Col_Check (" is abstract");
if Box_Present (Node) then
Write_Str_With_Col_Check (" <>");
elsif Present (Default_Name (Node)) then
Write_Str_With_Col_Check (" ");
Sprint_Node (Default_Name (Node));
end if;
Write_Char (';');
when N_Formal_Concrete_Subprogram_Declaration =>
Write_Indent_Str_Sloc ("with ");
Sprint_Node (Specification (Node));
if Box_Present (Node) then
Write_Str_With_Col_Check (" is <>");
elsif Present (Default_Name (Node)) then
Write_Str_With_Col_Check (" is ");
Sprint_Node (Default_Name (Node));
end if;
Write_Char (';');
when N_Formal_Discrete_Type_Definition =>
Write_Str_With_Col_Check_Sloc ("<>");
when N_Formal_Floating_Point_Definition =>
Write_Str_With_Col_Check_Sloc ("digits <>");
when N_Formal_Modular_Type_Definition =>
Write_Str_With_Col_Check_Sloc ("mod <>");
when N_Formal_Object_Declaration =>
Set_Debug_Sloc;
if Write_Indent_Identifiers (Node) then
Write_Str (" : ");
if In_Present (Node) then
Write_Str_With_Col_Check ("in ");
end if;
if Out_Present (Node) then
Write_Str_With_Col_Check ("out ");
end if;
Sprint_Node (Subtype_Mark (Node));
if Present (Expression (Node)) then
Write_Str (" := ");
Sprint_Node (Expression (Node));
end if;
Write_Char (';');
end if;
when N_Formal_Ordinary_Fixed_Point_Definition =>
Write_Str_With_Col_Check_Sloc ("delta <>");
when N_Formal_Package_Declaration =>
Write_Indent_Str_Sloc ("with package ");
Write_Id (Defining_Identifier (Node));
Write_Str_With_Col_Check (" is new ");
Sprint_Node (Name (Node));
Write_Str_With_Col_Check (" (<>);");
when N_Formal_Private_Type_Definition =>
if Abstract_Present (Node) then
Write_Str_With_Col_Check ("abstract ");
end if;
if Tagged_Present (Node) then
Write_Str_With_Col_Check ("tagged ");
end if;
if Limited_Present (Node) then
Write_Str_With_Col_Check ("limited ");
end if;
Write_Str_With_Col_Check_Sloc ("private");
when N_Formal_Signed_Integer_Type_Definition =>
Write_Str_With_Col_Check_Sloc ("range <>");
when N_Formal_Type_Declaration =>
Write_Indent_Str_Sloc ("type ");
Write_Id (Defining_Identifier (Node));
if Present (Discriminant_Specifications (Node)) then
Write_Discr_Specs (Node);
elsif Unknown_Discriminants_Present (Node) then
Write_Str_With_Col_Check ("(<>)");
end if;
Write_Str_With_Col_Check (" is ");
Sprint_Node (Formal_Type_Definition (Node));
Write_Char (';');
when N_Free_Statement =>
Write_Indent_Str_Sloc ("free ");
Sprint_Node (Expression (Node));
Write_Char (';');
when N_Freeze_Entity =>
if Dump_Original_Only then
null;
elsif Present (Actions (Node)) or else Dump_Freeze_Null then
Write_Indent;
Write_Rewrite_Str ("<<<");
Write_Str_With_Col_Check_Sloc ("freeze ");
Write_Id (Entity (Node));
Write_Str (" [");
if No (Actions (Node)) then
Write_Char (']');
else
Freeze_Indent := Freeze_Indent + 1;
Sprint_Indented_List (Actions (Node));
Freeze_Indent := Freeze_Indent - 1;
Write_Indent_Str ("]");
end if;
Write_Rewrite_Str (">>>");
end if;
when N_Full_Type_Declaration =>
Write_Indent_Str_Sloc ("type ");
Write_Id (Defining_Identifier (Node));
Write_Discr_Specs (Node);
Write_Str_With_Col_Check (" is ");
Sprint_Node (Type_Definition (Node));
Write_Char (';');
when N_Function_Call =>
Set_Debug_Sloc;
Note_Implicit_Run_Time_Call (Name (Node));
Sprint_Node (Name (Node));
Sprint_Opt_Paren_Comma_List (Parameter_Associations (Node));
when N_Function_Instantiation =>
Write_Indent_Str_Sloc ("function ");
Sprint_Node (Defining_Unit_Name (Node));
Write_Str_With_Col_Check (" is new ");
Sprint_Node (Name (Node));
Sprint_Opt_Paren_Comma_List (Generic_Associations (Node));
Write_Char (';');
when N_Function_Specification =>
Write_Str_With_Col_Check_Sloc ("function ");
Sprint_Node (Defining_Unit_Name (Node));
Write_Param_Specs (Node);
Write_Str_With_Col_Check (" return ");
-- Ada 2005 (AI-231)
if Nkind (Result_Definition (Node)) /= N_Access_Definition
and then Null_Exclusion_Present (Node)
then
Write_Str (" not null ");
end if;
Sprint_Node (Result_Definition (Node));
when N_Generic_Association =>
Set_Debug_Sloc;
if Present (Selector_Name (Node)) then
Sprint_Node (Selector_Name (Node));
Write_Str (" => ");
end if;
Sprint_Node (Explicit_Generic_Actual_Parameter (Node));
when N_Generic_Function_Renaming_Declaration =>
Write_Indent_Str_Sloc ("generic function ");
Sprint_Node (Defining_Unit_Name (Node));
Write_Str_With_Col_Check (" renames ");
Sprint_Node (Name (Node));
Write_Char (';');
when N_Generic_Package_Declaration =>
Write_Indent;
Write_Indent_Str_Sloc ("generic ");
Sprint_Indented_List (Generic_Formal_Declarations (Node));
Write_Indent;
Sprint_Node (Specification (Node));
Write_Char (';');
when N_Generic_Package_Renaming_Declaration =>
Write_Indent_Str_Sloc ("generic package ");
Sprint_Node (Defining_Unit_Name (Node));
Write_Str_With_Col_Check (" renames ");
Sprint_Node (Name (Node));
Write_Char (';');
when N_Generic_Procedure_Renaming_Declaration =>
Write_Indent_Str_Sloc ("generic procedure ");
Sprint_Node (Defining_Unit_Name (Node));
Write_Str_With_Col_Check (" renames ");
Sprint_Node (Name (Node));
Write_Char (';');
when N_Generic_Subprogram_Declaration =>
Write_Indent;
Write_Indent_Str_Sloc ("generic ");
Sprint_Indented_List (Generic_Formal_Declarations (Node));
Write_Indent;
Sprint_Node (Specification (Node));
Write_Char (';');
when N_Goto_Statement =>
Write_Indent_Str_Sloc ("goto ");
Sprint_Node (Name (Node));
Write_Char (';');
if Nkind (Next (Node)) = N_Label then
Write_Indent;
end if;
when N_Handled_Sequence_Of_Statements =>
Set_Debug_Sloc;
Sprint_Indented_List (Statements (Node));
if Present (Exception_Handlers (Node)) then
Write_Indent_Str ("exception");
Indent_Begin;
Sprint_Node_List (Exception_Handlers (Node));
Indent_End;
end if;
if Present (At_End_Proc (Node)) then
Write_Indent_Str ("at end");
Indent_Begin;
Write_Indent;
Sprint_Node (At_End_Proc (Node));
Write_Char (';');
Indent_End;
end if;
when N_Identifier =>
Set_Debug_Sloc;
Write_Id (Node);
when N_If_Statement =>
Write_Indent_Str_Sloc ("if ");
Sprint_Node (Condition (Node));
Write_Str_With_Col_Check (" then");
Sprint_Indented_List (Then_Statements (Node));
Sprint_Opt_Node_List (Elsif_Parts (Node));
if Present (Else_Statements (Node)) then
Write_Indent_Str ("else");
Sprint_Indented_List (Else_Statements (Node));
end if;
Write_Indent_Str ("end if;");
when N_Implicit_Label_Declaration =>
if not Dump_Original_Only then
Write_Indent;
Write_Rewrite_Str ("<<<");
Set_Debug_Sloc;
Write_Id (Defining_Identifier (Node));
Write_Str (" : ");
Write_Str_With_Col_Check ("label");
Write_Rewrite_Str (">>>");
end if;
when N_In =>
Sprint_Left_Opnd (Node);
Write_Str_Sloc (" in ");
Sprint_Right_Opnd (Node);
when N_Incomplete_Type_Declaration =>
Write_Indent_Str_Sloc ("type ");
Write_Id (Defining_Identifier (Node));
if Present (Discriminant_Specifications (Node)) then
Write_Discr_Specs (Node);
elsif Unknown_Discriminants_Present (Node) then
Write_Str_With_Col_Check ("(<>)");
end if;
Write_Char (';');
when N_Index_Or_Discriminant_Constraint =>
Set_Debug_Sloc;
Sprint_Paren_Comma_List (Constraints (Node));
when N_Indexed_Component =>
Sprint_Node_Sloc (Prefix (Node));
Sprint_Opt_Paren_Comma_List (Expressions (Node));
when N_Integer_Literal =>
if Print_In_Hex (Node) then
Write_Uint_With_Col_Check_Sloc (Intval (Node), Hex);
else
Write_Uint_With_Col_Check_Sloc (Intval (Node), Auto);
end if;
when N_Iteration_Scheme =>
if Present (Condition (Node)) then
Write_Str_With_Col_Check_Sloc ("while ");
Sprint_Node (Condition (Node));
else
Write_Str_With_Col_Check_Sloc ("for ");
Sprint_Node (Loop_Parameter_Specification (Node));
end if;
Write_Char (' ');
when N_Itype_Reference =>
Write_Indent_Str_Sloc ("reference ");
Write_Id (Itype (Node));
when N_Label =>
Write_Indent_Str_Sloc ("<<");
Write_Id (Identifier (Node));
Write_Str (">>");
when N_Loop_Parameter_Specification =>
Set_Debug_Sloc;
Write_Id (Defining_Identifier (Node));
Write_Str_With_Col_Check (" in ");
if Reverse_Present (Node) then
Write_Str_With_Col_Check ("reverse ");
end if;
Sprint_Node (Discrete_Subtype_Definition (Node));
when N_Loop_Statement =>
Write_Indent;
if Present (Identifier (Node))
and then (not Has_Created_Identifier (Node)
or else not Dump_Original_Only)
then
Write_Rewrite_Str ("<<<");
Write_Id (Identifier (Node));
Write_Str (" : ");
Write_Rewrite_Str (">>>");
Sprint_Node (Iteration_Scheme (Node));
Write_Str_With_Col_Check_Sloc ("loop");
Sprint_Indented_List (Statements (Node));
Write_Indent_Str ("end loop ");
Write_Rewrite_Str ("<<<");
Write_Id (Identifier (Node));
Write_Rewrite_Str (">>>");
Write_Char (';');
else
Sprint_Node (Iteration_Scheme (Node));
Write_Str_With_Col_Check_Sloc ("loop");
Sprint_Indented_List (Statements (Node));
Write_Indent_Str ("end loop;");
end if;
when N_Mod_Clause =>
Sprint_Node_List (Pragmas_Before (Node));
Write_Str_With_Col_Check_Sloc ("at mod ");
Sprint_Node (Expression (Node));
when N_Modular_Type_Definition =>
Write_Str_With_Col_Check_Sloc ("mod ");
Sprint_Node (Expression (Node));
when N_Not_In =>
Sprint_Left_Opnd (Node);
Write_Str_Sloc (" not in ");
Sprint_Right_Opnd (Node);
when N_Null =>
Write_Str_With_Col_Check_Sloc ("null");
when N_Null_Statement =>
if Comes_From_Source (Node)
or else Dump_Freeze_Null
or else not Is_List_Member (Node)
or else (No (Prev (Node)) and then No (Next (Node)))
then
Write_Indent_Str_Sloc ("null;");
end if;
when N_Number_Declaration =>
Set_Debug_Sloc;
if Write_Indent_Identifiers (Node) then
Write_Str_With_Col_Check (" : constant ");
Write_Str (" := ");
Sprint_Node (Expression (Node));
Write_Char (';');
end if;
when N_Object_Declaration =>
Set_Debug_Sloc;
if Write_Indent_Identifiers (Node) then
Write_Str (" : ");
if Aliased_Present (Node) then
Write_Str_With_Col_Check ("aliased ");
end if;
if Constant_Present (Node) then
Write_Str_With_Col_Check ("constant ");
end if;
-- Ada 2005 (AI-231)
if Null_Exclusion_Present (Node) then
Write_Str_With_Col_Check ("not null ");
end if;
Sprint_Node (Object_Definition (Node));
if Present (Expression (Node)) then
Write_Str (" := ");
Sprint_Node (Expression (Node));
end if;
Write_Char (';');
end if;
when N_Object_Renaming_Declaration =>
Write_Indent;
Set_Debug_Sloc;
Sprint_Node (Defining_Identifier (Node));
Write_Str (" : ");
-- Ada 2005 (AI-230): Access renamings
if Present (Access_Definition (Node)) then
Sprint_Node (Access_Definition (Node));
elsif Present (Subtype_Mark (Node)) then
Sprint_Node (Subtype_Mark (Node));
else
Write_Str (" ??? ");
end if;
Write_Str_With_Col_Check (" renames ");
Sprint_Node (Name (Node));
Write_Char (';');
when N_Op_Abs =>
Write_Operator (Node, "abs ");
Sprint_Right_Opnd (Node);
when N_Op_Add =>
Sprint_Left_Opnd (Node);
Write_Operator (Node, " + ");
Sprint_Right_Opnd (Node);
when N_Op_And =>
Sprint_Left_Opnd (Node);
Write_Operator (Node, " and ");
Sprint_Right_Opnd (Node);
when N_Op_Concat =>
Sprint_Left_Opnd (Node);
Write_Operator (Node, " & ");
Sprint_Right_Opnd (Node);
when N_Op_Divide =>
Sprint_Left_Opnd (Node);
Write_Char (' ');
Process_TFAI_RR_Flags (Node);
Write_Operator (Node, "/ ");
Sprint_Right_Opnd (Node);
when N_Op_Eq =>
Sprint_Left_Opnd (Node);
Write_Operator (Node, " = ");
Sprint_Right_Opnd (Node);
when N_Op_Expon =>
Sprint_Left_Opnd (Node);
Write_Operator (Node, " ** ");
Sprint_Right_Opnd (Node);
when N_Op_Ge =>
Sprint_Left_Opnd (Node);
Write_Operator (Node, " >= ");
Sprint_Right_Opnd (Node);
when N_Op_Gt =>
Sprint_Left_Opnd (Node);
Write_Operator (Node, " > ");
Sprint_Right_Opnd (Node);
when N_Op_Le =>
Sprint_Left_Opnd (Node);
Write_Operator (Node, " <= ");
Sprint_Right_Opnd (Node);
when N_Op_Lt =>
Sprint_Left_Opnd (Node);
Write_Operator (Node, " < ");
Sprint_Right_Opnd (Node);
when N_Op_Minus =>
Write_Operator (Node, "-");
Sprint_Right_Opnd (Node);
when N_Op_Mod =>
Sprint_Left_Opnd (Node);
if Treat_Fixed_As_Integer (Node) then
Write_Str (" #");
end if;
Write_Operator (Node, " mod ");
Sprint_Right_Opnd (Node);
when N_Op_Multiply =>
Sprint_Left_Opnd (Node);
Write_Char (' ');
Process_TFAI_RR_Flags (Node);
Write_Operator (Node, "* ");
Sprint_Right_Opnd (Node);
when N_Op_Ne =>
Sprint_Left_Opnd (Node);
Write_Operator (Node, " /= ");
Sprint_Right_Opnd (Node);
when N_Op_Not =>
Write_Operator (Node, "not ");
Sprint_Right_Opnd (Node);
when N_Op_Or =>
Sprint_Left_Opnd (Node);
Write_Operator (Node, " or ");
Sprint_Right_Opnd (Node);
when N_Op_Plus =>
Write_Operator (Node, "+");
Sprint_Right_Opnd (Node);
when N_Op_Rem =>
Sprint_Left_Opnd (Node);
if Treat_Fixed_As_Integer (Node) then
Write_Str (" #");
end if;
Write_Operator (Node, " rem ");
Sprint_Right_Opnd (Node);
when N_Op_Shift =>
Set_Debug_Sloc;
Write_Id (Node);
Write_Char ('!');
Write_Str_With_Col_Check ("(");
Sprint_Node (Left_Opnd (Node));
Write_Str (", ");
Sprint_Node (Right_Opnd (Node));
Write_Char (')');
when N_Op_Subtract =>
Sprint_Left_Opnd (Node);
Write_Operator (Node, " - ");
Sprint_Right_Opnd (Node);
when N_Op_Xor =>
Sprint_Left_Opnd (Node);
Write_Operator (Node, " xor ");
Sprint_Right_Opnd (Node);
when N_Operator_Symbol =>
Write_Name_With_Col_Check_Sloc (Chars (Node));
when N_Ordinary_Fixed_Point_Definition =>
Write_Str_With_Col_Check_Sloc ("delta ");
Sprint_Node (Delta_Expression (Node));
Sprint_Opt_Node (Real_Range_Specification (Node));
when N_Or_Else =>
Sprint_Left_Opnd (Node);
Write_Str_Sloc (" or else ");
Sprint_Right_Opnd (Node);
when N_Others_Choice =>
if All_Others (Node) then
Write_Str_With_Col_Check ("all ");
end if;
Write_Str_With_Col_Check_Sloc ("others");
when N_Package_Body =>
Write_Indent;
Write_Indent_Str_Sloc ("package body ");
Sprint_Node (Defining_Unit_Name (Node));
Write_Str (" is");
Sprint_Indented_List (Declarations (Node));
if Present (Handled_Statement_Sequence (Node)) then
Write_Indent_Str ("begin");
Sprint_Node (Handled_Statement_Sequence (Node));
end if;
Write_Indent_Str ("end ");
Sprint_Node (Defining_Unit_Name (Node));
Write_Char (';');
when N_Package_Body_Stub =>
Write_Indent_Str_Sloc ("package body ");
Sprint_Node (Defining_Identifier (Node));
Write_Str_With_Col_Check (" is separate;");
when N_Package_Declaration =>
Write_Indent;
Write_Indent;
Sprint_Node_Sloc (Specification (Node));
Write_Char (';');
when N_Package_Instantiation =>
Write_Indent;
Write_Indent_Str_Sloc ("package ");
Sprint_Node (Defining_Unit_Name (Node));
Write_Str (" is new ");
Sprint_Node (Name (Node));
Sprint_Opt_Paren_Comma_List (Generic_Associations (Node));
Write_Char (';');
when N_Package_Renaming_Declaration =>
Write_Indent_Str_Sloc ("package ");
Sprint_Node (Defining_Unit_Name (Node));
Write_Str_With_Col_Check (" renames ");
Sprint_Node (Name (Node));
Write_Char (';');
when N_Package_Specification =>
Write_Str_With_Col_Check_Sloc ("package ");
Sprint_Node (Defining_Unit_Name (Node));
Write_Str (" is");
Sprint_Indented_List (Visible_Declarations (Node));
if Present (Private_Declarations (Node)) then
Write_Indent_Str ("private");
Sprint_Indented_List (Private_Declarations (Node));
end if;
Write_Indent_Str ("end ");
Sprint_Node (Defining_Unit_Name (Node));
when N_Parameter_Association =>
Sprint_Node_Sloc (Selector_Name (Node));
Write_Str (" => ");
Sprint_Node (Explicit_Actual_Parameter (Node));
when N_Parameter_Specification =>
Set_Debug_Sloc;
if Write_Identifiers (Node) then
Write_Str (" : ");
if In_Present (Node) then
Write_Str_With_Col_Check ("in ");
end if;
if Out_Present (Node) then
Write_Str_With_Col_Check ("out ");
end if;
-- Ada 2005 (AI-231)
if Null_Exclusion_Present (Node) then
Write_Str ("not null ");
end if;
Sprint_Node (Parameter_Type (Node));
if Present (Expression (Node)) then
Write_Str (" := ");
Sprint_Node (Expression (Node));
end if;
else
Write_Str (", ");
end if;
when N_Pragma =>
Write_Indent_Str_Sloc ("pragma ");
Write_Name_With_Col_Check (Chars (Node));
if Present (Pragma_Argument_Associations (Node)) then
Sprint_Opt_Paren_Comma_List
(Pragma_Argument_Associations (Node));
end if;
Write_Char (';');
when N_Pragma_Argument_Association =>
Set_Debug_Sloc;
if Chars (Node) /= No_Name then
Write_Name_With_Col_Check (Chars (Node));
Write_Str (" => ");
end if;
Sprint_Node (Expression (Node));
when N_Private_Type_Declaration =>
Write_Indent_Str_Sloc ("type ");
Write_Id (Defining_Identifier (Node));
if Present (Discriminant_Specifications (Node)) then
Write_Discr_Specs (Node);
elsif Unknown_Discriminants_Present (Node) then
Write_Str_With_Col_Check ("(<>)");
end if;
Write_Str (" is ");
if Tagged_Present (Node) then
Write_Str_With_Col_Check ("tagged ");
end if;
if Limited_Present (Node) then
Write_Str_With_Col_Check ("limited ");
end if;
Write_Str_With_Col_Check ("private;");
when N_Private_Extension_Declaration =>
Write_Indent_Str_Sloc ("type ");
Write_Id (Defining_Identifier (Node));
if Present (Discriminant_Specifications (Node)) then
Write_Discr_Specs (Node);
elsif Unknown_Discriminants_Present (Node) then
Write_Str_With_Col_Check ("(<>)");
end if;
Write_Str_With_Col_Check (" is new ");
Sprint_Node (Subtype_Indication (Node));
Write_Str_With_Col_Check (" with private;");
when N_Procedure_Call_Statement =>
Write_Indent;
Set_Debug_Sloc;
Note_Implicit_Run_Time_Call (Name (Node));
Sprint_Node (Name (Node));
Sprint_Opt_Paren_Comma_List (Parameter_Associations (Node));
Write_Char (';');
when N_Procedure_Instantiation =>
Write_Indent_Str_Sloc ("procedure ");
Sprint_Node (Defining_Unit_Name (Node));
Write_Str_With_Col_Check (" is new ");
Sprint_Node (Name (Node));
Sprint_Opt_Paren_Comma_List (Generic_Associations (Node));
Write_Char (';');
when N_Procedure_Specification =>
Write_Str_With_Col_Check_Sloc ("procedure ");
Sprint_Node (Defining_Unit_Name (Node));
Write_Param_Specs (Node);
when N_Protected_Body =>
Write_Indent_Str_Sloc ("protected body ");
Write_Id (Defining_Identifier (Node));
Write_Str (" is");
Sprint_Indented_List (Declarations (Node));
Write_Indent_Str ("end ");
Write_Id (Defining_Identifier (Node));
Write_Char (';');
when N_Protected_Body_Stub =>
Write_Indent_Str_Sloc ("protected body ");
Write_Id (Defining_Identifier (Node));
Write_Str_With_Col_Check (" is separate;");
when N_Protected_Definition =>
Set_Debug_Sloc;
Sprint_Indented_List (Visible_Declarations (Node));
if Present (Private_Declarations (Node)) then
Write_Indent_Str ("private");
Sprint_Indented_List (Private_Declarations (Node));
end if;
Write_Indent_Str ("end ");
when N_Protected_Type_Declaration =>
Write_Indent_Str_Sloc ("protected type ");
Write_Id (Defining_Identifier (Node));
Write_Discr_Specs (Node);
if Present (Interface_List (Node)) then
Write_Str (" is new ");
Sprint_And_List (Interface_List (Node));
Write_Str (" with ");
else
Write_Str (" is");
end if;
Sprint_Node (Protected_Definition (Node));
Write_Id (Defining_Identifier (Node));
Write_Char (';');
when N_Qualified_Expression =>
Sprint_Node (Subtype_Mark (Node));
Write_Char_Sloc (''');
-- Print expression, make sure we have at least one level of
-- parentheses around the expression. For cases of qualified
-- expressions in the source, this is always the case, but
-- for generated qualifications, there may be no explicit
-- parentheses present.
if Paren_Count (Expression (Node)) /= 0 then
Sprint_Node (Expression (Node));
else
Write_Char ('(');
Sprint_Node (Expression (Node));
Write_Char (')');
end if;
when N_Raise_Constraint_Error =>
-- This node can be used either as a subexpression or as a
-- statement form. The following test is a reasonably reliable
-- way to distinguish the two cases.
if Is_List_Member (Node)
and then Nkind (Parent (Node)) not in N_Subexpr
then
Write_Indent;
end if;
Write_Str_With_Col_Check_Sloc ("[constraint_error");
Write_Condition_And_Reason (Node);
when N_Raise_Program_Error =>
-- This node can be used either as a subexpression or as a
-- statement form. The following test is a reasonably reliable
-- way to distinguish the two cases.
if Is_List_Member (Node)
and then Nkind (Parent (Node)) not in N_Subexpr
then
Write_Indent;
end if;
Write_Str_With_Col_Check_Sloc ("[program_error");
Write_Condition_And_Reason (Node);
when N_Raise_Storage_Error =>
-- This node can be used either as a subexpression or as a
-- statement form. The following test is a reasonably reliable
-- way to distinguish the two cases.
if Is_List_Member (Node)
and then Nkind (Parent (Node)) not in N_Subexpr
then
Write_Indent;
end if;
Write_Str_With_Col_Check_Sloc ("[storage_error");
Write_Condition_And_Reason (Node);
when N_Raise_Statement =>
Write_Indent_Str_Sloc ("raise ");
Sprint_Node (Name (Node));
Write_Char (';');
when N_Range =>
Sprint_Node (Low_Bound (Node));
Write_Str_Sloc (" .. ");
Sprint_Node (High_Bound (Node));
when N_Range_Constraint =>
Write_Str_With_Col_Check_Sloc ("range ");
Sprint_Node (Range_Expression (Node));
when N_Real_Literal =>
Write_Ureal_With_Col_Check_Sloc (Realval (Node));
when N_Real_Range_Specification =>
Write_Str_With_Col_Check_Sloc ("range ");
Sprint_Node (Low_Bound (Node));
Write_Str (" .. ");
Sprint_Node (High_Bound (Node));
when N_Record_Definition =>
if Abstract_Present (Node) then
Write_Str_With_Col_Check ("abstract ");
end if;
if Tagged_Present (Node) then
Write_Str_With_Col_Check ("tagged ");
end if;
if Limited_Present (Node) then
Write_Str_With_Col_Check ("limited ");
end if;
if Null_Present (Node) then
Write_Str_With_Col_Check_Sloc ("null record");
else
Write_Str_With_Col_Check_Sloc ("record");
Sprint_Node (Component_List (Node));
Write_Indent_Str ("end record");
end if;
when N_Record_Representation_Clause =>
Write_Indent_Str_Sloc ("for ");
Sprint_Node (Identifier (Node));
Write_Str_With_Col_Check (" use record ");
if Present (Mod_Clause (Node)) then
Sprint_Node (Mod_Clause (Node));
end if;
Sprint_Indented_List (Component_Clauses (Node));
Write_Indent_Str ("end record;");
when N_Reference =>
Sprint_Node (Prefix (Node));
Write_Str_With_Col_Check_Sloc ("'reference");
when N_Requeue_Statement =>
Write_Indent_Str_Sloc ("requeue ");
Sprint_Node (Name (Node));
if Abort_Present (Node) then
Write_Str_With_Col_Check (" with abort");
end if;
Write_Char (';');
when N_Return_Statement =>
if Present (Expression (Node)) then
Write_Indent_Str_Sloc ("return ");
Sprint_Node (Expression (Node));
Write_Char (';');
else
Write_Indent_Str_Sloc ("return;");
end if;
when N_Selective_Accept =>
Write_Indent_Str_Sloc ("select");
declare
Alt_Node : Node_Id;
begin
Alt_Node := First (Select_Alternatives (Node));
loop
Indent_Begin;
Sprint_Node (Alt_Node);
Indent_End;
Next (Alt_Node);
exit when No (Alt_Node);
Write_Indent_Str ("or");
end loop;
end;
if Present (Else_Statements (Node)) then
Write_Indent_Str ("else");
Sprint_Indented_List (Else_Statements (Node));
end if;
Write_Indent_Str ("end select;");
when N_Signed_Integer_Type_Definition =>
Write_Str_With_Col_Check_Sloc ("range ");
Sprint_Node (Low_Bound (Node));
Write_Str (" .. ");
Sprint_Node (High_Bound (Node));
when N_Single_Protected_Declaration =>
Write_Indent_Str_Sloc ("protected ");
Write_Id (Defining_Identifier (Node));
Write_Str (" is");
Sprint_Node (Protected_Definition (Node));
Write_Id (Defining_Identifier (Node));
Write_Char (';');
when N_Single_Task_Declaration =>
Write_Indent_Str_Sloc ("task ");
Write_Id (Defining_Identifier (Node));
if Present (Task_Definition (Node)) then
Write_Str (" is");
Sprint_Node (Task_Definition (Node));
Write_Id (Defining_Identifier (Node));
end if;
Write_Char (';');
when N_Selected_Component =>
Sprint_Node (Prefix (Node));
Write_Char_Sloc ('.');
Sprint_Node (Selector_Name (Node));
when N_Slice =>
Set_Debug_Sloc;
Sprint_Node (Prefix (Node));
Write_Str_With_Col_Check (" (");
Sprint_Node (Discrete_Range (Node));
Write_Char (')');
when N_String_Literal =>
if String_Length (Strval (Node)) + Column > 75 then
Write_Indent_Str (" ");
end if;
Set_Debug_Sloc;
Write_String_Table_Entry (Strval (Node));
when N_Subprogram_Body =>
if Freeze_Indent = 0 then
Write_Indent;
end if;
Write_Indent;
Sprint_Node_Sloc (Specification (Node));
Write_Str (" is");
Sprint_Indented_List (Declarations (Node));
Write_Indent_Str ("begin");
Sprint_Node (Handled_Statement_Sequence (Node));
Write_Indent_Str ("end ");
Sprint_Node (Defining_Unit_Name (Specification (Node)));
Write_Char (';');
if Is_List_Member (Node)
and then Present (Next (Node))
and then Nkind (Next (Node)) /= N_Subprogram_Body
then
Write_Indent;
end if;
when N_Subprogram_Body_Stub =>
Write_Indent;
Sprint_Node_Sloc (Specification (Node));
Write_Str_With_Col_Check (" is separate;");
when N_Subprogram_Declaration =>
Write_Indent;
Sprint_Node_Sloc (Specification (Node));
if Nkind (Specification (Node)) = N_Procedure_Specification
and then Null_Present (Specification (Node))
then
Write_Str_With_Col_Check (" is null");
end if;
Write_Char (';');
when N_Subprogram_Info =>
Sprint_Node (Identifier (Node));
Write_Str_With_Col_Check_Sloc ("'subprogram_info");
when N_Subprogram_Renaming_Declaration =>
Write_Indent;
Sprint_Node (Specification (Node));
Write_Str_With_Col_Check_Sloc (" renames ");
Sprint_Node (Name (Node));
Write_Char (';');
when N_Subtype_Declaration =>
Write_Indent_Str_Sloc ("subtype ");
Write_Id (Defining_Identifier (Node));
Write_Str (" is ");
-- Ada 2005 (AI-231)
if Null_Exclusion_Present (Node) then
Write_Str ("not null ");
end if;
Sprint_Node (Subtype_Indication (Node));
Write_Char (';');
when N_Subtype_Indication =>
Sprint_Node_Sloc (Subtype_Mark (Node));
Write_Char (' ');
Sprint_Node (Constraint (Node));
when N_Subunit =>
Write_Indent_Str_Sloc ("separate (");
Sprint_Node (Name (Node));
Write_Char (')');
Write_Eol;
Sprint_Node (Proper_Body (Node));
when N_Task_Body =>
Write_Indent_Str_Sloc ("task body ");
Write_Id (Defining_Identifier (Node));
Write_Str (" is");
Sprint_Indented_List (Declarations (Node));
Write_Indent_Str ("begin");
Sprint_Node (Handled_Statement_Sequence (Node));
Write_Indent_Str ("end ");
Write_Id (Defining_Identifier (Node));
Write_Char (';');
when N_Task_Body_Stub =>
Write_Indent_Str_Sloc ("task body ");
Write_Id (Defining_Identifier (Node));
Write_Str_With_Col_Check (" is separate;");
when N_Task_Definition =>
Set_Debug_Sloc;
Sprint_Indented_List (Visible_Declarations (Node));
if Present (Private_Declarations (Node)) then
Write_Indent_Str ("private");
Sprint_Indented_List (Private_Declarations (Node));
end if;
Write_Indent_Str ("end ");
when N_Task_Type_Declaration =>
Write_Indent_Str_Sloc ("task type ");
Write_Id (Defining_Identifier (Node));
Write_Discr_Specs (Node);
if Present (Interface_List (Node)) then
Write_Str (" is new ");
Sprint_And_List (Interface_List (Node));
end if;
if Present (Task_Definition (Node)) then
if No (Interface_List (Node)) then
Write_Str (" is");
else
Write_Str (" with ");
end if;
Sprint_Node (Task_Definition (Node));
Write_Id (Defining_Identifier (Node));
end if;
Write_Char (';');
when N_Terminate_Alternative =>
Sprint_Node_List (Pragmas_Before (Node));
Write_Indent;
if Present (Condition (Node)) then
Write_Str_With_Col_Check ("when ");
Sprint_Node (Condition (Node));
Write_Str (" => ");
end if;
Write_Str_With_Col_Check_Sloc ("terminate;");
Sprint_Node_List (Pragmas_After (Node));
when N_Timed_Entry_Call =>
Write_Indent_Str_Sloc ("select");
Indent_Begin;
Sprint_Node (Entry_Call_Alternative (Node));
Indent_End;
Write_Indent_Str ("or");
Indent_Begin;
Sprint_Node (Delay_Alternative (Node));
Indent_End;
Write_Indent_Str ("end select;");
when N_Triggering_Alternative =>
Sprint_Node_List (Pragmas_Before (Node));
Sprint_Node_Sloc (Triggering_Statement (Node));
Sprint_Node_List (Statements (Node));
when N_Type_Conversion =>
Set_Debug_Sloc;
Sprint_Node (Subtype_Mark (Node));
Col_Check (4);
if Conversion_OK (Node) then
Write_Char ('?');
end if;
if Float_Truncate (Node) then
Write_Char ('^');
end if;
if Rounded_Result (Node) then
Write_Char ('@');
end if;
Write_Char ('(');
Sprint_Node (Expression (Node));
Write_Char (')');
when N_Unchecked_Expression =>
Col_Check (10);
Write_Str ("`(");
Sprint_Node_Sloc (Expression (Node));
Write_Char (')');
when N_Unchecked_Type_Conversion =>
Sprint_Node (Subtype_Mark (Node));
Write_Char ('!');
Write_Str_With_Col_Check ("(");
Sprint_Node_Sloc (Expression (Node));
Write_Char (')');
when N_Unconstrained_Array_Definition =>
Write_Str_With_Col_Check_Sloc ("array (");
declare
Node1 : Node_Id;
begin
Node1 := First (Subtype_Marks (Node));
loop
Sprint_Node (Node1);
Write_Str_With_Col_Check (" range <>");
Next (Node1);
exit when Node1 = Empty;
Write_Str (", ");
end loop;
end;
Write_Str (") of ");
Sprint_Node (Component_Definition (Node));
when N_Unused_At_Start | N_Unused_At_End =>
Write_Indent_Str ("***** Error, unused node encountered *****");
Write_Eol;
when N_Use_Package_Clause =>
Write_Indent_Str_Sloc ("use ");
Sprint_Comma_List (Names (Node));
Write_Char (';');
when N_Use_Type_Clause =>
Write_Indent_Str_Sloc ("use type ");
Sprint_Comma_List (Subtype_Marks (Node));
Write_Char (';');
when N_Validate_Unchecked_Conversion =>
Write_Indent_Str_Sloc ("validate unchecked_conversion (");
Sprint_Node (Source_Type (Node));
Write_Str (", ");
Sprint_Node (Target_Type (Node));
Write_Str (");");
when N_Variant =>
Write_Indent_Str_Sloc ("when ");
Sprint_Bar_List (Discrete_Choices (Node));
Write_Str (" => ");
Sprint_Node (Component_List (Node));
when N_Variant_Part =>
Indent_Begin;
Write_Indent_Str_Sloc ("case ");
Sprint_Node (Name (Node));
Write_Str (" is ");
Sprint_Indented_List (Variants (Node));
Write_Indent_Str ("end case");
Indent_End;
when N_With_Clause =>
-- Special test, if we are dumping the original tree only,
-- then we want to eliminate the bogus with clauses that
-- correspond to the non-existent children of Text_IO.
if Dump_Original_Only
and then Is_Text_IO_Kludge_Unit (Name (Node))
then
null;
-- Normal case, output the with clause
else
if First_Name (Node) or else not Dump_Original_Only then
-- Ada 2005 (AI-50217): Print limited with_clauses
if Private_Present (Node) and Limited_Present (Node) then
Write_Indent_Str ("limited private with ");
elsif Private_Present (Node) then
Write_Indent_Str ("private with ");
elsif Limited_Present (Node) then
Write_Indent_Str ("limited with ");
else
Write_Indent_Str ("with ");
end if;
else
Write_Str (", ");
end if;
Sprint_Node_Sloc (Name (Node));
if Last_Name (Node) or else not Dump_Original_Only then
Write_Char (';');
end if;
end if;
when N_With_Type_Clause =>
Write_Indent_Str ("with type ");
Sprint_Node_Sloc (Name (Node));
if Tagged_Present (Node) then
Write_Str (" is tagged;");
else
Write_Str (" is access;");
end if;
end case;
if Nkind (Node) in N_Subexpr
and then Do_Range_Check (Node)
then
Write_Str ("}");
end if;
for J in 1 .. Paren_Count (Node) loop
Write_Char (')');
end loop;
pragma Assert (No (Debug_Node));
Debug_Node := Save_Debug_Node;
end Sprint_Node_Actual;
----------------------
-- Sprint_Node_List --
----------------------
procedure Sprint_Node_List (List : List_Id) is
Node : Node_Id;
begin
if Is_Non_Empty_List (List) then
Node := First (List);
loop
Sprint_Node (Node);
Next (Node);
exit when Node = Empty;
end loop;
end if;
end Sprint_Node_List;
----------------------
-- Sprint_Node_Sloc --
----------------------
procedure Sprint_Node_Sloc (Node : Node_Id) is
begin
Sprint_Node (Node);
if Present (Debug_Node) then
Set_Sloc (Debug_Node, Sloc (Node));
Debug_Node := Empty;
end if;
end Sprint_Node_Sloc;
---------------------
-- Sprint_Opt_Node --
---------------------
procedure Sprint_Opt_Node (Node : Node_Id) is
begin
if Present (Node) then
Write_Char (' ');
Sprint_Node (Node);
end if;
end Sprint_Opt_Node;
--------------------------
-- Sprint_Opt_Node_List --
--------------------------
procedure Sprint_Opt_Node_List (List : List_Id) is
begin
if Present (List) then
Sprint_Node_List (List);
end if;
end Sprint_Opt_Node_List;
---------------------------------
-- Sprint_Opt_Paren_Comma_List --
---------------------------------
procedure Sprint_Opt_Paren_Comma_List (List : List_Id) is
begin
if Is_Non_Empty_List (List) then
Write_Char (' ');
Sprint_Paren_Comma_List (List);
end if;
end Sprint_Opt_Paren_Comma_List;
-----------------------------
-- Sprint_Paren_Comma_List --
-----------------------------
procedure Sprint_Paren_Comma_List (List : List_Id) is
N : Node_Id;
Node_Exists : Boolean := False;
begin
if Is_Non_Empty_List (List) then
if Dump_Original_Only then
N := First (List);
while Present (N) loop
if not Is_Rewrite_Insertion (N) then
Node_Exists := True;
exit;
end if;
Next (N);
end loop;
if not Node_Exists then
return;
end if;
end if;
Write_Str_With_Col_Check ("(");
Sprint_Comma_List (List);
Write_Char (')');
end if;
end Sprint_Paren_Comma_List;
----------------------
-- Sprint_Right_Opnd --
----------------------
procedure Sprint_Right_Opnd (N : Node_Id) is
Opnd : constant Node_Id := Right_Opnd (N);
begin
if Paren_Count (Opnd) /= 0
or else Op_Prec (Nkind (Opnd)) > Op_Prec (Nkind (N))
then
Sprint_Node (Opnd);
else
Write_Char ('(');
Sprint_Node (Opnd);
Write_Char (')');
end if;
end Sprint_Right_Opnd;
---------------------
-- Write_Char_Sloc --
---------------------
procedure Write_Char_Sloc (C : Character) is
begin
if Debug_Generated_Code and then C /= ' ' then
Set_Debug_Sloc;
end if;
Write_Char (C);
end Write_Char_Sloc;
--------------------------------
-- Write_Condition_And_Reason --
--------------------------------
procedure Write_Condition_And_Reason (Node : Node_Id) is
Image : constant String := RT_Exception_Code'Image
(RT_Exception_Code'Val
(UI_To_Int (Reason (Node))));
begin
if Present (Condition (Node)) then
Write_Str_With_Col_Check (" when ");
Sprint_Node (Condition (Node));
end if;
Write_Str (" """);
for J in 4 .. Image'Last loop
if Image (J) = '_' then
Write_Char (' ');
else
Write_Char (Fold_Lower (Image (J)));
end if;
end loop;
Write_Str ("""]");
end Write_Condition_And_Reason;
-----------------------
-- Write_Discr_Specs --
-----------------------
procedure Write_Discr_Specs (N : Node_Id) is
Specs : List_Id;
Spec : Node_Id;
begin
Specs := Discriminant_Specifications (N);
if Present (Specs) then
Write_Str_With_Col_Check (" (");
Spec := First (Specs);
loop
Sprint_Node (Spec);
Next (Spec);
exit when Spec = Empty;
-- Add semicolon, unless we are printing original tree and the
-- next specification is part of a list (but not the first
-- element of that list)
if not Dump_Original_Only or else not Prev_Ids (Spec) then
Write_Str ("; ");
end if;
end loop;
Write_Char (')');
end if;
end Write_Discr_Specs;
-----------------
-- Write_Ekind --
-----------------
procedure Write_Ekind (E : Entity_Id) is
S : constant String := Entity_Kind'Image (Ekind (E));
begin
Name_Len := S'Length;
Name_Buffer (1 .. Name_Len) := S;
Set_Casing (Mixed_Case);
Write_Str_With_Col_Check (Name_Buffer (1 .. Name_Len));
end Write_Ekind;
--------------
-- Write_Id --
--------------
procedure Write_Id (N : Node_Id) is
begin
-- Deal with outputting Itype
-- Note: if we are printing the full tree with -gnatds, then we may
-- end up picking up the Associated_Node link from a generic template
-- here which overlaps the Entity field, but as documented, Write_Itype
-- is defended against junk calls.
if Nkind (N) in N_Entity then
Write_Itype (N);
elsif Nkind (N) in N_Has_Entity then
Write_Itype (Entity (N));
end if;
-- Case of a defining identifier
if Nkind (N) = N_Defining_Identifier then
-- If defining identifier has an interface name (and no
-- address clause), then we output the interface name.
if (Is_Imported (N) or else Is_Exported (N))
and then Present (Interface_Name (N))
and then No (Address_Clause (N))
then
String_To_Name_Buffer (Strval (Interface_Name (N)));
Write_Str_With_Col_Check (Name_Buffer (1 .. Name_Len));
-- If no interface name (or inactive because there was
-- an address clause), then just output the Chars name.
else
Write_Name_With_Col_Check (Chars (N));
end if;
-- Case of selector of an expanded name where the expanded name
-- has an associated entity, output this entity.
elsif Nkind (Parent (N)) = N_Expanded_Name
and then Selector_Name (Parent (N)) = N
and then Present (Entity (Parent (N)))
then
Write_Id (Entity (Parent (N)));
-- For any other node with an associated entity, output it
elsif Nkind (N) in N_Has_Entity
and then Present (Entity_Or_Associated_Node (N))
and then Nkind (Entity_Or_Associated_Node (N)) in N_Entity
then
Write_Id (Entity (N));
-- All other cases, we just print the Chars field
else
Write_Name_With_Col_Check (Chars (N));
end if;
end Write_Id;
-----------------------
-- Write_Identifiers --
-----------------------
function Write_Identifiers (Node : Node_Id) return Boolean is
begin
Sprint_Node (Defining_Identifier (Node));
-- The remainder of the declaration must be printed unless we are
-- printing the original tree and this is not the last identifier
return
not Dump_Original_Only or else not More_Ids (Node);
end Write_Identifiers;
------------------------
-- Write_Implicit_Def --
------------------------
procedure Write_Implicit_Def (E : Entity_Id) is
Ind : Node_Id;
begin
case Ekind (E) is
when E_Array_Subtype =>
Write_Str_With_Col_Check ("subtype ");
Write_Id (E);
Write_Str_With_Col_Check (" is ");
Write_Id (Base_Type (E));
Write_Str_With_Col_Check (" (");
Ind := First_Index (E);
while Present (Ind) loop
Sprint_Node (Ind);
Next_Index (Ind);
if Present (Ind) then
Write_Str (", ");
end if;
end loop;
Write_Str (");");
when E_Signed_Integer_Subtype | E_Enumeration_Subtype =>
Write_Str_With_Col_Check ("subtype ");
Write_Id (E);
Write_Str (" is ");
Write_Id (Etype (E));
Write_Str_With_Col_Check (" range ");
Sprint_Node (Scalar_Range (E));
Write_Str (";");
when others =>
Write_Str_With_Col_Check ("type ");
Write_Id (E);
Write_Str_With_Col_Check (" is <");
Write_Ekind (E);
Write_Str (">;");
end case;
end Write_Implicit_Def;
------------------
-- Write_Indent --
------------------
procedure Write_Indent is
begin
if Indent_Annull_Flag then
Indent_Annull_Flag := False;
else
Write_Eol;
for J in 1 .. Indent loop
Write_Char (' ');
end loop;
end if;
end Write_Indent;
------------------------------
-- Write_Indent_Identifiers --
------------------------------
function Write_Indent_Identifiers (Node : Node_Id) return Boolean is
begin
-- We need to start a new line for every node, except in the case
-- where we are printing the original tree and this is not the first
-- defining identifier in the list.
if not Dump_Original_Only or else not Prev_Ids (Node) then
Write_Indent;
-- If printing original tree and this is not the first defining
-- identifier in the list, then the previous call to this procedure
-- printed only the name, and we add a comma to separate the names.
else
Write_Str (", ");
end if;
Sprint_Node (Defining_Identifier (Node));
-- The remainder of the declaration must be printed unless we are
-- printing the original tree and this is not the last identifier
return
not Dump_Original_Only or else not More_Ids (Node);
end Write_Indent_Identifiers;
-----------------------------------
-- Write_Indent_Identifiers_Sloc --
-----------------------------------
function Write_Indent_Identifiers_Sloc (Node : Node_Id) return Boolean is
begin
-- We need to start a new line for every node, except in the case
-- where we are printing the original tree and this is not the first
-- defining identifier in the list.
if not Dump_Original_Only or else not Prev_Ids (Node) then
Write_Indent;
-- If printing original tree and this is not the first defining
-- identifier in the list, then the previous call to this procedure
-- printed only the name, and we add a comma to separate the names.
else
Write_Str (", ");
end if;
Set_Debug_Sloc;
Sprint_Node (Defining_Identifier (Node));
-- The remainder of the declaration must be printed unless we are
-- printing the original tree and this is not the last identifier
return
not Dump_Original_Only or else not More_Ids (Node);
end Write_Indent_Identifiers_Sloc;
----------------------
-- Write_Indent_Str --
----------------------
procedure Write_Indent_Str (S : String) is
begin
Write_Indent;
Write_Str (S);
end Write_Indent_Str;
---------------------------
-- Write_Indent_Str_Sloc --
---------------------------
procedure Write_Indent_Str_Sloc (S : String) is
begin
Write_Indent;
Write_Str_Sloc (S);
end Write_Indent_Str_Sloc;
-----------------
-- Write_Itype --
-----------------
procedure Write_Itype (Typ : Entity_Id) is
procedure Write_Header (T : Boolean := True);
-- Write type if T is True, subtype if T is false
------------------
-- Write_Header --
------------------
procedure Write_Header (T : Boolean := True) is
begin
if T then
Write_Str ("[type ");
else
Write_Str ("[subtype ");
end if;
Write_Name_With_Col_Check (Chars (Typ));
Write_Str (" is ");
end Write_Header;
-- Start of processing for Write_Itype
begin
if Nkind (Typ) in N_Entity
and then Is_Itype (Typ)
and then not Itype_Printed (Typ)
then
-- Itype to be printed
declare
B : constant Node_Id := Etype (Typ);
X : Node_Id;
P : constant Node_Id := Parent (Typ);
S : constant Saved_Output_Buffer := Save_Output_Buffer;
-- Save current output buffer
Old_Sloc : Source_Ptr;
-- Save sloc of related node, so it is not modified when
-- printing with -gnatD.
begin
-- Write indentation at start of line
for J in 1 .. Indent loop
Write_Char (' ');
end loop;
-- If we have a constructed declaration, print it
if Present (P) and then Nkind (P) in N_Declaration then
-- We must set Itype_Printed true before the recursive call to
-- print the node, otherwise we get an infinite recursion!
Set_Itype_Printed (Typ, True);
-- Write the declaration enclosed in [], avoiding new line
-- at start of declaration, and semicolon at end.
-- Note: The itype may be imported from another unit, in which
-- case we do not want to modify the Sloc of the declaration.
-- Otherwise the itype may appear to be in the current unit,
-- and the back-end will reject a reference out of scope.
Write_Char ('[');
Indent_Annull_Flag := True;
Old_Sloc := Sloc (P);
Sprint_Node (P);
Set_Sloc (P, Old_Sloc);
Write_Erase_Char (';');
-- If no constructed declaration, then we have to concoct the
-- source corresponding to the type entity that we have at hand.
else
case Ekind (Typ) is
-- Access types and subtypes
when Access_Kind =>
Write_Header (Ekind (Typ) = E_Access_Type);
Write_Str ("access ");
if Is_Access_Constant (Typ) then
Write_Str ("constant ");
elsif Can_Never_Be_Null (Typ) then
Write_Str ("not null ");
end if;
Write_Id (Directly_Designated_Type (Typ));
-- Array types and string types
when E_Array_Type | E_String_Type =>
Write_Header;
Write_Str ("array (");
X := First_Index (Typ);
loop
Sprint_Node (X);
if not Is_Constrained (Typ) then
Write_Str (" range <>");
end if;
Next_Index (X);
exit when No (X);
Write_Str (", ");
end loop;
Write_Str (") of ");
Sprint_Node (Component_Type (Typ));
-- Array subtypes and string subtypes
when E_Array_Subtype | E_String_Subtype =>
Write_Header (False);
Write_Id (Etype (Typ));
Write_Str (" (");
X := First_Index (Typ);
loop
Sprint_Node (X);
Next_Index (X);
exit when No (X);
Write_Str (", ");
end loop;
Write_Char (')');
-- Signed integer types, and modular integer subtypes
when E_Signed_Integer_Type |
E_Signed_Integer_Subtype |
E_Modular_Integer_Subtype =>
Write_Header (Ekind (Typ) = E_Signed_Integer_Type);
if Ekind (Typ) = E_Signed_Integer_Type then
Write_Str ("new ");
end if;
Write_Id (B);
-- Print bounds if not different from base type
declare
L : constant Node_Id := Type_Low_Bound (Typ);
H : constant Node_Id := Type_High_Bound (Typ);
LE : constant Node_Id := Type_Low_Bound (B);
HE : constant Node_Id := Type_High_Bound (B);
begin
if Nkind (L) = N_Integer_Literal
and then Nkind (H) = N_Integer_Literal
and then Nkind (LE) = N_Integer_Literal
and then Nkind (HE) = N_Integer_Literal
and then UI_Eq (Intval (L), Intval (LE))
and then UI_Eq (Intval (H), Intval (HE))
then
null;
else
Write_Str (" range ");
Sprint_Node (Type_Low_Bound (Typ));
Write_Str (" .. ");
Sprint_Node (Type_High_Bound (Typ));
end if;
end;
-- Modular integer types
when E_Modular_Integer_Type =>
Write_Header;
Write_Str (" mod ");
Write_Uint_With_Col_Check (Modulus (Typ), Auto);
-- Floating point types and subtypes
when E_Floating_Point_Type |
E_Floating_Point_Subtype =>
Write_Header (Ekind (Typ) = E_Floating_Point_Type);
if Ekind (Typ) = E_Floating_Point_Type then
Write_Str ("new ");
end if;
Write_Id (Etype (Typ));
if Digits_Value (Typ) /= Digits_Value (Etype (Typ)) then
Write_Str (" digits ");
Write_Uint_With_Col_Check
(Digits_Value (Typ), Decimal);
end if;
-- Print bounds if not different from base type
declare
L : constant Node_Id := Type_Low_Bound (Typ);
H : constant Node_Id := Type_High_Bound (Typ);
LE : constant Node_Id := Type_Low_Bound (B);
HE : constant Node_Id := Type_High_Bound (B);
begin
if Nkind (L) = N_Real_Literal
and then Nkind (H) = N_Real_Literal
and then Nkind (LE) = N_Real_Literal
and then Nkind (HE) = N_Real_Literal
and then UR_Eq (Realval (L), Realval (LE))
and then UR_Eq (Realval (H), Realval (HE))
then
null;
else
Write_Str (" range ");
Sprint_Node (Type_Low_Bound (Typ));
Write_Str (" .. ");
Sprint_Node (Type_High_Bound (Typ));
end if;
end;
-- Record subtypes
when E_Record_Subtype =>
Write_Header (False);
Write_Str ("record");
Indent_Begin;
declare
C : Entity_Id;
begin
C := First_Entity (Typ);
while Present (C) loop
Write_Indent;
Write_Id (C);
Write_Str (" : ");
Write_Id (Etype (C));
Next_Entity (C);
end loop;
end;
Indent_End;
Write_Indent_Str (" end record");
-- Class-Wide types
when E_Class_Wide_Type =>
Write_Header;
Write_Name_With_Col_Check (Chars (Etype (Typ)));
Write_Str ("'Class");
-- Subprogram types
when E_Subprogram_Type =>
Write_Header;
if Etype (Typ) = Standard_Void_Type then
Write_Str ("procedure");
else
Write_Str ("function");
end if;
if Present (First_Entity (Typ)) then
Write_Str (" (");
declare
Param : Entity_Id;
begin
Param := First_Entity (Typ);
loop
Write_Id (Param);
Write_Str (" : ");
if Ekind (Param) = E_In_Out_Parameter then
Write_Str ("in out ");
elsif Ekind (Param) = E_Out_Parameter then
Write_Str ("out ");
end if;
Write_Id (Etype (Param));
Next_Entity (Param);
exit when No (Param);
Write_Str (", ");
end loop;
Write_Char (')');
end;
end if;
if Etype (Typ) /= Standard_Void_Type then
Write_Str (" return ");
Write_Id (Etype (Typ));
end if;
-- For all other Itypes, print ??? (fill in later)
when others =>
Write_Header (True);
Write_Str ("???");
end case;
end if;
-- Add terminating bracket and restore output buffer
Write_Char (']');
Write_Eol;
Restore_Output_Buffer (S);
end;
Set_Itype_Printed (Typ);
end if;
end Write_Itype;
-------------------------------
-- Write_Name_With_Col_Check --
-------------------------------
procedure Write_Name_With_Col_Check (N : Name_Id) is
J : Natural;
begin
Get_Name_String (N);
-- Deal with -gnatI which replaces digits in an internal
-- name by three dots (e.g. R7b becomes R...b).
if Debug_Flag_II and then Name_Buffer (1) in 'A' .. 'Z' then
J := 2;
while J < Name_Len loop
exit when Name_Buffer (J) not in 'A' .. 'Z';
J := J + 1;
end loop;
if Name_Buffer (J) in '0' .. '9' then
Write_Str_With_Col_Check (Name_Buffer (1 .. J - 1));
Write_Str ("...");
while J <= Name_Len loop
if Name_Buffer (J) not in '0' .. '9' then
Write_Str (Name_Buffer (J .. Name_Len));
exit;
else
J := J + 1;
end if;
end loop;
return;
end if;
end if;
-- Fall through for normal case
Write_Str_With_Col_Check (Name_Buffer (1 .. Name_Len));
end Write_Name_With_Col_Check;
------------------------------------
-- Write_Name_With_Col_Check_Sloc --
------------------------------------
procedure Write_Name_With_Col_Check_Sloc (N : Name_Id) is
begin
Get_Name_String (N);
Write_Str_With_Col_Check_Sloc (Name_Buffer (1 .. Name_Len));
end Write_Name_With_Col_Check_Sloc;
--------------------
-- Write_Operator --
--------------------
procedure Write_Operator (N : Node_Id; S : String) is
F : Natural := S'First;
T : Natural := S'Last;
begin
-- If no overflow check, just write string out, and we are done
if not Do_Overflow_Check (N) then
Write_Str_Sloc (S);
-- If overflow check, we want to surround the operator with curly
-- brackets, but not include spaces within the brackets.
else
if S (F) = ' ' then
Write_Char (' ');
F := F + 1;
end if;
if S (T) = ' ' then
T := T - 1;
end if;
Write_Char ('{');
Write_Str_Sloc (S (F .. T));
Write_Char ('}');
if S (S'Last) = ' ' then
Write_Char (' ');
end if;
end if;
end Write_Operator;
-----------------------
-- Write_Param_Specs --
-----------------------
procedure Write_Param_Specs (N : Node_Id) is
Specs : List_Id;
Spec : Node_Id;
Formal : Node_Id;
begin
Specs := Parameter_Specifications (N);
if Is_Non_Empty_List (Specs) then
Write_Str_With_Col_Check (" (");
Spec := First (Specs);
loop
Sprint_Node (Spec);
Formal := Defining_Identifier (Spec);
Next (Spec);
exit when Spec = Empty;
-- Add semicolon, unless we are printing original tree and the
-- next specification is part of a list (but not the first
-- element of that list)
if not Dump_Original_Only or else not Prev_Ids (Spec) then
Write_Str ("; ");
end if;
end loop;
-- Write out any extra formals
while Present (Extra_Formal (Formal)) loop
Formal := Extra_Formal (Formal);
Write_Str ("; ");
Write_Name_With_Col_Check (Chars (Formal));
Write_Str (" : ");
Write_Name_With_Col_Check (Chars (Etype (Formal)));
end loop;
Write_Char (')');
end if;
end Write_Param_Specs;
--------------------------
-- Write_Rewrite_Str --
--------------------------
procedure Write_Rewrite_Str (S : String) is
begin
if not Dump_Generated_Only then
if S'Length = 3 and then S = ">>>" then
Write_Str (">>>");
else
Write_Str_With_Col_Check (S);
end if;
end if;
end Write_Rewrite_Str;
--------------------
-- Write_Str_Sloc --
--------------------
procedure Write_Str_Sloc (S : String) is
begin
for J in S'Range loop
Write_Char_Sloc (S (J));
end loop;
end Write_Str_Sloc;
------------------------------
-- Write_Str_With_Col_Check --
------------------------------
procedure Write_Str_With_Col_Check (S : String) is
begin
if Int (S'Last) + Column > Line_Limit then
Write_Indent_Str (" ");
-- LLVM local begin
if S (S'First) = ' ' then
Write_Str (S (S'First + 1 .. S'Last));
-- LLVM local end
else
Write_Str (S);
end if;
else
Write_Str (S);
end if;
end Write_Str_With_Col_Check;
-----------------------------------
-- Write_Str_With_Col_Check_Sloc --
-----------------------------------
procedure Write_Str_With_Col_Check_Sloc (S : String) is
begin
if Int (S'Last) + Column > Line_Limit then
Write_Indent_Str (" ");
-- LLVM local begin
if S (S'First) = ' ' then
Write_Str_Sloc (S (S'First + 1 .. S'Last));
-- LLVM local end
else
Write_Str_Sloc (S);
end if;
else
Write_Str_Sloc (S);
end if;
end Write_Str_With_Col_Check_Sloc;
-------------------------------
-- Write_Uint_With_Col_Check --
-------------------------------
procedure Write_Uint_With_Col_Check (U : Uint; Format : UI_Format) is
begin
Col_Check (UI_Decimal_Digits_Hi (U));
UI_Write (U, Format);
end Write_Uint_With_Col_Check;
------------------------------------
-- Write_Uint_With_Col_Check_Sloc --
------------------------------------
procedure Write_Uint_With_Col_Check_Sloc (U : Uint; Format : UI_Format) is
begin
Col_Check (UI_Decimal_Digits_Hi (U));
Set_Debug_Sloc;
UI_Write (U, Format);
end Write_Uint_With_Col_Check_Sloc;
-------------------------------------
-- Write_Ureal_With_Col_Check_Sloc --
-------------------------------------
procedure Write_Ureal_With_Col_Check_Sloc (U : Ureal) is
D : constant Uint := Denominator (U);
N : constant Uint := Numerator (U);
begin
Col_Check
(UI_Decimal_Digits_Hi (D) + UI_Decimal_Digits_Hi (N) + 4);
Set_Debug_Sloc;
UR_Write (U);
end Write_Ureal_With_Col_Check_Sloc;
end Sprint;
|
-----------------------------------------------------------------------
-- net-protos-Ipv4 -- IPv4 Network protocol
-- Copyright (C) 2016, 2017 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 Net.Protos.Arp;
package body Net.Protos.IPv4 is
use type Net.Protos.Arp.Arp_Status;
Packet_Id : Uint16 := 1;
-- ------------------------------
-- Send the raw IPv4 packet to the interface. The destination Ethernet address is
-- resolved from the ARP table and the packet Ethernet header updated. The packet
-- is send immediately when the destination Ethernet address is known, otherwise
-- it is queued and sent when the ARP resolution is successful.
-- ------------------------------
procedure Send_Raw (Ifnet : in out Net.Interfaces.Ifnet_Type'Class;
Target_Ip : in Ip_Addr;
Packet : in out Net.Buffers.Buffer_Type;
Status : out Error_Code) is
Ether : constant Net.Headers.Ether_Header_Access := Packet.Ethernet;
Arp_Status : Net.Protos.Arp.Arp_Status;
begin
Ether.Ether_Shost := Ifnet.Mac;
Ether.Ether_Type := Net.Headers.To_Network (Net.Protos.ETHERTYPE_IP);
if Ifnet.Is_Local_Network (Target_Ip) then
Net.Protos.Arp.Resolve (Ifnet, Target_Ip, Ether.Ether_Dhost, Packet, Arp_Status);
elsif Ifnet.Gateway /= (0, 0, 0, 0) then
Net.Protos.Arp.Resolve (Ifnet, Ifnet.Gateway, Ether.Ether_Dhost, Packet, Arp_Status);
else
Arp_Status := Net.Protos.Arp.ARP_UNREACHABLE;
end if;
case Arp_Status is
when Net.Protos.Arp.ARP_FOUND =>
Ifnet.Send (Packet);
Status := EOK;
when Net.Protos.Arp.ARP_PENDING | Net.Protos.Arp.ARP_NEEDED =>
Status := EINPROGRESS;
when Net.Protos.Arp.ARP_UNREACHABLE | Net.Protos.Arp.ARP_QUEUE_FULL =>
Net.Buffers.Release (Packet);
Status := ENETUNREACH;
end case;
end Send_Raw;
-- ------------------------------
-- Make an IP packet identifier.
-- ------------------------------
procedure Make_Ident (Ip : in Net.Headers.IP_Header_Access) is
begin
Ip.Ip_Id := Net.Headers.To_Network (Packet_Id);
Packet_Id := Packet_Id + 1;
end Make_Ident;
-- ------------------------------
-- Make the IPv4 header for the source and destination IP addresses and protocol.
-- ------------------------------
procedure Make_Header (Ip : in Net.Headers.IP_Header_Access;
Src : in Ip_Addr;
Dst : in Ip_Addr;
Proto : in Uint8;
Length : in Uint16) is
begin
Ip.Ip_Ihl := 16#45#;
Ip.Ip_Tos := 0;
Ip.Ip_Off := Net.Headers.To_Network (16#4000#);
Ip.Ip_Ttl := 64;
Ip.Ip_Sum := 0;
Ip.Ip_Src := Src;
Ip.Ip_Dst := Dst;
Ip.Ip_P := Proto;
Ip.Ip_Len := Net.Headers.To_Network (Length);
Make_Ident (Ip);
end Make_Header;
procedure Send (Ifnet : in out Net.Interfaces.Ifnet_Type'Class;
Target_Ip : in Ip_Addr;
Packet : in out Net.Buffers.Buffer_Type;
Status : out Error_Code) is
Ip : constant Net.Headers.IP_Header_Access := Packet.IP;
begin
Make_Header (Ip, Ifnet.Ip, Target_Ip, P_UDP, Packet.Get_Length);
Ip.Ip_Ihl := 4;
Ip.Ip_Tos := 0;
Ip.Ip_Id := 2;
Ip.Ip_Off := 0;
Ip.Ip_Ttl := 255;
Ip.Ip_Sum := 0;
Ip.Ip_Src := Ifnet.Ip;
Ip.Ip_Dst := Target_Ip;
Ip.Ip_P := 4;
-- Ip.Ip_Len := Net.Headers.To_Network (Packet.Get_Length);
-- if Ifnet.Is_Local_Address (Target_Ip) then
Send_Raw (Ifnet, Target_Ip, Packet, Status);
end Send;
end Net.Protos.IPv4;
|
--
-- This is a wrapper package for (non-generic) mixin.
-- As in generic case, everything can be done explicitly in a few lines of code,
-- as shown in main demo procedure. This module provides a somewhat clearer illustration by
-- keeping all relevant code in one place as well as presenting inheritance in a more
-- evident form by separating public presentation and hiding inheritance details in private part.
--
-- 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.
--
with base_iface; use base_iface;
with base_type; use base_type;
with oop_mixin;
package oop_mixin_compositor is
type Extension is limited new The_Interface with private;
type Mixin is limited new The_Type and The_Interface with private;
--
overriding procedure simple (Self : Mixin);
overriding procedure compound (Self : Mixin);
overriding procedure redispatching(Self : Mixin);
type Mixin_Child is new Mixin with private;
-- same could be done with Extension_Child, but that would be pretty much exactly
-- the same code/inheritance constructs
overriding procedure simple(Self : Mixin_Child);
private
type Extension is limited new oop_mixin.Derived with null record;
-- this should nont need any special handling, as we can derive from interfaces directly
type Mixin is limited new The_Type and The_Interface with record
-- here we have to mix-in extra type as a record entry (explicitly)
-- and provide a redirection glue code.
inner : oop_mixin.Derived;
end record;
---------------
-- try further inheritance and overriding various methods
type Mixin_Child is new Mixin with null record;
end oop_mixin_compositor;
|
-- CA2002A2.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.
--*
-- SUBUNIT BODIES FOR STUBS GIVEN IN PACKAGE CA2002A2 IN FILE
-- CA2002A0M.
-- BHS 8/02/84
SEPARATE (CA2002A2)
PROCEDURE PROC (Y : OUT INTEGER) IS
BEGIN
Y := 2;
END PROC;
SEPARATE (CA2002A2)
FUNCTION FUN (Z : INTEGER := 3) RETURN BOOLEAN IS
BEGIN
RETURN Z /= 3;
END FUN;
SEPARATE (CA2002A2)
PACKAGE BODY PKG IS
PROCEDURE PKG_PROC (YY : IN OUT INTEGER) IS SEPARATE;
BEGIN
I := 2;
END PKG;
SEPARATE (CA2002A2.PKG)
PROCEDURE PKG_PROC (YY : IN OUT INTEGER) IS
BEGIN
YY := YY + 1;
END PKG_PROC;
|
with Interfaces.C.Strings;
with System;
package AMPC is
package C renames Interfaces.C;
-- States - mpc_state_t
type States is
record
Position : C.long;
Row : C.long;
Column : C.long;
Term : C.int;
end record with
Convention => C;
type States_Ptr is access States with
Convention => C;
-- Errors - mpc_err_t
type Errors is
record
State : States;
Expected_Num : C.int;
Filename : C.Strings.chars_ptr;
Failure : C.Strings.chars_ptr;
Expected : System.Address;
Recieved : C.char;
end record with
Convention => C;
type Errors_Ptr is access all Errors with
Convention => C;
procedure Put (Error : in Errors_Ptr) with
Import => True,
Convention => C,
External_Name => "mpc_err_print";
procedure Free (Error : in Errors_Ptr) with
Import => True,
Convention => C,
External_Name => "mpc_err_delete";
-- Values - mpc_val_t
type Values is null record with
Convention => C;
type Values_Ptr is access Values;
type Results (Success : Boolean) is
record
case Success is
when False =>
Error : Errors_Ptr;
when True =>
Output : Values_Ptr;
end case;
end record with
Convention => C_Pass_By_Copy,
Unchecked_Union => True;
type Results_Ptr is access all Results with
Convention => C;
-- Parsers - mpc_parser_t
type Parsers is null record with
Convention => C;
type Parsers_Ptr is access Parsers with
Convention => C;
function Parse (Input : in String;
Parser : in Parsers_Ptr;
Result : in Results_Ptr;
Filename : in String := "<stdin>") return Boolean;
function New_Parser (Name : in String) return Parsers_Ptr;
procedure Free (Parser : in Parsers_Ptr);
procedure Free (Parser_1 : in Parsers_Ptr;
Parser_2 : in Parsers_Ptr);
procedure Free (Parser_1 : in Parsers_Ptr;
Parser_2 : in Parsers_Ptr;
Parser_3 : in Parsers_Ptr);
procedure Free (Parser_1 : in Parsers_Ptr;
Parser_2 : in Parsers_Ptr;
Parser_3 : in Parsers_Ptr;
Parser_4 : in Parsers_Ptr);
type Language_Flags is (Default, Predictive, Whitespace_Sensitive) with
Convention => C;
function Language (Flags : in Language_Flags; Grammar : in String; Parser : in Parsers_Ptr) return Errors_Ptr;
function Language (Flags : in Language_Flags;
Grammar : in String;
Parser_1 : in Parsers_Ptr;
Parser_2 : in Parsers_Ptr) return Errors_Ptr;
function Language (Flags : in Language_Flags;
Grammar : in String;
Parser_1 : in Parsers_Ptr;
Parser_2 : in Parsers_Ptr;
Parser_3 : in Parsers_Ptr) return Errors_Ptr;
function Language (Flags : in Language_Flags;
Grammar : in String;
Parser_1 : in Parsers_Ptr;
Parser_2 : in Parsers_Ptr;
Parser_3 : in Parsers_Ptr;
Parser_4 : in Parsers_Ptr) return Errors_Ptr;
function Language (Flags : in Language_Flags;
Grammar : in String;
Parser_1 : in Parsers_Ptr;
Parser_2 : in Parsers_Ptr;
Parser_3 : in Parsers_Ptr;
Parser_4 : in Parsers_Ptr;
Parser_5 : in Parsers_Ptr) return Errors_Ptr;
-- AST - mpc_ast_t
type ASTs is null record with
Convention => C;
type AST_Ptr is access ASTs with
Convention => C;
procedure Put (AST : in AST_Ptr) with
Import => True,
Convention => C,
External_Name => "mpc_ast_print";
procedure Free (AST : in AST_Ptr) with
Import => True,
Convention => C,
External_Name => "mpc_ast_delete";
end AMPC;
|
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.ADC is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- ISR_AWD array
type ISR_AWD_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ISR_AWD
type ISR_AWD_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AWD as a value
Val : HAL.UInt3;
when True =>
-- AWD as an array
Arr : ISR_AWD_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ISR_AWD_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- interrupt and status register
type ISR_Register is record
-- ADRDY
ADRDY : Boolean := False;
-- EOSMP
EOSMP : Boolean := False;
-- EOC
EOC : Boolean := False;
-- EOS
EOS : Boolean := False;
-- OVR
OVR : Boolean := False;
-- JEOC
JEOC : Boolean := False;
-- JEOS
JEOS : Boolean := False;
-- AWD1
AWD : ISR_AWD_Field := (As_Array => False, Val => 16#0#);
-- JQOVF
JQOVF : Boolean := False;
-- unspecified
Reserved_11_31 : HAL.UInt21 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ISR_Register use record
ADRDY at 0 range 0 .. 0;
EOSMP at 0 range 1 .. 1;
EOC at 0 range 2 .. 2;
EOS at 0 range 3 .. 3;
OVR at 0 range 4 .. 4;
JEOC at 0 range 5 .. 5;
JEOS at 0 range 6 .. 6;
AWD at 0 range 7 .. 9;
JQOVF at 0 range 10 .. 10;
Reserved_11_31 at 0 range 11 .. 31;
end record;
-- interrupt enable register
type IER_Register is record
-- ADRDYIE
ADRDYIE : Boolean := False;
-- EOSMPIE
EOSMPIE : Boolean := False;
-- EOCIE
EOCIE : Boolean := False;
-- EOSIE
EOSIE : Boolean := False;
-- OVRIE
OVRIE : Boolean := False;
-- JEOCIE
JEOCIE : Boolean := False;
-- JEOSIE
JEOSIE : Boolean := False;
-- AWD1IE
AWD1IE : Boolean := False;
-- AWD2IE
AWD2IE : Boolean := False;
-- AWD3IE
AWD3IE : Boolean := False;
-- JQOVFIE
JQOVFIE : Boolean := False;
-- unspecified
Reserved_11_31 : HAL.UInt21 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for IER_Register use record
ADRDYIE at 0 range 0 .. 0;
EOSMPIE at 0 range 1 .. 1;
EOCIE at 0 range 2 .. 2;
EOSIE at 0 range 3 .. 3;
OVRIE at 0 range 4 .. 4;
JEOCIE at 0 range 5 .. 5;
JEOSIE at 0 range 6 .. 6;
AWD1IE at 0 range 7 .. 7;
AWD2IE at 0 range 8 .. 8;
AWD3IE at 0 range 9 .. 9;
JQOVFIE at 0 range 10 .. 10;
Reserved_11_31 at 0 range 11 .. 31;
end record;
-- control register
type CR_Register is record
-- ADEN
ADEN : Boolean := False;
-- ADDIS
ADDIS : Boolean := False;
-- ADSTART
ADSTART : Boolean := False;
-- JADSTART
JADSTART : Boolean := False;
-- ADSTP
ADSTP : Boolean := False;
-- JADSTP
JADSTP : Boolean := False;
-- unspecified
Reserved_6_27 : HAL.UInt22 := 16#0#;
-- ADVREGEN
ADVREGEN : Boolean := False;
-- DEEPPWD
DEEPPWD : Boolean := False;
-- ADCALDIF
ADCALDIF : Boolean := False;
-- ADCAL
ADCAL : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CR_Register use record
ADEN at 0 range 0 .. 0;
ADDIS at 0 range 1 .. 1;
ADSTART at 0 range 2 .. 2;
JADSTART at 0 range 3 .. 3;
ADSTP at 0 range 4 .. 4;
JADSTP at 0 range 5 .. 5;
Reserved_6_27 at 0 range 6 .. 27;
ADVREGEN at 0 range 28 .. 28;
DEEPPWD at 0 range 29 .. 29;
ADCALDIF at 0 range 30 .. 30;
ADCAL at 0 range 31 .. 31;
end record;
subtype CFGR_RES_Field is HAL.UInt2;
subtype CFGR_EXTSEL_Field is HAL.UInt4;
subtype CFGR_EXTEN_Field is HAL.UInt2;
subtype CFGR_DISCNUM_Field is HAL.UInt3;
subtype CFGR_AWD1CH_Field is HAL.UInt5;
-- configuration register
type CFGR_Register is record
-- DMAEN
DMAEN : Boolean := False;
-- DMACFG
DMACFG : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- RES
RES : CFGR_RES_Field := 16#0#;
-- ALIGN
ALIGN : Boolean := False;
-- EXTSEL
EXTSEL : CFGR_EXTSEL_Field := 16#0#;
-- EXTEN
EXTEN : CFGR_EXTEN_Field := 16#0#;
-- OVRMOD
OVRMOD : Boolean := False;
-- CONT
CONT : Boolean := False;
-- AUTDLY
AUTDLY : Boolean := False;
-- AUTOFF
AUTOFF : Boolean := False;
-- DISCEN
DISCEN : Boolean := False;
-- DISCNUM
DISCNUM : CFGR_DISCNUM_Field := 16#0#;
-- JDISCEN
JDISCEN : Boolean := False;
-- JQM
JQM : Boolean := False;
-- AWD1SGL
AWD1SGL : Boolean := False;
-- AWD1EN
AWD1EN : Boolean := False;
-- JAWD1EN
JAWD1EN : Boolean := False;
-- JAUTO
JAUTO : Boolean := False;
-- AWD1CH
AWD1CH : CFGR_AWD1CH_Field := 16#0#;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CFGR_Register use record
DMAEN at 0 range 0 .. 0;
DMACFG at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
RES at 0 range 3 .. 4;
ALIGN at 0 range 5 .. 5;
EXTSEL at 0 range 6 .. 9;
EXTEN at 0 range 10 .. 11;
OVRMOD at 0 range 12 .. 12;
CONT at 0 range 13 .. 13;
AUTDLY at 0 range 14 .. 14;
AUTOFF at 0 range 15 .. 15;
DISCEN at 0 range 16 .. 16;
DISCNUM at 0 range 17 .. 19;
JDISCEN at 0 range 20 .. 20;
JQM at 0 range 21 .. 21;
AWD1SGL at 0 range 22 .. 22;
AWD1EN at 0 range 23 .. 23;
JAWD1EN at 0 range 24 .. 24;
JAUTO at 0 range 25 .. 25;
AWD1CH at 0 range 26 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
-- SMPR1_SMP array element
subtype SMPR1_SMP_Element is HAL.UInt3;
-- SMPR1_SMP array
type SMPR1_SMP_Field_Array is array (1 .. 9) of SMPR1_SMP_Element
with Component_Size => 3, Size => 27;
-- Type definition for SMPR1_SMP
type SMPR1_SMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- SMP as a value
Val : HAL.UInt27;
when True =>
-- SMP as an array
Arr : SMPR1_SMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 27;
for SMPR1_SMP_Field use record
Val at 0 range 0 .. 26;
Arr at 0 range 0 .. 26;
end record;
-- sample time register 1
type SMPR1_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- SMP1
SMP : SMPR1_SMP_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SMPR1_Register use record
Reserved_0_2 at 0 range 0 .. 2;
SMP at 0 range 3 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
-- SMPR2_SMP array element
subtype SMPR2_SMP_Element is HAL.UInt3;
-- SMPR2_SMP array
type SMPR2_SMP_Field_Array is array (10 .. 18) of SMPR2_SMP_Element
with Component_Size => 3, Size => 27;
-- Type definition for SMPR2_SMP
type SMPR2_SMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- SMP as a value
Val : HAL.UInt27;
when True =>
-- SMP as an array
Arr : SMPR2_SMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 27;
for SMPR2_SMP_Field use record
Val at 0 range 0 .. 26;
Arr at 0 range 0 .. 26;
end record;
-- sample time register 2
type SMPR2_Register is record
-- SMP10
SMP : SMPR2_SMP_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_27_31 : HAL.UInt5 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SMPR2_Register use record
SMP at 0 range 0 .. 26;
Reserved_27_31 at 0 range 27 .. 31;
end record;
subtype TR1_LT1_Field is HAL.UInt12;
subtype TR1_HT1_Field is HAL.UInt12;
-- watchdog threshold register 1
type TR1_Register is record
-- LT1
LT1 : TR1_LT1_Field := 16#0#;
-- unspecified
Reserved_12_15 : HAL.UInt4 := 16#0#;
-- HT1
HT1 : TR1_HT1_Field := 16#FFF#;
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TR1_Register use record
LT1 at 0 range 0 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
HT1 at 0 range 16 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
subtype TR2_LT2_Field is HAL.UInt8;
subtype TR2_HT2_Field is HAL.UInt8;
-- watchdog threshold register
type TR2_Register is record
-- LT2
LT2 : TR2_LT2_Field := 16#0#;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
-- HT2
HT2 : TR2_HT2_Field := 16#FF#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#F#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TR2_Register use record
LT2 at 0 range 0 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
HT2 at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype TR3_LT3_Field is HAL.UInt8;
subtype TR3_HT3_Field is HAL.UInt8;
-- watchdog threshold register 3
type TR3_Register is record
-- LT3
LT3 : TR3_LT3_Field := 16#0#;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
-- HT3
HT3 : TR3_HT3_Field := 16#FF#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#F#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for TR3_Register use record
LT3 at 0 range 0 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
HT3 at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype SQR1_L_Field is HAL.UInt4;
subtype SQR1_SQ1_Field is HAL.UInt5;
subtype SQR1_SQ2_Field is HAL.UInt5;
subtype SQR1_SQ3_Field is HAL.UInt5;
subtype SQR1_SQ4_Field is HAL.UInt5;
-- regular sequence register 1
type SQR1_Register is record
-- L
L : SQR1_L_Field := 16#0#;
-- unspecified
Reserved_4_5 : HAL.UInt2 := 16#0#;
-- SQ1
SQ1 : SQR1_SQ1_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- SQ2
SQ2 : SQR1_SQ2_Field := 16#0#;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- SQ3
SQ3 : SQR1_SQ3_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- SQ4
SQ4 : SQR1_SQ4_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SQR1_Register use record
L at 0 range 0 .. 3;
Reserved_4_5 at 0 range 4 .. 5;
SQ1 at 0 range 6 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
SQ2 at 0 range 12 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
SQ3 at 0 range 18 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
SQ4 at 0 range 24 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
subtype SQR2_SQ5_Field is HAL.UInt5;
subtype SQR2_SQ6_Field is HAL.UInt5;
subtype SQR2_SQ7_Field is HAL.UInt5;
subtype SQR2_SQ8_Field is HAL.UInt5;
subtype SQR2_SQ9_Field is HAL.UInt5;
-- regular sequence register 2
type SQR2_Register is record
-- SQ5
SQ5 : SQR2_SQ5_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- SQ6
SQ6 : SQR2_SQ6_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- SQ7
SQ7 : SQR2_SQ7_Field := 16#0#;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- SQ8
SQ8 : SQR2_SQ8_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- SQ9
SQ9 : SQR2_SQ9_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SQR2_Register use record
SQ5 at 0 range 0 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
SQ6 at 0 range 6 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
SQ7 at 0 range 12 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
SQ8 at 0 range 18 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
SQ9 at 0 range 24 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
subtype SQR3_SQ10_Field is HAL.UInt5;
subtype SQR3_SQ11_Field is HAL.UInt5;
subtype SQR3_SQ12_Field is HAL.UInt5;
subtype SQR3_SQ13_Field is HAL.UInt5;
subtype SQR3_SQ14_Field is HAL.UInt5;
-- regular sequence register 3
type SQR3_Register is record
-- SQ10
SQ10 : SQR3_SQ10_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- SQ11
SQ11 : SQR3_SQ11_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- SQ12
SQ12 : SQR3_SQ12_Field := 16#0#;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- SQ13
SQ13 : SQR3_SQ13_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- SQ14
SQ14 : SQR3_SQ14_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SQR3_Register use record
SQ10 at 0 range 0 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
SQ11 at 0 range 6 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
SQ12 at 0 range 12 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
SQ13 at 0 range 18 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
SQ14 at 0 range 24 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
subtype SQR4_SQ15_Field is HAL.UInt5;
subtype SQR4_SQ16_Field is HAL.UInt5;
-- regular sequence register 4
type SQR4_Register is record
-- SQ15
SQ15 : SQR4_SQ15_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- SQ16
SQ16 : SQR4_SQ16_Field := 16#0#;
-- unspecified
Reserved_11_31 : HAL.UInt21 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SQR4_Register use record
SQ15 at 0 range 0 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
SQ16 at 0 range 6 .. 10;
Reserved_11_31 at 0 range 11 .. 31;
end record;
subtype DR_RDATA_Field is HAL.UInt16;
-- regular Data Register
type DR_Register is record
-- Read-only. regularDATA
RDATA : DR_RDATA_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DR_Register use record
RDATA at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype JSQR_JL_Field is HAL.UInt2;
subtype JSQR_JEXTSEL_Field is HAL.UInt4;
subtype JSQR_JEXTEN_Field is HAL.UInt2;
subtype JSQR_JSQ1_Field is HAL.UInt5;
subtype JSQR_JSQ2_Field is HAL.UInt5;
subtype JSQR_JSQ3_Field is HAL.UInt5;
subtype JSQR_JSQ4_Field is HAL.UInt5;
-- injected sequence register
type JSQR_Register is record
-- JL
JL : JSQR_JL_Field := 16#0#;
-- JEXTSEL
JEXTSEL : JSQR_JEXTSEL_Field := 16#0#;
-- JEXTEN
JEXTEN : JSQR_JEXTEN_Field := 16#0#;
-- JSQ1
JSQ1 : JSQR_JSQ1_Field := 16#0#;
-- unspecified
Reserved_13_13 : HAL.Bit := 16#0#;
-- JSQ2
JSQ2 : JSQR_JSQ2_Field := 16#0#;
-- unspecified
Reserved_19_19 : HAL.Bit := 16#0#;
-- JSQ3
JSQ3 : JSQR_JSQ3_Field := 16#0#;
-- unspecified
Reserved_25_25 : HAL.Bit := 16#0#;
-- JSQ4
JSQ4 : JSQR_JSQ4_Field := 16#0#;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for JSQR_Register use record
JL at 0 range 0 .. 1;
JEXTSEL at 0 range 2 .. 5;
JEXTEN at 0 range 6 .. 7;
JSQ1 at 0 range 8 .. 12;
Reserved_13_13 at 0 range 13 .. 13;
JSQ2 at 0 range 14 .. 18;
Reserved_19_19 at 0 range 19 .. 19;
JSQ3 at 0 range 20 .. 24;
Reserved_25_25 at 0 range 25 .. 25;
JSQ4 at 0 range 26 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype OFR1_OFFSET1_Field is HAL.UInt12;
subtype OFR1_OFFSET1_CH_Field is HAL.UInt5;
-- offset register 1
type OFR1_Register is record
-- OFFSET1
OFFSET1 : OFR1_OFFSET1_Field := 16#0#;
-- unspecified
Reserved_12_25 : HAL.UInt14 := 16#0#;
-- OFFSET1_CH
OFFSET1_CH : OFR1_OFFSET1_CH_Field := 16#0#;
-- OFFSET1_EN
OFFSET1_EN : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OFR1_Register use record
OFFSET1 at 0 range 0 .. 11;
Reserved_12_25 at 0 range 12 .. 25;
OFFSET1_CH at 0 range 26 .. 30;
OFFSET1_EN at 0 range 31 .. 31;
end record;
subtype OFR2_OFFSET2_Field is HAL.UInt12;
subtype OFR2_OFFSET2_CH_Field is HAL.UInt5;
-- offset register 2
type OFR2_Register is record
-- OFFSET2
OFFSET2 : OFR2_OFFSET2_Field := 16#0#;
-- unspecified
Reserved_12_25 : HAL.UInt14 := 16#0#;
-- OFFSET2_CH
OFFSET2_CH : OFR2_OFFSET2_CH_Field := 16#0#;
-- OFFSET2_EN
OFFSET2_EN : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OFR2_Register use record
OFFSET2 at 0 range 0 .. 11;
Reserved_12_25 at 0 range 12 .. 25;
OFFSET2_CH at 0 range 26 .. 30;
OFFSET2_EN at 0 range 31 .. 31;
end record;
subtype OFR3_OFFSET3_Field is HAL.UInt12;
subtype OFR3_OFFSET3_CH_Field is HAL.UInt5;
-- offset register 3
type OFR3_Register is record
-- OFFSET3
OFFSET3 : OFR3_OFFSET3_Field := 16#0#;
-- unspecified
Reserved_12_25 : HAL.UInt14 := 16#0#;
-- OFFSET3_CH
OFFSET3_CH : OFR3_OFFSET3_CH_Field := 16#0#;
-- OFFSET3_EN
OFFSET3_EN : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OFR3_Register use record
OFFSET3 at 0 range 0 .. 11;
Reserved_12_25 at 0 range 12 .. 25;
OFFSET3_CH at 0 range 26 .. 30;
OFFSET3_EN at 0 range 31 .. 31;
end record;
subtype OFR4_OFFSET4_Field is HAL.UInt12;
subtype OFR4_OFFSET4_CH_Field is HAL.UInt5;
-- offset register 4
type OFR4_Register is record
-- OFFSET4
OFFSET4 : OFR4_OFFSET4_Field := 16#0#;
-- unspecified
Reserved_12_25 : HAL.UInt14 := 16#0#;
-- OFFSET4_CH
OFFSET4_CH : OFR4_OFFSET4_CH_Field := 16#0#;
-- OFFSET4_EN
OFFSET4_EN : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OFR4_Register use record
OFFSET4 at 0 range 0 .. 11;
Reserved_12_25 at 0 range 12 .. 25;
OFFSET4_CH at 0 range 26 .. 30;
OFFSET4_EN at 0 range 31 .. 31;
end record;
subtype JDR1_JDATA1_Field is HAL.UInt16;
-- injected data register 1
type JDR1_Register is record
-- Read-only. JDATA1
JDATA1 : JDR1_JDATA1_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for JDR1_Register use record
JDATA1 at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype JDR2_JDATA2_Field is HAL.UInt16;
-- injected data register 2
type JDR2_Register is record
-- Read-only. JDATA2
JDATA2 : JDR2_JDATA2_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for JDR2_Register use record
JDATA2 at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype JDR3_JDATA3_Field is HAL.UInt16;
-- injected data register 3
type JDR3_Register is record
-- Read-only. JDATA3
JDATA3 : JDR3_JDATA3_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for JDR3_Register use record
JDATA3 at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype JDR4_JDATA4_Field is HAL.UInt16;
-- injected data register 4
type JDR4_Register is record
-- Read-only. JDATA4
JDATA4 : JDR4_JDATA4_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for JDR4_Register use record
JDATA4 at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype AWD2CR_AWD2CH_Field is HAL.UInt18;
-- Analog Watchdog 2 Configuration Register
type AWD2CR_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit := 16#0#;
-- AWD2CH
AWD2CH : AWD2CR_AWD2CH_Field := 16#0#;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for AWD2CR_Register use record
Reserved_0_0 at 0 range 0 .. 0;
AWD2CH at 0 range 1 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
subtype AWD3CR_AWD3CH_Field is HAL.UInt18;
-- Analog Watchdog 3 Configuration Register
type AWD3CR_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit := 16#0#;
-- AWD3CH
AWD3CH : AWD3CR_AWD3CH_Field := 16#0#;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for AWD3CR_Register use record
Reserved_0_0 at 0 range 0 .. 0;
AWD3CH at 0 range 1 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
subtype DIFSEL_DIFSEL_1_15_Field is HAL.UInt15;
subtype DIFSEL_DIFSEL_16_18_Field is HAL.UInt3;
-- Differential Mode Selection Register 2
type DIFSEL_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit := 16#0#;
-- Differential mode for channels 15 to 1
DIFSEL_1_15 : DIFSEL_DIFSEL_1_15_Field := 16#0#;
-- Read-only. Differential mode for channels 18 to 16
DIFSEL_16_18 : DIFSEL_DIFSEL_16_18_Field := 16#0#;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DIFSEL_Register use record
Reserved_0_0 at 0 range 0 .. 0;
DIFSEL_1_15 at 0 range 1 .. 15;
DIFSEL_16_18 at 0 range 16 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
subtype CALFACT_CALFACT_S_Field is HAL.UInt7;
subtype CALFACT_CALFACT_D_Field is HAL.UInt7;
-- Calibration Factors
type CALFACT_Register is record
-- CALFACT_S
CALFACT_S : CALFACT_CALFACT_S_Field := 16#0#;
-- unspecified
Reserved_7_15 : HAL.UInt9 := 16#0#;
-- CALFACT_D
CALFACT_D : CALFACT_CALFACT_D_Field := 16#0#;
-- unspecified
Reserved_23_31 : HAL.UInt9 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CALFACT_Register use record
CALFACT_S at 0 range 0 .. 6;
Reserved_7_15 at 0 range 7 .. 15;
CALFACT_D at 0 range 16 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
-- ADC Common status register
type CSR_Register is record
-- Read-only. Master ADC ready
ADRDY_MST : Boolean;
-- Read-only. End of Sampling phase flag of the master ADC
EOSMP_MST : Boolean;
-- Read-only. End of regular conversion of the master ADC
EOC_MST : Boolean;
-- Read-only. End of regular sequence flag of the master ADC
EOS_MST : Boolean;
-- Read-only. Overrun flag of the master ADC
OVR_MST : Boolean;
-- Read-only. End of injected conversion flag of the master ADC
JEOC_MST : Boolean;
-- Read-only. End of injected sequence flag of the master ADC
JEOS_MST : Boolean;
-- Read-only. Analog watchdog 1 flag of the master ADC
AWD1_MST : Boolean;
-- Read-only. Analog watchdog 2 flag of the master ADC
AWD2_MST : Boolean;
-- Read-only. Analog watchdog 3 flag of the master ADC
AWD3_MST : Boolean;
-- Read-only. Injected Context Queue Overflow flag of the master ADC
JQOVF_MST : Boolean;
-- unspecified
Reserved_11_15 : HAL.UInt5;
-- Read-only. Slave ADC ready
ADRDY_SLV : Boolean;
-- Read-only. End of Sampling phase flag of the slave ADC
EOSMP_SLV : Boolean;
-- Read-only. End of regular conversion of the slave ADC
EOC_SLV : Boolean;
-- Read-only. End of regular sequence flag of the slave ADC
EOS_SLV : Boolean;
-- Read-only. Overrun flag of the slave ADC
OVR_SLV : Boolean;
-- Read-only. End of injected conversion flag of the slave ADC
JEOC_SLV : Boolean;
-- Read-only. End of injected sequence flag of the slave ADC
JEOS_SLV : Boolean;
-- Read-only. Analog watchdog 1 flag of the slave ADC
AWD1_SLV : Boolean;
-- Read-only. Analog watchdog 2 flag of the slave ADC
AWD2_SLV : Boolean;
-- Read-only. Analog watchdog 3 flag of the slave ADC
AWD3_SLV : Boolean;
-- Read-only. Injected Context Queue Overflow flag of the slave ADC
JQOVF_SLV : Boolean;
-- unspecified
Reserved_27_31 : HAL.UInt5;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CSR_Register use record
ADRDY_MST at 0 range 0 .. 0;
EOSMP_MST at 0 range 1 .. 1;
EOC_MST at 0 range 2 .. 2;
EOS_MST at 0 range 3 .. 3;
OVR_MST at 0 range 4 .. 4;
JEOC_MST at 0 range 5 .. 5;
JEOS_MST at 0 range 6 .. 6;
AWD1_MST at 0 range 7 .. 7;
AWD2_MST at 0 range 8 .. 8;
AWD3_MST at 0 range 9 .. 9;
JQOVF_MST at 0 range 10 .. 10;
Reserved_11_15 at 0 range 11 .. 15;
ADRDY_SLV at 0 range 16 .. 16;
EOSMP_SLV at 0 range 17 .. 17;
EOC_SLV at 0 range 18 .. 18;
EOS_SLV at 0 range 19 .. 19;
OVR_SLV at 0 range 20 .. 20;
JEOC_SLV at 0 range 21 .. 21;
JEOS_SLV at 0 range 22 .. 22;
AWD1_SLV at 0 range 23 .. 23;
AWD2_SLV at 0 range 24 .. 24;
AWD3_SLV at 0 range 25 .. 25;
JQOVF_SLV at 0 range 26 .. 26;
Reserved_27_31 at 0 range 27 .. 31;
end record;
subtype CCR_DUAL_Field is HAL.UInt5;
subtype CCR_DELAY_Field is HAL.UInt4;
subtype CCR_MDMA_Field is HAL.UInt2;
subtype CCR_CKMODE_Field is HAL.UInt2;
-- ADC common control register
type CCR_Register is record
-- Dual ADC mode selection
DUAL : CCR_DUAL_Field := 16#0#;
-- unspecified
Reserved_5_7 : HAL.UInt3 := 16#0#;
-- Delay between 2 sampling phases
DELAY_k : CCR_DELAY_Field := 16#0#;
-- unspecified
Reserved_12_12 : HAL.Bit := 16#0#;
-- DMA configuration (for dual ADC mode)
DMACFG : Boolean := False;
-- Direct memory access mode for dual ADC mode
MDMA : CCR_MDMA_Field := 16#0#;
-- ADC clock mode
CKMODE : CCR_CKMODE_Field := 16#0#;
-- unspecified
Reserved_18_21 : HAL.UInt4 := 16#0#;
-- VREFINT enable
VREFEN : Boolean := False;
-- Temperature sensor enable
TSEN : Boolean := False;
-- VBAT enable
VBATEN : Boolean := False;
-- unspecified
Reserved_25_31 : HAL.UInt7 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CCR_Register use record
DUAL at 0 range 0 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
DELAY_k at 0 range 8 .. 11;
Reserved_12_12 at 0 range 12 .. 12;
DMACFG at 0 range 13 .. 13;
MDMA at 0 range 14 .. 15;
CKMODE at 0 range 16 .. 17;
Reserved_18_21 at 0 range 18 .. 21;
VREFEN at 0 range 22 .. 22;
TSEN at 0 range 23 .. 23;
VBATEN at 0 range 24 .. 24;
Reserved_25_31 at 0 range 25 .. 31;
end record;
subtype CDR_RDATA_MST_Field is HAL.UInt16;
subtype CDR_RDATA_SLV_Field is HAL.UInt16;
-- ADC common regular data register for dual mode
type CDR_Register is record
-- Read-only. Regular data of the master ADC
RDATA_MST : CDR_RDATA_MST_Field;
-- Read-only. Regular data of the slave ADC
RDATA_SLV : CDR_RDATA_SLV_Field;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CDR_Register use record
RDATA_MST at 0 range 0 .. 15;
RDATA_SLV at 0 range 16 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Analog-to-Digital Converter
type ADC1_Peripheral is record
-- interrupt and status register
ISR : aliased ISR_Register;
-- interrupt enable register
IER : aliased IER_Register;
-- control register
CR : aliased CR_Register;
-- configuration register
CFGR : aliased CFGR_Register;
-- sample time register 1
SMPR1 : aliased SMPR1_Register;
-- sample time register 2
SMPR2 : aliased SMPR2_Register;
-- watchdog threshold register 1
TR1 : aliased TR1_Register;
-- watchdog threshold register
TR2 : aliased TR2_Register;
-- watchdog threshold register 3
TR3 : aliased TR3_Register;
-- regular sequence register 1
SQR1 : aliased SQR1_Register;
-- regular sequence register 2
SQR2 : aliased SQR2_Register;
-- regular sequence register 3
SQR3 : aliased SQR3_Register;
-- regular sequence register 4
SQR4 : aliased SQR4_Register;
-- regular Data Register
DR : aliased DR_Register;
-- injected sequence register
JSQR : aliased JSQR_Register;
-- offset register 1
OFR1 : aliased OFR1_Register;
-- offset register 2
OFR2 : aliased OFR2_Register;
-- offset register 3
OFR3 : aliased OFR3_Register;
-- offset register 4
OFR4 : aliased OFR4_Register;
-- injected data register 1
JDR1 : aliased JDR1_Register;
-- injected data register 2
JDR2 : aliased JDR2_Register;
-- injected data register 3
JDR3 : aliased JDR3_Register;
-- injected data register 4
JDR4 : aliased JDR4_Register;
-- Analog Watchdog 2 Configuration Register
AWD2CR : aliased AWD2CR_Register;
-- Analog Watchdog 3 Configuration Register
AWD3CR : aliased AWD3CR_Register;
-- Differential Mode Selection Register 2
DIFSEL : aliased DIFSEL_Register;
-- Calibration Factors
CALFACT : aliased CALFACT_Register;
end record
with Volatile;
for ADC1_Peripheral use record
ISR at 16#0# range 0 .. 31;
IER at 16#4# range 0 .. 31;
CR at 16#8# range 0 .. 31;
CFGR at 16#C# range 0 .. 31;
SMPR1 at 16#14# range 0 .. 31;
SMPR2 at 16#18# range 0 .. 31;
TR1 at 16#20# range 0 .. 31;
TR2 at 16#24# range 0 .. 31;
TR3 at 16#28# range 0 .. 31;
SQR1 at 16#30# range 0 .. 31;
SQR2 at 16#34# range 0 .. 31;
SQR3 at 16#38# range 0 .. 31;
SQR4 at 16#3C# range 0 .. 31;
DR at 16#40# range 0 .. 31;
JSQR at 16#4C# range 0 .. 31;
OFR1 at 16#60# range 0 .. 31;
OFR2 at 16#64# range 0 .. 31;
OFR3 at 16#68# range 0 .. 31;
OFR4 at 16#6C# range 0 .. 31;
JDR1 at 16#80# range 0 .. 31;
JDR2 at 16#84# range 0 .. 31;
JDR3 at 16#88# range 0 .. 31;
JDR4 at 16#8C# range 0 .. 31;
AWD2CR at 16#A0# range 0 .. 31;
AWD3CR at 16#A4# range 0 .. 31;
DIFSEL at 16#B0# range 0 .. 31;
CALFACT at 16#B4# range 0 .. 31;
end record;
-- Analog-to-Digital Converter
ADC1_Periph : aliased ADC1_Peripheral
with Import, Address => ADC1_Base;
-- Analog-to-Digital Converter
ADC2_Periph : aliased ADC1_Peripheral
with Import, Address => ADC2_Base;
-- ADC common registers
type ADC_Common_Peripheral is record
-- ADC Common status register
CSR : aliased CSR_Register;
-- ADC common control register
CCR : aliased CCR_Register;
-- ADC common regular data register for dual mode
CDR : aliased CDR_Register;
end record
with Volatile;
for ADC_Common_Peripheral use record
CSR at 16#0# range 0 .. 31;
CCR at 16#8# range 0 .. 31;
CDR at 16#C# range 0 .. 31;
end record;
-- ADC common registers
ADC_Common_Periph : aliased ADC_Common_Peripheral
with Import, Address => ADC_Common_Base;
end STM32_SVD.ADC;
|
-------------------------------------------------------------------------------
-- Copyright (c) 2019, Daniel King
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
-- * Redistributions of source code must retain the above copyright
-- notice, this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- * The name of the copyright holder may not be used to endorse or promote
-- Products derived from this software without specific prior written
-- permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
with Keccak.Types;
-- @summary
-- Simulates a higher-order level of parallelism from lower-order parallelism.
--
-- @description
-- This package uses a combines multiple instances of lower-order parallelism
-- (e.g. two 2x parallelism) into a single higher-order parallel instance.
-- For example, this package can be used to simulate Keccak-p[1600,24]x8
-- by serially invoking 2 separate instances of Keccak-[1600,24]x4.
--
-- This package is useful in cases where a high order of parallelism is
-- required (e.g. 8x) by an API, but such an implementation is not available.
--
-- Instances of this package can be chained. For example, if you want to
-- have a fallback for 8x parallelism, but you only have a 2x implementation,
-- then you can double the 2x into 4x, then double again the 4x into 8x.
--
-- @group Parallel Keccak-f
generic
type Permutation_State is private;
-- Type for the parallel permutation state (e.g. Keccak-f[1600]�2).
Base_Parallelism : Positive;
-- The number of parallel instances for the @Permutation_Type@.
--
-- For example, if Permutation_State is the state for Keccak-f[1600]�4
-- then set Base_Parallelism to 4.
Parallel_Factor : Positive;
-- Multiply the Base_Parallelism by this number.
--
-- The overall number of parallel instances will be:
-- Base_Parallelism * Parallel_Factor.
--
-- For example, if this package is instantiated with Keccak-f[1600]�4
-- and Parallel_Factor = 2, then this package will use 2x Keccak-f[1600]�4
-- to produce an overall Keccak-f[1600]�8 parallel permutation.
with procedure Init (S : out Permutation_State);
-- Initializes the Permutation_State to all zeroes.
with procedure XOR_Bits_Into_State_Separate
(S : in out Permutation_State;
Data : in Types.Byte_Array;
Data_Offset : in Natural;
Bit_Len : in Natural);
-- XOR bits into each parallel state.
with procedure XOR_Bits_Into_State_All
(S : in out Permutation_State;
Data : in Types.Byte_Array;
Bit_Len : in Natural);
with procedure Extract_Bytes (S : in Permutation_State;
Data : in out Types.Byte_Array;
Data_Offset : in Natural;
Byte_Len : in Natural);
-- Extract bytes from each parallel state.
State_Size_Bits : Positive;
package Keccak.Generic_Parallel_Permutation_Parallel_Fallback
is
Num_Parallel_Instances : constant Positive := Base_Parallelism * Parallel_Factor;
type Permutation_State_Array is
array (0 .. Parallel_Factor - 1)
of Permutation_State;
-- Parallel_State is not declared as a private type as a workaround for a
-- bug in GNATprove during flow analysis of instantiations of the
-- generic Permute_All procedure.
type Parallel_State is record
States : Permutation_State_Array;
end record;
type State_Index is new Natural range 0 .. Num_Parallel_Instances - 1;
procedure Init (S : out Parallel_State)
with Global => null;
generic
with procedure Permute (S : in out Permutation_State);
procedure Permute_All (S : in out Parallel_State)
with Global => null;
-- Apply the permutation function to each internal instance.
procedure XOR_Bits_Into_State_Separate
(S : in out Parallel_State;
Data : in Types.Byte_Array;
Data_Offset : in Natural;
Bit_Len : in Natural)
with Global => null,
Pre => (Data'Length / Num_Parallel_Instances <= Natural'Last / 8
and then Data'Length mod Num_Parallel_Instances = 0
and then Data_Offset <= (Data'Length / Num_Parallel_Instances)
and then Bit_Len <= ((Data'Length / Num_Parallel_Instances) - Data_Offset) * 8
and then Bit_Len <= State_Size_Bits);
procedure XOR_Bits_Into_State_All
(S : in out Parallel_State;
Data : in Types.Byte_Array;
Bit_Len : in Natural)
with Global => null,
Depends => (S =>+ (Data, Bit_Len)),
Pre => (Data'Length <= Natural'Last / 8
and then Bit_Len <= Data'Length * 8
and then Bit_Len <= State_Size_Bits);
procedure Extract_Bytes (S : in Parallel_State;
Data : in out Types.Byte_Array;
Data_Offset : in Natural;
Byte_Len : in Natural)
with Global => null,
Pre => (Data'Length mod Num_Parallel_Instances = 0
and then Data_Offset <= Data'Length / Num_Parallel_Instances
and then Byte_Len <= (Data'Length / Num_Parallel_Instances) - Data_Offset
and then Byte_Len <= State_Size_Bits / 8);
end Keccak.Generic_Parallel_Permutation_Parallel_Fallback;
|
--
-- 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.
--
--
with ewok.tasks; use ewok.tasks;
with ewok.tasks_shared; use ewok.tasks_shared;
with ewok.sanitize;
with ewok.debug;
with ewok.alarm;
package body ewok.syscalls.alarm
with spark_mode => off
is
procedure svc_alarm
(caller_id : in ewok.tasks_shared.t_task_id;
params : in t_parameters;
mode : in ewok.tasks_shared.t_task_mode)
is
alarm_time : unsigned_32 with address => params(1)'address;
handler : constant system_address := params(2);
begin
if alarm_time = 0 or handler = 0 then
ewok.alarm.unset_alarm (caller_id);
goto ret_ok;
end if;
if not ewok.sanitize.is_word_in_txt_region (handler, caller_id)
then
pragma DEBUG (debug.log (debug.ERROR, "Handler not in .txt section"));
goto ret_denied;
end if;
ewok.alarm.set_alarm
(caller_id, milliseconds (alarm_time), handler);
<<ret_ok>>
set_return_value (caller_id, mode, SYS_E_DONE);
ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
<<ret_denied>>
set_return_value (caller_id, mode, SYS_E_DENIED);
ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
end svc_alarm;
end ewok.syscalls.alarm;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . B I T _ O P S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- Operations on packed bit strings
with System;
package System.Bit_Ops is
-- Note: in all the following routines, the System.Address parameters
-- represent the address of the first byte of an array used to represent
-- a packed array (of type System.Unsigned_Types.Packed_Bytes{1,2,4})
-- The length in bits is passed as a separate parameter. Note that all
-- addresses must be of byte aligned arrays.
procedure Bit_And
(Left : System.Address;
Llen : Natural;
Right : System.Address;
Rlen : Natural;
Result : System.Address);
-- Bitwise "and" of given bit string with result being placed in Result.
-- The and operation is allowed to destroy unused bits in the last byte,
-- i.e. to leave them set in an undefined manner. Note that Left, Right
-- and Result always have the same length in bits (Len).
function Bit_Eq
(Left : System.Address;
Llen : Natural;
Right : System.Address;
Rlen : Natural) return Boolean;
-- Left and Right are the addresses of two bit packed arrays with Llen
-- and Rlen being the respective length in bits. The routine compares the
-- two bit strings for equality, being careful not to include the unused
-- bits in the final byte. Note that the result is always False if Rlen
-- is not equal to Llen.
procedure Bit_Not
(Opnd : System.Address;
Len : Natural;
Result : System.Address);
-- Bitwise "not" of given bit string with result being placed in Result.
-- The not operation is allowed to destroy unused bits in the last byte,
-- i.e. to leave them set in an undefined manner. Note that Result and
-- Opnd always have the same length in bits (Len).
procedure Bit_Or
(Left : System.Address;
Llen : Natural;
Right : System.Address;
Rlen : Natural;
Result : System.Address);
-- Bitwise "or" of given bit string with result being placed in Result.
-- The or operation is allowed to destroy unused bits in the last byte,
-- i.e. to leave them set in an undefined manner. Note that Left, Right
-- and Result always have the same length in bits (Len).
procedure Bit_Xor
(Left : System.Address;
Llen : Natural;
Right : System.Address;
Rlen : Natural;
Result : System.Address);
-- Bitwise "xor" of given bit string with result being placed in Result.
-- The xor operation is allowed to destroy unused bits in the last byte,
-- i.e. to leave them set in an undefined manner. Note that Left, Right
-- and Result always have the same length in bits (Len).
end System.Bit_Ops;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . M E M O R Y _ M O V E --
-- --
-- B o d y --
-- --
-- Copyright (C) 2006-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. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Unchecked_Conversion;
with Interfaces.C; use Interfaces.C;
package body System.Memory_Move is
type IA is mod System.Memory_Size;
-- The type used to provide the actual desired operations
function To_IA is new Ada.Unchecked_Conversion (Address, IA);
-- The operations are implemented by unchecked conversion to type IA,
-- followed by doing the intrinsic operation on the IA values, followed
-- by converting the result back to type Address.
type Byte is mod 2 ** 8;
for Byte'Size use 8;
-- Byte is the storage unit
type Byte_Ptr is access Byte;
-- Access to a byte
function To_Byte_Ptr is new Ada.Unchecked_Conversion (IA, Byte_Ptr);
-- Conversion between an integer address and access to byte
Byte_Size : constant := 1;
-- Number of storage unit in a byte
type Word is mod 2 ** System.Word_Size;
for Word'Size use System.Word_Size;
-- Word is efficiently loaded and stored by the processor, but has
-- alignment constraints.
type Word_Ptr is access Word;
-- Access to a word.
function To_Word_Ptr is new Ada.Unchecked_Conversion (IA, Word_Ptr);
-- Conversion from an integer adddress to word access
Word_Size : constant := Word'Size / Storage_Unit;
-- Number of storage unit per word
-------------
-- memmove --
-------------
function memmove
(Dest : Address; Src : Address; N : size_t) return Address is
D : IA := To_IA (Dest);
S : IA := To_IA (Src);
C : IA := IA (N);
begin
-- Return immediately if no bytes to copy.
if N = 0 then
return Dest;
end if;
-- This function must handle overlapping memory regions
-- for the source and destination. If the Dest buffer is
-- located past the Src buffer then we use backward copying,
-- and forward copying otherwise.
if D > S and then D < S + C then
D := D + C;
S := S + C;
while C /= 0 loop
D := D - Byte_Size;
S := S - Byte_Size;
To_Byte_Ptr (D).all := To_Byte_Ptr (S).all;
C := C - Byte_Size;
end loop;
else
-- Try to copy per word, if alignment constraints are respected
if ((D or S) and (Word'Alignment - 1)) = 0 then
while C >= Word_Size loop
To_Word_Ptr (D).all := To_Word_Ptr (S).all;
D := D + Word_Size;
S := S + Word_Size;
C := C - Word_Size;
end loop;
end if;
-- Copy the remaining byte per byte
while C > 0 loop
To_Byte_Ptr (D).all := To_Byte_Ptr (S).all;
D := D + Byte_Size;
S := S + Byte_Size;
C := C - Byte_Size;
end loop;
end if;
return Dest;
end memmove;
end System.Memory_Move;
|
-----------------------------------------------------------------------
-- ADO Databases -- Database Connections
-- Copyright (C) 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 Util.Log;
with Util.Log.Loggers;
with Ada.Unchecked_Deallocation;
with ADO.Statements.Create;
package body ADO.Databases is
use Util.Log;
use ADO.Drivers;
use type ADO.Drivers.Connections.Database_Connection_Access;
Log : constant Loggers.Logger := Loggers.Create ("ADO.Databases");
-- ------------------------------
-- Get the database connection status.
-- ------------------------------
function Get_Status (Database : in Connection) return Connection_Status is
begin
if Database.Impl = null then
return CLOSED;
else
return OPEN;
end if;
end Get_Status;
-- ------------------------------
-- Create a query statement. The statement is not prepared
-- ------------------------------
function Create_Statement (Database : in Connection;
Table : in ADO.Schemas.Class_Mapping_Access)
return Query_Statement is
begin
if Database.Impl = null then
Log.Error ("Database implementation is not initialized");
raise NOT_OPEN with "No connection to the database";
end if;
declare
Query : constant Query_Statement_Access := Database.Impl.all.Create_Statement (Table);
begin
return ADO.Statements.Create.Create_Statement (Query);
end;
end Create_Statement;
-- ------------------------------
-- Create a query statement. The statement is not prepared
-- ------------------------------
function Create_Statement (Database : in Connection;
Query : in String)
return Query_Statement is
begin
if Database.Impl = null then
Log.Error ("Database implementation is not initialized");
raise NOT_OPEN with "No connection to the database";
end if;
declare
Stmt : constant Query_Statement_Access := Database.Impl.all.Create_Statement (null);
begin
Append (Query => Stmt.all, SQL => Query);
return ADO.Statements.Create.Create_Statement (Stmt);
end;
end Create_Statement;
-- ------------------------------
-- Get the database driver which manages this connection.
-- ------------------------------
function Get_Driver (Database : in Connection) return ADO.Drivers.Connections.Driver_Access is
begin
if Database.Impl = null then
Log.Error ("Database implementation is not initialized");
raise NOT_OPEN with "No connection to the database";
end if;
return Database.Impl.Get_Driver;
end Get_Driver;
-- ------------------------------
-- Get the database driver index.
-- ------------------------------
function Get_Driver_Index (Database : in Connection) return ADO.Drivers.Driver_Index is
Driver : constant ADO.Drivers.Connections.Driver_Access := Database.Get_Driver;
begin
return Driver.Get_Driver_Index;
end Get_Driver_Index;
-- ------------------------------
-- Get a database connection identifier.
-- ------------------------------
function Get_Ident (Database : in Connection) return String is
begin
if Database.Impl = null then
return "null";
else
return Database.Impl.Ident;
end if;
end Get_Ident;
-- ------------------------------
-- Load the database schema definition for the current database.
-- ------------------------------
procedure Load_Schema (Database : in Connection;
Schema : out ADO.Schemas.Schema_Definition) is
begin
if Database.Impl = null then
Log.Error ("Database connection is not initialized");
raise NOT_OPEN with "No connection to the database";
end if;
Database.Impl.Load_Schema (Schema);
end Load_Schema;
-- ------------------------------
-- Close the database connection
-- ------------------------------
procedure Close (Database : in out Connection) is
begin
Log.Info ("Closing database connection {0}", Database.Get_Ident);
if Database.Impl /= null then
Database.Impl.Close;
end if;
end Close;
-- ------------------------------
-- Start a transaction.
-- ------------------------------
procedure Begin_Transaction (Database : in out Master_Connection) is
begin
Log.Info ("Begin transaction {0}", Database.Get_Ident);
if Database.Impl = null then
Log.Error ("Database implementation is not initialized");
raise NOT_OPEN with "No connection to the database";
end if;
Database.Impl.Begin_Transaction;
end Begin_Transaction;
-- ------------------------------
-- Commit the current transaction.
-- ------------------------------
procedure Commit (Database : in out Master_Connection) is
begin
Log.Info ("Commit transaction {0}", Database.Get_Ident);
if Database.Impl = null then
Log.Error ("Database implementation is not initialized");
raise NOT_OPEN with "No connection to the database";
end if;
Database.Impl.Commit;
end Commit;
-- ------------------------------
-- Rollback the current transaction.
-- ------------------------------
procedure Rollback (Database : in out Master_Connection) is
begin
Log.Info ("Rollback transaction {0}", Database.Get_Ident);
if Database.Impl = null then
Log.Error ("Database implementation is not initialized");
raise NOT_OPEN with "Database implementation is not initialized";
end if;
Database.Impl.Rollback;
end Rollback;
-- ------------------------------
-- Create a delete statement.
-- ------------------------------
function Create_Statement (Database : in Master_Connection;
Table : in ADO.Schemas.Class_Mapping_Access)
return Delete_Statement is
begin
Log.Debug ("Create delete statement {0}", Database.Get_Ident);
declare
Stmt : constant Delete_Statement_Access := Database.Impl.all.Create_Statement (Table);
begin
return ADO.Statements.Create.Create_Statement (Stmt);
end;
end Create_Statement;
-- ------------------------------
-- Create an insert statement.
-- ------------------------------
function Create_Statement (Database : in Master_Connection;
Table : in ADO.Schemas.Class_Mapping_Access)
return Insert_Statement is
begin
Log.Debug ("Create insert statement {0}", Database.Get_Ident);
declare
Stmt : constant Insert_Statement_Access := Database.Impl.all.Create_Statement (Table);
begin
return ADO.Statements.Create.Create_Statement (Stmt.all'Access);
end;
end Create_Statement;
-- ------------------------------
-- Create an update statement.
-- ------------------------------
function Create_Statement (Database : in Master_Connection;
Table : in ADO.Schemas.Class_Mapping_Access)
return Update_Statement is
begin
Log.Debug ("Create update statement {0}", Database.Get_Ident);
return ADO.Statements.Create.Create_Statement (Database.Impl.all.Create_Statement (Table));
end Create_Statement;
-- ------------------------------
-- Adjust the connection reference counter
-- ------------------------------
overriding
procedure Adjust (Object : in out Connection) is
begin
if Object.Impl /= null then
Object.Impl.Count := Object.Impl.Count + 1;
end if;
end Adjust;
-- ------------------------------
-- Releases the connection reference counter
-- ------------------------------
overriding
procedure Finalize (Object : in out Connection) is
procedure Free is new
Ada.Unchecked_Deallocation (Object => ADO.Drivers.Connections.Database_Connection'Class,
Name => ADO.Drivers.Connections.Database_Connection_Access);
begin
if Object.Impl /= null then
Object.Impl.Count := Object.Impl.Count - 1;
if Object.Impl.Count = 0 then
Free (Object.Impl);
end if;
end if;
end Finalize;
-- ------------------------------
-- Attempts to establish a connection with the data source
-- that this DataSource object represents.
-- ------------------------------
function Get_Connection (Controller : in DataSource)
return Master_Connection'Class is
Connection : ADO.Drivers.Connections.Database_Connection_Access;
begin
Log.Info ("Get master connection from data-source");
Controller.Create_Connection (Connection);
return Master_Connection '(Ada.Finalization.Controlled with
Impl => Connection);
end Get_Connection;
-- ------------------------------
-- Set the master data source
-- ------------------------------
procedure Set_Master (Controller : in out Replicated_DataSource;
Master : in DataSource_Access) is
begin
Controller.Master := Master;
end Set_Master;
-- ------------------------------
-- Get the master data source
-- ------------------------------
function Get_Master (Controller : in Replicated_DataSource)
return DataSource_Access is
begin
return Controller.Master;
end Get_Master;
-- ------------------------------
-- Set the slave data source
-- ------------------------------
procedure Set_Slave (Controller : in out Replicated_DataSource;
Slave : in DataSource_Access) is
begin
Controller.Slave := Slave;
end Set_Slave;
-- ------------------------------
-- Get the slave data source
-- ------------------------------
function Get_Slave (Controller : in Replicated_DataSource)
return DataSource_Access is
begin
return Controller.Slave;
end Get_Slave;
-- ------------------------------
-- Get a slave database connection
-- ------------------------------
function Get_Slave_Connection (Controller : in Replicated_DataSource)
return Connection'Class is
begin
return Controller.Slave.Get_Connection;
end Get_Slave_Connection;
end ADO.Databases;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S E M _ S M E M --
-- --
-- B o d y --
-- --
-- Copyright (C) 1998-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. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Einfo; use Einfo;
with Errout; use Errout;
with Namet; use Namet;
with Sem_Aux; use Sem_Aux;
with Sinfo; use Sinfo;
with Snames; use Snames;
package body Sem_Smem is
function Contains_Access_Type (T : Entity_Id) return Boolean;
-- This function determines if type T is an access type, or contains
-- a component (array, record, protected type cases) that contains
-- an access type (recursively defined in the appropriate manner).
----------------------
-- Check_Shared_Var --
----------------------
procedure Check_Shared_Var
(Id : Entity_Id;
T : Entity_Id;
N : Node_Id)
is
begin
-- We cannot tolerate aliased variables, because they might be
-- modified via an aliased pointer, and we could not detect that
-- this was happening (to update the corresponding shared memory
-- file), so we must disallow all use of Aliased
if Aliased_Present (N) then
Error_Msg_N
("aliased variables " &
"not supported in Shared_Passive partitions",
N);
-- We can't support access types at all, since they are local
-- pointers that cannot in any simple way be transmitted to other
-- partitions.
elsif Is_Access_Type (T) then
Error_Msg_N
("access type variables " &
"not supported in Shared_Passive partitions",
Id);
-- We cannot tolerate types that contain access types, same reasons
elsif Contains_Access_Type (T) then
Error_Msg_N
("types containing access components " &
"not supported in Shared_Passive partitions",
Id);
-- Objects with default-initialized types will be rejected when
-- the initialization code is generated. However we must flag tasks
-- earlier on, to prevent expansion of stream attributes that is
-- bound to fail.
elsif Has_Task (T) then
Error_Msg_N
("Shared_Passive partitions cannot contain tasks", Id);
-- Currently we do not support unconstrained record types, since we
-- use 'Write to write out values. This could probably be special
-- cased and handled in the future if necessary.
elsif Is_Record_Type (T)
and then not Is_Constrained (T)
and then (Nkind (N) /= N_Object_Declaration
or else No (Expression (N)))
then
Error_Msg_N
("unconstrained variant records " &
"not supported in Shared_Passive partitions",
Id);
end if;
end Check_Shared_Var;
--------------------------
-- Contains_Access_Type --
--------------------------
function Contains_Access_Type (T : Entity_Id) return Boolean is
C : Entity_Id;
begin
if Is_Access_Type (T) then
return True;
elsif Is_Array_Type (T) then
return Contains_Access_Type (Component_Type (T));
elsif Is_Record_Type (T) then
if Has_Discriminants (T) then
-- Check for access discriminants.
C := First_Discriminant (T);
while Present (C) loop
if Is_Access_Type (Etype (C)) then
return True;
else
C := Next_Discriminant (C);
end if;
end loop;
end if;
C := First_Component (T);
while Present (C) loop
-- For components, ignore internal components other than _Parent
if Comes_From_Source (T)
and then
(Chars (C) = Name_uParent
or else
not Is_Internal_Name (Chars (C)))
and then Contains_Access_Type (Etype (C))
then
return True;
else
C := Next_Component (C);
end if;
end loop;
return False;
elsif Is_Protected_Type (T) then
return Contains_Access_Type (Corresponding_Record_Type (T));
else
return False;
end if;
end Contains_Access_Type;
end Sem_Smem;
|
-------------------------------------------------------------------------------
-- --
-- Coffee Clock --
-- --
-- Copyright (C) 2016-2017 Fabien Chouteau --
-- --
-- Coffee Clock 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. --
-- --
-- Coffee Clock 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 We Noise Maker. If not, see <http://www.gnu.org/licenses/>. --
-- --
-------------------------------------------------------------------------------
with LCD_Graphic_Backend;
with Giza.GUI;
with Giza.Context;
with Giza.Bitmap_Fonts.FreeSerifItalic18pt7b;
with Ada.Synchronous_Task_Control;
with STM32.RNG.Polling;
with System;
with Giza.Events; use Giza.Events;
with Ada.Real_Time; use Ada.Real_Time;
with STM32.Board;
with HAL.Touch_Panel; use HAL.Touch_Panel;
with Clock_Window;
package body GUI is
Backend : aliased LCD_Graphic_Backend.Instance;
Context : aliased Giza.Context.Instance;
Main_W : aliased Clock_Window.Instance;
Sync : Ada.Synchronous_Task_Control.Suspension_Object;
type Touch_State is record
Touch_Detected : Boolean;
X : Natural;
Y : Natural;
end record;
function Current_Touch_State return Touch_State;
-------------------------
-- Current_Touch_State --
-------------------------
function Current_Touch_State return Touch_State is
TS : Touch_State;
ST_TS : constant HAL.Touch_Panel.TP_State :=
STM32.Board.Touch_Panel.Get_All_Touch_Points;
begin
TS.Touch_Detected := ST_TS'Length > 0;
if TS.Touch_Detected then
TS.X := ST_TS (1).X;
TS.Y := ST_TS (1).Y;
else
TS.X := 0;
TS.Y := 0;
end if;
return TS;
end Current_Touch_State;
task Touch_Screen is
pragma Priority (System.Default_Priority - 1);
end Touch_Screen;
task body Touch_Screen is
TS, Prev : Touch_State;
Click_Evt : constant Click_Event_Ref := new Click_Event;
Release_Evt : constant Click_Released_Event_Ref
:= new Click_Released_Event;
begin
Ada.Synchronous_Task_Control.Suspend_Until_True (Sync);
Prev.Touch_Detected := False;
loop
-- STM32F4.Touch_Panel.Wait_For_Touch_Detected;
TS := Current_Touch_State;
if TS.Touch_Detected /= Prev.Touch_Detected then
if TS.Touch_Detected then
Click_Evt.Pos.X := TS.X;
Click_Evt.Pos.Y := TS.Y;
Giza.GUI.Emit (Event_Not_Null_Ref (Click_Evt));
else
Giza.GUI.Emit (Event_Not_Null_Ref (Release_Evt));
end if;
end if;
Prev := TS;
delay until Clock + Milliseconds (10);
end loop;
end Touch_Screen;
----------------
-- Initialize --
----------------
procedure Initialize is
begin
LCD_Graphic_Backend.Initialize;
Giza.GUI.Set_Backend (Backend'Access);
STM32.Board.Touch_Panel.Initialize;
Context.Set_Font (Giza.Bitmap_Fonts.FreeSerifItalic18pt7b.Font);
Giza.GUI.Set_Context (Context'Access);
end Initialize;
-----------
-- Start --
-----------
procedure Start is
begin
STM32.Board.Configure_User_Button_GPIO;
Giza.GUI.Push (Main_W'Access);
Ada.Synchronous_Task_Control.Set_True (Sync);
Giza.GUI.Event_Loop;
end Start;
------------
-- Random --
------------
function Random (Modulo : Unsigned_32) return Unsigned_32 is
Rand_Exess : constant Unsigned_32 := (Unsigned_32'Last mod Modulo) + 1;
Rand_Linit : constant Unsigned_32 := Unsigned_32'Last - Rand_Exess;
Ret : Unsigned_32;
begin
loop
Ret := STM32.RNG.Polling.Random;
exit when Ret <= Rand_Linit;
end loop;
return Ret mod Modulo;
end Random;
end GUI;
|
------------------------------------------------------------------------------
-- Copyright (c) 2013-2016, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with Ada.Strings.Fixed;
package body Natools.String_Slices.Slice_Sets is
package Fixed renames Ada.Strings.Fixed;
---------------------------
-- Range_Set subprograms --
---------------------------
function Is_Overlapping (Bounds : String_Range; Set : Range_Set)
return Boolean
is
Cursor : Range_Sets.Cursor := Set.Floor (Bounds);
begin
if Range_Sets.Has_Element (Cursor) then
if Bounds.First <= Last (Range_Sets.Element (Cursor)) then
return True;
end if;
Range_Sets.Next (Cursor);
else
Cursor := Set.First;
end if;
if Range_Sets.Has_Element (Cursor)
and then Range_Sets.Element (Cursor).First <= Last (Bounds)
then
return True;
end if;
return False;
end Is_Overlapping;
function Is_Valid (Set : Range_Set) return Boolean is
Cursor : Range_Sets.Cursor := Set.First;
Prev, Cur : String_Range;
begin
if not Range_Sets.Has_Element (Cursor) then
return True;
end if;
Prev := Range_Sets.Element (Cursor);
if Prev.Length = 0 then
return False;
end if;
Range_Sets.Next (Cursor);
while Range_Sets.Has_Element (Cursor) loop
Cur := Range_Sets.Element (Cursor);
if Cur.Length = 0 then
return False;
end if;
pragma Assert (Prev.First <= Cur.First);
if Is_In (Last (Prev), Cur) then
return False;
end if;
Prev := Cur;
Range_Sets.Next (Cursor);
end loop;
return True;
end Is_Valid;
function Total_Span (Set : Range_Set) return String_Range is
Result : String_Range := (1, 0);
Cursor : Range_Sets.Cursor := Set.First;
begin
if not Range_Sets.Has_Element (Cursor) then
return Result;
end if;
Result.First := Range_Sets.Element (Cursor).First;
Cursor := Set.Last;
Set_Last (Result, Last (Range_Sets.Element (Cursor)));
return Result;
end Total_Span;
procedure Include_Range
(Set : in out Range_Set; Bounds : in String_Range)
is
Cursor : Range_Sets.Cursor := Set.Floor (Bounds);
Next : Range_Sets.Cursor;
Actual : String_Range := Bounds;
R : String_Range;
begin
if Range_Sets.Has_Element (Cursor) then
R := Range_Sets.Element (Cursor);
Next := Range_Sets.Next (Cursor);
-- Do nothing if the given range is already covered
if Is_Subrange (Actual, R) then
return;
end if;
-- Merge with previous range if overlapping
if Is_In (Actual.First, R) then
Set_First (Actual, R.First);
Set.Delete (Cursor);
end if;
else
Next := Set.First;
end if;
while Range_Sets.Has_Element (Next) loop
Cursor := Next;
R := Range_Sets.Element (Cursor);
exit when not Is_In (R.First, Actual);
Next := Range_Sets.Next (Cursor);
if Is_Subrange (R, Actual) then
Set.Delete (Cursor);
else
pragma Assert (Last (R) > Last (Actual));
Set_Last (Actual, Last (R));
Set.Delete (Cursor);
end if;
end loop;
Set.Insert (Actual);
pragma Assert (Is_Valid (Set));
end Include_Range;
procedure Exclude_Range
(Set : in out Range_Set; Bounds : in String_Range)
is
Cursor : Range_Sets.Cursor;
R : String_Range;
begin
if Bounds.Length = 0 then
return;
end if;
Cursor := Set.Floor (Bounds);
if Range_Sets.Has_Element (Cursor) then
R := Range_Sets.Element (Cursor);
if R.First < Bounds.First then
if Is_In (Bounds.First, R) then
if Is_In (Last (Bounds) + 1, R) then
Set.Insert (To_Range (Last (Bounds) + 1, Last (R)));
end if;
Set_Last (R, Bounds.First - 1);
pragma Assert (R.Length > 0);
Set.Replace_Element (Cursor, R);
end if;
Range_Sets.Next (Cursor);
end if;
else
Cursor := Set.First;
end if;
while Range_Sets.Has_Element (Cursor)
and then Is_Subrange (Range_Sets.Element (Cursor), Bounds)
loop
declare
Next : constant Range_Sets.Cursor := Range_Sets.Next (Cursor);
begin
Set.Delete (Cursor);
Cursor := Next;
end;
end loop;
if Range_Sets.Has_Element (Cursor)
and then Is_In (Last (Bounds) + 1, Range_Sets.Element (Cursor))
then
R := Range_Sets.Element (Cursor);
Set_First (R, Last (Bounds) + 1);
Set.Replace_Element (Cursor, R);
end if;
pragma Assert (Is_Valid (Set));
end Exclude_Range;
-------------------------------
-- Public helper subprograms --
-------------------------------
function "<" (Left, Right : String_Range) return Boolean is
begin
return Left.First < Right.First;
end "<";
----------------------------
-- Conversion subprograms --
----------------------------
function To_Slice (S : Slice_Set) return Slice is
use type Ada.Containers.Count_Type;
begin
if S.Ref.Is_Empty then
return Null_Slice;
end if;
if S.Bounds.Is_Empty then
return Slice'(Bounds => (1, 0),
Ref => S.Ref);
elsif S.Bounds.Length = 1 then
return Slice'(Bounds => S.Bounds.First_Element,
Ref => S.Ref);
end if;
return To_Slice (To_String (S));
end To_Slice;
function To_Slice_Set (S : String) return Slice_Set is
function Factory return String;
function Factory return String is
begin
return S;
end Factory;
Result : Slice_Set;
begin
Result.Ref := String_Refs.Create (Factory'Access);
if S'Length > 0 then
Result.Bounds.Insert ((S'First, S'Length));
end if;
return Result;
end To_Slice_Set;
function To_Slice_Set (S : Slice) return Slice_Set is
Result : Slice_Set;
begin
Result.Ref := S.Ref;
if S.Bounds.Length > 0 then
Result.Bounds.Insert (S.Bounds);
end if;
return Result;
end To_Slice_Set;
function To_String (Set : Slice_Set) return String is
Cursor : Range_Sets.Cursor := Set.Bounds.First;
R : String_Range;
I : Positive := 1;
begin
return Result : String (1 .. Set.Total_Length) do
while Range_Sets.Has_Element (Cursor) loop
R := Range_Sets.Element (Cursor);
Result (I .. I + R.Length - 1)
:= Set.Ref.Query.Data.all (R.First .. Last (R));
I := I + R.Length;
Range_Sets.Next (Cursor);
end loop;
pragma Assert (I = Result'Last + 1);
end return;
end To_String;
function To_String (Set : Slice_Set; Subrange : String_Range)
return String is
begin
return Set.Subset (Subrange).To_String;
end To_String;
function To_String (Set : Slice_Set; First : Positive; Last : Natural)
return String is
begin
return Set.Subset (To_Range (First, Last)).To_String;
end To_String;
---------------------------------
-- Basic slice-set subprograms --
---------------------------------
procedure Clear (Set : in out Slice_Set) is
begin
Set.Bounds.Clear;
end Clear;
function Element (Set : Slice_Set; Index : Positive) return Character is
begin
if not Is_In (Set, Index) then
raise Constraint_Error;
end if;
return Set.Ref.Query.Data.all (Index);
end Element;
function First (Set : Slice_Set) return Positive is
Cursor : constant Range_Sets.Cursor := Set.Bounds.First;
begin
if Range_Sets.Has_Element (Cursor) then
return Range_Sets.Element (Cursor).First;
else
return 1;
end if;
end First;
function Is_Empty (Set : Slice_Set) return Boolean is
begin
return Set.Bounds.Is_Empty;
end Is_Empty;
function Is_In (Set : Slice_Set; Index : Natural) return Boolean is
Cursor : Range_Sets.Cursor;
begin
if Index = 0 or else Set.Ref.Is_Empty or else Set.Bounds.Is_Empty then
return False;
end if;
Cursor := Set.Bounds.Floor ((Index, 0));
return Range_Sets.Has_Element (Cursor)
and then Is_In (Index, Range_Sets.Element (Cursor));
end Is_In;
function Is_Null (Set : Slice_Set) return Boolean is
begin
return Set.Ref.Is_Empty;
end Is_Null;
function Is_Valid (Set : Slice_Set) return Boolean is
begin
if Set.Ref.Is_Empty then
return Set.Bounds.Is_Empty;
else
return Is_Subrange (Total_Span (Set.Bounds),
Get_Range (Set.Ref.Query.Data.all))
and then Is_Valid (Set.Bounds);
end if;
end Is_Valid;
function Last (Set : Slice_Set) return Natural is
Cursor : constant Range_Sets.Cursor := Set.Bounds.Last;
begin
if Range_Sets.Has_Element (Cursor) then
return Last (Range_Sets.Element (Cursor));
else
return 0;
end if;
end Last;
-- Multistep version:
-- function Next (Set : Slice_Set; Index : Natural; Steps : Positive := 1)
-- return Natural
-- is
-- Cursor : Range_Sets.Cursor;
-- Target : Positive := Index + Steps;
-- Skipped : Natural;
-- R : String_Range;
-- begin
-- if Index = 0 or else Set.Ref.Is_Empty or else Set.Bounds.Is_Empty then
-- raise Constraint_Error;
-- end if;
--
-- Cursor := Set.Bounds.Floor ((Index, 0));
--
-- if not Range_Sets.Has_Element (Cursor) then
-- raise Constraint_Error with "Next with index out of bounds";
-- end if;
--
-- R := Range_Sets.Element (Cursor);
-- loop
-- if Is_In (Target, R) then
-- return Target;
-- end if;
--
-- Skipped := Last (R) + 1;
-- Range_Sets.Next (Cursor);
-- exit when not Range_Sets.Has_Element (Cursor);
-- R := Range_Sets.Element (Cursor);
-- Skipped := R.First - Skipped;
-- Target := Target + Skipped;
-- end loop;
--
-- return 0;
-- end Next;
function Next (Set : Slice_Set; Index : Natural) return Natural is
Cursor : Range_Sets.Cursor;
begin
if Index = 0 or else Set.Ref.Is_Empty or else Set.Bounds.Is_Empty then
raise Constraint_Error;
end if;
Cursor := Set.Bounds.Floor ((Index, 0));
if not Range_Sets.Has_Element (Cursor) then
raise Constraint_Error with "Next with index out of bounds";
end if;
if Is_In (Index + 1, Range_Sets.Element (Cursor)) then
return Index + 1;
else
Range_Sets.Next (Cursor);
if Range_Sets.Has_Element (Cursor) then
return Range_Sets.Element (Cursor).First;
else
return 0;
end if;
end if;
end Next;
procedure Next (Set : in Slice_Set; Index : in out Natural) is
begin
Index := Next (Set, Index);
end Next;
-- Multistep version:
-- function Previous (Set : Slice_Set; Index : Natural; Steps : Positive := 1)
-- return Natural
-- is
-- Cursor : Range_Sets.Cursor;
-- Target : Positive;
-- Prev_First : Positive;
-- Skipped : Natural;
-- R : String_Range;
-- begin
-- if Index = 0 or else Set.Ref.Is_Empty or else Set.Bounds.Is_Empty then
-- raise Constraint_Error;
-- end if;
--
-- if Steps >= Index then
-- return 0;
-- end if;
-- Target := Index - Steps;
--
-- Cursor := Set.Bounds.Floor ((Index, 0));
-- if not Range_Sets.Has_Element (Cursor) then
-- raise Constraint_Error with "Previous with index out of bounds";
-- end if;
--
-- loop
-- R := Range_Sets.Element (Cursor);
-- if Is_In (Target, R) then
-- return Target;
-- end if;
--
-- Prev_First := R.First;
-- Range_Sets.Previous (Cursor);
-- exit when not Range_Sets.Has_Element (Cursor);
-- R := Range_Sets.Element (Cursor);
--
-- Skipped := Prev_First - (Last (R) + 1);
-- exit when Skipped >= Target;
-- Target := Target - Skipped;
-- end loop;
--
-- return 0;
-- end Previous;
function Previous (Set : Slice_Set; Index : Natural) return Natural is
Cursor : Range_Sets.Cursor;
begin
if Index = 0 or else Set.Ref.Is_Empty or else Set.Bounds.Is_Empty then
raise Constraint_Error;
end if;
Cursor := Set.Bounds.Floor ((Index, 0));
if not Range_Sets.Has_Element (Cursor) then
raise Constraint_Error with "Previous with index out of bounds";
end if;
if Is_In (Index - 1, Range_Sets.Element (Cursor)) then
return Index - 1;
else
Range_Sets.Previous (Cursor);
if Range_Sets.Has_Element (Cursor) then
return Last (Range_Sets.Element (Cursor));
else
return 0;
end if;
end if;
end Previous;
procedure Previous (Set : in Slice_Set; Index : in out Natural) is
begin
Index := Previous (Set, Index);
end Previous;
function Total_Length (Set : Slice_Set) return Natural is
Cursor : Range_Sets.Cursor := Set.Bounds.First;
Result : Natural := 0;
begin
while Range_Sets.Has_Element (Cursor) loop
Result := Result + Range_Sets.Element (Cursor).Length;
Range_Sets.Next (Cursor);
end loop;
return Result;
end Total_Length;
----------------------------
-- Operation on slice set --
----------------------------
procedure Add_Slice (Set : in out Slice_Set; Bounds : in String_Range) is
begin
if Bounds.Length = 0 then
return;
end if;
if Set.Ref.Is_Empty then
raise Constraint_Error with "Cannot add range to null slice set";
end if;
if not Is_Subrange (Bounds, Get_Range (Set.Ref.Query.Data.all)) then
raise Constraint_Error with "Add slice outside of parent";
end if;
if Is_Overlapping (Bounds, Set.Bounds) then
raise Constraint_Error with "Add an overlapping slice to a set";
end if;
Set.Bounds.Insert (Bounds);
end Add_Slice;
procedure Add_Slice (Set : in out Slice_Set; S : in Slice) is
use type String_Refs.Immutable_Reference;
begin
if S.Bounds.Length = 0 then
return;
end if;
if Set.Ref.Is_Empty then
pragma Assert (Set.Bounds.Is_Empty);
Set.Ref := S.Ref;
Set.Bounds.Insert (S.Bounds);
return;
end if;
if Set.Ref /= S.Ref then
raise Constraint_Error with
"Addition of an unrelated slice to a slice set";
end if;
if Is_Overlapping (S.Bounds, Set.Bounds) then
raise Constraint_Error with
"Addition of an overlapping slice to a slice set";
end if;
Set.Bounds.Insert (S.Bounds);
end Add_Slice;
procedure Add_Slice
(Set : in out Slice_Set;
First : in Positive;
Last : in Natural) is
begin
Add_Slice (Set, To_Range (First, Last));
end Add_Slice;
procedure Include_Slice
(Set : in out Slice_Set; Bounds : in String_Range) is
begin
if Bounds.Length = 0 then
return;
end if;
if Set.Ref.Is_Empty then
raise Constraint_Error with "Cannot include range to null slice set";
end if;
if not Is_Subrange (Bounds, Get_Range (Set.Ref.Query.Data.all)) then
raise Constraint_Error with "Include slice outside of parent";
end if;
Include_Range (Set.Bounds, Bounds);
end Include_Slice;
procedure Include_Slice (Set : in out Slice_Set; S : in Slice) is
use type String_Refs.Immutable_Reference;
begin
if S.Bounds.Length = 0 then
return;
end if;
if Set.Ref.Is_Empty then
pragma Assert (Set.Bounds.Is_Empty);
Set.Ref := S.Ref;
Set.Bounds.Insert (S.Bounds);
return;
end if;
if Set.Ref /= S.Ref then
raise Constraint_Error with
"Addition of an unrelated slice to a slice set";
end if;
Include_Range (Set.Bounds, S.Bounds);
end Include_Slice;
procedure Include_Slice
(Set : in out Slice_Set;
First : in Positive;
Last : in Natural) is
begin
Include_Slice (Set, To_Range (First, Last));
end Include_Slice;
procedure Exclude_Slice
(Set : in out Slice_Set; Bounds : in String_Range) is
begin
if Bounds.Length = 0 then
return;
end if;
if Set.Ref.Is_Empty then
raise Constraint_Error with
"Cannot exclude range from null slice set";
end if;
Exclude_Range (Set.Bounds, Bounds);
end Exclude_Slice;
procedure Exclude_Slice
(Set : in out Slice_Set;
First : in Positive;
Last : in Natural) is
begin
Exclude_Slice (Set, To_Range (First, Last));
end Exclude_Slice;
procedure Restrict (Set : in out Slice_Set; Bounds : in String_Range) is
begin
if Set.Ref.Is_Empty then
raise Constraint_Error with "Cannot restrict null slice set";
end if;
if Bounds.Length = 0 then
Set.Bounds.Clear;
else
declare
Set_First : constant Positive := Set.First;
Set_Last : constant Natural := Set.Last;
begin
if Set_First < Bounds.First then
Exclude_Range
(Set.Bounds,
To_Range (Set_First, Bounds.First - 1));
end if;
if Set_Last > Last (Bounds) then
Exclude_Range
(Set.Bounds,
To_Range (Last (Bounds) + 1, Set_Last));
end if;
end;
end if;
end Restrict;
procedure Restrict
(Set : in out Slice_Set;
First : in Positive;
Last : in Natural) is
begin
Restrict (Set, To_Range (First, Last));
end Restrict;
function Subset (Set : Slice_Set; Bounds : String_Range) return Slice_Set is
Result : Slice_Set;
Cursor : Range_Sets.Cursor;
R : String_Range;
begin
if Set.Ref.Is_Empty then
raise Constraint_Error with "Subset of null slice set";
end if;
Result.Ref := Set.Ref;
if Bounds.Length = 0 or else Set.Bounds.Is_Empty then
return Result;
end if;
Cursor := Set.Bounds.Floor (Bounds);
if Range_Sets.Has_Element (Cursor) then
R := Range_Sets.Element (Cursor);
if R.First < Bounds.First then
if Is_In (Bounds.First, R) then
Set_First (R, Bounds.First);
if Is_In (Last (Bounds), R) then
Set_Last (R, Last (Bounds));
end if;
Result.Bounds.Insert (R);
end if;
Range_Sets.Next (Cursor);
end if;
else
Cursor := Set.Bounds.First;
end if;
while Range_Sets.Has_Element (Cursor) loop
R := Range_Sets.Element (Cursor);
if Is_Subrange (R, Bounds) then
Result.Bounds.Insert (R);
else
if Is_In (Last (Bounds), R) then
Set_Last (R, Last (Bounds));
Result.Bounds.Insert (R);
end if;
exit;
end if;
Range_Sets.Next (Cursor);
end loop;
return Result;
end Subset;
function Subset (Set : Slice_Set; First : Positive; Last : Natural)
return Slice_Set is
begin
return Subset (Set, To_Range (First, Last));
end Subset;
procedure Cut_Before (Set : in out Slice_Set; Index : in Positive) is
Cursor : Range_Sets.Cursor;
Lower, Upper : String_Range;
begin
if Set.Ref.Is_Empty or else Set.Bounds.Is_Empty then
raise Constraint_Error;
end if;
Cursor := Set.Bounds.Floor ((Index, 0));
if not Range_Sets.Has_Element (Cursor) then
raise Constraint_Error;
end if;
Lower := Range_Sets.Element (Cursor);
if not Is_In (Index, Lower) then
raise Constraint_Error;
end if;
if Lower.First = Index then
return; -- nothing to do
end if;
Upper := Lower;
Set_Last (Lower, Index - 1);
Set_First (Upper, Index);
Set.Bounds.Delete (Cursor);
Set.Bounds.Insert (Lower);
Set.Bounds.Insert (Upper);
end Cut_Before;
---------------
-- Iterators --
---------------
procedure Trim_Slices
(Set : in out Slice_Set;
Trim : not null access function (Slice : String) return String_Range)
is
Cursor : Range_Sets.Cursor := Set.Bounds.First;
Old_Range, New_Range : String_Range;
begin
while Range_Sets.Has_Element (Cursor) loop
Old_Range := Range_Sets.Element (Cursor);
New_Range := Trim.all
(Set.Ref.Query.Data.all (Old_Range.First .. Last (Old_Range)));
if New_Range.Length = 0 then
declare
Next : constant Range_Sets.Cursor := Range_Sets.Next (Cursor);
begin
Set.Bounds.Delete (Cursor);
Cursor := Next;
end;
else
if not Is_Subrange (New_Range, Old_Range) then
raise Constraint_Error with "Trim not returning a subrange";
end if;
Set.Bounds.Replace_Element (Cursor, New_Range);
Range_Sets.Next (Cursor);
end if;
end loop;
end Trim_Slices;
procedure Query_Slices
(Set : in Slice_Set;
Process : not null access procedure (S : in Slice))
is
Cursor : Range_Sets.Cursor := Set.Bounds.First;
begin
while Range_Sets.Has_Element (Cursor) loop
Process.all (Slice'(Range_Sets.Element (Cursor), Set.Ref));
Range_Sets.Next (Cursor);
end loop;
end Query_Slices;
----------------------
-- Search functions --
----------------------
function Find_Slice
(Set : Slice_Set;
From : Positive;
Test : not null access function (Slice : String) return Boolean;
Going : Ada.Strings.Direction := Ada.Strings.Forward)
return String_Range
is
Cursor : Range_Sets.Cursor;
Update : access procedure (C : in out Range_Sets.Cursor);
R : String_Range;
begin
if Set.Ref.Is_Empty then
raise Constraint_Error with "Find_Slice on null slice set";
end if;
case Going is
when Ada.Strings.Forward => Update := Range_Sets.Next'Access;
when Ada.Strings.Backward => Update := Range_Sets.Previous'Access;
end case;
Cursor := Set.Bounds.Floor ((From, 0));
while Range_Sets.Has_Element (Cursor) loop
R := Range_Sets.Element (Cursor);
if Test.all (Set.Ref.Query.Data.all (R.First .. Last (R))) then
return R;
end if;
Update.all (Cursor);
end loop;
return (1, 0);
end Find_Slice;
function Find_Slice
(Set : Slice_Set;
Test : not null access function (Slice : String) return Boolean;
Going : Ada.Strings.Direction := Ada.Strings.Forward)
return String_Range is
begin
case Going is
when Ada.Strings.Forward =>
return Find_Slice (Set, Set.First, Test, Going);
when Ada.Strings.Backward =>
return Find_Slice (Set, Set.Last, Test, Going);
end case;
end Find_Slice;
function Index
(Source : Slice_Set;
Set : Ada.Strings.Maps.Character_Set;
From : Positive;
Test : Ada.Strings.Membership := Ada.Strings.Inside;
Going : Ada.Strings.Direction := Ada.Strings.Forward)
return Natural
is
Cursor : Range_Sets.Cursor;
Update : access procedure (C : in out Range_Sets.Cursor);
R : String_Range;
Result : Natural := 0;
begin
case Going is
when Ada.Strings.Forward => Update := Range_Sets.Next'Access;
when Ada.Strings.Backward => Update := Range_Sets.Previous'Access;
end case;
Cursor := Source.Bounds.Floor ((From, 0));
if not Range_Sets.Has_Element (Cursor) then
raise Ada.Strings.Index_Error;
end if;
R := Range_Sets.Element (Cursor);
if Is_In (From, R) then
Result := Fixed.Index
(Source.Ref.Query.Data.all (R.First .. Last (R)),
Set,
From,
Test,
Going);
end if;
while Result = 0 loop
Update.all (Cursor);
if not Range_Sets.Has_Element (Cursor) then
return 0;
end if;
R := Range_Sets.Element (Cursor);
Result := Fixed.Index
(Source.Ref.Query.Data.all (R.First .. Last (R)),
Set,
Test,
Going);
end loop;
return Result;
end Index;
function Index
(Source : Slice_Set;
Set : Ada.Strings.Maps.Character_Set;
Test : Ada.Strings.Membership := Ada.Strings.Inside;
Going : Ada.Strings.Direction := Ada.Strings.Forward)
return Natural is
begin
case Going is
when Ada.Strings.Forward =>
return Index (Source, Set, Source.First, Test, Going);
when Ada.Strings.Backward =>
return Index (Source, Set, Source.Last, Test, Going);
end case;
end Index;
end Natools.String_Slices.Slice_Sets;
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="15">
<syndb class_id="0" tracking_level="0" version="0">
<userIPLatency>-1</userIPLatency>
<userIPName></userIPName>
<cdfg class_id="1" tracking_level="1" version="0" object_id="_0">
<name>load</name>
<ret_bitwidth>0</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="3" tracking_level="1" version="0" object_id="_1">
<Value class_id="4" tracking_level="0" version="0">
<Obj class_id="5" tracking_level="0" version="0">
<type>1</type>
<id>1</id>
<name>to_V_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>to.V.V</originalName>
<rtlName></rtlName>
<coreName>FIFO_SRL</coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<direction>1</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>from_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>from.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<direction>0</direction>
<if_type>4</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>from_V_offset</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</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>3</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>coalesced_data_num</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</coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<direction>0</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>17</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_5">
<Value>
<Obj>
<type>0</type>
<id>10</id>
<name>from_V_offset_read</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>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>40</item>
<item>41</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>1.21</m_delay>
</item>
<item class_id_reference="9" object_id="_6">
<Value>
<Obj>
<type>0</type>
<id>11</id>
<name>from_V_offset1_i</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>26</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>43</item>
<item>44</item>
<item>46</item>
<item>48</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_7">
<Value>
<Obj>
<type>0</type>
<id>12</id>
<name>tmp_i</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>49</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_8">
<Value>
<Obj>
<type>0</type>
<id>13</id>
<name>from_V_addr</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>512</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>50</item>
<item>51</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_9">
<Value>
<Obj>
<type>0</type>
<id>17</id>
<name>coalesced_data_num_read</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>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>53</item>
<item>54</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>1.21</m_delay>
</item>
<item class_id_reference="9" object_id="_10">
<Value>
<Obj>
<type>0</type>
<id>18</id>
<name>tmp</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>9718</lineNumber>
<contextFuncName>jacobi2d_kernel</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="11" tracking_level="0" version="0">
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</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>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9718</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>data_num</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>55</item>
</oprand_edges>
<opcode>trunc</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_11">
<Value>
<Obj>
<type>0</type>
<id>20</id>
<name>from_V_addr_i_rd_req</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>35</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9721</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>35</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>57</item>
<item>58</item>
<item>59</item>
</oprand_edges>
<opcode>readreq</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>2.43</m_delay>
</item>
<item class_id_reference="9" object_id="_12">
<Value>
<Obj>
<type>0</type>
<id>21</id>
<name></name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9721</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>32</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>60</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.60</m_delay>
</item>
<item class_id_reference="9" object_id="_13">
<Value>
<Obj>
<type>0</type>
<id>23</id>
<name>i_i_i_i</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>i</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>31</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>62</item>
<item>63</item>
<item>64</item>
<item>65</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_14">
<Value>
<Obj>
<type>0</type>
<id>24</id>
<name>i_cast_i_i_i</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9721</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>32</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>66</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_15">
<Value>
<Obj>
<type>0</type>
<id>25</id>
<name>tmp_i_i_i</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9721</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>32</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>67</item>
<item>68</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.85</m_delay>
</item>
<item class_id_reference="9" object_id="_16">
<Value>
<Obj>
<type>0</type>
<id>26</id>
<name>i</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9721</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>32</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>i</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>31</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>69</item>
<item>71</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.87</m_delay>
</item>
<item class_id_reference="9" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>27</id>
<name></name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9721</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>32</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>72</item>
<item>73</item>
<item>74</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>32</id>
<name>tmp_V</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>35</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9721</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>35</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>tmp.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>76</item>
<item>77</item>
<item>288</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>2.43</m_delay>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>33</id>
<name>empty</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>35</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9721</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>35</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>79</item>
<item>80</item>
<item>81</item>
</oprand_edges>
<opcode>nbwrite</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>1.21</m_delay>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>35</id>
<name></name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>load</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9721</second>
</item>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>load</second>
</first>
<second>32</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>82</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>37</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>0</count>
<item_version>0</item_version>
</oprand_edges>
<opcode>ret</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_22">
<Value>
<Obj>
<type>2</type>
<id>45</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>6</content>
</item>
<item class_id_reference="16" object_id="_23">
<Value>
<Obj>
<type>2</type>
<id>47</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>31</content>
</item>
<item class_id_reference="16" object_id="_24">
<Value>
<Obj>
<type>2</type>
<id>61</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>31</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_25">
<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>31</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="_26">
<Obj>
<type>3</type>
<id>22</id>
<name>entry</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>8</count>
<item_version>0</item_version>
<item>10</item>
<item>11</item>
<item>12</item>
<item>13</item>
<item>17</item>
<item>18</item>
<item>20</item>
<item>21</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_27">
<Obj>
<type>3</type>
<id>28</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>23</item>
<item>24</item>
<item>25</item>
<item>26</item>
<item>27</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_28">
<Obj>
<type>3</type>
<id>36</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>3</count>
<item_version>0</item_version>
<item>32</item>
<item>33</item>
<item>35</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_29">
<Obj>
<type>3</type>
<id>38</id>
<name>.exit</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>33</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_30">
<id>41</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>10</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_31">
<id>44</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>11</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_32">
<id>46</id>
<edge_type>1</edge_type>
<source_obj>45</source_obj>
<sink_obj>11</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_33">
<id>48</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>11</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_34">
<id>49</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>12</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_35">
<id>50</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>13</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_36">
<id>51</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>13</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_37">
<id>54</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>17</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_38">
<id>55</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_39">
<id>58</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>20</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_40">
<id>59</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>20</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_41">
<id>60</id>
<edge_type>2</edge_type>
<source_obj>28</source_obj>
<sink_obj>21</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_42">
<id>62</id>
<edge_type>1</edge_type>
<source_obj>61</source_obj>
<sink_obj>23</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_43">
<id>63</id>
<edge_type>2</edge_type>
<source_obj>22</source_obj>
<sink_obj>23</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_44">
<id>64</id>
<edge_type>1</edge_type>
<source_obj>26</source_obj>
<sink_obj>23</sink_obj>
<is_back_edge>1</is_back_edge>
</item>
<item class_id_reference="20" object_id="_45">
<id>65</id>
<edge_type>2</edge_type>
<source_obj>36</source_obj>
<sink_obj>23</sink_obj>
<is_back_edge>1</is_back_edge>
</item>
<item class_id_reference="20" object_id="_46">
<id>66</id>
<edge_type>1</edge_type>
<source_obj>23</source_obj>
<sink_obj>24</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_47">
<id>67</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_48">
<id>68</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_49">
<id>69</id>
<edge_type>1</edge_type>
<source_obj>23</source_obj>
<sink_obj>26</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_50">
<id>71</id>
<edge_type>1</edge_type>
<source_obj>70</source_obj>
<sink_obj>26</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_51">
<id>72</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>27</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_52">
<id>73</id>
<edge_type>2</edge_type>
<source_obj>38</source_obj>
<sink_obj>27</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_53">
<id>74</id>
<edge_type>2</edge_type>
<source_obj>36</source_obj>
<sink_obj>27</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_54">
<id>77</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>32</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_55">
<id>80</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>33</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_56">
<id>81</id>
<edge_type>1</edge_type>
<source_obj>32</source_obj>
<sink_obj>33</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_57">
<id>82</id>
<edge_type>2</edge_type>
<source_obj>28</source_obj>
<sink_obj>35</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_58">
<id>284</id>
<edge_type>2</edge_type>
<source_obj>22</source_obj>
<sink_obj>28</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_59">
<id>285</id>
<edge_type>2</edge_type>
<source_obj>28</source_obj>
<sink_obj>36</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_60">
<id>286</id>
<edge_type>2</edge_type>
<source_obj>28</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_61">
<id>287</id>
<edge_type>2</edge_type>
<source_obj>36</source_obj>
<sink_obj>28</sink_obj>
<is_back_edge>1</is_back_edge>
</item>
<item class_id_reference="20" object_id="_62">
<id>288</id>
<edge_type>4</edge_type>
<source_obj>20</source_obj>
<sink_obj>32</sink_obj>
<is_back_edge>0</is_back_edge>
</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="_63">
<mId>1</mId>
<mTag>load</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>-1</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_64">
<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>22</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>126</mMinLatency>
<mMaxLatency>126</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_65">
<mId>3</mId>
<mTag>load_epoch</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>28</item>
<item>36</item>
</basic_blocks>
<mII>1</mII>
<mDepth>3</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>-1</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_66">
<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>38</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>0</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
</cdfg_regions>
<fsm class_id="24" tracking_level="1" version="0" object_id="_67">
<states class_id="25" tracking_level="0" version="0">
<count>131</count>
<item_version>0</item_version>
<item class_id="26" tracking_level="1" version="0" object_id="_68">
<id>1</id>
<operations class_id="27" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="28" tracking_level="1" version="0" object_id="_69">
<id>10</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_70">
<id>11</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_71">
<id>17</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_72">
<id>18</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_73">
<id>2</id>
<operations>
<count>3</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_74">
<id>12</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_75">
<id>13</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_76">
<id>20</id>
<stage>126</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_77">
<id>3</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_78">
<id>20</id>
<stage>125</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_79">
<id>4</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_80">
<id>20</id>
<stage>124</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_81">
<id>5</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_82">
<id>20</id>
<stage>123</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_83">
<id>6</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_84">
<id>20</id>
<stage>122</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_85">
<id>7</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_86">
<id>20</id>
<stage>121</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_87">
<id>8</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_88">
<id>20</id>
<stage>120</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_89">
<id>9</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_90">
<id>20</id>
<stage>119</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_91">
<id>10</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_92">
<id>20</id>
<stage>118</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_93">
<id>11</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_94">
<id>20</id>
<stage>117</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_95">
<id>12</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_96">
<id>20</id>
<stage>116</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_97">
<id>13</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_98">
<id>20</id>
<stage>115</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_99">
<id>14</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_100">
<id>20</id>
<stage>114</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_101">
<id>15</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_102">
<id>20</id>
<stage>113</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_103">
<id>16</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_104">
<id>20</id>
<stage>112</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_105">
<id>17</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_106">
<id>20</id>
<stage>111</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_107">
<id>18</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_108">
<id>20</id>
<stage>110</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_109">
<id>19</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_110">
<id>20</id>
<stage>109</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_111">
<id>20</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_112">
<id>20</id>
<stage>108</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_113">
<id>21</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_114">
<id>20</id>
<stage>107</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_115">
<id>22</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_116">
<id>20</id>
<stage>106</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_117">
<id>23</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_118">
<id>20</id>
<stage>105</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_119">
<id>24</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_120">
<id>20</id>
<stage>104</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_121">
<id>25</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_122">
<id>20</id>
<stage>103</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_123">
<id>26</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_124">
<id>20</id>
<stage>102</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_125">
<id>27</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_126">
<id>20</id>
<stage>101</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_127">
<id>28</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_128">
<id>20</id>
<stage>100</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_129">
<id>29</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_130">
<id>20</id>
<stage>99</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_131">
<id>30</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_132">
<id>20</id>
<stage>98</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_133">
<id>31</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_134">
<id>20</id>
<stage>97</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_135">
<id>32</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_136">
<id>20</id>
<stage>96</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_137">
<id>33</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_138">
<id>20</id>
<stage>95</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_139">
<id>34</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_140">
<id>20</id>
<stage>94</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_141">
<id>35</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_142">
<id>20</id>
<stage>93</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_143">
<id>36</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_144">
<id>20</id>
<stage>92</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_145">
<id>37</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_146">
<id>20</id>
<stage>91</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_147">
<id>38</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_148">
<id>20</id>
<stage>90</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_149">
<id>39</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_150">
<id>20</id>
<stage>89</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_151">
<id>40</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_152">
<id>20</id>
<stage>88</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_153">
<id>41</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_154">
<id>20</id>
<stage>87</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_155">
<id>42</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_156">
<id>20</id>
<stage>86</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_157">
<id>43</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_158">
<id>20</id>
<stage>85</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_159">
<id>44</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_160">
<id>20</id>
<stage>84</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_161">
<id>45</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_162">
<id>20</id>
<stage>83</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_163">
<id>46</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_164">
<id>20</id>
<stage>82</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_165">
<id>47</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_166">
<id>20</id>
<stage>81</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_167">
<id>48</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_168">
<id>20</id>
<stage>80</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_169">
<id>49</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_170">
<id>20</id>
<stage>79</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_171">
<id>50</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_172">
<id>20</id>
<stage>78</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_173">
<id>51</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_174">
<id>20</id>
<stage>77</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_175">
<id>52</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_176">
<id>20</id>
<stage>76</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_177">
<id>53</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_178">
<id>20</id>
<stage>75</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_179">
<id>54</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_180">
<id>20</id>
<stage>74</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_181">
<id>55</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_182">
<id>20</id>
<stage>73</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_183">
<id>56</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_184">
<id>20</id>
<stage>72</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_185">
<id>57</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_186">
<id>20</id>
<stage>71</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_187">
<id>58</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_188">
<id>20</id>
<stage>70</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_189">
<id>59</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_190">
<id>20</id>
<stage>69</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_191">
<id>60</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_192">
<id>20</id>
<stage>68</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_193">
<id>61</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_194">
<id>20</id>
<stage>67</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_195">
<id>62</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_196">
<id>20</id>
<stage>66</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_197">
<id>63</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_198">
<id>20</id>
<stage>65</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_199">
<id>64</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_200">
<id>20</id>
<stage>64</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_201">
<id>65</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_202">
<id>20</id>
<stage>63</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_203">
<id>66</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_204">
<id>20</id>
<stage>62</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_205">
<id>67</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_206">
<id>20</id>
<stage>61</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_207">
<id>68</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_208">
<id>20</id>
<stage>60</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_209">
<id>69</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_210">
<id>20</id>
<stage>59</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_211">
<id>70</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_212">
<id>20</id>
<stage>58</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_213">
<id>71</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_214">
<id>20</id>
<stage>57</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_215">
<id>72</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_216">
<id>20</id>
<stage>56</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_217">
<id>73</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_218">
<id>20</id>
<stage>55</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_219">
<id>74</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_220">
<id>20</id>
<stage>54</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_221">
<id>75</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_222">
<id>20</id>
<stage>53</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_223">
<id>76</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_224">
<id>20</id>
<stage>52</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_225">
<id>77</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_226">
<id>20</id>
<stage>51</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_227">
<id>78</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_228">
<id>20</id>
<stage>50</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_229">
<id>79</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_230">
<id>20</id>
<stage>49</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_231">
<id>80</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_232">
<id>20</id>
<stage>48</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_233">
<id>81</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_234">
<id>20</id>
<stage>47</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_235">
<id>82</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_236">
<id>20</id>
<stage>46</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_237">
<id>83</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_238">
<id>20</id>
<stage>45</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_239">
<id>84</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_240">
<id>20</id>
<stage>44</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_241">
<id>85</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_242">
<id>20</id>
<stage>43</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_243">
<id>86</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_244">
<id>20</id>
<stage>42</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_245">
<id>87</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_246">
<id>20</id>
<stage>41</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_247">
<id>88</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_248">
<id>20</id>
<stage>40</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_249">
<id>89</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_250">
<id>20</id>
<stage>39</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_251">
<id>90</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_252">
<id>20</id>
<stage>38</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_253">
<id>91</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_254">
<id>20</id>
<stage>37</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_255">
<id>92</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_256">
<id>20</id>
<stage>36</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_257">
<id>93</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_258">
<id>20</id>
<stage>35</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_259">
<id>94</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_260">
<id>20</id>
<stage>34</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_261">
<id>95</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_262">
<id>20</id>
<stage>33</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_263">
<id>96</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_264">
<id>20</id>
<stage>32</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_265">
<id>97</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_266">
<id>20</id>
<stage>31</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_267">
<id>98</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_268">
<id>20</id>
<stage>30</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_269">
<id>99</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_270">
<id>20</id>
<stage>29</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_271">
<id>100</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_272">
<id>20</id>
<stage>28</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_273">
<id>101</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_274">
<id>20</id>
<stage>27</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_275">
<id>102</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_276">
<id>20</id>
<stage>26</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_277">
<id>103</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_278">
<id>20</id>
<stage>25</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_279">
<id>104</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_280">
<id>20</id>
<stage>24</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_281">
<id>105</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_282">
<id>20</id>
<stage>23</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_283">
<id>106</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_284">
<id>20</id>
<stage>22</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_285">
<id>107</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_286">
<id>20</id>
<stage>21</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_287">
<id>108</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_288">
<id>20</id>
<stage>20</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_289">
<id>109</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_290">
<id>20</id>
<stage>19</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_291">
<id>110</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_292">
<id>20</id>
<stage>18</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_293">
<id>111</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_294">
<id>20</id>
<stage>17</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_295">
<id>112</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_296">
<id>20</id>
<stage>16</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_297">
<id>113</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_298">
<id>20</id>
<stage>15</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_299">
<id>114</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_300">
<id>20</id>
<stage>14</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_301">
<id>115</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_302">
<id>20</id>
<stage>13</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_303">
<id>116</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_304">
<id>20</id>
<stage>12</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_305">
<id>117</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_306">
<id>20</id>
<stage>11</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_307">
<id>118</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_308">
<id>20</id>
<stage>10</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_309">
<id>119</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_310">
<id>20</id>
<stage>9</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_311">
<id>120</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_312">
<id>20</id>
<stage>8</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_313">
<id>121</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_314">
<id>20</id>
<stage>7</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_315">
<id>122</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_316">
<id>20</id>
<stage>6</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_317">
<id>123</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_318">
<id>20</id>
<stage>5</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_319">
<id>124</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_320">
<id>20</id>
<stage>4</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_321">
<id>125</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_322">
<id>20</id>
<stage>3</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_323">
<id>126</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_324">
<id>20</id>
<stage>2</stage>
<latency>126</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_325">
<id>127</id>
<operations>
<count>11</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_326">
<id>5</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_327">
<id>6</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_328">
<id>7</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_329">
<id>8</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_330">
<id>9</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_331">
<id>14</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_332">
<id>15</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_333">
<id>16</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_334">
<id>19</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_335">
<id>20</id>
<stage>1</stage>
<latency>126</latency>
</item>
<item class_id_reference="28" object_id="_336">
<id>21</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_337">
<id>128</id>
<operations>
<count>5</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_338">
<id>23</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_339">
<id>24</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_340">
<id>25</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_341">
<id>26</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_342">
<id>27</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_343">
<id>129</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_344">
<id>32</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_345">
<id>130</id>
<operations>
<count>6</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_346">
<id>29</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_347">
<id>30</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_348">
<id>31</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_349">
<id>33</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_350">
<id>34</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_351">
<id>35</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_352">
<id>131</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_353">
<id>37</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
</states>
<transitions class_id="29" tracking_level="0" version="0">
<count>131</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="1" version="0" object_id="_354">
<inState>1</inState>
<outState>2</outState>
<condition class_id="31" tracking_level="0" version="0">
<id>137</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="_355">
<inState>2</inState>
<outState>3</outState>
<condition>
<id>138</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="_356">
<inState>3</inState>
<outState>4</outState>
<condition>
<id>139</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="_357">
<inState>4</inState>
<outState>5</outState>
<condition>
<id>140</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="_358">
<inState>5</inState>
<outState>6</outState>
<condition>
<id>141</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="_359">
<inState>6</inState>
<outState>7</outState>
<condition>
<id>142</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="_360">
<inState>7</inState>
<outState>8</outState>
<condition>
<id>143</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="_361">
<inState>8</inState>
<outState>9</outState>
<condition>
<id>144</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="_362">
<inState>9</inState>
<outState>10</outState>
<condition>
<id>145</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="_363">
<inState>10</inState>
<outState>11</outState>
<condition>
<id>146</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="_364">
<inState>11</inState>
<outState>12</outState>
<condition>
<id>147</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="_365">
<inState>12</inState>
<outState>13</outState>
<condition>
<id>148</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="_366">
<inState>13</inState>
<outState>14</outState>
<condition>
<id>149</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="_367">
<inState>14</inState>
<outState>15</outState>
<condition>
<id>150</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="_368">
<inState>15</inState>
<outState>16</outState>
<condition>
<id>151</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="_369">
<inState>16</inState>
<outState>17</outState>
<condition>
<id>152</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="_370">
<inState>17</inState>
<outState>18</outState>
<condition>
<id>153</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="_371">
<inState>18</inState>
<outState>19</outState>
<condition>
<id>154</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="_372">
<inState>19</inState>
<outState>20</outState>
<condition>
<id>155</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="_373">
<inState>20</inState>
<outState>21</outState>
<condition>
<id>156</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="_374">
<inState>21</inState>
<outState>22</outState>
<condition>
<id>157</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="_375">
<inState>22</inState>
<outState>23</outState>
<condition>
<id>158</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="_376">
<inState>23</inState>
<outState>24</outState>
<condition>
<id>159</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="_377">
<inState>24</inState>
<outState>25</outState>
<condition>
<id>160</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="_378">
<inState>25</inState>
<outState>26</outState>
<condition>
<id>161</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="_379">
<inState>26</inState>
<outState>27</outState>
<condition>
<id>162</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="_380">
<inState>27</inState>
<outState>28</outState>
<condition>
<id>163</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="_381">
<inState>28</inState>
<outState>29</outState>
<condition>
<id>164</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="_382">
<inState>29</inState>
<outState>30</outState>
<condition>
<id>165</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="_383">
<inState>30</inState>
<outState>31</outState>
<condition>
<id>166</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="_384">
<inState>31</inState>
<outState>32</outState>
<condition>
<id>167</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="_385">
<inState>32</inState>
<outState>33</outState>
<condition>
<id>168</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="_386">
<inState>33</inState>
<outState>34</outState>
<condition>
<id>169</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="_387">
<inState>34</inState>
<outState>35</outState>
<condition>
<id>170</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="_388">
<inState>35</inState>
<outState>36</outState>
<condition>
<id>171</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="_389">
<inState>36</inState>
<outState>37</outState>
<condition>
<id>172</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="_390">
<inState>37</inState>
<outState>38</outState>
<condition>
<id>173</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="_391">
<inState>38</inState>
<outState>39</outState>
<condition>
<id>174</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="_392">
<inState>39</inState>
<outState>40</outState>
<condition>
<id>175</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="_393">
<inState>40</inState>
<outState>41</outState>
<condition>
<id>176</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="_394">
<inState>41</inState>
<outState>42</outState>
<condition>
<id>177</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="_395">
<inState>42</inState>
<outState>43</outState>
<condition>
<id>178</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="_396">
<inState>43</inState>
<outState>44</outState>
<condition>
<id>179</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="_397">
<inState>44</inState>
<outState>45</outState>
<condition>
<id>180</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="_398">
<inState>45</inState>
<outState>46</outState>
<condition>
<id>181</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="_399">
<inState>46</inState>
<outState>47</outState>
<condition>
<id>182</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="_400">
<inState>47</inState>
<outState>48</outState>
<condition>
<id>183</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="_401">
<inState>48</inState>
<outState>49</outState>
<condition>
<id>184</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="_402">
<inState>49</inState>
<outState>50</outState>
<condition>
<id>185</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="_403">
<inState>50</inState>
<outState>51</outState>
<condition>
<id>186</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="_404">
<inState>51</inState>
<outState>52</outState>
<condition>
<id>187</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="_405">
<inState>52</inState>
<outState>53</outState>
<condition>
<id>188</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="_406">
<inState>53</inState>
<outState>54</outState>
<condition>
<id>189</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="_407">
<inState>54</inState>
<outState>55</outState>
<condition>
<id>190</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="_408">
<inState>55</inState>
<outState>56</outState>
<condition>
<id>191</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="_409">
<inState>56</inState>
<outState>57</outState>
<condition>
<id>192</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="_410">
<inState>57</inState>
<outState>58</outState>
<condition>
<id>193</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="_411">
<inState>58</inState>
<outState>59</outState>
<condition>
<id>194</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="_412">
<inState>59</inState>
<outState>60</outState>
<condition>
<id>195</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="_413">
<inState>60</inState>
<outState>61</outState>
<condition>
<id>196</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="_414">
<inState>61</inState>
<outState>62</outState>
<condition>
<id>197</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="_415">
<inState>62</inState>
<outState>63</outState>
<condition>
<id>198</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="_416">
<inState>63</inState>
<outState>64</outState>
<condition>
<id>199</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="_417">
<inState>64</inState>
<outState>65</outState>
<condition>
<id>200</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="_418">
<inState>65</inState>
<outState>66</outState>
<condition>
<id>201</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="_419">
<inState>66</inState>
<outState>67</outState>
<condition>
<id>202</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="_420">
<inState>67</inState>
<outState>68</outState>
<condition>
<id>203</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="_421">
<inState>68</inState>
<outState>69</outState>
<condition>
<id>204</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="_422">
<inState>69</inState>
<outState>70</outState>
<condition>
<id>205</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="_423">
<inState>70</inState>
<outState>71</outState>
<condition>
<id>206</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="_424">
<inState>71</inState>
<outState>72</outState>
<condition>
<id>207</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="_425">
<inState>72</inState>
<outState>73</outState>
<condition>
<id>208</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="_426">
<inState>73</inState>
<outState>74</outState>
<condition>
<id>209</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="_427">
<inState>74</inState>
<outState>75</outState>
<condition>
<id>210</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="_428">
<inState>75</inState>
<outState>76</outState>
<condition>
<id>211</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="_429">
<inState>76</inState>
<outState>77</outState>
<condition>
<id>212</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="_430">
<inState>77</inState>
<outState>78</outState>
<condition>
<id>213</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="_431">
<inState>78</inState>
<outState>79</outState>
<condition>
<id>214</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="_432">
<inState>79</inState>
<outState>80</outState>
<condition>
<id>215</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="_433">
<inState>80</inState>
<outState>81</outState>
<condition>
<id>216</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="_434">
<inState>81</inState>
<outState>82</outState>
<condition>
<id>217</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="_435">
<inState>82</inState>
<outState>83</outState>
<condition>
<id>218</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="_436">
<inState>83</inState>
<outState>84</outState>
<condition>
<id>219</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="_437">
<inState>84</inState>
<outState>85</outState>
<condition>
<id>220</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="_438">
<inState>85</inState>
<outState>86</outState>
<condition>
<id>221</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="_439">
<inState>86</inState>
<outState>87</outState>
<condition>
<id>222</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="_440">
<inState>87</inState>
<outState>88</outState>
<condition>
<id>223</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="_441">
<inState>88</inState>
<outState>89</outState>
<condition>
<id>224</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="_442">
<inState>89</inState>
<outState>90</outState>
<condition>
<id>225</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="_443">
<inState>90</inState>
<outState>91</outState>
<condition>
<id>226</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="_444">
<inState>91</inState>
<outState>92</outState>
<condition>
<id>227</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="_445">
<inState>92</inState>
<outState>93</outState>
<condition>
<id>228</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="_446">
<inState>93</inState>
<outState>94</outState>
<condition>
<id>229</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="_447">
<inState>94</inState>
<outState>95</outState>
<condition>
<id>230</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="_448">
<inState>95</inState>
<outState>96</outState>
<condition>
<id>231</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="_449">
<inState>96</inState>
<outState>97</outState>
<condition>
<id>232</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="_450">
<inState>97</inState>
<outState>98</outState>
<condition>
<id>233</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="_451">
<inState>98</inState>
<outState>99</outState>
<condition>
<id>234</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="_452">
<inState>99</inState>
<outState>100</outState>
<condition>
<id>235</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="_453">
<inState>100</inState>
<outState>101</outState>
<condition>
<id>236</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="_454">
<inState>101</inState>
<outState>102</outState>
<condition>
<id>237</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="_455">
<inState>102</inState>
<outState>103</outState>
<condition>
<id>238</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="_456">
<inState>103</inState>
<outState>104</outState>
<condition>
<id>239</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="_457">
<inState>104</inState>
<outState>105</outState>
<condition>
<id>240</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="_458">
<inState>105</inState>
<outState>106</outState>
<condition>
<id>241</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="_459">
<inState>106</inState>
<outState>107</outState>
<condition>
<id>242</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="_460">
<inState>107</inState>
<outState>108</outState>
<condition>
<id>243</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="_461">
<inState>108</inState>
<outState>109</outState>
<condition>
<id>244</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="_462">
<inState>109</inState>
<outState>110</outState>
<condition>
<id>245</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="_463">
<inState>110</inState>
<outState>111</outState>
<condition>
<id>246</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="_464">
<inState>111</inState>
<outState>112</outState>
<condition>
<id>247</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="_465">
<inState>112</inState>
<outState>113</outState>
<condition>
<id>248</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="_466">
<inState>113</inState>
<outState>114</outState>
<condition>
<id>249</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="_467">
<inState>114</inState>
<outState>115</outState>
<condition>
<id>250</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="_468">
<inState>115</inState>
<outState>116</outState>
<condition>
<id>251</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="_469">
<inState>116</inState>
<outState>117</outState>
<condition>
<id>252</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="_470">
<inState>117</inState>
<outState>118</outState>
<condition>
<id>253</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="_471">
<inState>118</inState>
<outState>119</outState>
<condition>
<id>254</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="_472">
<inState>119</inState>
<outState>120</outState>
<condition>
<id>255</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="_473">
<inState>120</inState>
<outState>121</outState>
<condition>
<id>256</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="_474">
<inState>121</inState>
<outState>122</outState>
<condition>
<id>257</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="_475">
<inState>122</inState>
<outState>123</outState>
<condition>
<id>258</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="_476">
<inState>123</inState>
<outState>124</outState>
<condition>
<id>259</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="_477">
<inState>124</inState>
<outState>125</outState>
<condition>
<id>260</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="_478">
<inState>125</inState>
<outState>126</outState>
<condition>
<id>261</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="_479">
<inState>126</inState>
<outState>127</outState>
<condition>
<id>262</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="_480">
<inState>127</inState>
<outState>128</outState>
<condition>
<id>264</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="_481">
<inState>129</inState>
<outState>130</outState>
<condition>
<id>272</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="_482">
<inState>130</inState>
<outState>128</outState>
<condition>
<id>273</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="_483">
<inState>128</inState>
<outState>131</outState>
<condition>
<id>271</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>25</first>
<second>0</second>
</first>
<second>1</second>
</item>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_484">
<inState>128</inState>
<outState>129</outState>
<condition>
<id>274</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>25</first>
<second>0</second>
</first>
<second>0</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>17</count>
<item_version>0</item_version>
<item class_id="38" tracking_level="0" version="0">
<first>10</first>
<second class_id="39" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>11</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>12</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>13</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>17</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>18</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>20</first>
<second>
<first>1</first>
<second>125</second>
</second>
</item>
<item>
<first>21</first>
<second>
<first>126</first>
<second>0</second>
</second>
</item>
<item>
<first>23</first>
<second>
<first>127</first>
<second>0</second>
</second>
</item>
<item>
<first>24</first>
<second>
<first>127</first>
<second>0</second>
</second>
</item>
<item>
<first>25</first>
<second>
<first>127</first>
<second>0</second>
</second>
</item>
<item>
<first>26</first>
<second>
<first>127</first>
<second>0</second>
</second>
</item>
<item>
<first>27</first>
<second>
<first>127</first>
<second>0</second>
</second>
</item>
<item>
<first>32</first>
<second>
<first>128</first>
<second>0</second>
</second>
</item>
<item>
<first>33</first>
<second>
<first>129</first>
<second>0</second>
</second>
</item>
<item>
<first>35</first>
<second>
<first>129</first>
<second>0</second>
</second>
</item>
<item>
<first>37</first>
<second>
<first>130</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="40" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="41" tracking_level="0" version="0">
<first>22</first>
<second class_id="42" tracking_level="0" version="0">
<first>0</first>
<second>126</second>
</second>
</item>
<item>
<first>28</first>
<second>
<first>127</first>
<second>127</second>
</second>
</item>
<item>
<first>36</first>
<second>
<first>128</first>
<second>129</second>
</second>
</item>
<item>
<first>38</first>
<second>
<first>128</first>
<second>128</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="_485">
<region_name>load_epoch</region_name>
<basic_blocks>
<count>2</count>
<item_version>0</item_version>
<item>28</item>
<item>36</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>13</count>
<item_version>0</item_version>
<item class_id="46" tracking_level="0" version="0">
<first>98</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>10</item>
</second>
</item>
<item>
<first>104</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>17</item>
</second>
</item>
<item>
<first>110</first>
<second>
<count>126</count>
<item_version>0</item_version>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
</second>
</item>
<item>
<first>116</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>121</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>33</item>
</second>
</item>
<item>
<first>132</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
<item>
<first>139</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>149</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>153</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>156</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
<item>
<first>163</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>167</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>172</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="48" tracking_level="0" version="0">
<count>8</count>
<item_version>0</item_version>
<item class_id="49" tracking_level="0" version="0">
<first>from_V_addr_fu_156</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
<item>
<first>from_V_offset1_i_fu_139</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>i_cast_i_i_i_fu_163</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>i_fu_172</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>i_i_i_i_phi_fu_132</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
<item>
<first>tmp_fu_149</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>tmp_i_fu_153</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>tmp_i_i_i_fu_167</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</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>5</count>
<item_version>0</item_version>
<item>
<first>coalesced_data_num_read_read_fu_104</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>17</item>
</second>
</item>
<item>
<first>empty_nbwrite_fu_121</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>33</item>
</second>
</item>
<item>
<first>from_V_offset_read_read_fu_98</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>10</item>
</second>
</item>
<item>
<first>grp_readreq_fu_110</first>
<second>
<count>126</count>
<item_version>0</item_version>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
<item>20</item>
</second>
</item>
<item>
<first>tmp_V_read_fu_116</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
</dp_fu_nodes_io>
<return_ports>
<count>0</count>
<item_version>0</item_version>
</return_ports>
<dp_mem_port_nodes class_id="50" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>7</count>
<item_version>0</item_version>
<item>
<first>128</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
<item>
<first>178</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>183</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>189</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
<item>
<first>195</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>199</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>204</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
</dp_reg_nodes>
<dp_regname_nodes>
<count>7</count>
<item_version>0</item_version>
<item>
<first>from_V_addr_reg_189</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
<item>
<first>from_V_offset1_i_reg_178</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>i_i_i_i_reg_128</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
<item>
<first>i_reg_199</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>tmp_V_reg_204</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>tmp_i_i_i_reg_195</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>tmp_reg_183</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
</dp_regname_nodes>
<dp_reg_phi>
<count>1</count>
<item_version>0</item_version>
<item>
<first>128</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
</dp_reg_phi>
<dp_regname_phi>
<count>1</count>
<item_version>0</item_version>
<item>
<first>i_i_i_i_reg_128</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
</dp_regname_phi>
<dp_port_io_nodes class_id="51" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="52" tracking_level="0" version="0">
<first>coalesced_data_num</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>17</item>
</second>
</item>
</second>
</item>
<item>
<first>from_V</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>from_V_offset</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>10</item>
</second>
</item>
</second>
</item>
<item>
<first>to_V_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>nbwrite</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>33</item>
</second>
</item>
</second>
</item>
</dp_port_io_nodes>
<port2core class_id="53" tracking_level="0" version="0">
<count>3</count>
<item_version>0</item_version>
<item class_id="54" tracking_level="0" version="0">
<first>1</first>
<second>FIFO_SRL</second>
</item>
<item>
<first>3</first>
<second>FIFO</second>
</item>
<item>
<first>4</first>
<second>FIFO</second>
</item>
</port2core>
<node2core>
<count>0</count>
<item_version>0</item_version>
</node2core>
</syndb>
</boost_serialization>
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . D I M . G E N E R I C _ M K S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2011-2019, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Defines the MKS dimension system which is the SI system of units
-- Some other prefixes of this system are defined in a child package (see
-- System.Dim.Generic_Mks.Generic_Other_Prefixes) in order to avoid too many
-- constant declarations in this package.
-- The dimension terminology is defined in System.Dim package
with Ada.Numerics;
generic
type Float_Type is digits <>;
package System.Dim.Generic_Mks is
e : constant := Ada.Numerics.e;
Pi : constant := Ada.Numerics.Pi;
-- Dimensioned type Mks_Type
type Mks_Type is new Float_Type
with
Dimension_System => (
(Unit_Name => Meter, Unit_Symbol => 'm', Dim_Symbol => 'L'),
(Unit_Name => Kilogram, Unit_Symbol => "kg", Dim_Symbol => 'M'),
(Unit_Name => Second, Unit_Symbol => 's', Dim_Symbol => 'T'),
(Unit_Name => Ampere, Unit_Symbol => 'A', Dim_Symbol => 'I'),
(Unit_Name => Kelvin, Unit_Symbol => 'K', Dim_Symbol => '@'),
(Unit_Name => Mole, Unit_Symbol => "mol", Dim_Symbol => 'N'),
(Unit_Name => Candela, Unit_Symbol => "cd", Dim_Symbol => 'J'));
-- SI Base dimensioned subtypes
subtype Length is Mks_Type
with
Dimension => (Symbol => 'm',
Meter => 1,
others => 0);
subtype Mass is Mks_Type
with
Dimension => (Symbol => "kg",
Kilogram => 1,
others => 0);
subtype Time is Mks_Type
with
Dimension => (Symbol => 's',
Second => 1,
others => 0);
subtype Electric_Current is Mks_Type
with
Dimension => (Symbol => 'A',
Ampere => 1,
others => 0);
subtype Thermodynamic_Temperature is Mks_Type
with
Dimension => (Symbol => 'K',
Kelvin => 1,
others => 0);
subtype Amount_Of_Substance is Mks_Type
with
Dimension => (Symbol => "mol",
Mole => 1,
others => 0);
subtype Luminous_Intensity is Mks_Type
with
Dimension => (Symbol => "cd",
Candela => 1,
others => 0);
-- Initialize SI Base unit values
-- Turn off the all the dimension warnings for these basic assignments
-- since otherwise we would get complaints about assigning dimensionless
-- values to dimensioned subtypes (we can't assign 1.0*m to m).
pragma Warnings (Off, "*assumed to be*");
m : constant Length := 1.0;
kg : constant Mass := 1.0;
s : constant Time := 1.0;
A : constant Electric_Current := 1.0;
K : constant Thermodynamic_Temperature := 1.0;
mol : constant Amount_Of_Substance := 1.0;
cd : constant Luminous_Intensity := 1.0;
pragma Warnings (On, "*assumed to be*");
-- SI Derived dimensioned subtypes
subtype Absorbed_Dose is Mks_Type
with
Dimension => (Symbol => "Gy",
Meter => 2,
Second => -2,
others => 0);
subtype Angle is Mks_Type
with
Dimension => (Symbol => "rad",
others => 0);
subtype Area is Mks_Type
with
Dimension => (
Meter => 2,
others => 0);
subtype Catalytic_Activity is Mks_Type
with
Dimension => (Symbol => "kat",
Second => -1,
Mole => 1,
others => 0);
subtype Celsius_Temperature is Mks_Type
with
Dimension => (Symbol => "°C",
Kelvin => 1,
others => 0);
subtype Electric_Capacitance is Mks_Type
with
Dimension => (Symbol => 'F',
Meter => -2,
Kilogram => -1,
Second => 4,
Ampere => 2,
others => 0);
subtype Electric_Charge is Mks_Type
with
Dimension => (Symbol => 'C',
Second => 1,
Ampere => 1,
others => 0);
subtype Electric_Conductance is Mks_Type
with
Dimension => (Symbol => 'S',
Meter => -2,
Kilogram => -1,
Second => 3,
Ampere => 2,
others => 0);
subtype Electric_Potential_Difference is Mks_Type
with
Dimension => (Symbol => 'V',
Meter => 2,
Kilogram => 1,
Second => -3,
Ampere => -1,
others => 0);
-- Note the type punning below. The Symbol is a single "ohm" character
-- encoded in UTF-8 (ce a9 in hexadecimal), but this file is not compiled
-- with -gnatW8, so we're treating the string literal as a two-character
-- String.
subtype Electric_Resistance is Mks_Type
with
Dimension => (Symbol => "Ω",
Meter => 2,
Kilogram => 1,
Second => -3,
Ampere => -2,
others => 0);
subtype Energy is Mks_Type
with
Dimension => (Symbol => 'J',
Meter => 2,
Kilogram => 1,
Second => -2,
others => 0);
subtype Equivalent_Dose is Mks_Type
with
Dimension => (Symbol => "Sv",
Meter => 2,
Second => -2,
others => 0);
subtype Force is Mks_Type
with
Dimension => (Symbol => 'N',
Meter => 1,
Kilogram => 1,
Second => -2,
others => 0);
subtype Frequency is Mks_Type
with
Dimension => (Symbol => "Hz",
Second => -1,
others => 0);
subtype Illuminance is Mks_Type
with
Dimension => (Symbol => "lx",
Meter => -2,
Candela => 1,
others => 0);
subtype Inductance is Mks_Type
with
Dimension => (Symbol => 'H',
Meter => 2,
Kilogram => 1,
Second => -2,
Ampere => -2,
others => 0);
subtype Luminous_Flux is Mks_Type
with
Dimension => (Symbol => "lm",
Candela => 1,
others => 0);
subtype Magnetic_Flux is Mks_Type
with
Dimension => (Symbol => "Wb",
Meter => 2,
Kilogram => 1,
Second => -2,
Ampere => -1,
others => 0);
subtype Magnetic_Flux_Density is Mks_Type
with
Dimension => (Symbol => 'T',
Kilogram => 1,
Second => -2,
Ampere => -1,
others => 0);
subtype Power is Mks_Type
with
Dimension => (Symbol => 'W',
Meter => 2,
Kilogram => 1,
Second => -3,
others => 0);
subtype Pressure is Mks_Type
with
Dimension => (Symbol => "Pa",
Meter => -1,
Kilogram => 1,
Second => -2,
others => 0);
subtype Radioactivity is Mks_Type
with
Dimension => (Symbol => "Bq",
Second => -1,
others => 0);
subtype Solid_Angle is Mks_Type
with
Dimension => (Symbol => "sr",
others => 0);
subtype Speed is Mks_Type
with
Dimension => (
Meter => 1,
Second => -1,
others => 0);
subtype Volume is Mks_Type
with
Dimension => (
Meter => 3,
others => 0);
-- Initialize derived dimension values
-- Turn off the all the dimension warnings for these basic assignments
-- since otherwise we would get complaints about assigning dimensionless
-- values to dimensioned subtypes.
pragma Warnings (Off, "*assumed to be*");
rad : constant Angle := 1.0;
sr : constant Solid_Angle := 1.0;
Hz : constant Frequency := 1.0;
N : constant Force := 1.0;
Pa : constant Pressure := 1.0;
J : constant Energy := 1.0;
W : constant Power := 1.0;
C : constant Electric_Charge := 1.0;
V : constant Electric_Potential_Difference := 1.0;
F : constant Electric_Capacitance := 1.0;
Ohm : constant Electric_Resistance := 1.0;
Si : constant Electric_Conductance := 1.0;
Wb : constant Magnetic_Flux := 1.0;
T : constant Magnetic_Flux_Density := 1.0;
H : constant Inductance := 1.0;
dC : constant Celsius_Temperature := 273.15;
lm : constant Luminous_Flux := 1.0;
lx : constant Illuminance := 1.0;
Bq : constant Radioactivity := 1.0;
Gy : constant Absorbed_Dose := 1.0;
Sv : constant Equivalent_Dose := 1.0;
kat : constant Catalytic_Activity := 1.0;
-- SI prefixes for Meter
um : constant Length := 1.0E-06; -- micro (u)
mm : constant Length := 1.0E-03; -- milli
cm : constant Length := 1.0E-02; -- centi
dm : constant Length := 1.0E-01; -- deci
dam : constant Length := 1.0E+01; -- deka
hm : constant Length := 1.0E+02; -- hecto
km : constant Length := 1.0E+03; -- kilo
Mem : constant Length := 1.0E+06; -- mega
-- SI prefixes for Kilogram
ug : constant Mass := 1.0E-09; -- micro (u)
mg : constant Mass := 1.0E-06; -- milli
cg : constant Mass := 1.0E-05; -- centi
dg : constant Mass := 1.0E-04; -- deci
g : constant Mass := 1.0E-03; -- gram
dag : constant Mass := 1.0E-02; -- deka
hg : constant Mass := 1.0E-01; -- hecto
Meg : constant Mass := 1.0E+03; -- mega
-- SI prefixes for Second
us : constant Time := 1.0E-06; -- micro (u)
ms : constant Time := 1.0E-03; -- milli
cs : constant Time := 1.0E-02; -- centi
ds : constant Time := 1.0E-01; -- deci
das : constant Time := 1.0E+01; -- deka
hs : constant Time := 1.0E+02; -- hecto
ks : constant Time := 1.0E+03; -- kilo
Mes : constant Time := 1.0E+06; -- mega
-- Other constants for Second
min : constant Time := 60.0 * s;
hour : constant Time := 60.0 * min;
day : constant Time := 24.0 * hour;
year : constant Time := 365.25 * day;
-- SI prefixes for Ampere
mA : constant Electric_Current := 1.0E-03; -- milli
cA : constant Electric_Current := 1.0E-02; -- centi
dA : constant Electric_Current := 1.0E-01; -- deci
daA : constant Electric_Current := 1.0E+01; -- deka
hA : constant Electric_Current := 1.0E+02; -- hecto
kA : constant Electric_Current := 1.0E+03; -- kilo
MeA : constant Electric_Current := 1.0E+06; -- mega
pragma Warnings (On, "*assumed to be*");
end System.Dim.Generic_Mks;
|
------------------------------------------------------------------------------
-- 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);
with Ada.Strings.Fixed;
package body SPAT.Timing_Item is
---------------------------------------------------------------------------
-- Create
---------------------------------------------------------------------------
not overriding
function Create (Object : in JSON_Value;
Version : in File_Version) return T is
Proof_Time : Duration;
begin
case Version is
when GNAT_CE_2019 =>
Proof_Time :=
Duration (Object.Get_Long_Float (Field => Field_Names.Proof));
when GNAT_CE_2020 =>
declare
-- Callback when mapping the timing object. If the name of the
-- JSON value matches "gnatwhy3." we assume it's a timing value
-- that should be added to the proof time.
---------------------------------------------------------------
-- Add_Why3_Time
---------------------------------------------------------------
procedure Add_Why3_Time (Name : in UTF8_String;
Value : in JSON_Value);
---------------------------------------------------------------
-- Add_Why3_Time
---------------------------------------------------------------
procedure Add_Why3_Time (Name : in UTF8_String;
Value : in JSON_Value) is
begin
if
Ada.Strings.Fixed.Index
(Source => Name,
Pattern => Field_Names.GNAT_Why3_Prefixed) = 1
then
Proof_Time := Proof_Time + Duration (Value.Get_Long_Float);
end if;
end Add_Why3_Time;
begin
Proof_Time := 0.0;
GNATCOLL.JSON.Map_JSON_Object (Val => Object,
CB => Add_Why3_Time'Access);
end;
end case;
return
T'(Entity.T with
Version => Version,
Proof => Proof_Time,
Flow =>
Duration
(Object.Get_Long_Float (Field => Field_Names.Flow_Analysis)));
end Create;
-- TODO: Maybe accept integer values, too.
end SPAT.Timing_Item;
|
-- Copyright 2018-2021 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with System;
package Pck is
procedure Do_Nothing (A : System.Address);
function Ident (S : String) return String;
end Pck;
|
-- Copyright 2013-2017 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 Const; use Const;
procedure Foo is
begin
raise Aint_Global_GDB_E;
end Foo;
|
with Ada.Strings.Unbounded;
package Animals.Humans is
type Human is new Animals.Animal with private;
type Sex_Type is (Male, Female);
function Make
(Name : String;
Sex : Sex_Type)
return Human;
function Get_Name (H : Human) return Ada.Strings.Unbounded.Unbounded_String;
function Get_Sex (H : Human) return Sex_Type;
overriding
procedure Add_Wings (A : in out Human;
N : Positive);
private
type Human is new Animals.Animal with
record
Name : Ada.Strings.Unbounded.Unbounded_String;
Sex : Sex_Type;
end record;
end Animals.Humans;
|
package body Shell_Sort is
----------
-- Sort --
----------
procedure Sort (Item : in out Array_Type) is
Increment : Natural := Index_Type'Pos(Item'Last) / 2;
J : Index_Type;
Temp : Element_Type;
begin
while Increment > 0 loop
for I in Index_Type'Val(Increment) .. Item'Last loop
J := I;
Temp := Item(I);
while J > Index_Type'val(Increment) and then Item (Index_Type'Val(Index_Type'Pos(J) - Increment)) > Temp loop
Item(J) := Item (Index_Type'Val(Index_Type'Pos(J) - Increment));
J := Index_Type'Val(Index_Type'Pos(J) - Increment);
end loop;
Item(J) := Temp;
end loop;
if Increment = 2 then
Increment := 1;
else
Increment := Increment * 5 / 11;
end if;
end loop;
end Sort;
end Shell_Sort;
|
with Ada.Integer_Text_IO;
with Primes;
procedure Euler7 is
Ps: constant Primes.List := Primes.First(10_001);
begin
Ada.Integer_Text_IO.Put(Ps(Ps'Last));
end Euler7;
|
with Ada.Exception_Identification.From_Here;
with System.Zero_Terminated_WStrings;
with C.winerror;
with C.winnt;
package body System.Native_Directories is
use Ada.Exception_Identification.From_Here;
use type Ada.Exception_Identification.Exception_Id;
use type C.size_t;
use type C.windef.DWORD;
use type C.windef.WINBOOL;
use type C.winnt.HANDLE; -- C.void_ptr
use type C.winnt.WCHAR;
-- implementation
function Current_Directory return String is
Buffer : C.winnt.WCHAR_array (0 .. C.windef.MAX_PATH - 1);
Length : C.windef.DWORD;
begin
Length := C.winbase.GetCurrentDirectory (
C.windef.MAX_PATH,
Buffer (0)'Access);
if Length = 0 then
Raise_Exception (Use_Error'Identity);
else
return Zero_Terminated_WStrings.Value (
Buffer (0)'Access,
C.size_t (Length));
end if;
end Current_Directory;
procedure Set_Directory (Directory : String) is
W_Directory : aliased C.winnt.WCHAR_array (
0 ..
Directory'Length * Zero_Terminated_WStrings.Expanding);
begin
Zero_Terminated_WStrings.To_C (Directory, W_Directory (0)'Access);
if C.winbase.SetCurrentDirectory (W_Directory (0)'Access) =
C.windef.FALSE
then
Raise_Exception (Named_IO_Exception_Id (C.winbase.GetLastError));
end if;
end Set_Directory;
procedure Create_Directory (New_Directory : String) is
W_New_Directory : aliased C.winnt.WCHAR_array (
0 ..
New_Directory'Length * Zero_Terminated_WStrings.Expanding);
begin
Zero_Terminated_WStrings.To_C (
New_Directory,
W_New_Directory (0)'Access);
if C.winbase.CreateDirectory (W_New_Directory (0)'Access, null) =
C.windef.FALSE
then
Raise_Exception (Named_IO_Exception_Id (C.winbase.GetLastError));
end if;
end Create_Directory;
procedure Delete_Directory (Directory : String) is
W_Directory : aliased C.winnt.WCHAR_array (
0 ..
Directory'Length * Zero_Terminated_WStrings.Expanding);
begin
Zero_Terminated_WStrings.To_C (Directory, W_Directory (0)'Access);
if C.winbase.RemoveDirectory (W_Directory (0)'Access) =
C.windef.FALSE
then
Raise_Exception (Named_IO_Exception_Id (C.winbase.GetLastError));
end if;
end Delete_Directory;
procedure Delete_File (Name : String) is
W_Name : aliased C.winnt.WCHAR_array (
0 ..
Name'Length * Zero_Terminated_WStrings.Expanding);
begin
Zero_Terminated_WStrings.To_C (Name, W_Name (0)'Access);
if C.winbase.DeleteFile (W_Name (0)'Access) = C.windef.FALSE then
Raise_Exception (Named_IO_Exception_Id (C.winbase.GetLastError));
end if;
end Delete_File;
procedure Rename (
Old_Name : String;
New_Name : String;
Overwrite : Boolean)
is
W_Old : aliased C.winnt.WCHAR_array (
0 ..
Old_Name'Length * Zero_Terminated_WStrings.Expanding);
W_New : aliased C.winnt.WCHAR_array (
0 ..
New_Name'Length * Zero_Terminated_WStrings.Expanding);
Overwrite_Flag : C.windef.DWORD;
begin
Zero_Terminated_WStrings.To_C (Old_Name, W_Old (0)'Access);
Zero_Terminated_WStrings.To_C (New_Name, W_New (0)'Access);
if Overwrite then
Overwrite_Flag := C.winbase.MOVEFILE_REPLACE_EXISTING;
else
Overwrite_Flag := 0;
end if;
if C.winbase.MoveFileEx (
W_Old (0)'Access,
W_New (0)'Access,
dwFlags => C.winbase.MOVEFILE_COPY_ALLOWED or Overwrite_Flag) =
C.windef.FALSE
then
Raise_Exception (Named_IO_Exception_Id (C.winbase.GetLastError));
end if;
end Rename;
procedure Copy_File (
Source_Name : String;
Target_Name : String;
Overwrite : Boolean)
is
W_Source_Name : aliased C.winnt.WCHAR_array (
0 ..
Source_Name'Length * Zero_Terminated_WStrings.Expanding);
W_Target_Name : aliased C.winnt.WCHAR_array (
0 ..
Target_Name'Length * Zero_Terminated_WStrings.Expanding);
begin
Zero_Terminated_WStrings.To_C (Source_Name, W_Source_Name (0)'Access);
Zero_Terminated_WStrings.To_C (Target_Name, W_Target_Name (0)'Access);
if C.winbase.CopyFile (
W_Source_Name (0)'Access,
W_Target_Name (0)'Access,
bFailIfExists => Boolean'Pos (not Overwrite)) =
C.windef.FALSE
then
Raise_Exception (Named_IO_Exception_Id (C.winbase.GetLastError));
end if;
end Copy_File;
procedure Replace_File (
Source_Name : String;
Target_Name : String)
is
W_Source_Name : aliased C.winnt.WCHAR_array (
0 ..
Source_Name'Length * Zero_Terminated_WStrings.Expanding);
W_Target_Name : aliased C.winnt.WCHAR_array (
0 ..
Target_Name'Length * Zero_Terminated_WStrings.Expanding);
begin
Zero_Terminated_WStrings.To_C (Source_Name, W_Source_Name (0)'Access);
Zero_Terminated_WStrings.To_C (Target_Name, W_Target_Name (0)'Access);
if C.winbase.ReplaceFile (
W_Target_Name (0)'Access,
W_Source_Name (0)'Access,
null,
0,
C.windef.LPVOID (Null_Address),
C.windef.LPVOID (Null_Address)) =
C.windef.FALSE
then
-- Target_Name is not existing.
if C.winbase.MoveFileEx (
W_Source_Name (0)'Access,
W_Target_Name (0)'Access,
dwFlags => C.winbase.MOVEFILE_REPLACE_EXISTING) =
C.windef.FALSE
then
Raise_Exception (Named_IO_Exception_Id (C.winbase.GetLastError));
end if;
end if;
end Replace_File;
procedure Symbolic_Link (
Source_Name : String;
Target_Name : String;
Overwrite : Boolean) is
begin
raise Program_Error; -- try to create junction point ???
end Symbolic_Link;
function Full_Name (Name : String) return String is
Name_Length : constant C.size_t := Name'Length;
begin
if Name_Length = 0 then
-- Full_Name (Containing_Directory ("RELATIVE")) =
-- Containing_Directory (Full_Name ("RELATIVE"))
return Current_Directory;
else
declare
W_Name : C.winnt.WCHAR_array (
0 ..
Name_Length * Zero_Terminated_WStrings.Expanding);
Buffer_Length : constant C.size_t :=
Name_Length + C.windef.MAX_PATH;
Long : C.winnt.WCHAR_array (0 .. Buffer_Length - 1);
Long_Last : C.size_t;
Full : C.winnt.WCHAR_array (0 .. Buffer_Length - 1);
Full_Last : C.size_t;
begin
Zero_Terminated_WStrings.To_C (Name, W_Name (0)'Access);
-- expand short filename to long filename
Long_Last := C.size_t (
C.winbase.GetLongPathName (
W_Name (0)'Access,
Long (0)'Access,
Long'Length));
if Long_Last = 0 or else Long_Last > Long'Last then
Long (0 .. Name_Length) := W_Name (0 .. Name_Length);
Long_Last := Name_Length;
end if;
-- expand directories
Full_Last := C.size_t (
C.winbase.GetFullPathName (
Long (0)'Access,
Full'Length,
Full (0)'Access,
null));
if Full_Last = 0 or else Full_Last > Full'Last then
Full (0 .. Long_Last) := Long (0 .. Long_Last);
Full_Last := Long_Last;
end if;
-- drive letter to upper case
if Full_Last >= 2
and then Full (1) = C.winnt.WCHAR'Val (Wide_Character'Pos (':'))
and then Full (0) in
C.winnt.WCHAR'Val (Wide_Character'Pos ('a')) ..
C.winnt.WCHAR'Val (Wide_Character'Pos ('z'))
then
Full (0) := C.winnt.WCHAR'Val (
C.winnt.WCHAR'Pos (Full (0))
- (Wide_Character'Pos ('a') - Wide_Character'Pos ('A')));
end if;
return Zero_Terminated_WStrings.Value (Full (0)'Access, Full_Last);
end;
end if;
end Full_Name;
function Exists (Name : String) return Boolean is
W_Name : aliased C.winnt.WCHAR_array (
0 ..
Name'Length * Zero_Terminated_WStrings.Expanding);
Information : aliased Directory_Entry_Information_Type;
begin
Zero_Terminated_WStrings.To_C (Name, W_Name (0)'Access);
return C.winbase.GetFileAttributesEx (
W_Name (0)'Access,
C.winbase.GetFileExInfoStandard,
C.windef.LPVOID (Information'Address)) /=
C.windef.FALSE;
end Exists;
procedure Get_Information (
Name : String;
Information : aliased out Directory_Entry_Information_Type)
is
W_Name : aliased C.winnt.WCHAR_array (
0 ..
Name'Length * Zero_Terminated_WStrings.Expanding);
begin
Zero_Terminated_WStrings.To_C (Name, W_Name (0)'Access);
if C.winbase.GetFileAttributesEx (
W_Name (0)'Access,
C.winbase.GetFileExInfoStandard,
C.windef.LPVOID (Information'Address)) =
C.windef.FALSE
then
Raise_Exception (Named_IO_Exception_Id (C.winbase.GetLastError));
end if;
end Get_Information;
function Kind (Attributes : C.windef.DWORD) return File_Kind is
begin
if (Attributes and C.winnt.FILE_ATTRIBUTE_DIRECTORY) /= 0 then
return Directory;
elsif (Attributes
and (
C.winnt.FILE_ATTRIBUTE_DEVICE
or C.winnt.FILE_ATTRIBUTE_REPARSE_POINT
or C.winnt.FILE_ATTRIBUTE_VIRTUAL)) /= 0
then
return Special_File;
else
return Ordinary_File;
end if;
end Kind;
function Kind (Information : Directory_Entry_Information_Type)
return File_Kind is
begin
return File_Kind'Enum_Val (
File_Kind'Enum_Rep (Kind (Information.dwFileAttributes)));
end Kind;
function Size (Information : Directory_Entry_Information_Type)
return Ada.Streams.Stream_Element_Count
is
U : constant C.winnt.ULARGE_INTEGER := (
Unchecked_Tag => 0,
LowPart => Information.nFileSizeLow,
HighPart => Information.nFileSizeHigh);
begin
return Ada.Streams.Stream_Element_Offset (U.QuadPart);
end Size;
function Modification_Time (Information : Directory_Entry_Information_Type)
return Native_Calendar.Native_Time is
begin
return Information.ftLastWriteTime;
end Modification_Time;
procedure Set_Modification_Time (
Name : String;
Time : Native_Calendar.Native_Time)
is
Exception_Id : Ada.Exception_Identification.Exception_Id :=
Ada.Exception_Identification.Null_Id;
W_Name : aliased C.winnt.WCHAR_array (
0 ..
Name'Length * Zero_Terminated_WStrings.Expanding);
Information : aliased Directory_Entry_Information_Type;
Aliased_Time : aliased Native_Calendar.Native_Time := Time;
Handle : C.winnt.HANDLE;
begin
Zero_Terminated_WStrings.To_C (Name, W_Name (0)'Access);
if C.winbase.GetFileAttributesEx (
W_Name (0)'Access,
C.winbase.GetFileExInfoStandard,
C.windef.LPVOID (Information'Address)) =
C.windef.FALSE
then
Exception_Id := Named_IO_Exception_Id (C.winbase.GetLastError);
else
Handle := C.winbase.CreateFile (
W_Name (0)'Access,
dwDesiredAccess => C.winnt.FILE_WRITE_ATTRIBUTES,
dwShareMode => C.winnt.FILE_SHARE_READ or C.winnt.FILE_SHARE_WRITE,
lpSecurityAttributes => null,
dwCreationDisposition => C.winbase.OPEN_EXISTING,
dwFlagsAndAttributes =>
C.winbase.FILE_FLAG_BACKUP_SEMANTICS
or C.winbase.FILE_FLAG_OPEN_REPARSE_POINT,
hTemplateFile => C.windef.LPVOID (Null_Address));
if Handle = C.winbase.INVALID_HANDLE_VALUE then
Exception_Id := Named_IO_Exception_Id (C.winbase.GetLastError);
else
if C.winbase.SetFileTime (
Handle,
Information.ftCreationTime'Access,
Information.ftLastAccessTime'Access,
Aliased_Time'Access) =
C.windef.FALSE
then
Exception_Id := IO_Exception_Id (C.winbase.GetLastError);
end if;
if C.winbase.CloseHandle (Handle) = C.windef.FALSE
and then Exception_Id = Ada.Exception_Identification.Null_Id
then
Exception_Id := IO_Exception_Id (C.winbase.GetLastError);
end if;
end if;
end if;
if Exception_Id /= Ada.Exception_Identification.Null_Id then
Raise_Exception (Exception_Id);
end if;
end Set_Modification_Time;
function IO_Exception_Id (Error : C.windef.DWORD)
return Ada.Exception_Identification.Exception_Id is
begin
case Error is
when C.winerror.ERROR_WRITE_FAULT
| C.winerror.ERROR_READ_FAULT
| C.winerror.ERROR_GEN_FAILURE
| C.winerror.ERROR_IO_DEVICE =>
return Device_Error'Identity;
when others =>
return Use_Error'Identity;
end case;
end IO_Exception_Id;
function Named_IO_Exception_Id (Error : C.windef.DWORD)
return Ada.Exception_Identification.Exception_Id is
begin
case Error is
when C.winerror.ERROR_FILE_NOT_FOUND
| C.winerror.ERROR_PATH_NOT_FOUND
| C.winerror.ERROR_INVALID_NAME =>
return Name_Error'Identity;
when others =>
return IO_Exception_Id (Error);
end case;
end Named_IO_Exception_Id;
end System.Native_Directories;
|
declare
type Integer_Ptr is access Integer;
procedure Free is new Ada.Unchecked_Deallocation (Integer, Integer_Ptr)
Ptr : Integer_Ptr := new Integer; -- Allocated in the heap
begin
Free (Ptr); -- Explicit deallocation
...
end;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 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$
------------------------------------------------------------------------------
private package Matreshka.Internals.Text_Codecs.ISO88595 is
pragma Preelaborate;
-------------------------
-- ISO88595_Decoder --
-------------------------
type ISO88595_Decoder is new Abstract_Decoder with private;
overriding function Is_Error (Self : ISO88595_Decoder) return Boolean;
overriding function Is_Mailformed
(Self : ISO88595_Decoder) return Boolean;
overriding procedure Decode_Append
(Self : in out ISO88595_Decoder;
Data : Ada.Streams.Stream_Element_Array;
String : in out Matreshka.Internals.Strings.Shared_String_Access);
function Decoder (Mode : Decoder_Mode) return Abstract_Decoder'Class;
-------------------------
-- ISO88595_Encoder --
-------------------------
type ISO88595_Encoder is new Abstract_Encoder with private;
overriding procedure Encode
(Self : in out ISO88595_Encoder;
String : not null Matreshka.Internals.Strings.Shared_String_Access;
Buffer : out MISEV.Shared_Stream_Element_Vector_Access);
function Encoder return Abstract_Encoder'Class;
private
type ISO88595_Decoder is new Abstract_Decoder with null record;
type ISO88595_Encoder is new Abstract_Encoder with null record;
end Matreshka.Internals.Text_Codecs.ISO88595;
|
-- Standard Ada library specification
-- Copyright (c) 2003-2018 Maxim Reznik <reznikmm@gmail.com>
-- Copyright (c) 2004-2016 AXE Consultants
-- Copyright (c) 2004, 2005, 2006 Ada-Europe
-- Copyright (c) 2000 The MITRE Corporation, Inc.
-- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc.
-- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual
---------------------------------------------------------------------------
with Ada.Strings.Wide_Wide_Maps;
package Ada.Strings.Wide_Wide_Fixed is
pragma Preelaborate (Wide_Wide_Fixed);
-- "Copy" procedure for strings of possibly different lengths
procedure Move (Source : in Wide_Wide_String;
Target : out Wide_Wide_String;
Drop : in Truncation := Error;
Justify : in Alignment := Left;
Pad : in Wide_Wide_Character := Wide_Wide_Space);
-- Search subprograms
function Index (Source : in Wide_Wide_String;
Pattern : in Wide_Wide_String;
From : in Positive;
Going : in Direction := Forward;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping
:= Wide_Wide_Maps.Identity)
return Natural;
function Index
(Source : in Wide_Wide_String;
Pattern : in Wide_Wide_String;
From : in Positive;
Going : in Direction := Forward;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural;
function Index (Source : in Wide_Wide_String;
Pattern : in Wide_Wide_String;
Going : in Direction := Forward;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping
:= Wide_Wide_Maps.Identity)
return Natural;
function Index
(Source : in Wide_Wide_String;
Pattern : in Wide_Wide_String;
Going : in Direction := Forward;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural;
function Index (Source : in Wide_Wide_String;
Set : in Wide_Wide_Maps.Wide_Wide_Character_Set;
From : in Positive;
Test : in Membership := Inside;
Going : in Direction := Forward)
return Natural;
function Index (Source : in Wide_Wide_String;
Set : in Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : in Membership := Inside;
Going : in Direction := Forward)
return Natural;
function Index_Non_Blank (Source : in Wide_Wide_String;
From : in Positive;
Going : in Direction := Forward)
return Natural;
function Index_Non_Blank (Source : in Wide_Wide_String;
Going : in Direction := Forward)
return Natural;
function Count (Source : in Wide_Wide_String;
Pattern : in Wide_Wide_String;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping
:= Wide_Wide_Maps.Identity)
return Natural;
function Count
(Source : in Wide_Wide_String;
Pattern : in Wide_Wide_String;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural;
function Count (Source : in Wide_Wide_String;
Set : in Wide_Wide_Maps.Wide_Wide_Character_Set)
return Natural;
procedure Find_Token (Source : in Wide_Wide_String;
Set : in Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : in Membership;
First : out Positive;
Last : out Natural);
-- Wide_Wide_String translation subprograms
function Translate
(Source : in Wide_Wide_String;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping)
return Wide_Wide_String;
procedure Translate
(Source : in out Wide_Wide_String;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping);
function Translate
(Source : in Wide_Wide_String;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Wide_Wide_String;
procedure Translate
(Source : in out Wide_Wide_String;
Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function);
-- Wide_Wide_String transformation subprograms
function Replace_Slice (Source : in Wide_Wide_String;
Low : in Positive;
High : in Natural;
By : in Wide_Wide_String)
return Wide_Wide_String;
procedure Replace_Slice (Source : in out Wide_Wide_String;
Low : in Positive;
High : in Natural;
By : in Wide_Wide_String;
Drop : in Truncation := Error;
Justify : in Alignment := Left;
Pad : in Wide_Wide_Character
:= Wide_Wide_Space);
function Insert (Source : in Wide_Wide_String;
Before : in Positive;
New_Item : in Wide_Wide_String)
return Wide_Wide_String;
procedure Insert (Source : in out Wide_Wide_String;
Before : in Positive;
New_Item : in Wide_Wide_String;
Drop : in Truncation := Error);
function Overwrite (Source : in Wide_Wide_String;
Position : in Positive;
New_Item : in Wide_Wide_String)
return Wide_Wide_String;
procedure Overwrite (Source : in out Wide_Wide_String;
Position : in Positive;
New_Item : in Wide_Wide_String;
Drop : in Truncation := Right);
function Delete (Source : in Wide_Wide_String;
From : in Positive;
Through : in Natural)
return Wide_Wide_String;
procedure Delete (Source : in out Wide_Wide_String;
From : in Positive;
Through : in Natural;
Justify : in Alignment := Left;
Pad : in Wide_Wide_Character := Wide_Wide_Space);
-- Wide_Wide_String selector subprograms
function Trim (Source : in Wide_Wide_String;
Side : in Trim_End)
return Wide_Wide_String;
procedure Trim (Source : in out Wide_Wide_String;
Side : in Trim_End;
Justify : in Alignment := Left;
Pad : in Wide_Wide_Character := Wide_Wide_Space);
function Trim (Source : in Wide_Wide_String;
Left : in Wide_Wide_Maps.Wide_Wide_Character_Set;
Right : in Wide_Wide_Maps.Wide_Wide_Character_Set)
return Wide_Wide_String;
procedure Trim (Source : in out Wide_Wide_String;
Left : in Wide_Wide_Maps.Wide_Wide_Character_Set;
Right : in Wide_Wide_Maps.Wide_Wide_Character_Set;
Justify : in Alignment := Strings.Left;
Pad : in Wide_Wide_Character := Wide_Wide_Space);
function Head (Source : in Wide_Wide_String;
Count : in Natural;
Pad : in Wide_Wide_Character := Wide_Wide_Space)
return Wide_Wide_String;
procedure Head (Source : in out Wide_Wide_String;
Count : in Natural;
Justify : in Alignment := Left;
Pad : in Wide_Wide_Character := Wide_Wide_Space);
function Tail (Source : in Wide_Wide_String;
Count : in Natural;
Pad : in Wide_Wide_Character := Wide_Wide_Space)
return Wide_Wide_String;
procedure Tail (Source : in out Wide_Wide_String;
Count : in Natural;
Justify : in Alignment := Left;
Pad : in Wide_Wide_Character := Wide_Wide_Space);
-- Wide_Wide_String constructor functions
function "*" (Left : in Natural;
Right : in Wide_Wide_Character) return Wide_Wide_String;
function "*" (Left : in Natural;
Right : in Wide_Wide_String) return Wide_Wide_String;
end Ada.Strings.Wide_Wide_Fixed;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- ADA.EXCEPTIONS.EXCEPTION_TRACES --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Unchecked_Conversion;
pragma Warnings (Off);
with Ada.Exceptions.Last_Chance_Handler;
pragma Warnings (On);
-- Bring last chance handler into closure
separate (Ada.Exceptions)
package body Exception_Traces is
Nline : constant String := String'(1 => ASCII.LF);
-- Convenient shortcut
type Exception_Action is access procedure (E : Exception_Occurrence);
Global_Action : Exception_Action := null;
pragma Export
(Ada, Global_Action, "__gnat_exception_actions_global_action");
-- Global action, executed whenever an exception is raised. Changing the
-- export name must be coordinated with code in g-excact.adb.
Raise_Hook_Initialized : Boolean := False;
pragma Export
(Ada, Raise_Hook_Initialized, "__gnat_exception_actions_initialized");
procedure Last_Chance_Handler (Except : Exception_Occurrence);
pragma Import (C, Last_Chance_Handler, "__gnat_last_chance_handler");
pragma No_Return (Last_Chance_Handler);
-- Users can replace the default version of this routine,
-- Ada.Exceptions.Last_Chance_Handler.
function To_Action is new Ada.Unchecked_Conversion
(Raise_Action, Exception_Action);
-----------------------
-- Local Subprograms --
-----------------------
procedure Notify_Exception (Excep : EOA; Is_Unhandled : Boolean);
-- Factorizes the common processing for Notify_Handled_Exception and
-- Notify_Unhandled_Exception. Is_Unhandled is set to True only in the
-- latter case because Notify_Handled_Exception may be called for an
-- actually unhandled occurrence in the Front-End-SJLJ case.
----------------------
-- Notify_Exception --
----------------------
procedure Notify_Exception (Excep : EOA; Is_Unhandled : Boolean) is
begin
-- Output the exception information required by the Exception_Trace
-- configuration. Take care not to output information about internal
-- exceptions.
if not Excep.Id.Not_Handled_By_Others
and then
(Exception_Trace = Every_Raise
or else
(Is_Unhandled
and then
(Exception_Trace = Unhandled_Raise
or else Exception_Trace = Unhandled_Raise_In_Main)))
then
-- Exception trace messages need to be protected when several tasks
-- can issue them at the same time.
Lock_Task.all;
To_Stderr (Nline);
if Exception_Trace /= Unhandled_Raise_In_Main then
if Is_Unhandled then
To_Stderr ("Unhandled ");
end if;
To_Stderr ("Exception raised");
To_Stderr (Nline);
end if;
To_Stderr (Exception_Information (Excep.all));
Unlock_Task.all;
end if;
-- Call the user-specific actions
-- ??? We should presumably look at the reraise status here.
if Raise_Hook_Initialized
and then Exception_Data_Ptr (Excep.Id).Raise_Hook /= null
then
To_Action (Exception_Data_Ptr (Excep.Id).Raise_Hook) (Excep.all);
end if;
if Global_Action /= null then
Global_Action (Excep.all);
end if;
end Notify_Exception;
------------------------------
-- Notify_Handled_Exception --
------------------------------
procedure Notify_Handled_Exception (Excep : EOA) is
begin
Notify_Exception (Excep, Is_Unhandled => False);
end Notify_Handled_Exception;
--------------------------------
-- Notify_Unhandled_Exception --
--------------------------------
procedure Notify_Unhandled_Exception (Excep : EOA) is
begin
-- Check whether there is any termination handler to be executed for
-- the environment task, and execute it if needed. Here we handle both
-- the Abnormal and Unhandled_Exception task termination. Normal
-- task termination routine is executed elsewhere (either in the
-- Task_Wrapper or in the Adafinal routine for the environment task).
Task_Termination_Handler.all (Excep.all);
Notify_Exception (Excep, Is_Unhandled => True);
Debug_Unhandled_Exception (SSL.Exception_Data_Ptr (Excep.Id));
end Notify_Unhandled_Exception;
-----------------------------------
-- Unhandled_Exception_Terminate --
-----------------------------------
procedure Unhandled_Exception_Terminate (Excep : EOA) is
Occ : Exception_Occurrence;
-- This occurrence will be used to display a message after finalization.
-- It is necessary to save a copy here, or else the designated value
-- could be overwritten if an exception is raised during finalization
-- (even if that exception is caught). The occurrence is saved on the
-- stack to avoid dynamic allocation (if this exception is due to lack
-- of space in the heap, we therefore avoid a second failure). We assume
-- that there is enough room on the stack however.
begin
Save_Occurrence (Occ, Excep.all);
Last_Chance_Handler (Occ);
end Unhandled_Exception_Terminate;
------------------------------------
-- Handling GNAT.Exception_Traces --
------------------------------------
-- The bulk of exception traces output is centralized in Notify_Exception,
-- for both the Handled and Unhandled cases. Extra task specific output is
-- triggered in the task wrapper for unhandled occurrences in tasks. It is
-- not performed in this unit to avoid dependencies on the tasking units
-- here.
-- We used to rely on the output performed by Unhanded_Exception_Terminate
-- for the case of an unhandled occurrence in the environment thread, and
-- the task wrapper was responsible for the whole output in the tasking
-- case.
-- This initial scheme had a drawback: the output from Terminate only
-- occurs after finalization is done, which means possibly never if some
-- tasks keep hanging around.
-- The first "presumably obvious" fix consists in moving the Terminate
-- output before the finalization. It has not been retained because it
-- introduces annoying changes in output orders when the finalization
-- itself issues outputs, this also in "regular" cases not resorting to
-- Exception_Traces.
-- Today's solution has the advantage of simplicity and better isolates
-- the Exception_Traces machinery.
end Exception_Traces;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- M L I B . P R J --
-- --
-- S p e c --
-- --
-- Copyright (C) 2001-2007, 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 builds a library for a library project file
with Prj; use Prj;
package MLib.Prj is
procedure Build_Library
(For_Project : Project_Id;
In_Tree : Project_Tree_Ref;
Gnatbind : String;
Gnatbind_Path : String_Access;
Gcc : String;
Gcc_Path : String_Access;
Bind : Boolean := True;
Link : Boolean := True);
-- Build the library of library project For_Project.
-- Fails if For_Project is not a library project file.
-- Gnatbind, Gnatbind_Path, Gcc, Gcc_Path are used for standalone
-- libraries, to call the binder and to compile the binder generated
-- files. If Bind is False the binding of a stand-alone library is skipped.
-- If Link is False, the library is not linked/built.
procedure Check_Library
(For_Project : Project_Id;
In_Tree : Project_Tree_Ref);
-- Check if the library of a library project needs to be rebuilt,
-- because its time-stamp is earlier than the time stamp of one of its
-- object files.
end MLib.Prj;
|
-----------------------------------------------------------------------
-- AWA.Events.Models -- AWA.Events.Models
-----------------------------------------------------------------------
-- File generated by ada-gen DO NOT MODIFY
-- Template used: templates/model/package-spec.xhtml
-- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095
-----------------------------------------------------------------------
-- Copyright (C) 2020 Stephane Carrez
-- Written by Stephane Carrez (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.
-----------------------------------------------------------------------
pragma Warnings (Off);
with ADO.Sessions;
with ADO.Objects;
with ADO.Statements;
with ADO.SQL;
with ADO.Schemas;
with ADO.Queries;
with ADO.Queries.Loaders;
with Ada.Calendar;
with Ada.Containers.Vectors;
with Ada.Strings.Unbounded;
with Util.Beans.Objects;
with Util.Beans.Objects.Enums;
with Util.Beans.Basic.Lists;
with AWA.Users.Models;
pragma Warnings (On);
package AWA.Events.Models is
pragma Style_Checks ("-mr");
type Message_Status_Type is (QUEUED, PROCESSING, PROCESSED);
for Message_Status_Type use (QUEUED => 0, PROCESSING => 1, PROCESSED => 2);
package Message_Status_Type_Objects is
new Util.Beans.Objects.Enums (Message_Status_Type);
type Nullable_Message_Status_Type is record
Is_Null : Boolean := True;
Value : Message_Status_Type;
end record;
type Message_Type_Ref is new ADO.Objects.Object_Ref with null record;
type Queue_Ref is new ADO.Objects.Object_Ref with null record;
type Message_Ref is new ADO.Objects.Object_Ref with null record;
-- Create an object key for Message_Type.
function Message_Type_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key;
-- Create an object key for Message_Type from a string.
-- Raises Constraint_Error if the string cannot be converted into the object key.
function Message_Type_Key (Id : in String) return ADO.Objects.Object_Key;
Null_Message_Type : constant Message_Type_Ref;
function "=" (Left, Right : Message_Type_Ref'Class) return Boolean;
--
procedure Set_Id (Object : in out Message_Type_Ref;
Value : in ADO.Identifier);
--
function Get_Id (Object : in Message_Type_Ref)
return ADO.Identifier;
-- Set the message type name
procedure Set_Name (Object : in out Message_Type_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String);
procedure Set_Name (Object : in out Message_Type_Ref;
Value : in String);
-- Get the message type name
function Get_Name (Object : in Message_Type_Ref)
return Ada.Strings.Unbounded.Unbounded_String;
function Get_Name (Object : in Message_Type_Ref)
return String;
-- Load the entity identified by 'Id'.
-- Raises the NOT_FOUND exception if it does not exist.
procedure Load (Object : in out Message_Type_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier);
-- Load the entity identified by 'Id'.
-- Returns True in <b>Found</b> if the object was found and False if it does not exist.
procedure Load (Object : in out Message_Type_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean);
-- Find and load the entity.
overriding
procedure Find (Object : in out Message_Type_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean);
-- Save the entity. If the entity does not have an identifier, an identifier is allocated
-- and it is inserted in the table. Otherwise, only data fields which have been changed
-- are updated.
overriding
procedure Save (Object : in out Message_Type_Ref;
Session : in out ADO.Sessions.Master_Session'Class);
-- Delete the entity.
overriding
procedure Delete (Object : in out Message_Type_Ref;
Session : in out ADO.Sessions.Master_Session'Class);
overriding
function Get_Value (From : in Message_Type_Ref;
Name : in String) return Util.Beans.Objects.Object;
-- Table definition
MESSAGE_TYPE_TABLE : constant ADO.Schemas.Class_Mapping_Access;
-- Internal method to allocate the Object_Record instance
overriding
procedure Allocate (Object : in out Message_Type_Ref);
-- Copy of the object.
procedure Copy (Object : in Message_Type_Ref;
Into : in out Message_Type_Ref);
package Message_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Message_Type_Ref,
"=" => "=");
subtype Message_Type_Vector is Message_Type_Vectors.Vector;
procedure List (Object : in out Message_Type_Vector;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class);
-- --------------------
-- The message queue tracks the event messages that must be dispatched by
-- a given server.
-- --------------------
-- Create an object key for Queue.
function Queue_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key;
-- Create an object key for Queue from a string.
-- Raises Constraint_Error if the string cannot be converted into the object key.
function Queue_Key (Id : in String) return ADO.Objects.Object_Key;
Null_Queue : constant Queue_Ref;
function "=" (Left, Right : Queue_Ref'Class) return Boolean;
--
procedure Set_Id (Object : in out Queue_Ref;
Value : in ADO.Identifier);
--
function Get_Id (Object : in Queue_Ref)
return ADO.Identifier;
--
procedure Set_Server_Id (Object : in out Queue_Ref;
Value : in Integer);
--
function Get_Server_Id (Object : in Queue_Ref)
return Integer;
-- Set the message queue name
procedure Set_Name (Object : in out Queue_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String);
procedure Set_Name (Object : in out Queue_Ref;
Value : in String);
-- Get the message queue name
function Get_Name (Object : in Queue_Ref)
return Ada.Strings.Unbounded.Unbounded_String;
function Get_Name (Object : in Queue_Ref)
return String;
-- Load the entity identified by 'Id'.
-- Raises the NOT_FOUND exception if it does not exist.
procedure Load (Object : in out Queue_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier);
-- Load the entity identified by 'Id'.
-- Returns True in <b>Found</b> if the object was found and False if it does not exist.
procedure Load (Object : in out Queue_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean);
-- Find and load the entity.
overriding
procedure Find (Object : in out Queue_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean);
-- Save the entity. If the entity does not have an identifier, an identifier is allocated
-- and it is inserted in the table. Otherwise, only data fields which have been changed
-- are updated.
overriding
procedure Save (Object : in out Queue_Ref;
Session : in out ADO.Sessions.Master_Session'Class);
-- Delete the entity.
overriding
procedure Delete (Object : in out Queue_Ref;
Session : in out ADO.Sessions.Master_Session'Class);
overriding
function Get_Value (From : in Queue_Ref;
Name : in String) return Util.Beans.Objects.Object;
-- Table definition
QUEUE_TABLE : constant ADO.Schemas.Class_Mapping_Access;
-- Internal method to allocate the Object_Record instance
overriding
procedure Allocate (Object : in out Queue_Ref);
-- Copy of the object.
procedure Copy (Object : in Queue_Ref;
Into : in out Queue_Ref);
-- Create an object key for Message.
function Message_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key;
-- Create an object key for Message from a string.
-- Raises Constraint_Error if the string cannot be converted into the object key.
function Message_Key (Id : in String) return ADO.Objects.Object_Key;
Null_Message : constant Message_Ref;
function "=" (Left, Right : Message_Ref'Class) return Boolean;
-- Set the message identifier
procedure Set_Id (Object : in out Message_Ref;
Value : in ADO.Identifier);
-- Get the message identifier
function Get_Id (Object : in Message_Ref)
return ADO.Identifier;
-- Set the message creation date
procedure Set_Create_Date (Object : in out Message_Ref;
Value : in Ada.Calendar.Time);
-- Get the message creation date
function Get_Create_Date (Object : in Message_Ref)
return Ada.Calendar.Time;
-- Set the message priority
procedure Set_Priority (Object : in out Message_Ref;
Value : in Integer);
-- Get the message priority
function Get_Priority (Object : in Message_Ref)
return Integer;
-- Set the message count
procedure Set_Count (Object : in out Message_Ref;
Value : in Integer);
-- Get the message count
function Get_Count (Object : in Message_Ref)
return Integer;
-- Set the message parameters
procedure Set_Parameters (Object : in out Message_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String);
procedure Set_Parameters (Object : in out Message_Ref;
Value : in String);
-- Get the message parameters
function Get_Parameters (Object : in Message_Ref)
return Ada.Strings.Unbounded.Unbounded_String;
function Get_Parameters (Object : in Message_Ref)
return String;
-- Set the server identifier which processes the message
procedure Set_Server_Id (Object : in out Message_Ref;
Value : in Integer);
-- Get the server identifier which processes the message
function Get_Server_Id (Object : in Message_Ref)
return Integer;
-- Set the task identfier on the server which processes the message
procedure Set_Task_Id (Object : in out Message_Ref;
Value : in Integer);
-- Get the task identfier on the server which processes the message
function Get_Task_Id (Object : in Message_Ref)
return Integer;
-- Set the message status
procedure Set_Status (Object : in out Message_Ref;
Value : in AWA.Events.Models.Message_Status_Type);
-- Get the message status
function Get_Status (Object : in Message_Ref)
return AWA.Events.Models.Message_Status_Type;
-- Set the message processing date
procedure Set_Processing_Date (Object : in out Message_Ref;
Value : in ADO.Nullable_Time);
-- Get the message processing date
function Get_Processing_Date (Object : in Message_Ref)
return ADO.Nullable_Time;
--
function Get_Version (Object : in Message_Ref)
return Integer;
-- Set the entity identifier to which this event is associated.
procedure Set_Entity_Id (Object : in out Message_Ref;
Value : in ADO.Identifier);
-- Get the entity identifier to which this event is associated.
function Get_Entity_Id (Object : in Message_Ref)
return ADO.Identifier;
-- Set the entity type of the entity identifier to which this event is associated.
procedure Set_Entity_Type (Object : in out Message_Ref;
Value : in ADO.Entity_Type);
-- Get the entity type of the entity identifier to which this event is associated.
function Get_Entity_Type (Object : in Message_Ref)
return ADO.Entity_Type;
-- Set the date and time when the event was finished to be processed.
procedure Set_Finish_Date (Object : in out Message_Ref;
Value : in ADO.Nullable_Time);
-- Get the date and time when the event was finished to be processed.
function Get_Finish_Date (Object : in Message_Ref)
return ADO.Nullable_Time;
--
procedure Set_Queue (Object : in out Message_Ref;
Value : in AWA.Events.Models.Queue_Ref'Class);
--
function Get_Queue (Object : in Message_Ref)
return AWA.Events.Models.Queue_Ref'Class;
-- Set the message type
procedure Set_Message_Type (Object : in out Message_Ref;
Value : in AWA.Events.Models.Message_Type_Ref'Class);
-- Get the message type
function Get_Message_Type (Object : in Message_Ref)
return AWA.Events.Models.Message_Type_Ref'Class;
-- Set the optional user who triggered the event message creation
procedure Set_User (Object : in out Message_Ref;
Value : in AWA.Users.Models.User_Ref'Class);
-- Get the optional user who triggered the event message creation
function Get_User (Object : in Message_Ref)
return AWA.Users.Models.User_Ref'Class;
-- Set the optional user session that triggered the message creation
procedure Set_Session (Object : in out Message_Ref;
Value : in AWA.Users.Models.Session_Ref'Class);
-- Get the optional user session that triggered the message creation
function Get_Session (Object : in Message_Ref)
return AWA.Users.Models.Session_Ref'Class;
-- Load the entity identified by 'Id'.
-- Raises the NOT_FOUND exception if it does not exist.
procedure Load (Object : in out Message_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier);
-- Load the entity identified by 'Id'.
-- Returns True in <b>Found</b> if the object was found and False if it does not exist.
procedure Load (Object : in out Message_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean);
-- Find and load the entity.
overriding
procedure Find (Object : in out Message_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean);
-- Save the entity. If the entity does not have an identifier, an identifier is allocated
-- and it is inserted in the table. Otherwise, only data fields which have been changed
-- are updated.
overriding
procedure Save (Object : in out Message_Ref;
Session : in out ADO.Sessions.Master_Session'Class);
-- Delete the entity.
overriding
procedure Delete (Object : in out Message_Ref;
Session : in out ADO.Sessions.Master_Session'Class);
overriding
function Get_Value (From : in Message_Ref;
Name : in String) return Util.Beans.Objects.Object;
-- Table definition
MESSAGE_TABLE : constant ADO.Schemas.Class_Mapping_Access;
-- Internal method to allocate the Object_Record instance
overriding
procedure Allocate (Object : in out Message_Ref);
-- Copy of the object.
procedure Copy (Object : in Message_Ref;
Into : in out Message_Ref);
package Message_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Message_Ref,
"=" => "=");
subtype Message_Vector is Message_Vectors.Vector;
procedure List (Object : in out Message_Vector;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class);
Query_Queue_Pending_Message : constant ADO.Queries.Query_Definition_Access;
private
MESSAGE_TYPE_NAME : aliased constant String := "awa_message_type";
COL_0_1_NAME : aliased constant String := "id";
COL_1_1_NAME : aliased constant String := "name";
MESSAGE_TYPE_DEF : aliased constant ADO.Schemas.Class_Mapping :=
(Count => 2,
Table => MESSAGE_TYPE_NAME'Access,
Members => (
1 => COL_0_1_NAME'Access,
2 => COL_1_1_NAME'Access)
);
MESSAGE_TYPE_TABLE : constant ADO.Schemas.Class_Mapping_Access
:= MESSAGE_TYPE_DEF'Access;
Null_Message_Type : constant Message_Type_Ref
:= Message_Type_Ref'(ADO.Objects.Object_Ref with null record);
type Message_Type_Impl is
new ADO.Objects.Object_Record (Key_Type => ADO.Objects.KEY_INTEGER,
Of_Class => MESSAGE_TYPE_DEF'Access)
with record
Name : Ada.Strings.Unbounded.Unbounded_String;
end record;
type Message_Type_Access is access all Message_Type_Impl;
overriding
procedure Destroy (Object : access Message_Type_Impl);
overriding
procedure Find (Object : in out Message_Type_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean);
overriding
procedure Load (Object : in out Message_Type_Impl;
Session : in out ADO.Sessions.Session'Class);
procedure Load (Object : in out Message_Type_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class);
overriding
procedure Save (Object : in out Message_Type_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
procedure Create (Object : in out Message_Type_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
overriding
procedure Delete (Object : in out Message_Type_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
procedure Set_Field (Object : in out Message_Type_Ref'Class;
Impl : out Message_Type_Access);
QUEUE_NAME : aliased constant String := "awa_queue";
COL_0_2_NAME : aliased constant String := "id";
COL_1_2_NAME : aliased constant String := "server_id";
COL_2_2_NAME : aliased constant String := "name";
QUEUE_DEF : aliased constant ADO.Schemas.Class_Mapping :=
(Count => 3,
Table => QUEUE_NAME'Access,
Members => (
1 => COL_0_2_NAME'Access,
2 => COL_1_2_NAME'Access,
3 => COL_2_2_NAME'Access)
);
QUEUE_TABLE : constant ADO.Schemas.Class_Mapping_Access
:= QUEUE_DEF'Access;
Null_Queue : constant Queue_Ref
:= Queue_Ref'(ADO.Objects.Object_Ref with null record);
type Queue_Impl is
new ADO.Objects.Object_Record (Key_Type => ADO.Objects.KEY_INTEGER,
Of_Class => QUEUE_DEF'Access)
with record
Server_Id : Integer;
Name : Ada.Strings.Unbounded.Unbounded_String;
end record;
type Queue_Access is access all Queue_Impl;
overriding
procedure Destroy (Object : access Queue_Impl);
overriding
procedure Find (Object : in out Queue_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean);
overriding
procedure Load (Object : in out Queue_Impl;
Session : in out ADO.Sessions.Session'Class);
procedure Load (Object : in out Queue_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class);
overriding
procedure Save (Object : in out Queue_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
procedure Create (Object : in out Queue_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
overriding
procedure Delete (Object : in out Queue_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
procedure Set_Field (Object : in out Queue_Ref'Class;
Impl : out Queue_Access);
MESSAGE_NAME : aliased constant String := "awa_message";
COL_0_3_NAME : aliased constant String := "id";
COL_1_3_NAME : aliased constant String := "create_date";
COL_2_3_NAME : aliased constant String := "priority";
COL_3_3_NAME : aliased constant String := "count";
COL_4_3_NAME : aliased constant String := "parameters";
COL_5_3_NAME : aliased constant String := "server_id";
COL_6_3_NAME : aliased constant String := "task_id";
COL_7_3_NAME : aliased constant String := "status";
COL_8_3_NAME : aliased constant String := "processing_date";
COL_9_3_NAME : aliased constant String := "version";
COL_10_3_NAME : aliased constant String := "entity_id";
COL_11_3_NAME : aliased constant String := "entity_type";
COL_12_3_NAME : aliased constant String := "finish_date";
COL_13_3_NAME : aliased constant String := "queue_id";
COL_14_3_NAME : aliased constant String := "message_type_id";
COL_15_3_NAME : aliased constant String := "user_id";
COL_16_3_NAME : aliased constant String := "session_id";
MESSAGE_DEF : aliased constant ADO.Schemas.Class_Mapping :=
(Count => 17,
Table => MESSAGE_NAME'Access,
Members => (
1 => COL_0_3_NAME'Access,
2 => COL_1_3_NAME'Access,
3 => COL_2_3_NAME'Access,
4 => COL_3_3_NAME'Access,
5 => COL_4_3_NAME'Access,
6 => COL_5_3_NAME'Access,
7 => COL_6_3_NAME'Access,
8 => COL_7_3_NAME'Access,
9 => COL_8_3_NAME'Access,
10 => COL_9_3_NAME'Access,
11 => COL_10_3_NAME'Access,
12 => COL_11_3_NAME'Access,
13 => COL_12_3_NAME'Access,
14 => COL_13_3_NAME'Access,
15 => COL_14_3_NAME'Access,
16 => COL_15_3_NAME'Access,
17 => COL_16_3_NAME'Access)
);
MESSAGE_TABLE : constant ADO.Schemas.Class_Mapping_Access
:= MESSAGE_DEF'Access;
Null_Message : constant Message_Ref
:= Message_Ref'(ADO.Objects.Object_Ref with null record);
type Message_Impl is
new ADO.Objects.Object_Record (Key_Type => ADO.Objects.KEY_INTEGER,
Of_Class => MESSAGE_DEF'Access)
with record
Create_Date : Ada.Calendar.Time;
Priority : Integer;
Count : Integer;
Parameters : Ada.Strings.Unbounded.Unbounded_String;
Server_Id : Integer;
Task_Id : Integer;
Status : AWA.Events.Models.Message_Status_Type;
Processing_Date : ADO.Nullable_Time;
Version : Integer;
Entity_Id : ADO.Identifier;
Entity_Type : ADO.Entity_Type;
Finish_Date : ADO.Nullable_Time;
Queue : AWA.Events.Models.Queue_Ref;
Message_Type : AWA.Events.Models.Message_Type_Ref;
User : AWA.Users.Models.User_Ref;
Session : AWA.Users.Models.Session_Ref;
end record;
type Message_Access is access all Message_Impl;
overriding
procedure Destroy (Object : access Message_Impl);
overriding
procedure Find (Object : in out Message_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean);
overriding
procedure Load (Object : in out Message_Impl;
Session : in out ADO.Sessions.Session'Class);
procedure Load (Object : in out Message_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class);
overriding
procedure Save (Object : in out Message_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
procedure Create (Object : in out Message_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
overriding
procedure Delete (Object : in out Message_Impl;
Session : in out ADO.Sessions.Master_Session'Class);
procedure Set_Field (Object : in out Message_Ref'Class;
Impl : out Message_Access);
package File_1 is
new ADO.Queries.Loaders.File (Path => "queue-messages.xml",
Sha1 => "9B2B599473F75F92CB5AB5045675E4CCEF926543");
package Def_Queue_Pending_Message is
new ADO.Queries.Loaders.Query (Name => "queue-pending-message",
File => File_1.File'Access);
Query_Queue_Pending_Message : constant ADO.Queries.Query_Definition_Access
:= Def_Queue_Pending_Message.Query'Access;
end AWA.Events.Models;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . E X N _ L L F --
-- --
-- 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. --
-- --
-- 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;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . S T R I N G S . B O U N D E D --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2006, 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. --
-- --
--
--
--
--
--
--
--
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Strings.Maps;
with Ada.Strings.Superbounded;
package Ada.Strings.Bounded is
pragma Preelaborate;
generic
Max : Positive;
-- Maximum length of a Bounded_String
package Generic_Bounded_Length is
Max_Length : constant Positive := Max;
type Bounded_String is private;
pragma Preelaborable_Initialization (Bounded_String);
Null_Bounded_String : constant Bounded_String;
subtype Length_Range is Natural range 0 .. Max_Length;
function Length (Source : Bounded_String) return Length_Range;
--------------------------------------------------------
-- Conversion, Concatenation, and Selection Functions --
--------------------------------------------------------
function To_Bounded_String
(Source : String;
Drop : Truncation := Error) return Bounded_String;
function To_String (Source : Bounded_String) return String;
procedure Set_Bounded_String
(Target : out Bounded_String;
Source : String;
Drop : Truncation := Error);
pragma Ada_05 (Set_Bounded_String);
function Append
(Left : Bounded_String;
Right : Bounded_String;
Drop : Truncation := Error) return Bounded_String;
function Append
(Left : Bounded_String;
Right : String;
Drop : Truncation := Error) return Bounded_String;
function Append
(Left : String;
Right : Bounded_String;
Drop : Truncation := Error) return Bounded_String;
function Append
(Left : Bounded_String;
Right : Character;
Drop : Truncation := Error) return Bounded_String;
function Append
(Left : Character;
Right : Bounded_String;
Drop : Truncation := Error) return Bounded_String;
procedure Append
(Source : in out Bounded_String;
New_Item : Bounded_String;
Drop : Truncation := Error);
procedure Append
(Source : in out Bounded_String;
New_Item : String;
Drop : Truncation := Error);
procedure Append
(Source : in out Bounded_String;
New_Item : Character;
Drop : Truncation := Error);
function "&"
(Left : Bounded_String;
Right : Bounded_String) return Bounded_String;
function "&"
(Left : Bounded_String;
Right : String) return Bounded_String;
function "&"
(Left : String;
Right : Bounded_String) return Bounded_String;
function "&"
(Left : Bounded_String;
Right : Character) return Bounded_String;
function "&"
(Left : Character;
Right : Bounded_String) return Bounded_String;
function Element
(Source : Bounded_String;
Index : Positive) return Character;
procedure Replace_Element
(Source : in out Bounded_String;
Index : Positive;
By : Character);
function Slice
(Source : Bounded_String;
Low : Positive;
High : Natural) return String;
function Bounded_Slice
(Source : Bounded_String;
Low : Positive;
High : Natural) return Bounded_String;
pragma Ada_05 (Bounded_Slice);
procedure Bounded_Slice
(Source : Bounded_String;
Target : out Bounded_String;
Low : Positive;
High : Natural);
pragma Ada_05 (Bounded_Slice);
function "="
(Left : Bounded_String;
Right : Bounded_String) return Boolean;
function "="
(Left : Bounded_String;
Right : String) return Boolean;
function "="
(Left : String;
Right : Bounded_String) return Boolean;
function "<"
(Left : Bounded_String;
Right : Bounded_String) return Boolean;
function "<"
(Left : Bounded_String;
Right : String) return Boolean;
function "<"
(Left : String;
Right : Bounded_String) return Boolean;
function "<="
(Left : Bounded_String;
Right : Bounded_String) return Boolean;
function "<="
(Left : Bounded_String;
Right : String) return Boolean;
function "<="
(Left : String;
Right : Bounded_String) return Boolean;
function ">"
(Left : Bounded_String;
Right : Bounded_String) return Boolean;
function ">"
(Left : Bounded_String;
Right : String) return Boolean;
function ">"
(Left : String;
Right : Bounded_String) return Boolean;
function ">="
(Left : Bounded_String;
Right : Bounded_String) return Boolean;
function ">="
(Left : Bounded_String;
Right : String) return Boolean;
function ">="
(Left : String;
Right : Bounded_String) return Boolean;
----------------------
-- Search Functions --
----------------------
function Index
(Source : Bounded_String;
Pattern : String;
Going : Direction := Forward;
Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
function Index
(Source : Bounded_String;
Pattern : String;
Going : Direction := Forward;
Mapping : Maps.Character_Mapping_Function) return Natural;
function Index
(Source : Bounded_String;
Set : Maps.Character_Set;
Test : Membership := Inside;
Going : Direction := Forward) return Natural;
function Index
(Source : Bounded_String;
Pattern : String;
From : Positive;
Going : Direction := Forward;
Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
pragma Ada_05 (Index);
function Index
(Source : Bounded_String;
Pattern : String;
From : Positive;
Going : Direction := Forward;
Mapping : Maps.Character_Mapping_Function) return Natural;
pragma Ada_05 (Index);
function Index
(Source : Bounded_String;
Set : Maps.Character_Set;
From : Positive;
Test : Membership := Inside;
Going : Direction := Forward) return Natural;
pragma Ada_05 (Index);
function Index_Non_Blank
(Source : Bounded_String;
Going : Direction := Forward) return Natural;
function Index_Non_Blank
(Source : Bounded_String;
From : Positive;
Going : Direction := Forward) return Natural;
pragma Ada_05 (Index_Non_Blank);
function Count
(Source : Bounded_String;
Pattern : String;
Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
function Count
(Source : Bounded_String;
Pattern : String;
Mapping : Maps.Character_Mapping_Function) return Natural;
function Count
(Source : Bounded_String;
Set : Maps.Character_Set) return Natural;
procedure Find_Token
(Source : Bounded_String;
Set : Maps.Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
------------------------------------
-- String Translation Subprograms --
------------------------------------
function Translate
(Source : Bounded_String;
Mapping : Maps.Character_Mapping) return Bounded_String;
procedure Translate
(Source : in out Bounded_String;
Mapping : Maps.Character_Mapping);
function Translate
(Source : Bounded_String;
Mapping : Maps.Character_Mapping_Function) return Bounded_String;
procedure Translate
(Source : in out Bounded_String;
Mapping : Maps.Character_Mapping_Function);
---------------------------------------
-- String Transformation Subprograms --
---------------------------------------
function Replace_Slice
(Source : Bounded_String;
Low : Positive;
High : Natural;
By : String;
Drop : Truncation := Error) return Bounded_String;
procedure Replace_Slice
(Source : in out Bounded_String;
Low : Positive;
High : Natural;
By : String;
Drop : Truncation := Error);
function Insert
(Source : Bounded_String;
Before : Positive;
New_Item : String;
Drop : Truncation := Error) return Bounded_String;
procedure Insert
(Source : in out Bounded_String;
Before : Positive;
New_Item : String;
Drop : Truncation := Error);
function Overwrite
(Source : Bounded_String;
Position : Positive;
New_Item : String;
Drop : Truncation := Error) return Bounded_String;
procedure Overwrite
(Source : in out Bounded_String;
Position : Positive;
New_Item : String;
Drop : Truncation := Error);
function Delete
(Source : Bounded_String;
From : Positive;
Through : Natural) return Bounded_String;
procedure Delete
(Source : in out Bounded_String;
From : Positive;
Through : Natural);
---------------------------------
-- String Selector Subprograms --
---------------------------------
function Trim
(Source : Bounded_String;
Side : Trim_End) return Bounded_String;
procedure Trim
(Source : in out Bounded_String;
Side : Trim_End);
function Trim
(Source : Bounded_String;
Left : Maps.Character_Set;
Right : Maps.Character_Set) return Bounded_String;
procedure Trim
(Source : in out Bounded_String;
Left : Maps.Character_Set;
Right : Maps.Character_Set);
function Head
(Source : Bounded_String;
Count : Natural;
Pad : Character := Space;
Drop : Truncation := Error) return Bounded_String;
procedure Head
(Source : in out Bounded_String;
Count : Natural;
Pad : Character := Space;
Drop : Truncation := Error);
function Tail
(Source : Bounded_String;
Count : Natural;
Pad : Character := Space;
Drop : Truncation := Error) return Bounded_String;
procedure Tail
(Source : in out Bounded_String;
Count : Natural;
Pad : Character := Space;
Drop : Truncation := Error);
------------------------------------
-- String Constructor Subprograms --
------------------------------------
function "*"
(Left : Natural;
Right : Character) return Bounded_String;
function "*"
(Left : Natural;
Right : String) return Bounded_String;
function "*"
(Left : Natural;
Right : Bounded_String) return Bounded_String;
function Replicate
(Count : Natural;
Item : Character;
Drop : Truncation := Error) return Bounded_String;
function Replicate
(Count : Natural;
Item : String;
Drop : Truncation := Error) return Bounded_String;
function Replicate
(Count : Natural;
Item : Bounded_String;
Drop : Truncation := Error) return Bounded_String;
private
-- Most of the implementation is in the separate non generic package
-- Ada.Strings.Superbounded. Type Bounded_String is derived from type
-- Superbounded.Super_String with the maximum length constraint. In
-- almost all cases, the routines in Superbounded can be called with
-- no requirement to pass the maximum length explicitly, since there
-- is at least one Bounded_String argument from which the maximum
-- length can be obtained. For all such routines, the implementation
-- in this private part is simply a renaming of the corresponding
-- routine in the super bouded package.
-- The five exceptions are the * and Replicate routines operating on
-- character values. For these cases, we have a routine in the body
-- that calls the superbounded routine passing the maximum length
-- explicitly as an extra parameter.
type Bounded_String is new Superbounded.Super_String (Max_Length);
-- Deriving Bounded_String from Superbounded.Super_String is the
-- real trick, it ensures that the type Bounded_String declared in
-- the generic instantiation is compatible with the Super_String
-- type declared in the Superbounded package.
Null_Bounded_String : constant Bounded_String :=
(Max_Length => Max_Length,
Current_Length => 0,
Data =>
(1 .. Max_Length => ASCII.NUL));
pragma Inline (To_Bounded_String);
procedure Set_Bounded_String
(Target : out Bounded_String;
Source : String;
Drop : Truncation := Error)
renames Set_Super_String;
function Length
(Source : Bounded_String) return Length_Range
renames Super_Length;
function To_String
(Source : Bounded_String) return String
renames Super_To_String;
function Append
(Left : Bounded_String;
Right : Bounded_String;
Drop : Truncation := Error) return Bounded_String
renames Super_Append;
function Append
(Left : Bounded_String;
Right : String;
Drop : Truncation := Error) return Bounded_String
renames Super_Append;
function Append
(Left : String;
Right : Bounded_String;
Drop : Truncation := Error) return Bounded_String
renames Super_Append;
function Append
(Left : Bounded_String;
Right : Character;
Drop : Truncation := Error) return Bounded_String
renames Super_Append;
function Append
(Left : Character;
Right : Bounded_String;
Drop : Truncation := Error) return Bounded_String
renames Super_Append;
procedure Append
(Source : in out Bounded_String;
New_Item : Bounded_String;
Drop : Truncation := Error)
renames Super_Append;
procedure Append
(Source : in out Bounded_String;
New_Item : String;
Drop : Truncation := Error)
renames Super_Append;
procedure Append
(Source : in out Bounded_String;
New_Item : Character;
Drop : Truncation := Error)
renames Super_Append;
function "&"
(Left : Bounded_String;
Right : Bounded_String) return Bounded_String
renames Concat;
function "&"
(Left : Bounded_String;
Right : String) return Bounded_String
renames Concat;
function "&"
(Left : String;
Right : Bounded_String) return Bounded_String
renames Concat;
function "&"
(Left : Bounded_String;
Right : Character) return Bounded_String
renames Concat;
function "&"
(Left : Character;
Right : Bounded_String) return Bounded_String
renames Concat;
function Element
(Source : Bounded_String;
Index : Positive) return Character
renames Super_Element;
procedure Replace_Element
(Source : in out Bounded_String;
Index : Positive;
By : Character)
renames Super_Replace_Element;
function Slice
(Source : Bounded_String;
Low : Positive;
High : Natural) return String
renames Super_Slice;
function Bounded_Slice
(Source : Bounded_String;
Low : Positive;
High : Natural) return Bounded_String
renames Super_Slice;
procedure Bounded_Slice
(Source : Bounded_String;
Target : out Bounded_String;
Low : Positive;
High : Natural)
renames Super_Slice;
function "="
(Left : Bounded_String;
Right : Bounded_String) return Boolean
renames Equal;
function "="
(Left : Bounded_String;
Right : String) return Boolean
renames Equal;
function "="
(Left : String;
Right : Bounded_String) return Boolean
renames Equal;
function "<"
(Left : Bounded_String;
Right : Bounded_String) return Boolean
renames Less;
function "<"
(Left : Bounded_String;
Right : String) return Boolean
renames Less;
function "<"
(Left : String;
Right : Bounded_String) return Boolean
renames Less;
function "<="
(Left : Bounded_String;
Right : Bounded_String) return Boolean
renames Less_Or_Equal;
function "<="
(Left : Bounded_String;
Right : String) return Boolean
renames Less_Or_Equal;
function "<="
(Left : String;
Right : Bounded_String) return Boolean
renames Less_Or_Equal;
function ">"
(Left : Bounded_String;
Right : Bounded_String) return Boolean
renames Greater;
function ">"
(Left : Bounded_String;
Right : String) return Boolean
renames Greater;
function ">"
(Left : String;
Right : Bounded_String) return Boolean
renames Greater;
function ">="
(Left : Bounded_String;
Right : Bounded_String) return Boolean
renames Greater_Or_Equal;
function ">="
(Left : Bounded_String;
Right : String) return Boolean
renames Greater_Or_Equal;
function ">="
(Left : String;
Right : Bounded_String) return Boolean
renames Greater_Or_Equal;
function Index
(Source : Bounded_String;
Pattern : String;
Going : Direction := Forward;
Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
renames Super_Index;
function Index
(Source : Bounded_String;
Pattern : String;
Going : Direction := Forward;
Mapping : Maps.Character_Mapping_Function) return Natural
renames Super_Index;
function Index
(Source : Bounded_String;
Set : Maps.Character_Set;
Test : Membership := Inside;
Going : Direction := Forward) return Natural
renames Super_Index;
function Index
(Source : Bounded_String;
Pattern : String;
From : Positive;
Going : Direction := Forward;
Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
renames Super_Index;
function Index
(Source : Bounded_String;
Pattern : String;
From : Positive;
Going : Direction := Forward;
Mapping : Maps.Character_Mapping_Function) return Natural
renames Super_Index;
function Index
(Source : Bounded_String;
Set : Maps.Character_Set;
From : Positive;
Test : Membership := Inside;
Going : Direction := Forward) return Natural
renames Super_Index;
function Index_Non_Blank
(Source : Bounded_String;
Going : Direction := Forward) return Natural
renames Super_Index_Non_Blank;
function Index_Non_Blank
(Source : Bounded_String;
From : Positive;
Going : Direction := Forward) return Natural
renames Super_Index_Non_Blank;
function Count
(Source : Bounded_String;
Pattern : String;
Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
renames Super_Count;
function Count
(Source : Bounded_String;
Pattern : String;
Mapping : Maps.Character_Mapping_Function) return Natural
renames Super_Count;
function Count
(Source : Bounded_String;
Set : Maps.Character_Set) return Natural
renames Super_Count;
procedure Find_Token
(Source : Bounded_String;
Set : Maps.Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural)
renames Super_Find_Token;
function Translate
(Source : Bounded_String;
Mapping : Maps.Character_Mapping) return Bounded_String
renames Super_Translate;
procedure Translate
(Source : in out Bounded_String;
Mapping : Maps.Character_Mapping)
renames Super_Translate;
function Translate
(Source : Bounded_String;
Mapping : Maps.Character_Mapping_Function) return Bounded_String
renames Super_Translate;
procedure Translate
(Source : in out Bounded_String;
Mapping : Maps.Character_Mapping_Function)
renames Super_Translate;
function Replace_Slice
(Source : Bounded_String;
Low : Positive;
High : Natural;
By : String;
Drop : Truncation := Error) return Bounded_String
renames Super_Replace_Slice;
procedure Replace_Slice
(Source : in out Bounded_String;
Low : Positive;
High : Natural;
By : String;
Drop : Truncation := Error)
renames Super_Replace_Slice;
function Insert
(Source : Bounded_String;
Before : Positive;
New_Item : String;
Drop : Truncation := Error) return Bounded_String
renames Super_Insert;
procedure Insert
(Source : in out Bounded_String;
Before : Positive;
New_Item : String;
Drop : Truncation := Error)
renames Super_Insert;
function Overwrite
(Source : Bounded_String;
Position : Positive;
New_Item : String;
Drop : Truncation := Error) return Bounded_String
renames Super_Overwrite;
procedure Overwrite
(Source : in out Bounded_String;
Position : Positive;
New_Item : String;
Drop : Truncation := Error)
renames Super_Overwrite;
function Delete
(Source : Bounded_String;
From : Positive;
Through : Natural) return Bounded_String
renames Super_Delete;
procedure Delete
(Source : in out Bounded_String;
From : Positive;
Through : Natural)
renames Super_Delete;
function Trim
(Source : Bounded_String;
Side : Trim_End) return Bounded_String
renames Super_Trim;
procedure Trim
(Source : in out Bounded_String;
Side : Trim_End)
renames Super_Trim;
function Trim
(Source : Bounded_String;
Left : Maps.Character_Set;
Right : Maps.Character_Set) return Bounded_String
renames Super_Trim;
procedure Trim
(Source : in out Bounded_String;
Left : Maps.Character_Set;
Right : Maps.Character_Set)
renames Super_Trim;
function Head
(Source : Bounded_String;
Count : Natural;
Pad : Character := Space;
Drop : Truncation := Error) return Bounded_String
renames Super_Head;
procedure Head
(Source : in out Bounded_String;
Count : Natural;
Pad : Character := Space;
Drop : Truncation := Error)
renames Super_Head;
function Tail
(Source : Bounded_String;
Count : Natural;
Pad : Character := Space;
Drop : Truncation := Error) return Bounded_String
renames Super_Tail;
procedure Tail
(Source : in out Bounded_String;
Count : Natural;
Pad : Character := Space;
Drop : Truncation := Error)
renames Super_Tail;
function "*"
(Left : Natural;
Right : Bounded_String) return Bounded_String
renames Times;
function Replicate
(Count : Natural;
Item : Bounded_String;
Drop : Truncation := Error) return Bounded_String
renames Super_Replicate;
end Generic_Bounded_Length;
end Ada.Strings.Bounded;
|
-----------------------------------------------------------------------
-- openapi-server -- Rest server support
-- Copyright (C) 2017, 2020, 2022 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 Util.Beans.Objects.Readers;
with Util.Serialize.IO.JSON;
with Util.Serialize.IO.Form;
with Security;
with Servlet.Streams;
with Servlet.Responses;
package body OpenAPI.Servers is
use type Servlet.Streams.Input_Stream_Access;
-- ------------------------------
-- Get a request parameter defined in the URI path.
-- ------------------------------
procedure Get_Path_Parameter (Req : in Request'Class;
Pos : in Positive;
Value : out UString) is
begin
Value := To_UString (Req.Get_Path_Parameter (Pos));
end Get_Path_Parameter;
-- ------------------------------
-- Get a request parameter defined in the URI path.
-- ------------------------------
procedure Get_Path_Parameter (Req : in Request'Class;
Pos : in Positive;
Value : out Long) is
V : constant String := Req.Get_Path_Parameter (Pos);
begin
Value := Long'Value (V);
end Get_Path_Parameter;
-- ------------------------------
-- Get a request parameter from the query string.
-- ------------------------------
procedure Get_Query_Parameter (Req : in Request'Class;
Name : in String;
Value : out UString) is
begin
Value := To_UString (Req.Get_Parameter (Name));
end Get_Query_Parameter;
procedure Get_Query_Parameter (Req : in Request'Class;
Name : in String;
Value : out Nullable_UString) is
V : constant String := Req.Get_Parameter (Name);
begin
Value.Value := To_UString (V);
Value.Is_Null := V'Length = 0;
end Get_Query_Parameter;
-- ------------------------------
-- Get a request parameter from the query as boolean.
-- ------------------------------
procedure Get_Query_Parameter (Req : in Request'Class;
Name : in String;
Value : out Boolean) is
begin
Value := Boolean'Value (Req.Get_Parameter (Name));
end Get_Query_Parameter;
procedure Get_Query_Parameter (Req : in Request'Class;
Name : in String;
Value : out Nullable_Boolean) is
V : constant String := Req.Get_Parameter (Name);
begin
Value.Is_Null := V'Length = 0;
if Value.Is_Null then
Value.Value := False;
else
Value.Value := Boolean'Value (V);
end if;
end Get_Query_Parameter;
-- Get a request parameter from the query string.
procedure Get_Query_Parameter (Req : in Request'Class;
Name : in String;
Value : out UString_Vectors.Vector) is
begin
Value.Append (Req.Get_Parameter (Name));
end Get_Query_Parameter;
procedure Get_Query_Parameter (Req : in Request'Class;
Name : in String;
Value : out Nullable_UString_Vectors.Vector) is
Param : constant String := Req.Get_Parameter (Name);
begin
if Param'Length > 0 then
Value.Append ((Is_Null => False, Value => To_UString (Param)));
end if;
end Get_Query_Parameter;
-- ------------------------------
-- Read the request body and get a value object tree.
-- ------------------------------
procedure Read (Req : in Request'Class;
Value : out Value_Type) is
Stream : constant Servlet.Streams.Input_Stream_Access := Req.Get_Input_Stream;
Parser : Util.Serialize.IO.JSON.Parser;
Mapper : Util.Beans.Objects.Readers.Reader;
begin
if Stream = null then
Value := Util.Beans.Objects.Null_Object;
else
Parser.Parse (Stream.all, Mapper);
Value := Mapper.Get_Root;
end if;
end Read;
procedure Read (Context : in out Context_Type) is
Stream : constant Servlet.Streams.Input_Stream_Access := Context.Req.Get_Input_Stream;
Parser : Util.Serialize.IO.Form.Parser;
Mapper : Util.Beans.Objects.Readers.Reader;
begin
if Stream = null then
Context.Params := Util.Beans.Objects.Null_Object;
else
Parser.Parse (Stream.all, Mapper);
Context.Params := Mapper.Get_Root;
end if;
Context.Use_Map := True;
end Read;
procedure Initialize (Context : in out Context_Type;
Req : in out Request'Class;
Reply : in out Response'Class;
Stream : in out Output_Stream'Class) is
begin
Context.Req := Req'Unchecked_Access;
Context.Reply := Reply'Unchecked_Access;
Context.Stream := Stream'Unchecked_Access;
if Req.Get_Method = "PUT"
and then Req.Get_Content_Type = "application/x-www-form-urlencoded"
then
Context.Read;
end if;
end Initialize;
function Get_Parameter (Req : in out Context_Type;
Name : in String) return String is
begin
if Req.Use_Map then
return Util.Beans.Objects.To_String (Util.Beans.Objects.Get_Value (Req.Params, Name));
else
return Req.Req.Get_Parameter (Name);
end if;
end Get_Parameter;
-- ------------------------------
-- Get a request parameter passed in the form.
-- ------------------------------
procedure Get_Parameter (Req : in out Context_Type;
Name : in String;
Value : out Long) is
V : constant String := Req.Get_Parameter (Name);
begin
Value := Long'Value (V);
end Get_Parameter;
-- ------------------------------
-- Get a request parameter passed in the form.
-- ------------------------------
procedure Get_Parameter (Req : in out Context_Type;
Name : in String;
Value : out Integer) is
V : constant String := Req.Get_Parameter (Name);
begin
Value := Integer'Value (V);
end Get_Parameter;
-- ------------------------------
-- Get a request parameter passed in the form.
-- ------------------------------
procedure Get_Parameter (Req : in out Context_Type;
Name : in String;
Value : out UString) is
begin
Value := To_UString (Req.Get_Parameter (Name));
end Get_Parameter;
procedure Get_Parameter (Req : in out Context_Type;
Name : in String;
Value : out Nullable_UString) is
begin
if Req.Use_Map then
declare
Item : constant Util.Beans.Objects.Object
:= Util.Beans.Objects.Get_Value (Req.Params, Name);
begin
Value.Is_Null := Util.Beans.Objects.Is_Null (Item);
Value.Value := Util.Beans.Objects.To_Unbounded_String (Item);
end;
else
declare
Param : constant String := Req.Get_Parameter (Name);
begin
Value.Value := To_UString (Param);
Value.Is_Null := Param'Length = 0;
end;
end if;
end Get_Parameter;
-- ------------------------------
-- Get a request parameter passed in the form.
-- ------------------------------
procedure Get_Parameter (Req : in out Context_Type;
Name : in String;
Value : out Boolean) is
V : constant String := Req.Get_Parameter (Name);
begin
Value := Boolean'Value (V);
end Get_Parameter;
-- ------------------------------
-- Set the response error code with a message to return.
-- ------------------------------
procedure Set_Error (Context : in out Context_Type;
Code : in Natural;
Message : in String) is
begin
Context.Reply.Set_Status (Code);
Context.Stream.Start_Document;
Context.Stream.Start_Entity ("");
Context.Stream.Write_Attribute ("code", Code);
Context.Stream.Write_Attribute ("message", Message);
Context.Stream.End_Entity ("");
Context.Stream.End_Document;
end Set_Error;
-- ------------------------------
-- Set the HTTP status in the response.
-- ------------------------------
procedure Set_Status (Context : in out Context_Type;
Code : in Natural) is
begin
Context.Reply.Set_Status (Code);
end Set_Status;
-- ------------------------------
-- Get the HTTP status that will be sent in the response.
-- ------------------------------
function Get_Status (Context : in Context_Type) return Natural is
begin
return Context.Reply.Get_Status;
end Get_Status;
-- ------------------------------
-- Send a Location: header in the response.
-- ------------------------------
procedure Set_Location (Context : in out Context_Type;
URL : in String) is
begin
Context.Reply.Add_Header (Name => "Location", Value => URL);
end Set_Location;
-- ------------------------------
-- Returns True if the API request is authenticated.
-- ------------------------------
function Is_Authenticated (Context : in Context_Type) return Boolean is
use type Security.Principal_Access;
User : constant Security.Principal_Access := Context.Req.Get_User_Principal;
begin
return User /= null;
end Is_Authenticated;
-- ------------------------------
-- Returns True if the client doing the request has the given permission.
-- ------------------------------
function Has_Permission (Context : in Context_Type;
Permission : in Security.Permissions.Permission_Index)
return Boolean is
pragma Unreferenced (Permission);
use type Security.Principal_Access;
User : constant Security.Principal_Access := Context.Req.Get_User_Principal;
begin
if User = null then
return False;
end if;
return True;
end Has_Permission;
end OpenAPI.Servers;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . W I D E _ T E X T _ I O . M O D U L A R _ A U X --
-- --
-- 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 Ada.Wide_Text_IO.Generic_Aux; use Ada.Wide_Text_IO.Generic_Aux;
with System.Img_BIU; use System.Img_BIU;
with System.Img_Uns; use System.Img_Uns;
with System.Img_LLB; use System.Img_LLB;
with System.Img_LLU; use System.Img_LLU;
with System.Img_LLW; use System.Img_LLW;
with System.Img_WIU; use System.Img_WIU;
with System.Val_Uns; use System.Val_Uns;
with System.Val_LLU; use System.Val_LLU;
package body Ada.Wide_Text_IO.Modular_Aux is
use System.Unsigned_Types;
-----------------------
-- Local Subprograms --
-----------------------
procedure Load_Modular
(File : File_Type;
Buf : out String;
Ptr : in out Natural);
-- This is an auxiliary routine that is used to load an possibly signed
-- modular literal value from the input file into Buf, starting at Ptr + 1.
-- Ptr is left set to the last character stored.
-------------
-- Get_LLU --
-------------
procedure Get_LLU
(File : File_Type;
Item : out Long_Long_Unsigned;
Width : Field)
is
Buf : String (1 .. Field'Last);
Stop : Integer := 0;
Ptr : aliased Integer := 1;
begin
if Width /= 0 then
Load_Width (File, Width, Buf, Stop);
String_Skip (Buf, Ptr);
else
Load_Modular (File, Buf, Stop);
end if;
Item := Scan_Long_Long_Unsigned (Buf, Ptr'Access, Stop);
Check_End_Of_Field (Buf, Stop, Ptr, Width);
end Get_LLU;
-------------
-- Get_Uns --
-------------
procedure Get_Uns
(File : File_Type;
Item : out Unsigned;
Width : Field)
is
Buf : String (1 .. Field'Last);
Stop : Integer := 0;
Ptr : aliased Integer := 1;
begin
if Width /= 0 then
Load_Width (File, Width, Buf, Stop);
String_Skip (Buf, Ptr);
else
Load_Modular (File, Buf, Stop);
end if;
Item := Scan_Unsigned (Buf, Ptr'Access, Stop);
Check_End_Of_Field (Buf, Stop, Ptr, Width);
end Get_Uns;
--------------
-- Gets_LLU --
--------------
procedure Gets_LLU
(From : String;
Item : out Long_Long_Unsigned;
Last : out Positive)
is
Pos : aliased Integer;
begin
String_Skip (From, Pos);
Item := Scan_Long_Long_Unsigned (From, Pos'Access, From'Last);
Last := Pos - 1;
exception
when Constraint_Error =>
raise Data_Error;
end Gets_LLU;
--------------
-- Gets_Uns --
--------------
procedure Gets_Uns
(From : String;
Item : out Unsigned;
Last : out Positive)
is
Pos : aliased Integer;
begin
String_Skip (From, Pos);
Item := Scan_Unsigned (From, Pos'Access, From'Last);
Last := Pos - 1;
exception
when Constraint_Error =>
raise Data_Error;
end Gets_Uns;
------------------
-- Load_Modular --
------------------
procedure Load_Modular
(File : File_Type;
Buf : out String;
Ptr : in out Natural)
is
Hash_Loc : Natural;
Loaded : Boolean;
begin
Load_Skip (File);
-- Note: it is a bit strange to allow a minus sign here, but it seems
-- consistent with the general behavior expected by the ACVC tests
-- which is to scan past junk and then signal data error, see ACVC
-- test CE3704F, case (6), which is for signed integer exponents,
-- which seems a similar case.
Load (File, Buf, Ptr, '+', '-');
Load_Digits (File, Buf, Ptr, Loaded);
if Loaded then
Load (File, Buf, Ptr, '#', ':', Loaded);
if Loaded then
Hash_Loc := Ptr;
Load_Extended_Digits (File, Buf, Ptr);
Load (File, Buf, Ptr, Buf (Hash_Loc));
end if;
Load (File, Buf, Ptr, 'E', 'e', Loaded);
if Loaded then
-- Note: it is strange to allow a minus sign, since the syntax
-- does not, but that is what ACVC test CE3704F, case (6) wants
-- for the signed case, and there seems no good reason to treat
-- exponents differently for the signed and unsigned cases.
Load (File, Buf, Ptr, '+', '-');
Load_Digits (File, Buf, Ptr);
end if;
end if;
end Load_Modular;
-------------
-- Put_LLU --
-------------
procedure Put_LLU
(File : File_Type;
Item : Long_Long_Unsigned;
Width : Field;
Base : Number_Base)
is
Buf : String (1 .. Field'Last);
Ptr : Natural := 0;
begin
if Base = 10 and then Width = 0 then
Set_Image_Long_Long_Unsigned (Item, Buf, Ptr);
elsif Base = 10 then
Set_Image_Width_Long_Long_Unsigned (Item, Width, Buf, Ptr);
else
Set_Image_Based_Long_Long_Unsigned (Item, Base, Width, Buf, Ptr);
end if;
Put_Item (File, Buf (1 .. Ptr));
end Put_LLU;
-------------
-- Put_Uns --
-------------
procedure Put_Uns
(File : File_Type;
Item : Unsigned;
Width : Field;
Base : Number_Base)
is
Buf : String (1 .. Field'Last);
Ptr : Natural := 0;
begin
if Base = 10 and then Width = 0 then
Set_Image_Unsigned (Item, Buf, Ptr);
elsif Base = 10 then
Set_Image_Width_Unsigned (Item, Width, Buf, Ptr);
else
Set_Image_Based_Unsigned (Item, Base, Width, Buf, Ptr);
end if;
Put_Item (File, Buf (1 .. Ptr));
end Put_Uns;
--------------
-- Puts_LLU --
--------------
procedure Puts_LLU
(To : out String;
Item : Long_Long_Unsigned;
Base : Number_Base)
is
Buf : String (1 .. Field'Last);
Ptr : Natural := 0;
begin
if Base = 10 then
Set_Image_Width_Long_Long_Unsigned (Item, To'Length, Buf, Ptr);
else
Set_Image_Based_Long_Long_Unsigned (Item, Base, To'Length, Buf, Ptr);
end if;
if Ptr > To'Length then
raise Layout_Error;
else
To (To'First .. To'First + Ptr - 1) := Buf (1 .. Ptr);
end if;
end Puts_LLU;
--------------
-- Puts_Uns --
--------------
procedure Puts_Uns
(To : out String;
Item : Unsigned;
Base : Number_Base)
is
Buf : String (1 .. Field'Last);
Ptr : Natural := 0;
begin
if Base = 10 then
Set_Image_Width_Unsigned (Item, To'Length, Buf, Ptr);
else
Set_Image_Based_Unsigned (Item, Base, To'Length, Buf, Ptr);
end if;
if Ptr > To'Length then
raise Layout_Error;
else
To (To'First .. To'First + Ptr - 1) := Buf (1 .. Ptr);
end if;
end Puts_Uns;
end Ada.Wide_Text_IO.Modular_Aux;
|
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
package Program.Elements.Declarations is
pragma Pure (Program.Elements.Declarations);
type Declaration is limited interface and Program.Elements.Element;
type Declaration_Access is access all Declaration'Class
with Storage_Size => 0;
end Program.Elements.Declarations;
|
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Elements.Expressions;
with Program.Lexical_Elements;
package Program.Elements.Indexed_Components is
pragma Pure (Program.Elements.Indexed_Components);
type Indexed_Component is
limited interface and Program.Elements.Expressions.Expression;
type Indexed_Component_Access is access all Indexed_Component'Class
with Storage_Size => 0;
not overriding function Prefix
(Self : Indexed_Component)
return not null Program.Elements.Expressions.Expression_Access
is abstract;
not overriding function Expressions
(Self : Indexed_Component)
return Program.Elements.Expressions.Expression_Vector_Access is abstract;
type Indexed_Component_Text is limited interface;
type Indexed_Component_Text_Access is
access all Indexed_Component_Text'Class with Storage_Size => 0;
not overriding function To_Indexed_Component_Text
(Self : in out Indexed_Component)
return Indexed_Component_Text_Access is abstract;
not overriding function Left_Bracket_Token
(Self : Indexed_Component_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Right_Bracket_Token
(Self : Indexed_Component_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
end Program.Elements.Indexed_Components;
|
-- Copyright 2008-2019 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
procedure Comp_Bug is
type Number_T (Exists : Boolean := False) is
record
case Exists is
when True =>
Value : Natural range 0 .. 255;
when False =>
null;
end case;
end record;
pragma Pack (Number_T);
X : Number_T;
-- brobecker/2007-09-06: At the time when this issue (G904-017) was
-- reported, the problem only reproduced if the variable was declared
-- inside a function (in other words, stored on stack). Although
-- the issue probably still existed when I tried moving this variable
-- to a package spec, the symptoms inside GDB disappeared.
begin
X := (Exists => True, Value => 10);
if X.Exists then -- STOP
X.Value := X.Value + 1;
end if;
end Comp_Bug;
|
<?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></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></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_32_real/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_32_real/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></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_32_real/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_32_real/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></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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_5</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_6</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_8_0_phi</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/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_32_real/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_8_1_phi</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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_32_real/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="-1"></fsm>
<res class_id="-1"></res>
<node_label_latency class_id="26" tracking_level="0" version="0">
<count>43</count>
<item_version>0</item_version>
<item class_id="27" tracking_level="0" version="0">
<first>7</first>
<second class_id="28" 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="29" tracking_level="0" version="0">
<count>12</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="0" version="0">
<first>10</first>
<second class_id="31" 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="32" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="33" tracking_level="1" version="0" object_id="_183">
<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="34" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="35" 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="36" 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="37" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_port_io_nodes>
<port2core class_id="38" 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>
|
pragma Ada_2012;
limited with Protypo.Api.Engine_Values.Handlers;
package Protypo.Api.Engine_Values is
use Ada.Strings.Unbounded;
type Engine_Value_Class is
(
Void,
Int,
Real,
Text,
Array_Handler,
Record_Handler,
Ambivalent_Handler,
Function_Handler,
Reference_Handler,
Constant_Handler,
Iterator
);
subtype Scalar_Classes is Engine_Value_Class range Int .. Text;
subtype Numeric_Classes is Scalar_Classes range Int .. Real;
subtype Handler_Classes is Engine_Value_Class range Array_Handler .. Constant_Handler;
type Engine_Value (Class : Engine_Value_Class) is private;
Void_Value : constant Engine_Value;
subtype Integer_Value is Engine_Value (Int);
subtype Real_Value is Engine_Value (Real);
subtype String_Value is Engine_Value (Text);
subtype Array_Value is Engine_Value (Array_Handler);
subtype Record_Value is Engine_Value (Record_Handler);
subtype Ambivalent_Value is Engine_Value (Ambivalent_Handler);
subtype Iterator_Value is Engine_Value (Iterator);
subtype Function_Value is Engine_Value (Function_Handler);
subtype Reference_Value is Engine_Value (Reference_Handler);
subtype Constant_Value is Engine_Value (Constant_Handler);
subtype Handler_Value is Engine_Value
with Dynamic_Predicate => (Handler_Value.Class in Array_Handler .. Constant_Handler);
function Is_Scalar (X : Engine_Value) return Boolean
is (X.Class in Scalar_Classes);
function Is_Numeric (X : Engine_Value) return Boolean
is (X.Class in Numeric_Classes);
function Is_Handler (X : Engine_Value) return Boolean
is (X.Class in Handler_Classes);
function Mixed_Numeric (X, Y : Numeric_Classes) return Numeric_Classes
is (if X = Y then X else Real);
-- Function used in contracts. Return the highest common numeric
-- class between X and Y (Int if both are integers, Real otherwise)
function Compatible_Scalars (X, Y : Engine_Value) return Boolean
is ((X.Class = Text and Y.Class = Text) or (Is_Numeric (X) and Is_Numeric (Y)))
with Pre => Is_Scalar (X) and Is_Scalar (Y);
-- Function used in contract to express the fact that X and Y are
-- compatible, that is, they are both text or numeric.
function Identity (X : Engine_Value) return Engine_Value
is (X);
-- Strange this function, uh? Well, it is convenient to instantiate
-- generic wrapper packages. See, for example, Array_Wrappers
function "-" (X : Engine_Value) return Engine_Value
with Pre => Is_Numeric (X),
Post => X.Class = "-"'Result.Class;
function "not" (X : Engine_Value) return Integer_Value
with Pre => Is_Numeric (X);
function "mod" (X, Y : Integer_Value) return Integer_Value;
function "+" (Left, Right : Engine_Value) return Engine_Value
with
Pre =>
(Left.Class = Text and Right.Class = Text)
or (Is_Numeric (Left) and Is_Numeric (Right)),
Post =>
"+"'Result.Class = (if Is_Numeric (Left)
then
Mixed_Numeric (Left.Class, Right.Class)
else
Text);
function "-" (Left, Right : Engine_Value) return Engine_Value
with Pre => Is_Numeric (Left) and Is_Numeric (Right),
Post => "-"'Result.Class = Mixed_Numeric (Left.Class, Right.Class);
function "*" (Left, Right : Engine_Value) return Engine_Value
with Pre => Is_Numeric (Left) and Is_Numeric (Right),
Post => "*"'Result.Class = Mixed_Numeric (Left.Class, Right.Class);
function "/" (Left, Right : Engine_Value) return Engine_Value
with Pre => Is_Numeric (Left) and Is_Numeric (Right),
Post => "/"'Result.Class = Mixed_Numeric (Left.Class, Right.Class);
function "=" (Left, Right : Engine_Value) return Integer_Value
with Pre => Compatible_Scalars (Left, Right);
function "/=" (Left, Right : Engine_Value) return Integer_Value
with Pre => Compatible_Scalars (Left, Right);
function "<" (Left, Right : Engine_Value) return Integer_Value
with Pre => Compatible_Scalars (Left, Right);
function "<=" (Left, Right : Engine_Value) return Integer_Value
with Pre => Compatible_Scalars (Left, Right);
function ">" (Left, Right : Engine_Value) return Integer_Value
with Pre => Compatible_Scalars (Left, Right);
function ">=" (Left, Right : Engine_Value) return Integer_Value
with Pre => Compatible_Scalars (Left, Right);
function "and" (Left, Right : Integer_Value) return Integer_Value;
function "or" (Left, Right : Integer_Value) return Integer_Value;
function "xor" (Left, Right : Integer_Value) return Integer_Value;
function Create (Val : Integer) return Integer_Value;
function Create (Val : Float) return Real_Value;
function Create (Val : String) return String_Value;
function Create (Val : Unbounded_String) return String_Value;
function Create (Val : Boolean) return Integer_Value;
function Get_Integer (Val : Integer_Value) return Integer;
function Get_Integer (Val : Engine_Value; Default : Integer) return Integer;
function Get_Boolean (Val : Integer_Value) return Boolean;
function Get_Float (Val : Real_Value) return Float;
function Get_Float (Val : Engine_Value; Default : Float) return Float;
function Get_String (Val : String_Value) return String;
function Get_String (Val : Engine_Value; Default : String) return String;
private
-- type Engine_Value_Vector is range 1 .. 2;
type Engine_Value (Class : Engine_Value_Class) is
record
case Class is
when Void =>
null;
when Int =>
Int_Val : Integer;
when Real =>
Real_Val : Float;
when Text =>
Text_Val : Unbounded_String;
when Array_Handler =>
Array_Object : access Handlers.Array_Interface;
when Record_Handler =>
Record_Object : access Handlers.Record_Interface;
when Ambivalent_Handler =>
Ambivalent_Object : access Handlers.Ambivalent_Interface;
when Iterator =>
Iteration_Object : access Handlers.Iterator_Interface;
when Function_Handler =>
Function_Object : access Handlers.Function_Interface;
when Reference_Handler =>
Reference_Object : access Handlers.Reference_Interface;
when Constant_Handler =>
Constant_Object : access Handlers.Constant_Interface;
end case;
end record;
Void_Value : constant Engine_Value := (Class => Void);
function Bool (X : Integer) return Integer
is (if X /= 0 then 1 else 0);
function Bool (X : Float) return Integer
is (if X /= 0.0 then 1 else 0);
function Bool (X : Engine_Value) return Integer
is (case X.Class is
when Int => Bool (Get_Integer (X)),
when Real => Bool (Get_Float (X)),
when others => raise Constraint_Error);
function Real (X : Engine_Value) return Float
is (case X.Class is
when Int => Float (Get_Integer (X)),
when Real => Get_Float (X),
when others => raise Constraint_Error);
function Create (Val : Integer) return Integer_Value
is (Engine_Value'(Class => Int,
Int_Val => Val));
function Create (Val : Float) return Real_Value
is (Engine_Value'(Class => Real,
Real_Val => Val));
function Create (Val : String) return String_Value
is (Engine_Value'(Class => Text,
Text_Val => To_Unbounded_String (Val)));
function Create (Val : Unbounded_String) return String_Value
is (Create (To_String (Val)));
function Create (Val : Boolean) return Integer_Value
is (Engine_Value'(Class => Int,
Int_Val => (if Val then 1 else 0)));
function Get_Integer (Val : Integer_Value) return Integer
is (Val.Int_Val);
function Get_Integer (Val : Engine_Value; Default : Integer) return Integer
is (case Val.Class is
when Void =>
Default,
when Int =>
Val.Int_Val,
when others =>
raise Constraint_Error);
function Get_Float (Val : Real_Value) return Float
is (Val.Real_Val);
function Get_Float (Val : Engine_Value; Default : Float) return Float
is (case Val.Class is
when Void =>
Default,
when Int =>
Float (Val.Int_Val),
when Real =>
Val.Real_Val,
when others =>
raise Constraint_Error);
function Get_String (Val : String_Value) return String
is (To_String (Val.Text_Val));
function Get_String (Val : Engine_Value; Default : String) return String
is (case Val.Class is
when Void =>
Default,
when Text =>
Get_String (Val),
when others =>
raise Constraint_Error);
function Get_Boolean (Val : Integer_Value) return Boolean
is ((if Val.Int_Val = 0 then False else True));
function "-" (Left, Right : Engine_Value) return Engine_Value
is (Left + (-Right));
function "/=" (Left, Right : Engine_Value) return Integer_Value
is (not (Left = Right));
function ">" (Left, Right : Engine_Value) return Integer_Value
is (Right < Left);
function "<=" (Left, Right : Engine_Value) return Integer_Value
is (Right >= Left);
function ">=" (Left, Right : Engine_Value) return Integer_Value
is (not (Left < Right));
end Protypo.Api.Engine_Values;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010, 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$
------------------------------------------------------------------------------
package body FastCGI.Requests.Internals is
------------
-- Create --
------------
function Create
(Descriptor : Matreshka.FastCGI.Descriptor_Access)
return Request is
begin
return
(Descriptor => Descriptor,
In_Stream =>
new Input_Stream'
(Ada.Streams.Root_Stream_Type with Descriptor => Descriptor));
end Create;
end FastCGI.Requests.Internals;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 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$
------------------------------------------------------------------------------
with Asis;
with Engines.Contexts;
with League.Strings;
package Properties.Statements.Exit_Statement is
function Code
(Engine : access Engines.Contexts.Context;
Element : Asis.Expression;
Name : Engines.Text_Property) return League.Strings.Universal_String;
end Properties.Statements.Exit_Statement;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . S T O R A G E _ E L E M E N T S --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
pragma Compiler_Unit_Warning;
with Ada.Unchecked_Conversion;
package body System.Storage_Elements is
pragma Suppress (All_Checks);
-- Conversion to/from address
-- Note qualification below of To_Address to avoid ambiguities on VMS
function To_Address is
new Ada.Unchecked_Conversion (Storage_Offset, Address);
function To_Offset is
new Ada.Unchecked_Conversion (Address, Storage_Offset);
-- Conversion to/from integers
-- These functions must be place first because they are inlined_always
-- and are used and inlined in other subprograms defined in this unit.
----------------
-- To_Address --
----------------
function To_Address (Value : Integer_Address) return Address is
begin
return Address (Value);
end To_Address;
----------------
-- To_Integer --
----------------
function To_Integer (Value : Address) return Integer_Address is
begin
return Integer_Address (Value);
end To_Integer;
-- Address arithmetic
---------
-- "+" --
---------
function "+" (Left : Address; Right : Storage_Offset) return Address is
begin
return Storage_Elements.To_Address
(To_Integer (Left) + To_Integer (To_Address (Right)));
end "+";
function "+" (Left : Storage_Offset; Right : Address) return Address is
begin
return Storage_Elements.To_Address
(To_Integer (To_Address (Left)) + To_Integer (Right));
end "+";
---------
-- "-" --
---------
function "-" (Left : Address; Right : Storage_Offset) return Address is
begin
return Storage_Elements.To_Address
(To_Integer (Left) - To_Integer (To_Address (Right)));
end "-";
function "-" (Left, Right : Address) return Storage_Offset is
begin
return To_Offset (Storage_Elements.To_Address
(To_Integer (Left) - To_Integer (Right)));
end "-";
-----------
-- "mod" --
-----------
function "mod"
(Left : Address;
Right : Storage_Offset) return Storage_Offset
is
begin
if Right > 0 then
return Storage_Offset
(To_Integer (Left) mod Integer_Address (Right));
-- The negative case makes no sense since it is a case of a mod where
-- the left argument is unsigned and the right argument is signed. In
-- accordance with the (spirit of the) permission of RM 13.7.1(16),
-- we raise CE, and also include the zero case here. Yes, the RM says
-- PE, but this really is so obviously more like a constraint error.
else
raise Constraint_Error;
end if;
end "mod";
end System.Storage_Elements;
|
-- { dg-do run }
with System;
procedure SSO4 is
type Short_Int is mod 2**16;
type Rec1 is record
F1 : Short_Int;
F2 : Short_Int;
end record;
for Rec1 use record
F1 at 0 range 0 .. 15;
F2 at 0 range 16 .. 31;
end record;
for Rec1'Bit_Order use System.High_Order_First;
for Rec1'Scalar_Storage_Order use System.High_Order_First;
type Rec2 is record
I1 : Integer;
R1 : Rec1;
end record;
for Rec2 use record
I1 at 0 range 0 .. 31;
R1 at 4 range 0 .. 31;
end record;
for Rec2'Bit_Order use System.High_Order_First;
for Rec2'Scalar_Storage_Order use System.High_Order_First;
type Rec3 is record
Data : Rec1;
end record;
for Rec3 use record
Data at 0 range 0 .. 31;
end record;
for Rec3'Bit_Order use System.High_Order_First;
for Rec3'Scalar_Storage_Order use System.High_Order_First;
procedure Copy (Message : in Rec3) is
Local : Rec2;
begin
Local := (I1 => 1, R1 => Message.Data);
if Local.R1 /= Message.Data then
raise Program_Error;
end if;
end;
Message : Rec3;
begin
Message := (Data => (2, 3));
Copy(Message);
end;
|
with AUnit;
with AUnit.Simple_Test_Cases;
with kv.avm.Instructions;
with kv.avm.Registers;
with kv.avm.Processors;
with kv.avm.Instances;
with kv.avm.Actors;
with kv.avm.Messages;
with kv.avm.references; use kv.avm.references;
with kv.avm.Memories;
with kv.avm.Control;
package kv.avm.Test is
type Instruction_Test_Case is abstract new AUnit.Simple_Test_Cases.Test_Case with
record
p : aliased kv.avm.Processors.Processor_Type;
i : kv.avm.Instances.Instance_Access;
c : kv.avm.Instructions.Code_Access;
f : kv.avm.Instructions.Code_Access; -- FooBar code
a : kv.avm.Actors.Actor_Access;
m : kv.avm.Memories.Memory_Type;
s : kv.avm.Control.Status_Type;
x : kv.avm.Messages.Message_Type;
end record;
procedure Set_Up (T : in out Instruction_Test_Case);
procedure Tear_Down (T : in out Instruction_Test_Case);
procedure Mem_Set
(T : in out Instruction_Test_Case;
Ref : in reference_type;
Val : in kv.avm.Registers.Register_Type);
function Mem_Get
(T : in Instruction_Test_Case;
Ref : in reference_type) return kv.avm.Registers.Register_Type;
procedure Step(T : in out Instruction_Test_Case);
type Test_1 is new Instruction_Test_Case with null record;
function Name (T : Test_1) return AUnit.Message_String;
procedure Run_Test (T : in out Test_1);
type Test_2 is new Instruction_Test_Case with null record;
function Name (T : Test_2) return AUnit.Message_String;
procedure Run_Test (T : in out Test_2);
type Test_3 is new Instruction_Test_Case with null record;
function Name (T : Test_3) return AUnit.Message_String;
procedure Run_Test (T : in out Test_3);
type Test_4 is new Instruction_Test_Case with null record;
function Name (T : Test_4) return AUnit.Message_String;
procedure Run_Test (T : in out Test_4);
type Test_4b is new Instruction_Test_Case with null record;
function Name (T : Test_4b) return AUnit.Message_String;
procedure Run_Test (T : in out Test_4b);
type Test_5 is new Instruction_Test_Case with null record;
function Name (T : Test_5) return AUnit.Message_String;
procedure Run_Test (T : in out Test_5);
type Test_6 is new Instruction_Test_Case with null record;
function Name (T : Test_6) return AUnit.Message_String;
procedure Run_Test (T : in out Test_6);
type Test_6b is new Instruction_Test_Case with null record;
function Name (T : Test_6b) return AUnit.Message_String;
procedure Run_Test (T : in out Test_6b);
type Test_7 is new Instruction_Test_Case with null record;
function Name (T : Test_7) return AUnit.Message_String;
procedure Run_Test (T : in out Test_7);
type Test_8 is new Instruction_Test_Case with null record;
function Name (T : Test_8) return AUnit.Message_String;
procedure Run_Test (T : in out Test_8);
type Machine_Test_Case is abstract new AUnit.Simple_Test_Cases.Test_Case with
record
null;
end record;
procedure Set_Up (T : in out Machine_Test_Case);
procedure Tear_Down (T : in out Machine_Test_Case);
type Test_9 is new Machine_Test_Case with null record;
function Name (T : Test_9) return AUnit.Message_String;
procedure Run_Test (T : in out Test_9);
type Test_9b is new Machine_Test_Case with null record;
function Name (T : Test_9b) return AUnit.Message_String;
procedure Run_Test (T : in out Test_9b);
type Test_9c is new Machine_Test_Case with null record;
function Name (T : Test_9c) return AUnit.Message_String;
procedure Run_Test (T : in out Test_9c);
type Test_9d is new Instruction_Test_Case with null record;
function Name (T : Test_9d) return AUnit.Message_String;
procedure Run_Test (T : in out Test_9d);
type Test_10 is new Machine_Test_Case with null record;
function Name (T : Test_10) return AUnit.Message_String;
procedure Run_Test (T : in out Test_10);
type Test_11 is new Instruction_Test_Case with null record;
function Name (T : Test_11) return AUnit.Message_String;
procedure Run_Test (T : in out Test_11);
type Test_12 is new Instruction_Test_Case with null record;
function Name (T : Test_12) return AUnit.Message_String;
procedure Run_Test (T : in out Test_12);
type Test_13 is new Instruction_Test_Case with null record;
function Name (T : Test_13) return AUnit.Message_String;
procedure Run_Test (T : in out Test_13);
type Test_14 is new Instruction_Test_Case with null record;
function Name (T : Test_14) return AUnit.Message_String;
procedure Run_Test (T : in out Test_14);
type Test_15 is new Instruction_Test_Case with null record;
function Name (T : Test_15) return AUnit.Message_String;
procedure Run_Test (T : in out Test_15);
type Test_16 is new AUnit.Simple_Test_Cases.Test_Case with null record;
function Name (T : Test_16) return AUnit.Message_String;
procedure Run_Test (T : in out Test_16);
type Test_17 is new AUnit.Simple_Test_Cases.Test_Case with null record;
function Name (T : Test_17) return AUnit.Message_String;
procedure Run_Test (T : in out Test_17);
type Test_18 is new Instruction_Test_Case with null record;
function Name (T : Test_18) return AUnit.Message_String;
procedure Run_Test (T : in out Test_18);
type Test_19 is new Instruction_Test_Case with null record;
function Name (T : Test_19) return AUnit.Message_String;
procedure Run_Test (T : in out Test_19);
type Test_20 is new Instruction_Test_Case with null record;
function Name (T : Test_20) return AUnit.Message_String;
procedure Run_Test (T : in out Test_20);
type Test_21 is new Instruction_Test_Case with null record;
function Name (T : Test_21) return AUnit.Message_String;
procedure Run_Test (T : in out Test_21);
type Test_22 is new Instruction_Test_Case with null record;
function Name (T : Test_22) return AUnit.Message_String;
procedure Run_Test (T : in out Test_22);
type Test_23 is new Instruction_Test_Case with null record;
function Name (T : Test_23) return AUnit.Message_String;
procedure Run_Test (T : in out Test_23);
type Test_24 is new Instruction_Test_Case with null record;
function Name (T : Test_24) return AUnit.Message_String;
procedure Run_Test (T : in out Test_24);
type Test_25 is new Instruction_Test_Case with null record;
function Name (T : Test_25) return AUnit.Message_String;
procedure Run_Test (T : in out Test_25);
type Test_26 is new Instruction_Test_Case with null record;
function Name (T : Test_26) return AUnit.Message_String;
procedure Run_Test (T : in out Test_26);
end kv.avm.Test;
|
with Ada.Interrupts.Names;
package Signal is
protected type Handler is
function Triggered return Boolean;
private
Signal_Received : Boolean := False;
pragma Unreserve_All_Interrupts;
procedure Handle_Int with Attach_Handler => Ada.Interrupts.Names.SIGINT;
procedure Handle_Quit with Attach_Handler => Ada.Interrupts.Names.SIGQUIT;
procedure Handle_Term with Attach_Handler => Ada.Interrupts.Names.SIGTERM;
end Handler;
end Signal;
|
-----------------------------------------------------------------------
-- hestia-ports -- Heat port control
-- Copyright (C) 2017 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 STM32;
with STM32.GPIO;
with STM32.Device;
with Hestia.Config;
package Hestia.Ports is
type Zone_Type is new Natural range 1 .. Hestia.Config.MAX_ZONES;
type Control_Type is (H_CONFORT, H_ECO, H_HORS_GEL, H_STOPPED, H_CONFORT_M1, H_CONFORT_M2);
subtype Heat_Control_Point is STM32.GPIO.GPIO_Point;
-- Heat control ports are connected to the available PWM outputs.
Zone1_Control : Heat_Control_Point renames STM32.Device.PB4;
Zone2_Control : Heat_Control_Point renames STM32.Device.PA8;
Zone3_Control : Heat_Control_Point renames STM32.Device.PH6;
Zone4_Control : Heat_Control_Point renames STM32.Device.PA15;
Zone5_Control : Heat_Control_Point renames STM32.Device.PI0;
Zone6_Control : Heat_Control_Point renames STM32.Device.PB15;
-- Set the zone.
procedure Set_Zone (Zone : in Zone_Type;
Mode : in Control_Type);
-- Initialize the heat control ports.
procedure Initialize;
private
type Zone_Control_Type is limited record
Mode : Control_Type;
Pos_Control : Heat_Control_Point;
Neg_Control : Heat_Control_Point;
end record;
type Zone_Control_Array is array (Zone_Type) of Zone_Control_Type;
end Hestia.Ports;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- A D A . I N T E R R U P T S . N A M E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1991-2020, 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 is a Solaris version of this package
-- The following signals are reserved by the run time (native threads):
-- SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGTRAP, SIGABRT, SIGINT,
-- SIGLWP, SIGWAITING, SIGCANCEL, SIGSTOP, SIGKILL
-- The following signals are reserved by the run time (FSU threads):
-- SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGTRAP, SIGTERM, SIGABRT, SIGINT,
-- SIGLWP, SIGALRM, SIGVTALRM, SIGWAITING, SIGSTOP, SIGKILL
-- The pragma Unreserve_All_Interrupts affects the following signal(s):
-- SIGINT: made available for Ada handlers
with System.OS_Interface;
package Ada.Interrupts.Names is
-- All identifiers in this unit are implementation defined
pragma Implementation_Defined;
-- Beware that the mapping of names to signals may be many-to-one. There
-- may be aliases. Also, for all signal names that are not supported on the
-- current system the value of the corresponding constant will be zero.
SIGHUP : constant Interrupt_ID :=
System.OS_Interface.SIGHUP; -- hangup
SIGINT : constant Interrupt_ID :=
System.OS_Interface.SIGINT; -- interrupt (rubout)
SIGQUIT : constant Interrupt_ID :=
System.OS_Interface.SIGQUIT; -- quit (ASCD FS)
SIGILL : constant Interrupt_ID :=
System.OS_Interface.SIGILL; -- illegal instruction (not reset)
SIGTRAP : constant Interrupt_ID :=
System.OS_Interface.SIGTRAP; -- trace trap (not reset)
SIGIOT : constant Interrupt_ID :=
System.OS_Interface.SIGIOT; -- IOT instruction
SIGABRT : constant Interrupt_ID := -- used by abort,
System.OS_Interface.SIGABRT; -- replace SIGIOT in the future
SIGEMT : constant Interrupt_ID :=
System.OS_Interface.SIGEMT; -- EMT instruction
SIGFPE : constant Interrupt_ID :=
System.OS_Interface.SIGFPE; -- floating point exception
SIGKILL : constant Interrupt_ID :=
System.OS_Interface.SIGKILL; -- kill (cannot be caught or ignored)
SIGBUS : constant Interrupt_ID :=
System.OS_Interface.SIGBUS; -- bus error
SIGSEGV : constant Interrupt_ID :=
System.OS_Interface.SIGSEGV; -- segmentation violation
SIGSYS : constant Interrupt_ID :=
System.OS_Interface.SIGSYS; -- bad argument to system call
SIGPIPE : constant Interrupt_ID := -- write on a pipe with
System.OS_Interface.SIGPIPE; -- no one to read it
SIGALRM : constant Interrupt_ID :=
System.OS_Interface.SIGALRM; -- alarm clock
SIGTERM : constant Interrupt_ID :=
System.OS_Interface.SIGTERM; -- software termination signal from kill
SIGUSR1 : constant Interrupt_ID :=
System.OS_Interface.SIGUSR1; -- user defined signal 1
SIGUSR2 : constant Interrupt_ID :=
System.OS_Interface.SIGUSR2; -- user defined signal 2
SIGCLD : constant Interrupt_ID :=
System.OS_Interface.SIGCLD; -- child status change
SIGCHLD : constant Interrupt_ID :=
System.OS_Interface.SIGCHLD; -- 4.3BSD's/POSIX name for SIGCLD
SIGWINCH : constant Interrupt_ID :=
System.OS_Interface.SIGWINCH; -- window size change
SIGURG : constant Interrupt_ID :=
System.OS_Interface.SIGURG; -- urgent condition on IO channel
SIGPOLL : constant Interrupt_ID :=
System.OS_Interface.SIGPOLL; -- pollable event occurred
SIGIO : constant Interrupt_ID := -- input/output possible,
System.OS_Interface.SIGIO; -- SIGPOLL alias (Solaris)
SIGSTOP : constant Interrupt_ID :=
System.OS_Interface.SIGSTOP; -- stop (cannot be caught or ignored)
SIGTSTP : constant Interrupt_ID :=
System.OS_Interface.SIGTSTP; -- user stop requested from tty
SIGCONT : constant Interrupt_ID :=
System.OS_Interface.SIGCONT; -- stopped process has been continued
SIGTTIN : constant Interrupt_ID :=
System.OS_Interface.SIGTTIN; -- background tty read attempted
SIGTTOU : constant Interrupt_ID :=
System.OS_Interface.SIGTTOU; -- background tty write attempted
SIGVTALRM : constant Interrupt_ID :=
System.OS_Interface.SIGVTALRM; -- virtual timer expired
SIGPROF : constant Interrupt_ID :=
System.OS_Interface.SIGPROF; -- profiling timer expired
SIGXCPU : constant Interrupt_ID :=
System.OS_Interface.SIGXCPU; -- CPU time limit exceeded
SIGXFSZ : constant Interrupt_ID :=
System.OS_Interface.SIGXFSZ; -- filesize limit exceeded
SIGPWR : constant Interrupt_ID :=
System.OS_Interface.SIGPWR; -- power-fail restart
SIGWAITING : constant Interrupt_ID :=
System.OS_Interface.SIGWAITING; -- process's lwps blocked (Solaris)
SIGLWP : constant Interrupt_ID :=
System.OS_Interface.SIGLWP; -- used by thread library (Solaris)
SIGFREEZE : constant Interrupt_ID :=
System.OS_Interface.SIGFREEZE; -- used by CPR (Solaris)
-- what is CPR????
SIGTHAW : constant Interrupt_ID :=
System.OS_Interface.SIGTHAW; -- used by CPR (Solaris)
SIGCANCEL : constant Interrupt_ID :=
System.OS_Interface.SIGCANCEL; -- used for thread cancel (Solaris)
end Ada.Interrupts.Names;
|
--
-- Copyright (C) 2022 Jeremy Grosser <jeremy@synack.me>
--
-- SPDX-License-Identifier: BSD-3-Clause
--
with GNAT.OS_Lib;
with System;
package body Epoll is
function epoll_create1
(flags : int)
return Epoll_Descriptor
with Import => True,
Convention => C,
External_Name => "epoll_create1";
function epoll_ctl
(epfd : Epoll_Descriptor;
op : Epoll_Operation;
fd : int;
event : access Epoll_Event)
return int
with Import => True,
Convention => C,
External_Name => "epoll_ctl";
function epoll_wait
(epfd : Epoll_Descriptor;
events : System.Address;
maxevents : int;
timeout : int)
return int
with Import => True,
Convention => C,
External_Name => "epoll_wait";
function Create
return Epoll_Descriptor
is
begin
return epoll_create1 (0);
end Create;
procedure Control
(This : Epoll_Descriptor;
Socket : Socket_Type;
Op : Epoll_Operation;
Event : access Epoll_Event)
is
begin
if epoll_ctl (This, Op, int (To_C (Socket)), Event) = -1 then
raise Epoll_Error with GNAT.OS_Lib.Errno_Message;
end if;
end Control;
function Wait
(This : Epoll_Descriptor;
Max_Events : Positive := 1;
Timeout : Integer := -1)
return Epoll_Events
is
E : aliased Epoll_Events (1 .. Max_Events);
Status : int;
begin
Status := epoll_wait (This, E'Address, int (Max_Events), int (Timeout));
if Status = -1 then
raise Epoll_Error with GNAT.OS_Lib.Errno_Message;
end if;
return E (E'First .. Integer (Status));
end Wait;
end Epoll;
|
-- This file is covered by the Internet Software Consortium (ISC) License
-- Reference: ../License.txt
package AdaBase is
pragma Pure;
type Error_Modes is (silent, warning, raise_exception);
type Case_Modes is (lower_case, natural_case, upper_case);
type Trax_Isolation is (read_uncommitted, read_committed, repeatable_read,
serializable);
type Log_Category is (connecting, disconnecting, transaction, execution,
statement_preparation, statement_execution,
miscellaneous, note);
type Driver_Type is (foundation, driver_mysql, driver_postgresql,
driver_sqlite, driver_firebird);
type Null_Priority is (native, nulls_first, nulls_last);
type ISO_Keyword_List is array (Trax_Isolation) of String (1 .. 16);
type Trax_ID is mod 2 ** 64;
subtype BLOB_Maximum is Positive range 2 ** 12 .. 2 ** 30;
subtype SQL_State is String (1 .. 5);
subtype Driver_Codes is Integer range -999 .. 4999;
subtype Posix_Port is Natural range 0 .. 65535;
subtype Affected_Rows is Trax_ID;
ISO_Keywords : constant ISO_Keyword_List :=
("READ UNCOMMITTED",
"READ COMMITTED ",
"REPEATABLE READ ",
"SERIALIZABLE ");
blankstring : constant String := "";
stateless : constant SQL_State := " ";
portless : constant Posix_Port := 0;
type field_types is (ft_nbyte0, ft_nbyte1, ft_nbyte2, ft_nbyte3, ft_nbyte4,
ft_nbyte8, ft_byte1, ft_byte2, ft_byte3, ft_byte4,
ft_byte8, ft_real9, ft_real18, ft_textual, ft_widetext,
ft_supertext, ft_timestamp, ft_chain, ft_enumtype,
ft_settype, ft_bits, ft_utf8, ft_geometry);
ERRMODE_EXCEPTION : exception;
end AdaBase;
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="15">
<syndb class_id="0" tracking_level="0" version="0">
<userIPLatency>-1</userIPLatency>
<userIPName/>
<cdfg class_id="1" tracking_level="1" version="0" object_id="_0">
<name>getColorDistance_Str</name>
<ret_bitwidth>12</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>pixel_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/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>24</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>color_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>17</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>72</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_3">
<Value>
<Obj>
<type>0</type>
<id>4</id>
<name>color_V_read</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>17</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>78</item>
<item>79</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_4">
<Value>
<Obj>
<type>0</type>
<id>5</id>
<name>pixel_V_read</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>24</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>81</item>
<item>82</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_5">
<Value>
<Obj>
<type>0</type>
<id>6</id>
<name>pixelRed_V</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="11" tracking_level="0" version="0">
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</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>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>32</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>pixelRed.V</originalName>
<rtlName>pixelRed_V_fu_93_p4</rtlName>
<coreName/>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>84</item>
<item>85</item>
<item>87</item>
<item>89</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_6">
<Value>
<Obj>
<type>0</type>
<id>7</id>
<name>pixelGreen_V</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>33</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>33</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>pixelGreen.V</originalName>
<rtlName>pixelGreen_V_fu_103_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>90</item>
</oprand_edges>
<opcode>trunc</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_7">
<Value>
<Obj>
<type>0</type>
<id>8</id>
<name>pixelBlue_V</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>34</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>34</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>pixelBlue.V</originalName>
<rtlName>pixelBlue_V_fu_107_p4</rtlName>
<coreName/>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>91</item>
<item>92</item>
<item>94</item>
<item>96</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_8">
<Value>
<Obj>
<type>0</type>
<id>9</id>
<name>rhs_V</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>35</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>35</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>rhs.V</originalName>
<rtlName>rhs_V_fu_117_p3</rtlName>
<coreName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>98</item>
<item>99</item>
<item>100</item>
</oprand_edges>
<opcode>bitselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_9">
<Value>
<Obj>
<type>0</type>
<id>10</id>
<name>colorGreen_V</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>36</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>36</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>colorGreen.V</originalName>
<rtlName>colorGreen_V_fu_125_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>101</item>
</oprand_edges>
<opcode>trunc</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_10">
<Value>
<Obj>
<type>0</type>
<id>11</id>
<name>colorBlue_V</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>37</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>37</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>colorBlue.V</originalName>
<rtlName>colorBlue_V_fu_129_p4</rtlName>
<coreName/>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>103</item>
<item>104</item>
<item>105</item>
<item>106</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_11">
<Value>
<Obj>
<type>0</type>
<id>12</id>
<name>lhs_V</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>39</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>lhs.V</originalName>
<rtlName>lhs_V_fu_139_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>9</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>107</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_12">
<Value>
<Obj>
<type>0</type>
<id>13</id>
<name>rhs_V_cast</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>39</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>rhs_V_cast_fu_143_p3</rtlName>
<coreName/>
</Obj>
<bitwidth>9</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>108</item>
<item>110</item>
<item>112</item>
</oprand_edges>
<opcode>select</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_13">
<Value>
<Obj>
<type>0</type>
<id>14</id>
<name>r_V</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>39</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>r.V</originalName>
<rtlName>r_V_fu_151_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>9</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>113</item>
<item>114</item>
</oprand_edges>
<opcode>sub</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_14">
<Value>
<Obj>
<type>0</type>
<id>15</id>
<name>number_assign_cast</name>
<fileName>ColorComparator/powerFunction.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>3</lineNumber>
<contextFuncName>power</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
<item>
<first>
<first>ColorComparator/powerFunction.cpp</first>
<second>power</second>
</first>
<second>3</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>number_assign_cast_fu_195_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>18</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>115</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_15">
<Value>
<Obj>
<type>0</type>
<id>16</id>
<name>result</name>
<fileName>ColorComparator/powerFunction.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>7</lineNumber>
<contextFuncName>power</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
<item>
<first>
<first>ColorComparator/powerFunction.cpp</first>
<second>power</second>
</first>
<second>7</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>result</originalName>
<rtlName>result_fu_198_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>18</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>116</item>
<item>117</item>
</oprand_edges>
<opcode>mul</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_16">
<Value>
<Obj>
<type>0</type>
<id>17</id>
<name>result_cast6</name>
<fileName>ColorComparator/powerFunction.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>7</lineNumber>
<contextFuncName>power</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
<item>
<first>
<first>ColorComparator/powerFunction.cpp</first>
<second>power</second>
</first>
<second>7</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>result_cast6_fu_246_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>118</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>18</id>
<name>tmp</name>
<fileName>ColorComparator/powerFunction.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>7</lineNumber>
<contextFuncName>power</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
<item>
<first>
<first>ColorComparator/powerFunction.cpp</first>
<second>power</second>
</first>
<second>7</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_fu_204_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>17</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>119</item>
</oprand_edges>
<opcode>trunc</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>19</id>
<name>p_shl1</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>39</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>p_shl1_fu_249_p3</rtlName>
<coreName/>
</Obj>
<bitwidth>19</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>121</item>
<item>122</item>
<item>124</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>20</id>
<name>p_shl1_cast</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>39</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>p_shl1_cast_fu_256_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>125</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>21</id>
<name>tmp_2</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>39</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_2_fu_260_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>126</item>
<item>127</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>22</id>
<name>tmp_7</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>39</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_7_fu_266_p3</rtlName>
<coreName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>129</item>
<item>130</item>
<item>132</item>
</oprand_edges>
<opcode>bitselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_22">
<Value>
<Obj>
<type>0</type>
<id>23</id>
<name>p_neg1</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>39</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>p_neg1_fu_274_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>134</item>
<item>135</item>
</oprand_edges>
<opcode>sub</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>24</id>
<name>tmp_8</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>39</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_8_fu_280_p4</rtlName>
<coreName/>
</Obj>
<bitwidth>19</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>137</item>
<item>138</item>
<item>140</item>
<item>141</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_24">
<Value>
<Obj>
<type>0</type>
<id>25</id>
<name>tmp_cast</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>39</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_cast_fu_290_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>142</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_25">
<Value>
<Obj>
<type>0</type>
<id>26</id>
<name>tmp_1</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>39</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_1_fu_294_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>143</item>
<item>144</item>
</oprand_edges>
<opcode>sub</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_26">
<Value>
<Obj>
<type>0</type>
<id>27</id>
<name>tmp_10</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>39</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_10_fu_300_p4</rtlName>
<coreName/>
</Obj>
<bitwidth>19</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>145</item>
<item>146</item>
<item>147</item>
<item>148</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_27">
<Value>
<Obj>
<type>0</type>
<id>28</id>
<name>tmp_4_cast</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>39</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_4_cast_fu_310_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>149</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_28">
<Value>
<Obj>
<type>0</type>
<id>29</id>
<name>tmp_s</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>39</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_s_fu_314_p3</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>150</item>
<item>151</item>
<item>152</item>
</oprand_edges>
<opcode>select</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_29">
<Value>
<Obj>
<type>0</type>
<id>30</id>
<name>tmp_12</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>39</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_12_fu_433_p3</rtlName>
<coreName/>
</Obj>
<bitwidth>28</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>154</item>
<item>155</item>
<item>157</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_30">
<Value>
<Obj>
<type>0</type>
<id>31</id>
<name>p_Val2_s</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>39</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>39</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>__Val2__</originalName>
<rtlName>p_Val2_s_fu_440_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>158</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_31">
<Value>
<Obj>
<type>0</type>
<id>32</id>
<name>lhs_V_1</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>lhs.V</originalName>
<rtlName>lhs_V_1_fu_157_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>9</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>159</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_32">
<Value>
<Obj>
<type>0</type>
<id>33</id>
<name>rhs_V_1</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>rhs.V</originalName>
<rtlName>rhs_V_1_fu_161_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>9</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>160</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_33">
<Value>
<Obj>
<type>0</type>
<id>34</id>
<name>r_V_1</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>r.V</originalName>
<rtlName>r_V_1_fu_165_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>9</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>161</item>
<item>162</item>
</oprand_edges>
<opcode>sub</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_34">
<Value>
<Obj>
<type>0</type>
<id>35</id>
<name>number_assign_1_cast_1</name>
<fileName>ColorComparator/powerFunction.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>3</lineNumber>
<contextFuncName>power</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
<item>
<first>
<first>ColorComparator/powerFunction.cpp</first>
<second>power</second>
</first>
<second>3</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>14</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>163</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_35">
<Value>
<Obj>
<type>0</type>
<id>36</id>
<name>number_assign_1_cast</name>
<fileName>ColorComparator/powerFunction.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>3</lineNumber>
<contextFuncName>power</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
<item>
<first>
<first>ColorComparator/powerFunction.cpp</first>
<second>power</second>
</first>
<second>3</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>23</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>164</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_36">
<Value>
<Obj>
<type>0</type>
<id>37</id>
<name>tmp1</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp1_fu_175_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>14</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>166</item>
<item>167</item>
</oprand_edges>
<opcode>mul</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_37">
<Value>
<Obj>
<type>0</type>
<id>38</id>
<name>tmp1_cast</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>23</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>168</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_38">
<Value>
<Obj>
<type>0</type>
<id>39</id>
<name>tmp_5</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>getPixelClassificbkb_U2</rtlName>
<coreName/>
</Obj>
<bitwidth>23</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>169</item>
<item>170</item>
</oprand_edges>
<opcode>mul</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_39">
<Value>
<Obj>
<type>0</type>
<id>40</id>
<name>tmp_13</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_13_fu_214_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>21</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>171</item>
</oprand_edges>
<opcode>trunc</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_40">
<Value>
<Obj>
<type>0</type>
<id>41</id>
<name>tmp_14</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_14_reg_533</rtlName>
<coreName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>173</item>
<item>174</item>
<item>176</item>
</oprand_edges>
<opcode>bitselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_41">
<Value>
<Obj>
<type>0</type>
<id>42</id>
<name>p_neg9</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>p_neg9_fu_322_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>21</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>178</item>
<item>179</item>
</oprand_edges>
<opcode>sub</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_42">
<Value>
<Obj>
<type>0</type>
<id>43</id>
<name>tmp_15</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_15_fu_327_p4</rtlName>
<coreName/>
</Obj>
<bitwidth>19</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>181</item>
<item>182</item>
<item>184</item>
<item>186</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_43">
<Value>
<Obj>
<type>0</type>
<id>44</id>
<name>tmp_10_cast</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_10_cast_fu_337_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>187</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_44">
<Value>
<Obj>
<type>0</type>
<id>45</id>
<name>tmp_3</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_3_reg_538</rtlName>
<coreName/>
</Obj>
<bitwidth>21</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>189</item>
<item>190</item>
<item>191</item>
<item>192</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_45">
<Value>
<Obj>
<type>0</type>
<id>46</id>
<name>tmp_4</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_4_fu_341_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>193</item>
<item>194</item>
</oprand_edges>
<opcode>sub</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_46">
<Value>
<Obj>
<type>0</type>
<id>47</id>
<name>tmp_11_cast</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_11_cast_fu_347_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>21</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>195</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_47">
<Value>
<Obj>
<type>0</type>
<id>48</id>
<name>tmp_6</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_6_fu_351_p3</rtlName>
<coreName/>
</Obj>
<bitwidth>21</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>196</item>
<item>197</item>
<item>198</item>
</oprand_edges>
<opcode>select</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_48">
<Value>
<Obj>
<type>0</type>
<id>49</id>
<name>tmp_17</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_17_fu_444_p3</rtlName>
<coreName/>
</Obj>
<bitwidth>29</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>200</item>
<item>201</item>
<item>202</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_49">
<Value>
<Obj>
<type>0</type>
<id>50</id>
<name>p_Val2_1</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>40</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>__Val2__</originalName>
<rtlName>p_Val2_1_fu_451_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>203</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_50">
<Value>
<Obj>
<type>0</type>
<id>51</id>
<name>lhs_V_2</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>41</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>lhs.V</originalName>
<rtlName>lhs_V_2_fu_181_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>9</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>204</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_51">
<Value>
<Obj>
<type>0</type>
<id>52</id>
<name>rhs_V_2</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>41</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>rhs.V</originalName>
<rtlName>rhs_V_2_fu_185_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>9</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>205</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_52">
<Value>
<Obj>
<type>0</type>
<id>53</id>
<name>r_V_2</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>41</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>r.V</originalName>
<rtlName>r_V_2_fu_189_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>9</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>206</item>
<item>207</item>
</oprand_edges>
<opcode>sub</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_53">
<Value>
<Obj>
<type>0</type>
<id>54</id>
<name>number_assign_2_cast</name>
<fileName>ColorComparator/powerFunction.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>3</lineNumber>
<contextFuncName>power</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
<item>
<first>
<first>ColorComparator/powerFunction.cpp</first>
<second>power</second>
</first>
<second>3</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>number_assign_2_cast_fu_233_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>18</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>208</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_54">
<Value>
<Obj>
<type>0</type>
<id>55</id>
<name>result_1</name>
<fileName>ColorComparator/powerFunction.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>7</lineNumber>
<contextFuncName>power</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
<item>
<first>
<first>ColorComparator/powerFunction.cpp</first>
<second>power</second>
</first>
<second>7</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>result</originalName>
<rtlName>result_1_fu_236_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>18</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>209</item>
<item>210</item>
</oprand_edges>
<opcode>mul</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_55">
<Value>
<Obj>
<type>0</type>
<id>56</id>
<name>result_2_cast3</name>
<fileName>ColorComparator/powerFunction.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>7</lineNumber>
<contextFuncName>power</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
<item>
<first>
<first>ColorComparator/powerFunction.cpp</first>
<second>power</second>
</first>
<second>7</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>result_2_cast3_fu_357_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>211</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_56">
<Value>
<Obj>
<type>0</type>
<id>57</id>
<name>tmp_18</name>
<fileName>ColorComparator/powerFunction.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>7</lineNumber>
<contextFuncName>power</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
<item>
<first>
<first>ColorComparator/powerFunction.cpp</first>
<second>power</second>
</first>
<second>7</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_18_fu_242_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>17</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>212</item>
</oprand_edges>
<opcode>trunc</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_57">
<Value>
<Obj>
<type>0</type>
<id>58</id>
<name>p_shl</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>41</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>p_shl_fu_360_p3</rtlName>
<coreName/>
</Obj>
<bitwidth>19</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>213</item>
<item>214</item>
<item>215</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_58">
<Value>
<Obj>
<type>0</type>
<id>59</id>
<name>p_shl_cast</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>41</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>p_shl_cast_fu_367_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>216</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_59">
<Value>
<Obj>
<type>0</type>
<id>60</id>
<name>tmp_9</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>41</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_9_fu_371_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>217</item>
<item>218</item>
</oprand_edges>
<opcode>sub</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_60">
<Value>
<Obj>
<type>0</type>
<id>61</id>
<name>tmp_19</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>41</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_19_fu_377_p3</rtlName>
<coreName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>219</item>
<item>220</item>
<item>221</item>
</oprand_edges>
<opcode>bitselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_61">
<Value>
<Obj>
<type>0</type>
<id>62</id>
<name>p_neg</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>41</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>p_neg_fu_385_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>222</item>
<item>223</item>
</oprand_edges>
<opcode>sub</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_62">
<Value>
<Obj>
<type>0</type>
<id>63</id>
<name>tmp_20</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>41</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_20_fu_391_p4</rtlName>
<coreName/>
</Obj>
<bitwidth>19</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>224</item>
<item>225</item>
<item>226</item>
<item>227</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_63">
<Value>
<Obj>
<type>0</type>
<id>64</id>
<name>tmp_14_cast</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>41</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_14_cast_fu_401_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>228</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_64">
<Value>
<Obj>
<type>0</type>
<id>65</id>
<name>tmp_11</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>41</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_11_fu_405_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>229</item>
<item>230</item>
</oprand_edges>
<opcode>sub</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_65">
<Value>
<Obj>
<type>0</type>
<id>66</id>
<name>tmp_21</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>41</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_21_fu_411_p4</rtlName>
<coreName/>
</Obj>
<bitwidth>19</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>231</item>
<item>232</item>
<item>233</item>
<item>234</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_66">
<Value>
<Obj>
<type>0</type>
<id>67</id>
<name>tmp_17_cast</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>41</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_17_cast_fu_421_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>235</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_67">
<Value>
<Obj>
<type>0</type>
<id>68</id>
<name>tmp_16</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>41</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_16_fu_425_p3</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>236</item>
<item>237</item>
<item>238</item>
</oprand_edges>
<opcode>select</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_68">
<Value>
<Obj>
<type>0</type>
<id>69</id>
<name>tmp_22</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>41</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_22_fu_455_p3</rtlName>
<coreName/>
</Obj>
<bitwidth>28</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>239</item>
<item>240</item>
<item>241</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_69">
<Value>
<Obj>
<type>0</type>
<id>70</id>
<name>p_Val2_2</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>41</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>41</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>__Val2__</originalName>
<rtlName>p_Val2_2_fu_462_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>242</item>
</oprand_edges>
<opcode>sext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_70">
<Value>
<Obj>
<type>0</type>
<id>71</id>
<name>tmp2</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>42</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>42</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp2_fu_466_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>243</item>
<item>244</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_71">
<Value>
<Obj>
<type>0</type>
<id>72</id>
<name>powerSummation_V</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>42</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>42</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>powerSummation.V</originalName>
<rtlName>grp_fxp_sqrt_fu_88_in_val_V_read</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>245</item>
<item>246</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_72">
<Value>
<Obj>
<type>0</type>
<id>73</id>
<name>result_V</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>44</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>44</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>grp_fxp_sqrt_fu_88</rtlName>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>248</item>
<item>249</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_73">
<Value>
<Obj>
<type>0</type>
<id>74</id>
<name>tmp_23</name>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>45</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>45</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>ap_return</rtlName>
<coreName/>
</Obj>
<bitwidth>12</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>251</item>
<item>252</item>
<item>253</item>
<item>254</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_74">
<Value>
<Obj>
<type>0</type>
<id>75</id>
<name/>
<fileName>ColorComparator/ColorComparator.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>45</lineNumber>
<contextFuncName>getColorDistance_Stream</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Jonathan\Desktop\FPGAColorIdentifier</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>ColorComparator/ColorComparator.cpp</first>
<second>getColorDistance_Stream</second>
</first>
<second>45</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>255</item>
</oprand_edges>
<opcode>ret</opcode>
<m_Display>0</m_Display>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>17</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_75">
<Value>
<Obj>
<type>2</type>
<id>86</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>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>16</content>
</item>
<item class_id_reference="16" object_id="_76">
<Value>
<Obj>
<type>2</type>
<id>88</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>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>23</content>
</item>
<item class_id_reference="16" object_id="_77">
<Value>
<Obj>
<type>2</type>
<id>93</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>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>8</content>
</item>
<item class_id_reference="16" object_id="_78">
<Value>
<Obj>
<type>2</type>
<id>95</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>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>15</content>
</item>
<item class_id_reference="16" object_id="_79">
<Value>
<Obj>
<type>2</type>
<id>109</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>9</bitwidth>
</Value>
<const_type>0</const_type>
<content>255</content>
</item>
<item class_id_reference="16" object_id="_80">
<Value>
<Obj>
<type>2</type>
<id>111</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>9</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_81">
<Value>
<Obj>
<type>2</type>
<id>123</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>2</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_82">
<Value>
<Obj>
<type>2</type>
<id>131</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>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>19</content>
</item>
<item class_id_reference="16" object_id="_83">
<Value>
<Obj>
<type>2</type>
<id>133</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>20</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_84">
<Value>
<Obj>
<type>2</type>
<id>139</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>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_85">
<Value>
<Obj>
<type>2</type>
<id>156</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>8</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_86">
<Value>
<Obj>
<type>2</type>
<id>165</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>14</bitwidth>
</Value>
<const_type>0</const_type>
<content>11</content>
</item>
<item class_id_reference="16" object_id="_87">
<Value>
<Obj>
<type>2</type>
<id>175</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>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>22</content>
</item>
<item class_id_reference="16" object_id="_88">
<Value>
<Obj>
<type>2</type>
<id>177</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="_89">
<Value>
<Obj>
<type>2</type>
<id>183</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>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>2</content>
</item>
<item class_id_reference="16" object_id="_90">
<Value>
<Obj>
<type>2</type>
<id>185</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>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>20</content>
</item>
<item class_id_reference="16" object_id="_91">
<Value>
<Obj>
<type>2</type>
<id>247</id>
<name>fxp_sqrt</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>20</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:fxp_sqrt></content>
</item>
</consts>
<blocks class_id="17" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="18" tracking_level="1" version="0" object_id="_92">
<Obj>
<type>3</type>
<id>76</id>
<name>getColorDistance_Str</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<node_objs>
<count>72</count>
<item_version>0</item_version>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
<item>12</item>
<item>13</item>
<item>14</item>
<item>15</item>
<item>16</item>
<item>17</item>
<item>18</item>
<item>19</item>
<item>20</item>
<item>21</item>
<item>22</item>
<item>23</item>
<item>24</item>
<item>25</item>
<item>26</item>
<item>27</item>
<item>28</item>
<item>29</item>
<item>30</item>
<item>31</item>
<item>32</item>
<item>33</item>
<item>34</item>
<item>35</item>
<item>36</item>
<item>37</item>
<item>38</item>
<item>39</item>
<item>40</item>
<item>41</item>
<item>42</item>
<item>43</item>
<item>44</item>
<item>45</item>
<item>46</item>
<item>47</item>
<item>48</item>
<item>49</item>
<item>50</item>
<item>51</item>
<item>52</item>
<item>53</item>
<item>54</item>
<item>55</item>
<item>56</item>
<item>57</item>
<item>58</item>
<item>59</item>
<item>60</item>
<item>61</item>
<item>62</item>
<item>63</item>
<item>64</item>
<item>65</item>
<item>66</item>
<item>67</item>
<item>68</item>
<item>69</item>
<item>70</item>
<item>71</item>
<item>72</item>
<item>73</item>
<item>74</item>
<item>75</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>127</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_93">
<id>79</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>4</sink_obj>
</item>
<item class_id_reference="20" object_id="_94">
<id>82</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>5</sink_obj>
</item>
<item class_id_reference="20" object_id="_95">
<id>85</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>6</sink_obj>
</item>
<item class_id_reference="20" object_id="_96">
<id>87</id>
<edge_type>1</edge_type>
<source_obj>86</source_obj>
<sink_obj>6</sink_obj>
</item>
<item class_id_reference="20" object_id="_97">
<id>89</id>
<edge_type>1</edge_type>
<source_obj>88</source_obj>
<sink_obj>6</sink_obj>
</item>
<item class_id_reference="20" object_id="_98">
<id>90</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>7</sink_obj>
</item>
<item class_id_reference="20" object_id="_99">
<id>92</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>8</sink_obj>
</item>
<item class_id_reference="20" object_id="_100">
<id>94</id>
<edge_type>1</edge_type>
<source_obj>93</source_obj>
<sink_obj>8</sink_obj>
</item>
<item class_id_reference="20" object_id="_101">
<id>96</id>
<edge_type>1</edge_type>
<source_obj>95</source_obj>
<sink_obj>8</sink_obj>
</item>
<item class_id_reference="20" object_id="_102">
<id>99</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>9</sink_obj>
</item>
<item class_id_reference="20" object_id="_103">
<id>100</id>
<edge_type>1</edge_type>
<source_obj>86</source_obj>
<sink_obj>9</sink_obj>
</item>
<item class_id_reference="20" object_id="_104">
<id>101</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>10</sink_obj>
</item>
<item class_id_reference="20" object_id="_105">
<id>104</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>11</sink_obj>
</item>
<item class_id_reference="20" object_id="_106">
<id>105</id>
<edge_type>1</edge_type>
<source_obj>93</source_obj>
<sink_obj>11</sink_obj>
</item>
<item class_id_reference="20" object_id="_107">
<id>106</id>
<edge_type>1</edge_type>
<source_obj>95</source_obj>
<sink_obj>11</sink_obj>
</item>
<item class_id_reference="20" object_id="_108">
<id>107</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_109">
<id>108</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>13</sink_obj>
</item>
<item class_id_reference="20" object_id="_110">
<id>110</id>
<edge_type>1</edge_type>
<source_obj>109</source_obj>
<sink_obj>13</sink_obj>
</item>
<item class_id_reference="20" object_id="_111">
<id>112</id>
<edge_type>1</edge_type>
<source_obj>111</source_obj>
<sink_obj>13</sink_obj>
</item>
<item class_id_reference="20" object_id="_112">
<id>113</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>14</sink_obj>
</item>
<item class_id_reference="20" object_id="_113">
<id>114</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>14</sink_obj>
</item>
<item class_id_reference="20" object_id="_114">
<id>115</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>15</sink_obj>
</item>
<item class_id_reference="20" object_id="_115">
<id>116</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>16</sink_obj>
</item>
<item class_id_reference="20" object_id="_116">
<id>117</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>16</sink_obj>
</item>
<item class_id_reference="20" object_id="_117">
<id>118</id>
<edge_type>1</edge_type>
<source_obj>16</source_obj>
<sink_obj>17</sink_obj>
</item>
<item class_id_reference="20" object_id="_118">
<id>119</id>
<edge_type>1</edge_type>
<source_obj>16</source_obj>
<sink_obj>18</sink_obj>
</item>
<item class_id_reference="20" object_id="_119">
<id>122</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>19</sink_obj>
</item>
<item class_id_reference="20" object_id="_120">
<id>124</id>
<edge_type>1</edge_type>
<source_obj>123</source_obj>
<sink_obj>19</sink_obj>
</item>
<item class_id_reference="20" object_id="_121">
<id>125</id>
<edge_type>1</edge_type>
<source_obj>19</source_obj>
<sink_obj>20</sink_obj>
</item>
<item class_id_reference="20" object_id="_122">
<id>126</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="20" object_id="_123">
<id>127</id>
<edge_type>1</edge_type>
<source_obj>20</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="20" object_id="_124">
<id>130</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>22</sink_obj>
</item>
<item class_id_reference="20" object_id="_125">
<id>132</id>
<edge_type>1</edge_type>
<source_obj>131</source_obj>
<sink_obj>22</sink_obj>
</item>
<item class_id_reference="20" object_id="_126">
<id>134</id>
<edge_type>1</edge_type>
<source_obj>133</source_obj>
<sink_obj>23</sink_obj>
</item>
<item class_id_reference="20" object_id="_127">
<id>135</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>23</sink_obj>
</item>
<item class_id_reference="20" object_id="_128">
<id>138</id>
<edge_type>1</edge_type>
<source_obj>23</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="20" object_id="_129">
<id>140</id>
<edge_type>1</edge_type>
<source_obj>139</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="20" object_id="_130">
<id>141</id>
<edge_type>1</edge_type>
<source_obj>131</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="20" object_id="_131">
<id>142</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_132">
<id>143</id>
<edge_type>1</edge_type>
<source_obj>133</source_obj>
<sink_obj>26</sink_obj>
</item>
<item class_id_reference="20" object_id="_133">
<id>144</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>26</sink_obj>
</item>
<item class_id_reference="20" object_id="_134">
<id>146</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>27</sink_obj>
</item>
<item class_id_reference="20" object_id="_135">
<id>147</id>
<edge_type>1</edge_type>
<source_obj>139</source_obj>
<sink_obj>27</sink_obj>
</item>
<item class_id_reference="20" object_id="_136">
<id>148</id>
<edge_type>1</edge_type>
<source_obj>131</source_obj>
<sink_obj>27</sink_obj>
</item>
<item class_id_reference="20" object_id="_137">
<id>149</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="20" object_id="_138">
<id>150</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>29</sink_obj>
</item>
<item class_id_reference="20" object_id="_139">
<id>151</id>
<edge_type>1</edge_type>
<source_obj>26</source_obj>
<sink_obj>29</sink_obj>
</item>
<item class_id_reference="20" object_id="_140">
<id>152</id>
<edge_type>1</edge_type>
<source_obj>28</source_obj>
<sink_obj>29</sink_obj>
</item>
<item class_id_reference="20" object_id="_141">
<id>155</id>
<edge_type>1</edge_type>
<source_obj>29</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="20" object_id="_142">
<id>157</id>
<edge_type>1</edge_type>
<source_obj>156</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="20" object_id="_143">
<id>158</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>31</sink_obj>
</item>
<item class_id_reference="20" object_id="_144">
<id>159</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>32</sink_obj>
</item>
<item class_id_reference="20" object_id="_145">
<id>160</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>33</sink_obj>
</item>
<item class_id_reference="20" object_id="_146">
<id>161</id>
<edge_type>1</edge_type>
<source_obj>32</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_147">
<id>162</id>
<edge_type>1</edge_type>
<source_obj>33</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_148">
<id>163</id>
<edge_type>1</edge_type>
<source_obj>34</source_obj>
<sink_obj>35</sink_obj>
</item>
<item class_id_reference="20" object_id="_149">
<id>164</id>
<edge_type>1</edge_type>
<source_obj>34</source_obj>
<sink_obj>36</sink_obj>
</item>
<item class_id_reference="20" object_id="_150">
<id>166</id>
<edge_type>1</edge_type>
<source_obj>165</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_151">
<id>167</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_152">
<id>168</id>
<edge_type>1</edge_type>
<source_obj>37</source_obj>
<sink_obj>38</sink_obj>
</item>
<item class_id_reference="20" object_id="_153">
<id>169</id>
<edge_type>1</edge_type>
<source_obj>38</source_obj>
<sink_obj>39</sink_obj>
</item>
<item class_id_reference="20" object_id="_154">
<id>170</id>
<edge_type>1</edge_type>
<source_obj>36</source_obj>
<sink_obj>39</sink_obj>
</item>
<item class_id_reference="20" object_id="_155">
<id>171</id>
<edge_type>1</edge_type>
<source_obj>39</source_obj>
<sink_obj>40</sink_obj>
</item>
<item class_id_reference="20" object_id="_156">
<id>174</id>
<edge_type>1</edge_type>
<source_obj>39</source_obj>
<sink_obj>41</sink_obj>
</item>
<item class_id_reference="20" object_id="_157">
<id>176</id>
<edge_type>1</edge_type>
<source_obj>175</source_obj>
<sink_obj>41</sink_obj>
</item>
<item class_id_reference="20" object_id="_158">
<id>178</id>
<edge_type>1</edge_type>
<source_obj>177</source_obj>
<sink_obj>42</sink_obj>
</item>
<item class_id_reference="20" object_id="_159">
<id>179</id>
<edge_type>1</edge_type>
<source_obj>40</source_obj>
<sink_obj>42</sink_obj>
</item>
<item class_id_reference="20" object_id="_160">
<id>182</id>
<edge_type>1</edge_type>
<source_obj>42</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_161">
<id>184</id>
<edge_type>1</edge_type>
<source_obj>183</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_162">
<id>186</id>
<edge_type>1</edge_type>
<source_obj>185</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_163">
<id>187</id>
<edge_type>1</edge_type>
<source_obj>43</source_obj>
<sink_obj>44</sink_obj>
</item>
<item class_id_reference="20" object_id="_164">
<id>190</id>
<edge_type>1</edge_type>
<source_obj>39</source_obj>
<sink_obj>45</sink_obj>
</item>
<item class_id_reference="20" object_id="_165">
<id>191</id>
<edge_type>1</edge_type>
<source_obj>183</source_obj>
<sink_obj>45</sink_obj>
</item>
<item class_id_reference="20" object_id="_166">
<id>192</id>
<edge_type>1</edge_type>
<source_obj>175</source_obj>
<sink_obj>45</sink_obj>
</item>
<item class_id_reference="20" object_id="_167">
<id>193</id>
<edge_type>1</edge_type>
<source_obj>133</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_168">
<id>194</id>
<edge_type>1</edge_type>
<source_obj>44</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_169">
<id>195</id>
<edge_type>1</edge_type>
<source_obj>46</source_obj>
<sink_obj>47</sink_obj>
</item>
<item class_id_reference="20" object_id="_170">
<id>196</id>
<edge_type>1</edge_type>
<source_obj>41</source_obj>
<sink_obj>48</sink_obj>
</item>
<item class_id_reference="20" object_id="_171">
<id>197</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>48</sink_obj>
</item>
<item class_id_reference="20" object_id="_172">
<id>198</id>
<edge_type>1</edge_type>
<source_obj>45</source_obj>
<sink_obj>48</sink_obj>
</item>
<item class_id_reference="20" object_id="_173">
<id>201</id>
<edge_type>1</edge_type>
<source_obj>48</source_obj>
<sink_obj>49</sink_obj>
</item>
<item class_id_reference="20" object_id="_174">
<id>202</id>
<edge_type>1</edge_type>
<source_obj>156</source_obj>
<sink_obj>49</sink_obj>
</item>
<item class_id_reference="20" object_id="_175">
<id>203</id>
<edge_type>1</edge_type>
<source_obj>49</source_obj>
<sink_obj>50</sink_obj>
</item>
<item class_id_reference="20" object_id="_176">
<id>204</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>51</sink_obj>
</item>
<item class_id_reference="20" object_id="_177">
<id>205</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>52</sink_obj>
</item>
<item class_id_reference="20" object_id="_178">
<id>206</id>
<edge_type>1</edge_type>
<source_obj>51</source_obj>
<sink_obj>53</sink_obj>
</item>
<item class_id_reference="20" object_id="_179">
<id>207</id>
<edge_type>1</edge_type>
<source_obj>52</source_obj>
<sink_obj>53</sink_obj>
</item>
<item class_id_reference="20" object_id="_180">
<id>208</id>
<edge_type>1</edge_type>
<source_obj>53</source_obj>
<sink_obj>54</sink_obj>
</item>
<item class_id_reference="20" object_id="_181">
<id>209</id>
<edge_type>1</edge_type>
<source_obj>54</source_obj>
<sink_obj>55</sink_obj>
</item>
<item class_id_reference="20" object_id="_182">
<id>210</id>
<edge_type>1</edge_type>
<source_obj>54</source_obj>
<sink_obj>55</sink_obj>
</item>
<item class_id_reference="20" object_id="_183">
<id>211</id>
<edge_type>1</edge_type>
<source_obj>55</source_obj>
<sink_obj>56</sink_obj>
</item>
<item class_id_reference="20" object_id="_184">
<id>212</id>
<edge_type>1</edge_type>
<source_obj>55</source_obj>
<sink_obj>57</sink_obj>
</item>
<item class_id_reference="20" object_id="_185">
<id>214</id>
<edge_type>1</edge_type>
<source_obj>57</source_obj>
<sink_obj>58</sink_obj>
</item>
<item class_id_reference="20" object_id="_186">
<id>215</id>
<edge_type>1</edge_type>
<source_obj>123</source_obj>
<sink_obj>58</sink_obj>
</item>
<item class_id_reference="20" object_id="_187">
<id>216</id>
<edge_type>1</edge_type>
<source_obj>58</source_obj>
<sink_obj>59</sink_obj>
</item>
<item class_id_reference="20" object_id="_188">
<id>217</id>
<edge_type>1</edge_type>
<source_obj>59</source_obj>
<sink_obj>60</sink_obj>
</item>
<item class_id_reference="20" object_id="_189">
<id>218</id>
<edge_type>1</edge_type>
<source_obj>56</source_obj>
<sink_obj>60</sink_obj>
</item>
<item class_id_reference="20" object_id="_190">
<id>220</id>
<edge_type>1</edge_type>
<source_obj>60</source_obj>
<sink_obj>61</sink_obj>
</item>
<item class_id_reference="20" object_id="_191">
<id>221</id>
<edge_type>1</edge_type>
<source_obj>131</source_obj>
<sink_obj>61</sink_obj>
</item>
<item class_id_reference="20" object_id="_192">
<id>222</id>
<edge_type>1</edge_type>
<source_obj>133</source_obj>
<sink_obj>62</sink_obj>
</item>
<item class_id_reference="20" object_id="_193">
<id>223</id>
<edge_type>1</edge_type>
<source_obj>60</source_obj>
<sink_obj>62</sink_obj>
</item>
<item class_id_reference="20" object_id="_194">
<id>225</id>
<edge_type>1</edge_type>
<source_obj>62</source_obj>
<sink_obj>63</sink_obj>
</item>
<item class_id_reference="20" object_id="_195">
<id>226</id>
<edge_type>1</edge_type>
<source_obj>139</source_obj>
<sink_obj>63</sink_obj>
</item>
<item class_id_reference="20" object_id="_196">
<id>227</id>
<edge_type>1</edge_type>
<source_obj>131</source_obj>
<sink_obj>63</sink_obj>
</item>
<item class_id_reference="20" object_id="_197">
<id>228</id>
<edge_type>1</edge_type>
<source_obj>63</source_obj>
<sink_obj>64</sink_obj>
</item>
<item class_id_reference="20" object_id="_198">
<id>229</id>
<edge_type>1</edge_type>
<source_obj>133</source_obj>
<sink_obj>65</sink_obj>
</item>
<item class_id_reference="20" object_id="_199">
<id>230</id>
<edge_type>1</edge_type>
<source_obj>64</source_obj>
<sink_obj>65</sink_obj>
</item>
<item class_id_reference="20" object_id="_200">
<id>232</id>
<edge_type>1</edge_type>
<source_obj>60</source_obj>
<sink_obj>66</sink_obj>
</item>
<item class_id_reference="20" object_id="_201">
<id>233</id>
<edge_type>1</edge_type>
<source_obj>139</source_obj>
<sink_obj>66</sink_obj>
</item>
<item class_id_reference="20" object_id="_202">
<id>234</id>
<edge_type>1</edge_type>
<source_obj>131</source_obj>
<sink_obj>66</sink_obj>
</item>
<item class_id_reference="20" object_id="_203">
<id>235</id>
<edge_type>1</edge_type>
<source_obj>66</source_obj>
<sink_obj>67</sink_obj>
</item>
<item class_id_reference="20" object_id="_204">
<id>236</id>
<edge_type>1</edge_type>
<source_obj>61</source_obj>
<sink_obj>68</sink_obj>
</item>
<item class_id_reference="20" object_id="_205">
<id>237</id>
<edge_type>1</edge_type>
<source_obj>65</source_obj>
<sink_obj>68</sink_obj>
</item>
<item class_id_reference="20" object_id="_206">
<id>238</id>
<edge_type>1</edge_type>
<source_obj>67</source_obj>
<sink_obj>68</sink_obj>
</item>
<item class_id_reference="20" object_id="_207">
<id>240</id>
<edge_type>1</edge_type>
<source_obj>68</source_obj>
<sink_obj>69</sink_obj>
</item>
<item class_id_reference="20" object_id="_208">
<id>241</id>
<edge_type>1</edge_type>
<source_obj>156</source_obj>
<sink_obj>69</sink_obj>
</item>
<item class_id_reference="20" object_id="_209">
<id>242</id>
<edge_type>1</edge_type>
<source_obj>69</source_obj>
<sink_obj>70</sink_obj>
</item>
<item class_id_reference="20" object_id="_210">
<id>243</id>
<edge_type>1</edge_type>
<source_obj>31</source_obj>
<sink_obj>71</sink_obj>
</item>
<item class_id_reference="20" object_id="_211">
<id>244</id>
<edge_type>1</edge_type>
<source_obj>70</source_obj>
<sink_obj>71</sink_obj>
</item>
<item class_id_reference="20" object_id="_212">
<id>245</id>
<edge_type>1</edge_type>
<source_obj>71</source_obj>
<sink_obj>72</sink_obj>
</item>
<item class_id_reference="20" object_id="_213">
<id>246</id>
<edge_type>1</edge_type>
<source_obj>50</source_obj>
<sink_obj>72</sink_obj>
</item>
<item class_id_reference="20" object_id="_214">
<id>248</id>
<edge_type>1</edge_type>
<source_obj>247</source_obj>
<sink_obj>73</sink_obj>
</item>
<item class_id_reference="20" object_id="_215">
<id>249</id>
<edge_type>1</edge_type>
<source_obj>72</source_obj>
<sink_obj>73</sink_obj>
</item>
<item class_id_reference="20" object_id="_216">
<id>252</id>
<edge_type>1</edge_type>
<source_obj>73</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_217">
<id>253</id>
<edge_type>1</edge_type>
<source_obj>93</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_218">
<id>254</id>
<edge_type>1</edge_type>
<source_obj>131</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_219">
<id>255</id>
<edge_type>1</edge_type>
<source_obj>74</source_obj>
<sink_obj>75</sink_obj>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="21" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="1" version="0" object_id="_220">
<mId>1</mId>
<mTag>getColorDistance_Str</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>76</item>
</basic_blocks>
<mII>1</mII>
<mDepth>16</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>15</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="_221">
<states class_id="25" tracking_level="0" version="0">
<count>16</count>
<item_version>0</item_version>
<item class_id="26" tracking_level="1" version="0" object_id="_222">
<id>1</id>
<operations class_id="27" tracking_level="0" version="0">
<count>19</count>
<item_version>0</item_version>
<item class_id="28" tracking_level="1" version="0" object_id="_223">
<id>4</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_224">
<id>5</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_225">
<id>6</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_226">
<id>7</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_227">
<id>8</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_228">
<id>9</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_229">
<id>10</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_230">
<id>11</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_231">
<id>12</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_232">
<id>13</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_233">
<id>14</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_234">
<id>32</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_235">
<id>33</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_236">
<id>34</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_237">
<id>35</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_238">
<id>37</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_239">
<id>51</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_240">
<id>52</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_241">
<id>53</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_242">
<id>2</id>
<operations>
<count>12</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_243">
<id>15</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_244">
<id>16</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_245">
<id>18</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_246">
<id>36</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_247">
<id>38</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_248">
<id>39</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_249">
<id>40</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_250">
<id>41</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_251">
<id>45</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_252">
<id>54</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_253">
<id>55</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_254">
<id>57</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_255">
<id>3</id>
<operations>
<count>30</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_256">
<id>17</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_257">
<id>19</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_258">
<id>20</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_259">
<id>21</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_260">
<id>22</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_261">
<id>23</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_262">
<id>24</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_263">
<id>25</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_264">
<id>26</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_265">
<id>27</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_266">
<id>28</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_267">
<id>29</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_268">
<id>42</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_269">
<id>43</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_270">
<id>44</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_271">
<id>46</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_272">
<id>47</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_273">
<id>48</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_274">
<id>56</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_275">
<id>58</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_276">
<id>59</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_277">
<id>60</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_278">
<id>61</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_279">
<id>62</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_280">
<id>63</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_281">
<id>64</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_282">
<id>65</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_283">
<id>66</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_284">
<id>67</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_285">
<id>68</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_286">
<id>4</id>
<operations>
<count>9</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_287">
<id>30</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_288">
<id>31</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_289">
<id>49</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_290">
<id>50</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_291">
<id>69</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_292">
<id>70</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_293">
<id>71</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_294">
<id>72</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_295">
<id>73</id>
<stage>13</stage>
<latency>13</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_296">
<id>5</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_297">
<id>73</id>
<stage>12</stage>
<latency>13</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_298">
<id>6</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_299">
<id>73</id>
<stage>11</stage>
<latency>13</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_300">
<id>7</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_301">
<id>73</id>
<stage>10</stage>
<latency>13</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_302">
<id>8</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_303">
<id>73</id>
<stage>9</stage>
<latency>13</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_304">
<id>9</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_305">
<id>73</id>
<stage>8</stage>
<latency>13</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_306">
<id>10</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_307">
<id>73</id>
<stage>7</stage>
<latency>13</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_308">
<id>11</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_309">
<id>73</id>
<stage>6</stage>
<latency>13</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_310">
<id>12</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_311">
<id>73</id>
<stage>5</stage>
<latency>13</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_312">
<id>13</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_313">
<id>73</id>
<stage>4</stage>
<latency>13</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_314">
<id>14</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_315">
<id>73</id>
<stage>3</stage>
<latency>13</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_316">
<id>15</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_317">
<id>73</id>
<stage>2</stage>
<latency>13</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_318">
<id>16</id>
<operations>
<count>4</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_319">
<id>3</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_320">
<id>73</id>
<stage>1</stage>
<latency>13</latency>
</item>
<item class_id_reference="28" object_id="_321">
<id>74</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_322">
<id>75</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
</states>
<transitions class_id="29" tracking_level="0" version="0">
<count>15</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="1" version="0" object_id="_323">
<inState>1</inState>
<outState>2</outState>
<condition class_id="31" tracking_level="0" version="0">
<id>40</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="_324">
<inState>2</inState>
<outState>3</outState>
<condition>
<id>41</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="_325">
<inState>3</inState>
<outState>4</outState>
<condition>
<id>42</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="_326">
<inState>4</inState>
<outState>5</outState>
<condition>
<id>43</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="_327">
<inState>5</inState>
<outState>6</outState>
<condition>
<id>44</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="_328">
<inState>6</inState>
<outState>7</outState>
<condition>
<id>45</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="_329">
<inState>7</inState>
<outState>8</outState>
<condition>
<id>46</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="_330">
<inState>8</inState>
<outState>9</outState>
<condition>
<id>47</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="_331">
<inState>9</inState>
<outState>10</outState>
<condition>
<id>48</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="_332">
<inState>10</inState>
<outState>11</outState>
<condition>
<id>49</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="_333">
<inState>11</inState>
<outState>12</outState>
<condition>
<id>50</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="_334">
<inState>12</inState>
<outState>13</outState>
<condition>
<id>51</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="_335">
<inState>13</inState>
<outState>14</outState>
<condition>
<id>52</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_336">
<inState>14</inState>
<outState>15</outState>
<condition>
<id>53</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="_337">
<inState>15</inState>
<outState>16</outState>
<condition>
<id>54</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
</transitions>
</fsm>
<res class_id="34" tracking_level="1" version="0" object_id="_338">
<dp_component_resource class_id="35" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="36" tracking_level="0" version="0">
<first>grp_fxp_sqrt_fu_88 (fxp_sqrt)</first>
<second class_id="37" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="38" tracking_level="0" version="0">
<first>FF</first>
<second>357</second>
</item>
<item>
<first>LUT</first>
<second>3646</second>
</item>
</second>
</item>
</dp_component_resource>
<dp_expression_resource>
<count>24</count>
<item_version>0</item_version>
<item>
<first>ap_block_pp0_stage0_11001 ( 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>8</second>
</item>
</second>
</item>
<item>
<first>ap_block_pp0_stage0_subdone ( 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>8</second>
</item>
</second>
</item>
<item>
<first>ap_block_state1_pp0_stage0_iter0 ( 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>8</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>8</second>
</item>
</second>
</item>
<item>
<first>grp_fxp_sqrt_fu_88_in_val_V_read ( + ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>32</second>
</item>
<item>
<first>(1P1)</first>
<second>32</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>29</second>
</item>
</second>
</item>
<item>
<first>p_neg1_fu_274_p2 ( - ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>20</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>27</second>
</item>
</second>
</item>
<item>
<first>p_neg9_fu_322_p2 ( - ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>21</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>28</second>
</item>
</second>
</item>
<item>
<first>p_neg_fu_385_p2 ( - ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>20</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>27</second>
</item>
</second>
</item>
<item>
<first>r_V_1_fu_165_p2 ( - ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>9</second>
</item>
<item>
<first>(1P1)</first>
<second>9</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>16</second>
</item>
</second>
</item>
<item>
<first>r_V_2_fu_189_p2 ( - ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>9</second>
</item>
<item>
<first>(1P1)</first>
<second>9</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>16</second>
</item>
</second>
</item>
<item>
<first>r_V_fu_151_p2 ( - ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>9</second>
</item>
<item>
<first>(1P1)</first>
<second>9</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>16</second>
</item>
</second>
</item>
<item>
<first>result_1_fu_236_p2 ( * ) </first>
<second>
<count>5</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>9</second>
</item>
<item>
<first>(1P1)</first>
<second>9</second>
</item>
<item>
<first>DSP48E</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>51</second>
</item>
</second>
</item>
<item>
<first>result_fu_198_p2 ( * ) </first>
<second>
<count>5</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>9</second>
</item>
<item>
<first>(1P1)</first>
<second>9</second>
</item>
<item>
<first>DSP48E</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>51</second>
</item>
</second>
</item>
<item>
<first>rhs_V_cast_fu_143_p3 ( select ) </first>
<second>
<count>5</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>8</second>
</item>
<item>
<first>(2P2)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>8</second>
</item>
</second>
</item>
<item>
<first>tmp1_fu_175_p2 ( * ) </first>
<second>
<count>5</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>4</second>
</item>
<item>
<first>(1P1)</first>
<second>9</second>
</item>
<item>
<first>DSP48E</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>51</second>
</item>
</second>
</item>
<item>
<first>tmp2_fu_466_p2 ( + ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>32</second>
</item>
<item>
<first>(1P1)</first>
<second>32</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>29</second>
</item>
</second>
</item>
<item>
<first>tmp_11_fu_405_p2 ( - ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>20</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>27</second>
</item>
</second>
</item>
<item>
<first>tmp_16_fu_425_p3 ( select ) </first>
<second>
<count>5</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>20</second>
</item>
<item>
<first>(2P2)</first>
<second>20</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>20</second>
</item>
</second>
</item>
<item>
<first>tmp_1_fu_294_p2 ( - ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>20</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>27</second>
</item>
</second>
</item>
<item>
<first>tmp_2_fu_260_p2 ( + ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>20</second>
</item>
<item>
<first>(1P1)</first>
<second>20</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>27</second>
</item>
</second>
</item>
<item>
<first>tmp_4_fu_341_p2 ( - ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>20</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>27</second>
</item>
</second>
</item>
<item>
<first>tmp_6_fu_351_p3 ( select ) </first>
<second>
<count>5</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>21</second>
</item>
<item>
<first>(2P2)</first>
<second>21</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>21</second>
</item>
</second>
</item>
<item>
<first>tmp_9_fu_371_p2 ( - ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>20</second>
</item>
<item>
<first>(1P1)</first>
<second>20</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>27</second>
</item>
</second>
</item>
<item>
<first>tmp_s_fu_314_p3 ( select ) </first>
<second>
<count>5</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>20</second>
</item>
<item>
<first>(2P2)</first>
<second>20</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>20</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>1</count>
<item_version>0</item_version>
<item>
<first>pixel_V_TDATA_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>
</dp_multiplexer_resource>
<dp_register_resource>
<count>30</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>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>ap_enable_reg_pp0_iter10</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_iter11</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_iter12</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_iter13</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_iter14</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_iter15</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_iter2</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_iter3</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_iter4</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_iter5</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_iter6</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_iter7</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_iter8</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_iter9</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>r_V_1_reg_503</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>9</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>r_V_2_reg_513</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>9</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>r_V_reg_498</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>9</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>result_1_reg_543</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>18</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>18</second>
</item>
</second>
</item>
<item>
<first>result_reg_518</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>18</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>18</second>
</item>
</second>
</item>
<item>
<first>tmp1_reg_508</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>14</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>14</second>
</item>
</second>
</item>
<item>
<first>tmp_13_reg_528</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>tmp_14_reg_533</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_16_reg_563</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>20</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>20</second>
</item>
</second>
</item>
<item>
<first>tmp_18_reg_548</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>17</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>17</second>
</item>
</second>
</item>
<item>
<first>tmp_3_reg_538</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>tmp_6_reg_558</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>tmp_reg_523</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>17</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>17</second>
</item>
</second>
</item>
<item>
<first>tmp_s_reg_553</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>20</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>20</second>
</item>
</second>
</item>
</dp_register_resource>
<dp_dsp_resource>
<count>2</count>
<item_version>0</item_version>
<item>
<first>getPixelClassificbkb_U2</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>DSP48E</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>grp_fxp_sqrt_fu_88</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
</dp_dsp_resource>
<dp_component_map class_id="39" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="40" tracking_level="0" version="0">
<first>grp_fxp_sqrt_fu_88 (fxp_sqrt)</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>73</item>
</second>
</item>
</dp_component_map>
<dp_expression_map>
<count>20</count>
<item_version>0</item_version>
<item>
<first>grp_fxp_sqrt_fu_88_in_val_V_read ( + ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>72</item>
</second>
</item>
<item>
<first>p_neg1_fu_274_p2 ( - ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
<item>
<first>p_neg9_fu_322_p2 ( - ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>42</item>
</second>
</item>
<item>
<first>p_neg_fu_385_p2 ( - ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>62</item>
</second>
</item>
<item>
<first>r_V_1_fu_165_p2 ( - ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>r_V_2_fu_189_p2 ( - ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>53</item>
</second>
</item>
<item>
<first>r_V_fu_151_p2 ( - ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</second>
</item>
<item>
<first>result_1_fu_236_p2 ( * ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>55</item>
</second>
</item>
<item>
<first>result_fu_198_p2 ( * ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>16</item>
</second>
</item>
<item>
<first>rhs_V_cast_fu_143_p3 ( select ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
<item>
<first>tmp1_fu_175_p2 ( * ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>tmp2_fu_466_p2 ( + ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>71</item>
</second>
</item>
<item>
<first>tmp_11_fu_405_p2 ( - ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>65</item>
</second>
</item>
<item>
<first>tmp_16_fu_425_p3 ( select ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>68</item>
</second>
</item>
<item>
<first>tmp_1_fu_294_p2 ( - ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>tmp_2_fu_260_p2 ( + ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>tmp_4_fu_341_p2 ( - ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
<item>
<first>tmp_6_fu_351_p3 ( select ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>48</item>
</second>
</item>
<item>
<first>tmp_9_fu_371_p2 ( - ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>60</item>
</second>
</item>
<item>
<first>tmp_s_fu_314_p3 ( select ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</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="41" tracking_level="0" version="0">
<count>72</count>
<item_version>0</item_version>
<item class_id="42" tracking_level="0" version="0">
<first>4</first>
<second class_id="43" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>5</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>6</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>7</first>
<second>
<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>10</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>11</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>12</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>13</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>14</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>15</first>
<second>
<first>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>2</first>
<second>0</second>
</second>
</item>
<item>
<first>18</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>19</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>20</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>21</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>22</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>23</first>
<second>
<first>2</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>29</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>30</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>31</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>32</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>33</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>34</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>35</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>36</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>37</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>38</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>39</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>40</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>41</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>42</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>43</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>44</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>45</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>46</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>47</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>48</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>49</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>50</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>51</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>52</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>53</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>54</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>55</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>56</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>57</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>58</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>59</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>60</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>61</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>62</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>63</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>64</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>65</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>66</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>67</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>68</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>69</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>70</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>71</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>72</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>73</first>
<second>
<first>3</first>
<second>12</second>
</second>
</item>
<item>
<first>74</first>
<second>
<first>15</first>
<second>0</second>
</second>
</item>
<item>
<first>75</first>
<second>
<first>15</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="44" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="45" tracking_level="0" version="0">
<first>76</first>
<second class_id="46" tracking_level="0" version="0">
<first>0</first>
<second>15</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="47" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="48" tracking_level="1" version="0" object_id="_339">
<region_name>getColorDistance_Str</region_name>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>76</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>16</pipe_depth>
</item>
</regions>
<dp_fu_nodes class_id="49" tracking_level="0" version="0">
<count>71</count>
<item_version>0</item_version>
<item class_id="50" tracking_level="0" version="0">
<first>76</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>4</item>
</second>
</item>
<item>
<first>82</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>5</item>
</second>
</item>
<item>
<first>88</first>
<second>
<count>13</count>
<item_version>0</item_version>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
</second>
</item>
<item>
<first>93</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>6</item>
</second>
</item>
<item>
<first>103</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>7</item>
</second>
</item>
<item>
<first>107</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>8</item>
</second>
</item>
<item>
<first>117</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>9</item>
</second>
</item>
<item>
<first>125</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>10</item>
</second>
</item>
<item>
<first>129</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>143</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
<item>
<first>151</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</second>
</item>
<item>
<first>157</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>161</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>33</item>
</second>
</item>
<item>
<first>165</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>171</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>35</item>
</second>
</item>
<item>
<first>175</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>181</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>51</item>
</second>
</item>
<item>
<first>185</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>52</item>
</second>
</item>
<item>
<first>189</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>53</item>
</second>
</item>
<item>
<first>195</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>198</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>16</item>
</second>
</item>
<item>
<first>204</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>208</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>211</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>38</item>
</second>
</item>
<item>
<first>214</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>40</item>
</second>
</item>
<item>
<first>217</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</second>
</item>
<item>
<first>224</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>233</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>54</item>
</second>
</item>
<item>
<first>236</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>55</item>
</second>
</item>
<item>
<first>242</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>57</item>
</second>
</item>
<item>
<first>246</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>17</item>
</second>
</item>
<item>
<first>249</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</second>
</item>
<item>
<first>256</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>20</item>
</second>
</item>
<item>
<first>260</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>266</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>274</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
<item>
<first>280</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>290</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>294</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>300</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>310</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>28</item>
</second>
</item>
<item>
<first>314</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
<item>
<first>322</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>42</item>
</second>
</item>
<item>
<first>327</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>43</item>
</second>
</item>
<item>
<first>337</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>44</item>
</second>
</item>
<item>
<first>341</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
<item>
<first>347</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>351</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>48</item>
</second>
</item>
<item>
<first>357</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>56</item>
</second>
</item>
<item>
<first>360</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>58</item>
</second>
</item>
<item>
<first>367</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>59</item>
</second>
</item>
<item>
<first>371</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>60</item>
</second>
</item>
<item>
<first>377</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>61</item>
</second>
</item>
<item>
<first>385</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>62</item>
</second>
</item>
<item>
<first>391</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>63</item>
</second>
</item>
<item>
<first>401</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</second>
</item>
<item>
<first>405</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>65</item>
</second>
</item>
<item>
<first>411</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>66</item>
</second>
</item>
<item>
<first>421</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>67</item>
</second>
</item>
<item>
<first>425</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>68</item>
</second>
</item>
<item>
<first>433</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>440</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>444</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>49</item>
</second>
</item>
<item>
<first>451</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>50</item>
</second>
</item>
<item>
<first>455</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>69</item>
</second>
</item>
<item>
<first>462</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>70</item>
</second>
</item>
<item>
<first>466</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>71</item>
</second>
</item>
<item>
<first>472</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>72</item>
</second>
</item>
<item>
<first>479</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>74</item>
</second>
</item>
<item>
<first>489</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="52" tracking_level="0" version="0">
<count>68</count>
<item_version>0</item_version>
<item class_id="53" tracking_level="0" version="0">
<first>colorBlue_V_fu_129</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>colorGreen_V_fu_125</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>10</item>
</second>
</item>
<item>
<first>lhs_V_1_fu_157</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>lhs_V_2_fu_181</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>51</item>
</second>
</item>
<item>
<first>lhs_V_fu_139</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>number_assign_1_cast_1_fu_171</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>35</item>
</second>
</item>
<item>
<first>number_assign_1_cast_fu_208</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>number_assign_2_cast_fu_233</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>54</item>
</second>
</item>
<item>
<first>number_assign_cast_fu_195</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>p_Val2_1_fu_451</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>50</item>
</second>
</item>
<item>
<first>p_Val2_2_fu_462</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>70</item>
</second>
</item>
<item>
<first>p_Val2_s_fu_440</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>p_neg1_fu_274</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
<item>
<first>p_neg9_fu_322</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>42</item>
</second>
</item>
<item>
<first>p_neg_fu_385</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>62</item>
</second>
</item>
<item>
<first>p_shl1_cast_fu_256</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>20</item>
</second>
</item>
<item>
<first>p_shl1_fu_249</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</second>
</item>
<item>
<first>p_shl_cast_fu_367</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>59</item>
</second>
</item>
<item>
<first>p_shl_fu_360</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>58</item>
</second>
</item>
<item>
<first>pixelBlue_V_fu_107</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>8</item>
</second>
</item>
<item>
<first>pixelGreen_V_fu_103</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>7</item>
</second>
</item>
<item>
<first>pixelRed_V_fu_93</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>6</item>
</second>
</item>
<item>
<first>powerSummation_V_fu_472</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>72</item>
</second>
</item>
<item>
<first>r_V_1_fu_165</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>r_V_2_fu_189</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>53</item>
</second>
</item>
<item>
<first>r_V_fu_151</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</second>
</item>
<item>
<first>result_1_fu_236</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>55</item>
</second>
</item>
<item>
<first>result_2_cast3_fu_357</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>56</item>
</second>
</item>
<item>
<first>result_cast6_fu_246</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>17</item>
</second>
</item>
<item>
<first>result_fu_198</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>16</item>
</second>
</item>
<item>
<first>rhs_V_1_fu_161</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>33</item>
</second>
</item>
<item>
<first>rhs_V_2_fu_185</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>52</item>
</second>
</item>
<item>
<first>rhs_V_cast_fu_143</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
<item>
<first>rhs_V_fu_117</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>9</item>
</second>
</item>
<item>
<first>tmp1_cast_fu_211</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>38</item>
</second>
</item>
<item>
<first>tmp1_fu_175</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>tmp2_fu_466</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>71</item>
</second>
</item>
<item>
<first>tmp_10_cast_fu_337</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>44</item>
</second>
</item>
<item>
<first>tmp_10_fu_300</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>tmp_11_cast_fu_347</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>tmp_11_fu_405</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>65</item>
</second>
</item>
<item>
<first>tmp_12_fu_433</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>tmp_13_fu_214</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>40</item>
</second>
</item>
<item>
<first>tmp_14_cast_fu_401</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</second>
</item>
<item>
<first>tmp_14_fu_217</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</second>
</item>
<item>
<first>tmp_15_fu_327</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>43</item>
</second>
</item>
<item>
<first>tmp_16_fu_425</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>68</item>
</second>
</item>
<item>
<first>tmp_17_cast_fu_421</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>67</item>
</second>
</item>
<item>
<first>tmp_17_fu_444</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>49</item>
</second>
</item>
<item>
<first>tmp_18_fu_242</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>57</item>
</second>
</item>
<item>
<first>tmp_19_fu_377</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>61</item>
</second>
</item>
<item>
<first>tmp_1_fu_294</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>tmp_20_fu_391</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>63</item>
</second>
</item>
<item>
<first>tmp_21_fu_411</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>66</item>
</second>
</item>
<item>
<first>tmp_22_fu_455</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>69</item>
</second>
</item>
<item>
<first>tmp_23_fu_479</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>74</item>
</second>
</item>
<item>
<first>tmp_2_fu_260</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>tmp_3_fu_224</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>tmp_4_cast_fu_310</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>28</item>
</second>
</item>
<item>
<first>tmp_4_fu_341</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
<item>
<first>tmp_5_fu_489</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
<item>
<first>tmp_6_fu_351</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>48</item>
</second>
</item>
<item>
<first>tmp_7_fu_266</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>tmp_8_fu_280</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>tmp_9_fu_371</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>60</item>
</second>
</item>
<item>
<first>tmp_cast_fu_290</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>tmp_fu_204</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>tmp_s_fu_314</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>1</count>
<item_version>0</item_version>
<item>
<first>grp_fxp_sqrt_fu_88</first>
<second>
<count>13</count>
<item_version>0</item_version>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
<item>73</item>
</second>
</item>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>2</count>
<item_version>0</item_version>
<item>
<first>color_V_read_read_fu_76</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>4</item>
</second>
</item>
<item>
<first>pixel_V_read_read_fu_82</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>5</item>
</second>
</item>
</dp_fu_nodes_io>
<return_ports>
<count>1</count>
<item_version>0</item_version>
<item>
<first>ap_return</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>75</item>
</second>
</item>
</return_ports>
<dp_mem_port_nodes class_id="54" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>15</count>
<item_version>0</item_version>
<item>
<first>498</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</second>
</item>
<item>
<first>503</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>508</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>513</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>53</item>
</second>
</item>
<item>
<first>518</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>16</item>
</second>
</item>
<item>
<first>523</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>528</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>40</item>
</second>
</item>
<item>
<first>533</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</second>
</item>
<item>
<first>538</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>543</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>55</item>
</second>
</item>
<item>
<first>548</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>57</item>
</second>
</item>
<item>
<first>553</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
<item>
<first>558</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>48</item>
</second>
</item>
<item>
<first>563</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>68</item>
</second>
</item>
<item>
<first>568</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>72</item>
</second>
</item>
</dp_reg_nodes>
<dp_regname_nodes>
<count>15</count>
<item_version>0</item_version>
<item>
<first>powerSummation_V_reg_568</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>72</item>
</second>
</item>
<item>
<first>r_V_1_reg_503</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>r_V_2_reg_513</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>53</item>
</second>
</item>
<item>
<first>r_V_reg_498</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</second>
</item>
<item>
<first>result_1_reg_543</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>55</item>
</second>
</item>
<item>
<first>result_reg_518</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>16</item>
</second>
</item>
<item>
<first>tmp1_reg_508</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>tmp_13_reg_528</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>40</item>
</second>
</item>
<item>
<first>tmp_14_reg_533</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</second>
</item>
<item>
<first>tmp_16_reg_563</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>68</item>
</second>
</item>
<item>
<first>tmp_18_reg_548</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>57</item>
</second>
</item>
<item>
<first>tmp_3_reg_538</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>tmp_6_reg_558</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>48</item>
</second>
</item>
<item>
<first>tmp_reg_523</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>tmp_s_reg_553</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
</dp_regname_nodes>
<dp_reg_phi>
<count>0</count>
<item_version>0</item_version>
</dp_reg_phi>
<dp_regname_phi>
<count>0</count>
<item_version>0</item_version>
</dp_regname_phi>
<dp_port_io_nodes class_id="55" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="56" tracking_level="0" version="0">
<first>color_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>4</item>
</second>
</item>
</second>
</item>
<item>
<first>pixel_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>5</item>
</second>
</item>
</second>
</item>
</dp_port_io_nodes>
<port2core class_id="57" 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>
|
with AUnit; use AUnit;
with AUnit.Reporter.Text; use AUnit.Reporter.Text;
with AUnit.Run; use AUnit.Run;
with GNAT.OS_Lib; use GNAT.OS_Lib;
with Rejuvenation_Suite; use Rejuvenation_Suite;
procedure Tests is
function Runner is new Test_Runner_With_Status (Suite);
Reporter : Text_Reporter;
begin
if Runner (Reporter) /= Success then
OS_Exit (1);
end if;
end Tests;
|
pragma License (Unrestricted);
-- runtime unit
with Ada.Exceptions;
package System.Finally is
-- This unit will be linked if these subprograms are called from
-- UNIT__finalize_spec, UNIT__finalize_body, or finalize_library
-- generated by gnatbind.
pragma Preelaborate;
-- implementation of Save_Library_Occurrence (s-soflin.ads)
procedure Save_Library_Occurrence (
X : Ada.Exceptions.Exception_Occurrence_Access)
with Export,
Convention => Ada,
External_Name => "system__soft_links__save_library_occurrence";
-- implementation of Reraise_Library_Exception_If_Any (a-except-2005.adb)
procedure Reraise_Library_Exception_If_Any
with Export,
Convention => Ada,
External_Name => "__gnat_reraise_library_exception_if_any";
end System.Finally;
|
with AUnit.Test_Suites;
package MainTestSuite is
function Suite return AUnit.Test_Suites.Access_Test_Suite;
procedure runAll;
end MainTestSuite;
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with System.Machine_Code; use System.Machine_Code;
package body Memory_Barriers is
----------------------------------
-- Data_Synchronization_Barrier --
----------------------------------
procedure Data_Synchronization_Barrier is
pragma Suppress (All_Checks);
begin
Asm ("DSB #0xF", Volatile => True); -- 15 is 'Sy", ie "full system"
end Data_Synchronization_Barrier;
end Memory_Barriers;
|
------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- G N A T . S H A 2 2 4 --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009-2019, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package implements the SHA-224 secure hash function as described in
-- FIPS PUB 180-3. The complete text of FIPS PUB 180-3 can be found at:
-- http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf
-- See the declaration of GNAT.Secure_Hashes.H in g-sechas.ads for complete
-- documentation.
with GNAT.Secure_Hashes.SHA2_Common;
with GNAT.Secure_Hashes.SHA2_32;
with System;
package GNAT.SHA224 is new GNAT.Secure_Hashes.H
(Block_Words => GNAT.Secure_Hashes.SHA2_Common.Block_Words,
State_Words => 8,
Hash_Words => 7,
Hash_Bit_Order => System.High_Order_First,
Hash_State => GNAT.Secure_Hashes.SHA2_32.Hash_State,
Initial_State => GNAT.Secure_Hashes.SHA2_32.SHA224_Init_State,
Transform => GNAT.Secure_Hashes.SHA2_32.Transform);
|
------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- A D A . S T R I N G S . W I D E _ B O U N D E D . W I D E _ H A S H --
-- --
-- S p e c --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. In accordance with the copyright of that document, you can freely --
-- copy and modify this specification, provided that if you redistribute a --
-- modified version, any changes that you have made are clearly indicated. --
-- --
------------------------------------------------------------------------------
with Ada.Containers;
generic
with package Bounded is
new Ada.Strings.Wide_Bounded.Generic_Bounded_Length (<>);
function Ada.Strings.Wide_Bounded.Wide_Hash (Key : Bounded.Bounded_Wide_String)
return Containers.Hash_Type;
pragma Preelaborate (Ada.Strings.Wide_Bounded.Wide_Hash);
|
-----------------------------------------------------------------------
-- awa-jobs -- AWA Jobs
-- Copyright (C) 2012, 2015, 2018, 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.
-----------------------------------------------------------------------
-- = Jobs Module =
-- The `jobs` module defines a batch job framework for modules to perform
-- and execute long running and deferred actions. The `jobs` module is
-- intended to help web application designers in implementing end to end
-- asynchronous operation. A client schedules a job and does not block
-- nor wait for the immediate completion. Instead, the client asks
-- periodically or uses other mechanisms to check for the job completion.
--
-- @include awa-jobs-modules.ads
--
-- == Writing a job ==
-- A new job type is created by implementing the `Execute` operation
-- of the abstract `Job_Type` tagged record.
--
-- type Resize_Job is new AWA.Jobs.Job_Type with ...;
--
-- The `Execute` procedure must be implemented. It should use the
-- `Get_Parameter` functions to retrieve the job parameters and perform
-- the work. While the job is being executed, it can save result by using
-- the `Set_Result` operations, save messages by using the `Set_Message`
-- operations and report the progress by using `Set_Progress`.
-- It may report the job status by using `Set_Status`.
--
-- procedure Execute (Job : in out Resize_Job) is
-- begin
-- Job.Set_Result ("done", "ok");
-- end Execute;
--
-- == Registering a job ==
-- The `jobs` module must be able to create the job instance when
-- it is going to be executed. For this, a registration package must
-- be instantiated:
--
-- package Resize_Def is new AWA.Jobs.Definition (Resize_Job);
--
-- and the job definition must be added:
--
-- AWA.Jobs.Modules.Register (Resize_Def.Create'Access);
--
-- == Scheduling a job ==
-- To schedule a job, declare an instance of the job to execute and set
-- the job specific parameters. The job parameters will be saved in the
-- database. As soon as parameters are defined, call the `Schedule`
-- procedure to schedule the job in the job queue and obtain a job identifier.
--
-- Resize : Resize_Job;
-- ...
-- Resize.Set_Parameter ("file", "image.png");
-- Resize.Set_Parameter ("width", "32");
-- Resize.Set_Parameter ("height, "32");
-- Resize.Schedule;
--
-- == Checking for job completion ==
-- After a job is scheduled, a unique identifier is allocated that allows
-- to identify it. It is possible to query the status of the job by using
-- the `Get_Job_Status` function:
--
-- Status : AWA.Jobs.Models.Job_Status_Type
-- := AWA.Jobs.Services.Get_Job_Status (Resize.Get_Identifier);
--
-- @include awa-jobs-services.ads
--
-- == Ada Beans ==
--
-- @include-bean jobs.xml
--
-- == Data Model ==
-- [images/awa_jobs_model.png]
--
package AWA.Jobs is
pragma Pure;
end AWA.Jobs;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T A S K I N G . R E S T R I C T E D . S T A G E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2016, 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 is a simplified version of the System.Tasking.Stages package,
-- intended to be used in a restricted run time.
-- This package represents the high level tasking interface used by the
-- compiler to expand Ada 95 tasking constructs into simpler run time calls
-- (aka GNARLI, GNU Ada Run-time Library Interface)
-- Note: the compiler generates direct calls to this interface, via Rtsfind.
-- Any changes to this interface may require corresponding compiler changes
-- in exp_ch9.adb and possibly exp_ch7.adb
-- The restricted GNARLI is also composed of System.Protected_Objects and
-- System.Protected_Objects.Single_Entry
with System.Task_Info;
with System.Parameters;
package System.Tasking.Restricted.Stages is
pragma Elaborate_Body;
---------------------------------
-- Compiler Interface (GNARLI) --
---------------------------------
-- The compiler will expand in the GNAT tree the following construct:
-- task type T (Discr : Integer);
-- task body T is
-- ...declarations, possibly some controlled...
-- begin
-- ...B...;
-- end T;
-- T1 : T (1);
-- as follows:
-- task type t (discr : integer);
-- tE : aliased boolean := false;
-- tZ : size_type := unspecified_size;
-- type tV (discr : integer) is limited record
-- _task_id : task_id;
-- _atcb : aliased system__tasking__ada_task_control_block (0);
-- end record;
-- procedure tB (_task : access tV);
-- freeze tV [
-- procedure tVIP (_init : in out tV; _master : master_id;
-- _chain : in out activation_chain; _task_name : in string;
-- discr : integer) is
-- begin
-- _init.discr := discr;
-- _init._task_id := null;
-- system__tasking__ada_task_control_blockIP (_init._atcb, 0);
-- _init._task_id := _init._atcb'unchecked_access;
-- create_restricted_task (unspecified_priority, tZ,
-- unspecified_task_info, unspecified_cpu,
-- task_procedure_access!(tB'address), _init'address,
-- tE'unchecked_access, _task_name, _init._task_id);
-- return;
-- end tVIP;
-- _chain : aliased activation_chain;
-- activation_chainIP (_chain);
-- procedure tB (_task : access tV) is
-- discr : integer renames _task.discr;
-- procedure _clean is
-- begin
-- complete_restricted_task;
-- finalize_list (F14b);
-- return;
-- end _clean;
-- begin
-- ...declarations...
-- complete_restricted_activation;
-- ...B...;
-- return;
-- at end
-- _clean;
-- end tB;
-- tE := true;
-- t1 : t (1);
-- t1S : constant String := "t1";
-- tIP (t1, 3, _chain, t1S, 1);
Partition_Elaboration_Policy : Character := 'C';
pragma Export (C, Partition_Elaboration_Policy,
"__gnat_partition_elaboration_policy");
-- Partition elaboration policy. Value can be either 'C' for concurrent,
-- which is the default or 'S' for sequential. This value can be modified
-- by the binder generated code, before calling elaboration code.
procedure Create_Restricted_Task
(Priority : Integer;
Stack_Address : System.Address;
Size : System.Parameters.Size_Type;
Secondary_Stack_Size : System.Parameters.Size_Type;
Task_Info : System.Task_Info.Task_Info_Type;
CPU : Integer;
State : Task_Procedure_Access;
Discriminants : System.Address;
Elaborated : Access_Boolean;
Chain : in out Activation_Chain;
Task_Image : String;
Created_Task : Task_Id);
-- Compiler interface only. Do not call from within the RTS.
-- This must be called to create a new task, when the partition
-- elaboration policy is not specified (or is concurrent).
--
-- Priority is the task's priority (assumed to be in the
-- System.Any_Priority'Range)
--
-- Stack_Address is the start address of the stack associated to the task,
-- in case it has been preallocated by the compiler; it is equal to
-- Null_Address when the stack needs to be allocated by the underlying
-- operating system.
--
-- Size is the stack size of the task to create
--
-- Secondary_Stack_Size is the secondary stack size of the task to create
--
-- Task_Info is the task info associated with the created task, or
-- Unspecified_Task_Info if none.
--
-- CPU is the task affinity. We pass it as an Integer to avoid an explicit
-- dependency from System.Multiprocessors when not needed. Static range
-- checks are performed when analyzing the pragma, and dynamic ones are
-- performed before setting the affinity at run time.
--
-- State is the compiler generated task's procedure body
--
-- Discriminants is a pointer to a limited record whose discriminants are
-- those of the task to create. This parameter should be passed as the
-- single argument to State.
--
-- Elaborated is a pointer to a Boolean that must be set to true on exit
-- if the task could be successfully elaborated.
--
-- Chain is a linked list of task that needs to be created. On exit,
-- Created_Task.Activation_Link will be Chain.T_ID, and Chain.T_ID will be
-- Created_Task (the created task will be linked at the front of Chain).
--
-- Task_Image is a string created by the compiler that the run time can
-- store to ease the debugging and the Ada.Task_Identification facility.
--
-- Created_Task is the resulting task.
--
-- This procedure can raise Storage_Error if the task creation fails
procedure Create_Restricted_Task_Sequential
(Priority : Integer;
Stack_Address : System.Address;
Size : System.Parameters.Size_Type;
Secondary_Stack_Size : System.Parameters.Size_Type;
Task_Info : System.Task_Info.Task_Info_Type;
CPU : Integer;
State : Task_Procedure_Access;
Discriminants : System.Address;
Elaborated : Access_Boolean;
Task_Image : String;
Created_Task : Task_Id);
-- Compiler interface only. Do not call from within the RTS.
-- This must be called to create a new task, when the sequential partition
-- elaboration policy is used.
--
-- The parameters are the same as Create_Restricted_Task except there is
-- no Chain parameter (for the activation chain), as there is only one
-- global activation chain, which is declared in the body of this package.
procedure Activate_Restricted_Tasks
(Chain_Access : Activation_Chain_Access);
-- Compiler interface only. Do not call from within the RTS.
-- This must be called by the creator of a chain of one or more new tasks,
-- to activate them. The chain is a linked list that up to this point is
-- only known to the task that created them, though the individual tasks
-- are already in the All_Tasks_List.
--
-- The compiler builds the chain in LIFO order (as a stack). Another
-- version of this procedure had code to reverse the chain, so as to
-- activate the tasks in the order of declaration. This might be nice, but
-- it is not needed if priority-based scheduling is supported, since all
-- the activated tasks synchronize on the activators lock before they start
-- activating and so they should start activating in priority order.
--
-- When the partition elaboration policy is sequential, this procedure
-- does nothing, tasks will be activated at end of elaboration.
procedure Activate_All_Tasks_Sequential;
pragma Export (C, Activate_All_Tasks_Sequential,
"__gnat_activate_all_tasks");
-- Binder interface only. Do not call from within the RTS. This must be
-- called an the end of the elaboration to activate all tasks, in order
-- to implement the sequential elaboration policy.
procedure Complete_Restricted_Activation;
-- Compiler interface only. Do not call from within the RTS. This should be
-- called from the task body at the end of the elaboration code for its
-- declarative part. Decrement the count of tasks to be activated by the
-- activator and wake it up so it can check to see if all tasks have been
-- activated. Except for the environment task, which should never call this
-- procedure, T.Activator should only be null iff T has completed
-- activation.
procedure Complete_Restricted_Task;
-- Compiler interface only. Do not call from within the RTS. This should be
-- called from an implicit at-end handler associated with the task body,
-- when it completes. From this point, the current task will become not
-- callable. If the current task have not completed activation, this should
-- be done now in order to wake up the activator (the environment task).
function Restricted_Terminated (T : Task_Id) return Boolean;
-- Compiler interface only. Do not call from within the RTS. This is called
-- by the compiler to implement the 'Terminated attribute.
--
-- source code:
-- T1'Terminated
--
-- code expansion:
-- restricted_terminated (t1._task_id)
procedure Finalize_Global_Tasks;
-- This is needed to support the compiler interface. It will only be called
-- by the Environment task in the binder generated file (by adafinal).
-- Instead, it will cause the Environment to block forever, since none of
-- the dependent tasks are expected to terminate
end System.Tasking.Restricted.Stages;
|
-------------------------------------------------------------------------------
-- LSE -- L-System Editor
-- Author: Heziode
--
-- License:
-- MIT License
--
-- Copyright (c) 2018 Quentin Dauprat (Heziode) <Heziode@protonmail.com>
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the "Software"),
-- to deal in the Software without restriction, including without limitation
-- the rights to use, copy, modify, merge, publish, distribute, sublicense,
-- and/or sell copies of the Software, and to permit persons to whom the
-- Software is furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-- DEALINGS IN THE SOFTWARE.
-------------------------------------------------------------------------------
with LSE.Model.Grammar.Symbol.LogoAngleMinus;
with LSE.Model.Grammar.Symbol.LogoAnglePlus;
with LSE.Model.Grammar.Symbol.LogoForward;
with LSE.Model.Grammar.Symbol.LogoForwardTrace;
with LSE.Model.Grammar.Symbol.LogoPositionRestore;
with LSE.Model.Grammar.Symbol.LogoPositionSave;
with LSE.Model.Grammar.Symbol.LogoUTurn;
with LSE.Model.Grammar.Symbol.OtherSymbol;
package body LSE.Model.L_System.Factory is
function Make_Axiom (Value : String)
return LSE.Model.Grammar.Symbol_Utils.P_List.List
is
begin
return Make_Symbol_List (Value);
end Make_Axiom;
function Make_Angle (Value : String) return LSE.Utils.Angle.Angle
is
Result : constant LSE.Utils.Angle.Angle :=
LSE.Utils.Angle.Angle'Value (Value);
begin
return Result;
end Make_Angle;
function Make_Rule (Head : Character; Rule : String)
return Growth_Rule.Instance
is
Result : Growth_Rule.Instance;
begin
Result.Initialize (Get_Symbol (Head), Make_Symbol_List (Rule));
return Result;
end Make_Rule;
function ID_Hashed (Key : Character) return Hash_Type is
begin
return Hash_Type'Val (Character'Pos (Key));
end ID_Hashed;
function Get_Symbol (Key : Character) return Holder
is
------------------------
-- Methods prototype --
------------------------
function make_LogoAngleMinus return Holder;
function make_LogoAnglePlus return Holder;
function make_LogoForward return Holder;
function make_LogoForwardTrace return Holder;
function make_LogoPositionRestore return Holder;
function make_LogoPositionSave return Holder;
function make_LogoUTurn return Holder;
function make_OtherSymbol (Key : Character) return Holder;
-----------------------------
-- Declaration of methods --
-----------------------------
function make_LogoAngleMinus return Holder
is
use LSE.Model.Grammar.Symbol.LogoAngleMinus;
Value : Instance;
begin
Initialize (Value);
Symbol_List.Insert ('-', To_Holder (Value));
return Symbol_List.Element ('-');
end make_LogoAngleMinus;
function make_LogoAnglePlus return Holder
is
use LSE.Model.Grammar.Symbol.LogoAnglePlus;
Value : Instance;
begin
Initialize (Value);
Symbol_List.Insert ('+', To_Holder (Value));
return Symbol_List.Element ('+');
end make_LogoAnglePlus;
function make_LogoForward return Holder
is
use LSE.Model.Grammar.Symbol.LogoForward;
Value : Instance;
begin
Initialize (Value);
Symbol_List.Insert ('f', To_Holder (Value));
return Symbol_List.Element ('f');
end make_LogoForward;
function make_LogoForwardTrace return Holder
is
use LSE.Model.Grammar.Symbol.LogoForwardTrace;
Value : Instance;
begin
Initialize (Value);
Symbol_List.Insert ('F', To_Holder (Value));
return Symbol_List.Element ('F');
end make_LogoForwardTrace;
function make_LogoPositionRestore return Holder
is
use LSE.Model.Grammar.Symbol.LogoPositionRestore;
Value : Instance;
begin
Initialize (Value);
Symbol_List.Insert (']', To_Holder (Value));
return Symbol_List.Element (']');
end make_LogoPositionRestore;
function make_LogoPositionSave return Holder
is
use LSE.Model.Grammar.Symbol.LogoPositionSave;
Value : Instance;
begin
Initialize (Value);
Symbol_List.Insert ('[', To_Holder (Value));
return Symbol_List.Element ('[');
end make_LogoPositionSave;
function make_LogoUTurn return Holder
is
use LSE.Model.Grammar.Symbol.LogoUTurn;
Value : Instance;
begin
Initialize (Value);
Symbol_List.Insert ('|', To_Holder (Value));
return Symbol_List.Element ('|');
end make_LogoUTurn;
function make_OtherSymbol (Key : Character) return Holder
is
use LSE.Model.Grammar.Symbol.OtherSymbol;
Value : Instance;
begin
Initialize (Value, Key);
Symbol_List.Insert (Key, To_Holder (Value));
return Symbol_List.Element (Key);
end make_OtherSymbol;
begin
if Symbol_List.Contains (Key) then
-- Get element
return Symbol_List.Element (Key);
else
-- Create element
return (case Key is
when '-' =>
make_LogoAngleMinus,
when '+' =>
make_LogoAnglePlus,
when 'f' =>
make_LogoForward,
when 'F' =>
make_LogoForwardTrace,
when ']' =>
make_LogoPositionRestore,
when '[' =>
make_LogoPositionSave,
when '|' =>
make_LogoUTurn,
when others =>
make_OtherSymbol (Key)
);
end if;
end Get_Symbol;
function Make_Symbol_List (Value : String)
return LSE.Model.Grammar.Symbol_Utils.P_List.List
is
Result : LSE.Model.Grammar.Symbol_Utils.P_List.List;
begin
for C of Value loop
Result.Append (Get_Symbol (C));
end loop;
return Result;
end Make_Symbol_List;
end LSE.Model.L_System.Factory;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . S T O R A G E _ P O O L S . S U B P O O L S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2011-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Exceptions; use Ada.Exceptions;
with Ada.Unchecked_Conversion;
with System.Address_Image;
with System.Finalization_Masters; use System.Finalization_Masters;
with System.IO; use System.IO;
with System.Soft_Links; use System.Soft_Links;
with System.Storage_Elements; use System.Storage_Elements;
with System.Storage_Pools.Subpools.Finalization;
use System.Storage_Pools.Subpools.Finalization;
package body System.Storage_Pools.Subpools is
Finalize_Address_Table_In_Use : Boolean := False;
-- This flag should be set only when a successful allocation on a subpool
-- has been performed and the associated Finalize_Address has been added to
-- the hash table in System.Finalization_Masters.
function Address_To_FM_Node_Ptr is
new Ada.Unchecked_Conversion (Address, FM_Node_Ptr);
procedure Attach (N : not null SP_Node_Ptr; L : not null SP_Node_Ptr);
-- Attach a subpool node to a pool
-----------------------------------
-- Adjust_Controlled_Dereference --
-----------------------------------
procedure Adjust_Controlled_Dereference
(Addr : in out System.Address;
Storage_Size : in out System.Storage_Elements.Storage_Count;
Alignment : System.Storage_Elements.Storage_Count)
is
Header_And_Padding : constant Storage_Offset :=
Header_Size_With_Padding (Alignment);
begin
-- Expose the two hidden pointers by shifting the address from the
-- start of the object to the FM_Node equivalent of the pointers.
Addr := Addr - Header_And_Padding;
-- Update the size of the object to include the two pointers
Storage_Size := Storage_Size + Header_And_Padding;
end Adjust_Controlled_Dereference;
--------------
-- Allocate --
--------------
overriding procedure Allocate
(Pool : in out Root_Storage_Pool_With_Subpools;
Storage_Address : out System.Address;
Size_In_Storage_Elements : System.Storage_Elements.Storage_Count;
Alignment : System.Storage_Elements.Storage_Count)
is
begin
-- Dispatch to the user-defined implementations of Allocate_From_Subpool
-- and Default_Subpool_For_Pool.
Allocate_From_Subpool
(Root_Storage_Pool_With_Subpools'Class (Pool),
Storage_Address,
Size_In_Storage_Elements,
Alignment,
Default_Subpool_For_Pool
(Root_Storage_Pool_With_Subpools'Class (Pool)));
end Allocate;
-----------------------------
-- Allocate_Any_Controlled --
-----------------------------
procedure Allocate_Any_Controlled
(Pool : in out Root_Storage_Pool'Class;
Context_Subpool : Subpool_Handle;
Context_Master : Finalization_Masters.Finalization_Master_Ptr;
Fin_Address : Finalization_Masters.Finalize_Address_Ptr;
Addr : out System.Address;
Storage_Size : System.Storage_Elements.Storage_Count;
Alignment : System.Storage_Elements.Storage_Count;
Is_Controlled : Boolean;
On_Subpool : Boolean)
is
Is_Subpool_Allocation : constant Boolean :=
Pool in Root_Storage_Pool_With_Subpools'Class;
Master : Finalization_Master_Ptr := null;
N_Addr : Address;
N_Ptr : FM_Node_Ptr;
N_Size : Storage_Count;
Subpool : Subpool_Handle := null;
Lock_Taken : Boolean := False;
Header_And_Padding : Storage_Offset;
-- This offset includes the size of a FM_Node plus any additional
-- padding due to a larger alignment.
begin
-- Step 1: Pool-related runtime checks
-- Allocation on a pool_with_subpools. In this scenario there is a
-- master for each subpool. The master of the access type is ignored.
if Is_Subpool_Allocation then
-- Case of an allocation without a Subpool_Handle. Dispatch to the
-- implementation of Default_Subpool_For_Pool.
if Context_Subpool = null then
Subpool :=
Default_Subpool_For_Pool
(Root_Storage_Pool_With_Subpools'Class (Pool));
-- Allocation with a Subpool_Handle
else
Subpool := Context_Subpool;
end if;
-- Ensure proper ownership and chaining of the subpool
if Subpool.Owner /=
Root_Storage_Pool_With_Subpools'Class (Pool)'Unchecked_Access
or else Subpool.Node = null
or else Subpool.Node.Prev = null
or else Subpool.Node.Next = null
then
raise Program_Error with "incorrect owner of subpool";
end if;
Master := Subpool.Master'Unchecked_Access;
-- Allocation on a simple pool. In this scenario there is a master for
-- each access-to-controlled type. No context subpool should be present.
else
-- If the master is missing, then the expansion of the access type
-- failed to create one. This is a compiler bug.
pragma Assert
(Context_Master /= null, "missing master in pool allocation");
-- If a subpool is present, then this is the result of erroneous
-- allocator expansion. This is not a serious error, but it should
-- still be detected.
if Context_Subpool /= null then
raise Program_Error
with "subpool not required in pool allocation";
end if;
-- If the allocation is intended to be on a subpool, but the access
-- type's pool does not support subpools, then this is the result of
-- incorrect end-user code.
if On_Subpool then
raise Program_Error
with "pool of access type does not support subpools";
end if;
Master := Context_Master;
end if;
-- Step 2: Master, Finalize_Address-related runtime checks and size
-- calculations.
-- Allocation of a descendant from [Limited_]Controlled, a class-wide
-- object or a record with controlled components.
if Is_Controlled then
-- Synchronization:
-- Read - allocation, finalization
-- Write - finalization
Lock_Taken := True;
Lock_Task.all;
-- Do not allow the allocation of controlled objects while the
-- associated master is being finalized.
if Finalization_Started (Master.all) then
raise Program_Error with "allocation after finalization started";
end if;
-- Check whether primitive Finalize_Address is available. If it is
-- not, then either the expansion of the designated type failed or
-- the expansion of the allocator failed. This is a compiler bug.
pragma Assert
(Fin_Address /= null, "primitive Finalize_Address not available");
-- The size must account for the hidden header preceding the object.
-- Account for possible padding space before the header due to a
-- larger alignment.
Header_And_Padding := Header_Size_With_Padding (Alignment);
N_Size := Storage_Size + Header_And_Padding;
-- Non-controlled allocation
else
N_Size := Storage_Size;
end if;
-- Step 3: Allocation of object
-- For descendants of Root_Storage_Pool_With_Subpools, dispatch to the
-- implementation of Allocate_From_Subpool.
if Is_Subpool_Allocation then
Allocate_From_Subpool
(Root_Storage_Pool_With_Subpools'Class (Pool),
N_Addr, N_Size, Alignment, Subpool);
-- For descendants of Root_Storage_Pool, dispatch to the implementation
-- of Allocate.
else
Allocate (Pool, N_Addr, N_Size, Alignment);
end if;
-- Step 4: Attachment
if Is_Controlled then
-- Note that we already did "Lock_Task.all;" in Step 2 above
-- Map the allocated memory into a FM_Node record. This converts the
-- top of the allocated bits into a list header. If there is padding
-- due to larger alignment, the header is placed right next to the
-- object:
-- N_Addr N_Ptr
-- | |
-- V V
-- +-------+---------------+----------------------+
-- |Padding| Header | Object |
-- +-------+---------------+----------------------+
-- ^ ^ ^
-- | +- Header_Size -+
-- | |
-- +- Header_And_Padding --+
N_Ptr :=
Address_To_FM_Node_Ptr (N_Addr + Header_And_Padding - Header_Size);
-- Prepend the allocated object to the finalization master
-- Synchronization:
-- Write - allocation, deallocation, finalization
Attach_Unprotected (N_Ptr, Objects (Master.all));
-- Move the address from the hidden list header to the start of the
-- object. This operation effectively hides the list header.
Addr := N_Addr + Header_And_Padding;
-- Homogeneous masters service the following:
-- 1) Allocations on / Deallocations from regular pools
-- 2) Named access types
-- 3) Most cases of anonymous access types usage
-- Synchronization:
-- Read - allocation, finalization
-- Write - outside
if Master.Is_Homogeneous then
-- Synchronization:
-- Read - finalization
-- Write - allocation, outside
Set_Finalize_Address_Unprotected (Master.all, Fin_Address);
-- Heterogeneous masters service the following:
-- 1) Allocations on / Deallocations from subpools
-- 2) Certain cases of anonymous access types usage
else
-- Synchronization:
-- Read - finalization
-- Write - allocation, deallocation
Set_Heterogeneous_Finalize_Address_Unprotected (Addr, Fin_Address);
Finalize_Address_Table_In_Use := True;
end if;
Unlock_Task.all;
Lock_Taken := False;
-- Non-controlled allocation
else
Addr := N_Addr;
end if;
exception
when others =>
-- Unlock the task in case the allocation step failed and reraise the
-- exception.
if Lock_Taken then
Unlock_Task.all;
end if;
raise;
end Allocate_Any_Controlled;
------------
-- Attach --
------------
procedure Attach (N : not null SP_Node_Ptr; L : not null SP_Node_Ptr) is
begin
-- Ensure that the node has not been attached already
pragma Assert (N.Prev = null and then N.Next = null);
Lock_Task.all;
L.Next.Prev := N;
N.Next := L.Next;
L.Next := N;
N.Prev := L;
Unlock_Task.all;
-- Note: No need to unlock in case of an exception because the above
-- code can never raise one.
end Attach;
-------------------------------
-- Deallocate_Any_Controlled --
-------------------------------
procedure Deallocate_Any_Controlled
(Pool : in out Root_Storage_Pool'Class;
Addr : System.Address;
Storage_Size : System.Storage_Elements.Storage_Count;
Alignment : System.Storage_Elements.Storage_Count;
Is_Controlled : Boolean)
is
N_Addr : Address;
N_Ptr : FM_Node_Ptr;
N_Size : Storage_Count;
Header_And_Padding : Storage_Offset;
-- This offset includes the size of a FM_Node plus any additional
-- padding due to a larger alignment.
begin
-- Step 1: Detachment
if Is_Controlled then
Lock_Task.all;
begin
-- Destroy the relation pair object - Finalize_Address since it is
-- no longer needed.
if Finalize_Address_Table_In_Use then
-- Synchronization:
-- Read - finalization
-- Write - allocation, deallocation
Delete_Finalize_Address_Unprotected (Addr);
end if;
-- Account for possible padding space before the header due to a
-- larger alignment.
Header_And_Padding := Header_Size_With_Padding (Alignment);
-- N_Addr N_Ptr Addr (from input)
-- | | |
-- V V V
-- +-------+---------------+----------------------+
-- |Padding| Header | Object |
-- +-------+---------------+----------------------+
-- ^ ^ ^
-- | +- Header_Size -+
-- | |
-- +- Header_And_Padding --+
-- Convert the bits preceding the object into a list header
N_Ptr := Address_To_FM_Node_Ptr (Addr - Header_Size);
-- Detach the object from the related finalization master. This
-- action does not need to know the prior context used during
-- allocation.
-- Synchronization:
-- Write - allocation, deallocation, finalization
Detach_Unprotected (N_Ptr);
-- Move the address from the object to the beginning of the list
-- header.
N_Addr := Addr - Header_And_Padding;
-- The size of the deallocated object must include the size of the
-- hidden list header.
N_Size := Storage_Size + Header_And_Padding;
Unlock_Task.all;
exception
when others =>
-- Unlock the task in case the computations performed above
-- fail for some reason.
Unlock_Task.all;
raise;
end;
else
N_Addr := Addr;
N_Size := Storage_Size;
end if;
-- Step 2: Deallocation
-- Dispatch to the proper implementation of Deallocate. This action
-- covers both Root_Storage_Pool and Root_Storage_Pool_With_Subpools
-- implementations.
Deallocate (Pool, N_Addr, N_Size, Alignment);
end Deallocate_Any_Controlled;
------------------------------
-- Default_Subpool_For_Pool --
------------------------------
function Default_Subpool_For_Pool
(Pool : in out Root_Storage_Pool_With_Subpools)
return not null Subpool_Handle
is
pragma Unreferenced (Pool);
begin
return raise Program_Error with
"default Default_Subpool_For_Pool called; must be overridden";
end Default_Subpool_For_Pool;
------------
-- Detach --
------------
procedure Detach (N : not null SP_Node_Ptr) is
begin
-- Ensure that the node is attached to some list
pragma Assert (N.Next /= null and then N.Prev /= null);
Lock_Task.all;
N.Prev.Next := N.Next;
N.Next.Prev := N.Prev;
N.Prev := null;
N.Next := null;
Unlock_Task.all;
-- Note: No need to unlock in case of an exception because the above
-- code can never raise one.
end Detach;
--------------
-- Finalize --
--------------
overriding procedure Finalize (Controller : in out Pool_Controller) is
begin
Finalize_Pool (Controller.Enclosing_Pool.all);
end Finalize;
-------------------
-- Finalize_Pool --
-------------------
procedure Finalize_Pool (Pool : in out Root_Storage_Pool_With_Subpools) is
Curr_Ptr : SP_Node_Ptr;
Ex_Occur : Exception_Occurrence;
Raised : Boolean := False;
function Is_Empty_List (L : not null SP_Node_Ptr) return Boolean;
-- Determine whether a list contains only one element, the dummy head
-------------------
-- Is_Empty_List --
-------------------
function Is_Empty_List (L : not null SP_Node_Ptr) return Boolean is
begin
return L.Next = L and then L.Prev = L;
end Is_Empty_List;
-- Start of processing for Finalize_Pool
begin
-- It is possible for multiple tasks to cause the finalization of a
-- common pool. Allow only one task to finalize the contents.
if Pool.Finalization_Started then
return;
end if;
-- Lock the pool to prevent the creation of additional subpools while
-- the available ones are finalized. The pool remains locked because
-- either it is about to be deallocated or the associated access type
-- is about to go out of scope.
Pool.Finalization_Started := True;
while not Is_Empty_List (Pool.Subpools'Unchecked_Access) loop
Curr_Ptr := Pool.Subpools.Next;
-- Perform the following actions:
-- 1) Finalize all objects chained on the subpool's master
-- 2) Remove the subpool from the owner's list of subpools
-- 3) Deallocate the doubly linked list node associated with the
-- subpool.
-- 4) Call Deallocate_Subpool
begin
Finalize_And_Deallocate (Curr_Ptr.Subpool);
exception
when Fin_Occur : others =>
if not Raised then
Raised := True;
Save_Occurrence (Ex_Occur, Fin_Occur);
end if;
end;
end loop;
-- If the finalization of a particular master failed, reraise the
-- exception now.
if Raised then
Reraise_Occurrence (Ex_Occur);
end if;
end Finalize_Pool;
------------------------------
-- Header_Size_With_Padding --
------------------------------
function Header_Size_With_Padding
(Alignment : System.Storage_Elements.Storage_Count)
return System.Storage_Elements.Storage_Count
is
Size : constant Storage_Count := Header_Size;
begin
if Size mod Alignment = 0 then
return Size;
-- Add enough padding to reach the nearest multiple of the alignment
-- rounding up.
else
return ((Size + Alignment - 1) / Alignment) * Alignment;
end if;
end Header_Size_With_Padding;
----------------
-- Initialize --
----------------
overriding procedure Initialize (Controller : in out Pool_Controller) is
begin
Initialize_Pool (Controller.Enclosing_Pool.all);
end Initialize;
---------------------
-- Initialize_Pool --
---------------------
procedure Initialize_Pool (Pool : in out Root_Storage_Pool_With_Subpools) is
begin
-- The dummy head must point to itself in both directions
Pool.Subpools.Next := Pool.Subpools'Unchecked_Access;
Pool.Subpools.Prev := Pool.Subpools'Unchecked_Access;
end Initialize_Pool;
---------------------
-- Pool_Of_Subpool --
---------------------
function Pool_Of_Subpool
(Subpool : not null Subpool_Handle)
return access Root_Storage_Pool_With_Subpools'Class
is
begin
return Subpool.Owner;
end Pool_Of_Subpool;
----------------
-- Print_Pool --
----------------
procedure Print_Pool (Pool : Root_Storage_Pool_With_Subpools) is
Head : constant SP_Node_Ptr := Pool.Subpools'Unrestricted_Access;
Head_Seen : Boolean := False;
SP_Ptr : SP_Node_Ptr;
begin
-- Output the contents of the pool
-- Pool : 0x123456789
-- Subpools : 0x123456789
-- Fin_Start : TRUE <or> FALSE
-- Controller: OK <or> NOK
Put ("Pool : ");
Put_Line (Address_Image (Pool'Address));
Put ("Subpools : ");
Put_Line (Address_Image (Pool.Subpools'Address));
Put ("Fin_Start : ");
Put_Line (Pool.Finalization_Started'Img);
Put ("Controlled: ");
if Pool.Controller.Enclosing_Pool = Pool'Unrestricted_Access then
Put_Line ("OK");
else
Put_Line ("NOK (ERROR)");
end if;
SP_Ptr := Head;
while SP_Ptr /= null loop -- Should never be null
Put_Line ("V");
-- We see the head initially; we want to exit when we see the head a
-- second time.
if SP_Ptr = Head then
exit when Head_Seen;
Head_Seen := True;
end if;
-- The current element is null. This should never happend since the
-- list is circular.
if SP_Ptr.Prev = null then
Put_Line ("null (ERROR)");
-- The current element points back to the correct element
elsif SP_Ptr.Prev.Next = SP_Ptr then
Put_Line ("^");
-- The current element points to an erroneous element
else
Put_Line ("? (ERROR)");
end if;
-- Output the contents of the node
Put ("|Header: ");
Put (Address_Image (SP_Ptr.all'Address));
if SP_Ptr = Head then
Put_Line (" (dummy head)");
else
Put_Line ("");
end if;
Put ("| Prev: ");
if SP_Ptr.Prev = null then
Put_Line ("null");
else
Put_Line (Address_Image (SP_Ptr.Prev.all'Address));
end if;
Put ("| Next: ");
if SP_Ptr.Next = null then
Put_Line ("null");
else
Put_Line (Address_Image (SP_Ptr.Next.all'Address));
end if;
Put ("| Subp: ");
if SP_Ptr.Subpool = null then
Put_Line ("null");
else
Put_Line (Address_Image (SP_Ptr.Subpool.all'Address));
end if;
SP_Ptr := SP_Ptr.Next;
end loop;
end Print_Pool;
-------------------
-- Print_Subpool --
-------------------
procedure Print_Subpool (Subpool : Subpool_Handle) is
begin
if Subpool = null then
Put_Line ("null");
return;
end if;
-- Output the contents of a subpool
-- Owner : 0x123456789
-- Master: 0x123456789
-- Node : 0x123456789
Put ("Owner : ");
if Subpool.Owner = null then
Put_Line ("null");
else
Put_Line (Address_Image (Subpool.Owner'Address));
end if;
Put ("Master: ");
Put_Line (Address_Image (Subpool.Master'Address));
Put ("Node : ");
if Subpool.Node = null then
Put ("null");
if Subpool.Owner = null then
Put_Line (" OK");
else
Put_Line (" (ERROR)");
end if;
else
Put_Line (Address_Image (Subpool.Node'Address));
end if;
Print_Master (Subpool.Master);
end Print_Subpool;
-------------------------
-- Set_Pool_Of_Subpool --
-------------------------
procedure Set_Pool_Of_Subpool
(Subpool : not null Subpool_Handle;
To : in out Root_Storage_Pool_With_Subpools'Class)
is
N_Ptr : SP_Node_Ptr;
begin
-- If the subpool is already owned, raise Program_Error. This is a
-- direct violation of the RM rules.
if Subpool.Owner /= null then
raise Program_Error with "subpool already belongs to a pool";
end if;
-- Prevent the creation of a new subpool while the owner is being
-- finalized. This is a serious error.
if To.Finalization_Started then
raise Program_Error
with "subpool creation after finalization started";
end if;
Subpool.Owner := To'Unchecked_Access;
-- Create a subpool node and decorate it. Since this node is not
-- allocated on the owner's pool, it must be explicitly destroyed by
-- Finalize_And_Detach.
N_Ptr := new SP_Node;
N_Ptr.Subpool := Subpool;
Subpool.Node := N_Ptr;
Attach (N_Ptr, To.Subpools'Unchecked_Access);
-- Mark the subpool's master as being a heterogeneous collection of
-- controlled objects.
Set_Is_Heterogeneous (Subpool.Master);
end Set_Pool_Of_Subpool;
end System.Storage_Pools.Subpools;
|
package Var_Size is
type T (Length : Natural) is record
A : String (1 .. Length);
B : String (1 .. Length);
end record;
function A (X : T) return String;
end;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- C H E C K S --
-- --
-- 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. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Debug; use Debug;
with Einfo; use Einfo;
with Errout; use Errout;
with Exp_Ch2; use Exp_Ch2;
with Exp_Pakd; use Exp_Pakd;
with Exp_Util; use Exp_Util;
with Elists; use Elists;
with Eval_Fat; use Eval_Fat;
with Freeze; use Freeze;
with Lib; use Lib;
with Nlists; use Nlists;
with Nmake; use Nmake;
with Opt; use Opt;
with Output; use Output;
with Restrict; use Restrict;
with Rident; use Rident;
with Rtsfind; use Rtsfind;
with Sem; use Sem;
with Sem_Eval; use Sem_Eval;
with Sem_Ch3; use Sem_Ch3;
with Sem_Ch8; use Sem_Ch8;
with Sem_Res; use Sem_Res;
with Sem_Util; use Sem_Util;
with Sem_Warn; use Sem_Warn;
with Sinfo; use Sinfo;
with Sinput; use Sinput;
with Snames; use Snames;
with Sprint; use Sprint;
with Stand; use Stand;
with Targparm; use Targparm;
with Tbuild; use Tbuild;
with Ttypes; use Ttypes;
with Urealp; use Urealp;
with Validsw; use Validsw;
package body Checks is
-- General note: many of these routines are concerned with generating
-- checking code to make sure that constraint error is raised at runtime.
-- Clearly this code is only needed if the expander is active, since
-- otherwise we will not be generating code or going into the runtime
-- execution anyway.
-- We therefore disconnect most of these checks if the expander is
-- inactive. This has the additional benefit that we do not need to
-- worry about the tree being messed up by previous errors (since errors
-- turn off expansion anyway).
-- There are a few exceptions to the above rule. For instance routines
-- such as Apply_Scalar_Range_Check that do not insert any code can be
-- safely called even when the Expander is inactive (but Errors_Detected
-- is 0). The benefit of executing this code when expansion is off, is
-- the ability to emit constraint error warning for static expressions
-- even when we are not generating code.
-------------------------------------
-- Suppression of Redundant Checks --
-------------------------------------
-- This unit implements a limited circuit for removal of redundant
-- checks. The processing is based on a tracing of simple sequential
-- flow. For any sequence of statements, we save expressions that are
-- marked to be checked, and then if the same expression appears later
-- with the same check, then under certain circumstances, the second
-- check can be suppressed.
-- Basically, we can suppress the check if we know for certain that
-- the previous expression has been elaborated (together with its
-- check), and we know that the exception frame is the same, and that
-- nothing has happened to change the result of the exception.
-- Let us examine each of these three conditions in turn to describe
-- how we ensure that this condition is met.
-- First, we need to know for certain that the previous expression has
-- been executed. This is done principly by the mechanism of calling
-- Conditional_Statements_Begin at the start of any statement sequence
-- and Conditional_Statements_End at the end. The End call causes all
-- checks remembered since the Begin call to be discarded. This does
-- miss a few cases, notably the case of a nested BEGIN-END block with
-- no exception handlers. But the important thing is to be conservative.
-- The other protection is that all checks are discarded if a label
-- is encountered, since then the assumption of sequential execution
-- is violated, and we don't know enough about the flow.
-- Second, we need to know that the exception frame is the same. We
-- do this by killing all remembered checks when we enter a new frame.
-- Again, that's over-conservative, but generally the cases we can help
-- with are pretty local anyway (like the body of a loop for example).
-- Third, we must be sure to forget any checks which are no longer valid.
-- This is done by two mechanisms, first the Kill_Checks_Variable call is
-- used to note any changes to local variables. We only attempt to deal
-- with checks involving local variables, so we do not need to worry
-- about global variables. Second, a call to any non-global procedure
-- causes us to abandon all stored checks, since such a all may affect
-- the values of any local variables.
-- The following define the data structures used to deal with remembering
-- checks so that redundant checks can be eliminated as described above.
-- Right now, the only expressions that we deal with are of the form of
-- simple local objects (either declared locally, or IN parameters) or
-- such objects plus/minus a compile time known constant. We can do
-- more later on if it seems worthwhile, but this catches many simple
-- cases in practice.
-- The following record type reflects a single saved check. An entry
-- is made in the stack of saved checks if and only if the expression
-- has been elaborated with the indicated checks.
type Saved_Check is record
Killed : Boolean;
-- Set True if entry is killed by Kill_Checks
Entity : Entity_Id;
-- The entity involved in the expression that is checked
Offset : Uint;
-- A compile time value indicating the result of adding or
-- subtracting a compile time value. This value is to be
-- added to the value of the Entity. A value of zero is
-- used for the case of a simple entity reference.
Check_Type : Character;
-- This is set to 'R' for a range check (in which case Target_Type
-- is set to the target type for the range check) or to 'O' for an
-- overflow check (in which case Target_Type is set to Empty).
Target_Type : Entity_Id;
-- Used only if Do_Range_Check is set. Records the target type for
-- the check. We need this, because a check is a duplicate only if
-- it has a the same target type (or more accurately one with a
-- range that is smaller or equal to the stored target type of a
-- saved check).
end record;
-- The following table keeps track of saved checks. Rather than use an
-- extensible table. We just use a table of fixed size, and we discard
-- any saved checks that do not fit. That's very unlikely to happen and
-- this is only an optimization in any case.
Saved_Checks : array (Int range 1 .. 200) of Saved_Check;
-- Array of saved checks
Num_Saved_Checks : Nat := 0;
-- Number of saved checks
-- The following stack keeps track of statement ranges. It is treated
-- as a stack. When Conditional_Statements_Begin is called, an entry
-- is pushed onto this stack containing the value of Num_Saved_Checks
-- at the time of the call. Then when Conditional_Statements_End is
-- called, this value is popped off and used to reset Num_Saved_Checks.
-- Note: again, this is a fixed length stack with a size that should
-- always be fine. If the value of the stack pointer goes above the
-- limit, then we just forget all saved checks.
Saved_Checks_Stack : array (Int range 1 .. 100) of Nat;
Saved_Checks_TOS : Nat := 0;
-----------------------
-- Local Subprograms --
-----------------------
procedure Apply_Float_Conversion_Check
(Ck_Node : Node_Id;
Target_Typ : Entity_Id);
-- The checks on a conversion from a floating-point type to an integer
-- type are delicate. They have to be performed before conversion, they
-- have to raise an exception when the operand is a NaN, and rounding must
-- be taken into account to determine the safe bounds of the operand.
procedure Apply_Selected_Length_Checks
(Ck_Node : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
Do_Static : Boolean);
-- This is the subprogram that does all the work for Apply_Length_Check
-- and Apply_Static_Length_Check. Expr, Target_Typ and Source_Typ are as
-- described for the above routines. The Do_Static flag indicates that
-- only a static check is to be done.
procedure Apply_Selected_Range_Checks
(Ck_Node : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
Do_Static : Boolean);
-- This is the subprogram that does all the work for Apply_Range_Check.
-- Expr, Target_Typ and Source_Typ are as described for the above
-- routine. The Do_Static flag indicates that only a static check is
-- to be done.
type Check_Type is (Access_Check, Division_Check);
function Check_Needed (Nod : Node_Id; Check : Check_Type) return Boolean;
-- This function is used to see if an access or division by zero check is
-- needed. The check is to be applied to a single variable appearing in the
-- source, and N is the node for the reference. If N is not of this form,
-- True is returned with no further processing. If N is of the right form,
-- then further processing determines if the given Check is needed.
--
-- The particular circuit is to see if we have the case of a check that is
-- not needed because it appears in the right operand of a short circuited
-- conditional where the left operand guards the check. For example:
--
-- if Var = 0 or else Q / Var > 12 then
-- ...
-- end if;
--
-- In this example, the division check is not required. At the same time
-- we can issue warnings for suspicious use of non-short-circuited forms,
-- such as:
--
-- if Var = 0 or Q / Var > 12 then
-- ...
-- end if;
procedure Find_Check
(Expr : Node_Id;
Check_Type : Character;
Target_Type : Entity_Id;
Entry_OK : out Boolean;
Check_Num : out Nat;
Ent : out Entity_Id;
Ofs : out Uint);
-- This routine is used by Enable_Range_Check and Enable_Overflow_Check
-- to see if a check is of the form for optimization, and if so, to see
-- if it has already been performed. Expr is the expression to check,
-- and Check_Type is 'R' for a range check, 'O' for an overflow check.
-- Target_Type is the target type for a range check, and Empty for an
-- overflow check. If the entry is not of the form for optimization,
-- then Entry_OK is set to False, and the remaining out parameters
-- are undefined. If the entry is OK, then Ent/Ofs are set to the
-- entity and offset from the expression. Check_Num is the number of
-- a matching saved entry in Saved_Checks, or zero if no such entry
-- is located.
function Get_Discriminal (E : Entity_Id; Bound : Node_Id) return Node_Id;
-- If a discriminal is used in constraining a prival, Return reference
-- to the discriminal of the protected body (which renames the parameter
-- of the enclosing protected operation). This clumsy transformation is
-- needed because privals are created too late and their actual subtypes
-- are not available when analysing the bodies of the protected operations.
-- To be cleaned up???
function Guard_Access
(Cond : Node_Id;
Loc : Source_Ptr;
Ck_Node : Node_Id) return Node_Id;
-- In the access type case, guard the test with a test to ensure
-- that the access value is non-null, since the checks do not
-- not apply to null access values.
procedure Install_Static_Check (R_Cno : Node_Id; Loc : Source_Ptr);
-- Called by Apply_{Length,Range}_Checks to rewrite the tree with the
-- Constraint_Error node.
function Selected_Length_Checks
(Ck_Node : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
Warn_Node : Node_Id) return Check_Result;
-- Like Apply_Selected_Length_Checks, except it doesn't modify
-- anything, just returns a list of nodes as described in the spec of
-- this package for the Range_Check function.
function Selected_Range_Checks
(Ck_Node : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
Warn_Node : Node_Id) return Check_Result;
-- Like Apply_Selected_Range_Checks, except it doesn't modify anything,
-- just returns a list of nodes as described in the spec of this package
-- for the Range_Check function.
------------------------------
-- Access_Checks_Suppressed --
------------------------------
function Access_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Access_Check);
else
return Scope_Suppress (Access_Check);
end if;
end Access_Checks_Suppressed;
-------------------------------------
-- Accessibility_Checks_Suppressed --
-------------------------------------
function Accessibility_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Accessibility_Check);
else
return Scope_Suppress (Accessibility_Check);
end if;
end Accessibility_Checks_Suppressed;
-------------------------
-- Append_Range_Checks --
-------------------------
procedure Append_Range_Checks
(Checks : Check_Result;
Stmts : List_Id;
Suppress_Typ : Entity_Id;
Static_Sloc : Source_Ptr;
Flag_Node : Node_Id)
is
Internal_Flag_Node : constant Node_Id := Flag_Node;
Internal_Static_Sloc : constant Source_Ptr := Static_Sloc;
Checks_On : constant Boolean :=
(not Index_Checks_Suppressed (Suppress_Typ))
or else
(not Range_Checks_Suppressed (Suppress_Typ));
begin
-- For now we just return if Checks_On is false, however this should
-- be enhanced to check for an always True value in the condition
-- and to generate a compilation warning???
if not Checks_On then
return;
end if;
for J in 1 .. 2 loop
exit when No (Checks (J));
if Nkind (Checks (J)) = N_Raise_Constraint_Error
and then Present (Condition (Checks (J)))
then
if not Has_Dynamic_Range_Check (Internal_Flag_Node) then
Append_To (Stmts, Checks (J));
Set_Has_Dynamic_Range_Check (Internal_Flag_Node);
end if;
else
Append_To
(Stmts,
Make_Raise_Constraint_Error (Internal_Static_Sloc,
Reason => CE_Range_Check_Failed));
end if;
end loop;
end Append_Range_Checks;
------------------------
-- Apply_Access_Check --
------------------------
procedure Apply_Access_Check (N : Node_Id) is
P : constant Node_Id := Prefix (N);
begin
-- We do not need checks if we are not generating code (i.e. the
-- expander is not active). This is not just an optimization, there
-- are cases (e.g. with pragma Debug) where generating the checks
-- can cause real trouble).
if not Expander_Active then
return;
end if;
-- No check if short circuiting makes check unnecessary
if not Check_Needed (P, Access_Check) then
return;
end if;
-- Otherwise go ahead and install the check
Install_Null_Excluding_Check (P);
end Apply_Access_Check;
-------------------------------
-- Apply_Accessibility_Check --
-------------------------------
procedure Apply_Accessibility_Check (N : Node_Id; Typ : Entity_Id) is
Loc : constant Source_Ptr := Sloc (N);
Param_Ent : constant Entity_Id := Param_Entity (N);
Param_Level : Node_Id;
Type_Level : Node_Id;
begin
if Inside_A_Generic then
return;
-- Only apply the run-time check if the access parameter
-- has an associated extra access level parameter and
-- when the level of the type is less deep than the level
-- of the access parameter.
elsif Present (Param_Ent)
and then Present (Extra_Accessibility (Param_Ent))
and then UI_Gt (Object_Access_Level (N),
Type_Access_Level (Typ))
and then not Accessibility_Checks_Suppressed (Param_Ent)
and then not Accessibility_Checks_Suppressed (Typ)
then
Param_Level :=
New_Occurrence_Of (Extra_Accessibility (Param_Ent), Loc);
Type_Level :=
Make_Integer_Literal (Loc, Type_Access_Level (Typ));
-- Raise Program_Error if the accessibility level of the the access
-- parameter is deeper than the level of the target access type.
Insert_Action (N,
Make_Raise_Program_Error (Loc,
Condition =>
Make_Op_Gt (Loc,
Left_Opnd => Param_Level,
Right_Opnd => Type_Level),
Reason => PE_Accessibility_Check_Failed));
Analyze_And_Resolve (N);
end if;
end Apply_Accessibility_Check;
---------------------------
-- Apply_Alignment_Check --
---------------------------
procedure Apply_Alignment_Check (E : Entity_Id; N : Node_Id) is
AC : constant Node_Id := Address_Clause (E);
Typ : constant Entity_Id := Etype (E);
Expr : Node_Id;
Loc : Source_Ptr;
Alignment_Required : constant Boolean := Maximum_Alignment > 1;
-- Constant to show whether target requires alignment checks
begin
-- See if check needed. Note that we never need a check if the
-- maximum alignment is one, since the check will always succeed
if No (AC)
or else not Check_Address_Alignment (AC)
or else not Alignment_Required
then
return;
end if;
Loc := Sloc (AC);
Expr := Expression (AC);
if Nkind (Expr) = N_Unchecked_Type_Conversion then
Expr := Expression (Expr);
elsif Nkind (Expr) = N_Function_Call
and then Is_Entity_Name (Name (Expr))
and then Is_RTE (Entity (Name (Expr)), RE_To_Address)
then
Expr := First (Parameter_Associations (Expr));
if Nkind (Expr) = N_Parameter_Association then
Expr := Explicit_Actual_Parameter (Expr);
end if;
end if;
-- Here Expr is the address value. See if we know that the
-- value is unacceptable at compile time.
if Compile_Time_Known_Value (Expr)
and then (Known_Alignment (E) or else Known_Alignment (Typ))
then
declare
AL : Uint := Alignment (Typ);
begin
-- The object alignment might be more restrictive than the
-- type alignment.
if Known_Alignment (E) then
AL := Alignment (E);
end if;
if Expr_Value (Expr) mod AL /= 0 then
Insert_Action (N,
Make_Raise_Program_Error (Loc,
Reason => PE_Misaligned_Address_Value));
Error_Msg_NE
("?specified address for& not " &
"consistent with alignment ('R'M 13.3(27))", Expr, E);
end if;
end;
-- Here we do not know if the value is acceptable, generate
-- code to raise PE if alignment is inappropriate.
else
-- Skip generation of this code if we don't want elab code
if not Restriction_Active (No_Elaboration_Code) then
Insert_After_And_Analyze (N,
Make_Raise_Program_Error (Loc,
Condition =>
Make_Op_Ne (Loc,
Left_Opnd =>
Make_Op_Mod (Loc,
Left_Opnd =>
Unchecked_Convert_To
(RTE (RE_Integer_Address),
Duplicate_Subexpr_No_Checks (Expr)),
Right_Opnd =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (E, Loc),
Attribute_Name => Name_Alignment)),
Right_Opnd => Make_Integer_Literal (Loc, Uint_0)),
Reason => PE_Misaligned_Address_Value),
Suppress => All_Checks);
end if;
end if;
return;
exception
when RE_Not_Available =>
return;
end Apply_Alignment_Check;
-------------------------------------
-- Apply_Arithmetic_Overflow_Check --
-------------------------------------
-- This routine is called only if the type is an integer type, and
-- a software arithmetic overflow check must be performed for op
-- (add, subtract, multiply). The check is performed only if
-- Software_Overflow_Checking is enabled and Do_Overflow_Check
-- is set. In this case we expand the operation into a more complex
-- sequence of tests that ensures that overflow is properly caught.
procedure Apply_Arithmetic_Overflow_Check (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
Rtyp : constant Entity_Id := Root_Type (Typ);
Siz : constant Int := UI_To_Int (Esize (Rtyp));
Dsiz : constant Int := Siz * 2;
Opnod : Node_Id;
Ctyp : Entity_Id;
Opnd : Node_Id;
Cent : RE_Id;
begin
-- Skip this if overflow checks are done in back end, or the overflow
-- flag is not set anyway, or we are not doing code expansion.
if Backend_Overflow_Checks_On_Target
or else not Do_Overflow_Check (N)
or else not Expander_Active
then
return;
end if;
-- Otherwise, we generate the full general code for front end overflow
-- detection, which works by doing arithmetic in a larger type:
-- x op y
-- is expanded into
-- Typ (Checktyp (x) op Checktyp (y));
-- where Typ is the type of the original expression, and Checktyp is
-- an integer type of sufficient length to hold the largest possible
-- result.
-- In the case where check type exceeds the size of Long_Long_Integer,
-- we use a different approach, expanding to:
-- typ (xxx_With_Ovflo_Check (Integer_64 (x), Integer (y)))
-- where xxx is Add, Multiply or Subtract as appropriate
-- Find check type if one exists
if Dsiz <= Standard_Integer_Size then
Ctyp := Standard_Integer;
elsif Dsiz <= Standard_Long_Long_Integer_Size then
Ctyp := Standard_Long_Long_Integer;
-- No check type exists, use runtime call
else
if Nkind (N) = N_Op_Add then
Cent := RE_Add_With_Ovflo_Check;
elsif Nkind (N) = N_Op_Multiply then
Cent := RE_Multiply_With_Ovflo_Check;
else
pragma Assert (Nkind (N) = N_Op_Subtract);
Cent := RE_Subtract_With_Ovflo_Check;
end if;
Rewrite (N,
OK_Convert_To (Typ,
Make_Function_Call (Loc,
Name => New_Reference_To (RTE (Cent), Loc),
Parameter_Associations => New_List (
OK_Convert_To (RTE (RE_Integer_64), Left_Opnd (N)),
OK_Convert_To (RTE (RE_Integer_64), Right_Opnd (N))))));
Analyze_And_Resolve (N, Typ);
return;
end if;
-- If we fall through, we have the case where we do the arithmetic in
-- the next higher type and get the check by conversion. In these cases
-- Ctyp is set to the type to be used as the check type.
Opnod := Relocate_Node (N);
Opnd := OK_Convert_To (Ctyp, Left_Opnd (Opnod));
Analyze (Opnd);
Set_Etype (Opnd, Ctyp);
Set_Analyzed (Opnd, True);
Set_Left_Opnd (Opnod, Opnd);
Opnd := OK_Convert_To (Ctyp, Right_Opnd (Opnod));
Analyze (Opnd);
Set_Etype (Opnd, Ctyp);
Set_Analyzed (Opnd, True);
Set_Right_Opnd (Opnod, Opnd);
-- The type of the operation changes to the base type of the check
-- type, and we reset the overflow check indication, since clearly
-- no overflow is possible now that we are using a double length
-- type. We also set the Analyzed flag to avoid a recursive attempt
-- to expand the node.
Set_Etype (Opnod, Base_Type (Ctyp));
Set_Do_Overflow_Check (Opnod, False);
Set_Analyzed (Opnod, True);
-- Now build the outer conversion
Opnd := OK_Convert_To (Typ, Opnod);
Analyze (Opnd);
Set_Etype (Opnd, Typ);
-- In the discrete type case, we directly generate the range check
-- for the outer operand. This range check will implement the required
-- overflow check.
if Is_Discrete_Type (Typ) then
Rewrite (N, Opnd);
Generate_Range_Check (Expression (N), Typ, CE_Overflow_Check_Failed);
-- For other types, we enable overflow checking on the conversion,
-- after setting the node as analyzed to prevent recursive attempts
-- to expand the conversion node.
else
Set_Analyzed (Opnd, True);
Enable_Overflow_Check (Opnd);
Rewrite (N, Opnd);
end if;
exception
when RE_Not_Available =>
return;
end Apply_Arithmetic_Overflow_Check;
----------------------------
-- Apply_Array_Size_Check --
----------------------------
-- The situation is as follows. In GNAT 3 (GCC 2.x), the size in bits
-- is computed in 32 bits without an overflow check. That's a real
-- problem for Ada. So what we do in GNAT 3 is to approximate the
-- size of an array by manually multiplying the element size by the
-- number of elements, and comparing that against the allowed limits.
-- In GNAT 5, the size in byte is still computed in 32 bits without
-- an overflow check in the dynamic case, but the size in bits is
-- computed in 64 bits. We assume that's good enough, and we do not
-- bother to generate any front end test.
procedure Apply_Array_Size_Check (N : Node_Id; Typ : Entity_Id) is
Loc : constant Source_Ptr := Sloc (N);
Ctyp : constant Entity_Id := Component_Type (Typ);
Ent : constant Entity_Id := Defining_Identifier (N);
Decl : Node_Id;
Lo : Node_Id;
Hi : Node_Id;
Lob : Uint;
Hib : Uint;
Siz : Uint;
Xtyp : Entity_Id;
Indx : Node_Id;
Sizx : Node_Id;
Code : Node_Id;
Static : Boolean := True;
-- Set false if any index subtye bound is non-static
Umark : constant Uintp.Save_Mark := Uintp.Mark;
-- We can throw away all the Uint computations here, since they are
-- done only to generate boolean test results.
Check_Siz : Uint;
-- Size to check against
function Is_Address_Or_Import (Decl : Node_Id) return Boolean;
-- Determines if Decl is an address clause or Import/Interface pragma
-- that references the defining identifier of the current declaration.
--------------------------
-- Is_Address_Or_Import --
--------------------------
function Is_Address_Or_Import (Decl : Node_Id) return Boolean is
begin
if Nkind (Decl) = N_At_Clause then
return Chars (Identifier (Decl)) = Chars (Ent);
elsif Nkind (Decl) = N_Attribute_Definition_Clause then
return
Chars (Decl) = Name_Address
and then
Nkind (Name (Decl)) = N_Identifier
and then
Chars (Name (Decl)) = Chars (Ent);
elsif Nkind (Decl) = N_Pragma then
if (Chars (Decl) = Name_Import
or else
Chars (Decl) = Name_Interface)
and then Present (Pragma_Argument_Associations (Decl))
then
declare
F : constant Node_Id :=
First (Pragma_Argument_Associations (Decl));
begin
return
Present (F)
and then
Present (Next (F))
and then
Nkind (Expression (Next (F))) = N_Identifier
and then
Chars (Expression (Next (F))) = Chars (Ent);
end;
else
return False;
end if;
else
return False;
end if;
end Is_Address_Or_Import;
-- Start of processing for Apply_Array_Size_Check
begin
-- Do size check on local arrays. We only need this in the GCC 2
-- case, since in GCC 3, we expect the back end to properly handle
-- things. This routine can be removed when we baseline GNAT 3.
if Opt.GCC_Version >= 3 then
return;
end if;
-- No need for a check if not expanding
if not Expander_Active then
return;
end if;
-- No need for a check if checks are suppressed
if Storage_Checks_Suppressed (Typ) then
return;
end if;
-- It is pointless to insert this check inside an init proc, because
-- that's too late, we have already built the object to be the right
-- size, and if it's too large, too bad!
if Inside_Init_Proc then
return;
end if;
-- Look head for pragma interface/import or address clause applying
-- to this entity. If found, we suppress the check entirely. For now
-- we only look ahead 20 declarations to stop this becoming too slow
-- Note that eventually this whole routine gets moved to gigi.
Decl := N;
for Ctr in 1 .. 20 loop
Next (Decl);
exit when No (Decl);
if Is_Address_Or_Import (Decl) then
return;
end if;
end loop;
-- First step is to calculate the maximum number of elements. For
-- this calculation, we use the actual size of the subtype if it is
-- static, and if a bound of a subtype is non-static, we go to the
-- bound of the base type.
Siz := Uint_1;
Indx := First_Index (Typ);
while Present (Indx) loop
Xtyp := Etype (Indx);
Lo := Type_Low_Bound (Xtyp);
Hi := Type_High_Bound (Xtyp);
-- If any bound raises constraint error, we will never get this
-- far, so there is no need to generate any kind of check.
if Raises_Constraint_Error (Lo)
or else
Raises_Constraint_Error (Hi)
then
Uintp.Release (Umark);
return;
end if;
-- Otherwise get bounds values
if Is_Static_Expression (Lo) then
Lob := Expr_Value (Lo);
else
Lob := Expr_Value (Type_Low_Bound (Base_Type (Xtyp)));
Static := False;
end if;
if Is_Static_Expression (Hi) then
Hib := Expr_Value (Hi);
else
Hib := Expr_Value (Type_High_Bound (Base_Type (Xtyp)));
Static := False;
end if;
Siz := Siz * UI_Max (Hib - Lob + 1, Uint_0);
Next_Index (Indx);
end loop;
-- Compute the limit against which we want to check. For subprograms,
-- where the array will go on the stack, we use 8*2**24, which (in
-- bits) is the size of a 16 megabyte array.
if Is_Subprogram (Scope (Ent)) then
Check_Siz := Uint_2 ** 27;
else
Check_Siz := Uint_2 ** 31;
end if;
-- If we have all static bounds and Siz is too large, then we know
-- we know we have a storage error right now, so generate message
if Static and then Siz >= Check_Siz then
Insert_Action (N,
Make_Raise_Storage_Error (Loc,
Reason => SE_Object_Too_Large));
Error_Msg_N ("?Storage_Error will be raised at run-time", N);
Uintp.Release (Umark);
return;
end if;
-- Case of component size known at compile time. If the array
-- size is definitely in range, then we do not need a check.
if Known_Esize (Ctyp)
and then Siz * Esize (Ctyp) < Check_Siz
then
Uintp.Release (Umark);
return;
end if;
-- Here if a dynamic check is required
-- What we do is to build an expression for the size of the array,
-- which is computed as the 'Size of the array component, times
-- the size of each dimension.
Uintp.Release (Umark);
Sizx :=
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Ctyp, Loc),
Attribute_Name => Name_Size);
Indx := First_Index (Typ);
for J in 1 .. Number_Dimensions (Typ) loop
if Sloc (Etype (Indx)) = Sloc (N) then
Ensure_Defined (Etype (Indx), N);
end if;
Sizx :=
Make_Op_Multiply (Loc,
Left_Opnd => Sizx,
Right_Opnd =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Typ, Loc),
Attribute_Name => Name_Length,
Expressions => New_List (
Make_Integer_Literal (Loc, J))));
Next_Index (Indx);
end loop;
-- Emit the check
Code :=
Make_Raise_Storage_Error (Loc,
Condition =>
Make_Op_Ge (Loc,
Left_Opnd => Sizx,
Right_Opnd =>
Make_Integer_Literal (Loc,
Intval => Check_Siz)),
Reason => SE_Object_Too_Large);
Set_Size_Check_Code (Defining_Identifier (N), Code);
Insert_Action (N, Code, Suppress => All_Checks);
end Apply_Array_Size_Check;
----------------------------
-- Apply_Constraint_Check --
----------------------------
procedure Apply_Constraint_Check
(N : Node_Id;
Typ : Entity_Id;
No_Sliding : Boolean := False)
is
Desig_Typ : Entity_Id;
begin
if Inside_A_Generic then
return;
elsif Is_Scalar_Type (Typ) then
Apply_Scalar_Range_Check (N, Typ);
elsif Is_Array_Type (Typ) then
-- A useful optimization: an aggregate with only an others clause
-- always has the right bounds.
if Nkind (N) = N_Aggregate
and then No (Expressions (N))
and then Nkind
(First (Choices (First (Component_Associations (N)))))
= N_Others_Choice
then
return;
end if;
if Is_Constrained (Typ) then
Apply_Length_Check (N, Typ);
if No_Sliding then
Apply_Range_Check (N, Typ);
end if;
else
Apply_Range_Check (N, Typ);
end if;
elsif (Is_Record_Type (Typ)
or else Is_Private_Type (Typ))
and then Has_Discriminants (Base_Type (Typ))
and then Is_Constrained (Typ)
then
Apply_Discriminant_Check (N, Typ);
elsif Is_Access_Type (Typ) then
Desig_Typ := Designated_Type (Typ);
-- No checks necessary if expression statically null
if Nkind (N) = N_Null then
null;
-- No sliding possible on access to arrays
elsif Is_Array_Type (Desig_Typ) then
if Is_Constrained (Desig_Typ) then
Apply_Length_Check (N, Typ);
end if;
Apply_Range_Check (N, Typ);
elsif Has_Discriminants (Base_Type (Desig_Typ))
and then Is_Constrained (Desig_Typ)
then
Apply_Discriminant_Check (N, Typ);
end if;
if Can_Never_Be_Null (Typ)
and then not Can_Never_Be_Null (Etype (N))
then
Install_Null_Excluding_Check (N);
end if;
end if;
end Apply_Constraint_Check;
------------------------------
-- Apply_Discriminant_Check --
------------------------------
procedure Apply_Discriminant_Check
(N : Node_Id;
Typ : Entity_Id;
Lhs : Node_Id := Empty)
is
Loc : constant Source_Ptr := Sloc (N);
Do_Access : constant Boolean := Is_Access_Type (Typ);
S_Typ : Entity_Id := Etype (N);
Cond : Node_Id;
T_Typ : Entity_Id;
function Is_Aliased_Unconstrained_Component return Boolean;
-- It is possible for an aliased component to have a nominal
-- unconstrained subtype (through instantiation). If this is a
-- discriminated component assigned in the expansion of an aggregate
-- in an initialization, the check must be suppressed. This unusual
-- situation requires a predicate of its own (see 7503-008).
----------------------------------------
-- Is_Aliased_Unconstrained_Component --
----------------------------------------
function Is_Aliased_Unconstrained_Component return Boolean is
Comp : Entity_Id;
Pref : Node_Id;
begin
if Nkind (Lhs) /= N_Selected_Component then
return False;
else
Comp := Entity (Selector_Name (Lhs));
Pref := Prefix (Lhs);
end if;
if Ekind (Comp) /= E_Component
or else not Is_Aliased (Comp)
then
return False;
end if;
return not Comes_From_Source (Pref)
and then In_Instance
and then not Is_Constrained (Etype (Comp));
end Is_Aliased_Unconstrained_Component;
-- Start of processing for Apply_Discriminant_Check
begin
if Do_Access then
T_Typ := Designated_Type (Typ);
else
T_Typ := Typ;
end if;
-- Nothing to do if discriminant checks are suppressed or else no code
-- is to be generated
if not Expander_Active
or else Discriminant_Checks_Suppressed (T_Typ)
then
return;
end if;
-- No discriminant checks necessary for an access when expression
-- is statically Null. This is not only an optimization, this is
-- fundamental because otherwise discriminant checks may be generated
-- in init procs for types containing an access to a not-yet-frozen
-- record, causing a deadly forward reference.
-- Also, if the expression is of an access type whose designated
-- type is incomplete, then the access value must be null and
-- we suppress the check.
if Nkind (N) = N_Null then
return;
elsif Is_Access_Type (S_Typ) then
S_Typ := Designated_Type (S_Typ);
if Ekind (S_Typ) = E_Incomplete_Type then
return;
end if;
end if;
-- If an assignment target is present, then we need to generate
-- the actual subtype if the target is a parameter or aliased
-- object with an unconstrained nominal subtype.
if Present (Lhs)
and then (Present (Param_Entity (Lhs))
or else (not Is_Constrained (T_Typ)
and then Is_Aliased_View (Lhs)
and then not Is_Aliased_Unconstrained_Component))
then
T_Typ := Get_Actual_Subtype (Lhs);
end if;
-- Nothing to do if the type is unconstrained (this is the case
-- where the actual subtype in the RM sense of N is unconstrained
-- and no check is required).
if not Is_Constrained (T_Typ) then
return;
-- Ada 2005: nothing to do if the type is one for which there is a
-- partial view that is constrained.
elsif Ada_Version >= Ada_05
and then Has_Constrained_Partial_View (Base_Type (T_Typ))
then
return;
end if;
-- Nothing to do if the type is an Unchecked_Union
if Is_Unchecked_Union (Base_Type (T_Typ)) then
return;
end if;
-- Suppress checks if the subtypes are the same.
-- the check must be preserved in an assignment to a formal, because
-- the constraint is given by the actual.
if Nkind (Original_Node (N)) /= N_Allocator
and then (No (Lhs)
or else not Is_Entity_Name (Lhs)
or else No (Param_Entity (Lhs)))
then
if (Etype (N) = Typ
or else (Do_Access and then Designated_Type (Typ) = S_Typ))
and then not Is_Aliased_View (Lhs)
then
return;
end if;
-- We can also eliminate checks on allocators with a subtype mark
-- that coincides with the context type. The context type may be a
-- subtype without a constraint (common case, a generic actual).
elsif Nkind (Original_Node (N)) = N_Allocator
and then Is_Entity_Name (Expression (Original_Node (N)))
then
declare
Alloc_Typ : constant Entity_Id :=
Entity (Expression (Original_Node (N)));
begin
if Alloc_Typ = T_Typ
or else (Nkind (Parent (T_Typ)) = N_Subtype_Declaration
and then Is_Entity_Name (
Subtype_Indication (Parent (T_Typ)))
and then Alloc_Typ = Base_Type (T_Typ))
then
return;
end if;
end;
end if;
-- See if we have a case where the types are both constrained, and
-- all the constraints are constants. In this case, we can do the
-- check successfully at compile time.
-- We skip this check for the case where the node is a rewritten`
-- allocator, because it already carries the context subtype, and
-- extracting the discriminants from the aggregate is messy.
if Is_Constrained (S_Typ)
and then Nkind (Original_Node (N)) /= N_Allocator
then
declare
DconT : Elmt_Id;
Discr : Entity_Id;
DconS : Elmt_Id;
ItemS : Node_Id;
ItemT : Node_Id;
begin
-- S_Typ may not have discriminants in the case where it is a
-- private type completed by a default discriminated type. In
-- that case, we need to get the constraints from the
-- underlying_type. If the underlying type is unconstrained (i.e.
-- has no default discriminants) no check is needed.
if Has_Discriminants (S_Typ) then
Discr := First_Discriminant (S_Typ);
DconS := First_Elmt (Discriminant_Constraint (S_Typ));
else
Discr := First_Discriminant (Underlying_Type (S_Typ));
DconS :=
First_Elmt
(Discriminant_Constraint (Underlying_Type (S_Typ)));
if No (DconS) then
return;
end if;
-- A further optimization: if T_Typ is derived from S_Typ
-- without imposing a constraint, no check is needed.
if Nkind (Original_Node (Parent (T_Typ))) =
N_Full_Type_Declaration
then
declare
Type_Def : constant Node_Id :=
Type_Definition
(Original_Node (Parent (T_Typ)));
begin
if Nkind (Type_Def) = N_Derived_Type_Definition
and then Is_Entity_Name (Subtype_Indication (Type_Def))
and then Entity (Subtype_Indication (Type_Def)) = S_Typ
then
return;
end if;
end;
end if;
end if;
DconT := First_Elmt (Discriminant_Constraint (T_Typ));
while Present (Discr) loop
ItemS := Node (DconS);
ItemT := Node (DconT);
exit when
not Is_OK_Static_Expression (ItemS)
or else
not Is_OK_Static_Expression (ItemT);
if Expr_Value (ItemS) /= Expr_Value (ItemT) then
if Do_Access then -- needs run-time check.
exit;
else
Apply_Compile_Time_Constraint_Error
(N, "incorrect value for discriminant&?",
CE_Discriminant_Check_Failed, Ent => Discr);
return;
end if;
end if;
Next_Elmt (DconS);
Next_Elmt (DconT);
Next_Discriminant (Discr);
end loop;
if No (Discr) then
return;
end if;
end;
end if;
-- Here we need a discriminant check. First build the expression
-- for the comparisons of the discriminants:
-- (n.disc1 /= typ.disc1) or else
-- (n.disc2 /= typ.disc2) or else
-- ...
-- (n.discn /= typ.discn)
Cond := Build_Discriminant_Checks (N, T_Typ);
-- If Lhs is set and is a parameter, then the condition is
-- guarded by: lhs'constrained and then (condition built above)
if Present (Param_Entity (Lhs)) then
Cond :=
Make_And_Then (Loc,
Left_Opnd =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Param_Entity (Lhs), Loc),
Attribute_Name => Name_Constrained),
Right_Opnd => Cond);
end if;
if Do_Access then
Cond := Guard_Access (Cond, Loc, N);
end if;
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition => Cond,
Reason => CE_Discriminant_Check_Failed));
end Apply_Discriminant_Check;
------------------------
-- Apply_Divide_Check --
------------------------
procedure Apply_Divide_Check (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
Left : constant Node_Id := Left_Opnd (N);
Right : constant Node_Id := Right_Opnd (N);
LLB : Uint;
Llo : Uint;
Lhi : Uint;
LOK : Boolean;
Rlo : Uint;
Rhi : Uint;
ROK : Boolean;
begin
if Expander_Active
and then not Backend_Divide_Checks_On_Target
and then Check_Needed (Right, Division_Check)
then
Determine_Range (Right, ROK, Rlo, Rhi);
-- See if division by zero possible, and if so generate test. This
-- part of the test is not controlled by the -gnato switch.
if Do_Division_Check (N) then
if (not ROK) or else (Rlo <= 0 and then 0 <= Rhi) then
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Op_Eq (Loc,
Left_Opnd => Duplicate_Subexpr_Move_Checks (Right),
Right_Opnd => Make_Integer_Literal (Loc, 0)),
Reason => CE_Divide_By_Zero));
end if;
end if;
-- Test for extremely annoying case of xxx'First divided by -1
if Do_Overflow_Check (N) then
if Nkind (N) = N_Op_Divide
and then Is_Signed_Integer_Type (Typ)
then
Determine_Range (Left, LOK, Llo, Lhi);
LLB := Expr_Value (Type_Low_Bound (Base_Type (Typ)));
if ((not ROK) or else (Rlo <= (-1) and then (-1) <= Rhi))
and then
((not LOK) or else (Llo = LLB))
then
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_And_Then (Loc,
Make_Op_Eq (Loc,
Left_Opnd =>
Duplicate_Subexpr_Move_Checks (Left),
Right_Opnd => Make_Integer_Literal (Loc, LLB)),
Make_Op_Eq (Loc,
Left_Opnd =>
Duplicate_Subexpr (Right),
Right_Opnd =>
Make_Integer_Literal (Loc, -1))),
Reason => CE_Overflow_Check_Failed));
end if;
end if;
end if;
end if;
end Apply_Divide_Check;
----------------------------------
-- Apply_Float_Conversion_Check --
----------------------------------
-- Let F and I be the source and target types of the conversion.
-- The Ada standard specifies that a floating-point value X is rounded
-- to the nearest integer, with halfway cases being rounded away from
-- zero. The rounded value of X is checked against I'Range.
-- The catch in the above paragraph is that there is no good way
-- to know whether the round-to-integer operation resulted in
-- overflow. A remedy is to perform a range check in the floating-point
-- domain instead, however:
-- (1) The bounds may not be known at compile time
-- (2) The check must take into account possible rounding.
-- (3) The range of type I may not be exactly representable in F.
-- (4) The end-points I'First - 0.5 and I'Last + 0.5 may or may
-- not be in range, depending on the sign of I'First and I'Last.
-- (5) X may be a NaN, which will fail any comparison
-- The following steps take care of these issues converting X:
-- (1) If either I'First or I'Last is not known at compile time, use
-- I'Base instead of I in the next three steps and perform a
-- regular range check against I'Range after conversion.
-- (2) If I'First - 0.5 is representable in F then let Lo be that
-- value and define Lo_OK as (I'First > 0). Otherwise, let Lo be
-- F'Machine (T) and let Lo_OK be (Lo >= I'First). In other words,
-- take one of the closest floating-point numbers to T, and see if
-- it is in range or not.
-- (3) If I'Last + 0.5 is representable in F then let Hi be that value
-- and define Hi_OK as (I'Last < 0). Otherwise, let Hi be
-- F'Rounding (T) and let Hi_OK be (Hi <= I'Last).
-- (4) Raise CE when (Lo_OK and X < Lo) or (not Lo_OK and X <= Lo)
-- or (Hi_OK and X > Hi) or (not Hi_OK and X >= Hi)
procedure Apply_Float_Conversion_Check
(Ck_Node : Node_Id;
Target_Typ : Entity_Id)
is
LB : constant Node_Id := Type_Low_Bound (Target_Typ);
HB : constant Node_Id := Type_High_Bound (Target_Typ);
Loc : constant Source_Ptr := Sloc (Ck_Node);
Expr_Type : constant Entity_Id := Base_Type (Etype (Ck_Node));
Target_Base : constant Entity_Id := Implementation_Base_Type
(Target_Typ);
Max_Bound : constant Uint := UI_Expon
(Machine_Radix (Expr_Type),
Machine_Mantissa (Expr_Type) - 1) - 1;
-- Largest bound, so bound plus or minus half is a machine number of F
Ifirst,
Ilast : Uint; -- Bounds of integer type
Lo, Hi : Ureal; -- Bounds to check in floating-point domain
Lo_OK,
Hi_OK : Boolean; -- True iff Lo resp. Hi belongs to I'Range
Lo_Chk,
Hi_Chk : Node_Id; -- Expressions that are False iff check fails
Reason : RT_Exception_Code;
begin
if not Compile_Time_Known_Value (LB)
or not Compile_Time_Known_Value (HB)
then
declare
-- First check that the value falls in the range of the base
-- type, to prevent overflow during conversion and then
-- perform a regular range check against the (dynamic) bounds.
Par : constant Node_Id := Parent (Ck_Node);
pragma Assert (Target_Base /= Target_Typ);
pragma Assert (Nkind (Par) = N_Type_Conversion);
Temp : constant Entity_Id :=
Make_Defining_Identifier (Loc,
Chars => New_Internal_Name ('T'));
begin
Apply_Float_Conversion_Check (Ck_Node, Target_Base);
Set_Etype (Temp, Target_Base);
Insert_Action (Parent (Par),
Make_Object_Declaration (Loc,
Defining_Identifier => Temp,
Object_Definition => New_Occurrence_Of (Target_Typ, Loc),
Expression => New_Copy_Tree (Par)),
Suppress => All_Checks);
Insert_Action (Par,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Not_In (Loc,
Left_Opnd => New_Occurrence_Of (Temp, Loc),
Right_Opnd => New_Occurrence_Of (Target_Typ, Loc)),
Reason => CE_Range_Check_Failed));
Rewrite (Par, New_Occurrence_Of (Temp, Loc));
return;
end;
end if;
-- Get the bounds of the target type
Ifirst := Expr_Value (LB);
Ilast := Expr_Value (HB);
-- Check against lower bound
if abs (Ifirst) < Max_Bound then
Lo := UR_From_Uint (Ifirst) - Ureal_Half;
Lo_OK := (Ifirst > 0);
else
Lo := Machine (Expr_Type, UR_From_Uint (Ifirst), Round_Even, Ck_Node);
Lo_OK := (Lo >= UR_From_Uint (Ifirst));
end if;
if Lo_OK then
-- Lo_Chk := (X >= Lo)
Lo_Chk := Make_Op_Ge (Loc,
Left_Opnd => Duplicate_Subexpr_No_Checks (Ck_Node),
Right_Opnd => Make_Real_Literal (Loc, Lo));
else
-- Lo_Chk := (X > Lo)
Lo_Chk := Make_Op_Gt (Loc,
Left_Opnd => Duplicate_Subexpr_No_Checks (Ck_Node),
Right_Opnd => Make_Real_Literal (Loc, Lo));
end if;
-- Check against higher bound
if abs (Ilast) < Max_Bound then
Hi := UR_From_Uint (Ilast) + Ureal_Half;
Hi_OK := (Ilast < 0);
else
Hi := Machine (Expr_Type, UR_From_Uint (Ilast), Round_Even, Ck_Node);
Hi_OK := (Hi <= UR_From_Uint (Ilast));
end if;
if Hi_OK then
-- Hi_Chk := (X <= Hi)
Hi_Chk := Make_Op_Le (Loc,
Left_Opnd => Duplicate_Subexpr_No_Checks (Ck_Node),
Right_Opnd => Make_Real_Literal (Loc, Hi));
else
-- Hi_Chk := (X < Hi)
Hi_Chk := Make_Op_Lt (Loc,
Left_Opnd => Duplicate_Subexpr_No_Checks (Ck_Node),
Right_Opnd => Make_Real_Literal (Loc, Hi));
end if;
-- If the bounds of the target type are the same as those of the
-- base type, the check is an overflow check as a range check is
-- not performed in these cases.
if Expr_Value (Type_Low_Bound (Target_Base)) = Ifirst
and then Expr_Value (Type_High_Bound (Target_Base)) = Ilast
then
Reason := CE_Overflow_Check_Failed;
else
Reason := CE_Range_Check_Failed;
end if;
-- Raise CE if either conditions does not hold
Insert_Action (Ck_Node,
Make_Raise_Constraint_Error (Loc,
Condition => Make_Op_Not (Loc, Make_And_Then (Loc, Lo_Chk, Hi_Chk)),
Reason => Reason));
end Apply_Float_Conversion_Check;
------------------------
-- Apply_Length_Check --
------------------------
procedure Apply_Length_Check
(Ck_Node : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id := Empty)
is
begin
Apply_Selected_Length_Checks
(Ck_Node, Target_Typ, Source_Typ, Do_Static => False);
end Apply_Length_Check;
-----------------------
-- Apply_Range_Check --
-----------------------
procedure Apply_Range_Check
(Ck_Node : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id := Empty)
is
begin
Apply_Selected_Range_Checks
(Ck_Node, Target_Typ, Source_Typ, Do_Static => False);
end Apply_Range_Check;
------------------------------
-- Apply_Scalar_Range_Check --
------------------------------
-- Note that Apply_Scalar_Range_Check never turns the Do_Range_Check
-- flag off if it is already set on.
procedure Apply_Scalar_Range_Check
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id := Empty;
Fixed_Int : Boolean := False)
is
Parnt : constant Node_Id := Parent (Expr);
S_Typ : Entity_Id;
Arr : Node_Id := Empty; -- initialize to prevent warning
Arr_Typ : Entity_Id := Empty; -- initialize to prevent warning
OK : Boolean;
Is_Subscr_Ref : Boolean;
-- Set true if Expr is a subscript
Is_Unconstrained_Subscr_Ref : Boolean;
-- Set true if Expr is a subscript of an unconstrained array. In this
-- case we do not attempt to do an analysis of the value against the
-- range of the subscript, since we don't know the actual subtype.
Int_Real : Boolean;
-- Set to True if Expr should be regarded as a real value
-- even though the type of Expr might be discrete.
procedure Bad_Value;
-- Procedure called if value is determined to be out of range
---------------
-- Bad_Value --
---------------
procedure Bad_Value is
begin
Apply_Compile_Time_Constraint_Error
(Expr, "value not in range of}?", CE_Range_Check_Failed,
Ent => Target_Typ,
Typ => Target_Typ);
end Bad_Value;
-- Start of processing for Apply_Scalar_Range_Check
begin
if Inside_A_Generic then
return;
-- Return if check obviously not needed. Note that we do not check
-- for the expander being inactive, since this routine does not
-- insert any code, but it does generate useful warnings sometimes,
-- which we would like even if we are in semantics only mode.
elsif Target_Typ = Any_Type
or else not Is_Scalar_Type (Target_Typ)
or else Raises_Constraint_Error (Expr)
then
return;
end if;
-- Now, see if checks are suppressed
Is_Subscr_Ref :=
Is_List_Member (Expr) and then Nkind (Parnt) = N_Indexed_Component;
if Is_Subscr_Ref then
Arr := Prefix (Parnt);
Arr_Typ := Get_Actual_Subtype_If_Available (Arr);
end if;
if not Do_Range_Check (Expr) then
-- Subscript reference. Check for Index_Checks suppressed
if Is_Subscr_Ref then
-- Check array type and its base type
if Index_Checks_Suppressed (Arr_Typ)
or else Index_Checks_Suppressed (Base_Type (Arr_Typ))
then
return;
-- Check array itself if it is an entity name
elsif Is_Entity_Name (Arr)
and then Index_Checks_Suppressed (Entity (Arr))
then
return;
-- Check expression itself if it is an entity name
elsif Is_Entity_Name (Expr)
and then Index_Checks_Suppressed (Entity (Expr))
then
return;
end if;
-- All other cases, check for Range_Checks suppressed
else
-- Check target type and its base type
if Range_Checks_Suppressed (Target_Typ)
or else Range_Checks_Suppressed (Base_Type (Target_Typ))
then
return;
-- Check expression itself if it is an entity name
elsif Is_Entity_Name (Expr)
and then Range_Checks_Suppressed (Entity (Expr))
then
return;
-- If Expr is part of an assignment statement, then check
-- left side of assignment if it is an entity name.
elsif Nkind (Parnt) = N_Assignment_Statement
and then Is_Entity_Name (Name (Parnt))
and then Range_Checks_Suppressed (Entity (Name (Parnt)))
then
return;
end if;
end if;
end if;
-- Do not set range checks if they are killed
if Nkind (Expr) = N_Unchecked_Type_Conversion
and then Kill_Range_Check (Expr)
then
return;
end if;
-- Do not set range checks for any values from System.Scalar_Values
-- since the whole idea of such values is to avoid checking them!
if Is_Entity_Name (Expr)
and then Is_RTU (Scope (Entity (Expr)), System_Scalar_Values)
then
return;
end if;
-- Now see if we need a check
if No (Source_Typ) then
S_Typ := Etype (Expr);
else
S_Typ := Source_Typ;
end if;
if not Is_Scalar_Type (S_Typ) or else S_Typ = Any_Type then
return;
end if;
Is_Unconstrained_Subscr_Ref :=
Is_Subscr_Ref and then not Is_Constrained (Arr_Typ);
-- Always do a range check if the source type includes infinities
-- and the target type does not include infinities. We do not do
-- this if range checks are killed.
if Is_Floating_Point_Type (S_Typ)
and then Has_Infinities (S_Typ)
and then not Has_Infinities (Target_Typ)
then
Enable_Range_Check (Expr);
end if;
-- Return if we know expression is definitely in the range of
-- the target type as determined by Determine_Range. Right now
-- we only do this for discrete types, and not fixed-point or
-- floating-point types.
-- The additional less-precise tests below catch these cases
-- Note: skip this if we are given a source_typ, since the point
-- of supplying a Source_Typ is to stop us looking at the expression.
-- could sharpen this test to be out parameters only ???
if Is_Discrete_Type (Target_Typ)
and then Is_Discrete_Type (Etype (Expr))
and then not Is_Unconstrained_Subscr_Ref
and then No (Source_Typ)
then
declare
Tlo : constant Node_Id := Type_Low_Bound (Target_Typ);
Thi : constant Node_Id := Type_High_Bound (Target_Typ);
Lo : Uint;
Hi : Uint;
begin
if Compile_Time_Known_Value (Tlo)
and then Compile_Time_Known_Value (Thi)
then
declare
Lov : constant Uint := Expr_Value (Tlo);
Hiv : constant Uint := Expr_Value (Thi);
begin
-- If range is null, we for sure have a constraint error
-- (we don't even need to look at the value involved,
-- since all possible values will raise CE).
if Lov > Hiv then
Bad_Value;
return;
end if;
-- Otherwise determine range of value
Determine_Range (Expr, OK, Lo, Hi);
if OK then
-- If definitely in range, all OK
if Lo >= Lov and then Hi <= Hiv then
return;
-- If definitely not in range, warn
elsif Lov > Hi or else Hiv < Lo then
Bad_Value;
return;
-- Otherwise we don't know
else
null;
end if;
end if;
end;
end if;
end;
end if;
Int_Real :=
Is_Floating_Point_Type (S_Typ)
or else (Is_Fixed_Point_Type (S_Typ) and then not Fixed_Int);
-- Check if we can determine at compile time whether Expr is in the
-- range of the target type. Note that if S_Typ is within the bounds
-- of Target_Typ then this must be the case. This check is meaningful
-- only if this is not a conversion between integer and real types.
if not Is_Unconstrained_Subscr_Ref
and then
Is_Discrete_Type (S_Typ) = Is_Discrete_Type (Target_Typ)
and then
(In_Subrange_Of (S_Typ, Target_Typ, Fixed_Int)
or else
Is_In_Range (Expr, Target_Typ, Fixed_Int, Int_Real))
then
return;
elsif Is_Out_Of_Range (Expr, Target_Typ, Fixed_Int, Int_Real) then
Bad_Value;
return;
-- In the floating-point case, we only do range checks if the
-- type is constrained. We definitely do NOT want range checks
-- for unconstrained types, since we want to have infinities
elsif Is_Floating_Point_Type (S_Typ) then
if Is_Constrained (S_Typ) then
Enable_Range_Check (Expr);
end if;
-- For all other cases we enable a range check unconditionally
else
Enable_Range_Check (Expr);
return;
end if;
end Apply_Scalar_Range_Check;
----------------------------------
-- Apply_Selected_Length_Checks --
----------------------------------
procedure Apply_Selected_Length_Checks
(Ck_Node : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
Do_Static : Boolean)
is
Cond : Node_Id;
R_Result : Check_Result;
R_Cno : Node_Id;
Loc : constant Source_Ptr := Sloc (Ck_Node);
Checks_On : constant Boolean :=
(not Index_Checks_Suppressed (Target_Typ))
or else
(not Length_Checks_Suppressed (Target_Typ));
begin
if not Expander_Active then
return;
end if;
R_Result :=
Selected_Length_Checks (Ck_Node, Target_Typ, Source_Typ, Empty);
for J in 1 .. 2 loop
R_Cno := R_Result (J);
exit when No (R_Cno);
-- A length check may mention an Itype which is attached to a
-- subsequent node. At the top level in a package this can cause
-- an order-of-elaboration problem, so we make sure that the itype
-- is referenced now.
if Ekind (Current_Scope) = E_Package
and then Is_Compilation_Unit (Current_Scope)
then
Ensure_Defined (Target_Typ, Ck_Node);
if Present (Source_Typ) then
Ensure_Defined (Source_Typ, Ck_Node);
elsif Is_Itype (Etype (Ck_Node)) then
Ensure_Defined (Etype (Ck_Node), Ck_Node);
end if;
end if;
-- If the item is a conditional raise of constraint error,
-- then have a look at what check is being performed and
-- ???
if Nkind (R_Cno) = N_Raise_Constraint_Error
and then Present (Condition (R_Cno))
then
Cond := Condition (R_Cno);
if not Has_Dynamic_Length_Check (Ck_Node)
and then Checks_On
then
Insert_Action (Ck_Node, R_Cno);
if not Do_Static then
Set_Has_Dynamic_Length_Check (Ck_Node);
end if;
end if;
-- Output a warning if the condition is known to be True
if Is_Entity_Name (Cond)
and then Entity (Cond) = Standard_True
then
Apply_Compile_Time_Constraint_Error
(Ck_Node, "wrong length for array of}?",
CE_Length_Check_Failed,
Ent => Target_Typ,
Typ => Target_Typ);
-- If we were only doing a static check, or if checks are not
-- on, then we want to delete the check, since it is not needed.
-- We do this by replacing the if statement by a null statement
elsif Do_Static or else not Checks_On then
Rewrite (R_Cno, Make_Null_Statement (Loc));
end if;
else
Install_Static_Check (R_Cno, Loc);
end if;
end loop;
end Apply_Selected_Length_Checks;
---------------------------------
-- Apply_Selected_Range_Checks --
---------------------------------
procedure Apply_Selected_Range_Checks
(Ck_Node : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
Do_Static : Boolean)
is
Cond : Node_Id;
R_Result : Check_Result;
R_Cno : Node_Id;
Loc : constant Source_Ptr := Sloc (Ck_Node);
Checks_On : constant Boolean :=
(not Index_Checks_Suppressed (Target_Typ))
or else
(not Range_Checks_Suppressed (Target_Typ));
begin
if not Expander_Active or else not Checks_On then
return;
end if;
R_Result :=
Selected_Range_Checks (Ck_Node, Target_Typ, Source_Typ, Empty);
for J in 1 .. 2 loop
R_Cno := R_Result (J);
exit when No (R_Cno);
-- If the item is a conditional raise of constraint error,
-- then have a look at what check is being performed and
-- ???
if Nkind (R_Cno) = N_Raise_Constraint_Error
and then Present (Condition (R_Cno))
then
Cond := Condition (R_Cno);
if not Has_Dynamic_Range_Check (Ck_Node) then
Insert_Action (Ck_Node, R_Cno);
if not Do_Static then
Set_Has_Dynamic_Range_Check (Ck_Node);
end if;
end if;
-- Output a warning if the condition is known to be True
if Is_Entity_Name (Cond)
and then Entity (Cond) = Standard_True
then
-- Since an N_Range is technically not an expression, we
-- have to set one of the bounds to C_E and then just flag
-- the N_Range. The warning message will point to the
-- lower bound and complain about a range, which seems OK.
if Nkind (Ck_Node) = N_Range then
Apply_Compile_Time_Constraint_Error
(Low_Bound (Ck_Node), "static range out of bounds of}?",
CE_Range_Check_Failed,
Ent => Target_Typ,
Typ => Target_Typ);
Set_Raises_Constraint_Error (Ck_Node);
else
Apply_Compile_Time_Constraint_Error
(Ck_Node, "static value out of range of}?",
CE_Range_Check_Failed,
Ent => Target_Typ,
Typ => Target_Typ);
end if;
-- If we were only doing a static check, or if checks are not
-- on, then we want to delete the check, since it is not needed.
-- We do this by replacing the if statement by a null statement
elsif Do_Static or else not Checks_On then
Rewrite (R_Cno, Make_Null_Statement (Loc));
end if;
else
Install_Static_Check (R_Cno, Loc);
end if;
end loop;
end Apply_Selected_Range_Checks;
-------------------------------
-- Apply_Static_Length_Check --
-------------------------------
procedure Apply_Static_Length_Check
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id := Empty)
is
begin
Apply_Selected_Length_Checks
(Expr, Target_Typ, Source_Typ, Do_Static => True);
end Apply_Static_Length_Check;
-------------------------------------
-- Apply_Subscript_Validity_Checks --
-------------------------------------
procedure Apply_Subscript_Validity_Checks (Expr : Node_Id) is
Sub : Node_Id;
begin
pragma Assert (Nkind (Expr) = N_Indexed_Component);
-- Loop through subscripts
Sub := First (Expressions (Expr));
while Present (Sub) loop
-- Check one subscript. Note that we do not worry about
-- enumeration type with holes, since we will convert the
-- value to a Pos value for the subscript, and that convert
-- will do the necessary validity check.
Ensure_Valid (Sub, Holes_OK => True);
-- Move to next subscript
Sub := Next (Sub);
end loop;
end Apply_Subscript_Validity_Checks;
----------------------------------
-- Apply_Type_Conversion_Checks --
----------------------------------
procedure Apply_Type_Conversion_Checks (N : Node_Id) is
Target_Type : constant Entity_Id := Etype (N);
Target_Base : constant Entity_Id := Base_Type (Target_Type);
Expr : constant Node_Id := Expression (N);
Expr_Type : constant Entity_Id := Etype (Expr);
begin
if Inside_A_Generic then
return;
-- Skip these checks if serious errors detected, there are some nasty
-- situations of incomplete trees that blow things up.
elsif Serious_Errors_Detected > 0 then
return;
-- Scalar type conversions of the form Target_Type (Expr) require
-- a range check if we cannot be sure that Expr is in the base type
-- of Target_Typ and also that Expr is in the range of Target_Typ.
-- These are not quite the same condition from an implementation
-- point of view, but clearly the second includes the first.
elsif Is_Scalar_Type (Target_Type) then
declare
Conv_OK : constant Boolean := Conversion_OK (N);
-- If the Conversion_OK flag on the type conversion is set
-- and no floating point type is involved in the type conversion
-- then fixed point values must be read as integral values.
Float_To_Int : constant Boolean :=
Is_Floating_Point_Type (Expr_Type)
and then Is_Integer_Type (Target_Type);
begin
if not Overflow_Checks_Suppressed (Target_Base)
and then not In_Subrange_Of (Expr_Type, Target_Base, Conv_OK)
and then not Float_To_Int
then
Set_Do_Overflow_Check (N);
end if;
if not Range_Checks_Suppressed (Target_Type)
and then not Range_Checks_Suppressed (Expr_Type)
then
if Float_To_Int then
Apply_Float_Conversion_Check (Expr, Target_Type);
else
Apply_Scalar_Range_Check
(Expr, Target_Type, Fixed_Int => Conv_OK);
end if;
end if;
end;
elsif Comes_From_Source (N)
and then Is_Record_Type (Target_Type)
and then Is_Derived_Type (Target_Type)
and then not Is_Tagged_Type (Target_Type)
and then not Is_Constrained (Target_Type)
and then Present (Stored_Constraint (Target_Type))
then
-- An unconstrained derived type may have inherited discriminant
-- Build an actual discriminant constraint list using the stored
-- constraint, to verify that the expression of the parent type
-- satisfies the constraints imposed by the (unconstrained!)
-- derived type. This applies to value conversions, not to view
-- conversions of tagged types.
declare
Loc : constant Source_Ptr := Sloc (N);
Cond : Node_Id;
Constraint : Elmt_Id;
Discr_Value : Node_Id;
Discr : Entity_Id;
New_Constraints : constant Elist_Id := New_Elmt_List;
Old_Constraints : constant Elist_Id :=
Discriminant_Constraint (Expr_Type);
begin
Constraint := First_Elmt (Stored_Constraint (Target_Type));
while Present (Constraint) loop
Discr_Value := Node (Constraint);
if Is_Entity_Name (Discr_Value)
and then Ekind (Entity (Discr_Value)) = E_Discriminant
then
Discr := Corresponding_Discriminant (Entity (Discr_Value));
if Present (Discr)
and then Scope (Discr) = Base_Type (Expr_Type)
then
-- Parent is constrained by new discriminant. Obtain
-- Value of original discriminant in expression. If
-- the new discriminant has been used to constrain more
-- than one of the stored discriminants, this will
-- provide the required consistency check.
Append_Elmt (
Make_Selected_Component (Loc,
Prefix =>
Duplicate_Subexpr_No_Checks
(Expr, Name_Req => True),
Selector_Name =>
Make_Identifier (Loc, Chars (Discr))),
New_Constraints);
else
-- Discriminant of more remote ancestor ???
return;
end if;
-- Derived type definition has an explicit value for
-- this stored discriminant.
else
Append_Elmt
(Duplicate_Subexpr_No_Checks (Discr_Value),
New_Constraints);
end if;
Next_Elmt (Constraint);
end loop;
-- Use the unconstrained expression type to retrieve the
-- discriminants of the parent, and apply momentarily the
-- discriminant constraint synthesized above.
Set_Discriminant_Constraint (Expr_Type, New_Constraints);
Cond := Build_Discriminant_Checks (Expr, Expr_Type);
Set_Discriminant_Constraint (Expr_Type, Old_Constraints);
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition => Cond,
Reason => CE_Discriminant_Check_Failed));
end;
-- For arrays, conversions are applied during expansion, to take
-- into accounts changes of representation. The checks become range
-- checks on the base type or length checks on the subtype, depending
-- on whether the target type is unconstrained or constrained.
else
null;
end if;
end Apply_Type_Conversion_Checks;
----------------------------------------------
-- Apply_Universal_Integer_Attribute_Checks --
----------------------------------------------
procedure Apply_Universal_Integer_Attribute_Checks (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
begin
if Inside_A_Generic then
return;
-- Nothing to do if checks are suppressed
elsif Range_Checks_Suppressed (Typ)
and then Overflow_Checks_Suppressed (Typ)
then
return;
-- Nothing to do if the attribute does not come from source. The
-- internal attributes we generate of this type do not need checks,
-- and furthermore the attempt to check them causes some circular
-- elaboration orders when dealing with packed types.
elsif not Comes_From_Source (N) then
return;
-- If the prefix is a selected component that depends on a discriminant
-- the check may improperly expose a discriminant instead of using
-- the bounds of the object itself. Set the type of the attribute to
-- the base type of the context, so that a check will be imposed when
-- needed (e.g. if the node appears as an index).
elsif Nkind (Prefix (N)) = N_Selected_Component
and then Ekind (Typ) = E_Signed_Integer_Subtype
and then Depends_On_Discriminant (Scalar_Range (Typ))
then
Set_Etype (N, Base_Type (Typ));
-- Otherwise, replace the attribute node with a type conversion
-- node whose expression is the attribute, retyped to universal
-- integer, and whose subtype mark is the target type. The call
-- to analyze this conversion will set range and overflow checks
-- as required for proper detection of an out of range value.
else
Set_Etype (N, Universal_Integer);
Set_Analyzed (N, True);
Rewrite (N,
Make_Type_Conversion (Loc,
Subtype_Mark => New_Occurrence_Of (Typ, Loc),
Expression => Relocate_Node (N)));
Analyze_And_Resolve (N, Typ);
return;
end if;
end Apply_Universal_Integer_Attribute_Checks;
-------------------------------
-- Build_Discriminant_Checks --
-------------------------------
function Build_Discriminant_Checks
(N : Node_Id;
T_Typ : Entity_Id) return Node_Id
is
Loc : constant Source_Ptr := Sloc (N);
Cond : Node_Id;
Disc : Elmt_Id;
Disc_Ent : Entity_Id;
Dref : Node_Id;
Dval : Node_Id;
function Aggregate_Discriminant_Val (Disc : Entity_Id) return Node_Id;
----------------------------------
-- Aggregate_Discriminant_Value --
----------------------------------
function Aggregate_Discriminant_Val (Disc : Entity_Id) return Node_Id is
Assoc : Node_Id;
begin
-- The aggregate has been normalized with named associations. We
-- use the Chars field to locate the discriminant to take into
-- account discriminants in derived types, which carry the same
-- name as those in the parent.
Assoc := First (Component_Associations (N));
while Present (Assoc) loop
if Chars (First (Choices (Assoc))) = Chars (Disc) then
return Expression (Assoc);
else
Next (Assoc);
end if;
end loop;
-- Discriminant must have been found in the loop above
raise Program_Error;
end Aggregate_Discriminant_Val;
-- Start of processing for Build_Discriminant_Checks
begin
-- Loop through discriminants evolving the condition
Cond := Empty;
Disc := First_Elmt (Discriminant_Constraint (T_Typ));
-- For a fully private type, use the discriminants of the parent type
if Is_Private_Type (T_Typ)
and then No (Full_View (T_Typ))
then
Disc_Ent := First_Discriminant (Etype (Base_Type (T_Typ)));
else
Disc_Ent := First_Discriminant (T_Typ);
end if;
while Present (Disc) loop
Dval := Node (Disc);
if Nkind (Dval) = N_Identifier
and then Ekind (Entity (Dval)) = E_Discriminant
then
Dval := New_Occurrence_Of (Discriminal (Entity (Dval)), Loc);
else
Dval := Duplicate_Subexpr_No_Checks (Dval);
end if;
-- If we have an Unchecked_Union node, we can infer the discriminants
-- of the node.
if Is_Unchecked_Union (Base_Type (T_Typ)) then
Dref := New_Copy (
Get_Discriminant_Value (
First_Discriminant (T_Typ),
T_Typ,
Stored_Constraint (T_Typ)));
elsif Nkind (N) = N_Aggregate then
Dref :=
Duplicate_Subexpr_No_Checks
(Aggregate_Discriminant_Val (Disc_Ent));
else
Dref :=
Make_Selected_Component (Loc,
Prefix =>
Duplicate_Subexpr_No_Checks (N, Name_Req => True),
Selector_Name =>
Make_Identifier (Loc, Chars (Disc_Ent)));
Set_Is_In_Discriminant_Check (Dref);
end if;
Evolve_Or_Else (Cond,
Make_Op_Ne (Loc,
Left_Opnd => Dref,
Right_Opnd => Dval));
Next_Elmt (Disc);
Next_Discriminant (Disc_Ent);
end loop;
return Cond;
end Build_Discriminant_Checks;
------------------
-- Check_Needed --
------------------
function Check_Needed (Nod : Node_Id; Check : Check_Type) return Boolean is
N : Node_Id;
P : Node_Id;
K : Node_Kind;
L : Node_Id;
R : Node_Id;
begin
-- Always check if not simple entity
if Nkind (Nod) not in N_Has_Entity
or else not Comes_From_Source (Nod)
then
return True;
end if;
-- Look up tree for short circuit
N := Nod;
loop
P := Parent (N);
K := Nkind (P);
if K not in N_Subexpr then
return True;
-- Or/Or Else case, left operand must be equality test
elsif K = N_Op_Or or else K = N_Or_Else then
exit when N = Right_Opnd (P)
and then Nkind (Left_Opnd (P)) = N_Op_Eq;
-- And/And then case, left operand must be inequality test
elsif K = N_Op_And or else K = N_And_Then then
exit when N = Right_Opnd (P)
and then Nkind (Left_Opnd (P)) = N_Op_Ne;
end if;
N := P;
end loop;
-- If we fall through the loop, then we have a conditional with an
-- appropriate test as its left operand. So test further.
L := Left_Opnd (P);
if Nkind (L) = N_Op_Not then
L := Right_Opnd (L);
end if;
R := Right_Opnd (L);
L := Left_Opnd (L);
-- Left operand of test must match original variable
if Nkind (L) not in N_Has_Entity
or else Entity (L) /= Entity (Nod)
then
return True;
end if;
-- Right operand of test mus be key value (zero or null)
case Check is
when Access_Check =>
if Nkind (R) /= N_Null then
return True;
end if;
when Division_Check =>
if not Compile_Time_Known_Value (R)
or else Expr_Value (R) /= Uint_0
then
return True;
end if;
end case;
-- Here we have the optimizable case, warn if not short-circuited
if K = N_Op_And or else K = N_Op_Or then
case Check is
when Access_Check =>
Error_Msg_N
("Constraint_Error may be raised (access check)?",
Parent (Nod));
when Division_Check =>
Error_Msg_N
("Constraint_Error may be raised (zero divide)?",
Parent (Nod));
end case;
if K = N_Op_And then
Error_Msg_N ("use `AND THEN` instead of AND?", P);
else
Error_Msg_N ("use `OR ELSE` instead of OR?", P);
end if;
-- If not short-circuited, we need the ckeck
return True;
-- If short-circuited, we can omit the check
else
return False;
end if;
end Check_Needed;
-----------------------------------
-- Check_Valid_Lvalue_Subscripts --
-----------------------------------
procedure Check_Valid_Lvalue_Subscripts (Expr : Node_Id) is
begin
-- Skip this if range checks are suppressed
if Range_Checks_Suppressed (Etype (Expr)) then
return;
-- Only do this check for expressions that come from source. We
-- assume that expander generated assignments explicitly include
-- any necessary checks. Note that this is not just an optimization,
-- it avoids infinite recursions!
elsif not Comes_From_Source (Expr) then
return;
-- For a selected component, check the prefix
elsif Nkind (Expr) = N_Selected_Component then
Check_Valid_Lvalue_Subscripts (Prefix (Expr));
return;
-- Case of indexed component
elsif Nkind (Expr) = N_Indexed_Component then
Apply_Subscript_Validity_Checks (Expr);
-- Prefix may itself be or contain an indexed component, and
-- these subscripts need checking as well
Check_Valid_Lvalue_Subscripts (Prefix (Expr));
end if;
end Check_Valid_Lvalue_Subscripts;
----------------------------------
-- Null_Exclusion_Static_Checks --
----------------------------------
procedure Null_Exclusion_Static_Checks (N : Node_Id) is
K : constant Node_Kind := Nkind (N);
Typ : Entity_Id;
Related_Nod : Node_Id;
Has_Null_Exclusion : Boolean := False;
begin
pragma Assert (K = N_Parameter_Specification
or else K = N_Object_Declaration
or else K = N_Discriminant_Specification
or else K = N_Component_Declaration);
Typ := Etype (Defining_Identifier (N));
pragma Assert (Is_Access_Type (Typ)
or else (K = N_Object_Declaration and then Is_Array_Type (Typ)));
case K is
when N_Parameter_Specification =>
Related_Nod := Parameter_Type (N);
Has_Null_Exclusion := Null_Exclusion_Present (N);
when N_Object_Declaration =>
Related_Nod := Object_Definition (N);
Has_Null_Exclusion := Null_Exclusion_Present (N);
when N_Discriminant_Specification =>
Related_Nod := Discriminant_Type (N);
Has_Null_Exclusion := Null_Exclusion_Present (N);
when N_Component_Declaration =>
if Present (Access_Definition (Component_Definition (N))) then
Related_Nod := Component_Definition (N);
Has_Null_Exclusion :=
Null_Exclusion_Present
(Access_Definition (Component_Definition (N)));
else
Related_Nod :=
Subtype_Indication (Component_Definition (N));
Has_Null_Exclusion :=
Null_Exclusion_Present (Component_Definition (N));
end if;
when others =>
raise Program_Error;
end case;
-- Enforce legality rule 3.10 (14/1): A null_exclusion is only allowed
-- of the access subtype does not exclude null.
if Has_Null_Exclusion
and then Can_Never_Be_Null (Typ)
-- No need to check itypes that have the null-excluding attribute
-- because they were checked at their point of creation
and then not Is_Itype (Typ)
then
Error_Msg_N
("(Ada 2005) already a null-excluding type", Related_Nod);
end if;
-- Check that null-excluding objects are always initialized
if K = N_Object_Declaration
and then No (Expression (N))
then
-- Add a an expression that assignates null. This node is needed
-- by Apply_Compile_Time_Constraint_Error, that will replace this
-- node by a Constraint_Error node.
Set_Expression (N, Make_Null (Sloc (N)));
Set_Etype (Expression (N), Etype (Defining_Identifier (N)));
Apply_Compile_Time_Constraint_Error
(N => Expression (N),
Msg => "(Ada 2005) null-excluding objects must be initialized?",
Reason => CE_Null_Not_Allowed);
end if;
-- Check that the null value is not used as a single expression to
-- assignate a value to a null-excluding component, formal or object;
-- otherwise generate a warning message at the sloc of Related_Nod and
-- replace Expression (N) by an N_Contraint_Error node.
declare
Expr : constant Node_Id := Expression (N);
begin
if Present (Expr)
and then Nkind (Expr) = N_Null
then
case K is
when N_Discriminant_Specification |
N_Component_Declaration =>
Apply_Compile_Time_Constraint_Error
(N => Expr,
Msg => "(Ada 2005) NULL not allowed in"
& " null-excluding components?",
Reason => CE_Null_Not_Allowed);
when N_Parameter_Specification =>
Apply_Compile_Time_Constraint_Error
(N => Expr,
Msg => "(Ada 2005) NULL not allowed in"
& " null-excluding formals?",
Reason => CE_Null_Not_Allowed);
when N_Object_Declaration =>
Apply_Compile_Time_Constraint_Error
(N => Expr,
Msg => "(Ada 2005) NULL not allowed in"
& " null-excluding objects?",
Reason => CE_Null_Not_Allowed);
when others =>
null;
end case;
end if;
end;
end Null_Exclusion_Static_Checks;
----------------------------------
-- Conditional_Statements_Begin --
----------------------------------
procedure Conditional_Statements_Begin is
begin
Saved_Checks_TOS := Saved_Checks_TOS + 1;
-- If stack overflows, kill all checks, that way we know to
-- simply reset the number of saved checks to zero on return.
-- This should never occur in practice.
if Saved_Checks_TOS > Saved_Checks_Stack'Last then
Kill_All_Checks;
-- In the normal case, we just make a new stack entry saving
-- the current number of saved checks for a later restore.
else
Saved_Checks_Stack (Saved_Checks_TOS) := Num_Saved_Checks;
if Debug_Flag_CC then
w ("Conditional_Statements_Begin: Num_Saved_Checks = ",
Num_Saved_Checks);
end if;
end if;
end Conditional_Statements_Begin;
--------------------------------
-- Conditional_Statements_End --
--------------------------------
procedure Conditional_Statements_End is
begin
pragma Assert (Saved_Checks_TOS > 0);
-- If the saved checks stack overflowed, then we killed all
-- checks, so setting the number of saved checks back to
-- zero is correct. This should never occur in practice.
if Saved_Checks_TOS > Saved_Checks_Stack'Last then
Num_Saved_Checks := 0;
-- In the normal case, restore the number of saved checks
-- from the top stack entry.
else
Num_Saved_Checks := Saved_Checks_Stack (Saved_Checks_TOS);
if Debug_Flag_CC then
w ("Conditional_Statements_End: Num_Saved_Checks = ",
Num_Saved_Checks);
end if;
end if;
Saved_Checks_TOS := Saved_Checks_TOS - 1;
end Conditional_Statements_End;
---------------------
-- Determine_Range --
---------------------
Cache_Size : constant := 2 ** 10;
type Cache_Index is range 0 .. Cache_Size - 1;
-- Determine size of below cache (power of 2 is more efficient!)
Determine_Range_Cache_N : array (Cache_Index) of Node_Id;
Determine_Range_Cache_Lo : array (Cache_Index) of Uint;
Determine_Range_Cache_Hi : array (Cache_Index) of Uint;
-- The above arrays are used to implement a small direct cache
-- for Determine_Range calls. Because of the way Determine_Range
-- recursively traces subexpressions, and because overflow checking
-- calls the routine on the way up the tree, a quadratic behavior
-- can otherwise be encountered in large expressions. The cache
-- entry for node N is stored in the (N mod Cache_Size) entry, and
-- can be validated by checking the actual node value stored there.
procedure Determine_Range
(N : Node_Id;
OK : out Boolean;
Lo : out Uint;
Hi : out Uint)
is
Typ : constant Entity_Id := Etype (N);
Lo_Left : Uint;
Hi_Left : Uint;
-- Lo and Hi bounds of left operand
Lo_Right : Uint;
Hi_Right : Uint;
-- Lo and Hi bounds of right (or only) operand
Bound : Node_Id;
-- Temp variable used to hold a bound node
Hbound : Uint;
-- High bound of base type of expression
Lor : Uint;
Hir : Uint;
-- Refined values for low and high bounds, after tightening
OK1 : Boolean;
-- Used in lower level calls to indicate if call succeeded
Cindex : Cache_Index;
-- Used to search cache
function OK_Operands return Boolean;
-- Used for binary operators. Determines the ranges of the left and
-- right operands, and if they are both OK, returns True, and puts
-- the results in Lo_Right, Hi_Right, Lo_Left, Hi_Left
-----------------
-- OK_Operands --
-----------------
function OK_Operands return Boolean is
begin
Determine_Range (Left_Opnd (N), OK1, Lo_Left, Hi_Left);
if not OK1 then
return False;
end if;
Determine_Range (Right_Opnd (N), OK1, Lo_Right, Hi_Right);
return OK1;
end OK_Operands;
-- Start of processing for Determine_Range
begin
-- Prevent junk warnings by initializing range variables
Lo := No_Uint;
Hi := No_Uint;
Lor := No_Uint;
Hir := No_Uint;
-- If the type is not discrete, or is undefined, then we can't
-- do anything about determining the range.
if No (Typ) or else not Is_Discrete_Type (Typ)
or else Error_Posted (N)
then
OK := False;
return;
end if;
-- For all other cases, we can determine the range
OK := True;
-- If value is compile time known, then the possible range is the
-- one value that we know this expression definitely has!
if Compile_Time_Known_Value (N) then
Lo := Expr_Value (N);
Hi := Lo;
return;
end if;
-- Return if already in the cache
Cindex := Cache_Index (N mod Cache_Size);
if Determine_Range_Cache_N (Cindex) = N then
Lo := Determine_Range_Cache_Lo (Cindex);
Hi := Determine_Range_Cache_Hi (Cindex);
return;
end if;
-- Otherwise, start by finding the bounds of the type of the
-- expression, the value cannot be outside this range (if it
-- is, then we have an overflow situation, which is a separate
-- check, we are talking here only about the expression value).
-- We use the actual bound unless it is dynamic, in which case
-- use the corresponding base type bound if possible. If we can't
-- get a bound then we figure we can't determine the range (a
-- peculiar case, that perhaps cannot happen, but there is no
-- point in bombing in this optimization circuit.
-- First the low bound
Bound := Type_Low_Bound (Typ);
if Compile_Time_Known_Value (Bound) then
Lo := Expr_Value (Bound);
elsif Compile_Time_Known_Value (Type_Low_Bound (Base_Type (Typ))) then
Lo := Expr_Value (Type_Low_Bound (Base_Type (Typ)));
else
OK := False;
return;
end if;
-- Now the high bound
Bound := Type_High_Bound (Typ);
-- We need the high bound of the base type later on, and this should
-- always be compile time known. Again, it is not clear that this
-- can ever be false, but no point in bombing.
if Compile_Time_Known_Value (Type_High_Bound (Base_Type (Typ))) then
Hbound := Expr_Value (Type_High_Bound (Base_Type (Typ)));
Hi := Hbound;
else
OK := False;
return;
end if;
-- If we have a static subtype, then that may have a tighter bound
-- so use the upper bound of the subtype instead in this case.
if Compile_Time_Known_Value (Bound) then
Hi := Expr_Value (Bound);
end if;
-- We may be able to refine this value in certain situations. If
-- refinement is possible, then Lor and Hir are set to possibly
-- tighter bounds, and OK1 is set to True.
case Nkind (N) is
-- For unary plus, result is limited by range of operand
when N_Op_Plus =>
Determine_Range (Right_Opnd (N), OK1, Lor, Hir);
-- For unary minus, determine range of operand, and negate it
when N_Op_Minus =>
Determine_Range (Right_Opnd (N), OK1, Lo_Right, Hi_Right);
if OK1 then
Lor := -Hi_Right;
Hir := -Lo_Right;
end if;
-- For binary addition, get range of each operand and do the
-- addition to get the result range.
when N_Op_Add =>
if OK_Operands then
Lor := Lo_Left + Lo_Right;
Hir := Hi_Left + Hi_Right;
end if;
-- Division is tricky. The only case we consider is where the
-- right operand is a positive constant, and in this case we
-- simply divide the bounds of the left operand
when N_Op_Divide =>
if OK_Operands then
if Lo_Right = Hi_Right
and then Lo_Right > 0
then
Lor := Lo_Left / Lo_Right;
Hir := Hi_Left / Lo_Right;
else
OK1 := False;
end if;
end if;
-- For binary subtraction, get range of each operand and do
-- the worst case subtraction to get the result range.
when N_Op_Subtract =>
if OK_Operands then
Lor := Lo_Left - Hi_Right;
Hir := Hi_Left - Lo_Right;
end if;
-- For MOD, if right operand is a positive constant, then
-- result must be in the allowable range of mod results.
when N_Op_Mod =>
if OK_Operands then
if Lo_Right = Hi_Right
and then Lo_Right /= 0
then
if Lo_Right > 0 then
Lor := Uint_0;
Hir := Lo_Right - 1;
else -- Lo_Right < 0
Lor := Lo_Right + 1;
Hir := Uint_0;
end if;
else
OK1 := False;
end if;
end if;
-- For REM, if right operand is a positive constant, then
-- result must be in the allowable range of mod results.
when N_Op_Rem =>
if OK_Operands then
if Lo_Right = Hi_Right
and then Lo_Right /= 0
then
declare
Dval : constant Uint := (abs Lo_Right) - 1;
begin
-- The sign of the result depends on the sign of the
-- dividend (but not on the sign of the divisor, hence
-- the abs operation above).
if Lo_Left < 0 then
Lor := -Dval;
else
Lor := Uint_0;
end if;
if Hi_Left < 0 then
Hir := Uint_0;
else
Hir := Dval;
end if;
end;
else
OK1 := False;
end if;
end if;
-- Attribute reference cases
when N_Attribute_Reference =>
case Attribute_Name (N) is
-- For Pos/Val attributes, we can refine the range using the
-- possible range of values of the attribute expression
when Name_Pos | Name_Val =>
Determine_Range (First (Expressions (N)), OK1, Lor, Hir);
-- For Length attribute, use the bounds of the corresponding
-- index type to refine the range.
when Name_Length =>
declare
Atyp : Entity_Id := Etype (Prefix (N));
Inum : Nat;
Indx : Node_Id;
LL, LU : Uint;
UL, UU : Uint;
begin
if Is_Access_Type (Atyp) then
Atyp := Designated_Type (Atyp);
end if;
-- For string literal, we know exact value
if Ekind (Atyp) = E_String_Literal_Subtype then
OK := True;
Lo := String_Literal_Length (Atyp);
Hi := String_Literal_Length (Atyp);
return;
end if;
-- Otherwise check for expression given
if No (Expressions (N)) then
Inum := 1;
else
Inum :=
UI_To_Int (Expr_Value (First (Expressions (N))));
end if;
Indx := First_Index (Atyp);
for J in 2 .. Inum loop
Indx := Next_Index (Indx);
end loop;
Determine_Range
(Type_Low_Bound (Etype (Indx)), OK1, LL, LU);
if OK1 then
Determine_Range
(Type_High_Bound (Etype (Indx)), OK1, UL, UU);
if OK1 then
-- The maximum value for Length is the biggest
-- possible gap between the values of the bounds.
-- But of course, this value cannot be negative.
Hir := UI_Max (Uint_0, UU - LL);
-- For constrained arrays, the minimum value for
-- Length is taken from the actual value of the
-- bounds, since the index will be exactly of
-- this subtype.
if Is_Constrained (Atyp) then
Lor := UI_Max (Uint_0, UL - LU);
-- For an unconstrained array, the minimum value
-- for length is always zero.
else
Lor := Uint_0;
end if;
end if;
end if;
end;
-- No special handling for other attributes
-- Probably more opportunities exist here ???
when others =>
OK1 := False;
end case;
-- For type conversion from one discrete type to another, we
-- can refine the range using the converted value.
when N_Type_Conversion =>
Determine_Range (Expression (N), OK1, Lor, Hir);
-- Nothing special to do for all other expression kinds
when others =>
OK1 := False;
Lor := No_Uint;
Hir := No_Uint;
end case;
-- At this stage, if OK1 is true, then we know that the actual
-- result of the computed expression is in the range Lor .. Hir.
-- We can use this to restrict the possible range of results.
if OK1 then
-- If the refined value of the low bound is greater than the
-- type high bound, then reset it to the more restrictive
-- value. However, we do NOT do this for the case of a modular
-- type where the possible upper bound on the value is above the
-- base type high bound, because that means the result could wrap.
if Lor > Lo
and then not (Is_Modular_Integer_Type (Typ)
and then Hir > Hbound)
then
Lo := Lor;
end if;
-- Similarly, if the refined value of the high bound is less
-- than the value so far, then reset it to the more restrictive
-- value. Again, we do not do this if the refined low bound is
-- negative for a modular type, since this would wrap.
if Hir < Hi
and then not (Is_Modular_Integer_Type (Typ)
and then Lor < Uint_0)
then
Hi := Hir;
end if;
end if;
-- Set cache entry for future call and we are all done
Determine_Range_Cache_N (Cindex) := N;
Determine_Range_Cache_Lo (Cindex) := Lo;
Determine_Range_Cache_Hi (Cindex) := Hi;
return;
-- If any exception occurs, it means that we have some bug in the compiler
-- possibly triggered by a previous error, or by some unforseen peculiar
-- occurrence. However, this is only an optimization attempt, so there is
-- really no point in crashing the compiler. Instead we just decide, too
-- bad, we can't figure out a range in this case after all.
exception
when others =>
-- Debug flag K disables this behavior (useful for debugging)
if Debug_Flag_K then
raise;
else
OK := False;
Lo := No_Uint;
Hi := No_Uint;
return;
end if;
end Determine_Range;
------------------------------------
-- Discriminant_Checks_Suppressed --
------------------------------------
function Discriminant_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) then
if Is_Unchecked_Union (E) then
return True;
elsif Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Discriminant_Check);
end if;
end if;
return Scope_Suppress (Discriminant_Check);
end Discriminant_Checks_Suppressed;
--------------------------------
-- Division_Checks_Suppressed --
--------------------------------
function Division_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Division_Check);
else
return Scope_Suppress (Division_Check);
end if;
end Division_Checks_Suppressed;
-----------------------------------
-- Elaboration_Checks_Suppressed --
-----------------------------------
function Elaboration_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
-- The complication in this routine is that if we are in the dynamic
-- model of elaboration, we also check All_Checks, since All_Checks
-- does not set Elaboration_Check explicitly.
if Present (E) then
if Kill_Elaboration_Checks (E) then
return True;
elsif Checks_May_Be_Suppressed (E) then
if Is_Check_Suppressed (E, Elaboration_Check) then
return True;
elsif Dynamic_Elaboration_Checks then
return Is_Check_Suppressed (E, All_Checks);
else
return False;
end if;
end if;
end if;
if Scope_Suppress (Elaboration_Check) then
return True;
elsif Dynamic_Elaboration_Checks then
return Scope_Suppress (All_Checks);
else
return False;
end if;
end Elaboration_Checks_Suppressed;
---------------------------
-- Enable_Overflow_Check --
---------------------------
procedure Enable_Overflow_Check (N : Node_Id) is
Typ : constant Entity_Id := Base_Type (Etype (N));
Chk : Nat;
OK : Boolean;
Ent : Entity_Id;
Ofs : Uint;
Lo : Uint;
Hi : Uint;
begin
if Debug_Flag_CC then
w ("Enable_Overflow_Check for node ", Int (N));
Write_Str (" Source location = ");
wl (Sloc (N));
pg (N);
end if;
-- Nothing to do if the range of the result is known OK. We skip
-- this for conversions, since the caller already did the check,
-- and in any case the condition for deleting the check for a
-- type conversion is different in any case.
if Nkind (N) /= N_Type_Conversion then
Determine_Range (N, OK, Lo, Hi);
-- Note in the test below that we assume that if a bound of the
-- range is equal to that of the type. That's not quite accurate
-- but we do this for the following reasons:
-- a) The way that Determine_Range works, it will typically report
-- the bounds of the value as being equal to the bounds of the
-- type, because it either can't tell anything more precise, or
-- does not think it is worth the effort to be more precise.
-- b) It is very unusual to have a situation in which this would
-- generate an unnecessary overflow check (an example would be
-- a subtype with a range 0 .. Integer'Last - 1 to which the
-- literal value one is added.
-- c) The alternative is a lot of special casing in this routine
-- which would partially duplicate Determine_Range processing.
if OK
and then Lo > Expr_Value (Type_Low_Bound (Typ))
and then Hi < Expr_Value (Type_High_Bound (Typ))
then
if Debug_Flag_CC then
w ("No overflow check required");
end if;
return;
end if;
end if;
-- If not in optimizing mode, set flag and we are done. We are also
-- done (and just set the flag) if the type is not a discrete type,
-- since it is not worth the effort to eliminate checks for other
-- than discrete types. In addition, we take this same path if we
-- have stored the maximum number of checks possible already (a
-- very unlikely situation, but we do not want to blow up!)
if Optimization_Level = 0
or else not Is_Discrete_Type (Etype (N))
or else Num_Saved_Checks = Saved_Checks'Last
then
Set_Do_Overflow_Check (N, True);
if Debug_Flag_CC then
w ("Optimization off");
end if;
return;
end if;
-- Otherwise evaluate and check the expression
Find_Check
(Expr => N,
Check_Type => 'O',
Target_Type => Empty,
Entry_OK => OK,
Check_Num => Chk,
Ent => Ent,
Ofs => Ofs);
if Debug_Flag_CC then
w ("Called Find_Check");
w (" OK = ", OK);
if OK then
w (" Check_Num = ", Chk);
w (" Ent = ", Int (Ent));
Write_Str (" Ofs = ");
pid (Ofs);
end if;
end if;
-- If check is not of form to optimize, then set flag and we are done
if not OK then
Set_Do_Overflow_Check (N, True);
return;
end if;
-- If check is already performed, then return without setting flag
if Chk /= 0 then
if Debug_Flag_CC then
w ("Check suppressed!");
end if;
return;
end if;
-- Here we will make a new entry for the new check
Set_Do_Overflow_Check (N, True);
Num_Saved_Checks := Num_Saved_Checks + 1;
Saved_Checks (Num_Saved_Checks) :=
(Killed => False,
Entity => Ent,
Offset => Ofs,
Check_Type => 'O',
Target_Type => Empty);
if Debug_Flag_CC then
w ("Make new entry, check number = ", Num_Saved_Checks);
w (" Entity = ", Int (Ent));
Write_Str (" Offset = ");
pid (Ofs);
w (" Check_Type = O");
w (" Target_Type = Empty");
end if;
-- If we get an exception, then something went wrong, probably because
-- of an error in the structure of the tree due to an incorrect program.
-- Or it may be a bug in the optimization circuit. In either case the
-- safest thing is simply to set the check flag unconditionally.
exception
when others =>
Set_Do_Overflow_Check (N, True);
if Debug_Flag_CC then
w (" exception occurred, overflow flag set");
end if;
return;
end Enable_Overflow_Check;
------------------------
-- Enable_Range_Check --
------------------------
procedure Enable_Range_Check (N : Node_Id) is
Chk : Nat;
OK : Boolean;
Ent : Entity_Id;
Ofs : Uint;
Ttyp : Entity_Id;
P : Node_Id;
begin
-- Return if unchecked type conversion with range check killed.
-- In this case we never set the flag (that's what Kill_Range_Check
-- is all about!)
if Nkind (N) = N_Unchecked_Type_Conversion
and then Kill_Range_Check (N)
then
return;
end if;
-- Debug trace output
if Debug_Flag_CC then
w ("Enable_Range_Check for node ", Int (N));
Write_Str (" Source location = ");
wl (Sloc (N));
pg (N);
end if;
-- If not in optimizing mode, set flag and we are done. We are also
-- done (and just set the flag) if the type is not a discrete type,
-- since it is not worth the effort to eliminate checks for other
-- than discrete types. In addition, we take this same path if we
-- have stored the maximum number of checks possible already (a
-- very unlikely situation, but we do not want to blow up!)
if Optimization_Level = 0
or else No (Etype (N))
or else not Is_Discrete_Type (Etype (N))
or else Num_Saved_Checks = Saved_Checks'Last
then
Set_Do_Range_Check (N, True);
if Debug_Flag_CC then
w ("Optimization off");
end if;
return;
end if;
-- Otherwise find out the target type
P := Parent (N);
-- For assignment, use left side subtype
if Nkind (P) = N_Assignment_Statement
and then Expression (P) = N
then
Ttyp := Etype (Name (P));
-- For indexed component, use subscript subtype
elsif Nkind (P) = N_Indexed_Component then
declare
Atyp : Entity_Id;
Indx : Node_Id;
Subs : Node_Id;
begin
Atyp := Etype (Prefix (P));
if Is_Access_Type (Atyp) then
Atyp := Designated_Type (Atyp);
-- If the prefix is an access to an unconstrained array,
-- perform check unconditionally: it depends on the bounds
-- of an object and we cannot currently recognize whether
-- the test may be redundant.
if not Is_Constrained (Atyp) then
Set_Do_Range_Check (N, True);
return;
end if;
-- Ditto if the prefix is an explicit dereference whose
-- designated type is unconstrained.
elsif Nkind (Prefix (P)) = N_Explicit_Dereference
and then not Is_Constrained (Atyp)
then
Set_Do_Range_Check (N, True);
return;
end if;
Indx := First_Index (Atyp);
Subs := First (Expressions (P));
loop
if Subs = N then
Ttyp := Etype (Indx);
exit;
end if;
Next_Index (Indx);
Next (Subs);
end loop;
end;
-- For now, ignore all other cases, they are not so interesting
else
if Debug_Flag_CC then
w (" target type not found, flag set");
end if;
Set_Do_Range_Check (N, True);
return;
end if;
-- Evaluate and check the expression
Find_Check
(Expr => N,
Check_Type => 'R',
Target_Type => Ttyp,
Entry_OK => OK,
Check_Num => Chk,
Ent => Ent,
Ofs => Ofs);
if Debug_Flag_CC then
w ("Called Find_Check");
w ("Target_Typ = ", Int (Ttyp));
w (" OK = ", OK);
if OK then
w (" Check_Num = ", Chk);
w (" Ent = ", Int (Ent));
Write_Str (" Ofs = ");
pid (Ofs);
end if;
end if;
-- If check is not of form to optimize, then set flag and we are done
if not OK then
if Debug_Flag_CC then
w (" expression not of optimizable type, flag set");
end if;
Set_Do_Range_Check (N, True);
return;
end if;
-- If check is already performed, then return without setting flag
if Chk /= 0 then
if Debug_Flag_CC then
w ("Check suppressed!");
end if;
return;
end if;
-- Here we will make a new entry for the new check
Set_Do_Range_Check (N, True);
Num_Saved_Checks := Num_Saved_Checks + 1;
Saved_Checks (Num_Saved_Checks) :=
(Killed => False,
Entity => Ent,
Offset => Ofs,
Check_Type => 'R',
Target_Type => Ttyp);
if Debug_Flag_CC then
w ("Make new entry, check number = ", Num_Saved_Checks);
w (" Entity = ", Int (Ent));
Write_Str (" Offset = ");
pid (Ofs);
w (" Check_Type = R");
w (" Target_Type = ", Int (Ttyp));
pg (Ttyp);
end if;
-- If we get an exception, then something went wrong, probably because
-- of an error in the structure of the tree due to an incorrect program.
-- Or it may be a bug in the optimization circuit. In either case the
-- safest thing is simply to set the check flag unconditionally.
exception
when others =>
Set_Do_Range_Check (N, True);
if Debug_Flag_CC then
w (" exception occurred, range flag set");
end if;
return;
end Enable_Range_Check;
------------------
-- Ensure_Valid --
------------------
procedure Ensure_Valid (Expr : Node_Id; Holes_OK : Boolean := False) is
Typ : constant Entity_Id := Etype (Expr);
begin
-- Ignore call if we are not doing any validity checking
if not Validity_Checks_On then
return;
-- Ignore call if range checks suppressed on entity in question
elsif Is_Entity_Name (Expr)
and then Range_Checks_Suppressed (Entity (Expr))
then
return;
-- No check required if expression is from the expander, we assume
-- the expander will generate whatever checks are needed. Note that
-- this is not just an optimization, it avoids infinite recursions!
-- Unchecked conversions must be checked, unless they are initialized
-- scalar values, as in a component assignment in an init proc.
-- In addition, we force a check if Force_Validity_Checks is set
elsif not Comes_From_Source (Expr)
and then not Force_Validity_Checks
and then (Nkind (Expr) /= N_Unchecked_Type_Conversion
or else Kill_Range_Check (Expr))
then
return;
-- No check required if expression is known to have valid value
elsif Expr_Known_Valid (Expr) then
return;
-- No check required if checks off
elsif Range_Checks_Suppressed (Typ) then
return;
-- Ignore case of enumeration with holes where the flag is set not
-- to worry about holes, since no special validity check is needed
elsif Is_Enumeration_Type (Typ)
and then Has_Non_Standard_Rep (Typ)
and then Holes_OK
then
return;
-- No check required on the left-hand side of an assignment
elsif Nkind (Parent (Expr)) = N_Assignment_Statement
and then Expr = Name (Parent (Expr))
then
return;
-- No check on a univeral real constant. The context will eventually
-- convert it to a machine number for some target type, or report an
-- illegality.
elsif Nkind (Expr) = N_Real_Literal
and then Etype (Expr) = Universal_Real
then
return;
-- An annoying special case. If this is an out parameter of a scalar
-- type, then the value is not going to be accessed, therefore it is
-- inappropriate to do any validity check at the call site.
else
-- Only need to worry about scalar types
if Is_Scalar_Type (Typ) then
declare
P : Node_Id;
N : Node_Id;
E : Entity_Id;
F : Entity_Id;
A : Node_Id;
L : List_Id;
begin
-- Find actual argument (which may be a parameter association)
-- and the parent of the actual argument (the call statement)
N := Expr;
P := Parent (Expr);
if Nkind (P) = N_Parameter_Association then
N := P;
P := Parent (N);
end if;
-- Only need to worry if we are argument of a procedure
-- call since functions don't have out parameters. If this
-- is an indirect or dispatching call, get signature from
-- the subprogram type.
if Nkind (P) = N_Procedure_Call_Statement then
L := Parameter_Associations (P);
if Is_Entity_Name (Name (P)) then
E := Entity (Name (P));
else
pragma Assert (Nkind (Name (P)) = N_Explicit_Dereference);
E := Etype (Name (P));
end if;
-- Only need to worry if there are indeed actuals, and
-- if this could be a procedure call, otherwise we cannot
-- get a match (either we are not an argument, or the
-- mode of the formal is not OUT). This test also filters
-- out the generic case.
if Is_Non_Empty_List (L)
and then Is_Subprogram (E)
then
-- This is the loop through parameters, looking to
-- see if there is an OUT parameter for which we are
-- the argument.
F := First_Formal (E);
A := First (L);
while Present (F) loop
if Ekind (F) = E_Out_Parameter and then A = N then
return;
end if;
Next_Formal (F);
Next (A);
end loop;
end if;
end if;
end;
end if;
end if;
-- If we fall through, a validity check is required. Note that it would
-- not be good to set Do_Range_Check, even in contexts where this is
-- permissible, since this flag causes checking against the target type,
-- not the source type in contexts such as assignments
Insert_Valid_Check (Expr);
end Ensure_Valid;
----------------------
-- Expr_Known_Valid --
----------------------
function Expr_Known_Valid (Expr : Node_Id) return Boolean is
Typ : constant Entity_Id := Etype (Expr);
begin
-- Non-scalar types are always considered valid, since they never
-- give rise to the issues of erroneous or bounded error behavior
-- that are the concern. In formal reference manual terms the
-- notion of validity only applies to scalar types. Note that
-- even when packed arrays are represented using modular types,
-- they are still arrays semantically, so they are also always
-- valid (in particular, the unused bits can be random rubbish
-- without affecting the validity of the array value).
if not Is_Scalar_Type (Typ) or else Is_Packed_Array_Type (Typ) then
return True;
-- If no validity checking, then everything is considered valid
elsif not Validity_Checks_On then
return True;
-- Floating-point types are considered valid unless floating-point
-- validity checks have been specifically turned on.
elsif Is_Floating_Point_Type (Typ)
and then not Validity_Check_Floating_Point
then
return True;
-- If the expression is the value of an object that is known to
-- be valid, then clearly the expression value itself is valid.
elsif Is_Entity_Name (Expr)
and then Is_Known_Valid (Entity (Expr))
then
return True;
-- If the type is one for which all values are known valid, then
-- we are sure that the value is valid except in the slightly odd
-- case where the expression is a reference to a variable whose size
-- has been explicitly set to a value greater than the object size.
elsif Is_Known_Valid (Typ) then
if Is_Entity_Name (Expr)
and then Ekind (Entity (Expr)) = E_Variable
and then Esize (Entity (Expr)) > Esize (Typ)
then
return False;
else
return True;
end if;
-- Integer and character literals always have valid values, where
-- appropriate these will be range checked in any case.
elsif Nkind (Expr) = N_Integer_Literal
or else
Nkind (Expr) = N_Character_Literal
then
return True;
-- If we have a type conversion or a qualification of a known valid
-- value, then the result will always be valid.
elsif Nkind (Expr) = N_Type_Conversion
or else
Nkind (Expr) = N_Qualified_Expression
then
return Expr_Known_Valid (Expression (Expr));
-- The result of any operator is always considered valid, since we
-- assume the necessary checks are done by the operator. For operators
-- on floating-point operations, we must also check when the operation
-- is the right-hand side of an assignment, or is an actual in a call.
elsif
Nkind (Expr) in N_Binary_Op or else Nkind (Expr) in N_Unary_Op
then
if Is_Floating_Point_Type (Typ)
and then Validity_Check_Floating_Point
and then
(Nkind (Parent (Expr)) = N_Assignment_Statement
or else Nkind (Parent (Expr)) = N_Function_Call
or else Nkind (Parent (Expr)) = N_Parameter_Association)
then
return False;
else
return True;
end if;
-- For all other cases, we do not know the expression is valid
else
return False;
end if;
end Expr_Known_Valid;
----------------
-- Find_Check --
----------------
procedure Find_Check
(Expr : Node_Id;
Check_Type : Character;
Target_Type : Entity_Id;
Entry_OK : out Boolean;
Check_Num : out Nat;
Ent : out Entity_Id;
Ofs : out Uint)
is
function Within_Range_Of
(Target_Type : Entity_Id;
Check_Type : Entity_Id) return Boolean;
-- Given a requirement for checking a range against Target_Type, and
-- and a range Check_Type against which a check has already been made,
-- determines if the check against check type is sufficient to ensure
-- that no check against Target_Type is required.
---------------------
-- Within_Range_Of --
---------------------
function Within_Range_Of
(Target_Type : Entity_Id;
Check_Type : Entity_Id) return Boolean
is
begin
if Target_Type = Check_Type then
return True;
else
declare
Tlo : constant Node_Id := Type_Low_Bound (Target_Type);
Thi : constant Node_Id := Type_High_Bound (Target_Type);
Clo : constant Node_Id := Type_Low_Bound (Check_Type);
Chi : constant Node_Id := Type_High_Bound (Check_Type);
begin
if (Tlo = Clo
or else (Compile_Time_Known_Value (Tlo)
and then
Compile_Time_Known_Value (Clo)
and then
Expr_Value (Clo) >= Expr_Value (Tlo)))
and then
(Thi = Chi
or else (Compile_Time_Known_Value (Thi)
and then
Compile_Time_Known_Value (Chi)
and then
Expr_Value (Chi) <= Expr_Value (Clo)))
then
return True;
else
return False;
end if;
end;
end if;
end Within_Range_Of;
-- Start of processing for Find_Check
begin
-- Establish default, to avoid warnings from GCC
Check_Num := 0;
-- Case of expression is simple entity reference
if Is_Entity_Name (Expr) then
Ent := Entity (Expr);
Ofs := Uint_0;
-- Case of expression is entity + known constant
elsif Nkind (Expr) = N_Op_Add
and then Compile_Time_Known_Value (Right_Opnd (Expr))
and then Is_Entity_Name (Left_Opnd (Expr))
then
Ent := Entity (Left_Opnd (Expr));
Ofs := Expr_Value (Right_Opnd (Expr));
-- Case of expression is entity - known constant
elsif Nkind (Expr) = N_Op_Subtract
and then Compile_Time_Known_Value (Right_Opnd (Expr))
and then Is_Entity_Name (Left_Opnd (Expr))
then
Ent := Entity (Left_Opnd (Expr));
Ofs := UI_Negate (Expr_Value (Right_Opnd (Expr)));
-- Any other expression is not of the right form
else
Ent := Empty;
Ofs := Uint_0;
Entry_OK := False;
return;
end if;
-- Come here with expression of appropriate form, check if
-- entity is an appropriate one for our purposes.
if (Ekind (Ent) = E_Variable
or else
Ekind (Ent) = E_Constant
or else
Ekind (Ent) = E_Loop_Parameter
or else
Ekind (Ent) = E_In_Parameter)
and then not Is_Library_Level_Entity (Ent)
then
Entry_OK := True;
else
Entry_OK := False;
return;
end if;
-- See if there is matching check already
for J in reverse 1 .. Num_Saved_Checks loop
declare
SC : Saved_Check renames Saved_Checks (J);
begin
if SC.Killed = False
and then SC.Entity = Ent
and then SC.Offset = Ofs
and then SC.Check_Type = Check_Type
and then Within_Range_Of (Target_Type, SC.Target_Type)
then
Check_Num := J;
return;
end if;
end;
end loop;
-- If we fall through entry was not found
Check_Num := 0;
return;
end Find_Check;
---------------------------------
-- Generate_Discriminant_Check --
---------------------------------
-- Note: the code for this procedure is derived from the
-- emit_discriminant_check routine a-trans.c v1.659.
procedure Generate_Discriminant_Check (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Pref : constant Node_Id := Prefix (N);
Sel : constant Node_Id := Selector_Name (N);
Orig_Comp : constant Entity_Id :=
Original_Record_Component (Entity (Sel));
-- The original component to be checked
Discr_Fct : constant Entity_Id :=
Discriminant_Checking_Func (Orig_Comp);
-- The discriminant checking function
Discr : Entity_Id;
-- One discriminant to be checked in the type
Real_Discr : Entity_Id;
-- Actual discriminant in the call
Pref_Type : Entity_Id;
-- Type of relevant prefix (ignoring private/access stuff)
Args : List_Id;
-- List of arguments for function call
Formal : Entity_Id;
-- Keep track of the formal corresponding to the actual we build
-- for each discriminant, in order to be able to perform the
-- necessary type conversions.
Scomp : Node_Id;
-- Selected component reference for checking function argument
begin
Pref_Type := Etype (Pref);
-- Force evaluation of the prefix, so that it does not get evaluated
-- twice (once for the check, once for the actual reference). Such a
-- double evaluation is always a potential source of inefficiency,
-- and is functionally incorrect in the volatile case, or when the
-- prefix may have side-effects. An entity or a component of an
-- entity requires no evaluation.
if Is_Entity_Name (Pref) then
if Treat_As_Volatile (Entity (Pref)) then
Force_Evaluation (Pref, Name_Req => True);
end if;
elsif Treat_As_Volatile (Etype (Pref)) then
Force_Evaluation (Pref, Name_Req => True);
elsif Nkind (Pref) = N_Selected_Component
and then Is_Entity_Name (Prefix (Pref))
then
null;
else
Force_Evaluation (Pref, Name_Req => True);
end if;
-- For a tagged type, use the scope of the original component to
-- obtain the type, because ???
if Is_Tagged_Type (Scope (Orig_Comp)) then
Pref_Type := Scope (Orig_Comp);
-- For an untagged derived type, use the discriminants of the
-- parent which have been renamed in the derivation, possibly
-- by a one-to-many discriminant constraint.
-- For non-tagged type, initially get the Etype of the prefix
else
if Is_Derived_Type (Pref_Type)
and then Number_Discriminants (Pref_Type) /=
Number_Discriminants (Etype (Base_Type (Pref_Type)))
then
Pref_Type := Etype (Base_Type (Pref_Type));
end if;
end if;
-- We definitely should have a checking function, This routine should
-- not be called if no discriminant checking function is present.
pragma Assert (Present (Discr_Fct));
-- Create the list of the actual parameters for the call. This list
-- is the list of the discriminant fields of the record expression to
-- be discriminant checked.
Args := New_List;
Formal := First_Formal (Discr_Fct);
Discr := First_Discriminant (Pref_Type);
while Present (Discr) loop
-- If we have a corresponding discriminant field, and a parent
-- subtype is present, then we want to use the corresponding
-- discriminant since this is the one with the useful value.
if Present (Corresponding_Discriminant (Discr))
and then Ekind (Pref_Type) = E_Record_Type
and then Present (Parent_Subtype (Pref_Type))
then
Real_Discr := Corresponding_Discriminant (Discr);
else
Real_Discr := Discr;
end if;
-- Construct the reference to the discriminant
Scomp :=
Make_Selected_Component (Loc,
Prefix =>
Unchecked_Convert_To (Pref_Type,
Duplicate_Subexpr (Pref)),
Selector_Name => New_Occurrence_Of (Real_Discr, Loc));
-- Manually analyze and resolve this selected component. We really
-- want it just as it appears above, and do not want the expander
-- playing discriminal games etc with this reference. Then we
-- append the argument to the list we are gathering.
Set_Etype (Scomp, Etype (Real_Discr));
Set_Analyzed (Scomp, True);
Append_To (Args, Convert_To (Etype (Formal), Scomp));
Next_Formal_With_Extras (Formal);
Next_Discriminant (Discr);
end loop;
-- Now build and insert the call
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Function_Call (Loc,
Name => New_Occurrence_Of (Discr_Fct, Loc),
Parameter_Associations => Args),
Reason => CE_Discriminant_Check_Failed));
end Generate_Discriminant_Check;
---------------------------
-- Generate_Index_Checks --
---------------------------
procedure Generate_Index_Checks (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
A : constant Node_Id := Prefix (N);
Sub : Node_Id;
Ind : Nat;
Num : List_Id;
begin
Sub := First (Expressions (N));
Ind := 1;
while Present (Sub) loop
if Do_Range_Check (Sub) then
Set_Do_Range_Check (Sub, False);
-- Force evaluation except for the case of a simple name of
-- a non-volatile entity.
if not Is_Entity_Name (Sub)
or else Treat_As_Volatile (Entity (Sub))
then
Force_Evaluation (Sub);
end if;
-- Generate a raise of constraint error with the appropriate
-- reason and a condition of the form:
-- Base_Type(Sub) not in array'range (subscript)
-- Note that the reason we generate the conversion to the
-- base type here is that we definitely want the range check
-- to take place, even if it looks like the subtype is OK.
-- Optimization considerations that allow us to omit the
-- check have already been taken into account in the setting
-- of the Do_Range_Check flag earlier on.
if Ind = 1 then
Num := No_List;
else
Num := New_List (Make_Integer_Literal (Loc, Ind));
end if;
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Not_In (Loc,
Left_Opnd =>
Convert_To (Base_Type (Etype (Sub)),
Duplicate_Subexpr_Move_Checks (Sub)),
Right_Opnd =>
Make_Attribute_Reference (Loc,
Prefix => Duplicate_Subexpr_Move_Checks (A),
Attribute_Name => Name_Range,
Expressions => Num)),
Reason => CE_Index_Check_Failed));
end if;
Ind := Ind + 1;
Next (Sub);
end loop;
end Generate_Index_Checks;
--------------------------
-- Generate_Range_Check --
--------------------------
procedure Generate_Range_Check
(N : Node_Id;
Target_Type : Entity_Id;
Reason : RT_Exception_Code)
is
Loc : constant Source_Ptr := Sloc (N);
Source_Type : constant Entity_Id := Etype (N);
Source_Base_Type : constant Entity_Id := Base_Type (Source_Type);
Target_Base_Type : constant Entity_Id := Base_Type (Target_Type);
begin
-- First special case, if the source type is already within the
-- range of the target type, then no check is needed (probably we
-- should have stopped Do_Range_Check from being set in the first
-- place, but better late than later in preventing junk code!
-- We do NOT apply this if the source node is a literal, since in
-- this case the literal has already been labeled as having the
-- subtype of the target.
if In_Subrange_Of (Source_Type, Target_Type)
and then not
(Nkind (N) = N_Integer_Literal
or else
Nkind (N) = N_Real_Literal
or else
Nkind (N) = N_Character_Literal
or else
(Is_Entity_Name (N)
and then Ekind (Entity (N)) = E_Enumeration_Literal))
then
return;
end if;
-- We need a check, so force evaluation of the node, so that it does
-- not get evaluated twice (once for the check, once for the actual
-- reference). Such a double evaluation is always a potential source
-- of inefficiency, and is functionally incorrect in the volatile case.
if not Is_Entity_Name (N)
or else Treat_As_Volatile (Entity (N))
then
Force_Evaluation (N);
end if;
-- The easiest case is when Source_Base_Type and Target_Base_Type
-- are the same since in this case we can simply do a direct
-- check of the value of N against the bounds of Target_Type.
-- [constraint_error when N not in Target_Type]
-- Note: this is by far the most common case, for example all cases of
-- checks on the RHS of assignments are in this category, but not all
-- cases are like this. Notably conversions can involve two types.
if Source_Base_Type = Target_Base_Type then
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Not_In (Loc,
Left_Opnd => Duplicate_Subexpr (N),
Right_Opnd => New_Occurrence_Of (Target_Type, Loc)),
Reason => Reason));
-- Next test for the case where the target type is within the bounds
-- of the base type of the source type, since in this case we can
-- simply convert these bounds to the base type of T to do the test.
-- [constraint_error when N not in
-- Source_Base_Type (Target_Type'First)
-- ..
-- Source_Base_Type(Target_Type'Last))]
-- The conversions will always work and need no check
elsif In_Subrange_Of (Target_Type, Source_Base_Type) then
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Not_In (Loc,
Left_Opnd => Duplicate_Subexpr (N),
Right_Opnd =>
Make_Range (Loc,
Low_Bound =>
Convert_To (Source_Base_Type,
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Target_Type, Loc),
Attribute_Name => Name_First)),
High_Bound =>
Convert_To (Source_Base_Type,
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Target_Type, Loc),
Attribute_Name => Name_Last)))),
Reason => Reason));
-- Note that at this stage we now that the Target_Base_Type is
-- not in the range of the Source_Base_Type (since even the
-- Target_Type itself is not in this range). It could still be
-- the case that the Source_Type is in range of the target base
-- type, since we have not checked that case.
-- If that is the case, we can freely convert the source to the
-- target, and then test the target result against the bounds.
elsif In_Subrange_Of (Source_Type, Target_Base_Type) then
-- We make a temporary to hold the value of the converted
-- value (converted to the base type), and then we will
-- do the test against this temporary.
-- Tnn : constant Target_Base_Type := Target_Base_Type (N);
-- [constraint_error when Tnn not in Target_Type]
-- Then the conversion itself is replaced by an occurrence of Tnn
declare
Tnn : constant Entity_Id :=
Make_Defining_Identifier (Loc,
Chars => New_Internal_Name ('T'));
begin
Insert_Actions (N, New_List (
Make_Object_Declaration (Loc,
Defining_Identifier => Tnn,
Object_Definition =>
New_Occurrence_Of (Target_Base_Type, Loc),
Constant_Present => True,
Expression =>
Make_Type_Conversion (Loc,
Subtype_Mark => New_Occurrence_Of (Target_Base_Type, Loc),
Expression => Duplicate_Subexpr (N))),
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Not_In (Loc,
Left_Opnd => New_Occurrence_Of (Tnn, Loc),
Right_Opnd => New_Occurrence_Of (Target_Type, Loc)),
Reason => Reason)));
Rewrite (N, New_Occurrence_Of (Tnn, Loc));
end;
-- At this stage, we know that we have two scalar types, which are
-- directly convertible, and where neither scalar type has a base
-- range that is in the range of the other scalar type.
-- The only way this can happen is with a signed and unsigned type.
-- So test for these two cases:
else
-- Case of the source is unsigned and the target is signed
if Is_Unsigned_Type (Source_Base_Type)
and then not Is_Unsigned_Type (Target_Base_Type)
then
-- If the source is unsigned and the target is signed, then we
-- know that the source is not shorter than the target (otherwise
-- the source base type would be in the target base type range).
-- In other words, the unsigned type is either the same size
-- as the target, or it is larger. It cannot be smaller.
pragma Assert
(Esize (Source_Base_Type) >= Esize (Target_Base_Type));
-- We only need to check the low bound if the low bound of the
-- target type is non-negative. If the low bound of the target
-- type is negative, then we know that we will fit fine.
-- If the high bound of the target type is negative, then we
-- know we have a constraint error, since we can't possibly
-- have a negative source.
-- With these two checks out of the way, we can do the check
-- using the source type safely
-- This is definitely the most annoying case!
-- [constraint_error
-- when (Target_Type'First >= 0
-- and then
-- N < Source_Base_Type (Target_Type'First))
-- or else Target_Type'Last < 0
-- or else N > Source_Base_Type (Target_Type'Last)];
-- We turn off all checks since we know that the conversions
-- will work fine, given the guards for negative values.
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Or_Else (Loc,
Make_Or_Else (Loc,
Left_Opnd =>
Make_And_Then (Loc,
Left_Opnd => Make_Op_Ge (Loc,
Left_Opnd =>
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Target_Type, Loc),
Attribute_Name => Name_First),
Right_Opnd => Make_Integer_Literal (Loc, Uint_0)),
Right_Opnd =>
Make_Op_Lt (Loc,
Left_Opnd => Duplicate_Subexpr (N),
Right_Opnd =>
Convert_To (Source_Base_Type,
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Target_Type, Loc),
Attribute_Name => Name_First)))),
Right_Opnd =>
Make_Op_Lt (Loc,
Left_Opnd =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Target_Type, Loc),
Attribute_Name => Name_Last),
Right_Opnd => Make_Integer_Literal (Loc, Uint_0))),
Right_Opnd =>
Make_Op_Gt (Loc,
Left_Opnd => Duplicate_Subexpr (N),
Right_Opnd =>
Convert_To (Source_Base_Type,
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Target_Type, Loc),
Attribute_Name => Name_Last)))),
Reason => Reason),
Suppress => All_Checks);
-- Only remaining possibility is that the source is signed and
-- the target is unsigned
else
pragma Assert (not Is_Unsigned_Type (Source_Base_Type)
and then Is_Unsigned_Type (Target_Base_Type));
-- If the source is signed and the target is unsigned, then
-- we know that the target is not shorter than the source
-- (otherwise the target base type would be in the source
-- base type range).
-- In other words, the unsigned type is either the same size
-- as the target, or it is larger. It cannot be smaller.
-- Clearly we have an error if the source value is negative
-- since no unsigned type can have negative values. If the
-- source type is non-negative, then the check can be done
-- using the target type.
-- Tnn : constant Target_Base_Type (N) := Target_Type;
-- [constraint_error
-- when N < 0 or else Tnn not in Target_Type];
-- We turn off all checks for the conversion of N to the
-- target base type, since we generate the explicit check
-- to ensure that the value is non-negative
declare
Tnn : constant Entity_Id :=
Make_Defining_Identifier (Loc,
Chars => New_Internal_Name ('T'));
begin
Insert_Actions (N, New_List (
Make_Object_Declaration (Loc,
Defining_Identifier => Tnn,
Object_Definition =>
New_Occurrence_Of (Target_Base_Type, Loc),
Constant_Present => True,
Expression =>
Make_Type_Conversion (Loc,
Subtype_Mark =>
New_Occurrence_Of (Target_Base_Type, Loc),
Expression => Duplicate_Subexpr (N))),
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Or_Else (Loc,
Left_Opnd =>
Make_Op_Lt (Loc,
Left_Opnd => Duplicate_Subexpr (N),
Right_Opnd => Make_Integer_Literal (Loc, Uint_0)),
Right_Opnd =>
Make_Not_In (Loc,
Left_Opnd => New_Occurrence_Of (Tnn, Loc),
Right_Opnd =>
New_Occurrence_Of (Target_Type, Loc))),
Reason => Reason)),
Suppress => All_Checks);
-- Set the Etype explicitly, because Insert_Actions may
-- have placed the declaration in the freeze list for an
-- enclosing construct, and thus it is not analyzed yet.
Set_Etype (Tnn, Target_Base_Type);
Rewrite (N, New_Occurrence_Of (Tnn, Loc));
end;
end if;
end if;
end Generate_Range_Check;
---------------------
-- Get_Discriminal --
---------------------
function Get_Discriminal (E : Entity_Id; Bound : Node_Id) return Node_Id is
Loc : constant Source_Ptr := Sloc (E);
D : Entity_Id;
Sc : Entity_Id;
begin
-- The entity E is the type of a private component of the protected
-- type, or the type of a renaming of that component within a protected
-- operation of that type.
Sc := Scope (E);
if Ekind (Sc) /= E_Protected_Type then
Sc := Scope (Sc);
if Ekind (Sc) /= E_Protected_Type then
return Bound;
end if;
end if;
D := First_Discriminant (Sc);
while Present (D)
and then Chars (D) /= Chars (Bound)
loop
Next_Discriminant (D);
end loop;
return New_Occurrence_Of (Discriminal (D), Loc);
end Get_Discriminal;
------------------
-- Guard_Access --
------------------
function Guard_Access
(Cond : Node_Id;
Loc : Source_Ptr;
Ck_Node : Node_Id) return Node_Id
is
begin
if Nkind (Cond) = N_Or_Else then
Set_Paren_Count (Cond, 1);
end if;
if Nkind (Ck_Node) = N_Allocator then
return Cond;
else
return
Make_And_Then (Loc,
Left_Opnd =>
Make_Op_Ne (Loc,
Left_Opnd => Duplicate_Subexpr_No_Checks (Ck_Node),
Right_Opnd => Make_Null (Loc)),
Right_Opnd => Cond);
end if;
end Guard_Access;
-----------------------------
-- Index_Checks_Suppressed --
-----------------------------
function Index_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Index_Check);
else
return Scope_Suppress (Index_Check);
end if;
end Index_Checks_Suppressed;
----------------
-- Initialize --
----------------
procedure Initialize is
begin
for J in Determine_Range_Cache_N'Range loop
Determine_Range_Cache_N (J) := Empty;
end loop;
end Initialize;
-------------------------
-- Insert_Range_Checks --
-------------------------
procedure Insert_Range_Checks
(Checks : Check_Result;
Node : Node_Id;
Suppress_Typ : Entity_Id;
Static_Sloc : Source_Ptr := No_Location;
Flag_Node : Node_Id := Empty;
Do_Before : Boolean := False)
is
Internal_Flag_Node : Node_Id := Flag_Node;
Internal_Static_Sloc : Source_Ptr := Static_Sloc;
Check_Node : Node_Id;
Checks_On : constant Boolean :=
(not Index_Checks_Suppressed (Suppress_Typ))
or else
(not Range_Checks_Suppressed (Suppress_Typ));
begin
-- For now we just return if Checks_On is false, however this should
-- be enhanced to check for an always True value in the condition
-- and to generate a compilation warning???
if not Expander_Active or else not Checks_On then
return;
end if;
if Static_Sloc = No_Location then
Internal_Static_Sloc := Sloc (Node);
end if;
if No (Flag_Node) then
Internal_Flag_Node := Node;
end if;
for J in 1 .. 2 loop
exit when No (Checks (J));
if Nkind (Checks (J)) = N_Raise_Constraint_Error
and then Present (Condition (Checks (J)))
then
if not Has_Dynamic_Range_Check (Internal_Flag_Node) then
Check_Node := Checks (J);
Mark_Rewrite_Insertion (Check_Node);
if Do_Before then
Insert_Before_And_Analyze (Node, Check_Node);
else
Insert_After_And_Analyze (Node, Check_Node);
end if;
Set_Has_Dynamic_Range_Check (Internal_Flag_Node);
end if;
else
Check_Node :=
Make_Raise_Constraint_Error (Internal_Static_Sloc,
Reason => CE_Range_Check_Failed);
Mark_Rewrite_Insertion (Check_Node);
if Do_Before then
Insert_Before_And_Analyze (Node, Check_Node);
else
Insert_After_And_Analyze (Node, Check_Node);
end if;
end if;
end loop;
end Insert_Range_Checks;
------------------------
-- Insert_Valid_Check --
------------------------
procedure Insert_Valid_Check (Expr : Node_Id) is
Loc : constant Source_Ptr := Sloc (Expr);
Exp : Node_Id;
begin
-- Do not insert if checks off, or if not checking validity
if Range_Checks_Suppressed (Etype (Expr))
or else (not Validity_Checks_On)
then
return;
end if;
-- If we have a checked conversion, then validity check applies to
-- the expression inside the conversion, not the result, since if
-- the expression inside is valid, then so is the conversion result.
Exp := Expr;
while Nkind (Exp) = N_Type_Conversion loop
Exp := Expression (Exp);
end loop;
-- Insert the validity check. Note that we do this with validity
-- checks turned off, to avoid recursion, we do not want validity
-- checks on the validity checking code itself!
Validity_Checks_On := False;
Insert_Action
(Expr,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Op_Not (Loc,
Right_Opnd =>
Make_Attribute_Reference (Loc,
Prefix =>
Duplicate_Subexpr_No_Checks (Exp, Name_Req => True),
Attribute_Name => Name_Valid)),
Reason => CE_Invalid_Data),
Suppress => All_Checks);
-- If the expression is a a reference to an element of a bit-packed
-- array, it is rewritten as a renaming declaration. If the expression
-- is an actual in a call, it has not been expanded, waiting for the
-- proper point at which to do it. The same happens with renamings, so
-- that we have to force the expansion now. This non-local complication
-- is due to code in exp_ch2,adb, exp_ch4.adb and exp_ch6.adb.
if Is_Entity_Name (Exp)
and then Nkind (Parent (Entity (Exp))) = N_Object_Renaming_Declaration
then
declare
Old_Exp : constant Node_Id := Name (Parent (Entity (Exp)));
begin
if Nkind (Old_Exp) = N_Indexed_Component
and then Is_Bit_Packed_Array (Etype (Prefix (Old_Exp)))
then
Expand_Packed_Element_Reference (Old_Exp);
end if;
end;
end if;
Validity_Checks_On := True;
end Insert_Valid_Check;
----------------------------------
-- Install_Null_Excluding_Check --
----------------------------------
procedure Install_Null_Excluding_Check (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
procedure Mark_Non_Null;
-- After installation of check, marks node as non-null if entity
-------------------
-- Mark_Non_Null --
-------------------
procedure Mark_Non_Null is
begin
if Is_Entity_Name (N) then
Set_Is_Known_Null (Entity (N), False);
if Safe_To_Capture_Value (N, Entity (N)) then
Set_Is_Known_Non_Null (Entity (N), True);
end if;
end if;
end Mark_Non_Null;
-- Start of processing for Install_Null_Excluding_Check
begin
pragma Assert (Is_Access_Type (Typ));
-- No check inside a generic (why not???)
if Inside_A_Generic then
return;
end if;
-- No check needed if known to be non-null
if Known_Non_Null (N) then
return;
end if;
-- If known to be null, here is where we generate a compile time check
if Known_Null (N) then
Apply_Compile_Time_Constraint_Error
(N,
"null value not allowed here?",
CE_Access_Check_Failed);
Mark_Non_Null;
return;
end if;
-- If entity is never assigned, for sure a warning is appropriate
if Is_Entity_Name (N) then
Check_Unset_Reference (N);
end if;
-- No check needed if checks are suppressed on the range. Note that we
-- don't set Is_Known_Non_Null in this case (we could legitimately do
-- so, since the program is erroneous, but we don't like to casually
-- propagate such conclusions from erroneosity).
if Access_Checks_Suppressed (Typ) then
return;
end if;
-- Otherwise install access check
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Op_Eq (Loc,
Left_Opnd => Duplicate_Subexpr_Move_Checks (N),
Right_Opnd => Make_Null (Loc)),
Reason => CE_Access_Check_Failed));
Mark_Non_Null;
end Install_Null_Excluding_Check;
--------------------------
-- Install_Static_Check --
--------------------------
procedure Install_Static_Check (R_Cno : Node_Id; Loc : Source_Ptr) is
Stat : constant Boolean := Is_Static_Expression (R_Cno);
Typ : constant Entity_Id := Etype (R_Cno);
begin
Rewrite (R_Cno,
Make_Raise_Constraint_Error (Loc,
Reason => CE_Range_Check_Failed));
Set_Analyzed (R_Cno);
Set_Etype (R_Cno, Typ);
Set_Raises_Constraint_Error (R_Cno);
Set_Is_Static_Expression (R_Cno, Stat);
end Install_Static_Check;
---------------------
-- Kill_All_Checks --
---------------------
procedure Kill_All_Checks is
begin
if Debug_Flag_CC then
w ("Kill_All_Checks");
end if;
-- We reset the number of saved checks to zero, and also modify
-- all stack entries for statement ranges to indicate that the
-- number of checks at each level is now zero.
Num_Saved_Checks := 0;
for J in 1 .. Saved_Checks_TOS loop
Saved_Checks_Stack (J) := 0;
end loop;
end Kill_All_Checks;
-----------------
-- Kill_Checks --
-----------------
procedure Kill_Checks (V : Entity_Id) is
begin
if Debug_Flag_CC then
w ("Kill_Checks for entity", Int (V));
end if;
for J in 1 .. Num_Saved_Checks loop
if Saved_Checks (J).Entity = V then
if Debug_Flag_CC then
w (" Checks killed for saved check ", J);
end if;
Saved_Checks (J).Killed := True;
end if;
end loop;
end Kill_Checks;
------------------------------
-- Length_Checks_Suppressed --
------------------------------
function Length_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Length_Check);
else
return Scope_Suppress (Length_Check);
end if;
end Length_Checks_Suppressed;
--------------------------------
-- Overflow_Checks_Suppressed --
--------------------------------
function Overflow_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Overflow_Check);
else
return Scope_Suppress (Overflow_Check);
end if;
end Overflow_Checks_Suppressed;
-----------------
-- Range_Check --
-----------------
function Range_Check
(Ck_Node : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id := Empty;
Warn_Node : Node_Id := Empty) return Check_Result
is
begin
return Selected_Range_Checks
(Ck_Node, Target_Typ, Source_Typ, Warn_Node);
end Range_Check;
-----------------------------
-- Range_Checks_Suppressed --
-----------------------------
function Range_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) then
-- Note: for now we always suppress range checks on Vax float types,
-- since Gigi does not know how to generate these checks.
if Vax_Float (E) then
return True;
elsif Kill_Range_Checks (E) then
return True;
elsif Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Range_Check);
end if;
end if;
return Scope_Suppress (Range_Check);
end Range_Checks_Suppressed;
-------------------
-- Remove_Checks --
-------------------
procedure Remove_Checks (Expr : Node_Id) is
Discard : Traverse_Result;
pragma Warnings (Off, Discard);
function Process (N : Node_Id) return Traverse_Result;
-- Process a single node during the traversal
function Traverse is new Traverse_Func (Process);
-- The traversal function itself
-------------
-- Process --
-------------
function Process (N : Node_Id) return Traverse_Result is
begin
if Nkind (N) not in N_Subexpr then
return Skip;
end if;
Set_Do_Range_Check (N, False);
case Nkind (N) is
when N_And_Then =>
Discard := Traverse (Left_Opnd (N));
return Skip;
when N_Attribute_Reference =>
Set_Do_Overflow_Check (N, False);
when N_Function_Call =>
Set_Do_Tag_Check (N, False);
when N_Op =>
Set_Do_Overflow_Check (N, False);
case Nkind (N) is
when N_Op_Divide =>
Set_Do_Division_Check (N, False);
when N_Op_And =>
Set_Do_Length_Check (N, False);
when N_Op_Mod =>
Set_Do_Division_Check (N, False);
when N_Op_Or =>
Set_Do_Length_Check (N, False);
when N_Op_Rem =>
Set_Do_Division_Check (N, False);
when N_Op_Xor =>
Set_Do_Length_Check (N, False);
when others =>
null;
end case;
when N_Or_Else =>
Discard := Traverse (Left_Opnd (N));
return Skip;
when N_Selected_Component =>
Set_Do_Discriminant_Check (N, False);
when N_Type_Conversion =>
Set_Do_Length_Check (N, False);
Set_Do_Tag_Check (N, False);
Set_Do_Overflow_Check (N, False);
when others =>
null;
end case;
return OK;
end Process;
-- Start of processing for Remove_Checks
begin
Discard := Traverse (Expr);
end Remove_Checks;
----------------------------
-- Selected_Length_Checks --
----------------------------
function Selected_Length_Checks
(Ck_Node : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
Warn_Node : Node_Id) return Check_Result
is
Loc : constant Source_Ptr := Sloc (Ck_Node);
S_Typ : Entity_Id;
T_Typ : Entity_Id;
Expr_Actual : Node_Id;
Exptyp : Entity_Id;
Cond : Node_Id := Empty;
Do_Access : Boolean := False;
Wnode : Node_Id := Warn_Node;
Ret_Result : Check_Result := (Empty, Empty);
Num_Checks : Natural := 0;
procedure Add_Check (N : Node_Id);
-- Adds the action given to Ret_Result if N is non-Empty
function Get_E_Length (E : Entity_Id; Indx : Nat) return Node_Id;
function Get_N_Length (N : Node_Id; Indx : Nat) return Node_Id;
-- Comments required ???
function Same_Bounds (L : Node_Id; R : Node_Id) return Boolean;
-- True for equal literals and for nodes that denote the same constant
-- entity, even if its value is not a static constant. This includes the
-- case of a discriminal reference within an init proc. Removes some
-- obviously superfluous checks.
function Length_E_Cond
(Exptyp : Entity_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id;
-- Returns expression to compute:
-- Typ'Length /= Exptyp'Length
function Length_N_Cond
(Expr : Node_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id;
-- Returns expression to compute:
-- Typ'Length /= Expr'Length
---------------
-- Add_Check --
---------------
procedure Add_Check (N : Node_Id) is
begin
if Present (N) then
-- For now, ignore attempt to place more than 2 checks ???
if Num_Checks = 2 then
return;
end if;
pragma Assert (Num_Checks <= 1);
Num_Checks := Num_Checks + 1;
Ret_Result (Num_Checks) := N;
end if;
end Add_Check;
------------------
-- Get_E_Length --
------------------
function Get_E_Length (E : Entity_Id; Indx : Nat) return Node_Id is
Pt : constant Entity_Id := Scope (Scope (E));
N : Node_Id;
E1 : Entity_Id := E;
begin
if Ekind (Scope (E)) = E_Record_Type
and then Has_Discriminants (Scope (E))
then
N := Build_Discriminal_Subtype_Of_Component (E);
if Present (N) then
Insert_Action (Ck_Node, N);
E1 := Defining_Identifier (N);
end if;
end if;
if Ekind (E1) = E_String_Literal_Subtype then
return
Make_Integer_Literal (Loc,
Intval => String_Literal_Length (E1));
elsif Ekind (Pt) = E_Protected_Type
and then Has_Discriminants (Pt)
and then Has_Completion (Pt)
and then not Inside_Init_Proc
then
-- If the type whose length is needed is a private component
-- constrained by a discriminant, we must expand the 'Length
-- attribute into an explicit computation, using the discriminal
-- of the current protected operation. This is because the actual
-- type of the prival is constructed after the protected opera-
-- tion has been fully expanded.
declare
Indx_Type : Node_Id;
Lo : Node_Id;
Hi : Node_Id;
Do_Expand : Boolean := False;
begin
Indx_Type := First_Index (E);
for J in 1 .. Indx - 1 loop
Next_Index (Indx_Type);
end loop;
Get_Index_Bounds (Indx_Type, Lo, Hi);
if Nkind (Lo) = N_Identifier
and then Ekind (Entity (Lo)) = E_In_Parameter
then
Lo := Get_Discriminal (E, Lo);
Do_Expand := True;
end if;
if Nkind (Hi) = N_Identifier
and then Ekind (Entity (Hi)) = E_In_Parameter
then
Hi := Get_Discriminal (E, Hi);
Do_Expand := True;
end if;
if Do_Expand then
if not Is_Entity_Name (Lo) then
Lo := Duplicate_Subexpr_No_Checks (Lo);
end if;
if not Is_Entity_Name (Hi) then
Lo := Duplicate_Subexpr_No_Checks (Hi);
end if;
N :=
Make_Op_Add (Loc,
Left_Opnd =>
Make_Op_Subtract (Loc,
Left_Opnd => Hi,
Right_Opnd => Lo),
Right_Opnd => Make_Integer_Literal (Loc, 1));
return N;
else
N :=
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Length,
Prefix =>
New_Occurrence_Of (E1, Loc));
if Indx > 1 then
Set_Expressions (N, New_List (
Make_Integer_Literal (Loc, Indx)));
end if;
return N;
end if;
end;
else
N :=
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Length,
Prefix =>
New_Occurrence_Of (E1, Loc));
if Indx > 1 then
Set_Expressions (N, New_List (
Make_Integer_Literal (Loc, Indx)));
end if;
return N;
end if;
end Get_E_Length;
------------------
-- Get_N_Length --
------------------
function Get_N_Length (N : Node_Id; Indx : Nat) return Node_Id is
begin
return
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Length,
Prefix =>
Duplicate_Subexpr_No_Checks (N, Name_Req => True),
Expressions => New_List (
Make_Integer_Literal (Loc, Indx)));
end Get_N_Length;
-------------------
-- Length_E_Cond --
-------------------
function Length_E_Cond
(Exptyp : Entity_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id
is
begin
return
Make_Op_Ne (Loc,
Left_Opnd => Get_E_Length (Typ, Indx),
Right_Opnd => Get_E_Length (Exptyp, Indx));
end Length_E_Cond;
-------------------
-- Length_N_Cond --
-------------------
function Length_N_Cond
(Expr : Node_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id
is
begin
return
Make_Op_Ne (Loc,
Left_Opnd => Get_E_Length (Typ, Indx),
Right_Opnd => Get_N_Length (Expr, Indx));
end Length_N_Cond;
function Same_Bounds (L : Node_Id; R : Node_Id) return Boolean is
begin
return
(Nkind (L) = N_Integer_Literal
and then Nkind (R) = N_Integer_Literal
and then Intval (L) = Intval (R))
or else
(Is_Entity_Name (L)
and then Ekind (Entity (L)) = E_Constant
and then ((Is_Entity_Name (R)
and then Entity (L) = Entity (R))
or else
(Nkind (R) = N_Type_Conversion
and then Is_Entity_Name (Expression (R))
and then Entity (L) = Entity (Expression (R)))))
or else
(Is_Entity_Name (R)
and then Ekind (Entity (R)) = E_Constant
and then Nkind (L) = N_Type_Conversion
and then Is_Entity_Name (Expression (L))
and then Entity (R) = Entity (Expression (L)))
or else
(Is_Entity_Name (L)
and then Is_Entity_Name (R)
and then Entity (L) = Entity (R)
and then Ekind (Entity (L)) = E_In_Parameter
and then Inside_Init_Proc);
end Same_Bounds;
-- Start of processing for Selected_Length_Checks
begin
if not Expander_Active then
return Ret_Result;
end if;
if Target_Typ = Any_Type
or else Target_Typ = Any_Composite
or else Raises_Constraint_Error (Ck_Node)
then
return Ret_Result;
end if;
if No (Wnode) then
Wnode := Ck_Node;
end if;
T_Typ := Target_Typ;
if No (Source_Typ) then
S_Typ := Etype (Ck_Node);
else
S_Typ := Source_Typ;
end if;
if S_Typ = Any_Type or else S_Typ = Any_Composite then
return Ret_Result;
end if;
if Is_Access_Type (T_Typ) and then Is_Access_Type (S_Typ) then
S_Typ := Designated_Type (S_Typ);
T_Typ := Designated_Type (T_Typ);
Do_Access := True;
-- A simple optimization
if Nkind (Ck_Node) = N_Null then
return Ret_Result;
end if;
end if;
if Is_Array_Type (T_Typ) and then Is_Array_Type (S_Typ) then
if Is_Constrained (T_Typ) then
-- The checking code to be generated will freeze the
-- corresponding array type. However, we must freeze the
-- type now, so that the freeze node does not appear within
-- the generated condional expression, but ahead of it.
Freeze_Before (Ck_Node, T_Typ);
Expr_Actual := Get_Referenced_Object (Ck_Node);
Exptyp := Get_Actual_Subtype (Ck_Node);
if Is_Access_Type (Exptyp) then
Exptyp := Designated_Type (Exptyp);
end if;
-- String_Literal case. This needs to be handled specially be-
-- cause no index types are available for string literals. The
-- condition is simply:
-- T_Typ'Length = string-literal-length
if Nkind (Expr_Actual) = N_String_Literal
and then Ekind (Etype (Expr_Actual)) = E_String_Literal_Subtype
then
Cond :=
Make_Op_Ne (Loc,
Left_Opnd => Get_E_Length (T_Typ, 1),
Right_Opnd =>
Make_Integer_Literal (Loc,
Intval =>
String_Literal_Length (Etype (Expr_Actual))));
-- General array case. Here we have a usable actual subtype for
-- the expression, and the condition is built from the two types
-- (Do_Length):
-- T_Typ'Length /= Exptyp'Length or else
-- T_Typ'Length (2) /= Exptyp'Length (2) or else
-- T_Typ'Length (3) /= Exptyp'Length (3) or else
-- ...
elsif Is_Constrained (Exptyp) then
declare
Ndims : constant Nat := Number_Dimensions (T_Typ);
L_Index : Node_Id;
R_Index : Node_Id;
L_Low : Node_Id;
L_High : Node_Id;
R_Low : Node_Id;
R_High : Node_Id;
L_Length : Uint;
R_Length : Uint;
Ref_Node : Node_Id;
begin
-- At the library level, we need to ensure that the
-- type of the object is elaborated before the check
-- itself is emitted. This is only done if the object
-- is in the current compilation unit, otherwise the
-- type is frozen and elaborated in its unit.
if Is_Itype (Exptyp)
and then
Ekind (Cunit_Entity (Current_Sem_Unit)) = E_Package
and then
not In_Package_Body (Cunit_Entity (Current_Sem_Unit))
and then In_Open_Scopes (Scope (Exptyp))
then
Ref_Node := Make_Itype_Reference (Sloc (Ck_Node));
Set_Itype (Ref_Node, Exptyp);
Insert_Action (Ck_Node, Ref_Node);
end if;
L_Index := First_Index (T_Typ);
R_Index := First_Index (Exptyp);
for Indx in 1 .. Ndims loop
if not (Nkind (L_Index) = N_Raise_Constraint_Error
or else
Nkind (R_Index) = N_Raise_Constraint_Error)
then
Get_Index_Bounds (L_Index, L_Low, L_High);
Get_Index_Bounds (R_Index, R_Low, R_High);
-- Deal with compile time length check. Note that we
-- skip this in the access case, because the access
-- value may be null, so we cannot know statically.
if not Do_Access
and then Compile_Time_Known_Value (L_Low)
and then Compile_Time_Known_Value (L_High)
and then Compile_Time_Known_Value (R_Low)
and then Compile_Time_Known_Value (R_High)
then
if Expr_Value (L_High) >= Expr_Value (L_Low) then
L_Length := Expr_Value (L_High) -
Expr_Value (L_Low) + 1;
else
L_Length := UI_From_Int (0);
end if;
if Expr_Value (R_High) >= Expr_Value (R_Low) then
R_Length := Expr_Value (R_High) -
Expr_Value (R_Low) + 1;
else
R_Length := UI_From_Int (0);
end if;
if L_Length > R_Length then
Add_Check
(Compile_Time_Constraint_Error
(Wnode, "too few elements for}?", T_Typ));
elsif L_Length < R_Length then
Add_Check
(Compile_Time_Constraint_Error
(Wnode, "too many elements for}?", T_Typ));
end if;
-- The comparison for an individual index subtype
-- is omitted if the corresponding index subtypes
-- statically match, since the result is known to
-- be true. Note that this test is worth while even
-- though we do static evaluation, because non-static
-- subtypes can statically match.
elsif not
Subtypes_Statically_Match
(Etype (L_Index), Etype (R_Index))
and then not
(Same_Bounds (L_Low, R_Low)
and then Same_Bounds (L_High, R_High))
then
Evolve_Or_Else
(Cond, Length_E_Cond (Exptyp, T_Typ, Indx));
end if;
Next (L_Index);
Next (R_Index);
end if;
end loop;
end;
-- Handle cases where we do not get a usable actual subtype that
-- is constrained. This happens for example in the function call
-- and explicit dereference cases. In these cases, we have to get
-- the length or range from the expression itself, making sure we
-- do not evaluate it more than once.
-- Here Ck_Node is the original expression, or more properly the
-- result of applying Duplicate_Expr to the original tree,
-- forcing the result to be a name.
else
declare
Ndims : constant Nat := Number_Dimensions (T_Typ);
begin
-- Build the condition for the explicit dereference case
for Indx in 1 .. Ndims loop
Evolve_Or_Else
(Cond, Length_N_Cond (Ck_Node, T_Typ, Indx));
end loop;
end;
end if;
end if;
end if;
-- Construct the test and insert into the tree
if Present (Cond) then
if Do_Access then
Cond := Guard_Access (Cond, Loc, Ck_Node);
end if;
Add_Check
(Make_Raise_Constraint_Error (Loc,
Condition => Cond,
Reason => CE_Length_Check_Failed));
end if;
return Ret_Result;
end Selected_Length_Checks;
---------------------------
-- Selected_Range_Checks --
---------------------------
function Selected_Range_Checks
(Ck_Node : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
Warn_Node : Node_Id) return Check_Result
is
Loc : constant Source_Ptr := Sloc (Ck_Node);
S_Typ : Entity_Id;
T_Typ : Entity_Id;
Expr_Actual : Node_Id;
Exptyp : Entity_Id;
Cond : Node_Id := Empty;
Do_Access : Boolean := False;
Wnode : Node_Id := Warn_Node;
Ret_Result : Check_Result := (Empty, Empty);
Num_Checks : Integer := 0;
procedure Add_Check (N : Node_Id);
-- Adds the action given to Ret_Result if N is non-Empty
function Discrete_Range_Cond
(Expr : Node_Id;
Typ : Entity_Id) return Node_Id;
-- Returns expression to compute:
-- Low_Bound (Expr) < Typ'First
-- or else
-- High_Bound (Expr) > Typ'Last
function Discrete_Expr_Cond
(Expr : Node_Id;
Typ : Entity_Id) return Node_Id;
-- Returns expression to compute:
-- Expr < Typ'First
-- or else
-- Expr > Typ'Last
function Get_E_First_Or_Last
(E : Entity_Id;
Indx : Nat;
Nam : Name_Id) return Node_Id;
-- Returns expression to compute:
-- E'First or E'Last
function Get_N_First (N : Node_Id; Indx : Nat) return Node_Id;
function Get_N_Last (N : Node_Id; Indx : Nat) return Node_Id;
-- Returns expression to compute:
-- N'First or N'Last using Duplicate_Subexpr_No_Checks
function Range_E_Cond
(Exptyp : Entity_Id;
Typ : Entity_Id;
Indx : Nat)
return Node_Id;
-- Returns expression to compute:
-- Exptyp'First < Typ'First or else Exptyp'Last > Typ'Last
function Range_Equal_E_Cond
(Exptyp : Entity_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id;
-- Returns expression to compute:
-- Exptyp'First /= Typ'First or else Exptyp'Last /= Typ'Last
function Range_N_Cond
(Expr : Node_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id;
-- Return expression to compute:
-- Expr'First < Typ'First or else Expr'Last > Typ'Last
---------------
-- Add_Check --
---------------
procedure Add_Check (N : Node_Id) is
begin
if Present (N) then
-- For now, ignore attempt to place more than 2 checks ???
if Num_Checks = 2 then
return;
end if;
pragma Assert (Num_Checks <= 1);
Num_Checks := Num_Checks + 1;
Ret_Result (Num_Checks) := N;
end if;
end Add_Check;
-------------------------
-- Discrete_Expr_Cond --
-------------------------
function Discrete_Expr_Cond
(Expr : Node_Id;
Typ : Entity_Id) return Node_Id
is
begin
return
Make_Or_Else (Loc,
Left_Opnd =>
Make_Op_Lt (Loc,
Left_Opnd =>
Convert_To (Base_Type (Typ),
Duplicate_Subexpr_No_Checks (Expr)),
Right_Opnd =>
Convert_To (Base_Type (Typ),
Get_E_First_Or_Last (Typ, 0, Name_First))),
Right_Opnd =>
Make_Op_Gt (Loc,
Left_Opnd =>
Convert_To (Base_Type (Typ),
Duplicate_Subexpr_No_Checks (Expr)),
Right_Opnd =>
Convert_To
(Base_Type (Typ),
Get_E_First_Or_Last (Typ, 0, Name_Last))));
end Discrete_Expr_Cond;
-------------------------
-- Discrete_Range_Cond --
-------------------------
function Discrete_Range_Cond
(Expr : Node_Id;
Typ : Entity_Id) return Node_Id
is
LB : Node_Id := Low_Bound (Expr);
HB : Node_Id := High_Bound (Expr);
Left_Opnd : Node_Id;
Right_Opnd : Node_Id;
begin
if Nkind (LB) = N_Identifier
and then Ekind (Entity (LB)) = E_Discriminant then
LB := New_Occurrence_Of (Discriminal (Entity (LB)), Loc);
end if;
if Nkind (HB) = N_Identifier
and then Ekind (Entity (HB)) = E_Discriminant then
HB := New_Occurrence_Of (Discriminal (Entity (HB)), Loc);
end if;
Left_Opnd :=
Make_Op_Lt (Loc,
Left_Opnd =>
Convert_To
(Base_Type (Typ), Duplicate_Subexpr_No_Checks (LB)),
Right_Opnd =>
Convert_To
(Base_Type (Typ), Get_E_First_Or_Last (Typ, 0, Name_First)));
if Base_Type (Typ) = Typ then
return Left_Opnd;
elsif Compile_Time_Known_Value (High_Bound (Scalar_Range (Typ)))
and then
Compile_Time_Known_Value (High_Bound (Scalar_Range
(Base_Type (Typ))))
then
if Is_Floating_Point_Type (Typ) then
if Expr_Value_R (High_Bound (Scalar_Range (Typ))) =
Expr_Value_R (High_Bound (Scalar_Range (Base_Type (Typ))))
then
return Left_Opnd;
end if;
else
if Expr_Value (High_Bound (Scalar_Range (Typ))) =
Expr_Value (High_Bound (Scalar_Range (Base_Type (Typ))))
then
return Left_Opnd;
end if;
end if;
end if;
Right_Opnd :=
Make_Op_Gt (Loc,
Left_Opnd =>
Convert_To
(Base_Type (Typ), Duplicate_Subexpr_No_Checks (HB)),
Right_Opnd =>
Convert_To
(Base_Type (Typ),
Get_E_First_Or_Last (Typ, 0, Name_Last)));
return Make_Or_Else (Loc, Left_Opnd, Right_Opnd);
end Discrete_Range_Cond;
-------------------------
-- Get_E_First_Or_Last --
-------------------------
function Get_E_First_Or_Last
(E : Entity_Id;
Indx : Nat;
Nam : Name_Id) return Node_Id
is
N : Node_Id;
LB : Node_Id;
HB : Node_Id;
Bound : Node_Id;
begin
if Is_Array_Type (E) then
N := First_Index (E);
for J in 2 .. Indx loop
Next_Index (N);
end loop;
else
N := Scalar_Range (E);
end if;
if Nkind (N) = N_Subtype_Indication then
LB := Low_Bound (Range_Expression (Constraint (N)));
HB := High_Bound (Range_Expression (Constraint (N)));
elsif Is_Entity_Name (N) then
LB := Type_Low_Bound (Etype (N));
HB := Type_High_Bound (Etype (N));
else
LB := Low_Bound (N);
HB := High_Bound (N);
end if;
if Nam = Name_First then
Bound := LB;
else
Bound := HB;
end if;
if Nkind (Bound) = N_Identifier
and then Ekind (Entity (Bound)) = E_Discriminant
then
-- If this is a task discriminant, and we are the body, we must
-- retrieve the corresponding body discriminal. This is another
-- consequence of the early creation of discriminals, and the
-- need to generate constraint checks before their declarations
-- are made visible.
if Is_Concurrent_Record_Type (Scope (Entity (Bound))) then
declare
Tsk : constant Entity_Id :=
Corresponding_Concurrent_Type
(Scope (Entity (Bound)));
Disc : Entity_Id;
begin
if In_Open_Scopes (Tsk)
and then Has_Completion (Tsk)
then
-- Find discriminant of original task, and use its
-- current discriminal, which is the renaming within
-- the task body.
Disc := First_Discriminant (Tsk);
while Present (Disc) loop
if Chars (Disc) = Chars (Entity (Bound)) then
Set_Scope (Discriminal (Disc), Tsk);
return New_Occurrence_Of (Discriminal (Disc), Loc);
end if;
Next_Discriminant (Disc);
end loop;
-- That loop should always succeed in finding a matching
-- entry and returning. Fatal error if not.
raise Program_Error;
else
return
New_Occurrence_Of (Discriminal (Entity (Bound)), Loc);
end if;
end;
else
return New_Occurrence_Of (Discriminal (Entity (Bound)), Loc);
end if;
elsif Nkind (Bound) = N_Identifier
and then Ekind (Entity (Bound)) = E_In_Parameter
and then not Inside_Init_Proc
then
return Get_Discriminal (E, Bound);
elsif Nkind (Bound) = N_Integer_Literal then
return Make_Integer_Literal (Loc, Intval (Bound));
-- Case of a bound that has been rewritten to an
-- N_Raise_Constraint_Error node because it is an out-of-range
-- value. We may not call Duplicate_Subexpr on this node because
-- an N_Raise_Constraint_Error is not side effect free, and we may
-- not assume that we are in the proper context to remove side
-- effects on it at the point of reference.
elsif Nkind (Bound) = N_Raise_Constraint_Error then
return New_Copy_Tree (Bound);
else
return Duplicate_Subexpr_No_Checks (Bound);
end if;
end Get_E_First_Or_Last;
-----------------
-- Get_N_First --
-----------------
function Get_N_First (N : Node_Id; Indx : Nat) return Node_Id is
begin
return
Make_Attribute_Reference (Loc,
Attribute_Name => Name_First,
Prefix =>
Duplicate_Subexpr_No_Checks (N, Name_Req => True),
Expressions => New_List (
Make_Integer_Literal (Loc, Indx)));
end Get_N_First;
----------------
-- Get_N_Last --
----------------
function Get_N_Last (N : Node_Id; Indx : Nat) return Node_Id is
begin
return
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Last,
Prefix =>
Duplicate_Subexpr_No_Checks (N, Name_Req => True),
Expressions => New_List (
Make_Integer_Literal (Loc, Indx)));
end Get_N_Last;
------------------
-- Range_E_Cond --
------------------
function Range_E_Cond
(Exptyp : Entity_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id
is
begin
return
Make_Or_Else (Loc,
Left_Opnd =>
Make_Op_Lt (Loc,
Left_Opnd => Get_E_First_Or_Last (Exptyp, Indx, Name_First),
Right_Opnd => Get_E_First_Or_Last (Typ, Indx, Name_First)),
Right_Opnd =>
Make_Op_Gt (Loc,
Left_Opnd => Get_E_First_Or_Last (Exptyp, Indx, Name_Last),
Right_Opnd => Get_E_First_Or_Last (Typ, Indx, Name_Last)));
end Range_E_Cond;
------------------------
-- Range_Equal_E_Cond --
------------------------
function Range_Equal_E_Cond
(Exptyp : Entity_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id
is
begin
return
Make_Or_Else (Loc,
Left_Opnd =>
Make_Op_Ne (Loc,
Left_Opnd => Get_E_First_Or_Last (Exptyp, Indx, Name_First),
Right_Opnd => Get_E_First_Or_Last (Typ, Indx, Name_First)),
Right_Opnd =>
Make_Op_Ne (Loc,
Left_Opnd => Get_E_First_Or_Last (Exptyp, Indx, Name_Last),
Right_Opnd => Get_E_First_Or_Last (Typ, Indx, Name_Last)));
end Range_Equal_E_Cond;
------------------
-- Range_N_Cond --
------------------
function Range_N_Cond
(Expr : Node_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id
is
begin
return
Make_Or_Else (Loc,
Left_Opnd =>
Make_Op_Lt (Loc,
Left_Opnd => Get_N_First (Expr, Indx),
Right_Opnd => Get_E_First_Or_Last (Typ, Indx, Name_First)),
Right_Opnd =>
Make_Op_Gt (Loc,
Left_Opnd => Get_N_Last (Expr, Indx),
Right_Opnd => Get_E_First_Or_Last (Typ, Indx, Name_Last)));
end Range_N_Cond;
-- Start of processing for Selected_Range_Checks
begin
if not Expander_Active then
return Ret_Result;
end if;
if Target_Typ = Any_Type
or else Target_Typ = Any_Composite
or else Raises_Constraint_Error (Ck_Node)
then
return Ret_Result;
end if;
if No (Wnode) then
Wnode := Ck_Node;
end if;
T_Typ := Target_Typ;
if No (Source_Typ) then
S_Typ := Etype (Ck_Node);
else
S_Typ := Source_Typ;
end if;
if S_Typ = Any_Type or else S_Typ = Any_Composite then
return Ret_Result;
end if;
-- The order of evaluating T_Typ before S_Typ seems to be critical
-- because S_Typ can be derived from Etype (Ck_Node), if it's not passed
-- in, and since Node can be an N_Range node, it might be invalid.
-- Should there be an assert check somewhere for taking the Etype of
-- an N_Range node ???
if Is_Access_Type (T_Typ) and then Is_Access_Type (S_Typ) then
S_Typ := Designated_Type (S_Typ);
T_Typ := Designated_Type (T_Typ);
Do_Access := True;
-- A simple optimization
if Nkind (Ck_Node) = N_Null then
return Ret_Result;
end if;
end if;
-- For an N_Range Node, check for a null range and then if not
-- null generate a range check action.
if Nkind (Ck_Node) = N_Range then
-- There's no point in checking a range against itself
if Ck_Node = Scalar_Range (T_Typ) then
return Ret_Result;
end if;
declare
T_LB : constant Node_Id := Type_Low_Bound (T_Typ);
T_HB : constant Node_Id := Type_High_Bound (T_Typ);
LB : constant Node_Id := Low_Bound (Ck_Node);
HB : constant Node_Id := High_Bound (Ck_Node);
Null_Range : Boolean;
Out_Of_Range_L : Boolean;
Out_Of_Range_H : Boolean;
begin
-- Check for case where everything is static and we can
-- do the check at compile time. This is skipped if we
-- have an access type, since the access value may be null.
-- ??? This code can be improved since you only need to know
-- that the two respective bounds (LB & T_LB or HB & T_HB)
-- are known at compile time to emit pertinent messages.
if Compile_Time_Known_Value (LB)
and then Compile_Time_Known_Value (HB)
and then Compile_Time_Known_Value (T_LB)
and then Compile_Time_Known_Value (T_HB)
and then not Do_Access
then
-- Floating-point case
if Is_Floating_Point_Type (S_Typ) then
Null_Range := Expr_Value_R (HB) < Expr_Value_R (LB);
Out_Of_Range_L :=
(Expr_Value_R (LB) < Expr_Value_R (T_LB))
or else
(Expr_Value_R (LB) > Expr_Value_R (T_HB));
Out_Of_Range_H :=
(Expr_Value_R (HB) > Expr_Value_R (T_HB))
or else
(Expr_Value_R (HB) < Expr_Value_R (T_LB));
-- Fixed or discrete type case
else
Null_Range := Expr_Value (HB) < Expr_Value (LB);
Out_Of_Range_L :=
(Expr_Value (LB) < Expr_Value (T_LB))
or else
(Expr_Value (LB) > Expr_Value (T_HB));
Out_Of_Range_H :=
(Expr_Value (HB) > Expr_Value (T_HB))
or else
(Expr_Value (HB) < Expr_Value (T_LB));
end if;
if not Null_Range then
if Out_Of_Range_L then
if No (Warn_Node) then
Add_Check
(Compile_Time_Constraint_Error
(Low_Bound (Ck_Node),
"static value out of range of}?", T_Typ));
else
Add_Check
(Compile_Time_Constraint_Error
(Wnode,
"static range out of bounds of}?", T_Typ));
end if;
end if;
if Out_Of_Range_H then
if No (Warn_Node) then
Add_Check
(Compile_Time_Constraint_Error
(High_Bound (Ck_Node),
"static value out of range of}?", T_Typ));
else
Add_Check
(Compile_Time_Constraint_Error
(Wnode,
"static range out of bounds of}?", T_Typ));
end if;
end if;
end if;
else
declare
LB : Node_Id := Low_Bound (Ck_Node);
HB : Node_Id := High_Bound (Ck_Node);
begin
-- If either bound is a discriminant and we are within
-- the record declaration, it is a use of the discriminant
-- in a constraint of a component, and nothing can be
-- checked here. The check will be emitted within the
-- init proc. Before then, the discriminal has no real
-- meaning.
if Nkind (LB) = N_Identifier
and then Ekind (Entity (LB)) = E_Discriminant
then
if Current_Scope = Scope (Entity (LB)) then
return Ret_Result;
else
LB :=
New_Occurrence_Of (Discriminal (Entity (LB)), Loc);
end if;
end if;
if Nkind (HB) = N_Identifier
and then Ekind (Entity (HB)) = E_Discriminant
then
if Current_Scope = Scope (Entity (HB)) then
return Ret_Result;
else
HB :=
New_Occurrence_Of (Discriminal (Entity (HB)), Loc);
end if;
end if;
Cond := Discrete_Range_Cond (Ck_Node, T_Typ);
Set_Paren_Count (Cond, 1);
Cond :=
Make_And_Then (Loc,
Left_Opnd =>
Make_Op_Ge (Loc,
Left_Opnd => Duplicate_Subexpr_No_Checks (HB),
Right_Opnd => Duplicate_Subexpr_No_Checks (LB)),
Right_Opnd => Cond);
end;
end if;
end;
elsif Is_Scalar_Type (S_Typ) then
-- This somewhat duplicates what Apply_Scalar_Range_Check does,
-- except the above simply sets a flag in the node and lets
-- gigi generate the check base on the Etype of the expression.
-- Sometimes, however we want to do a dynamic check against an
-- arbitrary target type, so we do that here.
if Ekind (Base_Type (S_Typ)) /= Ekind (Base_Type (T_Typ)) then
Cond := Discrete_Expr_Cond (Ck_Node, T_Typ);
-- For literals, we can tell if the constraint error will be
-- raised at compile time, so we never need a dynamic check, but
-- if the exception will be raised, then post the usual warning,
-- and replace the literal with a raise constraint error
-- expression. As usual, skip this for access types
elsif Compile_Time_Known_Value (Ck_Node)
and then not Do_Access
then
declare
LB : constant Node_Id := Type_Low_Bound (T_Typ);
UB : constant Node_Id := Type_High_Bound (T_Typ);
Out_Of_Range : Boolean;
Static_Bounds : constant Boolean :=
Compile_Time_Known_Value (LB)
and Compile_Time_Known_Value (UB);
begin
-- Following range tests should use Sem_Eval routine ???
if Static_Bounds then
if Is_Floating_Point_Type (S_Typ) then
Out_Of_Range :=
(Expr_Value_R (Ck_Node) < Expr_Value_R (LB))
or else
(Expr_Value_R (Ck_Node) > Expr_Value_R (UB));
else -- fixed or discrete type
Out_Of_Range :=
Expr_Value (Ck_Node) < Expr_Value (LB)
or else
Expr_Value (Ck_Node) > Expr_Value (UB);
end if;
-- Bounds of the type are static and the literal is
-- out of range so make a warning message.
if Out_Of_Range then
if No (Warn_Node) then
Add_Check
(Compile_Time_Constraint_Error
(Ck_Node,
"static value out of range of}?", T_Typ));
else
Add_Check
(Compile_Time_Constraint_Error
(Wnode,
"static value out of range of}?", T_Typ));
end if;
end if;
else
Cond := Discrete_Expr_Cond (Ck_Node, T_Typ);
end if;
end;
-- Here for the case of a non-static expression, we need a runtime
-- check unless the source type range is guaranteed to be in the
-- range of the target type.
else
if not In_Subrange_Of (S_Typ, T_Typ) then
Cond := Discrete_Expr_Cond (Ck_Node, T_Typ);
end if;
end if;
end if;
if Is_Array_Type (T_Typ) and then Is_Array_Type (S_Typ) then
if Is_Constrained (T_Typ) then
Expr_Actual := Get_Referenced_Object (Ck_Node);
Exptyp := Get_Actual_Subtype (Expr_Actual);
if Is_Access_Type (Exptyp) then
Exptyp := Designated_Type (Exptyp);
end if;
-- String_Literal case. This needs to be handled specially be-
-- cause no index types are available for string literals. The
-- condition is simply:
-- T_Typ'Length = string-literal-length
if Nkind (Expr_Actual) = N_String_Literal then
null;
-- General array case. Here we have a usable actual subtype for
-- the expression, and the condition is built from the two types
-- T_Typ'First < Exptyp'First or else
-- T_Typ'Last > Exptyp'Last or else
-- T_Typ'First(1) < Exptyp'First(1) or else
-- T_Typ'Last(1) > Exptyp'Last(1) or else
-- ...
elsif Is_Constrained (Exptyp) then
declare
Ndims : constant Nat := Number_Dimensions (T_Typ);
L_Index : Node_Id;
R_Index : Node_Id;
L_Low : Node_Id;
L_High : Node_Id;
R_Low : Node_Id;
R_High : Node_Id;
begin
L_Index := First_Index (T_Typ);
R_Index := First_Index (Exptyp);
for Indx in 1 .. Ndims loop
if not (Nkind (L_Index) = N_Raise_Constraint_Error
or else
Nkind (R_Index) = N_Raise_Constraint_Error)
then
Get_Index_Bounds (L_Index, L_Low, L_High);
Get_Index_Bounds (R_Index, R_Low, R_High);
-- Deal with compile time length check. Note that we
-- skip this in the access case, because the access
-- value may be null, so we cannot know statically.
if not
Subtypes_Statically_Match
(Etype (L_Index), Etype (R_Index))
then
-- If the target type is constrained then we
-- have to check for exact equality of bounds
-- (required for qualified expressions).
if Is_Constrained (T_Typ) then
Evolve_Or_Else
(Cond,
Range_Equal_E_Cond (Exptyp, T_Typ, Indx));
else
Evolve_Or_Else
(Cond, Range_E_Cond (Exptyp, T_Typ, Indx));
end if;
end if;
Next (L_Index);
Next (R_Index);
end if;
end loop;
end;
-- Handle cases where we do not get a usable actual subtype that
-- is constrained. This happens for example in the function call
-- and explicit dereference cases. In these cases, we have to get
-- the length or range from the expression itself, making sure we
-- do not evaluate it more than once.
-- Here Ck_Node is the original expression, or more properly the
-- result of applying Duplicate_Expr to the original tree,
-- forcing the result to be a name.
else
declare
Ndims : constant Nat := Number_Dimensions (T_Typ);
begin
-- Build the condition for the explicit dereference case
for Indx in 1 .. Ndims loop
Evolve_Or_Else
(Cond, Range_N_Cond (Ck_Node, T_Typ, Indx));
end loop;
end;
end if;
else
-- Generate an Action to check that the bounds of the
-- source value are within the constraints imposed by the
-- target type for a conversion to an unconstrained type.
-- Rule is 4.6(38).
if Nkind (Parent (Ck_Node)) = N_Type_Conversion then
declare
Opnd_Index : Node_Id;
Targ_Index : Node_Id;
begin
Opnd_Index
:= First_Index (Get_Actual_Subtype (Ck_Node));
Targ_Index := First_Index (T_Typ);
while Opnd_Index /= Empty loop
if Nkind (Opnd_Index) = N_Range then
if Is_In_Range
(Low_Bound (Opnd_Index), Etype (Targ_Index))
and then
Is_In_Range
(High_Bound (Opnd_Index), Etype (Targ_Index))
then
null;
-- If null range, no check needed
elsif
Compile_Time_Known_Value (High_Bound (Opnd_Index))
and then
Compile_Time_Known_Value (Low_Bound (Opnd_Index))
and then
Expr_Value (High_Bound (Opnd_Index)) <
Expr_Value (Low_Bound (Opnd_Index))
then
null;
elsif Is_Out_Of_Range
(Low_Bound (Opnd_Index), Etype (Targ_Index))
or else
Is_Out_Of_Range
(High_Bound (Opnd_Index), Etype (Targ_Index))
then
Add_Check
(Compile_Time_Constraint_Error
(Wnode, "value out of range of}?", T_Typ));
else
Evolve_Or_Else
(Cond,
Discrete_Range_Cond
(Opnd_Index, Etype (Targ_Index)));
end if;
end if;
Next_Index (Opnd_Index);
Next_Index (Targ_Index);
end loop;
end;
end if;
end if;
end if;
-- Construct the test and insert into the tree
if Present (Cond) then
if Do_Access then
Cond := Guard_Access (Cond, Loc, Ck_Node);
end if;
Add_Check
(Make_Raise_Constraint_Error (Loc,
Condition => Cond,
Reason => CE_Range_Check_Failed));
end if;
return Ret_Result;
end Selected_Range_Checks;
-------------------------------
-- Storage_Checks_Suppressed --
-------------------------------
function Storage_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Storage_Check);
else
return Scope_Suppress (Storage_Check);
end if;
end Storage_Checks_Suppressed;
---------------------------
-- Tag_Checks_Suppressed --
---------------------------
function Tag_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) then
if Kill_Tag_Checks (E) then
return True;
elsif Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Tag_Check);
end if;
end if;
return Scope_Suppress (Tag_Check);
end Tag_Checks_Suppressed;
end Checks;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G P R E P --
-- --
-- S p e c --
-- --
-- Copyright (C) 2002-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package is the implementation of GNATPREP
package GPrep is
procedure Gnatprep;
-- Called by gnatprep
end GPrep;
|
-- Copyright (c) 2017 Maxim Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Incr.Lexers.Batch_Lexers.Generic_Lexers;
with Matreshka.Internals.Unicode;
package Ada_LSP.Ada_Lexers is
subtype Token is Incr.Lexers.Batch_Lexers.Rule_Index;
Abort_Token : constant Token := 1;
Abs_Token : constant Token := 2;
Abstract_Token : constant Token := 3;
Accept_Token : constant Token := 4;
Access_Token : constant Token := 5;
Aliased_Token : constant Token := 6;
All_Token : constant Token := 7;
Ampersand_Token : constant Token := 8;
And_Token : constant Token := 9;
Apostrophe_Token : constant Token := 10;
Array_Token : constant Token := 11;
Arrow_Token : constant Token := 12;
Assignment_Token : constant Token := 13;
At_Token : constant Token := 14;
Begin_Token : constant Token := 15;
Body_Token : constant Token := 16;
Box_Token : constant Token := 17;
Case_Token : constant Token := 18;
Character_Literal_Token : constant Token := 19;
Colon_Token : constant Token := 20;
Comma_Token : constant Token := 21;
Comment_Token : constant Token := 22;
Constant_Token : constant Token := 23;
Declare_Token : constant Token := 24;
Delay_Token : constant Token := 25;
Delta_Token : constant Token := 26;
Digits_Token : constant Token := 27;
Do_Token : constant Token := 28;
Dot_Token : constant Token := 29;
Double_Dot_Token : constant Token := 30;
Double_Star_Token : constant Token := 31;
Else_Token : constant Token := 32;
Elsif_Token : constant Token := 33;
End_Token : constant Token := 34;
Entry_Token : constant Token := 35;
Equal_Token : constant Token := 36;
Error_Token : constant Token := 37;
Exception_Token : constant Token := 38;
Exit_Token : constant Token := 39;
For_Token : constant Token := 40;
Function_Token : constant Token := 41;
Generic_Token : constant Token := 42;
Goto_Token : constant Token := 43;
Greater_Or_Equal_Token : constant Token := 44;
Greater_Token : constant Token := 45;
Hyphen_Token : constant Token := 46;
Identifier_Token : constant Token := 47;
If_Token : constant Token := 48;
In_Token : constant Token := 49;
Inequality_Token : constant Token := 50;
Interface_Token : constant Token := 51;
Is_Token : constant Token := 52;
Left_Label_Token : constant Token := 53;
Left_Parenthesis_Token : constant Token := 54;
Less_Or_Equal_Token : constant Token := 55;
Less_Token : constant Token := 56;
Limited_Token : constant Token := 57;
Loop_Token : constant Token := 58;
Mod_Token : constant Token := 59;
New_Line_Token : constant Token := 60;
New_Token : constant Token := 61;
Not_Token : constant Token := 62;
Null_Token : constant Token := 63;
Numeric_Literal_Token : constant Token := 64;
Of_Token : constant Token := 65;
Or_Token : constant Token := 66;
Others_Token : constant Token := 67;
Out_Token : constant Token := 68;
Overriding_Token : constant Token := 69;
Package_Token : constant Token := 70;
Plus_Token : constant Token := 71;
Pragma_Token : constant Token := 72;
Private_Token : constant Token := 73;
Procedure_Token : constant Token := 74;
Protected_Token : constant Token := 75;
Raise_Token : constant Token := 76;
Range_Token : constant Token := 77;
Record_Token : constant Token := 78;
Rem_Token : constant Token := 79;
Renames_Token : constant Token := 80;
Requeue_Token : constant Token := 81;
Return_Token : constant Token := 82;
Reverse_Token : constant Token := 83;
Right_Label_Token : constant Token := 84;
Right_Parenthesis_Token : constant Token := 85;
Select_Token : constant Token := 86;
Semicolon_Token : constant Token := 87;
Separate_Token : constant Token := 88;
Slash_Token : constant Token := 89;
Some_Token : constant Token := 90;
Space_Token : constant Token := 91;
Star_Token : constant Token := 92;
String_Literal_Token : constant Token := 93;
Subtype_Token : constant Token := 94;
Synchronized_Token : constant Token := 95;
Tagged_Token : constant Token := 96;
Task_Token : constant Token := 97;
Terminate_Token : constant Token := 98;
Then_Token : constant Token := 99;
Type_Token : constant Token := 100;
Until_Token : constant Token := 101;
Use_Token : constant Token := 102;
Vertical_Line_Token : constant Token := 103;
When_Token : constant Token := 104;
While_Token : constant Token := 105;
With_Token : constant Token := 106;
Xor_Token : constant Token := 107;
type Batch_Lexer is new Incr.Lexers.Batch_Lexers.Batch_Lexer with private;
overriding procedure Get_Token
(Self : access Batch_Lexer;
Result : out Incr.Lexers.Batch_Lexers.Rule_Index);
private
package Tables is
use Incr.Lexers.Batch_Lexers;
function To_Class (Value : Matreshka.Internals.Unicode.Code_Point)
return Character_Class;
pragma Inline (To_Class);
function Switch (S : State; Class : Character_Class) return State;
pragma Inline (Switch);
function Rule (S : State) return Rule_Index;
pragma Inline (Rule);
end Tables;
package Base_Lexers is new Incr.Lexers.Batch_Lexers.Generic_Lexers
(To_Class => Tables.To_Class,
Switch => Tables.Switch,
Rule => Tables.Rule,
First_Final => 34,
Last_Looping => 64,
Error_State => 86);
type Batch_Lexer is new Base_Lexers.Batch_Lexer with null record;
end Ada_LSP.Ada_Lexers;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E R R U T I L --
-- --
-- B o d y --
-- --
-- Copyright (C) 1991-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. 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 Err_Vars; use Err_Vars;
with Erroutc; use Erroutc;
with Namet; use Namet;
with Opt; use Opt;
with Output; use Output;
with Scans; use Scans;
with Sinput; use Sinput;
with Stylesw; use Stylesw;
package body Errutil is
Errors_Must_Be_Ignored : Boolean := False;
-- Set to True by procedure Set_Ignore_Errors (True), when calls to
-- error message procedures should be ignored (when parsing irrelevant
-- text in sources being preprocessed).
-----------------------
-- Local Subprograms --
-----------------------
procedure Error_Msg_AP (Msg : String);
-- Output a message just after the previous token
procedure Output_Source_Line
(L : Physical_Line_Number;
Sfile : Source_File_Index;
Errs : Boolean;
Source_Type : String);
-- Outputs text of source line L, in file S, together with preceding line
-- number, as described above for Output_Line_Number. The Errs parameter
-- indicates if there are errors attached to the line, which forces
-- listing on, even in the presence of pragma List (Off).
procedure Set_Msg_Insertion_Column;
-- Handle column number insertion (@ insertion character)
procedure Set_Msg_Text (Text : String; Flag : Source_Ptr);
-- Add a sequence of characters to the current message. The characters may
-- be one of the special insertion characters (see documentation in spec).
-- Flag is the location at which the error is to be posted, which is used
-- to determine whether or not the # insertion needs a file name. The
-- variables Msg_Buffer, Msglen, Is_Style_Msg, Is_Warning_Msg, and
-- Is_Unconditional_Msg are set on return.
------------------
-- Error_Msg_AP --
------------------
procedure Error_Msg_AP (Msg : String) is
S1 : Source_Ptr;
C : Character;
begin
-- If we had saved the Scan_Ptr value after scanning the previous
-- token, then we would have exactly the right place for putting
-- the flag immediately at hand. However, that would add at least
-- two instructions to a Scan call *just* to service the possibility
-- of an Error_Msg_AP call. So instead we reconstruct that value.
-- We have two possibilities, start with Prev_Token_Ptr and skip over
-- the current token, which is made harder by the possibility that this
-- token may be in error, or start with Token_Ptr and work backwards.
-- We used to take the second approach, but it's hard because of
-- comments, and harder still because things that look like comments
-- can appear inside strings. So now we take the first approach.
-- Note: in the case where there is no previous token, Prev_Token_Ptr
-- is set to Source_First, which is a reasonable position for the
-- error flag in this situation.
S1 := Prev_Token_Ptr;
C := Source (S1);
-- If the previous token is a string literal, we need a special approach
-- since there may be white space inside the literal and we don't want
-- to stop on that white space.
-- Note that it is not worth worrying about special UTF_32 line
-- terminator characters in this context, since this is only about
-- error recovery anyway.
if Prev_Token = Tok_String_Literal then
loop
S1 := S1 + 1;
if Source (S1) = C then
S1 := S1 + 1;
exit when Source (S1) /= C;
elsif Source (S1) in Line_Terminator then
exit;
end if;
end loop;
-- Character literal also needs special handling
elsif Prev_Token = Tok_Char_Literal then
S1 := S1 + 3;
-- Otherwise we search forward for the end of the current token, marked
-- by a line terminator, white space, a comment symbol or if we bump
-- into the following token (i.e. the current token)
-- Note that it is not worth worrying about special UTF_32 line
-- terminator characters in this context, since this is only about
-- error recovery anyway.
else
while Source (S1) not in Line_Terminator
and then Source (S1) /= ' '
and then Source (S1) /= ASCII.HT
and then (Source (S1) /= '-' or else Source (S1 + 1) /= '-')
and then S1 /= Token_Ptr
loop
S1 := S1 + 1;
end loop;
end if;
-- S1 is now set to the location for the flag
Error_Msg (Msg, S1);
end Error_Msg_AP;
---------------
-- Error_Msg --
---------------
procedure Error_Msg (Msg : String; Flag_Location : Source_Ptr) is
Next_Msg : Error_Msg_Id;
-- Pointer to next message at insertion point
Prev_Msg : Error_Msg_Id;
-- Pointer to previous message at insertion point
Sptr : Source_Ptr renames Flag_Location;
-- Corresponds to the Sptr value in the error message object
Optr : Source_Ptr renames Flag_Location;
-- Corresponds to the Optr value in the error message object. Note
-- that for this usage, Sptr and Optr always have the same value,
-- since we do not have to worry about generic instantiations.
begin
if Errors_Must_Be_Ignored then
return;
end if;
if Raise_Exception_On_Error /= 0 then
raise Error_Msg_Exception;
end if;
Test_Style_Warning_Serious_Msg (Msg);
Set_Msg_Text (Msg, Sptr);
-- Kill continuation if parent message killed
if Continuation and Last_Killed then
return;
end if;
-- Return without doing anything if message is killed and this is not
-- the first error message. The philosophy is that if we get a weird
-- error message and we already have had a message, then we hope the
-- weird message is a junk cascaded message
-- Immediate return if warning message and warnings are suppressed.
-- Note that style messages are not warnings for this purpose.
if Is_Warning_Msg and then Warnings_Suppressed (Sptr) then
Cur_Msg := No_Error_Msg;
return;
end if;
-- Otherwise build error message object for new message
Errors.Increment_Last;
Cur_Msg := Errors.Last;
Errors.Table (Cur_Msg).Text := new String'(Msg_Buffer (1 .. Msglen));
Errors.Table (Cur_Msg).Next := No_Error_Msg;
Errors.Table (Cur_Msg).Sptr := Sptr;
Errors.Table (Cur_Msg).Optr := Optr;
Errors.Table (Cur_Msg).Sfile := Get_Source_File_Index (Sptr);
Errors.Table (Cur_Msg).Line := Get_Physical_Line_Number (Sptr);
Errors.Table (Cur_Msg).Col := Get_Column_Number (Sptr);
Errors.Table (Cur_Msg).Style := Is_Style_Msg;
Errors.Table (Cur_Msg).Warn := Is_Warning_Msg;
Errors.Table (Cur_Msg).Serious := Is_Serious_Error;
Errors.Table (Cur_Msg).Uncond := Is_Unconditional_Msg;
Errors.Table (Cur_Msg).Msg_Cont := Continuation;
Errors.Table (Cur_Msg).Deleted := False;
Prev_Msg := No_Error_Msg;
Next_Msg := First_Error_Msg;
while Next_Msg /= No_Error_Msg loop
exit when
Errors.Table (Cur_Msg).Sfile < Errors.Table (Next_Msg).Sfile;
if Errors.Table (Cur_Msg).Sfile = Errors.Table (Next_Msg).Sfile then
exit when Sptr < Errors.Table (Next_Msg).Sptr;
end if;
Prev_Msg := Next_Msg;
Next_Msg := Errors.Table (Next_Msg).Next;
end loop;
-- Now we insert the new message in the error chain. The insertion
-- point for the message is after Prev_Msg and before Next_Msg.
-- The possible insertion point for the new message is after Prev_Msg
-- and before Next_Msg. However, this is where we do a special check
-- for redundant parsing messages, defined as messages posted on the
-- same line. The idea here is that probably such messages are junk
-- from the parser recovering. In full errors mode, we don't do this
-- deletion, but otherwise such messages are discarded at this stage.
if Prev_Msg /= No_Error_Msg
and then Errors.Table (Prev_Msg).Line =
Errors.Table (Cur_Msg).Line
and then Errors.Table (Prev_Msg).Sfile =
Errors.Table (Cur_Msg).Sfile
then
-- Don't delete unconditional messages and at this stage, don't
-- delete continuation lines (we attempted to delete those earlier
-- if the parent message was deleted.
if not Errors.Table (Cur_Msg).Uncond
and then not Continuation
then
-- Don't delete if prev msg is warning and new msg is an error.
-- This is because we don't want a real error masked by a warning.
-- In all other cases (that is parse errors for the same line that
-- are not unconditional) we do delete the message. This helps to
-- avoid junk extra messages from cascaded parsing errors
if not (Errors.Table (Prev_Msg).Warn
or else
Errors.Table (Prev_Msg).Style)
or else
(Errors.Table (Cur_Msg).Warn
or else
Errors.Table (Cur_Msg).Style)
then
-- All tests passed, delete the message by simply returning
-- without any further processing.
if not Continuation then
Last_Killed := True;
end if;
return;
end if;
end if;
end if;
-- Come here if message is to be inserted in the error chain
if not Continuation then
Last_Killed := False;
end if;
if Prev_Msg = No_Error_Msg then
First_Error_Msg := Cur_Msg;
else
Errors.Table (Prev_Msg).Next := Cur_Msg;
end if;
Errors.Table (Cur_Msg).Next := Next_Msg;
-- Bump appropriate statistics count
if Errors.Table (Cur_Msg).Warn
or else
Errors.Table (Cur_Msg).Style
then
Warnings_Detected := Warnings_Detected + 1;
else
Total_Errors_Detected := Total_Errors_Detected + 1;
if Errors.Table (Cur_Msg).Serious then
Serious_Errors_Detected := Serious_Errors_Detected + 1;
end if;
end if;
end Error_Msg;
-----------------
-- Error_Msg_S --
-----------------
procedure Error_Msg_S (Msg : String) is
begin
Error_Msg (Msg, Scan_Ptr);
end Error_Msg_S;
------------------
-- Error_Msg_SC --
------------------
procedure Error_Msg_SC (Msg : String) is
begin
-- If we are at end of file, post the flag after the previous token
if Token = Tok_EOF then
Error_Msg_AP (Msg);
-- For all other cases the message is posted at the current token
-- pointer position
else
Error_Msg (Msg, Token_Ptr);
end if;
end Error_Msg_SC;
------------------
-- Error_Msg_SP --
------------------
procedure Error_Msg_SP (Msg : String) is
begin
-- Note: in the case where there is no previous token, Prev_Token_Ptr
-- is set to Source_First, which is a reasonable position for the
-- error flag in this situation
Error_Msg (Msg, Prev_Token_Ptr);
end Error_Msg_SP;
--------------
-- Finalize --
--------------
procedure Finalize (Source_Type : String := "project") is
Cur : Error_Msg_Id;
Nxt : Error_Msg_Id;
E, F : Error_Msg_Id;
Err_Flag : Boolean;
begin
-- Eliminate any duplicated error messages from the list. This is
-- done after the fact to avoid problems with Change_Error_Text.
Cur := First_Error_Msg;
while Cur /= No_Error_Msg loop
Nxt := Errors.Table (Cur).Next;
F := Nxt;
while F /= No_Error_Msg
and then Errors.Table (F).Sptr = Errors.Table (Cur).Sptr
loop
Check_Duplicate_Message (Cur, F);
F := Errors.Table (F).Next;
end loop;
Cur := Nxt;
end loop;
-- Brief Error mode
if Brief_Output or (not Full_List and not Verbose_Mode) then
E := First_Error_Msg;
Set_Standard_Error;
while E /= No_Error_Msg loop
if not Errors.Table (E).Deleted then
if Full_Path_Name_For_Brief_Errors then
Write_Name (Full_Ref_Name (Errors.Table (E).Sfile));
else
Write_Name (Reference_Name (Errors.Table (E).Sfile));
end if;
Write_Char (':');
Write_Int (Int (Physical_To_Logical
(Errors.Table (E).Line,
Errors.Table (E).Sfile)));
Write_Char (':');
if Errors.Table (E).Col < 10 then
Write_Char ('0');
end if;
Write_Int (Int (Errors.Table (E).Col));
Write_Str (": ");
Output_Msg_Text (E);
Write_Eol;
end if;
E := Errors.Table (E).Next;
end loop;
Set_Standard_Output;
end if;
-- Full source listing case
if Full_List then
List_Pragmas_Index := 1;
List_Pragmas_Mode := True;
E := First_Error_Msg;
Write_Eol;
-- First list initial main source file with its error messages
for N in 1 .. Last_Source_Line (Main_Source_File) loop
Err_Flag :=
E /= No_Error_Msg
and then Errors.Table (E).Line = N
and then Errors.Table (E).Sfile = Main_Source_File;
Output_Source_Line (N, Main_Source_File, Err_Flag, Source_Type);
if Err_Flag then
Output_Error_Msgs (E);
Write_Eol;
end if;
end loop;
-- Then output errors, if any, for subsidiary units
while E /= No_Error_Msg
and then Errors.Table (E).Sfile /= Main_Source_File
loop
Write_Eol;
Output_Source_Line
(Errors.Table (E).Line,
Errors.Table (E).Sfile,
True,
Source_Type);
Output_Error_Msgs (E);
end loop;
end if;
-- Verbose mode (error lines only with error flags)
if Verbose_Mode then
E := First_Error_Msg;
-- Loop through error lines
while E /= No_Error_Msg loop
Write_Eol;
Output_Source_Line
(Errors.Table (E).Line,
Errors.Table (E).Sfile,
True,
Source_Type);
Output_Error_Msgs (E);
end loop;
end if;
-- Output error summary if verbose or full list mode
if Verbose_Mode or else Full_List then
-- Extra blank line if error messages or source listing were output
if Total_Errors_Detected + Warnings_Detected > 0
or else Full_List
then
Write_Eol;
end if;
-- Message giving number of lines read and number of errors detected.
-- This normally goes to Standard_Output. The exception is when brief
-- mode is not set, verbose mode (or full list mode) is set, and
-- there are errors. In this case we send the message to standard
-- error to make sure that *something* appears on standard error in
-- an error situation.
-- Formerly, only the "# errors" suffix was sent to stderr, whereas
-- "# lines:" appeared on stdout. This caused problems on VMS when
-- the stdout buffer was flushed, giving an extra line feed after
-- the prefix.
if Total_Errors_Detected + Warnings_Detected /= 0
and then not Brief_Output
and then (Verbose_Mode or Full_List)
then
Set_Standard_Error;
end if;
-- Message giving total number of lines
Write_Str (" ");
Write_Int (Num_Source_Lines (Main_Source_File));
if Num_Source_Lines (Main_Source_File) = 1 then
Write_Str (" line: ");
else
Write_Str (" lines: ");
end if;
if Total_Errors_Detected = 0 then
Write_Str ("No errors");
elsif Total_Errors_Detected = 1 then
Write_Str ("1 error");
else
Write_Int (Total_Errors_Detected);
Write_Str (" errors");
end if;
if Warnings_Detected /= 0 then
Write_Str (", ");
Write_Int (Warnings_Detected);
Write_Str (" warning");
if Warnings_Detected /= 1 then
Write_Char ('s');
end if;
if Warning_Mode = Treat_As_Error then
Write_Str (" (treated as error");
if Warnings_Detected /= 1 then
Write_Char ('s');
end if;
Write_Char (')');
end if;
end if;
Write_Eol;
Set_Standard_Output;
end if;
if Maximum_Messages /= 0 then
if Warnings_Detected >= Maximum_Messages then
Set_Standard_Error;
Write_Line ("maximum number of warnings detected");
Warning_Mode := Suppress;
end if;
if Total_Errors_Detected >= Maximum_Messages then
Set_Standard_Error;
Write_Line ("fatal error: maximum errors reached");
Set_Standard_Output;
end if;
end if;
if Warning_Mode = Treat_As_Error then
Total_Errors_Detected := Total_Errors_Detected + Warnings_Detected;
Warnings_Detected := 0;
end if;
end Finalize;
----------------
-- Initialize --
----------------
procedure Initialize is
begin
Errors.Init;
First_Error_Msg := No_Error_Msg;
Last_Error_Msg := No_Error_Msg;
Serious_Errors_Detected := 0;
Total_Errors_Detected := 0;
Warnings_Detected := 0;
Cur_Msg := No_Error_Msg;
-- Initialize warnings table, if all warnings are suppressed, supply
-- an initial dummy entry covering all possible source locations.
Warnings.Init;
if Warning_Mode = Suppress then
Warnings.Increment_Last;
Warnings.Table (Warnings.Last).Start := Source_Ptr'First;
Warnings.Table (Warnings.Last).Stop := Source_Ptr'Last;
end if;
end Initialize;
------------------------
-- Output_Source_Line --
------------------------
procedure Output_Source_Line
(L : Physical_Line_Number;
Sfile : Source_File_Index;
Errs : Boolean;
Source_Type : String)
is
S : Source_Ptr;
C : Character;
Line_Number_Output : Boolean := False;
-- Set True once line number is output
begin
if Sfile /= Current_Error_Source_File then
Write_Str ("==============Error messages for ");
Write_Str (Source_Type);
Write_Str (" file: ");
Write_Name (Full_File_Name (Sfile));
Write_Eol;
Current_Error_Source_File := Sfile;
end if;
if Errs then
Output_Line_Number (Physical_To_Logical (L, Sfile));
Line_Number_Output := True;
end if;
S := Line_Start (L, Sfile);
loop
C := Source_Text (Sfile) (S);
exit when C = ASCII.LF or else C = ASCII.CR or else C = EOF;
if Errs then
Write_Char (C);
end if;
S := S + 1;
end loop;
if Line_Number_Output then
Write_Eol;
end if;
end Output_Source_Line;
-----------------------
-- Set_Ignore_Errors --
-----------------------
procedure Set_Ignore_Errors (To : Boolean) is
begin
Errors_Must_Be_Ignored := To;
end Set_Ignore_Errors;
------------------------------
-- Set_Msg_Insertion_Column --
------------------------------
procedure Set_Msg_Insertion_Column is
begin
if RM_Column_Check then
Set_Msg_Str (" in column ");
Set_Msg_Int (Int (Error_Msg_Col) + 1);
end if;
end Set_Msg_Insertion_Column;
------------------
-- Set_Msg_Text --
------------------
procedure Set_Msg_Text (Text : String; Flag : Source_Ptr) is
C : Character; -- Current character
P : Natural; -- Current index;
begin
Manual_Quote_Mode := False;
Msglen := 0;
Flag_Source := Get_Source_File_Index (Flag);
P := Text'First;
while P <= Text'Last loop
C := Text (P);
P := P + 1;
-- Check for insertion character
if C = '%' then
if P <= Text'Last and then Text (P) = '%' then
P := P + 1;
Set_Msg_Insertion_Name_Literal;
else
Set_Msg_Insertion_Name;
end if;
elsif C = '$' then
-- '$' is ignored
null;
elsif C = '{' then
Set_Msg_Insertion_File_Name;
elsif C = '}' then
-- '}' is ignored
null;
elsif C = '*' then
Set_Msg_Insertion_Reserved_Name;
elsif C = '&' then
-- '&' is ignored
null;
elsif C = '#' then
Set_Msg_Insertion_Line_Number (Error_Msg_Sloc, Flag);
elsif C = '\' then
Continuation := True;
elsif C = '@' then
Set_Msg_Insertion_Column;
elsif C = '^' then
Set_Msg_Insertion_Uint;
elsif C = '`' then
Manual_Quote_Mode := not Manual_Quote_Mode;
Set_Msg_Char ('"');
elsif C = '!' then
Is_Unconditional_Msg := True;
elsif C = '?' then
null;
elsif C = '<' then
null;
elsif C = '|' then
null;
elsif C = ''' then
Set_Msg_Char (Text (P));
P := P + 1;
-- Upper case letter (start of reserved word if 2 or more)
elsif C in 'A' .. 'Z'
and then P <= Text'Last
and then Text (P) in 'A' .. 'Z'
then
P := P - 1;
Set_Msg_Insertion_Reserved_Word (Text, P);
-- Normal character with no special treatment
else
Set_Msg_Char (C);
end if;
end loop;
end Set_Msg_Text;
end Errutil;
|
------------------------------------------------------------------------------
-- --
-- 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_0007 is
pragma Preelaborate;
Group_0007 : aliased constant Core_Second_Stage
:= (16#00# .. 16#02# => -- 0700 .. 0702
(Other_Punctuation, Neutral,
Other, Other, S_Term, Alphabetic,
(STerm
| Terminal_Punctuation
| Grapheme_Base => True,
others => False)),
16#03# .. 16#0A# => -- 0703 .. 070A
(Other_Punctuation, Neutral,
Other, Other, Other, Alphabetic,
(Terminal_Punctuation
| Grapheme_Base => True,
others => False)),
16#0B# => -- 070B
(Other_Punctuation, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#0C# => -- 070C
(Other_Punctuation, Neutral,
Other, Other, Other, Alphabetic,
(Terminal_Punctuation
| Grapheme_Base => True,
others => False)),
16#0D# => -- 070D
(Other_Punctuation, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#0E# => -- 070E
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#0F# => -- 070F
(Format, Neutral,
Control, Format, Format, Alphabetic,
(Case_Ignorable => True,
others => False)),
16#11# => -- 0711
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#30# .. 16#3F# => -- 0730 .. 073F
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#40# .. 16#4A# => -- 0740 .. 074A
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#4B# .. 16#4C# => -- 074B .. 074C
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#A6# .. 16#B0# => -- 07A6 .. 07B0
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#B2# .. 16#BF# => -- 07B2 .. 07BF
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#C0# .. 16#C9# => -- 07C0 .. 07C9
(Decimal_Number, Neutral,
Other, Numeric, Numeric, Numeric,
(Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#EB# .. 16#F3# => -- 07EB .. 07F3
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#F4# .. 16#F5# => -- 07F4 .. 07F5
(Modifier_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Diacritic
| Alphabetic
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#F6# => -- 07F6
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#F7# => -- 07F7
(Other_Punctuation, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#F8# => -- 07F8
(Other_Punctuation, Neutral,
Other, Mid_Num, S_Continue, Infix_Numeric,
(Terminal_Punctuation
| Grapheme_Base => True,
others => False)),
16#F9# => -- 07F9
(Other_Punctuation, Neutral,
Other, Other, S_Term, Exclamation,
(STerm
| Terminal_Punctuation
| Grapheme_Base => True,
others => False)),
16#FA# => -- 07FA
(Modifier_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Extender
| Alphabetic
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#FB# .. 16#FF# => -- 07FB .. 07FF
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
others =>
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)));
end Matreshka.Internals.Unicode.Ucd.Core_0007;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- O S I N T - L --
-- --
-- S p e c --
-- --
-- Copyright (C) 2001-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 low level, operating system routines used only
-- in gnatls for command line processing and file input output.
package Osint.L is
function More_Lib_Files return Boolean;
-- Indicates whether more library information files remain to be processed.
-- Returns False right away if no source files, or if all source files
-- have been processed.
function Next_Main_Lib_File return File_Name_Type;
-- This function returns the name of the next library info file specified
-- on the command line. It is an error to call Next_Main_Lib_File if no
-- more library information files exist (i.e. Next_Main_Lib_File may be
-- called only if a previous call to More_Lib_Files returned True). This
-- name is the simple name, excluding any directory information.
end Osint.L;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- XML Processor --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-2014, 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 Ada_2012;
private package XML.SAX.Simple_Readers.Parser.Actions is
procedure On_Attribute_Default_Declaration
(Self : in out Simple_Reader'Class;
Default : Matreshka.Internals.Strings.Shared_String_Access);
-- Handles declaration of default value of the attribute.
procedure On_CDATA_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of CDATA type.
procedure On_CDATA_Open (Self : in out Simple_Reader'Class);
-- Process open of CDATA section.
procedure On_CDATA_Close (Self : in out Simple_Reader'Class);
-- Process close of CDATA section.
procedure On_Character_Data
(Self : in out Simple_Reader'Class;
Text : not null Matreshka.Internals.Strings.Shared_String_Access;
Is_Whitespace : Boolean);
-- Process segment of character data.
procedure On_Element_Attribute
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier;
Value : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Handles attribute of the element.
procedure On_Element_Attribute_Name
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Handles name of the attribute in the element. Now it olny switch scanner
-- into appopriate attribute value normalization mode.
procedure On_End_Of_Document (Self : in out Simple_Reader'Class);
-- Handles end of document.
procedure On_End_Of_Document_Type_Declaration
(Self : in out Simple_Reader'Class);
-- Handles end of document type declaration.
procedure On_End_Tag
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Handles end tag, rule [42].
procedure On_Empty_Element_Tag (Self : in out Simple_Reader'Class);
-- Process start tag, rule [44].
procedure On_Entity_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of CDATA type.
procedure On_Entities_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of CDATA type.
procedure On_Enumeration_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of enumeration type.
procedure On_Fixed_Attribute_Default_Declaration
(Self : in out Simple_Reader'Class;
Default : Matreshka.Internals.Strings.Shared_String_Access);
-- Handles declaration of fixed value of the attribute.
procedure On_General_Entity_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier;
Is_External : Boolean;
Value : League.Strings.Universal_String;
Notation : Matreshka.Internals.XML.Symbol_Identifier);
-- Process general entity declaration, rule [71].
procedure On_Id_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of CDATA type.
procedure On_IdRef_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of CDATA type.
procedure On_IdRefs_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of CDATA type.
procedure On_Implied_Attribute_Default_Declaration
(Self : in out Simple_Reader'Class);
-- Handles declaration of implied value of the attribute.
procedure On_Empty_Declaration
(Self : in out Simple_Reader'Class);
-- Handles declaration of empty of the element.
procedure On_Any_Declaration
(Self : in out Simple_Reader'Class);
-- Handles declaration of any of the element.
procedure On_Mixed_Content_Declaration
(Self : in out Simple_Reader'Class;
Is_Any : Boolean);
-- Handles declaration of mixed content of the element.
procedure On_Name_In_Mixed_Content_Declaration
(Self : in out Simple_Reader'Class);
-- Handles element name in the list of children element in mixed content
-- declration.
procedure On_NmToken_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of CDATA type.
procedure On_NmTokens_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of CDATA type.
procedure On_No_Document_Type_Declaration
(Self : in out Simple_Reader'Class);
-- Handles case when document type declaration is missing.
procedure On_Notation_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of NOTATION type.
procedure On_Notation_Declaration
(Self : in out Simple_Reader'Class;
Name : Matreshka.Internals.XML.Symbol_Identifier;
Public_Id : not null Matreshka.Internals.Strings.Shared_String_Access;
System_Id : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Handles declaration of notation.
procedure On_Open_Of_Tag
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Handles open of element's tag. The only purpose now is to resolve
-- element and set identifier of the declaration of currently
-- processed element.
procedure On_Parameter_Entity_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier;
Is_External : Boolean;
Value : League.Strings.Universal_String);
-- Process parameter entity declaration, rule [72].
procedure On_Required_Attribute_Default_Declaration
(Self : in out Simple_Reader'Class);
-- Handles declaration of required value of the attribute.
procedure On_Start_Of_Attribute_List_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Handles start of attribute list declaration.
procedure On_Start_Of_Document
(Self : in out Simple_Reader'Class);
-- Handles start of document.
procedure On_Start_Of_Document_Type_Declaration
(Self : in out Simple_Reader'Class;
Name : Matreshka.Internals.XML.Symbol_Identifier;
External : Boolean);
-- Handles start of document type declaration.
procedure On_Start_Of_Element_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Handles start of element declaration.
procedure On_Start_Tag (Self : in out Simple_Reader'Class);
-- Handles start tag of element.
procedure On_XML_Declaration
(Self : in out Simple_Reader'Class;
Version : not null Matreshka.Internals.Strings.Shared_String_Access;
Encoding : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Handles XML version information and entity's encoding by switching
-- scanner to the corresponding processing mode.
procedure On_Text_Declaration
(Self : in out Simple_Reader'Class;
Version : not null Matreshka.Internals.Strings.Shared_String_Access;
Encoding : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Handles XML version information and entity's encoding in external
-- entity.
procedure On_Standalone
(Self : in out Simple_Reader'Class;
Text : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Handles 'standalone' element of XML declaration.
procedure On_Processing_Instruction
(Self : in out Simple_Reader'Class;
Target : Matreshka.Internals.XML.Symbol_Identifier;
Data : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Process processing instruction.
end XML.SAX.Simple_Readers.Parser.Actions;
|
-- Copyright 2008-2020 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 Homonym is
procedure Start_Test;
end Homonym;
|
------------------------------------------------------------------------------
-- --
-- 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.UML_Packageable_Elements;
with AMF.UML.Dependencies.Collections;
with AMF.UML.Named_Elements;
with AMF.UML.Namespaces;
with AMF.UML.Packages.Collections;
with AMF.UML.Parameterable_Elements;
with AMF.UML.String_Expressions;
with AMF.UML.Template_Parameters;
with AMF.UML.Time_Events;
with AMF.UML.Time_Expressions;
with AMF.Visitors;
package AMF.Internals.UML_Time_Events is
type UML_Time_Event_Proxy is
limited new AMF.Internals.UML_Packageable_Elements.UML_Packageable_Element_Proxy
and AMF.UML.Time_Events.UML_Time_Event with null record;
overriding function Get_Is_Relative
(Self : not null access constant UML_Time_Event_Proxy)
return Boolean;
-- Getter of TimeEvent::isRelative.
--
-- Specifies whether it is relative or absolute time.
overriding procedure Set_Is_Relative
(Self : not null access UML_Time_Event_Proxy;
To : Boolean);
-- Setter of TimeEvent::isRelative.
--
-- Specifies whether it is relative or absolute time.
overriding function Get_When
(Self : not null access constant UML_Time_Event_Proxy)
return AMF.UML.Time_Expressions.UML_Time_Expression_Access;
-- Getter of TimeEvent::when.
--
-- Specifies the corresponding time deadline.
overriding procedure Set_When
(Self : not null access UML_Time_Event_Proxy;
To : AMF.UML.Time_Expressions.UML_Time_Expression_Access);
-- Setter of TimeEvent::when.
--
-- Specifies the corresponding time deadline.
overriding function Get_Client_Dependency
(Self : not null access constant UML_Time_Event_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency;
-- Getter of NamedElement::clientDependency.
--
-- Indicates the dependencies that reference the client.
overriding function Get_Name_Expression
(Self : not null access constant UML_Time_Event_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access;
-- Getter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding procedure Set_Name_Expression
(Self : not null access UML_Time_Event_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access);
-- Setter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding function Get_Namespace
(Self : not null access constant UML_Time_Event_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Getter of NamedElement::namespace.
--
-- Specifies the namespace that owns the NamedElement.
overriding function Get_Qualified_Name
(Self : not null access constant UML_Time_Event_Proxy)
return AMF.Optional_String;
-- Getter of NamedElement::qualifiedName.
--
-- A name which allows the NamedElement to be identified within a
-- hierarchy of nested Namespaces. It is constructed from the names of the
-- containing namespaces starting at the root of the hierarchy and ending
-- with the name of the NamedElement itself.
overriding function Get_Owning_Template_Parameter
(Self : not null access constant UML_Time_Event_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
-- Getter of ParameterableElement::owningTemplateParameter.
--
-- The formal template parameter that owns this element.
overriding procedure Set_Owning_Template_Parameter
(Self : not null access UML_Time_Event_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
-- Setter of ParameterableElement::owningTemplateParameter.
--
-- The formal template parameter that owns this element.
overriding function Get_Template_Parameter
(Self : not null access constant UML_Time_Event_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
-- Getter of ParameterableElement::templateParameter.
--
-- The template parameter that exposes this element as a formal parameter.
overriding procedure Set_Template_Parameter
(Self : not null access UML_Time_Event_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
-- Setter of ParameterableElement::templateParameter.
--
-- The template parameter that exposes this element as a formal parameter.
overriding function All_Owning_Packages
(Self : not null access constant UML_Time_Event_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package;
-- Operation NamedElement::allOwningPackages.
--
-- The query allOwningPackages() returns all the directly or indirectly
-- owning packages.
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Time_Event_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean;
-- Operation NamedElement::isDistinguishableFrom.
--
-- The query isDistinguishableFrom() determines whether two NamedElements
-- may logically co-exist within a Namespace. By default, two named
-- elements are distinguishable if (a) they have unrelated types or (b)
-- they have related types but different names.
overriding function Namespace
(Self : not null access constant UML_Time_Event_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Operation NamedElement::namespace.
--
-- Missing derivation for NamedElement::/namespace : Namespace
overriding function Is_Compatible_With
(Self : not null access constant UML_Time_Event_Proxy;
P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
return Boolean;
-- Operation ParameterableElement::isCompatibleWith.
--
-- The query isCompatibleWith() determines if this parameterable element
-- is compatible with the specified parameterable element. By default
-- parameterable element P is compatible with parameterable element Q if
-- the kind of P is the same or a subtype as the kind of Q. Subclasses
-- should override this operation to specify different compatibility
-- constraints.
overriding function Is_Template_Parameter
(Self : not null access constant UML_Time_Event_Proxy)
return Boolean;
-- Operation ParameterableElement::isTemplateParameter.
--
-- The query isTemplateParameter() determines if this parameterable
-- element is exposed as a formal template parameter.
overriding procedure Enter_Element
(Self : not null access constant UML_Time_Event_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of visitor interface.
overriding procedure Leave_Element
(Self : not null access constant UML_Time_Event_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of visitor interface.
overriding procedure Visit_Element
(Self : not null access constant UML_Time_Event_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of iterator interface.
end AMF.Internals.UML_Time_Events;
|
-----------------------------------------------------------------------
-- awa-wikis-writers -- Wiki writers
-- Copyright (C) 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 AWA.Wikis.Parsers;
package AWA.Wikis.Writers is
-- Render the wiki text according to the wiki syntax in an HTML string.
function To_Html (Text : in Wide_Wide_String;
Syntax : in AWA.Wikis.Parsers.Wiki_Syntax_Type) return String;
-- Render the wiki text according to the wiki syntax in a text string.
-- Wiki formatting and decoration are removed.
function To_Text (Text : in Wide_Wide_String;
Syntax : in AWA.Wikis.Parsers.Wiki_Syntax_Type) return String;
end AWA.Wikis.Writers;
|
-----------------------------------------------------------------------
-- awa-modules-reader -- Read module configuration files
-- Copyright (C) 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 Util.Serialize.IO.XML;
with AWA.Applications.Configs;
with Security.Policies;
-- The <b>AWA.Modules.Reader</b> package reads the module configuration files
-- and initializes the module.
package body AWA.Modules.Reader is
-- ------------------------------
-- Read the module configuration file and configure the components
-- ------------------------------
procedure Read_Configuration (Plugin : in out Module'Class;
File : in String;
Context : in EL.Contexts.Default.Default_Context_Access) is
Reader : Util.Serialize.IO.XML.Parser;
package Config is
new AWA.Applications.Configs.Reader_Config (Reader,
Plugin.App.all'Unchecked_Access,
Context);
pragma Warnings (Off, Config);
Sec : constant Security.Policies.Policy_Manager_Access := Plugin.App.Get_Security_Manager;
begin
Log.Info ("Reading module configuration file {0}", File);
Sec.Prepare_Config (Reader);
if AWA.Modules.Log.Get_Level >= Util.Log.DEBUG_LEVEL then
Util.Serialize.IO.Dump (Reader, AWA.Modules.Log);
end if;
-- Read the configuration file and record managed beans, navigation rules.
Reader.Parse (File);
Sec.Finish_Config (Reader);
exception
when others =>
Log.Error ("Error while reading {0}", File);
raise;
end Read_Configuration;
end AWA.Modules.Reader;
|
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2016 onox <denkpadje@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 GL.API;
with GL.Helpers;
with GL.Low_Level;
with GL.Enums.Textures;
package body GL.Objects.Samplers is
procedure Bind (Object : Sampler; Unit : Textures.Texture_Unit) is
begin
API.Bind_Sampler.Ref (UInt (Unit), Object.Reference.GL_Id);
end Bind;
procedure Bind (Objects : Sampler_Array; First_Unit : Textures.Texture_Unit) is
Sampler_Ids : Low_Level.UInt_Array (Objects'Range);
begin
for Index in Objects'Range loop
Sampler_Ids (Index) := Objects (Index).Reference.GL_Id;
end loop;
API.Bind_Samplers.Ref (UInt (First_Unit), Sampler_Ids'Length, Sampler_Ids);
end Bind;
overriding
procedure Initialize_Id (Object : in out Sampler) is
New_Id : UInt := 0;
begin
API.Create_Samplers.Ref (1, New_Id);
Object.Reference.GL_Id := New_Id;
end Initialize_Id;
overriding
procedure Delete_Id (Object : in out Sampler) is
begin
API.Delete_Samplers.Ref (1, (1 => Object.Reference.GL_Id));
Object.Reference.GL_Id := 0;
end Delete_Id;
-----------------------------------------------------------------------------
-- Sampler Parameters --
-----------------------------------------------------------------------------
procedure Set_Minifying_Filter (Object : Sampler;
Filter : Minifying_Function) is
begin
API.Sampler_Parameter_Minifying_Function.Ref
(Object.Reference.GL_Id, Enums.Textures.Min_Filter, Filter);
end Set_Minifying_Filter;
function Minifying_Filter (Object : Sampler) return Minifying_Function is
Ret : Minifying_Function := Minifying_Function'First;
begin
API.Get_Sampler_Parameter_Minifying_Function.Ref
(Object.Reference.GL_Id, Enums.Textures.Min_Filter, Ret);
return Ret;
end Minifying_Filter;
procedure Set_Magnifying_Filter (Object : Sampler;
Filter : Magnifying_Function) is
begin
API.Sampler_Parameter_Magnifying_Function.Ref
(Object.Reference.GL_Id, Enums.Textures.Mag_Filter, Filter);
end Set_Magnifying_Filter;
function Magnifying_Filter (Object : Sampler) return Magnifying_Function is
Ret : Magnifying_Function := Magnifying_Function'First;
begin
API.Get_Sampler_Parameter_Magnifying_Function.Ref
(Object.Reference.GL_Id, Enums.Textures.Mag_Filter, Ret);
return Ret;
end Magnifying_Filter;
procedure Set_Minimum_LoD (Object : Sampler; Level : Double) is
begin
API.Sampler_Parameter_Float.Ref
(Object.Reference.GL_Id, Enums.Textures.Min_LoD, Single (Level));
end Set_Minimum_LoD;
function Minimum_LoD (Object : Sampler) return Double is
Ret : Low_Level.Single_Array (1 .. 1);
begin
API.Get_Sampler_Parameter_Floats.Ref
(Object.Reference.GL_Id, Enums.Textures.Min_LoD, Ret);
return Double (Ret (1));
end Minimum_LoD;
procedure Set_Maximum_LoD (Object : Sampler; Level : Double) is
begin
API.Sampler_Parameter_Float.Ref
(Object.Reference.GL_Id, Enums.Textures.Max_LoD, Single (Level));
end Set_Maximum_LoD;
function Maximum_LoD (Object : Sampler) return Double is
Ret : Low_Level.Single_Array (1 .. 1);
begin
API.Get_Sampler_Parameter_Floats.Ref
(Object.Reference.GL_Id, Enums.Textures.Max_LoD, Ret);
return Double (Ret (1));
end Maximum_LoD;
procedure Set_LoD_Bias (Object : Sampler; Level : Double) is
begin
API.Sampler_Parameter_Float.Ref
(Object.Reference.GL_Id, Enums.Textures.LoD_Bias, Single (Level));
end Set_LoD_Bias;
function LoD_Bias (Object : Sampler) return Double is
Ret : Low_Level.Single_Array (1 .. 1);
begin
API.Get_Sampler_Parameter_Floats.Ref
(Object.Reference.GL_Id, Enums.Textures.LoD_Bias, Ret);
return Double (Ret (1));
end LoD_Bias;
procedure Set_Seamless_Filtering (Object : Sampler; Enable : Boolean) is
begin
API.Sampler_Parameter_Bool.Ref
(Object.Reference.GL_Id, Enums.Textures.Cube_Map_Seamless,
Low_Level.Bool (Enable));
end Set_Seamless_Filtering;
function Seamless_Filtering (Object : Sampler) return Boolean is
Result : Low_Level.Bool := Low_Level.Bool'First;
begin
API.Get_Sampler_Parameter_Bool.Ref
(Object.Reference.GL_Id, Enums.Textures.Cube_Map_Seamless, Result);
return Boolean (Result);
end Seamless_Filtering;
procedure Set_Max_Anisotropy (Object : Sampler; Degree : Double) is
begin
API.Sampler_Parameter_Float.Ref
(Object.Reference.GL_Id, Enums.Textures.Max_Anisotropy, Single (Degree));
end Set_Max_Anisotropy;
function Max_Anisotropy (Object : Sampler) return Double is
Ret : Low_Level.Single_Array (1 .. 1);
begin
API.Get_Sampler_Parameter_Floats.Ref
(Object.Reference.GL_Id, Enums.Textures.Max_Anisotropy, Ret);
return Double (Ret (1));
end Max_Anisotropy;
procedure Set_X_Wrapping (Object : Sampler; Mode : Wrapping_Mode) is
begin
API.Sampler_Parameter_Wrapping_Mode.Ref
(Object.Reference.GL_Id, Enums.Textures.Wrap_S, Mode);
end Set_X_Wrapping;
function X_Wrapping (Object : Sampler) return Wrapping_Mode is
Ret : Wrapping_Mode := Wrapping_Mode'First;
begin
API.Get_Sampler_Parameter_Wrapping_Mode.Ref
(Object.Reference.GL_Id, Enums.Textures.Wrap_S, Ret);
return Ret;
end X_Wrapping;
procedure Set_Y_Wrapping (Object : Sampler; Mode : Wrapping_Mode) is
begin
API.Sampler_Parameter_Wrapping_Mode.Ref
(Object.Reference.GL_Id, Enums.Textures.Wrap_T, Mode);
end Set_Y_Wrapping;
function Y_Wrapping (Object : Sampler) return Wrapping_Mode is
Ret : Wrapping_Mode := Wrapping_Mode'First;
begin
API.Get_Sampler_Parameter_Wrapping_Mode.Ref
(Object.Reference.GL_Id, Enums.Textures.Wrap_T, Ret);
return Ret;
end Y_Wrapping;
procedure Set_Z_Wrapping (Object : Sampler; Mode : Wrapping_Mode) is
begin
API.Sampler_Parameter_Wrapping_Mode.Ref
(Object.Reference.GL_Id, Enums.Textures.Wrap_R, Mode);
end Set_Z_Wrapping;
function Z_Wrapping (Object : Sampler) return Wrapping_Mode is
Ret : Wrapping_Mode := Wrapping_Mode'First;
begin
API.Get_Sampler_Parameter_Wrapping_Mode.Ref
(Object.Reference.GL_Id, Enums.Textures.Wrap_R, Ret);
return Ret;
end Z_Wrapping;
procedure Set_Border_Color (Object : Sampler; Color : Colors.Border_Color) is
Raw : constant Low_Level.Single_Array
:= Helpers.Float_Array (Colors.Vulkan_To_OpenGL (Color));
begin
API.Sampler_Parameter_Floats.Ref
(Object.Reference.GL_Id, Enums.Textures.Border_Color, Raw);
end Set_Border_Color;
function Border_Color (Object : Sampler) return Colors.Border_Color is
Raw : Low_Level.Single_Array (1 .. 4);
begin
API.Get_Sampler_Parameter_Floats.Ref
(Object.Reference.GL_Id, Enums.Textures.Border_Color, Raw);
return Colors.OpenGL_To_Vulkan (Helpers.Color (Raw));
end Border_Color;
procedure Set_Compare_X_To_Texture (Object : Sampler; Enabled : Boolean) is
Value : Enums.Textures.Compare_Kind;
begin
if Enabled then
Value := Enums.Textures.Compare_R_To_Texture;
else
Value := Enums.Textures.None;
end if;
API.Sampler_Parameter_Compare_Kind.Ref
(Object.Reference.GL_Id, Enums.Textures.Compare_Mode, Value);
end Set_Compare_X_To_Texture;
function Compare_X_To_Texture_Enabled (Object : Sampler) return Boolean is
use type Enums.Textures.Compare_Kind;
Value : Enums.Textures.Compare_Kind := Enums.Textures.Compare_Kind'First;
begin
API.Get_Sampler_Parameter_Compare_Kind.Ref
(Object.Reference.GL_Id, Enums.Textures.Compare_Mode, Value);
return Value = Enums.Textures.Compare_R_To_Texture;
end Compare_X_To_Texture_Enabled;
procedure Set_Compare_Function (Object : Sampler; Func : Compare_Function) is
begin
API.Sampler_Parameter_Compare_Function.Ref
(Object.Reference.GL_Id, Enums.Textures.Compare_Func, Func);
end Set_Compare_Function;
function Current_Compare_Function (Object : Sampler) return Compare_Function is
Value : Compare_Function := Compare_Function'First;
begin
API.Get_Sampler_Parameter_Compare_Function.Ref
(Object.Reference.GL_Id, Enums.Textures.Compare_Func, Value);
return Value;
end Current_Compare_Function;
end GL.Objects.Samplers;
|
-- This spec has been automatically generated from STM32L0x3.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.DMA is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- interrupt status register
type ISR_Register is record
-- Read-only. Channel x global interrupt flag (x = 1 ..7)
GIF1 : Boolean;
-- Read-only. Channel x transfer complete flag (x = 1 ..7)
TCIF1 : Boolean;
-- Read-only. Channel x half transfer flag (x = 1 ..7)
HTIF1 : Boolean;
-- Read-only. Channel x transfer error flag (x = 1 ..7)
TEIF1 : Boolean;
-- Read-only. Channel x global interrupt flag (x = 1 ..7)
GIF2 : Boolean;
-- Read-only. Channel x transfer complete flag (x = 1 ..7)
TCIF2 : Boolean;
-- Read-only. Channel x half transfer flag (x = 1 ..7)
HTIF2 : Boolean;
-- Read-only. Channel x transfer error flag (x = 1 ..7)
TEIF2 : Boolean;
-- Read-only. Channel x global interrupt flag (x = 1 ..7)
GIF3 : Boolean;
-- Read-only. Channel x transfer complete flag (x = 1 ..7)
TCIF3 : Boolean;
-- Read-only. Channel x half transfer flag (x = 1 ..7)
HTIF3 : Boolean;
-- Read-only. Channel x transfer error flag (x = 1 ..7)
TEIF3 : Boolean;
-- Read-only. Channel x global interrupt flag (x = 1 ..7)
GIF4 : Boolean;
-- Read-only. Channel x transfer complete flag (x = 1 ..7)
TCIF4 : Boolean;
-- Read-only. Channel x half transfer flag (x = 1 ..7)
HTIF4 : Boolean;
-- Read-only. Channel x transfer error flag (x = 1 ..7)
TEIF4 : Boolean;
-- Read-only. Channel x global interrupt flag (x = 1 ..7)
GIF5 : Boolean;
-- Read-only. Channel x transfer complete flag (x = 1 ..7)
TCIF5 : Boolean;
-- Read-only. Channel x half transfer flag (x = 1 ..7)
HTIF5 : Boolean;
-- Read-only. Channel x transfer error flag (x = 1 ..7)
TEIF5 : Boolean;
-- Read-only. Channel x global interrupt flag (x = 1 ..7)
GIF6 : Boolean;
-- Read-only. Channel x transfer complete flag (x = 1 ..7)
TCIF6 : Boolean;
-- Read-only. Channel x half transfer flag (x = 1 ..7)
HTIF6 : Boolean;
-- Read-only. Channel x transfer error flag (x = 1 ..7)
TEIF6 : Boolean;
-- Read-only. Channel x global interrupt flag (x = 1 ..7)
GIF7 : Boolean;
-- Read-only. Channel x transfer complete flag (x = 1 ..7)
TCIF7 : Boolean;
-- Read-only. Channel x half transfer flag (x = 1 ..7)
HTIF7 : Boolean;
-- Read-only. Channel x transfer error flag (x = 1 ..7)
TEIF7 : Boolean;
-- unspecified
Reserved_28_31 : HAL.UInt4;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ISR_Register use record
GIF1 at 0 range 0 .. 0;
TCIF1 at 0 range 1 .. 1;
HTIF1 at 0 range 2 .. 2;
TEIF1 at 0 range 3 .. 3;
GIF2 at 0 range 4 .. 4;
TCIF2 at 0 range 5 .. 5;
HTIF2 at 0 range 6 .. 6;
TEIF2 at 0 range 7 .. 7;
GIF3 at 0 range 8 .. 8;
TCIF3 at 0 range 9 .. 9;
HTIF3 at 0 range 10 .. 10;
TEIF3 at 0 range 11 .. 11;
GIF4 at 0 range 12 .. 12;
TCIF4 at 0 range 13 .. 13;
HTIF4 at 0 range 14 .. 14;
TEIF4 at 0 range 15 .. 15;
GIF5 at 0 range 16 .. 16;
TCIF5 at 0 range 17 .. 17;
HTIF5 at 0 range 18 .. 18;
TEIF5 at 0 range 19 .. 19;
GIF6 at 0 range 20 .. 20;
TCIF6 at 0 range 21 .. 21;
HTIF6 at 0 range 22 .. 22;
TEIF6 at 0 range 23 .. 23;
GIF7 at 0 range 24 .. 24;
TCIF7 at 0 range 25 .. 25;
HTIF7 at 0 range 26 .. 26;
TEIF7 at 0 range 27 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-- interrupt flag clear register
type IFCR_Register is record
-- Write-only. Channel x global interrupt clear (x = 1 ..7)
CGIF1 : Boolean := False;
-- Write-only. Channel x transfer complete clear (x = 1 ..7)
CTCIF1 : Boolean := False;
-- Write-only. Channel x half transfer clear (x = 1 ..7)
CHTIF1 : Boolean := False;
-- Write-only. Channel x transfer error clear (x = 1 ..7)
CTEIF1 : Boolean := False;
-- Write-only. Channel x global interrupt clear (x = 1 ..7)
CGIF2 : Boolean := False;
-- Write-only. Channel x transfer complete clear (x = 1 ..7)
CTCIF2 : Boolean := False;
-- Write-only. Channel x half transfer clear (x = 1 ..7)
CHTIF2 : Boolean := False;
-- Write-only. Channel x transfer error clear (x = 1 ..7)
CTEIF2 : Boolean := False;
-- Write-only. Channel x global interrupt clear (x = 1 ..7)
CGIF3 : Boolean := False;
-- Write-only. Channel x transfer complete clear (x = 1 ..7)
CTCIF3 : Boolean := False;
-- Write-only. Channel x half transfer clear (x = 1 ..7)
CHTIF3 : Boolean := False;
-- Write-only. Channel x transfer error clear (x = 1 ..7)
CTEIF3 : Boolean := False;
-- Write-only. Channel x global interrupt clear (x = 1 ..7)
CGIF4 : Boolean := False;
-- Write-only. Channel x transfer complete clear (x = 1 ..7)
CTCIF4 : Boolean := False;
-- Write-only. Channel x half transfer clear (x = 1 ..7)
CHTIF4 : Boolean := False;
-- Write-only. Channel x transfer error clear (x = 1 ..7)
CTEIF4 : Boolean := False;
-- Write-only. Channel x global interrupt clear (x = 1 ..7)
CGIF5 : Boolean := False;
-- Write-only. Channel x transfer complete clear (x = 1 ..7)
CTCIF5 : Boolean := False;
-- Write-only. Channel x half transfer clear (x = 1 ..7)
CHTIF5 : Boolean := False;
-- Write-only. Channel x transfer error clear (x = 1 ..7)
CTEIF5 : Boolean := False;
-- Write-only. Channel x global interrupt clear (x = 1 ..7)
CGIF6 : Boolean := False;
-- Write-only. Channel x transfer complete clear (x = 1 ..7)
CTCIF6 : Boolean := False;
-- Write-only. Channel x half transfer clear (x = 1 ..7)
CHTIF6 : Boolean := False;
-- Write-only. Channel x transfer error clear (x = 1 ..7)
CTEIF6 : Boolean := False;
-- Write-only. Channel x global interrupt clear (x = 1 ..7)
CGIF7 : Boolean := False;
-- Write-only. Channel x transfer complete clear (x = 1 ..7)
CTCIF7 : Boolean := False;
-- Write-only. Channel x half transfer clear (x = 1 ..7)
CHTIF7 : Boolean := False;
-- Write-only. Channel x transfer error clear (x = 1 ..7)
CTEIF7 : Boolean := False;
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IFCR_Register use record
CGIF1 at 0 range 0 .. 0;
CTCIF1 at 0 range 1 .. 1;
CHTIF1 at 0 range 2 .. 2;
CTEIF1 at 0 range 3 .. 3;
CGIF2 at 0 range 4 .. 4;
CTCIF2 at 0 range 5 .. 5;
CHTIF2 at 0 range 6 .. 6;
CTEIF2 at 0 range 7 .. 7;
CGIF3 at 0 range 8 .. 8;
CTCIF3 at 0 range 9 .. 9;
CHTIF3 at 0 range 10 .. 10;
CTEIF3 at 0 range 11 .. 11;
CGIF4 at 0 range 12 .. 12;
CTCIF4 at 0 range 13 .. 13;
CHTIF4 at 0 range 14 .. 14;
CTEIF4 at 0 range 15 .. 15;
CGIF5 at 0 range 16 .. 16;
CTCIF5 at 0 range 17 .. 17;
CHTIF5 at 0 range 18 .. 18;
CTEIF5 at 0 range 19 .. 19;
CGIF6 at 0 range 20 .. 20;
CTCIF6 at 0 range 21 .. 21;
CHTIF6 at 0 range 22 .. 22;
CTEIF6 at 0 range 23 .. 23;
CGIF7 at 0 range 24 .. 24;
CTCIF7 at 0 range 25 .. 25;
CHTIF7 at 0 range 26 .. 26;
CTEIF7 at 0 range 27 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
subtype CCR_PSIZE_Field is HAL.UInt2;
subtype CCR_MSIZE_Field is HAL.UInt2;
subtype CCR_PL_Field is HAL.UInt2;
-- channel x configuration register
type CCR_Register is record
-- Channel enable
EN : Boolean := False;
-- Transfer complete interrupt enable
TCIE : Boolean := False;
-- Half transfer interrupt enable
HTIE : Boolean := False;
-- Transfer error interrupt enable
TEIE : Boolean := False;
-- Data transfer direction
DIR : Boolean := False;
-- Circular mode
CIRC : Boolean := False;
-- Peripheral increment mode
PINC : Boolean := False;
-- Memory increment mode
MINC : Boolean := False;
-- Peripheral size
PSIZE : CCR_PSIZE_Field := 16#0#;
-- Memory size
MSIZE : CCR_MSIZE_Field := 16#0#;
-- Channel priority level
PL : CCR_PL_Field := 16#0#;
-- Memory to memory mode
MEM2MEM : 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 CCR_Register use record
EN at 0 range 0 .. 0;
TCIE at 0 range 1 .. 1;
HTIE at 0 range 2 .. 2;
TEIE at 0 range 3 .. 3;
DIR at 0 range 4 .. 4;
CIRC at 0 range 5 .. 5;
PINC at 0 range 6 .. 6;
MINC at 0 range 7 .. 7;
PSIZE at 0 range 8 .. 9;
MSIZE at 0 range 10 .. 11;
PL at 0 range 12 .. 13;
MEM2MEM at 0 range 14 .. 14;
Reserved_15_31 at 0 range 15 .. 31;
end record;
subtype CNDTR_NDT_Field is HAL.UInt16;
-- channel x number of data register
type CNDTR_Register is record
-- Number of data to transfer
NDT : CNDTR_NDT_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CNDTR_Register use record
NDT at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CSELR_C1S_Field is HAL.UInt4;
subtype CSELR_C2S_Field is HAL.UInt4;
subtype CSELR_C3S_Field is HAL.UInt4;
subtype CSELR_C4S_Field is HAL.UInt4;
subtype CSELR_C5S_Field is HAL.UInt4;
subtype CSELR_C6S_Field is HAL.UInt4;
subtype CSELR_C7S_Field is HAL.UInt4;
-- channel selection register
type CSELR_Register is record
-- DMA channel 1 selection
C1S : CSELR_C1S_Field := 16#0#;
-- DMA channel 2 selection
C2S : CSELR_C2S_Field := 16#0#;
-- DMA channel 3 selection
C3S : CSELR_C3S_Field := 16#0#;
-- DMA channel 4 selection
C4S : CSELR_C4S_Field := 16#0#;
-- DMA channel 5 selection
C5S : CSELR_C5S_Field := 16#0#;
-- DMA channel 6 selection
C6S : CSELR_C6S_Field := 16#0#;
-- DMA channel 7 selection
C7S : CSELR_C7S_Field := 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 CSELR_Register use record
C1S at 0 range 0 .. 3;
C2S at 0 range 4 .. 7;
C3S at 0 range 8 .. 11;
C4S at 0 range 12 .. 15;
C5S at 0 range 16 .. 19;
C6S at 0 range 20 .. 23;
C7S at 0 range 24 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Direct memory access controller
type DMA1_Peripheral is record
-- interrupt status register
ISR : aliased ISR_Register;
-- interrupt flag clear register
IFCR : aliased IFCR_Register;
-- channel x configuration register
CCR1 : aliased CCR_Register;
-- channel x number of data register
CNDTR1 : aliased CNDTR_Register;
-- channel x peripheral address register
CPAR1 : aliased HAL.UInt32;
-- channel x memory address register
CMAR1 : aliased HAL.UInt32;
-- channel x configuration register
CCR2 : aliased CCR_Register;
-- channel x number of data register
CNDTR2 : aliased CNDTR_Register;
-- channel x peripheral address register
CPAR2 : aliased HAL.UInt32;
-- channel x memory address register
CMAR2 : aliased HAL.UInt32;
-- channel x configuration register
CCR3 : aliased CCR_Register;
-- channel x number of data register
CNDTR3 : aliased CNDTR_Register;
-- channel x peripheral address register
CPAR3 : aliased HAL.UInt32;
-- channel x memory address register
CMAR3 : aliased HAL.UInt32;
-- channel x configuration register
CCR4 : aliased CCR_Register;
-- channel x number of data register
CNDTR4 : aliased CNDTR_Register;
-- channel x peripheral address register
CPAR4 : aliased HAL.UInt32;
-- channel x memory address register
CMAR4 : aliased HAL.UInt32;
-- channel x configuration register
CCR5 : aliased CCR_Register;
-- channel x number of data register
CNDTR5 : aliased CNDTR_Register;
-- channel x peripheral address register
CPAR5 : aliased HAL.UInt32;
-- channel x memory address register
CMAR5 : aliased HAL.UInt32;
-- channel x configuration register
CCR6 : aliased CCR_Register;
-- channel x number of data register
CNDTR6 : aliased CNDTR_Register;
-- channel x peripheral address register
CPAR6 : aliased HAL.UInt32;
-- channel x memory address register
CMAR6 : aliased HAL.UInt32;
-- channel x configuration register
CCR7 : aliased CCR_Register;
-- channel x number of data register
CNDTR7 : aliased CNDTR_Register;
-- channel x peripheral address register
CPAR7 : aliased HAL.UInt32;
-- channel x memory address register
CMAR7 : aliased HAL.UInt32;
-- channel selection register
CSELR : aliased CSELR_Register;
end record
with Volatile;
for DMA1_Peripheral use record
ISR at 16#0# range 0 .. 31;
IFCR at 16#4# range 0 .. 31;
CCR1 at 16#8# range 0 .. 31;
CNDTR1 at 16#C# range 0 .. 31;
CPAR1 at 16#10# range 0 .. 31;
CMAR1 at 16#14# range 0 .. 31;
CCR2 at 16#1C# range 0 .. 31;
CNDTR2 at 16#20# range 0 .. 31;
CPAR2 at 16#24# range 0 .. 31;
CMAR2 at 16#28# range 0 .. 31;
CCR3 at 16#30# range 0 .. 31;
CNDTR3 at 16#34# range 0 .. 31;
CPAR3 at 16#38# range 0 .. 31;
CMAR3 at 16#3C# range 0 .. 31;
CCR4 at 16#44# range 0 .. 31;
CNDTR4 at 16#48# range 0 .. 31;
CPAR4 at 16#4C# range 0 .. 31;
CMAR4 at 16#50# range 0 .. 31;
CCR5 at 16#58# range 0 .. 31;
CNDTR5 at 16#5C# range 0 .. 31;
CPAR5 at 16#60# range 0 .. 31;
CMAR5 at 16#64# range 0 .. 31;
CCR6 at 16#6C# range 0 .. 31;
CNDTR6 at 16#70# range 0 .. 31;
CPAR6 at 16#74# range 0 .. 31;
CMAR6 at 16#78# range 0 .. 31;
CCR7 at 16#80# range 0 .. 31;
CNDTR7 at 16#84# range 0 .. 31;
CPAR7 at 16#88# range 0 .. 31;
CMAR7 at 16#8C# range 0 .. 31;
CSELR at 16#A8# range 0 .. 31;
end record;
-- Direct memory access controller
DMA1_Periph : aliased DMA1_Peripheral
with Import, Address => System'To_Address (16#40020000#);
end STM32_SVD.DMA;
|
package Inline7_Pkg1 is
procedure Test (I : Integer);
pragma Inline (Test);
end Inline7_Pkg1;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- G N A T . T A B L E --
-- --
-- B o d y --
-- --
-- $Revision$
-- --
-- Copyright (C) 1998-2001 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). --
-- --
------------------------------------------------------------------------------
with System; use System;
package body GNAT.Table is
Min : constant Integer := Integer (Table_Low_Bound);
-- Subscript of the minimum entry in the currently allocated table
Max : Integer;
-- Subscript of the maximum entry in the currently allocated table
Length : Integer := 0;
-- Number of entries in currently allocated table. The value of zero
-- ensures that we initially allocate the table.
Last_Val : Integer;
-- Current value of Last.
type size_t is new Integer;
-----------------------
-- Local Subprograms --
-----------------------
procedure Reallocate;
-- Reallocate the existing table according to the current value stored
-- in Max. Works correctly to do an initial allocation if the table
-- is currently null.
--------------
-- Allocate --
--------------
function Allocate (Num : Integer := 1) return Table_Index_Type is
Old_Last : constant Integer := Last_Val;
begin
Last_Val := Last_Val + Num;
if Last_Val > Max then
Reallocate;
end if;
return Table_Index_Type (Old_Last + 1);
end Allocate;
------------
-- Append --
------------
procedure Append (New_Val : Table_Component_Type) is
begin
Increment_Last;
Table (Table_Index_Type (Last_Val)) := New_Val;
end Append;
--------------------
-- Decrement_Last --
--------------------
procedure Decrement_Last is
begin
Last_Val := Last_Val - 1;
end Decrement_Last;
----------
-- Free --
----------
procedure Free is
procedure free (T : Table_Ptr);
pragma Import (C, free);
begin
free (Table);
Table := null;
Length := 0;
end Free;
--------------------
-- Increment_Last --
--------------------
procedure Increment_Last is
begin
Last_Val := Last_Val + 1;
if Last_Val > Max then
Reallocate;
end if;
end Increment_Last;
----------
-- Init --
----------
procedure Init is
Old_Length : Integer := Length;
begin
Last_Val := Min - 1;
Max := Min + Table_Initial - 1;
Length := Max - Min + 1;
-- If table is same size as before (happens when table is never
-- expanded which is a common case), then simply reuse it. Note
-- that this also means that an explicit Init call right after
-- the implicit one in the package body is harmless.
if Old_Length = Length then
return;
-- Otherwise we can use Reallocate to get a table of the right size.
-- Note that Reallocate works fine to allocate a table of the right
-- initial size when it is first allocated.
else
Reallocate;
end if;
end Init;
----------
-- Last --
----------
function Last return Table_Index_Type is
begin
return Table_Index_Type (Last_Val);
end Last;
----------------
-- Reallocate --
----------------
procedure Reallocate is
function realloc
(memblock : Table_Ptr;
size : size_t)
return Table_Ptr;
pragma Import (C, realloc);
function malloc
(size : size_t)
return Table_Ptr;
pragma Import (C, malloc);
New_Size : size_t;
begin
if Max < Last_Val then
pragma Assert (not Locked);
while Max < Last_Val loop
-- Increase length using the table increment factor, but make
-- sure that we add at least ten elements (this avoids a loop
-- for silly small increment values)
Length := Integer'Max
(Length * (100 + Table_Increment) / 100,
Length + 10);
Max := Min + Length - 1;
end loop;
end if;
New_Size :=
size_t ((Max - Min + 1) *
(Table_Type'Component_Size / Storage_Unit));
if Table = null then
Table := malloc (New_Size);
elsif New_Size > 0 then
Table :=
realloc
(memblock => Table,
size => New_Size);
end if;
if Length /= 0 and then Table = null then
raise Storage_Error;
end if;
end Reallocate;
-------------
-- Release --
-------------
procedure Release is
begin
Length := Last_Val - Integer (Table_Low_Bound) + 1;
Max := Last_Val;
Reallocate;
end Release;
--------------
-- Set_Item --
--------------
procedure Set_Item
(Index : Table_Index_Type;
Item : Table_Component_Type)
is
begin
if Integer (Index) > Max then
Set_Last (Index);
end if;
Table (Index) := Item;
end Set_Item;
--------------
-- Set_Last --
--------------
procedure Set_Last (New_Val : Table_Index_Type) is
begin
if Integer (New_Val) < Last_Val then
Last_Val := Integer (New_Val);
else
Last_Val := Integer (New_Val);
if Last_Val > Max then
Reallocate;
end if;
end if;
end Set_Last;
begin
Init;
end GNAT.Table;
|
-- part of ParserTools, (c) 2017 Felix Krause
-- released under the terms of the MIT license, see the file "copying.txt"
with Ada.Finalization;
package Lexer.Source is
pragma Preelaborate;
-- a Source is anything that provides a character stream. Sources are always
-- single-use objects; the lexer takes ownership of sources and deallocates
-- them.
type Instance is abstract new Ada.Finalization.Limited_Controlled with
null record;
type Pointer is access all Instance'Class;
procedure Read_Data (S : in out Instance; Buffer : out String;
Length : out Natural) is abstract;
end Lexer.Source;
|
with Hide.Value;
with Hide.Encode_Generic;
procedure Hide.File_Coder.Encode_Main is new Hide.Encode_Generic;
|
-----------------------------------------------------------------------
-- mat-expressions-parser_io -- Input IO for Lex parser
-- Copyright (C) 2014, 2015 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;
package body MAT.Expressions.Parser_IO is
Input : Ada.Strings.Unbounded.Unbounded_String;
Pos : Natural := 0;
procedure Set_Input (Content : in String) is
begin
Input := Ada.Strings.Unbounded.To_Unbounded_String (Content);
Pos := 1;
MAT.Expressions.Lexer_dfa.yy_init := True;
MAT.Expressions.Lexer_dfa.yy_start := 0;
end Set_Input;
-- gets input and stuffs it into 'buf'. number of characters read, or YY_NULL,
-- is returned in 'result'.
procedure YY_INPUT (Buf : out unbounded_character_array;
Result : out Integer;
Max_Size : in Integer) is
I : Integer := 1;
Loc : Integer := Buf'First;
begin
while I <= Max_Size loop
if Pos > Ada.Strings.Unbounded.Length (Input) then
yy_eof_has_been_seen := True;
Result := I - 1;
return;
end if;
Buf (Loc) := Ada.Strings.Unbounded.Element (Input, Pos);
Pos := Pos + 1;
Loc := Loc + 1;
I := I + 1;
end loop;
Result := I - 1;
end YY_INPUT;
-- yy_get_next_buffer - try to read in new buffer
--
-- returns a code representing an action
-- EOB_ACT_LAST_MATCH -
-- EOB_ACT_RESTART_SCAN - restart the scanner
-- EOB_ACT_END_OF_FILE - end of file
function yy_get_next_buffer return eob_action_type is
dest : Integer := 0;
source : Integer := yytext_ptr - 1; -- copy prev. char, too
number_to_move : Integer;
ret_val : eob_action_type;
num_to_read : Integer;
begin
if yy_c_buf_p > yy_n_chars + 1 then
raise NULL_IN_INPUT;
end if;
-- try to read more data
-- first move last chars to start of buffer
number_to_move := yy_c_buf_p - yytext_ptr;
for i in 0 .. number_to_move - 1 loop
yy_ch_buf (dest) := yy_ch_buf (source);
dest := dest + 1;
source := source + 1;
end loop;
if yy_eof_has_been_seen then
-- don't do the read, it's not guaranteed to return an EOF,
-- just force an EOF
yy_n_chars := 0;
else
num_to_read := YY_BUF_SIZE - number_to_move - 1;
if num_to_read > YY_READ_BUF_SIZE then
num_to_read := YY_READ_BUF_SIZE;
end if;
-- read in more data
YY_INPUT (yy_ch_buf (number_to_move .. yy_ch_buf'Last), yy_n_chars, num_to_read);
end if;
if yy_n_chars = 0 then
if number_to_move = 1 then
ret_val := EOB_ACT_END_OF_FILE;
else
ret_val := EOB_ACT_LAST_MATCH;
end if;
yy_eof_has_been_seen := True;
else
ret_val := EOB_ACT_RESTART_SCAN;
end if;
yy_n_chars := yy_n_chars + number_to_move;
yy_ch_buf (yy_n_chars) := YY_END_OF_BUFFER_CHAR;
yy_ch_buf (yy_n_chars + 1) := YY_END_OF_BUFFER_CHAR;
-- yytext begins at the second character in
-- yy_ch_buf; the first character is the one which
-- preceded it before reading in the latest buffer;
-- it needs to be kept around in case it's a
-- newline, so yy_get_previous_state() will have
-- with '^' rules active
yytext_ptr := 1;
return ret_val;
end yy_get_next_buffer;
function Input_Line return Ada.Text_IO.Count is
begin
return 1;
end Input_Line;
-- default yywrap function - always treat EOF as an EOF
function yywrap return Boolean is
begin
return True;
end yywrap;
procedure Open_Input (Fname : in String) is
pragma Unreferenced (Fname);
begin
yy_init := True;
end Open_Input;
end MAT.Expressions.Parser_IO;
|
-- Task 2 of RTPL WS17/18
-- Team members: Hannes B. and Gabriel Z.
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO;
package body myTasks with SPARK_Mode is
-- Procedure for option 5
procedure opt5 is
task1 : myAmount;
begin
Put ("Add (a) or Remove (r) element (current:");
Put (Amount'Img);
Put ("): ");
Get (C1);
-- Check user input
if C1 = 'a' then
Put ("Amount to add: ");
Ada.Integer_Text_IO.Get (I1);
task1.Add (I1);
elsif C1 = 'r' then
Put ("Amount to remove: ");
Ada.Integer_Text_IO.Get (I1);
task1.Sub (I1);
else
Put_Line ("Wrong Input!");
end if;
end opt5;
-- Procedure for option 6
procedure opt6 is begin
GrowEnable := True;
Put_Line ("Growth started");
end opt6;
-- Procedure for option 7
procedure opt7 is begin
GrowEnable := False;
Put_Line ("Growth stopped");
end opt7;
-- User defined task to add / remove elements
task body myAmount is begin
loop
select
accept Sub (min : in Integer) do
Available := False;
if Amount - min >= 0 then
Amount := Amount - min;
else
Put_Line ("Amount can not be negative");
end if;
Put_Line ("New amount: " & Amount'Img);
Available := True;
end Sub;
or
accept Add (sum : in Integer) do
Available := False;
Amount := Amount + sum;
Put_Line ("New amount: " & Amount'Img);
Available := True;
end Add;
or
terminate;
end select;
end loop;
end myAmount;
task body myGrow is begin
loop
if myGrowEnd then
exit;
end if;
if GrowEnable then
Available := False;
Amount := Amount + 1;
delay (2.0);
Available := True;
end if;
delay (0.1);
end loop;
end myGrow;
end myTasks;
|
-- C45531A.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 THE OPERATOR "*" PRODUCES CORRECT RESULTS
-- FOR MIXED FIXED POINT AND INTEGER TYPES USING 4 SUBTESTS.
-- THIS TEST REQUIRES MIN_WORD_LENGTH = 12.
-- THIS TEST USES VALUES OF DELTA WHICH ARE LESS THAN 0.5.
--
-- TEST CASES ARE:
-- A) INTEGER * FIXED WHEN ALL VALUES ARE MODEL NUMBERS.
-- B) FIXED * INTEGER WHEN ALL VALUES ARE MODEL NUMBERS.
-- C) INTEGER * FIXED FOR NON-MODEL NUMBERS.
-- D) FIXED * INTEGER FOR NON-MODEL NUMBERS.
--
-- REPEAT FOR MINIMUM REQUIRED WORD LENGTHS OF 12, 16, 32 AND 48,
-- WITH RANGE <, =, AND > THAN 1.0 AND
-- WITH DELTA <, =, AND > THAN 1.0.
-- HISTORY:
-- NTW 09/08/86 CREATED ORIGINAL TEST.
-- RJW 11/05/86 REVISED COMMENTS.
-- DHH 01/13/88 ADDED APPLICABILITY CRITERIA AND STANDARD HEADER.
-- BCB 04/27/90 REVISED APPLICABILITY CRITERIA.
-- BCB 10/03/90 REMOVED APPLICABILITY CRITERIA AND N/A => ERROR
-- LINE. CHANGED EXTENSION FROM '.DEP' TO '.ADA'.
WITH REPORT;
PROCEDURE C45531A IS
USE REPORT;
MIN_WORD_LENGTH : CONSTANT := 12;
FULL_SCALE : CONSTANT := 2 ** (MIN_WORD_LENGTH - 1);
FORTH : CONSTANT := FULL_SCALE / 4;
DEL1 : CONSTANT := 0.5 / FULL_SCALE;
DEL4 : CONSTANT := 4.0 * DEL1;
TYPE FX_0P5 IS DELTA DEL1 * 1 RANGE -0.5 .. 0.5 - DEL1 * 1;
TYPE FX_1 IS DELTA DEL1 * 2 RANGE -1.0 .. 1.0 - DEL1 * 2;
TYPE FX_2 IS DELTA DEL1 * 4 RANGE -2.0 .. 2.0 - DEL1 * 4;
BEGIN TEST ("C45531A", "MIXED FIXED POINT AND INTEGER ""*"" "
& "FOR RANGE <, =, > 1.0");
--------------------------------------------------
-- CASE A) INTEGER * FIXED WHEN ALL VALUES ARE MODEL NUMBERS.
A: DECLARE
A : INTEGER := 0;
B : FX_0P5 := 0.0;
RESULT_VALUE : FX_0P5 := 0.0;
LOWEST_ACCEPTABLE_VALUE : FX_0P5 := FX_0P5 (0.375);
HIGHEST_ACCEPTABLE_VALUE : FX_0P5 := FX_0P5 (0.375);
BEGIN
IF EQUAL (3, 3) THEN
A := 3;
B := FX_0P5 (0.125); -- A MODEL NUMBER
END IF;
RESULT_VALUE := A * B;
IF (RESULT_VALUE < LOWEST_ACCEPTABLE_VALUE)
OR (RESULT_VALUE > HIGHEST_ACCEPTABLE_VALUE) THEN
FAILED ("RESULT OF ""*"" OUTSIDE RESULT MODEL INTERVAL "
& "FOR INTEGER * FIXED "
& "WHEN ALL VALUES ARE MODEL NUMBERS");
END IF;
END A;
--------------------------------------------------
-- CASE B) FIXED * INTEGER WHEN ALL VALUES ARE MODEL NUMBERS.
B: DECLARE
A : FX_1 := 0.0;
B : INTEGER := 0;
RESULT_VALUE : FX_1 := 0.0;
LOWEST_ACCEPTABLE_VALUE : FX_1 := FX_1 (0.75);
HIGHEST_ACCEPTABLE_VALUE : FX_1 := FX_1 (0.75);
BEGIN
IF EQUAL (3, 3) THEN
A := FX_1 (0.125); -- A MODEL NUMBER
B := 6;
END IF;
RESULT_VALUE := A * B;
IF (RESULT_VALUE < LOWEST_ACCEPTABLE_VALUE)
OR (RESULT_VALUE > HIGHEST_ACCEPTABLE_VALUE) THEN
FAILED ("RESULT OF ""*"" OUTSIDE RESULT MODEL INTERVAL "
& "FOR FIXED * INTEGER "
& "WHEN ALL VALUES ARE MODEL NUMBERS");
END IF;
END B;
--------------------------------------------------
-- CASE C) INTEGER * FIXED FOR NON-MODEL NUMBERS.
C: DECLARE
A : INTEGER := 0;
B : FX_2 := 0.0;
RESULT_VALUE : FX_2 := 0.0;
LOW_COUNT : CONSTANT := (3 * (FORTH + 0) );
HIGH_COUNT : CONSTANT := (3 * (FORTH + 1) );
LOWEST_ACCEPTABLE_VALUE : FX_2
:= FX_2 (DEL4 * LOW_COUNT );
HIGHEST_ACCEPTABLE_VALUE : FX_2
:= FX_2 (DEL4 * HIGH_COUNT);
BEGIN
IF EQUAL (3, 3) THEN -- B NOT A MODEL NUMBER
A := 3;
B := FX_2 (DEL4 * FORTH + DEL1 );
END IF;
RESULT_VALUE := A * B;
IF (RESULT_VALUE < LOWEST_ACCEPTABLE_VALUE)
OR (RESULT_VALUE > HIGHEST_ACCEPTABLE_VALUE) THEN
FAILED ("RESULT OF ""*"" OUTSIDE RESULT MODEL INTERVAL "
& "FOR INTEGER * FIXED FOR NON-MODEL NUMBERS");
END IF;
END C;
--------------------------------------------------
-- CASE D) FIXED * INTEGER FOR NON-MODEL NUMBERS.
D: DECLARE
A : FX_2 := 0.0;
B : INTEGER := 0;
RESULT_VALUE : FX_2 := 0.0;
LOW_COUNT : CONSTANT := (3 * (FORTH + 0) );
HIGH_COUNT : CONSTANT := (3 * (FORTH + 1) );
LOWEST_ACCEPTABLE_VALUE : FX_2
:= FX_2 (DEL4 * LOW_COUNT );
HIGHEST_ACCEPTABLE_VALUE : FX_2
:= FX_2 (DEL4 * HIGH_COUNT);
BEGIN
IF EQUAL (3, 3) THEN -- A NOT A MODEL NUMBER
A := FX_2 (DEL4 * FORTH + DEL1 );
B := 3;
END IF;
RESULT_VALUE := A * B;
IF (RESULT_VALUE < LOWEST_ACCEPTABLE_VALUE)
OR (RESULT_VALUE > HIGHEST_ACCEPTABLE_VALUE) THEN
FAILED ("RESULT OF ""*"" OUTSIDE RESULT MODEL INTERVAL "
& "FOR FIXED * INTEGER FOR NON-MODEL NUMBERS");
END IF;
END D;
--------------------------------------------------
RESULT;
END C45531A;
|
-- This spec has been automatically generated from STM32F40x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
with HAL;
with System;
package STM32_SVD.DBG is
pragma Preelaborate;
---------------
-- Registers --
---------------
----------------------------
-- DBGMCU_IDCODE_Register --
----------------------------
subtype DBGMCU_IDCODE_DEV_ID_Field is HAL.UInt12;
subtype DBGMCU_IDCODE_REV_ID_Field is HAL.Short;
-- IDCODE
type DBGMCU_IDCODE_Register is record
-- Read-only. DEV_ID
DEV_ID : DBGMCU_IDCODE_DEV_ID_Field;
-- unspecified
Reserved_12_15 : HAL.UInt4;
-- Read-only. REV_ID
REV_ID : DBGMCU_IDCODE_REV_ID_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DBGMCU_IDCODE_Register use record
DEV_ID at 0 range 0 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
REV_ID at 0 range 16 .. 31;
end record;
------------------------
-- DBGMCU_CR_Register --
------------------------
subtype DBGMCU_CR_TRACE_MODE_Field is HAL.UInt2;
-- Control Register
type DBGMCU_CR_Register is record
-- DBG_SLEEP
DBG_SLEEP : Boolean := False;
-- DBG_STOP
DBG_STOP : Boolean := False;
-- DBG_STANDBY
DBG_STANDBY : Boolean := False;
-- unspecified
Reserved_3_4 : HAL.UInt2 := 16#0#;
-- TRACE_IOEN
TRACE_IOEN : Boolean := False;
-- TRACE_MODE
TRACE_MODE : DBGMCU_CR_TRACE_MODE_Field := 16#0#;
-- unspecified
Reserved_8_15 : HAL.Byte := 16#0#;
-- DBG_I2C2_SMBUS_TIMEOUT
DBG_I2C2_SMBUS_TIMEOUT : Boolean := False;
-- DBG_TIM8_STOP
DBG_TIM8_STOP : Boolean := False;
-- DBG_TIM5_STOP
DBG_TIM5_STOP : Boolean := False;
-- DBG_TIM6_STOP
DBG_TIM6_STOP : Boolean := False;
-- DBG_TIM7_STOP
DBG_TIM7_STOP : Boolean := False;
-- unspecified
Reserved_21_31 : HAL.UInt11 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DBGMCU_CR_Register use record
DBG_SLEEP at 0 range 0 .. 0;
DBG_STOP at 0 range 1 .. 1;
DBG_STANDBY at 0 range 2 .. 2;
Reserved_3_4 at 0 range 3 .. 4;
TRACE_IOEN at 0 range 5 .. 5;
TRACE_MODE at 0 range 6 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
DBG_I2C2_SMBUS_TIMEOUT at 0 range 16 .. 16;
DBG_TIM8_STOP at 0 range 17 .. 17;
DBG_TIM5_STOP at 0 range 18 .. 18;
DBG_TIM6_STOP at 0 range 19 .. 19;
DBG_TIM7_STOP at 0 range 20 .. 20;
Reserved_21_31 at 0 range 21 .. 31;
end record;
-----------------------------
-- DBGMCU_APB1_FZ_Register --
-----------------------------
-- Debug MCU APB1 Freeze registe
type DBGMCU_APB1_FZ_Register is record
-- DBG_TIM2_STOP
DBG_TIM2_STOP : Boolean := False;
-- DBG_TIM3 _STOP
DBG_TIM3_STOP : Boolean := False;
-- DBG_TIM4_STOP
DBG_TIM4_STOP : Boolean := False;
-- DBG_TIM5_STOP
DBG_TIM5_STOP : Boolean := False;
-- DBG_TIM6_STOP
DBG_TIM6_STOP : Boolean := False;
-- DBG_TIM7_STOP
DBG_TIM7_STOP : Boolean := False;
-- DBG_TIM12_STOP
DBG_TIM12_STOP : Boolean := False;
-- DBG_TIM13_STOP
DBG_TIM13_STOP : Boolean := False;
-- DBG_TIM14_STOP
DBG_TIM14_STOP : Boolean := False;
-- unspecified
Reserved_9_10 : HAL.UInt2 := 16#0#;
-- DBG_WWDG_STOP
DBG_WWDG_STOP : Boolean := False;
-- DBG_IWDEG_STOP
DBG_IWDEG_STOP : Boolean := False;
-- unspecified
Reserved_13_20 : HAL.Byte := 16#0#;
-- DBG_J2C1_SMBUS_TIMEOUT
DBG_J2C1_SMBUS_TIMEOUT : Boolean := False;
-- DBG_J2C2_SMBUS_TIMEOUT
DBG_J2C2_SMBUS_TIMEOUT : Boolean := False;
-- DBG_J2C3SMBUS_TIMEOUT
DBG_J2C3SMBUS_TIMEOUT : Boolean := False;
-- unspecified
Reserved_24_24 : HAL.Bit := 16#0#;
-- DBG_CAN1_STOP
DBG_CAN1_STOP : Boolean := False;
-- DBG_CAN2_STOP
DBG_CAN2_STOP : Boolean := False;
-- unspecified
Reserved_27_31 : HAL.UInt5 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DBGMCU_APB1_FZ_Register use record
DBG_TIM2_STOP at 0 range 0 .. 0;
DBG_TIM3_STOP at 0 range 1 .. 1;
DBG_TIM4_STOP at 0 range 2 .. 2;
DBG_TIM5_STOP at 0 range 3 .. 3;
DBG_TIM6_STOP at 0 range 4 .. 4;
DBG_TIM7_STOP at 0 range 5 .. 5;
DBG_TIM12_STOP at 0 range 6 .. 6;
DBG_TIM13_STOP at 0 range 7 .. 7;
DBG_TIM14_STOP at 0 range 8 .. 8;
Reserved_9_10 at 0 range 9 .. 10;
DBG_WWDG_STOP at 0 range 11 .. 11;
DBG_IWDEG_STOP at 0 range 12 .. 12;
Reserved_13_20 at 0 range 13 .. 20;
DBG_J2C1_SMBUS_TIMEOUT at 0 range 21 .. 21;
DBG_J2C2_SMBUS_TIMEOUT at 0 range 22 .. 22;
DBG_J2C3SMBUS_TIMEOUT at 0 range 23 .. 23;
Reserved_24_24 at 0 range 24 .. 24;
DBG_CAN1_STOP at 0 range 25 .. 25;
DBG_CAN2_STOP at 0 range 26 .. 26;
Reserved_27_31 at 0 range 27 .. 31;
end record;
-----------------------------
-- DBGMCU_APB2_FZ_Register --
-----------------------------
-- Debug MCU APB2 Freeze registe
type DBGMCU_APB2_FZ_Register is record
-- TIM1 counter stopped when core is halted
DBG_TIM1_STOP : Boolean := False;
-- TIM8 counter stopped when core is halted
DBG_TIM8_STOP : Boolean := False;
-- unspecified
Reserved_2_15 : HAL.UInt14 := 16#0#;
-- TIM9 counter stopped when core is halted
DBG_TIM9_STOP : Boolean := False;
-- TIM10 counter stopped when core is halted
DBG_TIM10_STOP : Boolean := False;
-- TIM11 counter stopped when core is halted
DBG_TIM11_STOP : Boolean := False;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DBGMCU_APB2_FZ_Register use record
DBG_TIM1_STOP at 0 range 0 .. 0;
DBG_TIM8_STOP at 0 range 1 .. 1;
Reserved_2_15 at 0 range 2 .. 15;
DBG_TIM9_STOP at 0 range 16 .. 16;
DBG_TIM10_STOP at 0 range 17 .. 17;
DBG_TIM11_STOP at 0 range 18 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Debug support
type DBG_Peripheral is record
-- IDCODE
DBGMCU_IDCODE : DBGMCU_IDCODE_Register;
-- Control Register
DBGMCU_CR : DBGMCU_CR_Register;
-- Debug MCU APB1 Freeze registe
DBGMCU_APB1_FZ : DBGMCU_APB1_FZ_Register;
-- Debug MCU APB2 Freeze registe
DBGMCU_APB2_FZ : DBGMCU_APB2_FZ_Register;
end record
with Volatile;
for DBG_Peripheral use record
DBGMCU_IDCODE at 0 range 0 .. 31;
DBGMCU_CR at 4 range 0 .. 31;
DBGMCU_APB1_FZ at 8 range 0 .. 31;
DBGMCU_APB2_FZ at 12 range 0 .. 31;
end record;
-- Debug support
DBG_Periph : aliased DBG_Peripheral
with Import, Address => DBG_Base;
end STM32_SVD.DBG;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . P A R A M E T E R S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- Default version used when no target-specific version is provided
-- This package defines some system dependent parameters for GNAT. These
-- are values that are referenced by the runtime library and are therefore
-- relevant to the target machine.
-- The parameters whose value is defined in the spec are not generally
-- expected to be changed. If they are changed, it will be necessary to
-- recompile the run-time library.
-- The parameters which are defined by functions can be changed by modifying
-- the body of System.Parameters in file s-parame.adb. A change to this body
-- requires only rebinding and relinking of the application.
-- Note: do not introduce any pragma Inline statements into this unit, since
-- otherwise the relinking and rebinding capability would be deactivated.
package System.Parameters is
pragma Pure;
---------------------------------------
-- Task And Stack Allocation Control --
---------------------------------------
type Task_Storage_Size is new Integer;
-- Type used in tasking units for task storage size
type Size_Type is new Task_Storage_Size;
-- Type used to provide task storage size to runtime
Unspecified_Size : constant Size_Type := Size_Type'First;
-- Value used to indicate that no size type is set
subtype Ratio is Size_Type range -1 .. 100;
Dynamic : constant Size_Type := -1;
-- The secondary stack ratio is a constant between 0 and 100 which
-- determines the percentage of the allocated task stack that is
-- used by the secondary stack (the rest being the primary stack).
-- The special value of minus one indicates that the secondary
-- stack is to be allocated from the heap instead.
Sec_Stack_Ratio : constant Ratio := Dynamic;
-- This constant defines the handling of the secondary stack
Sec_Stack_Dynamic : constant Boolean := Sec_Stack_Ratio = Dynamic;
-- Convenient Boolean for testing for dynamic secondary stack
function Default_Stack_Size return Size_Type;
-- Default task stack size used if none is specified
function Minimum_Stack_Size return Size_Type;
-- Minimum task stack size permitted
function Adjust_Storage_Size (Size : Size_Type) return Size_Type;
-- Given the storage size stored in the TCB, return the Storage_Size
-- value required by the RM for the Storage_Size attribute. The
-- required adjustment is as follows:
--
-- when Size = Unspecified_Size, return Default_Stack_Size
-- when Size < Minimum_Stack_Size, return Minimum_Stack_Size
-- otherwise return given Size
Default_Env_Stack_Size : constant Size_Type := 8_192_000;
-- Assumed size of the environment task, if no other information
-- is available. This value is used when stack checking is
-- enabled and no GNAT_STACK_LIMIT environment variable is set.
Stack_Grows_Down : constant Boolean := True;
-- This constant indicates whether the stack grows up (False) or
-- down (True) in memory as functions are called. It is used for
-- proper implementation of the stack overflow check.
----------------------------------------------
-- Characteristics of types in Interfaces.C --
----------------------------------------------
long_bits : constant := Long_Integer'Size;
-- Number of bits in type long and unsigned_long. The normal convention
-- is that this is the same as type Long_Integer, but this is not true
-- of all targets. For example, in OpenVMS long /= Long_Integer.
----------------------------------------------
-- Behavior of Pragma Finalize_Storage_Only --
----------------------------------------------
-- Garbage_Collected is a Boolean constant whose value indicates the
-- effect of the pragma Finalize_Storage_Entry on a controlled type.
-- Garbage_Collected = False
-- The system releases all storage on program termination only,
-- but not other garbage collection occurs, so finalization calls
-- are ommitted only for outer level onjects can be omitted if
-- pragma Finalize_Storage_Only is used.
-- Garbage_Collected = True
-- The system provides full garbage collection, so it is never
-- necessary to release storage for controlled objects for which
-- a pragma Finalize_Storage_Only is used.
Garbage_Collected : constant Boolean := False;
-- The storage mode for this system (release on program exit)
---------------------
-- Tasking Profile --
---------------------
-- In the following sections, constant parameters are defined to
-- allow some optimizations and fine tuning within the tasking run time
-- based on restrictions on the tasking features.
----------------------
-- Locking Strategy --
----------------------
Single_Lock : constant Boolean := False;
-- Indicates whether a single lock should be used within the tasking
-- run-time to protect internal structures. If True, a single lock
-- will be used, meaning less locking/unlocking operations, but also
-- more global contention. In general, Single_Lock should be set to
-- True on single processor machines, and to False to multi-processor
-- systems, but this can vary from application to application and also
-- depends on the scheduling policy.
-------------------
-- Task Abortion --
-------------------
No_Abort : constant Boolean := False;
-- This constant indicates whether abort statements and asynchronous
-- transfer of control (ATC) are disallowed. If set to True, it is
-- assumed that neither construct is used, and the run time does not
-- need to defer/undefer abort and check for pending actions at
-- completion points. A value of True for No_Abort corresponds to:
-- pragma Restrictions (No_Abort_Statements);
-- pragma Restrictions (Max_Asynchronous_Select_Nesting => 0);
----------------------
-- Dynamic Priority --
----------------------
Dynamic_Priority_Support : constant Boolean := True;
-- This constant indicates whether dynamic changes of task priorities
-- are allowed (True means normal RM mode in which such changes are
-- allowed). In particular, if this is False, then we do not need to
-- poll for pending base priority changes at every abort completion
-- point. A value of False for Dynamic_Priority_Support corresponds
-- to pragma Restrictions (No_Dynamic_Priorities);
---------------------
-- Task Attributes --
---------------------
Default_Attribute_Count : constant := 4;
-- Number of pre-allocated Address-sized task attributes stored in the
-- task control block.
--------------------
-- Runtime Traces --
--------------------
Runtime_Traces : constant Boolean := False;
-- This constant indicates whether the runtime outputs traces to a
-- predefined output or not (True means that traces are output).
-- See System.Traces for more details.
------------------------------
-- Exception Message Length --
------------------------------
Default_Exception_Msg_Max_Length : constant := 200;
-- This constant specifies the default number of characters to allow
-- in an exception message (200 is minimum required by RM 11.4.1(18)).
end System.Parameters;
|
-- Abstract :
--
-- Generalized LR parser state.
--
-- Copyright (C) 2014-2015, 2017 - 2020 Free Software Foundation, Inc.
--
-- This file is part of the WisiToken package.
--
-- The WisiToken package 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 library is distributed in
-- the hope that it will be useful, but WITHOUT ANY WARRANTY; without
-- even the implied warranty of MERCHAN- TABILITY or FITNESS FOR A
-- PARTICULAR PURPOSE.
--
-- As a special exception under Section 7 of GPL version 3, you are granted
-- additional permissions described in the GCC Runtime Library Exception,
-- version 3.1, as published by the Free Software Foundation.
pragma License (Modified_GPL);
with Ada.Iterator_Interfaces;
with SAL.Gen_Indefinite_Doubly_Linked_Lists;
with SAL.Gen_Unbounded_Definite_Stacks;
with WisiToken.Syntax_Trees;
package WisiToken.Parse.LR.Parser_Lists is
type Parser_Stack_Item is record
State : Unknown_State_Index := Unknown_State;
Token : Node_Index := Invalid_Node_Index;
end record;
package Parser_Stacks is new SAL.Gen_Unbounded_Definite_Stacks (Parser_Stack_Item);
function Parser_Stack_Image
(Stack : in Parser_Stacks.Stack;
Descriptor : in WisiToken.Descriptor;
Tree : in Syntax_Trees.Tree;
Depth : in SAL.Base_Peek_Type := 0)
return String;
-- If Depth = 0, put all of Stack. Otherwise put Min (Depth,
-- Stack.Depth) items.
--
-- Unique name for calling from debugger
function Image
(Stack : in Parser_Stacks.Stack;
Descriptor : in WisiToken.Descriptor;
Tree : in Syntax_Trees.Tree;
Depth : in SAL.Base_Peek_Type := 0)
return String renames Parser_Stack_Image;
type Base_Parser_State is tagged
record
-- Visible components for direct access
Shared_Token : Base_Token_Index := Invalid_Token_Index;
-- Last token read from Shared_Parser.Terminals.
Recover_Insert_Delete : aliased Recover_Op_Arrays.Vector;
-- Tokens that were inserted or deleted during error recovery.
-- Contains only Insert and Delete ops. Filled by error recover, used
-- by main parse and Execute_Actions.
--
-- Not emptied between error recovery sessions, so Execute_Actions
-- knows about all insert/delete.
Recover_Insert_Delete_Current : Recover_Op_Arrays.Extended_Index := Recover_Op_Arrays.No_Index;
-- Next item in Recover_Insert_Delete to be processed by main parse;
-- No_Index if all done.
Current_Token : Node_Index := Invalid_Node_Index;
-- Current terminal, in Tree
Inc_Shared_Token : Boolean := True;
Stack : Parser_Stacks.Stack;
-- There is no need to use a branched stack; max stack length is
-- proportional to source text nesting depth, not source text length.
Tree : aliased Syntax_Trees.Tree;
-- We use a branched tree to avoid copying large trees for each
-- spawned parser; tree size is proportional to source text size. In
-- normal parsing, parallel parsers are short-lived; they each process
-- a few tokens, to resolve a grammar conflict.
--
-- When there is only one parser, tree nodes are written directly to
-- the shared tree (via the branched tree, with Flush => True).
--
-- When there is more than one, tree nodes are written to the
-- branched tree. Then when all but one parsers are terminated, the
-- remaining branched tree is flushed into the shared tree.
Recover : aliased LR.McKenzie_Data := (others => <>);
Zombie_Token_Count : Base_Token_Index := 0;
-- If Zombie_Token_Count > 0, this parser has errored, but is waiting
-- to see if other parsers do also.
Resume_Active : Boolean := False;
Resume_Token_Goal : Base_Token_Index := Invalid_Token_Index;
Conflict_During_Resume : Boolean := False;
-- Resume is complete for this parser Shared_Token reaches this
-- Resume_Token_Goal.
Errors : Parse_Error_Lists.List;
end record;
type Parser_State is new Base_Parser_State with private;
type State_Access is access all Parser_State;
type List is tagged private
with
Constant_Indexing => Constant_Reference,
Variable_Indexing => Reference,
Default_Iterator => Iterate,
Iterator_Element => Parser_State;
function New_List (Shared_Tree : in Syntax_Trees.Base_Tree_Access) return List;
function Last_Label (List : in Parser_Lists.List) return Natural;
function Count (List : in Parser_Lists.List) return SAL.Base_Peek_Type;
type Cursor (<>) is tagged private;
function First (List : aliased in out Parser_Lists.List'Class) return Cursor;
procedure Next (Cursor : in out Parser_Lists.Cursor);
function Is_Done (Cursor : in Parser_Lists.Cursor) return Boolean;
function Has_Element (Cursor : in Parser_Lists.Cursor) return Boolean is (not Is_Done (Cursor));
function Label (Cursor : in Parser_Lists.Cursor) return Natural;
function Total_Recover_Cost (Cursor : in Parser_Lists.Cursor) return Integer;
function Max_Recover_Ops_Length (Cursor : in Parser_Lists.Cursor) return Ada.Containers.Count_Type;
function Min_Recover_Cost (Cursor : in Parser_Lists.Cursor) return Integer;
procedure Set_Verb (Cursor : in Parser_Lists.Cursor; Verb : in All_Parse_Action_Verbs);
function Verb (Cursor : in Parser_Lists.Cursor) return All_Parse_Action_Verbs;
procedure Terminate_Parser
(Parsers : in out List;
Current : in out Cursor'Class;
Message : in String;
Trace : in out WisiToken.Trace'Class;
Terminals : in Base_Token_Arrays.Vector);
-- Terminate Current. Current is set to no element.
--
-- Terminals is used to report the current token in the message.
procedure Duplicate_State
(Parsers : in out List;
Current : in out Cursor'Class;
Trace : in out WisiToken.Trace'Class;
Terminals : in Base_Token_Arrays.Vector);
-- If any other parser in Parsers has a stack equivalent to Current,
-- Terminate one of them. Current is either unchanged, or advanced to
-- the next parser.
--
-- Terminals is used to report the current token in the message.
type State_Reference (Element : not null access Parser_State) is null record
with Implicit_Dereference => Element;
function State_Ref (Position : in Cursor) return State_Reference
with Pre => Has_Element (Position);
-- Direct access to visible components of Parser_State
function First_State_Ref (List : in Parser_Lists.List'Class) return State_Reference
with Pre => List.Count > 0;
-- Direct access to visible components of first parser's Parser_State
type Constant_State_Reference (Element : not null access constant Parser_State) is null record
with Implicit_Dereference => Element;
function First_Constant_State_Ref (List : in Parser_Lists.List'Class) return Constant_State_Reference
with Pre => List.Count > 0;
-- Direct access to visible components of first parser's Parser_State
procedure Put_Top_10 (Trace : in out WisiToken.Trace'Class; Cursor : in Parser_Lists.Cursor);
-- Put image of top 10 stack items to Trace.
procedure Prepend_Copy (List : in out Parser_Lists.List; Cursor : in Parser_Lists.Cursor'Class);
-- Copy parser at Cursor, prepend to current list. New copy will not
-- appear in Cursor.Next ...; it is accessible as First (List).
--
-- Copy.Recover is set to default.
----------
-- Stuff for iterators, to allow
-- 'for Parser of Parsers loop'
-- 'for I in Parsers.Iterate loop'
--
-- requires Parser_State to be not an incomplete type.
-- We'd like to use Cursor here, but we want that to be tagged, to
-- allow 'Cursor.operation' syntax, and the requirements of
-- iterators prevent a tagged iterator type (two tagged types on
-- First in this package body). So we use Parser_Node_Access as
-- the iterator type for Iterators, and typical usage is:
--
-- for I in Parsers.Iterate loop
-- declare
-- Cursor : Parser_Lists.Cursor renames To_Cursor (Parsers, I);
-- begin
-- Cursor.<cursor operation>
--
-- ... Parsers (I).<visible parser_state component> ...
-- end;
-- end loop;
--
-- or:
-- for Current_Parser of Parsers loop
-- ... Current_Parser.<visible parser_state component> ...
-- end loop;
type Parser_Node_Access (<>) is private;
function To_Cursor (Ptr : in Parser_Node_Access) return Cursor;
type Constant_Reference_Type (Element : not null access constant Parser_State) is null record
with Implicit_Dereference => Element;
function Constant_Reference
(Container : aliased in List'Class;
Position : in Parser_Node_Access)
return Constant_Reference_Type;
pragma Inline (Constant_Reference);
function Reference
(Container : aliased in out List'Class;
Position : in Parser_Node_Access)
return State_Reference;
pragma Inline (Reference);
function Persistent_State_Ref (Position : in Parser_Node_Access) return State_Access;
function Has_Element (Iterator : in Parser_Node_Access) return Boolean;
package Iterator_Interfaces is new Ada.Iterator_Interfaces (Parser_Node_Access, Has_Element);
function Iterate (Container : aliased in out List) return Iterator_Interfaces.Forward_Iterator'Class;
-- Access to some private Parser_State components
function Label (Iterator : in Parser_State) return Natural;
procedure Set_Verb (Iterator : in out Parser_State; Verb : in All_Parse_Action_Verbs);
function Verb (Iterator : in Parser_State) return All_Parse_Action_Verbs;
private
type Parser_State is new Base_Parser_State with record
Label : Natural; -- for debugging/verbosity
Verb : All_Parse_Action_Verbs := Shift; -- current action to perform
end record;
package Parser_State_Lists is new SAL.Gen_Indefinite_Doubly_Linked_Lists (Parser_State);
type List is tagged record
Elements : aliased Parser_State_Lists.List;
Parser_Label : Natural; -- label of last added parser.
end record;
type Cursor (Elements : access Parser_State_Lists.List) is tagged
record
Ptr : Parser_State_Lists.Cursor;
end record;
type Parser_Node_Access (Elements : access Parser_State_Lists.List) is
record
Ptr : Parser_State_Lists.Cursor;
end record;
end WisiToken.Parse.LR.Parser_Lists;
|
-- This spec has been automatically generated from STM32F7x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with System;
-- STM32F7x
package STM32_SVD is
pragma Preelaborate;
--------------------
-- Base addresses --
--------------------
RNG_Base : constant System.Address :=
System'To_Address (16#50060800#);
HASH_Base : constant System.Address :=
System'To_Address (16#50060400#);
CRYP_Base : constant System.Address :=
System'To_Address (16#50060000#);
DCMI_Base : constant System.Address :=
System'To_Address (16#50050000#);
FMC_Base : constant System.Address :=
System'To_Address (16#A0000000#);
DBG_Base : constant System.Address :=
System'To_Address (16#E0042000#);
DMA2_Base : constant System.Address :=
System'To_Address (16#40026400#);
DMA1_Base : constant System.Address :=
System'To_Address (16#40026000#);
RCC_Base : constant System.Address :=
System'To_Address (16#40023800#);
GPIOD_Base : constant System.Address :=
System'To_Address (16#40020C00#);
GPIOC_Base : constant System.Address :=
System'To_Address (16#40020800#);
GPIOK_Base : constant System.Address :=
System'To_Address (16#40022800#);
GPIOJ_Base : constant System.Address :=
System'To_Address (16#40022400#);
GPIOI_Base : constant System.Address :=
System'To_Address (16#40022000#);
GPIOH_Base : constant System.Address :=
System'To_Address (16#40021C00#);
GPIOG_Base : constant System.Address :=
System'To_Address (16#40021800#);
GPIOF_Base : constant System.Address :=
System'To_Address (16#40021400#);
GPIOE_Base : constant System.Address :=
System'To_Address (16#40021000#);
GPIOB_Base : constant System.Address :=
System'To_Address (16#40020400#);
GPIOA_Base : constant System.Address :=
System'To_Address (16#40020000#);
SYSCFG_Base : constant System.Address :=
System'To_Address (16#40013800#);
SPI1_Base : constant System.Address :=
System'To_Address (16#40013000#);
SPI2_Base : constant System.Address :=
System'To_Address (16#40003800#);
SPI3_Base : constant System.Address :=
System'To_Address (16#40003C00#);
SPI4_Base : constant System.Address :=
System'To_Address (16#40013400#);
SPI5_Base : constant System.Address :=
System'To_Address (16#40015000#);
SPI6_Base : constant System.Address :=
System'To_Address (16#40015400#);
ADC1_Base : constant System.Address :=
System'To_Address (16#40012000#);
ADC2_Base : constant System.Address :=
System'To_Address (16#40012100#);
ADC3_Base : constant System.Address :=
System'To_Address (16#40012200#);
DAC_Base : constant System.Address :=
System'To_Address (16#40007400#);
PWR_Base : constant System.Address :=
System'To_Address (16#40007000#);
IWDG_Base : constant System.Address :=
System'To_Address (16#40003000#);
WWDG_Base : constant System.Address :=
System'To_Address (16#40002C00#);
C_ADC_Base : constant System.Address :=
System'To_Address (16#40012300#);
TIM1_Base : constant System.Address :=
System'To_Address (16#40010000#);
TIM8_Base : constant System.Address :=
System'To_Address (16#40010400#);
TIM2_Base : constant System.Address :=
System'To_Address (16#40000000#);
TIM3_Base : constant System.Address :=
System'To_Address (16#40000400#);
TIM4_Base : constant System.Address :=
System'To_Address (16#40000800#);
TIM5_Base : constant System.Address :=
System'To_Address (16#40000C00#);
TIM9_Base : constant System.Address :=
System'To_Address (16#40014000#);
TIM12_Base : constant System.Address :=
System'To_Address (16#40001800#);
TIM10_Base : constant System.Address :=
System'To_Address (16#40014400#);
TIM11_Base : constant System.Address :=
System'To_Address (16#40014800#);
TIM13_Base : constant System.Address :=
System'To_Address (16#40001C00#);
TIM14_Base : constant System.Address :=
System'To_Address (16#40002000#);
TIM6_Base : constant System.Address :=
System'To_Address (16#40001000#);
TIM7_Base : constant System.Address :=
System'To_Address (16#40001400#);
Ethernet_MAC_Base : constant System.Address :=
System'To_Address (16#40028000#);
Ethernet_MMC_Base : constant System.Address :=
System'To_Address (16#40028100#);
Ethernet_PTP_Base : constant System.Address :=
System'To_Address (16#40028700#);
Ethernet_DMA_Base : constant System.Address :=
System'To_Address (16#40029000#);
CRC_Base : constant System.Address :=
System'To_Address (16#40023000#);
CAN1_Base : constant System.Address :=
System'To_Address (16#40006400#);
CAN2_Base : constant System.Address :=
System'To_Address (16#40006800#);
NVIC_Base : constant System.Address :=
System'To_Address (16#E000E000#);
FLASH_Base : constant System.Address :=
System'To_Address (16#40023C00#);
EXTI_Base : constant System.Address :=
System'To_Address (16#40013C00#);
LTDC_Base : constant System.Address :=
System'To_Address (16#40016800#);
SAI1_Base : constant System.Address :=
System'To_Address (16#40015800#);
SAI2_Base : constant System.Address :=
System'To_Address (16#40015C00#);
DMA2D_Base : constant System.Address :=
System'To_Address (16#4002B000#);
QUADSPI_Base : constant System.Address :=
System'To_Address (16#A0001000#);
CEC_Base : constant System.Address :=
System'To_Address (16#40006C00#);
SPDIF_RX_Base : constant System.Address :=
System'To_Address (16#40004000#);
SDMMC_Base : constant System.Address :=
System'To_Address (16#40012C00#);
LPTIM1_Base : constant System.Address :=
System'To_Address (16#40002400#);
I2C1_Base : constant System.Address :=
System'To_Address (16#40005400#);
I2C2_Base : constant System.Address :=
System'To_Address (16#40005800#);
I2C3_Base : constant System.Address :=
System'To_Address (16#40005C00#);
I2C4_Base : constant System.Address :=
System'To_Address (16#40006000#);
RTC_Base : constant System.Address :=
System'To_Address (16#40002800#);
USART6_Base : constant System.Address :=
System'To_Address (16#40011400#);
USART1_Base : constant System.Address :=
System'To_Address (16#40011000#);
USART3_Base : constant System.Address :=
System'To_Address (16#40004800#);
USART2_Base : constant System.Address :=
System'To_Address (16#40004400#);
UART5_Base : constant System.Address :=
System'To_Address (16#40005000#);
UART4_Base : constant System.Address :=
System'To_Address (16#40004C00#);
UART8_Base : constant System.Address :=
System'To_Address (16#40007C00#);
UART7_Base : constant System.Address :=
System'To_Address (16#40007800#);
OTG_FS_GLOBAL_Base : constant System.Address :=
System'To_Address (16#50000000#);
OTG_FS_HOST_Base : constant System.Address :=
System'To_Address (16#50000400#);
OTG_FS_DEVICE_Base : constant System.Address :=
System'To_Address (16#50000800#);
OTG_FS_PWRCLK_Base : constant System.Address :=
System'To_Address (16#50000E00#);
OTG_HS_GLOBAL_Base : constant System.Address :=
System'To_Address (16#40040000#);
OTG_HS_HOST_Base : constant System.Address :=
System'To_Address (16#40040400#);
OTG_HS_DEVICE_Base : constant System.Address :=
System'To_Address (16#40040800#);
OTG_HS_PWRCLK_Base : constant System.Address :=
System'To_Address (16#40040E00#);
end STM32_SVD;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.