CombinedText
stringlengths
4
3.42M
with Ada.Interrupts.Names; with STM32GD.Timer; with STM32GD.Timer.Peripheral; package Peripherals is package Timer is new STM32GD.Timer.Peripheral (Timer => STM32GD.Timer.Timer_14, IRQ => Ada.Interrupts.Names.TIM14); end Peripherals;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- O P T -- -- -- -- S p e c -- -- -- -- $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. -- -- -- ------------------------------------------------------------------------------ -- This package contains global switches set by the initialization -- routine from the command line and referenced throughout the compiler, -- the binder or gnatmake. The comments indicate which options are used by -- which programs (GNAT, GNATBIND, GNATMAKE). with Hostparm; use Hostparm; with Types; use Types; with System.WCh_Con; use System.WCh_Con; package Opt is ---------------------------------------------- -- Settings of Modes for Current Processing -- ---------------------------------------------- -- The following mode values represent the current state of processing. -- The values set here are the default values. Unless otherwise noted, -- the value may be reset in Switch with an appropropiate switch. In -- some cases, the values can also be modified by pragmas, and in the -- case of some binder variables, Gnatbind.Scan_Bind_Arg may modify -- the default values. Ada_Bind_File : Boolean := True; -- GNATBIND -- Set True if binder file to be generated in Ada rather than C Ada_95 : Boolean := True; -- GNAT -- Set True if operating in Ada 95 mode -- Set False if operating in Ada 83 mode Ada_83 : Boolean := False; -- GNAT -- Set True if operating in Ada 83 mode -- Set False if operating in Ada 95 mode Ada_Final_Suffix : constant String := "final"; -- GNATBIND -- The suffix of the name of the finalization procedure. This variable -- may be modified by Gnatbind.Scan_Bind_Arg. Ada_Final_Name : String_Ptr := new String'("ada" & Ada_Final_Suffix); -- GNATBIND -- The name of the procedure that performs the finalization at the end of -- execution. This variable may be modified by Gnatbind.Scan_Bind_Arg. Ada_Init_Suffix : constant String := "init"; -- GNATBIND -- The suffix of the name of the initialization procedure. This variable -- may be modified by Gnatbind.Scan_Bind_Arg. Ada_Init_Name : String_Ptr := new String'("ada" & Ada_Init_Suffix); -- GNATBIND -- The name of the procedure that performs initialization at the start -- of execution. This variable may be modified by Gnatbind.Scan_Bind_Arg. Ada_Main_Name_Suffix : constant String := "main"; -- GNATBIND -- The suffix for Ada_Main_Name. Defined as a constant here so that it -- can be referenced in a uniform manner to create either the default -- value of Ada_Main_Name (declared below), or the non-default name -- set by Gnatbind.Scan_Bind_Arg. Ada_Main_Name : String_Ptr := new String'("ada_" & Ada_Main_Name_Suffix); -- GNATBIND -- The name of the Ada package generated by the binder (when in Ada mode). -- This variable may be modified by Gnatbind.Scan_Bind_Arg. Address_Clause_Overlay_Warnings : Boolean := True; -- GNAT -- Set False to disable address clause warnings All_Errors_Mode : Boolean := False; -- GNAT -- Flag set to force display of multiple errors on a single line and -- also repeated error messages for references to undefined identifiers -- and certain other repeated error messages. All_Sources : Boolean := False; -- GNATBIND -- Set to True to require all source files to be present. This flag is -- directly modified by gnatmake to affect the shared binder routines. Alternate_Main_Name : String_Ptr := null; -- Set to non null when Bind_Alternate_Main_Name is True. This value -- is modified as needed by Gnatbind.Scan_Bind_Arg. Assertions_Enabled : Boolean := False; -- GNAT -- Enable assertions made using pragma Assert. Back_Annotate_Rep_Info : Boolean := False; -- GNAT -- If set True (by use of -gnatB), enables back annotation of -- representation information by gigi, even in -gnatc mode. Bind_Alternate_Main_Name : Boolean := False; -- GNATBIND -- Set to True if main should be called Alternate_Main_Name.all. This -- variable may be set to True by Gnatbind.Scan_Bind_Arg. Bind_Main_Program : Boolean := True; -- GNATBIND -- Set to False if not binding main Ada program. Bind_For_Library : Boolean := False; -- GNATBIND -- Set to True if the binder needs to generate a file designed for -- building a library. May be set to True by Gnatbind.Scan_Bind_Arg. Bind_Only : Boolean := False; -- GNATMAKE -- Set to True to skip compile and link steps -- (except when Compile_Only and/or Link_Only are True). Brief_Output : Boolean := False; -- GNAT, GNATBIND -- Force brief error messages to standard error, even if verbose mode is -- set (so that main error messages go to standard output). Check_Object_Consistency : Boolean := False; -- GNATBIND, GNATMAKE -- Set to True to check whether every object file is consistent with -- with its corresponding ada library information (ali) file. An object -- file is inconsistent with the corresponding ali file if the object -- file does not exist or if it has an older time stamp than the ali file. -- Default above is for GNATBIND. GNATMAKE overrides this default to -- True (see Make.Initialize) since we do not need to check source -- consistencies in gnatmake in this sense. Check_Only : Boolean := False; -- GNATBIND -- Set to True to do checks only, no output of binder file. Check_Readonly_Files : Boolean := False; -- GNATMAKE -- Set to True to check readonly files during the make process. Check_Source_Files : Boolean := True; -- GNATBIND -- Set to True to enable consistency checking for any source files that -- are present (i.e. date must match the date in the library info file). -- Set to False for object file consistency check only. This flag is -- directly modified by gnatmake, to affect the shared binder routines. Check_Switches : Boolean := False; -- GNATMAKE -- Set to True to check compiler options during the make process. Check_Unreferenced : Boolean := False; -- GNAT -- Set to True to enable checking for unreferenced variables Check_Withs : Boolean := False; -- GNAT -- Set to True to enable checking for unused withs, and also the case -- of withing a package and using none of the entities in the package. Compile_Only : Boolean := False; -- GNATMAKE -- Set to True to skip bind and link steps (except when Bind_Only is True) Compress_Debug_Names : Boolean := False; -- GNATMAKE -- Set to True if the option to compress debug information is set (-gnatC) Config_File : Boolean := True; -- GNAT -- Set to False to inhibit reading and processing of gnat.adc file Config_File_Name : String_Ptr := null; -- GNAT -- File name of configuration pragmas file (given by switch -gnatec) Constant_Condition_Warnings : Boolean := False; -- GNAT -- Set to True to activate warnings on constant conditions subtype Debug_Level_Value is Nat range 0 .. 3; Debugger_Level : Debug_Level_Value := 0; -- GNATBIND -- The value given to the -g parameter. -- The default value for -g with no value is 2 -- This is usually ignored by GNATBIND, except in the VMS version -- where it is passed as an argument to __gnat_initialize to trigger -- the activation of the remote debugging interface (is this true???). Debug_Generated_Code : Boolean := False; -- GNAT -- Set True (-gnatD switch) to debug generated expanded code instead -- of the original source code. Causes debugging information to be -- written with respect to the generated code file that is written. Display_Compilation_Progress : Boolean := False; -- GNATMAKE -- Set True (-d switch) to display information on progress while compiling -- files. Internal switch to be used in conjunction with an IDE such as -- Glide. type Distribution_Stub_Mode_Type is -- GNAT (No_Stubs, -- Normal mode, no generation/compilation of distribution stubs Generate_Receiver_Stub_Body, -- The unit being compiled is the RCI body, and the compiler will -- generate the body for the receiver stubs and compile it. Generate_Caller_Stub_Body); -- The unit being compiled is the RCI spec, and the compiler will -- generate the body for the caller stubs and compile it. Distribution_Stub_Mode : Distribution_Stub_Mode_Type := No_Stubs; -- GNAT -- This enumeration variable indicates the five states of distribution -- annex stub generation/compilation. Do_Not_Execute : Boolean := False; -- GNATMAKE -- Set to True if no actual compilations should be undertaken. Dynamic_Elaboration_Checks : Boolean := False; -- GNAT -- Set True for dynamic elaboration checking mode, as set by the -gnatE -- switch or by the use of pragma Elaboration_Checks (Dynamic). Elab_Dependency_Output : Boolean := False; -- GNATBIND -- Set to True to output complete list of elaboration constraints Elab_Order_Output : Boolean := False; -- GNATBIND -- Set to True to output chosen elaboration order Elab_Warnings : Boolean := False; -- GNAT -- Set to True to generate full elaboration warnings (-gnatwl) type Exception_Mechanism_Type is (Setjmp_Longjmp, Front_End_ZCX, GCC_ZCX); Exception_Mechanism : Exception_Mechanism_Type := Setjmp_Longjmp; -- GNAT -- Set to the appropriate value depending on the default as given in -- system.ads (ZCX_By_Default, GCC_ZCX_Support, Front_End_ZCX_Support) -- and the use of -gnatL -gnatZ (and -gnatdX) Exception_Tracebacks : Boolean := False; -- GNATBIND -- Set to True to store tracebacks in exception occurrences (-E) Extensions_Allowed : Boolean := False; -- GNAT type External_Casing_Type is ( As_Is, -- External names cased as they appear in the Ada source Uppercase, -- External names forced to all uppercase letters Lowercase); -- External names forced to all lowercase letters External_Name_Imp_Casing : External_Casing_Type := Lowercase; -- The setting of this switch determines the casing of external names -- when the name is implicitly derived from an entity name (i.e. either -- no explicit External_Name or Link_Name argument is used, or, in the -- case of extended DEC pragmas, the external name is given using an -- identifier. The As_Is setting is not permitted here (since this would -- create Ada source programs that were case sensitive). External_Name_Exp_Casing : External_Casing_Type := As_Is; -- The setting of this switch determines the casing of an external name -- specified explicitly with a string literal. As_Is means the string -- literal is used as given with no modification to the casing. If -- Lowercase or Uppercase is set, then the string is forced to all -- lowercase or all uppercase letters as appropriate. Note that this -- setting has no effect if the external name is given using an identifier -- in the case of extended DEC import/export pragmas (in this case the -- casing is controlled by External_Name_Imp_Casing), and also has no -- effect if an explicit Link_Name is supplied (a link name is always -- used exactly as given). Float_Format : Character := ' '; -- GNAT -- A non-blank value indicates that a Float_Format pragma has been -- processed, in which case this variable is set to 'I' for IEEE or -- to 'V' for VAX. The setting of 'V' is only possible on OpenVMS -- versions of GNAT. Float_Format_Long : Character := ' '; -- GNAT -- A non-blank value indicates that a Long_Float pragma has been -- processed (this pragma is recognized only in OpenVMS versions -- of GNAT), in which case this variable is set to D or G for -- D_Float or G_Float. Force_ALI_Tree_File : Boolean := False; -- GNAT -- Force generation of ali file even if errors are encountered. -- Also forces generation of tree file if -gnatt is also set. Force_Compilations : Boolean := False; -- GNATMAKE -- Set to force recompilations even when the objects are up-to-date. Force_RM_Elaboration_Order : Boolean := False; -- GNATBIND -- True if binding with forced RM elaboration order (-f switch set) -- Note: this is considered an obsolescent option, to be removed in -- some future release. it is no longer documented. The proper way -- to get this effect is to use -gnatE and suppress elab checks. Full_List : Boolean := False; -- GNAT -- Set True to generate full source listing with embedded errors Global_Discard_Names : Boolean := False; -- GNAT -- Set true if a pragma Discard_Names applies to the current unit GNAT_Mode : Boolean := False; -- GNAT -- True if compiling in GNAT system mode (-g switch set) HLO_Active : Boolean := False; -- GNAT -- True if High Level Optimizer is activated Implementation_Unit_Warnings : Boolean := True; -- GNAT -- Set True to active warnings for use of implementation internal units. -- Can be controlled by use of -gnatwi/-gnatwI. Identifier_Character_Set : Character; -- GNAT -- This variable indicates the character set to be used for identifiers. -- The possible settings are: -- '1' Latin-1 -- '2' Latin-2 -- '3' Latin-3 -- '4' Latin-4 -- 'p' PC (US, IBM page 437) -- '8' PC (European, IBM page 850) -- 'f' Full upper set (all distinct) -- 'n' No upper characters (Ada/83 rules) -- 'w' Latin-1 plus wide characters allowed in identifiers -- -- The setting affects the set of letters allowed in identifiers and the -- upper/lower case equivalences. It does not affect the interpretation of -- character and string literals, which are always stored using the actual -- coding in the source program. This variable is initialized to the -- default value appropriate to the system (in Osint.Initialize), and then -- reset if a command line switch is used to change the setting. Ineffective_Inline_Warnings : Boolean := False; -- GNAT -- Set True to activate warnings if front-end inlining (-gnatN) is not -- able to actually inline a particular call (or all calls). Can be -- controlled by use of -gnatwp/-gnatwP. Init_Or_Norm_Scalars : Boolean := False; -- GNAT -- Set True if a pragma Initialize_Scalars applies to the current unit. -- Also set True if a pragma Normalize_Scalars applies. Initialize_Scalars : Boolean := False; -- GNAT -- Set True if a pragma Initialize_Scalars applies to the current unit. -- Note that Init_Or_Norm_Scalars is also set to True if this is True. Initialize_Scalars_Mode : Character := 'I'; -- GNATBIND -- Set to 'I' for -Sin (default), 'L' for -Slo, 'H' for -Shi, 'X' for -Sxx Initialize_Scalars_Val : String (1 .. 2); -- GNATBIND -- Valid only if Initialize_Scalars_Mode is set to 'X' (-Shh). Contains -- the two hex bytes from the -Shh switch. Inline_Active : Boolean := False; -- GNAT -- Set True to activate pragma Inline processing across modules. Default -- for now is not to inline across module boundaries. Front_End_Inlining : Boolean := False; -- GNAT -- Set True to activate inlining by front-end expansion. Inline_Processing_Required : Boolean := False; -- GNAT -- Set True if inline processing is required. Inline processing is -- required if an active Inline pragma is processed. The flag is set -- for a pragma Inline or Inline_Always that is actually active. In_Place_Mode : Boolean := False; -- GNATMAKE -- Set True to store ALI and object files in place ie in the object -- directory if these files already exist or in the source directory -- if not. Keep_Going : Boolean := False; -- GNATMAKE -- When True signals gnatmake to ignore compilation errors and keep -- processing sources until there is no more work. Link_Only : Boolean := False; -- GNATMAKE -- Set to True to skip compile and bind steps -- (except when Bind_Only is set to True). List_Units : Boolean := False; -- GNAT -- List units in the active library List_Dependencies : Boolean := False; -- GNATMAKE -- When True gnatmake verifies that the objects are up to date and -- outputs the list of object dependencies. This list can be used -- directly in a Makefile. List_Representation_Info : Int range 0 .. 3 := 0; -- GNAT -- Set true by -gnatR switch to list representation information. -- The settings are as follows: -- -- 0 = no listing of representation information (default as above) -- 1 = list rep info for user defined record and array types -- 2 = list rep info for all user defined types and objects -- 3 = like 2, but variable fields are decoded symbolically Locking_Policy : Character := ' '; -- GNAT -- Set to ' ' for the default case (no locking policy specified). -- Reset to first character (uppercase) of locking policy name if a -- valid pragma Locking_Policy is encountered. Look_In_Primary_Dir : Boolean := True; -- GNAT, GNATBIND, GNATMAKE -- Set to False if a -I- was present on the command line. -- When True we are allowed to look in the primary directory to locate -- other source or library files. Mapping_File_Name : String_Ptr := null; -- GNAT -- File name of mapping between unit names, file names and path names. -- (given by switch -gnatem) Maximum_Errors : Int := 9999; -- GNAT, GNATBIND -- Maximum number of errors before compilation is terminated Maximum_File_Name_Length : Int; -- GNAT, GNATBIND -- Maximum number of characters allowed in a file name, not counting the -- extension, as set by the appropriate switch. If no switch is given, -- then this value is initialized by Osint to the appropriate value. Maximum_Processes : Positive := 1; -- GNATMAKE -- Maximum number of processes that should be spawned to carry out -- compilations. Minimal_Recompilation : Boolean := False; -- GNATMAKE -- Set to True if minimal recompilation mode requested. No_Stdlib : Boolean := False; -- GNATMAKE -- Set to True if no default library search dirs added to search list. No_Stdinc : Boolean := False; -- GNATMAKE -- Set to True if no default source search dirs added to search list. No_Main_Subprogram : Boolean := False; -- GNATMAKE, GNATBIND -- Set to True if compilation/binding of a program without main -- subprogram requested. Normalize_Scalars : Boolean := False; -- GNAT -- Set True if a pragma Normalize_Scalars applies to the current unit. -- Note that Init_Or_Norm_Scalars is also set to True if this is True. No_Run_Time : Boolean := False; -- GNAT -- Set True if a valid pragma No_Run_Time is processed or if the -- flag Targparm.High_Integrity_Mode_On_Target is set True. type Operating_Mode_Type is (Check_Syntax, Check_Semantics, Generate_Code); Operating_Mode : Operating_Mode_Type := Generate_Code; -- GNAT -- Indicates the operating mode of the compiler. The default is generate -- code, which runs the parser, semantics and backend. Switches can be -- used to set syntax checking only mode, or syntax and semantics checking -- only mode. Operating_Mode can also be modified as a result of detecting -- errors during the compilation process. In particular if any error is -- detected then this flag is reset from Generate_Code to Check_Semantics -- after generating an error message. Output_File_Name_Present : Boolean := False; -- GNATBIND, GNAT -- Set to True when the output C file name is given with option -o -- for GNATBIND or when the object file name is given with option -- -gnatO for GNAT. Output_Linker_Option_List : Boolean := False; -- GNATBIND -- True if output of list of linker options is requested (-K switch set) Output_Object_List : Boolean := False; -- GNATBIND -- True if output of list of objects is requested (-O switch set) Pessimistic_Elab_Order : Boolean := False; -- GNATBIND -- True if pessimistic elaboration order is to be chosen (-p switch set) Polling_Required : Boolean := False; -- GNAT -- Set to True if polling for asynchronous abort is enabled by using -- the -gnatP option for GNAT. Print_Generated_Code : Boolean := False; -- GNAT -- Set to True to enable output of generated code in source form. This -- flag is set by the -gnatG switch. Propagate_Exceptions : Boolean := False; -- GNAT -- Indicates if subprogram descriptor exception tables should be -- built for imported subprograms. Set True if a Propagate_Exceptions -- pragma applies to the extended main unit. Queuing_Policy : Character := ' '; -- GNAT -- Set to ' ' for the default case (no queuing policy specified). Reset to -- Reset to first character (uppercase) of locking policy name if a valid -- Queuing_Policy pragma is encountered. Quiet_Output : Boolean := False; -- GNATMAKE -- Set to True if the list of compilation commands should not be output. Shared_Libgnat : Boolean; -- GNATBIND -- Set to True if a shared libgnat is requested by using the -shared -- option for GNATBIND and to False when using the -static option. The -- value of this switch is set by Gnatbind.Scan_Bind_Arg. Software_Overflow_Checking : Boolean; -- GNAT -- Set to True by Osint.Initialize if the target requires the software -- approach to integer arithmetic overflow checking (i.e. the use of -- double length arithmetic followed by a range check). Set to False -- if the target implements hardware overflow checking. Stack_Checking_Enabled : Boolean; -- GNAT -- Set to indicate if -fstack-check switch is set for the compilation. -- True means that the switch is set, so that stack checking is enabled. -- False means that the switch is not set (no stack checking). This -- value is obtained from the external imported value flag_stack_check -- in the gcc backend (see Frontend) and may be referenced throughout -- the compilation phases. Strict_Math : aliased Boolean := False; -- GNAT -- This switch is set True if the current unit is to be compiled in -- strict math mode. The effect is to cause certain library file name -- substitutions to implement strict math semantics. See the routine -- Adjust_File_Name_For_Configuration, and also the configuration -- in the body of Opt. -- -- Note: currently this switch is always False. Eventually it will be -- settable by a switch and a configuration pragma. Style_Check : Boolean := False; -- GNAT -- Set True to perform style checks. Activates checks carried out -- in package Style (see body of this package for details of checks) -- This flag is set True by either the -gnatg or -gnaty switches. System_Extend_Pragma_Arg : Node_Id := Empty; -- GNAT -- Set non-empty if and only if a correct Extend_System pragma was present -- in which case it points to the argument of the pragma, and the name can -- be located as Chars (Expression (System_Extend_Pragma_Arg)). Subunits_Missing : Boolean := False; -- This flag is set true if missing subunits are detected with code -- generation active. This causes code generation to be skipped. Suppress_Options : Suppress_Record; -- GNAT -- Flags set True to suppress corresponding check, i.e. add an implicit -- pragma Suppress at the outer level of each unit compiled. Note that -- these suppress actions can be overridden by the use of the Unsuppress -- pragma. This variable is initialized by Osint.Initialize. Table_Factor : Int := 1; -- Factor by which all initial table sizes set in Alloc are multiplied. -- Used in Table to calculate initial table sizes (the initial table -- size is the value in Alloc, used as the Table_Initial parameter -- value, multiplied by the factor given here. The default value is -- used if no -gnatT switch appears. Task_Dispatching_Policy : Character := ' '; -- GNAT -- Set to ' ' for the default case (no task dispatching policy specified). -- Reset to first character (uppercase) of task dispatching policy name -- if a valid Task_Dispatching_Policy pragma is encountered. Tasking_Used : Boolean := False; -- Set True if any tasking construct is encountered. Used to activate the -- output of the Q, L and T lines in ali files. Time_Slice_Set : Boolean := False; -- Set True if a pragma Time_Slice is processed in the main unit, or -- if the T switch is present to set a time slice value. Time_Slice_Value : Nat; -- Time slice value. Valid only if Time_Slice_Set is True, i.e. if a -- Time_Slice pragma has been processed. Set to the time slice value -- in microseconds. Negative values are stored as zero, and the value -- is not larger than 1_000_000_000 (1000 seconds). Values larger than -- this are reset to this maximum. Tolerate_Consistency_Errors : Boolean := False; -- GNATBIND -- Tolerate time stamp and other consistency errors. If this switch is -- set true, then inconsistencies result in warnings rather than errors. Tree_Output : Boolean := False; -- GNAT -- Set True to generate output tree file Try_Semantics : Boolean := False; -- GNAT -- Flag set to force attempt at semantic analysis, even if parser errors -- occur. This will probably cause blowups at this stage in the game. On -- the other hand, most such blowups will be caught cleanly and simply -- say compilation abandoned. Unique_Error_Tag : Boolean := Tag_Errors; -- GNAT -- Indicates if error messages are to be prefixed by the string error: -- Initialized from Tag_Errors, can be forced on with the -gnatU switch. Unreserve_All_Interrupts : Boolean := False; -- GNAT, GNATBIND -- Normally set False, set True if a valid Unreserve_All_Interrupts -- pragma appears anywhere in the main unit for GNAT, or if any ALI -- file has the corresponding attribute set in GNATBIND. Upper_Half_Encoding : Boolean := False; -- GNAT -- Normally set False, indicating that upper half ASCII characters are -- used in the normal way to represent themselves. If the wide character -- encoding method uses the upper bit for this encoding, then this flag -- is set True, and upper half characters in the source indicate the -- start of a wide character sequence. Usage_Requested : Boolean := False; -- GNAT, GNATBIND, GNATMAKE -- Set to True if h switch encountered requesting usage information Use_VADS_Size : Boolean := False; -- GNAT -- Set to True if a valid pragma Use_VADS_Size is processed Validity_Checks_On : Boolean := True; -- This flag determines if validity checking is on or off. The initial -- state is on, and the required default validity checks are active. The -- actual set of checks that is performed if Validity_Checks_On is set -- is defined by the switches in package Sem_Val. The Validity_Checks_On -- switch is controlled by pragma Validity_Checks (On | Off), and also -- some generated compiler code (typically code that has to do with -- validity check generation) is compiled with this switch set to False. Verbose_Mode : Boolean := False; -- GNAT, GNATBIND -- Set to True to get verbose mode (full error message text and location -- information sent to standard output, also header, copyright and summary) Warn_On_Biased_Rounding : Boolean := False; -- GNAT -- Set to True to generate warnings for static constants that are rounded -- in a manner inconsistent with unbiased rounding (round to even). Can -- be modified by use of -gnatwb/B. Warn_On_Hiding : Boolean := False; -- GNAT -- Set to True to generate warnings if a declared entity hides another -- entity. The default is that this warning is suppressed. Warn_On_Redundant_Constructs : Boolean := False; -- GNAT -- Set to True to generate warnings for redundant constructs (e.g. useless -- assignments/conversions). The default is that this warning is disabled. type Warning_Mode_Type is (Suppress, Normal, Treat_As_Error); Warning_Mode : Warning_Mode_Type := Normal; -- GNAT, GNATBIND -- Controls treatment of warning messages. If set to Suppress, warning -- messages are not generated at all. In Normal mode, they are generated -- but do not count as errors. In Treat_As_Error mode, warning messages -- are generated and are treated as errors. Wide_Character_Encoding_Method : WC_Encoding_Method := WCEM_Brackets; -- GNAT -- Method used for encoding wide characters in the source program. See -- description of type in unit System.WCh_Con for a list of the methods -- that are currently supported. Note that brackets notation is always -- recognized in source programs regardless of the setting of this -- variable. The default setting causes only the brackets notation -- to be recognized. If this is the main unit, this setting also -- controls the output of the W=? parameter in the ali file, which -- is used to provide the default for Wide_Text_IO files. Xref_Active : Boolean := True; -- GNAT -- Set if cross-referencing is enabled (i.e. xref info in ali files) Zero_Cost_Exceptions_Val : Boolean; Zero_Cost_Exceptions_Set : Boolean := False; -- GNAT -- These values are to record the setting of the zero cost exception -- handling mode set by argument switches (-gnatZ/-gnatL). If the -- value is set by one of these switches, then Zero_Cost_Exceptions_Set -- is set to True, and Zero_Cost_Exceptions_Val indicates the setting. -- This value is used to reset ZCX_By_Default_On_Target. ---------------------------- -- Configuration Settings -- ---------------------------- -- These are settings that are used to establish the mode at the start -- of each unit. The values defined below can be affected either by -- command line switches, or by the use of appropriate configuration -- pragmas in the gnat.adc file. Ada_83_Config : Boolean; -- GNAT -- This is the value of the configuration switch for Ada 83 mode, as set -- by the command line switch -gnat83, and possibly modified by the use -- of configuration pragmas Ada_95 and Ada_83 in the gnat.adc file. This -- switch is used to set the initial value for Ada_83 mode at the start -- of analysis of a unit. Note however, that the setting of this switch -- is ignored for internal and predefined units (which are always compiled -- in Ada 95 mode). Dynamic_Elaboration_Checks_Config : Boolean := False; -- GNAT -- Set True for dynamic elaboration checking mode, as set by the -gnatE -- switch or by the use of pragma Elaboration_Checking (Dynamic). Extensions_Allowed_Config : Boolean; -- GNAT -- This is the switch that indicates whether extensions are allowed. -- It can be set True either by use of the -gnatX switch, or by use -- of the configuration pragma Extensions_Allowed (On). It is always -- set to True for internal GNAT units, since extensions are always -- permitted in such units. External_Name_Exp_Casing_Config : External_Casing_Type; -- GNAT -- This is the value of the configuration switch that controls casing -- of external symbols for which an explicit external name is given. It -- can be set to Uppercase by the command line switch -gnatF, and further -- modified by the use of the configuration pragma External_Name_Casing -- in the gnat.adc file. This switch is used to set the initial value -- for External_Name_Exp_Casing at the start of analyzing each unit. -- Note however that the setting of this switch is ignored for internal -- and predefined units (which are always compiled with As_Is mode). External_Name_Imp_Casing_Config : External_Casing_Type; -- GNAT -- This is the value of the configuration switch that controls casing -- of external symbols where the external name is implicitly given. It -- can be set to Uppercase by the command line switch -gnatF, and further -- modified by the use of the configuration pragma External_Name_Casing -- in the gnat.adc file. This switch is used to set the initial value -- for External_Name_Imp_Casing at the start of analyzing each unit. -- Note however that the setting of this switch is ignored for internal -- and predefined units (which are always compiled with Lowercase mode). Polling_Required_Config : Boolean; -- GNAT -- This is the value of the configuration switch that controls polling -- mode. It can be set True by the command line switch -gnatP, and then -- further modified by the use of pragma Polling in the gnat.adc file. -- This switch is used to set the initial value for Polling_Required -- at the start of analyzing each unit. Use_VADS_Size_Config : Boolean; -- GNAT -- This is the value of the configuration switch that controls the use -- of VADS_Size instead of Size whereever the attribute Size is used. -- It can be set True by the use of the pragma Use_VADS_Size in the -- gnat.adc file. This switch is used to set the initial value for -- Use_VADS_Size at the start of analyzing each unit. Note however that -- the setting of this switch is ignored for internal and predefined -- units (which are always compiled with the standard Size semantics). type Config_Switches_Type is private; -- Type used to save values of the switches set from Config values procedure Save_Opt_Config_Switches (Save : out Config_Switches_Type); -- This procedure saves the current values of the switches which are -- initialized from the above Config values, and then resets these -- switches according to the Config value settings. procedure Set_Opt_Config_Switches (Internal_Unit : Boolean); -- This procedure sets the switches to the appropriate initial values. -- The parameter Internal_Unit is True for an internal or predefined -- unit, and affects the way the switches are set (see above). procedure Restore_Opt_Config_Switches (Save : Config_Switches_Type); -- This procedure restores a set of switch values previously saved -- by a call to Save_Opt_Switches. procedure Register_Opt_Config_Switches; -- This procedure is called after processing the gnat.adc file to record -- the values of the Config switches, as possibly modified by the use -- of command line switches and configuration pragmas. ------------------------ -- Other Global Flags -- ------------------------ Expander_Active : Boolean := False; -- A flag that indicates if expansion is active (True) or deactivated -- (False). When expansion is deactivated all calls to expander routines -- have no effect. Note that the initial setting of False is merely to -- prevent saving of an undefined value for an initial call to the -- Expander_Mode_Save_And_Set procedure. For more information on the -- use of this flag, see package Expander. Indeed this flag might more -- logically be in the spec of Expander, but it is referenced by Errout, -- and it really seems wrong for Errout to depend on Expander. ----------------------- -- Tree I/O Routines -- ----------------------- procedure Tree_Read; -- Reads switch settings from current tree file using Tree_Read procedure Tree_Write; -- Writes out switch settings to current tree file using Tree_Write private type Config_Switches_Type is record Ada_83 : Boolean; Dynamic_Elaboration_Checks : Boolean; Extensions_Allowed : Boolean; External_Name_Exp_Casing : External_Casing_Type; External_Name_Imp_Casing : External_Casing_Type; Polling_Required : Boolean; Use_VADS_Size : Boolean; end record; end Opt;
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- package body Program.Nodes.Task_Definitions is function Create (Visible_Declarations : Program.Element_Vectors.Element_Vector_Access; Private_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Private_Declarations : Program.Element_Vectors.Element_Vector_Access; End_Token : not null Program.Lexical_Elements .Lexical_Element_Access; End_Name : Program.Elements.Identifiers.Identifier_Access) return Task_Definition is begin return Result : Task_Definition := (Visible_Declarations => Visible_Declarations, Private_Token => Private_Token, Private_Declarations => Private_Declarations, End_Token => End_Token, End_Name => End_Name, Enclosing_Element => null) do Initialize (Result); end return; end Create; function Create (Visible_Declarations : Program.Element_Vectors.Element_Vector_Access; Private_Declarations : Program.Element_Vectors.Element_Vector_Access; End_Name : Program.Elements.Identifiers.Identifier_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False) return Implicit_Task_Definition is begin return Result : Implicit_Task_Definition := (Visible_Declarations => Visible_Declarations, Private_Declarations => Private_Declarations, End_Name => End_Name, Is_Part_Of_Implicit => Is_Part_Of_Implicit, Is_Part_Of_Inherited => Is_Part_Of_Inherited, Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null) do Initialize (Result); end return; end Create; overriding function Visible_Declarations (Self : Base_Task_Definition) return Program.Element_Vectors.Element_Vector_Access is begin return Self.Visible_Declarations; end Visible_Declarations; overriding function Private_Declarations (Self : Base_Task_Definition) return Program.Element_Vectors.Element_Vector_Access is begin return Self.Private_Declarations; end Private_Declarations; overriding function End_Name (Self : Base_Task_Definition) return Program.Elements.Identifiers.Identifier_Access is begin return Self.End_Name; end End_Name; overriding function Private_Token (Self : Task_Definition) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Private_Token; end Private_Token; overriding function End_Token (Self : Task_Definition) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.End_Token; end End_Token; overriding function Is_Part_Of_Implicit (Self : Implicit_Task_Definition) return Boolean is begin return Self.Is_Part_Of_Implicit; end Is_Part_Of_Implicit; overriding function Is_Part_Of_Inherited (Self : Implicit_Task_Definition) return Boolean is begin return Self.Is_Part_Of_Inherited; end Is_Part_Of_Inherited; overriding function Is_Part_Of_Instance (Self : Implicit_Task_Definition) return Boolean is begin return Self.Is_Part_Of_Instance; end Is_Part_Of_Instance; procedure Initialize (Self : in out Base_Task_Definition'Class) is begin for Item in Self.Visible_Declarations.Each_Element loop Set_Enclosing_Element (Item.Element, Self'Unchecked_Access); end loop; for Item in Self.Private_Declarations.Each_Element loop Set_Enclosing_Element (Item.Element, Self'Unchecked_Access); end loop; if Self.End_Name.Assigned then Set_Enclosing_Element (Self.End_Name, Self'Unchecked_Access); end if; null; end Initialize; overriding function Is_Task_Definition (Self : Base_Task_Definition) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Task_Definition; overriding function Is_Definition (Self : Base_Task_Definition) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Definition; overriding procedure Visit (Self : not null access Base_Task_Definition; Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is begin Visitor.Task_Definition (Self); end Visit; overriding function To_Task_Definition_Text (Self : in out Task_Definition) return Program.Elements.Task_Definitions.Task_Definition_Text_Access is begin return Self'Unchecked_Access; end To_Task_Definition_Text; overriding function To_Task_Definition_Text (Self : in out Implicit_Task_Definition) return Program.Elements.Task_Definitions.Task_Definition_Text_Access is pragma Unreferenced (Self); begin return null; end To_Task_Definition_Text; end Program.Nodes.Task_Definitions;
-- part of AdaYaml, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "copying.txt" with Yaml.Dom.Vectors; with Yaml.Events.Queue; with Yaml.Destination; package Yaml.Dom.Dumping is function To_Event_Queue (Document : Document_Reference) return Events.Queue.Reference; function To_Event_Queue (Documents : Vectors.Vector) return Events.Queue.Reference; procedure Dump (Document : Document_Reference; Output : not null Destination.Pointer); procedure Dump (Documents : Vectors.Vector; Output : not null Destination.Pointer); end Yaml.Dom.Dumping;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . D I R E C T O R I E S . V A L I D I T Y -- -- -- -- B o d y -- -- (Windows Version) -- -- -- -- Copyright (C) 2004-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 is the Windows version of this package with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; package body Ada.Directories.Validity is Invalid_Character : constant array (Character) of Boolean := (NUL .. US | '\' => True, '/' | ':' | '*' | '?' => True, '"' | '<' | '>' | '|' => True, DEL => True, others => False); -- Note that a valid file-name or path-name is implementation defined. -- To support UTF-8 file and directory names, we do not want to be too -- restrictive here. --------------------------------- -- Is_Path_Name_Case_Sensitive -- --------------------------------- function Is_Path_Name_Case_Sensitive return Boolean is begin return False; end Is_Path_Name_Case_Sensitive; ------------------------ -- Is_Valid_Path_Name -- ------------------------ function Is_Valid_Path_Name (Name : String) return Boolean is Start : Positive := Name'First; Last : Natural; begin -- A path name cannot be empty, cannot contain more than 256 characters, -- cannot contain invalid characters and each directory/file name need -- to be valid. if Name'Length = 0 or else Name'Length > 256 then return False; else -- A drive letter may be specified at the beginning if Name'Length >= 2 and then Name (Start + 1) = ':' and then (Name (Start) in 'A' .. 'Z' or else Name (Start) in 'a' .. 'z') then Start := Start + 2; -- A drive letter followed by a colon and followed by nothing or -- by a relative path is an ambiguous path name on Windows, so we -- don't accept it. if Start > Name'Last or else (Name (Start) /= '/' and then Name (Start) /= '\') then return False; end if; end if; loop -- Look for the start of the next directory or file name while Start <= Name'Last and then (Name (Start) = '\' or Name (Start) = '/') loop Start := Start + 1; end loop; -- If all directories/file names are OK, return True exit when Start > Name'Last; Last := Start; -- Look for the end of the directory/file name while Last < Name'Last loop exit when Name (Last + 1) = '\' or Name (Last + 1) = '/'; Last := Last + 1; end loop; -- Check if the directory/file name is valid if not Is_Valid_Simple_Name (Name (Start .. Last)) then return False; end if; -- Move to the next name Start := Last + 1; end loop; end if; -- If Name follows the rules, it is valid return True; end Is_Valid_Path_Name; -------------------------- -- Is_Valid_Simple_Name -- -------------------------- function Is_Valid_Simple_Name (Name : String) return Boolean is Only_Spaces : Boolean; begin -- A file name cannot be empty, cannot contain more than 256 characters, -- and cannot contain invalid characters. if Name'Length = 0 or else Name'Length > 256 then return False; -- Name length is OK else Only_Spaces := True; for J in Name'Range loop if Invalid_Character (Name (J)) then return False; elsif Name (J) /= ' ' then Only_Spaces := False; end if; end loop; -- If no invalid chars, and not all spaces, file name is valid return not Only_Spaces; end if; end Is_Valid_Simple_Name; ------------- -- Windows -- ------------- function Windows return Boolean is begin return True; end Windows; end Ada.Directories.Validity;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . S T O R A G E _ E L E M E N T S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2002-2020, 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 implementation dependent sections of this file. -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ -- Warning: declarations in this package are ambiguous with respect to the -- extra declarations that can be introduced into System using Extend_System. -- It is a good idea to avoid use clauses for this package. pragma Compiler_Unit_Warning; package System.Storage_Elements is pragma Pure; -- Note that we take advantage of the implementation permission to make -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada 2005, -- this is Pure in any case (AI-362). -- We also add the pragma Pure_Function to the operations in this package, -- because otherwise functions with parameters derived from Address are -- treated as non-pure by the back-end (see exp_ch6.adb). This is because -- in many cases such a parameter is used to hide read/out access to -- objects, and it would be unsafe to treat such functions as pure. type Storage_Offset is range -(2 ** (Integer'(Standard'Address_Size) - 1)) .. +(2 ** (Integer'(Standard'Address_Size) - 1)) - Long_Long_Integer'(1); -- Note: the reason for the Long_Long_Integer qualification here is to -- avoid a bogus ambiguity when this unit is analyzed in an rtsfind -- context. It may be possible to remove this in the future, but it is -- certainly harmless in any case ??? subtype Storage_Count is Storage_Offset range 0 .. Storage_Offset'Last; type Storage_Element is mod 2 ** Storage_Unit; for Storage_Element'Size use Storage_Unit; pragma Universal_Aliasing (Storage_Element); -- This type is used by the expander to implement aggregate copy type Storage_Array is array (Storage_Offset range <>) of aliased Storage_Element; for Storage_Array'Component_Size use Storage_Unit; -- Address arithmetic function "+" (Left : Address; Right : Storage_Offset) return Address; pragma Convention (Intrinsic, "+"); pragma Inline_Always ("+"); pragma Pure_Function ("+"); function "+" (Left : Storage_Offset; Right : Address) return Address; pragma Convention (Intrinsic, "+"); pragma Inline_Always ("+"); pragma Pure_Function ("+"); function "-" (Left : Address; Right : Storage_Offset) return Address; pragma Convention (Intrinsic, "-"); pragma Inline_Always ("-"); pragma Pure_Function ("-"); function "-" (Left, Right : Address) return Storage_Offset; pragma Convention (Intrinsic, "-"); pragma Inline_Always ("-"); pragma Pure_Function ("-"); function "mod" (Left : Address; Right : Storage_Offset) return Storage_Offset; pragma Convention (Intrinsic, "mod"); pragma Inline_Always ("mod"); pragma Pure_Function ("mod"); -- Conversion to/from integers type Integer_Address is mod Memory_Size; function To_Address (Value : Integer_Address) return Address; pragma Convention (Intrinsic, To_Address); pragma Inline_Always (To_Address); pragma Pure_Function (To_Address); function To_Integer (Value : Address) return Integer_Address; pragma Convention (Intrinsic, To_Integer); pragma Inline_Always (To_Integer); pragma Pure_Function (To_Integer); end System.Storage_Elements;
-- BinToAsc -- Binary data to ASCII codecs -- Copyright (c) 2015, James Humphry -- -- Permission to use, copy, modify, and/or 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. generic type Bin is mod <>; type Bin_Array_Index is range <>; type Bin_Array is array (Bin_Array_Index range <>) of Bin; package BinToAsc is type Codec_State is (Ready, Completed, Failed); type Codec is abstract tagged record State : Codec_State := Ready; end record; procedure Reset (C : out Codec) is abstract with Post'Class => (C.State = Ready); -- Reset a Codec to its initial state function Input_Group_Size (C : in Codec) return Positive is abstract; function Output_Group_Size (C : in Codec) return Positive is abstract; type Codec_To_String is abstract new Codec with null record; not overriding procedure Process (C : in out Codec_To_String; Input : in Bin; Output : out String; Output_Length : out Natural) is abstract with Pre'Class => (C.State = Ready and Output'Length >= Output_Group_Size(C)); not overriding procedure Process (C : in out Codec_To_String; Input : in Bin_Array; Output : out String; Output_Length : out Natural) is abstract with Pre'Class => (C.State = Ready and Output'Length / Output_Group_Size(C) >= Input'Length / Input_Group_Size(C) + 1); not overriding procedure Complete (C : in out Codec_To_String; Output : out String; Output_Length : out Natural) is abstract with Pre'Class => (C.State = Ready and Output'Length >= Output_Group_Size(C)), Post'Class => C.State in Completed | Failed; type Codec_To_Bin is abstract new Codec with null record; not overriding procedure Process (C : in out Codec_To_Bin; Input : in Character; Output : out Bin_Array; Output_Length : out Bin_Array_Index) is abstract with Pre'Class => (C.State = Ready and Output'Length >= Output_Group_Size(C)); not overriding procedure Process (C : in out Codec_To_Bin; Input : in String; Output : out Bin_Array; Output_Length : out Bin_Array_Index) is abstract with Pre'Class => (C.State = Ready and Output'Length / Output_Group_Size(C) >= Input'Length / Input_Group_Size(C) + 1); not overriding procedure Complete (C : in out Codec_To_Bin; Output : out Bin_Array; Output_Length : out Bin_Array_Index) is abstract with Pre'Class => (C.State = Ready and Output'Length >= Output_Group_Size(C)), Post'Class => C.State in Completed | Failed; -- Helper functions generic type Codec is new Codec_To_String with private; function To_String (Input : in Bin_Array) return String; Invalid_Data_Encoding : exception; generic type Codec is new Codec_To_Bin with private; function To_Bin (Input : in String) return Bin_Array; -- Define Alphabet types subtype Alphabet_Index is Bin range 0..Bin'Last - 1; type Alphabet is array (Alphabet_Index range <>) of Character; function Valid_Alphabet (A : in Alphabet; Case_Sensitive : in Boolean) return Boolean with Pre => (A'First = 0); subtype Alphabet_16 is Alphabet(0..15); subtype Alphabet_32 is Alphabet(0..31); subtype Alphabet_64 is Alphabet(0..63); subtype Alphabet_85 is Alphabet(0..84); private type Reverse_Alphabet_Lookup is array (Character) of Bin; Invalid_Character_Input : constant Bin := 255; -- Any useful BinToAsc codec cannot map all Bin values to a Character value -- else there would be no benefit over simply using the Bin data directly. function Make_Reverse_Alphabet (A : in Alphabet; Case_Sensitive : in Boolean) return Reverse_Alphabet_Lookup with Pre => (Valid_Alphabet(A, Case_Sensitive)); -- This compile-time check is useful for GNAT, but in GNATprove it currently -- just generates a warning that it can not yet be proved correct. pragma Warnings (GNATprove, Off, "Compile_Time_Error"); pragma Compile_Time_Error ((Bin'Size /= 8 or Bin'Modulus /= 256 or Bin'Last /= 255 or Bin'First /= 0), "BinToAsc only works where the binary type" & "specified is a regular 8-bit byte."); pragma Warnings (GNATprove, On, "Compile_Time_Error"); end BinToAsc;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . E X E C U T I O N _ T I M E -- -- -- -- S p e c -- -- -- -- Copyright (C) 2007-2020, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Task_Identification; with Ada.Real_Time; package Ada.Execution_Time with SPARK_Mode is type CPU_Time is private; CPU_Time_First : constant CPU_Time; CPU_Time_Last : constant CPU_Time; CPU_Time_Unit : constant := Ada.Real_Time.Time_Unit; CPU_Tick : constant Ada.Real_Time.Time_Span; use type Ada.Task_Identification.Task_Id; function Clock (T : Ada.Task_Identification.Task_Id := Ada.Task_Identification.Current_Task) return CPU_Time with Volatile_Function, Global => Ada.Real_Time.Clock_Time, Pre => T /= Ada.Task_Identification.Null_Task_Id; function "+" (Left : CPU_Time; Right : Ada.Real_Time.Time_Span) return CPU_Time with Global => null; function "+" (Left : Ada.Real_Time.Time_Span; Right : CPU_Time) return CPU_Time with Global => null; function "-" (Left : CPU_Time; Right : Ada.Real_Time.Time_Span) return CPU_Time with Global => null; function "-" (Left : CPU_Time; Right : CPU_Time) return Ada.Real_Time.Time_Span with Global => null; function "<" (Left, Right : CPU_Time) return Boolean with Global => null; function "<=" (Left, Right : CPU_Time) return Boolean with Global => null; function ">" (Left, Right : CPU_Time) return Boolean with Global => null; function ">=" (Left, Right : CPU_Time) return Boolean with Global => null; procedure Split (T : CPU_Time; SC : out Ada.Real_Time.Seconds_Count; TS : out Ada.Real_Time.Time_Span) with Global => null; function Time_Of (SC : Ada.Real_Time.Seconds_Count; TS : Ada.Real_Time.Time_Span := Ada.Real_Time.Time_Span_Zero) return CPU_Time with Global => null; Interrupt_Clocks_Supported : constant Boolean := False; Separate_Interrupt_Clocks_Supported : constant Boolean := False; pragma Warnings (Off, "check will fail at run time"); function Clock_For_Interrupts return CPU_Time with Volatile_Function, Global => Ada.Real_Time.Clock_Time, Pre => Interrupt_Clocks_Supported; pragma Warnings (On, "check will fail at run time"); private pragma SPARK_Mode (Off); type CPU_Time is new Ada.Real_Time.Time; CPU_Time_First : constant CPU_Time := CPU_Time (Ada.Real_Time.Time_First); CPU_Time_Last : constant CPU_Time := CPU_Time (Ada.Real_Time.Time_Last); CPU_Tick : constant Ada.Real_Time.Time_Span := Ada.Real_Time.Tick; pragma Import (Intrinsic, "<"); pragma Import (Intrinsic, "<="); pragma Import (Intrinsic, ">"); pragma Import (Intrinsic, ">="); end Ada.Execution_Time;
pragma Ada_2005; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with SDL_stdinc_h; with Interfaces.C.Strings; package SDL_sensor_h is SDL_STANDARD_GRAVITY : constant := 9.80665; -- ..\SDL2_tmp\SDL_sensor.h:97 -- Simple DirectMedia Layer -- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org> -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages -- arising from the use of this software. -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it -- freely, subject to the following restrictions: -- 1. The origin of this software must not be misrepresented; you must not -- claim that you wrote the original software. If you use this software -- in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. -- 2. Altered source versions must be plainly marked as such, and must not be -- misrepresented as being the original software. -- 3. This notice may not be removed or altered from any source distribution. -- --* -- * \file SDL_sensor.h -- * -- * Include file for SDL sensor event handling -- * -- -- Set up for C function definitions, even when using C++ -- *INDENT-OFF* -- *INDENT-ON* --* -- * \brief SDL_sensor.h -- * -- * In order to use these functions, SDL_Init() must have been called -- * with the ::SDL_INIT_SENSOR flag. This causes SDL to scan the system -- * for sensors, and load appropriate drivers. -- type u_SDL_Sensor is null record; -- incomplete struct subtype SDL_Sensor is u_SDL_Sensor; -- ..\SDL2_tmp\SDL_sensor.h:52 --* -- * This is a unique ID for a sensor for the time it is connected to the system, -- * and is never reused for the lifetime of the application. -- * -- * The ID value starts at 0 and increments from there. The value -1 is an invalid ID. -- subtype SDL_SensorID is SDL_stdinc_h.Sint32; -- ..\SDL2_tmp\SDL_sensor.h:60 -- The different sensors defined by SDL -- * -- * Additional sensors may be available, using platform dependent semantics. -- * -- * Hare are the additional Android sensors: -- * https://developer.android.com/reference/android/hardware/SensorEvent.html#values -- --*< Returned for an invalid sensor --*< Unknown sensor type --*< Accelerometer --*< Gyroscope subtype SDL_SensorType is int; SDL_SENSOR_INVALID : constant int := -1; SDL_SENSOR_UNKNOWN : constant int := 0; SDL_SENSOR_ACCEL : constant int := 1; SDL_SENSOR_GYRO : constant int := 2; -- ..\SDL2_tmp\SDL_sensor.h:75 --* -- * Accelerometer sensor -- * -- * The accelerometer returns the current acceleration in SI meters per -- * second squared. This includes gravity, so a device at rest will have -- * an acceleration of SDL_STANDARD_GRAVITY straight down. -- * -- * values[0]: Acceleration on the x axis -- * values[1]: Acceleration on the y axis -- * values[2]: Acceleration on the z axis -- * -- * For phones held in portrait mode, the axes are defined as follows: -- * -X ... +X : left ... right -- * -Y ... +Y : bottom ... top -- * -Z ... +Z : farther ... closer -- * -- * The axis data is not changed when the phone is rotated. -- * -- * \sa SDL_GetDisplayOrientation() -- --* -- * Gyroscope sensor -- * -- * The gyroscope returns the current rate of rotation in radians per second. -- * The rotation is positive in the counter-clockwise direction. That is, -- * an observer looking from a positive location on one of the axes would -- * see positive rotation on that axis when it appeared to be rotating -- * counter-clockwise. -- * -- * values[0]: Angular speed around the x axis -- * values[1]: Angular speed around the y axis -- * values[2]: Angular speed around the z axis -- * -- * For phones held in portrait mode, the axes are defined as follows: -- * -X ... +X : left ... right -- * -Y ... +Y : bottom ... top -- * -Z ... +Z : farther ... closer -- * -- * The axis data is not changed when the phone is rotated. -- * -- * \sa SDL_GetDisplayOrientation() -- -- Function prototypes --* -- * \brief Count the number of sensors attached to the system right now -- function SDL_NumSensors return int; -- ..\SDL2_tmp\SDL_sensor.h:127 pragma Import (C, SDL_NumSensors, "SDL_NumSensors"); --* -- * \brief Get the implementation dependent name of a sensor. -- * -- * This can be called before any sensors are opened. -- * -- * \return The sensor name, or NULL if device_index is out of range. -- function SDL_SensorGetDeviceName (device_index : int) return Interfaces.C.Strings.chars_ptr; -- ..\SDL2_tmp\SDL_sensor.h:136 pragma Import (C, SDL_SensorGetDeviceName, "SDL_SensorGetDeviceName"); --* -- * \brief Get the type of a sensor. -- * -- * This can be called before any sensors are opened. -- * -- * \return The sensor type, or SDL_SENSOR_INVALID if device_index is out of range. -- function SDL_SensorGetDeviceType (device_index : int) return SDL_SensorType; -- ..\SDL2_tmp\SDL_sensor.h:145 pragma Import (C, SDL_SensorGetDeviceType, "SDL_SensorGetDeviceType"); --* -- * \brief Get the platform dependent type of a sensor. -- * -- * This can be called before any sensors are opened. -- * -- * \return The sensor platform dependent type, or -1 if device_index is out of range. -- function SDL_SensorGetDeviceNonPortableType (device_index : int) return int; -- ..\SDL2_tmp\SDL_sensor.h:154 pragma Import (C, SDL_SensorGetDeviceNonPortableType, "SDL_SensorGetDeviceNonPortableType"); --* -- * \brief Get the instance ID of a sensor. -- * -- * This can be called before any sensors are opened. -- * -- * \return The sensor instance ID, or -1 if device_index is out of range. -- function SDL_SensorGetDeviceInstanceID (device_index : int) return SDL_SensorID; -- ..\SDL2_tmp\SDL_sensor.h:163 pragma Import (C, SDL_SensorGetDeviceInstanceID, "SDL_SensorGetDeviceInstanceID"); --* -- * \brief Open a sensor for use. -- * -- * The index passed as an argument refers to the N'th sensor on the system. -- * -- * \return A sensor identifier, or NULL if an error occurred. -- function SDL_SensorOpen (device_index : int) return access SDL_Sensor; -- ..\SDL2_tmp\SDL_sensor.h:172 pragma Import (C, SDL_SensorOpen, "SDL_SensorOpen"); --* -- * Return the SDL_Sensor associated with an instance id. -- function SDL_SensorFromInstanceID (instance_id : SDL_SensorID) return access SDL_Sensor; -- ..\SDL2_tmp\SDL_sensor.h:177 pragma Import (C, SDL_SensorFromInstanceID, "SDL_SensorFromInstanceID"); --* -- * \brief Get the implementation dependent name of a sensor. -- * -- * \return The sensor name, or NULL if the sensor is NULL. -- function SDL_SensorGetName (sensor : access SDL_Sensor) return Interfaces.C.Strings.chars_ptr; -- ..\SDL2_tmp\SDL_sensor.h:184 pragma Import (C, SDL_SensorGetName, "SDL_SensorGetName"); --* -- * \brief Get the type of a sensor. -- * -- * This can be called before any sensors are opened. -- * -- * \return The sensor type, or SDL_SENSOR_INVALID if the sensor is NULL. -- function SDL_SensorGetType (sensor : access SDL_Sensor) return SDL_SensorType; -- ..\SDL2_tmp\SDL_sensor.h:193 pragma Import (C, SDL_SensorGetType, "SDL_SensorGetType"); --* -- * \brief Get the platform dependent type of a sensor. -- * -- * This can be called before any sensors are opened. -- * -- * \return The sensor platform dependent type, or -1 if the sensor is NULL. -- function SDL_SensorGetNonPortableType (sensor : access SDL_Sensor) return int; -- ..\SDL2_tmp\SDL_sensor.h:202 pragma Import (C, SDL_SensorGetNonPortableType, "SDL_SensorGetNonPortableType"); --* -- * \brief Get the instance ID of a sensor. -- * -- * This can be called before any sensors are opened. -- * -- * \return The sensor instance ID, or -1 if the sensor is NULL. -- function SDL_SensorGetInstanceID (sensor : access SDL_Sensor) return SDL_SensorID; -- ..\SDL2_tmp\SDL_sensor.h:211 pragma Import (C, SDL_SensorGetInstanceID, "SDL_SensorGetInstanceID"); --* -- * Get the current state of an opened sensor. -- * -- * The number of values and interpretation of the data is sensor dependent. -- * -- * \param sensor The sensor to query -- * \param data A pointer filled with the current sensor state -- * \param num_values The number of values to write to data -- * -- * \return 0 or -1 if an error occurred. -- function SDL_SensorGetData (sensor : access SDL_Sensor; data : access float; num_values : int) return int; -- ..\SDL2_tmp\SDL_sensor.h:224 pragma Import (C, SDL_SensorGetData, "SDL_SensorGetData"); --* -- * Close a sensor previously opened with SDL_SensorOpen() -- procedure SDL_SensorClose (sensor : access SDL_Sensor); -- ..\SDL2_tmp\SDL_sensor.h:229 pragma Import (C, SDL_SensorClose, "SDL_SensorClose"); --* -- * Update the current state of the open sensors. -- * -- * This is called automatically by the event loop if sensor events are enabled. -- * -- * This needs to be called from the thread that initialized the sensor subsystem. -- procedure SDL_SensorUpdate; -- ..\SDL2_tmp\SDL_sensor.h:238 pragma Import (C, SDL_SensorUpdate, "SDL_SensorUpdate"); -- Ends C function definitions when using C++ -- *INDENT-OFF* -- *INDENT-ON* -- vi: set ts=4 sw=4 expandtab: end SDL_sensor_h;
-- 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.Real_Time; with Ada.Task_Identification; package Ada.Execution_Time is type CPU_Time is private; CPU_Time_First : constant CPU_Time; CPU_Time_Last : constant CPU_Time; CPU_Time_Unit : constant := implementation_defined; CPU_Tick : constant Ada.Real_Time.Time_Span; function Clock (T : in Ada.Task_Identification.Task_Id := Ada.Task_Identification.Current_Task) return CPU_Time; function "+" (Left : in CPU_Time; Right : in Ada.Real_Time.Time_Span) return CPU_Time; function "+" (Left : in Ada.Real_Time.Time_Span; Right : in CPU_Time) return CPU_Time; function "-" (Left : in CPU_Time; Right : in Ada.Real_Time.Time_Span) return CPU_Time; function "-" (Left : in CPU_Time; Right : in CPU_Time) return Ada.Real_Time.Time_Span; function "<" (Left : in CPU_Time; Right : in CPU_Time) return Boolean; function "<=" (Left : in CPU_Time; Right : in CPU_Time) return Boolean; function ">" (Left : in CPU_Time; Right : in CPU_Time) return Boolean; function ">=" (Left : in CPU_Time; Right : in CPU_Time) return Boolean; procedure Split (T : in CPU_Time; SC : out Ada.Real_Time.Seconds_Count; TS : out Ada.Real_Time.Time_Span); function Time_Of (SC : in Ada.Real_Time.Seconds_Count; TS : in Ada.Real_Time.Time_Span := Ada.Real_Time.Time_Span_Zero) return CPU_Time; private pragma Import (Ada, CPU_Time); pragma Import (Ada, CPU_Time_First); pragma Import (Ada, CPU_Time_Last); pragma Import (Ada, CPU_Tick); end Ada.Execution_Time;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- Internal representation of code point sets. ------------------------------------------------------------------------------ with Matreshka.Atomics.Counters; with Matreshka.Internals.Regexps; with Matreshka.Internals.Unicode.Ucd; with Matreshka.Internals.Unicode.Ucd.Indexes; with League.Characters; package Matreshka.Internals.Code_Point_Sets is pragma Preelaborate; subtype First_Stage_Index is Matreshka.Internals.Unicode.UCD.First_Stage_Index; subtype Second_Stage_Index is Matreshka.Internals.Unicode.Ucd.Second_Stage_Index; type Boolean_Second_Stage is array (Second_Stage_Index) of Boolean; pragma Pack (Boolean_Second_Stage); All_Off : constant Boolean_Second_Stage := (others => False); All_On : constant Boolean_Second_Stage := (others => True); subtype Second_Stage_Array_Index is First_Stage_Index; type Second_Stage_Array is array (Second_Stage_Array_Index range <>) of Boolean_Second_Stage; type First_Stage_Map is array (First_Stage_Index) of Second_Stage_Array_Index; type Shared_Code_Point_Set (Last : Second_Stage_Array_Index) is limited record Counter : aliased Matreshka.Atomics.Counters.Counter; -- Atomic reference counter. First_Stage : First_Stage_Map; Second_Stages : Second_Stage_Array (0 .. Last); end record; function To_Set (Sequence : Wide_Wide_String) return Shared_Code_Point_Set; -- Return set containing all characters from Sequence function To_Set (Low : Matreshka.Internals.Unicode.Code_Point; High : Matreshka.Internals.Unicode.Code_Point) return Shared_Code_Point_Set; type Descriptor_Kinds is (General_Category, Binary); type Code_Point_Set_Descriptor (Kind : Descriptor_Kinds := Binary) is record case Kind is when General_Category => GC_Flags : Matreshka.Internals.Regexps.General_Category_Flags; when Binary => Property : Matreshka.Internals.Unicode.Ucd.Boolean_Properties; end case; end record; subtype Core_Shared_Code_Point_Set is Shared_Code_Point_Set (Last => Matreshka.Internals.Unicode.Ucd.Indexes.Base_Last); function To_Set (Descriptor : Code_Point_Set_Descriptor) return Core_Shared_Code_Point_Set; function Match (Descriptor : Code_Point_Set_Descriptor; Value : Matreshka.Internals.Unicode.Ucd.Core_Values) return Boolean; pragma Inline (Match); function "=" (Left, Right : Shared_Code_Point_Set) return Boolean; function "+" (Right : Shared_Code_Point_Set) return Shared_Code_Point_Set; -- Return the same set of character function "not" (Right : Shared_Code_Point_Set) return Shared_Code_Point_Set; -- Return complementing set of character function "and" (Left, Right : Shared_Code_Point_Set) return Shared_Code_Point_Set; -- Return intersection of Left and Right function "or" (Left, Right : Shared_Code_Point_Set) return Shared_Code_Point_Set; -- Return union of Left and Right function "xor" (Left, Right : Shared_Code_Point_Set) return Shared_Code_Point_Set; function "-" (Left, Right : Shared_Code_Point_Set) return Shared_Code_Point_Set; -- Return difference function Has (Set : Shared_Code_Point_Set; Element : League.Characters.Universal_Character) return Boolean; function Is_Subset (Elements : Shared_Code_Point_Set; Set : Shared_Code_Point_Set) return Boolean; function Is_Empty (Set : Shared_Code_Point_Set) return Boolean; type Shared_Code_Point_Set_Access is access all Shared_Code_Point_Set; Shared_Empty : aliased Shared_Code_Point_Set := (Last => 0, Counter => <>, First_Stage => (others => 0), Second_Stages => (0 => (others => False))); -- Globally defined empty shared code point set to be used as default value -- Reference and Dereference subprograms known about this object and -- never change its reference counter for speed optimization (atomic -- increment/decrement operations have significant perfomance penalty) -- and allows to be used in Preelaborateable_Initialization types. procedure Reference (Self : Shared_Code_Point_Set_Access); pragma Inline (Reference); -- Increment reference counter. Change of reference counter of Shared_Empty -- object is prevented to provide speedup and to allow to use it to -- initialize components of Preelaborateable_Initialization types. procedure Dereference (Self : in out Shared_Code_Point_Set_Access); -- Decrement reference counter and free resources if it reach zero value. -- Self is setted to null. Decrement of reference counter and deallocation -- of Shared_Empty object is prevented to provide minor speedup and to -- allow use it to initialize components of Preelaborateable_Initialization -- types. end Matreshka.Internals.Code_Point_Sets;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . B B . T I M E -- -- -- -- S p e c -- -- -- -- Copyright (C) 1999-2002 Universidad Politecnica de Madrid -- -- Copyright (C) 2003-2004 The European Space Agency -- -- Copyright (C) 2003-2021, AdaCore -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- -- The port of GNARL to bare board targets was initially developed by the -- -- Real-Time Systems Group at the Technical University of Madrid. -- -- -- ------------------------------------------------------------------------------ -- Package in charge of implementing clock and timer functionalities pragma Restrictions (No_Elaboration_Code); with System.Multiprocessors; package System.BB.Time is pragma Preelaborate; type Time is mod 2 ** 64; for Time'Size use 64; ------------------ -- Time keeping -- ------------------ -- Time is represented at this level as a 64-bit unsigned number. We assume -- that the Board_Support.Read_Clock function provides access to a hardware -- clock with a resolution of 20 microseconds or better, counting from -- 0 to Board_Support.Max_Timer_Interval over a period of at least 0.735 -- seconds, and returning a value of the 32-bit Timer_Interval type. The -- clock resolution should be an integral number of nanoseconds between 1 -- and 20_000. -- In addition, Board_Support provides an alarm facility, generating an -- alarm interrupt at up to Max_Timer_Interval clock ticks in the future. -- The clock frequency is the same as for Read_Clock, but it may or may not -- use the same timer. See the next section for more information. -- The Time package uses these facilities to keep a 64-bit clock that will -- allow a program to keep track of up to 50 years in the future without -- having the most significant bit set. This means it is always safe to -- subtract two Clock readings to determine a Time_Span without overflow. -- We need to support a clock running for 50 years, so this requires -- a hardware clock period of at least 1_577_880_000 / 2**31 or 0.735 -- seconds. As comparison, a LEON2 at 80 MHz with 24-bit clock and the -- minimum prescale factor of 4, has a period of 2**24 / (80E6 / 4) = 0.839 -- seconds, while a 200 MHz LEON3 has a period of 2**32 / (200E6 / 5) = -- 107 seconds. For faster clocks or smaller clock width, higher prescaler -- values may be needed to achieve 50 year run time. The prescale factor -- should be chosen such that the period between clock ticks is an integral -- number of nanoseconds between 1 and 20_000. type Time_Span is range -2 ** 63 .. 2 ** 63 - 1; for Time_Span'Size use 64; -- Time_Span represents the length of time intervals, and it is defined as -- a 64-bit signed integer. ------------ -- Alarms -- ------------ -- Alarms are used for two purposes: -- * Waking up tasks that sleep as result of Delay_Until -- * Clock updates, to prevent undetected wrap-around of the -- hardware clock -- Alarms use the same time unit as the clock used for time keeping, -- and need to be able to provide an alarm up to slightly less than -- Max_Timer_Interval ticks in the future; there always will be a pending -- alarm within this time frame because of required clock updates. A -- requirement is that an alarm always can be handled within 1/8th of the -- time it takes the hardware clock to wrap around. This gives an upper -- bound to how early we have to set the alarm to ensure timely clock -- updates. This will result in an interrupt rate 14% higher than -- absolutely necessary. However, as long as sleep-related alarms are -- sufficiently frequent, no extra clock-related interrupts are necessary. -------------------- -- Execution time -- -------------------- -- System.BB.Execution_Time will set these hooks to enable execution time -- computation only when needed. Scheduling_Event_Hook : access procedure := null; -- This hooks must be called when the charged account change: in case of -- rescheduling and before and after the handling of interrupt. -------------------- -- Initialization -- -------------------- procedure Initialize_Timers; -- Initialize this package (clock and alarm handlers). Must be called -- before any other functions. ---------------- -- Operations -- ---------------- function Epoch return Time; -- Get the reference startup time function Clock return Time; -- Get the number of ticks elapsed since startup procedure Delay_Until (T : Time); -- Suspend the calling thread until the absolute time specified by T function Get_Next_Timeout (CPU_Id : System.Multiprocessors.CPU) return Time; -- Get the date of the next alarm or timing event procedure Update_Alarm (Alarm : Time); -- Re-configure the timer if "Alarm" is earlier than the Pending_Alarm. -- Update_Alarm is the only routine allowed to set an alarm. -- Execution time -- Ada allows reading the execution time of any task. To support that, we -- need to have exclusive access to the time (which is costly as it is not -- possible to atomically read that value without using a spin lock and -- masking interrupts). To avoid that cost, let's split that type in two -- parts (that can be read or written atomically by the processor). It -- is not possible to read atomically the whole value, but it is possible -- to read a coherent value: if the time has been changed from A to B -- while being read, the value read is between A and B. Because of the -- architecture of the runtime, the execution time is always written -- atomically (written by the processor executing the task, within the -- kernel). -- The type Composite_Execution_Time is declared here so that s-bbthre -- doesn't depend on s-bbtiev. But this type is used by s-bbtiev. type Word is mod 2 ** 32; type Composite_Execution_Time is record High : Word; pragma Atomic (High); -- High part of execution time Low : Word; pragma Atomic (Low); -- Low part of execution time end record; Initial_Composite_Execution_Time : constant Composite_Execution_Time := (0, 0); -- The initial value for Composite_Execution_Time private pragma Inline (Clock); pragma Inline (Epoch); end System.BB.Time;
<?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>matrix_multiply_top</name> <ret_bitwidth>0</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="3" tracking_level="1" version="0" object_id="_1"> <Value class_id="4" tracking_level="0" version="0"> <Obj class_id="5" tracking_level="0" version="0"> <type>1</type> <id>1</id> <name>A</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>A</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>1</if_type> <array_size>9</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>B</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>B</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>1</if_type> <array_size>9</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>C</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>C</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>9</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>74</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_4"> <Value> <Obj> <type>0</type> <id>8</id> <name>a_i</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="10" tracking_level="0" version="0"> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</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>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>40</second> </item> </second> </item> </inlineStackInfo> <originalName>a_i</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>120</item> </oprand_edges> <opcode>alloca</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="_5"> <Value> <Obj> <type>0</type> <id>9</id> <name>b_i</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>41</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>41</second> </item> </second> </item> </inlineStackInfo> <originalName>b_i</originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>121</item> </oprand_edges> <opcode>alloca</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="_6"> <Value> <Obj> <type>0</type> <id>10</id> <name>C_assign</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName>RAM</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>122</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>3</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_7"> <Value> <Obj> <type>0</type> <id>11</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>45</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>45</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> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.83</m_delay> <m_topoIndex>4</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_8"> <Value> <Obj> <type>0</type> <id>13</id> <name>r</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>r</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>125</item> <item>126</item> <item>127</item> <item>128</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>5</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_9"> <Value> <Obj> <type>0</type> <id>14</id> <name>tmp</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>45</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>45</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>129</item> <item>131</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.47</m_delay> <m_topoIndex>6</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_10"> <Value> <Obj> <type>0</type> <id>16</id> <name>r_1</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>45</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>45</second> </item> </second> </item> </inlineStackInfo> <originalName>r</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>132</item> <item>134</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>0.80</m_delay> <m_topoIndex>7</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_11"> <Value> <Obj> <type>0</type> <id>17</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>45</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>45</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>135</item> <item>136</item> <item>137</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>8</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_12"> <Value> <Obj> <type>0</type> <id>21</id> <name>tmp_1_cast</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>45</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>45</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>139</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>9</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_13"> <Value> <Obj> <type>0</type> <id>22</id> <name>tmp_1</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>45</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>45</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>141</item> <item>142</item> <item>143</item> </oprand_edges> <opcode>bitconcatenate</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>10</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_14"> <Value> <Obj> <type>0</type> <id>23</id> <name>p_shl_cast</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>47</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>47</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>144</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>11</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_15"> <Value> <Obj> <type>0</type> <id>24</id> <name>tmp_4</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>47</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>47</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>145</item> <item>146</item> </oprand_edges> <opcode>sub</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.96</m_delay> <m_topoIndex>12</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_16"> <Value> <Obj> <type>0</type> <id>25</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>46</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>46</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>147</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.83</m_delay> <m_topoIndex>13</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_17"> <Value> <Obj> <type>0</type> <id>27</id> <name>c</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>c</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>148</item> <item>149</item> <item>150</item> <item>151</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="_18"> <Value> <Obj> <type>0</type> <id>28</id> <name>tmp_3</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>46</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>46</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>152</item> <item>153</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.47</m_delay> <m_topoIndex>16</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_19"> <Value> <Obj> <type>0</type> <id>30</id> <name>c_1</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>46</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>46</second> </item> </second> </item> </inlineStackInfo> <originalName>c</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>154</item> <item>155</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>0.80</m_delay> <m_topoIndex>17</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_20"> <Value> <Obj> <type>0</type> <id>31</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>46</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>46</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>156</item> <item>157</item> <item>158</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="_21"> <Value> <Obj> <type>0</type> <id>34</id> <name>tmp_6_cast</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>47</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>47</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>159</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>19</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>tmp_11</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>47</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>47</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>160</item> <item>161</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.04</m_delay> <m_topoIndex>20</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>tmp_18_cast</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>47</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>47</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>162</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>21</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>A_addr</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>47</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>47</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>163</item> <item>165</item> <item>166</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>22</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_25"> <Value> <Obj> <type>0</type> <id>38</id> <name>a_i_addr</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>47</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>47</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>167</item> <item>168</item> <item>169</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>25</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_26"> <Value> <Obj> <type>0</type> <id>39</id> <name>A_load</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>47</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>47</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>170</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.09</m_delay> <m_topoIndex>23</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_27"> <Value> <Obj> <type>0</type> <id>40</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>47</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>47</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>171</item> <item>172</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.09</m_delay> <m_topoIndex>26</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_28"> <Value> <Obj> <type>0</type> <id>41</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>46</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>46</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>173</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="_29"> <Value> <Obj> <type>0</type> <id>44</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>45</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>45</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>174</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>24</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_30"> <Value> <Obj> <type>0</type> <id>46</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>50</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>138</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.83</m_delay> <m_topoIndex>14</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_31"> <Value> <Obj> <type>0</type> <id>48</id> <name>r1</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>r</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>175</item> <item>176</item> <item>177</item> <item>178</item> </oprand_edges> <opcode>phi</opcode> <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="_32"> <Value> <Obj> <type>0</type> <id>49</id> <name>tmp_2</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>50</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>179</item> <item>180</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.47</m_delay> <m_topoIndex>29</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_33"> <Value> <Obj> <type>0</type> <id>51</id> <name>r_2</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>50</second> </item> </second> </item> </inlineStackInfo> <originalName>r</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>181</item> <item>182</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>0.80</m_delay> <m_topoIndex>30</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_34"> <Value> <Obj> <type>0</type> <id>52</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>50</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>183</item> <item>184</item> <item>185</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>31</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_35"> <Value> <Obj> <type>0</type> <id>56</id> <name>tmp_4_cast</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>50</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>186</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>32</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_36"> <Value> <Obj> <type>0</type> <id>57</id> <name>tmp_6</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>50</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>187</item> <item>188</item> <item>189</item> </oprand_edges> <opcode>bitconcatenate</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>33</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_37"> <Value> <Obj> <type>0</type> <id>58</id> <name>p_shl1_cast</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>52</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>52</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>190</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>34</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_38"> <Value> <Obj> <type>0</type> <id>59</id> <name>tmp_10</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>52</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>52</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>191</item> <item>192</item> </oprand_edges> <opcode>sub</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.96</m_delay> <m_topoIndex>35</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_39"> <Value> <Obj> <type>0</type> <id>60</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>51</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>51</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>193</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.83</m_delay> <m_topoIndex>36</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_40"> <Value> <Obj> <type>0</type> <id>62</id> <name>c2</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>c</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>194</item> <item>195</item> <item>196</item> <item>197</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>38</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_41"> <Value> <Obj> <type>0</type> <id>63</id> <name>tmp_9</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>51</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>51</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>198</item> <item>199</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.47</m_delay> <m_topoIndex>39</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_42"> <Value> <Obj> <type>0</type> <id>65</id> <name>c_2</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>51</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>51</second> </item> </second> </item> </inlineStackInfo> <originalName>c</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>200</item> <item>201</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>0.80</m_delay> <m_topoIndex>40</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_43"> <Value> <Obj> <type>0</type> <id>66</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>51</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>51</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>202</item> <item>203</item> <item>204</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>41</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_44"> <Value> <Obj> <type>0</type> <id>69</id> <name>tmp_5_cast</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>52</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>52</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>205</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>42</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_45"> <Value> <Obj> <type>0</type> <id>70</id> <name>tmp_15</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>52</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>52</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>206</item> <item>207</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.04</m_delay> <m_topoIndex>43</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_46"> <Value> <Obj> <type>0</type> <id>71</id> <name>tmp_21_cast</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>52</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>52</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>208</item> </oprand_edges> <opcode>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>44</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_47"> <Value> <Obj> <type>0</type> <id>72</id> <name>B_addr</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>52</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>52</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>209</item> <item>210</item> <item>211</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>45</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_48"> <Value> <Obj> <type>0</type> <id>73</id> <name>b_i_addr</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>52</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>52</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>212</item> <item>213</item> <item>214</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>48</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_49"> <Value> <Obj> <type>0</type> <id>74</id> <name>B_load</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>52</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>52</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>215</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.09</m_delay> <m_topoIndex>46</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_50"> <Value> <Obj> <type>0</type> <id>75</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>52</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>52</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>216</item> <item>217</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.09</m_delay> <m_topoIndex>49</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_51"> <Value> <Obj> <type>0</type> <id>76</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>51</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>51</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>218</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>50</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_52"> <Value> <Obj> <type>0</type> <id>79</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>50</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>219</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>47</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_53"> <Value> <Obj> <type>0</type> <id>81</id> <name></name> <fileName>D:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/linear_algebra/hls_matrix_multiply.h</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>511</lineNumber> <contextFuncName>matrix_multiply_top&amp;lt;hls::NoTranspose, hls::NoTranspose, 3, 3, 3, 3, 3, 3, hls::matrix_multiply_traits&amp;lt;hls::NoTranspose, hls::NoTranspose, 3, 3, 3, 3, float, float&amp;gt;, float, float&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>3</count> <item_version>0</item_version> <item> <first> <first>D:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/linear_algebra/hls_matrix_multiply.h</first> <second>matrix_multiply&amp;lt;hls::NoTranspose, hls::NoTranspose, 3, 3, 3, 3, 3, 3, float, float&amp;gt;</second> </first> <second>560</second> </item> <item> <first> <first>D:/Xilinx/Vivado/2018.3/common/technology/autopilot/hls/linear_algebra/hls_matrix_multiply.h</first> <second>matrix_multiply_top&amp;lt;hls::NoTranspose, hls::NoTranspose, 3, 3, 3, 3, 3, 3, hls::matrix_multiply_traits&amp;lt;hls::NoTranspose, hls::NoTranspose, 3, 3, 3, 3, float, float&amp;gt;, float, float&amp;gt;</second> </first> <second>511</second> </item> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>57</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>221</item> <item>222</item> <item>223</item> <item>224</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>37</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_54"> <Value> <Obj> <type>0</type> <id>82</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>60</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>60</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>225</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.83</m_delay> <m_topoIndex>51</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_55"> <Value> <Obj> <type>0</type> <id>84</id> <name>r3</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>r</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>226</item> <item>227</item> <item>228</item> <item>229</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>52</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_56"> <Value> <Obj> <type>0</type> <id>85</id> <name>tmp_8</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>60</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>60</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>230</item> <item>231</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.47</m_delay> <m_topoIndex>53</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_57"> <Value> <Obj> <type>0</type> <id>87</id> <name>r_3</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>60</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>60</second> </item> </second> </item> </inlineStackInfo> <originalName>r</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>232</item> <item>233</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>0.80</m_delay> <m_topoIndex>54</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_58"> <Value> <Obj> <type>0</type> <id>88</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>60</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>60</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>234</item> <item>235</item> <item>236</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>55</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_59"> <Value> <Obj> <type>0</type> <id>92</id> <name>tmp_cast</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>60</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>60</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>237</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>56</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_60"> <Value> <Obj> <type>0</type> <id>93</id> <name>tmp_13</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>60</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>60</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>238</item> <item>239</item> <item>240</item> </oprand_edges> <opcode>bitconcatenate</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>57</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_61"> <Value> <Obj> <type>0</type> <id>94</id> <name>p_shl2_cast</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>62</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>62</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>241</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>58</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_62"> <Value> <Obj> <type>0</type> <id>95</id> <name>tmp_14</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>62</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>62</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>242</item> <item>243</item> </oprand_edges> <opcode>sub</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.96</m_delay> <m_topoIndex>59</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_63"> <Value> <Obj> <type>0</type> <id>96</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>61</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>61</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>244</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.83</m_delay> <m_topoIndex>60</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_64"> <Value> <Obj> <type>0</type> <id>98</id> <name>c4</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>c</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>245</item> <item>246</item> <item>247</item> <item>248</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>62</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_65"> <Value> <Obj> <type>0</type> <id>99</id> <name>tmp_7</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>61</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>61</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>249</item> <item>250</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.47</m_delay> <m_topoIndex>63</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_66"> <Value> <Obj> <type>0</type> <id>101</id> <name>c_3</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>61</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>61</second> </item> </second> </item> </inlineStackInfo> <originalName>c</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>251</item> <item>252</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>0.80</m_delay> <m_topoIndex>64</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_67"> <Value> <Obj> <type>0</type> <id>102</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>61</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>61</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>253</item> <item>254</item> <item>255</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>65</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_68"> <Value> <Obj> <type>0</type> <id>105</id> <name>tmp_10_cast</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>62</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>62</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>256</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>66</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_69"> <Value> <Obj> <type>0</type> <id>106</id> <name>tmp_16</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>62</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>62</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>257</item> <item>258</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.04</m_delay> <m_topoIndex>67</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_70"> <Value> <Obj> <type>0</type> <id>107</id> <name>tmp_22_cast</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>62</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>62</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>259</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>68</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_71"> <Value> <Obj> <type>0</type> <id>108</id> <name>C_addr</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>62</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>62</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>260</item> <item>261</item> <item>262</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>72</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_72"> <Value> <Obj> <type>0</type> <id>109</id> <name>C_assign_addr</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>62</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>62</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>263</item> <item>264</item> <item>265</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>69</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_73"> <Value> <Obj> <type>0</type> <id>110</id> <name>C_assign_load</name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>62</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>62</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>266</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.09</m_delay> <m_topoIndex>70</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_74"> <Value> <Obj> <type>0</type> <id>111</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>62</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>62</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>267</item> <item>268</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.09</m_delay> <m_topoIndex>73</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_75"> <Value> <Obj> <type>0</type> <id>112</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>61</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>61</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>269</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>74</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_76"> <Value> <Obj> <type>0</type> <id>115</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>60</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>60</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>270</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>71</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_77"> <Value> <Obj> <type>0</type> <id>117</id> <name></name> <fileName>matrix_multiply.cpp</fileName> <fileDirectory>D:\Gabriel\Documents\Xilinx\matrix_multiply</fileDirectory> <lineNumber>66</lineNumber> <contextFuncName>matrix_multiply_top</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Gabriel\Documents\Xilinx\matrix_multiply</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>matrix_multiply.cpp</first> <second>matrix_multiply_top</second> </first> <second>66</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>0</count> <item_version>0</item_version> </oprand_edges> <opcode>ret</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>61</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>6</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_78"> <Value> <Obj> <type>2</type> <id>119</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_79"> <Value> <Obj> <type>2</type> <id>124</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_80"> <Value> <Obj> <type>2</type> <id>130</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <const_type>0</const_type> <content>3</content> </item> <item class_id_reference="16" object_id="_81"> <Value> <Obj> <type>2</type> <id>133</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_82"> <Value> <Obj> <type>2</type> <id>164</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="_83"> <Value> <Obj> <type>2</type> <id>220</id> <name>matrix_multiply_alt2</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <const_type>6</const_type> <content>&lt;constant:matrix_multiply_alt2&gt;</content> </item> </consts> <blocks class_id="17" tracking_level="0" version="0"> <count>19</count> <item_version>0</item_version> <item class_id="18" tracking_level="1" version="0" object_id="_84"> <Obj> <type>3</type> <id>12</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>4</count> <item_version>0</item_version> <item>8</item> <item>9</item> <item>10</item> <item>11</item> </node_objs> </item> <item class_id_reference="18" object_id="_85"> <Obj> <type>3</type> <id>18</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>4</count> <item_version>0</item_version> <item>13</item> <item>14</item> <item>16</item> <item>17</item> </node_objs> </item> <item class_id_reference="18" object_id="_86"> <Obj> <type>3</type> <id>26</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>21</item> <item>22</item> <item>23</item> <item>24</item> <item>25</item> </node_objs> </item> <item class_id_reference="18" object_id="_87"> <Obj> <type>3</type> <id>32</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>4</count> <item_version>0</item_version> <item>27</item> <item>28</item> <item>30</item> <item>31</item> </node_objs> </item> <item class_id_reference="18" object_id="_88"> <Obj> <type>3</type> <id>42</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>8</count> <item_version>0</item_version> <item>34</item> <item>35</item> <item>36</item> <item>37</item> <item>38</item> <item>39</item> <item>40</item> <item>41</item> </node_objs> </item> <item class_id_reference="18" object_id="_89"> <Obj> <type>3</type> <id>45</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>1</count> <item_version>0</item_version> <item>44</item> </node_objs> </item> <item class_id_reference="18" object_id="_90"> <Obj> <type>3</type> <id>47</id> <name>.preheader.preheader</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>1</count> <item_version>0</item_version> <item>46</item> </node_objs> </item> <item class_id_reference="18" object_id="_91"> <Obj> <type>3</type> <id>53</id> <name>.preheader</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>4</count> <item_version>0</item_version> <item>48</item> <item>49</item> <item>51</item> <item>52</item> </node_objs> </item> <item class_id_reference="18" object_id="_92"> <Obj> <type>3</type> <id>61</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>5</count> <item_version>0</item_version> <item>56</item> <item>57</item> <item>58</item> <item>59</item> <item>60</item> </node_objs> </item> <item class_id_reference="18" object_id="_93"> <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>4</count> <item_version>0</item_version> <item>62</item> <item>63</item> <item>65</item> <item>66</item> </node_objs> </item> <item class_id_reference="18" object_id="_94"> <Obj> <type>3</type> <id>77</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>8</count> <item_version>0</item_version> <item>69</item> <item>70</item> <item>71</item> <item>72</item> <item>73</item> <item>74</item> <item>75</item> <item>76</item> </node_objs> </item> <item class_id_reference="18" object_id="_95"> <Obj> <type>3</type> <id>80</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>1</count> <item_version>0</item_version> <item>79</item> </node_objs> </item> <item class_id_reference="18" object_id="_96"> <Obj> <type>3</type> <id>83</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>81</item> <item>82</item> </node_objs> </item> <item class_id_reference="18" object_id="_97"> <Obj> <type>3</type> <id>89</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>4</count> <item_version>0</item_version> <item>84</item> <item>85</item> <item>87</item> <item>88</item> </node_objs> </item> <item class_id_reference="18" object_id="_98"> <Obj> <type>3</type> <id>97</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>92</item> <item>93</item> <item>94</item> <item>95</item> <item>96</item> </node_objs> </item> <item class_id_reference="18" object_id="_99"> <Obj> <type>3</type> <id>103</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>4</count> <item_version>0</item_version> <item>98</item> <item>99</item> <item>101</item> <item>102</item> </node_objs> </item> <item class_id_reference="18" object_id="_100"> <Obj> <type>3</type> <id>113</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>8</count> <item_version>0</item_version> <item>105</item> <item>106</item> <item>107</item> <item>108</item> <item>109</item> <item>110</item> <item>111</item> <item>112</item> </node_objs> </item> <item class_id_reference="18" object_id="_101"> <Obj> <type>3</type> <id>116</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>1</count> <item_version>0</item_version> <item>115</item> </node_objs> </item> <item class_id_reference="18" object_id="_102"> <Obj> <type>3</type> <id>118</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>1</count> <item_version>0</item_version> <item>117</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>166</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_103"> <id>120</id> <edge_type>1</edge_type> <source_obj>119</source_obj> <sink_obj>8</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_104"> <id>121</id> <edge_type>1</edge_type> <source_obj>119</source_obj> <sink_obj>9</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_105"> <id>122</id> <edge_type>1</edge_type> <source_obj>119</source_obj> <sink_obj>10</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_106"> <id>123</id> <edge_type>2</edge_type> <source_obj>18</source_obj> <sink_obj>11</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_107"> <id>125</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>13</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_108"> <id>126</id> <edge_type>2</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="_109"> <id>127</id> <edge_type>1</edge_type> <source_obj>16</source_obj> <sink_obj>13</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_110"> <id>128</id> <edge_type>2</edge_type> <source_obj>45</source_obj> <sink_obj>13</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_111"> <id>129</id> <edge_type>1</edge_type> <source_obj>13</source_obj> <sink_obj>14</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_112"> <id>131</id> <edge_type>1</edge_type> <source_obj>130</source_obj> <sink_obj>14</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_113"> <id>132</id> <edge_type>1</edge_type> <source_obj>13</source_obj> <sink_obj>16</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_114"> <id>134</id> <edge_type>1</edge_type> <source_obj>133</source_obj> <sink_obj>16</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_115"> <id>135</id> <edge_type>1</edge_type> <source_obj>14</source_obj> <sink_obj>17</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_116"> <id>136</id> <edge_type>2</edge_type> <source_obj>26</source_obj> <sink_obj>17</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_117"> <id>137</id> <edge_type>2</edge_type> <source_obj>47</source_obj> <sink_obj>17</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_118"> <id>138</id> <edge_type>2</edge_type> <source_obj>53</source_obj> <sink_obj>46</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_119"> <id>139</id> <edge_type>1</edge_type> <source_obj>13</source_obj> <sink_obj>21</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_120"> <id>142</id> <edge_type>1</edge_type> <source_obj>13</source_obj> <sink_obj>22</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_121"> <id>143</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>22</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_122"> <id>144</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="_123"> <id>145</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="_124"> <id>146</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>24</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_125"> <id>147</id> <edge_type>2</edge_type> <source_obj>32</source_obj> <sink_obj>25</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_126"> <id>148</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>27</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_127"> <id>149</id> <edge_type>2</edge_type> <source_obj>26</source_obj> <sink_obj>27</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_128"> <id>150</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>27</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_129"> <id>151</id> <edge_type>2</edge_type> <source_obj>42</source_obj> <sink_obj>27</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_130"> <id>152</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>28</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_131"> <id>153</id> <edge_type>1</edge_type> <source_obj>130</source_obj> <sink_obj>28</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_132"> <id>154</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>30</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_133"> <id>155</id> <edge_type>1</edge_type> <source_obj>133</source_obj> <sink_obj>30</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_134"> <id>156</id> <edge_type>1</edge_type> <source_obj>28</source_obj> <sink_obj>31</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_135"> <id>157</id> <edge_type>2</edge_type> <source_obj>42</source_obj> <sink_obj>31</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_136"> <id>158</id> <edge_type>2</edge_type> <source_obj>45</source_obj> <sink_obj>31</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_137"> <id>159</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>34</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_138"> <id>160</id> <edge_type>1</edge_type> <source_obj>24</source_obj> <sink_obj>35</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_139"> <id>161</id> <edge_type>1</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="_140"> <id>162</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="_141"> <id>163</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>37</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_142"> <id>165</id> <edge_type>1</edge_type> <source_obj>164</source_obj> <sink_obj>37</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_143"> <id>166</id> <edge_type>1</edge_type> <source_obj>36</source_obj> <sink_obj>37</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_144"> <id>167</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>38</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_145"> <id>168</id> <edge_type>1</edge_type> <source_obj>164</source_obj> <sink_obj>38</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_146"> <id>169</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="_147"> <id>170</id> <edge_type>1</edge_type> <source_obj>37</source_obj> <sink_obj>39</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_148"> <id>171</id> <edge_type>1</edge_type> <source_obj>39</source_obj> <sink_obj>40</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_149"> <id>172</id> <edge_type>1</edge_type> <source_obj>38</source_obj> <sink_obj>40</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_150"> <id>173</id> <edge_type>2</edge_type> <source_obj>32</source_obj> <sink_obj>41</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_151"> <id>174</id> <edge_type>2</edge_type> <source_obj>18</source_obj> <sink_obj>44</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_152"> <id>175</id> <edge_type>1</edge_type> <source_obj>51</source_obj> <sink_obj>48</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_153"> <id>176</id> <edge_type>2</edge_type> <source_obj>80</source_obj> <sink_obj>48</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_154"> <id>177</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>48</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_155"> <id>178</id> <edge_type>2</edge_type> <source_obj>47</source_obj> <sink_obj>48</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_156"> <id>179</id> <edge_type>1</edge_type> <source_obj>48</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_157"> <id>180</id> <edge_type>1</edge_type> <source_obj>130</source_obj> <sink_obj>49</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_158"> <id>181</id> <edge_type>1</edge_type> <source_obj>48</source_obj> <sink_obj>51</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_159"> <id>182</id> <edge_type>1</edge_type> <source_obj>133</source_obj> <sink_obj>51</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_160"> <id>183</id> <edge_type>1</edge_type> <source_obj>49</source_obj> <sink_obj>52</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_161"> <id>184</id> <edge_type>2</edge_type> <source_obj>61</source_obj> <sink_obj>52</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_162"> <id>185</id> <edge_type>2</edge_type> <source_obj>83</source_obj> <sink_obj>52</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_163"> <id>186</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="_164"> <id>188</id> <edge_type>1</edge_type> <source_obj>48</source_obj> <sink_obj>57</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_165"> <id>189</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>57</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_166"> <id>190</id> <edge_type>1</edge_type> <source_obj>57</source_obj> <sink_obj>58</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_167"> <id>191</id> <edge_type>1</edge_type> <source_obj>58</source_obj> <sink_obj>59</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_168"> <id>192</id> <edge_type>1</edge_type> <source_obj>56</source_obj> <sink_obj>59</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_169"> <id>193</id> <edge_type>2</edge_type> <source_obj>67</source_obj> <sink_obj>60</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_170"> <id>194</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>62</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_171"> <id>195</id> <edge_type>2</edge_type> <source_obj>61</source_obj> <sink_obj>62</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_172"> <id>196</id> <edge_type>1</edge_type> <source_obj>65</source_obj> <sink_obj>62</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_173"> <id>197</id> <edge_type>2</edge_type> <source_obj>77</source_obj> <sink_obj>62</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_174"> <id>198</id> <edge_type>1</edge_type> <source_obj>62</source_obj> <sink_obj>63</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_175"> <id>199</id> <edge_type>1</edge_type> <source_obj>130</source_obj> <sink_obj>63</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_176"> <id>200</id> <edge_type>1</edge_type> <source_obj>62</source_obj> <sink_obj>65</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_177"> <id>201</id> <edge_type>1</edge_type> <source_obj>133</source_obj> <sink_obj>65</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_178"> <id>202</id> <edge_type>1</edge_type> <source_obj>63</source_obj> <sink_obj>66</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_179"> <id>203</id> <edge_type>2</edge_type> <source_obj>77</source_obj> <sink_obj>66</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_180"> <id>204</id> <edge_type>2</edge_type> <source_obj>80</source_obj> <sink_obj>66</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_181"> <id>205</id> <edge_type>1</edge_type> <source_obj>62</source_obj> <sink_obj>69</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_182"> <id>206</id> <edge_type>1</edge_type> <source_obj>59</source_obj> <sink_obj>70</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_183"> <id>207</id> <edge_type>1</edge_type> <source_obj>69</source_obj> <sink_obj>70</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_184"> <id>208</id> <edge_type>1</edge_type> <source_obj>70</source_obj> <sink_obj>71</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_185"> <id>209</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>72</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_186"> <id>210</id> <edge_type>1</edge_type> <source_obj>164</source_obj> <sink_obj>72</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_187"> <id>211</id> <edge_type>1</edge_type> <source_obj>71</source_obj> <sink_obj>72</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_188"> <id>212</id> <edge_type>1</edge_type> <source_obj>9</source_obj> <sink_obj>73</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_189"> <id>213</id> <edge_type>1</edge_type> <source_obj>164</source_obj> <sink_obj>73</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_190"> <id>214</id> <edge_type>1</edge_type> <source_obj>71</source_obj> <sink_obj>73</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_191"> <id>215</id> <edge_type>1</edge_type> <source_obj>72</source_obj> <sink_obj>74</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_192"> <id>216</id> <edge_type>1</edge_type> <source_obj>74</source_obj> <sink_obj>75</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_193"> <id>217</id> <edge_type>1</edge_type> <source_obj>73</source_obj> <sink_obj>75</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_194"> <id>218</id> <edge_type>2</edge_type> <source_obj>67</source_obj> <sink_obj>76</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_195"> <id>219</id> <edge_type>2</edge_type> <source_obj>53</source_obj> <sink_obj>79</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_196"> <id>221</id> <edge_type>1</edge_type> <source_obj>220</source_obj> <sink_obj>81</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_197"> <id>222</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>81</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_198"> <id>223</id> <edge_type>1</edge_type> <source_obj>9</source_obj> <sink_obj>81</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_199"> <id>224</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>81</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_200"> <id>225</id> <edge_type>2</edge_type> <source_obj>89</source_obj> <sink_obj>82</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_201"> <id>226</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>84</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_202"> <id>227</id> <edge_type>2</edge_type> <source_obj>83</source_obj> <sink_obj>84</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_203"> <id>228</id> <edge_type>1</edge_type> <source_obj>87</source_obj> <sink_obj>84</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_204"> <id>229</id> <edge_type>2</edge_type> <source_obj>116</source_obj> <sink_obj>84</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_205"> <id>230</id> <edge_type>1</edge_type> <source_obj>84</source_obj> <sink_obj>85</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_206"> <id>231</id> <edge_type>1</edge_type> <source_obj>130</source_obj> <sink_obj>85</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_207"> <id>232</id> <edge_type>1</edge_type> <source_obj>84</source_obj> <sink_obj>87</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_208"> <id>233</id> <edge_type>1</edge_type> <source_obj>133</source_obj> <sink_obj>87</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_209"> <id>234</id> <edge_type>1</edge_type> <source_obj>85</source_obj> <sink_obj>88</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_210"> <id>235</id> <edge_type>2</edge_type> <source_obj>97</source_obj> <sink_obj>88</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_211"> <id>236</id> <edge_type>2</edge_type> <source_obj>118</source_obj> <sink_obj>88</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_212"> <id>237</id> <edge_type>1</edge_type> <source_obj>84</source_obj> <sink_obj>92</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_213"> <id>239</id> <edge_type>1</edge_type> <source_obj>84</source_obj> <sink_obj>93</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_214"> <id>240</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>93</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_215"> <id>241</id> <edge_type>1</edge_type> <source_obj>93</source_obj> <sink_obj>94</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_216"> <id>242</id> <edge_type>1</edge_type> <source_obj>94</source_obj> <sink_obj>95</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_217"> <id>243</id> <edge_type>1</edge_type> <source_obj>92</source_obj> <sink_obj>95</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_218"> <id>244</id> <edge_type>2</edge_type> <source_obj>103</source_obj> <sink_obj>96</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_219"> <id>245</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>98</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_220"> <id>246</id> <edge_type>2</edge_type> <source_obj>97</source_obj> <sink_obj>98</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_221"> <id>247</id> <edge_type>1</edge_type> <source_obj>101</source_obj> <sink_obj>98</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_222"> <id>248</id> <edge_type>2</edge_type> <source_obj>113</source_obj> <sink_obj>98</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_223"> <id>249</id> <edge_type>1</edge_type> <source_obj>98</source_obj> <sink_obj>99</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_224"> <id>250</id> <edge_type>1</edge_type> <source_obj>130</source_obj> <sink_obj>99</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_225"> <id>251</id> <edge_type>1</edge_type> <source_obj>98</source_obj> <sink_obj>101</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_226"> <id>252</id> <edge_type>1</edge_type> <source_obj>133</source_obj> <sink_obj>101</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_227"> <id>253</id> <edge_type>1</edge_type> <source_obj>99</source_obj> <sink_obj>102</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_228"> <id>254</id> <edge_type>2</edge_type> <source_obj>113</source_obj> <sink_obj>102</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_229"> <id>255</id> <edge_type>2</edge_type> <source_obj>116</source_obj> <sink_obj>102</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_230"> <id>256</id> <edge_type>1</edge_type> <source_obj>98</source_obj> <sink_obj>105</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_231"> <id>257</id> <edge_type>1</edge_type> <source_obj>95</source_obj> <sink_obj>106</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_232"> <id>258</id> <edge_type>1</edge_type> <source_obj>105</source_obj> <sink_obj>106</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_233"> <id>259</id> <edge_type>1</edge_type> <source_obj>106</source_obj> <sink_obj>107</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_234"> <id>260</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>108</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_235"> <id>261</id> <edge_type>1</edge_type> <source_obj>164</source_obj> <sink_obj>108</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_236"> <id>262</id> <edge_type>1</edge_type> <source_obj>107</source_obj> <sink_obj>108</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_237"> <id>263</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>109</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_238"> <id>264</id> <edge_type>1</edge_type> <source_obj>164</source_obj> <sink_obj>109</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_239"> <id>265</id> <edge_type>1</edge_type> <source_obj>107</source_obj> <sink_obj>109</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_240"> <id>266</id> <edge_type>1</edge_type> <source_obj>109</source_obj> <sink_obj>110</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_241"> <id>267</id> <edge_type>1</edge_type> <source_obj>110</source_obj> <sink_obj>111</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_242"> <id>268</id> <edge_type>1</edge_type> <source_obj>108</source_obj> <sink_obj>111</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_243"> <id>269</id> <edge_type>2</edge_type> <source_obj>103</source_obj> <sink_obj>112</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_244"> <id>270</id> <edge_type>2</edge_type> <source_obj>89</source_obj> <sink_obj>115</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_245"> <id>344</id> <edge_type>2</edge_type> <source_obj>12</source_obj> <sink_obj>18</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_246"> <id>345</id> <edge_type>2</edge_type> <source_obj>18</source_obj> <sink_obj>47</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_247"> <id>346</id> <edge_type>2</edge_type> <source_obj>18</source_obj> <sink_obj>26</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_248"> <id>347</id> <edge_type>2</edge_type> <source_obj>26</source_obj> <sink_obj>32</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_249"> <id>348</id> <edge_type>2</edge_type> <source_obj>32</source_obj> <sink_obj>45</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_250"> <id>349</id> <edge_type>2</edge_type> <source_obj>32</source_obj> <sink_obj>42</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_251"> <id>350</id> <edge_type>2</edge_type> <source_obj>42</source_obj> <sink_obj>32</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_252"> <id>351</id> <edge_type>2</edge_type> <source_obj>45</source_obj> <sink_obj>18</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_253"> <id>352</id> <edge_type>2</edge_type> <source_obj>47</source_obj> <sink_obj>53</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_254"> <id>353</id> <edge_type>2</edge_type> <source_obj>53</source_obj> <sink_obj>83</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_255"> <id>354</id> <edge_type>2</edge_type> <source_obj>53</source_obj> <sink_obj>61</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_256"> <id>355</id> <edge_type>2</edge_type> <source_obj>61</source_obj> <sink_obj>67</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_257"> <id>356</id> <edge_type>2</edge_type> <source_obj>67</source_obj> <sink_obj>80</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_258"> <id>357</id> <edge_type>2</edge_type> <source_obj>67</source_obj> <sink_obj>77</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_259"> <id>358</id> <edge_type>2</edge_type> <source_obj>77</source_obj> <sink_obj>67</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_260"> <id>359</id> <edge_type>2</edge_type> <source_obj>80</source_obj> <sink_obj>53</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_261"> <id>360</id> <edge_type>2</edge_type> <source_obj>83</source_obj> <sink_obj>89</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_262"> <id>361</id> <edge_type>2</edge_type> <source_obj>89</source_obj> <sink_obj>118</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_263"> <id>362</id> <edge_type>2</edge_type> <source_obj>89</source_obj> <sink_obj>97</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_264"> <id>363</id> <edge_type>2</edge_type> <source_obj>97</source_obj> <sink_obj>103</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_265"> <id>364</id> <edge_type>2</edge_type> <source_obj>103</source_obj> <sink_obj>116</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_266"> <id>365</id> <edge_type>2</edge_type> <source_obj>103</source_obj> <sink_obj>113</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_267"> <id>366</id> <edge_type>2</edge_type> <source_obj>113</source_obj> <sink_obj>103</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_268"> <id>367</id> <edge_type>2</edge_type> <source_obj>116</source_obj> <sink_obj>89</sink_obj> <is_back_edge>1</is_back_edge> </item> </edges> </cdfg> <cdfg_regions class_id="21" tracking_level="0" version="0"> <count>17</count> <item_version>0</item_version> <item class_id="22" tracking_level="1" version="0" object_id="_269"> <mId>1</mId> <mTag>matrix_multiply_top</mTag> <mType>0</mType> <sub_regions> <count>7</count> <item_version>0</item_version> <item>2</item> <item>3</item> <item>7</item> <item>8</item> <item>12</item> <item>13</item> <item>17</item> </sub_regions> <basic_blocks> <count>0</count> <item_version>0</item_version> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>120</mMinLatency> <mMaxLatency>120</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_270"> <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>12</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>0</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_271"> <mId>3</mId> <mTag>a_row_loop</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>3</mMinTripCount> <mMaxTripCount>3</mMaxTripCount> <mMinLatency>24</mMinLatency> <mMaxLatency>24</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_272"> <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>18</item> <item>26</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>0</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_273"> <mId>5</mId> <mTag>a_col_loop</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>32</item> <item>42</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>3</mMinTripCount> <mMaxTripCount>3</mMaxTripCount> <mMinLatency>6</mMinLatency> <mMaxLatency>6</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_274"> <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>45</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>0</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_275"> <mId>7</mId> <mTag>Region 3</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>47</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>0</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_276"> <mId>8</mId> <mTag>b_row_loop</mTag> <mType>1</mType> <sub_regions> <count>3</count> <item_version>0</item_version> <item>9</item> <item>10</item> <item>11</item> </sub_regions> <basic_blocks> <count>0</count> <item_version>0</item_version> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>3</mMinTripCount> <mMaxTripCount>3</mMaxTripCount> <mMinLatency>24</mMinLatency> <mMaxLatency>24</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_277"> <mId>9</mId> <mTag>Region 4</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>53</item> <item>61</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>0</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_278"> <mId>10</mId> <mTag>b_col_loop</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>67</item> <item>77</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>3</mMinTripCount> <mMaxTripCount>3</mMaxTripCount> <mMinLatency>6</mMinLatency> <mMaxLatency>6</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_279"> <mId>11</mId> <mTag>Region 5</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>80</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>0</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_280"> <mId>12</mId> <mTag>Region 6</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>83</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>45</mMinLatency> <mMaxLatency>45</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_281"> <mId>13</mId> <mTag>c_row_loop</mTag> <mType>1</mType> <sub_regions> <count>3</count> <item_version>0</item_version> <item>14</item> <item>15</item> <item>16</item> </sub_regions> <basic_blocks> <count>0</count> <item_version>0</item_version> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>3</mMinTripCount> <mMaxTripCount>3</mMaxTripCount> <mMinLatency>24</mMinLatency> <mMaxLatency>24</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_282"> <mId>14</mId> <mTag>Region 7</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>89</item> <item>97</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>0</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_283"> <mId>15</mId> <mTag>c_col_loop</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>103</item> <item>113</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>3</mMinTripCount> <mMaxTripCount>3</mMaxTripCount> <mMinLatency>6</mMinLatency> <mMaxLatency>6</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_284"> <mId>16</mId> <mTag>Region 8</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>116</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>0</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_285"> <mId>17</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>118</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="_286"> <states class_id="25" tracking_level="0" version="0"> <count>11</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_287"> <id>1</id> <operations class_id="27" tracking_level="0" version="0"> <count>8</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_288"> <id>4</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_289"> <id>5</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_290"> <id>6</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_291"> <id>7</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_292"> <id>8</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_293"> <id>9</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_294"> <id>10</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_295"> <id>11</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_296"> <id>2</id> <operations> <count>13</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_297"> <id>13</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_298"> <id>14</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_299"> <id>15</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_300"> <id>16</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_301"> <id>17</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_302"> <id>19</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_303"> <id>20</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_304"> <id>21</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_305"> <id>22</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_306"> <id>23</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_307"> <id>24</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_308"> <id>25</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_309"> <id>46</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_310"> <id>3</id> <operations> <count>12</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_311"> <id>27</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_312"> <id>28</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_313"> <id>29</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_314"> <id>30</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_315"> <id>31</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_316"> <id>34</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_317"> <id>35</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_318"> <id>36</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_319"> <id>37</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_320"> <id>39</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_321"> <id>43</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_322"> <id>44</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_323"> <id>4</id> <operations> <count>5</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_324"> <id>33</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_325"> <id>38</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_326"> <id>39</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_327"> <id>40</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_328"> <id>41</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_329"> <id>5</id> <operations> <count>13</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_330"> <id>48</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_331"> <id>49</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_332"> <id>50</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_333"> <id>51</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_334"> <id>52</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_335"> <id>54</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_336"> <id>55</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_337"> <id>56</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_338"> <id>57</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_339"> <id>58</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_340"> <id>59</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_341"> <id>60</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_342"> <id>81</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_343"> <id>6</id> <operations> <count>12</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_344"> <id>62</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_345"> <id>63</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_346"> <id>64</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_347"> <id>65</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_348"> <id>66</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_349"> <id>69</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_350"> <id>70</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_351"> <id>71</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_352"> <id>72</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_353"> <id>74</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_354"> <id>78</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_355"> <id>79</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_356"> <id>7</id> <operations> <count>5</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_357"> <id>68</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_358"> <id>73</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_359"> <id>74</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_360"> <id>75</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_361"> <id>76</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_362"> <id>8</id> <operations> <count>2</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_363"> <id>81</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_364"> <id>82</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_365"> <id>9</id> <operations> <count>13</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_366"> <id>84</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_367"> <id>85</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_368"> <id>86</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_369"> <id>87</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_370"> <id>88</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_371"> <id>90</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_372"> <id>91</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_373"> <id>92</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_374"> <id>93</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_375"> <id>94</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_376"> <id>95</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_377"> <id>96</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_378"> <id>117</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_379"> <id>10</id> <operations> <count>12</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_380"> <id>98</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_381"> <id>99</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_382"> <id>100</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_383"> <id>101</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_384"> <id>102</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_385"> <id>105</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_386"> <id>106</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_387"> <id>107</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_388"> <id>109</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_389"> <id>110</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_390"> <id>114</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_391"> <id>115</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_392"> <id>11</id> <operations> <count>5</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_393"> <id>104</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_394"> <id>108</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_395"> <id>110</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_396"> <id>111</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_397"> <id>112</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="29" tracking_level="0" version="0"> <count>16</count> <item_version>0</item_version> <item class_id="30" tracking_level="1" version="0" object_id="_398"> <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="_399"> <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>14</first> <second>0</second> </first> <second>1</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_400"> <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>28</first> <second>0</second> </first> <second>1</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_401"> <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="_402"> <inState>3</inState> <outState>2</outState> <condition> <id>-1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item> <first> <first>28</first> <second>0</second> </first> <second>0</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_403"> <inState>2</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>14</first> <second>0</second> </first> <second>0</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_404"> <inState>5</inState> <outState>8</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>49</first> <second>0</second> </first> <second>0</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_405"> <inState>5</inState> <outState>6</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>49</first> <second>0</second> </first> <second>1</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_406"> <inState>6</inState> <outState>7</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>63</first> <second>0</second> </first> <second>1</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_407"> <inState>7</inState> <outState>6</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="_408"> <inState>6</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>63</first> <second>0</second> </first> <second>0</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_409"> <inState>8</inState> <outState>9</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="_410"> <inState>9</inState> <outState>10</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>85</first> <second>0</second> </first> <second>1</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_411"> <inState>10</inState> <outState>11</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>99</first> <second>0</second> </first> <second>1</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_412"> <inState>11</inState> <outState>10</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="_413"> <inState>10</inState> <outState>9</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>99</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>74</count> <item_version>0</item_version> <item class_id="38" tracking_level="0" version="0"> <first>8</first> <second class_id="39" tracking_level="0" version="0"> <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>13</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>14</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>16</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>17</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>21</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>22</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>23</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>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>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>31</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>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>3</first> <second>0</second> </second> </item> <item> <first>39</first> <second> <first>2</first> <second>1</second> </second> </item> <item> <first>40</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>41</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>44</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>46</first> <second> <first>1</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>51</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>52</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>56</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>57</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>58</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>59</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>60</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>62</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>63</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>65</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>66</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>69</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>70</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>71</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>72</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>73</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>74</first> <second> <first>5</first> <second>1</second> </second> </item> <item> <first>75</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>76</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>79</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>81</first> <second> <first>4</first> <second>1</second> </second> </item> <item> <first>82</first> <second> <first>7</first> <second>0</second> </second> </item> <item> <first>84</first> <second> <first>8</first> <second>0</second> </second> </item> <item> <first>85</first> <second> <first>8</first> <second>0</second> </second> </item> <item> <first>87</first> <second> <first>8</first> <second>0</second> </second> </item> <item> <first>88</first> <second> <first>8</first> <second>0</second> </second> </item> <item> <first>92</first> <second> <first>8</first> <second>0</second> </second> </item> <item> <first>93</first> <second> <first>8</first> <second>0</second> </second> </item> <item> <first>94</first> <second> <first>8</first> <second>0</second> </second> </item> <item> <first>95</first> <second> <first>8</first> <second>0</second> </second> </item> <item> <first>96</first> <second> <first>8</first> <second>0</second> </second> </item> <item> <first>98</first> <second> <first>9</first> <second>0</second> </second> </item> <item> <first>99</first> <second> <first>9</first> <second>0</second> </second> </item> <item> <first>101</first> <second> <first>9</first> <second>0</second> </second> </item> <item> <first>102</first> <second> <first>9</first> <second>0</second> </second> </item> <item> <first>105</first> <second> <first>9</first> <second>0</second> </second> </item> <item> <first>106</first> <second> <first>9</first> <second>0</second> </second> </item> <item> <first>107</first> <second> <first>9</first> <second>0</second> </second> </item> <item> <first>108</first> <second> <first>10</first> <second>0</second> </second> </item> <item> <first>109</first> <second> <first>9</first> <second>0</second> </second> </item> <item> <first>110</first> <second> <first>9</first> <second>1</second> </second> </item> <item> <first>111</first> <second> <first>10</first> <second>0</second> </second> </item> <item> <first>112</first> <second> <first>10</first> <second>0</second> </second> </item> <item> <first>115</first> <second> <first>9</first> <second>0</second> </second> </item> <item> <first>117</first> <second> <first>8</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="40" tracking_level="0" version="0"> <count>19</count> <item_version>0</item_version> <item class_id="41" tracking_level="0" version="0"> <first>12</first> <second class_id="42" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>18</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>26</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>32</first> <second> <first>2</first> <second>2</second> </second> </item> <item> <first>42</first> <second> <first>2</first> <second>3</second> </second> </item> <item> <first>45</first> <second> <first>2</first> <second>2</second> </second> </item> <item> <first>47</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>53</first> <second> <first>2</first> <second>2</second> </second> </item> <item> <first>61</first> <second> <first>2</first> <second>2</second> </second> </item> <item> <first>67</first> <second> <first>3</first> <second>3</second> </second> </item> <item> <first>77</first> <second> <first>3</first> <second>4</second> </second> </item> <item> <first>80</first> <second> <first>3</first> <second>3</second> </second> </item> <item> <first>83</first> <second> <first>2</first> <second>3</second> </second> </item> <item> <first>89</first> <second> <first>4</first> <second>4</second> </second> </item> <item> <first>97</first> <second> <first>4</first> <second>4</second> </second> </item> <item> <first>103</first> <second> <first>5</first> <second>5</second> </second> </item> <item> <first>113</first> <second> <first>5</first> <second>6</second> </second> </item> <item> <first>116</first> <second> <first>5</first> <second>5</second> </second> </item> <item> <first>118</first> <second> <first>4</first> <second>4</second> </second> </item> </bblk_ent_exit> <regions class_id="43" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </regions> <dp_fu_nodes class_id="44" tracking_level="0" version="0"> <count>55</count> <item_version>0</item_version> <item class_id="45" tracking_level="0" version="0"> <first>48</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>52</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> <item> <first>56</first> <second> <count>1</count> <item_version>0</item_version> <item>10</item> </second> </item> <item> <first>60</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>67</first> <second> <count>2</count> <item_version>0</item_version> <item>39</item> <item>39</item> </second> </item> <item> <first>73</first> <second> <count>1</count> <item_version>0</item_version> <item>38</item> </second> </item> <item> <first>79</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>86</first> <second> <count>1</count> <item_version>0</item_version> <item>72</item> </second> </item> <item> <first>93</first> <second> <count>2</count> <item_version>0</item_version> <item>74</item> <item>74</item> </second> </item> <item> <first>99</first> <second> <count>1</count> <item_version>0</item_version> <item>73</item> </second> </item> <item> <first>105</first> <second> <count>1</count> <item_version>0</item_version> <item>75</item> </second> </item> <item> <first>112</first> <second> <count>1</count> <item_version>0</item_version> <item>109</item> </second> </item> <item> <first>118</first> <second> <count>2</count> <item_version>0</item_version> <item>110</item> <item>110</item> </second> </item> <item> <first>124</first> <second> <count>1</count> <item_version>0</item_version> <item>108</item> </second> </item> <item> <first>131</first> <second> <count>1</count> <item_version>0</item_version> <item>111</item> </second> </item> <item> <first>142</first> <second> <count>1</count> <item_version>0</item_version> <item>13</item> </second> </item> <item> <first>153</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>164</first> <second> <count>1</count> <item_version>0</item_version> <item>48</item> </second> </item> <item> <first>175</first> <second> <count>1</count> <item_version>0</item_version> <item>62</item> </second> </item> <item> <first>186</first> <second> <count>1</count> <item_version>0</item_version> <item>84</item> </second> </item> <item> <first>197</first> <second> <count>1</count> <item_version>0</item_version> <item>98</item> </second> </item> <item> <first>204</first> <second> <count>2</count> <item_version>0</item_version> <item>81</item> <item>81</item> </second> </item> <item> <first>211</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>217</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> <item> <first>223</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>227</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>235</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>239</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>245</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>251</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>257</first> <second> <count>1</count> <item_version>0</item_version> <item>34</item> </second> </item> <item> <first>261</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>266</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>271</first> <second> <count>1</count> <item_version>0</item_version> <item>49</item> </second> </item> <item> <first>277</first> <second> <count>1</count> <item_version>0</item_version> <item>51</item> </second> </item> <item> <first>283</first> <second> <count>1</count> <item_version>0</item_version> <item>56</item> </second> </item> <item> <first>287</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> <item> <first>295</first> <second> <count>1</count> <item_version>0</item_version> <item>58</item> </second> </item> <item> <first>299</first> <second> <count>1</count> <item_version>0</item_version> <item>59</item> </second> </item> <item> <first>305</first> <second> <count>1</count> <item_version>0</item_version> <item>63</item> </second> </item> <item> <first>311</first> <second> <count>1</count> <item_version>0</item_version> <item>65</item> </second> </item> <item> <first>317</first> <second> <count>1</count> <item_version>0</item_version> <item>69</item> </second> </item> <item> <first>321</first> <second> <count>1</count> <item_version>0</item_version> <item>70</item> </second> </item> <item> <first>326</first> <second> <count>1</count> <item_version>0</item_version> <item>71</item> </second> </item> <item> <first>331</first> <second> <count>1</count> <item_version>0</item_version> <item>85</item> </second> </item> <item> <first>337</first> <second> <count>1</count> <item_version>0</item_version> <item>87</item> </second> </item> <item> <first>343</first> <second> <count>1</count> <item_version>0</item_version> <item>92</item> </second> </item> <item> <first>347</first> <second> <count>1</count> <item_version>0</item_version> <item>93</item> </second> </item> <item> <first>355</first> <second> <count>1</count> <item_version>0</item_version> <item>94</item> </second> </item> <item> <first>359</first> <second> <count>1</count> <item_version>0</item_version> <item>95</item> </second> </item> <item> <first>365</first> <second> <count>1</count> <item_version>0</item_version> <item>99</item> </second> </item> <item> <first>371</first> <second> <count>1</count> <item_version>0</item_version> <item>101</item> </second> </item> <item> <first>377</first> <second> <count>1</count> <item_version>0</item_version> <item>105</item> </second> </item> <item> <first>381</first> <second> <count>1</count> <item_version>0</item_version> <item>106</item> </second> </item> <item> <first>386</first> <second> <count>1</count> <item_version>0</item_version> <item>107</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="47" tracking_level="0" version="0"> <count>48</count> <item_version>0</item_version> <item class_id="48" tracking_level="0" version="0"> <first>A_addr_gep_fu_60</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>B_addr_gep_fu_86</first> <second> <count>1</count> <item_version>0</item_version> <item>72</item> </second> </item> <item> <first>C_addr_gep_fu_124</first> <second> <count>1</count> <item_version>0</item_version> <item>108</item> </second> </item> <item> <first>C_assign_addr_gep_fu_112</first> <second> <count>1</count> <item_version>0</item_version> <item>109</item> </second> </item> <item> <first>C_assign_alloca_fu_56</first> <second> <count>1</count> <item_version>0</item_version> <item>10</item> </second> </item> <item> <first>a_i_addr_gep_fu_73</first> <second> <count>1</count> <item_version>0</item_version> <item>38</item> </second> </item> <item> <first>a_i_alloca_fu_48</first> <second> <count>1</count> <item_version>0</item_version> <item>8</item> </second> </item> <item> <first>b_i_addr_gep_fu_99</first> <second> <count>1</count> <item_version>0</item_version> <item>73</item> </second> </item> <item> <first>b_i_alloca_fu_52</first> <second> <count>1</count> <item_version>0</item_version> <item>9</item> </second> </item> <item> <first>c2_phi_fu_175</first> <second> <count>1</count> <item_version>0</item_version> <item>62</item> </second> </item> <item> <first>c4_phi_fu_197</first> <second> <count>1</count> <item_version>0</item_version> <item>98</item> </second> </item> <item> <first>c_1_fu_251</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>c_2_fu_311</first> <second> <count>1</count> <item_version>0</item_version> <item>65</item> </second> </item> <item> <first>c_3_fu_371</first> <second> <count>1</count> <item_version>0</item_version> <item>101</item> </second> </item> <item> <first>c_phi_fu_153</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>p_shl1_cast_fu_295</first> <second> <count>1</count> <item_version>0</item_version> <item>58</item> </second> </item> <item> <first>p_shl2_cast_fu_355</first> <second> <count>1</count> <item_version>0</item_version> <item>94</item> </second> </item> <item> <first>p_shl_cast_fu_235</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>r1_phi_fu_164</first> <second> <count>1</count> <item_version>0</item_version> <item>48</item> </second> </item> <item> <first>r3_phi_fu_186</first> <second> <count>1</count> <item_version>0</item_version> <item>84</item> </second> </item> <item> <first>r_1_fu_217</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> <item> <first>r_2_fu_277</first> <second> <count>1</count> <item_version>0</item_version> <item>51</item> </second> </item> <item> <first>r_3_fu_337</first> <second> <count>1</count> <item_version>0</item_version> <item>87</item> </second> </item> <item> <first>r_phi_fu_142</first> <second> <count>1</count> <item_version>0</item_version> <item>13</item> </second> </item> <item> <first>tmp_10_cast_fu_377</first> <second> <count>1</count> <item_version>0</item_version> <item>105</item> </second> </item> <item> <first>tmp_10_fu_299</first> <second> <count>1</count> <item_version>0</item_version> <item>59</item> </second> </item> <item> <first>tmp_11_fu_261</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>tmp_13_fu_347</first> <second> <count>1</count> <item_version>0</item_version> <item>93</item> </second> </item> <item> <first>tmp_14_fu_359</first> <second> <count>1</count> <item_version>0</item_version> <item>95</item> </second> </item> <item> <first>tmp_15_fu_321</first> <second> <count>1</count> <item_version>0</item_version> <item>70</item> </second> </item> <item> <first>tmp_16_fu_381</first> <second> <count>1</count> <item_version>0</item_version> <item>106</item> </second> </item> <item> <first>tmp_18_cast_fu_266</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>tmp_1_cast_fu_223</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>tmp_1_fu_227</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>tmp_21_cast_fu_326</first> <second> <count>1</count> <item_version>0</item_version> <item>71</item> </second> </item> <item> <first>tmp_22_cast_fu_386</first> <second> <count>1</count> <item_version>0</item_version> <item>107</item> </second> </item> <item> <first>tmp_2_fu_271</first> <second> <count>1</count> <item_version>0</item_version> <item>49</item> </second> </item> <item> <first>tmp_3_fu_245</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>tmp_4_cast_fu_283</first> <second> <count>1</count> <item_version>0</item_version> <item>56</item> </second> </item> <item> <first>tmp_4_fu_239</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>tmp_5_cast_fu_317</first> <second> <count>1</count> <item_version>0</item_version> <item>69</item> </second> </item> <item> <first>tmp_6_cast_fu_257</first> <second> <count>1</count> <item_version>0</item_version> <item>34</item> </second> </item> <item> <first>tmp_6_fu_287</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> <item> <first>tmp_7_fu_365</first> <second> <count>1</count> <item_version>0</item_version> <item>99</item> </second> </item> <item> <first>tmp_8_fu_331</first> <second> <count>1</count> <item_version>0</item_version> <item>85</item> </second> </item> <item> <first>tmp_9_fu_305</first> <second> <count>1</count> <item_version>0</item_version> <item>63</item> </second> </item> <item> <first>tmp_cast_fu_343</first> <second> <count>1</count> <item_version>0</item_version> <item>92</item> </second> </item> <item> <first>tmp_fu_211</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> </dp_fu_nodes_expression> <dp_fu_nodes_module> <count>1</count> <item_version>0</item_version> <item> <first>grp_matrix_multiply_alt2_fu_204</first> <second> <count>2</count> <item_version>0</item_version> <item>81</item> <item>81</item> </second> </item> </dp_fu_nodes_module> <dp_fu_nodes_io> <count>0</count> <item_version>0</item_version> </dp_fu_nodes_io> <return_ports> <count>0</count> <item_version>0</item_version> </return_ports> <dp_mem_port_nodes class_id="49" tracking_level="0" version="0"> <count>9</count> <item_version>0</item_version> <item class_id="50" tracking_level="0" version="0"> <first class_id="51" tracking_level="0" version="0"> <first>A</first> <second>0</second> </first> <second> <count>2</count> <item_version>0</item_version> <item>39</item> <item>39</item> </second> </item> <item> <first> <first>B</first> <second>0</second> </first> <second> <count>2</count> <item_version>0</item_version> <item>74</item> <item>74</item> </second> </item> <item> <first> <first>C</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>111</item> </second> </item> <item> <first> <first>C_assign</first> <second>0</second> </first> <second> <count>2</count> <item_version>0</item_version> <item>110</item> <item>110</item> </second> </item> <item> <first> <first>C_assign</first> <second>100</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>81</item> </second> </item> <item> <first> <first>a_i</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first> <first>a_i</first> <second>100</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>81</item> </second> </item> <item> <first> <first>b_i</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>75</item> </second> </item> <item> <first> <first>b_i</first> <second>100</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>81</item> </second> </item> </dp_mem_port_nodes> <dp_reg_nodes> <count>21</count> <item_version>0</item_version> <item> <first>138</first> <second> <count>1</count> <item_version>0</item_version> <item>13</item> </second> </item> <item> <first>149</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>160</first> <second> <count>1</count> <item_version>0</item_version> <item>48</item> </second> </item> <item> <first>171</first> <second> <count>1</count> <item_version>0</item_version> <item>62</item> </second> </item> <item> <first>182</first> <second> <count>1</count> <item_version>0</item_version> <item>84</item> </second> </item> <item> <first>193</first> <second> <count>1</count> <item_version>0</item_version> <item>98</item> </second> </item> <item> <first>394</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> <item> <first>399</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>407</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>412</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>417</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>425</first> <second> <count>1</count> <item_version>0</item_version> <item>51</item> </second> </item> <item> <first>430</first> <second> <count>1</count> <item_version>0</item_version> <item>59</item> </second> </item> <item> <first>438</first> <second> <count>1</count> <item_version>0</item_version> <item>65</item> </second> </item> <item> <first>443</first> <second> <count>1</count> <item_version>0</item_version> <item>71</item> </second> </item> <item> <first>448</first> <second> <count>1</count> <item_version>0</item_version> <item>72</item> </second> </item> <item> <first>456</first> <second> <count>1</count> <item_version>0</item_version> <item>87</item> </second> </item> <item> <first>461</first> <second> <count>1</count> <item_version>0</item_version> <item>95</item> </second> </item> <item> <first>469</first> <second> <count>1</count> <item_version>0</item_version> <item>101</item> </second> </item> <item> <first>474</first> <second> <count>1</count> <item_version>0</item_version> <item>107</item> </second> </item> <item> <first>479</first> <second> <count>1</count> <item_version>0</item_version> <item>109</item> </second> </item> </dp_reg_nodes> <dp_regname_nodes> <count>21</count> <item_version>0</item_version> <item> <first>A_addr_reg_417</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>B_addr_reg_448</first> <second> <count>1</count> <item_version>0</item_version> <item>72</item> </second> </item> <item> <first>C_assign_addr_reg_479</first> <second> <count>1</count> <item_version>0</item_version> <item>109</item> </second> </item> <item> <first>c2_reg_171</first> <second> <count>1</count> <item_version>0</item_version> <item>62</item> </second> </item> <item> <first>c4_reg_193</first> <second> <count>1</count> <item_version>0</item_version> <item>98</item> </second> </item> <item> <first>c_1_reg_407</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>c_2_reg_438</first> <second> <count>1</count> <item_version>0</item_version> <item>65</item> </second> </item> <item> <first>c_3_reg_469</first> <second> <count>1</count> <item_version>0</item_version> <item>101</item> </second> </item> <item> <first>c_reg_149</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>r1_reg_160</first> <second> <count>1</count> <item_version>0</item_version> <item>48</item> </second> </item> <item> <first>r3_reg_182</first> <second> <count>1</count> <item_version>0</item_version> <item>84</item> </second> </item> <item> <first>r_1_reg_394</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> <item> <first>r_2_reg_425</first> <second> <count>1</count> <item_version>0</item_version> <item>51</item> </second> </item> <item> <first>r_3_reg_456</first> <second> <count>1</count> <item_version>0</item_version> <item>87</item> </second> </item> <item> <first>r_reg_138</first> <second> <count>1</count> <item_version>0</item_version> <item>13</item> </second> </item> <item> <first>tmp_10_reg_430</first> <second> <count>1</count> <item_version>0</item_version> <item>59</item> </second> </item> <item> <first>tmp_14_reg_461</first> <second> <count>1</count> <item_version>0</item_version> <item>95</item> </second> </item> <item> <first>tmp_18_cast_reg_412</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>tmp_21_cast_reg_443</first> <second> <count>1</count> <item_version>0</item_version> <item>71</item> </second> </item> <item> <first>tmp_22_cast_reg_474</first> <second> <count>1</count> <item_version>0</item_version> <item>107</item> </second> </item> <item> <first>tmp_4_reg_399</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> </dp_regname_nodes> <dp_reg_phi> <count>6</count> <item_version>0</item_version> <item> <first>138</first> <second> <count>1</count> <item_version>0</item_version> <item>13</item> </second> </item> <item> <first>149</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>160</first> <second> <count>1</count> <item_version>0</item_version> <item>48</item> </second> </item> <item> <first>171</first> <second> <count>1</count> <item_version>0</item_version> <item>62</item> </second> </item> <item> <first>182</first> <second> <count>1</count> <item_version>0</item_version> <item>84</item> </second> </item> <item> <first>193</first> <second> <count>1</count> <item_version>0</item_version> <item>98</item> </second> </item> </dp_reg_phi> <dp_regname_phi> <count>6</count> <item_version>0</item_version> <item> <first>c2_reg_171</first> <second> <count>1</count> <item_version>0</item_version> <item>62</item> </second> </item> <item> <first>c4_reg_193</first> <second> <count>1</count> <item_version>0</item_version> <item>98</item> </second> </item> <item> <first>c_reg_149</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>r1_reg_160</first> <second> <count>1</count> <item_version>0</item_version> <item>48</item> </second> </item> <item> <first>r3_reg_182</first> <second> <count>1</count> <item_version>0</item_version> <item>84</item> </second> </item> <item> <first>r_reg_138</first> <second> <count>1</count> <item_version>0</item_version> <item>13</item> </second> </item> </dp_regname_phi> <dp_port_io_nodes class_id="52" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="53" tracking_level="0" version="0"> <first>A(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>load</first> <second> <count>2</count> <item_version>0</item_version> <item>39</item> <item>39</item> </second> </item> </second> </item> <item> <first>B(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>load</first> <second> <count>2</count> <item_version>0</item_version> <item>74</item> <item>74</item> </second> </item> </second> </item> <item> <first>C(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>111</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core class_id="54" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="55" tracking_level="0" version="0"> <first>1</first> <second>RAM</second> </item> <item> <first>2</first> <second>RAM</second> </item> <item> <first>3</first> <second>RAM</second> </item> </port2core> <node2core> <count>3</count> <item_version>0</item_version> <item> <first>8</first> <second>RAM</second> </item> <item> <first>9</first> <second>RAM</second> </item> <item> <first>10</first> <second>RAM</second> </item> </node2core> </syndb> </boost_serialization>
-- Copyright (c) 2015-2017 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- package Gen is pragma Pure; end Gen;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2009, 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$ ------------------------------------------------------------------------------ -- Root package for pregenerated data from the Unicode Common Locale Data -- Repository. package Matreshka.Internals.Unicode.Cldr is pragma Pure; end Matreshka.Internals.Unicode.Cldr;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- I N D E P S W -- -- -- -- S p e c -- -- -- -- Copyright (C) 2004-2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- GNATLINK platform-independent switches -- Used to convert GNAT switches to their platform-dependent switch -- equivalent for the underlying linker. with System.OS_Lib; use System.OS_Lib; package Indepsw is type Switch_Kind is -- Independent switches currently supported (Map_File); -- Produce a map file. The path name of the map file to produce -- is given as an argument. procedure Convert (Switch : Switch_Kind; Argument : String; To : out String_List_Access); -- Convert Switch to the platform-dependent linker switch (with or without -- additional arguments) To. Issue a warning if Switch is not supported -- for the platform; in this case, To is set to null. function Is_Supported (Switch : Switch_Kind) return Boolean; -- Return True for each independent switch supported by the platform private -- Default warning messages when the switches are not supported by the -- implementation. These are in the spec so that the platform specific -- bodies do not need to redefine them. Map_File_Not_Supported : aliased String := "the underlying linker does not allow the output of a map file"; No_Support_For : constant array (Switch_Kind) of String_Access := (Map_File => Map_File_Not_Supported'Access); -- All implementations of procedure Convert should include a case -- statements with a "when others =>" choice that output the default -- warning message: -- case Switch is -- when ... => -- ... -- when others => -- Write_Str ("warning: "); -- Write_Line (No_Support_For (Switch).all); -- To := null; -- end case; end Indepsw;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- A driver for the Cyclic Redundancy Check CRC-32 calculation processor, -- using DMA to transfer the data to the CRC unit (instead of the CPU). -- Note this API is for the STM32 F4x family. Other STM MCUs have additional -- CRC capabilities. -- See also app note AN4187 "Using CRC through DMA" -- Example usage, assuming prior clock enabling for the CRC unit: -- Checksum_DMA : UInt32 := 0; -- -- Data : constant Block_32 := ( .... ); -- -- ... -- -- Enable_Clock (Controller); -- -- Reset (Controller); -- -- Reset_Calculator (CRC_Unit); -- if need be -- -- Update_CRC (CRC_Unit, Controller'Access, Stream, Input => Data); -- -- DMA_IRQ_Handler.Await_Event (Next_DMA_Interrupt); -- -- if Next_DMA_Interrupt /= Transfer_Complete_Interrupt then -- Panic; -- end if; -- -- Checksum_DMA := Value (CRC_Unit); with STM32.DMA; use STM32.DMA; with System; package STM32.CRC.DMA is pragma Elaborate_Body; -- These routines use the specified controller and stream to transfer -- all of the Input data components to This CRC unit, updating the -- CRC value accordingly. At the end of the transfer the DMA interrupt -- Transfer_Complete_Interrupt is triggered. Clients are expected to have -- an application-defined handler for that interrupt, in order to await -- completion of the transfer. -- These routines can be called multiple times, back-to-back, presumably -- with different input blocks, in order to update the value of the -- calculated CRC checksum within the CRC processor. Each call will -- result in a Transfer_Complete_Interrupt event. -- Note that you can use a slice if the entire block is not intended for -- transfer, but beware alignment boundaries to prevent copying of the -- actual parameter into a temporary. procedure Update_CRC (This : in out CRC_32; Controller : access DMA_Controller; Channel : DMA_Channel_Selector; Input : Block_32); -- Update the calculated CRC value based on all of the 32-bit components -- of Input. Triggers the Transfer_Complete_Interrupt on completion. procedure Update_CRC (This : in out CRC_32; Controller : access DMA_Controller; Channel : DMA_Channel_Selector; Input : Block_16); -- Update the calculated CRC value based on all of the 16-bit components -- of Input. Triggers the Transfer_Complete_Interrupt on completion. procedure Update_CRC (This : in out CRC_32; Controller : access DMA_Controller; Channel : DMA_Channel_Selector; Input : Block_8); -- Update the calculated CRC value based on all of the 8-bit components -- of Input. Triggers the Transfer_Complete_Interrupt on completion. private procedure Transfer_Input_To_CRC (This : in out CRC_32; Controller : access DMA_Controller; Channel : DMA_Channel_Selector; Input_Address : System.Address; Input_Length : UInt16; Data_Width : DMA_Data_Transfer_Widths); -- Configures the DMA controller and stream for transfering memory blocks, -- of the width specified by Data_Width, to This CRC processor. Then uses -- the controller and stream to transfer the data starting at Input_Address -- to This CRC unit, updating the CRC value accordingly. The number of -- Input memory items (of Data_Width size) to be transferred is specified -- by Input_Length. At the end of the transfer the DMA interrupt -- Transfer_Complete_Interrupt is triggered. end STM32.CRC.DMA;
procedure main is begin null; end main;
------------------------------------------------------------------------------ -- -- -- Ada binding for OpenGL/WebGL -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2016-2018, 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. -- -- -- ------------------------------------------------------------------------------ package body OpenGL.Renderbuffers.Internals is ---------------------------- -- Get_WebGL_Renderbuffer -- ---------------------------- function Get_WebGL_Renderbuffer (Self : OpenGL_Renderbuffer'Class) return WebAPI.WebGL.Renderbuffers.WebGL_Renderbuffer_Access is begin return Self.Renderbuffer; end Get_WebGL_Renderbuffer; end OpenGL.Renderbuffers.Internals;
package Trendy_Terminal.Example.Input is procedure Run_Print_Input; end Trendy_Terminal.Example.Input;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- M A K E U S G -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Procedure to output usage information for gnatmake procedure Makeusg; -- Output gnatmake usage information
with Gdk.Event; use Gdk.Event; with Gtk.Button; use Gtk.Button; with Gtk.Label; use Gtk.Label; with Gtk.Window; use Gtk.Window; with Gtk.Widget; use Gtk.Widget; with Gtk.Table; use Gtk.Table; with Gtk.Handlers; with Gtk.Main; procedure Simple_Windowed_Application is Window : Gtk_Window; Grid : Gtk_Table; Button : Gtk_Button; Label : Gtk_Label; Count : Natural := 0; package Handlers is new Gtk.Handlers.Callback (Gtk_Widget_Record); package Return_Handlers is new Gtk.Handlers.Return_Callback (Gtk_Widget_Record, Boolean); function Delete_Event (Widget : access Gtk_Widget_Record'Class) return Boolean is begin return False; end Delete_Event; procedure Destroy (Widget : access Gtk_Widget_Record'Class) is begin Gtk.Main.Main_Quit; end Destroy; procedure Clicked (Widget : access Gtk_Widget_Record'Class) is begin Count := Count + 1; Set_Text (Label, "The button clicks:" & Natural'Image (Count)); end Clicked; begin Gtk.Main.Init; Gtk.Window.Gtk_New (Window); Gtk_New (Grid, 1, 2, False); Add (Window, Grid); Gtk_New (Label, "There have been no clicks yet"); Attach (Grid, Label, 0, 1, 0, 1); Gtk_New (Button, "Click me"); Attach (Grid, Button, 0, 1, 1, 2); Return_Handlers.Connect ( Window, "delete_event", Return_Handlers.To_Marshaller (Delete_Event'Access) ); Handlers.Connect ( Window, "destroy", Handlers.To_Marshaller (Destroy'Access) ); Handlers.Connect ( Button, "clicked", Handlers.To_Marshaller (Clicked'Access) ); Show_All (Grid); Show (Window); Gtk.Main.Main; end Simple_Windowed_Application;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . S T R I N G S . W I D E _ U N B O U N D E D -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Strings.Wide_Maps; with Ada.Finalization; package Ada.Strings.Wide_Unbounded is pragma Preelaborate; type Unbounded_Wide_String is private; Null_Unbounded_Wide_String : constant Unbounded_Wide_String; function Length (Source : Unbounded_Wide_String) return Natural; type Wide_String_Access is access all Wide_String; procedure Free (X : in out Wide_String_Access); -------------------------------------------------------- -- Conversion, Concatenation, and Selection Functions -- -------------------------------------------------------- function To_Unbounded_Wide_String (Source : Wide_String) return Unbounded_Wide_String; function To_Unbounded_Wide_String (Length : Natural) return Unbounded_Wide_String; function To_Wide_String (Source : Unbounded_Wide_String) return Wide_String; procedure Set_Unbounded_Wide_String (Target : out Unbounded_Wide_String; Source : Wide_String); pragma Ada_05 (Set_Unbounded_Wide_String); procedure Append (Source : in out Unbounded_Wide_String; New_Item : Unbounded_Wide_String); procedure Append (Source : in out Unbounded_Wide_String; New_Item : Wide_String); procedure Append (Source : in out Unbounded_Wide_String; New_Item : Wide_Character); function "&" (Left : Unbounded_Wide_String; Right : Unbounded_Wide_String) return Unbounded_Wide_String; function "&" (Left : Unbounded_Wide_String; Right : Wide_String) return Unbounded_Wide_String; function "&" (Left : Wide_String; Right : Unbounded_Wide_String) return Unbounded_Wide_String; function "&" (Left : Unbounded_Wide_String; Right : Wide_Character) return Unbounded_Wide_String; function "&" (Left : Wide_Character; Right : Unbounded_Wide_String) return Unbounded_Wide_String; function Element (Source : Unbounded_Wide_String; Index : Positive) return Wide_Character; procedure Replace_Element (Source : in out Unbounded_Wide_String; Index : Positive; By : Wide_Character); function Slice (Source : Unbounded_Wide_String; Low : Positive; High : Natural) return Wide_String; function Unbounded_Slice (Source : Unbounded_Wide_String; Low : Positive; High : Natural) return Unbounded_Wide_String; pragma Ada_05 (Unbounded_Slice); procedure Unbounded_Slice (Source : Unbounded_Wide_String; Target : out Unbounded_Wide_String; Low : Positive; High : Natural); pragma Ada_05 (Unbounded_Slice); function "=" (Left : Unbounded_Wide_String; Right : Unbounded_Wide_String) return Boolean; function "=" (Left : Unbounded_Wide_String; Right : Wide_String) return Boolean; function "=" (Left : Wide_String; Right : Unbounded_Wide_String) return Boolean; function "<" (Left : Unbounded_Wide_String; Right : Unbounded_Wide_String) return Boolean; function "<" (Left : Unbounded_Wide_String; Right : Wide_String) return Boolean; function "<" (Left : Wide_String; Right : Unbounded_Wide_String) return Boolean; function "<=" (Left : Unbounded_Wide_String; Right : Unbounded_Wide_String) return Boolean; function "<=" (Left : Unbounded_Wide_String; Right : Wide_String) return Boolean; function "<=" (Left : Wide_String; Right : Unbounded_Wide_String) return Boolean; function ">" (Left : Unbounded_Wide_String; Right : Unbounded_Wide_String) return Boolean; function ">" (Left : Unbounded_Wide_String; Right : Wide_String) return Boolean; function ">" (Left : Wide_String; Right : Unbounded_Wide_String) return Boolean; function ">=" (Left : Unbounded_Wide_String; Right : Unbounded_Wide_String) return Boolean; function ">=" (Left : Unbounded_Wide_String; Right : Wide_String) return Boolean; function ">=" (Left : Wide_String; Right : Unbounded_Wide_String) return Boolean; ------------------------ -- Search Subprograms -- ------------------------ function Index (Source : Unbounded_Wide_String; Pattern : Wide_String; Going : Direction := Forward; Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity) return Natural; function Index (Source : Unbounded_Wide_String; Pattern : Wide_String; Going : Direction := Forward; Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural; function Index (Source : Unbounded_Wide_String; Set : Wide_Maps.Wide_Character_Set; Test : Membership := Inside; Going : Direction := Forward) return Natural; function Index (Source : Unbounded_Wide_String; Pattern : Wide_String; From : Positive; Going : Direction := Forward; Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity) return Natural; pragma Ada_05 (Index); function Index (Source : Unbounded_Wide_String; Pattern : Wide_String; From : Positive; Going : Direction := Forward; Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural; pragma Ada_05 (Index); function Index (Source : Unbounded_Wide_String; Set : Wide_Maps.Wide_Character_Set; From : Positive; Test : Membership := Inside; Going : Direction := Forward) return Natural; pragma Ada_05 (Index); function Index_Non_Blank (Source : Unbounded_Wide_String; Going : Direction := Forward) return Natural; function Index_Non_Blank (Source : Unbounded_Wide_String; From : Positive; Going : Direction := Forward) return Natural; pragma Ada_05 (Index_Non_Blank); function Count (Source : Unbounded_Wide_String; Pattern : Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity) return Natural; function Count (Source : Unbounded_Wide_String; Pattern : Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural; function Count (Source : Unbounded_Wide_String; Set : Wide_Maps.Wide_Character_Set) return Natural; procedure Find_Token (Source : Unbounded_Wide_String; Set : Wide_Maps.Wide_Character_Set; Test : Membership; First : out Positive; Last : out Natural); ------------------------------------ -- String Translation Subprograms -- ------------------------------------ function Translate (Source : Unbounded_Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping) return Unbounded_Wide_String; procedure Translate (Source : in out Unbounded_Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping); function Translate (Source : Unbounded_Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Unbounded_Wide_String; procedure Translate (Source : in out Unbounded_Wide_String; Mapping : Wide_Maps.Wide_Character_Mapping_Function); --------------------------------------- -- String Transformation Subprograms -- --------------------------------------- function Replace_Slice (Source : Unbounded_Wide_String; Low : Positive; High : Natural; By : Wide_String) return Unbounded_Wide_String; procedure Replace_Slice (Source : in out Unbounded_Wide_String; Low : Positive; High : Natural; By : Wide_String); function Insert (Source : Unbounded_Wide_String; Before : Positive; New_Item : Wide_String) return Unbounded_Wide_String; procedure Insert (Source : in out Unbounded_Wide_String; Before : Positive; New_Item : Wide_String); function Overwrite (Source : Unbounded_Wide_String; Position : Positive; New_Item : Wide_String) return Unbounded_Wide_String; procedure Overwrite (Source : in out Unbounded_Wide_String; Position : Positive; New_Item : Wide_String); function Delete (Source : Unbounded_Wide_String; From : Positive; Through : Natural) return Unbounded_Wide_String; procedure Delete (Source : in out Unbounded_Wide_String; From : Positive; Through : Natural); function Trim (Source : Unbounded_Wide_String; Side : Trim_End) return Unbounded_Wide_String; procedure Trim (Source : in out Unbounded_Wide_String; Side : Trim_End); function Trim (Source : Unbounded_Wide_String; Left : Wide_Maps.Wide_Character_Set; Right : Wide_Maps.Wide_Character_Set) return Unbounded_Wide_String; procedure Trim (Source : in out Unbounded_Wide_String; Left : Wide_Maps.Wide_Character_Set; Right : Wide_Maps.Wide_Character_Set); function Head (Source : Unbounded_Wide_String; Count : Natural; Pad : Wide_Character := Wide_Space) return Unbounded_Wide_String; procedure Head (Source : in out Unbounded_Wide_String; Count : Natural; Pad : Wide_Character := Wide_Space); function Tail (Source : Unbounded_Wide_String; Count : Natural; Pad : Wide_Character := Wide_Space) return Unbounded_Wide_String; procedure Tail (Source : in out Unbounded_Wide_String; Count : Natural; Pad : Wide_Character := Wide_Space); function "*" (Left : Natural; Right : Wide_Character) return Unbounded_Wide_String; function "*" (Left : Natural; Right : Wide_String) return Unbounded_Wide_String; function "*" (Left : Natural; Right : Unbounded_Wide_String) return Unbounded_Wide_String; private pragma Inline (Length); package AF renames Ada.Finalization; Null_Wide_String : aliased Wide_String := ""; function To_Unbounded_Wide (S : Wide_String) return Unbounded_Wide_String renames To_Unbounded_Wide_String; type Unbounded_Wide_String is new AF.Controlled with record Reference : Wide_String_Access := Null_Wide_String'Access; Last : Natural := 0; end record; -- The Unbounded_Wide_String is using a buffered implementation to increase -- speed of the Append/Delete/Insert procedures. The Reference string -- pointer above contains the current string value and extra room at the -- end to be used by the next Append routine. Last is the index of the -- string ending character. So the current string value is really -- Reference (1 .. Last). pragma Stream_Convert (Unbounded_Wide_String, To_Unbounded_Wide, To_Wide_String); pragma Finalize_Storage_Only (Unbounded_Wide_String); -- Finalization is required only for freeing storage procedure Initialize (Object : in out Unbounded_Wide_String); procedure Adjust (Object : in out Unbounded_Wide_String); procedure Finalize (Object : in out Unbounded_Wide_String); procedure Realloc_For_Chunk (Source : in out Unbounded_Wide_String; Chunk_Size : Natural); -- Adjust the size allocated for the string. Add at least Chunk_Size so it -- is safe to add a string of this size at the end of the current content. -- The real size allocated for the string is Chunk_Size + x of the current -- string size. This buffered handling makes the Append unbounded string -- routines very fast. Null_Unbounded_Wide_String : constant Unbounded_Wide_String := (AF.Controlled with Reference => Null_Wide_String'Access, Last => 0); -- Note: this declaration is illegal since library level controlled -- objects are not allowed in preelaborated units. See AI-161 for a -- discussion of this issue and an attempt to address it. Meanwhile, -- what happens in GNAT is that this check is omitted for internal -- implementation units (see check in sem_cat.adb). end Ada.Strings.Wide_Unbounded;
function "-" (Left, Right : Luminance) return Count is begin if Left > Right then return Count (Left) - Count (Right); else return Count (Right) - Count (Left); end if; end "-";
-- generic_list.adb -*- Ada -*- -- -- This package defines a generic list and list iterator. -- -- Author: Eric Gustafson -- Date: 25 August 1998 -- -- ------------------------------------------------------------ -- -- $Revision$ -- -- $Log$ -- ------------------------------------------------------------ package body Generic_List is -- ----- List_Type Methods --------------------------------- procedure List_Add( List : in out List_Type; Element : in Element_Type ) is begin if List.Num_Elements = List.List'Last then declare New_List : Element_Array_Access := new Element_Array(1..List.List'Last+3); begin New_List(List.List'Range) := List.List.all; -- Deallocate list.list access List.List := New_List; end; end if; List.Num_Elements := List.Num_Elements + 1; List.List(List.Num_Elements) := Element; end List_Add; -- --------------------------------------------------------- function List_New_Iterator( List : in List_Type ) return List_Iterator_Type is List_Iterator : List_Iterator_Type; begin List_Iterator.List := List.List; List_Iterator.Num_Elements := List.Num_Elements; return List_Iterator; end List_New_Iterator; -- ----- List_Iterator_Type Methods ------------------------ function Is_Next( List_Iterator : in List_Iterator_Type ) return Boolean is begin if List_Iterator.Index <= List_Iterator.Num_Elements then return True; else return False; end if; end Is_Next; -- --------------------------------------------------------- procedure Get_Next( List_Iterator : in out List_Iterator_Type; Next_Element : out Element_Type ) is begin if not Is_Next( List_Iterator ) then raise Iterator_Bound_Error; end if; Next_Element := List_Iterator.List(List_Iterator.Index); List_Iterator.Index := List_Iterator.Index + 1; end Get_Next; end Generic_List;
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Program.Elements.Expressions; with Program.Elements.Operator_Symbols; package Program.Elements.Infix_Operators is pragma Pure (Program.Elements.Infix_Operators); type Infix_Operator is limited interface and Program.Elements.Expressions.Expression; type Infix_Operator_Access is access all Infix_Operator'Class with Storage_Size => 0; not overriding function Left (Self : Infix_Operator) return Program.Elements.Expressions.Expression_Access is abstract; not overriding function Operator (Self : Infix_Operator) return not null Program.Elements.Operator_Symbols.Operator_Symbol_Access is abstract; not overriding function Right (Self : Infix_Operator) return not null Program.Elements.Expressions.Expression_Access is abstract; type Infix_Operator_Text is limited interface; type Infix_Operator_Text_Access is access all Infix_Operator_Text'Class with Storage_Size => 0; not overriding function To_Infix_Operator_Text (Self : in out Infix_Operator) return Infix_Operator_Text_Access is abstract; end Program.Elements.Infix_Operators;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G N A T . C G I . D E B U G -- -- -- -- S p e c -- -- -- -- $Revision$ -- -- -- Copyright (C) 2000 Ada Core Technologies, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). -- -- -- ------------------------------------------------------------------------------ -- This is a package to help debugging CGI (Common Gateway Interface) -- programs written in Ada. package GNAT.CGI.Debug is -- Both functions below output all possible CGI parameters set. These -- are the form field and all CGI environment variables which make the -- CGI environment at runtime. function Text_Output return String; -- Returns a plain text version of the CGI runtime environment function HTML_Output return String; -- Returns an HTML version of the CGI runtime environment end GNAT.CGI.Debug;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Generic_Collections; package AMF.CMOF.Named_Elements.Collections is pragma Preelaborate; package CMOF_Named_Element_Collections is new AMF.Generic_Collections (CMOF_Named_Element, CMOF_Named_Element_Access); type Set_Of_CMOF_Named_Element is new CMOF_Named_Element_Collections.Set with null record; Empty_Set_Of_CMOF_Named_Element : constant Set_Of_CMOF_Named_Element; type Ordered_Set_Of_CMOF_Named_Element is new CMOF_Named_Element_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_CMOF_Named_Element : constant Ordered_Set_Of_CMOF_Named_Element; type Bag_Of_CMOF_Named_Element is new CMOF_Named_Element_Collections.Bag with null record; Empty_Bag_Of_CMOF_Named_Element : constant Bag_Of_CMOF_Named_Element; type Sequence_Of_CMOF_Named_Element is new CMOF_Named_Element_Collections.Sequence with null record; Empty_Sequence_Of_CMOF_Named_Element : constant Sequence_Of_CMOF_Named_Element; private Empty_Set_Of_CMOF_Named_Element : constant Set_Of_CMOF_Named_Element := (CMOF_Named_Element_Collections.Set with null record); Empty_Ordered_Set_Of_CMOF_Named_Element : constant Ordered_Set_Of_CMOF_Named_Element := (CMOF_Named_Element_Collections.Ordered_Set with null record); Empty_Bag_Of_CMOF_Named_Element : constant Bag_Of_CMOF_Named_Element := (CMOF_Named_Element_Collections.Bag with null record); Empty_Sequence_Of_CMOF_Named_Element : constant Sequence_Of_CMOF_Named_Element := (CMOF_Named_Element_Collections.Sequence with null record); end AMF.CMOF.Named_Elements.Collections;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . W W D _ W C H A R -- -- -- -- 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 Interfaces; use Interfaces; with System.WWd_Char; package body System.Wwd_WChar is ------------------------------------ -- Wide_Wide_Width_Wide_Character -- ------------------------------------ -- This is the case where we are talking about the Wide_Wide_Image of -- a Wide_Character, which is always the same character sequence as the -- Wide_Image of the same Wide_Character. function Wide_Wide_Width_Wide_Character (Lo, Hi : Wide_Character) return Natural is begin return Wide_Width_Wide_Character (Lo, Hi); end Wide_Wide_Width_Wide_Character; ------------------------------------ -- Wide_Wide_Width_Wide_Wide_Char -- ------------------------------------ function Wide_Wide_Width_Wide_Wide_Char (Lo, Hi : Wide_Wide_Character) return Natural is LV : constant Unsigned_32 := Wide_Wide_Character'Pos (Lo); HV : constant Unsigned_32 := Wide_Wide_Character'Pos (Hi); begin -- Return zero if empty range if LV > HV then return 0; -- Return max value (12) for wide character (Hex_hhhhhhhh) elsif HV > 255 then return 12; -- If any characters in normal character range, then use normal -- Wide_Wide_Width attribute on this range to find out a starting point. -- Otherwise start with zero. else return System.WWd_Char.Wide_Wide_Width_Character (Lo => Character'Val (LV), Hi => Character'Val (Unsigned_32'Min (255, HV))); end if; end Wide_Wide_Width_Wide_Wide_Char; ------------------------------- -- Wide_Width_Wide_Character -- ------------------------------- function Wide_Width_Wide_Character (Lo, Hi : Wide_Character) return Natural is LV : constant Unsigned_32 := Wide_Character'Pos (Lo); HV : constant Unsigned_32 := Wide_Character'Pos (Hi); begin -- Return zero if empty range if LV > HV then return 0; -- Return max value (12) for wide character (Hex_hhhhhhhh) elsif HV > 255 then return 12; -- If any characters in normal character range, then use normal -- Wide_Wide_Width attribute on this range to find out a starting point. -- Otherwise start with zero. else return System.WWd_Char.Wide_Width_Character (Lo => Character'Val (LV), Hi => Character'Val (Unsigned_32'Min (255, HV))); end if; end Wide_Width_Wide_Character; ------------------------------------ -- Wide_Width_Wide_Wide_Character -- ------------------------------------ function Wide_Width_Wide_Wide_Character (Lo, Hi : Wide_Wide_Character) return Natural is begin return Wide_Wide_Width_Wide_Wide_Char (Lo, Hi); end Wide_Width_Wide_Wide_Character; end System.Wwd_WChar;
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- limited with Program.Compilations; limited with Program.Library_Items; limited with Program.Library_Unit_Bodies; limited with Program.Library_Unit_Declarations; limited with Program.Subunits; with Program.Element_Vectors; with Program.Elements; package Program.Compilation_Units is pragma Pure; -- A specific Compilation_Unit value is valid (usable) for as long as the -- Context variable, used to create it, remains open. Once an Context is -- closed, all associated Compilation_Unit values become invalid. It is -- erroneous to use an invalid Compilation_Unit value. type Compilation_Unit is limited interface; -- The Ada Compilation Unit abstraction: -- -- The text of a program is submitted to the compiler in one or more -- compilations. Each compilation is a succession of compilation units. -- -- Compilation units are composed of three distinct parts: -- -- a) A context clause. -- -- b) The declaration of a library_item or unit. -- -- c) Pragmas that apply to the compilation, of which the unit is a part. -- -- The context clause contains zero or more with clauses, use clauses, -- pragma elaborates, and possibly other pragmas. -- -- We treat Pragmas that appear immediately after the context clause and -- before the subsequent declaration part as belonging to the context -- clause part. -- -- The declaration associated with a compilation unit is one of: a package, -- a procedure, a function, a generic, or a subunit for normal units. -- -- The abstract type Compilation_Unit is a handle for compilation units as -- a whole. An object of the type Compilation_Unit deals with the external -- view of compilation units such as their relationships with other units -- or their compilation attributes. type Compilation_Unit_Access is access all Compilation_Unit'Class with Storage_Size => 0; function Assigned (Self : access Compilation_Unit'Class) return Boolean is (Self /= null); not overriding function Compilation (Self : access Compilation_Unit) return Program.Compilations.Compilation_Access is abstract; -- Return corresponding compilation not overriding function Full_Name (Self : access Compilation_Unit) return Text is abstract; -- Returns the string image of the fully expanded Ada name of the given -- compilation unit. This may be a simple name ("A") of a root library -- unit, or an expanded name ("A.B") of a subunit or non-root child unit. -- An expanded name shall contain the full parent_unit_name as its prefix. not overriding function Context_Clause_Elements (Self : access Compilation_Unit) return Program.Element_Vectors.Element_Vector_Access is abstract; -- with Post'Class => -- (Context_Clause_Elements'Result.Is_Empty -- or else (for all X in Context_Clause_Elements'Result.Each_Element -- => X.Element.Is_Pragma -- or X.Element.Is_With_Clause -- or X.Element.Is_Use_Clause)); -- Returns a list of with clauses, use clauses, and pragmas that explicitly -- appear in the context clause of the compilation unit, in their order of -- appearance. not overriding function Unit_Declaration (Self : access Compilation_Unit) return not null Program.Elements.Element_Access is abstract with Post'Class => (Unit_Declaration'Result.Is_Declaration); -- Returns the element representing the declaration of the compilation_unit not overriding function Is_Subunit_Unit (Self : Compilation_Unit) return Boolean is abstract; -- Return True if Self is a subunit. function Is_Subunit (Self : Compilation_Unit'Class) return Boolean is (Self.Is_Subunit_Unit); -- Return True if Self is a subunit. function To_Subunit (Self : access Compilation_Unit'Class) return Program.Subunits.Subunit_Access with Pre => Self.Is_Subunit; -- Convert to the subunit type. not overriding function Is_Library_Item_Unit (Self : Compilation_Unit) return Boolean is abstract; -- Return True if Self is a library_item. function Is_Library_Item (Self : Compilation_Unit'Class) return Boolean is (Self.Is_Library_Item_Unit); -- Return True if Self is a library_item. function To_Library_Item (Self : access Compilation_Unit'Class) return Program.Library_Items.Library_Item_Access with Pre => Self.Is_Library_Item; -- Convert to the library_item type. not overriding function Is_Library_Unit_Body_Unit (Self : Compilation_Unit) return Boolean is abstract; -- Return True if Self is a library_unit_body. function Is_Library_Unit_Body (Self : Compilation_Unit'Class) return Boolean is (Self.Is_Library_Unit_Body_Unit); -- Return True if Self is a library_unit_body. function To_Library_Unit_Body (Self : access Compilation_Unit'Class) return Program.Library_Unit_Bodies.Library_Unit_Body_Access with Pre => Self.Is_Library_Unit_Body; -- Convert to the library_unit_body type. not overriding function Is_Library_Unit_Declaration_Unit (Self : Compilation_Unit) return Boolean is abstract; -- Return True if Self is a library_unit_declaration. function Is_Library_Unit_Declaration (Self : Compilation_Unit'Class) return Boolean is (Self.Is_Library_Unit_Declaration_Unit); -- Return True if Self is a library_unit_declaration. function To_Library_Unit_Declaration (Self : access Compilation_Unit'Class) return Program.Library_Unit_Declarations.Library_Unit_Declaration_Access with Pre => Self.Is_Library_Unit_Declaration; -- Convert to the library_unit_declaration type. end Program.Compilation_Units;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2016-2020, 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 NRF_SVD.RTC; with HAL; use HAL; package nRF.RTC is type RTC_Events is (Tick_Event, Overflow_Event, Compare_0_Event, Compare_1_Event, Compare_2_Event, Compare_3_Event); type Compare_Channel is range 0 .. 3; type Real_Time_Counter (Periph : not null access NRF_SVD.RTC.RTC_Peripheral) is private; procedure Start (This : Real_Time_Counter); procedure Stop (This : Real_Time_Counter); procedure Clear (This : Real_Time_Counter); procedure Set_Prescaler (This : Real_Time_Counter; Prescaler : UInt12); function Counter (This : Real_Time_Counter) return UInt24; procedure Set_Compare (This : Real_Time_Counter; Compare : Compare_Channel; Value : UInt24); function Event (This : Real_Time_Counter; Evt : RTC_Events) return Event_Type; procedure Enable_Event (This : Real_Time_Counter; Evt : RTC_Events); procedure Disable_Event (This : Real_Time_Counter; Evt : RTC_Events); private type Real_Time_Counter (Periph : not null access NRF_SVD.RTC.RTC_Peripheral) is null record; end nRF.RTC;
----------------------------------------------------------------------- -- AWA.Wikis.Models -- AWA.Wikis.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) 2016 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- 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.Images.Models; with AWA.Storages.Models; with AWA.Users.Models; with AWA.Workspaces.Models; with Util.Beans.Methods; pragma Warnings (On); package AWA.Wikis.Models is pragma Style_Checks ("-mr"); type Format_Type is (FORMAT_CREOLE, FORMAT_HTML, FORMAT_MARKDOWN, FORMAT_DOTCLEAR, FORMAT_MEDIAWIKI, FORMAT_PHPBB); for Format_Type use (FORMAT_CREOLE => 0, FORMAT_HTML => 1, FORMAT_MARKDOWN => 2, FORMAT_DOTCLEAR => 3, FORMAT_MEDIAWIKI => 4, FORMAT_PHPBB => 5); package Format_Type_Objects is new Util.Beans.Objects.Enums (Format_Type); type Wiki_Space_Ref is new ADO.Objects.Object_Ref with null record; type Wiki_Page_Ref is new ADO.Objects.Object_Ref with null record; type Wiki_Content_Ref is new ADO.Objects.Object_Ref with null record; -- -------------------- -- Permission is granted to display a wiki page if there is -- an ACL entry between the wiki space and the user. -- -------------------- -- Create an object key for Wiki_Space. function Wiki_Space_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key; -- Create an object key for Wiki_Space from a string. -- Raises Constraint_Error if the string cannot be converted into the object key. function Wiki_Space_Key (Id : in String) return ADO.Objects.Object_Key; Null_Wiki_Space : constant Wiki_Space_Ref; function "=" (Left, Right : Wiki_Space_Ref'Class) return Boolean; -- Set the wiki space identifier procedure Set_Id (Object : in out Wiki_Space_Ref; Value : in ADO.Identifier); -- Get the wiki space identifier function Get_Id (Object : in Wiki_Space_Ref) return ADO.Identifier; -- Set the wiki name procedure Set_Name (Object : in out Wiki_Space_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String); procedure Set_Name (Object : in out Wiki_Space_Ref; Value : in String); -- Get the wiki name function Get_Name (Object : in Wiki_Space_Ref) return Ada.Strings.Unbounded.Unbounded_String; function Get_Name (Object : in Wiki_Space_Ref) return String; -- Set whether the wiki is public procedure Set_Is_Public (Object : in out Wiki_Space_Ref; Value : in Boolean); -- Get whether the wiki is public function Get_Is_Public (Object : in Wiki_Space_Ref) return Boolean; -- function Get_Version (Object : in Wiki_Space_Ref) return Integer; -- Set the wiki creation date. procedure Set_Create_Date (Object : in out Wiki_Space_Ref; Value : in Ada.Calendar.Time); -- Get the wiki creation date. function Get_Create_Date (Object : in Wiki_Space_Ref) return Ada.Calendar.Time; -- Set the left panel side wiki text for every page. procedure Set_Left_Side (Object : in out Wiki_Space_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String); procedure Set_Left_Side (Object : in out Wiki_Space_Ref; Value : in String); -- Get the left panel side wiki text for every page. function Get_Left_Side (Object : in Wiki_Space_Ref) return Ada.Strings.Unbounded.Unbounded_String; function Get_Left_Side (Object : in Wiki_Space_Ref) return String; -- Set the right panel wiki text for every page. procedure Set_Right_Side (Object : in out Wiki_Space_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String); procedure Set_Right_Side (Object : in out Wiki_Space_Ref; Value : in String); -- Get the right panel wiki text for every page. function Get_Right_Side (Object : in Wiki_Space_Ref) return Ada.Strings.Unbounded.Unbounded_String; function Get_Right_Side (Object : in Wiki_Space_Ref) return String; -- Set the default wiki page format. procedure Set_Format (Object : in out Wiki_Space_Ref; Value : in AWA.Wikis.Models.Format_Type); -- Get the default wiki page format. function Get_Format (Object : in Wiki_Space_Ref) return AWA.Wikis.Models.Format_Type; -- procedure Set_Workspace (Object : in out Wiki_Space_Ref; Value : in AWA.Workspaces.Models.Workspace_Ref'Class); -- function Get_Workspace (Object : in Wiki_Space_Ref) return AWA.Workspaces.Models.Workspace_Ref'Class; -- Load the entity identified by 'Id'. -- Raises the NOT_FOUND exception if it does not exist. procedure Load (Object : in out Wiki_Space_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 Wiki_Space_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 Wiki_Space_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 Wiki_Space_Ref; Session : in out ADO.Sessions.Master_Session'Class); -- Delete the entity. overriding procedure Delete (Object : in out Wiki_Space_Ref; Session : in out ADO.Sessions.Master_Session'Class); overriding function Get_Value (From : in Wiki_Space_Ref; Name : in String) return Util.Beans.Objects.Object; -- Table definition WIKI_SPACE_TABLE : constant ADO.Schemas.Class_Mapping_Access; -- Internal method to allocate the Object_Record instance overriding procedure Allocate (Object : in out Wiki_Space_Ref); -- Copy of the object. procedure Copy (Object : in Wiki_Space_Ref; Into : in out Wiki_Space_Ref); -- -------------------- -- The wiki page represents a page with its versions. -- It refers to the last version which is currently visible. -- It has an optional preview image which defines -- the thumbnail preview of the last/current wiki content. -- -------------------- -- Create an object key for Wiki_Page. function Wiki_Page_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key; -- Create an object key for Wiki_Page from a string. -- Raises Constraint_Error if the string cannot be converted into the object key. function Wiki_Page_Key (Id : in String) return ADO.Objects.Object_Key; Null_Wiki_Page : constant Wiki_Page_Ref; function "=" (Left, Right : Wiki_Page_Ref'Class) return Boolean; -- Set the wiki page identifier procedure Set_Id (Object : in out Wiki_Page_Ref; Value : in ADO.Identifier); -- Get the wiki page identifier function Get_Id (Object : in Wiki_Page_Ref) return ADO.Identifier; -- Set the wiki page name procedure Set_Name (Object : in out Wiki_Page_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String); procedure Set_Name (Object : in out Wiki_Page_Ref; Value : in String); -- Get the wiki page name function Get_Name (Object : in Wiki_Page_Ref) return Ada.Strings.Unbounded.Unbounded_String; function Get_Name (Object : in Wiki_Page_Ref) return String; -- Set the last page version number procedure Set_Last_Version (Object : in out Wiki_Page_Ref; Value : in Integer); -- Get the last page version number function Get_Last_Version (Object : in Wiki_Page_Ref) return Integer; -- Set whether the wiki page is public procedure Set_Is_Public (Object : in out Wiki_Page_Ref; Value : in Boolean); -- Get whether the wiki page is public function Get_Is_Public (Object : in Wiki_Page_Ref) return Boolean; -- Set the page title procedure Set_Title (Object : in out Wiki_Page_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String); procedure Set_Title (Object : in out Wiki_Page_Ref; Value : in String); -- Get the page title function Get_Title (Object : in Wiki_Page_Ref) return Ada.Strings.Unbounded.Unbounded_String; function Get_Title (Object : in Wiki_Page_Ref) return String; -- function Get_Version (Object : in Wiki_Page_Ref) return Integer; -- Set a read counter which indicates how many times the page was read. procedure Set_Read_Count (Object : in out Wiki_Page_Ref; Value : in Integer); -- Get a read counter which indicates how many times the page was read. function Get_Read_Count (Object : in Wiki_Page_Ref) return Integer; -- Set the wiki page preview. procedure Set_Preview (Object : in out Wiki_Page_Ref; Value : in AWA.Images.Models.Image_Ref'Class); -- Get the wiki page preview. function Get_Preview (Object : in Wiki_Page_Ref) return AWA.Images.Models.Image_Ref'Class; -- Set the wiki space that this page belongs to procedure Set_Wiki (Object : in out Wiki_Page_Ref; Value : in AWA.Wikis.Models.Wiki_Space_Ref'Class); -- Get the wiki space that this page belongs to function Get_Wiki (Object : in Wiki_Page_Ref) return AWA.Wikis.Models.Wiki_Space_Ref'Class; -- Set the current content (or last version) procedure Set_Content (Object : in out Wiki_Page_Ref; Value : in AWA.Wikis.Models.Wiki_Content_Ref'Class); -- Get the current content (or last version) function Get_Content (Object : in Wiki_Page_Ref) return AWA.Wikis.Models.Wiki_Content_Ref'Class; -- Load the entity identified by 'Id'. -- Raises the NOT_FOUND exception if it does not exist. procedure Load (Object : in out Wiki_Page_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 Wiki_Page_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 Wiki_Page_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 Wiki_Page_Ref; Session : in out ADO.Sessions.Master_Session'Class); -- Delete the entity. overriding procedure Delete (Object : in out Wiki_Page_Ref; Session : in out ADO.Sessions.Master_Session'Class); overriding function Get_Value (From : in Wiki_Page_Ref; Name : in String) return Util.Beans.Objects.Object; -- Table definition WIKI_PAGE_TABLE : constant ADO.Schemas.Class_Mapping_Access; -- Internal method to allocate the Object_Record instance overriding procedure Allocate (Object : in out Wiki_Page_Ref); -- Copy of the object. procedure Copy (Object : in Wiki_Page_Ref; Into : in out Wiki_Page_Ref); -- Create an object key for Wiki_Content. function Wiki_Content_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key; -- Create an object key for Wiki_Content from a string. -- Raises Constraint_Error if the string cannot be converted into the object key. function Wiki_Content_Key (Id : in String) return ADO.Objects.Object_Key; Null_Wiki_Content : constant Wiki_Content_Ref; function "=" (Left, Right : Wiki_Content_Ref'Class) return Boolean; -- Set the wiki page content identifier procedure Set_Id (Object : in out Wiki_Content_Ref; Value : in ADO.Identifier); -- Get the wiki page content identifier function Get_Id (Object : in Wiki_Content_Ref) return ADO.Identifier; -- Set the wiki content creation date procedure Set_Create_Date (Object : in out Wiki_Content_Ref; Value : in Ada.Calendar.Time); -- Get the wiki content creation date function Get_Create_Date (Object : in Wiki_Content_Ref) return Ada.Calendar.Time; -- Set the wiki text content procedure Set_Content (Object : in out Wiki_Content_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String); procedure Set_Content (Object : in out Wiki_Content_Ref; Value : in String); -- Get the wiki text content function Get_Content (Object : in Wiki_Content_Ref) return Ada.Strings.Unbounded.Unbounded_String; function Get_Content (Object : in Wiki_Content_Ref) return String; -- Set the format type used used by the wiki content procedure Set_Format (Object : in out Wiki_Content_Ref; Value : in AWA.Wikis.Models.Format_Type); -- Get the format type used used by the wiki content function Get_Format (Object : in Wiki_Content_Ref) return AWA.Wikis.Models.Format_Type; -- Set the content comment string procedure Set_Save_Comment (Object : in out Wiki_Content_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String); procedure Set_Save_Comment (Object : in out Wiki_Content_Ref; Value : in String); -- Get the content comment string function Get_Save_Comment (Object : in Wiki_Content_Ref) return Ada.Strings.Unbounded.Unbounded_String; function Get_Save_Comment (Object : in Wiki_Content_Ref) return String; -- function Get_Version (Object : in Wiki_Content_Ref) return Integer; -- Set the wiki page version procedure Set_Page_Version (Object : in out Wiki_Content_Ref; Value : in Integer); -- Get the wiki page version function Get_Page_Version (Object : in Wiki_Content_Ref) return Integer; -- Set the wiki page that this Wiki_Content belongs to procedure Set_Page (Object : in out Wiki_Content_Ref; Value : in AWA.Wikis.Models.Wiki_Page_Ref'Class); -- Get the wiki page that this Wiki_Content belongs to function Get_Page (Object : in Wiki_Content_Ref) return AWA.Wikis.Models.Wiki_Page_Ref'Class; -- Set the page version author procedure Set_Author (Object : in out Wiki_Content_Ref; Value : in AWA.Users.Models.User_Ref'Class); -- Get the page version author function Get_Author (Object : in Wiki_Content_Ref) return AWA.Users.Models.User_Ref'Class; -- Load the entity identified by 'Id'. -- Raises the NOT_FOUND exception if it does not exist. procedure Load (Object : in out Wiki_Content_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 Wiki_Content_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 Wiki_Content_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 Wiki_Content_Ref; Session : in out ADO.Sessions.Master_Session'Class); -- Delete the entity. overriding procedure Delete (Object : in out Wiki_Content_Ref; Session : in out ADO.Sessions.Master_Session'Class); overriding function Get_Value (From : in Wiki_Content_Ref; Name : in String) return Util.Beans.Objects.Object; -- Table definition WIKI_CONTENT_TABLE : constant ADO.Schemas.Class_Mapping_Access; -- Internal method to allocate the Object_Record instance overriding procedure Allocate (Object : in out Wiki_Content_Ref); -- Copy of the object. procedure Copy (Object : in Wiki_Content_Ref; Into : in out Wiki_Content_Ref); Query_Page_Access_Stats : constant ADO.Queries.Query_Definition_Access; -- -------------------- -- The information about an image used in a wiki page. -- -------------------- type Wiki_Image_Bean is abstract new Util.Beans.Basic.Bean and Util.Beans.Methods.Method_Bean with record -- the image folder identifier. Folder_Id : ADO.Identifier; -- the image file identifier. Id : ADO.Identifier; -- the file creation date. Create_Date : Ada.Calendar.Time; -- the file storage URI. Uri : Ada.Strings.Unbounded.Unbounded_String; -- the file storage URI. Storage : AWA.Storages.Models.Storage_Type; -- the file mime type. Mime_Type : Ada.Strings.Unbounded.Unbounded_String; -- the file size. File_Size : Integer; -- the image width. Width : Integer; -- the image height. Height : Integer; end record; -- This bean provides some methods that can be used in a Method_Expression. overriding function Get_Method_Bindings (From : in Wiki_Image_Bean) return Util.Beans.Methods.Method_Binding_Array_Access; -- Get the bean attribute identified by the name. overriding function Get_Value (From : in Wiki_Image_Bean; Name : in String) return Util.Beans.Objects.Object; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out Wiki_Image_Bean; Name : in String; Value : in Util.Beans.Objects.Object); procedure Load (Bean : in out Wiki_Image_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; -- Read in the object the data from the query result and prepare to read the next row. -- If there is no row, raise the ADO.NOT_FOUND exception. procedure Read (Into : in out Wiki_Image_Bean; Stmt : in out ADO.Statements.Query_Statement'Class); -- Run the query controlled by <b>Context</b> and load the result in <b>Object</b>. procedure Load (Object : in out Wiki_Image_Bean'Class; Session : in out ADO.Sessions.Session'Class; Context : in out ADO.Queries.Context'Class); Query_Wiki_Image : constant ADO.Queries.Query_Definition_Access; -- -------------------- -- The information about an image used in a wiki page. -- -------------------- type Wiki_Image_Info is new Util.Beans.Basic.Bean with record -- the image folder identifier. Folder_Id : ADO.Identifier; -- the image file identifier. Id : ADO.Identifier; -- the file creation date. Create_Date : Ada.Calendar.Time; -- the file storage URI. Uri : Ada.Strings.Unbounded.Unbounded_String; -- the file storage URI. Storage : AWA.Storages.Models.Storage_Type; -- the file mime type. Mime_Type : Ada.Strings.Unbounded.Unbounded_String; -- the file size. File_Size : Integer; -- the image width. Width : Integer; -- the image height. Height : Integer; end record; -- Get the bean attribute identified by the name. overriding function Get_Value (From : in Wiki_Image_Info; Name : in String) return Util.Beans.Objects.Object; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out Wiki_Image_Info; Name : in String; Value : in Util.Beans.Objects.Object); package Wiki_Image_Info_Beans is new Util.Beans.Basic.Lists (Element_Type => Wiki_Image_Info); package Wiki_Image_Info_Vectors renames Wiki_Image_Info_Beans.Vectors; subtype Wiki_Image_Info_List_Bean is Wiki_Image_Info_Beans.List_Bean; type Wiki_Image_Info_List_Bean_Access is access all Wiki_Image_Info_List_Bean; -- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>. procedure List (Object : in out Wiki_Image_Info_List_Bean'Class; Session : in out ADO.Sessions.Session'Class; Context : in out ADO.Queries.Context'Class); subtype Wiki_Image_Info_Vector is Wiki_Image_Info_Vectors.Vector; -- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>. procedure List (Object : in out Wiki_Image_Info_Vector; Session : in out ADO.Sessions.Session'Class; Context : in out ADO.Queries.Context'Class); Query_Wiki_Image_Get_Data : constant ADO.Queries.Query_Definition_Access; Query_Wiki_Image_Width_Get_Data : constant ADO.Queries.Query_Definition_Access; Query_Wiki_Image_Height_Get_Data : constant ADO.Queries.Query_Definition_Access; -- -------------------- -- The list of wikis. -- -------------------- type Wiki_Info is new Util.Beans.Basic.Bean with record -- the wiki space identifier. Id : ADO.Identifier; -- the wiki name. Name : Ada.Strings.Unbounded.Unbounded_String; -- whether the wiki is public. Is_Public : Boolean; -- the wiki creation date. Create_Date : Ada.Calendar.Time; -- the number of pages in the wiki. Page_Count : Integer; end record; -- Get the bean attribute identified by the name. overriding function Get_Value (From : in Wiki_Info; Name : in String) return Util.Beans.Objects.Object; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out Wiki_Info; Name : in String; Value : in Util.Beans.Objects.Object); package Wiki_Info_Beans is new Util.Beans.Basic.Lists (Element_Type => Wiki_Info); package Wiki_Info_Vectors renames Wiki_Info_Beans.Vectors; subtype Wiki_Info_List_Bean is Wiki_Info_Beans.List_Bean; type Wiki_Info_List_Bean_Access is access all Wiki_Info_List_Bean; -- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>. procedure List (Object : in out Wiki_Info_List_Bean'Class; Session : in out ADO.Sessions.Session'Class; Context : in out ADO.Queries.Context'Class); subtype Wiki_Info_Vector is Wiki_Info_Vectors.Vector; -- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>. procedure List (Object : in out Wiki_Info_Vector; Session : in out ADO.Sessions.Session'Class; Context : in out ADO.Queries.Context'Class); Query_Wiki_List : constant ADO.Queries.Query_Definition_Access; -- -------------------- -- The information about a wiki page. -- -------------------- type Wiki_Page_Info is new Util.Beans.Basic.Bean with record -- the wiki page identifier. Id : ADO.Identifier; -- the wiki page name. Name : Ada.Strings.Unbounded.Unbounded_String; -- the wiki page title. Title : Ada.Strings.Unbounded.Unbounded_String; -- whether the wiki is public. Is_Public : Boolean; -- the last version. Last_Version : Integer; -- the read count. Read_Count : Integer; -- the wiki creation date. Create_Date : Ada.Calendar.Time; -- the wiki page author. Author : Ada.Strings.Unbounded.Unbounded_String; end record; -- Get the bean attribute identified by the name. overriding function Get_Value (From : in Wiki_Page_Info; Name : in String) return Util.Beans.Objects.Object; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out Wiki_Page_Info; Name : in String; Value : in Util.Beans.Objects.Object); package Wiki_Page_Info_Beans is new Util.Beans.Basic.Lists (Element_Type => Wiki_Page_Info); package Wiki_Page_Info_Vectors renames Wiki_Page_Info_Beans.Vectors; subtype Wiki_Page_Info_List_Bean is Wiki_Page_Info_Beans.List_Bean; type Wiki_Page_Info_List_Bean_Access is access all Wiki_Page_Info_List_Bean; -- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>. procedure List (Object : in out Wiki_Page_Info_List_Bean'Class; Session : in out ADO.Sessions.Session'Class; Context : in out ADO.Queries.Context'Class); subtype Wiki_Page_Info_Vector is Wiki_Page_Info_Vectors.Vector; -- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>. procedure List (Object : in out Wiki_Page_Info_Vector; Session : in out ADO.Sessions.Session'Class; Context : in out ADO.Queries.Context'Class); Query_Wiki_Page_List : constant ADO.Queries.Query_Definition_Access; Query_Wiki_Page_Tag_List : constant ADO.Queries.Query_Definition_Access; -- -------------------- -- The information about a wiki page version. -- -------------------- type Wiki_Version_Info is new Util.Beans.Basic.Bean with record -- the wiki page identifier. Id : ADO.Identifier; -- the wiki page version comment. Comment : Ada.Strings.Unbounded.Unbounded_String; -- the wiki page creation date. Create_Date : Ada.Calendar.Time; -- the page version. Page_Version : Integer; -- the wiki page author. Author : Ada.Strings.Unbounded.Unbounded_String; end record; -- Get the bean attribute identified by the name. overriding function Get_Value (From : in Wiki_Version_Info; Name : in String) return Util.Beans.Objects.Object; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out Wiki_Version_Info; Name : in String; Value : in Util.Beans.Objects.Object); package Wiki_Version_Info_Beans is new Util.Beans.Basic.Lists (Element_Type => Wiki_Version_Info); package Wiki_Version_Info_Vectors renames Wiki_Version_Info_Beans.Vectors; subtype Wiki_Version_Info_List_Bean is Wiki_Version_Info_Beans.List_Bean; type Wiki_Version_Info_List_Bean_Access is access all Wiki_Version_Info_List_Bean; -- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>. procedure List (Object : in out Wiki_Version_Info_List_Bean'Class; Session : in out ADO.Sessions.Session'Class; Context : in out ADO.Queries.Context'Class); subtype Wiki_Version_Info_Vector is Wiki_Version_Info_Vectors.Vector; -- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>. procedure List (Object : in out Wiki_Version_Info_Vector; Session : in out ADO.Sessions.Session'Class; Context : in out ADO.Queries.Context'Class); Query_Wiki_Version_List : constant ADO.Queries.Query_Definition_Access; -- -------------------- -- The information about a wiki page. -- -------------------- type Wiki_View_Info is abstract new Util.Beans.Basic.Bean and Util.Beans.Methods.Method_Bean with record -- the wiki page identifier. Id : ADO.Identifier; -- the wiki page name. Name : Ada.Strings.Unbounded.Unbounded_String; -- the wiki page title. Title : Ada.Strings.Unbounded.Unbounded_String; -- whether the wiki is public. Is_Public : Boolean; -- the last version. Version : Integer; -- the number of times the page was displayed. Read_Count : Integer; -- the wiki page creation date. Date : Ada.Calendar.Time; -- the wiki page format. Format : AWA.Wikis.Models.Format_Type; -- the wiki page content. Content : Ada.Strings.Unbounded.Unbounded_String; -- the wiki version comment. Save_Comment : Ada.Strings.Unbounded.Unbounded_String; -- the wiki page left side panel. Left_Side : Ada.Strings.Unbounded.Unbounded_String; -- the wiki page right side panel. Right_Side : Ada.Strings.Unbounded.Unbounded_String; -- the wiki side format. Side_Format : AWA.Wikis.Models.Format_Type; -- the wiki page author. Author : Ada.Strings.Unbounded.Unbounded_String; -- the acl Id if there is one. Acl_Id : ADO.Identifier; end record; -- This bean provides some methods that can be used in a Method_Expression. overriding function Get_Method_Bindings (From : in Wiki_View_Info) return Util.Beans.Methods.Method_Binding_Array_Access; -- Get the bean attribute identified by the name. overriding function Get_Value (From : in Wiki_View_Info; Name : in String) return Util.Beans.Objects.Object; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out Wiki_View_Info; Name : in String; Value : in Util.Beans.Objects.Object); procedure Load (Bean : in out Wiki_View_Info; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; -- Read in the object the data from the query result and prepare to read the next row. -- If there is no row, raise the ADO.NOT_FOUND exception. procedure Read (Into : in out Wiki_View_Info; Stmt : in out ADO.Statements.Query_Statement'Class); -- Run the query controlled by <b>Context</b> and load the result in <b>Object</b>. procedure Load (Object : in out Wiki_View_Info'Class; Session : in out ADO.Sessions.Session'Class; Context : in out ADO.Queries.Context'Class); Query_Wiki_Page : constant ADO.Queries.Query_Definition_Access; Query_Wiki_Page_Id : constant ADO.Queries.Query_Definition_Access; Query_Wiki_Page_Content : constant ADO.Queries.Query_Definition_Access; Query_Wiki_Page_Name_Count : constant ADO.Queries.Query_Definition_Access; type Wiki_Space_Bean is abstract new AWA.Wikis.Models.Wiki_Space_Ref and Util.Beans.Basic.Bean and Util.Beans.Methods.Method_Bean with null record; -- This bean provides some methods that can be used in a Method_Expression. overriding function Get_Method_Bindings (From : in Wiki_Space_Bean) return Util.Beans.Methods.Method_Binding_Array_Access; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out Wiki_Space_Bean; Name : in String; Value : in Util.Beans.Objects.Object); procedure Save (Bean : in out Wiki_Space_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; procedure Load (Bean : in out Wiki_Space_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; -- -------------------- -- setup the page bean when the wiki page is created. -- -------------------- type Wiki_Page_Bean is abstract new AWA.Wikis.Models.Wiki_Page_Ref and Util.Beans.Basic.Bean and Util.Beans.Methods.Method_Bean with null record; -- This bean provides some methods that can be used in a Method_Expression. overriding function Get_Method_Bindings (From : in Wiki_Page_Bean) return Util.Beans.Methods.Method_Binding_Array_Access; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out Wiki_Page_Bean; Name : in String; Value : in Util.Beans.Objects.Object); procedure Save (Bean : in out Wiki_Page_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; procedure Delete (Bean : in out Wiki_Page_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; procedure Load (Bean : in out Wiki_Page_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; procedure Setup (Bean : in out Wiki_Page_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; -- -------------------- -- Load the list items -- -------------------- type Wiki_Page_List_Bean is abstract limited new Util.Beans.Basic.Bean and Util.Beans.Methods.Method_Bean with record -- the page number being displayed (for pagination) Page : Integer; -- The number of wiki pages Count : Integer; -- the number of items in the page Page_Size : Integer; -- the tag to filter the list Tag : Ada.Strings.Unbounded.Unbounded_String; -- the wiki identifier Wiki_Id : ADO.Identifier; -- the sort list mode. Sort : Ada.Strings.Unbounded.Unbounded_String; end record; -- This bean provides some methods that can be used in a Method_Expression. overriding function Get_Method_Bindings (From : in Wiki_Page_List_Bean) return Util.Beans.Methods.Method_Binding_Array_Access; -- Get the bean attribute identified by the name. overriding function Get_Value (From : in Wiki_Page_List_Bean; Name : in String) return Util.Beans.Objects.Object; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out Wiki_Page_List_Bean; Name : in String; Value : in Util.Beans.Objects.Object); procedure Load (Bean : in out Wiki_Page_List_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; type Wiki_Version_List_Bean is abstract limited new Util.Beans.Basic.Bean and Util.Beans.Methods.Method_Bean with record -- the page number. Page : Integer; -- the number of versions. Count : Integer; -- the number of wiki version per display page. Page_Size : Integer; -- the wiki identifier. Wiki_Id : ADO.Identifier; -- the wiki page id. Page_Id : ADO.Identifier; end record; -- This bean provides some methods that can be used in a Method_Expression. overriding function Get_Method_Bindings (From : in Wiki_Version_List_Bean) return Util.Beans.Methods.Method_Binding_Array_Access; -- Get the bean attribute identified by the name. overriding function Get_Value (From : in Wiki_Version_List_Bean; Name : in String) return Util.Beans.Objects.Object; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out Wiki_Version_List_Bean; Name : in String; Value : in Util.Beans.Objects.Object); procedure Load (Bean : in out Wiki_Version_List_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; type Wiki_Page_Info_Bean is abstract limited new Util.Beans.Basic.Bean and Util.Beans.Methods.Method_Bean with record -- the wiki identifier. Wiki_Id : ADO.Identifier; -- the wiki page identifier. Page_Id : ADO.Identifier; end record; -- This bean provides some methods that can be used in a Method_Expression. overriding function Get_Method_Bindings (From : in Wiki_Page_Info_Bean) return Util.Beans.Methods.Method_Binding_Array_Access; -- Get the bean attribute identified by the name. overriding function Get_Value (From : in Wiki_Page_Info_Bean; Name : in String) return Util.Beans.Objects.Object; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out Wiki_Page_Info_Bean; Name : in String; Value : in Util.Beans.Objects.Object); procedure Load (Bean : in out Wiki_Page_Info_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; private WIKI_SPACE_NAME : aliased constant String := "awa_wiki_space"; COL_0_1_NAME : aliased constant String := "id"; COL_1_1_NAME : aliased constant String := "name"; COL_2_1_NAME : aliased constant String := "is_public"; COL_3_1_NAME : aliased constant String := "version"; COL_4_1_NAME : aliased constant String := "create_date"; COL_5_1_NAME : aliased constant String := "left_side"; COL_6_1_NAME : aliased constant String := "right_side"; COL_7_1_NAME : aliased constant String := "format"; COL_8_1_NAME : aliased constant String := "workspace_id"; WIKI_SPACE_DEF : aliased constant ADO.Schemas.Class_Mapping := (Count => 9, Table => WIKI_SPACE_NAME'Access, Members => ( 1 => COL_0_1_NAME'Access, 2 => COL_1_1_NAME'Access, 3 => COL_2_1_NAME'Access, 4 => COL_3_1_NAME'Access, 5 => COL_4_1_NAME'Access, 6 => COL_5_1_NAME'Access, 7 => COL_6_1_NAME'Access, 8 => COL_7_1_NAME'Access, 9 => COL_8_1_NAME'Access ) ); WIKI_SPACE_TABLE : constant ADO.Schemas.Class_Mapping_Access := WIKI_SPACE_DEF'Access; Null_Wiki_Space : constant Wiki_Space_Ref := Wiki_Space_Ref'(ADO.Objects.Object_Ref with null record); type Wiki_Space_Impl is new ADO.Objects.Object_Record (Key_Type => ADO.Objects.KEY_INTEGER, Of_Class => WIKI_SPACE_DEF'Access) with record Name : Ada.Strings.Unbounded.Unbounded_String; Is_Public : Boolean; Version : Integer; Create_Date : Ada.Calendar.Time; Left_Side : Ada.Strings.Unbounded.Unbounded_String; Right_Side : Ada.Strings.Unbounded.Unbounded_String; Format : AWA.Wikis.Models.Format_Type; Workspace : AWA.Workspaces.Models.Workspace_Ref; end record; type Wiki_Space_Access is access all Wiki_Space_Impl; overriding procedure Destroy (Object : access Wiki_Space_Impl); overriding procedure Find (Object : in out Wiki_Space_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean); overriding procedure Load (Object : in out Wiki_Space_Impl; Session : in out ADO.Sessions.Session'Class); procedure Load (Object : in out Wiki_Space_Impl; Stmt : in out ADO.Statements.Query_Statement'Class; Session : in out ADO.Sessions.Session'Class); overriding procedure Save (Object : in out Wiki_Space_Impl; Session : in out ADO.Sessions.Master_Session'Class); procedure Create (Object : in out Wiki_Space_Impl; Session : in out ADO.Sessions.Master_Session'Class); overriding procedure Delete (Object : in out Wiki_Space_Impl; Session : in out ADO.Sessions.Master_Session'Class); procedure Set_Field (Object : in out Wiki_Space_Ref'Class; Impl : out Wiki_Space_Access); WIKI_PAGE_NAME : aliased constant String := "awa_wiki_page"; COL_0_2_NAME : aliased constant String := "id"; COL_1_2_NAME : aliased constant String := "name"; COL_2_2_NAME : aliased constant String := "last_version"; COL_3_2_NAME : aliased constant String := "is_public"; COL_4_2_NAME : aliased constant String := "title"; COL_5_2_NAME : aliased constant String := "version"; COL_6_2_NAME : aliased constant String := "read_count"; COL_7_2_NAME : aliased constant String := "preview_id"; COL_8_2_NAME : aliased constant String := "wiki_id"; COL_9_2_NAME : aliased constant String := "content_id"; WIKI_PAGE_DEF : aliased constant ADO.Schemas.Class_Mapping := (Count => 10, Table => WIKI_PAGE_NAME'Access, Members => ( 1 => COL_0_2_NAME'Access, 2 => COL_1_2_NAME'Access, 3 => COL_2_2_NAME'Access, 4 => COL_3_2_NAME'Access, 5 => COL_4_2_NAME'Access, 6 => COL_5_2_NAME'Access, 7 => COL_6_2_NAME'Access, 8 => COL_7_2_NAME'Access, 9 => COL_8_2_NAME'Access, 10 => COL_9_2_NAME'Access ) ); WIKI_PAGE_TABLE : constant ADO.Schemas.Class_Mapping_Access := WIKI_PAGE_DEF'Access; Null_Wiki_Page : constant Wiki_Page_Ref := Wiki_Page_Ref'(ADO.Objects.Object_Ref with null record); type Wiki_Page_Impl is new ADO.Objects.Object_Record (Key_Type => ADO.Objects.KEY_INTEGER, Of_Class => WIKI_PAGE_DEF'Access) with record Name : Ada.Strings.Unbounded.Unbounded_String; Last_Version : Integer; Is_Public : Boolean; Title : Ada.Strings.Unbounded.Unbounded_String; Version : Integer; Read_Count : Integer; Preview : AWA.Images.Models.Image_Ref; Wiki : AWA.Wikis.Models.Wiki_Space_Ref; Content : AWA.Wikis.Models.Wiki_Content_Ref; end record; type Wiki_Page_Access is access all Wiki_Page_Impl; overriding procedure Destroy (Object : access Wiki_Page_Impl); overriding procedure Find (Object : in out Wiki_Page_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean); overriding procedure Load (Object : in out Wiki_Page_Impl; Session : in out ADO.Sessions.Session'Class); procedure Load (Object : in out Wiki_Page_Impl; Stmt : in out ADO.Statements.Query_Statement'Class; Session : in out ADO.Sessions.Session'Class); overriding procedure Save (Object : in out Wiki_Page_Impl; Session : in out ADO.Sessions.Master_Session'Class); procedure Create (Object : in out Wiki_Page_Impl; Session : in out ADO.Sessions.Master_Session'Class); overriding procedure Delete (Object : in out Wiki_Page_Impl; Session : in out ADO.Sessions.Master_Session'Class); procedure Set_Field (Object : in out Wiki_Page_Ref'Class; Impl : out Wiki_Page_Access); WIKI_CONTENT_NAME : aliased constant String := "awa_wiki_content"; COL_0_3_NAME : aliased constant String := "id"; COL_1_3_NAME : aliased constant String := "create_date"; COL_2_3_NAME : aliased constant String := "content"; COL_3_3_NAME : aliased constant String := "format"; COL_4_3_NAME : aliased constant String := "save_comment"; COL_5_3_NAME : aliased constant String := "version"; COL_6_3_NAME : aliased constant String := "page_version"; COL_7_3_NAME : aliased constant String := "page_id"; COL_8_3_NAME : aliased constant String := "author_id"; WIKI_CONTENT_DEF : aliased constant ADO.Schemas.Class_Mapping := (Count => 9, Table => WIKI_CONTENT_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 ) ); WIKI_CONTENT_TABLE : constant ADO.Schemas.Class_Mapping_Access := WIKI_CONTENT_DEF'Access; Null_Wiki_Content : constant Wiki_Content_Ref := Wiki_Content_Ref'(ADO.Objects.Object_Ref with null record); type Wiki_Content_Impl is new ADO.Objects.Object_Record (Key_Type => ADO.Objects.KEY_INTEGER, Of_Class => WIKI_CONTENT_DEF'Access) with record Create_Date : Ada.Calendar.Time; Content : Ada.Strings.Unbounded.Unbounded_String; Format : AWA.Wikis.Models.Format_Type; Save_Comment : Ada.Strings.Unbounded.Unbounded_String; Version : Integer; Page_Version : Integer; Page : AWA.Wikis.Models.Wiki_Page_Ref; Author : AWA.Users.Models.User_Ref; end record; type Wiki_Content_Access is access all Wiki_Content_Impl; overriding procedure Destroy (Object : access Wiki_Content_Impl); overriding procedure Find (Object : in out Wiki_Content_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean); overriding procedure Load (Object : in out Wiki_Content_Impl; Session : in out ADO.Sessions.Session'Class); procedure Load (Object : in out Wiki_Content_Impl; Stmt : in out ADO.Statements.Query_Statement'Class; Session : in out ADO.Sessions.Session'Class); overriding procedure Save (Object : in out Wiki_Content_Impl; Session : in out ADO.Sessions.Master_Session'Class); procedure Create (Object : in out Wiki_Content_Impl; Session : in out ADO.Sessions.Master_Session'Class); overriding procedure Delete (Object : in out Wiki_Content_Impl; Session : in out ADO.Sessions.Master_Session'Class); procedure Set_Field (Object : in out Wiki_Content_Ref'Class; Impl : out Wiki_Content_Access); package File_1 is new ADO.Queries.Loaders.File (Path => "wiki-stat.xml", Sha1 => "9B2B599473F75F92CB5AB5045675E4CCEF926543"); package Def_Page_Access_Stats is new ADO.Queries.Loaders.Query (Name => "page-access-stats", File => File_1.File'Access); Query_Page_Access_Stats : constant ADO.Queries.Query_Definition_Access := Def_Page_Access_Stats.Query'Access; package File_2 is new ADO.Queries.Loaders.File (Path => "wiki-images-info.xml", Sha1 => "ACC06A1E40987526FBEB39D13B94AC44B833D516"); package Def_Wikiimagebean_Wiki_Image is new ADO.Queries.Loaders.Query (Name => "wiki-image", File => File_2.File'Access); Query_Wiki_Image : constant ADO.Queries.Query_Definition_Access := Def_Wikiimagebean_Wiki_Image.Query'Access; package File_3 is new ADO.Queries.Loaders.File (Path => "wiki-images.xml", Sha1 => "63109B4E802BF3B5AD1680973D6E7E348C4E57D2"); package Def_Wikiimageinfo_Wiki_Image_Get_Data is new ADO.Queries.Loaders.Query (Name => "wiki-image-get-data", File => File_3.File'Access); Query_Wiki_Image_Get_Data : constant ADO.Queries.Query_Definition_Access := Def_Wikiimageinfo_Wiki_Image_Get_Data.Query'Access; package Def_Wikiimageinfo_Wiki_Image_Width_Get_Data is new ADO.Queries.Loaders.Query (Name => "wiki-image-width-get-data", File => File_3.File'Access); Query_Wiki_Image_Width_Get_Data : constant ADO.Queries.Query_Definition_Access := Def_Wikiimageinfo_Wiki_Image_Width_Get_Data.Query'Access; package Def_Wikiimageinfo_Wiki_Image_Height_Get_Data is new ADO.Queries.Loaders.Query (Name => "wiki-image-height-get-data", File => File_3.File'Access); Query_Wiki_Image_Height_Get_Data : constant ADO.Queries.Query_Definition_Access := Def_Wikiimageinfo_Wiki_Image_Height_Get_Data.Query'Access; package File_4 is new ADO.Queries.Loaders.File (Path => "wiki-list.xml", Sha1 => "134AA901EAD20B164194D37CC198D8B6092FF0DF"); package Def_Wikiinfo_Wiki_List is new ADO.Queries.Loaders.Query (Name => "wiki-list", File => File_4.File'Access); Query_Wiki_List : constant ADO.Queries.Query_Definition_Access := Def_Wikiinfo_Wiki_List.Query'Access; package File_5 is new ADO.Queries.Loaders.File (Path => "wiki-pages.xml", Sha1 => "3D026597D06A525412B37B034831E5ABC1F9EFA5"); package Def_Wikipageinfo_Wiki_Page_List is new ADO.Queries.Loaders.Query (Name => "wiki-page-list", File => File_5.File'Access); Query_Wiki_Page_List : constant ADO.Queries.Query_Definition_Access := Def_Wikipageinfo_Wiki_Page_List.Query'Access; package Def_Wikipageinfo_Wiki_Page_Tag_List is new ADO.Queries.Loaders.Query (Name => "wiki-page-tag-list", File => File_5.File'Access); Query_Wiki_Page_Tag_List : constant ADO.Queries.Query_Definition_Access := Def_Wikipageinfo_Wiki_Page_Tag_List.Query'Access; package File_6 is new ADO.Queries.Loaders.File (Path => "wiki-history.xml", Sha1 => "AC42BF3C04729AEE8ADED975B16EBB859D1E7276"); package Def_Wikiversioninfo_Wiki_Version_List is new ADO.Queries.Loaders.Query (Name => "wiki-version-list", File => File_6.File'Access); Query_Wiki_Version_List : constant ADO.Queries.Query_Definition_Access := Def_Wikiversioninfo_Wiki_Version_List.Query'Access; package File_7 is new ADO.Queries.Loaders.File (Path => "wiki-page.xml", Sha1 => "AF1DAD113E5BB4F34507D92D188098C84BF1174A"); package Def_Wikiviewinfo_Wiki_Page is new ADO.Queries.Loaders.Query (Name => "wiki-page", File => File_7.File'Access); Query_Wiki_Page : constant ADO.Queries.Query_Definition_Access := Def_Wikiviewinfo_Wiki_Page.Query'Access; package Def_Wikiviewinfo_Wiki_Page_Id is new ADO.Queries.Loaders.Query (Name => "wiki-page-id", File => File_7.File'Access); Query_Wiki_Page_Id : constant ADO.Queries.Query_Definition_Access := Def_Wikiviewinfo_Wiki_Page_Id.Query'Access; package Def_Wikiviewinfo_Wiki_Page_Content is new ADO.Queries.Loaders.Query (Name => "wiki-page-content", File => File_7.File'Access); Query_Wiki_Page_Content : constant ADO.Queries.Query_Definition_Access := Def_Wikiviewinfo_Wiki_Page_Content.Query'Access; package Def_Wikiviewinfo_Wiki_Page_Name_Count is new ADO.Queries.Loaders.Query (Name => "wiki-page-name-count", File => File_7.File'Access); Query_Wiki_Page_Name_Count : constant ADO.Queries.Query_Definition_Access := Def_Wikiviewinfo_Wiki_Page_Name_Count.Query'Access; end AWA.Wikis.Models;
package body Discr10 is function Get (X : R) return R is begin return R'(D1 => False, D2 => False, D3 => X.D3); end; end Discr10;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- 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$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Elements; with AMF.Internals.Helpers; with AMF.Internals.Tables.Utp_Attributes; with AMF.UML.Operations; with AMF.Visitors.Utp_Iterators; with AMF.Visitors.Utp_Visitors; package body AMF.Internals.Utp_Data_Selectors is ------------------------ -- Get_Base_Operation -- ------------------------ overriding function Get_Base_Operation (Self : not null access constant Utp_Data_Selector_Proxy) return AMF.UML.Operations.UML_Operation_Access is begin return AMF.UML.Operations.UML_Operation_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.Utp_Attributes.Internal_Get_Base_Operation (Self.Element))); end Get_Base_Operation; ------------------------ -- Set_Base_Operation -- ------------------------ overriding procedure Set_Base_Operation (Self : not null access Utp_Data_Selector_Proxy; To : AMF.UML.Operations.UML_Operation_Access) is begin AMF.Internals.Tables.Utp_Attributes.Internal_Set_Base_Operation (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_Base_Operation; ------------------- -- Enter_Element -- ------------------- overriding procedure Enter_Element (Self : not null access constant Utp_Data_Selector_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Visitor in AMF.Visitors.Utp_Visitors.Utp_Visitor'Class then AMF.Visitors.Utp_Visitors.Utp_Visitor'Class (Visitor).Enter_Data_Selector (AMF.Utp.Data_Selectors.Utp_Data_Selector_Access (Self), Control); end if; end Enter_Element; ------------------- -- Leave_Element -- ------------------- overriding procedure Leave_Element (Self : not null access constant Utp_Data_Selector_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Visitor in AMF.Visitors.Utp_Visitors.Utp_Visitor'Class then AMF.Visitors.Utp_Visitors.Utp_Visitor'Class (Visitor).Leave_Data_Selector (AMF.Utp.Data_Selectors.Utp_Data_Selector_Access (Self), Control); end if; end Leave_Element; ------------------- -- Visit_Element -- ------------------- overriding procedure Visit_Element (Self : not null access constant Utp_Data_Selector_Proxy; Iterator : in out AMF.Visitors.Abstract_Iterator'Class; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Iterator in AMF.Visitors.Utp_Iterators.Utp_Iterator'Class then AMF.Visitors.Utp_Iterators.Utp_Iterator'Class (Iterator).Visit_Data_Selector (Visitor, AMF.Utp.Data_Selectors.Utp_Data_Selector_Access (Self), Control); end if; end Visit_Element; end AMF.Internals.Utp_Data_Selectors;
-- { dg-do run } with Init7; use Init7; with Text_IO; use Text_IO; with Dump; procedure T7 is Verbose : constant Boolean := False; Local_R1 : R1; Local_R2 : R2; begin Local_R1.I := My_R1.I + 1; Local_R1.N.C1 := My_R1.N.C1 + 1; Local_R1.N.C2 := My_R1.N.C2 + 1; Local_R1.N.C3 := My_R1.N.C3 + 1; Put ("Local_R1 :"); Dump (Local_R1'Address, R1'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "Local_R1 : 79 56 34 12 13 00 ab 00 35 00 cd 00 57 00 ef 00.*\n" } Local_R2.I := My_R2.I + 1; Local_R2.N.C1 := My_R2.N.C1 + 1; Local_R2.N.C2 := My_R2.N.C2 + 1; Local_R2.N.C3 := My_R2.N.C3 + 1; Put ("Local_R2 :"); Dump (Local_R2'Address, R2'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "Local_R2 : 12 34 56 79 00 ab 00 13 00 cd 00 35 00 ef 00 57.*\n" } -- Local_R1 := (I => 16#12345678#, N => (16#AB0012#, 16#CD0034#, 16#EF0056#)); Put ("Local_R1 :"); Dump (Local_R1'Address, R1'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "Local_R1 : 78 56 34 12 12 00 ab 00 34 00 cd 00 56 00 ef 00.*\n" } Local_R2 := (I => 16#12345678#, N => (16#AB0012#, 16#CD0034#, 16#EF0056#)); Put ("Local_R2 :"); Dump (Local_R2'Address, R2'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "Local_R2 : 12 34 56 78 00 ab 00 12 00 cd 00 34 00 ef 00 56.*\n" } Local_R1.I := Local_R1.I + 1; Local_R1.N.C1 := Local_R1.N.C1 + 1; Local_R1.N.C2 := Local_R1.N.C2 + 1; Local_R1.N.C3 := Local_R1.N.C3 + 1; Put ("Local_R1 :"); Dump (Local_R1'Address, R1'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "Local_R1 : 79 56 34 12 13 00 ab 00 35 00 cd 00 57 00 ef 00.*\n" } Local_R2.I := Local_R2.I + 1; Local_R2.N.C1 := Local_R2.N.C1 + 1; Local_R2.N.C2 := Local_R2.N.C2 + 1; Local_R2.N.C3 := Local_R2.N.C3 + 1; Put ("Local_R2 :"); Dump (Local_R2'Address, R2'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "Local_R2 : 12 34 56 79 00 ab 00 13 00 cd 00 35 00 ef 00 57.*\n" } end;
-- Copyright 2013-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); end Pck;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017-2018, Fabien Chouteau -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ private package AGATE.Arch is procedure Jump_In_Task (T : Task_ID) with No_Return; procedure Idle_Procedure; procedure Initialize_Task_Context (T : Task_ID); end AGATE.Arch;
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Program.Elements.Access_Types; with Program.Lexical_Elements; with Program.Elements.Parameter_Specifications; package Program.Elements.Procedure_Access_Types is pragma Pure (Program.Elements.Procedure_Access_Types); type Procedure_Access_Type is limited interface and Program.Elements.Access_Types.Access_Type; type Procedure_Access_Type_Access is access all Procedure_Access_Type'Class with Storage_Size => 0; not overriding function Parameters (Self : Procedure_Access_Type) return Program.Elements.Parameter_Specifications .Parameter_Specification_Vector_Access is abstract; not overriding function Has_Not_Null (Self : Procedure_Access_Type) return Boolean is abstract; not overriding function Has_Protected (Self : Procedure_Access_Type) return Boolean is abstract; type Procedure_Access_Type_Text is limited interface; type Procedure_Access_Type_Text_Access is access all Procedure_Access_Type_Text'Class with Storage_Size => 0; not overriding function To_Procedure_Access_Type_Text (Self : in out Procedure_Access_Type) return Procedure_Access_Type_Text_Access is abstract; not overriding function Not_Token (Self : Procedure_Access_Type_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Null_Token (Self : Procedure_Access_Type_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Access_Token (Self : Procedure_Access_Type_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Protected_Token (Self : Procedure_Access_Type_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Procedure_Token (Self : Procedure_Access_Type_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Left_Bracket_Token (Self : Procedure_Access_Type_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Right_Bracket_Token (Self : Procedure_Access_Type_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; end Program.Elements.Procedure_Access_Types;
pragma Style_Checks (Off); -- This spec has been automatically generated from STM32G474xx.svd pragma Restrictions (No_Elaboration_Code); with HAL; with System; package STM32_SVD.NVIC is pragma Preelaborate; --------------- -- Registers -- --------------- -- IPR_IPR_N array element subtype IPR_IPR_N_Element is HAL.UInt8; -- IPR_IPR_N array type IPR_IPR_N_Field_Array is array (0 .. 3) of IPR_IPR_N_Element with Component_Size => 8, Size => 32; -- Interrupt Priority Register type IPR_Register (As_Array : Boolean := False) is record case As_Array is when False => -- IPR_N as a value Val : HAL.UInt32; when True => -- IPR_N as an array Arr : IPR_IPR_N_Field_Array; end case; end record with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IPR_Register use record Val at 0 range 0 .. 31; Arr at 0 range 0 .. 31; end record; subtype STIR_INTID_Field is HAL.UInt9; -- Software trigger interrupt register type STIR_Register is record -- Software generated interrupt ID INTID : STIR_INTID_Field := 16#0#; -- unspecified Reserved_9_31 : HAL.UInt23 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for STIR_Register use record INTID at 0 range 0 .. 8; Reserved_9_31 at 0 range 9 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Nested Vectored Interrupt Controller type NVIC_Peripheral is record -- Interrupt Set-Enable Register ISER0 : aliased HAL.UInt32; -- Interrupt Set-Enable Register ISER1 : aliased HAL.UInt32; -- Interrupt Set-Enable Register ISER2 : aliased HAL.UInt32; -- Interrupt Set-Enable Register ISER3 : aliased HAL.UInt32; -- Interrupt Clear-Enable Register ICER0 : aliased HAL.UInt32; -- Interrupt Clear-Enable Register ICER1 : aliased HAL.UInt32; -- Interrupt Clear-Enable Register ICER2 : aliased HAL.UInt32; -- Interrupt Clear-Enable Register ICER3 : aliased HAL.UInt32; -- Interrupt Set-Pending Register ISPR0 : aliased HAL.UInt32; -- Interrupt Set-Pending Register ISPR1 : aliased HAL.UInt32; -- Interrupt Set-Pending Register ISPR2 : aliased HAL.UInt32; -- Interrupt Set-Pending Register ISPR3 : aliased HAL.UInt32; -- Interrupt Clear-Pending Register ICPR0 : aliased HAL.UInt32; -- Interrupt Clear-Pending Register ICPR1 : aliased HAL.UInt32; -- Interrupt Clear-Pending Register ICPR2 : aliased HAL.UInt32; -- Interrupt Clear-Pending Register ICPR3 : aliased HAL.UInt32; -- Interrupt Active Bit Register IABR0 : aliased HAL.UInt32; -- Interrupt Active Bit Register IABR1 : aliased HAL.UInt32; -- Interrupt Active Bit Register IABR2 : aliased HAL.UInt32; -- Interrupt Active Bit Register IABR3 : aliased HAL.UInt32; -- Interrupt Priority Register IPR0 : aliased IPR_Register; -- Interrupt Priority Register IPR1 : aliased IPR_Register; -- Interrupt Priority Register IPR2 : aliased IPR_Register; -- Interrupt Priority Register IPR3 : aliased IPR_Register; -- Interrupt Priority Register IPR4 : aliased IPR_Register; -- Interrupt Priority Register IPR5 : aliased IPR_Register; -- Interrupt Priority Register IPR6 : aliased IPR_Register; -- Interrupt Priority Register IPR7 : aliased IPR_Register; -- Interrupt Priority Register IPR8 : aliased IPR_Register; -- Interrupt Priority Register IPR9 : aliased IPR_Register; -- Interrupt Priority Register IPR10 : aliased IPR_Register; -- Interrupt Priority Register IPR11 : aliased IPR_Register; -- Interrupt Priority Register IPR12 : aliased IPR_Register; -- Interrupt Priority Register IPR13 : aliased IPR_Register; -- Interrupt Priority Register IPR14 : aliased IPR_Register; -- Interrupt Priority Register IPR15 : aliased IPR_Register; -- Interrupt Priority Register IPR16 : aliased IPR_Register; -- Interrupt Priority Register IPR17 : aliased IPR_Register; -- Interrupt Priority Register IPR18 : aliased IPR_Register; -- Interrupt Priority Register IPR19 : aliased IPR_Register; -- Interrupt Priority Register IPR20 : aliased IPR_Register; -- Interrupt Priority Register IPR21 : aliased HAL.UInt32; -- Interrupt Priority Register IPR22 : aliased HAL.UInt32; -- Interrupt Priority Register IPR23 : aliased HAL.UInt32; -- Interrupt Priority Register IPR24 : aliased HAL.UInt32; -- Interrupt Priority Register IPR25 : aliased HAL.UInt32; end record with Volatile; for NVIC_Peripheral use record ISER0 at 16#0# range 0 .. 31; ISER1 at 16#4# range 0 .. 31; ISER2 at 16#8# range 0 .. 31; ISER3 at 16#C# range 0 .. 31; ICER0 at 16#80# range 0 .. 31; ICER1 at 16#84# range 0 .. 31; ICER2 at 16#88# range 0 .. 31; ICER3 at 16#8C# range 0 .. 31; ISPR0 at 16#100# range 0 .. 31; ISPR1 at 16#104# range 0 .. 31; ISPR2 at 16#108# range 0 .. 31; ISPR3 at 16#10C# range 0 .. 31; ICPR0 at 16#180# range 0 .. 31; ICPR1 at 16#184# range 0 .. 31; ICPR2 at 16#188# range 0 .. 31; ICPR3 at 16#18C# range 0 .. 31; IABR0 at 16#200# range 0 .. 31; IABR1 at 16#204# range 0 .. 31; IABR2 at 16#208# range 0 .. 31; IABR3 at 16#20C# range 0 .. 31; IPR0 at 16#300# range 0 .. 31; IPR1 at 16#304# range 0 .. 31; IPR2 at 16#308# range 0 .. 31; IPR3 at 16#30C# range 0 .. 31; IPR4 at 16#310# range 0 .. 31; IPR5 at 16#314# range 0 .. 31; IPR6 at 16#318# range 0 .. 31; IPR7 at 16#31C# range 0 .. 31; IPR8 at 16#320# range 0 .. 31; IPR9 at 16#324# range 0 .. 31; IPR10 at 16#328# range 0 .. 31; IPR11 at 16#32C# range 0 .. 31; IPR12 at 16#330# range 0 .. 31; IPR13 at 16#334# range 0 .. 31; IPR14 at 16#338# range 0 .. 31; IPR15 at 16#33C# range 0 .. 31; IPR16 at 16#340# range 0 .. 31; IPR17 at 16#344# range 0 .. 31; IPR18 at 16#348# range 0 .. 31; IPR19 at 16#34C# range 0 .. 31; IPR20 at 16#350# range 0 .. 31; IPR21 at 16#354# range 0 .. 31; IPR22 at 16#358# range 0 .. 31; IPR23 at 16#35C# range 0 .. 31; IPR24 at 16#360# range 0 .. 31; IPR25 at 16#364# range 0 .. 31; end record; -- Nested Vectored Interrupt Controller NVIC_Periph : aliased NVIC_Peripheral with Import, Address => NVIC_Base; -- Nested vectored interrupt controller type NVIC_STIR_Peripheral is record -- Software trigger interrupt register STIR : aliased STIR_Register; end record with Volatile; for NVIC_STIR_Peripheral use record STIR at 0 range 0 .. 31; end record; -- Nested vectored interrupt controller NVIC_STIR_Periph : aliased NVIC_STIR_Peripheral with Import, Address => NVIC_STIR_Base; end STM32_SVD.NVIC;
package ARM_Database is -- -- Ada reference manual formatter (ARM_Form). -- -- This package contains the database to store items for non-normative -- appendixes. -- -- --------------------------------------- -- Copyright 2000, 2004, 2005, 2006, 2011 -- AXE Consultants. All rights reserved. -- P.O. Box 1512, Madison WI 53701 -- E-Mail: randy@rrsoftware.com -- -- ARM_Form is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License version 3 -- as published by the Free Software Foundation. -- -- AXE CONSULTANTS MAKES THIS TOOL AND SOURCE CODE AVAILABLE ON AN "AS IS" -- BASIS AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY, -- CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR FUNCTIONING OF THIS TOOL. -- IN NO EVENT WILL AXE CONSULTANTS BE LIABLE FOR ANY GENERAL, -- CONSEQUENTIAL, INDIRECT, INCIDENTAL, EXEMPLARY, OR SPECIAL DAMAGES, -- EVEN IF AXE CONSULTANTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -- DAMAGES. -- -- A copy of the GNU General Public License is available in the file -- gpl-3-0.txt in the standard distribution of the ARM_Form tool. -- Otherwise, see <http://www.gnu.org/licenses/>. -- -- If the GPLv3 license is not satisfactory for your needs, a commercial -- use license is available for this tool. Contact Randy at AXE Consultants -- for more information. -- -- --------------------------------------- -- -- Edit History: -- -- 5/16/00 - RLB - Created package. -- 8/10/00 - RLB - Added Normal_Indexed_List to fix glossary problems. -- 8/28/00 - RLB - Added revision info to database. -- 10/28/04 - RLB - Added Inserted_Normal_Number change kind. -- 11/02/04 - RLB - Added Deleted_Inserted_Number change kind. -- 12/06/04 - RLB - Added Revised_Inserted_Number change kind. -- 1/19/05 - RLB - Added Added_Version. -- 2/15/06 - RLB - Added Deleted_No_Delete_Message and -- Deleted_Inserted_Number_No_Delete_Message change kinds. -- 10/18/06 - RLB - Added No_Deleted_Paragraph_Messages to Report. -- 10/18/11 - RLB - Changed to GPLv3 license. -- 10/20/11 - RLB - Added Initial_Version parameter. type Database_Type is tagged limited private; type Paragraph_Change_Kind_Type is (None, Inserted, Inserted_Normal_Number, Deleted, Deleted_Inserted_Number, Deleted_No_Delete_Message, Deleted_Inserted_Number_No_Delete_Message, Revised, Revised_Inserted_Number); Not_Valid_Error : exception; procedure Create (Database_Object : in out Database_Type); -- Initialize a database object. procedure Destroy (Database_Object : in out Database_Type); -- Destroy a database object, freeing any resources used. procedure Insert (Database_Object : in out Database_Type; Sort_Key : in String; Hang_Item : in String; Text : in String; Change_Kind : in Paragraph_Change_Kind_Type := ARM_Database.None; Version : in Character := '0'; Initial_Version : in Character := '0'); -- Insert an item into the database object. -- Sort_Key is the string on which this item will be sorted (if it -- is sorted). Hang_Item is the item which hangs out for the item -- in the report (if any). Text is the text for the item; the text -- may include formatting codes. Change_Kind and Version are the -- revision status for this item. Initial_Version is the version of -- the initial text for this item. type Format_Type is (Normal_List, Normal_Indexed_List, Bullet_List, Hanging_List); generic with procedure Format_Text (Text : in String; Text_Name : in String); procedure Report (Database_Object : in out Database_Type; In_Format : in Format_Type; Sorted : in Boolean; Added_Version : Character := '0'; No_Deleted_Paragraph_Messages : in Boolean := False); -- Output the items with the appropriate format to the -- "Format_Text" routine. "Format_Text" allows all commands -- for the full formatter. (Text_Name is an identifying name -- for error messages). This is an added list for Added_Version -- ('0' meaning it is not added); in that case, use normal numbers -- for items with a version less than or equal to Added_Version. -- (This is intended to be used to output the items to -- appropriate Format and Output objects; but we can't do that -- directly because that would make this unit recursive with -- ARM_Format. -- No paragraphs will be have deleted paragraph messages if -- No_Deleted_Paragraph_Messages is True. private type Item; type Item_List is access all Item; type Database_Type is tagged limited record Is_Valid : Boolean := False; List : Item_List; Item_Count : Natural; end record; end ARM_Database;
-- CC3125A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT CONSTRAINT_ERROR IS RAISED IF THE INITIAL VALUE OF A -- GENERIC IN PARAMETER DOES NOT SATISFY ITS SUBTYPE CONSTRAINT. -- THIS TEST CHECKS PARAMETERS OF A NON-GENERIC TYPE. -- DAT 8/10/81 -- SPS 4/14/82 WITH REPORT; USE REPORT; PROCEDURE CC3125A IS BEGIN TEST ("CC3125A","GENERIC PARAMETER DEFAULTS OF " & "NON-GENERIC TYPE EVALUATED AND CHECKED WHEN " & "DECLARATION IS INSTANTIATED AND DEFAULT USED"); FOR I IN 1 .. 3 LOOP COMMENT ("LOOP ITERATION"); BEGIN DECLARE SUBTYPE T IS INTEGER RANGE 1 .. IDENT_INT(1); SUBTYPE I_1_2 IS INTEGER RANGE IDENT_INT (1) .. IDENT_INT (2); GENERIC P,Q : T := I_1_2'(I); PACKAGE PKG IS R: T := P; END PKG; BEGIN BEGIN DECLARE PACKAGE P1 IS NEW PKG; BEGIN IF I = IDENT_INT(1) THEN IF P1.R /= IDENT_INT(1) THEN FAILED ("BAD INITIAL"& " VALUE"); END IF; ELSIF I = 2 THEN FAILED ("SUBTYPE NOT CHECKED AT " & "INSTANTIATION"); ELSE FAILED ("DEFAULT NOT EVALUATED AT " & "INSTANTIATION"); END IF; EXCEPTION WHEN OTHERS => FAILED ("WRONG HANDLER"); END; EXCEPTION WHEN CONSTRAINT_ERROR => CASE I IS WHEN 1 => FAILED ("INCORRECT EXCEPTION"); WHEN 2 => COMMENT ("CONSTRAINT CHECKED" & " ON INSTANTIATION"); WHEN 3 => COMMENT ("DEFAULT EVALUATED " & "ON INSTANTIATION"); END CASE; END; EXCEPTION WHEN OTHERS => FAILED ("WRONG EXCEPTION"); END; EXCEPTION WHEN CONSTRAINT_ERROR => CASE I IS WHEN 1 => FAILED ("NO EXCEPTION SHOULD BE RAISED"); WHEN 2 => FAILED ("DEFAULT CHECKED AGAINST " & "SUBTYPE AT DECLARATION"); WHEN 3 => FAILED ("DEFAULT EVALUATED AT " & "DECLARATION"); END CASE; END; END LOOP; RESULT; END CC3125A;
-- Lumen.Shader -- Helper routines to fetch shader source, load it, and compile -- -- Chip Richards, NiEstu, Phoenix AZ, Winter 2013 -- This code is covered by the ISC License: -- -- Copyright © 2010, NiEstu -- -- Permission to use, copy, modify, and/or 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.Directories; with Ada.Streams.Stream_IO; with Interfaces.C; with System; with Lumen.Binary; use type Lumen.Binary.Byte; package body Lumen.Shader is --------------------------------------------------------------------------- -- Read shader source from a disk file procedure From_File (Shader_Type : in GL.Enum; Name : in String; ID : out GL.UInt; Success : out Boolean) is Result : GL.UInt; Size : constant Ada.Directories.File_Size := Ada.Directories.Size (Name); Status : GL.Int; begin -- From_File -- Tell the GPU to create a new shader Result := GL.Create_Shader (Shader_Type); ID := Result; -- Read shader source from file declare use Ada.Streams; use type Ada.Directories.File_Size; File : Stream_IO.File_Type; -- +1 = room for terminating NUL Source : Stream_Element_Array (1 .. Stream_Element_Offset (Size + 1)); Last : Stream_Element_Offset; Source_Ptr : GL.Pointer := Source'Address; begin -- Open the file and try to read it all in one gulp, then close it Stream_IO.Open (File, Stream_IO.In_File, Name); Stream_IO.Read (File, Source, Last); Stream_IO.Close (File); -- Double-check that we got it all if Last /= Stream_Element_Offset (Size) then raise Read_Error with "Got only" & Stream_Element_Offset'Image (Last) & " bytes out of" & Ada.Directories.File_Size'Image (Size); end if; -- Add a NUL byte to the end of the source string Source (Source'Last) := 0; -- Pump the shader source down to the GPU GL.Shader_Source (Result, 1, Source_Ptr'Address, System.Null_Address); end; -- Tell it to compile the source GL.Compile_Shader (Result); -- Check that compile worked, return status to caller GL.Get_Shader (Result, GL.GL_COMPILE_STATUS, Status'Address); Success := GL.Bool (Status) = GL.GL_TRUE; return; end From_File; --------------------------------------------------------------------------- -- Use shader source provided in a string procedure From_String (Shader_Type : in GL.Enum; Source : in String; ID : out GL.UInt; Success : out Boolean) is Result : GL.UInt; -- doesn't hurt if caller already did it Text : String := Source & ASCII.NUL; Source_Ptr : GL.Pointer := Text'Address; Status : GL.Int; begin -- From_String -- Tell the GPU to create a new shader Result := GL.Create_Shader (Shader_Type); ID := Result; -- Pump the shader source down to the GPU GL.Shader_Source (Result, 1, Source_Ptr'Address, System.Null_Address); -- Tell it to compile the source GL.Compile_Shader (Result); -- Check that compile worked GL.Get_Shader (Result, GL.GL_COMPILE_STATUS, Status'Address); Success := GL.Bool (Status) = GL.GL_TRUE; return; end From_String; --------------------------------------------------------------------------- function Get_Info_Log (Shader : GL.UInt) return String is Log_Len : GL.Int; begin -- Get_Info_Log GL.Get_Shader (Shader, GL.GL_INFO_LOG_LENGTH, Log_Len'Address); declare Log : Interfaces.C.char_array (1 .. Interfaces.C.size_t (Log_Len)); Got : GL.SizeI; begin GL.Get_Shader_Info_Log (Shader, Log'Length, Got'Address, Log'Address); return Interfaces.C.To_Ada (Log); end; end Get_Info_Log; --------------------------------------------------------------------------- end Lumen.Shader;
------------------------------------------------------------------------------ -- -- -- THIS IS AN AUTOMATICALLY GENERATED FILE! DO NOT EDIT! -- -- -- -- WAVEFILES -- -- -- -- Test application -- -- -- -- The MIT License (MIT) -- -- -- -- Copyright (c) 2020 Gustavo A. Hoffmann -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining -- -- a copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, sublicense, and / or sell copies of the Software, and to -- -- permit persons to whom the Software is furnished to do so, subject to -- -- the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be -- -- included in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -- -- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -- -- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -- -- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -- -- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- ------------------------------------------------------------------------------ package body Generic_Fixed_PCM_Buffer_Ops is --------- -- "+" -- --------- function "+" (PCM_Ref : PCM_MC_Sample; PCM_DUT : PCM_MC_Sample) return PCM_MC_Sample is Max_Last : constant Positive := Positive'Max (PCM_Ref'Last, PCM_DUT'Last); PCM_Sum : PCM_MC_Sample (1 .. Max_Last); begin for I in 1 .. Max_Last loop PCM_Sum (I) := PCM_Ref (I) + PCM_DUT (I); end loop; return PCM_Sum; end "+"; --------- -- "-" -- --------- function "-" (PCM_Ref : PCM_MC_Sample; PCM_DUT : PCM_MC_Sample) return PCM_MC_Sample is Max_Last : constant Positive := Positive'Max (PCM_Ref'Last, PCM_DUT'Last); PCM_Diff : PCM_MC_Sample (1 .. Max_Last); begin for I in 1 .. Max_Last loop PCM_Diff (I) := PCM_Ref (I) - PCM_DUT (I); end loop; return PCM_Diff; end "-"; end Generic_Fixed_PCM_Buffer_Ops;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- I N T E R F A C E S . V X W O R K S . I O -- -- -- -- B o d y -- -- -- -- Copyright (C) 2002-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. -- -- -- ------------------------------------------------------------------------------ package body Interfaces.VxWorks.IO is -------------------------- -- Enable_Get_Immediate -- -------------------------- procedure Enable_Get_Immediate (File : Interfaces.C_Streams.FILEs; Success : out Boolean) is Status : int; Fd : int; begin Fd := fileno (File); Status := ioctl (Fd, FIOSETOPTIONS, OPT_RAW); if Status /= int (ERROR) then Success := True; else Success := False; end if; end Enable_Get_Immediate; --------------------------- -- Disable_Get_Immediate -- --------------------------- procedure Disable_Get_Immediate (File : Interfaces.C_Streams.FILEs; Success : out Boolean) is Status : int; Fd : int; begin Fd := fileno (File); Status := ioctl (Fd, FIOSETOPTIONS, OPT_TERMINAL); Success := (if Status /= int (ERROR) then True else False); end Disable_Get_Immediate; end Interfaces.VxWorks.IO;
with Interfaces.C; private with color_h; package Libtcod.Color is type RGB_Component is new Interfaces.C.unsigned_char; type Alpha is new Interfaces.C.unsigned_char; type Hue is new Float range 0.0 .. 360.0; type Saturation is new Float range 0.0 .. 1.0; type Value is new Float range 0.0 .. 1.0; type Color_Factor is new Float; -- A three channel color struct type RGB_Color is private; type RGBA_Color is private; -- Constructors -- function make_RGB_color(r, g, b : RGB_Component) return RGB_Color; function make_HSV_color(h : Hue; s : Saturation; v : Value) return RGB_Color; -- Setters/getters -- procedure set_RGB(color : in out RGB_Color; r, g, b : RGB_Component) with Inline; procedure set_RGBA(color : in out RGBA_Color; r, g, b : RGB_Component; a : Alpha) with Inline; procedure set_red(color : in out RGB_Color; r : RGB_Component) with Inline; function get_red(color : RGB_Color) return RGB_Component with Inline; procedure set_red(color : in out RGBA_Color; r : RGB_Component) with Inline; function get_red(color : RGBA_Color) return RGB_Component with Inline; procedure set_green(color : in out RGB_Color; g : RGB_Component) with Inline; function get_green(color : RGB_Color) return RGB_Component with Inline; procedure set_green(color : in out RGBA_Color; g : RGB_Component) with Inline; function get_green(color : RGBA_Color) return RGB_Component with Inline; procedure set_blue(color : in out RGB_Color; b : RGB_Component) with Inline; function get_blue(color : RGB_Color) return RGB_Component with Inline; procedure set_blue(color : in out RGBA_Color; b : RGB_Component) with Inline; function get_blue(color : RGBA_Color) return RGB_Component with Inline; procedure set_alpha(color : in out RGBA_Color; a : Alpha) with Inline; function get_alpha(color : RGBA_Color) return Alpha with Inline; -- HSV -- procedure set_HSV(color : aliased in out RGB_Color; h : Hue; s : Saturation; v : Value) with Inline; procedure get_HSV(color : RGB_Color; h : out Hue; s : out Saturation; v : out Value) with Inline; procedure set_hue(color : aliased in out RGB_Color; h : Hue); function get_hue(color : RGB_Color) return Hue; procedure set_saturation(color : aliased in out RGB_Color; s : Saturation); function get_saturation(color : RGB_Color) return Saturation; procedure set_value(color : aliased in out RGB_Color; v : Value); function get_value(color : RGB_Color) return Value; -- Operators -- function "="(a, b : RGB_Color) return Boolean with Inline; function "-"(a, b : RGB_Color) return RGB_Color with Inline; function "+"(a, b : RGB_Color) return RGB_Color with Inline; function "*"(a, b : RGB_Color) return RGB_Color with Inline; function "*"(a : RGB_Color; scalar : Color_Factor) return RGB_Color with Inline; -- Operations -- function interpolate(a, b : RGB_Color; coeff : Color_Factor) return RGB_Color with Inline; procedure shift_hue(color : aliased in out RGB_Color; shift : Hue); procedure scale_HSV(color : aliased in out RGB_Color; sat_coeff : Saturation; value_coeff : Value); -- Constants -- -- grey levels black : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_black"; darkest_grey : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_grey"; darker_grey : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_grey"; dark_grey : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_grey"; grey : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_grey"; light_grey : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_grey"; lighter_grey : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_grey"; lightest_grey : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_grey"; darkest_gray : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_gray"; darker_gray : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_gray"; dark_gray : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_gray"; gray : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_gray"; light_gray : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_gray"; lighter_gray : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_gray"; lightest_gray : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_gray"; white : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_white"; -- sepia darkest_sepia : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_sepia"; darker_sepia : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_sepia"; dark_sepia : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_sepia"; sepia : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_sepia"; light_sepia : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_sepia"; lighter_sepia : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_sepia"; lightest_sepia : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_sepia"; -- standard colors red : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_red"; flame : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_flame"; orange : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_orange"; amber : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_amber"; yellow : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_yellow"; lime : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lime"; chartreuse : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_chartreuse"; green : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_green"; sea : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_sea"; turquoise : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_turquoise"; cyan : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_cyan"; sky : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_sky"; azure : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_azure"; blue : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_blue"; han : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_han"; violet : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_violet"; purple : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_purple"; fuchsia : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_fuchsia"; magenta : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_magenta"; pink : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_pink"; crimson : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_crimson"; -- dark colors dark_red : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_red"; dark_flame : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_flame"; dark_orange : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_orange"; dark_amber : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_amber"; dark_yellow : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_yellow"; dark_lime : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_lime"; dark_chartreuse : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_chartreuse"; dark_green : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_green"; dark_sea : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_sea"; dark_turquoise : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_turquoise"; dark_cyan : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_cyan"; dark_sky : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_sky"; dark_azure : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_azure"; dark_blue : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_blue"; dark_han : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_han"; dark_violet : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_violet"; dark_purple : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_purple"; dark_fuchsia : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_fuchsia"; dark_magenta : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_magenta"; dark_pink : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_pink"; dark_crimson : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_dark_crimson"; -- darker colors darker_red : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_red"; darker_flame : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_flame"; darker_orange : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_orange"; darker_amber : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_amber"; darker_yellow : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_yellow"; darker_lime : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_lime"; darker_chartreuse : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_chartreuse"; darker_green : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_green"; darker_sea : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_sea"; darker_turquoise : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_turquoise"; darker_cyan : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_cyan"; darker_sky : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_sky"; darker_azure : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_azure"; darker_blue : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_blue"; darker_han : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_han"; darker_violet : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_violet"; darker_purple : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_purple"; darker_fuchsia : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_fuchsia"; darker_magenta : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_magenta"; darker_pink : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_pink"; darker_crimson : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darker_crimson"; -- darkest colors darkest_red : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_red"; darkest_flame : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_flame"; darkest_orange : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_orange"; darkest_amber : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_amber"; darkest_yellow : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_yellow"; darkest_lime : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_lime"; darkest_chartreuse : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_chartreuse"; darkest_green : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_green"; darkest_sea : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_sea"; darkest_turquoise : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_turquoise"; darkest_cyan : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_cyan"; darkest_sky : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_sky"; darkest_azure : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_azure"; darkest_blue : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_blue"; darkest_han : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_han"; darkest_violet : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_violet"; darkest_purple : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_purple"; darkest_fuchsia : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_fuchsia"; darkest_magenta : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_magenta"; darkest_pink : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_pink"; darkest_crimson : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_darkest_crimson"; -- light colors light_red : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_red"; light_flame : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_flame"; light_orange : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_orange"; light_amber : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_amber"; light_yellow : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_yellow"; light_lime : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_lime"; light_chartreuse : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_chartreuse"; light_green : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_green"; light_sea : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_sea"; light_turquoise : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_turquoise"; light_cyan : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_cyan"; light_sky : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_sky"; light_azure : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_azure"; light_blue : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_blue"; light_han : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_han"; light_violet : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_violet"; light_purple : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_purple"; light_fuchsia : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_fuchsia"; light_magenta : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_magenta"; light_pink : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_pink"; light_crimson : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_light_crimson"; -- lighter colors lighter_red : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_red"; lighter_flame : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_flame"; lighter_orange : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_orange"; lighter_amber : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_amber"; lighter_yellow : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_yellow"; lighter_lime : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_lime"; lighter_chartreuse : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_chartreuse"; lighter_green : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_green"; lighter_sea : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_sea"; lighter_turquoise : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_turquoise"; lighter_cyan : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_cyan"; lighter_sky : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_sky"; lighter_azure : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_azure"; lighter_blue : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_blue"; lighter_han : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_han"; lighter_violet : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_violet"; lighter_purple : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_purple"; lighter_fuchsia : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_fuchsia"; lighter_magenta : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_magenta"; lighter_pink : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_pink"; lighter_crimson : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lighter_crimson"; -- lightest colors lightest_red : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_red"; lightest_flame : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_flame"; lightest_orange : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_orange"; lightest_amber : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_amber"; lightest_yellow : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_yellow"; lightest_lime : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_lime"; lightest_chartreuse : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_chartreuse"; lightest_green : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_green"; lightest_sea : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_sea"; lightest_turquoise : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_turquoise"; lightest_cyan : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_cyan"; lightest_sky : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_sky"; lightest_azure : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_azure"; lightest_blue : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_blue"; lightest_han : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_han"; lightest_violet : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_violet"; lightest_purple : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_purple"; lightest_fuchsia : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_fuchsia"; lightest_magenta : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_magenta"; lightest_pink : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_pink"; lightest_crimson : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_lightest_crimson"; -- desaturated desaturated_red : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_red"; desaturated_flame : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_flame"; desaturated_orange : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_orange"; desaturated_amber : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_amber"; desaturated_yellow : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_yellow"; desaturated_lime : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_lime"; desaturated_chartreuse : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_chartreuse"; desaturated_green : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_green"; desaturated_sea : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_sea"; desaturated_turquoise : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_turquoise"; desaturated_cyan : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_cyan"; desaturated_sky : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_sky"; desaturated_azure : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_azure"; desaturated_blue : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_blue"; desaturated_han : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_han"; desaturated_violet : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_violet"; desaturated_purple : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_purple"; desaturated_fuchsia : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_fuchsia"; desaturated_magenta : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_magenta"; desaturated_pink : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_pink"; desaturated_crimson : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_desaturated_crimson"; -- metallic brass : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_brass"; copper : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_copper"; gold : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_gold"; silver : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_silver"; -- miscellaneous celadon : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_celadon"; peach : aliased constant RGB_Color with Import => True, Convention => C, External_Name => "TCOD_peach"; private type RGB_Color is new color_h.TCOD_ColorRGB; type RGBA_Color is new color_h.TCOD_ColorRGBA; end Libtcod.Color;
M:descriptors S:Ldescriptors.aligned_alloc$size$1$13({2}SI:U),B,1,-4 S:Ldescriptors.aligned_alloc$alignment$1$13({2}SI:U),B,1,1 T:Fdescriptors$SI_UU32[({0}S:S$u32$0$0({4}SL:U),Z,0,0)({0}S:S$s32$0$0({4}SL:S),Z,0,0)({0}S:S$uu16$0$0({4}DA2d,STSI_UU16:S),Z,0,0)({0}S:S$u16$0$0({4}DA2d,SI:U),Z,0,0)({0}S:S$s16$0$0({4}DA2d,SI:S),Z,0,0)({0}S:S$u8$0$0({4}DA4d,SC:U),Z,0,0)({0}S:S$s8$0$0({4}DA4d,SC:S),Z,0,0)] T:Fdescriptors$SI_UU16[({0}S:S$u16$0$0({2}SI:U),Z,0,0)({0}S:S$s16$0$0({2}SI:S),Z,0,0)({0}S:S$u8$0$0({2}DA2d,SC:U),Z,0,0)({0}S:S$s8$0$0({2}DA2d,SC:S),Z,0,0)] T:Fdescriptors$SI_GEN_PTR[({0}S:S$u8$0$0({3}DA3d,SC:U),Z,0,0)({0}S:S$gptr$0$0({3}ST__00000000:S),Z,0,0)] T:Fdescriptors$__00000000[({0}S:S$memtype$0$0({1}SC:U),Z,0,0)({1}S:S$address$0$0({2}STSI_UU16:S),Z,0,0)] T:Fdescriptors$__00000010[({0}S:S$bits$0$0({1}ST__00000011:S),Z,0,0)({0}S:S$c$0$0({1}SC:U),Z,0,0)] T:Fdescriptors$__00000001[({0}S:S$bmRequestType$0$0({1}ST__00000002:S),Z,0,0)({1}S:S$bRequest$0$0({1}SC:U),Z,0,0)({2}S:S$wValue$0$0({2}SI:U),Z,0,0)({4}S:S$wIndex$0$0({2}SI:U),Z,0,0)({6}S:S$wLength$0$0({2}SI:U),Z,0,0)] T:Fdescriptors$__00000011[({0}S:S$callback$0$0({1}SB0$1:U),Z,0,0)({0}S:S$outPacketPending$0$0({1}SB1$1:U),Z,0,0)({0}S:S$inPacketPending$0$0({1}SB2$1:U),Z,0,0)({0}S:S$waitForRead$0$0({1}SB3$1:U),Z,0,0)] T:Fdescriptors$__00000002[({0}S:S$Recipient$0$0({1}SB0$5:U),Z,0,0)({0}S:S$Type$0$0({1}SB5$2:U),Z,0,0)({0}S:S$Direction$0$0({1}SB7$1:U),Z,0,0)] T:Fdescriptors$__00000012[({0}S:S$configurationValue$0$0({1}SC:U),Z,0,0)({1}S:S$numberOfStrings$0$0({1}SC:U),Z,0,0)({2}S:S$state$0$0({1}SC:U),Z,0,0)({3}S:S$savedState$0$0({1}SC:U),Z,0,0)({4}S:S$setup$0$0({8}ST__00000001:S),Z,0,0)({12}S:S$ep0String$0$0({1}ST__00000013:S),Z,0,0)({13}S:S$ep0$0$0({7}ST__00000009:S),Z,0,0)({20}S:S$ep1in$0$0({7}ST__00000009:S),Z,0,0)({27}S:S$ep1out$0$0({7}ST__00000009:S),Z,0,0)({34}S:S$deviceDescriptor$0$0({3}DG,ST__00000004:S),Z,0,0)({37}S:S$configDescriptor$0$0({3}DG,ST__00000005:S),Z,0,0)({40}S:S$stringDescriptors$0$0({3}DG,DG,DG,SC:U),Z,0,0)] T:Fdescriptors$__00000003[({0}S:S$setup$0$0({8}ST__00000001:S),Z,0,0)({0}S:S$c$0$0({8}DA8d,SC:U),Z,0,0)({0}S:S$i$0$0({8}DA4d,SI:U),Z,0,0)] T:Fdescriptors$__00000013[({0}S:S$encoding$0$0({1}ST__00000014:S),Z,0,0)({0}S:S$c$0$0({1}SC:U),Z,0,0)] T:Fdescriptors$__00000004[({0}S:S$bLength$0$0({1}SC:U),Z,0,0)({1}S:S$bDescriptorType$0$0({1}SC:U),Z,0,0)({2}S:S$bcdUSB$0$0({2}SI:U),Z,0,0)({4}S:S$bDeviceClass$0$0({1}SC:U),Z,0,0)({5}S:S$bDeviceSubClass$0$0({1}SC:U),Z,0,0)({6}S:S$bDeviceProtocol$0$0({1}SC:U),Z,0,0)({7}S:S$bMaxPacketSize0$0$0({1}SC:U),Z,0,0)({8}S:S$idVendor$0$0({2}SI:U),Z,0,0)({10}S:S$idProduct$0$0({2}SI:U),Z,0,0)({12}S:S$bcdDevice$0$0({2}SI:U),Z,0,0)({14}S:S$iManufacturer$0$0({1}SC:U),Z,0,0)({15}S:S$iProduct$0$0({1}SC:U),Z,0,0)({16}S:S$iSerialNumber$0$0({1}SC:U),Z,0,0)({17}S:S$bNumConfigurations$0$0({1}SC:U),Z,0,0)] T:Fdescriptors$__00000014[({0}S:S$type$0$0({1}SB0$7:U),Z,0,0)({0}S:S$init$0$0({1}SB7$1:U),Z,0,0)] T:Fdescriptors$__00000005[({0}S:S$bLength$0$0({1}SC:U),Z,0,0)({1}S:S$bDescriptorType$0$0({1}SC:U),Z,0,0)({2}S:S$wTotalLength$0$0({2}SI:U),Z,0,0)({4}S:S$bNumInterfaces$0$0({1}SC:U),Z,0,0)({5}S:S$bConfigurationValue$0$0({1}SC:U),Z,0,0)({6}S:S$iConfiguration$0$0({1}SC:U),Z,0,0)({7}S:S$bmAttributes$0$0({1}SC:U),Z,0,0)({8}S:S$bMaxPower$0$0({1}SC:U),Z,0,0)] T:Fdescriptors$__00000006[({0}S:S$bLength$0$0({1}SC:U),Z,0,0)({1}S:S$bDescriptorType$0$0({1}SC:U),Z,0,0)({2}S:S$bInterfaceNumber$0$0({1}SC:U),Z,0,0)({3}S:S$bAlternateSetting$0$0({1}SC:U),Z,0,0)({4}S:S$bNumEndpoints$0$0({1}SC:U),Z,0,0)({5}S:S$bInterfaceClass$0$0({1}SC:U),Z,0,0)({6}S:S$bInterfaceSubClass$0$0({1}SC:U),Z,0,0)({7}S:S$bInterfaceProtocol$0$0({1}SC:U),Z,0,0)({8}S:S$iInterface$0$0({1}SC:U),Z,0,0)] T:Fdescriptors$__00000007[({0}S:S$bLength$0$0({1}SC:U),Z,0,0)({1}S:S$bDescriptorType$0$0({1}SC:U),Z,0,0)({2}S:S$bEndpointAddress$0$0({1}SC:U),Z,0,0)({3}S:S$bmAttributes$0$0({1}SC:U),Z,0,0)({4}S:S$wMaxPacketSize$0$0({2}SI:U),Z,0,0)({6}S:S$bInterval$0$0({1}SC:U),Z,0,0)] T:Fdescriptors$__00000008[({0}S:S$deviceDescriptor$0$0({3}DG,ST__00000004:S),Z,0,0)({3}S:S$configDescriptor$0$0({3}DG,SC:U),Z,0,0)({6}S:S$stringDescriptors$0$0({3}DG,DG,DG,SC:U),Z,0,0)({9}S:S$numberOfStrings$0$0({1}SC:U),Z,0,0)] T:Fdescriptors$__00000009[({0}S:S$buf$0$0({3}DG,SC:U),Z,0,0)({3}S:S$remaining$0$0({2}SI:U),Z,0,0)({5}S:S$state$0$0({1}SC:U),Z,0,0)({6}S:S$misc$0$0({1}ST__00000010:S),Z,0,0)] S:Fdescriptors$myUsbStringTable_USEnglish$0$0({10}DA5d,DC,SC:U),F,0,0 S:G$ACC$0$0({1}SC:U),I,0,0 S:G$ADC0AC$0$0({1}SC:U),I,0,0 S:G$ADC0CF$0$0({1}SC:U),I,0,0 S:G$ADC0CN0$0$0({1}SC:U),I,0,0 S:G$ADC0CN1$0$0({1}SC:U),I,0,0 S:G$ADC0GTH$0$0({1}SC:U),I,0,0 S:G$ADC0GTL$0$0({1}SC:U),I,0,0 S:G$ADC0H$0$0({1}SC:U),I,0,0 S:G$ADC0L$0$0({1}SC:U),I,0,0 S:G$ADC0LTH$0$0({1}SC:U),I,0,0 S:G$ADC0LTL$0$0({1}SC:U),I,0,0 S:G$ADC0MX$0$0({1}SC:U),I,0,0 S:G$ADC0PWR$0$0({1}SC:U),I,0,0 S:G$ADC0TK$0$0({1}SC:U),I,0,0 S:G$B$0$0({1}SC:U),I,0,0 S:G$CKCON0$0$0({1}SC:U),I,0,0 S:G$CKCON1$0$0({1}SC:U),I,0,0 S:G$CLKSEL$0$0({1}SC:U),I,0,0 S:G$CMP0CN0$0$0({1}SC:U),I,0,0 S:G$CMP0CN1$0$0({1}SC:U),I,0,0 S:G$CMP0MD$0$0({1}SC:U),I,0,0 S:G$CMP0MX$0$0({1}SC:U),I,0,0 S:G$CMP1CN0$0$0({1}SC:U),I,0,0 S:G$CMP1CN1$0$0({1}SC:U),I,0,0 S:G$CMP1MD$0$0({1}SC:U),I,0,0 S:G$CMP1MX$0$0({1}SC:U),I,0,0 S:G$CRC0CN0$0$0({1}SC:U),I,0,0 S:G$CRC0CN1$0$0({1}SC:U),I,0,0 S:G$CRC0CNT$0$0({1}SC:U),I,0,0 S:G$CRC0DAT$0$0({1}SC:U),I,0,0 S:G$CRC0FLIP$0$0({1}SC:U),I,0,0 S:G$CRC0IN$0$0({1}SC:U),I,0,0 S:G$CRC0ST$0$0({1}SC:U),I,0,0 S:G$DERIVID$0$0({1}SC:U),I,0,0 S:G$DEVICEID$0$0({1}SC:U),I,0,0 S:G$DPH$0$0({1}SC:U),I,0,0 S:G$DPL$0$0({1}SC:U),I,0,0 S:G$EIE1$0$0({1}SC:U),I,0,0 S:G$EIE2$0$0({1}SC:U),I,0,0 S:G$EIP1$0$0({1}SC:U),I,0,0 S:G$EIP1H$0$0({1}SC:U),I,0,0 S:G$EIP2$0$0({1}SC:U),I,0,0 S:G$EIP2H$0$0({1}SC:U),I,0,0 S:G$EMI0CN$0$0({1}SC:U),I,0,0 S:G$FLKEY$0$0({1}SC:U),I,0,0 S:G$HFO0CAL$0$0({1}SC:U),I,0,0 S:G$HFO1CAL$0$0({1}SC:U),I,0,0 S:G$HFOCN$0$0({1}SC:U),I,0,0 S:G$I2C0CN0$0$0({1}SC:U),I,0,0 S:G$I2C0DIN$0$0({1}SC:U),I,0,0 S:G$I2C0DOUT$0$0({1}SC:U),I,0,0 S:G$I2C0FCN0$0$0({1}SC:U),I,0,0 S:G$I2C0FCN1$0$0({1}SC:U),I,0,0 S:G$I2C0FCT$0$0({1}SC:U),I,0,0 S:G$I2C0SLAD$0$0({1}SC:U),I,0,0 S:G$I2C0STAT$0$0({1}SC:U),I,0,0 S:G$IE$0$0({1}SC:U),I,0,0 S:G$IP$0$0({1}SC:U),I,0,0 S:G$IPH$0$0({1}SC:U),I,0,0 S:G$IT01CF$0$0({1}SC:U),I,0,0 S:G$LFO0CN$0$0({1}SC:U),I,0,0 S:G$P0$0$0({1}SC:U),I,0,0 S:G$P0MASK$0$0({1}SC:U),I,0,0 S:G$P0MAT$0$0({1}SC:U),I,0,0 S:G$P0MDIN$0$0({1}SC:U),I,0,0 S:G$P0MDOUT$0$0({1}SC:U),I,0,0 S:G$P0SKIP$0$0({1}SC:U),I,0,0 S:G$P1$0$0({1}SC:U),I,0,0 S:G$P1MASK$0$0({1}SC:U),I,0,0 S:G$P1MAT$0$0({1}SC:U),I,0,0 S:G$P1MDIN$0$0({1}SC:U),I,0,0 S:G$P1MDOUT$0$0({1}SC:U),I,0,0 S:G$P1SKIP$0$0({1}SC:U),I,0,0 S:G$P2$0$0({1}SC:U),I,0,0 S:G$P2MASK$0$0({1}SC:U),I,0,0 S:G$P2MAT$0$0({1}SC:U),I,0,0 S:G$P2MDIN$0$0({1}SC:U),I,0,0 S:G$P2MDOUT$0$0({1}SC:U),I,0,0 S:G$P2SKIP$0$0({1}SC:U),I,0,0 S:G$P3$0$0({1}SC:U),I,0,0 S:G$P3MDIN$0$0({1}SC:U),I,0,0 S:G$P3MDOUT$0$0({1}SC:U),I,0,0 S:G$PCA0CENT$0$0({1}SC:U),I,0,0 S:G$PCA0CLR$0$0({1}SC:U),I,0,0 S:G$PCA0CN0$0$0({1}SC:U),I,0,0 S:G$PCA0CPH0$0$0({1}SC:U),I,0,0 S:G$PCA0CPH1$0$0({1}SC:U),I,0,0 S:G$PCA0CPH2$0$0({1}SC:U),I,0,0 S:G$PCA0CPL0$0$0({1}SC:U),I,0,0 S:G$PCA0CPL1$0$0({1}SC:U),I,0,0 S:G$PCA0CPL2$0$0({1}SC:U),I,0,0 S:G$PCA0CPM0$0$0({1}SC:U),I,0,0 S:G$PCA0CPM1$0$0({1}SC:U),I,0,0 S:G$PCA0CPM2$0$0({1}SC:U),I,0,0 S:G$PCA0H$0$0({1}SC:U),I,0,0 S:G$PCA0L$0$0({1}SC:U),I,0,0 S:G$PCA0MD$0$0({1}SC:U),I,0,0 S:G$PCA0POL$0$0({1}SC:U),I,0,0 S:G$PCA0PWM$0$0({1}SC:U),I,0,0 S:G$PCON0$0$0({1}SC:U),I,0,0 S:G$PCON1$0$0({1}SC:U),I,0,0 S:G$PFE0CN$0$0({1}SC:U),I,0,0 S:G$PRTDRV$0$0({1}SC:U),I,0,0 S:G$PSCTL$0$0({1}SC:U),I,0,0 S:G$PSW$0$0({1}SC:U),I,0,0 S:G$REF0CN$0$0({1}SC:U),I,0,0 S:G$REG0CN$0$0({1}SC:U),I,0,0 S:G$REG1CN$0$0({1}SC:U),I,0,0 S:G$REVID$0$0({1}SC:U),I,0,0 S:G$RSTSRC$0$0({1}SC:U),I,0,0 S:G$SBCON1$0$0({1}SC:U),I,0,0 S:G$SBRLH1$0$0({1}SC:U),I,0,0 S:G$SBRLL1$0$0({1}SC:U),I,0,0 S:G$SBUF0$0$0({1}SC:U),I,0,0 S:G$SBUF1$0$0({1}SC:U),I,0,0 S:G$SCON0$0$0({1}SC:U),I,0,0 S:G$SCON1$0$0({1}SC:U),I,0,0 S:G$SFRPAGE$0$0({1}SC:U),I,0,0 S:G$SFRPGCN$0$0({1}SC:U),I,0,0 S:G$SFRSTACK$0$0({1}SC:U),I,0,0 S:G$SMB0ADM$0$0({1}SC:U),I,0,0 S:G$SMB0ADR$0$0({1}SC:U),I,0,0 S:G$SMB0CF$0$0({1}SC:U),I,0,0 S:G$SMB0CN0$0$0({1}SC:U),I,0,0 S:G$SMB0DAT$0$0({1}SC:U),I,0,0 S:G$SMB0FCN0$0$0({1}SC:U),I,0,0 S:G$SMB0FCN1$0$0({1}SC:U),I,0,0 S:G$SMB0FCT$0$0({1}SC:U),I,0,0 S:G$SMB0RXLN$0$0({1}SC:U),I,0,0 S:G$SMB0TC$0$0({1}SC:U),I,0,0 S:G$SMOD1$0$0({1}SC:U),I,0,0 S:G$SP$0$0({1}SC:U),I,0,0 S:G$SPI0CFG$0$0({1}SC:U),I,0,0 S:G$SPI0CKR$0$0({1}SC:U),I,0,0 S:G$SPI0CN0$0$0({1}SC:U),I,0,0 S:G$SPI0DAT$0$0({1}SC:U),I,0,0 S:G$SPI0FCN0$0$0({1}SC:U),I,0,0 S:G$SPI0FCN1$0$0({1}SC:U),I,0,0 S:G$SPI0FCT$0$0({1}SC:U),I,0,0 S:G$TCON$0$0({1}SC:U),I,0,0 S:G$TH0$0$0({1}SC:U),I,0,0 S:G$TH1$0$0({1}SC:U),I,0,0 S:G$TL0$0$0({1}SC:U),I,0,0 S:G$TL1$0$0({1}SC:U),I,0,0 S:G$TMOD$0$0({1}SC:U),I,0,0 S:G$TMR2CN0$0$0({1}SC:U),I,0,0 S:G$TMR2CN1$0$0({1}SC:U),I,0,0 S:G$TMR2H$0$0({1}SC:U),I,0,0 S:G$TMR2L$0$0({1}SC:U),I,0,0 S:G$TMR2RLH$0$0({1}SC:U),I,0,0 S:G$TMR2RLL$0$0({1}SC:U),I,0,0 S:G$TMR3CN0$0$0({1}SC:U),I,0,0 S:G$TMR3CN1$0$0({1}SC:U),I,0,0 S:G$TMR3H$0$0({1}SC:U),I,0,0 S:G$TMR3L$0$0({1}SC:U),I,0,0 S:G$TMR3RLH$0$0({1}SC:U),I,0,0 S:G$TMR3RLL$0$0({1}SC:U),I,0,0 S:G$TMR4CN0$0$0({1}SC:U),I,0,0 S:G$TMR4CN1$0$0({1}SC:U),I,0,0 S:G$TMR4H$0$0({1}SC:U),I,0,0 S:G$TMR4L$0$0({1}SC:U),I,0,0 S:G$TMR4RLH$0$0({1}SC:U),I,0,0 S:G$TMR4RLL$0$0({1}SC:U),I,0,0 S:G$UART1FCN0$0$0({1}SC:U),I,0,0 S:G$UART1FCN1$0$0({1}SC:U),I,0,0 S:G$UART1FCT$0$0({1}SC:U),I,0,0 S:G$UART1LIN$0$0({1}SC:U),I,0,0 S:G$USB0ADR$0$0({1}SC:U),I,0,0 S:G$USB0AEC$0$0({1}SC:U),I,0,0 S:G$USB0CDCF$0$0({1}SC:U),I,0,0 S:G$USB0CDCN$0$0({1}SC:U),I,0,0 S:G$USB0CDSTA$0$0({1}SC:U),I,0,0 S:G$USB0CF$0$0({1}SC:U),I,0,0 S:G$USB0DAT$0$0({1}SC:U),I,0,0 S:G$USB0XCN$0$0({1}SC:U),I,0,0 S:G$VDM0CN$0$0({1}SC:U),I,0,0 S:G$WDTCN$0$0({1}SC:U),I,0,0 S:G$XBR0$0$0({1}SC:U),I,0,0 S:G$XBR1$0$0({1}SC:U),I,0,0 S:G$XBR2$0$0({1}SC:U),I,0,0 S:G$ADC0GT$0$0({2}SI:U),I,0,0 S:G$ADC0$0$0({2}SI:U),I,0,0 S:G$ADC0LT$0$0({2}SI:U),I,0,0 S:G$DP$0$0({2}SI:U),I,0,0 S:G$PCA0CP0$0$0({2}SI:U),I,0,0 S:G$PCA0CP1$0$0({2}SI:U),I,0,0 S:G$PCA0CP2$0$0({2}SI:U),I,0,0 S:G$PCA0$0$0({2}SI:U),I,0,0 S:G$SBRL1$0$0({2}SI:U),I,0,0 S:G$TMR2$0$0({2}SI:U),I,0,0 S:G$TMR2RL$0$0({2}SI:U),I,0,0 S:G$TMR3$0$0({2}SI:U),I,0,0 S:G$TMR3RL$0$0({2}SI:U),I,0,0 S:G$TMR4$0$0({2}SI:U),I,0,0 S:G$TMR4RL$0$0({2}SI:U),I,0,0 S:G$_XPAGE$0$0({1}SC:U),I,0,0 S:G$ACC_ACC0$0$0({1}SX:U),J,0,0 S:G$ACC_ACC1$0$0({1}SX:U),J,0,0 S:G$ACC_ACC2$0$0({1}SX:U),J,0,0 S:G$ACC_ACC3$0$0({1}SX:U),J,0,0 S:G$ACC_ACC4$0$0({1}SX:U),J,0,0 S:G$ACC_ACC5$0$0({1}SX:U),J,0,0 S:G$ACC_ACC6$0$0({1}SX:U),J,0,0 S:G$ACC_ACC7$0$0({1}SX:U),J,0,0 S:G$ADC0CN0_ADCM0$0$0({1}SX:U),J,0,0 S:G$ADC0CN0_ADCM1$0$0({1}SX:U),J,0,0 S:G$ADC0CN0_ADCM2$0$0({1}SX:U),J,0,0 S:G$ADC0CN0_ADWINT$0$0({1}SX:U),J,0,0 S:G$ADC0CN0_ADBUSY$0$0({1}SX:U),J,0,0 S:G$ADC0CN0_ADINT$0$0({1}SX:U),J,0,0 S:G$ADC0CN0_ADBMEN$0$0({1}SX:U),J,0,0 S:G$ADC0CN0_ADEN$0$0({1}SX:U),J,0,0 S:G$B_B0$0$0({1}SX:U),J,0,0 S:G$B_B1$0$0({1}SX:U),J,0,0 S:G$B_B2$0$0({1}SX:U),J,0,0 S:G$B_B3$0$0({1}SX:U),J,0,0 S:G$B_B4$0$0({1}SX:U),J,0,0 S:G$B_B5$0$0({1}SX:U),J,0,0 S:G$B_B6$0$0({1}SX:U),J,0,0 S:G$B_B7$0$0({1}SX:U),J,0,0 S:G$IE_EX0$0$0({1}SX:U),J,0,0 S:G$IE_ET0$0$0({1}SX:U),J,0,0 S:G$IE_EX1$0$0({1}SX:U),J,0,0 S:G$IE_ET1$0$0({1}SX:U),J,0,0 S:G$IE_ES0$0$0({1}SX:U),J,0,0 S:G$IE_ET2$0$0({1}SX:U),J,0,0 S:G$IE_ESPI0$0$0({1}SX:U),J,0,0 S:G$IE_EA$0$0({1}SX:U),J,0,0 S:G$IP_PX0$0$0({1}SX:U),J,0,0 S:G$IP_PT0$0$0({1}SX:U),J,0,0 S:G$IP_PX1$0$0({1}SX:U),J,0,0 S:G$IP_PT1$0$0({1}SX:U),J,0,0 S:G$IP_PS0$0$0({1}SX:U),J,0,0 S:G$IP_PT2$0$0({1}SX:U),J,0,0 S:G$IP_PSPI0$0$0({1}SX:U),J,0,0 S:G$P0_B0$0$0({1}SX:U),J,0,0 S:G$P0_B1$0$0({1}SX:U),J,0,0 S:G$P0_B2$0$0({1}SX:U),J,0,0 S:G$P0_B3$0$0({1}SX:U),J,0,0 S:G$P0_B4$0$0({1}SX:U),J,0,0 S:G$P0_B5$0$0({1}SX:U),J,0,0 S:G$P0_B6$0$0({1}SX:U),J,0,0 S:G$P0_B7$0$0({1}SX:U),J,0,0 S:G$P1_B0$0$0({1}SX:U),J,0,0 S:G$P1_B1$0$0({1}SX:U),J,0,0 S:G$P1_B2$0$0({1}SX:U),J,0,0 S:G$P1_B3$0$0({1}SX:U),J,0,0 S:G$P1_B4$0$0({1}SX:U),J,0,0 S:G$P1_B5$0$0({1}SX:U),J,0,0 S:G$P1_B6$0$0({1}SX:U),J,0,0 S:G$P1_B7$0$0({1}SX:U),J,0,0 S:G$P2_B0$0$0({1}SX:U),J,0,0 S:G$P2_B1$0$0({1}SX:U),J,0,0 S:G$P2_B2$0$0({1}SX:U),J,0,0 S:G$P2_B3$0$0({1}SX:U),J,0,0 S:G$P3_B0$0$0({1}SX:U),J,0,0 S:G$P3_B1$0$0({1}SX:U),J,0,0 S:G$PCA0CN0_CCF0$0$0({1}SX:U),J,0,0 S:G$PCA0CN0_CCF1$0$0({1}SX:U),J,0,0 S:G$PCA0CN0_CCF2$0$0({1}SX:U),J,0,0 S:G$PCA0CN0_CR$0$0({1}SX:U),J,0,0 S:G$PCA0CN0_CF$0$0({1}SX:U),J,0,0 S:G$PSW_PARITY$0$0({1}SX:U),J,0,0 S:G$PSW_F1$0$0({1}SX:U),J,0,0 S:G$PSW_OV$0$0({1}SX:U),J,0,0 S:G$PSW_RS0$0$0({1}SX:U),J,0,0 S:G$PSW_RS1$0$0({1}SX:U),J,0,0 S:G$PSW_F0$0$0({1}SX:U),J,0,0 S:G$PSW_AC$0$0({1}SX:U),J,0,0 S:G$PSW_CY$0$0({1}SX:U),J,0,0 S:G$SCON0_RI$0$0({1}SX:U),J,0,0 S:G$SCON0_TI$0$0({1}SX:U),J,0,0 S:G$SCON0_RB8$0$0({1}SX:U),J,0,0 S:G$SCON0_TB8$0$0({1}SX:U),J,0,0 S:G$SCON0_REN$0$0({1}SX:U),J,0,0 S:G$SCON0_MCE$0$0({1}SX:U),J,0,0 S:G$SCON0_SMODE$0$0({1}SX:U),J,0,0 S:G$SCON1_RI$0$0({1}SX:U),J,0,0 S:G$SCON1_TI$0$0({1}SX:U),J,0,0 S:G$SCON1_RBX$0$0({1}SX:U),J,0,0 S:G$SCON1_TBX$0$0({1}SX:U),J,0,0 S:G$SCON1_REN$0$0({1}SX:U),J,0,0 S:G$SCON1_PERR$0$0({1}SX:U),J,0,0 S:G$SCON1_OVR$0$0({1}SX:U),J,0,0 S:G$SMB0CN0_SI$0$0({1}SX:U),J,0,0 S:G$SMB0CN0_ACK$0$0({1}SX:U),J,0,0 S:G$SMB0CN0_ARBLOST$0$0({1}SX:U),J,0,0 S:G$SMB0CN0_ACKRQ$0$0({1}SX:U),J,0,0 S:G$SMB0CN0_STO$0$0({1}SX:U),J,0,0 S:G$SMB0CN0_STA$0$0({1}SX:U),J,0,0 S:G$SMB0CN0_TXMODE$0$0({1}SX:U),J,0,0 S:G$SMB0CN0_MASTER$0$0({1}SX:U),J,0,0 S:G$SPI0CN0_SPIEN$0$0({1}SX:U),J,0,0 S:G$SPI0CN0_TXNF$0$0({1}SX:U),J,0,0 S:G$SPI0CN0_NSSMD0$0$0({1}SX:U),J,0,0 S:G$SPI0CN0_NSSMD1$0$0({1}SX:U),J,0,0 S:G$SPI0CN0_RXOVRN$0$0({1}SX:U),J,0,0 S:G$SPI0CN0_MODF$0$0({1}SX:U),J,0,0 S:G$SPI0CN0_WCOL$0$0({1}SX:U),J,0,0 S:G$SPI0CN0_SPIF$0$0({1}SX:U),J,0,0 S:G$TCON_IT0$0$0({1}SX:U),J,0,0 S:G$TCON_IE0$0$0({1}SX:U),J,0,0 S:G$TCON_IT1$0$0({1}SX:U),J,0,0 S:G$TCON_IE1$0$0({1}SX:U),J,0,0 S:G$TCON_TR0$0$0({1}SX:U),J,0,0 S:G$TCON_TF0$0$0({1}SX:U),J,0,0 S:G$TCON_TR1$0$0({1}SX:U),J,0,0 S:G$TCON_TF1$0$0({1}SX:U),J,0,0 S:G$TMR2CN0_T2XCLK0$0$0({1}SX:U),J,0,0 S:G$TMR2CN0_T2XCLK1$0$0({1}SX:U),J,0,0 S:G$TMR2CN0_TR2$0$0({1}SX:U),J,0,0 S:G$TMR2CN0_T2SPLIT$0$0({1}SX:U),J,0,0 S:G$TMR2CN0_TF2CEN$0$0({1}SX:U),J,0,0 S:G$TMR2CN0_TF2LEN$0$0({1}SX:U),J,0,0 S:G$TMR2CN0_TF2L$0$0({1}SX:U),J,0,0 S:G$TMR2CN0_TF2H$0$0({1}SX:U),J,0,0 S:G$TMR4CN0_T4XCLK0$0$0({1}SX:U),J,0,0 S:G$TMR4CN0_T4XCLK1$0$0({1}SX:U),J,0,0 S:G$TMR4CN0_TR4$0$0({1}SX:U),J,0,0 S:G$TMR4CN0_T4SPLIT$0$0({1}SX:U),J,0,0 S:G$TMR4CN0_TF4CEN$0$0({1}SX:U),J,0,0 S:G$TMR4CN0_TF4LEN$0$0({1}SX:U),J,0,0 S:G$TMR4CN0_TF4L$0$0({1}SX:U),J,0,0 S:G$TMR4CN0_TF4H$0$0({1}SX:U),J,0,0 S:G$UART1FCN1_RIE$0$0({1}SX:U),J,0,0 S:G$UART1FCN1_RXTO0$0$0({1}SX:U),J,0,0 S:G$UART1FCN1_RXTO1$0$0({1}SX:U),J,0,0 S:G$UART1FCN1_RFRQ$0$0({1}SX:U),J,0,0 S:G$UART1FCN1_TIE$0$0({1}SX:U),J,0,0 S:G$UART1FCN1_TXHOLD$0$0({1}SX:U),J,0,0 S:G$UART1FCN1_TXNF$0$0({1}SX:U),J,0,0 S:G$UART1FCN1_TFRQ$0$0({1}SX:U),J,0,0 S:G$atof$0$0({2}DF,SF:S),C,0,0 S:G$atoi$0$0({2}DF,SI:S),C,0,0 S:G$atol$0$0({2}DF,SL:S),C,0,0 S:G$_uitoa$0$0({2}DF,SV:S),C,0,0 S:G$_itoa$0$0({2}DF,SV:S),C,0,0 S:G$_ultoa$0$0({2}DF,SV:S),C,0,0 S:G$_ltoa$0$0({2}DF,SV:S),C,0,0 S:G$rand$0$0({2}DF,SI:S),C,0,0 S:G$srand$0$0({2}DF,SV:S),C,0,0 S:G$calloc$0$0({2}DF,DX,SV:S),C,0,0 S:G$malloc$0$0({2}DF,DX,SV:S),C,0,0 S:G$realloc$0$0({2}DF,DX,SV:S),C,0,0 S:G$aligned_alloc$0$0({2}DF,DG,SV:S),C,0,2 S:G$free$0$0({2}DF,SV:S),C,0,0 S:G$abs$0$0({2}DF,SI:S),C,0,0 S:G$labs$0$0({2}DF,SL:S),C,0,0 S:G$mblen$0$0({2}DF,SI:S),C,0,0 S:G$mbtowc$0$0({2}DF,SI:S),C,0,0 S:G$wctomb$0$0({2}DF,SI:S),C,0,0 S:G$memcpy$0$0({2}DF,DG,SV:S),C,0,0 S:G$memmove$0$0({2}DF,DG,SV:S),C,0,0 S:G$strcpy$0$0({2}DF,DG,SC:U),C,0,0 S:G$strncpy$0$0({2}DF,DG,SC:U),C,0,0 S:G$strcat$0$0({2}DF,DG,SC:U),C,0,0 S:G$strncat$0$0({2}DF,DG,SC:U),C,0,0 S:G$memcmp$0$0({2}DF,SI:S),C,0,0 S:G$strcmp$0$0({2}DF,SI:S),C,0,0 S:G$strncmp$0$0({2}DF,SI:S),C,0,0 S:G$strxfrm$0$0({2}DF,SI:U),C,0,0 S:G$memchr$0$0({2}DF,DG,SV:S),C,0,0 S:G$strchr$0$0({2}DF,DG,SC:U),C,0,0 S:G$strcspn$0$0({2}DF,SI:U),C,0,0 S:G$strpbrk$0$0({2}DF,DG,SC:U),C,0,0 S:G$strrchr$0$0({2}DF,DG,SC:U),C,0,0 S:G$strspn$0$0({2}DF,SI:U),C,0,0 S:G$strstr$0$0({2}DF,DG,SC:U),C,0,0 S:G$strtok$0$0({2}DF,DG,SC:U),C,0,0 S:G$memset$0$0({2}DF,DG,SV:S),C,0,0 S:G$strlen$0$0({2}DF,SI:U),C,0,0 S:G$USBD_SetUsbState$0$0({2}DF,SV:S),C,0,0 S:G$USBDCH9_SetupCmd$0$0({2}DF,SC:U),C,0,0 S:G$USBD_AbortAllTransfers$0$0({2}DF,SV:S),C,0,0 S:G$USBD_AbortTransfer$0$0({2}DF,SC:S),C,0,0 S:G$USBD_Connect$0$0({2}DF,SV:S),C,0,0 S:G$USBD_Disconnect$0$0({2}DF,SV:S),C,0,0 S:G$USBD_EpIsBusy$0$0({2}DF,SB0$1:U),C,0,0 S:G$USBD_GetUsbState$0$0({2}DF,SC:U),C,0,0 S:G$USBD_Init$0$0({2}DF,SC:S),C,0,0 S:G$USBD_Read$0$0({2}DF,SC:S),C,0,0 S:G$USBD_RemoteWakeup$0$0({2}DF,SC:S),C,0,0 S:G$USBD_StallEp$0$0({2}DF,SC:S),C,0,0 S:G$USBD_Stop$0$0({2}DF,SV:S),C,0,0 S:G$USBD_Suspend$0$0({2}DF,SV:S),C,0,0 S:G$USBD_UnStallEp$0$0({2}DF,SC:S),C,0,0 S:G$USBD_Write$0$0({2}DF,SC:S),C,0,0 S:G$USBD_EnterHandler$0$0({2}DF,SV:S),C,0,0 S:G$USBD_ExitHandler$0$0({2}DF,SV:S),C,0,0 S:G$USBD_ResetCb$0$0({2}DF,SV:S),C,0,0 S:G$USBD_SofCb$0$0({2}DF,SV:S),C,0,0 S:G$USBD_DeviceStateChangeCb$0$0({2}DF,SV:S),C,0,0 S:G$USBD_IsSelfPoweredCb$0$0({2}DF,SB0$1:U),C,0,0 S:G$USBD_SetupCmdCb$0$0({2}DF,SC:U),C,0,0 S:G$USBD_SetInterfaceCb$0$0({2}DF,SC:U),C,0,0 S:G$USBD_RemoteWakeupCb$0$0({2}DF,SB0$1:U),C,0,0 S:G$USBD_RemoteWakeupDelay$0$0({2}DF,SV:S),C,0,0 S:G$USBD_Run$0$0({2}DF,SV:S),C,0,0 S:G$USBD_XferCompleteCb$0$0({2}DF,SI:U),C,0,0 S:G$USB_ReadFIFO$0$0({2}DF,SV:S),C,0,0 S:G$USB_WriteFIFO$0$0({2}DF,SV:S),C,0,0 S:G$USB_GetIntsEnabled$0$0({2}DF,SB0$1:U),C,0,0 S:G$USB_IsRegulatorEnabled$0$0({2}DF,SB0$1:U),C,0,0 S:G$USB_IsPrefetchEnabled$0$0({2}DF,SB0$1:U),C,0,0 S:G$USB_SuspendOscillator$0$0({2}DF,SV:S),C,0,0 S:G$USB_SetIndex$0$0({2}DF,SV:S),C,0,0 S:G$USB_GetCommonInts$0$0({2}DF,SC:U),C,0,0 S:G$USB_GetInInts$0$0({2}DF,SC:U),C,0,0 S:G$USB_GetOutInts$0$0({2}DF,SC:U),C,0,0 S:G$USB_GetIndex$0$0({2}DF,SC:U),C,0,0 S:G$USB_IsSuspended$0$0({2}DF,SB0$1:U),C,0,0 S:G$USB_GetSetupEnd$0$0({2}DF,SB0$1:U),C,0,0 S:G$USB_Ep0SentStall$0$0({2}DF,SB0$1:U),C,0,0 S:G$USB_Ep0InPacketReady$0$0({2}DF,SB0$1:U),C,0,0 S:G$USB_Ep0OutPacketReady$0$0({2}DF,SB0$1:U),C,0,0 S:G$USB_Ep0GetCount$0$0({2}DF,SC:U),C,0,0 S:G$USB_EpnInGetSentStall$0$0({2}DF,SB0$1:U),C,0,0 S:G$USB_EpnGetInPacketReady$0$0({2}DF,SB0$1:U),C,0,0 S:G$USB_EpnOutGetSentStall$0$0({2}DF,SB0$1:U),C,0,0 S:G$USB_EpnGetOutPacketReady$0$0({2}DF,SB0$1:U),C,0,0 S:G$USB_EpOutGetCount$0$0({2}DF,SI:U),C,0,0 S:G$USB_GetSofNumber$0$0({2}DF,SI:U),C,0,0 S:G$USB_AbortInEp$0$0({2}DF,SV:S),C,0,0 S:G$USB_AbortOutEp$0$0({2}DF,SV:S),C,0,0 S:G$USB_ActivateEp$0$0({2}DF,SV:S),C,0,0 S:G$ReportDescriptor0$0$0({34}DA34d,SC:U),D,0,0 S:G$deviceDesc$0$0({14}DA14d,SC:U),D,0,0 S:G$configDesc$0$0({41}DA41d,SC:U),D,0,0 S:Fdescriptors$langDesc$0$0({4}DA2d,SI:U),D,0,0 S:Fdescriptors$mfrDesc$0$0({16}DA16d,SC:U),D,0,0 S:Fdescriptors$prodDesc$0$0({12}DA12d,SC:U),D,0,0 S:Fdescriptors$serDesc$0$0({20}DA20d,SC:U),D,0,0 S:Fdescriptors$int0Desc$0$0({12}DA12d,SC:U),D,0,0 S:G$initstruct$0$0({10}ST__00000008:S),D,0,0 S:Fdescriptors$__str_0$0$0({13}DA13d,SC:S),Z,0,0 S:Fdescriptors$__str_1$0$0({9}DA9d,SC:S),Z,0,0 S:Fdescriptors$__str_2$0$0({17}DA17d,SC:S),Z,0,0 S:Fdescriptors$__xinit_myUsbStringTable_USEnglish$0$0({10}DA5d,DC,SC:U),C,0,0
-- This file is generated by SWIG. Please do not modify by hand. -- with Interfaces; with Interfaces.C; with Interfaces.C.Pointers; package xcb.xcb_recolor_cursor_request_t is -- Item -- type Item is record major_opcode : aliased Interfaces.Unsigned_8; pad0 : aliased Interfaces.Unsigned_8; length : aliased Interfaces.Unsigned_16; cursor : aliased xcb.xcb_cursor_t; fore_red : aliased Interfaces.Unsigned_16; fore_green : aliased Interfaces.Unsigned_16; fore_blue : aliased Interfaces.Unsigned_16; back_red : aliased Interfaces.Unsigned_16; back_green : aliased Interfaces.Unsigned_16; back_blue : aliased Interfaces.Unsigned_16; end record; -- Item_Array -- type Item_Array is array (Interfaces.C .size_t range <>) of aliased xcb.xcb_recolor_cursor_request_t .Item; -- Pointer -- package C_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_recolor_cursor_request_t.Item, Element_Array => xcb.xcb_recolor_cursor_request_t.Item_Array, Default_Terminator => (others => <>)); subtype Pointer is C_Pointers.Pointer; -- Pointer_Array -- type Pointer_Array is array (Interfaces.C .size_t range <>) of aliased xcb.xcb_recolor_cursor_request_t .Pointer; -- Pointer_Pointer -- package C_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_recolor_cursor_request_t.Pointer, Element_Array => xcb.xcb_recolor_cursor_request_t.Pointer_Array, Default_Terminator => null); subtype Pointer_Pointer is C_Pointer_Pointers.Pointer; end xcb.xcb_recolor_cursor_request_t;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S W I T C H - B -- -- -- -- B o d y -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ with Bindgen; with Debug; use Debug; with Osint; use Osint; with Opt; use Opt; with System.OS_Lib; use System.OS_Lib; with System.WCh_Con; use System.WCh_Con; package body Switch.B is -------------------------- -- Scan_Binder_Switches -- -------------------------- procedure Scan_Binder_Switches (Switch_Chars : String) is Max : constant Integer := Switch_Chars'Last; Ptr : Integer := Switch_Chars'First; C : Character := ' '; function Get_Optional_Filename return String_Ptr; -- If current character is '=', return a newly allocated string that -- contains the remainder of the current switch (after the '='), else -- return null. function Get_Stack_Size (S : Character) return Int; -- Used for -d and -D to scan stack size including handling k/m. S is -- set to 'd' or 'D' to indicate the switch being scanned. procedure Scan_Debug_Switches; -- Scan out debug switches --------------------------- -- Get_Optional_Filename -- --------------------------- function Get_Optional_Filename return String_Ptr is Result : String_Ptr; begin if Ptr <= Max and then Switch_Chars (Ptr) = '=' then if Ptr = Max then Bad_Switch (Switch_Chars); else Result := new String'(Switch_Chars (Ptr + 1 .. Max)); Ptr := Max + 1; return Result; end if; end if; return null; end Get_Optional_Filename; -------------------- -- Get_Stack_Size -- -------------------- function Get_Stack_Size (S : Character) return Int is Result : Int; begin Scan_Pos (Switch_Chars, Max, Ptr, Result, S); -- In the following code, we enable overflow checking since the -- multiplication by K or M may cause overflow, which is an error. declare pragma Unsuppress (Overflow_Check); begin -- Check for additional character 'k' (for kilobytes) or 'm' (for -- Megabytes), but only if we have not reached the end of the -- switch string. Note that if this appears before the end of the -- string we will get an error when we test to make sure that the -- string is exhausted (at the end of the case). if Ptr <= Max then if Switch_Chars (Ptr) = 'k' then Result := Result * 1024; Ptr := Ptr + 1; elsif Switch_Chars (Ptr) = 'm' then Result := Result * (1024 * 1024); Ptr := Ptr + 1; end if; end if; exception when Constraint_Error => Osint.Fail ("numeric value out of range for switch: " & S); end; return Result; end Get_Stack_Size; ------------------------- -- Scan_Debug_Switches -- ------------------------- procedure Scan_Debug_Switches is Dot : Boolean := False; Underscore : Boolean := False; begin while Ptr <= Max loop C := Switch_Chars (Ptr); -- Binder debug flags come in the following forms: -- -- letter -- . letter -- _ letter -- -- digit -- . digit -- _ digit -- -- Note that the processing of switch -d aleady takes care of the -- case where the first flag is a digit (default stack size). if C in '1' .. '9' or else C in 'a' .. 'z' or else C in 'A' .. 'Z' then -- . letter -- . digit if Dot then Set_Dotted_Debug_Flag (C); Dot := False; -- _ letter -- _ digit elsif Underscore then Set_Underscored_Debug_Flag (C); Underscore := False; -- letter -- digit else Set_Debug_Flag (C); end if; elsif C = '.' then Dot := True; elsif C = '_' then Underscore := True; else Bad_Switch (Switch_Chars); end if; Ptr := Ptr + 1; end loop; end Scan_Debug_Switches; -- Start of processing for Scan_Binder_Switches begin -- Skip past the initial character (must be the switch character) if Ptr = Max then Bad_Switch (Switch_Chars); else Ptr := Ptr + 1; end if; -- A little check, "gnat" at the start of a switch is not allowed except -- for the compiler if Max >= Ptr + 3 and then Switch_Chars (Ptr .. Ptr + 3) = "gnat" then Osint.Fail ("invalid switch: """ & Switch_Chars & """" & " (gnat not needed here)"); end if; -- Loop to scan through switches given in switch string Check_Switch : begin C := Switch_Chars (Ptr); case C is -- Processing for a switch when 'a' => Ptr := Ptr + 1; Use_Pragma_Linker_Constructor := True; -- Processing for A switch when 'A' => Ptr := Ptr + 1; Output_ALI_List := True; ALI_List_Filename := Get_Optional_Filename; -- Processing for b switch when 'b' => Ptr := Ptr + 1; Brief_Output := True; -- Processing for c switch when 'c' => Ptr := Ptr + 1; Check_Only := True; -- Processing for d switch when 'd' => if Ptr = Max then Bad_Switch (Switch_Chars); end if; Ptr := Ptr + 1; C := Switch_Chars (Ptr); -- Case where character after -d is a digit (default stack size) if C in '0' .. '9' then -- In this case, we process the default primary stack size Default_Stack_Size := Get_Stack_Size ('d'); -- Case where character after -d is not digit (debug flags) else Scan_Debug_Switches; end if; -- Processing for D switch when 'D' => if Ptr = Max then Bad_Switch (Switch_Chars); end if; Ptr := Ptr + 1; Default_Sec_Stack_Size := Get_Stack_Size ('D'); -- Processing for e switch when 'e' => Ptr := Ptr + 1; Elab_Dependency_Output := True; -- Processing for E switch when 'E' => -- -E is equivalent to -Ea (see below) Exception_Tracebacks := True; Ptr := Ptr + 1; if Ptr <= Max then case Switch_Chars (Ptr) is -- -Ea sets Exception_Tracebacks when 'a' => null; -- -Es sets both Exception_Tracebacks and -- Exception_Tracebacks_Symbolic. when 's' => Exception_Tracebacks_Symbolic := True; when others => Bad_Switch (Switch_Chars); end case; Ptr := Ptr + 1; end if; -- Processing for f switch when 'f' => if Ptr = Max then Bad_Switch (Switch_Chars); end if; Force_Elab_Order_File := new String'(Switch_Chars (Ptr + 1 .. Max)); Ptr := Max + 1; if not Is_Read_Accessible_File (Force_Elab_Order_File.all) then Osint.Fail (Force_Elab_Order_File.all & ": file not found"); end if; -- Processing for F switch when 'F' => Ptr := Ptr + 1; Force_Checking_Of_Elaboration_Flags := True; -- Processing for g switch when 'g' => Ptr := Ptr + 1; if Ptr <= Max then C := Switch_Chars (Ptr); if C in '0' .. '3' then Debugger_Level := Character'Pos (Switch_Chars (Ptr)) - Character'Pos ('0'); Ptr := Ptr + 1; end if; else Debugger_Level := 2; end if; -- Processing for G switch when 'G' => Ptr := Ptr + 1; Generate_C_Code := True; -- Processing for h switch when 'h' => Ptr := Ptr + 1; Usage_Requested := True; -- Processing for H switch when 'H' => Ptr := Ptr + 1; Legacy_Elaboration_Order := True; -- Processing for i switch when 'i' => if Ptr = Max then Bad_Switch (Switch_Chars); end if; Ptr := Ptr + 1; C := Switch_Chars (Ptr); if C in '1' .. '5' or else C = '8' or else C = 'p' or else C = 'f' or else C = 'n' or else C = 'w' then Identifier_Character_Set := C; Ptr := Ptr + 1; else Bad_Switch (Switch_Chars); end if; -- Processing for K switch when 'K' => Ptr := Ptr + 1; Output_Linker_Option_List := True; -- Processing for l switch when 'l' => Ptr := Ptr + 1; Elab_Order_Output := True; -- Processing for m switch when 'm' => if Ptr = Max then Bad_Switch (Switch_Chars); end if; Ptr := Ptr + 1; Scan_Pos (Switch_Chars, Max, Ptr, Maximum_Messages, C); -- Processing for n switch when 'n' => Ptr := Ptr + 1; Bind_Main_Program := False; -- Note: The -L option of the binder also implies -n, so -- any change here must also be reflected in the processing -- for -L that is found in Gnatbind.Scan_Bind_Arg. -- Processing for o switch when 'o' => Ptr := Ptr + 1; if Output_File_Name_Present then Osint.Fail ("duplicate -o switch"); else Output_File_Name_Present := True; end if; -- Processing for O switch when 'O' => Ptr := Ptr + 1; Output_Object_List := True; Object_List_Filename := Get_Optional_Filename; -- Processing for p switch when 'p' => Ptr := Ptr + 1; Pessimistic_Elab_Order := True; -- Processing for P switch when 'P' => Ptr := Ptr + 1; CodePeer_Mode := True; -- Processing for q switch when 'q' => Ptr := Ptr + 1; Quiet_Output := True; -- Processing for Q switch when 'Q' => if Ptr = Max then Bad_Switch (Switch_Chars); end if; Ptr := Ptr + 1; Scan_Nat (Switch_Chars, Max, Ptr, Quantity_Of_Default_Size_Sec_Stacks, C); -- Processing for r switch when 'r' => Ptr := Ptr + 1; List_Restrictions := True; -- Processing for R switch when 'R' => Ptr := Ptr + 1; List_Closure := True; if Ptr <= Max and then Switch_Chars (Ptr) = 'a' then Ptr := Ptr + 1; List_Closure_All := True; end if; -- Processing for s switch when 's' => Ptr := Ptr + 1; All_Sources := True; Check_Source_Files := True; -- Processing for t switch when 't' => Ptr := Ptr + 1; Tolerate_Consistency_Errors := True; -- Processing for T switch when 'T' => if Ptr = Max then Bad_Switch (Switch_Chars); end if; Ptr := Ptr + 1; Time_Slice_Set := True; Scan_Nat (Switch_Chars, Max, Ptr, Time_Slice_Value, C); Time_Slice_Value := Time_Slice_Value * 1_000; -- Processing for u switch when 'u' => if Ptr = Max then Bad_Switch (Switch_Chars); end if; Ptr := Ptr + 1; Dynamic_Stack_Measurement := True; Scan_Nat (Switch_Chars, Max, Ptr, Dynamic_Stack_Measurement_Array_Size, C); -- Processing for v switch when 'v' => Ptr := Ptr + 1; Verbose_Mode := True; -- Processing for V switch when 'V' => declare Eq : Integer; begin Ptr := Ptr + 1; Eq := Ptr; while Eq <= Max and then Switch_Chars (Eq) /= '=' loop Eq := Eq + 1; end loop; if Eq = Ptr or else Eq = Max then Bad_Switch (Switch_Chars); end if; Bindgen.Set_Bind_Env (Key => Switch_Chars (Ptr .. Eq - 1), Value => Switch_Chars (Eq + 1 .. Max)); Ptr := Max + 1; end; -- Processing for w switch when 'w' => if Ptr = Max then Bad_Switch (Switch_Chars); end if; -- For the binder we only allow suppress/error cases Ptr := Ptr + 1; case Switch_Chars (Ptr) is when 'e' => Warning_Mode := Treat_As_Error; when 'E' => Warning_Mode := Treat_Run_Time_Warnings_As_Errors; when 's' => Warning_Mode := Suppress; when others => Bad_Switch (Switch_Chars); end case; Ptr := Ptr + 1; -- Processing for W switch when 'W' => Ptr := Ptr + 1; if Ptr > Max then Bad_Switch (Switch_Chars); end if; begin Wide_Character_Encoding_Method := Get_WC_Encoding_Method (Switch_Chars (Ptr)); exception when Constraint_Error => Bad_Switch (Switch_Chars); end; Wide_Character_Encoding_Method_Specified := True; Upper_Half_Encoding := Wide_Character_Encoding_Method in WC_Upper_Half_Encoding_Method; Ptr := Ptr + 1; -- Processing for x switch when 'x' => Ptr := Ptr + 1; All_Sources := False; Check_Source_Files := False; -- Processing for X switch when 'X' => if Ptr = Max then Bad_Switch (Switch_Chars); end if; Ptr := Ptr + 1; Scan_Pos (Switch_Chars, Max, Ptr, Default_Exit_Status, C); -- Processing for y switch when 'y' => Ptr := Ptr + 1; Leap_Seconds_Support := True; -- Processing for z switch when 'z' => Ptr := Ptr + 1; No_Main_Subprogram := True; -- Processing for Z switch when 'Z' => Ptr := Ptr + 1; Zero_Formatting := True; -- Processing for --RTS when '-' => if Ptr + 4 <= Max and then Switch_Chars (Ptr + 1 .. Ptr + 3) = "RTS" then Ptr := Ptr + 4; if Switch_Chars (Ptr) /= '=' or else Ptr = Max then Osint.Fail ("missing path for --RTS"); else -- Valid --RTS switch Opt.No_Stdinc := True; Opt.RTS_Switch := True; declare Src_Path_Name : constant String_Ptr := Get_RTS_Search_Dir (Switch_Chars (Ptr + 1 .. Max), Include); Lib_Path_Name : constant String_Ptr := Get_RTS_Search_Dir (Switch_Chars (Ptr + 1 .. Max), Objects); begin if Src_Path_Name /= null and then Lib_Path_Name /= null then -- Set the RTS_*_Path_Name variables, so that the -- correct directories will be set when a subsequent -- call Osint.Add_Default_Search_Dirs is made. RTS_Src_Path_Name := Src_Path_Name; RTS_Lib_Path_Name := Lib_Path_Name; Ptr := Max + 1; elsif Src_Path_Name = null and then Lib_Path_Name = null then Osint.Fail ("RTS path not valid: missing adainclude and " & "adalib directories"); elsif Src_Path_Name = null then Osint.Fail ("RTS path not valid: missing adainclude directory"); elsif Lib_Path_Name = null then Osint.Fail ("RTS path not valid: missing adalib directory"); end if; end; end if; else Bad_Switch (Switch_Chars); end if; -- Anything else is an error (illegal switch character) when others => Bad_Switch (Switch_Chars); end case; if Ptr <= Max then Bad_Switch (Switch_Chars); end if; end Check_Switch; end Scan_Binder_Switches; end Switch.B;
with STM32.Setup; with STM32_SVD.RCC; use STM32_SVD.RCC; with STM32_SVD.DBGMCU; use STM32_SVD.DBGMCU; package body STM32.Board is --------------------- -- Initialize_LEDs -- --------------------- procedure Initialize_LEDs is Configuration : GPIO_Port_Configuration; begin Enable_Clock (LED1); Configuration.Mode := Mode_Out; Configuration.Output_Type := Push_Pull; Configuration.Speed := Speed_2MHz; Configuration.Resistors := Floating; Configure_IO (LED1, Config => Configuration); end Initialize_LEDs; procedure Initialize_Board is begin -- Two steps here to enable the debugger in WFI -- 1) Enable the DBGMCU regs. -- RCC_Periph.APB2ENR.DBGEN := True; -- 2) Allow debug in these 3 states -- w/o this setting, a WFI is goodbye to your gdb session. DBGMCU_Periph.CR := (DBG_SLEEP => True, DBG_STOP => True, DBG_STANDBY => True, others => <>); Initialize_LEDs; end Initialize_Board; end STM32.Board;
------------------------------------------------------------------------------- -- Copyright (c) 2017 Daniel King -- -- Permission is hereby granted, free of charge, to any person obtaining a -- copy of this software and associated documentation files (the "Software"), -- to deal in the Software without restriction, including without limitation -- the rights to use, copy, modify, merge, publish, distribute, sublicense, -- and/or sell copies of the Software, and to permit persons to whom the -- Software is furnished to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be included in -- all copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -- DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- with DW1000.Driver; use DW1000.Driver; package body Configurations with SPARK_Mode => On is type Preamble_Codes_Array is array (Positive range 1 .. 7, DW1000.Driver.PRF_Type) of DW1000.Driver.Preamble_Code_Number; type PRF_Config_Array is array (EVB1000.S1.Bit) of DW1000.Driver.PRF_Type; type Data_Rate_Config_Array is array (EVB1000.S1.Bit, EVB1000.S1.Bit) of DW1000.Driver.Data_Rates; type Channels_Config_Array is array (EVB1000.S1.Bit, EVB1000.S1.Bit, EVB1000.S1.Bit) of DW1000.Driver.Channel_Number; Preamble_Codes : constant Preamble_Codes_Array := (1 => (PRF_16MHz => 1, PRF_64MHz => 9), 2 => (PRF_16MHz => 3, PRF_64MHz => 10), 3 => (PRF_16MHz => 5, PRF_64MHz => 11), 4 => (PRF_16MHz => 7, PRF_64MHz => 17), 5 => (PRF_16MHz => 4, PRF_64MHz => 12), 6 => (PRF_16MHz => 1, -- Channel 6 not used PRF_64MHz => 9), 7 => (PRF_16MHz => 8, PRF_64MHz => 18)); PRF_Config : constant PRF_Config_Array := (0 => PRF_16MHz, 1 => PRF_64MHz); Data_Rate_Config : constant Data_Rate_Config_Array := (0 => (0 => Data_Rate_110k, 1 => Data_Rate_850k), 1 => (0 => Data_Rate_6M8, 1 => Data_Rate_6M8)); Channel_Config : constant Channels_Config_Array := (0 => (0 => (0 => 1, 1 => 2), 1 => (0 => 3, 1 => 4)), 1 => (0 => (0 => 5, 1 => 7), 1 => (0 => 7, 1 => 7))); procedure Get_Switches_Config (Config : out DecaDriver.Core.Configuration_Type) is Switches : EVB1000.S1.Switch_Bit_Array; Channel : DW1000.Driver.Channel_Number; PRF : DW1000.Driver.PRF_Type; Data_Rate : DW1000.Driver.Data_Rates; begin EVB1000.S1.Read_All (Switches); Data_Rate := Data_Rate_Config (Switches (3), Switches (4)); PRF := PRF_Config (Switches (5)); Channel := Channel_Config (Switches (6), Switches (7), Switches (8)); Config := DecaDriver.Core.Configuration_Type' (Channel => Channel, PRF => PRF, Tx_Preamble_Length => PLEN_1024, Rx_PAC => PAC_32, Tx_Preamble_Code => Preamble_Codes (Positive (Channel), PRF), Rx_Preamble_Code => Preamble_Codes (Positive (Channel), PRF), Use_Nonstandard_SFD => False, Data_Rate => Data_Rate, PHR_Mode => Standard_Frames, SFD_Timeout => 1024 + 64 + 1); end Get_Switches_Config; end Configurations;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G N A T . S O C K E T S . C O N S T A N T S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2000-2005, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides target dependent definitions of constant for use -- by the GNAT.Sockets package (g-socket.ads). This package should not be -- directly with'ed by an applications program. -- This is the version for powerpc-apple-darwin7.4.1 -- This file is generated automatically, do not modify it by hand! Instead, -- make changes to gen-soccon.c and re-run it on each target. package GNAT.Sockets.Constants is -------------- -- Families -- -------------- AF_INET : constant := 2; -- IPv4 address family AF_INET6 : constant := 30; -- IPv6 address family ----------- -- Modes -- ----------- SOCK_STREAM : constant := 1; -- Stream socket SOCK_DGRAM : constant := 2; -- Datagram socket ------------------- -- Socket errors -- ------------------- EACCES : constant := 13; -- Permission denied EADDRINUSE : constant := 48; -- Address already in use EADDRNOTAVAIL : constant := 49; -- Cannot assign address EAFNOSUPPORT : constant := 47; -- Addr family not supported EALREADY : constant := 37; -- Operation in progress EBADF : constant := 9; -- Bad file descriptor ECONNABORTED : constant := 53; -- Connection aborted ECONNREFUSED : constant := 61; -- Connection refused ECONNRESET : constant := 54; -- Connection reset by peer EDESTADDRREQ : constant := 39; -- Destination addr required EFAULT : constant := 14; -- Bad address EHOSTDOWN : constant := 64; -- Host is down EHOSTUNREACH : constant := 65; -- No route to host EINPROGRESS : constant := 36; -- Operation now in progress EINTR : constant := 4; -- Interrupted system call EINVAL : constant := 22; -- Invalid argument EIO : constant := 5; -- Input output error EISCONN : constant := 56; -- Socket already connected ELOOP : constant := 62; -- Too many symbolic lynks EMFILE : constant := 24; -- Too many open files EMSGSIZE : constant := 40; -- Message too long ENAMETOOLONG : constant := 63; -- Name too long ENETDOWN : constant := 50; -- Network is down ENETRESET : constant := 52; -- Disconn. on network reset ENETUNREACH : constant := 51; -- Network is unreachable ENOBUFS : constant := 55; -- No buffer space available ENOPROTOOPT : constant := 42; -- Protocol not available ENOTCONN : constant := 57; -- Socket not connected ENOTSOCK : constant := 38; -- Operation on non socket EOPNOTSUPP : constant := 45; -- Operation not supported EPFNOSUPPORT : constant := 46; -- Unknown protocol family EPROTONOSUPPORT : constant := 43; -- Unknown protocol EPROTOTYPE : constant := 41; -- Unknown protocol type ESHUTDOWN : constant := 58; -- Cannot send once shutdown ESOCKTNOSUPPORT : constant := 44; -- Socket type not supported ETIMEDOUT : constant := 60; -- Connection timed out ETOOMANYREFS : constant := 59; -- Too many references EWOULDBLOCK : constant := 35; -- Operation would block ----------------- -- Host errors -- ----------------- HOST_NOT_FOUND : constant := 1; -- Unknown host TRY_AGAIN : constant := 2; -- Host name lookup failure NO_DATA : constant := 4; -- No data record for name NO_RECOVERY : constant := 3; -- Non recoverable errors ------------------- -- Control flags -- ------------------- FIONBIO : constant := -2147195266; -- Set/clear non-blocking io FIONREAD : constant := 1074030207; -- How many bytes to read -------------------- -- Shutdown modes -- -------------------- SHUT_RD : constant := 0; -- No more recv SHUT_WR : constant := 1; -- No more send SHUT_RDWR : constant := 2; -- No more recv/send --------------------- -- Protocol levels -- --------------------- SOL_SOCKET : constant := 65535; -- Options for socket level IPPROTO_IP : constant := 0; -- Dummy protocol for IP IPPROTO_UDP : constant := 17; -- UDP IPPROTO_TCP : constant := 6; -- TCP ------------------- -- Request flags -- ------------------- MSG_OOB : constant := 1; -- Process out-of-band data MSG_PEEK : constant := 2; -- Peek at incoming data MSG_EOR : constant := 8; -- Send end of record MSG_WAITALL : constant := 64; -- Wait for full reception MSG_NOSIGNAL : constant := -1; -- No SIGPIPE on send MSG_Forced_Flags : constant := 0; -- Flags set on all send(2) calls -------------------- -- Socket options -- -------------------- TCP_NODELAY : constant := 1; -- Do not coalesce packets SO_REUSEADDR : constant := 4; -- Bind reuse local address SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs SO_LINGER : constant := 128; -- Defer close to flush data SO_BROADCAST : constant := 32; -- Can send broadcast msgs SO_SNDBUF : constant := 4097; -- Set/get send buffer size SO_RCVBUF : constant := 4098; -- Set/get recv buffer size SO_SNDTIMEO : constant := 4101; -- Emission timeout SO_RCVTIMEO : constant := 4102; -- Reception timeout SO_ERROR : constant := 4103; -- Get/clear error status IP_MULTICAST_IF : constant := 9; -- Set/get mcast interface IP_MULTICAST_TTL : constant := 10; -- Set/get multicast TTL IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group ------------------- -- System limits -- ------------------- IOV_MAX : constant := 2147483647; -- Maximum writev iovcnt ---------------------- -- Type definitions -- ---------------------- -- Sizes (in bytes) of the components of struct timeval SIZEOF_tv_sec : constant := 4; -- tv_sec SIZEOF_tv_usec : constant := 4; -- tv_usec end GNAT.Sockets.Constants;
-------------------------------------------------------------------------------------------------------------------- -- Copyright (c) 2013-2020, Luke A. Guest -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages -- arising from the use of this software. -- -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it -- freely, subject to the following restrictions: -- -- 1. The origin of this software must not be misrepresented; you must not -- claim that you wrote the original software. If you use this software -- in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. -- -- 2. Altered source versions must be plainly marked as such, and must not be -- misrepresented as being the original software. -- -- 3. This notice may not be removed or altered from any source -- distribution. -------------------------------------------------------------------------------------------------------------------- with SDL.Error; package body SDL.RWops.Streams is use type Interfaces.C.unsigned_long; function Open (Op : in RWops) return RWops_Stream is begin return (Ada.Streams.Root_Stream_Type with Context => Op); end Open; procedure Open (Op : in RWops; Stream : out RWops_Stream) is begin Stream.Context := Op; end Open; procedure Close (Stream : in RWops_Stream) is begin Close (Stream.Context); end Close; overriding procedure Read (Stream : in out RWops_Stream; Item : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset) is Objects_Read : Interfaces.C.unsigned_long := 0; begin -- Re-implemented c-macro: -- #define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) -- Read : access function -- (context : RWops_Pointer; -- ptr : System.Address; -- size : Interfaces.C.unsigned_long; -- maxnum : Interfaces.C.unsigned_long) return Interfaces.C.unsigned_long; Objects_Read := Stream.Context.Read (Context => RWops_Pointer (Stream.Context), Ptr => Item'Address, Size => Item'Length, Max_Num => 1); if Objects_Read = 0 then raise RWops_Error with SDL.Error.Get; end if; Last := Item'Length; end Read; overriding procedure Write (Stream : in out RWops_Stream; Item : Ada.Streams.Stream_Element_Array) is Objects_Written : Interfaces.C.unsigned_long := 0; begin -- Re-implemented c-macro: -- #define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) -- Write : access function -- (Context : RWops_Pointer; -- Ptr : System.Address; -- Size : Interfaces.C.unsigned_long; -- Num : Interfaces.C.unsigned_long) return Interfaces.C.unsigned_long; Objects_Written := Stream.Context.Write (Context => RWops_Pointer (Stream.Context), Ptr => Item'Address, Size => Item'Length, Num => 1); if Objects_Written = 0 then raise RWops_Error with SDL.Error.Get; end if; end Write; end SDL.RWops.Streams;
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ADA.STRINGS.FIXED.HASH_CASE_INSENSITIVE -- -- -- -- S p e c -- -- -- -- Copyright (C) 2011-2021, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ with Ada.Containers; with Ada.Strings.Hash_Case_Insensitive; function Ada.Strings.Fixed.Hash_Case_Insensitive (Key : String) return Containers.Hash_Type renames Ada.Strings.Hash_Case_Insensitive; pragma Pure (Ada.Strings.Fixed.Hash_Case_Insensitive);
-- Abstract : -- -- External process parser for gpr mode -- -- Copyright (C) 2017 - 2019 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or -- modify it under terms of the GNU General Public License as -- published by the Free Software Foundation; either version 3, or (at -- your option) any later version. This program is distributed in the -- hope that it will be useful, but WITHOUT ANY WARRANTY; without even -- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -- PURPOSE. See the GNU General Public License for more details. You -- should have received a copy of the GNU General Public License -- distributed with this program; see file COPYING. If not, write to -- the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, -- MA 02110-1335, USA. pragma License (GPL); with Gen_Emacs_Wisi_LR_Parse; with Gpr_Process_Actions; with Gpr_Process_LR1_Main; with Wisi.Gpr; procedure Gpr_Mode_Wisi_Parse is new Gen_Emacs_Wisi_LR_Parse (Parse_Data_Type => Wisi.Gpr.Parse_Data_Type, Language_Protocol_Version => Wisi.Gpr.Language_Protocol_Version, Name => "gpr_mode_wisi_parse", Descriptor => Gpr_Process_Actions.Descriptor, Partial_Parse_Active => Gpr_Process_Actions.Partial_Parse_Active, Language_Fixes => null, Language_Matching_Begin_Tokens => null, Language_String_ID_Set => null, Create_Parser => Gpr_Process_LR1_Main.Create_Parser);
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017, Universidad Politécnica de Madrid -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------- -- Telemetry reception subsystem with HK_Data; use HK_Data; with TTC_Data; use TTC_Data; with Ada.Real_Time; use Ada.Real_Time; with System; package TTC is procedure Init; -- Initialize TTC sybsystem procedure Send (TC : TC_Type := HK); -- Send a telecommand private task TM_Receiver with Priority => System.Default_Priority; -- replace with DMS priority when available task TC_Sender with Priority => System.Default_Priority; -- replace with DMS priority when available end TTC;
----------------------------------------------------------------------- -- awa -- Ada Web Application -- Copyright (C) 2009, 2010, 2011, 2012 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with ASF.Requests; with ASF.Responses; with ASF.Server; with Ada.IO_Exceptions; with Util.Files; with Util.Properties; with EL.Contexts.Default; with AWA.Modules.Reader; with AWA.Applications; package body AWA.Modules is -- ------------------------------ -- Get the module name -- ------------------------------ function Get_Name (Plugin : in Module) return String is begin return To_String (Plugin.Name); end Get_Name; -- ------------------------------ -- Get the base URI for this module -- ------------------------------ function Get_URI (Plugin : in Module) return String is begin return To_String (Plugin.URI); end Get_URI; -- ------------------------------ -- Get the application in which this module is registered. -- ------------------------------ function Get_Application (Plugin : in Module) return Application_Access is begin return Plugin.App; end Get_Application; -- ------------------------------ -- Get the module configuration property identified by the name. -- If the configuration property does not exist, returns the default value. -- ------------------------------ function Get_Config (Plugin : Module; Name : String; Default : String := "") return String is begin return Plugin.Config.Get (Name, Default); end Get_Config; -- ------------------------------ -- Get the module configuration property identified by the name. -- If the configuration property does not exist, returns the default value. -- ------------------------------ function Get_Config (Plugin : in Module; Name : in String; Default : in Integer := -1) return Integer is Value : constant String := Plugin.Config.Get (Name, Integer'Image (Default)); begin return Integer'Value (Value); exception when Constraint_Error => return Default; end Get_Config; -- ------------------------------ -- Get the module configuration property identified by the <tt>Config</tt> parameter. -- If the property does not exist, the default configuration value is returned. -- ------------------------------ function Get_Config (Plugin : in Module; Config : in ASF.Applications.Config_Param) return String is begin return Plugin.Config.Get (Config); end Get_Config; -- ------------------------------ -- Send the event to the module -- ------------------------------ procedure Send_Event (Plugin : in Module; Content : in AWA.Events.Module_Event'Class) is begin Plugin.App.Send_Event (Content); end Send_Event; -- ------------------------------ -- Find the module with the given name -- ------------------------------ function Find_Module (Plugin : Module; Name : String) return Module_Access is begin if Plugin.Registry = null then return null; end if; return Find_By_Name (Plugin.Registry.all, Name); end Find_Module; -- ------------------------------ -- Register under the given name a function to create the bean instance when -- it is accessed for a first time. The scope defines the scope of the bean. -- bean -- ------------------------------ procedure Register (Plugin : in out Module; Name : in String; Bind : in ASF.Beans.Class_Binding_Access) is begin Plugin.App.Register_Class (Name, Bind); end Register; -- ------------------------------ -- Finalize the module. -- ------------------------------ overriding procedure Finalize (Plugin : in out Module) is begin null; end Finalize; procedure Initialize (Manager : in out Module_Manager; Module : in AWA.Modules.Module'Class) is begin Manager.Module := Module.Self; end Initialize; function Get_Value (Manager : in Module_Manager; Name : in String) return Util.Beans.Objects.Object is pragma Unreferenced (Manager, Name); begin return Util.Beans.Objects.Null_Object; end Get_Value; -- Module manager -- -- ------------------------------ -- Get the database connection for reading -- ------------------------------ function Get_Session (Manager : Module_Manager) return ADO.Sessions.Session is begin return Manager.Module.Get_Session; end Get_Session; -- ------------------------------ -- Get the database connection for writing -- ------------------------------ function Get_Master_Session (Manager : Module_Manager) return ADO.Sessions.Master_Session is begin return Manager.Module.Get_Master_Session; end Get_Master_Session; -- ------------------------------ -- Send the event to the module. The module identified by <b>To</b> is -- found and the event is posted on its event channel. -- ------------------------------ procedure Send_Event (Manager : in Module_Manager; Content : in AWA.Events.Module_Event'Class) is begin Manager.Module.Send_Event (Content); end Send_Event; procedure Initialize (Plugin : in out Module; App : in Application_Access; Props : in ASF.Applications.Config) is pragma Unreferenced (Props); begin Plugin.Self := Plugin'Unchecked_Access; Plugin.App := App; end Initialize; -- ------------------------------ -- Initialize the registry -- ------------------------------ procedure Initialize (Registry : in out Module_Registry; Config : in ASF.Applications.Config) is begin Registry.Config := Config; end Initialize; -- ------------------------------ -- Register the module in the registry. -- ------------------------------ procedure Register (Registry : in Module_Registry_Access; App : in Application_Access; Plugin : in Module_Access; Name : in String; URI : in String) is procedure Copy (Params : in Util.Properties.Manager'Class); procedure Copy (Params : in Util.Properties.Manager'Class) is begin Plugin.Config.Copy (From => Params, Prefix => Name & ".", Strip => True); end Copy; Paths : constant String := Registry.Config.Get (Applications.P_Module_Dir.P); begin Log.Info ("Register module '{0}' under URI '{1}'", Name, URI); if Plugin.Registry /= null then Log.Error ("Module '{0}' is already attached to a registry", Name); raise Program_Error with "Module '" & Name & "' already registered"; end if; Plugin.App := App; Plugin.Registry := Registry; Plugin.Name := To_Unbounded_String (Name); Plugin.URI := To_Unbounded_String (URI); Plugin.Registry.Name_Map.Insert (Name, Plugin); if URI /= "" then Plugin.Registry.URI_Map.Insert (URI, Plugin); end if; -- Load the module configuration file Log.Debug ("Module search path: {0}", Paths); declare Base : constant String := Name & ".properties"; Path : constant String := Util.Files.Find_File_Path (Base, Paths); begin Plugin.Config.Load_Properties (Path => Path, Prefix => Name & ".", Strip => True); exception when Ada.IO_Exceptions.Name_Error => Log.Info ("Module configuration file '{0}' does not exist", Path); end; Plugin.Initialize (App, Plugin.Config); -- Read the module XML configuration file if there is one. declare Base : constant String := Plugin.Config.Get ("config", Name & ".xml"); Path : constant String := Util.Files.Find_File_Path (Base, Paths); Ctx : aliased EL.Contexts.Default.Default_Context; begin AWA.Modules.Reader.Read_Configuration (Plugin.all, Path, Ctx'Unchecked_Access); exception when Ada.IO_Exceptions.Name_Error => Log.Warn ("Module configuration file '{0}' does not exist", Path); end; -- Override the module configuration with the application configuration App.Get_Init_Parameters (Copy'Access); Plugin.Configure (Plugin.Config); exception when Constraint_Error => Log.Error ("Another module is already registered " & "under name '{0}' or URI '{1}'", Name, URI); raise; end Register; -- ------------------------------ -- Find the module with the given name -- ------------------------------ function Find_By_Name (Registry : Module_Registry; Name : String) return Module_Access is Pos : constant Module_Maps.Cursor := Module_Maps.Find (Registry.Name_Map, Name); begin if Module_Maps.Has_Element (Pos) then return Module_Maps.Element (Pos); end if; return null; end Find_By_Name; -- ------------------------------ -- Find the module mapped to a given URI -- ------------------------------ function Find_By_URI (Registry : Module_Registry; URI : String) return Module_Access is Pos : constant Module_Maps.Cursor := Module_Maps.Find (Registry.URI_Map, URI); begin if Module_Maps.Has_Element (Pos) then return Module_Maps.Element (Pos); end if; return null; end Find_By_URI; -- ------------------------------ -- Iterate over the modules that have been registered and execute the <b>Process</b> -- procedure on each of the module instance. -- ------------------------------ procedure Iterate (Registry : in Module_Registry; Process : access procedure (Plugin : in out Module'Class)) is Iter : Module_Maps.Cursor := Registry.Name_Map.First; begin while Module_Maps.Has_Element (Iter) loop Process (Module_Maps.Element (Iter).all); Module_Maps.Next (Iter); end loop; end Iterate; -- ------------------------------ -- Get the database connection for reading -- ------------------------------ function Get_Session (Manager : Module) return ADO.Sessions.Session is begin return Manager.App.Get_Session; end Get_Session; -- ------------------------------ -- Get the database connection for writing -- ------------------------------ function Get_Master_Session (Manager : Module) return ADO.Sessions.Master_Session is begin return Manager.App.Get_Master_Session; end Get_Master_Session; -- ------------------------------ -- Add a listener to the module listner list. The module will invoke the listner -- depending on events or actions that occur in the module. -- ------------------------------ procedure Add_Listener (Into : in out Module; Item : in Util.Listeners.Listener_Access) is begin Util.Listeners.Add_Listener (Into.Listeners, Item); end Add_Listener; -- ------------------------------ -- Remove a listener from the module listener list. -- ------------------------------ procedure Remove_Listener (Into : in out Module; Item : in Util.Listeners.Listener_Access) is begin Util.Listeners.Remove_Listener (Into.Listeners, Item); end Remove_Listener; -- Get per request manager => look in Request -- Get per session manager => look in Request.Get_Session -- Get per application manager => look in Application -- Get per pool manager => look in pool attached to Application function Get_Manager return Manager_Type_Access is procedure Process (Request : in out ASF.Requests.Request'Class; Response : in out ASF.Responses.Response'Class); Value : Util.Beans.Objects.Object; procedure Process (Request : in out ASF.Requests.Request'Class; Response : in out ASF.Responses.Response'Class) is pragma Unreferenced (Response); begin Value := Request.Get_Attribute (Name); if Util.Beans.Objects.Is_Null (Value) then declare M : constant Manager_Type_Access := new Manager_Type; begin Value := Util.Beans.Objects.To_Object (M.all'Unchecked_Access); Request.Set_Attribute (Name, Value); end; end if; end Process; begin ASF.Server.Update_Context (Process'Access); if Util.Beans.Objects.Is_Null (Value) then return null; end if; declare B : constant access Util.Beans.Basic.Readonly_Bean'Class := Util.Beans.Objects.To_Bean (Value); begin if not (B.all in Manager_Type'Class) then return null; end if; return Manager_Type'Class (B.all)'Unchecked_Access; end; end Get_Manager; end AWA.Modules;
----------------------------------------------------------------------- -- awa-votes -- Module votes -- Copyright (C) 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. ----------------------------------------------------------------------- -- == Introduction == -- The <b>Votes</b> module allows users to vote for objects defined in the application. -- Users can vote by setting a rating value on an item (+1, -1 or any other integer value). -- The Votes module makes sure that users can vote only once for an item. A global rating -- is associated with the item to give the vote summary. The vote can be associated with -- any database entity and it is not necessary to change other entities in your data model. -- -- == Model == -- [http://ada-awa.googlecode.com/svn/wiki/awa_votes_model.png] -- -- @include awa-votes-modules.ads -- @include awa-votes-beans.ads -- -- == Javascript Integration == -- The <b>Votes</b> module provides a Javascript support to help users vote for items. -- The Javascript file <tt>/js/awa-votes.js</tt> must be included in the Javascript page. -- It is based on jQuery and ASF. The vote actions are activated on the page items as -- follows in XHTML facelet files: -- -- <util:script> -- $('.question-vote').votes({ -- voteUrl: "#{contextPath}/questions/ajax/questionVote/vote?id=", -- itemPrefix: "vote_for-" -- }); -- </util:script> -- -- When the vote up or down HTML element is clicked, the <tt>vote</tt> operation of the -- managed bean <tt>questionVote</tt> is called. The operation will update the user's vote -- for the selected item (in the example "a question"). package AWA.Votes is pragma Preelaborate; end AWA.Votes;
----------------------------------------------------------------------- -- gen-model-enums -- Enum definitions -- Copyright (C) 2011, 2012, 2018, 2021 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. ----------------------------------------------------------------------- package body Gen.Model.Enums is -- ------------------------------ -- Get the value identified by the name. -- If the name cannot be found, the method should return the Null object. -- ------------------------------ overriding function Get_Value (From : Value_Definition; Name : String) return UBO.Object is begin if Name = "value" then return UBO.To_Object (From.Number); else return Definition (From).Get_Value (Name); end if; end Get_Value; -- ------------------------------ -- Get the value identified by the name. -- If the name cannot be found, the method should return the Null object. -- ------------------------------ overriding function Get_Value (From : Enum_Definition; Name : String) return UBO.Object is begin if Name = "values" then return From.Values_Bean; elsif Name = "name" then return UBO.To_Object (From.Type_Name); elsif Name = "isEnum" or Name = "isDiscrete" then return UBO.To_Object (True); elsif Name = "sqlType" then if Length (From.Sql_Type) > 0 then return UBO.To_Object (Mappings.Get_Type_Name (From.Sql_Type)); else return UBO.To_Object (Mappings.Get_Type_Name (To_UString ("enum"))); end if; else return Mappings.Mapping_Definition (From).Get_Value (Name); end if; end Get_Value; -- ------------------------------ -- Compare two enum literals. -- ------------------------------ function "<" (Left, Right : in Value_Definition_Access) return Boolean is begin return Left.Number < Right.Number; end "<"; -- ------------------------------ -- Prepare the generation of the model. -- ------------------------------ overriding procedure Prepare (O : in out Enum_Definition) is procedure Sort is new Value_List.Sort_On ("<"); begin O.Target := O.Type_Name; Sort (O.Values); end Prepare; -- ------------------------------ -- Initialize the table definition instance. -- ------------------------------ overriding procedure Initialize (O : in out Enum_Definition) is begin O.Values_Bean := UBO.To_Object (O.Values'Unchecked_Access, UBO.STATIC); end Initialize; -- ------------------------------ -- Add an enum value to this enum definition and return the new value. -- ------------------------------ procedure Add_Value (Enum : in out Enum_Definition; Name : in String; Value : out Value_Definition_Access) is begin Value := new Value_Definition; Value.Set_Name (Name); Value.Number := Enum.Values.Get_Count; Enum.Values.Append (Value); end Add_Value; -- ------------------------------ -- Create an enum with the given name. -- ------------------------------ function Create_Enum (Name : in UString) return Enum_Definition_Access is Enum : constant Enum_Definition_Access := new Enum_Definition; begin Enum.Set_Name (Name); declare use Ada.Strings.Unbounded; Pos : constant Natural := Index (Enum.Name, ".", Ada.Strings.Backward); begin if Pos > 0 then Enum.Pkg_Name := Unbounded_Slice (Enum.Name, 1, Pos - 1); Enum.Type_Name := Unbounded_Slice (Enum.Name, Pos + 1, Length (Enum.Name)); Enum.Nullable_Type := "Nullable_" & Enum.Type_Name; else Enum.Pkg_Name := To_UString ("ADO"); Enum.Type_Name := Enum.Name; Enum.Nullable_Type := "Nullable_" & Enum.Name; end if; end; return Enum; end Create_Enum; end Gen.Model.Enums;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . T A S K _ P R I M I T I V E S . O P E R A T I O N S -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNARL; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This is a HP-UX DCE threads (HPUX 10) version of this package -- This package contains all the GNULL primitives that interface directly -- with the underlying OS. pragma Polling (Off); -- Turn off polling, we do not want ATC polling to take place during -- tasking operations. It causes infinite loops and other problems. with System.Tasking.Debug; -- used for Known_Tasks with System.Interrupt_Management; -- used for Keep_Unmasked -- Abort_Task_Interrupt -- Interrupt_ID pragma Warnings (Off); with System.Interrupt_Management.Operations; -- used for Set_Interrupt_Mask -- All_Tasks_Mask pragma Elaborate_All (System.Interrupt_Management.Operations); pragma Warnings (On); with System.OS_Primitives; -- used for Delay_Modes with Interfaces.C; -- used for int -- size_t with System.Task_Primitives.Interrupt_Operations; -- used for Get_Interrupt_ID with System.Soft_Links; -- used for Defer/Undefer_Abort -- We use System.Soft_Links instead of System.Tasking.Initialization -- because the later is a higher level package that we shouldn't depend on. -- For example when using the restricted run time, it is replaced by -- System.Tasking.Restricted.Stages. with Unchecked_Conversion; with Unchecked_Deallocation; package body System.Task_Primitives.Operations is package SSL renames System.Soft_Links; use System.Tasking.Debug; use System.Tasking; use Interfaces.C; use System.OS_Interface; use System.Parameters; use System.OS_Primitives; package PIO renames System.Task_Primitives.Interrupt_Operations; ---------------- -- Local Data -- ---------------- -- The followings are logically constants, but need to be initialized -- at run time. Single_RTS_Lock : aliased RTS_Lock; -- This is a lock to allow only one thread of control in the RTS at -- a time; it is used to execute in mutual exclusion from all other tasks. -- Used mainly in Single_Lock mode, but also to protect All_Tasks_List ATCB_Key : aliased pthread_key_t; -- Key used to find the Ada Task_Id associated with a thread Environment_Task_Id : Task_Id; -- A variable to hold Task_Id for the environment task Unblocked_Signal_Mask : aliased sigset_t; -- The set of signals that should unblocked in all tasks Time_Slice_Val : Integer; pragma Import (C, Time_Slice_Val, "__gl_time_slice_val"); Dispatching_Policy : Character; pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy"); -- Note: the reason that Locking_Policy is not needed is that this -- is not implemented for DCE threads. The HPUX 10 port is at this -- stage considered dead, and no further work is planned on it. Foreign_Task_Elaborated : aliased Boolean := True; -- Used to identified fake tasks (i.e., non-Ada Threads) -------------------- -- Local Packages -- -------------------- package Specific is procedure Initialize (Environment_Task : Task_Id); pragma Inline (Initialize); -- Initialize various data needed by this package function Is_Valid_Task return Boolean; pragma Inline (Is_Valid_Task); -- Does the executing thread have a TCB? procedure Set (Self_Id : Task_Id); pragma Inline (Set); -- Set the self id for the current task function Self return Task_Id; pragma Inline (Self); -- Return a pointer to the Ada Task Control Block of the calling task end Specific; package body Specific is separate; -- The body of this package is target specific --------------------------------- -- Support for foreign threads -- --------------------------------- function Register_Foreign_Thread (Thread : Thread_Id) return Task_Id; -- Allocate and Initialize a new ATCB for the current Thread function Register_Foreign_Thread (Thread : Thread_Id) return Task_Id is separate; ----------------------- -- Local Subprograms -- ----------------------- procedure Abort_Handler (Sig : Signal); function To_Address is new Unchecked_Conversion (Task_Id, System.Address); ------------------- -- Abort_Handler -- ------------------- procedure Abort_Handler (Sig : Signal) is pragma Unreferenced (Sig); Self_Id : constant Task_Id := Self; Result : Interfaces.C.int; Old_Set : aliased sigset_t; begin if Self_Id.Deferral_Level = 0 and then Self_Id.Pending_ATC_Level < Self_Id.ATC_Nesting_Level and then not Self_Id.Aborting then Self_Id.Aborting := True; -- Make sure signals used for RTS internal purpose are unmasked Result := pthread_sigmask (SIG_UNBLOCK, Unblocked_Signal_Mask'Unchecked_Access, Old_Set'Unchecked_Access); pragma Assert (Result = 0); raise Standard'Abort_Signal; end if; end Abort_Handler; ----------------- -- Stack_Guard -- ----------------- -- The underlying thread system sets a guard page at the -- bottom of a thread stack, so nothing is needed. -- ??? Check the comment above procedure Stack_Guard (T : ST.Task_Id; On : Boolean) is pragma Unreferenced (T, On); begin null; end Stack_Guard; ------------------- -- Get_Thread_Id -- ------------------- function Get_Thread_Id (T : ST.Task_Id) return OSI.Thread_Id is begin return T.Common.LL.Thread; end Get_Thread_Id; ---------- -- Self -- ---------- function Self return Task_Id renames Specific.Self; --------------------- -- Initialize_Lock -- --------------------- -- Note: mutexes and cond_variables needed per-task basis are -- initialized in Initialize_TCB and the Storage_Error is -- handled. Other mutexes (such as RTS_Lock, Memory_Lock...) -- used in RTS is initialized before any status change of RTS. -- Therefore rasing Storage_Error in the following routines -- should be able to be handled safely. procedure Initialize_Lock (Prio : System.Any_Priority; L : access Lock) is Attributes : aliased pthread_mutexattr_t; Result : Interfaces.C.int; begin Result := pthread_mutexattr_init (Attributes'Access); pragma Assert (Result = 0 or else Result = ENOMEM); if Result = ENOMEM then raise Storage_Error; end if; L.Priority := Prio; Result := pthread_mutex_init (L.L'Access, Attributes'Access); pragma Assert (Result = 0 or else Result = ENOMEM); if Result = ENOMEM then raise Storage_Error; end if; Result := pthread_mutexattr_destroy (Attributes'Access); pragma Assert (Result = 0); end Initialize_Lock; procedure Initialize_Lock (L : access RTS_Lock; Level : Lock_Level) is pragma Unreferenced (Level); Attributes : aliased pthread_mutexattr_t; Result : Interfaces.C.int; begin Result := pthread_mutexattr_init (Attributes'Access); pragma Assert (Result = 0 or else Result = ENOMEM); if Result = ENOMEM then raise Storage_Error; end if; Result := pthread_mutex_init (L, Attributes'Access); pragma Assert (Result = 0 or else Result = ENOMEM); if Result = ENOMEM then raise Storage_Error; end if; Result := pthread_mutexattr_destroy (Attributes'Access); pragma Assert (Result = 0); end Initialize_Lock; ------------------- -- Finalize_Lock -- ------------------- procedure Finalize_Lock (L : access Lock) is Result : Interfaces.C.int; begin Result := pthread_mutex_destroy (L.L'Access); pragma Assert (Result = 0); end Finalize_Lock; procedure Finalize_Lock (L : access RTS_Lock) is Result : Interfaces.C.int; begin Result := pthread_mutex_destroy (L); pragma Assert (Result = 0); end Finalize_Lock; ---------------- -- Write_Lock -- ---------------- procedure Write_Lock (L : access Lock; Ceiling_Violation : out Boolean) is Result : Interfaces.C.int; begin L.Owner_Priority := Get_Priority (Self); if L.Priority < L.Owner_Priority then Ceiling_Violation := True; return; end if; Result := pthread_mutex_lock (L.L'Access); pragma Assert (Result = 0); Ceiling_Violation := False; end Write_Lock; procedure Write_Lock (L : access RTS_Lock; Global_Lock : Boolean := False) is Result : Interfaces.C.int; begin if not Single_Lock or else Global_Lock then Result := pthread_mutex_lock (L); pragma Assert (Result = 0); end if; end Write_Lock; procedure Write_Lock (T : Task_Id) is Result : Interfaces.C.int; begin if not Single_Lock then Result := pthread_mutex_lock (T.Common.LL.L'Access); pragma Assert (Result = 0); end if; end Write_Lock; --------------- -- Read_Lock -- --------------- procedure Read_Lock (L : access Lock; Ceiling_Violation : out Boolean) is begin Write_Lock (L, Ceiling_Violation); end Read_Lock; ------------ -- Unlock -- ------------ procedure Unlock (L : access Lock) is Result : Interfaces.C.int; begin Result := pthread_mutex_unlock (L.L'Access); pragma Assert (Result = 0); end Unlock; procedure Unlock (L : access RTS_Lock; Global_Lock : Boolean := False) is Result : Interfaces.C.int; begin if not Single_Lock or else Global_Lock then Result := pthread_mutex_unlock (L); pragma Assert (Result = 0); end if; end Unlock; procedure Unlock (T : Task_Id) is Result : Interfaces.C.int; begin if not Single_Lock then Result := pthread_mutex_unlock (T.Common.LL.L'Access); pragma Assert (Result = 0); end if; end Unlock; ----------- -- Sleep -- ----------- procedure Sleep (Self_ID : Task_Id; Reason : System.Tasking.Task_States) is pragma Unreferenced (Reason); Result : Interfaces.C.int; begin if Single_Lock then Result := pthread_cond_wait (Self_ID.Common.LL.CV'Access, Single_RTS_Lock'Access); else Result := pthread_cond_wait (Self_ID.Common.LL.CV'Access, Self_ID.Common.LL.L'Access); end if; -- EINTR is not considered a failure pragma Assert (Result = 0 or else Result = EINTR); end Sleep; ----------------- -- Timed_Sleep -- ----------------- procedure Timed_Sleep (Self_ID : Task_Id; Time : Duration; Mode : ST.Delay_Modes; Reason : System.Tasking.Task_States; Timedout : out Boolean; Yielded : out Boolean) is pragma Unreferenced (Reason); Check_Time : constant Duration := Monotonic_Clock; Abs_Time : Duration; Request : aliased timespec; Result : Interfaces.C.int; begin Timedout := True; Yielded := False; if Mode = Relative then Abs_Time := Duration'Min (Time, Max_Sensible_Delay) + Check_Time; else Abs_Time := Duration'Min (Check_Time + Max_Sensible_Delay, Time); end if; if Abs_Time > Check_Time then Request := To_Timespec (Abs_Time); loop exit when Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level or else Self_ID.Pending_Priority_Change; if Single_Lock then Result := pthread_cond_timedwait (Self_ID.Common.LL.CV'Access, Single_RTS_Lock'Access, Request'Access); else Result := pthread_cond_timedwait (Self_ID.Common.LL.CV'Access, Self_ID.Common.LL.L'Access, Request'Access); end if; exit when Abs_Time <= Monotonic_Clock; if Result = 0 or Result = EINTR then -- Somebody may have called Wakeup for us Timedout := False; exit; end if; pragma Assert (Result = ETIMEDOUT); end loop; end if; end Timed_Sleep; ----------------- -- Timed_Delay -- ----------------- procedure Timed_Delay (Self_ID : Task_Id; Time : Duration; Mode : ST.Delay_Modes) is Check_Time : constant Duration := Monotonic_Clock; Abs_Time : Duration; Request : aliased timespec; Result : Interfaces.C.int; begin if Single_Lock then Lock_RTS; end if; Write_Lock (Self_ID); if Mode = Relative then Abs_Time := Time + Check_Time; else Abs_Time := Duration'Min (Check_Time + Max_Sensible_Delay, Time); end if; if Abs_Time > Check_Time then Request := To_Timespec (Abs_Time); Self_ID.Common.State := Delay_Sleep; loop if Self_ID.Pending_Priority_Change then Self_ID.Pending_Priority_Change := False; Self_ID.Common.Base_Priority := Self_ID.New_Base_Priority; Set_Priority (Self_ID, Self_ID.Common.Base_Priority); end if; exit when Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level; if Single_Lock then Result := pthread_cond_timedwait (Self_ID.Common.LL.CV'Access, Single_RTS_Lock'Access, Request'Access); else Result := pthread_cond_timedwait (Self_ID.Common.LL.CV'Access, Self_ID.Common.LL.L'Access, Request'Access); end if; exit when Abs_Time <= Monotonic_Clock; pragma Assert (Result = 0 or else Result = ETIMEDOUT or else Result = EINTR); end loop; Self_ID.Common.State := Runnable; end if; Unlock (Self_ID); if Single_Lock then Unlock_RTS; end if; Result := sched_yield; end Timed_Delay; --------------------- -- Monotonic_Clock -- --------------------- function Monotonic_Clock return Duration is TS : aliased timespec; Result : Interfaces.C.int; begin Result := Clock_Gettime (CLOCK_REALTIME, TS'Unchecked_Access); pragma Assert (Result = 0); return To_Duration (TS); end Monotonic_Clock; ------------------- -- RT_Resolution -- ------------------- function RT_Resolution return Duration is begin return 10#1.0#E-6; end RT_Resolution; ------------ -- Wakeup -- ------------ procedure Wakeup (T : Task_Id; Reason : System.Tasking.Task_States) is pragma Unreferenced (Reason); Result : Interfaces.C.int; begin Result := pthread_cond_signal (T.Common.LL.CV'Access); pragma Assert (Result = 0); end Wakeup; ----------- -- Yield -- ----------- procedure Yield (Do_Yield : Boolean := True) is Result : Interfaces.C.int; pragma Unreferenced (Result); begin if Do_Yield then Result := sched_yield; end if; end Yield; ------------------ -- Set_Priority -- ------------------ type Prio_Array_Type is array (System.Any_Priority) of Integer; pragma Atomic_Components (Prio_Array_Type); Prio_Array : Prio_Array_Type; -- Global array containing the id of the currently running task for -- each priority. -- -- Note: we assume that we are on a single processor with run-til-blocked -- scheduling. procedure Set_Priority (T : Task_Id; Prio : System.Any_Priority; Loss_Of_Inheritance : Boolean := False) is Result : Interfaces.C.int; Array_Item : Integer; Param : aliased struct_sched_param; begin Param.sched_priority := Interfaces.C.int (Underlying_Priorities (Prio)); if Time_Slice_Val > 0 then Result := pthread_setschedparam (T.Common.LL.Thread, SCHED_RR, Param'Access); elsif Dispatching_Policy = 'F' or else Time_Slice_Val = 0 then Result := pthread_setschedparam (T.Common.LL.Thread, SCHED_FIFO, Param'Access); else Result := pthread_setschedparam (T.Common.LL.Thread, SCHED_OTHER, Param'Access); end if; pragma Assert (Result = 0); if Dispatching_Policy = 'F' then -- Annex D requirement [RM D.2.2 par. 9]: -- If the task drops its priority due to the loss of inherited -- priority, it is added at the head of the ready queue for its -- new active priority. if Loss_Of_Inheritance and then Prio < T.Common.Current_Priority then Array_Item := Prio_Array (T.Common.Base_Priority) + 1; Prio_Array (T.Common.Base_Priority) := Array_Item; loop -- Let some processes a chance to arrive Yield; -- Then wait for our turn to proceed exit when Array_Item = Prio_Array (T.Common.Base_Priority) or else Prio_Array (T.Common.Base_Priority) = 1; end loop; Prio_Array (T.Common.Base_Priority) := Prio_Array (T.Common.Base_Priority) - 1; end if; end if; T.Common.Current_Priority := Prio; end Set_Priority; ------------------ -- Get_Priority -- ------------------ function Get_Priority (T : Task_Id) return System.Any_Priority is begin return T.Common.Current_Priority; end Get_Priority; ---------------- -- Enter_Task -- ---------------- procedure Enter_Task (Self_ID : Task_Id) is begin Self_ID.Common.LL.Thread := pthread_self; Specific.Set (Self_ID); Lock_RTS; for J in Known_Tasks'Range loop if Known_Tasks (J) = null then Known_Tasks (J) := Self_ID; Self_ID.Known_Tasks_Index := J; exit; end if; end loop; Unlock_RTS; end Enter_Task; -------------- -- New_ATCB -- -------------- function New_ATCB (Entry_Num : Task_Entry_Index) return Task_Id is begin return new Ada_Task_Control_Block (Entry_Num); end New_ATCB; ------------------- -- Is_Valid_Task -- ------------------- function Is_Valid_Task return Boolean renames Specific.Is_Valid_Task; ----------------------------- -- Register_Foreign_Thread -- ----------------------------- function Register_Foreign_Thread return Task_Id is begin if Is_Valid_Task then return Self; else return Register_Foreign_Thread (pthread_self); end if; end Register_Foreign_Thread; -------------------- -- Initialize_TCB -- -------------------- procedure Initialize_TCB (Self_ID : Task_Id; Succeeded : out Boolean) is Mutex_Attr : aliased pthread_mutexattr_t; Result : Interfaces.C.int; Cond_Attr : aliased pthread_condattr_t; begin if not Single_Lock then Result := pthread_mutexattr_init (Mutex_Attr'Access); pragma Assert (Result = 0 or else Result = ENOMEM); if Result = 0 then Result := pthread_mutex_init (Self_ID.Common.LL.L'Access, Mutex_Attr'Access); pragma Assert (Result = 0 or else Result = ENOMEM); end if; if Result /= 0 then Succeeded := False; return; end if; Result := pthread_mutexattr_destroy (Mutex_Attr'Access); pragma Assert (Result = 0); end if; Result := pthread_condattr_init (Cond_Attr'Access); pragma Assert (Result = 0 or else Result = ENOMEM); if Result = 0 then Result := pthread_cond_init (Self_ID.Common.LL.CV'Access, Cond_Attr'Access); pragma Assert (Result = 0 or else Result = ENOMEM); end if; if Result = 0 then Succeeded := True; else if not Single_Lock then Result := pthread_mutex_destroy (Self_ID.Common.LL.L'Access); pragma Assert (Result = 0); end if; Succeeded := False; end if; Result := pthread_condattr_destroy (Cond_Attr'Access); pragma Assert (Result = 0); end Initialize_TCB; ----------------- -- Create_Task -- ----------------- procedure Create_Task (T : Task_Id; Wrapper : System.Address; Stack_Size : System.Parameters.Size_Type; Priority : System.Any_Priority; Succeeded : out Boolean) is Attributes : aliased pthread_attr_t; Result : Interfaces.C.int; function Thread_Body_Access is new Unchecked_Conversion (System.Address, Thread_Body); begin Result := pthread_attr_init (Attributes'Access); pragma Assert (Result = 0 or else Result = ENOMEM); if Result /= 0 then Succeeded := False; return; end if; Result := pthread_attr_setstacksize (Attributes'Access, Interfaces.C.size_t (Stack_Size)); pragma Assert (Result = 0); -- Since the initial signal mask of a thread is inherited from the -- creator, and the Environment task has all its signals masked, we -- do not need to manipulate caller's signal mask at this point. -- All tasks in RTS will have All_Tasks_Mask initially. Result := pthread_create (T.Common.LL.Thread'Access, Attributes'Access, Thread_Body_Access (Wrapper), To_Address (T)); pragma Assert (Result = 0 or else Result = EAGAIN); Succeeded := Result = 0; pthread_detach (T.Common.LL.Thread'Access); -- Detach the thread using pthread_detach, sinc DCE threads do not have -- pthread_attr_set_detachstate. Result := pthread_attr_destroy (Attributes'Access); pragma Assert (Result = 0); Set_Priority (T, Priority); end Create_Task; ------------------ -- Finalize_TCB -- ------------------ procedure Finalize_TCB (T : Task_Id) is Result : Interfaces.C.int; Tmp : Task_Id := T; Is_Self : constant Boolean := T = Self; procedure Free is new Unchecked_Deallocation (Ada_Task_Control_Block, Task_Id); begin if not Single_Lock then Result := pthread_mutex_destroy (T.Common.LL.L'Access); pragma Assert (Result = 0); end if; Result := pthread_cond_destroy (T.Common.LL.CV'Access); pragma Assert (Result = 0); if T.Known_Tasks_Index /= -1 then Known_Tasks (T.Known_Tasks_Index) := null; end if; Free (Tmp); if Is_Self then Specific.Set (null); end if; end Finalize_TCB; --------------- -- Exit_Task -- --------------- procedure Exit_Task is begin Specific.Set (null); end Exit_Task; ---------------- -- Abort_Task -- ---------------- procedure Abort_Task (T : Task_Id) is begin -- -- Interrupt Server_Tasks may be waiting on an "event" flag (signal) -- if T.Common.State = Interrupt_Server_Blocked_On_Event_Flag then System.Interrupt_Management.Operations.Interrupt_Self_Process (System.Interrupt_Management.Interrupt_ID (PIO.Get_Interrupt_ID (T))); end if; end Abort_Task; ---------------- -- Initialize -- ---------------- procedure Initialize (S : in out Suspension_Object) is Mutex_Attr : aliased pthread_mutexattr_t; Cond_Attr : aliased pthread_condattr_t; Result : Interfaces.C.int; begin -- Initialize internal state. It is always initialized to False (ARM -- D.10 par. 6). S.State := False; S.Waiting := False; -- Initialize internal mutex Result := pthread_mutex_init (S.L'Access, Mutex_Attr'Access); pragma Assert (Result = 0 or else Result = ENOMEM); if Result = ENOMEM then raise Storage_Error; end if; -- Initialize internal condition variable Result := pthread_cond_init (S.CV'Access, Cond_Attr'Access); pragma Assert (Result = 0 or else Result = ENOMEM); if Result /= 0 then Result := pthread_mutex_destroy (S.L'Access); pragma Assert (Result = 0); if Result = ENOMEM then raise Storage_Error; end if; end if; end Initialize; -------------- -- Finalize -- -------------- procedure Finalize (S : in out Suspension_Object) is Result : Interfaces.C.int; begin -- Destroy internal mutex Result := pthread_mutex_destroy (S.L'Access); pragma Assert (Result = 0); -- Destroy internal condition variable Result := pthread_cond_destroy (S.CV'Access); pragma Assert (Result = 0); end Finalize; ------------------- -- Current_State -- ------------------- function Current_State (S : Suspension_Object) return Boolean is begin -- We do not want to use lock on this read operation. State is marked -- as Atomic so that we ensure that the value retrieved is correct. return S.State; end Current_State; --------------- -- Set_False -- --------------- procedure Set_False (S : in out Suspension_Object) is Result : Interfaces.C.int; begin SSL.Abort_Defer.all; Result := pthread_mutex_lock (S.L'Access); pragma Assert (Result = 0); S.State := False; Result := pthread_mutex_unlock (S.L'Access); pragma Assert (Result = 0); SSL.Abort_Undefer.all; end Set_False; -------------- -- Set_True -- -------------- procedure Set_True (S : in out Suspension_Object) is Result : Interfaces.C.int; begin SSL.Abort_Defer.all; Result := pthread_mutex_lock (S.L'Access); pragma Assert (Result = 0); -- If there is already a task waiting on this suspension object then -- we resume it, leaving the state of the suspension object to False, -- as it is specified in ARM D.10 par. 9. Otherwise, it just leaves -- the state to True. if S.Waiting then S.Waiting := False; S.State := False; Result := pthread_cond_signal (S.CV'Access); pragma Assert (Result = 0); else S.State := True; end if; Result := pthread_mutex_unlock (S.L'Access); pragma Assert (Result = 0); SSL.Abort_Undefer.all; end Set_True; ------------------------ -- Suspend_Until_True -- ------------------------ procedure Suspend_Until_True (S : in out Suspension_Object) is Result : Interfaces.C.int; begin SSL.Abort_Defer.all; Result := pthread_mutex_lock (S.L'Access); pragma Assert (Result = 0); if S.Waiting then -- Program_Error must be raised upon calling Suspend_Until_True -- if another task is already waiting on that suspension object -- (ARM D.10 par. 10). Result := pthread_mutex_unlock (S.L'Access); pragma Assert (Result = 0); SSL.Abort_Undefer.all; raise Program_Error; else -- Suspend the task if the state is False. Otherwise, the task -- continues its execution, and the state of the suspension object -- is set to False (ARM D.10 par. 9). if S.State then S.State := False; else S.Waiting := True; Result := pthread_cond_wait (S.CV'Access, S.L'Access); end if; Result := pthread_mutex_unlock (S.L'Access); pragma Assert (Result = 0); SSL.Abort_Undefer.all; end if; end Suspend_Until_True; ---------------- -- Check_Exit -- ---------------- -- Dummy version function Check_Exit (Self_ID : ST.Task_Id) return Boolean is pragma Unreferenced (Self_ID); begin return True; end Check_Exit; -------------------- -- Check_No_Locks -- -------------------- function Check_No_Locks (Self_ID : ST.Task_Id) return Boolean is pragma Unreferenced (Self_ID); begin return True; end Check_No_Locks; ---------------------- -- Environment_Task -- ---------------------- function Environment_Task return Task_Id is begin return Environment_Task_Id; end Environment_Task; -------------- -- Lock_RTS -- -------------- procedure Lock_RTS is begin Write_Lock (Single_RTS_Lock'Access, Global_Lock => True); end Lock_RTS; ---------------- -- Unlock_RTS -- ---------------- procedure Unlock_RTS is begin Unlock (Single_RTS_Lock'Access, Global_Lock => True); end Unlock_RTS; ------------------ -- Suspend_Task -- ------------------ function Suspend_Task (T : ST.Task_Id; Thread_Self : Thread_Id) return Boolean is pragma Unreferenced (T); pragma Unreferenced (Thread_Self); begin return False; end Suspend_Task; ----------------- -- Resume_Task -- ----------------- function Resume_Task (T : ST.Task_Id; Thread_Self : Thread_Id) return Boolean is pragma Unreferenced (T); pragma Unreferenced (Thread_Self); begin return False; end Resume_Task; ---------------- -- Initialize -- ---------------- procedure Initialize (Environment_Task : Task_Id) is act : aliased struct_sigaction; old_act : aliased struct_sigaction; Tmp_Set : aliased sigset_t; Result : Interfaces.C.int; function State (Int : System.Interrupt_Management.Interrupt_ID) return Character; pragma Import (C, State, "__gnat_get_interrupt_state"); -- Get interrupt state. Defined in a-init.c. The input argument is -- the interrupt number, and the result is one of the following: Default : constant Character := 's'; -- 'n' this interrupt not set by any Interrupt_State pragma -- 'u' Interrupt_State pragma set state to User -- 'r' Interrupt_State pragma set state to Runtime -- 's' Interrupt_State pragma set state to System (use "default" -- system handler) begin Environment_Task_Id := Environment_Task; Interrupt_Management.Initialize; -- Initialize the lock used to synchronize chain of all ATCBs Initialize_Lock (Single_RTS_Lock'Access, RTS_Lock_Level); Specific.Initialize (Environment_Task); Enter_Task (Environment_Task); -- Install the abort-signal handler if State (System.Interrupt_Management.Abort_Task_Interrupt) /= Default then act.sa_flags := 0; act.sa_handler := Abort_Handler'Address; Result := sigemptyset (Tmp_Set'Access); pragma Assert (Result = 0); act.sa_mask := Tmp_Set; Result := sigaction ( Signal (System.Interrupt_Management.Abort_Task_Interrupt), act'Unchecked_Access, old_act'Unchecked_Access); pragma Assert (Result = 0); end if; end Initialize; -- NOTE: Unlike other pthread implementations, we do *not* mask all -- signals here since we handle signals using the process-wide primitive -- signal, rather than using sigthreadmask and sigwait. The reason of -- this difference is that sigwait doesn't work when some critical -- signals (SIGABRT, SIGPIPE) are masked. end System.Task_Primitives.Operations;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017-2018, Fabien Chouteau -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with AGATE.Traces; package body AGATE.API.Dynamic_Mutex is ------------ -- Create -- ------------ function Create (Prio : Task_Priority; Name : String) return Mutex_ID is Ret : constant Mutex_ID := new Mutex (Prio); begin Traces.Register (Ret, Name); return Ret; end Create; end AGATE.API.Dynamic_Mutex;
-- Copyright 2015,2016,2017 Steven Stewart-Gallus -- -- 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.Characters.Latin_1; with Ada.Unchecked_Conversion; with Linted.Writer; with Linted.Triggers; package body Linted.Stdio is package C renames Interfaces.C; use Linted.Errors; use Linted.KOs; procedure Write_Line (Object : KO; Str : String) is Dummy : Error; begin Write_String (Object, Str & Ada.Characters.Latin_1.LF, Dummy); end Write_Line; procedure Write_String (Object : KO; Str : String; Err : out Error) with Spark_Mode => Off is X : C.char_array := C.To_C (Str); Bytes_Written : C.size_t; begin Write (Object, X (X'First)'Address, X'Length, Bytes_Written, Err); end Write_String; procedure Write (Object : KO; Buf : System.Address; Count : C.size_t; Bytes_Written : out C.size_t; Err : out Error) is Future : Writer.Future; Event : Writer.Event; begin Writer.Write (Object, Buf, Count, Triggers.Null_Signaller, Future); Writer.Write_Wait (Future, Event); Bytes_Written := Event.Bytes_Written; Err := Event.Err; end Write; end Linted.Stdio;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2016-2020, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with HAL; use HAL; with HAL.I2C; use HAL.I2C; with nRF.GPIO; use nRF.GPIO; with NRF_SVD.TWI; package nRF.TWI is type TWI_Speed is (TWI_100kbps, TWI_250kbps, TWI_400kbps); type TWI_Master (Periph : not null access NRF_SVD.TWI.TWI_Peripheral) is new HAL.I2C.I2C_Port with private; procedure Enable (This : in out TWI_Master); procedure Disable (This : in out TWI_Master); function Enabled (This : TWI_Master) return Boolean; procedure Configure (This : in out TWI_Master; SCL, SDA : GPIO_Pin_Index; Speed : TWI_Speed); procedure Disconnect (This : in out TWI_Master); -- Disconect the peripheral from the GPIO points overriding procedure Master_Transmit (This : in out TWI_Master; Addr : I2C_Address; Data : I2C_Data; Status : out I2C_Status; Timeout : Natural := 1000) with Pre => Enabled (This); overriding procedure Master_Receive (This : in out TWI_Master; Addr : I2C_Address; Data : out I2C_Data; Status : out I2C_Status; Timeout : Natural := 1000) with Pre => Enabled (This); overriding procedure Mem_Write (This : in out TWI_Master; Addr : I2C_Address; Mem_Addr : UInt16; Mem_Addr_Size : I2C_Memory_Address_Size; Data : I2C_Data; Status : out I2C_Status; Timeout : Natural := 1000) with Pre => Enabled (This); overriding procedure Mem_Read (This : in out TWI_Master; Addr : I2C_Address; Mem_Addr : UInt16; Mem_Addr_Size : I2C_Memory_Address_Size; Data : out I2C_Data; Status : out I2C_Status; Timeout : Natural := 1000) with Pre => Enabled (This); private type TWI_Master (Periph : not null access NRF_SVD.TWI.TWI_Peripheral) is new HAL.I2C.I2C_Port with record Do_Stop_Sequence : Boolean := True; end record; end nRF.TWI;
with Ada.Text_IO; use Ada.Text_IO; procedure MultiReturn is procedure SumAndDiff (x, y : Integer; sum, diff : out Integer) is begin sum := x + y; diff := x - y; end SumAndDiff; inta : Integer := 5; intb : Integer := 3; thesum, thediff : Integer; begin SumAndDiff (inta, intb, thesum, thediff); Put_Line ("Sum:" & Integer'Image (thesum)); Put_Line ("Diff:" & Integer'Image (thediff)); end MultiReturn;
-- Copyright 2012-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/>. package body Pck is procedure Break_Me is begin null; end Break_Me; end Pck;
package Loop_Optimization5_Pkg is type String_Access is access all String; function Init return String; function Locate (S : String) return String_Access; end Loop_Optimization5_Pkg;
-- -- Copyright (C) 2021 Jeremy Grosser <jeremy@synack.me> -- -- SPDX-License-Identifier: BSD-3-Clause -- package body HT16K33 is procedure Initialize (This : in out Device) is Oscillator_On : constant I2C_Data (1 .. 1) := (1 => 16#21#); Display_On : constant I2C_Data (1 .. 1) := (1 => 16#81#); Row_Output : constant I2C_Data (1 .. 1) := (1 => 16#A0#); Status : I2C_Status := Err_Error; begin This.Port.Master_Transmit (This.Address, Oscillator_On, Status, Timeout => 10); This.Port.Master_Transmit (This.Address, Display_On, Status, Timeout => 10); This.Port.Master_Transmit (This.Address, Row_Output, Status, Timeout => 10); Set_Brightness (This, Brightness_Level'Last); Update (This); end Initialize; procedure Set_Brightness (This : in out Device; Level : Brightness_Level) is Data : constant I2C_Data (1 .. 1) := (1 => 16#E0# or Level); Status : I2C_Status := Err_Error; begin This.Port.Master_Transmit (This.Address, Data, Status, Timeout => 10); end Set_Brightness; procedure Update (This : in out Device) is Status : I2C_Status := Err_Error; begin This.Port.Master_Transmit (This.Address, This.Buffer, Status, Timeout => 100); end Update; procedure Set (This : in out Device; Num : Output_Index) is Index : constant Positive := (Num / 8) + 1; begin This.Buffer (Index) := This.Buffer (Index) or Shift_Left (1, Num mod 8); end Set; procedure Clear (This : in out Device; Num : Output_Index) is Index : constant Positive := (Num / 8) + 1; begin This.Buffer (Index) := This.Buffer (Index) and not Shift_Left (1, Num mod 8); end Clear; procedure Clear_All (This : in out Device) is begin This.Buffer := (others => 0); end Clear_All; end HT16K33;
package Discr41 is type Vector is array (Positive range <>) of Long_Float; type Date is record LF : Long_Float := 0.0; end record; type Date_Vector is array (Positive range <>) of Date; type Rec (D : Natural) is record B1 : Boolean := False; DL : Date_Vector (1 .. D); VL : Vector (1 .. D) := (others => 0.0); B2 : Boolean := True; end record; function F return Rec; end Discr41;
-- Abstract : -- -- Root of extensions to Ada.Containers. -- -- Copyright (C) 2019 Free Software Foundation All Rights Reserved. -- -- This library 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); package SAL.Ada_Containers is end SAL.Ada_Containers;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ -- A multiplicity is a definition of an inclusive interval of non-negative -- integers beginning with a lower bound and ending with a (possibly -- infinite) upper bound. A multiplicity element embeds this information to -- specify the allowable cardinalities for an instantiation of this element. ------------------------------------------------------------------------------ with AMF.CMOF.Elements; package AMF.CMOF.Multiplicity_Elements is pragma Preelaborate; type CMOF_Multiplicity_Element is limited interface and AMF.CMOF.Elements.CMOF_Element; type CMOF_Multiplicity_Element_Access is access all CMOF_Multiplicity_Element'Class; for CMOF_Multiplicity_Element_Access'Storage_Size use 0; not overriding function Get_Is_Ordered (Self : not null access constant CMOF_Multiplicity_Element) return Boolean is abstract; -- Getter of MultiplicityElement::isOrdered. -- -- For a multivalued multiplicity, this attribute specifies whether the -- values in an instantiation of this element are sequentially ordered. not overriding procedure Set_Is_Ordered (Self : not null access CMOF_Multiplicity_Element; To : Boolean) is abstract; -- Setter of MultiplicityElement::isOrdered. -- -- For a multivalued multiplicity, this attribute specifies whether the -- values in an instantiation of this element are sequentially ordered. not overriding function Get_Is_Unique (Self : not null access constant CMOF_Multiplicity_Element) return Boolean is abstract; -- Getter of MultiplicityElement::isUnique. -- -- For a multivalued multiplicity, this attributes specifies whether the -- values in an instantiation of this element are unique. not overriding procedure Set_Is_Unique (Self : not null access CMOF_Multiplicity_Element; To : Boolean) is abstract; -- Setter of MultiplicityElement::isUnique. -- -- For a multivalued multiplicity, this attributes specifies whether the -- values in an instantiation of this element are unique. not overriding function Get_Lower (Self : not null access constant CMOF_Multiplicity_Element) return AMF.Optional_Integer is abstract; -- Getter of MultiplicityElement::lower. -- -- Specifies the lower bound of the multiplicity interval. not overriding procedure Set_Lower (Self : not null access CMOF_Multiplicity_Element; To : AMF.Optional_Integer) is abstract; -- Setter of MultiplicityElement::lower. -- -- Specifies the lower bound of the multiplicity interval. not overriding function Get_Upper (Self : not null access constant CMOF_Multiplicity_Element) return AMF.Optional_Unlimited_Natural is abstract; -- Getter of MultiplicityElement::upper. -- -- Specifies the upper bound of the multiplicity interval. not overriding procedure Set_Upper (Self : not null access CMOF_Multiplicity_Element; To : AMF.Optional_Unlimited_Natural) is abstract; -- Setter of MultiplicityElement::upper. -- -- Specifies the upper bound of the multiplicity interval. not overriding function Is_Multivalued (Self : not null access constant CMOF_Multiplicity_Element) return Boolean is abstract; -- Operation MultiplicityElement::isMultivalued. -- -- The query isMultivalued() checks whether this multiplicity has an upper -- bound greater than one. not overriding function Includes_Multiplicity (Self : not null access constant CMOF_Multiplicity_Element; M : AMF.CMOF.Multiplicity_Elements.CMOF_Multiplicity_Element_Access) return Boolean is abstract; -- Operation MultiplicityElement::includesMultiplicity. -- -- The query includesMultiplicity() checks whether this multiplicity -- includes all the cardinalities allowed by the specified multiplicity. not overriding function Includes_Cardinality (Self : not null access constant CMOF_Multiplicity_Element; C : Integer) return Boolean is abstract; -- Operation MultiplicityElement::includesCardinality. -- -- The query includesCardinality() checks whether the specified -- cardinality is valid for this multiplicity. not overriding function Lower_Bound (Self : not null access constant CMOF_Multiplicity_Element) return Integer is abstract; -- Operation MultiplicityElement::lowerBound. -- -- The query lowerBound() returns the lower bound of the multiplicity as -- an integer. not overriding function Upper_Bound (Self : not null access constant CMOF_Multiplicity_Element) return AMF.Unlimited_Natural is abstract; -- Operation MultiplicityElement::upperBound. -- -- The query upperBound() returns the upper bound of the multiplicity for -- a bounded multiplicity as an unlimited natural. end AMF.CMOF.Multiplicity_Elements;
with GL, float_Math.Algebra.linear.d2, float_Math.Algebra.linear.d3, float_Math.Geometry.d2, float_Math.Geometry.d3, ada.Containers; package openGL -- -- Provides a namespace and set of core types. -- is pragma Pure; Error : exception; ------------ -- Profiles -- type profile_Kind is (Safe, Lean, Desk); function Profile return profile_Kind; ---------- -- Models -- Model_too_complex : exception; max_Models : constant := 2**32 - 1; type model_Id is range 0 .. max_Models; null_model_Id : constant model_Id; ----------- -- Indices -- type short_Index_t is range 0 .. 2**8 - 1; type Index_t is range 0 .. 2**16 - 1; type long_Index_t is range 0 .. 2**32 - 1; type short_Indices is array (long_Index_t range <>) of short_Index_t; type Indices is array (long_Index_t range <>) of Index_t; type long_Indices is array (long_Index_t range <>) of long_Index_t; -------- -- Math -- package Math renames float_Math; use Math; package linear_Algebra renames float_Math.Algebra.linear; package linear_Algebra_2d renames float_Math.Algebra.linear.d2; package linear_Algebra_3d renames float_Math.Algebra.linear.d3; package Geometry_2d renames float_Math.Geometry.d2; package Geometry_3d renames float_Math.Geometry.d3; -------- -- Real -- subtype Real is math.Real; package real_Functions renames math.Functions; ------------- -- Safe Real -- protected type safe_Real is procedure Value_is (Now : in Real); function Value return Real; private the_Value : Real; end safe_Real; ----------- -- Extents -- type Extent_2d is record Width : Natural; Height : Natural; end record; ----------- -- Vectors -- subtype Vector is math.Vector; subtype Vector_2 is math.Vector_2; subtype Vector_3 is math.Vector_3; subtype Vector_4 is math.Vector_4; type Vector_2_array is array (Positive range <>) of Vector_2; type Vector_3_array is array ( Index_t range <>) of aliased Vector_3; type Vector_3_large_array is array (long_Index_t range <>) of aliased Vector_3; function Scaled (Self : in Vector_3; By : in Vector_3) return Vector_3; function Scaled (Self : in Vector_3_array; By : in Vector_3) return Vector_3_array; function to_Vector_3_array (Self : in Vector_2_array) return Vector_3_array; ------------ -- Matrices -- subtype Matrix is math.Matrix; subtype Matrix_2x2 is math.Matrix_2x2; subtype Matrix_3x3 is math.Matrix_3x3; subtype Matrix_4x4 is math.Matrix_4x4; --------------- -- Height Maps -- type height_Map is array (Index_t range <>, Index_t range <>) of aliased Real; function Scaled (Self : in height_Map; By : in Real) return height_Map; procedure scale (Self : in out height_Map; By : in Real); function height_Extent (Self : in height_Map) return Vector_2; -- -- Returns the min and max height. type index_Pair is array (1 .. 2) of Index_t; function Region (Self : in height_Map; Rows, Cols : in index_Pair) return height_Map; -- -- Returns the submatrix indicated via Rows & Cols. ------------ -- Geometry -- subtype Site is Vector_3; -- A position in 3d space. subtype Sites is Vector_3_array; subtype many_Sites is Vector_3_large_array; subtype Normal is Vector_3; -- A normal in 3d space. subtype Normals is Vector_3_array; subtype many_Normals is Vector_3_large_array; type Bounds is record Ball : Real; -- Sphere radius. Box : Geometry_3d.bounding_Box; end record; null_Bounds : constant Bounds; function bounding_Box_of (Self : Sites) return Bounds; procedure set_Ball_from_Box (Self : in out Bounds); --------- -- Color -- subtype grey_Value is gl.GLubyte; subtype color_Value is gl.GLubyte; Opaque : constant color_Value; Lucid : constant color_Value; function to_color_Value (Self : in unit_Interval) return color_Value; function to_Real (Self : in color_Value) return unit_Interval; type Color is record Red : aliased color_Value; Green : color_Value; Blue : color_Value; end record; type Colors is array (Index_t range <>) of Color; type lucid_Color is record Primary : Color; Opacity : color_Value; end record; type lucid_Colors is array (Index_t range <>) of lucid_Color; subtype light_color_Value is Real range 0.0 .. 1.0; type light_Color is record Red : light_color_Value; Green : light_color_Value; Blue : light_color_Value; Opacity : light_color_Value; end record; subtype Shine is Real range 1.0 .. Real'Last; ---------- -- Images -- type grey_Image is array (Index_t range <>, Index_t range <>) of aliased grey_Value; type Image is array (Index_t range <>, Index_t range <>) of aliased Color; type lucid_Image is array (Index_t range <>, Index_t range <>) of aliased lucid_Color; function to_Image (From : in lucid_Image) return Image; ----------- -- Texture -- -- Coordinates -- type Coordinate_1D is record S : aliased Real; end record; type Coordinate_2D is record S, T : aliased Real; end record; type Coordinate_3D is record S, T, R : aliased Real; end record; type Coordinate_4D is record S, T, R, Q : aliased Real; end record; type Coordinates_1D is array (Index_t range <>) of aliased Coordinate_1D; type Coordinates_2D is array (Index_t range <>) of aliased Coordinate_2D; type Coordinates_3D is array (Index_t range <>) of aliased Coordinate_3D; type Coordinates_4D is array (Index_t range <>) of aliased Coordinate_4D; type many_Coordinates_1D is array (long_Index_t range <>) of aliased Coordinate_1D; type many_Coordinates_2D is array (long_Index_t range <>) of aliased Coordinate_2D; type many_Coordinates_3D is array (long_Index_t range <>) of aliased Coordinate_3D; type many_Coordinates_4D is array (long_Index_t range <>) of aliased Coordinate_4D; -- Transforms -- type texture_Transform is record Offset : Real; Scale : Real; end record; type texture_Transform_1D is record S : texture_Transform; end record; type texture_Transform_2D is record S : texture_Transform; T : texture_Transform; end record; type texture_Transform_3D is record S : texture_Transform; T : texture_Transform; R : texture_Transform; end record; type texture_Transform_4D is record S : texture_Transform; T : texture_Transform; R : texture_Transform; Q : texture_Transform; end record; ---------- -- Assets -- type asset_Name is new String (1 .. 128); -- -- Name of a file containing textures, images, fonts or other resources. null_Asset : constant asset_Name; function to_Asset (Self : in String) return asset_Name; function to_String (Self : in asset_Name) return String; function Hash (Self : in asset_Name) return ada.Containers.Hash_type; ----------------------------- -- Shader Program Parameters -- type Parameters is tagged limited private; --------------- -- Task Safety -- type safe_Boolean is new Boolean; pragma Atomic (safe_Boolean); private -- NB: Packing these arrays forces compiler to use the correct size for the element type, rather than the most efficient size. -- pragma Pack (short_Indices); pragma Pack ( Indices); pragma Pack ( long_Indices); pragma Assert (GL.GLfloat'Size = Real'Size); null_Asset : constant asset_Name := (others => ' '); null_model_Id : constant model_Id := 0; null_Bounds : constant Bounds := (ball => 0.0, box => (lower => (Real'Last, Real'Last, Real'Last), upper => (Real'First, Real'First, Real'First))); --------- -- Color -- Opaque : constant color_Value := color_Value'Last; Lucid : constant color_Value := color_Value'First; function to_Color (R, G, B : in unit_Interval) return Color; ---------------------------- -- Shader Program Parameters -- type Parameters is tagged limited null record; end openGL;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S E M _ C H 1 3 -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Aspects; use Aspects; with Atree; use Atree; with Checks; use Checks; with Debug; use Debug; with Einfo; use Einfo; with Elists; use Elists; with Errout; use Errout; with Exp_Disp; use Exp_Disp; with Exp_Tss; use Exp_Tss; with Exp_Util; use Exp_Util; with Freeze; use Freeze; with Ghost; use Ghost; with Lib; use Lib; with Lib.Xref; use Lib.Xref; with Namet; use Namet; with Nlists; use Nlists; with Nmake; use Nmake; with Opt; use Opt; with Par_SCO; use Par_SCO; with Restrict; use Restrict; with Rident; use Rident; with Rtsfind; use Rtsfind; with Sem; use Sem; with Sem_Aux; use Sem_Aux; with Sem_Case; use Sem_Case; with Sem_Cat; use Sem_Cat; with Sem_Ch3; use Sem_Ch3; with Sem_Ch6; use Sem_Ch6; with Sem_Ch7; use Sem_Ch7; with Sem_Ch8; use Sem_Ch8; with Sem_Dim; use Sem_Dim; with Sem_Disp; use Sem_Disp; with Sem_Eval; use Sem_Eval; with Sem_Prag; use Sem_Prag; with Sem_Res; use Sem_Res; with Sem_Type; use Sem_Type; 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 Stand; use Stand; with Targparm; use Targparm; with Ttypes; use Ttypes; with Tbuild; use Tbuild; with Urealp; use Urealp; with Warnsw; use Warnsw; with GNAT.Heap_Sort_G; package body Sem_Ch13 is SSU : constant Pos := System_Storage_Unit; -- Convenient short hand for commonly used constant ----------------------- -- Local Subprograms -- ----------------------- procedure Adjust_Record_For_Reverse_Bit_Order_Ada_95 (R : Entity_Id); -- Helper routine providing the original (pre-AI95-0133) behavior for -- Adjust_Record_For_Reverse_Bit_Order. procedure Alignment_Check_For_Size_Change (Typ : Entity_Id; Size : Uint); -- This routine is called after setting one of the sizes of type entity -- Typ to Size. The purpose is to deal with the situation of a derived -- type whose inherited alignment is no longer appropriate for the new -- size value. In this case, we reset the Alignment to unknown. function All_Static_Choices (L : List_Id) return Boolean; -- Returns true if all elements of the list are OK static choices -- as defined below for Is_Static_Choice. Used for case expression -- alternatives and for the right operand of a membership test. An -- others_choice is static if the corresponding expression is static. -- The staticness of the bounds is checked separately. procedure Build_Discrete_Static_Predicate (Typ : Entity_Id; Expr : Node_Id; Nam : Name_Id); -- Given a predicated type Typ, where Typ is a discrete static subtype, -- whose predicate expression is Expr, tests if Expr is a static predicate, -- and if so, builds the predicate range list. Nam is the name of the one -- argument to the predicate function. Occurrences of the type name in the -- predicate expression have been replaced by identifier references to this -- name, which is unique, so any identifier with Chars matching Nam must be -- a reference to the type. If the predicate is non-static, this procedure -- returns doing nothing. If the predicate is static, then the predicate -- list is stored in Static_Discrete_Predicate (Typ), and the Expr is -- rewritten as a canonicalized membership operation. function Build_Export_Import_Pragma (Asp : Node_Id; Id : Entity_Id) return Node_Id; -- Create the corresponding pragma for aspect Export or Import denoted by -- Asp. Id is the related entity subject to the aspect. Return Empty when -- the expression of aspect Asp evaluates to False or is erroneous. function Build_Predicate_Function_Declaration (Typ : Entity_Id) return Node_Id; -- Build the declaration for a predicate function. The declaration is built -- at the end of the declarative part containing the type definition, which -- may be before the freeze point of the type. The predicate expression is -- preanalyzed at this point, to catch visibility errors. procedure Build_Predicate_Functions (Typ : Entity_Id; N : Node_Id); -- If Typ has predicates (indicated by Has_Predicates being set for Typ), -- then either there are pragma Predicate entries on the rep chain for the -- type (note that Predicate aspects are converted to pragma Predicate), or -- there are inherited aspects from a parent type, or ancestor subtypes. -- This procedure builds body for the Predicate function that tests these -- predicates. N is the freeze node for the type. The spec of the function -- is inserted before the freeze node, and the body of the function is -- inserted after the freeze node. If the predicate expression has a least -- one Raise_Expression, then this procedure also builds the M version of -- the predicate function for use in membership tests. procedure Check_Pool_Size_Clash (Ent : Entity_Id; SP, SS : Node_Id); -- Called if both Storage_Pool and Storage_Size attribute definition -- clauses (SP and SS) are present for entity Ent. Issue error message. procedure Freeze_Entity_Checks (N : Node_Id); -- Called from Analyze_Freeze_Entity and Analyze_Generic_Freeze Entity -- to generate appropriate semantic checks that are delayed until this -- point (they had to be delayed this long for cases of delayed aspects, -- e.g. analysis of statically predicated subtypes in choices, for which -- we have to be sure the subtypes in question are frozen before checking). function Get_Alignment_Value (Expr : Node_Id) return Uint; -- Given the expression for an alignment value, returns the corresponding -- Uint value. If the value is inappropriate, then error messages are -- posted as required, and a value of No_Uint is returned. function Is_Operational_Item (N : Node_Id) return Boolean; -- A specification for a stream attribute is allowed before the full type -- is declared, as explained in AI-00137 and the corrigendum. Attributes -- that do not specify a representation characteristic are operational -- attributes. function Is_Static_Choice (N : Node_Id) return Boolean; -- Returns True if N represents a static choice (static subtype, or -- static subtype indication, or static expression, or static range). -- -- Note that this is a bit more inclusive than we actually need -- (in particular membership tests do not allow the use of subtype -- indications). But that doesn't matter, we have already checked -- that the construct is legal to get this far. function Is_Type_Related_Rep_Item (N : Node_Id) return Boolean; -- Returns True for a representation clause/pragma that specifies a -- type-related representation (as opposed to operational) aspect. function Is_Predicate_Static (Expr : Node_Id; Nam : Name_Id) return Boolean; -- Given predicate expression Expr, tests if Expr is predicate-static in -- the sense of the rules in (RM 3.2.4 (15-24)). Occurrences of the type -- name in the predicate expression have been replaced by references to -- an identifier whose Chars field is Nam. This name is unique, so any -- identifier with Chars matching Nam must be a reference to the type. -- Returns True if the expression is predicate-static and False otherwise, -- but is not in the business of setting flags or issuing error messages. -- -- Only scalar types can have static predicates, so False is always -- returned for non-scalar types. -- -- Note: the RM seems to suggest that string types can also have static -- predicates. But that really makes lttle sense as very few useful -- predicates can be constructed for strings. Remember that: -- -- "ABC" < "DEF" -- -- is not a static expression. So even though the clearly faulty RM wording -- allows the following: -- -- subtype S is String with Static_Predicate => S < "DEF" -- -- We can't allow this, otherwise we have predicate-static applying to a -- larger class than static expressions, which was never intended. procedure New_Put_Image_Subprogram (N : Node_Id; Ent : Entity_Id; Subp : Entity_Id); -- Similar to New_Stream_Subprogram, but for the Put_Image attribute procedure New_Stream_Subprogram (N : Node_Id; Ent : Entity_Id; Subp : Entity_Id; Nam : TSS_Name_Type); -- Create a subprogram renaming of a given stream attribute to the -- designated subprogram and then in the tagged case, provide this as a -- primitive operation, or in the untagged case make an appropriate TSS -- entry. This is more properly an expansion activity than just semantics, -- but the presence of user-defined stream functions for limited types -- is a legality check, which is why this takes place here rather than in -- exp_ch13, where it was previously. Nam indicates the name of the TSS -- function to be generated. -- -- To avoid elaboration anomalies with freeze nodes, for untagged types -- we generate both a subprogram declaration and a subprogram renaming -- declaration, so that the attribute specification is handled as a -- renaming_as_body. For tagged types, the specification is one of the -- primitive specs. procedure No_Type_Rep_Item (N : Node_Id); -- Output message indicating that no type-related aspects can be -- specified due to some property of the parent type. procedure Register_Address_Clause_Check (N : Node_Id; X : Entity_Id; A : Uint; Y : Entity_Id; Off : Boolean); -- Register a check for the address clause N. The rest of the parameters -- are in keeping with the components of Address_Clause_Check_Record below. procedure Validate_Aspect_Aggregate (N : Node_Id); -- Check legality of operations given in the Ada 202x Aggregate aspect for -- containers. procedure Resolve_Aspect_Aggregate (Typ : Entity_Id; Expr : Node_Id); -- Resolve each one of the operations specified in the specification of -- Aspect_Aggregate. procedure Resolve_Iterable_Operation (N : Node_Id; Cursor : Entity_Id; Typ : Entity_Id; Nam : Name_Id); -- If the name of a primitive operation for an Iterable aspect is -- overloaded, resolve according to required signature. procedure Set_Biased (E : Entity_Id; N : Node_Id; Msg : String; Biased : Boolean := True); -- If Biased is True, sets Has_Biased_Representation flag for E, and -- outputs a warning message at node N if Warn_On_Biased_Representation is -- is True. This warning inserts the string Msg to describe the construct -- causing biasing. ----------------------------------------------------------- -- Visibility of Discriminants in Aspect Specifications -- ----------------------------------------------------------- -- The discriminants of a type are visible when analyzing the aspect -- specifications of a type declaration or protected type declaration, -- but not when analyzing those of a subtype declaration. The following -- routines enforce this distinction. procedure Push_Type (E : Entity_Id); -- Push scope E and make visible the discriminants of type entity E if E -- has discriminants and is not a subtype. procedure Pop_Type (E : Entity_Id); -- Remove visibility to the discriminants of type entity E and pop the -- scope stack if E has discriminants and is not a subtype. ---------------------------------------------- -- Table for Validate_Unchecked_Conversions -- ---------------------------------------------- -- The following table collects unchecked conversions for validation. -- Entries are made by Validate_Unchecked_Conversion and then the call -- to Validate_Unchecked_Conversions does the actual error checking and -- posting of warnings. The reason for this delayed processing is to take -- advantage of back-annotations of size and alignment values performed by -- the back end. -- Note: the reason we store a Source_Ptr value instead of a Node_Id is -- that by the time Validate_Unchecked_Conversions is called, Sprint will -- already have modified all Sloc values if the -gnatD option is set. type UC_Entry is record Eloc : Source_Ptr; -- node used for posting warnings Source : Entity_Id; -- source type for unchecked conversion Target : Entity_Id; -- target type for unchecked conversion Act_Unit : Entity_Id; -- actual function instantiated end record; package Unchecked_Conversions is new Table.Table ( Table_Component_Type => UC_Entry, Table_Index_Type => Int, Table_Low_Bound => 1, Table_Initial => 50, Table_Increment => 200, Table_Name => "Unchecked_Conversions"); ---------------------------------------- -- Table for Validate_Address_Clauses -- ---------------------------------------- -- If an address clause has the form -- for X'Address use Expr -- where Expr has a value known at compile time or is of the form Y'Address -- or recursively is a reference to a constant initialized with either of -- these forms, and the value of Expr is not a multiple of X's alignment, -- or if Y has a smaller alignment than X, then that merits a warning about -- possible bad alignment. The following table collects address clauses of -- this kind. We put these in a table so that they can be checked after the -- back end has completed annotation of the alignments of objects, since we -- can catch more cases that way. type Address_Clause_Check_Record is record N : Node_Id; -- The address clause X : Entity_Id; -- The entity of the object subject to the address clause A : Uint; -- The value of the address in the first case Y : Entity_Id; -- The entity of the object being overlaid in the second case Off : Boolean; -- Whether the address is offset within Y in the second case Alignment_Checks_Suppressed : Boolean; -- Whether alignment checks are suppressed by an active scope suppress -- setting. We need to save the value in order to be able to reuse it -- after the back end has been run. end record; package Address_Clause_Checks is new Table.Table ( Table_Component_Type => Address_Clause_Check_Record, Table_Index_Type => Int, Table_Low_Bound => 1, Table_Initial => 20, Table_Increment => 200, Table_Name => "Address_Clause_Checks"); function Alignment_Checks_Suppressed (ACCR : Address_Clause_Check_Record) return Boolean; -- Return whether the alignment check generated for the address clause -- is suppressed. --------------------------------- -- Alignment_Checks_Suppressed -- --------------------------------- function Alignment_Checks_Suppressed (ACCR : Address_Clause_Check_Record) return Boolean is begin if Checks_May_Be_Suppressed (ACCR.X) then return Is_Check_Suppressed (ACCR.X, Alignment_Check); else return ACCR.Alignment_Checks_Suppressed; end if; end Alignment_Checks_Suppressed; ----------------------------------------- -- Adjust_Record_For_Reverse_Bit_Order -- ----------------------------------------- procedure Adjust_Record_For_Reverse_Bit_Order (R : Entity_Id) is Max_Machine_Scalar_Size : constant Uint := UI_From_Int (System_Max_Integer_Size); -- We use this as the maximum machine scalar size SSU : constant Uint := UI_From_Int (System_Storage_Unit); CC : Node_Id; Comp : Node_Id; Num_CC : Natural; begin -- The processing done here used to depend on the Ada version, but the -- behavior has been changed by AI95-0133. However this AI is a Binding -- Interpretation, so we now implement it even in Ada 95 mode. But the -- original behavior from unamended Ada 95 is available for the sake of -- compatibility under the debugging switch -gnatd.p in Ada 95 mode. if Ada_Version < Ada_2005 and then Debug_Flag_Dot_P then Adjust_Record_For_Reverse_Bit_Order_Ada_95 (R); return; end if; -- For Ada 2005, we do machine scalar processing, as fully described In -- AI-133. This involves gathering all components which start at the -- same byte offset and processing them together. Same approach is still -- valid in later versions including Ada 2012. -- Note that component clauses found on record types may be inherited, -- in which case the layout of the component with such a clause still -- has to be done at this point. Therefore, the processing done here -- must exclusively rely on the Component_Clause of the component. -- This first loop through components does two things. First it deals -- with the case of components with component clauses whose length is -- greater than the maximum machine scalar size (either accepting them -- or rejecting as needed). Second, it counts the number of components -- with component clauses whose length does not exceed this maximum for -- later processing. Num_CC := 0; Comp := First_Component_Or_Discriminant (R); while Present (Comp) loop CC := Component_Clause (Comp); if Present (CC) then declare Fbit : constant Uint := Static_Integer (First_Bit (CC)); Lbit : constant Uint := Static_Integer (Last_Bit (CC)); begin -- Case of component with last bit >= max machine scalar if Lbit >= Max_Machine_Scalar_Size then -- This is allowed only if first bit is zero, and last bit -- + 1 is a multiple of storage unit size. if Fbit = 0 and then (Lbit + 1) mod SSU = 0 then -- This is the case to give a warning if enabled if Warn_On_Reverse_Bit_Order then Error_Msg_N ("info: multi-byte field specified with " & "non-standard Bit_Order?V?", CC); if Bytes_Big_Endian then Error_Msg_N ("\bytes are not reversed " & "(component is big-endian)?V?", CC); else Error_Msg_N ("\bytes are not reversed " & "(component is little-endian)?V?", CC); end if; end if; -- Give error message for RM 13.5.1(10) violation else Error_Msg_FE ("machine scalar rules not followed for&", First_Bit (CC), Comp); Error_Msg_Uint_1 := Lbit + 1; Error_Msg_Uint_2 := Max_Machine_Scalar_Size; Error_Msg_F ("\last bit + 1 (^) exceeds maximum machine scalar " & "size (^)", First_Bit (CC)); if (Lbit + 1) mod SSU /= 0 then Error_Msg_Uint_1 := SSU; Error_Msg_F ("\and is not a multiple of Storage_Unit (^) " & "(RM 13.5.1(10))", First_Bit (CC)); else Error_Msg_Uint_1 := Fbit; Error_Msg_F ("\and first bit (^) is non-zero " & "(RM 13.4.1(10))", First_Bit (CC)); end if; end if; -- OK case of machine scalar related component clause. For now, -- just count them. else Num_CC := Num_CC + 1; end if; end; end if; Next_Component_Or_Discriminant (Comp); end loop; -- We need to sort the component clauses on the basis of the Position -- values in the clause, so we can group clauses with the same Position -- together to determine the relevant machine scalar size. Sort_CC : declare Comps : array (0 .. Num_CC) of Entity_Id; -- Array to collect component and discriminant entities. The data -- starts at index 1, the 0'th entry is for the sort routine. function CP_Lt (Op1, Op2 : Natural) return Boolean; -- Compare routine for Sort procedure CP_Move (From : Natural; To : Natural); -- Move routine for Sort package Sorting is new GNAT.Heap_Sort_G (CP_Move, CP_Lt); MaxL : Uint; -- Maximum last bit value of any component in this set MSS : Uint; -- Corresponding machine scalar size Start : Natural; Stop : Natural; -- Start and stop positions in the component list of the set of -- components with the same starting position (that constitute -- components in a single machine scalar). ----------- -- CP_Lt -- ----------- function CP_Lt (Op1, Op2 : Natural) return Boolean is begin return Position (Component_Clause (Comps (Op1))) < Position (Component_Clause (Comps (Op2))); end CP_Lt; ------------- -- CP_Move -- ------------- procedure CP_Move (From : Natural; To : Natural) is begin Comps (To) := Comps (From); end CP_Move; -- Start of processing for Sort_CC begin -- Collect the machine scalar relevant component clauses Num_CC := 0; Comp := First_Component_Or_Discriminant (R); while Present (Comp) loop declare CC : constant Node_Id := Component_Clause (Comp); begin -- Collect only component clauses whose last bit is less than -- machine scalar size. Any component clause whose last bit -- exceeds this value does not take part in machine scalar -- layout considerations. The test for Error_Posted makes sure -- we exclude component clauses for which we already posted an -- error. if Present (CC) and then not Error_Posted (Last_Bit (CC)) and then Static_Integer (Last_Bit (CC)) < Max_Machine_Scalar_Size then Num_CC := Num_CC + 1; Comps (Num_CC) := Comp; end if; end; Next_Component_Or_Discriminant (Comp); end loop; -- Sort by ascending position number Sorting.Sort (Num_CC); -- We now have all the components whose size does not exceed the max -- machine scalar value, sorted by starting position. In this loop we -- gather groups of clauses starting at the same position, to process -- them in accordance with AI-133. Stop := 0; while Stop < Num_CC loop Start := Stop + 1; Stop := Start; MaxL := Static_Integer (Last_Bit (Component_Clause (Comps (Start)))); while Stop < Num_CC loop if Static_Integer (Position (Component_Clause (Comps (Stop + 1)))) = Static_Integer (Position (Component_Clause (Comps (Stop)))) then Stop := Stop + 1; MaxL := UI_Max (MaxL, Static_Integer (Last_Bit (Component_Clause (Comps (Stop))))); else exit; end if; end loop; -- Now we have a group of component clauses from Start to Stop -- whose positions are identical, and MaxL is the maximum last -- bit value of any of these components. -- We need to determine the corresponding machine scalar size. -- This loop assumes that machine scalar sizes are even, and that -- each possible machine scalar has twice as many bits as the next -- smaller one. MSS := Max_Machine_Scalar_Size; while MSS mod 2 = 0 and then (MSS / 2) >= SSU and then (MSS / 2) > MaxL loop MSS := MSS / 2; end loop; -- Here is where we fix up the Component_Bit_Offset value to -- account for the reverse bit order. Some examples of what needs -- to be done for the case of a machine scalar size of 8 are: -- First_Bit .. Last_Bit Component_Bit_Offset -- old new old new -- 0 .. 0 7 .. 7 0 7 -- 0 .. 1 6 .. 7 0 6 -- 0 .. 2 5 .. 7 0 5 -- 0 .. 7 0 .. 7 0 4 -- 1 .. 1 6 .. 6 1 6 -- 1 .. 4 3 .. 6 1 3 -- 4 .. 7 0 .. 3 4 0 -- The rule is that the first bit is obtained by subtracting the -- old ending bit from machine scalar size - 1. for C in Start .. Stop loop declare Comp : constant Entity_Id := Comps (C); CC : constant Node_Id := Component_Clause (Comp); FB : constant Uint := Static_Integer (First_Bit (CC)); LB : constant Uint := Static_Integer (Last_Bit (CC)); NFB : constant Uint := MSS - 1 - LB; NLB : constant Uint := NFB + LB - FB; Pos : constant Uint := Static_Integer (Position (CC)); begin -- Do not warn for the artificial clause built for the tag -- in Check_Record_Representation_Clause if it is inherited. if Warn_On_Reverse_Bit_Order and then Chars (Comp) /= Name_uTag then Error_Msg_Uint_1 := MSS; Error_Msg_N ("info: reverse bit order in machine scalar of " & "length^?V?", First_Bit (CC)); Error_Msg_Uint_1 := NFB; Error_Msg_Uint_2 := NLB; if Bytes_Big_Endian then Error_Msg_NE ("\big-endian range for component & is ^ .. ^?V?", First_Bit (CC), Comp); else Error_Msg_NE ("\little-endian range for component & is ^ .. ^?V?", First_Bit (CC), Comp); end if; end if; Set_Component_Bit_Offset (Comp, Pos * SSU + NFB); Set_Esize (Comp, 1 + (NLB - NFB)); Set_Normalized_First_Bit (Comp, NFB mod SSU); Set_Normalized_Position (Comp, Pos + NFB / SSU); end; end loop; end loop; end Sort_CC; end Adjust_Record_For_Reverse_Bit_Order; ------------------------------------------------ -- Adjust_Record_For_Reverse_Bit_Order_Ada_95 -- ------------------------------------------------ procedure Adjust_Record_For_Reverse_Bit_Order_Ada_95 (R : Entity_Id) is CC : Node_Id; Comp : Node_Id; begin -- For Ada 95, we just renumber bits within a storage unit. We do the -- same for Ada 83 mode, since we recognize the Bit_Order attribute in -- Ada 83, and are free to add this extension. Comp := First_Component_Or_Discriminant (R); while Present (Comp) loop CC := Component_Clause (Comp); -- If component clause is present, then deal with the non-default -- bit order case for Ada 95 mode. -- We only do this processing for the base type, and in fact that -- is important, since otherwise if there are record subtypes, we -- could reverse the bits once for each subtype, which is wrong. if Present (CC) and then Ekind (R) = E_Record_Type then declare CFB : constant Uint := Component_Bit_Offset (Comp); CSZ : constant Uint := Esize (Comp); CLC : constant Node_Id := Component_Clause (Comp); Pos : constant Node_Id := Position (CLC); FB : constant Node_Id := First_Bit (CLC); Storage_Unit_Offset : constant Uint := CFB / System_Storage_Unit; Start_Bit : constant Uint := CFB mod System_Storage_Unit; begin -- Cases where field goes over storage unit boundary if Start_Bit + CSZ > System_Storage_Unit then -- Allow multi-byte field but generate warning if Start_Bit mod System_Storage_Unit = 0 and then CSZ mod System_Storage_Unit = 0 then Error_Msg_N ("info: multi-byte field specified with non-standard " & "Bit_Order?V?", CLC); if Bytes_Big_Endian then Error_Msg_N ("\bytes are not reversed " & "(component is big-endian)?V?", CLC); else Error_Msg_N ("\bytes are not reversed " & "(component is little-endian)?V?", CLC); end if; -- Do not allow non-contiguous field else Error_Msg_N ("attempt to specify non-contiguous field not " & "permitted", CLC); Error_Msg_N ("\caused by non-standard Bit_Order specified in " & "legacy Ada 95 mode", CLC); end if; -- Case where field fits in one storage unit else -- Give warning if suspicious component clause if Intval (FB) >= System_Storage_Unit and then Warn_On_Reverse_Bit_Order then Error_Msg_N ("info: Bit_Order clause does not affect byte " & "ordering?V?", Pos); Error_Msg_Uint_1 := Intval (Pos) + Intval (FB) / System_Storage_Unit; Error_Msg_N ("info: position normalized to ^ before bit order " & "interpreted?V?", Pos); end if; -- Here is where we fix up the Component_Bit_Offset value -- to account for the reverse bit order. Some examples of -- what needs to be done are: -- First_Bit .. Last_Bit Component_Bit_Offset -- old new old new -- 0 .. 0 7 .. 7 0 7 -- 0 .. 1 6 .. 7 0 6 -- 0 .. 2 5 .. 7 0 5 -- 0 .. 7 0 .. 7 0 4 -- 1 .. 1 6 .. 6 1 6 -- 1 .. 4 3 .. 6 1 3 -- 4 .. 7 0 .. 3 4 0 -- The rule is that the first bit is obtained by subtracting -- the old ending bit from storage_unit - 1. Set_Component_Bit_Offset (Comp, (Storage_Unit_Offset * System_Storage_Unit) + (System_Storage_Unit - 1) - (Start_Bit + CSZ - 1)); Set_Normalized_Position (Comp, Component_Bit_Offset (Comp) / System_Storage_Unit); Set_Normalized_First_Bit (Comp, Component_Bit_Offset (Comp) mod System_Storage_Unit); end if; end; end if; Next_Component_Or_Discriminant (Comp); end loop; end Adjust_Record_For_Reverse_Bit_Order_Ada_95; ------------------------------------- -- Alignment_Check_For_Size_Change -- ------------------------------------- procedure Alignment_Check_For_Size_Change (Typ : Entity_Id; Size : Uint) is begin -- If the alignment is known, and not set by a rep clause, and is -- inconsistent with the size being set, then reset it to unknown, -- we assume in this case that the size overrides the inherited -- alignment, and that the alignment must be recomputed. if Known_Alignment (Typ) and then not Has_Alignment_Clause (Typ) and then Size mod (Alignment (Typ) * SSU) /= 0 then Init_Alignment (Typ); end if; end Alignment_Check_For_Size_Change; ----------------------------------- -- All_Membership_Choices_Static -- ----------------------------------- function All_Membership_Choices_Static (Expr : Node_Id) return Boolean is pragma Assert (Nkind (Expr) in N_Membership_Test); begin pragma Assert (Present (Right_Opnd (Expr)) xor Present (Alternatives (Expr))); if Present (Right_Opnd (Expr)) then return Is_Static_Choice (Right_Opnd (Expr)); else return All_Static_Choices (Alternatives (Expr)); end if; end All_Membership_Choices_Static; ------------------------ -- All_Static_Choices -- ------------------------ function All_Static_Choices (L : List_Id) return Boolean is N : Node_Id; begin N := First (L); while Present (N) loop if not Is_Static_Choice (N) then return False; end if; Next (N); end loop; return True; end All_Static_Choices; ------------------------------------- -- Analyze_Aspects_At_Freeze_Point -- ------------------------------------- procedure Analyze_Aspects_At_Freeze_Point (E : Entity_Id) is procedure Analyze_Aspect_Default_Value (ASN : Node_Id); -- This routine analyzes an Aspect_Default_[Component_]Value denoted by -- the aspect specification node ASN. procedure Check_Aspect_Too_Late (N : Node_Id); -- This procedure is similar to Rep_Item_Too_Late for representation -- aspects that apply to type and that do not have a corresponding -- pragma. -- Used to check in particular that the expression associated with -- aspect node N for the given type (entity) of the aspect does not -- appear too late according to the rules in RM 13.1(9) and 13.1(10). procedure Inherit_Delayed_Rep_Aspects (ASN : Node_Id); -- As discussed in the spec of Aspects (see Aspect_Delay declaration), -- a derived type can inherit aspects from its parent which have been -- specified at the time of the derivation using an aspect, as in: -- -- type A is range 1 .. 10 -- with Size => Not_Defined_Yet; -- .. -- type B is new A; -- .. -- Not_Defined_Yet : constant := 64; -- -- In this example, the Size of A is considered to be specified prior -- to the derivation, and thus inherited, even though the value is not -- known at the time of derivation. To deal with this, we use two entity -- flags. The flag Has_Derived_Rep_Aspects is set in the parent type (A -- here), and then the flag May_Inherit_Delayed_Rep_Aspects is set in -- the derived type (B here). If this flag is set when the derived type -- is frozen, then this procedure is called to ensure proper inheritance -- of all delayed aspects from the parent type. The derived type is E, -- the argument to Analyze_Aspects_At_Freeze_Point. ASN is the first -- aspect specification node in the Rep_Item chain for the parent type. procedure Make_Pragma_From_Boolean_Aspect (ASN : Node_Id); -- Given an aspect specification node ASN whose expression is an -- optional Boolean, this routines creates the corresponding pragma -- at the freezing point. ---------------------------------- -- Analyze_Aspect_Default_Value -- ---------------------------------- procedure Analyze_Aspect_Default_Value (ASN : Node_Id) is Ent : constant Entity_Id := Entity (ASN); Expr : constant Node_Id := Expression (ASN); begin Set_Has_Default_Aspect (Base_Type (Ent)); if Is_Scalar_Type (Ent) then Set_Default_Aspect_Value (Base_Type (Ent), Expr); else Set_Default_Aspect_Component_Value (Base_Type (Ent), Expr); end if; Check_Aspect_Too_Late (ASN); end Analyze_Aspect_Default_Value; --------------------------- -- Check_Aspect_Too_Late -- --------------------------- procedure Check_Aspect_Too_Late (N : Node_Id) is Typ : constant Entity_Id := Entity (N); Expr : constant Node_Id := Expression (N); function Find_Type_Reference (Typ : Entity_Id; Expr : Node_Id) return Boolean; -- Return True if a reference to type Typ is found in the expression -- Expr. ------------------------- -- Find_Type_Reference -- ------------------------- function Find_Type_Reference (Typ : Entity_Id; Expr : Node_Id) return Boolean is function Find_Type (N : Node_Id) return Traverse_Result; -- Set Found to True if N refers to Typ --------------- -- Find_Type -- --------------- function Find_Type (N : Node_Id) return Traverse_Result is begin if N = Typ or else (Nkind (N) in N_Identifier | N_Expanded_Name and then Present (Entity (N)) and then Entity (N) = Typ) then return Abandon; else return OK; end if; end Find_Type; function Search_Type_Reference is new Traverse_Func (Find_Type); begin return Search_Type_Reference (Expr) = Abandon; end Find_Type_Reference; Parent_Type : Entity_Id; begin -- Ensure Expr is analyzed so that e.g. all types are properly -- resolved for Find_Type_Reference. Analyze (Expr); -- A self-referential aspect is illegal if it forces freezing the -- entity before the corresponding aspect has been analyzed. if Find_Type_Reference (Typ, Expr) then Error_Msg_NE ("aspect specification causes premature freezing of&", N, Typ); end if; -- For representation aspects, check for case of untagged derived -- type whose parent either has primitive operations (pre Ada 202x), -- or is a by-reference type (RM 13.1(10)). -- Strictly speaking the check also applies to Ada 2012 but it is -- really too constraining for existing code already, so relax it. -- ??? Confirming aspects should be allowed here. if Is_Representation_Aspect (Get_Aspect_Id (N)) and then Is_Derived_Type (Typ) and then not Is_Tagged_Type (Typ) then Parent_Type := Etype (Base_Type (Typ)); if Ada_Version <= Ada_2012 and then Has_Primitive_Operations (Parent_Type) then Error_Msg_N ("|representation aspect not permitted before Ada 202x: " & "use -gnat2020!", N); Error_Msg_NE ("\parent type & has primitive operations!", N, Parent_Type); elsif Is_By_Reference_Type (Parent_Type) then No_Type_Rep_Item (N); Error_Msg_NE ("\parent type & is a by-reference type!", N, Parent_Type); end if; end if; end Check_Aspect_Too_Late; --------------------------------- -- Inherit_Delayed_Rep_Aspects -- --------------------------------- procedure Inherit_Delayed_Rep_Aspects (ASN : Node_Id) is A_Id : constant Aspect_Id := Get_Aspect_Id (ASN); P : constant Entity_Id := Entity (ASN); -- Entity for parent type N : Node_Id; -- Item from Rep_Item chain A : Aspect_Id; begin -- Loop through delayed aspects for the parent type N := ASN; while Present (N) loop if Nkind (N) = N_Aspect_Specification then exit when Entity (N) /= P; if Is_Delayed_Aspect (N) then A := Get_Aspect_Id (Chars (Identifier (N))); -- Process delayed rep aspect. For Boolean attributes it is -- not possible to cancel an attribute once set (the attempt -- to use an aspect with xxx => False is an error) for a -- derived type. So for those cases, we do not have to check -- if a clause has been given for the derived type, since it -- is harmless to set it again if it is already set. case A is -- Alignment when Aspect_Alignment => if not Has_Alignment_Clause (E) then Set_Alignment (E, Alignment (P)); end if; -- Atomic when Aspect_Atomic => if Is_Atomic (P) then Set_Is_Atomic (E); end if; -- Atomic_Components when Aspect_Atomic_Components => if Has_Atomic_Components (P) then Set_Has_Atomic_Components (Base_Type (E)); end if; -- Bit_Order when Aspect_Bit_Order => if Is_Record_Type (E) and then No (Get_Attribute_Definition_Clause (E, Attribute_Bit_Order)) and then Reverse_Bit_Order (P) then Set_Reverse_Bit_Order (Base_Type (E)); end if; -- Component_Size when Aspect_Component_Size => if Is_Array_Type (E) and then not Has_Component_Size_Clause (E) then Set_Component_Size (Base_Type (E), Component_Size (P)); end if; -- Machine_Radix when Aspect_Machine_Radix => if Is_Decimal_Fixed_Point_Type (E) and then not Has_Machine_Radix_Clause (E) then Set_Machine_Radix_10 (E, Machine_Radix_10 (P)); end if; -- Object_Size (also Size which also sets Object_Size) when Aspect_Object_Size | Aspect_Size => if not Has_Size_Clause (E) and then No (Get_Attribute_Definition_Clause (E, Attribute_Object_Size)) then Set_Esize (E, Esize (P)); end if; -- Pack when Aspect_Pack => if not Is_Packed (E) then Set_Is_Packed (Base_Type (E)); if Is_Bit_Packed_Array (P) then Set_Is_Bit_Packed_Array (Base_Type (E)); Set_Packed_Array_Impl_Type (E, Packed_Array_Impl_Type (P)); end if; end if; -- Scalar_Storage_Order when Aspect_Scalar_Storage_Order => if (Is_Record_Type (E) or else Is_Array_Type (E)) and then No (Get_Attribute_Definition_Clause (E, Attribute_Scalar_Storage_Order)) and then Reverse_Storage_Order (P) then Set_Reverse_Storage_Order (Base_Type (E)); -- Clear default SSO indications, since the aspect -- overrides the default. Set_SSO_Set_Low_By_Default (Base_Type (E), False); Set_SSO_Set_High_By_Default (Base_Type (E), False); end if; -- Small when Aspect_Small => if Is_Fixed_Point_Type (E) and then not Has_Small_Clause (E) then Set_Small_Value (E, Small_Value (P)); end if; -- Storage_Size when Aspect_Storage_Size => if (Is_Access_Type (E) or else Is_Task_Type (E)) and then not Has_Storage_Size_Clause (E) then Set_Storage_Size_Variable (Base_Type (E), Storage_Size_Variable (P)); end if; -- Value_Size when Aspect_Value_Size => -- Value_Size is never inherited, it is either set by -- default, or it is explicitly set for the derived -- type. So nothing to do here. null; -- Volatile when Aspect_Volatile => if Is_Volatile (P) then Set_Is_Volatile (E); end if; -- Volatile_Full_Access when Aspect_Volatile_Full_Access => if Is_Volatile_Full_Access (P) then Set_Is_Volatile_Full_Access (E); end if; -- Volatile_Components when Aspect_Volatile_Components => if Has_Volatile_Components (P) then Set_Has_Volatile_Components (Base_Type (E)); end if; -- That should be all the Rep Aspects when others => pragma Assert (Aspect_Delay (A_Id) /= Rep_Aspect); null; end case; end if; end if; Next_Rep_Item (N); end loop; end Inherit_Delayed_Rep_Aspects; ------------------------------------- -- Make_Pragma_From_Boolean_Aspect -- ------------------------------------- procedure Make_Pragma_From_Boolean_Aspect (ASN : Node_Id) is Ident : constant Node_Id := Identifier (ASN); A_Name : constant Name_Id := Chars (Ident); A_Id : constant Aspect_Id := Get_Aspect_Id (A_Name); Ent : constant Entity_Id := Entity (ASN); Expr : constant Node_Id := Expression (ASN); Loc : constant Source_Ptr := Sloc (ASN); procedure Check_False_Aspect_For_Derived_Type; -- This procedure checks for the case of a false aspect for a derived -- type, which improperly tries to cancel an aspect inherited from -- the parent. ----------------------------------------- -- Check_False_Aspect_For_Derived_Type -- ----------------------------------------- procedure Check_False_Aspect_For_Derived_Type is Par : Node_Id; begin -- We are only checking derived types if not Is_Derived_Type (E) then return; end if; Par := Nearest_Ancestor (E); case A_Id is when Aspect_Atomic | Aspect_Shared => if not Is_Atomic (Par) then return; end if; when Aspect_Atomic_Components => if not Has_Atomic_Components (Par) then return; end if; when Aspect_Discard_Names => if not Discard_Names (Par) then return; end if; when Aspect_Pack => if not Is_Packed (Par) then return; end if; when Aspect_Unchecked_Union => if not Is_Unchecked_Union (Par) then return; end if; when Aspect_Volatile => if not Is_Volatile (Par) then return; end if; when Aspect_Volatile_Components => if not Has_Volatile_Components (Par) then return; end if; when Aspect_Volatile_Full_Access => if not Is_Volatile_Full_Access (Par) then return; end if; when others => return; end case; -- Fall through means we are canceling an inherited aspect Error_Msg_Name_1 := A_Name; Error_Msg_NE ("derived type& inherits aspect%, cannot cancel", Expr, E); end Check_False_Aspect_For_Derived_Type; -- Local variables Prag : Node_Id; -- Start of processing for Make_Pragma_From_Boolean_Aspect begin -- Note that we know Expr is present, because for a missing Expr -- argument, we knew it was True and did not need to delay the -- evaluation to the freeze point. if Is_False (Static_Boolean (Expr)) then Check_False_Aspect_For_Derived_Type; else Prag := Make_Pragma (Loc, Pragma_Identifier => Make_Identifier (Sloc (Ident), Chars (Ident)), Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Sloc (Ident), Expression => New_Occurrence_Of (Ent, Sloc (Ident))))); Set_From_Aspect_Specification (Prag, True); Set_Corresponding_Aspect (Prag, ASN); Set_Aspect_Rep_Item (ASN, Prag); Set_Is_Delayed_Aspect (Prag); Set_Parent (Prag, ASN); end if; end Make_Pragma_From_Boolean_Aspect; -- Local variables A_Id : Aspect_Id; ASN : Node_Id; Ritem : Node_Id; -- Start of processing for Analyze_Aspects_At_Freeze_Point begin -- Must be visible in current scope, but if this is a type from a nested -- package it may be frozen from an object declaration in the enclosing -- scope, so install the package declarations to complete the analysis -- of the aspects, if any. If the package itself is frozen the type will -- have been frozen as well. if not Scope_Within_Or_Same (Current_Scope, Scope (E)) then if Is_Type (E) and then From_Nested_Package (E) then declare Pack : constant Entity_Id := Scope (E); begin Push_Scope (Pack); Install_Visible_Declarations (Pack); Install_Private_Declarations (Pack); Analyze_Aspects_At_Freeze_Point (E); if Is_Private_Type (E) and then Present (Full_View (E)) then Analyze_Aspects_At_Freeze_Point (Full_View (E)); end if; End_Package_Scope (Pack); return; end; -- Aspects from other entities in different contexts are analyzed -- elsewhere. else return; end if; end if; -- Look for aspect specification entries for this entity ASN := First_Rep_Item (E); while Present (ASN) loop if Nkind (ASN) = N_Aspect_Specification then exit when Entity (ASN) /= E; if Is_Delayed_Aspect (ASN) then A_Id := Get_Aspect_Id (ASN); case A_Id is -- For aspects whose expression is an optional Boolean, make -- the corresponding pragma at the freeze point. when Boolean_Aspects | Library_Unit_Aspects => -- Aspects Export and Import require special handling. -- Both are by definition Boolean and may benefit from -- forward references, however their expressions are -- treated as static. In addition, the syntax of their -- corresponding pragmas requires extra "pieces" which -- may also contain forward references. To account for -- all of this, the corresponding pragma is created by -- Analyze_Aspect_Export_Import, but is not analyzed as -- the complete analysis must happen now. if A_Id = Aspect_Export or else A_Id = Aspect_Import then null; -- Otherwise create a corresponding pragma else Make_Pragma_From_Boolean_Aspect (ASN); end if; -- Special handling for aspects that don't correspond to -- pragmas/attributes. when Aspect_Default_Value | Aspect_Default_Component_Value => -- Do not inherit aspect for anonymous base type of a -- scalar or array type, because they apply to the first -- subtype of the type, and will be processed when that -- first subtype is frozen. if Is_Derived_Type (E) and then not Comes_From_Source (E) and then E /= First_Subtype (E) then null; else Analyze_Aspect_Default_Value (ASN); end if; -- Ditto for iterator aspects, because the corresponding -- attributes may not have been analyzed yet. when Aspect_Constant_Indexing | Aspect_Default_Iterator | Aspect_Iterator_Element | Aspect_Variable_Indexing => Analyze (Expression (ASN)); if Etype (Expression (ASN)) = Any_Type then Error_Msg_NE ("\aspect must be fully defined before & is frozen", ASN, E); end if; when Aspect_Integer_Literal | Aspect_Real_Literal | Aspect_String_Literal => Validate_Literal_Aspect (E, ASN); when Aspect_Iterable => Validate_Iterable_Aspect (E, ASN); when Aspect_Aggregate => null; when others => null; end case; Ritem := Aspect_Rep_Item (ASN); if Present (Ritem) then Analyze (Ritem); end if; end if; end if; Next_Rep_Item (ASN); end loop; -- This is where we inherit delayed rep aspects from our parent. Note -- that if we fell out of the above loop with ASN non-empty, it means -- we hit an aspect for an entity other than E, and it must be the -- type from which we were derived. if May_Inherit_Delayed_Rep_Aspects (E) then Inherit_Delayed_Rep_Aspects (ASN); end if; if In_Instance and then E /= Base_Type (E) and then Is_First_Subtype (E) then Inherit_Rep_Item_Chain (Base_Type (E), E); end if; end Analyze_Aspects_At_Freeze_Point; ----------------------------------- -- Analyze_Aspect_Specifications -- ----------------------------------- procedure Analyze_Aspect_Specifications (N : Node_Id; E : Entity_Id) is pragma Assert (Present (E)); procedure Decorate (Asp : Node_Id; Prag : Node_Id); -- Establish linkages between an aspect and its corresponding pragma procedure Insert_Pragma (Prag : Node_Id; Is_Instance : Boolean := False); -- Subsidiary to the analysis of aspects -- Abstract_State -- Attach_Handler -- Contract_Cases -- Depends -- Ghost -- Global -- Initial_Condition -- Initializes -- Post -- Pre -- Refined_Depends -- Refined_Global -- Refined_State -- SPARK_Mode -- Subprogram_Variant -- Warnings -- Insert pragma Prag such that it mimics the placement of a source -- pragma of the same kind. Flag Is_Generic should be set when the -- context denotes a generic instance. -------------- -- Decorate -- -------------- procedure Decorate (Asp : Node_Id; Prag : Node_Id) is begin Set_Aspect_Rep_Item (Asp, Prag); Set_Corresponding_Aspect (Prag, Asp); Set_From_Aspect_Specification (Prag); Set_Parent (Prag, Asp); end Decorate; ------------------- -- Insert_Pragma -- ------------------- procedure Insert_Pragma (Prag : Node_Id; Is_Instance : Boolean := False) is Aux : Node_Id; Decl : Node_Id; Decls : List_Id; Def : Node_Id; Inserted : Boolean := False; begin -- When the aspect appears on an entry, package, protected unit, -- subprogram, or task unit body, insert the generated pragma at the -- top of the body declarations to emulate the behavior of a source -- pragma. -- package body Pack with Aspect is -- package body Pack is -- pragma Prag; if Nkind (N) in N_Entry_Body | N_Package_Body | N_Protected_Body | N_Subprogram_Body | N_Task_Body then Decls := Declarations (N); if No (Decls) then Decls := New_List; Set_Declarations (N, Decls); end if; Prepend_To (Decls, Prag); -- When the aspect is associated with a [generic] package declaration -- insert the generated pragma at the top of the visible declarations -- to emulate the behavior of a source pragma. -- package Pack with Aspect is -- package Pack is -- pragma Prag; elsif Nkind (N) in N_Generic_Package_Declaration | N_Package_Declaration then Decls := Visible_Declarations (Specification (N)); if No (Decls) then Decls := New_List; Set_Visible_Declarations (Specification (N), Decls); end if; -- The visible declarations of a generic instance have the -- following structure: -- <renamings of generic formals> -- <renamings of internally-generated spec and body> -- <first source declaration> -- Insert the pragma before the first source declaration by -- skipping the instance "header" to ensure proper visibility of -- all formals. if Is_Instance then Decl := First (Decls); while Present (Decl) loop if Comes_From_Source (Decl) then Insert_Before (Decl, Prag); Inserted := True; exit; else Next (Decl); end if; end loop; -- The pragma is placed after the instance "header" if not Inserted then Append_To (Decls, Prag); end if; -- Otherwise this is not a generic instance else Prepend_To (Decls, Prag); end if; -- When the aspect is associated with a protected unit declaration, -- insert the generated pragma at the top of the visible declarations -- the emulate the behavior of a source pragma. -- protected [type] Prot with Aspect is -- protected [type] Prot is -- pragma Prag; elsif Nkind (N) = N_Protected_Type_Declaration then Def := Protected_Definition (N); if No (Def) then Def := Make_Protected_Definition (Sloc (N), Visible_Declarations => New_List, End_Label => Empty); Set_Protected_Definition (N, Def); end if; Decls := Visible_Declarations (Def); if No (Decls) then Decls := New_List; Set_Visible_Declarations (Def, Decls); end if; Prepend_To (Decls, Prag); -- When the aspect is associated with a task unit declaration, insert -- insert the generated pragma at the top of the visible declarations -- the emulate the behavior of a source pragma. -- task [type] Prot with Aspect is -- task [type] Prot is -- pragma Prag; elsif Nkind (N) = N_Task_Type_Declaration then Def := Task_Definition (N); if No (Def) then Def := Make_Task_Definition (Sloc (N), Visible_Declarations => New_List, End_Label => Empty); Set_Task_Definition (N, Def); end if; Decls := Visible_Declarations (Def); if No (Decls) then Decls := New_List; Set_Visible_Declarations (Def, Decls); end if; Prepend_To (Decls, Prag); -- When the context is a library unit, the pragma is added to the -- Pragmas_After list. elsif Nkind (Parent (N)) = N_Compilation_Unit then Aux := Aux_Decls_Node (Parent (N)); if No (Pragmas_After (Aux)) then Set_Pragmas_After (Aux, New_List); end if; Prepend (Prag, Pragmas_After (Aux)); -- Default, the pragma is inserted after the context else Insert_After (N, Prag); end if; end Insert_Pragma; -- Local variables Aspect : Node_Id; Aitem : Node_Id := Empty; Ent : Node_Id; L : constant List_Id := Aspect_Specifications (N); pragma Assert (Present (L)); Ins_Node : Node_Id := N; -- Insert pragmas/attribute definition clause after this node when no -- delayed analysis is required. -- Start of processing for Analyze_Aspect_Specifications begin -- The general processing involves building an attribute definition -- clause or a pragma node that corresponds to the aspect. Then in order -- to delay the evaluation of this aspect to the freeze point, we attach -- the corresponding pragma/attribute definition clause to the aspect -- specification node, which is then placed in the Rep Item chain. In -- this case we mark the entity by setting the flag Has_Delayed_Aspects -- and we evaluate the rep item at the freeze point. When the aspect -- doesn't have a corresponding pragma/attribute definition clause, then -- its analysis is simply delayed at the freeze point. -- Some special cases don't require delay analysis, thus the aspect is -- analyzed right now. -- Note that there is a special handling for Pre, Post, Test_Case, -- Contract_Cases and Subprogram_Variant aspects. In these cases, we do -- not have to worry about delay issues, since the pragmas themselves -- deal with delay of visibility for the expression analysis. Thus, we -- just insert the pragma after the node N. -- Loop through aspects Aspect := First (L); Aspect_Loop : while Present (Aspect) loop Analyze_One_Aspect : declare Expr : constant Node_Id := Expression (Aspect); Id : constant Node_Id := Identifier (Aspect); Loc : constant Source_Ptr := Sloc (Aspect); Nam : constant Name_Id := Chars (Id); A_Id : constant Aspect_Id := Get_Aspect_Id (Nam); Anod : Node_Id; Delay_Required : Boolean; -- Set False if delay is not required Eloc : Source_Ptr := No_Location; -- Source location of expression, modified when we split PPC's. It -- is set below when Expr is present. procedure Analyze_Aspect_Convention; -- Perform analysis of aspect Convention procedure Analyze_Aspect_Disable_Controlled; -- Perform analysis of aspect Disable_Controlled procedure Analyze_Aspect_Export_Import; -- Perform analysis of aspects Export or Import procedure Analyze_Aspect_External_Link_Name; -- Perform analysis of aspects External_Name or Link_Name procedure Analyze_Aspect_Implicit_Dereference; -- Perform analysis of the Implicit_Dereference aspects procedure Analyze_Aspect_Relaxed_Initialization; -- Perform analysis of aspect Relaxed_Initialization procedure Analyze_Aspect_Yield; -- Perform analysis of aspect Yield procedure Analyze_Aspect_Static; -- Ada 202x (AI12-0075): Perform analysis of aspect Static procedure Make_Aitem_Pragma (Pragma_Argument_Associations : List_Id; Pragma_Name : Name_Id); -- This is a wrapper for Make_Pragma used for converting aspects -- to pragmas. It takes care of Sloc (set from Loc) and building -- the pragma identifier from the given name. In addition the -- flags Class_Present and Split_PPC are set from the aspect -- node, as well as Is_Ignored. This routine also sets the -- From_Aspect_Specification in the resulting pragma node to -- True, and sets Corresponding_Aspect to point to the aspect. -- The resulting pragma is assigned to Aitem. ------------------------------- -- Analyze_Aspect_Convention -- ------------------------------- procedure Analyze_Aspect_Convention is Conv : Node_Id; Dummy_1 : Node_Id; Dummy_2 : Node_Id; Dummy_3 : Node_Id; Expo : Node_Id; Imp : Node_Id; begin -- Obtain all interfacing aspects that apply to the related -- entity. Get_Interfacing_Aspects (Iface_Asp => Aspect, Conv_Asp => Dummy_1, EN_Asp => Dummy_2, Expo_Asp => Expo, Imp_Asp => Imp, LN_Asp => Dummy_3, Do_Checks => True); -- The related entity is subject to aspect Export or Import. -- Do not process Convention now because it must be analysed -- as part of Export or Import. if Present (Expo) or else Present (Imp) then return; -- Otherwise Convention appears by itself else -- The aspect specifies a particular convention if Present (Expr) then Conv := New_Copy_Tree (Expr); -- Otherwise assume convention Ada else Conv := Make_Identifier (Loc, Name_Ada); end if; -- Generate: -- pragma Convention (<Conv>, <E>); Make_Aitem_Pragma (Pragma_Name => Name_Convention, Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Conv), Make_Pragma_Argument_Association (Loc, Expression => New_Occurrence_Of (E, Loc)))); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); end if; end Analyze_Aspect_Convention; --------------------------------------- -- Analyze_Aspect_Disable_Controlled -- --------------------------------------- procedure Analyze_Aspect_Disable_Controlled is begin -- The aspect applies only to controlled records if not (Ekind (E) = E_Record_Type and then Is_Controlled_Active (E)) then Error_Msg_N ("aspect % requires controlled record type", Aspect); return; end if; -- Preanalyze the expression (if any) when the aspect resides -- in a generic unit. if Inside_A_Generic then if Present (Expr) then Preanalyze_And_Resolve (Expr, Any_Boolean); end if; -- Otherwise the aspect resides in a nongeneric context else -- A controlled record type loses its controlled semantics -- when the expression statically evaluates to True. if Present (Expr) then Analyze_And_Resolve (Expr, Any_Boolean); if Is_OK_Static_Expression (Expr) then if Is_True (Static_Boolean (Expr)) then Set_Disable_Controlled (E); end if; -- Otherwise the expression is not static else Error_Msg_N ("expression of aspect % must be static", Aspect); end if; -- Otherwise the aspect appears without an expression and -- defaults to True. else Set_Disable_Controlled (E); end if; end if; end Analyze_Aspect_Disable_Controlled; ---------------------------------- -- Analyze_Aspect_Export_Import -- ---------------------------------- procedure Analyze_Aspect_Export_Import is Dummy_1 : Node_Id; Dummy_2 : Node_Id; Dummy_3 : Node_Id; Expo : Node_Id; Imp : Node_Id; begin -- Obtain all interfacing aspects that apply to the related -- entity. Get_Interfacing_Aspects (Iface_Asp => Aspect, Conv_Asp => Dummy_1, EN_Asp => Dummy_2, Expo_Asp => Expo, Imp_Asp => Imp, LN_Asp => Dummy_3, Do_Checks => True); -- The related entity cannot be subject to both aspects Export -- and Import. if Present (Expo) and then Present (Imp) then Error_Msg_N ("incompatible interfacing aspects given for &", E); Error_Msg_Sloc := Sloc (Expo); Error_Msg_N ("\aspect `Export` #", E); Error_Msg_Sloc := Sloc (Imp); Error_Msg_N ("\aspect `Import` #", E); end if; -- A variable is most likely modified from the outside. Take -- the optimistic approach to avoid spurious errors. if Ekind (E) = E_Variable then Set_Never_Set_In_Source (E, False); end if; -- Resolve the expression of an Import or Export here, and -- require it to be of type Boolean and static. This is not -- quite right, because in general this should be delayed, -- but that seems tricky for these, because normally Boolean -- aspects are replaced with pragmas at the freeze point in -- Make_Pragma_From_Boolean_Aspect. if not Present (Expr) or else Is_True (Static_Boolean (Expr)) then if A_Id = Aspect_Import then Set_Has_Completion (E); Set_Is_Imported (E); -- An imported object cannot be explicitly initialized if Nkind (N) = N_Object_Declaration and then Present (Expression (N)) then Error_Msg_N ("imported entities cannot be initialized " & "(RM B.1(24))", Expression (N)); end if; else pragma Assert (A_Id = Aspect_Export); Set_Is_Exported (E); end if; -- Create the proper form of pragma Export or Import taking -- into account Conversion, External_Name, and Link_Name. Aitem := Build_Export_Import_Pragma (Aspect, E); -- Otherwise the expression is either False or erroneous. There -- is no corresponding pragma. else Aitem := Empty; end if; end Analyze_Aspect_Export_Import; --------------------------------------- -- Analyze_Aspect_External_Link_Name -- --------------------------------------- procedure Analyze_Aspect_External_Link_Name is Dummy_1 : Node_Id; Dummy_2 : Node_Id; Dummy_3 : Node_Id; Expo : Node_Id; Imp : Node_Id; begin -- Obtain all interfacing aspects that apply to the related -- entity. Get_Interfacing_Aspects (Iface_Asp => Aspect, Conv_Asp => Dummy_1, EN_Asp => Dummy_2, Expo_Asp => Expo, Imp_Asp => Imp, LN_Asp => Dummy_3, Do_Checks => True); -- Ensure that aspect External_Name applies to aspect Export or -- Import. if A_Id = Aspect_External_Name then if No (Expo) and then No (Imp) then Error_Msg_N ("aspect `External_Name` requires aspect `Import` or " & "`Export`", Aspect); end if; -- Otherwise ensure that aspect Link_Name applies to aspect -- Export or Import. else pragma Assert (A_Id = Aspect_Link_Name); if No (Expo) and then No (Imp) then Error_Msg_N ("aspect `Link_Name` requires aspect `Import` or " & "`Export`", Aspect); end if; end if; end Analyze_Aspect_External_Link_Name; ----------------------------------------- -- Analyze_Aspect_Implicit_Dereference -- ----------------------------------------- procedure Analyze_Aspect_Implicit_Dereference is begin if not Is_Type (E) or else not Has_Discriminants (E) then Error_Msg_N ("aspect must apply to a type with discriminants", Expr); elsif not Is_Entity_Name (Expr) then Error_Msg_N ("aspect must name a discriminant of current type", Expr); else -- Discriminant type be an anonymous access type or an -- anonymous access to subprogram. -- Missing synchronized types??? declare Disc : Entity_Id := First_Discriminant (E); begin while Present (Disc) loop if Chars (Expr) = Chars (Disc) and then Ekind (Etype (Disc)) in E_Anonymous_Access_Subprogram_Type | E_Anonymous_Access_Type then Set_Has_Implicit_Dereference (E); Set_Has_Implicit_Dereference (Disc); exit; end if; Next_Discriminant (Disc); end loop; -- Error if no proper access discriminant if Present (Disc) then -- For a type extension, check whether parent has -- a reference discriminant, to verify that use is -- proper. if Is_Derived_Type (E) and then Has_Discriminants (Etype (E)) then declare Parent_Disc : constant Entity_Id := Get_Reference_Discriminant (Etype (E)); begin if Present (Parent_Disc) and then Corresponding_Discriminant (Disc) /= Parent_Disc then Error_Msg_N ("reference discriminant does not match " & "discriminant of parent type", Expr); end if; end; end if; else Error_Msg_NE ("not an access discriminant of&", Expr, E); end if; end; end if; end Analyze_Aspect_Implicit_Dereference; ------------------------------------------- -- Analyze_Aspect_Relaxed_Initialization -- ------------------------------------------- procedure Analyze_Aspect_Relaxed_Initialization is procedure Analyze_Relaxed_Parameter (Subp_Id : Entity_Id; Param : Node_Id; Seen : in out Elist_Id); -- Analyze parameter that appears in the expression of the -- aspect Relaxed_Initialization. ------------------------------- -- Analyze_Relaxed_Parameter -- ------------------------------- procedure Analyze_Relaxed_Parameter (Subp_Id : Entity_Id; Param : Node_Id; Seen : in out Elist_Id) is begin -- Set name of the aspect for error messages Error_Msg_Name_1 := Nam; -- The relaxed parameter is a formal parameter if Nkind (Param) in N_Identifier | N_Expanded_Name then Analyze (Param); declare Item : constant Entity_Id := Entity (Param); begin -- It must be a formal of the analyzed subprogram if Scope (Item) = Subp_Id then pragma Assert (Is_Formal (Item)); -- It must not have scalar or access type if Is_Elementary_Type (Etype (Item)) then Error_Msg_N ("illegal aspect % item", Param); Error_Msg_N ("\item must not have elementary type", Param); end if; -- Detect duplicated items if Contains (Seen, Item) then Error_Msg_N ("duplicate aspect % item", Param); else Append_New_Elmt (Item, Seen); end if; else Error_Msg_N ("illegal aspect % item", Param); end if; end; -- The relaxed parameter is the function's Result attribute elsif Is_Attribute_Result (Param) then Analyze (Param); declare Pref : constant Node_Id := Prefix (Param); begin if Present (Pref) and then Nkind (Pref) in N_Identifier | N_Expanded_Name and then Entity (Pref) = Subp_Id then -- Function result must not have scalar or access -- type. if Is_Elementary_Type (Etype (Pref)) then Error_Msg_N ("illegal aspect % item", Param); Error_Msg_N ("\function result must not have elementary" & " type", Param); end if; -- Detect duplicated items if Contains (Seen, Subp_Id) then Error_Msg_N ("duplicate aspect % item", Param); else Append_New_Elmt (Entity (Pref), Seen); end if; else Error_Msg_N ("illegal aspect % item", Param); end if; end; else Error_Msg_N ("illegal aspect % item", Param); end if; end Analyze_Relaxed_Parameter; -- Local variables Seen : Elist_Id := No_Elist; -- Items that appear in the relaxed initialization aspect -- expression of a subprogram; for detecting duplicates. Restore_Scope : Boolean; -- Will be set to True if we need to restore the scope table -- after analyzing the aspect expression. Prev_Id : Entity_Id; -- Start of processing for Analyze_Aspect_Relaxed_Initialization begin -- Set name of the aspect for error messages Error_Msg_Name_1 := Nam; -- Annotation of a type; no aspect expression is allowed. -- For a private type, the aspect must be attached to the -- partial view. -- -- ??? Once the exact rule for this aspect is ready, we will -- likely reject concurrent types, etc., so let's keep the code -- for types and variable separate. if Is_First_Subtype (E) then Prev_Id := Incomplete_Or_Partial_View (E); if Present (Prev_Id) then -- Aspect may appear on the full view of an incomplete -- type because the incomplete declaration cannot have -- any aspects. if Ekind (Prev_Id) = E_Incomplete_Type then null; else Error_Msg_N ("aspect % must apply to partial view", N); end if; elsif Present (Expr) then Error_Msg_N ("illegal aspect % expression", Expr); end if; -- Annotation of a variable; no aspect expression is allowed elsif Ekind (E) = E_Variable then if Present (Expr) then Error_Msg_N ("illegal aspect % expression", Expr); end if; -- Annotation of a constant; no aspect expression is allowed. -- For a deferred constant, the aspect must be attached to the -- partial view. elsif Ekind (E) = E_Constant then if Present (Incomplete_Or_Partial_View (E)) then Error_Msg_N ("aspect % must apply to deferred constant", N); elsif Present (Expr) then Error_Msg_N ("illegal aspect % expression", Expr); end if; -- Annotation of a subprogram; aspect expression is required elsif Is_Subprogram_Or_Entry (E) or else Is_Generic_Subprogram (E) then if Present (Expr) then -- If we analyze subprogram body that acts as its own -- spec, then the subprogram itself and its formals are -- already installed; otherwise, we need to install them, -- as they must be visible when analyzing the aspect -- expression. if In_Open_Scopes (E) then Restore_Scope := False; else Restore_Scope := True; Push_Scope (E); -- Only formals of the subprogram itself can appear -- in Relaxed_Initialization aspect expression, not -- formals of the enclosing generic unit. (This is -- different than in Precondition or Depends aspects, -- where both kinds of formals are allowed.) Install_Formals (E); end if; -- Aspect expression is either an aggregate with list of -- parameters (and possibly the Result attribute for a -- function). if Nkind (Expr) = N_Aggregate then -- Component associations in the aggregate must be a -- parameter name followed by a static boolean -- expression. if Present (Component_Associations (Expr)) then declare Assoc : Node_Id := First (Component_Associations (Expr)); begin while Present (Assoc) loop if List_Length (Choices (Assoc)) = 1 then Analyze_Relaxed_Parameter (E, First (Choices (Assoc)), Seen); if Inside_A_Generic then Preanalyze_And_Resolve (Expression (Assoc), Any_Boolean); else Analyze_And_Resolve (Expression (Assoc), Any_Boolean); end if; if not Is_OK_Static_Expression (Expression (Assoc)) then Error_Msg_Name_1 := Nam; Error_Msg_N ("expression of aspect %" & "must be static", Aspect); end if; else Error_Msg_Name_1 := Nam; Error_Msg_N ("illegal aspect % expression", Expr); end if; Next (Assoc); end loop; end; end if; -- Expressions of the aggregate are parameter names if Present (Expressions (Expr)) then declare Param : Node_Id := First (Expressions (Expr)); begin while Present (Param) loop Analyze_Relaxed_Parameter (E, Param, Seen); Next (Param); end loop; end; end if; -- Mark the aggregate expression itself as analyzed; -- its subexpressions were marked when they themselves -- were analyzed. Set_Analyzed (Expr); -- Otherwise, it is a single name of a subprogram -- parameter (or possibly the Result attribute for -- a function). else Analyze_Relaxed_Parameter (E, Expr, Seen); end if; if Restore_Scope then End_Scope; end if; else Error_Msg_N ("missing expression for aspect %", N); end if; else Error_Msg_N ("inappropriate entity for aspect %", E); end if; end Analyze_Aspect_Relaxed_Initialization; --------------------------- -- Analyze_Aspect_Static -- --------------------------- procedure Analyze_Aspect_Static is function Has_Convention_Intrinsic (L : List_Id) return Boolean; -- Return True if L contains a pragma argument association -- node representing a convention Intrinsic. ------------------------------ -- Has_Convention_Intrinsic -- ------------------------------ function Has_Convention_Intrinsic (L : List_Id) return Boolean is Arg : Node_Id := First (L); begin while Present (Arg) loop if Nkind (Arg) = N_Pragma_Argument_Association and then Chars (Arg) = Name_Convention and then Chars (Expression (Arg)) = Name_Intrinsic then return True; end if; Next (Arg); end loop; return False; end Has_Convention_Intrinsic; Is_Imported_Intrinsic : Boolean; begin if Ada_Version < Ada_2020 then Error_Msg_N ("aspect % is an Ada 202x feature", Aspect); Error_Msg_N ("\compile with -gnat2020", Aspect); return; end if; Is_Imported_Intrinsic := Is_Imported (E) and then Has_Convention_Intrinsic (Pragma_Argument_Associations (Import_Pragma (E))); -- The aspect applies only to expression functions that -- statisfy the requirements for a static expression function -- (such as having an expression that is predicate-static) as -- well as Intrinsic imported functions as a -gnatX extension. if not Is_Expression_Function (E) and then not (Extensions_Allowed and then Is_Imported_Intrinsic) then if Extensions_Allowed then Error_Msg_N ("aspect % requires intrinsic or expression function", Aspect); elsif Is_Imported_Intrinsic then Error_Msg_N ("aspect % on intrinsic function is an extension: " & "use -gnatX", Aspect); else Error_Msg_N ("aspect % requires expression function", Aspect); end if; return; -- Ada 202x (AI12-0075): Check that the function satisfies -- several requirements of static functions as specified in -- RM 6.8(5.1-5.8). Note that some of the requirements given -- there are checked elsewhere. else -- The expression of the expression function must be a -- potentially static expression (RM 202x 6.8(3.2-3.4)). -- That's checked in Sem_Ch6.Analyze_Expression_Function. -- The function must not contain any calls to itself, which -- is checked in Sem_Res.Resolve_Call. -- Each formal must be of mode in and have a static subtype declare Formal : Entity_Id := First_Formal (E); begin while Present (Formal) loop if Ekind (Formal) /= E_In_Parameter then Error_Msg_N ("aspect % requires formals of mode IN", Aspect); return; end if; if not Is_Static_Subtype (Etype (Formal)) then Error_Msg_N ("aspect % requires formals with static subtypes", Aspect); return; end if; Next_Formal (Formal); end loop; end; -- The function's result subtype must be a static subtype if not Is_Static_Subtype (Etype (E)) then Error_Msg_N ("aspect % requires function with result of " & "a static subtype", Aspect); return; end if; -- Check that the function does not have any applicable -- precondition or postcondition expression. for Asp in Pre_Post_Aspects loop if Has_Aspect (E, Asp) then Error_Msg_N ("this aspect not allowed for static expression " & "functions", Find_Aspect (E, Asp)); return; end if; end loop; -- ??? TBD: Must check that "for result type R, if the -- function is a boundary entity for type R (see 7.3.2), -- no type invariant applies to type R; if R has a -- component type C, a similar rule applies to C." end if; -- Preanalyze the expression (if any) when the aspect resides -- in a generic unit. (Is this generic-related code necessary -- for this aspect? It's modeled on what's done for aspect -- Disable_Controlled. ???) if Inside_A_Generic then if Present (Expr) then Preanalyze_And_Resolve (Expr, Any_Boolean); end if; -- Otherwise the aspect resides in a nongeneric context else -- When the expression statically evaluates to True, the -- expression function is treated as a static function. -- Otherwise the aspect appears without an expression and -- defaults to True. if Present (Expr) then Analyze_And_Resolve (Expr, Any_Boolean); -- Error if the boolean expression is not static if not Is_OK_Static_Expression (Expr) then Error_Msg_N ("expression of aspect % must be static", Aspect); end if; end if; end if; end Analyze_Aspect_Static; -------------------------- -- Analyze_Aspect_Yield -- -------------------------- procedure Analyze_Aspect_Yield is Expr_Value : Boolean := False; begin -- Check valid declarations for 'Yield if Nkind (N) in N_Abstract_Subprogram_Declaration | N_Entry_Declaration | N_Generic_Subprogram_Declaration | N_Subprogram_Declaration | N_Formal_Subprogram_Declaration and then not Within_Protected_Type (E) then null; elsif Within_Protected_Type (E) then Error_Msg_N ("aspect% not applicable to protected operations", Id); return; else Error_Msg_N ("aspect% only applicable to subprogram and entry " & "declarations", Id); return; end if; -- Evaluate its static expression (if available); otherwise it -- defaults to True. if No (Expr) then Expr_Value := True; -- Otherwise it must have a static boolean expression else if Inside_A_Generic then Preanalyze_And_Resolve (Expr, Any_Boolean); else Analyze_And_Resolve (Expr, Any_Boolean); end if; if Is_OK_Static_Expression (Expr) then if Is_True (Static_Boolean (Expr)) then Expr_Value := True; end if; else Error_Msg_N ("expression of aspect % must be static", Aspect); end if; end if; if Expr_Value then Set_Has_Yield_Aspect (E); end if; -- If the Yield aspect is specified for a dispatching -- subprogram that inherits the aspect, the specified -- value shall be confirming. if Present (Expr) and then Is_Dispatching_Operation (E) and then Present (Overridden_Operation (E)) and then Has_Yield_Aspect (Overridden_Operation (E)) /= Is_True (Static_Boolean (Expr)) then Error_Msg_N ("specification of inherited aspect% can only " & "confirm parent value", Id); end if; end Analyze_Aspect_Yield; ----------------------- -- Make_Aitem_Pragma -- ----------------------- procedure Make_Aitem_Pragma (Pragma_Argument_Associations : List_Id; Pragma_Name : Name_Id) is Args : List_Id := Pragma_Argument_Associations; begin -- We should never get here if aspect was disabled pragma Assert (not Is_Disabled (Aspect)); -- Certain aspects allow for an optional name or expression. Do -- not generate a pragma with empty argument association list. if No (Args) or else No (Expression (First (Args))) then Args := No_List; end if; -- Build the pragma Aitem := Make_Pragma (Loc, Pragma_Argument_Associations => Args, Pragma_Identifier => Make_Identifier (Sloc (Id), Pragma_Name), Class_Present => Class_Present (Aspect), Split_PPC => Split_PPC (Aspect)); -- Set additional semantic fields if Is_Ignored (Aspect) then Set_Is_Ignored (Aitem); elsif Is_Checked (Aspect) then Set_Is_Checked (Aitem); end if; Set_Corresponding_Aspect (Aitem, Aspect); Set_From_Aspect_Specification (Aitem); end Make_Aitem_Pragma; -- Start of processing for Analyze_One_Aspect begin -- Skip aspect if already analyzed, to avoid looping in some cases if Analyzed (Aspect) then goto Continue; end if; -- Skip looking at aspect if it is totally disabled. Just mark it -- as such for later reference in the tree. This also sets the -- Is_Ignored and Is_Checked flags appropriately. Check_Applicable_Policy (Aspect); if Is_Disabled (Aspect) then goto Continue; end if; -- Set the source location of expression, used in the case of -- a failed precondition/postcondition or invariant. Note that -- the source location of the expression is not usually the best -- choice here. For example, it gets located on the last AND -- keyword in a chain of boolean expressiond AND'ed together. -- It is best to put the message on the first character of the -- assertion, which is the effect of the First_Node call here. if Present (Expr) then Eloc := Sloc (First_Node (Expr)); end if; -- Check restriction No_Implementation_Aspect_Specifications if Implementation_Defined_Aspect (A_Id) then Check_Restriction (No_Implementation_Aspect_Specifications, Aspect); end if; -- Check restriction No_Specification_Of_Aspect Check_Restriction_No_Specification_Of_Aspect (Aspect); -- Mark aspect analyzed (actual analysis is delayed till later) Set_Analyzed (Aspect); Set_Entity (Aspect, E); -- Build the reference to E that will be used in the built pragmas Ent := New_Occurrence_Of (E, Sloc (Id)); if A_Id = Aspect_Attach_Handler or else A_Id = Aspect_Interrupt_Handler then -- Treat the specification as a reference to the protected -- operation, which might otherwise appear unreferenced and -- generate spurious warnings. Generate_Reference (E, Id); end if; -- Check for duplicate aspect. Note that the Comes_From_Source -- test allows duplicate Pre/Post's that we generate internally -- to escape being flagged here. if No_Duplicates_Allowed (A_Id) then Anod := First (L); while Anod /= Aspect loop if Comes_From_Source (Aspect) and then Same_Aspect (A_Id, Get_Aspect_Id (Anod)) then Error_Msg_Name_1 := Nam; Error_Msg_Sloc := Sloc (Anod); -- Case of same aspect specified twice if Class_Present (Anod) = Class_Present (Aspect) then if not Class_Present (Anod) then Error_Msg_NE ("aspect% for & previously given#", Id, E); else Error_Msg_NE ("aspect `%''Class` for & previously given#", Id, E); end if; end if; end if; Next (Anod); end loop; end if; -- Check some general restrictions on language defined aspects if not Implementation_Defined_Aspect (A_Id) or else A_Id = Aspect_Async_Readers or else A_Id = Aspect_Async_Writers or else A_Id = Aspect_Effective_Reads or else A_Id = Aspect_Effective_Reads then Error_Msg_Name_1 := Nam; -- Not allowed for renaming declarations. Examine the original -- node because a subprogram renaming may have been rewritten -- as a body. if Nkind (Original_Node (N)) in N_Renaming_Declaration then Error_Msg_N ("aspect % not allowed for renaming declaration", Aspect); end if; -- Not allowed for formal type declarations in previous -- versions of the language. Allowed for them only for -- shared variable control aspects. if Nkind (N) = N_Formal_Type_Declaration then if Ada_Version < Ada_2020 then Error_Msg_N ("aspect % not allowed for formal type declaration", Aspect); elsif A_Id /= Aspect_Atomic and then A_Id /= Aspect_Volatile and then A_Id /= Aspect_Independent and then A_Id /= Aspect_Atomic_Components and then A_Id /= Aspect_Independent_Components and then A_Id /= Aspect_Volatile_Components and then A_Id /= Aspect_Async_Readers and then A_Id /= Aspect_Async_Writers and then A_Id /= Aspect_Effective_Reads and then A_Id /= Aspect_Effective_Reads then Error_Msg_N ("aspect % not allowed for formal type declaration", Aspect); end if; end if; end if; -- Copy expression for later processing by the procedures -- Check_Aspect_At_[Freeze_Point | End_Of_Declarations] Set_Entity (Id, New_Copy_Tree (Expr)); -- Set Delay_Required as appropriate to aspect case Aspect_Delay (A_Id) is when Always_Delay => Delay_Required := True; when Never_Delay => Delay_Required := False; when Rep_Aspect => -- If expression has the form of an integer literal, then -- do not delay, since we know the value cannot change. -- This optimization catches most rep clause cases. -- For Boolean aspects, don't delay if no expression if A_Id in Boolean_Aspects and then No (Expr) then Delay_Required := False; -- For non-Boolean aspects, don't delay if integer literal elsif A_Id not in Boolean_Aspects and then Present (Expr) and then Nkind (Expr) = N_Integer_Literal then Delay_Required := False; -- For Alignment and various Size aspects, don't delay for -- an attribute reference whose prefix is Standard, for -- example Standard'Maximum_Alignment or Standard'Word_Size. elsif (A_Id = Aspect_Alignment or else A_Id = Aspect_Component_Size or else A_Id = Aspect_Object_Size or else A_Id = Aspect_Size or else A_Id = Aspect_Value_Size) and then Present (Expr) and then Nkind (Expr) = N_Attribute_Reference and then Nkind (Prefix (Expr)) = N_Identifier and then Chars (Prefix (Expr)) = Name_Standard then Delay_Required := False; -- All other cases are delayed else Delay_Required := True; Set_Has_Delayed_Rep_Aspects (E); end if; end case; -- Check 13.1(9.2/5): A representation aspect of a subtype or type -- shall not be specified (whether by a representation item or an -- aspect_specification) before the type is completely defined -- (see 3.11.1). if Is_Representation_Aspect (A_Id) and then Rep_Item_Too_Early (E, N) then goto Continue; end if; -- Processing based on specific aspect case A_Id is when Aspect_Unimplemented => null; -- ??? temp for now -- No_Aspect should be impossible when No_Aspect => raise Program_Error; -- Case 1: Aspects corresponding to attribute definition -- clauses. when Aspect_Address | Aspect_Alignment | Aspect_Bit_Order | Aspect_Component_Size | Aspect_Constant_Indexing | Aspect_Default_Iterator | Aspect_Dispatching_Domain | Aspect_External_Tag | Aspect_Input | Aspect_Iterable | Aspect_Iterator_Element | Aspect_Machine_Radix | Aspect_Object_Size | Aspect_Output | Aspect_Put_Image | Aspect_Read | Aspect_Scalar_Storage_Order | Aspect_Simple_Storage_Pool | Aspect_Size | Aspect_Small | Aspect_Storage_Pool | Aspect_Stream_Size | Aspect_Value_Size | Aspect_Variable_Indexing | Aspect_Write => -- Indexing aspects apply only to tagged type if (A_Id = Aspect_Constant_Indexing or else A_Id = Aspect_Variable_Indexing) and then not (Is_Type (E) and then Is_Tagged_Type (E)) then Error_Msg_N ("indexing aspect can only apply to a tagged type", Aspect); goto Continue; end if; -- For the case of aspect Address, we don't consider that we -- know the entity is never set in the source, since it is -- is likely aliasing is occurring. -- Note: one might think that the analysis of the resulting -- attribute definition clause would take care of that, but -- that's not the case since it won't be from source. if A_Id = Aspect_Address then Set_Never_Set_In_Source (E, False); end if; -- Correctness of the profile of a stream operation is -- verified at the freeze point, but we must detect the -- illegal specification of this aspect for a subtype now, -- to prevent malformed rep_item chains. if A_Id = Aspect_Input or else A_Id = Aspect_Output or else A_Id = Aspect_Read or else A_Id = Aspect_Write then if not Is_First_Subtype (E) then Error_Msg_N ("local name must be a first subtype", Aspect); goto Continue; -- If stream aspect applies to the class-wide type, -- the generated attribute definition applies to the -- class-wide type as well. elsif Class_Present (Aspect) then Ent := Make_Attribute_Reference (Loc, Prefix => Ent, Attribute_Name => Name_Class); end if; end if; -- Construct the attribute_definition_clause. The expression -- in the aspect specification is simply shared with the -- constructed attribute, because it will be fully analyzed -- when the attribute is processed. Aitem := Make_Attribute_Definition_Clause (Loc, Name => Ent, Chars => Chars (Id), Expression => Relocate_Node (Expr)); -- If the address is specified, then we treat the entity as -- referenced, to avoid spurious warnings. This is analogous -- to what is done with an attribute definition clause, but -- here we don't want to generate a reference because this -- is the point of definition of the entity. if A_Id = Aspect_Address then Set_Referenced (E); end if; -- Case 2: Aspects corresponding to pragmas -- Case 2a: Aspects corresponding to pragmas with two -- arguments, where the first argument is a local name -- referring to the entity, and the second argument is the -- aspect definition expression. -- Linker_Section/Suppress/Unsuppress when Aspect_Linker_Section | Aspect_Suppress | Aspect_Unsuppress => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => New_Occurrence_Of (E, Loc)), Make_Pragma_Argument_Association (Sloc (Expr), Expression => Relocate_Node (Expr))), Pragma_Name => Chars (Id)); -- Linker_Section does not need delaying, as its argument -- must be a static string. Furthermore, if applied to -- an object with an explicit initialization, the object -- must be frozen in order to elaborate the initialization -- code. (This is already done for types with implicit -- initialization, such as protected types.) if A_Id = Aspect_Linker_Section and then Nkind (N) = N_Object_Declaration and then Has_Init_Expression (N) then Delay_Required := False; end if; -- Synchronization -- Corresponds to pragma Implemented, construct the pragma when Aspect_Synchronization => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => New_Occurrence_Of (E, Loc)), Make_Pragma_Argument_Association (Sloc (Expr), Expression => Relocate_Node (Expr))), Pragma_Name => Name_Implemented); -- Attach_Handler when Aspect_Attach_Handler => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Sloc (Ent), Expression => Ent), Make_Pragma_Argument_Association (Sloc (Expr), Expression => Relocate_Node (Expr))), Pragma_Name => Name_Attach_Handler); -- We need to insert this pragma into the tree to get proper -- processing and to look valid from a placement viewpoint. Insert_Pragma (Aitem); goto Continue; -- Dynamic_Predicate, Predicate, Static_Predicate when Aspect_Dynamic_Predicate | Aspect_Predicate | Aspect_Static_Predicate => -- These aspects apply only to subtypes if not Is_Type (E) then Error_Msg_N ("predicate can only be specified for a subtype", Aspect); goto Continue; elsif Is_Incomplete_Type (E) then Error_Msg_N ("predicate cannot apply to incomplete view", Aspect); elsif Is_Generic_Type (E) then Error_Msg_N ("predicate cannot apply to formal type", Aspect); goto Continue; end if; -- Construct the pragma (always a pragma Predicate, with -- flags recording whether it is static/dynamic). We also -- set flags recording this in the type itself. Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Sloc (Ent), Expression => Ent), Make_Pragma_Argument_Association (Sloc (Expr), Expression => Relocate_Node (Expr))), Pragma_Name => Name_Predicate); -- Mark type has predicates, and remember what kind of -- aspect lead to this predicate (we need this to access -- the right set of check policies later on). Set_Has_Predicates (E); if A_Id = Aspect_Dynamic_Predicate then Set_Has_Dynamic_Predicate_Aspect (E); -- If the entity has a dynamic predicate, any inherited -- static predicate becomes dynamic as well, and the -- predicate function includes the conjunction of both. Set_Has_Static_Predicate_Aspect (E, False); elsif A_Id = Aspect_Static_Predicate then Set_Has_Static_Predicate_Aspect (E); end if; -- If the type is private, indicate that its completion -- has a freeze node, because that is the one that will -- be visible at freeze time. if Is_Private_Type (E) and then Present (Full_View (E)) then Set_Has_Predicates (Full_View (E)); if A_Id = Aspect_Dynamic_Predicate then Set_Has_Dynamic_Predicate_Aspect (Full_View (E)); elsif A_Id = Aspect_Static_Predicate then Set_Has_Static_Predicate_Aspect (Full_View (E)); end if; Set_Has_Delayed_Aspects (Full_View (E)); Ensure_Freeze_Node (Full_View (E)); -- If there is an Underlying_Full_View, also create a -- freeze node for that one. if Is_Private_Type (Full_View (E)) then declare U_Full : constant Entity_Id := Underlying_Full_View (Full_View (E)); begin if Present (U_Full) then Set_Has_Delayed_Aspects (U_Full); Ensure_Freeze_Node (U_Full); end if; end; end if; end if; -- Predicate_Failure when Aspect_Predicate_Failure => -- This aspect applies only to subtypes if not Is_Type (E) then Error_Msg_N ("predicate can only be specified for a subtype", Aspect); goto Continue; elsif Is_Incomplete_Type (E) then Error_Msg_N ("predicate cannot apply to incomplete view", Aspect); goto Continue; elsif not Has_Predicates (E) then Error_Msg_N ("Predicate_Failure requires previous predicate" & " specification", Aspect); goto Continue; end if; -- Construct the pragma Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Sloc (Ent), Expression => Ent), Make_Pragma_Argument_Association (Sloc (Expr), Expression => Relocate_Node (Expr))), Pragma_Name => Name_Predicate_Failure); -- Case 2b: Aspects corresponding to pragmas with two -- arguments, where the second argument is a local name -- referring to the entity, and the first argument is the -- aspect definition expression. -- Convention when Aspect_Convention => Analyze_Aspect_Convention; goto Continue; -- External_Name, Link_Name when Aspect_External_Name | Aspect_Link_Name => Analyze_Aspect_External_Link_Name; goto Continue; -- CPU, Interrupt_Priority, Priority -- These three aspects can be specified for a subprogram spec -- or body, in which case we analyze the expression and export -- the value of the aspect. -- Previously, we generated an equivalent pragma for bodies -- (note that the specs cannot contain these pragmas). The -- pragma was inserted ahead of local declarations, rather than -- after the body. This leads to a certain duplication between -- the processing performed for the aspect and the pragma, but -- given the straightforward handling required it is simpler -- to duplicate than to translate the aspect in the spec into -- a pragma in the declarative part of the body. when Aspect_CPU | Aspect_Interrupt_Priority | Aspect_Priority => if Nkind (N) in N_Subprogram_Body | N_Subprogram_Declaration then -- Analyze the aspect expression Analyze_And_Resolve (Expr, Standard_Integer); -- Interrupt_Priority aspect not allowed for main -- subprograms. RM D.1 does not forbid this explicitly, -- but RM J.15.11(6/3) does not permit pragma -- Interrupt_Priority for subprograms. if A_Id = Aspect_Interrupt_Priority then Error_Msg_N ("Interrupt_Priority aspect cannot apply to " & "subprogram", Expr); -- The expression must be static elsif not Is_OK_Static_Expression (Expr) then Flag_Non_Static_Expr ("aspect requires static expression!", Expr); -- Check whether this is the main subprogram. Issue a -- warning only if it is obviously not a main program -- (when it has parameters or when the subprogram is -- within a package). elsif Present (Parameter_Specifications (Specification (N))) or else not Is_Compilation_Unit (Defining_Entity (N)) then -- See RM D.1(14/3) and D.16(12/3) Error_Msg_N ("aspect applied to subprogram other than the " & "main subprogram has no effect??", Expr); -- Otherwise check in range and export the value -- For the CPU aspect elsif A_Id = Aspect_CPU then if Is_In_Range (Expr, RTE (RE_CPU_Range)) then -- Value is correct so we export the value to make -- it available at execution time. Set_Main_CPU (Main_Unit, UI_To_Int (Expr_Value (Expr))); else Error_Msg_N ("main subprogram CPU is out of range", Expr); end if; -- For the Priority aspect elsif A_Id = Aspect_Priority then if Is_In_Range (Expr, RTE (RE_Priority)) then -- Value is correct so we export the value to make -- it available at execution time. Set_Main_Priority (Main_Unit, UI_To_Int (Expr_Value (Expr))); -- Ignore pragma if Relaxed_RM_Semantics to support -- other targets/non GNAT compilers. elsif not Relaxed_RM_Semantics then Error_Msg_N ("main subprogram priority is out of range", Expr); end if; end if; -- Load an arbitrary entity from System.Tasking.Stages -- or System.Tasking.Restricted.Stages (depending on -- the supported profile) to make sure that one of these -- packages is implicitly with'ed, since we need to have -- the tasking run time active for the pragma Priority to -- have any effect. Previously we with'ed the package -- System.Tasking, but this package does not trigger the -- required initialization of the run-time library. declare Discard : Entity_Id; begin if Restricted_Profile then Discard := RTE (RE_Activate_Restricted_Tasks); else Discard := RTE (RE_Activate_Tasks); end if; end; -- Handling for these aspects in subprograms is complete goto Continue; -- For task and protected types pass the aspect as an -- attribute. else Aitem := Make_Attribute_Definition_Clause (Loc, Name => Ent, Chars => Chars (Id), Expression => Relocate_Node (Expr)); end if; -- Warnings when Aspect_Warnings => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Sloc (Expr), Expression => Relocate_Node (Expr)), Make_Pragma_Argument_Association (Loc, Expression => New_Occurrence_Of (E, Loc))), Pragma_Name => Chars (Id)); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Case 2c: Aspects corresponding to pragmas with three -- arguments. -- Invariant aspects have a first argument that references the -- entity, a second argument that is the expression and a third -- argument that is an appropriate message. -- Invariant, Type_Invariant when Aspect_Invariant | Aspect_Type_Invariant => -- Analysis of the pragma will verify placement legality: -- an invariant must apply to a private type, or appear in -- the private part of a spec and apply to a completion. Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Sloc (Ent), Expression => Ent), Make_Pragma_Argument_Association (Sloc (Expr), Expression => Relocate_Node (Expr))), Pragma_Name => Name_Invariant); -- Add message unless exception messages are suppressed if not Opt.Exception_Locations_Suppressed then Append_To (Pragma_Argument_Associations (Aitem), Make_Pragma_Argument_Association (Eloc, Chars => Name_Message, Expression => Make_String_Literal (Eloc, Strval => "failed invariant from " & Build_Location_String (Eloc)))); end if; -- For Invariant case, insert immediately after the entity -- declaration. We do not have to worry about delay issues -- since the pragma processing takes care of this. Delay_Required := False; -- Case 2d : Aspects that correspond to a pragma with one -- argument. -- Abstract_State -- Aspect Abstract_State introduces implicit declarations for -- all state abstraction entities it defines. To emulate this -- behavior, insert the pragma at the beginning of the visible -- declarations of the related package so that it is analyzed -- immediately. when Aspect_Abstract_State => Abstract_State : declare Context : Node_Id := N; begin -- When aspect Abstract_State appears on a generic package, -- it is propageted to the package instance. The context in -- this case is the instance spec. if Nkind (Context) = N_Package_Instantiation then Context := Instance_Spec (Context); end if; if Nkind (Context) in N_Generic_Package_Declaration | N_Package_Declaration then Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Abstract_State); Decorate (Aspect, Aitem); Insert_Pragma (Prag => Aitem, Is_Instance => Is_Generic_Instance (Defining_Entity (Context))); else Error_Msg_NE ("aspect & must apply to a package declaration", Aspect, Id); end if; goto Continue; end Abstract_State; -- Aspect Async_Readers is never delayed because it is -- equivalent to a source pragma which appears after the -- related object declaration. when Aspect_Async_Readers => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Async_Readers); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Aspect Async_Writers is never delayed because it is -- equivalent to a source pragma which appears after the -- related object declaration. when Aspect_Async_Writers => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Async_Writers); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Aspect Constant_After_Elaboration is never delayed because -- it is equivalent to a source pragma which appears after the -- related object declaration. when Aspect_Constant_After_Elaboration => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Constant_After_Elaboration); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Aspect Default_Internal_Condition is never delayed because -- it is equivalent to a source pragma which appears after the -- related private type. To deal with forward references, the -- generated pragma is stored in the rep chain of the related -- private type as types do not carry contracts. The pragma is -- wrapped inside of a procedure at the freeze point of the -- private type's full view. when Aspect_Default_Initial_Condition => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Default_Initial_Condition); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Default_Storage_Pool when Aspect_Default_Storage_Pool => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Default_Storage_Pool); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Depends -- Aspect Depends is never delayed because it is equivalent to -- a source pragma which appears after the related subprogram. -- To deal with forward references, the generated pragma is -- stored in the contract of the related subprogram and later -- analyzed at the end of the declarative region. See routine -- Analyze_Depends_In_Decl_Part for details. when Aspect_Depends => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Depends); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Aspect Effective_Reads is never delayed because it is -- equivalent to a source pragma which appears after the -- related object declaration. when Aspect_Effective_Reads => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Effective_Reads); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Aspect Effective_Writes is never delayed because it is -- equivalent to a source pragma which appears after the -- related object declaration. when Aspect_Effective_Writes => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Effective_Writes); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Aspect Extensions_Visible is never delayed because it is -- equivalent to a source pragma which appears after the -- related subprogram. when Aspect_Extensions_Visible => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Extensions_Visible); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Aspect Ghost is never delayed because it is equivalent to a -- source pragma which appears at the top of [generic] package -- declarations or after an object, a [generic] subprogram, or -- a type declaration. when Aspect_Ghost => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Ghost); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Global -- Aspect Global is never delayed because it is equivalent to -- a source pragma which appears after the related subprogram. -- To deal with forward references, the generated pragma is -- stored in the contract of the related subprogram and later -- analyzed at the end of the declarative region. See routine -- Analyze_Global_In_Decl_Part for details. when Aspect_Global => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Global); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Initial_Condition -- Aspect Initial_Condition is never delayed because it is -- equivalent to a source pragma which appears after the -- related package. To deal with forward references, the -- generated pragma is stored in the contract of the related -- package and later analyzed at the end of the declarative -- region. See routine Analyze_Initial_Condition_In_Decl_Part -- for details. when Aspect_Initial_Condition => Initial_Condition : declare Context : Node_Id := N; begin -- When aspect Initial_Condition appears on a generic -- package, it is propageted to the package instance. The -- context in this case is the instance spec. if Nkind (Context) = N_Package_Instantiation then Context := Instance_Spec (Context); end if; if Nkind (Context) in N_Generic_Package_Declaration | N_Package_Declaration then Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Initial_Condition); Decorate (Aspect, Aitem); Insert_Pragma (Prag => Aitem, Is_Instance => Is_Generic_Instance (Defining_Entity (Context))); -- Otherwise the context is illegal else Error_Msg_NE ("aspect & must apply to a package declaration", Aspect, Id); end if; goto Continue; end Initial_Condition; -- Initializes -- Aspect Initializes is never delayed because it is equivalent -- to a source pragma appearing after the related package. To -- deal with forward references, the generated pragma is stored -- in the contract of the related package and later analyzed at -- the end of the declarative region. For details, see routine -- Analyze_Initializes_In_Decl_Part. when Aspect_Initializes => Initializes : declare Context : Node_Id := N; begin -- When aspect Initializes appears on a generic package, -- it is propageted to the package instance. The context -- in this case is the instance spec. if Nkind (Context) = N_Package_Instantiation then Context := Instance_Spec (Context); end if; if Nkind (Context) in N_Generic_Package_Declaration | N_Package_Declaration then Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Initializes); Decorate (Aspect, Aitem); Insert_Pragma (Prag => Aitem, Is_Instance => Is_Generic_Instance (Defining_Entity (Context))); -- Otherwise the context is illegal else Error_Msg_NE ("aspect & must apply to a package declaration", Aspect, Id); end if; goto Continue; end Initializes; -- Max_Entry_Queue_Depth when Aspect_Max_Entry_Queue_Depth => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Max_Entry_Queue_Depth); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Max_Entry_Queue_Length when Aspect_Max_Entry_Queue_Length => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Max_Entry_Queue_Length); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Max_Queue_Length when Aspect_Max_Queue_Length => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Max_Queue_Length); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Aspect No_Caching is never delayed because it is equivalent -- to a source pragma which appears after the related object -- declaration. when Aspect_No_Caching => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_No_Caching); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Obsolescent when Aspect_Obsolescent => declare Args : List_Id; begin if No (Expr) then Args := No_List; else Args := New_List ( Make_Pragma_Argument_Association (Sloc (Expr), Expression => Relocate_Node (Expr))); end if; Make_Aitem_Pragma (Pragma_Argument_Associations => Args, Pragma_Name => Chars (Id)); end; -- Part_Of when Aspect_Part_Of => if Nkind (N) in N_Object_Declaration | N_Package_Instantiation or else Is_Single_Concurrent_Type_Declaration (N) then Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Part_Of); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); else Error_Msg_NE ("aspect & must apply to package instantiation, " & "object, single protected type or single task type", Aspect, Id); end if; goto Continue; -- SPARK_Mode when Aspect_SPARK_Mode => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_SPARK_Mode); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Refined_Depends -- Aspect Refined_Depends is never delayed because it is -- equivalent to a source pragma which appears in the -- declarations of the related subprogram body. To deal with -- forward references, the generated pragma is stored in the -- contract of the related subprogram body and later analyzed -- at the end of the declarative region. For details, see -- routine Analyze_Refined_Depends_In_Decl_Part. when Aspect_Refined_Depends => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Refined_Depends); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Refined_Global -- Aspect Refined_Global is never delayed because it is -- equivalent to a source pragma which appears in the -- declarations of the related subprogram body. To deal with -- forward references, the generated pragma is stored in the -- contract of the related subprogram body and later analyzed -- at the end of the declarative region. For details, see -- routine Analyze_Refined_Global_In_Decl_Part. when Aspect_Refined_Global => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Refined_Global); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Refined_Post when Aspect_Refined_Post => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Refined_Post); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Refined_State when Aspect_Refined_State => -- The corresponding pragma for Refined_State is inserted in -- the declarations of the related package body. This action -- synchronizes both the source and from-aspect versions of -- the pragma. if Nkind (N) = N_Package_Body then Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Refined_State); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); -- Otherwise the context is illegal else Error_Msg_NE ("aspect & must apply to a package body", Aspect, Id); end if; goto Continue; -- Relative_Deadline when Aspect_Relative_Deadline => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Relative_Deadline); -- If the aspect applies to a task, the corresponding pragma -- must appear within its declarations, not after. if Nkind (N) = N_Task_Type_Declaration then declare Def : Node_Id; V : List_Id; begin if No (Task_Definition (N)) then Set_Task_Definition (N, Make_Task_Definition (Loc, Visible_Declarations => New_List, End_Label => Empty)); end if; Def := Task_Definition (N); V := Visible_Declarations (Def); if not Is_Empty_List (V) then Insert_Before (First (V), Aitem); else Set_Visible_Declarations (Def, New_List (Aitem)); end if; goto Continue; end; end if; -- Relaxed_Initialization when Aspect_Relaxed_Initialization => Analyze_Aspect_Relaxed_Initialization; goto Continue; -- Secondary_Stack_Size -- Aspect Secondary_Stack_Size needs to be converted into a -- pragma for two reasons: the attribute is not analyzed until -- after the expansion of the task type declaration and the -- attribute does not have visibility on the discriminant. when Aspect_Secondary_Stack_Size => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Secondary_Stack_Size); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Volatile_Function -- Aspect Volatile_Function is never delayed because it is -- equivalent to a source pragma which appears after the -- related subprogram. when Aspect_Volatile_Function => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Volatile_Function); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Case 2e: Annotate aspect when Aspect_Annotate => declare Args : List_Id; Pargs : List_Id; Arg : Node_Id; begin -- The argument can be a single identifier if Nkind (Expr) = N_Identifier then -- One level of parens is allowed if Paren_Count (Expr) > 1 then Error_Msg_F ("extra parentheses ignored", Expr); end if; Set_Paren_Count (Expr, 0); -- Add the single item to the list Args := New_List (Expr); -- Otherwise we must have an aggregate elsif Nkind (Expr) = N_Aggregate then -- Must be positional if Present (Component_Associations (Expr)) then Error_Msg_F ("purely positional aggregate required", Expr); goto Continue; end if; -- Must not be parenthesized if Paren_Count (Expr) /= 0 then Error_Msg_F ("extra parentheses ignored", Expr); end if; -- List of arguments is list of aggregate expressions Args := Expressions (Expr); -- Anything else is illegal else Error_Msg_F ("wrong form for Annotate aspect", Expr); goto Continue; end if; -- Prepare pragma arguments Pargs := New_List; Arg := First (Args); while Present (Arg) loop Append_To (Pargs, Make_Pragma_Argument_Association (Sloc (Arg), Expression => Relocate_Node (Arg))); Next (Arg); end loop; Append_To (Pargs, Make_Pragma_Argument_Association (Sloc (Ent), Chars => Name_Entity, Expression => Ent)); Make_Aitem_Pragma (Pragma_Argument_Associations => Pargs, Pragma_Name => Name_Annotate); end; -- Case 3 : Aspects that don't correspond to pragma/attribute -- definition clause. -- Case 3a: The aspects listed below don't correspond to -- pragmas/attributes but do require delayed analysis. when Aspect_Default_Value | Aspect_Default_Component_Value => Error_Msg_Name_1 := Chars (Id); if not Is_Type (E) then Error_Msg_N ("aspect% can only apply to a type", Id); goto Continue; elsif not Is_First_Subtype (E) then Error_Msg_N ("aspect% cannot apply to subtype", Id); goto Continue; elsif A_Id = Aspect_Default_Value and then not Is_Scalar_Type (E) then Error_Msg_N ("aspect% can only be applied to scalar type", Id); goto Continue; elsif A_Id = Aspect_Default_Component_Value then if not Is_Array_Type (E) then Error_Msg_N ("aspect% can only be applied to array " & "type", Id); goto Continue; elsif not Is_Scalar_Type (Component_Type (E)) then Error_Msg_N ("aspect% requires scalar components", Id); goto Continue; end if; end if; Aitem := Empty; when Aspect_Aggregate => Validate_Aspect_Aggregate (Expr); Record_Rep_Item (E, Aspect); return; when Aspect_Integer_Literal | Aspect_Real_Literal | Aspect_String_Literal => if not Is_First_Subtype (E) then Error_Msg_N ("may only be specified for a first subtype", Aspect); goto Continue; end if; if Ada_Version < Ada_2020 then Check_Restriction (No_Implementation_Aspect_Specifications, N); end if; Aitem := Empty; -- Case 3b: The aspects listed below don't correspond to -- pragmas/attributes and don't need delayed analysis. -- Implicit_Dereference -- For Implicit_Dereference, External_Name and Link_Name, only -- the legality checks are done during the analysis, thus no -- delay is required. when Aspect_Implicit_Dereference => Analyze_Aspect_Implicit_Dereference; goto Continue; -- Dimension when Aspect_Dimension => Analyze_Aspect_Dimension (N, Id, Expr); goto Continue; -- Dimension_System when Aspect_Dimension_System => Analyze_Aspect_Dimension_System (N, Id, Expr); goto Continue; -- Case 4: Aspects requiring special handling -- Pre/Post/Test_Case/Contract_Cases/Subprogram_Variant whose -- corresponding pragmas take care of the delay. -- Pre/Post -- Aspects Pre/Post generate Precondition/Postcondition pragmas -- with a first argument that is the expression, and a second -- argument that is an informative message if the test fails. -- This is inserted right after the declaration, to get the -- required pragma placement. The processing for the pragmas -- takes care of the required delay. when Pre_Post_Aspects => Pre_Post : declare Pname : Name_Id; begin if A_Id = Aspect_Pre or else A_Id = Aspect_Precondition then Pname := Name_Precondition; else Pname := Name_Postcondition; end if; -- Check that the class-wide predicate cannot be applied to -- an operation of a synchronized type. AI12-0182 forbids -- these altogether, while earlier language semantics made -- them legal on tagged synchronized types. -- Other legality checks are performed when analyzing the -- contract of the operation. if Class_Present (Aspect) and then Is_Concurrent_Type (Current_Scope) and then Ekind (E) in E_Entry | E_Function | E_Procedure then Error_Msg_Name_1 := Original_Aspect_Pragma_Name (Aspect); Error_Msg_N ("aspect % can only be specified for a primitive " & "operation of a tagged type", Aspect); goto Continue; end if; -- If the expressions is of the form A and then B, then -- we generate separate Pre/Post aspects for the separate -- clauses. Since we allow multiple pragmas, there is no -- problem in allowing multiple Pre/Post aspects internally. -- These should be treated in reverse order (B first and -- A second) since they are later inserted just after N in -- the order they are treated. This way, the pragma for A -- ends up preceding the pragma for B, which may have an -- importance for the error raised (either constraint error -- or precondition error). -- We do not do this for Pre'Class, since we have to put -- these conditions together in a complex OR expression. -- We don't do this in GNATprove mode, because it brings no -- benefit for proof and causes annoyance for flow analysis, -- which prefers to be as close to the original source code -- as possible. Also we don't do this when analyzing generic -- units since it causes spurious visibility errors in the -- preanalysis of instantiations. if not GNATprove_Mode and then (Pname = Name_Postcondition or else not Class_Present (Aspect)) and then not Inside_A_Generic then while Nkind (Expr) = N_And_Then loop Insert_After (Aspect, Make_Aspect_Specification (Sloc (Left_Opnd (Expr)), Identifier => Identifier (Aspect), Expression => Relocate_Node (Left_Opnd (Expr)), Class_Present => Class_Present (Aspect), Split_PPC => True)); Rewrite (Expr, Relocate_Node (Right_Opnd (Expr))); Eloc := Sloc (Expr); end loop; end if; -- Build the precondition/postcondition pragma -- We use Relocate_Node here rather than New_Copy_Tree -- because subsequent visibility analysis of the aspect -- depends on this sharing. This should be cleaned up??? -- If the context is generic, we want to preserve the -- original tree, and simply share it between aspect and -- generated attribute. This parallels what is done in -- sem_prag.adb (see Get_Argument). declare New_Expr : Node_Id; begin if Inside_A_Generic then New_Expr := Expr; else New_Expr := Relocate_Node (Expr); end if; Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Eloc, Chars => Name_Check, Expression => New_Expr)), Pragma_Name => Pname); end; -- Add message unless exception messages are suppressed if not Opt.Exception_Locations_Suppressed then Append_To (Pragma_Argument_Associations (Aitem), Make_Pragma_Argument_Association (Eloc, Chars => Name_Message, Expression => Make_String_Literal (Eloc, Strval => "failed " & Get_Name_String (Pname) & " from " & Build_Location_String (Eloc)))); end if; Set_Is_Delayed_Aspect (Aspect); -- For Pre/Post cases, insert immediately after the entity -- declaration, since that is the required pragma placement. -- Note that for these aspects, we do not have to worry -- about delay issues, since the pragmas themselves deal -- with delay of visibility for the expression analysis. Insert_Pragma (Aitem); goto Continue; end Pre_Post; -- Test_Case when Aspect_Test_Case => Test_Case : declare Args : List_Id; Comp_Expr : Node_Id; Comp_Assn : Node_Id; begin Args := New_List; if Nkind (Parent (N)) = N_Compilation_Unit then Error_Msg_Name_1 := Nam; Error_Msg_N ("incorrect placement of aspect `%`", E); goto Continue; end if; if Nkind (Expr) /= N_Aggregate then Error_Msg_Name_1 := Nam; Error_Msg_NE ("wrong syntax for aspect `%` for &", Id, E); goto Continue; end if; -- Create the list of arguments for building the Test_Case -- pragma. Comp_Expr := First (Expressions (Expr)); while Present (Comp_Expr) loop Append_To (Args, Make_Pragma_Argument_Association (Sloc (Comp_Expr), Expression => Relocate_Node (Comp_Expr))); Next (Comp_Expr); end loop; Comp_Assn := First (Component_Associations (Expr)); while Present (Comp_Assn) loop if List_Length (Choices (Comp_Assn)) /= 1 or else Nkind (First (Choices (Comp_Assn))) /= N_Identifier then Error_Msg_Name_1 := Nam; Error_Msg_NE ("wrong syntax for aspect `%` for &", Id, E); goto Continue; end if; Append_To (Args, Make_Pragma_Argument_Association (Sloc (Comp_Assn), Chars => Chars (First (Choices (Comp_Assn))), Expression => Relocate_Node (Expression (Comp_Assn)))); Next (Comp_Assn); end loop; -- Build the test-case pragma Make_Aitem_Pragma (Pragma_Argument_Associations => Args, Pragma_Name => Nam); end Test_Case; -- Contract_Cases when Aspect_Contract_Cases => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Nam); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Subprogram_Variant when Aspect_Subprogram_Variant => Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Nam); Decorate (Aspect, Aitem); Insert_Pragma (Aitem); goto Continue; -- Case 5: Special handling for aspects with an optional -- boolean argument. -- In the delayed case, the corresponding pragma cannot be -- generated yet because the evaluation of the boolean needs -- to be delayed till the freeze point. when Boolean_Aspects | Library_Unit_Aspects => Set_Is_Boolean_Aspect (Aspect); -- Lock_Free aspect only apply to protected objects if A_Id = Aspect_Lock_Free then if Ekind (E) /= E_Protected_Type then Error_Msg_Name_1 := Nam; Error_Msg_N ("aspect % only applies to a protected type " & "or object", Aspect); else -- Set the Uses_Lock_Free flag to True if there is no -- expression or if the expression is True. The -- evaluation of this aspect should be delayed to the -- freeze point if we wanted to handle the corner case -- of "true" or "false" being redefined. if No (Expr) or else Is_True (Static_Boolean (Expr)) then Set_Uses_Lock_Free (E); end if; Record_Rep_Item (E, Aspect); end if; goto Continue; elsif A_Id = Aspect_Export or else A_Id = Aspect_Import then Analyze_Aspect_Export_Import; -- Disable_Controlled elsif A_Id = Aspect_Disable_Controlled then Analyze_Aspect_Disable_Controlled; goto Continue; -- Ada 202x (AI12-0129): Exclusive_Functions elsif A_Id = Aspect_Exclusive_Functions then if Ekind (E) /= E_Protected_Type then Error_Msg_Name_1 := Nam; Error_Msg_N ("aspect % only applies to a protected type " & "or object", Aspect); end if; goto Continue; -- Ada 202x (AI12-0075): static expression functions elsif A_Id = Aspect_Static then Analyze_Aspect_Static; goto Continue; -- Ada 2020 (AI12-0279) elsif A_Id = Aspect_Yield then Analyze_Aspect_Yield; goto Continue; end if; -- Library unit aspects require special handling in the case -- of a package declaration, the pragma needs to be inserted -- in the list of declarations for the associated package. -- There is no issue of visibility delay for these aspects. if A_Id in Library_Unit_Aspects and then Nkind (N) in N_Package_Declaration | N_Generic_Package_Declaration and then Nkind (Parent (N)) /= N_Compilation_Unit -- Aspect is legal on a local instantiation of a library- -- level generic unit. and then not Is_Generic_Instance (Defining_Entity (N)) then Error_Msg_N ("incorrect context for library unit aspect&", Id); goto Continue; end if; -- Cases where we do not delay, includes all cases where the -- expression is missing other than the above cases. if not Delay_Required or else No (Expr) then -- Exclude aspects Export and Import because their pragma -- syntax does not map directly to a Boolean aspect. if A_Id /= Aspect_Export and then A_Id /= Aspect_Import then Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Sloc (Ent), Expression => Ent)), Pragma_Name => Chars (Id)); end if; Delay_Required := False; -- In general cases, the corresponding pragma/attribute -- definition clause will be inserted later at the freezing -- point, and we do not need to build it now. else Aitem := Empty; end if; -- Storage_Size -- This is special because for access types we need to generate -- an attribute definition clause. This also works for single -- task declarations, but it does not work for task type -- declarations, because we have the case where the expression -- references a discriminant of the task type. That can't use -- an attribute definition clause because we would not have -- visibility on the discriminant. For that case we must -- generate a pragma in the task definition. when Aspect_Storage_Size => -- Task type case if Ekind (E) = E_Task_Type then declare Decl : constant Node_Id := Declaration_Node (E); begin pragma Assert (Nkind (Decl) = N_Task_Type_Declaration); -- If no task definition, create one if No (Task_Definition (Decl)) then Set_Task_Definition (Decl, Make_Task_Definition (Loc, Visible_Declarations => Empty_List, End_Label => Empty)); end if; -- Create a pragma and put it at the start of the task -- definition for the task type declaration. Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Expression => Relocate_Node (Expr))), Pragma_Name => Name_Storage_Size); Prepend (Aitem, Visible_Declarations (Task_Definition (Decl))); goto Continue; end; -- All other cases, generate attribute definition else Aitem := Make_Attribute_Definition_Clause (Loc, Name => Ent, Chars => Chars (Id), Expression => Relocate_Node (Expr)); end if; end case; -- Attach the corresponding pragma/attribute definition clause to -- the aspect specification node. if Present (Aitem) then Set_From_Aspect_Specification (Aitem); end if; -- For an aspect that applies to a type, indicate whether it -- appears on a partial view of the type. if Is_Type (E) and then Is_Private_Type (E) then Set_Aspect_On_Partial_View (Aspect); end if; -- In the context of a compilation unit, we directly put the -- pragma in the Pragmas_After list of the N_Compilation_Unit_Aux -- node (no delay is required here) except for aspects on a -- subprogram body (see below) and a generic package, for which we -- need to introduce the pragma before building the generic copy -- (see sem_ch12), and for package instantiations, where the -- library unit pragmas are better handled early. if Nkind (Parent (N)) = N_Compilation_Unit and then (Present (Aitem) or else Is_Boolean_Aspect (Aspect)) then declare Aux : constant Node_Id := Aux_Decls_Node (Parent (N)); begin pragma Assert (Nkind (Aux) = N_Compilation_Unit_Aux); -- For a Boolean aspect, create the corresponding pragma if -- no expression or if the value is True. if Is_Boolean_Aspect (Aspect) and then No (Aitem) then if Is_True (Static_Boolean (Expr)) then Make_Aitem_Pragma (Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Sloc (Ent), Expression => Ent)), Pragma_Name => Chars (Id)); Set_From_Aspect_Specification (Aitem, True); Set_Corresponding_Aspect (Aitem, Aspect); else goto Continue; end if; end if; -- If the aspect is on a subprogram body (relevant aspect -- is Inline), add the pragma in front of the declarations. if Nkind (N) = N_Subprogram_Body then if No (Declarations (N)) then Set_Declarations (N, New_List); end if; Prepend (Aitem, Declarations (N)); elsif Nkind (N) = N_Generic_Package_Declaration then if No (Visible_Declarations (Specification (N))) then Set_Visible_Declarations (Specification (N), New_List); end if; Prepend (Aitem, Visible_Declarations (Specification (N))); elsif Nkind (N) = N_Package_Instantiation then declare Spec : constant Node_Id := Specification (Instance_Spec (N)); begin if No (Visible_Declarations (Spec)) then Set_Visible_Declarations (Spec, New_List); end if; Prepend (Aitem, Visible_Declarations (Spec)); end; else if No (Pragmas_After (Aux)) then Set_Pragmas_After (Aux, New_List); end if; Append (Aitem, Pragmas_After (Aux)); end if; goto Continue; end; end if; -- The evaluation of the aspect is delayed to the freezing point. -- The pragma or attribute clause if there is one is then attached -- to the aspect specification which is put in the rep item list. if Delay_Required then if Present (Aitem) then Set_Is_Delayed_Aspect (Aitem); Set_Aspect_Rep_Item (Aspect, Aitem); Set_Parent (Aitem, Aspect); end if; Set_Is_Delayed_Aspect (Aspect); -- In the case of Default_Value, link the aspect to base type -- as well, even though it appears on a first subtype. This is -- mandated by the semantics of the aspect. Do not establish -- the link when processing the base type itself as this leads -- to a rep item circularity. if A_Id = Aspect_Default_Value and then Base_Type (E) /= E then Set_Has_Delayed_Aspects (Base_Type (E)); Record_Rep_Item (Base_Type (E), Aspect); end if; Set_Has_Delayed_Aspects (E); Record_Rep_Item (E, Aspect); -- When delay is not required and the context is a package or a -- subprogram body, insert the pragma in the body declarations. elsif Nkind (N) in N_Package_Body | N_Subprogram_Body then if No (Declarations (N)) then Set_Declarations (N, New_List); end if; -- The pragma is added before source declarations Prepend_To (Declarations (N), Aitem); -- When delay is not required and the context is not a compilation -- unit, we simply insert the pragma/attribute definition clause -- in sequence. elsif Present (Aitem) then Insert_After (Ins_Node, Aitem); Ins_Node := Aitem; end if; end Analyze_One_Aspect; <<Continue>> Next (Aspect); end loop Aspect_Loop; if Has_Delayed_Aspects (E) then Ensure_Freeze_Node (E); end if; end Analyze_Aspect_Specifications; ------------------------------------------------ -- Analyze_Aspects_On_Subprogram_Body_Or_Stub -- ------------------------------------------------ procedure Analyze_Aspects_On_Subprogram_Body_Or_Stub (N : Node_Id) is Body_Id : constant Entity_Id := Defining_Entity (N); procedure Diagnose_Misplaced_Aspects (Spec_Id : Entity_Id); -- Body [stub] N has aspects, but they are not properly placed. Emit an -- error message depending on the aspects involved. Spec_Id denotes the -- entity of the corresponding spec. -------------------------------- -- Diagnose_Misplaced_Aspects -- -------------------------------- procedure Diagnose_Misplaced_Aspects (Spec_Id : Entity_Id) is procedure Misplaced_Aspect_Error (Asp : Node_Id; Ref_Nam : Name_Id); -- Emit an error message concerning misplaced aspect Asp. Ref_Nam is -- the name of the refined version of the aspect. ---------------------------- -- Misplaced_Aspect_Error -- ---------------------------- procedure Misplaced_Aspect_Error (Asp : Node_Id; Ref_Nam : Name_Id) is Asp_Nam : constant Name_Id := Chars (Identifier (Asp)); Asp_Id : constant Aspect_Id := Get_Aspect_Id (Asp_Nam); begin -- The corresponding spec already contains the aspect in question -- and the one appearing on the body must be the refined form: -- procedure P with Global ...; -- procedure P with Global ... is ... end P; -- ^ -- Refined_Global if Has_Aspect (Spec_Id, Asp_Id) then Error_Msg_Name_1 := Asp_Nam; -- Subunits cannot carry aspects that apply to a subprogram -- declaration. if Nkind (Parent (N)) = N_Subunit then Error_Msg_N ("aspect % cannot apply to a subunit", Asp); -- Otherwise suggest the refined form else Error_Msg_Name_2 := Ref_Nam; Error_Msg_N ("aspect % should be %", Asp); end if; -- Otherwise the aspect must appear on the spec, not on the body -- procedure P; -- procedure P with Global ... is ... end P; else Error_Msg_N ("aspect specification must appear on initial declaration", Asp); end if; end Misplaced_Aspect_Error; -- Local variables Asp : Node_Id; Asp_Nam : Name_Id; -- Start of processing for Diagnose_Misplaced_Aspects begin -- Iterate over the aspect specifications and emit specific errors -- where applicable. Asp := First (Aspect_Specifications (N)); while Present (Asp) loop Asp_Nam := Chars (Identifier (Asp)); -- Do not emit errors on aspects that can appear on a subprogram -- body. This scenario occurs when the aspect specification list -- contains both misplaced and properly placed aspects. if Aspect_On_Body_Or_Stub_OK (Get_Aspect_Id (Asp_Nam)) then null; -- Special diagnostics for SPARK aspects elsif Asp_Nam = Name_Depends then Misplaced_Aspect_Error (Asp, Name_Refined_Depends); elsif Asp_Nam = Name_Global then Misplaced_Aspect_Error (Asp, Name_Refined_Global); elsif Asp_Nam = Name_Post then Misplaced_Aspect_Error (Asp, Name_Refined_Post); -- Otherwise a language-defined aspect is misplaced else Error_Msg_N ("aspect specification must appear on initial declaration", Asp); end if; Next (Asp); end loop; end Diagnose_Misplaced_Aspects; -- Local variables Spec_Id : constant Entity_Id := Unique_Defining_Entity (N); -- Start of processing for Analyze_Aspects_On_Subprogram_Body_Or_Stub begin -- Language-defined aspects cannot be associated with a subprogram body -- [stub] if the subprogram has a spec. Certain implementation defined -- aspects are allowed to break this rule (for all applicable cases, see -- table Aspects.Aspect_On_Body_Or_Stub_OK). if Spec_Id /= Body_Id and then not Aspects_On_Body_Or_Stub_OK (N) then Diagnose_Misplaced_Aspects (Spec_Id); else Analyze_Aspect_Specifications (N, Body_Id); end if; end Analyze_Aspects_On_Subprogram_Body_Or_Stub; ----------------------- -- Analyze_At_Clause -- ----------------------- -- An at clause is replaced by the corresponding Address attribute -- definition clause that is the preferred approach in Ada 95. procedure Analyze_At_Clause (N : Node_Id) is CS : constant Boolean := Comes_From_Source (N); begin -- This is an obsolescent feature Check_Restriction (No_Obsolescent_Features, N); if Warn_On_Obsolescent_Feature then Error_Msg_N ("?j?at clause is an obsolescent feature (RM J.7(2))", N); Error_Msg_N ("\?j?use address attribute definition clause instead", N); end if; -- Rewrite as address clause Rewrite (N, Make_Attribute_Definition_Clause (Sloc (N), Name => Identifier (N), Chars => Name_Address, Expression => Expression (N))); -- We preserve Comes_From_Source, since logically the clause still comes -- from the source program even though it is changed in form. Set_Comes_From_Source (N, CS); -- Analyze rewritten clause Analyze_Attribute_Definition_Clause (N); end Analyze_At_Clause; ----------------------------------------- -- Analyze_Attribute_Definition_Clause -- ----------------------------------------- procedure Analyze_Attribute_Definition_Clause (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); Nam : constant Node_Id := Name (N); Attr : constant Name_Id := Chars (N); Expr : constant Node_Id := Expression (N); Id : constant Attribute_Id := Get_Attribute_Id (Attr); Ent : Entity_Id; -- The entity of Nam after it is analyzed. In the case of an incomplete -- type, this is the underlying type. U_Ent : Entity_Id; -- The underlying entity to which the attribute applies. Generally this -- is the Underlying_Type of Ent, except in the case where the clause -- applies to the full view of an incomplete or private type, in which -- case U_Ent is just a copy of Ent. FOnly : Boolean := False; -- Reset to True for subtype specific attribute (Alignment, Size) -- and for stream attributes, i.e. those cases where in the call to -- Rep_Item_Too_Late, FOnly is set True so that only the freezing rules -- are checked. Note that the case of stream attributes is not clear -- from the RM, but see AI95-00137. Also, the RM seems to disallow -- Storage_Size for derived task types, but that is also clearly -- unintentional. procedure Analyze_Put_Image_TSS_Definition; procedure Analyze_Stream_TSS_Definition (TSS_Nam : TSS_Name_Type); -- Common processing for 'Read, 'Write, 'Input and 'Output attribute -- definition clauses. function Duplicate_Clause return Boolean; -- This routine checks if the aspect for U_Ent being given by attribute -- definition clause N is for an aspect that has already been specified, -- and if so gives an error message. If there is a duplicate, True is -- returned, otherwise if there is no error, False is returned. procedure Check_Indexing_Functions; -- Check that the function in Constant_Indexing or Variable_Indexing -- attribute has the proper type structure. If the name is overloaded, -- check that some interpretation is legal. procedure Check_Iterator_Functions; -- Check that there is a single function in Default_Iterator attribute -- that has the proper type structure. function Check_Primitive_Function (Subp : Entity_Id) return Boolean; -- Common legality check for the previous two ----------------------------------- -- Analyze_Put_Image_TSS_Definition -- ----------------------------------- procedure Analyze_Put_Image_TSS_Definition is Subp : Entity_Id := Empty; I : Interp_Index; It : Interp; Pnam : Entity_Id; function Has_Good_Profile (Subp : Entity_Id; Report : Boolean := False) return Boolean; -- Return true if the entity is a subprogram with an appropriate -- profile for the attribute being defined. If result is False and -- Report is True, function emits appropriate error. ---------------------- -- Has_Good_Profile -- ---------------------- function Has_Good_Profile (Subp : Entity_Id; Report : Boolean := False) return Boolean is F : Entity_Id; Typ : Entity_Id; begin if Ekind (Subp) /= E_Procedure then return False; end if; F := First_Formal (Subp); if No (F) or else Etype (F) /= Class_Wide_Type (RTE (RE_Sink)) then return False; end if; Next_Formal (F); if Parameter_Mode (F) /= E_In_Parameter then return False; end if; Typ := Etype (F); -- Verify that the prefix of the attribute and the local name for -- the type of the formal match. if Typ /= Ent then return False; end if; if Present (Next_Formal (F)) then return False; elsif not Is_Scalar_Type (Typ) and then not Is_First_Subtype (Typ) then if Report and not Is_First_Subtype (Typ) then Error_Msg_N ("subtype of formal in Put_Image operation must be a " & "first subtype", Parameter_Type (Parent (F))); end if; return False; else return True; end if; end Has_Good_Profile; -- Start of processing for Analyze_Put_Image_TSS_Definition begin if not Is_Type (U_Ent) then Error_Msg_N ("local name must be a subtype", Nam); return; elsif not Is_First_Subtype (U_Ent) then Error_Msg_N ("local name must be a first subtype", Nam); return; end if; Pnam := TSS (Base_Type (U_Ent), TSS_Put_Image); -- If Pnam is present, it can be either inherited from an ancestor -- type (in which case it is legal to redefine it for this type), or -- be a previous definition of the attribute for the same type (in -- which case it is illegal). -- In the first case, it will have been analyzed already, and we can -- check that its profile does not match the expected profile for the -- Put_Image attribute of U_Ent. In the second case, either Pnam has -- been analyzed (and has the expected profile), or it has not been -- analyzed yet (case of a type that has not been frozen yet and for -- which Put_Image has been set using Set_TSS). if Present (Pnam) and then (No (First_Entity (Pnam)) or else Has_Good_Profile (Pnam)) then Error_Msg_Sloc := Sloc (Pnam); Error_Msg_Name_1 := Attr; Error_Msg_N ("% attribute already defined #", Nam); return; end if; Analyze (Expr); if Is_Entity_Name (Expr) then if not Is_Overloaded (Expr) then if Has_Good_Profile (Entity (Expr), Report => True) then Subp := Entity (Expr); end if; else Get_First_Interp (Expr, I, It); while Present (It.Nam) loop if Has_Good_Profile (It.Nam) then Subp := It.Nam; exit; end if; Get_Next_Interp (I, It); end loop; end if; end if; if Present (Subp) then if Is_Abstract_Subprogram (Subp) then Error_Msg_N ("Put_Image subprogram must not be abstract", Expr); return; end if; Set_Entity (Expr, Subp); Set_Etype (Expr, Etype (Subp)); New_Put_Image_Subprogram (N, U_Ent, Subp); else Error_Msg_Name_1 := Attr; Error_Msg_N ("incorrect expression for% attribute", Expr); end if; end Analyze_Put_Image_TSS_Definition; ----------------------------------- -- Analyze_Stream_TSS_Definition -- ----------------------------------- procedure Analyze_Stream_TSS_Definition (TSS_Nam : TSS_Name_Type) is Subp : Entity_Id := Empty; I : Interp_Index; It : Interp; Pnam : Entity_Id; Is_Read : constant Boolean := (TSS_Nam = TSS_Stream_Read); -- True for Read attribute, False for other attributes function Has_Good_Profile (Subp : Entity_Id; Report : Boolean := False) return Boolean; -- Return true if the entity is a subprogram with an appropriate -- profile for the attribute being defined. If result is False and -- Report is True, function emits appropriate error. ---------------------- -- Has_Good_Profile -- ---------------------- function Has_Good_Profile (Subp : Entity_Id; Report : Boolean := False) return Boolean is Expected_Ekind : constant array (Boolean) of Entity_Kind := (False => E_Procedure, True => E_Function); Is_Function : constant Boolean := (TSS_Nam = TSS_Stream_Input); F : Entity_Id; Typ : Entity_Id; begin if Ekind (Subp) /= Expected_Ekind (Is_Function) then return False; end if; F := First_Formal (Subp); if No (F) or else Ekind (Etype (F)) /= E_Anonymous_Access_Type or else Designated_Type (Etype (F)) /= Class_Wide_Type (RTE (RE_Root_Stream_Type)) then return False; end if; if not Is_Function then Next_Formal (F); declare Expected_Mode : constant array (Boolean) of Entity_Kind := (False => E_In_Parameter, True => E_Out_Parameter); begin if Parameter_Mode (F) /= Expected_Mode (Is_Read) then return False; end if; end; Typ := Etype (F); else Typ := Etype (Subp); end if; -- Verify that the prefix of the attribute and the local name for -- the type of the formal match. if Base_Type (Typ) /= Base_Type (Ent) then return False; end if; if Present (Next_Formal (F)) then return False; elsif not Is_Scalar_Type (Typ) and then not Is_First_Subtype (Typ) and then not Is_Class_Wide_Type (Typ) then if Report and not Is_First_Subtype (Typ) then Error_Msg_N ("subtype of formal in stream operation must be a first " & "subtype", Parameter_Type (Parent (F))); end if; return False; else return True; end if; end Has_Good_Profile; -- Start of processing for Analyze_Stream_TSS_Definition begin FOnly := True; if not Is_Type (U_Ent) then Error_Msg_N ("local name must be a subtype", Nam); return; elsif not Is_First_Subtype (U_Ent) then Error_Msg_N ("local name must be a first subtype", Nam); return; end if; Pnam := TSS (Base_Type (U_Ent), TSS_Nam); -- If Pnam is present, it can be either inherited from an ancestor -- type (in which case it is legal to redefine it for this type), or -- be a previous definition of the attribute for the same type (in -- which case it is illegal). -- In the first case, it will have been analyzed already, and we -- can check that its profile does not match the expected profile -- for a stream attribute of U_Ent. In the second case, either Pnam -- has been analyzed (and has the expected profile), or it has not -- been analyzed yet (case of a type that has not been frozen yet -- and for which the stream attribute has been set using Set_TSS). if Present (Pnam) and then (No (First_Entity (Pnam)) or else Has_Good_Profile (Pnam)) then Error_Msg_Sloc := Sloc (Pnam); Error_Msg_Name_1 := Attr; Error_Msg_N ("% attribute already defined #", Nam); return; end if; Analyze (Expr); if Is_Entity_Name (Expr) then if not Is_Overloaded (Expr) then if Has_Good_Profile (Entity (Expr), Report => True) then Subp := Entity (Expr); end if; else Get_First_Interp (Expr, I, It); while Present (It.Nam) loop if Has_Good_Profile (It.Nam) then Subp := It.Nam; exit; end if; Get_Next_Interp (I, It); end loop; end if; end if; if Present (Subp) then if Is_Abstract_Subprogram (Subp) then Error_Msg_N ("stream subprogram must not be abstract", Expr); return; -- A stream subprogram for an interface type must be a null -- procedure (RM 13.13.2 (38/3)). Note that the class-wide type -- of an interface is not an interface type (3.9.4 (6.b/2)). elsif Is_Interface (U_Ent) and then not Is_Class_Wide_Type (U_Ent) and then not Inside_A_Generic and then (Ekind (Subp) = E_Function or else not Null_Present (Specification (Unit_Declaration_Node (Ultimate_Alias (Subp))))) then Error_Msg_N ("stream subprogram for interface type must be null " & "procedure", Expr); end if; Set_Entity (Expr, Subp); Set_Etype (Expr, Etype (Subp)); New_Stream_Subprogram (N, U_Ent, Subp, TSS_Nam); else Error_Msg_Name_1 := Attr; if Is_Class_Wide_Type (Base_Type (Ent)) then Error_Msg_N ("incorrect expression for class-wide% attribute", Expr); else Error_Msg_N ("incorrect expression for% attribute", Expr); end if; end if; end Analyze_Stream_TSS_Definition; ------------------------------ -- Check_Indexing_Functions -- ------------------------------ procedure Check_Indexing_Functions is Indexing_Found : Boolean := False; procedure Check_Inherited_Indexing; -- For a derived type, check that for a derived type, a specification -- of an indexing aspect can only be confirming, i.e. uses the same -- name as in the parent type. -- AI12-0160: Verify that an indexing cannot be specified for -- a derived type unless it is specified for the parent. procedure Check_One_Function (Subp : Entity_Id); -- Check one possible interpretation. Sets Indexing_Found True if a -- legal indexing function is found. procedure Illegal_Indexing (Msg : String); -- Diagnose illegal indexing function if not overloaded. In the -- overloaded case indicate that no legal interpretation exists. ------------------------------ -- Check_Inherited_Indexing -- ------------------------------ procedure Check_Inherited_Indexing is Inherited : Node_Id; Other_Indexing : Node_Id; begin if Attr = Name_Constant_Indexing then Inherited := Find_Aspect (Etype (Ent), Aspect_Constant_Indexing); Other_Indexing := Find_Aspect (Etype (Ent), Aspect_Variable_Indexing); else pragma Assert (Attr = Name_Variable_Indexing); Inherited := Find_Aspect (Etype (Ent), Aspect_Variable_Indexing); Other_Indexing := Find_Aspect (Etype (Ent), Aspect_Constant_Indexing); end if; if Present (Inherited) then if Debug_Flag_Dot_XX then null; -- OK if current attribute_definition_clause is expansion of -- inherited aspect. elsif Aspect_Rep_Item (Inherited) = N then null; -- Check if this is a confirming specification. The name -- may be overloaded between the parent operation and the -- inherited one, so we check that the Chars fields match. elsif Is_Entity_Name (Expression (Inherited)) and then Chars (Entity (Expression (Inherited))) = Chars (Entity (Expression (N))) then Indexing_Found := True; -- Indicate the operation that must be overridden, rather than -- redefining the indexing aspect. else Illegal_Indexing ("indexing function already inherited from parent type"); Error_Msg_NE ("!override & instead", N, Entity (Expression (Inherited))); end if; -- If not inherited and the parent has another indexing function -- this is illegal, because it leads to inconsistent results in -- class-wide calls. elsif Present (Other_Indexing) then Error_Msg_N ("cannot specify indexing operation on derived type" & " if not specified for parent", N); end if; end Check_Inherited_Indexing; ------------------------ -- Check_One_Function -- ------------------------ procedure Check_One_Function (Subp : Entity_Id) is Default_Element : Node_Id; Ret_Type : constant Entity_Id := Etype (Subp); begin if not Is_Overloadable (Subp) then Illegal_Indexing ("illegal indexing function for type&"); return; elsif Scope (Subp) /= Scope (Ent) then if Nkind (Expr) = N_Expanded_Name then -- Indexing function can't be declared elsewhere Illegal_Indexing ("indexing function must be declared" & " in scope of type&"); end if; if Is_Derived_Type (Ent) then Check_Inherited_Indexing; end if; return; elsif No (First_Formal (Subp)) then Illegal_Indexing ("Indexing requires a function that applies to type&"); return; elsif No (Next_Formal (First_Formal (Subp))) then Illegal_Indexing ("indexing function must have at least two parameters"); return; elsif Is_Derived_Type (Ent) then Check_Inherited_Indexing; end if; if not Check_Primitive_Function (Subp) then Illegal_Indexing ("Indexing aspect requires a function that applies to type&"); return; end if; -- If partial declaration exists, verify that it is not tagged. if Ekind (Current_Scope) = E_Package and then Has_Private_Declaration (Ent) and then From_Aspect_Specification (N) and then List_Containing (Parent (Ent)) = Private_Declarations (Specification (Unit_Declaration_Node (Current_Scope))) and then Nkind (N) = N_Attribute_Definition_Clause then declare Decl : Node_Id; begin Decl := First (Visible_Declarations (Specification (Unit_Declaration_Node (Current_Scope)))); while Present (Decl) loop if Nkind (Decl) = N_Private_Type_Declaration and then Ent = Full_View (Defining_Identifier (Decl)) and then Tagged_Present (Decl) and then No (Aspect_Specifications (Decl)) then Illegal_Indexing ("Indexing aspect cannot be specified on full view " & "if partial view is tagged"); return; end if; Next (Decl); end loop; end; end if; -- An indexing function must return either the default element of -- the container, or a reference type. For variable indexing it -- must be the latter. Default_Element := Find_Value_Of_Aspect (Etype (First_Formal (Subp)), Aspect_Iterator_Element); if Present (Default_Element) then Analyze (Default_Element); end if; -- For variable_indexing the return type must be a reference type if Attr = Name_Variable_Indexing then if not Has_Implicit_Dereference (Ret_Type) then Illegal_Indexing ("variable indexing must return a reference type"); return; elsif Is_Access_Constant (Etype (First_Discriminant (Ret_Type))) then Illegal_Indexing ("variable indexing must return an access to variable"); return; end if; else if Has_Implicit_Dereference (Ret_Type) and then not Is_Access_Constant (Etype (Get_Reference_Discriminant (Ret_Type))) then Illegal_Indexing ("constant indexing must return an access to constant"); return; elsif Is_Access_Type (Etype (First_Formal (Subp))) and then not Is_Access_Constant (Etype (First_Formal (Subp))) then Illegal_Indexing ("constant indexing must apply to an access to constant"); return; end if; end if; -- All checks succeeded Indexing_Found := True; end Check_One_Function; ----------------------- -- Illegal_Indexing -- ----------------------- procedure Illegal_Indexing (Msg : String) is begin Error_Msg_NE (Msg, N, Ent); end Illegal_Indexing; -- Start of processing for Check_Indexing_Functions begin if In_Instance then Check_Inherited_Indexing; end if; Analyze (Expr); if not Is_Overloaded (Expr) then Check_One_Function (Entity (Expr)); else declare I : Interp_Index; It : Interp; begin Indexing_Found := False; Get_First_Interp (Expr, I, It); while Present (It.Nam) loop -- Note that analysis will have added the interpretation -- that corresponds to the dereference. We only check the -- subprogram itself. Ignore homonyms that may come from -- derived types in the context. if Is_Overloadable (It.Nam) and then Comes_From_Source (It.Nam) then Check_One_Function (It.Nam); end if; Get_Next_Interp (I, It); end loop; end; end if; if not Indexing_Found and then not Error_Posted (N) then Error_Msg_NE ("aspect Indexing requires a local function that applies to " & "type&", Expr, Ent); end if; end Check_Indexing_Functions; ------------------------------ -- Check_Iterator_Functions -- ------------------------------ procedure Check_Iterator_Functions is function Valid_Default_Iterator (Subp : Entity_Id) return Boolean; -- Check one possible interpretation for validity ---------------------------- -- Valid_Default_Iterator -- ---------------------------- function Valid_Default_Iterator (Subp : Entity_Id) return Boolean is Root_T : constant Entity_Id := Root_Type (Etype (Etype (Subp))); Formal : Entity_Id; begin if not Check_Primitive_Function (Subp) then return False; -- The return type must be derived from a type in an instance -- of Iterator.Interfaces, and thus its root type must have a -- predefined name. elsif Chars (Root_T) /= Name_Forward_Iterator and then Chars (Root_T) /= Name_Reversible_Iterator then return False; else Formal := First_Formal (Subp); end if; -- False if any subsequent formal has no default expression Next_Formal (Formal); while Present (Formal) loop if No (Expression (Parent (Formal))) then return False; end if; Next_Formal (Formal); end loop; -- True if all subsequent formals have default expressions return True; end Valid_Default_Iterator; -- Start of processing for Check_Iterator_Functions begin Analyze (Expr); if not Is_Entity_Name (Expr) then Error_Msg_N ("aspect Iterator must be a function name", Expr); end if; if not Is_Overloaded (Expr) then if Entity (Expr) /= Any_Id and then not Check_Primitive_Function (Entity (Expr)) then Error_Msg_NE ("aspect Indexing requires a function that applies to type&", Entity (Expr), Ent); end if; -- Flag the default_iterator as well as the denoted function. if not Valid_Default_Iterator (Entity (Expr)) then Error_Msg_N ("improper function for default iterator!", Expr); end if; else declare Default : Entity_Id := Empty; I : Interp_Index; It : Interp; begin Get_First_Interp (Expr, I, It); while Present (It.Nam) loop if not Check_Primitive_Function (It.Nam) or else not Valid_Default_Iterator (It.Nam) then Remove_Interp (I); elsif Present (Default) then -- An explicit one should override an implicit one if Comes_From_Source (Default) = Comes_From_Source (It.Nam) then Error_Msg_N ("default iterator must be unique", Expr); Error_Msg_Sloc := Sloc (Default); Error_Msg_N ("\\possible interpretation#", Expr); Error_Msg_Sloc := Sloc (It.Nam); Error_Msg_N ("\\possible interpretation#", Expr); elsif Comes_From_Source (It.Nam) then Default := It.Nam; end if; else Default := It.Nam; end if; Get_Next_Interp (I, It); end loop; if Present (Default) then Set_Entity (Expr, Default); Set_Is_Overloaded (Expr, False); else Error_Msg_N ("no interpretation is a valid default iterator!", Expr); end if; end; end if; end Check_Iterator_Functions; ------------------------------- -- Check_Primitive_Function -- ------------------------------- function Check_Primitive_Function (Subp : Entity_Id) return Boolean is Ctrl : Entity_Id; begin if Ekind (Subp) /= E_Function then return False; end if; if No (First_Formal (Subp)) then return False; else Ctrl := Etype (First_Formal (Subp)); end if; -- To be a primitive operation subprogram has to be in same scope. if Scope (Ctrl) /= Scope (Subp) then return False; end if; -- Type of formal may be the class-wide type, an access to such, -- or an incomplete view. if Ctrl = Ent or else Ctrl = Class_Wide_Type (Ent) or else (Ekind (Ctrl) = E_Anonymous_Access_Type and then (Designated_Type (Ctrl) = Ent or else Designated_Type (Ctrl) = Class_Wide_Type (Ent))) or else (Ekind (Ctrl) = E_Incomplete_Type and then Full_View (Ctrl) = Ent) then null; else return False; end if; return True; end Check_Primitive_Function; ---------------------- -- Duplicate_Clause -- ---------------------- function Duplicate_Clause return Boolean is A : Node_Id; begin -- Nothing to do if this attribute definition clause comes from -- an aspect specification, since we could not be duplicating an -- explicit clause, and we dealt with the case of duplicated aspects -- in Analyze_Aspect_Specifications. if From_Aspect_Specification (N) then return False; end if; -- Otherwise current clause may duplicate previous clause, or a -- previously given pragma or aspect specification for the same -- aspect. A := Get_Rep_Item (U_Ent, Chars (N), Check_Parents => False); if Present (A) then Error_Msg_Name_1 := Chars (N); Error_Msg_Sloc := Sloc (A); Error_Msg_NE ("aspect% for & previously given#", N, U_Ent); return True; end if; return False; end Duplicate_Clause; -- Start of processing for Analyze_Attribute_Definition_Clause begin -- The following code is a defense against recursion. Not clear that -- this can happen legitimately, but perhaps some error situations can -- cause it, and we did see this recursion during testing. if Analyzed (N) then return; else Set_Analyzed (N, True); end if; Check_Restriction_No_Use_Of_Attribute (N); if Get_Aspect_Id (Chars (N)) /= No_Aspect then -- 6.1/3 No_Specification_of_Aspect: Identifies an aspect for which -- no aspect_specification, attribute_definition_clause, or pragma -- is given. Check_Restriction_No_Specification_Of_Aspect (N); end if; -- Ignore some selected attributes in CodePeer mode since they are not -- relevant in this context. if CodePeer_Mode then case Id is -- Ignore Component_Size in CodePeer mode, to avoid changing the -- internal representation of types by implicitly packing them. when Attribute_Component_Size => Rewrite (N, Make_Null_Statement (Sloc (N))); return; when others => null; end case; end if; -- Process Ignore_Rep_Clauses option if Ignore_Rep_Clauses then case Id is -- The following should be ignored. They do not affect legality -- and may be target dependent. The basic idea of -gnatI is to -- ignore any rep clauses that may be target dependent but do not -- affect legality (except possibly to be rejected because they -- are incompatible with the compilation target). when Attribute_Alignment | Attribute_Bit_Order | Attribute_Component_Size | Attribute_Default_Scalar_Storage_Order | Attribute_Machine_Radix | Attribute_Object_Size | Attribute_Scalar_Storage_Order | Attribute_Size | Attribute_Small | Attribute_Stream_Size | Attribute_Value_Size => Kill_Rep_Clause (N); return; -- The following should not be ignored, because in the first place -- they are reasonably portable, and should not cause problems -- in compiling code from another target, and also they do affect -- legality, e.g. failing to provide a stream attribute for a type -- may make a program illegal. when Attribute_External_Tag | Attribute_Input | Attribute_Output | Attribute_Put_Image | Attribute_Read | Attribute_Simple_Storage_Pool | Attribute_Storage_Pool | Attribute_Storage_Size | Attribute_Write => null; -- We do not do anything here with address clauses, they will be -- removed by Freeze later on, but for now, it works better to -- keep them in the tree. when Attribute_Address => null; -- Other cases are errors ("attribute& cannot be set with -- definition clause"), which will be caught below. when others => null; end case; end if; Analyze (Nam); Ent := Entity (Nam); if Rep_Item_Too_Early (Ent, N) then return; end if; -- Rep clause applies to (underlying) full view of private or incomplete -- type if we have one (if not, this is a premature use of the type). -- However, some semantic checks need to be done on the specified entity -- i.e. the private view, so we save it in Ent. if Is_Private_Type (Ent) and then Is_Derived_Type (Ent) and then not Is_Tagged_Type (Ent) and then No (Full_View (Ent)) and then No (Underlying_Full_View (Ent)) then U_Ent := Ent; elsif Ekind (Ent) = E_Incomplete_Type then -- The attribute applies to the full view, set the entity of the -- attribute definition accordingly. Ent := Underlying_Type (Ent); U_Ent := Ent; Set_Entity (Nam, Ent); else U_Ent := Underlying_Type (Ent); end if; -- Avoid cascaded error if Etype (Nam) = Any_Type then return; -- Must be declared in current scope or in case of an aspect -- specification, must be visible in current scope. elsif Scope (Ent) /= Current_Scope and then not (From_Aspect_Specification (N) and then Scope_Within_Or_Same (Current_Scope, Scope (Ent))) then Error_Msg_N ("entity must be declared in this scope", Nam); return; -- Must not be a source renaming (we do have some cases where the -- expander generates a renaming, and those cases are OK, in such -- cases any attribute applies to the renamed object as well). elsif Is_Object (Ent) and then Present (Renamed_Object (Ent)) then -- In the case of a renamed object from source, this is an error -- unless the object is an aggregate and the renaming is created -- for an object declaration. if Comes_From_Source (Renamed_Object (Ent)) and then Nkind (Renamed_Object (Ent)) /= N_Aggregate then Get_Name_String (Chars (N)); Error_Msg_Strlen := Name_Len; Error_Msg_String (1 .. Name_Len) := Name_Buffer (1 .. Name_Len); Error_Msg_N ("~ clause not allowed for a renaming declaration " & "(RM 13.1(6))", Nam); return; -- For the case of a compiler generated renaming, the attribute -- definition clause applies to the renamed object created by the -- expander. The easiest general way to handle this is to create a -- copy of the attribute definition clause for this object. elsif Is_Entity_Name (Renamed_Object (Ent)) then Insert_Action (N, Make_Attribute_Definition_Clause (Loc, Name => New_Occurrence_Of (Entity (Renamed_Object (Ent)), Loc), Chars => Chars (N), Expression => Duplicate_Subexpr (Expression (N)))); -- If the renamed object is not an entity, it must be a dereference -- of an unconstrained function call, and we must introduce a new -- declaration to capture the expression. This is needed in the case -- of 'Alignment, where the original declaration must be rewritten. else pragma Assert (Nkind (Renamed_Object (Ent)) = N_Explicit_Dereference); null; end if; -- If no underlying entity, use entity itself, applies to some -- previously detected error cases ??? elsif No (U_Ent) then U_Ent := Ent; -- Cannot specify for a subtype (exception Object/Value_Size) elsif Is_Type (U_Ent) and then not Is_First_Subtype (U_Ent) and then Id /= Attribute_Object_Size and then Id /= Attribute_Value_Size and then not From_At_Mod (N) then Error_Msg_N ("cannot specify attribute for subtype", Nam); return; end if; Set_Entity (N, U_Ent); -- Switch on particular attribute case Id is ------------- -- Address -- ------------- -- Address attribute definition clause when Attribute_Address => Address : begin -- A little error check, catch for X'Address use X'Address; if Nkind (Nam) = N_Identifier and then Nkind (Expr) = N_Attribute_Reference and then Attribute_Name (Expr) = Name_Address and then Nkind (Prefix (Expr)) = N_Identifier and then Chars (Nam) = Chars (Prefix (Expr)) then Error_Msg_NE ("address for & is self-referencing", Prefix (Expr), Ent); return; end if; -- Not that special case, carry on with analysis of expression Analyze_And_Resolve (Expr, RTE (RE_Address)); -- Even when ignoring rep clauses we need to indicate that the -- entity has an address clause and thus it is legal to declare -- it imported. Freeze will get rid of the address clause later. -- Also call Set_Address_Taken to indicate that an address clause -- was present, even if we are about to remove it. if Ignore_Rep_Clauses then Set_Address_Taken (U_Ent); if Ekind (U_Ent) in E_Variable | E_Constant then Record_Rep_Item (U_Ent, N); end if; return; end if; if Duplicate_Clause then null; -- Case of address clause for subprogram elsif Is_Subprogram (U_Ent) then if Has_Homonym (U_Ent) then Error_Msg_N ("address clause cannot be given for overloaded " & "subprogram", Nam); return; end if; -- For subprograms, all address clauses are permitted, and we -- mark the subprogram as having a deferred freeze so that Gigi -- will not elaborate it too soon. -- Above needs more comments, what is too soon about??? Set_Has_Delayed_Freeze (U_Ent); -- Case of address clause for entry elsif Ekind (U_Ent) = E_Entry then if Nkind (Parent (N)) = N_Task_Body then Error_Msg_N ("entry address must be specified in task spec", Nam); return; end if; -- For entries, we require a constant address Check_Constant_Address_Clause (Expr, U_Ent); -- Special checks for task types if Is_Task_Type (Scope (U_Ent)) and then Comes_From_Source (Scope (U_Ent)) then Error_Msg_N ("??entry address declared for entry in task type", N); Error_Msg_N ("\??only one task can be declared of this type", N); end if; -- Entry address clauses are obsolescent Check_Restriction (No_Obsolescent_Features, N); if Warn_On_Obsolescent_Feature then Error_Msg_N ("?j?attaching interrupt to task entry is an obsolescent " & "feature (RM J.7.1)", N); Error_Msg_N ("\?j?use interrupt procedure instead", N); end if; -- Case of an address clause for a class-wide object, which is -- considered erroneous. elsif Is_Class_Wide_Type (Etype (U_Ent)) then Error_Msg_NE ("??class-wide object & must not be overlaid", Nam, U_Ent); Error_Msg_N ("\??Program_Error will be raised at run time", Nam); Insert_Action (Declaration_Node (U_Ent), Make_Raise_Program_Error (Loc, Reason => PE_Overlaid_Controlled_Object)); return; -- Case of address clause for an object elsif Ekind (U_Ent) in E_Constant | E_Variable then declare Expr : constant Node_Id := Expression (N); O_Ent : Entity_Id; Off : Boolean; begin -- Exported variables cannot have an address clause, because -- this cancels the effect of the pragma Export. if Is_Exported (U_Ent) then Error_Msg_N ("cannot export object with address clause", Nam); return; end if; Find_Overlaid_Entity (N, O_Ent, Off); if Present (O_Ent) then -- If the object overlays a constant object, mark it so if Is_Constant_Object (O_Ent) then Set_Overlays_Constant (U_Ent); end if; -- If the address clause is of the form: -- for X'Address use Y'Address; -- or -- C : constant Address := Y'Address; -- ... -- for X'Address use C; -- then we make an entry in the table to check the size -- and alignment of the overlaying variable. But we defer -- this check till after code generation to take full -- advantage of the annotation done by the back end. -- If the entity has a generic type, the check will be -- performed in the instance if the actual type justifies -- it, and we do not insert the clause in the table to -- prevent spurious warnings. -- Note: we used to test Comes_From_Source and only give -- this warning for source entities, but we have removed -- this test. It really seems bogus to generate overlays -- that would trigger this warning in generated code. -- Furthermore, by removing the test, we handle the -- aspect case properly. if Is_Object (O_Ent) and then not Is_Generic_Formal (O_Ent) and then not Is_Generic_Type (Etype (U_Ent)) and then Address_Clause_Overlay_Warnings then Register_Address_Clause_Check (N, U_Ent, No_Uint, O_Ent, Off); end if; -- If the overlay changes the storage order, warn since -- the construct is not really supported by the back end. -- Also mark the entity as being volatile to block the -- optimizer, even if there is no warranty on the result. if (Is_Record_Type (Etype (U_Ent)) or else Is_Array_Type (Etype (U_Ent))) and then (Is_Record_Type (Etype (O_Ent)) or else Is_Array_Type (Etype (O_Ent))) and then Reverse_Storage_Order (Etype (U_Ent)) /= Reverse_Storage_Order (Etype (O_Ent)) then Error_Msg_N ("??overlay changes scalar storage order", Expr); Set_Treat_As_Volatile (U_Ent); end if; else -- If this is not an overlay, mark a variable as being -- volatile to prevent unwanted optimizations. It's a -- conservative interpretation of RM 13.3(19) for the -- cases where the compiler cannot detect potential -- aliasing issues easily and it also covers the case -- of an absolute address where the volatile aspect is -- kind of implicit. if Ekind (U_Ent) = E_Variable then Set_Treat_As_Volatile (U_Ent); end if; -- Make an entry in the table for an absolute address as -- above to check that the value is compatible with the -- alignment of the object. declare Addr : constant Node_Id := Address_Value (Expr); begin if Compile_Time_Known_Value (Addr) and then Address_Clause_Overlay_Warnings then Register_Address_Clause_Check (N, U_Ent, Expr_Value (Addr), Empty, False); end if; end; end if; -- Issue an unconditional warning for a constant overlaying -- a variable. For the reverse case, we will issue it only -- if the variable is modified. -- Within a generic unit an In_Parameter is a constant. -- It can be instantiated with a variable, in which case -- there will be a warning on the instance. if Ekind (U_Ent) = E_Constant and then Present (O_Ent) and then Ekind (O_Ent) /= E_Generic_In_Parameter and then not Overlays_Constant (U_Ent) and then Address_Clause_Overlay_Warnings then Error_Msg_N ("??constant overlays a variable", Expr); -- Imported variables can have an address clause, but then -- the import is pretty meaningless except to suppress -- initializations, so we do not need such variables to -- be statically allocated (and in fact it causes trouble -- if the address clause is a local value). elsif Is_Imported (U_Ent) then Set_Is_Statically_Allocated (U_Ent, False); end if; -- We mark a possible modification of a variable with an -- address clause, since it is likely aliasing is occurring. Note_Possible_Modification (Nam, Sure => False); -- Legality checks on the address clause for initialized -- objects is deferred until the freeze point, because -- a subsequent pragma might indicate that the object -- is imported and thus not initialized. Also, the address -- clause might involve entities that have yet to be -- elaborated. Set_Has_Delayed_Freeze (U_Ent); -- If an initialization call has been generated for this -- object, it needs to be deferred to after the freeze node -- we have just now added, otherwise GIGI will see a -- reference to the variable (as actual to the IP call) -- before its definition. declare Init_Call : constant Node_Id := Remove_Init_Call (U_Ent, N); begin if Present (Init_Call) then Append_Freeze_Action (U_Ent, Init_Call); -- Reset Initialization_Statements pointer so that -- if there is a pragma Import further down, it can -- clear any default initialization. Set_Initialization_Statements (U_Ent, Init_Call); end if; end; -- Entity has delayed freeze, so we will generate an -- alignment check at the freeze point unless suppressed. if not Range_Checks_Suppressed (U_Ent) and then not Alignment_Checks_Suppressed (U_Ent) then Set_Check_Address_Alignment (N); end if; -- Kill the size check code, since we are not allocating -- the variable, it is somewhere else. Kill_Size_Check_Code (U_Ent); end; -- Not a valid entity for an address clause else Error_Msg_N ("address cannot be given for &", Nam); end if; end Address; --------------- -- Alignment -- --------------- -- Alignment attribute definition clause when Attribute_Alignment => Alignment : declare Align : constant Uint := Get_Alignment_Value (Expr); Max_Align : constant Uint := UI_From_Int (Maximum_Alignment); begin FOnly := True; if not Is_Type (U_Ent) and then Ekind (U_Ent) /= E_Variable and then Ekind (U_Ent) /= E_Constant then Error_Msg_N ("alignment cannot be given for &", Nam); elsif Duplicate_Clause then null; elsif Align /= No_Uint then Set_Has_Alignment_Clause (U_Ent); -- Tagged type case, check for attempt to set alignment to a -- value greater than Max_Align, and reset if so. if Is_Tagged_Type (U_Ent) and then Align > Max_Align then Error_Msg_N ("alignment for & set to Maximum_Aligment??", Nam); Set_Alignment (U_Ent, Max_Align); -- All other cases else Set_Alignment (U_Ent, Align); end if; -- For an array type, U_Ent is the first subtype. In that case, -- also set the alignment of the anonymous base type so that -- other subtypes (such as the itypes for aggregates of the -- type) also receive the expected alignment. if Is_Array_Type (U_Ent) then Set_Alignment (Base_Type (U_Ent), Align); end if; end if; end Alignment; --------------- -- Bit_Order -- --------------- -- Bit_Order attribute definition clause when Attribute_Bit_Order => if not Is_Record_Type (U_Ent) then Error_Msg_N ("Bit_Order can only be defined for record type", Nam); elsif Is_Tagged_Type (U_Ent) and then Is_Derived_Type (U_Ent) then Error_Msg_N ("Bit_Order cannot be defined for record extensions", Nam); elsif Duplicate_Clause then null; else Analyze_And_Resolve (Expr, RTE (RE_Bit_Order)); if Etype (Expr) = Any_Type then return; elsif not Is_OK_Static_Expression (Expr) then Flag_Non_Static_Expr ("Bit_Order requires static expression!", Expr); elsif (Expr_Value (Expr) = 0) /= Bytes_Big_Endian then Set_Reverse_Bit_Order (Base_Type (U_Ent), True); end if; end if; -------------------- -- Component_Size -- -------------------- -- Component_Size attribute definition clause when Attribute_Component_Size => Component_Size_Case : declare Csize : constant Uint := Static_Integer (Expr); Ctyp : Entity_Id; Btype : Entity_Id; Biased : Boolean; New_Ctyp : Entity_Id; Decl : Node_Id; begin if not Is_Array_Type (U_Ent) then Error_Msg_N ("component size requires array type", Nam); return; end if; Btype := Base_Type (U_Ent); Ctyp := Component_Type (Btype); if Duplicate_Clause then null; elsif Rep_Item_Too_Early (Btype, N) then null; elsif Csize /= No_Uint then Check_Size (Expr, Ctyp, Csize, Biased); -- For the biased case, build a declaration for a subtype that -- will be used to represent the biased subtype that reflects -- the biased representation of components. We need the subtype -- to get proper conversions on referencing elements of the -- array. if Biased then New_Ctyp := Make_Defining_Identifier (Loc, Chars => New_External_Name (Chars (U_Ent), 'C', 0, 'T')); Decl := Make_Subtype_Declaration (Loc, Defining_Identifier => New_Ctyp, Subtype_Indication => New_Occurrence_Of (Component_Type (Btype), Loc)); Set_Parent (Decl, N); Analyze (Decl, Suppress => All_Checks); Set_Has_Delayed_Freeze (New_Ctyp, False); Init_Esize (New_Ctyp); Set_RM_Size (New_Ctyp, Csize); Init_Alignment (New_Ctyp); Set_Is_Itype (New_Ctyp, True); Set_Associated_Node_For_Itype (New_Ctyp, U_Ent); Set_Component_Type (Btype, New_Ctyp); Set_Biased (New_Ctyp, N, "component size clause"); end if; Set_Component_Size (Btype, Csize); -- Deal with warning on overridden size if Warn_On_Overridden_Size and then Has_Size_Clause (Ctyp) and then RM_Size (Ctyp) /= Csize then Error_Msg_NE ("component size overrides size clause for&?S?", N, Ctyp); end if; Set_Has_Component_Size_Clause (Btype, True); Set_Has_Non_Standard_Rep (Btype, True); end if; end Component_Size_Case; ----------------------- -- Constant_Indexing -- ----------------------- when Attribute_Constant_Indexing => Check_Indexing_Functions; --------- -- CPU -- --------- when Attribute_CPU => pragma Assert (From_Aspect_Specification (N)); -- The parser forbids this clause in source code, so it must have -- come from an aspect specification. if not Is_Task_Type (U_Ent) then Error_Msg_N ("CPU can only be defined for task", Nam); elsif Duplicate_Clause then null; else -- The expression must be analyzed in the special manner -- described in "Handling of Default and Per-Object -- Expressions" in sem.ads. -- The visibility to the components must be established -- and restored before and after analysis. Push_Type (U_Ent); Preanalyze_Spec_Expression (Expr, RTE (RE_CPU_Range)); Pop_Type (U_Ent); -- AI12-0117-1, "Restriction No_Tasks_Unassigned_To_CPU": -- If the expression is static, and its value is -- System.Multiprocessors.Not_A_Specific_CPU (i.e. zero) then -- that's a violation of No_Tasks_Unassigned_To_CPU. It might -- seem better to refer to Not_A_Specific_CPU here, but that -- involves a lot of horsing around with Rtsfind, and this -- value is not going to change, so it's better to hardwire -- Uint_0. -- -- AI12-0055-1, "All properties of a usage profile are defined -- by pragmas": If the expression is nonstatic, that's a -- violation of No_Dynamic_CPU_Assignment. if Is_OK_Static_Expression (Expr) then if Expr_Value (Expr) = Uint_0 then Check_Restriction (No_Tasks_Unassigned_To_CPU, Expr); end if; else Check_Restriction (No_Dynamic_CPU_Assignment, Expr); end if; end if; ---------------------- -- Default_Iterator -- ---------------------- when Attribute_Default_Iterator => Default_Iterator : declare Func : Entity_Id; Typ : Entity_Id; begin -- If target type is untagged, further checks are irrelevant if not Is_Tagged_Type (U_Ent) then Error_Msg_N ("aspect Default_Iterator applies to tagged type", Nam); return; end if; Check_Iterator_Functions; Analyze (Expr); if not Is_Entity_Name (Expr) or else Ekind (Entity (Expr)) /= E_Function then Error_Msg_N ("aspect Iterator must be a function", Expr); return; else Func := Entity (Expr); end if; -- The type of the first parameter must be T, T'class, or a -- corresponding access type (5.5.1 (8/3). If function is -- parameterless label type accordingly. if No (First_Formal (Func)) then Typ := Any_Type; else Typ := Etype (First_Formal (Func)); end if; if Typ = U_Ent or else Typ = Class_Wide_Type (U_Ent) or else (Is_Access_Type (Typ) and then Designated_Type (Typ) = U_Ent) or else (Is_Access_Type (Typ) and then Designated_Type (Typ) = Class_Wide_Type (U_Ent)) then null; else Error_Msg_NE ("Default Iterator must be a primitive of&", Func, U_Ent); end if; end Default_Iterator; ------------------------ -- Dispatching_Domain -- ------------------------ when Attribute_Dispatching_Domain => pragma Assert (From_Aspect_Specification (N)); -- The parser forbids this clause in source code, so it must have -- come from an aspect specification. if not Is_Task_Type (U_Ent) then Error_Msg_N ("Dispatching_Domain can only be defined for task", Nam); elsif Duplicate_Clause then null; else -- The expression must be analyzed in the special manner -- described in "Handling of Default and Per-Object -- Expressions" in sem.ads. -- The visibility to the components must be restored Push_Type (U_Ent); Preanalyze_Spec_Expression (Expr, RTE (RE_Dispatching_Domain)); Pop_Type (U_Ent); end if; ------------------ -- External_Tag -- ------------------ when Attribute_External_Tag => if not Is_Tagged_Type (U_Ent) then Error_Msg_N ("should be a tagged type", Nam); end if; if Duplicate_Clause then null; else Analyze_And_Resolve (Expr, Standard_String); if not Is_OK_Static_Expression (Expr) then Flag_Non_Static_Expr ("static string required for tag name!", Nam); end if; if not Is_Library_Level_Entity (U_Ent) then Error_Msg_NE ("??non-unique external tag supplied for &", N, U_Ent); Error_Msg_N ("\??same external tag applies to all subprogram calls", N); Error_Msg_N ("\??corresponding internal tag cannot be obtained", N); end if; end if; -------------------------- -- Implicit_Dereference -- -------------------------- when Attribute_Implicit_Dereference => -- Legality checks already performed at the point of the type -- declaration, aspect is not delayed. null; ----------- -- Input -- ----------- when Attribute_Input => Analyze_Stream_TSS_Definition (TSS_Stream_Input); Set_Has_Specified_Stream_Input (Ent); ------------------------ -- Interrupt_Priority -- ------------------------ when Attribute_Interrupt_Priority => pragma Assert (From_Aspect_Specification (N)); -- The parser forbids this clause in source code, so it must have -- come from an aspect specification. if not Is_Concurrent_Type (U_Ent) then Error_Msg_N ("Interrupt_Priority can only be defined for task and " & "protected object", Nam); elsif Duplicate_Clause then null; else -- The expression must be analyzed in the special manner -- described in "Handling of Default and Per-Object -- Expressions" in sem.ads. -- The visibility to the components must be restored Push_Type (U_Ent); Preanalyze_Spec_Expression (Expr, RTE (RE_Interrupt_Priority)); Pop_Type (U_Ent); -- Check the No_Task_At_Interrupt_Priority restriction if Is_Task_Type (U_Ent) then Check_Restriction (No_Task_At_Interrupt_Priority, N); end if; end if; -------------- -- Iterable -- -------------- when Attribute_Iterable => Analyze (Expr); if Nkind (Expr) /= N_Aggregate then Error_Msg_N ("aspect Iterable must be an aggregate", Expr); end if; declare Assoc : Node_Id; begin Assoc := First (Component_Associations (Expr)); while Present (Assoc) loop Analyze (Expression (Assoc)); if not Is_Entity_Name (Expression (Assoc)) then Error_Msg_N ("value must be a function", Assoc); end if; Next (Assoc); end loop; end; ---------------------- -- Iterator_Element -- ---------------------- when Attribute_Iterator_Element => Analyze (Expr); if not Is_Entity_Name (Expr) or else not Is_Type (Entity (Expr)) then Error_Msg_N ("aspect Iterator_Element must be a type", Expr); return; end if; ------------------- -- Machine_Radix -- ------------------- -- Machine radix attribute definition clause when Attribute_Machine_Radix => Machine_Radix : declare Radix : constant Uint := Static_Integer (Expr); begin if not Is_Decimal_Fixed_Point_Type (U_Ent) then Error_Msg_N ("decimal fixed-point type expected for &", Nam); elsif Duplicate_Clause then null; elsif Radix /= No_Uint then Set_Has_Machine_Radix_Clause (U_Ent); Set_Has_Non_Standard_Rep (Base_Type (U_Ent)); if Radix = 2 then null; elsif Radix = 10 then Set_Machine_Radix_10 (U_Ent); else Error_Msg_N ("machine radix value must be 2 or 10", Expr); end if; end if; end Machine_Radix; ----------------- -- Object_Size -- ----------------- -- Object_Size attribute definition clause when Attribute_Object_Size => Object_Size : declare Size : constant Uint := Static_Integer (Expr); Biased : Boolean; pragma Warnings (Off, Biased); begin if not Is_Type (U_Ent) then Error_Msg_N ("Object_Size cannot be given for &", Nam); elsif Duplicate_Clause then null; else Check_Size (Expr, U_Ent, Size, Biased); if Size <= 0 then Error_Msg_N ("Object_Size must be positive", Expr); elsif Is_Scalar_Type (U_Ent) then if Size /= 8 and then Size /= 16 and then Size /= 32 and then UI_Mod (Size, 64) /= 0 then Error_Msg_N ("Object_Size must be 8, 16, 32, or multiple of 64", Expr); end if; elsif Size mod 8 /= 0 then Error_Msg_N ("Object_Size must be a multiple of 8", Expr); end if; Set_Esize (U_Ent, Size); Set_Has_Object_Size_Clause (U_Ent); Alignment_Check_For_Size_Change (U_Ent, Size); end if; end Object_Size; ------------ -- Output -- ------------ when Attribute_Output => Analyze_Stream_TSS_Definition (TSS_Stream_Output); Set_Has_Specified_Stream_Output (Ent); -------------- -- Priority -- -------------- when Attribute_Priority => -- Priority attribute definition clause not allowed except from -- aspect specification. if From_Aspect_Specification (N) then if not (Is_Concurrent_Type (U_Ent) or else Ekind (U_Ent) = E_Procedure) then Error_Msg_N ("Priority can only be defined for task and protected " & "object", Nam); elsif Duplicate_Clause then null; else -- The expression must be analyzed in the special manner -- described in "Handling of Default and Per-Object -- Expressions" in sem.ads. -- The visibility to the components must be restored Push_Type (U_Ent); Preanalyze_Spec_Expression (Expr, Standard_Integer); Pop_Type (U_Ent); if not Is_OK_Static_Expression (Expr) then Check_Restriction (Static_Priorities, Expr); end if; end if; else Error_Msg_N ("attribute& cannot be set with definition clause", N); end if; --------------- -- Put_Image -- --------------- when Attribute_Put_Image => Analyze_Put_Image_TSS_Definition; ---------- -- Read -- ---------- when Attribute_Read => Analyze_Stream_TSS_Definition (TSS_Stream_Read); Set_Has_Specified_Stream_Read (Ent); -------------------------- -- Scalar_Storage_Order -- -------------------------- -- Scalar_Storage_Order attribute definition clause when Attribute_Scalar_Storage_Order => if not (Is_Record_Type (U_Ent) or else Is_Array_Type (U_Ent)) then Error_Msg_N ("Scalar_Storage_Order can only be defined for record or " & "array type", Nam); elsif Duplicate_Clause then null; else Analyze_And_Resolve (Expr, RTE (RE_Bit_Order)); if Etype (Expr) = Any_Type then return; elsif not Is_OK_Static_Expression (Expr) then Flag_Non_Static_Expr ("Scalar_Storage_Order requires static expression!", Expr); elsif (Expr_Value (Expr) = 0) /= Bytes_Big_Endian then -- Here for the case of a non-default (i.e. non-confirming) -- Scalar_Storage_Order attribute definition. if Support_Nondefault_SSO_On_Target then Set_Reverse_Storage_Order (Base_Type (U_Ent), True); else Error_Msg_N ("non-default Scalar_Storage_Order not supported on " & "target", Expr); end if; end if; -- Clear SSO default indications since explicit setting of the -- order overrides the defaults. Set_SSO_Set_Low_By_Default (Base_Type (U_Ent), False); Set_SSO_Set_High_By_Default (Base_Type (U_Ent), False); end if; ---------- -- Size -- ---------- -- Size attribute definition clause when Attribute_Size => Size : declare Size : constant Uint := Static_Integer (Expr); Etyp : Entity_Id; Biased : Boolean; begin FOnly := True; if Duplicate_Clause then null; elsif not Is_Type (U_Ent) and then Ekind (U_Ent) /= E_Variable and then Ekind (U_Ent) /= E_Constant then Error_Msg_N ("size cannot be given for &", Nam); elsif Is_Array_Type (U_Ent) and then not Is_Constrained (U_Ent) then Error_Msg_N ("size cannot be given for unconstrained array", Nam); elsif Size /= No_Uint then if Is_Type (U_Ent) then Etyp := U_Ent; else Etyp := Etype (U_Ent); end if; -- Check size, note that Gigi is in charge of checking that the -- size of an array or record type is OK. Also we do not check -- the size in the ordinary fixed-point case, since it is too -- early to do so (there may be subsequent small clause that -- affects the size). We can check the size if a small clause -- has already been given. if not Is_Ordinary_Fixed_Point_Type (U_Ent) or else Has_Small_Clause (U_Ent) then Check_Size (Expr, Etyp, Size, Biased); Set_Biased (U_Ent, N, "size clause", Biased); end if; -- For types set RM_Size and Esize if possible if Is_Type (U_Ent) then Set_RM_Size (U_Ent, Size); -- For elementary types, increase Object_Size to power of 2, -- but not less than a storage unit in any case (normally -- this means it will be byte addressable). -- For all other types, nothing else to do, we leave Esize -- (object size) unset, the back end will set it from the -- size and alignment in an appropriate manner. -- In both cases, we check whether the alignment must be -- reset in the wake of the size change. if Is_Elementary_Type (U_Ent) then if Size <= System_Storage_Unit then Init_Esize (U_Ent, System_Storage_Unit); elsif Size <= 16 then Init_Esize (U_Ent, 16); elsif Size <= 32 then Init_Esize (U_Ent, 32); else Set_Esize (U_Ent, (Size + 63) / 64 * 64); end if; Alignment_Check_For_Size_Change (U_Ent, Esize (U_Ent)); else Alignment_Check_For_Size_Change (U_Ent, Size); end if; -- For objects, set Esize only else if Is_Elementary_Type (Etyp) and then Size /= System_Storage_Unit and then Size /= System_Storage_Unit * 2 and then Size /= System_Storage_Unit * 4 and then Size /= System_Storage_Unit * 8 then Error_Msg_Uint_1 := UI_From_Int (System_Storage_Unit); Error_Msg_Uint_2 := Error_Msg_Uint_1 * 8; Error_Msg_N ("size for primitive object must be a power of 2 in " & "the range ^-^", N); end if; Set_Esize (U_Ent, Size); end if; Set_Has_Size_Clause (U_Ent); end if; end Size; ----------- -- Small -- ----------- -- Small attribute definition clause when Attribute_Small => Small : declare Implicit_Base : constant Entity_Id := Base_Type (U_Ent); Small : Ureal; begin Analyze_And_Resolve (Expr, Any_Real); if Etype (Expr) = Any_Type then return; elsif not Is_OK_Static_Expression (Expr) then Flag_Non_Static_Expr ("small requires static expression!", Expr); return; else Small := Expr_Value_R (Expr); if Small <= Ureal_0 then Error_Msg_N ("small value must be greater than zero", Expr); return; end if; end if; if not Is_Ordinary_Fixed_Point_Type (U_Ent) then Error_Msg_N ("small requires an ordinary fixed point type", Nam); elsif Has_Small_Clause (U_Ent) then Error_Msg_N ("small already given for &", Nam); elsif Small > Delta_Value (U_Ent) then Error_Msg_N ("small value must not be greater than delta value", Nam); else Set_Small_Value (U_Ent, Small); Set_Small_Value (Implicit_Base, Small); Set_Has_Small_Clause (U_Ent); Set_Has_Small_Clause (Implicit_Base); Set_Has_Non_Standard_Rep (Implicit_Base); end if; end Small; ------------------ -- Storage_Pool -- ------------------ -- Storage_Pool attribute definition clause when Attribute_Simple_Storage_Pool | Attribute_Storage_Pool => Storage_Pool : declare Pool : Entity_Id; T : Entity_Id; procedure Associate_Storage_Pool (Ent : Entity_Id; Pool : Entity_Id); -- Associate Pool to Ent and perform legality checks on subpools ---------------------------- -- Associate_Storage_Pool -- ---------------------------- procedure Associate_Storage_Pool (Ent : Entity_Id; Pool : Entity_Id) is function Object_From (Pool : Entity_Id) return Entity_Id; -- Return the entity of which Pool is a part of ----------------- -- Object_From -- ----------------- function Object_From (Pool : Entity_Id) return Entity_Id is N : Node_Id := Pool; begin if Present (Renamed_Object (Pool)) then N := Renamed_Object (Pool); end if; while Present (N) loop case Nkind (N) is when N_Defining_Identifier => return N; when N_Identifier | N_Expanded_Name => return Entity (N); when N_Indexed_Component | N_Selected_Component | N_Explicit_Dereference => N := Prefix (N); when N_Type_Conversion => N := Expression (N); when others => -- ??? we probably should handle more cases but -- this is good enough in practice for this check -- on a corner case. return Empty; end case; end loop; return Empty; end Object_From; Obj : Entity_Id; begin Set_Associated_Storage_Pool (Ent, Pool); -- Check RM 13.11.4(22-23/3): a specification of a storage pool -- is illegal if the storage pool supports subpools and: -- (A) The access type is a general access type. -- (B) The access type is statically deeper than the storage -- pool object; -- (C) The storage pool object is a part of a formal parameter; -- (D) The storage pool object is a part of the dereference of -- a non-library level general access type; if Ada_Version >= Ada_2012 and then RTU_Loaded (System_Storage_Pools_Subpools) and then Is_Ancestor (RTE (RE_Root_Storage_Pool_With_Subpools), Etype (Pool)) then -- check (A) if Ekind (Etype (Ent)) = E_General_Access_Type then Error_Msg_N ("subpool cannot be used on general access type", Ent); end if; -- check (B) if Type_Access_Level (Ent) > Object_Access_Level (Pool) then Error_Msg_N ("subpool access type has deeper accessibility " & "level than pool", Ent); return; end if; Obj := Object_From (Pool); -- check (C) if Present (Obj) and then Is_Formal (Obj) then Error_Msg_N ("subpool cannot be part of a parameter", Ent); return; end if; -- check (D) if Present (Obj) and then Ekind (Etype (Obj)) = E_General_Access_Type and then not Is_Library_Level_Entity (Etype (Obj)) then Error_Msg_N ("subpool cannot be part of the dereference of a " & "nested general access type", Ent); return; end if; end if; end Associate_Storage_Pool; begin if Ekind (U_Ent) = E_Access_Subprogram_Type then Error_Msg_N ("storage pool cannot be given for access-to-subprogram type", Nam); return; elsif Ekind (U_Ent) not in E_Access_Type | E_General_Access_Type then Error_Msg_N ("storage pool can only be given for access types", Nam); return; elsif Is_Derived_Type (U_Ent) then Error_Msg_N ("storage pool cannot be given for a derived access type", Nam); elsif Duplicate_Clause then return; elsif Present (Associated_Storage_Pool (U_Ent)) then Error_Msg_N ("storage pool already given for &", Nam); return; end if; -- Check for Storage_Size previously given declare SS : constant Node_Id := Get_Attribute_Definition_Clause (U_Ent, Attribute_Storage_Size); begin if Present (SS) then Check_Pool_Size_Clash (U_Ent, N, SS); end if; end; -- Storage_Pool case if Id = Attribute_Storage_Pool then Analyze_And_Resolve (Expr, Class_Wide_Type (RTE (RE_Root_Storage_Pool))); -- In the Simple_Storage_Pool case, we allow a variable of any -- simple storage pool type, so we Resolve without imposing an -- expected type. else Analyze_And_Resolve (Expr); if not Present (Get_Rep_Pragma (Etype (Expr), Name_Simple_Storage_Pool_Type)) then Error_Msg_N ("expression must be of a simple storage pool type", Expr); end if; end if; if not Denotes_Variable (Expr) then Error_Msg_N ("storage pool must be a variable", Expr); return; end if; if Nkind (Expr) = N_Type_Conversion then T := Etype (Expression (Expr)); else T := Etype (Expr); end if; -- The Stack_Bounded_Pool is used internally for implementing -- access types with a Storage_Size. Since it only work properly -- when used on one specific type, we need to check that it is not -- hijacked improperly: -- type T is access Integer; -- for T'Storage_Size use n; -- type Q is access Float; -- for Q'Storage_Size use T'Storage_Size; -- incorrect if RTE_Available (RE_Stack_Bounded_Pool) and then Base_Type (T) = RTE (RE_Stack_Bounded_Pool) then Error_Msg_N ("non-shareable internal Pool", Expr); return; end if; -- Validate_Remote_Access_To_Class_Wide_Type for attribute -- Storage_Pool since this attribute cannot be defined for such -- types (RM E.2.2(17)). Validate_Remote_Access_To_Class_Wide_Type (N); -- If the argument is a name that is not an entity name, then -- we construct a renaming operation to define an entity of -- type storage pool. if not Is_Entity_Name (Expr) and then Is_Object_Reference (Expr) then Pool := Make_Temporary (Loc, 'P', Expr); declare Rnode : constant Node_Id := Make_Object_Renaming_Declaration (Loc, Defining_Identifier => Pool, Subtype_Mark => New_Occurrence_Of (Etype (Expr), Loc), Name => Expr); begin -- If the attribute definition clause comes from an aspect -- clause, then insert the renaming before the associated -- entity's declaration, since the attribute clause has -- not yet been appended to the declaration list. if From_Aspect_Specification (N) then Insert_Before (Parent (Entity (N)), Rnode); else Insert_Before (N, Rnode); end if; Analyze (Rnode); Associate_Storage_Pool (U_Ent, Pool); end; elsif Is_Entity_Name (Expr) then Pool := Entity (Expr); -- If pool is a renamed object, get original one. This can -- happen with an explicit renaming, and within instances. while Present (Renamed_Object (Pool)) and then Is_Entity_Name (Renamed_Object (Pool)) loop Pool := Entity (Renamed_Object (Pool)); end loop; if Present (Renamed_Object (Pool)) and then Nkind (Renamed_Object (Pool)) = N_Type_Conversion and then Is_Entity_Name (Expression (Renamed_Object (Pool))) then Pool := Entity (Expression (Renamed_Object (Pool))); end if; Associate_Storage_Pool (U_Ent, Pool); elsif Nkind (Expr) = N_Type_Conversion and then Is_Entity_Name (Expression (Expr)) and then Nkind (Original_Node (Expr)) = N_Attribute_Reference then Pool := Entity (Expression (Expr)); Associate_Storage_Pool (U_Ent, Pool); else Error_Msg_N ("incorrect reference to a Storage Pool", Expr); return; end if; end Storage_Pool; ------------------ -- Storage_Size -- ------------------ -- Storage_Size attribute definition clause when Attribute_Storage_Size => Storage_Size : declare Btype : constant Entity_Id := Base_Type (U_Ent); begin if Is_Task_Type (U_Ent) then -- Check obsolescent (but never obsolescent if from aspect) if not From_Aspect_Specification (N) then Check_Restriction (No_Obsolescent_Features, N); if Warn_On_Obsolescent_Feature then Error_Msg_N ("?j?storage size clause for task is an obsolescent " & "feature (RM J.9)", N); Error_Msg_N ("\?j?use Storage_Size pragma instead", N); end if; end if; FOnly := True; end if; if not Is_Access_Type (U_Ent) and then Ekind (U_Ent) /= E_Task_Type then Error_Msg_N ("storage size cannot be given for &", Nam); elsif Is_Access_Type (U_Ent) and Is_Derived_Type (U_Ent) then Error_Msg_N ("storage size cannot be given for a derived access type", Nam); elsif Duplicate_Clause then null; else -- Validate_Remote_Access_To_Class_Wide_Type for attribute -- Storage_Size since this attribute cannot be defined for such -- types (RM E.2.2(17)). Validate_Remote_Access_To_Class_Wide_Type (N); Analyze_And_Resolve (Expr, Any_Integer); if Is_Access_Type (U_Ent) then -- Check for Storage_Pool previously given declare SP : constant Node_Id := Get_Attribute_Definition_Clause (U_Ent, Attribute_Storage_Pool); begin if Present (SP) then Check_Pool_Size_Clash (U_Ent, SP, N); end if; end; -- Special case of for x'Storage_Size use 0 if Is_OK_Static_Expression (Expr) and then Expr_Value (Expr) = 0 then Set_No_Pool_Assigned (Btype); end if; end if; Set_Has_Storage_Size_Clause (Btype); end if; end Storage_Size; ----------------- -- Stream_Size -- ----------------- when Attribute_Stream_Size => Stream_Size : declare Size : constant Uint := Static_Integer (Expr); begin if Ada_Version <= Ada_95 then Check_Restriction (No_Implementation_Attributes, N); end if; if Duplicate_Clause then null; elsif Is_Elementary_Type (U_Ent) then if Size /= System_Storage_Unit and then Size /= System_Storage_Unit * 2 and then Size /= System_Storage_Unit * 3 and then Size /= System_Storage_Unit * 4 and then Size /= System_Storage_Unit * 8 then Error_Msg_N ("stream size for elementary type must be 8, 16, 24, " & "32 or 64", N); elsif RM_Size (U_Ent) > Size then Error_Msg_Uint_1 := RM_Size (U_Ent); Error_Msg_N ("stream size for elementary type must be 8, 16, 24, " & "32 or 64 and at least ^", N); end if; Set_Has_Stream_Size_Clause (U_Ent); else Error_Msg_N ("Stream_Size cannot be given for &", Nam); end if; end Stream_Size; ---------------- -- Value_Size -- ---------------- -- Value_Size attribute definition clause when Attribute_Value_Size => Value_Size : declare Size : constant Uint := Static_Integer (Expr); Biased : Boolean; begin if not Is_Type (U_Ent) then Error_Msg_N ("Value_Size cannot be given for &", Nam); elsif Duplicate_Clause then null; elsif Is_Array_Type (U_Ent) and then not Is_Constrained (U_Ent) then Error_Msg_N ("Value_Size cannot be given for unconstrained array", Nam); else if Is_Elementary_Type (U_Ent) then Check_Size (Expr, U_Ent, Size, Biased); Set_Biased (U_Ent, N, "value size clause", Biased); end if; Set_RM_Size (U_Ent, Size); end if; end Value_Size; ----------------------- -- Variable_Indexing -- ----------------------- when Attribute_Variable_Indexing => Check_Indexing_Functions; ----------- -- Write -- ----------- when Attribute_Write => Analyze_Stream_TSS_Definition (TSS_Stream_Write); Set_Has_Specified_Stream_Write (Ent); -- All other attributes cannot be set when others => Error_Msg_N ("attribute& cannot be set with definition clause", N); end case; -- The test for the type being frozen must be performed after any -- expression the clause has been analyzed since the expression itself -- might cause freezing that makes the clause illegal. if Rep_Item_Too_Late (U_Ent, N, FOnly) then return; end if; end Analyze_Attribute_Definition_Clause; ---------------------------- -- Analyze_Code_Statement -- ---------------------------- procedure Analyze_Code_Statement (N : Node_Id) is HSS : constant Node_Id := Parent (N); SBody : constant Node_Id := Parent (HSS); Subp : constant Entity_Id := Current_Scope; Stmt : Node_Id; Decl : Node_Id; StmtO : Node_Id; DeclO : Node_Id; begin -- Accept foreign code statements for CodePeer. The analysis is skipped -- to avoid rejecting unrecognized constructs. if CodePeer_Mode then Set_Analyzed (N); return; end if; -- Analyze and check we get right type, note that this implements the -- requirement (RM 13.8(1)) that Machine_Code be with'ed, since that is -- the only way that Asm_Insn could possibly be visible. Analyze_And_Resolve (Expression (N)); if Etype (Expression (N)) = Any_Type then return; elsif Etype (Expression (N)) /= RTE (RE_Asm_Insn) then Error_Msg_N ("incorrect type for code statement", N); return; end if; Check_Code_Statement (N); -- Make sure we appear in the handled statement sequence of a subprogram -- (RM 13.8(3)). if Nkind (HSS) /= N_Handled_Sequence_Of_Statements or else Nkind (SBody) /= N_Subprogram_Body then Error_Msg_N ("code statement can only appear in body of subprogram", N); return; end if; -- Do remaining checks (RM 13.8(3)) if not already done if not Is_Machine_Code_Subprogram (Subp) then Set_Is_Machine_Code_Subprogram (Subp); -- No exception handlers allowed if Present (Exception_Handlers (HSS)) then Error_Msg_N ("exception handlers not permitted in machine code subprogram", First (Exception_Handlers (HSS))); end if; -- No declarations other than use clauses and pragmas (we allow -- certain internally generated declarations as well). Decl := First (Declarations (SBody)); while Present (Decl) loop DeclO := Original_Node (Decl); if Comes_From_Source (DeclO) and Nkind (DeclO) not in N_Pragma | N_Use_Package_Clause | N_Use_Type_Clause | N_Implicit_Label_Declaration then Error_Msg_N ("this declaration not allowed in machine code subprogram", DeclO); end if; Next (Decl); end loop; -- No statements other than code statements, pragmas, and labels. -- Again we allow certain internally generated statements. -- In Ada 2012, qualified expressions are names, and the code -- statement is initially parsed as a procedure call. Stmt := First (Statements (HSS)); while Present (Stmt) loop StmtO := Original_Node (Stmt); -- A procedure call transformed into a code statement is OK if Ada_Version >= Ada_2012 and then Nkind (StmtO) = N_Procedure_Call_Statement and then Nkind (Name (StmtO)) = N_Qualified_Expression then null; elsif Comes_From_Source (StmtO) and then Nkind (StmtO) not in N_Pragma | N_Label | N_Code_Statement then Error_Msg_N ("this statement is not allowed in machine code subprogram", StmtO); end if; Next (Stmt); end loop; end if; end Analyze_Code_Statement; ----------------------------------------------- -- Analyze_Enumeration_Representation_Clause -- ----------------------------------------------- procedure Analyze_Enumeration_Representation_Clause (N : Node_Id) is Ident : constant Node_Id := Identifier (N); Aggr : constant Node_Id := Array_Aggregate (N); Enumtype : Entity_Id; Elit : Entity_Id; Expr : Node_Id; Assoc : Node_Id; Choice : Node_Id; Val : Uint; Err : Boolean := False; -- Set True to avoid cascade errors and crashes on incorrect source code Lo : constant Uint := Expr_Value (Type_Low_Bound (Universal_Integer)); Hi : constant Uint := Expr_Value (Type_High_Bound (Universal_Integer)); -- Allowed range of universal integer (= allowed range of enum lit vals) Min : Uint; Max : Uint; -- Minimum and maximum values of entries Max_Node : Node_Id := Empty; -- init to avoid warning -- Pointer to node for literal providing max value begin if Ignore_Rep_Clauses then Kill_Rep_Clause (N); return; end if; -- Ignore enumeration rep clauses by default in CodePeer mode, -- unless -gnatd.I is specified, as a work around for potential false -- positive messages. if CodePeer_Mode and not Debug_Flag_Dot_II then return; end if; -- First some basic error checks Find_Type (Ident); Enumtype := Entity (Ident); if Enumtype = Any_Type or else Rep_Item_Too_Early (Enumtype, N) then return; else Enumtype := Underlying_Type (Enumtype); end if; if not Is_Enumeration_Type (Enumtype) then Error_Msg_NE ("enumeration type required, found}", Ident, First_Subtype (Enumtype)); return; end if; -- Ignore rep clause on generic actual type. This will already have -- been flagged on the template as an error, and this is the safest -- way to ensure we don't get a junk cascaded message in the instance. if Is_Generic_Actual_Type (Enumtype) then return; -- Type must be in current scope elsif Scope (Enumtype) /= Current_Scope then Error_Msg_N ("type must be declared in this scope", Ident); return; -- Type must be a first subtype elsif not Is_First_Subtype (Enumtype) then Error_Msg_N ("cannot give enumeration rep clause for subtype", N); return; -- Ignore duplicate rep clause elsif Has_Enumeration_Rep_Clause (Enumtype) then Error_Msg_N ("duplicate enumeration rep clause ignored", N); return; -- Don't allow rep clause for standard [wide_[wide_]]character elsif Is_Standard_Character_Type (Enumtype) then Error_Msg_N ("enumeration rep clause not allowed for this type", N); return; -- Check that the expression is a proper aggregate (no parentheses) elsif Paren_Count (Aggr) /= 0 then Error_Msg ("extra parentheses surrounding aggregate not allowed", First_Sloc (Aggr)); return; -- All tests passed, so set rep clause in place else Set_Has_Enumeration_Rep_Clause (Enumtype); Set_Has_Enumeration_Rep_Clause (Base_Type (Enumtype)); end if; -- Now we process the aggregate. Note that we don't use the normal -- aggregate code for this purpose, because we don't want any of the -- normal expansion activities, and a number of special semantic -- rules apply (including the component type being any integer type) Elit := First_Literal (Enumtype); -- First the positional entries if any if Present (Expressions (Aggr)) then Expr := First (Expressions (Aggr)); while Present (Expr) loop if No (Elit) then Error_Msg_N ("too many entries in aggregate", Expr); return; end if; Val := Static_Integer (Expr); -- Err signals that we found some incorrect entries processing -- the list. The final checks for completeness and ordering are -- skipped in this case. if Val = No_Uint then Err := True; elsif Val < Lo or else Hi < Val then Error_Msg_N ("value outside permitted range", Expr); Err := True; end if; Set_Enumeration_Rep (Elit, Val); Set_Enumeration_Rep_Expr (Elit, Expr); Next (Expr); Next (Elit); end loop; end if; -- Now process the named entries if present if Present (Component_Associations (Aggr)) then Assoc := First (Component_Associations (Aggr)); while Present (Assoc) loop Choice := First (Choices (Assoc)); if Present (Next (Choice)) then Error_Msg_N ("multiple choice not allowed here", Next (Choice)); Err := True; end if; if Nkind (Choice) = N_Others_Choice then Error_Msg_N ("others choice not allowed here", Choice); Err := True; elsif Nkind (Choice) = N_Range then -- ??? should allow zero/one element range here Error_Msg_N ("range not allowed here", Choice); Err := True; else Analyze_And_Resolve (Choice, Enumtype); if Error_Posted (Choice) then Err := True; end if; if not Err then if Is_Entity_Name (Choice) and then Is_Type (Entity (Choice)) then Error_Msg_N ("subtype name not allowed here", Choice); Err := True; -- ??? should allow static subtype with zero/one entry elsif Etype (Choice) = Base_Type (Enumtype) then if not Is_OK_Static_Expression (Choice) then Flag_Non_Static_Expr ("non-static expression used for choice!", Choice); Err := True; else Elit := Expr_Value_E (Choice); if Present (Enumeration_Rep_Expr (Elit)) then Error_Msg_Sloc := Sloc (Enumeration_Rep_Expr (Elit)); Error_Msg_NE ("representation for& previously given#", Choice, Elit); Err := True; end if; Set_Enumeration_Rep_Expr (Elit, Expression (Assoc)); Expr := Expression (Assoc); Val := Static_Integer (Expr); if Val = No_Uint then Err := True; elsif Val < Lo or else Hi < Val then Error_Msg_N ("value outside permitted range", Expr); Err := True; end if; Set_Enumeration_Rep (Elit, Val); end if; end if; end if; end if; Next (Assoc); end loop; end if; -- Aggregate is fully processed. Now we check that a full set of -- representations was given, and that they are in range and in order. -- These checks are only done if no other errors occurred. if not Err then Min := No_Uint; Max := No_Uint; Elit := First_Literal (Enumtype); while Present (Elit) loop if No (Enumeration_Rep_Expr (Elit)) then Error_Msg_NE ("missing representation for&!", N, Elit); else Val := Enumeration_Rep (Elit); if Min = No_Uint then Min := Val; end if; if Val /= No_Uint then if Max /= No_Uint and then Val <= Max then Error_Msg_NE ("enumeration value for& not ordered!", Enumeration_Rep_Expr (Elit), Elit); end if; Max_Node := Enumeration_Rep_Expr (Elit); Max := Val; end if; -- If there is at least one literal whose representation is not -- equal to the Pos value, then note that this enumeration type -- has a non-standard representation. if Val /= Enumeration_Pos (Elit) then Set_Has_Non_Standard_Rep (Base_Type (Enumtype)); end if; end if; Next (Elit); end loop; -- Now set proper size information declare Minsize : Uint := UI_From_Int (Minimum_Size (Enumtype)); begin if Has_Size_Clause (Enumtype) then -- All OK, if size is OK now if RM_Size (Enumtype) >= Minsize then null; else -- Try if we can get by with biasing Minsize := UI_From_Int (Minimum_Size (Enumtype, Biased => True)); -- Error message if even biasing does not work if RM_Size (Enumtype) < Minsize then Error_Msg_Uint_1 := RM_Size (Enumtype); Error_Msg_Uint_2 := Max; Error_Msg_N ("previously given size (^) is too small " & "for this value (^)", Max_Node); -- If biasing worked, indicate that we now have biased rep else Set_Biased (Enumtype, Size_Clause (Enumtype), "size clause"); end if; end if; else Set_RM_Size (Enumtype, Minsize); Set_Enum_Esize (Enumtype); end if; Set_RM_Size (Base_Type (Enumtype), RM_Size (Enumtype)); Set_Esize (Base_Type (Enumtype), Esize (Enumtype)); Set_Alignment (Base_Type (Enumtype), Alignment (Enumtype)); end; end if; -- We repeat the too late test in case it froze itself if Rep_Item_Too_Late (Enumtype, N) then null; end if; end Analyze_Enumeration_Representation_Clause; ---------------------------- -- Analyze_Free_Statement -- ---------------------------- procedure Analyze_Free_Statement (N : Node_Id) is begin Analyze (Expression (N)); end Analyze_Free_Statement; --------------------------- -- Analyze_Freeze_Entity -- --------------------------- procedure Analyze_Freeze_Entity (N : Node_Id) is begin Freeze_Entity_Checks (N); end Analyze_Freeze_Entity; ----------------------------------- -- Analyze_Freeze_Generic_Entity -- ----------------------------------- procedure Analyze_Freeze_Generic_Entity (N : Node_Id) is E : constant Entity_Id := Entity (N); begin if not Is_Frozen (E) and then Has_Delayed_Aspects (E) then Analyze_Aspects_At_Freeze_Point (E); end if; Freeze_Entity_Checks (N); end Analyze_Freeze_Generic_Entity; ------------------------------------------ -- Analyze_Record_Representation_Clause -- ------------------------------------------ -- Note: we check as much as we can here, but we can't do any checks -- based on the position values (e.g. overlap checks) until freeze time -- because especially in Ada 2005 (machine scalar mode), the processing -- for non-standard bit order can substantially change the positions. -- See procedure Check_Record_Representation_Clause (called from Freeze) -- for the remainder of this processing. procedure Analyze_Record_Representation_Clause (N : Node_Id) is Ident : constant Node_Id := Identifier (N); Biased : Boolean; CC : Node_Id; Comp : Entity_Id; Fbit : Uint; Lbit : Uint; Ocomp : Entity_Id; Posit : Uint; Rectype : Entity_Id; Recdef : Node_Id; function Is_Inherited (Comp : Entity_Id) return Boolean; -- True if Comp is an inherited component in a record extension ------------------ -- Is_Inherited -- ------------------ function Is_Inherited (Comp : Entity_Id) return Boolean is Comp_Base : Entity_Id; begin if Ekind (Rectype) = E_Record_Subtype then Comp_Base := Original_Record_Component (Comp); else Comp_Base := Comp; end if; return Comp_Base /= Original_Record_Component (Comp_Base); end Is_Inherited; -- Local variables Is_Record_Extension : Boolean; -- True if Rectype is a record extension CR_Pragma : Node_Id := Empty; -- Points to N_Pragma node if Complete_Representation pragma present -- Start of processing for Analyze_Record_Representation_Clause begin if Ignore_Rep_Clauses then Kill_Rep_Clause (N); return; end if; Find_Type (Ident); Rectype := Entity (Ident); if Rectype = Any_Type or else Rep_Item_Too_Early (Rectype, N) then return; else Rectype := Underlying_Type (Rectype); end if; -- First some basic error checks if not Is_Record_Type (Rectype) then Error_Msg_NE ("record type required, found}", Ident, First_Subtype (Rectype)); return; elsif Scope (Rectype) /= Current_Scope then Error_Msg_N ("type must be declared in this scope", N); return; elsif not Is_First_Subtype (Rectype) then Error_Msg_N ("cannot give record rep clause for subtype", N); return; elsif Has_Record_Rep_Clause (Rectype) then Error_Msg_N ("duplicate record rep clause ignored", N); return; elsif Rep_Item_Too_Late (Rectype, N) then return; end if; -- We know we have a first subtype, now possibly go to the anonymous -- base type to determine whether Rectype is a record extension. Recdef := Type_Definition (Declaration_Node (Base_Type (Rectype))); Is_Record_Extension := Nkind (Recdef) = N_Derived_Type_Definition and then Present (Record_Extension_Part (Recdef)); if Present (Mod_Clause (N)) then declare M : constant Node_Id := Mod_Clause (N); P : constant List_Id := Pragmas_Before (M); Ignore : Uint; begin Check_Restriction (No_Obsolescent_Features, Mod_Clause (N)); if Warn_On_Obsolescent_Feature then Error_Msg_N ("?j?mod clause is an obsolescent feature (RM J.8)", N); Error_Msg_N ("\?j?use alignment attribute definition clause instead", N); end if; if Present (P) then Analyze_List (P); end if; -- Get the alignment value to perform error checking Ignore := Get_Alignment_Value (Expression (M)); end; end if; -- For untagged types, clear any existing component clauses for the -- type. If the type is derived, this is what allows us to override -- a rep clause for the parent. For type extensions, the representation -- of the inherited components is inherited, so we want to keep previous -- component clauses for completeness. if not Is_Tagged_Type (Rectype) then Comp := First_Component_Or_Discriminant (Rectype); while Present (Comp) loop Set_Component_Clause (Comp, Empty); Next_Component_Or_Discriminant (Comp); end loop; end if; -- All done if no component clauses CC := First (Component_Clauses (N)); if No (CC) then return; end if; -- A representation like this applies to the base type Set_Has_Record_Rep_Clause (Base_Type (Rectype)); Set_Has_Non_Standard_Rep (Base_Type (Rectype)); Set_Has_Specified_Layout (Base_Type (Rectype)); -- Process the component clauses while Present (CC) loop -- Pragma if Nkind (CC) = N_Pragma then Analyze (CC); -- The only pragma of interest is Complete_Representation if Pragma_Name (CC) = Name_Complete_Representation then CR_Pragma := CC; end if; -- Processing for real component clause else Posit := Static_Integer (Position (CC)); Fbit := Static_Integer (First_Bit (CC)); Lbit := Static_Integer (Last_Bit (CC)); if Posit /= No_Uint and then Fbit /= No_Uint and then Lbit /= No_Uint then if Posit < 0 then Error_Msg_N ("position cannot be negative", Position (CC)); elsif Fbit < 0 then Error_Msg_N ("first bit cannot be negative", First_Bit (CC)); -- The Last_Bit specified in a component clause must not be -- less than the First_Bit minus one (RM-13.5.1(10)). elsif Lbit < Fbit - 1 then Error_Msg_N ("last bit cannot be less than first bit minus one", Last_Bit (CC)); -- Values look OK, so find the corresponding record component -- Even though the syntax allows an attribute reference for -- implementation-defined components, GNAT does not allow the -- tag to get an explicit position. elsif Nkind (Component_Name (CC)) = N_Attribute_Reference then if Attribute_Name (Component_Name (CC)) = Name_Tag then Error_Msg_N ("position of tag cannot be specified", CC); else Error_Msg_N ("illegal component name", CC); end if; else Comp := First_Entity (Rectype); while Present (Comp) loop exit when Chars (Comp) = Chars (Component_Name (CC)); Next_Entity (Comp); end loop; if No (Comp) then -- Maybe component of base type that is absent from -- statically constrained first subtype. Comp := First_Entity (Base_Type (Rectype)); while Present (Comp) loop exit when Chars (Comp) = Chars (Component_Name (CC)); Next_Entity (Comp); end loop; end if; if No (Comp) then Error_Msg_N ("component clause is for non-existent field", CC); -- Ada 2012 (AI05-0026): Any name that denotes a -- discriminant of an object of an unchecked union type -- shall not occur within a record_representation_clause. -- The general restriction of using record rep clauses on -- Unchecked_Union types has now been lifted. Since it is -- possible to introduce a record rep clause which mentions -- the discriminant of an Unchecked_Union in non-Ada 2012 -- code, this check is applied to all versions of the -- language. elsif Ekind (Comp) = E_Discriminant and then Is_Unchecked_Union (Rectype) then Error_Msg_N ("cannot reference discriminant of unchecked union", Component_Name (CC)); elsif Is_Record_Extension and then Is_Inherited (Comp) then Error_Msg_NE ("component clause not allowed for inherited " & "component&", CC, Comp); elsif Present (Component_Clause (Comp)) then -- Diagnose duplicate rep clause, or check consistency -- if this is an inherited component. In a double fault, -- there may be a duplicate inconsistent clause for an -- inherited component. if Scope (Original_Record_Component (Comp)) = Rectype or else Parent (Component_Clause (Comp)) = N then Error_Msg_Sloc := Sloc (Component_Clause (Comp)); Error_Msg_N ("component clause previously given#", CC); else declare Rep1 : constant Node_Id := Component_Clause (Comp); begin if Intval (Position (Rep1)) /= Intval (Position (CC)) or else Intval (First_Bit (Rep1)) /= Intval (First_Bit (CC)) or else Intval (Last_Bit (Rep1)) /= Intval (Last_Bit (CC)) then Error_Msg_N ("component clause inconsistent with " & "representation of ancestor", CC); elsif Warn_On_Redundant_Constructs then Error_Msg_N ("?r?redundant confirming component clause " & "for component!", CC); end if; end; end if; -- Normal case where this is the first component clause we -- have seen for this entity, so set it up properly. else -- Make reference for field in record rep clause and set -- appropriate entity field in the field identifier. Generate_Reference (Comp, Component_Name (CC), Set_Ref => False); Set_Entity (Component_Name (CC), Comp); -- Update Fbit and Lbit to the actual bit number Fbit := Fbit + UI_From_Int (SSU) * Posit; Lbit := Lbit + UI_From_Int (SSU) * Posit; if Has_Size_Clause (Rectype) and then RM_Size (Rectype) <= Lbit then Error_Msg_Uint_1 := RM_Size (Rectype); Error_Msg_Uint_2 := Lbit + 1; Error_Msg_N ("bit number out of range of specified " & "size (expected ^, got ^)", Last_Bit (CC)); else Set_Component_Clause (Comp, CC); Set_Component_Bit_Offset (Comp, Fbit); Set_Esize (Comp, 1 + (Lbit - Fbit)); Set_Normalized_First_Bit (Comp, Fbit mod SSU); Set_Normalized_Position (Comp, Fbit / SSU); Set_Normalized_Position_Max (Comp, Normalized_Position (Comp)); if Warn_On_Overridden_Size and then Has_Size_Clause (Etype (Comp)) and then RM_Size (Etype (Comp)) /= Esize (Comp) then Error_Msg_NE ("?S?component size overrides size clause for&", Component_Name (CC), Etype (Comp)); end if; Check_Size (Component_Name (CC), Etype (Comp), Esize (Comp), Biased); Set_Biased (Comp, First_Node (CC), "component clause", Biased); -- This information is also set in the corresponding -- component of the base type, found by accessing the -- Original_Record_Component link if it is present. Ocomp := Original_Record_Component (Comp); if Present (Ocomp) and then Ocomp /= Comp then Set_Component_Clause (Ocomp, CC); Set_Component_Bit_Offset (Ocomp, Fbit); Set_Esize (Ocomp, 1 + (Lbit - Fbit)); Set_Normalized_First_Bit (Ocomp, Fbit mod SSU); Set_Normalized_Position (Ocomp, Fbit / SSU); Set_Normalized_Position_Max (Ocomp, Normalized_Position (Ocomp)); -- Note: we don't use Set_Biased here, because we -- already gave a warning above if needed, and we -- would get a duplicate for the same name here. Set_Has_Biased_Representation (Ocomp, Has_Biased_Representation (Comp)); end if; if Esize (Comp) < 0 then Error_Msg_N ("component size is negative", CC); end if; end if; end if; end if; end if; end if; Next (CC); end loop; -- Check missing components if Complete_Representation pragma appeared if Present (CR_Pragma) then Comp := First_Component_Or_Discriminant (Rectype); while Present (Comp) loop if No (Component_Clause (Comp)) then Error_Msg_NE ("missing component clause for &", CR_Pragma, Comp); end if; Next_Component_Or_Discriminant (Comp); end loop; -- Give missing components warning if required elsif Warn_On_Unrepped_Components then declare Num_Repped_Components : Nat := 0; Num_Unrepped_Components : Nat := 0; begin -- First count number of repped and unrepped components Comp := First_Component_Or_Discriminant (Rectype); while Present (Comp) loop if Present (Component_Clause (Comp)) then Num_Repped_Components := Num_Repped_Components + 1; else Num_Unrepped_Components := Num_Unrepped_Components + 1; end if; Next_Component_Or_Discriminant (Comp); end loop; -- We are only interested in the case where there is at least one -- unrepped component, and at least half the components have rep -- clauses. We figure that if less than half have them, then the -- partial rep clause is really intentional. If the component -- type has no underlying type set at this point (as for a generic -- formal type), we don't know enough to give a warning on the -- component. if Num_Unrepped_Components > 0 and then Num_Unrepped_Components < Num_Repped_Components then Comp := First_Component_Or_Discriminant (Rectype); while Present (Comp) loop if No (Component_Clause (Comp)) and then Comes_From_Source (Comp) and then Present (Underlying_Type (Etype (Comp))) and then (Is_Scalar_Type (Underlying_Type (Etype (Comp))) or else Size_Known_At_Compile_Time (Underlying_Type (Etype (Comp)))) and then not Has_Warnings_Off (Rectype) -- Ignore discriminant in unchecked union, since it is -- not there, and cannot have a component clause. and then (not Is_Unchecked_Union (Rectype) or else Ekind (Comp) /= E_Discriminant) then Error_Msg_Sloc := Sloc (Comp); Error_Msg_NE ("?C?no component clause given for & declared #", N, Comp); end if; Next_Component_Or_Discriminant (Comp); end loop; end if; end; end if; end Analyze_Record_Representation_Clause; ------------------------------------- -- Build_Discrete_Static_Predicate -- ------------------------------------- procedure Build_Discrete_Static_Predicate (Typ : Entity_Id; Expr : Node_Id; Nam : Name_Id) is Loc : constant Source_Ptr := Sloc (Expr); Non_Static : exception; -- Raised if something non-static is found Btyp : constant Entity_Id := Base_Type (Typ); BLo : constant Uint := Expr_Value (Type_Low_Bound (Btyp)); BHi : constant Uint := Expr_Value (Type_High_Bound (Btyp)); -- Low bound and high bound value of base type of Typ TLo : Uint; THi : Uint; -- Bounds for constructing the static predicate. We use the bound of the -- subtype if it is static, otherwise the corresponding base type bound. -- Note: a non-static subtype can have a static predicate. type REnt is record Lo, Hi : Uint; end record; -- One entry in a Rlist value, a single REnt (range entry) value denotes -- one range from Lo to Hi. To represent a single value range Lo = Hi = -- value. type RList is array (Nat range <>) of REnt; -- A list of ranges. The ranges are sorted in increasing order, and are -- disjoint (there is a gap of at least one value between each range in -- the table). A value is in the set of ranges in Rlist if it lies -- within one of these ranges. False_Range : constant RList := RList'(1 .. 0 => REnt'(No_Uint, No_Uint)); -- An empty set of ranges represents a range list that can never be -- satisfied, since there are no ranges in which the value could lie, -- so it does not lie in any of them. False_Range is a canonical value -- for this empty set, but general processing should test for an Rlist -- with length zero (see Is_False predicate), since other null ranges -- may appear which must be treated as False. True_Range : constant RList := RList'(1 => REnt'(BLo, BHi)); -- Range representing True, value must be in the base range function "and" (Left : RList; Right : RList) return RList; -- And's together two range lists, returning a range list. This is a set -- intersection operation. function "or" (Left : RList; Right : RList) return RList; -- Or's together two range lists, returning a range list. This is a set -- union operation. function "not" (Right : RList) return RList; -- Returns complement of a given range list, i.e. a range list -- representing all the values in TLo .. THi that are not in the input -- operand Right. function Build_Val (V : Uint) return Node_Id; -- Return an analyzed N_Identifier node referencing this value, suitable -- for use as an entry in the Static_Discrte_Predicate list. This node -- is typed with the base type. function Build_Range (Lo : Uint; Hi : Uint) return Node_Id; -- Return an analyzed N_Range node referencing this range, suitable for -- use as an entry in the Static_Discrete_Predicate list. This node is -- typed with the base type. function Get_RList (Exp : Node_Id) return RList; -- This is a recursive routine that converts the given expression into a -- list of ranges, suitable for use in building the static predicate. function Is_False (R : RList) return Boolean; pragma Inline (Is_False); -- Returns True if the given range list is empty, and thus represents a -- False list of ranges that can never be satisfied. function Is_True (R : RList) return Boolean; -- Returns True if R trivially represents the True predicate by having a -- single range from BLo to BHi. function Is_Type_Ref (N : Node_Id) return Boolean; pragma Inline (Is_Type_Ref); -- Returns if True if N is a reference to the type for the predicate in -- the expression (i.e. if it is an identifier whose Chars field matches -- the Nam given in the call). N must not be parenthesized, if the type -- name appears in parens, this routine will return False. function Lo_Val (N : Node_Id) return Uint; -- Given an entry from a Static_Discrete_Predicate list that is either -- a static expression or static range, gets either the expression value -- or the low bound of the range. function Hi_Val (N : Node_Id) return Uint; -- Given an entry from a Static_Discrete_Predicate list that is either -- a static expression or static range, gets either the expression value -- or the high bound of the range. function Membership_Entry (N : Node_Id) return RList; -- Given a single membership entry (range, value, or subtype), returns -- the corresponding range list. Raises Static_Error if not static. function Membership_Entries (N : Node_Id) return RList; -- Given an element on an alternatives list of a membership operation, -- returns the range list corresponding to this entry and all following -- entries (i.e. returns the "or" of this list of values). function Stat_Pred (Typ : Entity_Id) return RList; -- Given a type, if it has a static predicate, then return the predicate -- as a range list, otherwise raise Non_Static. ----------- -- "and" -- ----------- function "and" (Left : RList; Right : RList) return RList is FEnt : REnt; -- First range of result SLeft : Nat := Left'First; -- Start of rest of left entries SRight : Nat := Right'First; -- Start of rest of right entries begin -- If either range is True, return the other if Is_True (Left) then return Right; elsif Is_True (Right) then return Left; end if; -- If either range is False, return False if Is_False (Left) or else Is_False (Right) then return False_Range; end if; -- Loop to remove entries at start that are disjoint, and thus just -- get discarded from the result entirely. loop -- If no operands left in either operand, result is false if SLeft > Left'Last or else SRight > Right'Last then return False_Range; -- Discard first left operand entry if disjoint with right elsif Left (SLeft).Hi < Right (SRight).Lo then SLeft := SLeft + 1; -- Discard first right operand entry if disjoint with left elsif Right (SRight).Hi < Left (SLeft).Lo then SRight := SRight + 1; -- Otherwise we have an overlapping entry else exit; end if; end loop; -- Now we have two non-null operands, and first entries overlap. The -- first entry in the result will be the overlapping part of these -- two entries. FEnt := REnt'(Lo => UI_Max (Left (SLeft).Lo, Right (SRight).Lo), Hi => UI_Min (Left (SLeft).Hi, Right (SRight).Hi)); -- Now we can remove the entry that ended at a lower value, since its -- contribution is entirely contained in Fent. if Left (SLeft).Hi <= Right (SRight).Hi then SLeft := SLeft + 1; else SRight := SRight + 1; end if; -- Compute result by concatenating this first entry with the "and" of -- the remaining parts of the left and right operands. Note that if -- either of these is empty, "and" will yield empty, so that we will -- end up with just Fent, which is what we want in that case. return FEnt & (Left (SLeft .. Left'Last) and Right (SRight .. Right'Last)); end "and"; ----------- -- "not" -- ----------- function "not" (Right : RList) return RList is begin -- Return True if False range if Is_False (Right) then return True_Range; end if; -- Return False if True range if Is_True (Right) then return False_Range; end if; -- Here if not trivial case declare Result : RList (1 .. Right'Length + 1); -- May need one more entry for gap at beginning and end Count : Nat := 0; -- Number of entries stored in Result begin -- Gap at start if Right (Right'First).Lo > TLo then Count := Count + 1; Result (Count) := REnt'(TLo, Right (Right'First).Lo - 1); end if; -- Gaps between ranges for J in Right'First .. Right'Last - 1 loop Count := Count + 1; Result (Count) := REnt'(Right (J).Hi + 1, Right (J + 1).Lo - 1); end loop; -- Gap at end if Right (Right'Last).Hi < THi then Count := Count + 1; Result (Count) := REnt'(Right (Right'Last).Hi + 1, THi); end if; return Result (1 .. Count); end; end "not"; ---------- -- "or" -- ---------- function "or" (Left : RList; Right : RList) return RList is FEnt : REnt; -- First range of result SLeft : Nat := Left'First; -- Start of rest of left entries SRight : Nat := Right'First; -- Start of rest of right entries begin -- If either range is True, return True if Is_True (Left) or else Is_True (Right) then return True_Range; end if; -- If either range is False (empty), return the other if Is_False (Left) then return Right; elsif Is_False (Right) then return Left; end if; -- Initialize result first entry from left or right operand depending -- on which starts with the lower range. if Left (SLeft).Lo < Right (SRight).Lo then FEnt := Left (SLeft); SLeft := SLeft + 1; else FEnt := Right (SRight); SRight := SRight + 1; end if; -- This loop eats ranges from left and right operands that are -- contiguous with the first range we are gathering. loop -- Eat first entry in left operand if contiguous or overlapped by -- gathered first operand of result. if SLeft <= Left'Last and then Left (SLeft).Lo <= FEnt.Hi + 1 then FEnt.Hi := UI_Max (FEnt.Hi, Left (SLeft).Hi); SLeft := SLeft + 1; -- Eat first entry in right operand if contiguous or overlapped by -- gathered right operand of result. elsif SRight <= Right'Last and then Right (SRight).Lo <= FEnt.Hi + 1 then FEnt.Hi := UI_Max (FEnt.Hi, Right (SRight).Hi); SRight := SRight + 1; -- All done if no more entries to eat else exit; end if; end loop; -- Obtain result as the first entry we just computed, concatenated -- to the "or" of the remaining results (if one operand is empty, -- this will just concatenate with the other return FEnt & (Left (SLeft .. Left'Last) or Right (SRight .. Right'Last)); end "or"; ----------------- -- Build_Range -- ----------------- function Build_Range (Lo : Uint; Hi : Uint) return Node_Id is Result : Node_Id; begin Result := Make_Range (Loc, Low_Bound => Build_Val (Lo), High_Bound => Build_Val (Hi)); Set_Etype (Result, Btyp); Set_Analyzed (Result); return Result; end Build_Range; --------------- -- Build_Val -- --------------- function Build_Val (V : Uint) return Node_Id is Result : Node_Id; begin if Is_Enumeration_Type (Typ) then Result := Get_Enum_Lit_From_Pos (Typ, V, Loc); else Result := Make_Integer_Literal (Loc, V); end if; Set_Etype (Result, Btyp); Set_Is_Static_Expression (Result); Set_Analyzed (Result); return Result; end Build_Val; --------------- -- Get_RList -- --------------- function Get_RList (Exp : Node_Id) return RList is Op : Node_Kind; Val : Uint; begin -- Static expression can only be true or false if Is_OK_Static_Expression (Exp) then if Expr_Value (Exp) = 0 then return False_Range; else return True_Range; end if; end if; -- Otherwise test node type Op := Nkind (Exp); case Op is -- And when N_And_Then | N_Op_And => return Get_RList (Left_Opnd (Exp)) and Get_RList (Right_Opnd (Exp)); -- Or when N_Op_Or | N_Or_Else => return Get_RList (Left_Opnd (Exp)) or Get_RList (Right_Opnd (Exp)); -- Not when N_Op_Not => return not Get_RList (Right_Opnd (Exp)); -- Comparisons of type with static value when N_Op_Compare => -- Type is left operand if Is_Type_Ref (Left_Opnd (Exp)) and then Is_OK_Static_Expression (Right_Opnd (Exp)) then Val := Expr_Value (Right_Opnd (Exp)); -- Typ is right operand elsif Is_Type_Ref (Right_Opnd (Exp)) and then Is_OK_Static_Expression (Left_Opnd (Exp)) then Val := Expr_Value (Left_Opnd (Exp)); -- Invert sense of comparison case Op is when N_Op_Gt => Op := N_Op_Lt; when N_Op_Lt => Op := N_Op_Gt; when N_Op_Ge => Op := N_Op_Le; when N_Op_Le => Op := N_Op_Ge; when others => null; end case; -- Other cases are non-static else raise Non_Static; end if; -- Construct range according to comparison operation case Op is when N_Op_Eq => return RList'(1 => REnt'(Val, Val)); when N_Op_Ge => return RList'(1 => REnt'(Val, BHi)); when N_Op_Gt => return RList'(1 => REnt'(Val + 1, BHi)); when N_Op_Le => return RList'(1 => REnt'(BLo, Val)); when N_Op_Lt => return RList'(1 => REnt'(BLo, Val - 1)); when N_Op_Ne => return RList'(REnt'(BLo, Val - 1), REnt'(Val + 1, BHi)); when others => raise Program_Error; end case; -- Membership (IN) when N_In => if not Is_Type_Ref (Left_Opnd (Exp)) then raise Non_Static; end if; if Present (Right_Opnd (Exp)) then return Membership_Entry (Right_Opnd (Exp)); else return Membership_Entries (First (Alternatives (Exp))); end if; -- Negative membership (NOT IN) when N_Not_In => if not Is_Type_Ref (Left_Opnd (Exp)) then raise Non_Static; end if; if Present (Right_Opnd (Exp)) then return not Membership_Entry (Right_Opnd (Exp)); else return not Membership_Entries (First (Alternatives (Exp))); end if; -- Function call, may be call to static predicate when N_Function_Call => if Is_Entity_Name (Name (Exp)) then declare Ent : constant Entity_Id := Entity (Name (Exp)); begin if Is_Predicate_Function (Ent) or else Is_Predicate_Function_M (Ent) then return Stat_Pred (Etype (First_Formal (Ent))); end if; end; end if; -- Other function call cases are non-static raise Non_Static; -- Qualified expression, dig out the expression when N_Qualified_Expression => return Get_RList (Expression (Exp)); when N_Case_Expression => declare Alt : Node_Id; Choices : List_Id; Dep : Node_Id; begin if not Is_Entity_Name (Expression (Expr)) or else Etype (Expression (Expr)) /= Typ then Error_Msg_N ("expression must denaote subtype", Expression (Expr)); return False_Range; end if; -- Collect discrete choices in all True alternatives Choices := New_List; Alt := First (Alternatives (Exp)); while Present (Alt) loop Dep := Expression (Alt); if not Is_OK_Static_Expression (Dep) then raise Non_Static; elsif Is_True (Expr_Value (Dep)) then Append_List_To (Choices, New_Copy_List (Discrete_Choices (Alt))); end if; Next (Alt); end loop; return Membership_Entries (First (Choices)); end; -- Expression with actions: if no actions, dig out expression when N_Expression_With_Actions => if Is_Empty_List (Actions (Exp)) then return Get_RList (Expression (Exp)); else raise Non_Static; end if; -- Xor operator when N_Op_Xor => return (Get_RList (Left_Opnd (Exp)) and not Get_RList (Right_Opnd (Exp))) or (Get_RList (Right_Opnd (Exp)) and not Get_RList (Left_Opnd (Exp))); -- Any other node type is non-static when others => raise Non_Static; end case; end Get_RList; ------------ -- Hi_Val -- ------------ function Hi_Val (N : Node_Id) return Uint is begin if Is_OK_Static_Expression (N) then return Expr_Value (N); else pragma Assert (Nkind (N) = N_Range); return Expr_Value (High_Bound (N)); end if; end Hi_Val; -------------- -- Is_False -- -------------- function Is_False (R : RList) return Boolean is begin return R'Length = 0; end Is_False; ------------- -- Is_True -- ------------- function Is_True (R : RList) return Boolean is begin return R'Length = 1 and then R (R'First).Lo = BLo and then R (R'First).Hi = BHi; end Is_True; ----------------- -- Is_Type_Ref -- ----------------- function Is_Type_Ref (N : Node_Id) return Boolean is begin return Nkind (N) = N_Identifier and then Chars (N) = Nam and then Paren_Count (N) = 0; end Is_Type_Ref; ------------ -- Lo_Val -- ------------ function Lo_Val (N : Node_Id) return Uint is begin if Is_OK_Static_Expression (N) then return Expr_Value (N); else pragma Assert (Nkind (N) = N_Range); return Expr_Value (Low_Bound (N)); end if; end Lo_Val; ------------------------ -- Membership_Entries -- ------------------------ function Membership_Entries (N : Node_Id) return RList is begin if No (Next (N)) then return Membership_Entry (N); else return Membership_Entry (N) or Membership_Entries (Next (N)); end if; end Membership_Entries; ---------------------- -- Membership_Entry -- ---------------------- function Membership_Entry (N : Node_Id) return RList is Val : Uint; SLo : Uint; SHi : Uint; begin -- Range case if Nkind (N) = N_Range then if not Is_OK_Static_Expression (Low_Bound (N)) or else not Is_OK_Static_Expression (High_Bound (N)) then raise Non_Static; else SLo := Expr_Value (Low_Bound (N)); SHi := Expr_Value (High_Bound (N)); return RList'(1 => REnt'(SLo, SHi)); end if; -- Others case elsif Nkind (N) = N_Others_Choice then declare Choices : constant List_Id := Others_Discrete_Choices (N); Choice : Node_Id; Range_List : RList (1 .. List_Length (Choices)); begin Choice := First (Choices); for J in Range_List'Range loop Range_List (J) := REnt'(Lo_Val (Choice), Hi_Val (Choice)); Next (Choice); end loop; return Range_List; end; -- Static expression case elsif Is_OK_Static_Expression (N) then Val := Expr_Value (N); return RList'(1 => REnt'(Val, Val)); -- Identifier (other than static expression) case else pragma Assert (Nkind (N) in N_Expanded_Name | N_Identifier); -- Type case if Is_Type (Entity (N)) then -- If type has predicates, process them if Has_Predicates (Entity (N)) then return Stat_Pred (Entity (N)); -- For static subtype without predicates, get range elsif Is_OK_Static_Subtype (Entity (N)) then SLo := Expr_Value (Type_Low_Bound (Entity (N))); SHi := Expr_Value (Type_High_Bound (Entity (N))); return RList'(1 => REnt'(SLo, SHi)); -- Any other type makes us non-static else raise Non_Static; end if; -- Any other kind of identifier in predicate (e.g. a non-static -- expression value) means this is not a static predicate. else raise Non_Static; end if; end if; end Membership_Entry; --------------- -- Stat_Pred -- --------------- function Stat_Pred (Typ : Entity_Id) return RList is begin -- Not static if type does not have static predicates if not Has_Static_Predicate (Typ) then raise Non_Static; end if; -- Otherwise we convert the predicate list to a range list declare Spred : constant List_Id := Static_Discrete_Predicate (Typ); Result : RList (1 .. List_Length (Spred)); P : Node_Id; begin P := First (Static_Discrete_Predicate (Typ)); for J in Result'Range loop Result (J) := REnt'(Lo_Val (P), Hi_Val (P)); Next (P); end loop; return Result; end; end Stat_Pred; -- Start of processing for Build_Discrete_Static_Predicate begin -- Establish bounds for the predicate if Compile_Time_Known_Value (Type_Low_Bound (Typ)) then TLo := Expr_Value (Type_Low_Bound (Typ)); else TLo := BLo; end if; if Compile_Time_Known_Value (Type_High_Bound (Typ)) then THi := Expr_Value (Type_High_Bound (Typ)); else THi := BHi; end if; -- Analyze the expression to see if it is a static predicate declare Ranges : constant RList := Get_RList (Expr); -- Range list from expression if it is static Plist : List_Id; begin -- Convert range list into a form for the static predicate. In the -- Ranges array, we just have raw ranges, these must be converted -- to properly typed and analyzed static expressions or range nodes. -- Note: here we limit ranges to the ranges of the subtype, so that -- a predicate is always false for values outside the subtype. That -- seems fine, such values are invalid anyway, and considering them -- to fail the predicate seems allowed and friendly, and furthermore -- simplifies processing for case statements and loops. Plist := New_List; for J in Ranges'Range loop declare Lo : Uint := Ranges (J).Lo; Hi : Uint := Ranges (J).Hi; begin -- Ignore completely out of range entry if Hi < TLo or else Lo > THi then null; -- Otherwise process entry else -- Adjust out of range value to subtype range if Lo < TLo then Lo := TLo; end if; if Hi > THi then Hi := THi; end if; -- Convert range into required form Append_To (Plist, Build_Range (Lo, Hi)); end if; end; end loop; -- Processing was successful and all entries were static, so now we -- can store the result as the predicate list. Set_Static_Discrete_Predicate (Typ, Plist); -- Within a generic the predicate functions themselves need not -- be constructed. if Inside_A_Generic then return; end if; -- The processing for static predicates put the expression into -- canonical form as a series of ranges. It also eliminated -- duplicates and collapsed and combined ranges. We might as well -- replace the alternatives list of the right operand of the -- membership test with the static predicate list, which will -- usually be more efficient. declare New_Alts : constant List_Id := New_List; Old_Node : Node_Id; New_Node : Node_Id; begin Old_Node := First (Plist); while Present (Old_Node) loop New_Node := New_Copy (Old_Node); if Nkind (New_Node) = N_Range then Set_Low_Bound (New_Node, New_Copy (Low_Bound (Old_Node))); Set_High_Bound (New_Node, New_Copy (High_Bound (Old_Node))); end if; Append_To (New_Alts, New_Node); Next (Old_Node); end loop; -- If empty list, replace by False if Is_Empty_List (New_Alts) then Rewrite (Expr, New_Occurrence_Of (Standard_False, Loc)); -- Else replace by set membership test else Rewrite (Expr, Make_In (Loc, Left_Opnd => Make_Identifier (Loc, Nam), Right_Opnd => Empty, Alternatives => New_Alts)); -- Resolve new expression in function context Install_Formals (Predicate_Function (Typ)); Push_Scope (Predicate_Function (Typ)); Analyze_And_Resolve (Expr, Standard_Boolean); Pop_Scope; end if; end; end; -- If non-static, return doing nothing exception when Non_Static => return; end Build_Discrete_Static_Predicate; -------------------------------- -- Build_Export_Import_Pragma -- -------------------------------- function Build_Export_Import_Pragma (Asp : Node_Id; Id : Entity_Id) return Node_Id is Asp_Id : constant Aspect_Id := Get_Aspect_Id (Asp); Expr : constant Node_Id := Expression (Asp); Loc : constant Source_Ptr := Sloc (Asp); Args : List_Id; Conv : Node_Id; Conv_Arg : Node_Id; Dummy_1 : Node_Id; Dummy_2 : Node_Id; EN : Node_Id; LN : Node_Id; Prag : Node_Id; Create_Pragma : Boolean := False; -- This flag is set when the aspect form is such that it warrants the -- creation of a corresponding pragma. begin if Present (Expr) then if Error_Posted (Expr) then null; elsif Is_True (Expr_Value (Expr)) then Create_Pragma := True; end if; -- Otherwise the aspect defaults to True else Create_Pragma := True; end if; -- Nothing to do when the expression is False or is erroneous if not Create_Pragma then return Empty; end if; -- Obtain all interfacing aspects that apply to the related entity Get_Interfacing_Aspects (Iface_Asp => Asp, Conv_Asp => Conv, EN_Asp => EN, Expo_Asp => Dummy_1, Imp_Asp => Dummy_2, LN_Asp => LN); Args := New_List; -- Handle the convention argument if Present (Conv) then Conv_Arg := New_Copy_Tree (Expression (Conv)); -- Assume convention "Ada' when aspect Convention is missing else Conv_Arg := Make_Identifier (Loc, Name_Ada); end if; Append_To (Args, Make_Pragma_Argument_Association (Loc, Chars => Name_Convention, Expression => Conv_Arg)); -- Handle the entity argument Append_To (Args, Make_Pragma_Argument_Association (Loc, Chars => Name_Entity, Expression => New_Occurrence_Of (Id, Loc))); -- Handle the External_Name argument if Present (EN) then Append_To (Args, Make_Pragma_Argument_Association (Loc, Chars => Name_External_Name, Expression => New_Copy_Tree (Expression (EN)))); end if; -- Handle the Link_Name argument if Present (LN) then Append_To (Args, Make_Pragma_Argument_Association (Loc, Chars => Name_Link_Name, Expression => New_Copy_Tree (Expression (LN)))); end if; -- Generate: -- pragma Export/Import -- (Convention => <Conv>/Ada, -- Entity => <Id>, -- [External_Name => <EN>,] -- [Link_Name => <LN>]); Prag := Make_Pragma (Loc, Pragma_Identifier => Make_Identifier (Loc, Chars (Identifier (Asp))), Pragma_Argument_Associations => Args); -- Decorate the relevant aspect and the pragma Set_Aspect_Rep_Item (Asp, Prag); Set_Corresponding_Aspect (Prag, Asp); Set_From_Aspect_Specification (Prag); Set_Parent (Prag, Asp); if Asp_Id = Aspect_Import and then Is_Subprogram (Id) then Set_Import_Pragma (Id, Prag); end if; return Prag; end Build_Export_Import_Pragma; ------------------------------- -- Build_Predicate_Functions -- ------------------------------- -- The functions that are constructed here have the form: -- function typPredicate (Ixxx : typ) return Boolean is -- begin -- return -- typ1Predicate (typ1 (Ixxx)) -- and then typ2Predicate (typ2 (Ixxx)) -- and then ... -- and then exp1 and then exp2 and then ...; -- end typPredicate; -- Here exp1, and exp2 are expressions from Predicate pragmas. Note that -- this is the point at which these expressions get analyzed, providing the -- required delay, and typ1, typ2, are entities from which predicates are -- inherited. Note that we do NOT generate Check pragmas, that's because we -- use this function even if checks are off, e.g. for membership tests. -- Note that the inherited predicates are evaluated first, as required by -- AI12-0071-1. -- Note that Sem_Eval.Real_Or_String_Static_Predicate_Matches depends on -- the form of this return expression. -- If the expression has at least one Raise_Expression, then we also build -- the typPredicateM version of the function, in which any occurrence of a -- Raise_Expression is converted to "return False". -- WARNING: This routine manages Ghost regions. Return statements must be -- replaced by gotos which jump to the end of the routine and restore the -- Ghost mode. procedure Build_Predicate_Functions (Typ : Entity_Id; N : Node_Id) is Loc : constant Source_Ptr := Sloc (Typ); Expr : Node_Id; -- This is the expression for the result of the function. It is -- is build by connecting the component predicates with AND THEN. Expr_M : Node_Id := Empty; -- init to avoid warning -- This is the corresponding return expression for the Predicate_M -- function. It differs in that raise expressions are marked for -- special expansion (see Process_REs). Object_Name : Name_Id; -- Name for argument of Predicate procedure. Note that we use the same -- name for both predicate functions. That way the reference within the -- predicate expression is the same in both functions. Object_Entity : Entity_Id; -- Entity for argument of Predicate procedure Object_Entity_M : Entity_Id; -- Entity for argument of separate Predicate procedure when exceptions -- are present in expression. FDecl : Node_Id; -- The function declaration SId : Entity_Id; -- Its entity Raise_Expression_Present : Boolean := False; -- Set True if Expr has at least one Raise_Expression procedure Add_Condition (Cond : Node_Id); -- Append Cond to Expr using "and then" (or just copy Cond to Expr if -- Expr is empty). procedure Add_Predicates; -- Appends expressions for any Predicate pragmas in the rep item chain -- Typ to Expr. Note that we look only at items for this exact entity. -- Inheritance of predicates for the parent type is done by calling the -- Predicate_Function of the parent type, using Add_Call above. procedure Add_Call (T : Entity_Id); -- Includes a call to the predicate function for type T in Expr if -- Predicate_Function (T) is non-empty. function Process_RE (N : Node_Id) return Traverse_Result; -- Used in Process REs, tests if node N is a raise expression, and if -- so, marks it to be converted to return False. procedure Process_REs is new Traverse_Proc (Process_RE); -- Marks any raise expressions in Expr_M to return False function Test_RE (N : Node_Id) return Traverse_Result; -- Used in Test_REs, tests one node for being a raise expression, and if -- so sets Raise_Expression_Present True. procedure Test_REs is new Traverse_Proc (Test_RE); -- Tests to see if Expr contains any raise expressions -------------- -- Add_Call -- -------------- procedure Add_Call (T : Entity_Id) is Exp : Node_Id; begin if Present (Predicate_Function (T)) then pragma Assert (Has_Predicates (Typ)); -- Build the call to the predicate function of T. The type may be -- derived, so use an unchecked conversion for the actual. Exp := Make_Predicate_Call (Typ => T, Expr => Unchecked_Convert_To (T, Make_Identifier (Loc, Object_Name))); -- "and"-in the call to evolving expression Add_Condition (Exp); -- Output info message on inheritance if required. Note we do not -- give this information for generic actual types, since it is -- unwelcome noise in that case in instantiations. We also -- generally suppress the message in instantiations, and also -- if it involves internal names. if Opt.List_Inherited_Aspects and then not Is_Generic_Actual_Type (Typ) and then Instantiation_Depth (Sloc (Typ)) = 0 and then not Is_Internal_Name (Chars (T)) and then not Is_Internal_Name (Chars (Typ)) then Error_Msg_Sloc := Sloc (Predicate_Function (T)); Error_Msg_Node_2 := T; Error_Msg_N ("info: & inherits predicate from & #?L?", Typ); end if; end if; end Add_Call; ------------------- -- Add_Condition -- ------------------- procedure Add_Condition (Cond : Node_Id) is begin -- This is the first predicate expression if No (Expr) then Expr := Cond; -- Otherwise concatenate to the existing predicate expressions by -- using "and then". else Expr := Make_And_Then (Loc, Left_Opnd => Relocate_Node (Expr), Right_Opnd => Cond); end if; end Add_Condition; -------------------- -- Add_Predicates -- -------------------- procedure Add_Predicates is procedure Add_Predicate (Prag : Node_Id); -- Concatenate the expression of predicate pragma Prag to Expr by -- using a short circuit "and then" operator. ------------------- -- Add_Predicate -- ------------------- procedure Add_Predicate (Prag : Node_Id) is procedure Replace_Type_Reference (N : Node_Id); -- Replace a single occurrence N of the subtype name with a -- reference to the formal of the predicate function. N can be an -- identifier referencing the subtype, or a selected component, -- representing an appropriately qualified occurrence of the -- subtype name. procedure Replace_Type_References is new Replace_Type_References_Generic (Replace_Type_Reference); -- Traverse an expression changing every occurrence of an -- identifier whose name matches the name of the subtype with a -- reference to the formal parameter of the predicate function. ---------------------------- -- Replace_Type_Reference -- ---------------------------- procedure Replace_Type_Reference (N : Node_Id) is begin Rewrite (N, Make_Identifier (Sloc (N), Object_Name)); -- Use the Sloc of the usage name, not the defining name Set_Etype (N, Typ); Set_Entity (N, Object_Entity); end Replace_Type_Reference; -- Local variables Asp : constant Node_Id := Corresponding_Aspect (Prag); Arg1 : Node_Id; Arg2 : Node_Id; -- Start of processing for Add_Predicate begin -- Mark corresponding SCO as enabled Set_SCO_Pragma_Enabled (Sloc (Prag)); -- Extract the arguments of the pragma. The expression itself -- is copied for use in the predicate function, to preserve the -- original version for ASIS use. -- Is this still needed??? Arg1 := First (Pragma_Argument_Associations (Prag)); Arg2 := Next (Arg1); Arg1 := Get_Pragma_Arg (Arg1); Arg2 := New_Copy_Tree (Get_Pragma_Arg (Arg2)); -- When the predicate pragma applies to the current type or its -- full view, replace all occurrences of the subtype name with -- references to the formal parameter of the predicate function. if Entity (Arg1) = Typ or else Full_View (Entity (Arg1)) = Typ then Replace_Type_References (Arg2, Typ); -- If the predicate pragma comes from an aspect, replace the -- saved expression because we need the subtype references -- replaced for the calls to Preanalyze_Spec_Expression in -- Check_Aspect_At_xxx routines. if Present (Asp) then Set_Entity (Identifier (Asp), New_Copy_Tree (Arg2)); end if; -- "and"-in the Arg2 condition to evolving expression Add_Condition (Relocate_Node (Arg2)); end if; end Add_Predicate; -- Local variables Ritem : Node_Id; -- Start of processing for Add_Predicates begin Ritem := First_Rep_Item (Typ); -- If the type is private, check whether full view has inherited -- predicates. if Is_Private_Type (Typ) and then No (Ritem) then Ritem := First_Rep_Item (Full_View (Typ)); end if; while Present (Ritem) loop if Nkind (Ritem) = N_Pragma and then Pragma_Name (Ritem) = Name_Predicate then Add_Predicate (Ritem); -- If the type is declared in an inner package it may be frozen -- outside of the package, and the generated pragma has not been -- analyzed yet, so capture the expression for the predicate -- function at this point. elsif Nkind (Ritem) = N_Aspect_Specification and then Present (Aspect_Rep_Item (Ritem)) and then Scope_Depth (Scope (Typ)) > Scope_Depth (Current_Scope) then declare Prag : constant Node_Id := Aspect_Rep_Item (Ritem); begin if Nkind (Prag) = N_Pragma and then Pragma_Name (Prag) = Name_Predicate then Add_Predicate (Prag); end if; end; end if; Next_Rep_Item (Ritem); end loop; end Add_Predicates; ---------------- -- Process_RE -- ---------------- function Process_RE (N : Node_Id) return Traverse_Result is begin if Nkind (N) = N_Raise_Expression then Set_Convert_To_Return_False (N); return Skip; else return OK; end if; end Process_RE; ------------- -- Test_RE -- ------------- function Test_RE (N : Node_Id) return Traverse_Result is begin if Nkind (N) = N_Raise_Expression then Raise_Expression_Present := True; return Abandon; else return OK; end if; end Test_RE; -- Local variables Saved_GM : constant Ghost_Mode_Type := Ghost_Mode; Saved_IGR : constant Node_Id := Ignored_Ghost_Region; -- Save the Ghost-related attributes to restore on exit -- Start of processing for Build_Predicate_Functions begin -- Return if already built or if type does not have predicates SId := Predicate_Function (Typ); if not Has_Predicates (Typ) or else (Present (SId) and then Has_Completion (SId)) then return; -- Do not generate predicate bodies within a generic unit. The -- expressions have been analyzed already, and the bodies play -- no role if not within an executable unit. However, if a statc -- predicate is present it must be processed for legality checks -- such as case coverage in an expression. elsif Inside_A_Generic and then not Has_Static_Predicate_Aspect (Typ) then return; end if; -- The related type may be subject to pragma Ghost. Set the mode now to -- ensure that the predicate functions are properly marked as Ghost. Set_Ghost_Mode (Typ); -- Prepare to construct predicate expression Expr := Empty; if Present (SId) then FDecl := Unit_Declaration_Node (SId); else FDecl := Build_Predicate_Function_Declaration (Typ); SId := Defining_Entity (FDecl); end if; -- Recover name of formal parameter of function that replaces references -- to the type in predicate expressions. Object_Entity := Defining_Identifier (First (Parameter_Specifications (Specification (FDecl)))); Object_Name := Chars (Object_Entity); Object_Entity_M := Make_Defining_Identifier (Loc, Chars => Object_Name); -- Add predicates for ancestor if present. These must come before the -- ones for the current type, as required by AI12-0071-1. -- Looks like predicates aren't added for case of inheriting from -- multiple progenitors??? declare Atyp : Entity_Id; begin Atyp := Nearest_Ancestor (Typ); -- The type may be private but the full view may inherit predicates if No (Atyp) and then Is_Private_Type (Typ) then Atyp := Nearest_Ancestor (Full_View (Typ)); end if; if Present (Atyp) then Add_Call (Atyp); end if; end; -- Add Predicates for the current type Add_Predicates; -- Case where predicates are present if Present (Expr) then -- Test for raise expression present Test_REs (Expr); -- If raise expression is present, capture a copy of Expr for use -- in building the predicateM function version later on. For this -- copy we replace references to Object_Entity by Object_Entity_M. if Raise_Expression_Present then declare function Reset_Loop_Variable (N : Node_Id) return Traverse_Result; procedure Reset_Loop_Variables is new Traverse_Proc (Reset_Loop_Variable); ------------------------ -- Reset_Loop_Variable -- ------------------------ function Reset_Loop_Variable (N : Node_Id) return Traverse_Result is begin if Nkind (N) = N_Iterator_Specification then Set_Defining_Identifier (N, Make_Defining_Identifier (Sloc (N), Chars (Defining_Identifier (N)))); end if; return OK; end Reset_Loop_Variable; -- Local variables Map : constant Elist_Id := New_Elmt_List; begin Append_Elmt (Object_Entity, Map); Append_Elmt (Object_Entity_M, Map); Expr_M := New_Copy_Tree (Expr, Map => Map); -- The unanalyzed expression will be copied and appear in -- both functions. Normally expressions do not declare new -- entities, but quantified expressions do, so we need to -- create new entities for their bound variables, to prevent -- multiple definitions in gigi. Reset_Loop_Variables (Expr_M); end; end if; -- Build the main predicate function declare SIdB : constant Entity_Id := Make_Defining_Identifier (Loc, Chars => New_External_Name (Chars (Typ), "Predicate")); -- The entity for the function body Spec : Node_Id; FBody : Node_Id; begin Set_Ekind (SIdB, E_Function); Set_Is_Predicate_Function (SIdB); -- Build function body Spec := Make_Function_Specification (Loc, Defining_Unit_Name => SIdB, Parameter_Specifications => New_List ( Make_Parameter_Specification (Loc, Defining_Identifier => Make_Defining_Identifier (Loc, Object_Name), Parameter_Type => New_Occurrence_Of (Typ, Loc))), Result_Definition => New_Occurrence_Of (Standard_Boolean, Loc)); FBody := Make_Subprogram_Body (Loc, Specification => Spec, Declarations => Empty_List, Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, Statements => New_List ( Make_Simple_Return_Statement (Loc, Expression => Expr)))); -- The declaration has been analyzed when created, and placed -- after type declaration. Insert body itself after freeze node, -- unless subprogram declaration is already there, in which case -- body better be placed afterwards. if FDecl = Next (N) then Insert_After_And_Analyze (FDecl, FBody); else Insert_After_And_Analyze (N, FBody); end if; -- The defining identifier of a quantified expression carries the -- scope in which the type appears, but when unnesting we need -- to indicate that its proper scope is the constructed predicate -- function. The quantified expressions have been converted into -- loops during analysis and expansion. declare function Reset_Quantified_Variable_Scope (N : Node_Id) return Traverse_Result; procedure Reset_Quantified_Variables_Scope is new Traverse_Proc (Reset_Quantified_Variable_Scope); ------------------------------------- -- Reset_Quantified_Variable_Scope -- ------------------------------------- function Reset_Quantified_Variable_Scope (N : Node_Id) return Traverse_Result is begin if Nkind (N) in N_Iterator_Specification | N_Loop_Parameter_Specification then Set_Scope (Defining_Identifier (N), Predicate_Function (Typ)); end if; return OK; end Reset_Quantified_Variable_Scope; begin if Unnest_Subprogram_Mode then Reset_Quantified_Variables_Scope (Expr); end if; end; -- Within a generic unit, prevent a double analysis of the body -- which will not be marked analyzed yet. This will happen when -- the freeze node is created during the preanalysis of an -- expression function. if Inside_A_Generic then Set_Analyzed (FBody); end if; -- Static predicate functions are always side-effect free, and -- in most cases dynamic predicate functions are as well. Mark -- them as such whenever possible, so redundant predicate checks -- can be optimized. If there is a variable reference within the -- expression, the function is not pure. if Expander_Active then Set_Is_Pure (SId, Side_Effect_Free (Expr, Variable_Ref => True)); Set_Is_Inlined (SId); end if; end; -- Test for raise expressions present and if so build M version if Raise_Expression_Present then declare SId : constant Entity_Id := Make_Defining_Identifier (Loc, Chars => New_External_Name (Chars (Typ), "PredicateM")); -- The entity for the function spec SIdB : constant Entity_Id := Make_Defining_Identifier (Loc, Chars => New_External_Name (Chars (Typ), "PredicateM")); -- The entity for the function body Spec : Node_Id; FBody : Node_Id; FDecl : Node_Id; BTemp : Entity_Id; CRec_Typ : Entity_Id; -- The corresponding record type of Full_Typ Full_Typ : Entity_Id; -- The full view of Typ Priv_Typ : Entity_Id; -- The partial view of Typ UFull_Typ : Entity_Id; -- The underlying full view of Full_Typ begin -- Mark any raise expressions for special expansion Process_REs (Expr_M); -- Build function declaration Set_Ekind (SId, E_Function); Set_Is_Predicate_Function_M (SId); Set_Predicate_Function_M (Typ, SId); -- Obtain all views of the input type Get_Views (Typ, Priv_Typ, Full_Typ, UFull_Typ, CRec_Typ); -- Associate the predicate function with all views Propagate_Predicate_Attributes (Priv_Typ, From_Typ => Typ); Propagate_Predicate_Attributes (Full_Typ, From_Typ => Typ); Propagate_Predicate_Attributes (UFull_Typ, From_Typ => Typ); Propagate_Predicate_Attributes (CRec_Typ, From_Typ => Typ); Spec := Make_Function_Specification (Loc, Defining_Unit_Name => SId, Parameter_Specifications => New_List ( Make_Parameter_Specification (Loc, Defining_Identifier => Object_Entity_M, Parameter_Type => New_Occurrence_Of (Typ, Loc))), Result_Definition => New_Occurrence_Of (Standard_Boolean, Loc)); FDecl := Make_Subprogram_Declaration (Loc, Specification => Spec); -- Build function body Spec := Make_Function_Specification (Loc, Defining_Unit_Name => SIdB, Parameter_Specifications => New_List ( Make_Parameter_Specification (Loc, Defining_Identifier => Make_Defining_Identifier (Loc, Object_Name), Parameter_Type => New_Occurrence_Of (Typ, Loc))), Result_Definition => New_Occurrence_Of (Standard_Boolean, Loc)); -- Build the body, we declare the boolean expression before -- doing the return, because we are not really confident of -- what happens if a return appears within a return. BTemp := Make_Defining_Identifier (Loc, Chars => New_Internal_Name ('B')); FBody := Make_Subprogram_Body (Loc, Specification => Spec, Declarations => New_List ( Make_Object_Declaration (Loc, Defining_Identifier => BTemp, Constant_Present => True, Object_Definition => New_Occurrence_Of (Standard_Boolean, Loc), Expression => Expr_M)), Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, Statements => New_List ( Make_Simple_Return_Statement (Loc, Expression => New_Occurrence_Of (BTemp, Loc))))); -- Insert declaration before freeze node and body after Insert_Before_And_Analyze (N, FDecl); Insert_After_And_Analyze (N, FBody); -- Should quantified expressions be handled here as well ??? end; end if; -- See if we have a static predicate. Note that the answer may be -- yes even if we have an explicit Dynamic_Predicate present. declare PS : Boolean; EN : Node_Id; begin if not Is_Scalar_Type (Typ) and then not Is_String_Type (Typ) then PS := False; else PS := Is_Predicate_Static (Expr, Object_Name); end if; -- Case where we have a predicate-static aspect if PS then -- We don't set Has_Static_Predicate_Aspect, since we can have -- any of the three cases (Predicate, Dynamic_Predicate, or -- Static_Predicate) generating a predicate with an expression -- that is predicate-static. We just indicate that we have a -- predicate that can be treated as static. Set_Has_Static_Predicate (Typ); -- For discrete subtype, build the static predicate list if Is_Discrete_Type (Typ) then Build_Discrete_Static_Predicate (Typ, Expr, Object_Name); -- If we don't get a static predicate list, it means that we -- have a case where this is not possible, most typically in -- the case where we inherit a dynamic predicate. We do not -- consider this an error, we just leave the predicate as -- dynamic. But if we do succeed in building the list, then -- we mark the predicate as static. if No (Static_Discrete_Predicate (Typ)) then Set_Has_Static_Predicate (Typ, False); end if; -- For real or string subtype, save predicate expression elsif Is_Real_Type (Typ) or else Is_String_Type (Typ) then Set_Static_Real_Or_String_Predicate (Typ, Expr); end if; -- Case of dynamic predicate (expression is not predicate-static) else -- Again, we don't set Has_Dynamic_Predicate_Aspect, since that -- is only set if we have an explicit Dynamic_Predicate aspect -- given. Here we may simply have a Predicate aspect where the -- expression happens not to be predicate-static. -- Emit an error when the predicate is categorized as static -- but its expression is not predicate-static. -- First a little fiddling to get a nice location for the -- message. If the expression is of the form (A and then B), -- where A is an inherited predicate, then use the right -- operand for the Sloc. This avoids getting confused by a call -- to an inherited predicate with a less convenient source -- location. EN := Expr; while Nkind (EN) = N_And_Then and then Nkind (Left_Opnd (EN)) = N_Function_Call and then Is_Predicate_Function (Entity (Name (Left_Opnd (EN)))) loop EN := Right_Opnd (EN); end loop; -- Now post appropriate message if Has_Static_Predicate_Aspect (Typ) then if Is_Scalar_Type (Typ) or else Is_String_Type (Typ) then Error_Msg_F ("expression is not predicate-static (RM 3.2.4(16-22))", EN); else Error_Msg_F ("static predicate requires scalar or string type", EN); end if; end if; end if; end; end if; Restore_Ghost_Region (Saved_GM, Saved_IGR); end Build_Predicate_Functions; ------------------------------------------ -- Build_Predicate_Function_Declaration -- ------------------------------------------ -- WARNING: This routine manages Ghost regions. Return statements must be -- replaced by gotos which jump to the end of the routine and restore the -- Ghost mode. function Build_Predicate_Function_Declaration (Typ : Entity_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (Typ); Saved_GM : constant Ghost_Mode_Type := Ghost_Mode; Saved_IGR : constant Node_Id := Ignored_Ghost_Region; -- Save the Ghost-related attributes to restore on exit Func_Decl : Node_Id; Func_Id : Entity_Id; Spec : Node_Id; CRec_Typ : Entity_Id; -- The corresponding record type of Full_Typ Full_Typ : Entity_Id; -- The full view of Typ Priv_Typ : Entity_Id; -- The partial view of Typ UFull_Typ : Entity_Id; -- The underlying full view of Full_Typ begin -- The related type may be subject to pragma Ghost. Set the mode now to -- ensure that the predicate functions are properly marked as Ghost. Set_Ghost_Mode (Typ); Func_Id := Make_Defining_Identifier (Loc, Chars => New_External_Name (Chars (Typ), "Predicate")); Set_Ekind (Func_Id, E_Function); Set_Etype (Func_Id, Standard_Boolean); Set_Is_Internal (Func_Id); Set_Is_Predicate_Function (Func_Id); Set_Predicate_Function (Typ, Func_Id); -- The predicate function requires debug info when the predicates are -- subject to Source Coverage Obligations. if Opt.Generate_SCO then Set_Debug_Info_Needed (Func_Id); end if; -- Obtain all views of the input type Get_Views (Typ, Priv_Typ, Full_Typ, UFull_Typ, CRec_Typ); -- Associate the predicate function and various flags with all views Propagate_Predicate_Attributes (Priv_Typ, From_Typ => Typ); Propagate_Predicate_Attributes (Full_Typ, From_Typ => Typ); Propagate_Predicate_Attributes (UFull_Typ, From_Typ => Typ); Propagate_Predicate_Attributes (CRec_Typ, From_Typ => Typ); Spec := Make_Function_Specification (Loc, Defining_Unit_Name => Func_Id, Parameter_Specifications => New_List ( Make_Parameter_Specification (Loc, Defining_Identifier => Make_Temporary (Loc, 'I'), Parameter_Type => New_Occurrence_Of (Typ, Loc))), Result_Definition => New_Occurrence_Of (Standard_Boolean, Loc)); Func_Decl := Make_Subprogram_Declaration (Loc, Specification => Spec); Insert_After (Parent (Typ), Func_Decl); Analyze (Func_Decl); Restore_Ghost_Region (Saved_GM, Saved_IGR); return Func_Decl; end Build_Predicate_Function_Declaration; ----------------------------------------- -- Check_Aspect_At_End_Of_Declarations -- ----------------------------------------- procedure Check_Aspect_At_End_Of_Declarations (ASN : Node_Id) is Ent : constant Entity_Id := Entity (ASN); Ident : constant Node_Id := Identifier (ASN); A_Id : constant Aspect_Id := Get_Aspect_Id (Chars (Ident)); End_Decl_Expr : constant Node_Id := Entity (Ident); -- Expression to be analyzed at end of declarations Freeze_Expr : constant Node_Id := Expression (ASN); -- Expression from call to Check_Aspect_At_Freeze_Point. T : constant Entity_Id := Etype (Original_Node (Freeze_Expr)); -- Type required for preanalyze call. We use the original expression to -- get the proper type, to prevent cascaded errors when the expression -- is constant-folded. Err : Boolean; -- Set False if error -- On entry to this procedure, Entity (Ident) contains a copy of the -- original expression from the aspect, saved for this purpose, and -- but Expression (Ident) is a preanalyzed copy of the expression, -- preanalyzed just after the freeze point. procedure Check_Overloaded_Name; -- For aspects whose expression is simply a name, this routine checks if -- the name is overloaded or not. If so, it verifies there is an -- interpretation that matches the entity obtained at the freeze point, -- otherwise the compiler complains. --------------------------- -- Check_Overloaded_Name -- --------------------------- procedure Check_Overloaded_Name is begin if not Is_Overloaded (End_Decl_Expr) then Err := not Is_Entity_Name (End_Decl_Expr) or else Entity (End_Decl_Expr) /= Entity (Freeze_Expr); else Err := True; declare Index : Interp_Index; It : Interp; begin Get_First_Interp (End_Decl_Expr, Index, It); while Present (It.Typ) loop if It.Nam = Entity (Freeze_Expr) then Err := False; exit; end if; Get_Next_Interp (Index, It); end loop; end; end if; end Check_Overloaded_Name; -- Start of processing for Check_Aspect_At_End_Of_Declarations begin -- In an instance we do not perform the consistency check between freeze -- point and end of declarations, because it was done already in the -- analysis of the generic. Furthermore, the delayed analysis of an -- aspect of the instance may produce spurious errors when the generic -- is a child unit that references entities in the parent (which might -- not be in scope at the freeze point of the instance). if In_Instance then return; -- The enclosing scope may have been rewritten during expansion (.e.g. a -- task body is rewritten as a procedure) after this conformance check -- has been performed, so do not perform it again (it may not easily be -- done if full visibility of local entities is not available). elsif not Comes_From_Source (Current_Scope) then return; -- Case of aspects Dimension, Dimension_System and Synchronization elsif A_Id = Aspect_Synchronization then return; -- Case of stream attributes and Put_Image, just have to compare -- entities. However, the expression is just a possibly-overloaded -- name, so we need to verify that one of these interpretations is -- the one available at at the freeze point. elsif A_Id = Aspect_Input or else A_Id = Aspect_Output or else A_Id = Aspect_Read or else A_Id = Aspect_Write or else A_Id = Aspect_Put_Image then Analyze (End_Decl_Expr); Check_Overloaded_Name; elsif A_Id = Aspect_Variable_Indexing or else A_Id = Aspect_Constant_Indexing or else A_Id = Aspect_Default_Iterator or else A_Id = Aspect_Iterator_Element or else A_Id = Aspect_Integer_Literal or else A_Id = Aspect_Real_Literal or else A_Id = Aspect_String_Literal then -- Make type unfrozen before analysis, to prevent spurious errors -- about late attributes. Set_Is_Frozen (Ent, False); Analyze (End_Decl_Expr); Set_Is_Frozen (Ent, True); -- If the end of declarations comes before any other freeze point, -- the Freeze_Expr is not analyzed: no check needed. if Analyzed (Freeze_Expr) and then not In_Instance then Check_Overloaded_Name; else Err := False; end if; -- All other cases else -- In a generic context freeze nodes are not always generated, so -- analyze the expression now. If the aspect is for a type, we must -- also make its potential components accessible. if not Analyzed (Freeze_Expr) and then Inside_A_Generic then if A_Id = Aspect_Dynamic_Predicate or else A_Id = Aspect_Predicate then Push_Type (Ent); Preanalyze_Spec_Expression (Freeze_Expr, Standard_Boolean); Pop_Type (Ent); elsif A_Id = Aspect_Priority then Push_Type (Ent); Preanalyze_Spec_Expression (Freeze_Expr, Any_Integer); Pop_Type (Ent); else Preanalyze (Freeze_Expr); end if; end if; -- Indicate that the expression comes from an aspect specification, -- which is used in subsequent analysis even if expansion is off. Set_Parent (End_Decl_Expr, ASN); -- In a generic context the original aspect expressions have not -- been preanalyzed, so do it now. There are no conformance checks -- to perform in this case. As before, we have to make components -- visible for aspects that may reference them. if No (T) then if A_Id = Aspect_Dynamic_Predicate or else A_Id = Aspect_Predicate or else A_Id = Aspect_Priority then Push_Type (Ent); Check_Aspect_At_Freeze_Point (ASN); Pop_Type (Ent); else Check_Aspect_At_Freeze_Point (ASN); end if; return; -- The default values attributes may be defined in the private part, -- and the analysis of the expression may take place when only the -- partial view is visible. The expression must be scalar, so use -- the full view to resolve. elsif (A_Id = Aspect_Default_Value or else A_Id = Aspect_Default_Component_Value) and then Is_Private_Type (T) then Preanalyze_Spec_Expression (End_Decl_Expr, Full_View (T)); -- The following aspect expressions may contain references to -- components and discriminants of the type. elsif A_Id = Aspect_Dynamic_Predicate or else A_Id = Aspect_Predicate or else A_Id = Aspect_Priority or else A_Id = Aspect_CPU then Push_Type (Ent); Preanalyze_Spec_Expression (End_Decl_Expr, T); Pop_Type (Ent); elsif A_Id = Aspect_Predicate_Failure then Preanalyze_Spec_Expression (End_Decl_Expr, Standard_String); else Preanalyze_Spec_Expression (End_Decl_Expr, T); end if; Err := not Fully_Conformant_Expressions (End_Decl_Expr, Freeze_Expr, Report => True); end if; -- Output error message if error. Force error on aspect specification -- even if there is an error on the expression itself. if Err then Error_Msg_NE ("!visibility of aspect for& changes after freeze point", ASN, Ent); Error_Msg_NE ("info: & is frozen here, (RM 13.1.1 (13/3))??", Freeze_Node (Ent), Ent); end if; end Check_Aspect_At_End_Of_Declarations; ---------------------------------- -- Check_Aspect_At_Freeze_Point -- ---------------------------------- procedure Check_Aspect_At_Freeze_Point (ASN : Node_Id) is Ident : constant Node_Id := Identifier (ASN); -- Identifier (use Entity field to save expression) Expr : constant Node_Id := Expression (ASN); -- For cases where using Entity (Identifier) doesn't work A_Id : constant Aspect_Id := Get_Aspect_Id (Chars (Ident)); T : Entity_Id := Empty; -- Type required for preanalyze call begin -- On entry to this procedure, Entity (Ident) contains a copy of the -- original expression from the aspect, saved for this purpose. -- On exit from this procedure Entity (Ident) is unchanged, still -- containing that copy, but Expression (Ident) is a preanalyzed copy -- of the expression, preanalyzed just after the freeze point. -- Make a copy of the expression to be preanalyzed Set_Expression (ASN, New_Copy_Tree (Entity (Ident))); -- Find type for preanalyze call case A_Id is -- No_Aspect should be impossible when No_Aspect => raise Program_Error; -- Aspects taking an optional boolean argument when Boolean_Aspects | Library_Unit_Aspects => T := Standard_Boolean; -- Aspects corresponding to attribute definition clauses when Aspect_Address => T := RTE (RE_Address); when Aspect_Attach_Handler => T := RTE (RE_Interrupt_ID); when Aspect_Bit_Order | Aspect_Scalar_Storage_Order => T := RTE (RE_Bit_Order); when Aspect_Convention => return; when Aspect_CPU => T := RTE (RE_CPU_Range); -- Default_Component_Value is resolved with the component type when Aspect_Default_Component_Value => T := Component_Type (Entity (ASN)); when Aspect_Default_Storage_Pool => T := Class_Wide_Type (RTE (RE_Root_Storage_Pool)); -- Default_Value is resolved with the type entity in question when Aspect_Default_Value => T := Entity (ASN); when Aspect_Dispatching_Domain => T := RTE (RE_Dispatching_Domain); when Aspect_External_Tag => T := Standard_String; when Aspect_External_Name => T := Standard_String; when Aspect_Link_Name => T := Standard_String; when Aspect_Interrupt_Priority | Aspect_Priority => T := Standard_Integer; when Aspect_Relative_Deadline => T := RTE (RE_Time_Span); when Aspect_Secondary_Stack_Size => T := Standard_Integer; when Aspect_Small => -- Note that the expression can be of any real type (not just a -- real universal literal) as long as it is a static constant. T := Any_Real; -- For a simple storage pool, we have to retrieve the type of the -- pool object associated with the aspect's corresponding attribute -- definition clause. when Aspect_Simple_Storage_Pool => T := Etype (Expression (Aspect_Rep_Item (ASN))); when Aspect_Storage_Pool => T := Class_Wide_Type (RTE (RE_Root_Storage_Pool)); when Aspect_Alignment | Aspect_Component_Size | Aspect_Machine_Radix | Aspect_Object_Size | Aspect_Size | Aspect_Storage_Size | Aspect_Stream_Size | Aspect_Value_Size => T := Any_Integer; when Aspect_Linker_Section => T := Standard_String; when Aspect_Synchronization => return; -- Special case, the expression of these aspects is just an entity -- that does not need any resolution, so just analyze. when Aspect_Input | Aspect_Output | Aspect_Put_Image | Aspect_Read | Aspect_Suppress | Aspect_Unsuppress | Aspect_Warnings | Aspect_Write => Analyze (Expression (ASN)); return; -- Same for Iterator aspects, where the expression is a function -- name. Legality rules are checked separately. when Aspect_Constant_Indexing | Aspect_Default_Iterator | Aspect_Iterator_Element | Aspect_Variable_Indexing => Analyze (Expression (ASN)); return; -- Same for Literal aspects, where the expression is a function -- name. Legality rules are checked separately. Use Expr to avoid -- losing track of the previous resolution of Expression. when Aspect_Integer_Literal | Aspect_Real_Literal | Aspect_String_Literal => Set_Entity (Expression (ASN), Entity (Expr)); Set_Etype (Expression (ASN), Etype (Expr)); Set_Is_Overloaded (Expression (ASN), False); Analyze (Expression (ASN)); return; -- Ditto for Iterable, legality checks in Validate_Iterable_Aspect. when Aspect_Iterable => T := Entity (ASN); declare Cursor : constant Entity_Id := Get_Cursor_Type (ASN, T); Assoc : Node_Id; Expr : Node_Id; begin if Cursor = Any_Type then return; end if; Assoc := First (Component_Associations (Expression (ASN))); while Present (Assoc) loop Expr := Expression (Assoc); Analyze (Expr); if not Error_Posted (Expr) then Resolve_Iterable_Operation (Expr, Cursor, T, Chars (First (Choices (Assoc)))); end if; Next (Assoc); end loop; end; return; when Aspect_Aggregate => Resolve_Aspect_Aggregate (Entity (ASN), Expr); return; -- Invariant/Predicate take boolean expressions when Aspect_Dynamic_Predicate | Aspect_Invariant | Aspect_Predicate | Aspect_Static_Predicate | Aspect_Type_Invariant => T := Standard_Boolean; when Aspect_Predicate_Failure => T := Standard_String; -- Here is the list of aspects that don't require delay analysis when Aspect_Abstract_State | Aspect_Annotate | Aspect_Async_Readers | Aspect_Async_Writers | Aspect_Constant_After_Elaboration | Aspect_Contract_Cases | Aspect_Default_Initial_Condition | Aspect_Depends | Aspect_Dimension | Aspect_Dimension_System | Aspect_Effective_Reads | Aspect_Effective_Writes | Aspect_Extensions_Visible | Aspect_Ghost | Aspect_Global | Aspect_Implicit_Dereference | Aspect_Initial_Condition | Aspect_Initializes | Aspect_Max_Entry_Queue_Depth | Aspect_Max_Entry_Queue_Length | Aspect_Max_Queue_Length | Aspect_No_Caching | Aspect_Obsolescent | Aspect_Part_Of | Aspect_Post | Aspect_Postcondition | Aspect_Pre | Aspect_Precondition | Aspect_Refined_Depends | Aspect_Refined_Global | Aspect_Refined_Post | Aspect_Refined_State | Aspect_Relaxed_Initialization | Aspect_SPARK_Mode | Aspect_Subprogram_Variant | Aspect_Test_Case | Aspect_Unimplemented | Aspect_Volatile_Function => raise Program_Error; end case; -- Do the preanalyze call Preanalyze_Spec_Expression (Expression (ASN), T); end Check_Aspect_At_Freeze_Point; ----------------------------------- -- Check_Constant_Address_Clause -- ----------------------------------- procedure Check_Constant_Address_Clause (Expr : Node_Id; U_Ent : Entity_Id) is procedure Check_At_Constant_Address (Nod : Node_Id); -- Checks that the given node N represents a name whose 'Address is -- constant (in the same sense as OK_Constant_Address_Clause, i.e. the -- address value is the same at the point of declaration of U_Ent and at -- the time of elaboration of the address clause. procedure Check_Expr_Constants (Nod : Node_Id); -- Checks that Nod meets the requirements for a constant address clause -- in the sense of the enclosing procedure. procedure Check_List_Constants (Lst : List_Id); -- Check that all elements of list Lst meet the requirements for a -- constant address clause in the sense of the enclosing procedure. ------------------------------- -- Check_At_Constant_Address -- ------------------------------- procedure Check_At_Constant_Address (Nod : Node_Id) is begin if Is_Entity_Name (Nod) then if Present (Address_Clause (Entity ((Nod)))) then Error_Msg_NE ("invalid address clause for initialized object &!", Nod, U_Ent); Error_Msg_NE ("address for& cannot depend on another address clause! " & "(RM 13.1(22))!", Nod, U_Ent); elsif In_Same_Source_Unit (Entity (Nod), U_Ent) and then Sloc (U_Ent) < Sloc (Entity (Nod)) then Error_Msg_NE ("invalid address clause for initialized object &!", Nod, U_Ent); Error_Msg_Node_2 := U_Ent; Error_Msg_NE ("\& must be defined before & (RM 13.1(22))!", Nod, Entity (Nod)); end if; elsif Nkind (Nod) = N_Selected_Component then declare T : constant Entity_Id := Etype (Prefix (Nod)); begin if (Is_Record_Type (T) and then Has_Discriminants (T)) or else (Is_Access_Type (T) and then Is_Record_Type (Designated_Type (T)) and then Has_Discriminants (Designated_Type (T))) then Error_Msg_NE ("invalid address clause for initialized object &!", Nod, U_Ent); Error_Msg_N ("\address cannot depend on component of discriminated " & "record (RM 13.1(22))!", Nod); else Check_At_Constant_Address (Prefix (Nod)); end if; end; elsif Nkind (Nod) = N_Indexed_Component then Check_At_Constant_Address (Prefix (Nod)); Check_List_Constants (Expressions (Nod)); else Check_Expr_Constants (Nod); end if; end Check_At_Constant_Address; -------------------------- -- Check_Expr_Constants -- -------------------------- procedure Check_Expr_Constants (Nod : Node_Id) is Loc_U_Ent : constant Source_Ptr := Sloc (U_Ent); Ent : Entity_Id := Empty; begin if Nkind (Nod) in N_Has_Etype and then Etype (Nod) = Any_Type then return; end if; case Nkind (Nod) is when N_Empty | N_Error => return; when N_Expanded_Name | N_Identifier => Ent := Entity (Nod); -- We need to look at the original node if it is different -- from the node, since we may have rewritten things and -- substituted an identifier representing the rewrite. if Is_Rewrite_Substitution (Nod) then Check_Expr_Constants (Original_Node (Nod)); -- If the node is an object declaration without initial -- value, some code has been expanded, and the expression -- is not constant, even if the constituents might be -- acceptable, as in A'Address + offset. if Ekind (Ent) = E_Variable and then Nkind (Declaration_Node (Ent)) = N_Object_Declaration and then No (Expression (Declaration_Node (Ent))) then Error_Msg_NE ("invalid address clause for initialized object &!", Nod, U_Ent); -- If entity is constant, it may be the result of expanding -- a check. We must verify that its declaration appears -- before the object in question, else we also reject the -- address clause. elsif Ekind (Ent) = E_Constant and then In_Same_Source_Unit (Ent, U_Ent) and then Sloc (Ent) > Loc_U_Ent then Error_Msg_NE ("invalid address clause for initialized object &!", Nod, U_Ent); end if; return; end if; -- Otherwise look at the identifier and see if it is OK if Ekind (Ent) in E_Named_Integer | E_Named_Real or else Is_Type (Ent) then return; elsif Ekind (Ent) in E_Constant | E_In_Parameter then -- This is the case where we must have Ent defined before -- U_Ent. Clearly if they are in different units this -- requirement is met since the unit containing Ent is -- already processed. if not In_Same_Source_Unit (Ent, U_Ent) then return; -- Otherwise location of Ent must be before the location -- of U_Ent, that's what prior defined means. elsif Sloc (Ent) < Loc_U_Ent then return; else Error_Msg_NE ("invalid address clause for initialized object &!", Nod, U_Ent); Error_Msg_Node_2 := U_Ent; Error_Msg_NE ("\& must be defined before & (RM 13.1(22))!", Nod, Ent); end if; elsif Nkind (Original_Node (Nod)) = N_Function_Call then Check_Expr_Constants (Original_Node (Nod)); else Error_Msg_NE ("invalid address clause for initialized object &!", Nod, U_Ent); if Comes_From_Source (Ent) then Error_Msg_NE ("\reference to variable& not allowed" & " (RM 13.1(22))!", Nod, Ent); else Error_Msg_N ("non-static expression not allowed" & " (RM 13.1(22))!", Nod); end if; end if; when N_Integer_Literal => -- If this is a rewritten unchecked conversion, in a system -- where Address is an integer type, always use the base type -- for a literal value. This is user-friendly and prevents -- order-of-elaboration issues with instances of unchecked -- conversion. if Nkind (Original_Node (Nod)) = N_Function_Call then Set_Etype (Nod, Base_Type (Etype (Nod))); end if; when N_Character_Literal | N_Real_Literal | N_String_Literal => return; when N_Range => Check_Expr_Constants (Low_Bound (Nod)); Check_Expr_Constants (High_Bound (Nod)); when N_Explicit_Dereference => Check_Expr_Constants (Prefix (Nod)); when N_Indexed_Component => Check_Expr_Constants (Prefix (Nod)); Check_List_Constants (Expressions (Nod)); when N_Slice => Check_Expr_Constants (Prefix (Nod)); Check_Expr_Constants (Discrete_Range (Nod)); when N_Selected_Component => Check_Expr_Constants (Prefix (Nod)); when N_Attribute_Reference => if Attribute_Name (Nod) in Name_Address | Name_Access | Name_Unchecked_Access | Name_Unrestricted_Access then Check_At_Constant_Address (Prefix (Nod)); -- Normally, System'To_Address will have been transformed into -- an Unchecked_Conversion, but in -gnatc mode, it will not, -- and we don't want to give an error, because the whole point -- of 'To_Address is that it is static. elsif Attribute_Name (Nod) = Name_To_Address then pragma Assert (Operating_Mode = Check_Semantics); null; else Check_Expr_Constants (Prefix (Nod)); Check_List_Constants (Expressions (Nod)); end if; when N_Aggregate => Check_List_Constants (Component_Associations (Nod)); Check_List_Constants (Expressions (Nod)); when N_Component_Association => Check_Expr_Constants (Expression (Nod)); when N_Extension_Aggregate => Check_Expr_Constants (Ancestor_Part (Nod)); Check_List_Constants (Component_Associations (Nod)); Check_List_Constants (Expressions (Nod)); when N_Null => return; when N_Binary_Op | N_Membership_Test | N_Short_Circuit => Check_Expr_Constants (Left_Opnd (Nod)); Check_Expr_Constants (Right_Opnd (Nod)); when N_Unary_Op => Check_Expr_Constants (Right_Opnd (Nod)); when N_Allocator | N_Qualified_Expression | N_Type_Conversion | N_Unchecked_Type_Conversion => Check_Expr_Constants (Expression (Nod)); when N_Function_Call => if not Is_Pure (Entity (Name (Nod))) then Error_Msg_NE ("invalid address clause for initialized object &!", Nod, U_Ent); Error_Msg_NE ("\function & is not pure (RM 13.1(22))!", Nod, Entity (Name (Nod))); else Check_List_Constants (Parameter_Associations (Nod)); end if; when N_Parameter_Association => Check_Expr_Constants (Explicit_Actual_Parameter (Nod)); when others => Error_Msg_NE ("invalid address clause for initialized object &!", Nod, U_Ent); Error_Msg_NE ("\must be constant defined before& (RM 13.1(22))!", Nod, U_Ent); end case; end Check_Expr_Constants; -------------------------- -- Check_List_Constants -- -------------------------- procedure Check_List_Constants (Lst : List_Id) is Nod1 : Node_Id; begin if Present (Lst) then Nod1 := First (Lst); while Present (Nod1) loop Check_Expr_Constants (Nod1); Next (Nod1); end loop; end if; end Check_List_Constants; -- Start of processing for Check_Constant_Address_Clause begin -- If rep_clauses are to be ignored, no need for legality checks. In -- particular, no need to pester user about rep clauses that violate the -- rule on constant addresses, given that these clauses will be removed -- by Freeze before they reach the back end. Similarly in CodePeer mode, -- we want to relax these checks. if not Ignore_Rep_Clauses and not CodePeer_Mode then Check_Expr_Constants (Expr); end if; end Check_Constant_Address_Clause; --------------------------- -- Check_Pool_Size_Clash -- --------------------------- procedure Check_Pool_Size_Clash (Ent : Entity_Id; SP, SS : Node_Id) is Post : Node_Id; begin -- We need to find out which one came first. Note that in the case of -- aspects mixed with pragmas there are cases where the processing order -- is reversed, which is why we do the check here. if Sloc (SP) < Sloc (SS) then Error_Msg_Sloc := Sloc (SP); Post := SS; Error_Msg_NE ("Storage_Pool previously given for&#", Post, Ent); else Error_Msg_Sloc := Sloc (SS); Post := SP; Error_Msg_NE ("Storage_Size previously given for&#", Post, Ent); end if; Error_Msg_N ("\cannot have Storage_Size and Storage_Pool (RM 13.11(3))", Post); end Check_Pool_Size_Clash; ---------------------------------------- -- Check_Record_Representation_Clause -- ---------------------------------------- procedure Check_Record_Representation_Clause (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); Ident : constant Node_Id := Identifier (N); Rectype : Entity_Id; Fent : Entity_Id; CC : Node_Id; Fbit : Uint := No_Uint; Lbit : Uint := No_Uint; Hbit : Uint := Uint_0; Comp : Entity_Id; Pcomp : Entity_Id; Max_Bit_So_Far : Uint; -- Records the maximum bit position so far. If all field positions -- are monotonically increasing, then we can skip the circuit for -- checking for overlap, since no overlap is possible. Tagged_Parent : Entity_Id := Empty; -- This is set in the case of an extension for which we have either a -- size clause or Is_Fully_Repped_Tagged_Type True (indicating that all -- components are positioned by record representation clauses) on the -- parent type. In this case we check for overlap between components of -- this tagged type and the parent component. Tagged_Parent will point -- to this parent type. For all other cases, Tagged_Parent is Empty. Parent_Last_Bit : Uint := No_Uint; -- init to avoid warning -- Relevant only if Tagged_Parent is set, Parent_Last_Bit indicates the -- last bit position for any field in the parent type. We only need to -- check overlap for fields starting below this point. Overlap_Check_Required : Boolean; -- Used to keep track of whether or not an overlap check is required Overlap_Detected : Boolean := False; -- Set True if an overlap is detected Ccount : Natural := 0; -- Number of component clauses in record rep clause procedure Check_Component_Overlap (C1_Ent, C2_Ent : Entity_Id); -- Given two entities for record components or discriminants, checks -- if they have overlapping component clauses and issues errors if so. procedure Find_Component; -- Finds component entity corresponding to current component clause (in -- CC), and sets Comp to the entity, and Fbit/Lbit to the zero origin -- start/stop bits for the field. If there is no matching component or -- if the matching component does not have a component clause, then -- that's an error and Comp is set to Empty, but no error message is -- issued, since the message was already given. Comp is also set to -- Empty if the current "component clause" is in fact a pragma. procedure Record_Hole_Check (Rectype : Entity_Id; After_Last : out Uint; Warn : Boolean); -- Checks for gaps in the given Rectype. Compute After_Last, the bit -- number after the last component. Warn is True on the initial call, -- and warnings are given for gaps. For a type extension, this is called -- recursively to compute After_Last for the parent type; in this case -- Warn is False and the warnings are suppressed. procedure Component_Order_Check (Rectype : Entity_Id); -- Check that the order of component clauses agrees with the order of -- component declarations, and that the component clauses are given in -- increasing order of bit offset. ----------------------------- -- Check_Component_Overlap -- ----------------------------- procedure Check_Component_Overlap (C1_Ent, C2_Ent : Entity_Id) is CC1 : constant Node_Id := Component_Clause (C1_Ent); CC2 : constant Node_Id := Component_Clause (C2_Ent); begin if Present (CC1) and then Present (CC2) then -- Exclude odd case where we have two tag components in the same -- record, both at location zero. This seems a bit strange, but -- it seems to happen in some circumstances, perhaps on an error. if Chars (C1_Ent) = Name_uTag then return; end if; -- Here we check if the two fields overlap declare S1 : constant Uint := Component_Bit_Offset (C1_Ent); S2 : constant Uint := Component_Bit_Offset (C2_Ent); E1 : constant Uint := S1 + Esize (C1_Ent); E2 : constant Uint := S2 + Esize (C2_Ent); begin if E2 <= S1 or else E1 <= S2 then null; else Error_Msg_Node_2 := Component_Name (CC2); Error_Msg_Sloc := Sloc (Error_Msg_Node_2); Error_Msg_Node_1 := Component_Name (CC1); Error_Msg_N ("component& overlaps & #", Component_Name (CC1)); Overlap_Detected := True; end if; end; end if; end Check_Component_Overlap; --------------------------- -- Component_Order_Check -- --------------------------- procedure Component_Order_Check (Rectype : Entity_Id) is Comp : Entity_Id := First_Component (Rectype); Clause : Node_Id := First (Component_Clauses (N)); Prev_Bit_Offset : Uint := Uint_0; OOO : constant String := "?component clause out of order with respect to declaration"; begin -- Step Comp through components and Clause through component clauses, -- skipping pragmas. We ignore discriminants and variant parts, -- because we get most of the benefit from the plain vanilla -- component cases, without the extra complexity. If we find a Comp -- and Clause that don't match, give a warning on both and quit. If -- we find two subsequent clauses out of order by bit layout, give -- warning and quit. On each iteration, Prev_Bit_Offset is the one -- from the previous iteration (or 0 to start). while Present (Comp) and then Present (Clause) loop if Nkind (Clause) = N_Component_Clause and then Ekind (Entity (Component_Name (Clause))) = E_Component then if Entity (Component_Name (Clause)) /= Comp then Error_Msg_N (OOO, Comp); Error_Msg_N (OOO, Clause); exit; end if; if not Reverse_Bit_Order (Rectype) and then not Reverse_Storage_Order (Rectype) and then Component_Bit_Offset (Comp) < Prev_Bit_Offset then Error_Msg_N ("?memory layout out of order", Clause); exit; end if; Prev_Bit_Offset := Component_Bit_Offset (Comp); Next_Component (Comp); end if; Next (Clause); end loop; end Component_Order_Check; -------------------- -- Find_Component -- -------------------- procedure Find_Component is procedure Search_Component (R : Entity_Id); -- Search components of R for a match. If found, Comp is set ---------------------- -- Search_Component -- ---------------------- procedure Search_Component (R : Entity_Id) is begin Comp := First_Component_Or_Discriminant (R); while Present (Comp) loop -- Ignore error of attribute name for component name (we -- already gave an error message for this, so no need to -- complain here) if Nkind (Component_Name (CC)) = N_Attribute_Reference then null; else exit when Chars (Comp) = Chars (Component_Name (CC)); end if; Next_Component_Or_Discriminant (Comp); end loop; end Search_Component; -- Start of processing for Find_Component begin -- Return with Comp set to Empty if we have a pragma if Nkind (CC) = N_Pragma then Comp := Empty; return; end if; -- Search current record for matching component Search_Component (Rectype); -- If not found, maybe component of base type discriminant that is -- absent from statically constrained first subtype. if No (Comp) then Search_Component (Base_Type (Rectype)); end if; -- If no component, or the component does not reference the component -- clause in question, then there was some previous error for which -- we already gave a message, so just return with Comp Empty. if No (Comp) or else Component_Clause (Comp) /= CC then Check_Error_Detected; Comp := Empty; -- Normal case where we have a component clause else Fbit := Component_Bit_Offset (Comp); Lbit := Fbit + Esize (Comp) - 1; end if; end Find_Component; ----------------------- -- Record_Hole_Check -- ----------------------- procedure Record_Hole_Check (Rectype : Entity_Id; After_Last : out Uint; Warn : Boolean) is Decl : constant Node_Id := Declaration_Node (Base_Type (Rectype)); -- Full declaration of record type procedure Check_Component_List (DS : List_Id; CL : Node_Id; Sbit : Uint; Abit : out Uint); -- Check component list CL for holes. DS is a list of discriminant -- specifications to be included in the consideration of components. -- Sbit is the starting bit, which is zero if there are no preceding -- components (before a variant part, or a parent type, or a tag -- field). If there are preceding components, Sbit is the bit just -- after the last such component. Abit is set to the bit just after -- the last component of DS and CL. -------------------------- -- Check_Component_List -- -------------------------- procedure Check_Component_List (DS : List_Id; CL : Node_Id; Sbit : Uint; Abit : out Uint) is Compl : Integer; begin Compl := Integer (List_Length (Component_Items (CL))); if DS /= No_List then Compl := Compl + Integer (List_Length (DS)); end if; declare Comps : array (Natural range 0 .. Compl) of Entity_Id; -- Gather components (zero entry is for sort routine) Ncomps : Natural := 0; -- Number of entries stored in Comps (starting at Comps (1)) Citem : Node_Id; -- One component item or discriminant specification Nbit : Uint; -- Starting bit for next component CEnt : Entity_Id; -- Component entity Variant : Node_Id; -- One variant function Lt (Op1, Op2 : Natural) return Boolean; -- Compare routine for Sort procedure Move (From : Natural; To : Natural); -- Move routine for Sort package Sorting is new GNAT.Heap_Sort_G (Move, Lt); -------- -- Lt -- -------- function Lt (Op1, Op2 : Natural) return Boolean is begin return Component_Bit_Offset (Comps (Op1)) < Component_Bit_Offset (Comps (Op2)); end Lt; ---------- -- Move -- ---------- procedure Move (From : Natural; To : Natural) is begin Comps (To) := Comps (From); end Move; begin -- Gather discriminants into Comp if DS /= No_List then Citem := First (DS); while Present (Citem) loop if Nkind (Citem) = N_Discriminant_Specification then declare Ent : constant Entity_Id := Defining_Identifier (Citem); begin if Ekind (Ent) = E_Discriminant then Ncomps := Ncomps + 1; Comps (Ncomps) := Ent; end if; end; end if; Next (Citem); end loop; end if; -- Gather component entities into Comp Citem := First (Component_Items (CL)); while Present (Citem) loop if Nkind (Citem) = N_Component_Declaration then Ncomps := Ncomps + 1; Comps (Ncomps) := Defining_Identifier (Citem); end if; Next (Citem); end loop; -- Now sort the component entities based on the first bit. -- Note we already know there are no overlapping components. Sorting.Sort (Ncomps); -- Loop through entries checking for holes Nbit := Sbit; for J in 1 .. Ncomps loop CEnt := Comps (J); pragma Annotate (CodePeer, Modified, CEnt); declare CBO : constant Uint := Component_Bit_Offset (CEnt); begin -- Skip components with unknown offsets if CBO /= No_Uint and then CBO >= 0 then Error_Msg_Uint_1 := CBO - Nbit; if Warn and then Error_Msg_Uint_1 > 0 then Error_Msg_NE ("?H?^-bit gap before component&", Component_Name (Component_Clause (CEnt)), CEnt); end if; Nbit := CBO + Esize (CEnt); end if; end; end loop; -- Set Abit to just after the last nonvariant component Abit := Nbit; -- Process variant parts recursively if present. Set Abit to -- the maximum for all variant parts. if Present (Variant_Part (CL)) then declare Var_Start : constant Uint := Nbit; begin Variant := First (Variants (Variant_Part (CL))); while Present (Variant) loop Check_Component_List (No_List, Component_List (Variant), Var_Start, Nbit); Next (Variant); if Nbit > Abit then Abit := Nbit; end if; end loop; end; end if; end; end Check_Component_List; Sbit : Uint; -- Starting bit for call to Check_Component_List. Zero for an -- untagged type. The size of the Tag for a nonderived tagged -- type. Parent size for a type extension. Record_Definition : Node_Id; -- Record_Definition containing Component_List to pass to -- Check_Component_List. -- Start of processing for Record_Hole_Check begin if Is_Tagged_Type (Rectype) then Sbit := UI_From_Int (System_Address_Size); else Sbit := Uint_0; end if; After_Last := Uint_0; if Nkind (Decl) = N_Full_Type_Declaration then Record_Definition := Type_Definition (Decl); -- If we have a record extension, set Sbit to point after the last -- component of the parent type, by calling Record_Hole_Check -- recursively. if Nkind (Record_Definition) = N_Derived_Type_Definition then Record_Definition := Record_Extension_Part (Record_Definition); Record_Hole_Check (Underlying_Type (Parent_Subtype (Rectype)), After_Last => Sbit, Warn => False); end if; if Nkind (Record_Definition) = N_Record_Definition then Check_Component_List (Discriminant_Specifications (Decl), Component_List (Record_Definition), Sbit, After_Last); end if; end if; end Record_Hole_Check; -- Start of processing for Check_Record_Representation_Clause begin Find_Type (Ident); Rectype := Entity (Ident); if Rectype = Any_Type then return; end if; Rectype := Underlying_Type (Rectype); -- See if we have a fully repped derived tagged type declare PS : constant Entity_Id := Parent_Subtype (Rectype); begin if Present (PS) and then Known_Static_RM_Size (PS) then Tagged_Parent := PS; Parent_Last_Bit := RM_Size (PS) - 1; elsif Present (PS) and then Is_Fully_Repped_Tagged_Type (PS) then Tagged_Parent := PS; -- Find maximum bit of any component of the parent type Parent_Last_Bit := UI_From_Int (System_Address_Size - 1); Pcomp := First_Entity (Tagged_Parent); while Present (Pcomp) loop if Ekind (Pcomp) in E_Discriminant | E_Component then if Component_Bit_Offset (Pcomp) /= No_Uint and then Known_Static_Esize (Pcomp) then Parent_Last_Bit := UI_Max (Parent_Last_Bit, Component_Bit_Offset (Pcomp) + Esize (Pcomp) - 1); end if; else -- Skip anonymous types generated for constrained array -- or record components. null; end if; Next_Entity (Pcomp); end loop; end if; end; -- All done if no component clauses CC := First (Component_Clauses (N)); if No (CC) then return; end if; -- If a tag is present, then create a component clause that places it -- at the start of the record (otherwise gigi may place it after other -- fields that have rep clauses). Fent := First_Entity (Rectype); if Nkind (Fent) = N_Defining_Identifier and then Chars (Fent) = Name_uTag then Set_Component_Bit_Offset (Fent, Uint_0); Set_Normalized_Position (Fent, Uint_0); Set_Normalized_First_Bit (Fent, Uint_0); Set_Normalized_Position_Max (Fent, Uint_0); Init_Esize (Fent, System_Address_Size); Set_Component_Clause (Fent, Make_Component_Clause (Loc, Component_Name => Make_Identifier (Loc, Name_uTag), Position => Make_Integer_Literal (Loc, Uint_0), First_Bit => Make_Integer_Literal (Loc, Uint_0), Last_Bit => Make_Integer_Literal (Loc, UI_From_Int (System_Address_Size - 1)))); Ccount := Ccount + 1; end if; Max_Bit_So_Far := Uint_Minus_1; Overlap_Check_Required := False; -- Process the component clauses while Present (CC) loop Find_Component; if Present (Comp) then Ccount := Ccount + 1; -- We need a full overlap check if record positions non-monotonic if Fbit <= Max_Bit_So_Far then Overlap_Check_Required := True; end if; Max_Bit_So_Far := Lbit; -- Check bit position out of range of specified size if Has_Size_Clause (Rectype) and then RM_Size (Rectype) <= Lbit then Error_Msg_Uint_1 := RM_Size (Rectype); Error_Msg_Uint_2 := Lbit + 1; Error_Msg_N ("bit number out of range of specified " & "size (expected ^, got ^)", Last_Bit (CC)); -- Check for overlap with tag or parent component else if Is_Tagged_Type (Rectype) and then Fbit < System_Address_Size then Error_Msg_NE ("component overlaps tag field of&", Component_Name (CC), Rectype); Overlap_Detected := True; elsif Present (Tagged_Parent) and then Fbit <= Parent_Last_Bit then Error_Msg_NE ("component overlaps parent field of&", Component_Name (CC), Rectype); Overlap_Detected := True; end if; if Hbit < Lbit then Hbit := Lbit; end if; end if; end if; Next (CC); end loop; -- Now that we have processed all the component clauses, check for -- overlap. We have to leave this till last, since the components can -- appear in any arbitrary order in the representation clause. -- We do not need this check if all specified ranges were monotonic, -- as recorded by Overlap_Check_Required being False at this stage. -- This first section checks if there are any overlapping entries at -- all. It does this by sorting all entries and then seeing if there are -- any overlaps. If there are none, then that is decisive, but if there -- are overlaps, they may still be OK (they may result from fields in -- different variants). if Overlap_Check_Required then Overlap_Check1 : declare OC_Fbit : array (0 .. Ccount) of Uint; -- First-bit values for component clauses, the value is the offset -- of the first bit of the field from start of record. The zero -- entry is for use in sorting. OC_Lbit : array (0 .. Ccount) of Uint; -- Last-bit values for component clauses, the value is the offset -- of the last bit of the field from start of record. The zero -- entry is for use in sorting. OC_Count : Natural := 0; -- Count of entries in OC_Fbit and OC_Lbit function OC_Lt (Op1, Op2 : Natural) return Boolean; -- Compare routine for Sort procedure OC_Move (From : Natural; To : Natural); -- Move routine for Sort package Sorting is new GNAT.Heap_Sort_G (OC_Move, OC_Lt); ----------- -- OC_Lt -- ----------- function OC_Lt (Op1, Op2 : Natural) return Boolean is begin return OC_Fbit (Op1) < OC_Fbit (Op2); end OC_Lt; ------------- -- OC_Move -- ------------- procedure OC_Move (From : Natural; To : Natural) is begin OC_Fbit (To) := OC_Fbit (From); OC_Lbit (To) := OC_Lbit (From); end OC_Move; -- Start of processing for Overlap_Check begin CC := First (Component_Clauses (N)); while Present (CC) loop -- Exclude component clause already marked in error if not Error_Posted (CC) then Find_Component; if Present (Comp) then OC_Count := OC_Count + 1; OC_Fbit (OC_Count) := Fbit; OC_Lbit (OC_Count) := Lbit; end if; end if; Next (CC); end loop; Sorting.Sort (OC_Count); Overlap_Check_Required := False; for J in 1 .. OC_Count - 1 loop if OC_Lbit (J) >= OC_Fbit (J + 1) then Overlap_Check_Required := True; exit; end if; end loop; end Overlap_Check1; end if; -- If Overlap_Check_Required is still True, then we have to do the full -- scale overlap check, since we have at least two fields that do -- overlap, and we need to know if that is OK since they are in -- different variant, or whether we have a definite problem. if Overlap_Check_Required then Overlap_Check2 : declare C1_Ent, C2_Ent : Entity_Id; -- Entities of components being checked for overlap Clist : Node_Id; -- Component_List node whose Component_Items are being checked Citem : Node_Id; -- Component declaration for component being checked begin C1_Ent := First_Entity (Base_Type (Rectype)); -- Loop through all components in record. For each component check -- for overlap with any of the preceding elements on the component -- list containing the component and also, if the component is in -- a variant, check against components outside the case structure. -- This latter test is repeated recursively up the variant tree. Main_Component_Loop : while Present (C1_Ent) loop if Ekind (C1_Ent) not in E_Component | E_Discriminant then goto Continue_Main_Component_Loop; end if; -- Skip overlap check if entity has no declaration node. This -- happens with discriminants in constrained derived types. -- Possibly we are missing some checks as a result, but that -- does not seem terribly serious. if No (Declaration_Node (C1_Ent)) then goto Continue_Main_Component_Loop; end if; Clist := Parent (List_Containing (Declaration_Node (C1_Ent))); -- Loop through component lists that need checking. Check the -- current component list and all lists in variants above us. Component_List_Loop : loop -- If derived type definition, go to full declaration -- If at outer level, check discriminants if there are any. if Nkind (Clist) = N_Derived_Type_Definition then Clist := Parent (Clist); end if; -- Outer level of record definition, check discriminants -- but be careful not to flag a non-girder discriminant -- and the girder discriminant it renames as overlapping. if Nkind (Clist) in N_Full_Type_Declaration | N_Private_Type_Declaration then if Has_Discriminants (Defining_Identifier (Clist)) then C2_Ent := First_Discriminant (Defining_Identifier (Clist)); while Present (C2_Ent) loop exit when Original_Record_Component (C1_Ent) = Original_Record_Component (C2_Ent); Check_Component_Overlap (C1_Ent, C2_Ent); Next_Discriminant (C2_Ent); end loop; end if; -- Record extension case elsif Nkind (Clist) = N_Derived_Type_Definition then Clist := Empty; -- Otherwise check one component list else Citem := First (Component_Items (Clist)); while Present (Citem) loop if Nkind (Citem) = N_Component_Declaration then C2_Ent := Defining_Identifier (Citem); exit when C1_Ent = C2_Ent; Check_Component_Overlap (C1_Ent, C2_Ent); end if; Next (Citem); end loop; end if; -- Check for variants above us (the parent of the Clist can -- be a variant, in which case its parent is a variant part, -- and the parent of the variant part is a component list -- whose components must all be checked against the current -- component for overlap). if Nkind (Parent (Clist)) = N_Variant then Clist := Parent (Parent (Parent (Clist))); -- Check for possible discriminant part in record, this -- is treated essentially as another level in the -- recursion. For this case the parent of the component -- list is the record definition, and its parent is the -- full type declaration containing the discriminant -- specifications. elsif Nkind (Parent (Clist)) = N_Record_Definition then Clist := Parent (Parent ((Clist))); -- If neither of these two cases, we are at the top of -- the tree. else exit Component_List_Loop; end if; end loop Component_List_Loop; <<Continue_Main_Component_Loop>> Next_Entity (C1_Ent); end loop Main_Component_Loop; end Overlap_Check2; end if; -- Skip the following warnings if overlap was detected; programmer -- should fix the errors first. if not Overlap_Detected then -- Check for record holes (gaps) if Warn_On_Record_Holes then declare Ignore : Uint; begin Record_Hole_Check (Rectype, After_Last => Ignore, Warn => True); end; end if; -- Check for out-of-order component clauses if Warn_On_Component_Order then Component_Order_Check (Rectype); end if; end if; -- For records that have component clauses for all components, and whose -- size is less than or equal to 32, and which can be fully packed, we -- need to know the size in the front end to activate possible packed -- array processing where the component type is a record. -- At this stage Hbit + 1 represents the first unused bit from all the -- component clauses processed, so if the component clauses are -- complete, then this is the length of the record. -- For records longer than System.Storage_Unit, and for those where not -- all components have component clauses, the back end determines the -- length (it may for example be appropriate to round up the size -- to some convenient boundary, based on alignment considerations, etc). if Unknown_RM_Size (Rectype) and then Hbit + 1 <= 32 and then not Strict_Alignment (Rectype) then -- Nothing to do if at least one component has no component clause Comp := First_Component_Or_Discriminant (Rectype); while Present (Comp) loop exit when No (Component_Clause (Comp)); Next_Component_Or_Discriminant (Comp); end loop; -- If we fall out of loop, all components have component clauses -- and so we can set the size to the maximum value. if No (Comp) then Set_RM_Size (Rectype, Hbit + 1); end if; end if; end Check_Record_Representation_Clause; ---------------- -- Check_Size -- ---------------- procedure Check_Size (N : Node_Id; T : Entity_Id; Siz : Uint; Biased : out Boolean) is procedure Size_Too_Small_Error (Min_Siz : Uint); -- Emit an error concerning illegal size Siz. Min_Siz denotes the -- minimum size. -------------------------- -- Size_Too_Small_Error -- -------------------------- procedure Size_Too_Small_Error (Min_Siz : Uint) is begin Error_Msg_Uint_1 := Min_Siz; Error_Msg_NE (Size_Too_Small_Message, N, T); end Size_Too_Small_Error; -- Local variables UT : constant Entity_Id := Underlying_Type (T); M : Uint; -- Start of processing for Check_Size begin Biased := False; -- Reject patently improper size values if Is_Elementary_Type (T) and then Siz > UI_From_Int (Int'Last) then Error_Msg_N ("Size value too large for elementary type", N); if Nkind (Original_Node (N)) = N_Op_Expon then Error_Msg_N ("\maybe '* was meant, rather than '*'*", Original_Node (N)); end if; end if; -- Dismiss generic types if Is_Generic_Type (T) or else Is_Generic_Type (UT) or else Is_Generic_Type (Root_Type (UT)) then return; -- Guard against previous errors elsif No (UT) or else UT = Any_Type then Check_Error_Detected; return; -- Check case of bit packed array elsif Is_Array_Type (UT) and then Known_Static_Component_Size (UT) and then Is_Bit_Packed_Array (UT) then declare Asiz : Uint; Indx : Node_Id; Ityp : Entity_Id; begin Asiz := Component_Size (UT); Indx := First_Index (UT); loop Ityp := Etype (Indx); -- If non-static bound, then we are not in the business of -- trying to check the length, and indeed an error will be -- issued elsewhere, since sizes of non-static array types -- cannot be set implicitly or explicitly. if not Is_OK_Static_Subtype (Ityp) then return; end if; -- Otherwise accumulate next dimension Asiz := Asiz * (Expr_Value (Type_High_Bound (Ityp)) - Expr_Value (Type_Low_Bound (Ityp)) + Uint_1); Next_Index (Indx); exit when No (Indx); end loop; if Asiz <= Siz then return; else Size_Too_Small_Error (Asiz); Set_Esize (T, Asiz); Set_RM_Size (T, Asiz); end if; end; -- All other composite types are ignored elsif Is_Composite_Type (UT) then return; -- For fixed-point types, don't check minimum if type is not frozen, -- since we don't know all the characteristics of the type that can -- affect the size (e.g. a specified small) till freeze time. elsif Is_Fixed_Point_Type (UT) and then not Is_Frozen (UT) then null; -- Cases for which a minimum check is required else -- Ignore if specified size is correct for the type if Known_Esize (UT) and then Siz = Esize (UT) then return; end if; -- Otherwise get minimum size M := UI_From_Int (Minimum_Size (UT)); if Siz < M then -- Size is less than minimum size, but one possibility remains -- that we can manage with the new size if we bias the type. M := UI_From_Int (Minimum_Size (UT, Biased => True)); if Siz < M then Size_Too_Small_Error (M); Set_Esize (T, M); Set_RM_Size (T, M); else Biased := True; end if; end if; end if; end Check_Size; -------------------------- -- Freeze_Entity_Checks -- -------------------------- procedure Freeze_Entity_Checks (N : Node_Id) is procedure Hide_Non_Overridden_Subprograms (Typ : Entity_Id); -- Inspect the primitive operations of type Typ and hide all pairs of -- implicitly declared non-overridden non-fully conformant homographs -- (Ada RM 8.3 12.3/2). ------------------------------------- -- Hide_Non_Overridden_Subprograms -- ------------------------------------- procedure Hide_Non_Overridden_Subprograms (Typ : Entity_Id) is procedure Hide_Matching_Homographs (Subp_Id : Entity_Id; Start_Elmt : Elmt_Id); -- Inspect a list of primitive operations starting with Start_Elmt -- and find matching implicitly declared non-overridden non-fully -- conformant homographs of Subp_Id. If found, all matches along -- with Subp_Id are hidden from all visibility. function Is_Non_Overridden_Or_Null_Procedure (Subp_Id : Entity_Id) return Boolean; -- Determine whether subprogram Subp_Id is implicitly declared non- -- overridden subprogram or an implicitly declared null procedure. ------------------------------ -- Hide_Matching_Homographs -- ------------------------------ procedure Hide_Matching_Homographs (Subp_Id : Entity_Id; Start_Elmt : Elmt_Id) is Prim : Entity_Id; Prim_Elmt : Elmt_Id; begin Prim_Elmt := Start_Elmt; while Present (Prim_Elmt) loop Prim := Node (Prim_Elmt); -- The current primitive is implicitly declared non-overridden -- non-fully conformant homograph of Subp_Id. Both subprograms -- must be hidden from visibility. if Chars (Prim) = Chars (Subp_Id) and then Is_Non_Overridden_Or_Null_Procedure (Prim) and then not Fully_Conformant (Prim, Subp_Id) then Set_Is_Hidden_Non_Overridden_Subpgm (Prim); Set_Is_Immediately_Visible (Prim, False); Set_Is_Potentially_Use_Visible (Prim, False); Set_Is_Hidden_Non_Overridden_Subpgm (Subp_Id); Set_Is_Immediately_Visible (Subp_Id, False); Set_Is_Potentially_Use_Visible (Subp_Id, False); end if; Next_Elmt (Prim_Elmt); end loop; end Hide_Matching_Homographs; ----------------------------------------- -- Is_Non_Overridden_Or_Null_Procedure -- ----------------------------------------- function Is_Non_Overridden_Or_Null_Procedure (Subp_Id : Entity_Id) return Boolean is Alias_Id : Entity_Id; begin -- The subprogram is inherited (implicitly declared), it does not -- override and does not cover a primitive of an interface. if Ekind (Subp_Id) in E_Function | E_Procedure and then Present (Alias (Subp_Id)) and then No (Interface_Alias (Subp_Id)) and then No (Overridden_Operation (Subp_Id)) then Alias_Id := Alias (Subp_Id); if Requires_Overriding (Alias_Id) then return True; elsif Nkind (Parent (Alias_Id)) = N_Procedure_Specification and then Null_Present (Parent (Alias_Id)) then return True; end if; end if; return False; end Is_Non_Overridden_Or_Null_Procedure; -- Local variables Prim_Ops : constant Elist_Id := Direct_Primitive_Operations (Typ); Prim : Entity_Id; Prim_Elmt : Elmt_Id; -- Start of processing for Hide_Non_Overridden_Subprograms begin -- Inspect the list of primitives looking for non-overridden -- subprograms. if Present (Prim_Ops) then Prim_Elmt := First_Elmt (Prim_Ops); while Present (Prim_Elmt) loop Prim := Node (Prim_Elmt); Next_Elmt (Prim_Elmt); if Is_Non_Overridden_Or_Null_Procedure (Prim) then Hide_Matching_Homographs (Subp_Id => Prim, Start_Elmt => Prim_Elmt); end if; end loop; end if; end Hide_Non_Overridden_Subprograms; -- Local variables E : constant Entity_Id := Entity (N); Nongeneric_Case : constant Boolean := Nkind (N) = N_Freeze_Entity; -- True in nongeneric case. Some of the processing here is skipped -- for the generic case since it is not needed. Basically in the -- generic case, we only need to do stuff that might generate error -- messages or warnings. -- Start of processing for Freeze_Entity_Checks begin -- Remember that we are processing a freezing entity. Required to -- ensure correct decoration of internal entities associated with -- interfaces (see New_Overloaded_Entity). Inside_Freezing_Actions := Inside_Freezing_Actions + 1; -- For tagged types covering interfaces add internal entities that link -- the primitives of the interfaces with the primitives that cover them. -- Note: These entities were originally generated only when generating -- code because their main purpose was to provide support to initialize -- the secondary dispatch tables. They are also used to locate -- primitives covering interfaces when processing generics (see -- Derive_Subprograms). -- This is not needed in the generic case if Ada_Version >= Ada_2005 and then Nongeneric_Case and then Ekind (E) = E_Record_Type and then Is_Tagged_Type (E) and then not Is_Interface (E) and then Has_Interfaces (E) then -- This would be a good common place to call the routine that checks -- overriding of interface primitives (and thus factorize calls to -- Check_Abstract_Overriding located at different contexts in the -- compiler). However, this is not possible because it causes -- spurious errors in case of late overriding. Add_Internal_Interface_Entities (E); end if; -- After all forms of overriding have been resolved, a tagged type may -- be left with a set of implicitly declared and possibly erroneous -- abstract subprograms, null procedures and subprograms that require -- overriding. If this set contains fully conformant homographs, then -- one is chosen arbitrarily (already done during resolution), otherwise -- all remaining non-fully conformant homographs are hidden from -- visibility (Ada RM 8.3 12.3/2). if Is_Tagged_Type (E) then Hide_Non_Overridden_Subprograms (E); end if; -- Check CPP types if Ekind (E) = E_Record_Type and then Is_CPP_Class (E) and then Is_Tagged_Type (E) and then Tagged_Type_Expansion then if CPP_Num_Prims (E) = 0 then -- If the CPP type has user defined components then it must import -- primitives from C++. This is required because if the C++ class -- has no primitives then the C++ compiler does not added the _tag -- component to the type. if First_Entity (E) /= Last_Entity (E) then Error_Msg_N ("'C'P'P type must import at least one primitive from C++??", E); end if; end if; -- Check that all its primitives are abstract or imported from C++. -- Check also availability of the C++ constructor. declare Has_Constructors : constant Boolean := Has_CPP_Constructors (E); Elmt : Elmt_Id; Error_Reported : Boolean := False; Prim : Node_Id; begin Elmt := First_Elmt (Primitive_Operations (E)); while Present (Elmt) loop Prim := Node (Elmt); if Comes_From_Source (Prim) then if Is_Abstract_Subprogram (Prim) then null; elsif not Is_Imported (Prim) or else Convention (Prim) /= Convention_CPP then Error_Msg_N ("primitives of 'C'P'P types must be imported from C++ " & "or abstract??", Prim); elsif not Has_Constructors and then not Error_Reported then Error_Msg_Name_1 := Chars (E); Error_Msg_N ("??'C'P'P constructor required for type %", Prim); Error_Reported := True; end if; end if; Next_Elmt (Elmt); end loop; end; end if; -- Check Ada derivation of CPP type if Expander_Active -- why? losing errors in -gnatc mode??? and then Present (Etype (E)) -- defend against errors and then Tagged_Type_Expansion and then Ekind (E) = E_Record_Type and then Etype (E) /= E and then Is_CPP_Class (Etype (E)) and then CPP_Num_Prims (Etype (E)) > 0 and then not Is_CPP_Class (E) and then not Has_CPP_Constructors (Etype (E)) then -- If the parent has C++ primitives but it has no constructor then -- check that all the primitives are overridden in this derivation; -- otherwise the constructor of the parent is needed to build the -- dispatch table. declare Elmt : Elmt_Id; Prim : Node_Id; begin Elmt := First_Elmt (Primitive_Operations (E)); while Present (Elmt) loop Prim := Node (Elmt); if not Is_Abstract_Subprogram (Prim) and then No (Interface_Alias (Prim)) and then Find_Dispatching_Type (Ultimate_Alias (Prim)) /= E then Error_Msg_Name_1 := Chars (Etype (E)); Error_Msg_N ("'C'P'P constructor required for parent type %", E); exit; end if; Next_Elmt (Elmt); end loop; end; end if; Inside_Freezing_Actions := Inside_Freezing_Actions - 1; -- If we have a type with predicates, build predicate function. This is -- not needed in the generic case, nor within e.g. TSS subprograms and -- other predefined primitives. For a derived type, ensure that the -- parent type is already frozen so that its predicate function has been -- constructed already. This is necessary if the parent is declared -- in a nested package and its own freeze point has not been reached. if Is_Type (E) and then Nongeneric_Case and then Has_Predicates (E) and then Predicate_Check_In_Scope (N) then declare Atyp : constant Entity_Id := Nearest_Ancestor (E); begin if Present (Atyp) and then Has_Predicates (Atyp) and then not Is_Frozen (Atyp) then Freeze_Before (N, Atyp); end if; end; Build_Predicate_Functions (E, N); end if; -- If type has delayed aspects, this is where we do the preanalysis at -- the freeze point, as part of the consistent visibility check. Note -- that this must be done after calling Build_Predicate_Functions or -- Build_Invariant_Procedure since these subprograms fix occurrences of -- the subtype name in the saved expression so that they will not cause -- trouble in the preanalysis. -- This is also not needed in the generic case if Nongeneric_Case and then Has_Delayed_Aspects (E) and then Scope (E) = Current_Scope then declare A_Id : Aspect_Id; Ritem : Node_Id; begin -- Look for aspect specification entries for this entity Ritem := First_Rep_Item (E); while Present (Ritem) loop if Nkind (Ritem) = N_Aspect_Specification and then Entity (Ritem) = E and then Is_Delayed_Aspect (Ritem) then A_Id := Get_Aspect_Id (Ritem); if A_Id = Aspect_Dynamic_Predicate or else A_Id = Aspect_Predicate or else A_Id = Aspect_Priority or else A_Id = Aspect_CPU then -- Retrieve the visibility to components and discriminants -- in order to properly analyze the aspects. Push_Type (E); Check_Aspect_At_Freeze_Point (Ritem); Pop_Type (E); else Check_Aspect_At_Freeze_Point (Ritem); end if; end if; Next_Rep_Item (Ritem); end loop; end; end if; -- For a record type, deal with variant parts. This has to be delayed to -- this point, because of the issue of statically predicated subtypes, -- which we have to ensure are frozen before checking choices, since we -- need to have the static choice list set. if Is_Record_Type (E) then Check_Variant_Part : declare D : constant Node_Id := Declaration_Node (E); T : Node_Id; C : Node_Id; VP : Node_Id; Others_Present : Boolean; pragma Warnings (Off, Others_Present); -- Indicates others present, not used in this case procedure Non_Static_Choice_Error (Choice : Node_Id); -- Error routine invoked by the generic instantiation below when -- the variant part has a non static choice. procedure Process_Declarations (Variant : Node_Id); -- Processes declarations associated with a variant. We analyzed -- the declarations earlier (in Sem_Ch3.Analyze_Variant_Part), -- but we still need the recursive call to Check_Choices for any -- nested variant to get its choices properly processed. This is -- also where we expand out the choices if expansion is active. package Variant_Choices_Processing is new Generic_Check_Choices (Process_Empty_Choice => No_OP, Process_Non_Static_Choice => Non_Static_Choice_Error, Process_Associated_Node => Process_Declarations); use Variant_Choices_Processing; ----------------------------- -- Non_Static_Choice_Error -- ----------------------------- procedure Non_Static_Choice_Error (Choice : Node_Id) is begin Flag_Non_Static_Expr ("choice given in variant part is not static!", Choice); end Non_Static_Choice_Error; -------------------------- -- Process_Declarations -- -------------------------- procedure Process_Declarations (Variant : Node_Id) is CL : constant Node_Id := Component_List (Variant); VP : Node_Id; begin -- Check for static predicate present in this variant if Has_SP_Choice (Variant) then -- Here we expand. You might expect to find this call in -- Expand_N_Variant_Part, but that is called when we first -- see the variant part, and we cannot do this expansion -- earlier than the freeze point, since for statically -- predicated subtypes, the predicate is not known till -- the freeze point. -- Furthermore, we do this expansion even if the expander -- is not active, because other semantic processing, e.g. -- for aggregates, requires the expanded list of choices. -- If the expander is not active, then we can't just clobber -- the list since it would invalidate the tree. -- So we have to rewrite the variant part with a Rewrite -- call that replaces it with a copy and clobber the copy. if not Expander_Active then declare NewV : constant Node_Id := New_Copy (Variant); begin Set_Discrete_Choices (NewV, New_Copy_List (Discrete_Choices (Variant))); Rewrite (Variant, NewV); end; end if; Expand_Static_Predicates_In_Choices (Variant); end if; -- We don't need to worry about the declarations in the variant -- (since they were analyzed by Analyze_Choices when we first -- encountered the variant), but we do need to take care of -- expansion of any nested variants. if not Null_Present (CL) then VP := Variant_Part (CL); if Present (VP) then Check_Choices (VP, Variants (VP), Etype (Name (VP)), Others_Present); end if; end if; end Process_Declarations; -- Start of processing for Check_Variant_Part begin -- Find component list C := Empty; if Nkind (D) = N_Full_Type_Declaration then T := Type_Definition (D); if Nkind (T) = N_Record_Definition then C := Component_List (T); elsif Nkind (T) = N_Derived_Type_Definition and then Present (Record_Extension_Part (T)) then C := Component_List (Record_Extension_Part (T)); end if; end if; -- Case of variant part present if Present (C) and then Present (Variant_Part (C)) then VP := Variant_Part (C); -- Check choices Check_Choices (VP, Variants (VP), Etype (Name (VP)), Others_Present); -- If the last variant does not contain the Others choice, -- replace it with an N_Others_Choice node since Gigi always -- wants an Others. Note that we do not bother to call Analyze -- on the modified variant part, since its only effect would be -- to compute the Others_Discrete_Choices node laboriously, and -- of course we already know the list of choices corresponding -- to the others choice (it's the list we're replacing). -- We only want to do this if the expander is active, since -- we do not want to clobber the tree. if Expander_Active then declare Last_Var : constant Node_Id := Last_Non_Pragma (Variants (VP)); Others_Node : Node_Id; begin if Nkind (First (Discrete_Choices (Last_Var))) /= N_Others_Choice then Others_Node := Make_Others_Choice (Sloc (Last_Var)); Set_Others_Discrete_Choices (Others_Node, Discrete_Choices (Last_Var)); Set_Discrete_Choices (Last_Var, New_List (Others_Node)); end if; end; end if; end if; end Check_Variant_Part; end if; end Freeze_Entity_Checks; ------------------------- -- Get_Alignment_Value -- ------------------------- function Get_Alignment_Value (Expr : Node_Id) return Uint is Align : constant Uint := Static_Integer (Expr); begin if Align = No_Uint then return No_Uint; elsif Align < 0 then Error_Msg_N ("alignment value must be positive", Expr); return No_Uint; -- If Alignment is specified to be 0, we treat it the same as 1 elsif Align = 0 then return Uint_1; else for J in Int range 0 .. 64 loop declare M : constant Uint := Uint_2 ** J; begin exit when M = Align; if M > Align then Error_Msg_N ("alignment value must be power of 2", Expr); return No_Uint; end if; end; end loop; return Align; end if; end Get_Alignment_Value; ----------------------------------- -- Has_Compatible_Representation -- ----------------------------------- function Has_Compatible_Representation (Target_Type, Operand_Type : Entity_Id) return Boolean is T1 : constant Entity_Id := Underlying_Type (Target_Type); T2 : constant Entity_Id := Underlying_Type (Operand_Type); begin -- A quick check, if base types are the same, then we definitely have -- the same representation, because the subtype specific representation -- attributes (Size and Alignment) do not affect representation from -- the point of view of this test. if Base_Type (T1) = Base_Type (T2) then return True; elsif Is_Private_Type (Base_Type (T2)) and then Base_Type (T1) = Full_View (Base_Type (T2)) then return True; -- If T2 is a generic actual it is declared as a subtype, so -- check against its base type. elsif Is_Generic_Actual_Type (T1) and then Has_Compatible_Representation (Base_Type (T1), T2) then return True; end if; -- Tagged types always have the same representation, because it is not -- possible to specify different representations for common fields. if Is_Tagged_Type (T1) then return True; end if; -- Representations are definitely different if conventions differ if Convention (T1) /= Convention (T2) then return False; end if; -- Representations are different if component alignments or scalar -- storage orders differ. if (Is_Record_Type (T1) or else Is_Array_Type (T1)) and then (Is_Record_Type (T2) or else Is_Array_Type (T2)) and then (Component_Alignment (T1) /= Component_Alignment (T2) or else Reverse_Storage_Order (T1) /= Reverse_Storage_Order (T2)) then return False; end if; -- For arrays, the only real issue is component size. If we know the -- component size for both arrays, and it is the same, then that's -- good enough to know we don't have a change of representation. if Is_Array_Type (T1) then -- In a view conversion, if the target type is an array type having -- aliased components and the operand type is an array type having -- unaliased components, then a new object is created (4.6(58.3/4)). if Has_Aliased_Components (T1) and then not Has_Aliased_Components (T2) then return False; end if; if Known_Component_Size (T1) and then Known_Component_Size (T2) and then Component_Size (T1) = Component_Size (T2) then return True; end if; end if; -- For records, representations are different if reorderings differ if Is_Record_Type (T1) and then Is_Record_Type (T2) and then No_Reordering (T1) /= No_Reordering (T2) then return False; end if; -- Types definitely have same representation if neither has non-standard -- representation since default representations are always consistent. -- If only one has non-standard representation, and the other does not, -- then we consider that they do not have the same representation. They -- might, but there is no way of telling early enough. if Has_Non_Standard_Rep (T1) then if not Has_Non_Standard_Rep (T2) then return False; end if; else return not Has_Non_Standard_Rep (T2); end if; -- Here the two types both have non-standard representation, and we need -- to determine if they have the same non-standard representation. -- For arrays, we simply need to test if the component sizes are the -- same. Pragma Pack is reflected in modified component sizes, so this -- check also deals with pragma Pack. if Is_Array_Type (T1) then return Component_Size (T1) = Component_Size (T2); -- Case of record types elsif Is_Record_Type (T1) then -- Packed status must conform if Is_Packed (T1) /= Is_Packed (T2) then return False; -- Otherwise we must check components. Typ2 maybe a constrained -- subtype with fewer components, so we compare the components -- of the base types. else Record_Case : declare CD1, CD2 : Entity_Id; function Same_Rep return Boolean; -- CD1 and CD2 are either components or discriminants. This -- function tests whether they have the same representation. -------------- -- Same_Rep -- -------------- function Same_Rep return Boolean is begin if No (Component_Clause (CD1)) then return No (Component_Clause (CD2)); else -- Note: at this point, component clauses have been -- normalized to the default bit order, so that the -- comparison of Component_Bit_Offsets is meaningful. return Present (Component_Clause (CD2)) and then Component_Bit_Offset (CD1) = Component_Bit_Offset (CD2) and then Esize (CD1) = Esize (CD2); end if; end Same_Rep; -- Start of processing for Record_Case begin if Has_Discriminants (T1) then -- The number of discriminants may be different if the -- derived type has fewer (constrained by values). The -- invisible discriminants retain the representation of -- the original, so the discrepancy does not per se -- indicate a different representation. CD1 := First_Discriminant (T1); CD2 := First_Discriminant (T2); while Present (CD1) and then Present (CD2) loop if not Same_Rep then return False; else Next_Discriminant (CD1); Next_Discriminant (CD2); end if; end loop; end if; CD1 := First_Component (Underlying_Type (Base_Type (T1))); CD2 := First_Component (Underlying_Type (Base_Type (T2))); while Present (CD1) loop if not Same_Rep then return False; else Next_Component (CD1); Next_Component (CD2); end if; end loop; return True; end Record_Case; end if; -- For enumeration types, we must check each literal to see if the -- representation is the same. Note that we do not permit enumeration -- representation clauses for Character and Wide_Character, so these -- cases were already dealt with. elsif Is_Enumeration_Type (T1) then Enumeration_Case : declare L1, L2 : Entity_Id; begin L1 := First_Literal (T1); L2 := First_Literal (T2); while Present (L1) loop if Enumeration_Rep (L1) /= Enumeration_Rep (L2) then return False; else Next_Literal (L1); Next_Literal (L2); end if; end loop; return True; end Enumeration_Case; -- Any other types have the same representation for these purposes else return True; end if; end Has_Compatible_Representation; ------------------------------------- -- Inherit_Aspects_At_Freeze_Point -- ------------------------------------- procedure Inherit_Aspects_At_Freeze_Point (Typ : Entity_Id) is function Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item (Rep_Item : Node_Id) return Boolean; -- This routine checks if Rep_Item is either a pragma or an aspect -- specification node whose correponding pragma (if any) is present in -- the Rep Item chain of the entity it has been specified to. function Rep_Item_Entity (Rep_Item : Node_Id) return Entity_Id; -- Return the entity for which Rep_Item is specified -------------------------------------------------- -- Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item -- -------------------------------------------------- function Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item (Rep_Item : Node_Id) return Boolean is begin return Nkind (Rep_Item) = N_Pragma or else Present_In_Rep_Item (Entity (Rep_Item), Aspect_Rep_Item (Rep_Item)); end Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item; --------------------- -- Rep_Item_Entity -- --------------------- function Rep_Item_Entity (Rep_Item : Node_Id) return Entity_Id is begin if Nkind (Rep_Item) = N_Aspect_Specification then return Entity (Rep_Item); else pragma Assert (Nkind (Rep_Item) in N_Attribute_Definition_Clause | N_Pragma); return Entity (Name (Rep_Item)); end if; end Rep_Item_Entity; -- Start of processing for Inherit_Aspects_At_Freeze_Point begin -- A representation item is either subtype-specific (Size and Alignment -- clauses) or type-related (all others). Subtype-specific aspects may -- differ for different subtypes of the same type (RM 13.1.8). -- A derived type inherits each type-related representation aspect of -- its parent type that was directly specified before the declaration of -- the derived type (RM 13.1.15). -- A derived subtype inherits each subtype-specific representation -- aspect of its parent subtype that was directly specified before the -- declaration of the derived type (RM 13.1.15). -- The general processing involves inheriting a representation aspect -- from a parent type whenever the first rep item (aspect specification, -- attribute definition clause, pragma) corresponding to the given -- representation aspect in the rep item chain of Typ, if any, isn't -- directly specified to Typ but to one of its parents. -- ??? Note that, for now, just a limited number of representation -- aspects have been inherited here so far. Many of them are -- still inherited in Sem_Ch3. This will be fixed soon. Here is -- a non- exhaustive list of aspects that likely also need to -- be moved to this routine: Alignment, Component_Alignment, -- Component_Size, Machine_Radix, Object_Size, Pack, Predicates, -- Preelaborable_Initialization, RM_Size and Small. -- In addition, Convention must be propagated from base type to subtype, -- because the subtype may have been declared on an incomplete view. if Nkind (Parent (Typ)) = N_Private_Extension_Declaration then return; end if; -- Ada_05/Ada_2005 if not Has_Rep_Item (Typ, Name_Ada_05, Name_Ada_2005, False) and then Has_Rep_Item (Typ, Name_Ada_05, Name_Ada_2005) and then Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item (Get_Rep_Item (Typ, Name_Ada_05, Name_Ada_2005)) then Set_Is_Ada_2005_Only (Typ); end if; -- Ada_12/Ada_2012 if not Has_Rep_Item (Typ, Name_Ada_12, Name_Ada_2012, False) and then Has_Rep_Item (Typ, Name_Ada_12, Name_Ada_2012) and then Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item (Get_Rep_Item (Typ, Name_Ada_12, Name_Ada_2012)) then Set_Is_Ada_2012_Only (Typ); end if; -- Atomic/Shared if not Has_Rep_Item (Typ, Name_Atomic, Name_Shared, False) and then Has_Rep_Pragma (Typ, Name_Atomic, Name_Shared) and then Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item (Get_Rep_Item (Typ, Name_Atomic, Name_Shared)) then Set_Is_Atomic (Typ); Set_Is_Volatile (Typ); Set_Treat_As_Volatile (Typ); end if; -- Convention if Is_Record_Type (Typ) and then Typ /= Base_Type (Typ) and then Is_Frozen (Base_Type (Typ)) then Set_Convention (Typ, Convention (Base_Type (Typ))); end if; -- Default_Component_Value -- Verify that there is no rep_item declared for the type, and there -- is one coming from an ancestor. if Is_Array_Type (Typ) and then Is_Base_Type (Typ) and then not Has_Rep_Item (Typ, Name_Default_Component_Value, False) and then Has_Rep_Item (Typ, Name_Default_Component_Value) then Set_Default_Aspect_Component_Value (Typ, Default_Aspect_Component_Value (Entity (Get_Rep_Item (Typ, Name_Default_Component_Value)))); end if; -- Default_Value if Is_Scalar_Type (Typ) and then Is_Base_Type (Typ) and then not Has_Rep_Item (Typ, Name_Default_Value, False) and then Has_Rep_Item (Typ, Name_Default_Value) then Set_Has_Default_Aspect (Typ); Set_Default_Aspect_Value (Typ, Default_Aspect_Value (Entity (Get_Rep_Item (Typ, Name_Default_Value)))); end if; -- Discard_Names if not Has_Rep_Item (Typ, Name_Discard_Names, False) and then Has_Rep_Item (Typ, Name_Discard_Names) and then Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item (Get_Rep_Item (Typ, Name_Discard_Names)) then Set_Discard_Names (Typ); end if; -- Volatile if not Has_Rep_Item (Typ, Name_Volatile, False) and then Has_Rep_Item (Typ, Name_Volatile) and then Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item (Get_Rep_Item (Typ, Name_Volatile)) then Set_Is_Volatile (Typ); Set_Treat_As_Volatile (Typ); end if; -- Volatile_Full_Access if not Has_Rep_Item (Typ, Name_Volatile_Full_Access, False) and then Has_Rep_Pragma (Typ, Name_Volatile_Full_Access) and then Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item (Get_Rep_Item (Typ, Name_Volatile_Full_Access)) then Set_Is_Volatile_Full_Access (Typ); Set_Is_Volatile (Typ); Set_Treat_As_Volatile (Typ); end if; -- Inheritance for derived types only if Is_Derived_Type (Typ) then declare Bas_Typ : constant Entity_Id := Base_Type (Typ); Imp_Bas_Typ : constant Entity_Id := Implementation_Base_Type (Typ); begin -- Atomic_Components if not Has_Rep_Item (Typ, Name_Atomic_Components, False) and then Has_Rep_Item (Typ, Name_Atomic_Components) and then Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item (Get_Rep_Item (Typ, Name_Atomic_Components)) then Set_Has_Atomic_Components (Imp_Bas_Typ); end if; -- Volatile_Components if not Has_Rep_Item (Typ, Name_Volatile_Components, False) and then Has_Rep_Item (Typ, Name_Volatile_Components) and then Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item (Get_Rep_Item (Typ, Name_Volatile_Components)) then Set_Has_Volatile_Components (Imp_Bas_Typ); end if; -- Finalize_Storage_Only if not Has_Rep_Pragma (Typ, Name_Finalize_Storage_Only, False) and then Has_Rep_Pragma (Typ, Name_Finalize_Storage_Only) then Set_Finalize_Storage_Only (Bas_Typ); end if; -- Universal_Aliasing if not Has_Rep_Item (Typ, Name_Universal_Aliasing, False) and then Has_Rep_Item (Typ, Name_Universal_Aliasing) and then Is_Pragma_Or_Corr_Pragma_Present_In_Rep_Item (Get_Rep_Item (Typ, Name_Universal_Aliasing)) then Set_Universal_Aliasing (Imp_Bas_Typ); end if; -- Bit_Order if Is_Record_Type (Typ) then if not Has_Rep_Item (Typ, Name_Bit_Order, False) and then Has_Rep_Item (Typ, Name_Bit_Order) then Set_Reverse_Bit_Order (Bas_Typ, Reverse_Bit_Order (Rep_Item_Entity (Get_Rep_Item (Typ, Name_Bit_Order)))); end if; end if; -- Scalar_Storage_Order -- Note: the aspect is specified on a first subtype, but recorded -- in a flag of the base type! if (Is_Record_Type (Typ) or else Is_Array_Type (Typ)) and then Typ = Bas_Typ then -- For a type extension, always inherit from parent; otherwise -- inherit if no default applies. Note: we do not check for -- an explicit rep item on the parent type when inheriting, -- because the parent SSO may itself have been set by default. if not Has_Rep_Item (First_Subtype (Typ), Name_Scalar_Storage_Order, False) and then (Is_Tagged_Type (Bas_Typ) or else not (SSO_Set_Low_By_Default (Bas_Typ) or else SSO_Set_High_By_Default (Bas_Typ))) then Set_Reverse_Storage_Order (Bas_Typ, Reverse_Storage_Order (Implementation_Base_Type (Etype (Bas_Typ)))); -- Clear default SSO indications, since the inherited aspect -- which was set explicitly overrides the default. Set_SSO_Set_Low_By_Default (Bas_Typ, False); Set_SSO_Set_High_By_Default (Bas_Typ, False); end if; end if; end; end if; end Inherit_Aspects_At_Freeze_Point; ---------------- -- Initialize -- ---------------- procedure Initialize is begin Address_Clause_Checks.Init; Unchecked_Conversions.Init; -- ??? Might be needed in the future for some non GCC back-ends -- if AAMP_On_Target then -- Independence_Checks.Init; -- end if; end Initialize; --------------------------- -- Install_Discriminants -- --------------------------- procedure Install_Discriminants (E : Entity_Id) is Disc : Entity_Id; Prev : Entity_Id; begin Disc := First_Discriminant (E); while Present (Disc) loop Prev := Current_Entity (Disc); Set_Current_Entity (Disc); Set_Is_Immediately_Visible (Disc); Set_Homonym (Disc, Prev); Next_Discriminant (Disc); end loop; end Install_Discriminants; ------------------------- -- Is_Operational_Item -- ------------------------- function Is_Operational_Item (N : Node_Id) return Boolean is begin if Nkind (N) /= N_Attribute_Definition_Clause then return False; else declare Id : constant Attribute_Id := Get_Attribute_Id (Chars (N)); begin -- List of operational items is given in AARM 13.1(8.mm/1). -- It is clearly incomplete, as it does not include iterator -- aspects, among others. return Id = Attribute_Constant_Indexing or else Id = Attribute_Default_Iterator or else Id = Attribute_Implicit_Dereference or else Id = Attribute_Input or else Id = Attribute_Iterator_Element or else Id = Attribute_Iterable or else Id = Attribute_Output or else Id = Attribute_Read or else Id = Attribute_Variable_Indexing or else Id = Attribute_Write or else Id = Attribute_External_Tag; end; end if; end Is_Operational_Item; ------------------------- -- Is_Predicate_Static -- ------------------------- -- Note: the basic legality of the expression has already been checked, so -- we don't need to worry about cases or ranges on strings for example. function Is_Predicate_Static (Expr : Node_Id; Nam : Name_Id) return Boolean is function All_Static_Case_Alternatives (L : List_Id) return Boolean; -- Given a list of case expression alternatives, returns True if all -- the alternatives are static (have all static choices, and a static -- expression). function Is_Type_Ref (N : Node_Id) return Boolean; pragma Inline (Is_Type_Ref); -- Returns True if N is a reference to the type for the predicate in the -- expression (i.e. if it is an identifier whose Chars field matches the -- Nam given in the call). N must not be parenthesized, if the type name -- appears in parens, this routine will return False. -- -- The routine also returns True for function calls generated during the -- expansion of comparison operators on strings, which are intended to -- be legal in static predicates, and are converted into calls to array -- comparison routines in the body of the corresponding predicate -- function. ---------------------------------- -- All_Static_Case_Alternatives -- ---------------------------------- function All_Static_Case_Alternatives (L : List_Id) return Boolean is N : Node_Id; begin N := First (L); while Present (N) loop if not (All_Static_Choices (Discrete_Choices (N)) and then Is_OK_Static_Expression (Expression (N))) then return False; end if; Next (N); end loop; return True; end All_Static_Case_Alternatives; ----------------- -- Is_Type_Ref -- ----------------- function Is_Type_Ref (N : Node_Id) return Boolean is begin return (Nkind (N) = N_Identifier and then Chars (N) = Nam and then Paren_Count (N) = 0) or else Nkind (N) = N_Function_Call; end Is_Type_Ref; -- Start of processing for Is_Predicate_Static begin -- Predicate_Static means one of the following holds. Numbers are the -- corresponding paragraph numbers in (RM 3.2.4(16-22)). -- 16: A static expression if Is_OK_Static_Expression (Expr) then return True; -- 17: A membership test whose simple_expression is the current -- instance, and whose membership_choice_list meets the requirements -- for a static membership test. elsif Nkind (Expr) in N_Membership_Test and then All_Membership_Choices_Static (Expr) then return True; -- 18. A case_expression whose selecting_expression is the current -- instance, and whose dependent expressions are static expressions. elsif Nkind (Expr) = N_Case_Expression and then Is_Type_Ref (Expression (Expr)) and then All_Static_Case_Alternatives (Alternatives (Expr)) then return True; -- 19. A call to a predefined equality or ordering operator, where one -- operand is the current instance, and the other is a static -- expression. -- Note: the RM is clearly wrong here in not excluding string types. -- Without this exclusion, we would allow expressions like X > "ABC" -- to be considered as predicate-static, which is clearly not intended, -- since the idea is for predicate-static to be a subset of normal -- static expressions (and "DEF" > "ABC" is not a static expression). -- However, we do allow internally generated (not from source) equality -- and inequality operations to be valid on strings (this helps deal -- with cases where we transform A in "ABC" to A = "ABC). -- In fact, it appears that the intent of the ARG is to extend static -- predicates to strings, and that the extension should probably apply -- to static expressions themselves. The code below accepts comparison -- operators that apply to static strings. elsif Nkind (Expr) in N_Op_Compare and then ((Is_Type_Ref (Left_Opnd (Expr)) and then Is_OK_Static_Expression (Right_Opnd (Expr))) or else (Is_Type_Ref (Right_Opnd (Expr)) and then Is_OK_Static_Expression (Left_Opnd (Expr)))) then return True; -- 20. A call to a predefined boolean logical operator, where each -- operand is predicate-static. elsif (Nkind (Expr) in N_Op_And | N_Op_Or | N_Op_Xor and then Is_Predicate_Static (Left_Opnd (Expr), Nam) and then Is_Predicate_Static (Right_Opnd (Expr), Nam)) or else (Nkind (Expr) = N_Op_Not and then Is_Predicate_Static (Right_Opnd (Expr), Nam)) then return True; -- 21. A short-circuit control form where both operands are -- predicate-static. elsif Nkind (Expr) in N_Short_Circuit and then Is_Predicate_Static (Left_Opnd (Expr), Nam) and then Is_Predicate_Static (Right_Opnd (Expr), Nam) then return True; -- 22. A parenthesized predicate-static expression. This does not -- require any special test, since we just ignore paren levels in -- all the cases above. -- One more test that is an implementation artifact caused by the fact -- that we are analyzing not the original expression, but the generated -- expression in the body of the predicate function. This can include -- references to inherited predicates, so that the expression we are -- processing looks like: -- xxPredicate (typ (Inns)) and then expression -- Where the call is to a Predicate function for an inherited predicate. -- We simply ignore such a call, which could be to either a dynamic or -- a static predicate. Note that if the parent predicate is dynamic then -- eventually this type will be marked as dynamic, but you are allowed -- to specify a static predicate for a subtype which is inheriting a -- dynamic predicate, so the static predicate validation here ignores -- the inherited predicate even if it is dynamic. -- In all cases, a static predicate can only apply to a scalar type. elsif Nkind (Expr) = N_Function_Call and then Is_Predicate_Function (Entity (Name (Expr))) and then Is_Scalar_Type (Etype (First_Entity (Entity (Name (Expr))))) then return True; elsif Is_Entity_Name (Expr) and then Entity (Expr) = Standard_True then Error_Msg_N ("predicate is redundant (always True)?", Expr); return True; -- That's an exhaustive list of tests, all other cases are not -- predicate-static, so we return False. else return False; end if; end Is_Predicate_Static; ---------------------- -- Is_Static_Choice -- ---------------------- function Is_Static_Choice (N : Node_Id) return Boolean is begin return Nkind (N) = N_Others_Choice or else Is_OK_Static_Expression (N) or else (Is_Entity_Name (N) and then Is_Type (Entity (N)) and then Is_OK_Static_Subtype (Entity (N))) or else (Nkind (N) = N_Subtype_Indication and then Is_OK_Static_Subtype (Entity (N))) or else (Nkind (N) = N_Range and then Is_OK_Static_Range (N)); end Is_Static_Choice; ------------------------------ -- Is_Type_Related_Rep_Item -- ------------------------------ function Is_Type_Related_Rep_Item (N : Node_Id) return Boolean is begin case Nkind (N) is when N_Attribute_Definition_Clause => declare Id : constant Attribute_Id := Get_Attribute_Id (Chars (N)); -- See AARM 13.1(8.f-8.x) list items that end in "clause" -- ???: include any GNAT-defined attributes here? begin return Id = Attribute_Component_Size or else Id = Attribute_Bit_Order or else Id = Attribute_Storage_Pool or else Id = Attribute_Stream_Size or else Id = Attribute_Machine_Radix; end; when N_Pragma => case Get_Pragma_Id (N) is -- See AARM 13.1(8.f-8.x) list items that start with "pragma" -- ???: include any GNAT-defined pragmas here? when Pragma_Pack | Pragma_Import | Pragma_Export | Pragma_Convention | Pragma_Atomic | Pragma_Independent | Pragma_Volatile | Pragma_Atomic_Components | Pragma_Independent_Components | Pragma_Volatile_Components | Pragma_Discard_Names => return True; when others => null; end case; when N_Enumeration_Representation_Clause | N_Record_Representation_Clause => return True; when others => null; end case; return False; end Is_Type_Related_Rep_Item; --------------------- -- Kill_Rep_Clause -- --------------------- procedure Kill_Rep_Clause (N : Node_Id) is begin pragma Assert (Ignore_Rep_Clauses); -- Note: we use Replace rather than Rewrite, because we don't want -- tools to be able to use Original_Node to dig out the (undecorated) -- rep clause that is being replaced. Replace (N, Make_Null_Statement (Sloc (N))); -- The null statement must be marked as not coming from source. This is -- so that tools ignore it, and also the back end does not expect bogus -- "from source" null statements in weird places (e.g. in declarative -- regions where such null statements are not allowed). Set_Comes_From_Source (N, False); end Kill_Rep_Clause; ------------------ -- Minimum_Size -- ------------------ function Minimum_Size (T : Entity_Id; Biased : Boolean := False) return Nat is Lo : Uint := No_Uint; Hi : Uint := No_Uint; LoR : Ureal := No_Ureal; HiR : Ureal := No_Ureal; LoSet : Boolean := False; HiSet : Boolean := False; B : Uint; S : Nat; Ancest : Entity_Id; R_Typ : constant Entity_Id := Root_Type (T); begin -- If bad type, return 0 if T = Any_Type then return 0; -- For generic types, just return zero. There cannot be any legitimate -- need to know such a size, but this routine may be called with a -- generic type as part of normal processing. elsif Is_Generic_Type (R_Typ) or else R_Typ = Any_Type then return 0; -- Access types (cannot have size smaller than System.Address) elsif Is_Access_Type (T) then return System_Address_Size; -- Floating-point types elsif Is_Floating_Point_Type (T) then return UI_To_Int (Esize (R_Typ)); -- Discrete types elsif Is_Discrete_Type (T) then -- The following loop is looking for the nearest compile time known -- bounds following the ancestor subtype chain. The idea is to find -- the most restrictive known bounds information. Ancest := T; loop if Ancest = Any_Type or else Etype (Ancest) = Any_Type then return 0; end if; if not LoSet then if Compile_Time_Known_Value (Type_Low_Bound (Ancest)) then Lo := Expr_Rep_Value (Type_Low_Bound (Ancest)); LoSet := True; exit when HiSet; end if; end if; if not HiSet then if Compile_Time_Known_Value (Type_High_Bound (Ancest)) then Hi := Expr_Rep_Value (Type_High_Bound (Ancest)); HiSet := True; exit when LoSet; end if; end if; Ancest := Ancestor_Subtype (Ancest); if No (Ancest) then Ancest := Base_Type (T); if Is_Generic_Type (Ancest) then return 0; end if; end if; end loop; -- Fixed-point types. We can't simply use Expr_Value to get the -- Corresponding_Integer_Value values of the bounds, since these do not -- get set till the type is frozen, and this routine can be called -- before the type is frozen. Similarly the test for bounds being static -- needs to include the case where we have unanalyzed real literals for -- the same reason. elsif Is_Fixed_Point_Type (T) then -- The following loop is looking for the nearest compile time known -- bounds following the ancestor subtype chain. The idea is to find -- the most restrictive known bounds information. Ancest := T; loop if Ancest = Any_Type or else Etype (Ancest) = Any_Type then return 0; end if; -- Note: In the following two tests for LoSet and HiSet, it may -- seem redundant to test for N_Real_Literal here since normally -- one would assume that the test for the value being known at -- compile time includes this case. However, there is a glitch. -- If the real literal comes from folding a non-static expression, -- then we don't consider any non- static expression to be known -- at compile time if we are in configurable run time mode (needed -- in some cases to give a clearer definition of what is and what -- is not accepted). So the test is indeed needed. Without it, we -- would set neither Lo_Set nor Hi_Set and get an infinite loop. if not LoSet then if Nkind (Type_Low_Bound (Ancest)) = N_Real_Literal or else Compile_Time_Known_Value (Type_Low_Bound (Ancest)) then LoR := Expr_Value_R (Type_Low_Bound (Ancest)); LoSet := True; exit when HiSet; end if; end if; if not HiSet then if Nkind (Type_High_Bound (Ancest)) = N_Real_Literal or else Compile_Time_Known_Value (Type_High_Bound (Ancest)) then HiR := Expr_Value_R (Type_High_Bound (Ancest)); HiSet := True; exit when LoSet; end if; end if; Ancest := Ancestor_Subtype (Ancest); if No (Ancest) then Ancest := Base_Type (T); if Is_Generic_Type (Ancest) then return 0; end if; end if; end loop; Lo := UR_To_Uint (LoR / Small_Value (T)); Hi := UR_To_Uint (HiR / Small_Value (T)); -- No other types allowed else raise Program_Error; end if; -- Fall through with Hi and Lo set. Deal with biased case if (Biased and then not Is_Fixed_Point_Type (T) and then not (Is_Enumeration_Type (T) and then Has_Non_Standard_Rep (T))) or else Has_Biased_Representation (T) then Hi := Hi - Lo; Lo := Uint_0; end if; -- Null range case, size is always zero. We only do this in the discrete -- type case, since that's the odd case that came up. Probably we should -- also do this in the fixed-point case, but doing so causes peculiar -- gigi failures, and it is not worth worrying about this incredibly -- marginal case (explicit null-range fixed-point type declarations)??? if Lo > Hi and then Is_Discrete_Type (T) then S := 0; -- Signed case. Note that we consider types like range 1 .. -1 to be -- signed for the purpose of computing the size, since the bounds have -- to be accommodated in the base type. elsif Lo < 0 or else Hi < 0 then S := 1; B := Uint_1; -- S = size, B = 2 ** (size - 1) (can accommodate -B .. +(B - 1)) -- Note that we accommodate the case where the bounds cross. This -- can happen either because of the way the bounds are declared -- or because of the algorithm in Freeze_Fixed_Point_Type. while Lo < -B or else Hi < -B or else Lo >= B or else Hi >= B loop B := Uint_2 ** S; S := S + 1; end loop; -- Unsigned case else -- If both bounds are positive, make sure that both are represen- -- table in the case where the bounds are crossed. This can happen -- either because of the way the bounds are declared, or because of -- the algorithm in Freeze_Fixed_Point_Type. if Lo > Hi then Hi := Lo; end if; -- S = size, (can accommodate 0 .. (2**size - 1)) S := 0; while Hi >= Uint_2 ** S loop S := S + 1; end loop; end if; return S; end Minimum_Size; ------------------------------ -- New_Put_Image_Subprogram -- ------------------------------ procedure New_Put_Image_Subprogram (N : Node_Id; Ent : Entity_Id; Subp : Entity_Id) is Loc : constant Source_Ptr := Sloc (N); Sname : constant Name_Id := Make_TSS_Name (Base_Type (Ent), TSS_Put_Image); Subp_Id : Entity_Id; Subp_Decl : Node_Id; F : Entity_Id; Etyp : Entity_Id; Defer_Declaration : constant Boolean := Is_Tagged_Type (Ent) or else Is_Private_Type (Ent); -- For a tagged type, there is a declaration at the freeze point, and -- we must generate only a completion of this declaration. We do the -- same for private types, because the full view might be tagged. -- Otherwise we generate a declaration at the point of the attribute -- definition clause. If the attribute definition comes from an aspect -- specification the declaration is part of the freeze actions of the -- type. function Build_Spec return Node_Id; -- Used for declaration and renaming declaration, so that this is -- treated as a renaming_as_body. ---------------- -- Build_Spec -- ---------------- function Build_Spec return Node_Id is Formals : List_Id; Spec : Node_Id; T_Ref : constant Node_Id := New_Occurrence_Of (Etyp, Loc); begin Subp_Id := Make_Defining_Identifier (Loc, Sname); -- S : Sink'Class Formals := New_List ( Make_Parameter_Specification (Loc, Defining_Identifier => Make_Defining_Identifier (Loc, Name_S), In_Present => True, Out_Present => True, Parameter_Type => New_Occurrence_Of (Etype (F), Loc))); -- V : T Append_To (Formals, Make_Parameter_Specification (Loc, Defining_Identifier => Make_Defining_Identifier (Loc, Name_V), Parameter_Type => T_Ref)); Spec := Make_Procedure_Specification (Loc, Defining_Unit_Name => Subp_Id, Parameter_Specifications => Formals); return Spec; end Build_Spec; -- Start of processing for New_Put_Image_Subprogram begin F := First_Formal (Subp); Etyp := Etype (Next_Formal (F)); -- Prepare subprogram declaration and insert it as an action on the -- clause node. The visibility for this entity is used to test for -- visibility of the attribute definition clause (in the sense of -- 8.3(23) as amended by AI-195). if not Defer_Declaration then Subp_Decl := Make_Subprogram_Declaration (Loc, Specification => Build_Spec); -- For a tagged type, there is always a visible declaration for the -- Put_Image TSS (it is a predefined primitive operation), and the -- completion of this declaration occurs at the freeze point, which is -- not always visible at places where the attribute definition clause is -- visible. So, we create a dummy entity here for the purpose of -- tracking the visibility of the attribute definition clause itself. else Subp_Id := Make_Defining_Identifier (Loc, New_External_Name (Sname, 'V')); Subp_Decl := Make_Object_Declaration (Loc, Defining_Identifier => Subp_Id, Object_Definition => New_Occurrence_Of (Standard_Boolean, Loc)); end if; if not Defer_Declaration and then From_Aspect_Specification (N) and then Has_Delayed_Freeze (Ent) then Append_Freeze_Action (Ent, Subp_Decl); else Insert_Action (N, Subp_Decl); Set_Entity (N, Subp_Id); end if; Subp_Decl := Make_Subprogram_Renaming_Declaration (Loc, Specification => Build_Spec, Name => New_Occurrence_Of (Subp, Loc)); if Defer_Declaration then Set_TSS (Base_Type (Ent), Subp_Id); else if From_Aspect_Specification (N) then Append_Freeze_Action (Ent, Subp_Decl); else Insert_Action (N, Subp_Decl); end if; Copy_TSS (Subp_Id, Base_Type (Ent)); end if; end New_Put_Image_Subprogram; --------------------------- -- New_Stream_Subprogram -- --------------------------- procedure New_Stream_Subprogram (N : Node_Id; Ent : Entity_Id; Subp : Entity_Id; Nam : TSS_Name_Type) is Loc : constant Source_Ptr := Sloc (N); Sname : constant Name_Id := Make_TSS_Name (Base_Type (Ent), Nam); Subp_Id : Entity_Id; Subp_Decl : Node_Id; F : Entity_Id; Etyp : Entity_Id; Defer_Declaration : constant Boolean := Is_Tagged_Type (Ent) or else Is_Private_Type (Ent); -- For a tagged type, there is a declaration for each stream attribute -- at the freeze point, and we must generate only a completion of this -- declaration. We do the same for private types, because the full view -- might be tagged. Otherwise we generate a declaration at the point of -- the attribute definition clause. If the attribute definition comes -- from an aspect specification the declaration is part of the freeze -- actions of the type. function Build_Spec return Node_Id; -- Used for declaration and renaming declaration, so that this is -- treated as a renaming_as_body. ---------------- -- Build_Spec -- ---------------- function Build_Spec return Node_Id is Out_P : constant Boolean := (Nam = TSS_Stream_Read); Formals : List_Id; Spec : Node_Id; T_Ref : constant Node_Id := New_Occurrence_Of (Etyp, Loc); begin Subp_Id := Make_Defining_Identifier (Loc, Sname); -- S : access Root_Stream_Type'Class Formals := New_List ( Make_Parameter_Specification (Loc, Defining_Identifier => Make_Defining_Identifier (Loc, Name_S), Parameter_Type => Make_Access_Definition (Loc, Subtype_Mark => New_Occurrence_Of ( Designated_Type (Etype (F)), Loc)))); if Nam = TSS_Stream_Input then Spec := Make_Function_Specification (Loc, Defining_Unit_Name => Subp_Id, Parameter_Specifications => Formals, Result_Definition => T_Ref); else -- V : [out] T Append_To (Formals, Make_Parameter_Specification (Loc, Defining_Identifier => Make_Defining_Identifier (Loc, Name_V), Out_Present => Out_P, Parameter_Type => T_Ref)); Spec := Make_Procedure_Specification (Loc, Defining_Unit_Name => Subp_Id, Parameter_Specifications => Formals); end if; return Spec; end Build_Spec; -- Start of processing for New_Stream_Subprogram begin F := First_Formal (Subp); if Ekind (Subp) = E_Procedure then Etyp := Etype (Next_Formal (F)); else Etyp := Etype (Subp); end if; -- Prepare subprogram declaration and insert it as an action on the -- clause node. The visibility for this entity is used to test for -- visibility of the attribute definition clause (in the sense of -- 8.3(23) as amended by AI-195). if not Defer_Declaration then Subp_Decl := Make_Subprogram_Declaration (Loc, Specification => Build_Spec); -- For a tagged type, there is always a visible declaration for each -- stream TSS (it is a predefined primitive operation), and the -- completion of this declaration occurs at the freeze point, which is -- not always visible at places where the attribute definition clause is -- visible. So, we create a dummy entity here for the purpose of -- tracking the visibility of the attribute definition clause itself. else Subp_Id := Make_Defining_Identifier (Loc, New_External_Name (Sname, 'V')); Subp_Decl := Make_Object_Declaration (Loc, Defining_Identifier => Subp_Id, Object_Definition => New_Occurrence_Of (Standard_Boolean, Loc)); end if; if not Defer_Declaration and then From_Aspect_Specification (N) and then Has_Delayed_Freeze (Ent) then Append_Freeze_Action (Ent, Subp_Decl); else Insert_Action (N, Subp_Decl); Set_Entity (N, Subp_Id); end if; Subp_Decl := Make_Subprogram_Renaming_Declaration (Loc, Specification => Build_Spec, Name => New_Occurrence_Of (Subp, Loc)); if Defer_Declaration then Set_TSS (Base_Type (Ent), Subp_Id); else if From_Aspect_Specification (N) then Append_Freeze_Action (Ent, Subp_Decl); else Insert_Action (N, Subp_Decl); end if; Copy_TSS (Subp_Id, Base_Type (Ent)); end if; end New_Stream_Subprogram; ---------------------- -- No_Type_Rep_Item -- ---------------------- procedure No_Type_Rep_Item (N : Node_Id) is begin Error_Msg_N ("|type-related representation item not permitted!", N); end No_Type_Rep_Item; -------------- -- Pop_Type -- -------------- procedure Pop_Type (E : Entity_Id) is begin if Ekind (E) = E_Record_Type and then E = Current_Scope then End_Scope; elsif Is_Type (E) and then Has_Discriminants (E) and then Nkind (Parent (E)) /= N_Subtype_Declaration then Uninstall_Discriminants (E); Pop_Scope; end if; end Pop_Type; --------------- -- Push_Type -- --------------- procedure Push_Type (E : Entity_Id) is Comp : Entity_Id; begin if Ekind (E) = E_Record_Type then Push_Scope (E); Comp := First_Component (E); while Present (Comp) loop Install_Entity (Comp); Next_Component (Comp); end loop; if Has_Discriminants (E) then Install_Discriminants (E); end if; elsif Is_Type (E) and then Has_Discriminants (E) and then Nkind (Parent (E)) /= N_Subtype_Declaration then Push_Scope (E); Install_Discriminants (E); end if; end Push_Type; ----------------------------------- -- Register_Address_Clause_Check -- ----------------------------------- procedure Register_Address_Clause_Check (N : Node_Id; X : Entity_Id; A : Uint; Y : Entity_Id; Off : Boolean) is ACS : constant Boolean := Scope_Suppress.Suppress (Alignment_Check); begin Address_Clause_Checks.Append ((N, X, A, Y, Off, ACS)); end Register_Address_Clause_Check; ------------------------ -- Rep_Item_Too_Early -- ------------------------ function Rep_Item_Too_Early (T : Entity_Id; N : Node_Id) return Boolean is function Has_Generic_Parent (E : Entity_Id) return Boolean; -- Return True if R or any ancestor is a generic type ------------------------ -- Has_Generic_Parent -- ------------------------ function Has_Generic_Parent (E : Entity_Id) return Boolean is Ancestor_Type : Entity_Id := Etype (E); begin if Is_Generic_Type (E) then return True; end if; while Present (Ancestor_Type) and then not Is_Generic_Type (Ancestor_Type) and then Etype (Ancestor_Type) /= Ancestor_Type loop Ancestor_Type := Etype (Ancestor_Type); end loop; return Present (Ancestor_Type) and then Is_Generic_Type (Ancestor_Type); end Has_Generic_Parent; -- Start of processing for Rep_Item_Too_Early begin -- Cannot apply non-operational rep items to generic types if Is_Operational_Item (N) then return False; elsif Is_Type (T) and then Has_Generic_Parent (T) and then (Nkind (N) /= N_Pragma or else Get_Pragma_Id (N) /= Pragma_Convention) then if Ada_Version < Ada_2020 then Error_Msg_N ("representation item not allowed for generic type", N); return True; else return False; end if; end if; -- Otherwise check for incomplete type if Is_Incomplete_Or_Private_Type (T) and then No (Underlying_Type (T)) and then (Nkind (N) /= N_Pragma or else Get_Pragma_Id (N) /= Pragma_Import) then Error_Msg_N ("representation item must be after full type declaration", N); return True; -- If the type has incomplete components, a representation clause is -- illegal but stream attributes and Convention pragmas are correct. elsif Has_Private_Component (T) then if Nkind (N) = N_Pragma then return False; else Error_Msg_N ("representation item must appear after type is fully defined", N); return True; end if; else return False; end if; end Rep_Item_Too_Early; ----------------------- -- Rep_Item_Too_Late -- ----------------------- function Rep_Item_Too_Late (T : Entity_Id; N : Node_Id; FOnly : Boolean := False) return Boolean is procedure Too_Late; -- Output message for an aspect being specified too late -- Note that neither of the above errors is considered a serious one, -- since the effect is simply that we ignore the representation clause -- in these cases. -- Is this really true? In any case if we make this change we must -- document the requirement in the spec of Rep_Item_Too_Late that -- if True is returned, then the rep item must be completely ignored??? -------------- -- Too_Late -- -------------- procedure Too_Late is begin -- Other compilers seem more relaxed about rep items appearing too -- late. Since analysis tools typically don't care about rep items -- anyway, no reason to be too strict about this. if not Relaxed_RM_Semantics then Error_Msg_N ("|representation item appears too late!", N); end if; end Too_Late; -- Local variables Parent_Type : Entity_Id; S : Entity_Id; -- Start of processing for Rep_Item_Too_Late begin -- First make sure entity is not frozen (RM 13.1(9)) if Is_Frozen (T) -- Exclude imported types, which may be frozen if they appear in a -- representation clause for a local type. and then not From_Limited_With (T) -- Exclude generated entities (not coming from source). The common -- case is when we generate a renaming which prematurely freezes the -- renamed internal entity, but we still want to be able to set copies -- of attribute values such as Size/Alignment. and then Comes_From_Source (T) then -- A self-referential aspect is illegal if it forces freezing the -- entity before the corresponding pragma has been analyzed. if Nkind (N) in N_Attribute_Definition_Clause | N_Pragma and then From_Aspect_Specification (N) then Error_Msg_NE ("aspect specification causes premature freezing of&", N, T); Set_Has_Delayed_Freeze (T, False); return True; end if; Too_Late; S := First_Subtype (T); if Present (Freeze_Node (S)) then if not Relaxed_RM_Semantics then Error_Msg_NE ("??no more representation items for }", Freeze_Node (S), S); end if; end if; return True; -- Check for case of untagged derived type whose parent either has -- primitive operations (pre Ada 202x), or is a by-reference type (RM -- 13.1(10)). In this case we do not output a Too_Late message, since -- there is no earlier point where the rep item could be placed to make -- it legal. -- ??? Confirming representation clauses should be allowed here. elsif Is_Type (T) and then not FOnly and then Is_Derived_Type (T) and then not Is_Tagged_Type (T) then Parent_Type := Etype (Base_Type (T)); if Relaxed_RM_Semantics then null; elsif Ada_Version <= Ada_2012 and then Has_Primitive_Operations (Parent_Type) then Error_Msg_N ("|representation item not permitted before Ada 202x!", N); Error_Msg_NE ("\parent type & has primitive operations!", N, Parent_Type); return True; elsif Is_By_Reference_Type (Parent_Type) then No_Type_Rep_Item (N); Error_Msg_NE ("\parent type & is a by-reference type!", N, Parent_Type); return True; end if; end if; -- No error, but one more warning to consider. The RM (surprisingly) -- allows this pattern in some cases: -- type S is ... -- primitive operations for S -- type R is new S; -- rep clause for S -- Meaning that calls on the primitive operations of S for values of -- type R may require possibly expensive implicit conversion operations. -- So even when this is not an error, it is still worth a warning. if not Relaxed_RM_Semantics and then Is_Type (T) then declare DTL : constant Entity_Id := Derived_Type_Link (Base_Type (T)); begin if Present (DTL) -- For now, do not generate this warning for the case of -- aspect specification using Ada 2012 syntax, since we get -- wrong messages we do not understand. The whole business -- of derived types and rep items seems a bit confused when -- aspects are used, since the aspects are not evaluated -- till freeze time. However, AI12-0109 confirms (in an AARM -- ramification) that inheritance in this case is required -- to work. and then not From_Aspect_Specification (N) then if Is_By_Reference_Type (T) and then not Is_Tagged_Type (T) and then Is_Type_Related_Rep_Item (N) and then (Ada_Version >= Ada_2012 or else Has_Primitive_Operations (Base_Type (T))) then -- Treat as hard error (AI12-0109, binding interpretation). -- Implementing a change of representation is not really -- an option in the case of a by-reference type, so we -- take this path for all Ada dialects if primitive -- operations are present. Error_Msg_Sloc := Sloc (DTL); Error_Msg_N ("representation item for& appears after derived type " & "declaration#", N); elsif Has_Primitive_Operations (Base_Type (T)) then Error_Msg_Sloc := Sloc (DTL); Error_Msg_N ("representation item for& appears after derived type " & "declaration#??", N); Error_Msg_NE ("\may result in implicit conversions for primitive " & "operations of&??", N, T); Error_Msg_NE ("\to change representations when called with arguments " & "of type&??", N, DTL); end if; end if; end; end if; -- No error, link item into head of chain of rep items for the entity, -- but avoid chaining if we have an overloadable entity, and the pragma -- is one that can apply to multiple overloaded entities. if Is_Overloadable (T) and then Nkind (N) = N_Pragma then declare Pname : constant Name_Id := Pragma_Name (N); begin if Pname in Name_Convention | Name_Import | Name_Export | Name_External | Name_Interface then return False; end if; end; end if; Record_Rep_Item (T, N); return False; end Rep_Item_Too_Late; ------------------------------------- -- Replace_Type_References_Generic -- ------------------------------------- procedure Replace_Type_References_Generic (N : Node_Id; T : Entity_Id) is TName : constant Name_Id := Chars (T); function Replace_Type_Ref (N : Node_Id) return Traverse_Result; -- Processes a single node in the traversal procedure below, checking -- if node N should be replaced, and if so, doing the replacement. function Visible_Component (Comp : Name_Id) return Entity_Id; -- Given an identifier in the expression, check whether there is a -- discriminant, component, protected procedure, or entry of the type -- that is directy visible, and rewrite it as the corresponding selected -- component of the formal of the subprogram. ---------------------- -- Replace_Type_Ref -- ---------------------- function Replace_Type_Ref (N : Node_Id) return Traverse_Result is Loc : constant Source_Ptr := Sloc (N); procedure Add_Prefix (Ref : Node_Id; Comp : Entity_Id); -- Add the proper prefix to a reference to a component of the type -- when it is not already a selected component. ---------------- -- Add_Prefix -- ---------------- procedure Add_Prefix (Ref : Node_Id; Comp : Entity_Id) is begin Rewrite (Ref, Make_Selected_Component (Loc, Prefix => New_Occurrence_Of (T, Loc), Selector_Name => New_Occurrence_Of (Comp, Loc))); Replace_Type_Reference (Prefix (Ref)); end Add_Prefix; -- Local variables Comp : Entity_Id; Pref : Node_Id; Scop : Entity_Id; -- Start of processing for Replace_Type_Ref begin if Nkind (N) = N_Identifier then -- If not the type name, check whether it is a reference to some -- other type, which must be frozen before the predicate function -- is analyzed, i.e. before the freeze node of the type to which -- the predicate applies. if Chars (N) /= TName then if Present (Current_Entity (N)) and then Is_Type (Current_Entity (N)) then Freeze_Before (Freeze_Node (T), Current_Entity (N)); end if; -- The components of the type are directly visible and can -- be referenced without a prefix. if Nkind (Parent (N)) = N_Selected_Component then null; -- In expression C (I), C may be a directly visible function -- or a visible component that has an array type. Disambiguate -- by examining the component type. elsif Nkind (Parent (N)) = N_Indexed_Component and then N = Prefix (Parent (N)) then Comp := Visible_Component (Chars (N)); if Present (Comp) and then Is_Array_Type (Etype (Comp)) then Add_Prefix (N, Comp); end if; else Comp := Visible_Component (Chars (N)); if Present (Comp) then Add_Prefix (N, Comp); end if; end if; return Skip; -- Otherwise do the replacement if this is not a qualified -- reference to a homograph of the type itself. Note that the -- current instance could not appear in such a context, e.g. -- the prefix of a type conversion. else if Nkind (Parent (N)) /= N_Selected_Component or else N /= Selector_Name (Parent (N)) then Replace_Type_Reference (N); end if; return Skip; end if; -- Case of selected component, which may be a subcomponent of the -- current instance, or an expanded name which is still unanalyzed. elsif Nkind (N) = N_Selected_Component then -- If selector name is not our type, keep going (we might still -- have an occurrence of the type in the prefix). If it is a -- subcomponent of the current entity, add prefix. if Nkind (Selector_Name (N)) /= N_Identifier or else Chars (Selector_Name (N)) /= TName then if Nkind (Prefix (N)) = N_Identifier then Comp := Visible_Component (Chars (Prefix (N))); if Present (Comp) then Add_Prefix (Prefix (N), Comp); end if; end if; return OK; -- Selector name is our type, check qualification else -- Loop through scopes and prefixes, doing comparison Scop := Current_Scope; Pref := Prefix (N); loop -- Continue if no more scopes or scope with no name if No (Scop) or else Nkind (Scop) not in N_Has_Chars then return OK; end if; -- Do replace if prefix is an identifier matching the scope -- that we are currently looking at. if Nkind (Pref) = N_Identifier and then Chars (Pref) = Chars (Scop) then Replace_Type_Reference (N); return Skip; end if; -- Go check scope above us if prefix is itself of the form -- of a selected component, whose selector matches the scope -- we are currently looking at. if Nkind (Pref) = N_Selected_Component and then Nkind (Selector_Name (Pref)) = N_Identifier and then Chars (Selector_Name (Pref)) = Chars (Scop) then Scop := Scope (Scop); Pref := Prefix (Pref); -- For anything else, we don't have a match, so keep on -- going, there are still some weird cases where we may -- still have a replacement within the prefix. else return OK; end if; end loop; end if; -- Continue for any other node kind else return OK; end if; end Replace_Type_Ref; procedure Replace_Type_Refs is new Traverse_Proc (Replace_Type_Ref); ----------------------- -- Visible_Component -- ----------------------- function Visible_Component (Comp : Name_Id) return Entity_Id is E : Entity_Id; begin -- Types with nameable components are record, task, and protected -- types, and discriminated private types. if Ekind (T) in E_Record_Type | E_Task_Type | E_Protected_Type or else (Is_Private_Type (T) and then Has_Discriminants (T)) then -- This is a sequential search, which seems acceptable -- efficiency-wise, given the typical size of component -- lists, protected operation lists, task item lists, and -- check expressions. E := First_Entity (T); while Present (E) loop if Comes_From_Source (E) and then Chars (E) = Comp then return E; end if; Next_Entity (E); end loop; end if; -- Nothing by that name return Empty; end Visible_Component; -- Start of processing for Replace_Type_References_Generic begin Replace_Type_Refs (N); end Replace_Type_References_Generic; -------------------------------- -- Resolve_Aspect_Expressions -- -------------------------------- procedure Resolve_Aspect_Expressions (E : Entity_Id) is function Resolve_Name (N : Node_Id) return Traverse_Result; -- Verify that all identifiers in the expression, with the exception -- of references to the current entity, denote visible entities. This -- is done only to detect visibility errors, as the expression will be -- properly analyzed/expanded during analysis of the predicate function -- body. We omit quantified expressions from this test, given that they -- introduce a local identifier that would require proper expansion to -- handle properly. ------------------ -- Resolve_Name -- ------------------ function Resolve_Name (N : Node_Id) return Traverse_Result is Dummy : Traverse_Result; begin if Nkind (N) = N_Selected_Component then if Nkind (Prefix (N)) = N_Identifier and then Chars (Prefix (N)) /= Chars (E) then Find_Selected_Component (N); end if; return Skip; -- Resolve identifiers that are not selectors in parameter -- associations (these are never resolved by visibility). elsif Nkind (N) = N_Identifier and then Chars (N) /= Chars (E) and then (Nkind (Parent (N)) /= N_Parameter_Association or else N /= Selector_Name (Parent (N))) then Find_Direct_Name (N); Set_Entity (N, Empty); -- The name is component association needs no resolution. elsif Nkind (N) = N_Component_Association then Dummy := Resolve_Name (Expression (N)); return Skip; elsif Nkind (N) = N_Quantified_Expression then return Skip; end if; return OK; end Resolve_Name; procedure Resolve_Aspect_Expression is new Traverse_Proc (Resolve_Name); -- Local variables ASN : Node_Id := First_Rep_Item (E); -- Start of processing for Resolve_Aspect_Expressions begin if No (ASN) then return; end if; while Present (ASN) loop if Nkind (ASN) = N_Aspect_Specification and then Entity (ASN) = E then declare A_Id : constant Aspect_Id := Get_Aspect_Id (ASN); Expr : constant Node_Id := Expression (ASN); begin case A_Id is when Aspect_Aggregate => Resolve_Aspect_Aggregate (Entity (ASN), Expr); -- For now we only deal with aspects that do not generate -- subprograms, or that may mention current instances of -- types. These will require special handling (???TBD). when Aspect_Invariant | Aspect_Predicate | Aspect_Predicate_Failure => null; when Aspect_Dynamic_Predicate | Aspect_Static_Predicate => -- Build predicate function specification and preanalyze -- expression after type replacement. The function -- declaration must be analyzed in the scope of the type, -- but the expression can reference components and -- discriminants of the type. if No (Predicate_Function (E)) then declare FDecl : constant Node_Id := Build_Predicate_Function_Declaration (E); pragma Unreferenced (FDecl); begin Push_Type (E); Resolve_Aspect_Expression (Expr); Pop_Type (E); end; end if; when Pre_Post_Aspects => null; when Aspect_Iterable => if Nkind (Expr) = N_Aggregate then declare Assoc : Node_Id; begin Assoc := First (Component_Associations (Expr)); while Present (Assoc) loop Find_Direct_Name (Expression (Assoc)); Next (Assoc); end loop; end; end if; -- The expression for Default_Value is a static expression -- of the type, but this expression does not freeze the -- type, so it can still appear in a representation clause -- before the actual freeze point. when Aspect_Default_Value => Set_Must_Not_Freeze (Expr); Preanalyze_Spec_Expression (Expr, E); when Aspect_Priority => Push_Type (E); Preanalyze_Spec_Expression (Expr, Any_Integer); Pop_Type (E); -- Ditto for Storage_Size. Any other aspects that carry -- expressions that should not freeze ??? This is only -- relevant to the misuse of deferred constants. when Aspect_Storage_Size => Set_Must_Not_Freeze (Expr); Preanalyze_Spec_Expression (Expr, Any_Integer); when others => if Present (Expr) then case Aspect_Argument (A_Id) is when Expression | Optional_Expression => Analyze_And_Resolve (Expr); when Name | Optional_Name => if Nkind (Expr) = N_Identifier then Find_Direct_Name (Expr); elsif Nkind (Expr) = N_Selected_Component then Find_Selected_Component (Expr); end if; end case; end if; end case; end; end if; Next_Rep_Item (ASN); end loop; end Resolve_Aspect_Expressions; ---------------------------- -- Parse_Aspect_Aggregate -- ---------------------------- procedure Parse_Aspect_Aggregate (N : Node_Id; Empty_Subp : in out Node_Id; Add_Named_Subp : in out Node_Id; Add_Unnamed_Subp : in out Node_Id; New_Indexed_Subp : in out Node_Id; Assign_Indexed_Subp : in out Node_Id) is Assoc : Node_Id := First (Component_Associations (N)); Op_Name : Name_Id; Subp : Node_Id; begin while Present (Assoc) loop Subp := Expression (Assoc); Op_Name := Chars (First (Choices (Assoc))); if Op_Name = Name_Empty then Empty_Subp := Subp; elsif Op_Name = Name_Add_Named then Add_Named_Subp := Subp; elsif Op_Name = Name_Add_Unnamed then Add_Unnamed_Subp := Subp; elsif Op_Name = Name_New_Indexed then New_Indexed_Subp := Subp; elsif Op_Name = Name_Assign_Indexed then Assign_Indexed_Subp := Subp; end if; Next (Assoc); end loop; end Parse_Aspect_Aggregate; ------------------------------- -- Validate_Aspect_Aggregate -- ------------------------------- procedure Validate_Aspect_Aggregate (N : Node_Id) is Empty_Subp : Node_Id := Empty; Add_Named_Subp : Node_Id := Empty; Add_Unnamed_Subp : Node_Id := Empty; New_Indexed_Subp : Node_Id := Empty; Assign_Indexed_Subp : Node_Id := Empty; begin if Ada_Version < Ada_2020 then Error_Msg_N ("Aspect Aggregate is an Ada_2020 feature", N); elsif Nkind (N) /= N_Aggregate or else Present (Expressions (N)) or else No (Component_Associations (N)) then Error_Msg_N ("Aspect Aggregate requires an aggregate " & "with component associations", N); return; end if; Parse_Aspect_Aggregate (N, Empty_Subp, Add_Named_Subp, Add_Unnamed_Subp, New_Indexed_Subp, Assign_Indexed_Subp); if No (Empty_Subp) then Error_Msg_N ("missing specification for Empty in aggregate", N); end if; if Present (Add_Named_Subp) then if Present (Add_Unnamed_Subp) or else Present (Assign_Indexed_Subp) then Error_Msg_N ("conflicting operations for aggregate (RM 4.3.5)", N); return; end if; elsif Present (New_Indexed_Subp) /= Present (Assign_Indexed_Subp) then Error_Msg_N ("incomplete specification for indexed aggregate", N); end if; end Validate_Aspect_Aggregate; -------------------------------- -- Resolve_Iterable_Operation -- -------------------------------- procedure Resolve_Iterable_Operation (N : Node_Id; Cursor : Entity_Id; Typ : Entity_Id; Nam : Name_Id) is Ent : Entity_Id; F1 : Entity_Id; F2 : Entity_Id; begin if not Is_Overloaded (N) then if not Is_Entity_Name (N) or else Ekind (Entity (N)) /= E_Function or else Scope (Entity (N)) /= Scope (Typ) or else No (First_Formal (Entity (N))) or else Etype (First_Formal (Entity (N))) /= Typ then Error_Msg_N ("iterable primitive must be local function name whose first " & "formal is an iterable type", N); return; end if; Ent := Entity (N); F1 := First_Formal (Ent); if Nam = Name_First or else Nam = Name_Last then -- First or Last (Container) => Cursor if Etype (Ent) /= Cursor then Error_Msg_N ("primitive for First must yield a curosr", N); end if; elsif Nam = Name_Next then -- Next (Container, Cursor) => Cursor F2 := Next_Formal (F1); if Etype (F2) /= Cursor or else Etype (Ent) /= Cursor or else Present (Next_Formal (F2)) then Error_Msg_N ("no match for Next iterable primitive", N); end if; elsif Nam = Name_Previous then -- Previous (Container, Cursor) => Cursor F2 := Next_Formal (F1); if Etype (F2) /= Cursor or else Etype (Ent) /= Cursor or else Present (Next_Formal (F2)) then Error_Msg_N ("no match for Previous iterable primitive", N); end if; elsif Nam = Name_Has_Element then -- Has_Element (Container, Cursor) => Boolean F2 := Next_Formal (F1); if Etype (F2) /= Cursor or else Etype (Ent) /= Standard_Boolean or else Present (Next_Formal (F2)) then Error_Msg_N ("no match for Has_Element iterable primitive", N); end if; elsif Nam = Name_Element then F2 := Next_Formal (F1); if No (F2) or else Etype (F2) /= Cursor or else Present (Next_Formal (F2)) then Error_Msg_N ("no match for Element iterable primitive", N); end if; else raise Program_Error; end if; else -- Overloaded case: find subprogram with proper signature. Caller -- will report error if no match is found. declare I : Interp_Index; It : Interp; begin Get_First_Interp (N, I, It); while Present (It.Typ) loop if Ekind (It.Nam) = E_Function and then Scope (It.Nam) = Scope (Typ) and then Etype (First_Formal (It.Nam)) = Typ then F1 := First_Formal (It.Nam); if Nam = Name_First then if Etype (It.Nam) = Cursor and then No (Next_Formal (F1)) then Set_Entity (N, It.Nam); exit; end if; elsif Nam = Name_Next then F2 := Next_Formal (F1); if Present (F2) and then No (Next_Formal (F2)) and then Etype (F2) = Cursor and then Etype (It.Nam) = Cursor then Set_Entity (N, It.Nam); exit; end if; elsif Nam = Name_Has_Element then F2 := Next_Formal (F1); if Present (F2) and then No (Next_Formal (F2)) and then Etype (F2) = Cursor and then Etype (It.Nam) = Standard_Boolean then Set_Entity (N, It.Nam); F2 := Next_Formal (F1); exit; end if; elsif Nam = Name_Element then F2 := Next_Formal (F1); if Present (F2) and then No (Next_Formal (F2)) and then Etype (F2) = Cursor then Set_Entity (N, It.Nam); exit; end if; end if; end if; Get_Next_Interp (I, It); end loop; end; end if; end Resolve_Iterable_Operation; ------------------------------ -- Resolve_Aspect_Aggregate -- ------------------------------ procedure Resolve_Aspect_Aggregate (Typ : Entity_Id; Expr : Node_Id) is -- Predicates that establish the legality of each possible operation in -- an Aggregate aspect. function Valid_Empty (E : Entity_Id) return Boolean; function Valid_Add_Named (E : Entity_Id) return Boolean; function Valid_Add_Unnamed (E : Entity_Id) return Boolean; function Valid_New_Indexed (E : Entity_Id) return Boolean; function Valid_Assign_Indexed (E : Entity_Id) return Boolean; generic with function Pred (Id : Node_Id) return Boolean; procedure Resolve_Operation (Subp_Id : Node_Id); -- Common processing to resolve each aggregate operation. ------------------------ -- Valid_Assign_Index -- ------------------------ function Valid_Assign_Indexed (E : Entity_Id) return Boolean is begin -- The profile must be the same as for Add_Named, with the added -- requirement that the key_type be a discrete type. if Valid_Add_Named (E) then return Is_Discrete_Type (Etype (Next_Formal (First_Formal (E)))); else return False; end if; end Valid_Assign_Indexed; ----------------- -- Valid_Emoty -- ----------------- function Valid_Empty (E : Entity_Id) return Boolean is begin if Etype (E) /= Typ or else Scope (E) /= Scope (Typ) then return False; elsif Ekind (E) = E_Constant then return True; elsif Ekind (E) = E_Function then return No (First_Formal (E)) or else (Is_Integer_Type (Etype (First_Formal (E))) and then No (Next_Formal (First_Formal (E)))); else return False; end if; end Valid_Empty; --------------------- -- Valid_Add_Named -- --------------------- function Valid_Add_Named (E : Entity_Id) return Boolean is F2, F3 : Entity_Id; begin if Ekind (E) = E_Procedure and then Scope (E) = Scope (Typ) and then Number_Formals (E) = 3 and then Etype (First_Formal (E)) = Typ and then Ekind (First_Formal (E)) = E_In_Out_Parameter then F2 := Next_Formal (First_Formal (E)); F3 := Next_Formal (F2); return Ekind (F2) = E_In_Parameter and then Ekind (F3) = E_In_Parameter and then not Is_Limited_Type (Etype (F2)) and then not Is_Limited_Type (Etype (F3)); else return False; end if; end Valid_Add_Named; ----------------------- -- Valid_Add_Unnamed -- ----------------------- function Valid_Add_Unnamed (E : Entity_Id) return Boolean is begin return Ekind (E) = E_Procedure and then Scope (E) = Scope (Typ) and then Number_Formals (E) = 2 and then Etype (First_Formal (E)) = Typ and then Ekind (First_Formal (E)) = E_In_Out_Parameter and then not Is_Limited_Type (Etype (Next_Formal (First_Formal (E)))); end Valid_Add_Unnamed; ----------------------- -- Valid_Nmw_Indexed -- ----------------------- function Valid_New_Indexed (E : Entity_Id) return Boolean is begin return Ekind (E) = E_Function and then Scope (E) = Scope (Typ) and then Etype (E) = Typ and then Number_Formals (E) = 2 and then Is_Discrete_Type (Etype (First_Formal (E))) and then Etype (First_Formal (E)) = Etype (Next_Formal (First_Formal (E))); end Valid_New_Indexed; ----------------------- -- Resolve_Operation -- ----------------------- procedure Resolve_Operation (Subp_Id : Node_Id) is Subp : Entity_Id; I : Interp_Index; It : Interp; begin if not Is_Overloaded (Subp_Id) then Subp := Entity (Subp_Id); if not Pred (Subp) then Error_Msg_NE ("improper aggregate operation for&", Subp_Id, Typ); end if; else Set_Entity (Subp_Id, Empty); Get_First_Interp (Subp_Id, I, It); while Present (It.Nam) loop if Pred (It.Nam) then Set_Is_Overloaded (Subp_Id, False); Set_Entity (Subp_Id, It.Nam); exit; end if; Get_Next_Interp (I, It); end loop; if No (Entity (Subp_Id)) then Error_Msg_NE ("improper aggregate operation for&", Subp_Id, Typ); end if; end if; end Resolve_Operation; Assoc : Node_Id; Op_Name : Name_Id; Subp_Id : Node_Id; procedure Resolve_Empty is new Resolve_Operation (Valid_Empty); procedure Resolve_Unnamed is new Resolve_Operation (Valid_Add_Unnamed); procedure Resolve_Named is new Resolve_Operation (Valid_Add_Named); procedure Resolve_Indexed is new Resolve_Operation (Valid_New_Indexed); procedure Resolve_Assign_Indexed is new Resolve_Operation (Valid_Assign_Indexed); begin Assoc := First (Component_Associations (Expr)); while Present (Assoc) loop Op_Name := Chars (First (Choices (Assoc))); -- When verifying the consistency of aspects between the freeze point -- and the end of declarqtions, we use a copy which is not analyzed -- yet, so do it now. Subp_Id := Expression (Assoc); if No (Etype (Subp_Id)) then Analyze (Subp_Id); end if; if Op_Name = Name_Empty then Resolve_Empty (Subp_Id); elsif Op_Name = Name_Add_Named then Resolve_Named (Subp_Id); elsif Op_Name = Name_Add_Unnamed then Resolve_Unnamed (Subp_Id); elsif Op_Name = Name_New_Indexed then Resolve_Indexed (Subp_Id); elsif Op_Name = Name_Assign_Indexed then Resolve_Assign_Indexed (Subp_Id); end if; Next (Assoc); end loop; end Resolve_Aspect_Aggregate; ---------------- -- Set_Biased -- ---------------- procedure Set_Biased (E : Entity_Id; N : Node_Id; Msg : String; Biased : Boolean := True) is begin if Biased then Set_Has_Biased_Representation (E); if Warn_On_Biased_Representation then Error_Msg_NE ("?B?" & Msg & " forces biased representation for&", N, E); end if; end if; end Set_Biased; -------------------- -- Set_Enum_Esize -- -------------------- procedure Set_Enum_Esize (T : Entity_Id) is Lo : Uint; Hi : Uint; Sz : Nat; begin Init_Alignment (T); -- Find the minimum standard size (8,16,32,64) that fits Lo := Enumeration_Rep (Entity (Type_Low_Bound (T))); Hi := Enumeration_Rep (Entity (Type_High_Bound (T))); if Lo < 0 then if Lo >= -Uint_2**07 and then Hi < Uint_2**07 then Sz := Standard_Character_Size; -- May be > 8 on some targets elsif Lo >= -Uint_2**15 and then Hi < Uint_2**15 then Sz := 16; elsif Lo >= -Uint_2**31 and then Hi < Uint_2**31 then Sz := 32; else pragma Assert (Lo >= -Uint_2**63 and then Hi < Uint_2**63); Sz := 64; end if; else if Hi < Uint_2**08 then Sz := Standard_Character_Size; -- May be > 8 on some targets elsif Hi < Uint_2**16 then Sz := 16; elsif Hi < Uint_2**32 then Sz := 32; else pragma Assert (Hi < Uint_2**63); Sz := 64; end if; end if; -- That minimum is the proper size unless we have a foreign convention -- and the size required is 32 or less, in which case we bump the size -- up to 32. This is required for C and C++ and seems reasonable for -- all other foreign conventions. if Has_Foreign_Convention (T) and then Esize (T) < Standard_Integer_Size -- Don't do this if Short_Enums on target and then not Target_Short_Enums then Init_Esize (T, Standard_Integer_Size); else Init_Esize (T, Sz); end if; end Set_Enum_Esize; ----------------------------- -- Uninstall_Discriminants -- ----------------------------- procedure Uninstall_Discriminants (E : Entity_Id) is Disc : Entity_Id; Prev : Entity_Id; Outer : Entity_Id; begin -- Discriminants have been made visible for type declarations and -- protected type declarations, not for subtype declarations. if Nkind (Parent (E)) /= N_Subtype_Declaration then Disc := First_Discriminant (E); while Present (Disc) loop if Disc /= Current_Entity (Disc) then Prev := Current_Entity (Disc); while Present (Prev) and then Present (Homonym (Prev)) and then Homonym (Prev) /= Disc loop Prev := Homonym (Prev); end loop; else Prev := Empty; end if; Set_Is_Immediately_Visible (Disc, False); Outer := Homonym (Disc); while Present (Outer) and then Scope (Outer) = E loop Outer := Homonym (Outer); end loop; -- Reset homonym link of other entities, but do not modify link -- between entities in current scope, so that the back end can -- have a proper count of local overloadings. if No (Prev) then Set_Name_Entity_Id (Chars (Disc), Outer); elsif Scope (Prev) /= Scope (Disc) then Set_Homonym (Prev, Outer); end if; Next_Discriminant (Disc); end loop; end if; end Uninstall_Discriminants; ------------------------------ -- Validate_Address_Clauses -- ------------------------------ procedure Validate_Address_Clauses is function Offset_Value (Expr : Node_Id) return Uint; -- Given an Address attribute reference, return the value in bits of its -- offset from the first bit of the underlying entity, or 0 if it is not -- known at compile time. ------------------ -- Offset_Value -- ------------------ function Offset_Value (Expr : Node_Id) return Uint is N : Node_Id := Prefix (Expr); Off : Uint; Val : Uint := Uint_0; begin -- Climb the prefix chain and compute the cumulative offset loop if Is_Entity_Name (N) then return Val; elsif Nkind (N) = N_Selected_Component then Off := Component_Bit_Offset (Entity (Selector_Name (N))); if Off /= No_Uint and then Off >= Uint_0 then Val := Val + Off; N := Prefix (N); else return Uint_0; end if; elsif Nkind (N) = N_Indexed_Component then Off := Indexed_Component_Bit_Offset (N); if Off /= No_Uint then Val := Val + Off; N := Prefix (N); else return Uint_0; end if; else return Uint_0; end if; end loop; end Offset_Value; -- Start of processing for Validate_Address_Clauses begin for J in Address_Clause_Checks.First .. Address_Clause_Checks.Last loop declare ACCR : Address_Clause_Check_Record renames Address_Clause_Checks.Table (J); Expr : Node_Id; X_Alignment : Uint; Y_Alignment : Uint := Uint_0; X_Size : Uint; Y_Size : Uint := Uint_0; X_Offs : Uint; begin -- Skip processing of this entry if warning already posted if not Address_Warning_Posted (ACCR.N) then Expr := Original_Node (Expression (ACCR.N)); -- Get alignments, sizes and offset, if any X_Alignment := Alignment (ACCR.X); X_Size := Esize (ACCR.X); if Present (ACCR.Y) then Y_Alignment := Alignment (ACCR.Y); Y_Size := Esize (ACCR.Y); end if; if ACCR.Off and then Nkind (Expr) = N_Attribute_Reference and then Attribute_Name (Expr) = Name_Address then X_Offs := Offset_Value (Expr); else X_Offs := Uint_0; end if; -- Check for known value not multiple of alignment if No (ACCR.Y) then if not Alignment_Checks_Suppressed (ACCR) and then X_Alignment /= 0 and then ACCR.A mod X_Alignment /= 0 then Error_Msg_NE ("??specified address for& is inconsistent with " & "alignment", ACCR.N, ACCR.X); Error_Msg_N ("\??program execution may be erroneous (RM 13.3(27))", ACCR.N); Error_Msg_Uint_1 := X_Alignment; Error_Msg_NE ("\??alignment of & is ^", ACCR.N, ACCR.X); end if; -- Check for large object overlaying smaller one elsif Y_Size > Uint_0 and then X_Size > Uint_0 and then X_Offs + X_Size > Y_Size then Error_Msg_NE ("??& overlays smaller object", ACCR.N, ACCR.X); Error_Msg_N ("\??program execution may be erroneous", ACCR.N); Error_Msg_Uint_1 := X_Size; Error_Msg_NE ("\??size of & is ^", ACCR.N, ACCR.X); Error_Msg_Uint_1 := Y_Size; Error_Msg_NE ("\??size of & is ^", ACCR.N, ACCR.Y); if Y_Size >= X_Size then Error_Msg_Uint_1 := X_Offs; Error_Msg_NE ("\??but offset of & is ^", ACCR.N, ACCR.X); end if; -- Check for inadequate alignment, both of the base object -- and of the offset, if any. We only do this check if the -- run-time Alignment_Check is active. No point in warning -- if this check has been suppressed (or is suppressed by -- default in the non-strict alignment machine case). -- Note: we do not check the alignment if we gave a size -- warning, since it would likely be redundant. elsif not Alignment_Checks_Suppressed (ACCR) and then Y_Alignment /= Uint_0 and then (Y_Alignment < X_Alignment or else (ACCR.Off and then Nkind (Expr) = N_Attribute_Reference and then Attribute_Name (Expr) = Name_Address and then Has_Compatible_Alignment (ACCR.X, Prefix (Expr), True) /= Known_Compatible)) then Error_Msg_NE ("??specified address for& may be inconsistent with " & "alignment", ACCR.N, ACCR.X); Error_Msg_N ("\??program execution may be erroneous (RM 13.3(27))", ACCR.N); Error_Msg_Uint_1 := X_Alignment; Error_Msg_NE ("\??alignment of & is ^", ACCR.N, ACCR.X); Error_Msg_Uint_1 := Y_Alignment; Error_Msg_NE ("\??alignment of & is ^", ACCR.N, ACCR.Y); if Y_Alignment >= X_Alignment then Error_Msg_N ("\??but offset is not multiple of alignment", ACCR.N); end if; end if; end if; end; end loop; end Validate_Address_Clauses; --------------------------- -- Validate_Independence -- --------------------------- procedure Validate_Independence is SU : constant Uint := UI_From_Int (System_Storage_Unit); N : Node_Id; E : Entity_Id; IC : Boolean; Comp : Entity_Id; Addr : Node_Id; P : Node_Id; procedure Check_Array_Type (Atyp : Entity_Id); -- Checks if the array type Atyp has independent components, and -- if not, outputs an appropriate set of error messages. procedure No_Independence; -- Output message that independence cannot be guaranteed function OK_Component (C : Entity_Id) return Boolean; -- Checks one component to see if it is independently accessible, and -- if so yields True, otherwise yields False if independent access -- cannot be guaranteed. This is a conservative routine, it only -- returns True if it knows for sure, it returns False if it knows -- there is a problem, or it cannot be sure there is no problem. procedure Reason_Bad_Component (C : Entity_Id); -- Outputs continuation message if a reason can be determined for -- the component C being bad. ---------------------- -- Check_Array_Type -- ---------------------- procedure Check_Array_Type (Atyp : Entity_Id) is Ctyp : constant Entity_Id := Component_Type (Atyp); begin -- OK if no alignment clause, no pack, and no component size if not Has_Component_Size_Clause (Atyp) and then not Has_Alignment_Clause (Atyp) and then not Is_Packed (Atyp) then return; end if; -- Case where component size is greater than or equal to the maximum -- integer size and the alignment of the array is at least as large -- as the alignment of the component. We are OK in this situation. if Known_Component_Size (Atyp) and then Component_Size (Atyp) >= System_Max_Integer_Size and then Known_Alignment (Atyp) and then Known_Alignment (Ctyp) and then Alignment (Atyp) >= Alignment (Ctyp) then return; end if; -- Check actual component size if not Known_Component_Size (Atyp) or else not Addressable (Component_Size (Atyp)) or else Component_Size (Atyp) mod Esize (Ctyp) /= 0 then No_Independence; -- Bad component size, check reason if Has_Component_Size_Clause (Atyp) then P := Get_Attribute_Definition_Clause (Atyp, Attribute_Component_Size); if Present (P) then Error_Msg_Sloc := Sloc (P); Error_Msg_N ("\because of Component_Size clause#", N); return; end if; end if; if Is_Packed (Atyp) then P := Get_Rep_Pragma (Atyp, Name_Pack); if Present (P) then Error_Msg_Sloc := Sloc (P); Error_Msg_N ("\because of pragma Pack#", N); return; end if; end if; -- No reason found, just return return; end if; -- Array type is OK independence-wise return; end Check_Array_Type; --------------------- -- No_Independence -- --------------------- procedure No_Independence is begin if Pragma_Name (N) = Name_Independent then Error_Msg_NE ("independence cannot be guaranteed for&", N, E); else Error_Msg_NE ("independent components cannot be guaranteed for&", N, E); end if; end No_Independence; ------------------ -- OK_Component -- ------------------ function OK_Component (C : Entity_Id) return Boolean is Rec : constant Entity_Id := Scope (C); Ctyp : constant Entity_Id := Etype (C); begin -- OK if no component clause, no Pack, and no alignment clause if No (Component_Clause (C)) and then not Is_Packed (Rec) and then not Has_Alignment_Clause (Rec) then return True; end if; -- Here we look at the actual component layout. A component is -- addressable if its size is a multiple of the Esize of the -- component type, and its starting position in the record has -- appropriate alignment, and the record itself has appropriate -- alignment to guarantee the component alignment. -- Make sure sizes are static, always assume the worst for any -- cases where we cannot check static values. if not (Known_Static_Esize (C) and then Known_Static_Esize (Ctyp)) then return False; end if; -- Size of component must be addressable or greater than the maximum -- integer size and a multiple of bytes. if not Addressable (Esize (C)) and then Esize (C) < System_Max_Integer_Size then return False; end if; -- Check size is proper multiple if Esize (C) mod Esize (Ctyp) /= 0 then return False; end if; -- Check alignment of component is OK if not Known_Component_Bit_Offset (C) or else Component_Bit_Offset (C) < Uint_0 or else Component_Bit_Offset (C) mod Esize (Ctyp) /= 0 then return False; end if; -- Check alignment of record type is OK if not Known_Alignment (Rec) or else (Alignment (Rec) * SU) mod Esize (Ctyp) /= 0 then return False; end if; -- All tests passed, component is addressable return True; end OK_Component; -------------------------- -- Reason_Bad_Component -- -------------------------- procedure Reason_Bad_Component (C : Entity_Id) is Rec : constant Entity_Id := Scope (C); Ctyp : constant Entity_Id := Etype (C); begin -- If component clause present assume that's the problem if Present (Component_Clause (C)) then Error_Msg_Sloc := Sloc (Component_Clause (C)); Error_Msg_N ("\because of Component_Clause#", N); return; end if; -- If pragma Pack clause present, assume that's the problem if Is_Packed (Rec) then P := Get_Rep_Pragma (Rec, Name_Pack); if Present (P) then Error_Msg_Sloc := Sloc (P); Error_Msg_N ("\because of pragma Pack#", N); return; end if; end if; -- See if record has bad alignment clause if Has_Alignment_Clause (Rec) and then Known_Alignment (Rec) and then (Alignment (Rec) * SU) mod Esize (Ctyp) /= 0 then P := Get_Attribute_Definition_Clause (Rec, Attribute_Alignment); if Present (P) then Error_Msg_Sloc := Sloc (P); Error_Msg_N ("\because of Alignment clause#", N); end if; end if; -- Couldn't find a reason, so return without a message return; end Reason_Bad_Component; -- Start of processing for Validate_Independence begin for J in Independence_Checks.First .. Independence_Checks.Last loop N := Independence_Checks.Table (J).N; E := Independence_Checks.Table (J).E; IC := Pragma_Name (N) = Name_Independent_Components; -- Deal with component case if Ekind (E) = E_Discriminant or else Ekind (E) = E_Component then if not OK_Component (E) then No_Independence; Reason_Bad_Component (E); goto Continue; end if; end if; -- Deal with record with Independent_Components if IC and then Is_Record_Type (E) then Comp := First_Component_Or_Discriminant (E); while Present (Comp) loop if not OK_Component (Comp) then No_Independence; Reason_Bad_Component (Comp); goto Continue; end if; Next_Component_Or_Discriminant (Comp); end loop; end if; -- Deal with address clause case if Is_Object (E) then Addr := Address_Clause (E); if Present (Addr) then No_Independence; Error_Msg_Sloc := Sloc (Addr); Error_Msg_N ("\because of Address clause#", N); goto Continue; end if; end if; -- Deal with independent components for array type if IC and then Is_Array_Type (E) then Check_Array_Type (E); end if; -- Deal with independent components for array object if IC and then Is_Object (E) and then Is_Array_Type (Etype (E)) then Check_Array_Type (Etype (E)); end if; <<Continue>> null; end loop; end Validate_Independence; ------------------------------ -- Validate_Iterable_Aspect -- ------------------------------ procedure Validate_Iterable_Aspect (Typ : Entity_Id; ASN : Node_Id) is Assoc : Node_Id; Expr : Node_Id; Prim : Node_Id; Cursor : constant Entity_Id := Get_Cursor_Type (ASN, Typ); First_Id : Entity_Id; Last_Id : Entity_Id; Next_Id : Entity_Id; Has_Element_Id : Entity_Id; Element_Id : Entity_Id; begin -- If previous error aspect is unusable if Cursor = Any_Type then return; end if; First_Id := Empty; Last_Id := Empty; Next_Id := Empty; Has_Element_Id := Empty; Element_Id := Empty; -- Each expression must resolve to a function with the proper signature Assoc := First (Component_Associations (Expression (ASN))); while Present (Assoc) loop Expr := Expression (Assoc); Analyze (Expr); Prim := First (Choices (Assoc)); if Nkind (Prim) /= N_Identifier or else Present (Next (Prim)) then Error_Msg_N ("illegal name in association", Prim); elsif Chars (Prim) = Name_First then Resolve_Iterable_Operation (Expr, Cursor, Typ, Name_First); First_Id := Entity (Expr); elsif Chars (Prim) = Name_Last then Resolve_Iterable_Operation (Expr, Cursor, Typ, Name_Last); Last_Id := Entity (Expr); elsif Chars (Prim) = Name_Previous then Resolve_Iterable_Operation (Expr, Cursor, Typ, Name_Previous); Last_Id := Entity (Expr); elsif Chars (Prim) = Name_Next then Resolve_Iterable_Operation (Expr, Cursor, Typ, Name_Next); Next_Id := Entity (Expr); elsif Chars (Prim) = Name_Has_Element then Resolve_Iterable_Operation (Expr, Cursor, Typ, Name_Has_Element); Has_Element_Id := Entity (Expr); elsif Chars (Prim) = Name_Element then Resolve_Iterable_Operation (Expr, Cursor, Typ, Name_Element); Element_Id := Entity (Expr); else Error_Msg_N ("invalid name for iterable function", Prim); end if; Next (Assoc); end loop; if No (First_Id) then Error_Msg_N ("match for First primitive not found", ASN); elsif No (Next_Id) then Error_Msg_N ("match for Next primitive not found", ASN); elsif No (Has_Element_Id) then Error_Msg_N ("match for Has_Element primitive not found", ASN); elsif No (Element_Id) or else No (Last_Id) then null; -- optional end if; end Validate_Iterable_Aspect; ------------------------------ -- Validate_Literal_Aspect -- ------------------------------ procedure Validate_Literal_Aspect (Typ : Entity_Id; ASN : Node_Id) is A_Id : constant Aspect_Id := Get_Aspect_Id (ASN); pragma Assert ((A_Id = Aspect_Integer_Literal) or (A_Id = Aspect_Real_Literal) or (A_Id = Aspect_String_Literal)); Func_Name : constant Node_Id := Expression (ASN); Overloaded : Boolean := Is_Overloaded (Func_Name); I : Interp_Index; It : Interp; Param_Type : Entity_Id; Match_Found : Boolean := False; Is_Match : Boolean; Match : Interp; begin if not Is_Type (Typ) then Error_Msg_N ("aspect can only be specified for a type", ASN); return; elsif not Is_First_Subtype (Typ) then Error_Msg_N ("aspect cannot be specified for a subtype", ASN); return; end if; if A_Id = Aspect_String_Literal then if Is_String_Type (Typ) then Error_Msg_N ("aspect cannot be specified for a string type", ASN); return; end if; Param_Type := Standard_Wide_Wide_String; else if Is_Numeric_Type (Typ) then Error_Msg_N ("aspect cannot be specified for a numeric type", ASN); return; end if; Param_Type := Standard_String; end if; if not Overloaded and then not Present (Entity (Func_Name)) then Analyze (Func_Name); Overloaded := Is_Overloaded (Func_Name); end if; if Overloaded then Get_First_Interp (Func_Name, I => I, It => It); else -- only one possible interpretation It.Nam := Entity (Func_Name); pragma Assert (Present (It.Nam)); end if; while It.Nam /= Empty loop Is_Match := False; if Ekind (It.Nam) = E_Function and then Base_Type (Etype (It.Nam)) = Typ then declare Params : constant List_Id := Parameter_Specifications (Parent (It.Nam)); Param_Spec : Node_Id; Param_Id : Entity_Id; begin if List_Length (Params) = 1 then Param_Spec := First (Params); if not More_Ids (Param_Spec) then Param_Id := Defining_Identifier (Param_Spec); if Base_Type (Etype (Param_Id)) = Param_Type and then Ekind (Param_Id) = E_In_Parameter and then not Is_Aliased (Param_Id) then Is_Match := True; end if; end if; end if; end; end if; if Is_Match then if Match_Found then Error_Msg_N ("aspect specification is ambiguous", ASN); return; end if; Match_Found := True; Match := It; end if; exit when not Overloaded; if not Is_Match then Remove_Interp (I => I); end if; Get_Next_Interp (I => I, It => It); end loop; if not Match_Found then Error_Msg_N ("function name in aspect specification cannot be resolved", ASN); return; end if; Set_Entity (Func_Name, Match.Nam); Set_Etype (Func_Name, Etype (Match.Nam)); Set_Is_Overloaded (Func_Name, False); end Validate_Literal_Aspect; ----------------------------------- -- Validate_Unchecked_Conversion -- ----------------------------------- procedure Validate_Unchecked_Conversion (N : Node_Id; Act_Unit : Entity_Id) is Source : Entity_Id; Target : Entity_Id; Vnode : Node_Id; begin -- Obtain source and target types. Note that we call Ancestor_Subtype -- here because the processing for generic instantiation always makes -- subtypes, and we want the original frozen actual types. -- If we are dealing with private types, then do the check on their -- fully declared counterparts if the full declarations have been -- encountered (they don't have to be visible, but they must exist). Source := Ancestor_Subtype (Etype (First_Formal (Act_Unit))); if Is_Private_Type (Source) and then Present (Underlying_Type (Source)) then Source := Underlying_Type (Source); end if; Target := Ancestor_Subtype (Etype (Act_Unit)); -- If either type is generic, the instantiation happens within a generic -- unit, and there is nothing to check. The proper check will happen -- when the enclosing generic is instantiated. if Is_Generic_Type (Source) or else Is_Generic_Type (Target) then return; end if; if Is_Private_Type (Target) and then Present (Underlying_Type (Target)) then Target := Underlying_Type (Target); end if; -- Source may be unconstrained array, but not target, except in relaxed -- semantics mode. if Is_Array_Type (Target) and then not Is_Constrained (Target) and then not Relaxed_RM_Semantics then Error_Msg_N ("unchecked conversion to unconstrained array not allowed", N); return; end if; -- Warn if conversion between two different convention pointers if Is_Access_Type (Target) and then Is_Access_Type (Source) and then Convention (Target) /= Convention (Source) and then Warn_On_Unchecked_Conversion then -- Give warnings for subprogram pointers only on most targets if Is_Access_Subprogram_Type (Target) or else Is_Access_Subprogram_Type (Source) then Error_Msg_N ("?z?conversion between pointers with different conventions!", N); end if; end if; -- Warn if one of the operands is Ada.Calendar.Time. Do not emit a -- warning when compiling GNAT-related sources. if Warn_On_Unchecked_Conversion and then not In_Predefined_Unit (N) and then RTU_Loaded (Ada_Calendar) and then (Chars (Source) = Name_Time or else Chars (Target) = Name_Time) then -- If Ada.Calendar is loaded and the name of one of the operands is -- Time, there is a good chance that this is Ada.Calendar.Time. declare Calendar_Time : constant Entity_Id := Full_View (RTE (RO_CA_Time)); begin pragma Assert (Present (Calendar_Time)); if Source = Calendar_Time or else Target = Calendar_Time then Error_Msg_N ("?z?representation of 'Time values may change between " & "'G'N'A'T versions", N); end if; end; end if; -- Make entry in unchecked conversion table for later processing by -- Validate_Unchecked_Conversions, which will check sizes and alignments -- (using values set by the back end where possible). This is only done -- if the appropriate warning is active. if Warn_On_Unchecked_Conversion then Unchecked_Conversions.Append (New_Val => UC_Entry'(Eloc => Sloc (N), Source => Source, Target => Target, Act_Unit => Act_Unit)); -- If both sizes are known statically now, then back-end annotation -- is not required to do a proper check but if either size is not -- known statically, then we need the annotation. if Known_Static_RM_Size (Source) and then Known_Static_RM_Size (Target) then null; else Back_Annotate_Rep_Info := True; end if; end if; -- If unchecked conversion to access type, and access type is declared -- in the same unit as the unchecked conversion, then set the flag -- No_Strict_Aliasing (no strict aliasing is implicit here) if Is_Access_Type (Target) and then In_Same_Source_Unit (Target, N) then Set_No_Strict_Aliasing (Implementation_Base_Type (Target)); end if; -- Generate N_Validate_Unchecked_Conversion node for back end in case -- the back end needs to perform special validation checks. -- Shouldn't this be in Exp_Ch13, since the check only gets done if we -- have full expansion and the back end is called ??? Vnode := Make_Validate_Unchecked_Conversion (Sloc (N)); Set_Source_Type (Vnode, Source); Set_Target_Type (Vnode, Target); -- If the unchecked conversion node is in a list, just insert before it. -- If not we have some strange case, not worth bothering about. if Is_List_Member (N) then Insert_After (N, Vnode); end if; end Validate_Unchecked_Conversion; ------------------------------------ -- Validate_Unchecked_Conversions -- ------------------------------------ procedure Validate_Unchecked_Conversions is function Is_Null_Array (T : Entity_Id) return Boolean; -- We want to warn in the case of converting to a wrong-sized array of -- bytes, including the zero-size case. This returns True in that case, -- which is necessary because a size of 0 is used to indicate both an -- unknown size and a size of 0. It's OK for this to return True in -- other zero-size cases, but we don't go out of our way; for example, -- we don't bother with multidimensional arrays. function Is_Null_Array (T : Entity_Id) return Boolean is begin if Is_Array_Type (T) and then Is_Constrained (T) then declare Index : constant Node_Id := First_Index (T); R : Node_Id; -- N_Range begin case Nkind (Index) is when N_Range => R := Index; when N_Subtype_Indication => R := Range_Expression (Constraint (Index)); when N_Identifier | N_Expanded_Name => R := Scalar_Range (Entity (Index)); when others => raise Program_Error; end case; return Is_Null_Range (Low_Bound (R), High_Bound (R)); end; end if; return False; end Is_Null_Array; begin for N in Unchecked_Conversions.First .. Unchecked_Conversions.Last loop declare T : UC_Entry renames Unchecked_Conversions.Table (N); Act_Unit : constant Entity_Id := T.Act_Unit; Eloc : constant Source_Ptr := T.Eloc; Source : constant Entity_Id := T.Source; Target : constant Entity_Id := T.Target; Source_Siz : Uint; Target_Siz : Uint; begin -- Skip if function marked as warnings off if Warnings_Off (Act_Unit) or else Serious_Errors_Detected > 0 then goto Continue; end if; -- Don't do the check if warnings off for either type, note the -- deliberate use of OR here instead of OR ELSE to get the flag -- Warnings_Off_Used set for both types if appropriate. if Has_Warnings_Off (Source) or Has_Warnings_Off (Target) then goto Continue; end if; if (Known_Static_RM_Size (Source) and then Known_Static_RM_Size (Target)) or else Is_Null_Array (Target) then -- This validation check, which warns if we have unequal sizes -- for unchecked conversion, and thus implementation dependent -- semantics, is one of the few occasions on which we use the -- official RM size instead of Esize. See description in Einfo -- "Handling of Type'Size Values" for details. Source_Siz := RM_Size (Source); Target_Siz := RM_Size (Target); if Source_Siz /= Target_Siz then Error_Msg ("?z?types for unchecked conversion have different sizes!", Eloc, Act_Unit); if All_Errors_Mode then Error_Msg_Name_1 := Chars (Source); Error_Msg_Uint_1 := Source_Siz; Error_Msg_Name_2 := Chars (Target); Error_Msg_Uint_2 := Target_Siz; Error_Msg ("\size of % is ^, size of % is ^?z?", Eloc); Error_Msg_Uint_1 := UI_Abs (Source_Siz - Target_Siz); if Is_Discrete_Type (Source) and then Is_Discrete_Type (Target) then if Source_Siz > Target_Siz then Error_Msg ("\?z?^ high order bits of source will " & "be ignored!", Eloc); elsif Is_Unsigned_Type (Source) then Error_Msg ("\?z?source will be extended with ^ high order " & "zero bits!", Eloc); else Error_Msg ("\?z?source will be extended with ^ high order " & "sign bits!", Eloc); end if; elsif Source_Siz < Target_Siz then if Is_Discrete_Type (Target) then if Bytes_Big_Endian then Error_Msg ("\?z?target value will include ^ undefined " & "low order bits!", Eloc, Act_Unit); else Error_Msg ("\?z?target value will include ^ undefined " & "high order bits!", Eloc, Act_Unit); end if; else Error_Msg ("\?z?^ trailing bits of target value will be " & "undefined!", Eloc, Act_Unit); end if; else pragma Assert (Source_Siz > Target_Siz); if Is_Discrete_Type (Source) then if Bytes_Big_Endian then Error_Msg ("\?z?^ low order bits of source will be " & "ignored!", Eloc, Act_Unit); else Error_Msg ("\?z?^ high order bits of source will be " & "ignored!", Eloc, Act_Unit); end if; else Error_Msg ("\?z?^ trailing bits of source will be " & "ignored!", Eloc, Act_Unit); end if; end if; end if; end if; end if; -- If both types are access types, we need to check the alignment. -- If the alignment of both is specified, we can do it here. if Serious_Errors_Detected = 0 and then Is_Access_Type (Source) and then Is_Access_Type (Target) and then Target_Strict_Alignment and then Present (Designated_Type (Source)) and then Present (Designated_Type (Target)) then declare D_Source : constant Entity_Id := Designated_Type (Source); D_Target : constant Entity_Id := Designated_Type (Target); begin if Known_Alignment (D_Source) and then Known_Alignment (D_Target) then declare Source_Align : constant Uint := Alignment (D_Source); Target_Align : constant Uint := Alignment (D_Target); begin if Source_Align < Target_Align and then not Is_Tagged_Type (D_Source) -- Suppress warning if warnings suppressed on either -- type or either designated type. Note the use of -- OR here instead of OR ELSE. That is intentional, -- we would like to set flag Warnings_Off_Used in -- all types for which warnings are suppressed. and then not (Has_Warnings_Off (D_Source) or Has_Warnings_Off (D_Target) or Has_Warnings_Off (Source) or Has_Warnings_Off (Target)) then Error_Msg_Uint_1 := Target_Align; Error_Msg_Uint_2 := Source_Align; Error_Msg_Node_1 := D_Target; Error_Msg_Node_2 := D_Source; Error_Msg ("?z?alignment of & (^) is stricter than " & "alignment of & (^)!", Eloc, Act_Unit); Error_Msg ("\?z?resulting access value may have invalid " & "alignment!", Eloc, Act_Unit); end if; end; end if; end; end if; end; <<Continue>> null; end loop; end Validate_Unchecked_Conversions; end Sem_Ch13;
------------------------------------------------------------------------------ -- -- -- 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.Standard_Profile_L2.Model_Libraries.Hash is new AMF.Elements.Generic_Hash (Standard_Profile_L2_Model_Library, Standard_Profile_L2_Model_Library_Access);
pragma License (Unrestricted); -- BSD 3-Clause -- translated unit from SFMT (SFMT-params216091.h) with Ada.Numerics.SFMT; package Ada.Numerics.SFMT_216091 is new SFMT ( MEXP => 216091, POS1 => 627, SL1 => 11, SL2 => 3, SR1 => 10, SR2 => 1, MSK1 => 16#bff7bff7#, MSK2 => 16#bfffffff#, MSK3 => 16#bffffa7f#, MSK4 => 16#ffddfbfb#, PARITY1 => 16#f8000001#, PARITY2 => 16#89e80709#, PARITY3 => 16#3bd2b64b#, PARITY4 => 16#0c64b1e4#); -- The largest periods. pragma Preelaborate (Ada.Numerics.SFMT_216091);
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . C H A R A C T E R S . H A N D L I N G -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; with Ada.Strings.Maps; use Ada.Strings.Maps; with Ada.Strings.Maps.Constants; use Ada.Strings.Maps.Constants; package body Ada.Characters.Handling is ------------------------------------ -- Character Classification Table -- ------------------------------------ type Character_Flags is mod 256; for Character_Flags'Size use 8; Control : constant Character_Flags := 1; Lower : constant Character_Flags := 2; Upper : constant Character_Flags := 4; Basic : constant Character_Flags := 8; Hex_Digit : constant Character_Flags := 16; Digit : constant Character_Flags := 32; Special : constant Character_Flags := 64; Letter : constant Character_Flags := Lower or Upper; Alphanum : constant Character_Flags := Letter or Digit; Graphic : constant Character_Flags := Alphanum or Special; Char_Map : constant array (Character) of Character_Flags := ( NUL => Control, SOH => Control, STX => Control, ETX => Control, EOT => Control, ENQ => Control, ACK => Control, BEL => Control, BS => Control, HT => Control, LF => Control, VT => Control, FF => Control, CR => Control, SO => Control, SI => Control, DLE => Control, DC1 => Control, DC2 => Control, DC3 => Control, DC4 => Control, NAK => Control, SYN => Control, ETB => Control, CAN => Control, EM => Control, SUB => Control, ESC => Control, FS => Control, GS => Control, RS => Control, US => Control, Space => Special, Exclamation => Special, Quotation => Special, Number_Sign => Special, Dollar_Sign => Special, Percent_Sign => Special, Ampersand => Special, Apostrophe => Special, Left_Parenthesis => Special, Right_Parenthesis => Special, Asterisk => Special, Plus_Sign => Special, Comma => Special, Hyphen => Special, Full_Stop => Special, Solidus => Special, '0' .. '9' => Digit + Hex_Digit, Colon => Special, Semicolon => Special, Less_Than_Sign => Special, Equals_Sign => Special, Greater_Than_Sign => Special, Question => Special, Commercial_At => Special, 'A' .. 'F' => Upper + Basic + Hex_Digit, 'G' .. 'Z' => Upper + Basic, Left_Square_Bracket => Special, Reverse_Solidus => Special, Right_Square_Bracket => Special, Circumflex => Special, Low_Line => Special, Grave => Special, 'a' .. 'f' => Lower + Basic + Hex_Digit, 'g' .. 'z' => Lower + Basic, Left_Curly_Bracket => Special, Vertical_Line => Special, Right_Curly_Bracket => Special, Tilde => Special, DEL => Control, Reserved_128 => Control, Reserved_129 => Control, BPH => Control, NBH => Control, Reserved_132 => Control, NEL => Control, SSA => Control, ESA => Control, HTS => Control, HTJ => Control, VTS => Control, PLD => Control, PLU => Control, RI => Control, SS2 => Control, SS3 => Control, DCS => Control, PU1 => Control, PU2 => Control, STS => Control, CCH => Control, MW => Control, SPA => Control, EPA => Control, SOS => Control, Reserved_153 => Control, SCI => Control, CSI => Control, ST => Control, OSC => Control, PM => Control, APC => Control, No_Break_Space => Special, Inverted_Exclamation => Special, Cent_Sign => Special, Pound_Sign => Special, Currency_Sign => Special, Yen_Sign => Special, Broken_Bar => Special, Section_Sign => Special, Diaeresis => Special, Copyright_Sign => Special, Feminine_Ordinal_Indicator => Special, Left_Angle_Quotation => Special, Not_Sign => Special, Soft_Hyphen => Special, Registered_Trade_Mark_Sign => Special, Macron => Special, Degree_Sign => Special, Plus_Minus_Sign => Special, Superscript_Two => Special, Superscript_Three => Special, Acute => Special, Micro_Sign => Special, Pilcrow_Sign => Special, Middle_Dot => Special, Cedilla => Special, Superscript_One => Special, Masculine_Ordinal_Indicator => Special, Right_Angle_Quotation => Special, Fraction_One_Quarter => Special, Fraction_One_Half => Special, Fraction_Three_Quarters => Special, Inverted_Question => Special, UC_A_Grave => Upper, UC_A_Acute => Upper, UC_A_Circumflex => Upper, UC_A_Tilde => Upper, UC_A_Diaeresis => Upper, UC_A_Ring => Upper, UC_AE_Diphthong => Upper + Basic, UC_C_Cedilla => Upper, UC_E_Grave => Upper, UC_E_Acute => Upper, UC_E_Circumflex => Upper, UC_E_Diaeresis => Upper, UC_I_Grave => Upper, UC_I_Acute => Upper, UC_I_Circumflex => Upper, UC_I_Diaeresis => Upper, UC_Icelandic_Eth => Upper + Basic, UC_N_Tilde => Upper, UC_O_Grave => Upper, UC_O_Acute => Upper, UC_O_Circumflex => Upper, UC_O_Tilde => Upper, UC_O_Diaeresis => Upper, Multiplication_Sign => Special, UC_O_Oblique_Stroke => Upper, UC_U_Grave => Upper, UC_U_Acute => Upper, UC_U_Circumflex => Upper, UC_U_Diaeresis => Upper, UC_Y_Acute => Upper, UC_Icelandic_Thorn => Upper + Basic, LC_German_Sharp_S => Lower + Basic, LC_A_Grave => Lower, LC_A_Acute => Lower, LC_A_Circumflex => Lower, LC_A_Tilde => Lower, LC_A_Diaeresis => Lower, LC_A_Ring => Lower, LC_AE_Diphthong => Lower + Basic, LC_C_Cedilla => Lower, LC_E_Grave => Lower, LC_E_Acute => Lower, LC_E_Circumflex => Lower, LC_E_Diaeresis => Lower, LC_I_Grave => Lower, LC_I_Acute => Lower, LC_I_Circumflex => Lower, LC_I_Diaeresis => Lower, LC_Icelandic_Eth => Lower + Basic, LC_N_Tilde => Lower, LC_O_Grave => Lower, LC_O_Acute => Lower, LC_O_Circumflex => Lower, LC_O_Tilde => Lower, LC_O_Diaeresis => Lower, Division_Sign => Special, LC_O_Oblique_Stroke => Lower, LC_U_Grave => Lower, LC_U_Acute => Lower, LC_U_Circumflex => Lower, LC_U_Diaeresis => Lower, LC_Y_Acute => Lower, LC_Icelandic_Thorn => Lower + Basic, LC_Y_Diaeresis => Lower ); --------------------- -- Is_Alphanumeric -- --------------------- function Is_Alphanumeric (Item : in Character) return Boolean is begin return (Char_Map (Item) and Alphanum) /= 0; end Is_Alphanumeric; -------------- -- Is_Basic -- -------------- function Is_Basic (Item : in Character) return Boolean is begin return (Char_Map (Item) and Basic) /= 0; end Is_Basic; ------------------ -- Is_Character -- ------------------ function Is_Character (Item : in Wide_Character) return Boolean is begin return Wide_Character'Pos (Item) < 256; end Is_Character; ---------------- -- Is_Control -- ---------------- function Is_Control (Item : in Character) return Boolean is begin return (Char_Map (Item) and Control) /= 0; end Is_Control; -------------- -- Is_Digit -- -------------- function Is_Digit (Item : in Character) return Boolean is begin return Item in '0' .. '9'; end Is_Digit; ---------------- -- Is_Graphic -- ---------------- function Is_Graphic (Item : in Character) return Boolean is begin return (Char_Map (Item) and Graphic) /= 0; end Is_Graphic; -------------------------- -- Is_Hexadecimal_Digit -- -------------------------- function Is_Hexadecimal_Digit (Item : in Character) return Boolean is begin return (Char_Map (Item) and Hex_Digit) /= 0; end Is_Hexadecimal_Digit; ---------------- -- Is_ISO_646 -- ---------------- function Is_ISO_646 (Item : in Character) return Boolean is begin return Item in ISO_646; end Is_ISO_646; -- Note: much more efficient coding of the following function is possible -- by testing several 16#80# bits in a complete word in a single operation function Is_ISO_646 (Item : in String) return Boolean is begin for J in Item'Range loop if Item (J) not in ISO_646 then return False; end if; end loop; return True; end Is_ISO_646; --------------- -- Is_Letter -- --------------- function Is_Letter (Item : in Character) return Boolean is begin return (Char_Map (Item) and Letter) /= 0; end Is_Letter; -------------- -- Is_Lower -- -------------- function Is_Lower (Item : in Character) return Boolean is begin return (Char_Map (Item) and Lower) /= 0; end Is_Lower; ---------------- -- Is_Special -- ---------------- function Is_Special (Item : in Character) return Boolean is begin return (Char_Map (Item) and Special) /= 0; end Is_Special; --------------- -- Is_String -- --------------- function Is_String (Item : in Wide_String) return Boolean is begin for J in Item'Range loop if Wide_Character'Pos (Item (J)) >= 256 then return False; end if; end loop; return True; end Is_String; -------------- -- Is_Upper -- -------------- function Is_Upper (Item : in Character) return Boolean is begin return (Char_Map (Item) and Upper) /= 0; end Is_Upper; -------------- -- To_Basic -- -------------- function To_Basic (Item : in Character) return Character is begin return Value (Basic_Map, Item); end To_Basic; function To_Basic (Item : in String) return String is Result : String (1 .. Item'Length); begin for J in Item'Range loop Result (J - (Item'First - 1)) := Value (Basic_Map, Item (J)); end loop; return Result; end To_Basic; ------------------ -- To_Character -- ------------------ function To_Character (Item : in Wide_Character; Substitute : in Character := ' ') return Character is begin if Is_Character (Item) then return Character'Val (Wide_Character'Pos (Item)); else return Substitute; end if; end To_Character; ---------------- -- To_ISO_646 -- ---------------- function To_ISO_646 (Item : in Character; Substitute : in ISO_646 := ' ') return ISO_646 is begin if Item in ISO_646 then return Item; else return Substitute; end if; end To_ISO_646; function To_ISO_646 (Item : in String; Substitute : in ISO_646 := ' ') return String is Result : String (1 .. Item'Length); begin for J in Item'Range loop if Item (J) in ISO_646 then Result (J - (Item'First - 1)) := Item (J); else Result (J - (Item'First - 1)) := Substitute; end if; end loop; return Result; end To_ISO_646; -------------- -- To_Lower -- -------------- function To_Lower (Item : in Character) return Character is begin return Value (Lower_Case_Map, Item); end To_Lower; function To_Lower (Item : in String) return String is Result : String (1 .. Item'Length); begin for J in Item'Range loop Result (J - (Item'First - 1)) := Value (Lower_Case_Map, Item (J)); end loop; return Result; end To_Lower; --------------- -- To_String -- --------------- function To_String (Item : in Wide_String; Substitute : in Character := ' ') return String is Result : String (1 .. Item'Length); begin for J in Item'Range loop Result (J - (Item'First - 1)) := To_Character (Item (J), Substitute); end loop; return Result; end To_String; -------------- -- To_Upper -- -------------- function To_Upper (Item : in Character) return Character is begin return Value (Upper_Case_Map, Item); end To_Upper; function To_Upper (Item : in String) return String is Result : String (1 .. Item'Length); begin for J in Item'Range loop Result (J - (Item'First - 1)) := Value (Upper_Case_Map, Item (J)); end loop; return Result; end To_Upper; ----------------------- -- To_Wide_Character -- ----------------------- function To_Wide_Character (Item : in Character) return Wide_Character is begin return Wide_Character'Val (Character'Pos (Item)); end To_Wide_Character; -------------------- -- To_Wide_String -- -------------------- function To_Wide_String (Item : in String) return Wide_String is Result : Wide_String (1 .. Item'Length); begin for J in Item'Range loop Result (J - (Item'First - 1)) := To_Wide_Character (Item (J)); end loop; return Result; end To_Wide_String; end Ada.Characters.Handling;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . P U R E _ E X C E P T I O N S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2000-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 provides an interface for raising predefined exceptions with -- an exception message. It can be used from Pure units. This unit is for -- internal use only, it is not generally available to applications. pragma Compiler_Unit_Warning; package System.Pure_Exceptions is pragma Pure; type Exception_Type is limited null record; -- Type used to specify which exception to raise -- Really Exception_Type is Exception_Id, but Exception_Id can't be -- used directly since it is declared in the non-pure unit Ada.Exceptions, -- Exception_Id is in fact simply a pointer to the type Exception_Data -- declared in System.Standard_Library (which is also non-pure). So what -- we do is to define it here as a by reference type (any by reference -- type would do), and then Import the definitions from Standard_Library. -- Since this is a by reference type, these will be passed by reference, -- which has the same effect as passing a pointer. -- This type is not private because keeping it by reference would require -- defining it in a way (e.g a tagged type) that would drag other run time -- files, which is unwanted in the case of e.g ravenscar where we want to -- minimize the number of run time files needed by default. CE : constant Exception_Type; -- Constraint_Error PE : constant Exception_Type; -- Program_Error SE : constant Exception_Type; -- Storage_Error TE : constant Exception_Type; -- Tasking_Error -- One of these constants is used in the call to specify the exception procedure Raise_Exception (E : Exception_Type; Message : String); pragma Import (Ada, Raise_Exception, "__gnat_raise_exception"); pragma No_Return (Raise_Exception); -- Raise specified exception with specified message private pragma Import (C, CE, "constraint_error"); pragma Import (C, PE, "program_error"); pragma Import (C, SE, "storage_error"); pragma Import (C, TE, "tasking_error"); -- References to the exception structures in the standard library end System.Pure_Exceptions;
-- ----------------------------------------------------------------------------- -- smk, the smart make -- © 2018 Lionel Draghi <lionel.draghi@free.fr> -- SPDX-License-Identifier: APSL-2.0 -- ----------------------------------------------------------------------------- -- 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. -- ----------------------------------------------------------------------------- -- ----------------------------------------------------------------------------- -- Procedure: Smk.Main body -- -- Implementation Notes: -- -- Portability Issues: -- -- Anticipated Changes: -- ----------------------------------------------------------------------------- with Smk.IO; with Smk.Makefiles; with Smk.Run_Files; with Smk.Settings; use Smk.Settings; with Ada.Calendar; with Ada.Command_Line; with Ada.Directories; procedure Smk.Main is -- Debug : constant Boolean := True; -- -------------------------------------------------------------------------- procedure Put_Help is separate; procedure Put_Error (Msg : in String := ""; With_Help : in Boolean := False) is separate; -- Put_Line Utilities -- -------------------------------------------------------------------------- procedure Analyze_Cmd_Line is separate; -- Cmd line options are then available in the Settings package. -- -------------------------------------------------------------------------- procedure Analyze_Run (-- Previous_Run_Time : in Ada.Calendar.Time; Source_Files : out Run_Files.File_Lists.Map; Target_Files : out Run_Files.File_Lists.Map) is separate; -- Based on the run log file (that is the strace output), and the run time, -- it identifies Source and Target files. -- Thanks to strace -y option, file names appears clearly between <> -- in the strace output. -- This output is filtered to keep only those file names, and pushed to -- Source_Files list output parameter if the file's time tag is older than -- the execution time, and to Target_Files list otherwise. -- -------------------------------------------------------------------------- function Must_Be_Run (Command : Run_Files.Command_Lines; Previous_Run : in out Run_Files.Run_Lists.Map) return Boolean is separate; -- This function return True if one of the following condition is met: -- 1. the --always-make option is set; -- 2. the provided Command is not found in the previous run; -- 3. one the files identified as Target during the previous run -- is missing; -- 4. one the files identified as Source during the previous run -- has been updated after the previous run. -- -------------------------------------------------------------------------- procedure Run_Command (E : in out Makefiles.Makefile_Entry; The_Run_List : in out Run_Files.Run_Lists.Map) -- Was_Run : out Boolean) is separate; -- Run_Command is in charge of spawning the Cmd (using strace), -- and analysing the strace log file. -- The_Run_List is updated with this run results -- -------------------------------------------------------------------------- procedure Clean_Files is use Ada.Directories; Search : Search_Type; File : Directory_Entry_Type; begin Start_Search (Search, Directory => ".", Pattern => Smk_File_Prefix & "*", Filter => (Ordinary_File => True, others => False)); while More_Entries (Search) loop Get_Next_Entry (Search, File); IO.Put_Line ("Deleting " & Simple_Name (File)); Delete_File (Simple_Name (File)); end loop; end Clean_Files; The_Makefile : Makefiles.Makefile; The_Run_List : Run_Files.Run_Lists.Map; begin -- -------------------------------------------------------------------------- Analyze_Cmd_Line; if IO.Some_Error then -- If some error occurs during command line analysis, stop here. Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure); return; end if; if Clean_Smk_Files then Clean_Files; end if; if Makefile_Name = "" then return; end if; -- Nothing to do : useful for, e.g. -h or -v options -- Fixme: do we want -ls or -lm option without Makefile given that just -- apply to.smk.* files found in the directory? -- 1. Current Makefile analysis -- ---------------------------- Makefiles.Analyze (Makefile_Name, The_Makefile); if List_Makefile then -- -lm option Makefiles.Dump (The_Makefile); return; end if; -- 2. Load previous run -- -------------------- if Run_Files.Saved_Run_Found then The_Run_List := Run_Files.Get_Saved_Run; else The_Run_List := Run_Files.Run_Lists.Empty_Map; end if; if List_Saved_Run then -- -ls Option Run_Files.Dump (The_Run_List, Filter_Sytem_Files => True); return; end if; -- 3. Run commands found in the Makefile -- ------------------------------------- declare A_Cmd_Was_Run : Boolean := False; -- use Run_Files; begin Outer : for I in 1 .. The_Makefile.Entries.Length loop -- This double loop is a pragmatic way to avoid a more complex -- dependies analysis. -- -- Why: build command may appears not ordered in the Makefile. -- What should we do if a command invalidate another one that was -- before in The_Makefile.Entries? -- Exemple : -- 1. gcc -o hello hello.o main.o -- 2. gcc -o hello.o -c hello.c -- 3. gcc -o main.o -c main.c -- If main.c is changed, a single loop approach will re-run 3. and -- exit. -- The double loop will re-loop, and run 1. -- If during the inner loop, nothing is run, then OK, -- we exit the outer loop. -- -- The the worst order will cause as many loop as -- The_Makefile.Entries. Otherwise, it means that there is a circular -- dependency. -- To avoid infinite recursion in that case, the outer loop is -- limited to the worst case, that is The_Makefile.Entries.Length. A_Cmd_Was_Run := False; Inner : for E of The_Makefile.Entries loop -- IO.Put_Line (Positive'Image (Positive (I)) & " " & (+E.Command) -- & " Already_Run = " -- & Boolean'Image (E.Already_Run)); if not E.Already_Run then Run_Command (E, The_Run_List); if IO.Some_Error and not Ignore_Errors then exit Outer; end if; A_Cmd_Was_Run := E.Already_Run; end if; end loop Inner; -- IO.Put_Line (""); -- Naive loop aproach : each time a cmd is run, and potentialy -- invalidate another cmd, we restart the whole cmd list, until -- no command is re-run. exit Outer when not A_Cmd_Was_Run; end loop Outer; end; -- 4. Save the updated run -- ----------------------- Run_Files.Save_Run (The_Run_List); if IO.Some_Error then Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure); return; end if; end Smk.Main;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of STMicroelectronics nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- -- -- -- This file is based on: -- -- -- -- @file stm32f4xx_hal_rng.h -- -- @author MCD Application Team -- -- @version V1.1.0 -- -- @date 19-June-2014 -- -- @brief Header file of RNG HAL module. -- -- -- -- COPYRIGHT(c) 2014 STMicroelectronics -- ------------------------------------------------------------------------------ -- This file provides the API for the random number generator on the STM32F4 -- (ARM Cortex M4F) microcontrollers from ST Microelectronics. -- -- Random numbers are acquired by responding to interrupts from the on-board -- generator. package STM32.RNG.Interrupts is procedure Initialize_RNG with Post => RNG_Interrupt_Enabled; -- Must be called once, prior to any call to get a random number via -- interrupts. Both necessary and sufficient. -- Enables the clock as well. function Random return Interfaces.Unsigned_32; -- Uses the interrupt interface to get the next available number. -- NB: call Initialize_RNG before any calls to this function. end STM32.RNG.Interrupts;
<?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>my_ip_hls</name> <ret_bitwidth>0</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>12</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>slaveIn_V_data_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>slaveIn.V.data.V</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs class_id="7" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_2"> <Value> <Obj> <type>1</type> <id>2</id> <name>slaveIn_V_strb_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>slaveIn.V.strb.V</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>4</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>slaveIn_V_last_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>slaveIn.V.last.V</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>1</bitwidth> </Value> <direction>0</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_4"> <Value> <Obj> <type>1</type> <id>4</id> <name>masterOut_V_data_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>masterOut.V.data.V</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_5"> <Value> <Obj> <type>1</type> <id>5</id> <name>masterOut_V_strb_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>masterOut.V.strb.V</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>4</bitwidth> </Value> <direction>1</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_6"> <Value> <Obj> <type>1</type> <id>6</id> <name>masterOut_V_last_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>masterOut.V.last.V</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>1</bitwidth> </Value> <direction>1</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_7"> <Value> <Obj> <type>1</type> <id>7</id> <name>rule0_V</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> <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="_8"> <Value> <Obj> <type>1</type> <id>8</id> <name>rule1_V</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> <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="_9"> <Value> <Obj> <type>1</type> <id>9</id> <name>rule2_V</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> <direction>0</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_10"> <Value> <Obj> <type>1</type> <id>10</id> <name>rule0cnt_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>rule0cnt.V</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_11"> <Value> <Obj> <type>1</type> <id>11</id> <name>rule1cnt_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>rule1cnt.V</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_12"> <Value> <Obj> <type>1</type> <id>12</id> <name>rule2cnt_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>rule2cnt.V</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>32</bitwidth> </Value> <direction>1</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> </ports> <nodes class_id="8" tracking_level="0" version="0"> <count>23</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_13"> <Value> <Obj> <type>0</type> <id>22</id> <name>rule2_V_read</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> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>94</item> <item>95</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_14"> <Value> <Obj> <type>0</type> <id>23</id> <name>rule1_V_read</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> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>96</item> <item>97</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_15"> <Value> <Obj> <type>0</type> <id>24</id> <name>rule0_V_read</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> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>98</item> <item>99</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_16"> <Value> <Obj> <type>0</type> <id>25</id> <name>rule2_V_c3</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>rule2_V_c3_U</rtlName> <coreName>FIFO</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>101</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_17"> <Value> <Obj> <type>0</type> <id>26</id> <name>rule1_V_c2</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>rule1_V_c2_U</rtlName> <coreName>FIFO</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>102</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_18"> <Value> <Obj> <type>0</type> <id>27</id> <name>rule0_V_c1</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>rule0_V_c1_U</rtlName> <coreName>FIFO</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>103</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_19"> <Value> <Obj> <type>0</type> <id>28</id> <name>rule2_V_c</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>rule2_V_c_U</rtlName> <coreName>FIFO</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>104</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_20"> <Value> <Obj> <type>0</type> <id>29</id> <name>rule1_V_c</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>rule1_V_c_U</rtlName> <coreName>FIFO</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>105</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_21"> <Value> <Obj> <type>0</type> <id>30</id> <name>rule0_V_c</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>rule0_V_c_U</rtlName> <coreName>FIFO</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>106</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_22"> <Value> <Obj> <type>0</type> <id>78</id> <name/> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>my_ip_hls_entry3_U0</rtlName> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>7</count> <item_version>0</item_version> <item>108</item> <item>109</item> <item>110</item> <item>111</item> <item>112</item> <item>113</item> <item>114</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_23"> <Value> <Obj> <type>0</type> <id>79</id> <name/> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>my_ip_hls_entry83_U0</rtlName> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>9</count> <item_version>0</item_version> <item>116</item> <item>117</item> <item>118</item> <item>119</item> <item>120</item> <item>121</item> <item>122</item> <item>705</item> <item>706</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_24"> <Value> <Obj> <type>0</type> <id>80</id> <name>call_ret</name> <fileName>my_ip_hls/my_ip_hls.cpp</fileName> <fileDirectory>..</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>my_ip_hls</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="11" tracking_level="0" version="0"> <first>C:\Users\CS\Desktop\Vivado-Projects\M3</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>my_ip_hls/my_ip_hls.cpp</first> <second>my_ip_hls</second> </first> <second>40</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>rules_in_U0</rtlName> <coreName/> </Obj> <bitwidth>96</bitwidth> </Value> <oprand_edges> <count>6</count> <item_version>0</item_version> <item>124</item> <item>125</item> <item>126</item> <item>127</item> <item>704</item> <item>707</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_25"> <Value> <Obj> <type>0</type> <id>81</id> <name>rule0Reg_V_channel</name> <fileName>my_ip_hls/my_ip_hls.cpp</fileName> <fileDirectory>..</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>my_ip_hls</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\CS\Desktop\Vivado-Projects\M3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>my_ip_hls/my_ip_hls.cpp</first> <second>my_ip_hls</second> </first> <second>40</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>rule0Reg_V_channel_U</rtlName> <coreName>FIFO</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>128</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_26"> <Value> <Obj> <type>0</type> <id>82</id> <name>rule1Reg_V_channel</name> <fileName>my_ip_hls/my_ip_hls.cpp</fileName> <fileDirectory>..</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>my_ip_hls</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\CS\Desktop\Vivado-Projects\M3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>my_ip_hls/my_ip_hls.cpp</first> <second>my_ip_hls</second> </first> <second>40</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>rule1Reg_V_channel_U</rtlName> <coreName>FIFO</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>129</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_27"> <Value> <Obj> <type>0</type> <id>83</id> <name>rule2Reg_V_channel</name> <fileName>my_ip_hls/my_ip_hls.cpp</fileName> <fileDirectory>..</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>my_ip_hls</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\CS\Desktop\Vivado-Projects\M3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>my_ip_hls/my_ip_hls.cpp</first> <second>my_ip_hls</second> </first> <second>40</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>rule2Reg_V_channel_U</rtlName> <coreName>FIFO</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>130</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_28"> <Value> <Obj> <type>0</type> <id>84</id> <name/> <fileName>my_ip_hls/my_ip_hls.cpp</fileName> <fileDirectory>..</fileDirectory> <lineNumber>43</lineNumber> <contextFuncName>my_ip_hls</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\CS\Desktop\Vivado-Projects\M3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>my_ip_hls/my_ip_hls.cpp</first> <second>my_ip_hls</second> </first> <second>43</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>ps2ip_fifo_U0</rtlName> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>7</count> <item_version>0</item_version> <item>132</item> <item>133</item> <item>134</item> <item>135</item> <item>157</item> <item>158</item> <item>159</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_29"> <Value> <Obj> <type>0</type> <id>85</id> <name>core_ret</name> <fileName>my_ip_hls/my_ip_hls.cpp</fileName> <fileDirectory>..</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>my_ip_hls</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\CS\Desktop\Vivado-Projects\M3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>my_ip_hls/my_ip_hls.cpp</first> <second>my_ip_hls</second> </first> <second>40</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>core_U0</rtlName> <coreName/> </Obj> <bitwidth>96</bitwidth> </Value> <oprand_edges> <count>14</count> <item_version>0</item_version> <item>137</item> <item>138</item> <item>139</item> <item>140</item> <item>160</item> <item>161</item> <item>162</item> <item>163</item> <item>164</item> <item>165</item> <item>166</item> <item>167</item> <item>168</item> <item>703</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_30"> <Value> <Obj> <type>0</type> <id>86</id> <name>cnt0Reg_V</name> <fileName>my_ip_hls/my_ip_hls.cpp</fileName> <fileDirectory>..</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>my_ip_hls</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\CS\Desktop\Vivado-Projects\M3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>my_ip_hls/my_ip_hls.cpp</first> <second>my_ip_hls</second> </first> <second>40</second> </item> </second> </item> </inlineStackInfo> <originalName>cnt0Reg.V</originalName> <rtlName>cnt0Reg_V_U</rtlName> <coreName>FIFO</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>141</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_31"> <Value> <Obj> <type>0</type> <id>87</id> <name>cnt1Reg_V</name> <fileName>my_ip_hls/my_ip_hls.cpp</fileName> <fileDirectory>..</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>my_ip_hls</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\CS\Desktop\Vivado-Projects\M3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>my_ip_hls/my_ip_hls.cpp</first> <second>my_ip_hls</second> </first> <second>40</second> </item> </second> </item> </inlineStackInfo> <originalName>cnt1Reg.V</originalName> <rtlName>cnt1Reg_V_U</rtlName> <coreName>FIFO</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>142</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_32"> <Value> <Obj> <type>0</type> <id>88</id> <name>cnt2Reg_V</name> <fileName>my_ip_hls/my_ip_hls.cpp</fileName> <fileDirectory>..</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>my_ip_hls</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\CS\Desktop\Vivado-Projects\M3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>my_ip_hls/my_ip_hls.cpp</first> <second>my_ip_hls</second> </first> <second>40</second> </item> </second> </item> </inlineStackInfo> <originalName>cnt2Reg.V</originalName> <rtlName>cnt2Reg_V_U</rtlName> <coreName>FIFO</coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>143</item> </oprand_edges> <opcode>extractvalue</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_33"> <Value> <Obj> <type>0</type> <id>89</id> <name/> <fileName>my_ip_hls/my_ip_hls.cpp</fileName> <fileDirectory>..</fileDirectory> <lineNumber>47</lineNumber> <contextFuncName>my_ip_hls</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\CS\Desktop\Vivado-Projects\M3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>my_ip_hls/my_ip_hls.cpp</first> <second>my_ip_hls</second> </first> <second>47</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>ip2ps_fifo_U0</rtlName> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>8</count> <item_version>0</item_version> <item>145</item> <item>146</item> <item>147</item> <item>148</item> <item>169</item> <item>170</item> <item>171</item> <item>702</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_34"> <Value> <Obj> <type>0</type> <id>90</id> <name/> <fileName>my_ip_hls/my_ip_hls.cpp</fileName> <fileDirectory>..</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>my_ip_hls</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\CS\Desktop\Vivado-Projects\M3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>my_ip_hls/my_ip_hls.cpp</first> <second>my_ip_hls</second> </first> <second>40</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>counters_out_U0</rtlName> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>7</count> <item_version>0</item_version> <item>150</item> <item>151</item> <item>152</item> <item>153</item> <item>154</item> <item>155</item> <item>156</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_35"> <Value> <Obj> <type>0</type> <id>91</id> <name/> <fileName>my_ip_hls/my_ip_hls.cpp</fileName> <fileDirectory>..</fileDirectory> <lineNumber>51</lineNumber> <contextFuncName>my_ip_hls</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>C:\Users\CS\Desktop\Vivado-Projects\M3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>my_ip_hls/my_ip_hls.cpp</first> <second>my_ip_hls</second> </first> <second>51</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>0</count> <item_version>0</item_version> </oprand_edges> <opcode>ret</opcode> <m_Display>0</m_Display> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>8</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_36"> <Value> <Obj> <type>2</type> <id>100</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>64</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_37"> <Value> <Obj> <type>2</type> <id>107</id> <name>my_ip_hls_entry3</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> <const_type>6</const_type> <content>&lt;constant:my_ip_hls.entry3&gt;</content> </item> <item class_id_reference="16" object_id="_38"> <Value> <Obj> <type>2</type> <id>115</id> <name>my_ip_hls_entry83</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> <const_type>6</const_type> <content>&lt;constant:my_ip_hls.entry83&gt;</content> </item> <item class_id_reference="16" object_id="_39"> <Value> <Obj> <type>2</type> <id>123</id> <name>rules_in</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>96</bitwidth> </Value> <const_type>6</const_type> <content>&lt;constant:rules_in&gt;</content> </item> <item class_id_reference="16" object_id="_40"> <Value> <Obj> <type>2</type> <id>131</id> <name>ps2ip_fifo</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> <const_type>6</const_type> <content>&lt;constant:ps2ip_fifo&gt;</content> </item> <item class_id_reference="16" object_id="_41"> <Value> <Obj> <type>2</type> <id>136</id> <name>core</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>96</bitwidth> </Value> <const_type>6</const_type> <content>&lt;constant:core&gt;</content> </item> <item class_id_reference="16" object_id="_42"> <Value> <Obj> <type>2</type> <id>144</id> <name>ip2ps_fifo</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> <const_type>6</const_type> <content>&lt;constant:ip2ps_fifo&gt;</content> </item> <item class_id_reference="16" object_id="_43"> <Value> <Obj> <type>2</type> <id>149</id> <name>counters_out</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> <const_type>6</const_type> <content>&lt;constant:counters_out&gt;</content> </item> </consts> <blocks class_id="17" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="18" tracking_level="1" version="0" object_id="_44"> <Obj> <type>3</type> <id>92</id> <name>my_ip_hls</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>23</count> <item_version>0</item_version> <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>78</item> <item>79</item> <item>80</item> <item>81</item> <item>82</item> <item>83</item> <item>84</item> <item>85</item> <item>86</item> <item>87</item> <item>88</item> <item>89</item> <item>90</item> <item>91</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>73</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_45"> <id>95</id> <edge_type>1</edge_type> <source_obj>9</source_obj> <sink_obj>22</sink_obj> </item> <item class_id_reference="20" object_id="_46"> <id>97</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>23</sink_obj> </item> <item class_id_reference="20" object_id="_47"> <id>99</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>24</sink_obj> </item> <item class_id_reference="20" object_id="_48"> <id>101</id> <edge_type>1</edge_type> <source_obj>100</source_obj> <sink_obj>25</sink_obj> </item> <item class_id_reference="20" object_id="_49"> <id>102</id> <edge_type>1</edge_type> <source_obj>100</source_obj> <sink_obj>26</sink_obj> </item> <item class_id_reference="20" object_id="_50"> <id>103</id> <edge_type>1</edge_type> <source_obj>100</source_obj> <sink_obj>27</sink_obj> </item> <item class_id_reference="20" object_id="_51"> <id>104</id> <edge_type>1</edge_type> <source_obj>100</source_obj> <sink_obj>28</sink_obj> </item> <item class_id_reference="20" object_id="_52"> <id>105</id> <edge_type>1</edge_type> <source_obj>100</source_obj> <sink_obj>29</sink_obj> </item> <item class_id_reference="20" object_id="_53"> <id>106</id> <edge_type>1</edge_type> <source_obj>100</source_obj> <sink_obj>30</sink_obj> </item> <item class_id_reference="20" object_id="_54"> <id>108</id> <edge_type>1</edge_type> <source_obj>107</source_obj> <sink_obj>78</sink_obj> </item> <item class_id_reference="20" object_id="_55"> <id>109</id> <edge_type>1</edge_type> <source_obj>24</source_obj> <sink_obj>78</sink_obj> </item> <item class_id_reference="20" object_id="_56"> <id>110</id> <edge_type>1</edge_type> <source_obj>23</source_obj> <sink_obj>78</sink_obj> </item> <item class_id_reference="20" object_id="_57"> <id>111</id> <edge_type>1</edge_type> <source_obj>22</source_obj> <sink_obj>78</sink_obj> </item> <item class_id_reference="20" object_id="_58"> <id>112</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>78</sink_obj> </item> <item class_id_reference="20" object_id="_59"> <id>113</id> <edge_type>1</edge_type> <source_obj>26</source_obj> <sink_obj>78</sink_obj> </item> <item class_id_reference="20" object_id="_60"> <id>114</id> <edge_type>1</edge_type> <source_obj>25</source_obj> <sink_obj>78</sink_obj> </item> <item class_id_reference="20" object_id="_61"> <id>116</id> <edge_type>1</edge_type> <source_obj>115</source_obj> <sink_obj>79</sink_obj> </item> <item class_id_reference="20" object_id="_62"> <id>117</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>79</sink_obj> </item> <item class_id_reference="20" object_id="_63"> <id>118</id> <edge_type>1</edge_type> <source_obj>26</source_obj> <sink_obj>79</sink_obj> </item> <item class_id_reference="20" object_id="_64"> <id>119</id> <edge_type>1</edge_type> <source_obj>25</source_obj> <sink_obj>79</sink_obj> </item> <item class_id_reference="20" object_id="_65"> <id>120</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>79</sink_obj> </item> <item class_id_reference="20" object_id="_66"> <id>121</id> <edge_type>1</edge_type> <source_obj>29</source_obj> <sink_obj>79</sink_obj> </item> <item class_id_reference="20" object_id="_67"> <id>122</id> <edge_type>1</edge_type> <source_obj>28</source_obj> <sink_obj>79</sink_obj> </item> <item class_id_reference="20" object_id="_68"> <id>124</id> <edge_type>1</edge_type> <source_obj>123</source_obj> <sink_obj>80</sink_obj> </item> <item class_id_reference="20" object_id="_69"> <id>125</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>80</sink_obj> </item> <item class_id_reference="20" object_id="_70"> <id>126</id> <edge_type>1</edge_type> <source_obj>29</source_obj> <sink_obj>80</sink_obj> </item> <item class_id_reference="20" object_id="_71"> <id>127</id> <edge_type>1</edge_type> <source_obj>28</source_obj> <sink_obj>80</sink_obj> </item> <item class_id_reference="20" object_id="_72"> <id>128</id> <edge_type>1</edge_type> <source_obj>80</source_obj> <sink_obj>81</sink_obj> </item> <item class_id_reference="20" object_id="_73"> <id>129</id> <edge_type>1</edge_type> <source_obj>80</source_obj> <sink_obj>82</sink_obj> </item> <item class_id_reference="20" object_id="_74"> <id>130</id> <edge_type>1</edge_type> <source_obj>80</source_obj> <sink_obj>83</sink_obj> </item> <item class_id_reference="20" object_id="_75"> <id>132</id> <edge_type>1</edge_type> <source_obj>131</source_obj> <sink_obj>84</sink_obj> </item> <item class_id_reference="20" object_id="_76"> <id>133</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>84</sink_obj> </item> <item class_id_reference="20" object_id="_77"> <id>134</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>84</sink_obj> </item> <item class_id_reference="20" object_id="_78"> <id>135</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>84</sink_obj> </item> <item class_id_reference="20" object_id="_79"> <id>137</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>85</sink_obj> </item> <item class_id_reference="20" object_id="_80"> <id>138</id> <edge_type>1</edge_type> <source_obj>81</source_obj> <sink_obj>85</sink_obj> </item> <item class_id_reference="20" object_id="_81"> <id>139</id> <edge_type>1</edge_type> <source_obj>82</source_obj> <sink_obj>85</sink_obj> </item> <item class_id_reference="20" object_id="_82"> <id>140</id> <edge_type>1</edge_type> <source_obj>83</source_obj> <sink_obj>85</sink_obj> </item> <item class_id_reference="20" object_id="_83"> <id>141</id> <edge_type>1</edge_type> <source_obj>85</source_obj> <sink_obj>86</sink_obj> </item> <item class_id_reference="20" object_id="_84"> <id>142</id> <edge_type>1</edge_type> <source_obj>85</source_obj> <sink_obj>87</sink_obj> </item> <item class_id_reference="20" object_id="_85"> <id>143</id> <edge_type>1</edge_type> <source_obj>85</source_obj> <sink_obj>88</sink_obj> </item> <item class_id_reference="20" object_id="_86"> <id>145</id> <edge_type>1</edge_type> <source_obj>144</source_obj> <sink_obj>89</sink_obj> </item> <item class_id_reference="20" object_id="_87"> <id>146</id> <edge_type>1</edge_type> <source_obj>4</source_obj> <sink_obj>89</sink_obj> </item> <item class_id_reference="20" object_id="_88"> <id>147</id> <edge_type>1</edge_type> <source_obj>5</source_obj> <sink_obj>89</sink_obj> </item> <item class_id_reference="20" object_id="_89"> <id>148</id> <edge_type>1</edge_type> <source_obj>6</source_obj> <sink_obj>89</sink_obj> </item> <item class_id_reference="20" object_id="_90"> <id>150</id> <edge_type>1</edge_type> <source_obj>149</source_obj> <sink_obj>90</sink_obj> </item> <item class_id_reference="20" object_id="_91"> <id>151</id> <edge_type>1</edge_type> <source_obj>86</source_obj> <sink_obj>90</sink_obj> </item> <item class_id_reference="20" object_id="_92"> <id>152</id> <edge_type>1</edge_type> <source_obj>87</source_obj> <sink_obj>90</sink_obj> </item> <item class_id_reference="20" object_id="_93"> <id>153</id> <edge_type>1</edge_type> <source_obj>88</source_obj> <sink_obj>90</sink_obj> </item> <item class_id_reference="20" object_id="_94"> <id>154</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>90</sink_obj> </item> <item class_id_reference="20" object_id="_95"> <id>155</id> <edge_type>1</edge_type> <source_obj>11</source_obj> <sink_obj>90</sink_obj> </item> <item class_id_reference="20" object_id="_96"> <id>156</id> <edge_type>1</edge_type> <source_obj>12</source_obj> <sink_obj>90</sink_obj> </item> <item class_id_reference="20" object_id="_97"> <id>157</id> <edge_type>1</edge_type> <source_obj>13</source_obj> <sink_obj>84</sink_obj> </item> <item class_id_reference="20" object_id="_98"> <id>158</id> <edge_type>1</edge_type> <source_obj>14</source_obj> <sink_obj>84</sink_obj> </item> <item class_id_reference="20" object_id="_99"> <id>159</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>84</sink_obj> </item> <item class_id_reference="20" object_id="_100"> <id>160</id> <edge_type>1</edge_type> <source_obj>13</source_obj> <sink_obj>85</sink_obj> </item> <item class_id_reference="20" object_id="_101"> <id>161</id> <edge_type>1</edge_type> <source_obj>14</source_obj> <sink_obj>85</sink_obj> </item> <item class_id_reference="20" object_id="_102"> <id>162</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>85</sink_obj> </item> <item class_id_reference="20" object_id="_103"> <id>163</id> <edge_type>1</edge_type> <source_obj>16</source_obj> <sink_obj>85</sink_obj> </item> <item class_id_reference="20" object_id="_104"> <id>164</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>85</sink_obj> </item> <item class_id_reference="20" object_id="_105"> <id>165</id> <edge_type>1</edge_type> <source_obj>18</source_obj> <sink_obj>85</sink_obj> </item> <item class_id_reference="20" object_id="_106"> <id>166</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>85</sink_obj> </item> <item class_id_reference="20" object_id="_107"> <id>167</id> <edge_type>1</edge_type> <source_obj>20</source_obj> <sink_obj>85</sink_obj> </item> <item class_id_reference="20" object_id="_108"> <id>168</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>85</sink_obj> </item> <item class_id_reference="20" object_id="_109"> <id>169</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>89</sink_obj> </item> <item class_id_reference="20" object_id="_110"> <id>170</id> <edge_type>1</edge_type> <source_obj>20</source_obj> <sink_obj>89</sink_obj> </item> <item class_id_reference="20" object_id="_111"> <id>171</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>89</sink_obj> </item> <item class_id_reference="20" object_id="_112"> <id>702</id> <edge_type>4</edge_type> <source_obj>85</source_obj> <sink_obj>89</sink_obj> </item> <item class_id_reference="20" object_id="_113"> <id>703</id> <edge_type>4</edge_type> <source_obj>84</source_obj> <sink_obj>85</sink_obj> </item> <item class_id_reference="20" object_id="_114"> <id>704</id> <edge_type>4</edge_type> <source_obj>79</source_obj> <sink_obj>80</sink_obj> </item> <item class_id_reference="20" object_id="_115"> <id>705</id> <edge_type>4</edge_type> <source_obj>78</source_obj> <sink_obj>79</sink_obj> </item> <item class_id_reference="20" object_id="_116"> <id>706</id> <edge_type>4</edge_type> <source_obj>78</source_obj> <sink_obj>79</sink_obj> </item> <item class_id_reference="20" object_id="_117"> <id>707</id> <edge_type>4</edge_type> <source_obj>79</source_obj> <sink_obj>80</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="_118"> <mId>1</mId> <mTag>my_ip_hls</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>92</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>6</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>1</mIsDfPipe> <mDfPipe class_id="23" tracking_level="1" version="0" object_id="_119"> <port_list class_id="24" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </port_list> <process_list class_id="25" tracking_level="0" version="0"> <count>7</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_120"> <type>0</type> <name>my_ip_hls_entry3_U0</name> <ssdmobj_id>78</ssdmobj_id> <pins class_id="27" tracking_level="0" version="0"> <count>6</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_121"> <port class_id="29" tracking_level="1" version="0" object_id="_122"> <name>rule0_V</name> <dir>3</dir> <type>0</type> </port> <inst class_id="30" tracking_level="1" version="0" object_id="_123"> <type>0</type> <name>my_ip_hls_entry3_U0</name> <ssdmobj_id>78</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_124"> <port class_id_reference="29" object_id="_125"> <name>rule1_V</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_123"/> </item> <item class_id_reference="28" object_id="_126"> <port class_id_reference="29" object_id="_127"> <name>rule2_V</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_123"/> </item> <item class_id_reference="28" object_id="_128"> <port class_id_reference="29" object_id="_129"> <name>rule0_V_out</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_123"/> </item> <item class_id_reference="28" object_id="_130"> <port class_id_reference="29" object_id="_131"> <name>rule1_V_out</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_123"/> </item> <item class_id_reference="28" object_id="_132"> <port class_id_reference="29" object_id="_133"> <name>rule2_V_out</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_123"/> </item> </pins> </item> <item class_id_reference="26" object_id="_134"> <type>0</type> <name>my_ip_hls_entry83_U0</name> <ssdmobj_id>79</ssdmobj_id> <pins> <count>6</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_135"> <port class_id_reference="29" object_id="_136"> <name>rule0_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id="_137"> <type>0</type> <name>my_ip_hls_entry83_U0</name> <ssdmobj_id>79</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_138"> <port class_id_reference="29" object_id="_139"> <name>rule1_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_137"/> </item> <item class_id_reference="28" object_id="_140"> <port class_id_reference="29" object_id="_141"> <name>rule2_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_137"/> </item> <item class_id_reference="28" object_id="_142"> <port class_id_reference="29" object_id="_143"> <name>rule0_V_out</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_137"/> </item> <item class_id_reference="28" object_id="_144"> <port class_id_reference="29" object_id="_145"> <name>rule1_V_out</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_137"/> </item> <item class_id_reference="28" object_id="_146"> <port class_id_reference="29" object_id="_147"> <name>rule2_V_out</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_137"/> </item> </pins> </item> <item class_id_reference="26" object_id="_148"> <type>0</type> <name>rules_in_U0</name> <ssdmobj_id>80</ssdmobj_id> <pins> <count>6</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_149"> <port class_id_reference="29" object_id="_150"> <name>rule0_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id="_151"> <type>0</type> <name>rules_in_U0</name> <ssdmobj_id>80</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_152"> <port class_id_reference="29" object_id="_153"> <name>rule1_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_151"/> </item> <item class_id_reference="28" object_id="_154"> <port class_id_reference="29" object_id="_155"> <name>rule2_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_151"/> </item> <item class_id_reference="28" object_id="_156"> <port class_id_reference="29" object_id="_157"> <name>ap_return</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_151"/> </item> <item class_id_reference="28" object_id="_158"> <port class_id_reference="29" object_id="_159"> <name>ap_return</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_151"/> </item> <item class_id_reference="28" object_id="_160"> <port class_id_reference="29" object_id="_161"> <name>ap_return</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_151"/> </item> </pins> </item> <item class_id_reference="26" object_id="_162"> <type>0</type> <name>ps2ip_fifo_U0</name> <ssdmobj_id>84</ssdmobj_id> <pins> <count>6</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_163"> <port class_id_reference="29" object_id="_164"> <name>ps2ip_V_data_V</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id="_165"> <type>0</type> <name>ps2ip_fifo_U0</name> <ssdmobj_id>84</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_166"> <port class_id_reference="29" object_id="_167"> <name>ps2ip_V_strb_V</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_165"/> </item> <item class_id_reference="28" object_id="_168"> <port class_id_reference="29" object_id="_169"> <name>ps2ip_V_last_V</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_165"/> </item> <item class_id_reference="28" object_id="_170"> <port class_id_reference="29" object_id="_171"> <name>ps2ipFifo_V_data_V</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_165"/> </item> <item class_id_reference="28" object_id="_172"> <port class_id_reference="29" object_id="_173"> <name>ps2ipFifo_V_strb_V</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_165"/> </item> <item class_id_reference="28" object_id="_174"> <port class_id_reference="29" object_id="_175"> <name>ps2ipFifo_V_last_V</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_165"/> </item> </pins> </item> <item class_id_reference="26" object_id="_176"> <type>0</type> <name>core_U0</name> <ssdmobj_id>85</ssdmobj_id> <pins> <count>15</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_177"> <port class_id_reference="29" object_id="_178"> <name>p_read</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id="_179"> <type>0</type> <name>core_U0</name> <ssdmobj_id>85</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_180"> <port class_id_reference="29" object_id="_181"> <name>p_read1</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </item> <item class_id_reference="28" object_id="_182"> <port class_id_reference="29" object_id="_183"> <name>p_read2</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </item> <item class_id_reference="28" object_id="_184"> <port class_id_reference="29" object_id="_185"> <name>ps2ipFifo_V_data_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </item> <item class_id_reference="28" object_id="_186"> <port class_id_reference="29" object_id="_187"> <name>ps2ipFifo_V_strb_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </item> <item class_id_reference="28" object_id="_188"> <port class_id_reference="29" object_id="_189"> <name>ps2ipFifo_V_last_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </item> <item class_id_reference="28" object_id="_190"> <port class_id_reference="29" object_id="_191"> <name>cnt0Reg_core_V</name> <dir>3</dir> <type>2</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </item> <item class_id_reference="28" object_id="_192"> <port class_id_reference="29" object_id="_193"> <name>cnt1Reg_core_V</name> <dir>3</dir> <type>2</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </item> <item class_id_reference="28" object_id="_194"> <port class_id_reference="29" object_id="_195"> <name>cnt2Reg_core_V</name> <dir>3</dir> <type>2</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </item> <item class_id_reference="28" object_id="_196"> <port class_id_reference="29" object_id="_197"> <name>ip2psFifo_V_data_V</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </item> <item class_id_reference="28" object_id="_198"> <port class_id_reference="29" object_id="_199"> <name>ip2psFifo_V_strb_V</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </item> <item class_id_reference="28" object_id="_200"> <port class_id_reference="29" object_id="_201"> <name>ip2psFifo_V_last_V</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </item> <item class_id_reference="28" object_id="_202"> <port class_id_reference="29" object_id="_203"> <name>ap_return</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </item> <item class_id_reference="28" object_id="_204"> <port class_id_reference="29" object_id="_205"> <name>ap_return</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </item> <item class_id_reference="28" object_id="_206"> <port class_id_reference="29" object_id="_207"> <name>ap_return</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </item> </pins> </item> <item class_id_reference="26" object_id="_208"> <type>0</type> <name>ip2ps_fifo_U0</name> <ssdmobj_id>89</ssdmobj_id> <pins> <count>6</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_209"> <port class_id_reference="29" object_id="_210"> <name>ip2ps_V_data_V</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id="_211"> <type>0</type> <name>ip2ps_fifo_U0</name> <ssdmobj_id>89</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_212"> <port class_id_reference="29" object_id="_213"> <name>ip2ps_V_strb_V</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_211"/> </item> <item class_id_reference="28" object_id="_214"> <port class_id_reference="29" object_id="_215"> <name>ip2ps_V_last_V</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_211"/> </item> <item class_id_reference="28" object_id="_216"> <port class_id_reference="29" object_id="_217"> <name>ip2psFifo_V_data_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_211"/> </item> <item class_id_reference="28" object_id="_218"> <port class_id_reference="29" object_id="_219"> <name>ip2psFifo_V_strb_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_211"/> </item> <item class_id_reference="28" object_id="_220"> <port class_id_reference="29" object_id="_221"> <name>ip2psFifo_V_last_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_211"/> </item> </pins> </item> <item class_id_reference="26" object_id="_222"> <type>0</type> <name>counters_out_U0</name> <ssdmobj_id>90</ssdmobj_id> <pins> <count>6</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_223"> <port class_id_reference="29" object_id="_224"> <name>p_read</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id="_225"> <type>0</type> <name>counters_out_U0</name> <ssdmobj_id>90</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_226"> <port class_id_reference="29" object_id="_227"> <name>p_read1</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_225"/> </item> <item class_id_reference="28" object_id="_228"> <port class_id_reference="29" object_id="_229"> <name>p_read2</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_225"/> </item> <item class_id_reference="28" object_id="_230"> <port class_id_reference="29" object_id="_231"> <name>rule0cnt_V</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_225"/> </item> <item class_id_reference="28" object_id="_232"> <port class_id_reference="29" object_id="_233"> <name>rule1cnt_V</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_225"/> </item> <item class_id_reference="28" object_id="_234"> <port class_id_reference="29" object_id="_235"> <name>rule2cnt_V</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_225"/> </item> </pins> </item> </process_list> <channel_list class_id="31" tracking_level="0" version="0"> <count>18</count> <item_version>0</item_version> <item class_id="32" tracking_level="1" version="0" object_id="_236"> <type>1</type> <name>rule0_V_c1</name> <ssdmobj_id>27</ssdmobj_id> <ctype>0</ctype> <depth>1</depth> <bitwidth>32</bitwidth> <source class_id_reference="28" object_id="_237"> <port class_id_reference="29" object_id="_238"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_123"/> </source> <sink class_id_reference="28" object_id="_239"> <port class_id_reference="29" object_id="_240"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_137"/> </sink> </item> <item class_id_reference="32" object_id="_241"> <type>1</type> <name>rule1_V_c2</name> <ssdmobj_id>26</ssdmobj_id> <ctype>0</ctype> <depth>1</depth> <bitwidth>32</bitwidth> <source class_id_reference="28" object_id="_242"> <port class_id_reference="29" object_id="_243"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_123"/> </source> <sink class_id_reference="28" object_id="_244"> <port class_id_reference="29" object_id="_245"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_137"/> </sink> </item> <item class_id_reference="32" object_id="_246"> <type>1</type> <name>rule2_V_c3</name> <ssdmobj_id>25</ssdmobj_id> <ctype>0</ctype> <depth>1</depth> <bitwidth>32</bitwidth> <source class_id_reference="28" object_id="_247"> <port class_id_reference="29" object_id="_248"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_123"/> </source> <sink class_id_reference="28" object_id="_249"> <port class_id_reference="29" object_id="_250"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_137"/> </sink> </item> <item class_id_reference="32" object_id="_251"> <type>1</type> <name>rule0_V_c</name> <ssdmobj_id>30</ssdmobj_id> <ctype>0</ctype> <depth>1</depth> <bitwidth>32</bitwidth> <source class_id_reference="28" object_id="_252"> <port class_id_reference="29" object_id="_253"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_137"/> </source> <sink class_id_reference="28" object_id="_254"> <port class_id_reference="29" object_id="_255"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_151"/> </sink> </item> <item class_id_reference="32" object_id="_256"> <type>1</type> <name>rule1_V_c</name> <ssdmobj_id>29</ssdmobj_id> <ctype>0</ctype> <depth>1</depth> <bitwidth>32</bitwidth> <source class_id_reference="28" object_id="_257"> <port class_id_reference="29" object_id="_258"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_137"/> </source> <sink class_id_reference="28" object_id="_259"> <port class_id_reference="29" object_id="_260"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_151"/> </sink> </item> <item class_id_reference="32" object_id="_261"> <type>1</type> <name>rule2_V_c</name> <ssdmobj_id>28</ssdmobj_id> <ctype>0</ctype> <depth>1</depth> <bitwidth>32</bitwidth> <source class_id_reference="28" object_id="_262"> <port class_id_reference="29" object_id="_263"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_137"/> </source> <sink class_id_reference="28" object_id="_264"> <port class_id_reference="29" object_id="_265"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_151"/> </sink> </item> <item class_id_reference="32" object_id="_266"> <type>1</type> <name>rule0Reg_V_channel</name> <ssdmobj_id>81</ssdmobj_id> <ctype>0</ctype> <depth>2</depth> <bitwidth>32</bitwidth> <source class_id_reference="28" object_id="_267"> <port class_id_reference="29" object_id="_268"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_151"/> </source> <sink class_id_reference="28" object_id="_269"> <port class_id_reference="29" object_id="_270"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </sink> </item> <item class_id_reference="32" object_id="_271"> <type>1</type> <name>rule1Reg_V_channel</name> <ssdmobj_id>82</ssdmobj_id> <ctype>0</ctype> <depth>2</depth> <bitwidth>32</bitwidth> <source class_id_reference="28" object_id="_272"> <port class_id_reference="29" object_id="_273"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_151"/> </source> <sink class_id_reference="28" object_id="_274"> <port class_id_reference="29" object_id="_275"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </sink> </item> <item class_id_reference="32" object_id="_276"> <type>1</type> <name>rule2Reg_V_channel</name> <ssdmobj_id>83</ssdmobj_id> <ctype>0</ctype> <depth>2</depth> <bitwidth>32</bitwidth> <source class_id_reference="28" object_id="_277"> <port class_id_reference="29" object_id="_278"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_151"/> </source> <sink class_id_reference="28" object_id="_279"> <port class_id_reference="29" object_id="_280"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </sink> </item> <item class_id_reference="32" object_id="_281"> <type>1</type> <name>ps2ipFifo_V_data_V</name> <ssdmobj_id>13</ssdmobj_id> <ctype>0</ctype> <depth>64</depth> <bitwidth>32</bitwidth> <source class_id_reference="28" object_id="_282"> <port class_id_reference="29" object_id="_283"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_165"/> </source> <sink class_id_reference="28" object_id="_284"> <port class_id_reference="29" object_id="_285"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </sink> </item> <item class_id_reference="32" object_id="_286"> <type>1</type> <name>ps2ipFifo_V_strb_V</name> <ssdmobj_id>14</ssdmobj_id> <ctype>0</ctype> <depth>64</depth> <bitwidth>4</bitwidth> <source class_id_reference="28" object_id="_287"> <port class_id_reference="29" object_id="_288"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_165"/> </source> <sink class_id_reference="28" object_id="_289"> <port class_id_reference="29" object_id="_290"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </sink> </item> <item class_id_reference="32" object_id="_291"> <type>1</type> <name>ps2ipFifo_V_last_V</name> <ssdmobj_id>15</ssdmobj_id> <ctype>0</ctype> <depth>64</depth> <bitwidth>1</bitwidth> <source class_id_reference="28" object_id="_292"> <port class_id_reference="29" object_id="_293"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_165"/> </source> <sink class_id_reference="28" object_id="_294"> <port class_id_reference="29" object_id="_295"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </sink> </item> <item class_id_reference="32" object_id="_296"> <type>1</type> <name>ip2psFifo_V_data_V</name> <ssdmobj_id>19</ssdmobj_id> <ctype>0</ctype> <depth>64</depth> <bitwidth>32</bitwidth> <source class_id_reference="28" object_id="_297"> <port class_id_reference="29" object_id="_298"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </source> <sink class_id_reference="28" object_id="_299"> <port class_id_reference="29" object_id="_300"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_211"/> </sink> </item> <item class_id_reference="32" object_id="_301"> <type>1</type> <name>ip2psFifo_V_strb_V</name> <ssdmobj_id>20</ssdmobj_id> <ctype>0</ctype> <depth>64</depth> <bitwidth>4</bitwidth> <source class_id_reference="28" object_id="_302"> <port class_id_reference="29" object_id="_303"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </source> <sink class_id_reference="28" object_id="_304"> <port class_id_reference="29" object_id="_305"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_211"/> </sink> </item> <item class_id_reference="32" object_id="_306"> <type>1</type> <name>ip2psFifo_V_last_V</name> <ssdmobj_id>21</ssdmobj_id> <ctype>0</ctype> <depth>64</depth> <bitwidth>1</bitwidth> <source class_id_reference="28" object_id="_307"> <port class_id_reference="29" object_id="_308"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </source> <sink class_id_reference="28" object_id="_309"> <port class_id_reference="29" object_id="_310"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_211"/> </sink> </item> <item class_id_reference="32" object_id="_311"> <type>1</type> <name>cnt0Reg_V</name> <ssdmobj_id>86</ssdmobj_id> <ctype>0</ctype> <depth>2</depth> <bitwidth>32</bitwidth> <source class_id_reference="28" object_id="_312"> <port class_id_reference="29" object_id="_313"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </source> <sink class_id_reference="28" object_id="_314"> <port class_id_reference="29" object_id="_315"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_225"/> </sink> </item> <item class_id_reference="32" object_id="_316"> <type>1</type> <name>cnt1Reg_V</name> <ssdmobj_id>87</ssdmobj_id> <ctype>0</ctype> <depth>2</depth> <bitwidth>32</bitwidth> <source class_id_reference="28" object_id="_317"> <port class_id_reference="29" object_id="_318"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </source> <sink class_id_reference="28" object_id="_319"> <port class_id_reference="29" object_id="_320"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_225"/> </sink> </item> <item class_id_reference="32" object_id="_321"> <type>1</type> <name>cnt2Reg_V</name> <ssdmobj_id>88</ssdmobj_id> <ctype>0</ctype> <depth>2</depth> <bitwidth>32</bitwidth> <source class_id_reference="28" object_id="_322"> <port class_id_reference="29" object_id="_323"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_179"/> </source> <sink class_id_reference="28" object_id="_324"> <port class_id_reference="29" object_id="_325"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_225"/> </sink> </item> </channel_list> <net_list class_id="33" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </net_list> </mDfPipe> </item> </cdfg_regions> <fsm class_id="34" tracking_level="1" version="0" object_id="_326"> <states class_id="35" tracking_level="0" version="0"> <count>8</count> <item_version>0</item_version> <item class_id="36" tracking_level="1" version="0" object_id="_327"> <id>1</id> <operations class_id="37" tracking_level="0" version="0"> <count>11</count> <item_version>0</item_version> <item class_id="38" tracking_level="1" version="0" object_id="_328"> <id>22</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_329"> <id>23</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_330"> <id>24</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_331"> <id>25</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_332"> <id>26</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_333"> <id>27</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_334"> <id>28</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_335"> <id>29</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_336"> <id>30</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_337"> <id>78</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_338"> <id>84</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_339"> <id>2</id> <operations> <count>2</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_340"> <id>79</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_341"> <id>84</id> <stage>1</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_342"> <id>3</id> <operations> <count>5</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_343"> <id>80</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_344"> <id>81</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_345"> <id>82</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_346"> <id>83</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_347"> <id>85</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_348"> <id>4</id> <operations> <count>5</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_349"> <id>85</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="38" object_id="_350"> <id>86</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_351"> <id>87</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_352"> <id>88</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_353"> <id>90</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_354"> <id>5</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_355"> <id>89</id> <stage>3</stage> <latency>3</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_356"> <id>6</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_357"> <id>89</id> <stage>2</stage> <latency>3</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_358"> <id>7</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_359"> <id>89</id> <stage>1</stage> <latency>3</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_360"> <id>8</id> <operations> <count>48</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_361"> <id>31</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_362"> <id>32</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_363"> <id>33</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_364"> <id>34</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_365"> <id>35</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_366"> <id>36</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_367"> <id>37</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_368"> <id>38</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_369"> <id>39</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_370"> <id>40</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_371"> <id>41</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_372"> <id>42</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_373"> <id>43</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_374"> <id>44</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_375"> <id>45</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_376"> <id>46</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_377"> <id>47</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_378"> <id>48</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_379"> <id>49</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_380"> <id>50</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_381"> <id>51</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_382"> <id>52</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_383"> <id>53</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_384"> <id>54</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_385"> <id>55</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_386"> <id>56</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_387"> <id>57</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_388"> <id>58</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_389"> <id>59</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_390"> <id>60</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_391"> <id>61</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_392"> <id>62</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_393"> <id>63</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_394"> <id>64</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_395"> <id>65</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_396"> <id>66</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_397"> <id>67</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_398"> <id>68</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_399"> <id>69</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_400"> <id>70</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_401"> <id>71</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_402"> <id>72</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_403"> <id>73</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_404"> <id>74</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_405"> <id>75</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_406"> <id>76</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_407"> <id>77</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_408"> <id>91</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="39" tracking_level="0" version="0"> <count>7</count> <item_version>0</item_version> <item class_id="40" tracking_level="1" version="0" object_id="_409"> <inState>1</inState> <outState>2</outState> <condition class_id="41" tracking_level="0" version="0"> <id>0</id> <sop class_id="42" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="43" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="40" object_id="_410"> <inState>2</inState> <outState>3</outState> <condition> <id>1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="40" object_id="_411"> <inState>3</inState> <outState>4</outState> <condition> <id>2</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="40" object_id="_412"> <inState>4</inState> <outState>5</outState> <condition> <id>3</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="40" object_id="_413"> <inState>5</inState> <outState>6</outState> <condition> <id>4</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="40" object_id="_414"> <inState>6</inState> <outState>7</outState> <condition> <id>5</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="40" object_id="_415"> <inState>7</inState> <outState>8</outState> <condition> <id>6</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> </transitions> </fsm> <res class_id="44" tracking_level="1" version="0" object_id="_416"> <dp_component_resource class_id="45" tracking_level="0" version="0"> <count>11</count> <item_version>0</item_version> <item class_id="46" tracking_level="0" version="0"> <first>core_U0 (core)</first> <second class_id="47" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="48" tracking_level="0" version="0"> <first>FF</first> <second>334</second> </item> <item> <first>LUT</first> <second>370</second> </item> </second> </item> <item> <first>counters_out_U0 (counters_out)</first> <second> <count>2</count> <item_version>0</item_version> <item> <first>FF</first> <second>98</second> </item> <item> <first>LUT</first> <second>44</second> </item> </second> </item> <item> <first>ip2ps_fifo_U0 (ip2ps_fifo)</first> <second> <count>2</count> <item_version>0</item_version> <item> <first>FF</first> <second>131</second> </item> <item> <first>LUT</first> <second>259</second> </item> </second> </item> <item> <first>my_ip_hls_entry3_U0 (my_ip_hls_entry3)</first> <second> <count>2</count> <item_version>0</item_version> <item> <first>FF</first> <second>3</second> </item> <item> <first>LUT</first> <second>53</second> </item> </second> </item> <item> <first>my_ip_hls_entry83_U0 (my_ip_hls_entry83)</first> <second> <count>2</count> <item_version>0</item_version> <item> <first>FF</first> <second>3</second> </item> <item> <first>LUT</first> <second>80</second> </item> </second> </item> <item> <first>my_ip_hls_psAxiLite_s_axi_U (my_ip_hls_psAxiLite_s_axi)</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>258</second> </item> <item> <first>LUT</first> <second>424</second> </item> </second> </item> <item> <first>ps2ip_fifo_U0 (ps2ip_fifo)</first> <second> <count>2</count> <item_version>0</item_version> <item> <first>FF</first> <second>42</second> </item> <item> <first>LUT</first> <second>92</second> </item> </second> </item> <item> <first>rules_in_U0 (rules_in)</first> <second> <count>2</count> <item_version>0</item_version> <item> <first>FF</first> <second>98</second> </item> <item> <first>LUT</first> <second>71</second> </item> </second> </item> <item> <first>start_for_ip2ps_fdEe_U (start_for_ip2ps_fdEe)</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>start_for_my_ip_hbkb_U (start_for_my_ip_hbkb)</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>start_for_rules_icud_U (start_for_rules_icud)</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> </dp_component_resource> <dp_expression_resource> <count>16</count> <item_version>0</item_version> <item> <first>ap_channel_done_cnt0Reg_V ( 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_channel_done_cnt1Reg_V ( 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_channel_done_cnt2Reg_V ( 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_channel_done_rule0Reg_V_channel ( 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_channel_done_rule1Reg_V_channel ( 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_channel_done_rule2Reg_V_channel ( 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_sync_channel_write_cnt0Reg_V ( 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_sync_channel_write_cnt1Reg_V ( 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_sync_channel_write_cnt2Reg_V ( 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_sync_channel_write_rule0Reg_V_channel ( 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_sync_channel_write_rule1Reg_V_channel ( 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_sync_channel_write_rule2Reg_V_channel ( 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>core_U0_ap_continue ( 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>core_U0_ap_start ( 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>counters_out_U0_ap_start ( 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>rules_in_U0_ap_continue ( 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> </dp_expression_resource> <dp_fifo_resource> <count>18</count> <item_version>0</item_version> <item> <first>cnt0Reg_V_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>32</second> </item> <item> <first>(2Size:D*B)</first> <second>64</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>5</second> </item> <item> <first>LUT</first> <second>44</second> </item> </second> </item> <item> <first>cnt1Reg_V_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>32</second> </item> <item> <first>(2Size:D*B)</first> <second>64</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>5</second> </item> <item> <first>LUT</first> <second>44</second> </item> </second> </item> <item> <first>cnt2Reg_V_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>32</second> </item> <item> <first>(2Size:D*B)</first> <second>64</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>5</second> </item> <item> <first>LUT</first> <second>44</second> </item> </second> </item> <item> <first>ip2psFifo_V_data_V_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>64</second> </item> <item> <first>(1Bits)</first> <second>32</second> </item> <item> <first>(2Size:D*B)</first> <second>2048</second> </item> <item> <first>BRAM</first> <second>2</second> </item> <item> <first>FF</first> <second>54</second> </item> <item> <first>LUT</first> <second>56</second> </item> </second> </item> <item> <first>ip2psFifo_V_last_V_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>64</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Size:D*B)</first> <second>64</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>9</second> </item> <item> <first>LUT</first> <second>36</second> </item> </second> </item> <item> <first>ip2psFifo_V_strb_V_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>64</second> </item> <item> <first>(1Bits)</first> <second>4</second> </item> <item> <first>(2Size:D*B)</first> <second>256</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>9</second> </item> <item> <first>LUT</first> <second>36</second> </item> </second> </item> <item> <first>ps2ipFifo_V_data_V_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>64</second> </item> <item> <first>(1Bits)</first> <second>32</second> </item> <item> <first>(2Size:D*B)</first> <second>2048</second> </item> <item> <first>BRAM</first> <second>2</second> </item> <item> <first>FF</first> <second>54</second> </item> <item> <first>LUT</first> <second>56</second> </item> </second> </item> <item> <first>ps2ipFifo_V_last_V_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>64</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Size:D*B)</first> <second>64</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>9</second> </item> <item> <first>LUT</first> <second>36</second> </item> </second> </item> <item> <first>ps2ipFifo_V_strb_V_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>64</second> </item> <item> <first>(1Bits)</first> <second>4</second> </item> <item> <first>(2Size:D*B)</first> <second>256</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>9</second> </item> <item> <first>LUT</first> <second>36</second> </item> </second> </item> <item> <first>rule0Reg_V_channel_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>32</second> </item> <item> <first>(2Size:D*B)</first> <second>64</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>5</second> </item> <item> <first>LUT</first> <second>44</second> </item> </second> </item> <item> <first>rule0_V_c1_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>1</second> </item> <item> <first>(1Bits)</first> <second>32</second> </item> <item> <first>(2Size:D*B)</first> <second>32</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>5</second> </item> <item> <first>LUT</first> <second>44</second> </item> </second> </item> <item> <first>rule0_V_c_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>1</second> </item> <item> <first>(1Bits)</first> <second>32</second> </item> <item> <first>(2Size:D*B)</first> <second>32</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>5</second> </item> <item> <first>LUT</first> <second>44</second> </item> </second> </item> <item> <first>rule1Reg_V_channel_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>32</second> </item> <item> <first>(2Size:D*B)</first> <second>64</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>5</second> </item> <item> <first>LUT</first> <second>44</second> </item> </second> </item> <item> <first>rule1_V_c2_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>1</second> </item> <item> <first>(1Bits)</first> <second>32</second> </item> <item> <first>(2Size:D*B)</first> <second>32</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>5</second> </item> <item> <first>LUT</first> <second>44</second> </item> </second> </item> <item> <first>rule1_V_c_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>1</second> </item> <item> <first>(1Bits)</first> <second>32</second> </item> <item> <first>(2Size:D*B)</first> <second>32</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>5</second> </item> <item> <first>LUT</first> <second>44</second> </item> </second> </item> <item> <first>rule2Reg_V_channel_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>32</second> </item> <item> <first>(2Size:D*B)</first> <second>64</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>5</second> </item> <item> <first>LUT</first> <second>44</second> </item> </second> </item> <item> <first>rule2_V_c3_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>1</second> </item> <item> <first>(1Bits)</first> <second>32</second> </item> <item> <first>(2Size:D*B)</first> <second>32</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>5</second> </item> <item> <first>LUT</first> <second>44</second> </item> </second> </item> <item> <first>rule2_V_c_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>1</second> </item> <item> <first>(1Bits)</first> <second>32</second> </item> <item> <first>(2Size:D*B)</first> <second>32</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>5</second> </item> <item> <first>LUT</first> <second>44</second> </item> </second> </item> </dp_fifo_resource> <dp_memory_resource> <count>0</count> <item_version>0</item_version> </dp_memory_resource> <dp_multiplexer_resource> <count>6</count> <item_version>0</item_version> <item> <first>ap_sync_reg_channel_write_cnt0Reg_V</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_sync_reg_channel_write_cnt1Reg_V</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_sync_reg_channel_write_cnt2Reg_V</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_sync_reg_channel_write_rule0Reg_V_channel</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_sync_reg_channel_write_rule1Reg_V_channel</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_sync_reg_channel_write_rule2Reg_V_channel</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>6</count> <item_version>0</item_version> <item> <first>ap_sync_reg_channel_write_cnt0Reg_V</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_sync_reg_channel_write_cnt1Reg_V</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_sync_reg_channel_write_cnt2Reg_V</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_sync_reg_channel_write_rule0Reg_V_channel</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_sync_reg_channel_write_rule1Reg_V_channel</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_sync_reg_channel_write_rule2Reg_V_channel</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> </dp_register_resource> <dp_dsp_resource> <count>11</count> <item_version>0</item_version> <item> <first>core_U0</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>counters_out_U0</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>ip2ps_fifo_U0</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>my_ip_hls_entry3_U0</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>my_ip_hls_entry83_U0</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>my_ip_hls_psAxiLite_s_axi_U</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>ps2ip_fifo_U0</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>rules_in_U0</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>start_for_ip2ps_fdEe_U</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>start_for_my_ip_hbkb_U</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>start_for_rules_icud_U</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> </dp_dsp_resource> <dp_component_map class_id="49" tracking_level="0" version="0"> <count>7</count> <item_version>0</item_version> <item class_id="50" tracking_level="0" version="0"> <first>core_U0 (core)</first> <second> <count>1</count> <item_version>0</item_version> <item>85</item> </second> </item> <item> <first>counters_out_U0 (counters_out)</first> <second> <count>1</count> <item_version>0</item_version> <item>90</item> </second> </item> <item> <first>ip2ps_fifo_U0 (ip2ps_fifo)</first> <second> <count>1</count> <item_version>0</item_version> <item>89</item> </second> </item> <item> <first>my_ip_hls_entry3_U0 (my_ip_hls_entry3)</first> <second> <count>1</count> <item_version>0</item_version> <item>78</item> </second> </item> <item> <first>my_ip_hls_entry83_U0 (my_ip_hls_entry83)</first> <second> <count>1</count> <item_version>0</item_version> <item>79</item> </second> </item> <item> <first>ps2ip_fifo_U0 (ps2ip_fifo)</first> <second> <count>1</count> <item_version>0</item_version> <item>84</item> </second> </item> <item> <first>rules_in_U0 (rules_in)</first> <second> <count>1</count> <item_version>0</item_version> <item>80</item> </second> </item> </dp_component_map> <dp_expression_map> <count>0</count> <item_version>0</item_version> </dp_expression_map> <dp_fifo_map> <count>18</count> <item_version>0</item_version> <item> <first>cnt0Reg_V_U</first> <second> <count>1</count> <item_version>0</item_version> <item>435</item> </second> </item> <item> <first>cnt1Reg_V_U</first> <second> <count>1</count> <item_version>0</item_version> <item>444</item> </second> </item> <item> <first>cnt2Reg_V_U</first> <second> <count>1</count> <item_version>0</item_version> <item>454</item> </second> </item> <item> <first>ip2psFifo_V_data_V_U</first> <second> <count>1</count> <item_version>0</item_version> <item>405</item> </second> </item> <item> <first>ip2psFifo_V_last_V_U</first> <second> <count>1</count> <item_version>0</item_version> <item>425</item> </second> </item> <item> <first>ip2psFifo_V_strb_V_U</first> <second> <count>1</count> <item_version>0</item_version> <item>415</item> </second> </item> <item> <first>ps2ipFifo_V_data_V_U</first> <second> <count>1</count> <item_version>0</item_version> <item>373</item> </second> </item> <item> <first>ps2ipFifo_V_last_V_U</first> <second> <count>1</count> <item_version>0</item_version> <item>395</item> </second> </item> <item> <first>ps2ipFifo_V_strb_V_U</first> <second> <count>1</count> <item_version>0</item_version> <item>384</item> </second> </item> <item> <first>rule0Reg_V_channel_U</first> <second> <count>1</count> <item_version>0</item_version> <item>343</item> </second> </item> <item> <first>rule0_V_c1_U</first> <second> <count>1</count> <item_version>0</item_version> <item>282</item> </second> </item> <item> <first>rule0_V_c_U</first> <second> <count>1</count> <item_version>0</item_version> <item>312</item> </second> </item> <item> <first>rule1Reg_V_channel_U</first> <second> <count>1</count> <item_version>0</item_version> <item>352</item> </second> </item> <item> <first>rule1_V_c2_U</first> <second> <count>1</count> <item_version>0</item_version> <item>292</item> </second> </item> <item> <first>rule1_V_c_U</first> <second> <count>1</count> <item_version>0</item_version> <item>322</item> </second> </item> <item> <first>rule2Reg_V_channel_U</first> <second> <count>1</count> <item_version>0</item_version> <item>362</item> </second> </item> <item> <first>rule2_V_c3_U</first> <second> <count>1</count> <item_version>0</item_version> <item>302</item> </second> </item> <item> <first>rule2_V_c_U</first> <second> <count>1</count> <item_version>0</item_version> <item>332</item> </second> </item> </dp_fifo_map> <dp_memory_map> <count>0</count> <item_version>0</item_version> </dp_memory_map> </res> <node_label_latency class_id="51" tracking_level="0" version="0"> <count>23</count> <item_version>0</item_version> <item class_id="52" tracking_level="0" version="0"> <first>22</first> <second class_id="53" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>23</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>24</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>25</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>26</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>27</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>28</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>29</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>30</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>78</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>79</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>80</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>81</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>82</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>83</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>84</first> <second> <first>0</first> <second>1</second> </second> </item> <item> <first>85</first> <second> <first>2</first> <second>1</second> </second> </item> <item> <first>86</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>87</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>88</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>89</first> <second> <first>4</first> <second>2</second> </second> </item> <item> <first>90</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>91</first> <second> <first>7</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="54" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="55" tracking_level="0" version="0"> <first>92</first> <second class_id="56" tracking_level="0" version="0"> <first>0</first> <second>7</second> </second> </item> </bblk_ent_exit> <regions class_id="57" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="58" tracking_level="1" version="0" object_id="_417"> <region_name>my_ip_hls</region_name> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>92</item> </basic_blocks> <nodes> <count>70</count> <item_version>0</item_version> <item>22</item> <item>23</item> <item>24</item> <item>25</item> <item>26</item> <item>27</item> <item>28</item> <item>29</item> <item>30</item> <item>31</item> <item>32</item> <item>33</item> <item>34</item> <item>35</item> <item>36</item> <item>37</item> <item>38</item> <item>39</item> <item>40</item> <item>41</item> <item>42</item> <item>43</item> <item>44</item> <item>45</item> <item>46</item> <item>47</item> <item>48</item> <item>49</item> <item>50</item> <item>51</item> <item>52</item> <item>53</item> <item>54</item> <item>55</item> <item>56</item> <item>57</item> <item>58</item> <item>59</item> <item>60</item> <item>61</item> <item>62</item> <item>63</item> <item>64</item> <item>65</item> <item>66</item> <item>67</item> <item>68</item> <item>69</item> <item>70</item> <item>71</item> <item>72</item> <item>73</item> <item>74</item> <item>75</item> <item>76</item> <item>77</item> <item>78</item> <item>79</item> <item>80</item> <item>81</item> <item>82</item> <item>83</item> <item>84</item> <item>85</item> <item>86</item> <item>87</item> <item>88</item> <item>89</item> <item>90</item> <item>91</item> </nodes> <anchor_node>-1</anchor_node> <region_type>16</region_type> <interval>0</interval> <pipe_depth>0</pipe_depth> </item> </regions> <dp_fu_nodes class_id="59" tracking_level="0" version="0"> <count>22</count> <item_version>0</item_version> <item class_id="60" tracking_level="0" version="0"> <first>124</first> <second> <count>1</count> <item_version>0</item_version> <item>25</item> </second> </item> <item> <first>128</first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> <item> <first>132</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>136</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>140</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>144</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>148</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>154</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>160</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>166</first> <second> <count>2</count> <item_version>0</item_version> <item>85</item> <item>85</item> </second> </item> <item> <first>191</first> <second> <count>2</count> <item_version>0</item_version> <item>84</item> <item>84</item> </second> </item> <item> <first>207</first> <second> <count>3</count> <item_version>0</item_version> <item>89</item> <item>89</item> <item>89</item> </second> </item> <item> <first>223</first> <second> <count>1</count> <item_version>0</item_version> <item>78</item> </second> </item> <item> <first>236</first> <second> <count>1</count> <item_version>0</item_version> <item>79</item> </second> </item> <item> <first>246</first> <second> <count>1</count> <item_version>0</item_version> <item>90</item> </second> </item> <item> <first>259</first> <second> <count>1</count> <item_version>0</item_version> <item>80</item> </second> </item> <item> <first>266</first> <second> <count>1</count> <item_version>0</item_version> <item>81</item> </second> </item> <item> <first>271</first> <second> <count>1</count> <item_version>0</item_version> <item>82</item> </second> </item> <item> <first>276</first> <second> <count>1</count> <item_version>0</item_version> <item>83</item> </second> </item> <item> <first>281</first> <second> <count>1</count> <item_version>0</item_version> <item>86</item> </second> </item> <item> <first>286</first> <second> <count>1</count> <item_version>0</item_version> <item>87</item> </second> </item> <item> <first>291</first> <second> <count>1</count> <item_version>0</item_version> <item>88</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="62" tracking_level="0" version="0"> <count>12</count> <item_version>0</item_version> <item class_id="63" tracking_level="0" version="0"> <first>cnt0Reg_V_fu_281</first> <second> <count>1</count> <item_version>0</item_version> <item>86</item> </second> </item> <item> <first>cnt1Reg_V_fu_286</first> <second> <count>1</count> <item_version>0</item_version> <item>87</item> </second> </item> <item> <first>cnt2Reg_V_fu_291</first> <second> <count>1</count> <item_version>0</item_version> <item>88</item> </second> </item> <item> <first>rule0Reg_V_channel_fu_266</first> <second> <count>1</count> <item_version>0</item_version> <item>81</item> </second> </item> <item> <first>rule0_V_c1_fu_132</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>rule0_V_c_fu_144</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>rule1Reg_V_channel_fu_271</first> <second> <count>1</count> <item_version>0</item_version> <item>82</item> </second> </item> <item> <first>rule1_V_c2_fu_128</first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> <item> <first>rule1_V_c_fu_140</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>rule2Reg_V_channel_fu_276</first> <second> <count>1</count> <item_version>0</item_version> <item>83</item> </second> </item> <item> <first>rule2_V_c3_fu_124</first> <second> <count>1</count> <item_version>0</item_version> <item>25</item> </second> </item> <item> <first>rule2_V_c_fu_136</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> </dp_fu_nodes_expression> <dp_fu_nodes_module> <count>7</count> <item_version>0</item_version> <item> <first>StgValue_18_my_ip_hls_entry3_fu_223</first> <second> <count>1</count> <item_version>0</item_version> <item>78</item> </second> </item> <item> <first>StgValue_20_my_ip_hls_entry83_fu_236</first> <second> <count>1</count> <item_version>0</item_version> <item>79</item> </second> </item> <item> <first>StgValue_31_counters_out_fu_246</first> <second> <count>1</count> <item_version>0</item_version> <item>90</item> </second> </item> <item> <first>call_ret_rules_in_fu_259</first> <second> <count>1</count> <item_version>0</item_version> <item>80</item> </second> </item> <item> <first>grp_core_fu_166</first> <second> <count>2</count> <item_version>0</item_version> <item>85</item> <item>85</item> </second> </item> <item> <first>grp_ip2ps_fifo_fu_207</first> <second> <count>3</count> <item_version>0</item_version> <item>89</item> <item>89</item> <item>89</item> </second> </item> <item> <first>grp_ps2ip_fifo_fu_191</first> <second> <count>2</count> <item_version>0</item_version> <item>84</item> <item>84</item> </second> </item> </dp_fu_nodes_module> <dp_fu_nodes_io> <count>3</count> <item_version>0</item_version> <item> <first>rule0_V_read_read_fu_160</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>rule1_V_read_read_fu_154</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>rule2_V_read_read_fu_148</first> <second> <count>1</count> <item_version>0</item_version> <item>22</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="64" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_mem_port_nodes> <dp_reg_nodes> <count>6</count> <item_version>0</item_version> <item> <first>296</first> <second> <count>1</count> <item_version>0</item_version> <item>25</item> </second> </item> <item> <first>302</first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> <item> <first>308</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>314</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>320</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>326</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> </dp_reg_nodes> <dp_regname_nodes> <count>6</count> <item_version>0</item_version> <item> <first>rule0_V_c1_reg_308</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>rule0_V_c_reg_326</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>rule1_V_c2_reg_302</first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> <item> <first>rule1_V_c_reg_320</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>rule2_V_c3_reg_296</first> <second> <count>1</count> <item_version>0</item_version> <item>25</item> </second> </item> <item> <first>rule2_V_c_reg_314</first> <second> <count>1</count> <item_version>0</item_version> <item>28</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="65" tracking_level="0" version="0"> <count>12</count> <item_version>0</item_version> <item class_id="66" tracking_level="0" version="0"> <first>masterOut_V_data_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>89</item> </second> </item> </second> </item> <item> <first>masterOut_V_last_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>89</item> </second> </item> </second> </item> <item> <first>masterOut_V_strb_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>89</item> </second> </item> </second> </item> <item> <first>rule0_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>24</item> </second> </item> </second> </item> <item> <first>rule0cnt_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>90</item> </second> </item> </second> </item> <item> <first>rule1_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>23</item> </second> </item> </second> </item> <item> <first>rule1cnt_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>90</item> </second> </item> </second> </item> <item> <first>rule2_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>22</item> </second> </item> </second> </item> <item> <first>rule2cnt_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>90</item> </second> </item> </second> </item> <item> <first>slaveIn_V_data_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>84</item> </second> </item> </second> </item> <item> <first>slaveIn_V_last_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>84</item> </second> </item> </second> </item> <item> <first>slaveIn_V_strb_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>84</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core class_id="67" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </port2core> <node2core> <count>12</count> <item_version>0</item_version> <item class_id="68" tracking_level="0" version="0"> <first>25</first> <second>FIFO</second> </item> <item> <first>26</first> <second>FIFO</second> </item> <item> <first>27</first> <second>FIFO</second> </item> <item> <first>28</first> <second>FIFO</second> </item> <item> <first>29</first> <second>FIFO</second> </item> <item> <first>30</first> <second>FIFO</second> </item> <item> <first>81</first> <second>FIFO</second> </item> <item> <first>82</first> <second>FIFO</second> </item> <item> <first>83</first> <second>FIFO</second> </item> <item> <first>86</first> <second>FIFO</second> </item> <item> <first>87</first> <second>FIFO</second> </item> <item> <first>88</first> <second>FIFO</second> </item> </node2core> </syndb> </boost_serialization>
-- TITLE main body -- AUTHOR: John Self (UCI) -- DESCRIPTION driver routines for aflex. Calls drivers for all -- high level routines from other packages. -- $Header: /co/ua/self/arcadia/aflex/ada/src/RCS/mainS.a,v 1.5 90/01/12 15:20:14 self Exp Locker: self $ --*************************************************************************** -- This file is subject to the Arcadia License Agreement. -- -- (see notice in aflex.a) -- --*************************************************************************** -- aflex - tool to generate fast lexical analyzers package MAIN_BODY is procedure AFLEXEND(STATUS : in INTEGER); procedure AFLEXINIT; procedure READIN; procedure SET_UP_INITIAL_ALLOCATIONS; AFLEX_TERMINATE : exception; TERMINATION_STATUS : INTEGER; end MAIN_BODY;
with Loop_Optimization7_Pkg; use Loop_Optimization7_Pkg; package Loop_Optimization7 is type Arr is array (1..8) of Rec; function Conv (A : Arr) return Arr; end Loop_Optimization7;
----------------------------------------------------------------------- -- regtests -- Support for unit tests -- Copyright (C) 2009, 2010, 2017, 2018 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with ADO.Audits; with ADO.Sessions; with ADO.Sessions.Sources; package Regtests is -- Get the database manager to be used for the unit tests function Get_Controller return ADO.Sessions.Sources.Data_Source'Class; -- Get the readonly connection database to be used for the unit tests function Get_Database return ADO.Sessions.Session; -- Get the writeable connection database to be used for the unit tests function Get_Master_Database return ADO.Sessions.Master_Session; -- Set the audit manager on the factory. procedure Set_Audit_Manager (Manager : in ADO.Audits.Audit_Manager_Access); -- Initialize the test database procedure Initialize (Name : in String); end Regtests;
with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Ada.Text_IO; use Ada.Text_IO; with Ada.Calendar; use Ada.Calendar; with Ada.Calendar.Formatting; use Ada.Calendar.Formatting; package Display_Warning is Cancel : Boolean := False; procedure Warning (Message : String; Down : Integer := 0; D : Duration := 0.0); function GetYN (Message : String; Down : Integer := 0) return Boolean; end Display_Warning;
-- Copyright (C) 2019 Thierry Rascle <thierr26@free.fr> -- MIT license. Please refer to the LICENSE file. with Ada.Unchecked_Deallocation; package body Apsepp_Test_Node_Barrier is ---------------------------------------------------------------------------- function Test_Reporter_Proc_Name (Event_Kind : Test_Event_Kind) return String is Event_Kind_Str : String := Test_Event_Kind'Image (Event_Kind); begin for K in Event_Kind_Str'First + 1 .. Event_Kind_Str'Last loop if Event_Kind_Str(K - 1) /= '_' then Event_Kind_Str(K) := To_Lower (Event_Kind_Str(K)); end if; end loop; return "Report_" & Event_Kind_Str; end; ---------------------------------------------------------------------------- task body Test_Node_Barrier_Monitor is B : access Test_Node_Barrier; Period : Day_Duration; Cross_Count : Natural; begin accept Setup (Barrier : not null Test_Node_Barrier_Access; Monitoring_Period : Day_Duration := 0.7) do B := Barrier; Period := Monitoring_Period; Cross_Count := B.Cross_Count; end Setup; while not B.Completed loop delay Period; if B.Cross_Count = Cross_Count then B.Time_Out; end if; Cross_Count := B.Cross_Count; end loop; end Test_Node_Barrier_Monitor; ---------------------------------------------------------------------------- protected body Test_Node_Barrier is ----------------------------------------------------- function Permanently_Opened return Boolean is (case Permanent_Opening_Cause is when None => False, when Saturation | Overflow | Time_Out => True); ----------------------------------------------------- procedure Setup (Ch_I : not null Char_Name_Image_Func; T_T_C : not null Tag_To_Char_Func; C_T_C : not null Char_To_Tag_Func; V : not null Validate_Proc; Exp : not null Tag_Array_Access) is begin Char_Name_Image := Ch_I; Tag_To_Char := T_T_C; Char_To_Tag := C_T_C; Validate := V; Expected_Tag := Exp; Crossing_Count := Prot_Natural.Create (0); Permanent_Opening_Cause := None; Failed_Validation_Flag := False; end Setup; ----------------------------------------------------- function Cross_Condition (Char : ISO_646) return Boolean is use Prot_Natural; -- TODO: Write function Inc in Generic_Prot_Integer. <2019-06-13> Crossing_Count_Su : constant O_P_I_Type := Crossing_Count + Create (1); K : constant Positive := Val (Crossing_Count_Su); begin return Permanently_Opened or else Sat (Crossing_Count_Su) or else K > Expected_Tag'Length or else ( Tag_To_Char (Expected_Tag (K - 1 + Expected_Tag'First)) = Char ); end Cross_Condition; ----------------------------------------------------- entry Cross(for Char in ISO_646) (Event_Kind : Test_Event_Kind; Event_Data : Test_Event_Data) when Cross_Condition (Char) is use Prot_Natural; Entity_Name : constant String := "Apsepp_Test_Node_Barrier.Test_Node_Barrier.Cross"; C_D_T : constant Controlled_Debug_Tracer := Create_N (Entity_Name); Failed_Val : Boolean := False; function Msg_Pref return String is C_C_Str : String := Natural'Image (Val (Crossing_Count)); begin C_C_Str(1) := '#'; return "Crossing " & C_C_Str & Char_Name_Image (Char); end Msg_Pref; procedure Free is new Ada.Unchecked_Deallocation (Object => Exception_Occurrence, Name => Exception_Occurrence_Access); begin Inc (Crossing_Count); if not Permanently_Opened then if Sat (Crossing_Count) then Permanent_Opening_Cause := Saturation; -- Causes Permanently_Opened to be True from -- from now on. C_D_T.Trace ("Test node barrier saturated"); elsif Val (Crossing_Count) > Expected_Tag'Length then Permanent_Opening_Cause := Overflow; -- Ditto. Crossing_Count_On_Overflow := Val (Crossing_Count) - 1; C_D_T.Trace ("Test node barrier overflowed"); end if; end if; if not Permanently_Opened then declare Excep : Exception_Occurrence_Access := Event_Data.E; begin Validate (Val (Crossing_Count), Event_Kind, Event_Data, Char, Char_To_Tag, Msg_Pref); Free (Excep); -- Free the exception allocated by Save_Occurrence -- in the Report_ primitives of -- Test_Reporter_W_Barrier. exception when E : others => -- Probably -- Ada.Assertions.Assertion_Error. C_D_T.Trace (Msg_Pref & Exception_Message (E)); Failed_Validation_Flag := True; Failed_Val := True; end; end if; if not Failed_Val then C_D_T.Trace (Msg_Pref(Msg_Pref'First .. Msg_Pref'Last - 2) & (if Permanently_Opened then " (Permanently opened)" else "")); end if; end Cross; ----------------------------------------------------- procedure Time_Out is use Prot_Natural; Entity_Name : constant String := "Apsepp_Test_Node_Barrier.Test_Node_Barrier.Time_Out"; C_D_T : constant Controlled_Debug_Tracer := Create_N (Entity_Name); begin if not Permanently_Opened then Permanent_Opening_Cause := Time_Out; -- Causes Permanently_Opened to be True from now -- on. Crossing_Count_On_Time_Out := Val (Crossing_Count); C_D_T.Trace ("Test node barrier timed out"); end if; end Time_Out; ----------------------------------------------------- function Cross_Count return Natural is (Prot_Natural.Val (Crossing_Count)); ----------------------------------------------------- function Timed_Out return Boolean is (case Permanent_Opening_Cause is when Time_Out => True, when None | Saturation | Overflow => False); ----------------------------------------------------- function Cross_Count_On_Time_Out return Natural is (Crossing_Count_On_Time_Out); ----------------------------------------------------- function Saturated return Boolean is (case Permanent_Opening_Cause is when Saturation => True, when None | Time_Out | Overflow => False); ----------------------------------------------------- function Overflowed return Boolean is (case Permanent_Opening_Cause is when Overflow => True, when None | Time_Out | Saturation => False); ----------------------------------------------------- function Cross_Count_On_Overflow return Natural is (Crossing_Count_On_Overflow); ----------------------------------------------------- function Completed return Boolean is (Cross_Count = Expected_Tag'Length); ----------------------------------------------------- function Failed_Validation return Boolean is (Failed_Validation_Flag); ----------------------------------------------------- end Test_Node_Barrier; ---------------------------------------------------------------------------- not overriding procedure Setup (Obj : in out Test_Reporter_W_Barrier; B : not null Test_Node_Barrier_Access; Ch_I : not null Char_Name_Image_Func; T_T_C : not null Tag_To_Char_Func) is begin Obj.Barrier := B; Obj.Char_Name_Image := Ch_I; Obj.Tag_To_Char := T_T_C; end Setup; ----------------------------------------------------- not overriding function Arriv_To_Cross_Message (Obj : Test_Reporter_W_Barrier; Operation_Name : String; Node_Tag : Tag) return String is ("Apsepp_Test_Node_Barrier." & Operation_Name & Obj.Char_Name_Image (Obj.Tag_To_Char (Node_Tag)) & "Arriving to test node barrier"); ----------------------------------------------------- overriding procedure Report_Failed_Child_Test_Node_Access (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag; Previous_Child_Tag : Tag; E : Exception_Occurrence) is Event_Kind : constant Test_Event_Kind := Failed_Child_Test_Node_Access; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (E => Save_Occurrence (E), Previous_Child_Tag => Previous_Child_Tag, others => <>)); end Report_Failed_Child_Test_Node_Access; ----------------------------------------------------- overriding procedure Report_Unexpected_Node_Cond_Check_Error (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag; E : Exception_Occurrence) is Event_Kind : constant Test_Event_Kind := Unexpected_Node_Cond_Check_Error; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (E => Save_Occurrence (E), others => <>)); end Report_Unexpected_Node_Cond_Check_Error; ----------------------------------------------------- overriding procedure Report_Unexpected_Node_Run_Error (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag; E : Exception_Occurrence) is Event_Kind : constant Test_Event_Kind := Unexpected_Node_Run_Error; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (E => Save_Occurrence (E), others => <>)); end Report_Unexpected_Node_Run_Error; ----------------------------------------------------- overriding procedure Report_Node_Cond_Check_Start (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag) is Event_Kind : constant Test_Event_Kind := Node_Cond_Check_Start; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (others => <>)); end Report_Node_Cond_Check_Start; ----------------------------------------------------- overriding procedure Report_Passed_Node_Cond_Check (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag) is Event_Kind : constant Test_Event_Kind := Passed_Node_Cond_Check; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (others => <>)); end Report_Passed_Node_Cond_Check; ----------------------------------------------------- overriding procedure Report_Failed_Node_Cond_Check (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag) is Event_Kind : constant Test_Event_Kind := Failed_Node_Cond_Check; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (others => <>)); end Report_Failed_Node_Cond_Check; ----------------------------------------------------- overriding procedure Report_Passed_Node_Cond_Assert (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag) is Event_Kind : constant Test_Event_Kind := Passed_Node_Cond_Assert; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (others => <>)); end Report_Passed_Node_Cond_Assert; ----------------------------------------------------- overriding procedure Report_Failed_Node_Cond_Assert (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag) is Event_Kind : constant Test_Event_Kind := Failed_Node_Cond_Assert; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (others => <>)); end Report_Failed_Node_Cond_Assert; ----------------------------------------------------- overriding procedure Report_Node_Run_Start (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag) is Event_Kind : constant Test_Event_Kind := Node_Run_Start; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (others => <>)); end Report_Node_Run_Start; ----------------------------------------------------- overriding procedure Report_Test_Routine_Start (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag; K : Test_Node_Class.Test_Routine_Count) is Event_Kind : constant Test_Event_Kind := Test_Routine_Start; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (R_Index => K, others => <>)); end Report_Test_Routine_Start; ----------------------------------------------------- overriding procedure Report_Test_Routines_Cancellation (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag; First_K, Last_K : Test_Node_Class.Test_Routine_Count) is Event_Kind : constant Test_Event_Kind := Test_Routines_Cancellation; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); pragma Unreferenced (First_K); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (R_Index => Last_K, others => <>)); end Report_Test_Routines_Cancellation; ----------------------------------------------------- overriding procedure Report_Failed_Test_Routine_Access (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag; K : Test_Node_Class.Test_Routine_Count; E : Exception_Occurrence) is Event_Kind : constant Test_Event_Kind := Failed_Test_Routine_Access; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (E => Save_Occurrence (E), R_Index => K, others => <>)); end Report_Failed_Test_Routine_Access; ----------------------------------------------------- overriding procedure Report_Failed_Test_Routine_Setup (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag; K : Test_Node_Class.Test_Routine_Count; E : Exception_Occurrence) is Event_Kind : constant Test_Event_Kind := Failed_Test_Routine_Setup; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (E => Save_Occurrence (E), R_Index => K, others => <>)); end Report_Failed_Test_Routine_Setup; ----------------------------------------------------- overriding procedure Report_Passed_Test_Assert (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag; K : Test_Node_Class.Test_Routine_Count; Assert_Num_Avail : Boolean; Assert_Num : Test_Node_Class.Test_Assert_Count) is Event_Kind : constant Test_Event_Kind := Passed_Test_Assert; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (if Assert_Num_Avail then (R_Index => K, Assert_Num => Assert_Num, others => <>) else (R_Index => K, others => <>))); end Report_Passed_Test_Assert; ----------------------------------------------------- overriding procedure Report_Failed_Test_Assert (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag; K : Test_Node_Class.Test_Routine_Count; Assert_Num_Avail : Boolean; Assert_Num : Test_Node_Class.Test_Assert_Count; E : Exception_Occurrence) is Event_Kind : constant Test_Event_Kind := Failed_Test_Assert; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (if Assert_Num_Avail then (E => Save_Occurrence (E), R_Index => K, Assert_Num => Assert_Num, others => <>) else (E => Save_Occurrence (E), R_Index => K, others => <>))); end Report_Failed_Test_Assert; ----------------------------------------------------- overriding procedure Report_Unexpected_Routine_Exception (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag; K : Test_Node_Class.Test_Routine_Count; E : Exception_Occurrence) is Event_Kind : constant Test_Event_Kind := Unexpected_Routine_Exception; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (E => Save_Occurrence (E), R_Index => K, others => <>)); end Report_Unexpected_Routine_Exception; ----------------------------------------------------- overriding procedure Report_Passed_Test_Routine (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag; K : Test_Node_Class.Test_Routine_Count) is Event_Kind : constant Test_Event_Kind := Passed_Test_Routine; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (R_Index => K, others => <>)); end Report_Passed_Test_Routine; ----------------------------------------------------- overriding procedure Report_Failed_Test_Routine (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag; K : Test_Node_Class.Test_Routine_Count) is Event_Kind : constant Test_Event_Kind := Failed_Test_Routine; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (R_Index => K, others => <>)); end Report_Failed_Test_Routine; ----------------------------------------------------- overriding procedure Report_Passed_Node_Run (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag) is Event_Kind : constant Test_Event_Kind := Passed_Node_Run; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (others => <>)); end Report_Passed_Node_Run; ----------------------------------------------------- overriding procedure Report_Failed_Node_Run (Obj : in out Test_Reporter_W_Barrier; Node_Tag : Tag) is Event_Kind : constant Test_Event_Kind := Failed_Node_Run; Proc_Name : constant String := Test_Reporter_Proc_Name (Event_Kind); begin Obj.C_D_T.Trace (Test_Reporter_W_Barrier'Class (Obj).Arriv_To_Cross_Message (Proc_Name, Node_Tag)); Obj.Barrier.Cross (Obj.Tag_To_Char (Node_Tag)) (Event_Kind, (others => <>)); end Report_Failed_Node_Run; ---------------------------------------------------------------------------- end Apsepp_Test_Node_Barrier;
with Giza.Widgets.Frame; use Giza.Widgets.Frame; with Giza.Graphics; use Giza.Graphics; with Giza.Events; use Giza.Events; package Power_Phase_Widget is subtype PP_Range is Natural range 0 .. 100; type PP_Widget is new Gframe with private; overriding procedure Draw (This : in out PP_Widget; Ctx : in out Context'Class; Force : Boolean := True); overriding function On_Event (This : in out PP_Widget; Evt : Event_Not_Null_Ref) return Boolean; procedure Set_Ignition (This : in out PP_Widget; Val : PP_Range); procedure Set_Duration (This : in out PP_Widget; Val : PP_Range); private type PP_Widget is new Gframe with record Ignition : PP_Range := 25; Duration : PP_Range := 50; end record; end Power_Phase_Widget;
-- This spec has been automatically generated from STM32L5x2.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package STM32_SVD.COMP is pragma Preelaborate; --------------- -- Registers -- --------------- subtype COMP1_CSR_COMP1_PWRMODE_Field is HAL.UInt2; subtype COMP1_CSR_COMP1_INMSEL_Field is HAL.UInt3; subtype COMP1_CSR_COMP1_HYST_Field is HAL.UInt2; subtype COMP1_CSR_COMP1_BLANKING_Field is HAL.UInt3; -- Comparator 1 control and status register type COMP1_CSR_Register is record -- Comparator 1 enable bit COMP1_EN : Boolean := False; -- unspecified Reserved_1_1 : HAL.Bit := 16#0#; -- Power Mode of the comparator 1 COMP1_PWRMODE : COMP1_CSR_COMP1_PWRMODE_Field := 16#0#; -- Comparator 1 Input Minus connection configuration bit COMP1_INMSEL : COMP1_CSR_COMP1_INMSEL_Field := 16#0#; -- Comparator1 input plus selection bit COMP1_INPSEL : Boolean := False; -- unspecified Reserved_8_14 : HAL.UInt7 := 16#0#; -- Comparator 1 polarity selection bit COMP1_POLARITY : Boolean := False; -- Comparator 1 hysteresis selection bits COMP1_HYST : COMP1_CSR_COMP1_HYST_Field := 16#0#; -- Comparator 1 blanking source selection bits COMP1_BLANKING : COMP1_CSR_COMP1_BLANKING_Field := 16#0#; -- unspecified Reserved_21_21 : HAL.Bit := 16#0#; -- Scaler bridge enable COMP1_BRGEN : Boolean := False; -- Voltage scaler enable bit COMP1_SCALEN : Boolean := False; -- unspecified Reserved_24_29 : HAL.UInt6 := 16#0#; -- Read-only. Comparator 1 output status bit COMP1_VALUE : Boolean := False; -- Write-only. COMP1_CSR register lock bit COMP1_LOCK : Boolean := False; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for COMP1_CSR_Register use record COMP1_EN at 0 range 0 .. 0; Reserved_1_1 at 0 range 1 .. 1; COMP1_PWRMODE at 0 range 2 .. 3; COMP1_INMSEL at 0 range 4 .. 6; COMP1_INPSEL at 0 range 7 .. 7; Reserved_8_14 at 0 range 8 .. 14; COMP1_POLARITY at 0 range 15 .. 15; COMP1_HYST at 0 range 16 .. 17; COMP1_BLANKING at 0 range 18 .. 20; Reserved_21_21 at 0 range 21 .. 21; COMP1_BRGEN at 0 range 22 .. 22; COMP1_SCALEN at 0 range 23 .. 23; Reserved_24_29 at 0 range 24 .. 29; COMP1_VALUE at 0 range 30 .. 30; COMP1_LOCK at 0 range 31 .. 31; end record; subtype COMP2_CSR_COMP2_PWRMODE_Field is HAL.UInt2; subtype COMP2_CSR_COMP2_INMSEL_Field is HAL.UInt3; subtype COMP2_CSR_COMP2_HYST_Field is HAL.UInt2; subtype COMP2_CSR_COMP2_BLANKING_Field is HAL.UInt3; -- Comparator 2 control and status register type COMP2_CSR_Register is record -- Comparator 2 enable bit COMP2_EN : Boolean := False; -- unspecified Reserved_1_1 : HAL.Bit := 16#0#; -- Power Mode of the comparator 2 COMP2_PWRMODE : COMP2_CSR_COMP2_PWRMODE_Field := 16#0#; -- Comparator 2 Input Minus connection configuration bit COMP2_INMSEL : COMP2_CSR_COMP2_INMSEL_Field := 16#0#; -- Comparator 2 Input Plus connection configuration bit COMP2_INPSEL : Boolean := False; -- unspecified Reserved_8_8 : HAL.Bit := 16#0#; -- Windows mode selection bit COMP2_WINMODE : Boolean := False; -- unspecified Reserved_10_14 : HAL.UInt5 := 16#0#; -- Comparator 2 polarity selection bit COMP2_POLARITY : Boolean := False; -- Comparator 2 hysteresis selection bits COMP2_HYST : COMP2_CSR_COMP2_HYST_Field := 16#0#; -- Comparator 2 blanking source selection bits COMP2_BLANKING : COMP2_CSR_COMP2_BLANKING_Field := 16#0#; -- unspecified Reserved_21_21 : HAL.Bit := 16#0#; -- Scaler bridge enable COMP2_BRGEN : Boolean := False; -- Voltage scaler enable bit COMP2_SCALEN : Boolean := False; -- unspecified Reserved_24_29 : HAL.UInt6 := 16#0#; -- Read-only. Comparator 2 output status bit COMP2_VALUE : Boolean := False; -- Write-only. COMP2_CSR register lock bit COMP2_LOCK : Boolean := False; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for COMP2_CSR_Register use record COMP2_EN at 0 range 0 .. 0; Reserved_1_1 at 0 range 1 .. 1; COMP2_PWRMODE at 0 range 2 .. 3; COMP2_INMSEL at 0 range 4 .. 6; COMP2_INPSEL at 0 range 7 .. 7; Reserved_8_8 at 0 range 8 .. 8; COMP2_WINMODE at 0 range 9 .. 9; Reserved_10_14 at 0 range 10 .. 14; COMP2_POLARITY at 0 range 15 .. 15; COMP2_HYST at 0 range 16 .. 17; COMP2_BLANKING at 0 range 18 .. 20; Reserved_21_21 at 0 range 21 .. 21; COMP2_BRGEN at 0 range 22 .. 22; COMP2_SCALEN at 0 range 23 .. 23; Reserved_24_29 at 0 range 24 .. 29; COMP2_VALUE at 0 range 30 .. 30; COMP2_LOCK at 0 range 31 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Comparator type COMP_Peripheral is record -- Comparator 1 control and status register COMP1_CSR : aliased COMP1_CSR_Register; -- Comparator 2 control and status register COMP2_CSR : aliased COMP2_CSR_Register; end record with Volatile; for COMP_Peripheral use record COMP1_CSR at 16#0# range 0 .. 31; COMP2_CSR at 16#4# range 0 .. 31; end record; -- Comparator COMP_Periph : aliased COMP_Peripheral with Import, Address => System'To_Address (16#40010200#); -- Comparator SEC_COMP_Periph : aliased COMP_Peripheral with Import, Address => System'To_Address (16#50010200#); end STM32_SVD.COMP;
------------------------------------------------------------------------------ -- -- -- GNAT RUNTIME COMPONENTS -- -- -- -- A D A . N U M E R I C S . G E N E R I C _ C O M P L E X _ T Y P E S -- -- -- -- S p e c -- -- -- -- $Revision: 2 $ -- -- -- -- This specification is adapted from the Ada Reference Manual for use with -- -- GNAT. In accordance with the copyright of that document, you can freely -- -- copy and modify this specification, provided that if you redistribute a -- -- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ generic type Real is digits <>; package Ada.Numerics.Generic_Complex_Types is pragma Pure (Generic_Complex_Types); type Complex is record Re, Im : Real'Base; end record; type Imaginary is private; i : constant Imaginary; j : constant Imaginary; function Re (X : Complex) return Real'Base; function Im (X : Complex) return Real'Base; function Im (X : Imaginary) return Real'Base; procedure Set_Re (X : in out Complex; Re : in Real'Base); procedure Set_Im (X : in out Complex; Im : in Real'Base); procedure Set_Im (X : out Imaginary; Im : in Real'Base); function Compose_From_Cartesian (Re, Im : Real'Base) return Complex; function Compose_From_Cartesian (Re : Real'Base) return Complex; function Compose_From_Cartesian (Im : Imaginary) return Complex; function Modulus (X : Complex) return Real'Base; function "abs" (Right : Complex) return Real'Base renames Modulus; function Argument (X : Complex) return Real'Base; function Argument (X : Complex; Cycle : Real'Base) return Real'Base; function Compose_From_Polar ( Modulus, Argument : Real'Base) return Complex; function Compose_From_Polar ( Modulus, Argument, Cycle : Real'Base) return Complex; function "+" (Right : Complex) return Complex; function "-" (Right : Complex) return Complex; function Conjugate (X : Complex) return Complex; function "+" (Left, Right : Complex) return Complex; function "-" (Left, Right : Complex) return Complex; function "*" (Left, Right : Complex) return Complex; function "/" (Left, Right : Complex) return Complex; function "**" (Left : Complex; Right : Integer) return Complex; function "+" (Right : Imaginary) return Imaginary; function "-" (Right : Imaginary) return Imaginary; function Conjugate (X : Imaginary) return Imaginary renames "-"; function "abs" (Right : Imaginary) return Real'Base; function "+" (Left, Right : Imaginary) return Imaginary; function "-" (Left, Right : Imaginary) return Imaginary; function "*" (Left, Right : Imaginary) return Real'Base; function "/" (Left, Right : Imaginary) return Real'Base; function "**" (Left : Imaginary; Right : Integer) return Complex; function "<" (Left, Right : Imaginary) return Boolean; function "<=" (Left, Right : Imaginary) return Boolean; function ">" (Left, Right : Imaginary) return Boolean; function ">=" (Left, Right : Imaginary) return Boolean; function "+" (Left : Complex; Right : Real'Base) return Complex; function "+" (Left : Real'Base; Right : Complex) return Complex; function "-" (Left : Complex; Right : Real'Base) return Complex; function "-" (Left : Real'Base; Right : Complex) return Complex; function "*" (Left : Complex; Right : Real'Base) return Complex; function "*" (Left : Real'Base; Right : Complex) return Complex; function "/" (Left : Complex; Right : Real'Base) return Complex; function "/" (Left : Real'Base; Right : Complex) return Complex; function "+" (Left : Complex; Right : Imaginary) return Complex; function "+" (Left : Imaginary; Right : Complex) return Complex; function "-" (Left : Complex; Right : Imaginary) return Complex; function "-" (Left : Imaginary; Right : Complex) return Complex; function "*" (Left : Complex; Right : Imaginary) return Complex; function "*" (Left : Imaginary; Right : Complex) return Complex; function "/" (Left : Complex; Right : Imaginary) return Complex; function "/" (Left : Imaginary; Right : Complex) return Complex; function "+" (Left : Imaginary; Right : Real'Base) return Complex; function "+" (Left : Real'Base; Right : Imaginary) return Complex; function "-" (Left : Imaginary; Right : Real'Base) return Complex; function "-" (Left : Real'Base; Right : Imaginary) return Complex; function "*" (Left : Imaginary; Right : Real'Base) return Imaginary; function "*" (Left : Real'Base; Right : Imaginary) return Imaginary; function "/" (Left : Imaginary; Right : Real'Base) return Imaginary; function "/" (Left : Real'Base; Right : Imaginary) return Imaginary; private type Imaginary is new Real'Base; i : constant Imaginary := 1.0; j : constant Imaginary := 1.0; pragma Inline ("+"); pragma Inline ("-"); pragma Inline ("*"); pragma Inline ("<"); pragma Inline ("<="); pragma Inline (">"); pragma Inline (">="); pragma Inline ("abs"); pragma Inline (Compose_From_Cartesian); pragma Inline (Conjugate); pragma Inline (Im); pragma Inline (Re); pragma Inline (Set_Im); pragma Inline (Set_Re); end Ada.Numerics.Generic_Complex_Types;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- A L I -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package defines the internal data structures used for representation -- of Ada Library Information (ALI) acquired from the ALI files generated -- by the front end. with Casing; use Casing; with Gnatvsn; use Gnatvsn; with Namet; use Namet; with Rident; use Rident; with Table; with Types; use Types; with GNAT.HTable; use GNAT.HTable; package ALI is -------------- -- Id Types -- -------------- -- The various entries are stored in tables with distinct subscript ranges. -- The following type definitions show the ranges used for the subscripts -- (Id values) for the various tables. type ALI_Id is range 0 .. 999_999; -- Id values used for ALIs table entries type Unit_Id is range 1_000_000 .. 1_999_999; -- Id values used for Unit table entries type With_Id is range 2_000_000 .. 2_999_999; -- Id values used for Withs table entries type Arg_Id is range 3_000_000 .. 3_999_999; -- Id values used for argument table entries type Sdep_Id is range 4_000_000 .. 4_999_999; -- Id values used for Sdep table entries type Source_Id is range 5_000_000 .. 5_999_999; -- Id values used for Source table entries type Interrupt_State_Id is range 6_000_000 .. 6_999_999; -- Id values used for Interrupt_State table entries type Priority_Specific_Dispatching_Id is range 7_000_000 .. 7_999_999; -- Id values used for Priority_Specific_Dispatching table entries -------------------- -- ALI File Table -- -------------------- -- Each ALI file read generates an entry in the ALIs table No_ALI_Id : constant ALI_Id := ALI_Id'First; -- Special value indicating no ALI entry First_ALI_Entry : constant ALI_Id := No_ALI_Id + 1; -- Id of first actual entry in table type Main_Program_Type is (None, Proc, Func); -- Indicator of whether unit can be used as main program type ALIs_Record is record Afile : File_Name_Type; -- Name of ALI file Ofile_Full_Name : File_Name_Type; -- Full name of object file corresponding to the ALI file Sfile : File_Name_Type; -- Name of source file that generates this ALI file (which is equal -- to the name of the source file in the first unit table entry for -- this ALI file, since the body if present is always first). Ver : String (1 .. Ver_Len_Max); -- Value of library version (V line in ALI file). Not set if -- V lines are ignored as a result of the Ignore_Lines parameter. Ver_Len : Natural; -- Length of characters stored in Ver. Not set if V lines are ignored as -- a result of the Ignore_Lines parameter. SAL_Interface : Boolean; -- Set True when this is an interface to a standalone library First_Unit : Unit_Id; -- Id of first Unit table entry for this file Last_Unit : Unit_Id; -- Id of last Unit table entry for this file First_Sdep : Sdep_Id; -- Id of first Sdep table entry for this file Last_Sdep : Sdep_Id; -- Id of last Sdep table entry for this file Main_Program : Main_Program_Type; -- Indicator of whether first unit can be used as main program. Not set -- if 'M' appears in Ignore_Lines. Main_Priority : Int; -- Indicates priority value if Main_Program field indicates that this -- can be a main program. A value of -1 (No_Main_Priority) indicates -- that no parameter was found, or no M line was present. Not set if -- 'M' appears in Ignore_Lines. Main_CPU : Int; -- Indicates processor if Main_Program field indicates that this can -- be a main program. A value of -1 (No_Main_CPU) indicates that no C -- parameter was found, or no M line was present. Not set if 'M' appears -- in Ignore_Lines. Time_Slice_Value : Int; -- Indicates value of time slice parameter from T=xxx on main program -- line. A value of -1 indicates that no T=xxx parameter was found, or -- no M line was present. Not set if 'M' appears in Ignore_Lines. Allocator_In_Body : Boolean; -- Set True if an AB switch appears on the main program line. False -- if no M line, or AB not present, or 'M appears in Ignore_Lines. WC_Encoding : Character; -- Wide character encoding if main procedure. Otherwise not relevant. -- Not set if 'M' appears in Ignore_Lines. Locking_Policy : Character; -- Indicates locking policy for units in this file. Space means tasking -- was not used, or that no Locking_Policy pragma was present or that -- this is a language defined unit. Otherwise set to first character -- (upper case) of policy name. Not set if 'P' appears in Ignore_Lines. Queuing_Policy : Character; -- Indicates queuing policy for units in this file. Space means tasking -- was not used, or that no Queuing_Policy pragma was present or that -- this is a language defined unit. Otherwise set to first character -- (upper case) of policy name. Not set if 'P' appears in Ignore_Lines. Task_Dispatching_Policy : Character; -- Indicates task dispatching policy for units in this file. Space means -- tasking was not used, or that no Task_Dispatching_Policy pragma was -- present or that this is a language defined unit. Otherwise set to -- first character (upper case) of policy name. Not set if 'P' appears -- in Ignore_Lines. Compile_Errors : Boolean; -- Set to True if compile errors for unit. Note that No_Object will -- always be set as well in this case. Not set if 'P' appears in -- Ignore_Lines. Float_Format : Character; -- Set to float format (set to I if no float-format given). Not set if -- 'P' appears in Ignore_Lines. No_Object : Boolean; -- Set to True if no object file generated. Not set if 'P' appears in -- Ignore_Lines. Normalize_Scalars : Boolean; -- Set to True if file was compiled with Normalize_Scalars. Not set if -- 'P' appears in Ignore_Lines. Unit_Exception_Table : Boolean; -- Set to True if unit exception table pointer generated. Not set if 'P' -- appears in Ignore_Lines. Zero_Cost_Exceptions : Boolean; -- Set to True if file was compiled with zero cost exceptions. Not set -- if 'P' appears in Ignore_Lines. Restrictions : Restrictions_Info; -- Restrictions information reconstructed from R lines First_Interrupt_State : Interrupt_State_Id; Last_Interrupt_State : Interrupt_State_Id'Base; -- These point to the first and last entries in the interrupt state -- table for this unit. If no entries, then Last_Interrupt_State = -- First_Interrupt_State - 1 (that's why the 'Base reference is there, -- it can be one less than the lower bound of the subtype). Not set if -- 'I' appears in Ignore_Lines First_Specific_Dispatching : Priority_Specific_Dispatching_Id; Last_Specific_Dispatching : Priority_Specific_Dispatching_Id'Base; -- These point to the first and last entries in the priority specific -- dispatching table for this unit. If there are no entries, then -- Last_Specific_Dispatching = First_Specific_Dispatching - 1. That -- is why the 'Base reference is there, it can be one less than the -- lower bound of the subtype. Not set if 'S' appears in Ignore_Lines. end record; No_Main_Priority : constant Int := -1; -- Code for no main priority set No_Main_CPU : constant Int := -1; -- Code for no main cpu set package ALIs is new Table.Table ( Table_Component_Type => ALIs_Record, Table_Index_Type => ALI_Id, Table_Low_Bound => First_ALI_Entry, Table_Initial => 500, Table_Increment => 200, Table_Name => "ALIs"); ---------------- -- Unit Table -- ---------------- -- Each unit within an ALI file generates an entry in the unit table No_Unit_Id : constant Unit_Id := Unit_Id'First; -- Special value indicating no unit table entry First_Unit_Entry : constant Unit_Id := No_Unit_Id + 1; -- Id of first actual entry in table type Unit_Type is (Is_Spec, Is_Body, Is_Spec_Only, Is_Body_Only); -- Indicates type of entry, if both body and spec appear in the ALI file, -- then the first unit is marked Is_Body, and the second is marked Is_Spec. -- If only a spec appears, then it is marked as Is_Spec_Only, and if only -- a body appears, then it is marked Is_Body_Only). subtype Version_String is String (1 .. 8); -- Version string, taken from unit record type Unit_Record is record My_ALI : ALI_Id; -- Corresponding ALI entry Uname : Unit_Name_Type; -- Name of Unit Sfile : File_Name_Type; -- Name of source file Preelab : Boolean; -- Indicates presence of PR parameter for a preelaborated package No_Elab : Boolean; -- Indicates presence of NE parameter for a unit that has does not -- have an elaboration routine (since it has no elaboration code). Pure : Boolean; -- Indicates presence of PU parameter for a package having pragma Pure Dynamic_Elab : Boolean; -- Set to True if the unit was compiled with dynamic elaboration checks -- (i.e. either -gnatE or pragma Elaboration_Checks (RM) was used to -- compile the unit). Elaborate_Body : Boolean; -- Indicates presence of EB parameter for a package which has a pragma -- Elaborate_Body, and also for generic package instantiations. Set_Elab_Entity : Boolean; -- Indicates presence of EE parameter for a unit which has an -- elaboration entity which must be set true as part of the -- elaboration of the entity. Has_RACW : Boolean; -- Indicates presence of RA parameter for a package that declares at -- least one Remote Access to Class_Wide (RACW) object. Remote_Types : Boolean; -- Indicates presence of RT parameter for a package which has a -- pragma Remote_Types. Shared_Passive : Boolean; -- Indicates presence of SP parameter for a package which has a pragma -- Shared_Passive. RCI : Boolean; -- Indicates presence of RC parameter for a package which has a pragma -- Remote_Call_Interface. Predefined : Boolean; -- Indicates if unit is language predefined (or a child of such a unit) Internal : Boolean; -- Indicates if unit is an internal unit (or a child of such a unit) First_With : With_Id; -- Id of first withs table entry for this file Last_With : With_Id; -- Id of last withs table entry for this file First_Arg : Arg_Id; -- Id of first args table entry for this file Last_Arg : Arg_Id; -- Id of last args table entry for this file Utype : Unit_Type; -- Type of entry Is_Generic : Boolean; -- True for generic unit (i.e. a generic declaration, or a generic -- body). False for a non-generic unit. Unit_Kind : Character; -- Indicates the nature of the unit. 'p' for Packages and 's' for -- subprograms. Version : Version_String; -- Version of unit Icasing : Casing_Type; -- Indicates casing of identifiers in source file for this unit. This -- is used for informational output, and also for constructing the main -- unit if it is being built in Ada. Kcasing : Casing_Type; -- Indicates casing of keywords in source file for this unit. This is -- used for informational output, and also for constructing the main -- unit if it is being built in Ada. Elab_Position : aliased Natural; -- Initialized to zero. Set non-zero when a unit is chosen and -- placed in the elaboration order. The value represents the -- ordinal position in the elaboration order. Init_Scalars : Boolean; -- Set True if IS qualifier appears in ALI file, indicating that -- an Initialize_Scalars pragma applies to the unit. SAL_Interface : Boolean; -- Set True when this is an interface to a standalone library Directly_Scanned : Boolean; -- True iff it is a unit from an ALI file specified to gnatbind Body_Needed_For_SAL : Boolean; -- Indicates that the source for the body of the unit (subprogram, -- package, or generic unit) must be included in a standalone library. Elaborate_Body_Desirable : Boolean; -- Indicates that the front end elaboration circuitry decided that it -- would be a good idea if this package had Elaborate_Body. The binder -- will attempt, but does not promise, to place the elaboration call -- for the body right after the call for the spec, or at least as close -- together as possible. Optimize_Alignment : Character; -- Optimize_Alignment setting. Set to L/S/T/O for OL/OS/OT/OO present end record; package Units is new Table.Table ( Table_Component_Type => Unit_Record, Table_Index_Type => Unit_Id, Table_Low_Bound => First_Unit_Entry, Table_Initial => 100, Table_Increment => 200, Table_Name => "Unit"); --------------------------- -- Interrupt State Table -- --------------------------- -- An entry is made in this table for each I (interrupt state) line -- encountered in the input ALI file. The First/Last_Interrupt_Id -- fields of the ALI file entry show the range of entries defined -- within a particular ALI file. type Interrupt_State_Record is record Interrupt_Id : Nat; -- Id from interrupt state entry Interrupt_State : Character; -- State from interrupt state entry ('u'/'r'/'s') IS_Pragma_Line : Nat; -- Line number of Interrupt_State pragma end record; package Interrupt_States is new Table.Table ( Table_Component_Type => Interrupt_State_Record, Table_Index_Type => Interrupt_State_Id'Base, Table_Low_Bound => Interrupt_State_Id'First, Table_Initial => 100, Table_Increment => 200, Table_Name => "Interrupt_States"); ----------------------------------------- -- Priority Specific Dispatching Table -- ----------------------------------------- -- An entry is made in this table for each S (priority specific -- dispatching) line encountered in the input ALI file. The -- First/Last_Specific_Dispatching_Id fields of the ALI file -- entry show the range of entries defined within a particular -- ALI file. type Specific_Dispatching_Record is record Dispatching_Policy : Character; -- First character (upper case) of the corresponding policy name First_Priority : Nat; -- Lower bound of the priority range to which the specified dispatching -- policy applies. Last_Priority : Nat; -- Upper bound of the priority range to which the specified dispatching -- policy applies. PSD_Pragma_Line : Nat; -- Line number of Priority_Specific_Dispatching pragma end record; package Specific_Dispatching is new Table.Table ( Table_Component_Type => Specific_Dispatching_Record, Table_Index_Type => Priority_Specific_Dispatching_Id'Base, Table_Low_Bound => Priority_Specific_Dispatching_Id'First, Table_Initial => 100, Table_Increment => 200, Table_Name => "Priority_Specific_Dispatching"); -------------- -- Switches -- -------------- -- These switches record status information about ali files that -- have been read, for quick reference without searching tables. -- Note: a switch will be left set at its default value if the line -- which might otherwise set it is ignored (from Ignore_Lines). Dynamic_Elaboration_Checks_Specified : Boolean := False; -- Set to False by Initialize_ALI. Set to True if Scan_ALI reads -- a unit for which dynamic elaboration checking is enabled. Float_Format_Specified : Character := ' '; -- Set to blank by Initialize_ALI. Set to appropriate float format -- character (V or I, see Opt.Float_Format) if an ali file that -- is read contains an F line setting the floating point format. Initialize_Scalars_Used : Boolean := False; -- Set True if an ali file contains the Initialize_Scalars flag Locking_Policy_Specified : Character := ' '; -- Set to blank by Initialize_ALI. Set to the appropriate locking policy -- character if an ali file contains a P line setting the locking policy. No_Normalize_Scalars_Specified : Boolean := False; -- Set to False by Initialize_ALI. Set to True if an ali file indicates -- that the file was compiled without normalize scalars. No_Object_Specified : Boolean := False; -- Set to False by Initialize_ALI. Set to True if an ali file contains -- the No_Object flag. Normalize_Scalars_Specified : Boolean := False; -- Set to False by Initialize_ALI. Set to True if an ali file indicates -- that the file was compiled in Normalize_Scalars mode. Queuing_Policy_Specified : Character := ' '; -- Set to blank by Initialize_ALI. Set to the appropriate queuing policy -- character if an ali file contains a P line setting the queuing policy. Cumulative_Restrictions : Restrictions_Info := No_Restrictions; -- This variable records the cumulative contributions of R lines in all -- ali files, showing whether a restriction pragma exists anywhere, and -- accumulating the aggregate knowledge of violations. Stack_Check_Switch_Set : Boolean := False; -- Set to True if at least one ALI file contains '-fstack-check' in its -- argument list. Static_Elaboration_Model_Used : Boolean := False; -- Set to False by Initialize_ALI. Set to True if any ALI file for a -- non-internal unit compiled with the static elaboration model is -- encountered. Task_Dispatching_Policy_Specified : Character := ' '; -- Set to blank by Initialize_ALI. Set to the appropriate task dispatching -- policy character if an ali file contains a P line setting the -- task dispatching policy. Unreserve_All_Interrupts_Specified : Boolean := False; -- Set to False by Initialize_ALI. Set to True if an ali file is read that -- has P line specifying unreserve all interrupts mode. Zero_Cost_Exceptions_Specified : Boolean := False; -- Set to False by Initialize_ALI. Set to True if an ali file is read that -- has a P line specifying the generation of zero cost exceptions. ----------------- -- Withs Table -- ----------------- -- Each With line (W line) in an ALI file generates a Withs table entry -- Note: there will be no entries in this table if 'W' lines are ignored No_With_Id : constant With_Id := With_Id'First; -- Special value indicating no withs table entry First_With_Entry : constant With_Id := No_With_Id + 1; -- Id of first actual entry in table type With_Record is record Uname : Unit_Name_Type; -- Name of Unit Sfile : File_Name_Type; -- Name of source file, set to No_File in generic case Afile : File_Name_Type; -- Name of ALI file, set to No_File in generic case Elaborate : Boolean; -- Indicates presence of E parameter Elaborate_All : Boolean; -- Indicates presence of EA parameter Elab_All_Desirable : Boolean; -- Indicates presence of AD parameter Elab_Desirable : Boolean; -- Indicates presence of ED parameter SAL_Interface : Boolean := False; -- True if the Unit is an Interface of a Stand-Alone Library Limited_With : Boolean := False; -- True if unit is named in a limited_with_clause end record; package Withs is new Table.Table ( Table_Component_Type => With_Record, Table_Index_Type => With_Id, Table_Low_Bound => First_With_Entry, Table_Initial => 5000, Table_Increment => 200, Table_Name => "Withs"); --------------------- -- Arguments Table -- --------------------- -- Each Arg line (A line) in an ALI file generates an Args table entry -- Note: there will be no entries in this table if 'A' lines are ignored No_Arg_Id : constant Arg_Id := Arg_Id'First; -- Special value indicating no args table entry First_Arg_Entry : constant Arg_Id := No_Arg_Id + 1; -- Id of first actual entry in table package Args is new Table.Table ( Table_Component_Type => String_Ptr, Table_Index_Type => Arg_Id, Table_Low_Bound => First_Arg_Entry, Table_Initial => 1000, Table_Increment => 100, Table_Name => "Args"); -------------------------- -- Linker_Options Table -- -------------------------- -- If an ALI file has one of more Linker_Options lines, then a single -- entry is made in this table. If more than one Linker_Options lines -- appears in a given ALI file, then the arguments are concatenated -- to form the entry in this table, using a NUL character as the -- separator, and a final NUL character is appended to the end. -- Note: there will be no entries in this table if 'L' lines are ignored type Linker_Option_Record is record Name : Name_Id; -- Name entry containing concatenated list of Linker_Options -- arguments separated by NUL and ended by NUL as described above. Unit : Unit_Id; -- Unit_Id for the entry Internal_File : Boolean; -- Set True if the linker options are from an internal file. This is -- used to insert certain standard entries after all the user entries -- but before the entries from the run-time. Original_Pos : Positive; -- Keep track of original position in the linker options table. This -- is used to implement a stable sort when we sort the linker options -- table. end record; -- The indexes of active entries in this table range from 1 to the -- value of Linker_Options.Last. The zero'th element is for sort call. package Linker_Options is new Table.Table ( Table_Component_Type => Linker_Option_Record, Table_Index_Type => Integer, Table_Low_Bound => 0, Table_Initial => 200, Table_Increment => 400, Table_Name => "Linker_Options"); ----------------- -- Notes Table -- ----------------- -- The notes table records entries from N lines type Notes_Record is record Pragma_Type : Character; -- 'A', 'C', 'I', 'S', 'T' for Annotate/Comment/Ident/Subtitle/Title Pragma_Line : Nat; -- Line number of pragma Pragma_Col : Nat; -- Column number of pragma Unit : Unit_Id; -- Unit_Id for the entry Pragma_Args : Name_Id; -- Pragma arguments. No_Name if no arguments, otherwise a single -- name table entry consisting of all the characters on the notes -- line from the first non-blank character following the source -- location to the last character on the line. end record; -- The indexes of active entries in this table range from 1 to the -- value of Linker_Options.Last. The zero'th element is for convenience -- if the table needs to be sorted. package Notes is new Table.Table ( Table_Component_Type => Notes_Record, Table_Index_Type => Integer, Table_Low_Bound => 0, Table_Initial => 200, Table_Increment => 400, Table_Name => "Notes"); ------------------------------------------- -- External Version Reference Hash Table -- ------------------------------------------- -- This hash table keeps track of external version reference strings -- as read from E lines in the ali file. The stored values do not -- include the terminating quote characters. -- Note: there will be no entries in this table if 'E' lines are ignored type Vindex is range 0 .. 98; -- Type to define range of headers function SHash (S : String_Ptr) return Vindex; -- Hash function for this table function SEq (F1, F2 : String_Ptr) return Boolean; -- Equality function for this table package Version_Ref is new Simple_HTable ( Header_Num => Vindex, Element => Boolean, No_Element => False, Key => String_Ptr, Hash => SHash, Equal => SEq); ------------------------- -- No_Dependency Table -- ------------------------- -- Each R line for a No_Dependency Restriction generates an entry in -- this No_Dependency table. type No_Dep_Record is record ALI_File : ALI_Id; -- ALI File containing the entry No_Dep_Unit : Name_Id; -- Id for names table entry including entire name, including periods end record; package No_Deps is new Table.Table ( Table_Component_Type => No_Dep_Record, Table_Index_Type => Integer, Table_Low_Bound => 0, Table_Initial => 200, Table_Increment => 400, Table_Name => "No_Deps"); ------------------------------------ -- Sdep (Source Dependency) Table -- ------------------------------------ -- Each source dependency (D line) in an ALI file generates an entry in the -- Sdep table. -- Note: there will be no entries in this table if 'D' lines are ignored No_Sdep_Id : constant Sdep_Id := Sdep_Id'First; -- Special value indicating no Sdep table entry First_Sdep_Entry : Sdep_Id := No_Sdep_Id + 1; -- Id of first Sdep entry for current ali file. This is initialized to the -- first Sdep entry in the table, and then incremented appropriately as -- successive ALI files are scanned. type Sdep_Record is record Sfile : File_Name_Type; -- Name of source file Stamp : Time_Stamp_Type; -- Time stamp value. Note that this will be all zero characters for the -- dummy entries for missing or non-dependent files. Checksum : Word; -- Checksum value. Note that this will be all zero characters for the -- dummy entries for missing or non-dependent files Dummy_Entry : Boolean; -- Set True for dummy entries that correspond to missing files or files -- where no dependency relationship exists. Subunit_Name : Name_Id; -- Name_Id for subunit name if present, else No_Name Rfile : File_Name_Type; -- Reference file name. Same as Sfile unless a Source_Reference pragma -- was used, in which case it reflects the name used in the pragma. Start_Line : Nat; -- Starting line number in file. Always 1, unless a Source_Reference -- pragma was used, in which case it reflects the line number value -- given in the pragma. end record; package Sdep is new Table.Table ( Table_Component_Type => Sdep_Record, Table_Index_Type => Sdep_Id, Table_Low_Bound => First_Sdep_Entry, Table_Initial => 5000, Table_Increment => 200, Table_Name => "Sdep"); ---------------------------- -- Use of Name Table Info -- ---------------------------- -- All unit names and file names are entered into the Names table. The Info -- fields of these entries are used as follows: -- Unit name Info field has Unit_Id of unit table entry -- ALI file name Info field has ALI_Id of ALI table entry -- Source file name Info field has Source_Id of source table entry -------------------------- -- Cross-Reference Data -- -------------------------- -- The following table records cross-reference sections, there is one entry -- for each X header line in the ALI file for an xref section. -- Note: there will be no entries in this table if 'X' lines are ignored type Xref_Section_Record is record File_Num : Sdep_Id; -- Dependency number for file (entry in Sdep.Table) File_Name : File_Name_Type; -- Name of file First_Entity : Nat; -- First entry in Xref_Entity table Last_Entity : Nat; -- Last entry in Xref_Entity table end record; package Xref_Section is new Table.Table ( Table_Component_Type => Xref_Section_Record, Table_Index_Type => Nat, Table_Low_Bound => 1, Table_Initial => 50, Table_Increment => 300, Table_Name => "Xref_Section"); -- The following is used to indicate whether a typeref field is present -- for the entity, and if so what kind of typeref field. type Tref_Kind is ( Tref_None, -- No typeref present Tref_Access, -- Access type typeref (points to designated type) Tref_Derived, -- Derived type typeref (points to parent type) Tref_Type); -- All other cases type Visibility_Kind is (Global, -- Library level entity Static, -- Static C/C++ entity Other); -- Local and other entity -- The following table records entities for which xrefs are recorded type Xref_Entity_Record is record Line : Pos; -- Line number of definition Etype : Character; -- Set to the identification character for the entity. See section -- "Cross-Reference Entity Identifiers" in lib-xref.ads for details. Col : Pos; -- Column number of definition Visibility : Visibility_Kind; -- Visibility of entity Entity : Name_Id; -- Name of entity Iref_File_Num : Sdep_Id; -- This field is set to the dependency reference for the file containing -- the generic entity that this one instantiates, or to No_Sdep_Id if -- the current entity is not an instantiation Iref_Line : Nat; -- This field is set to the line number in Iref_File_Num of the generic -- entity that this one instantiates, or to zero if the current entity -- is not an instantiation. Rref_Line : Nat; -- This field is set to the line number of a renaming reference if -- one is present, or to zero if no renaming reference is present Rref_Col : Nat; -- This field is set to the column number of a renaming reference -- if one is present, or to zero if no renaming reference is present. Tref : Tref_Kind; -- Indicates if a typeref is present, and if so what kind. Set to -- Tref_None if no typeref field is present. Tref_File_Num : Sdep_Id; -- This field is set to No_Sdep_Id if no typeref is present, or -- if the typeref refers to an entity in standard. Otherwise it -- it is the dependency reference for the file containing the -- declaration of the typeref entity. Tref_Line : Nat; -- This field is set to zero if no typeref is present, or if the -- typeref refers to an entity in standard. Otherwise it contains -- the line number of the declaration of the typeref entity. Tref_Type : Character; -- This field is set to blank if no typeref is present, or if the -- typeref refers to an entity in standard. Otherwise it contains -- the identification character for the typeref entity. See section -- "Cross-Reference Entity Identifiers" in lib-xref.ads for details. Tref_Col : Nat; -- This field is set to zero if no typeref is present, or if the -- typeref refers to an entity in standard. Otherwise it contains -- the column number of the declaration of the parent type. Tref_Standard_Entity : Name_Id; -- This field is set to No_Name if no typeref is present or if the -- typeref refers to a declared entity rather than an entity in -- package Standard. If there is a typeref that references an -- entity in package Standard, then this field is a Name_Id -- reference for the entity name. Oref_File_Num : Sdep_Id; -- This field is set to No_Sdep_Id if the entity doesn't override any -- other entity, or to the dependency reference for the overridden -- entity. Oref_Line : Nat; Oref_Col : Nat; -- These two fields are set to the line and column of the overridden -- entity. First_Xref : Nat; -- Index into Xref table of first cross-reference Last_Xref : Nat; -- Index into Xref table of last cross-reference. The value in -- Last_Xref can be less than the First_Xref value to indicate -- that no entries are present in the Xref Table. end record; package Xref_Entity is new Table.Table ( Table_Component_Type => Xref_Entity_Record, Table_Index_Type => Nat, Table_Low_Bound => 1, Table_Initial => 500, Table_Increment => 300, Table_Name => "Xref_Entity"); Array_Index_Reference : constant Character := '*'; Interface_Reference : constant Character := 'I'; -- Some special types of references. In the ALI file itself, these -- are output as attributes of the entity, not as references, but -- there is no provision in Xref_Entity_Record for storing multiple -- such references. -- The following table records actual cross-references type Xref_Record is record File_Num : Sdep_Id; -- Set to the file dependency number for the cross-reference. Note -- that if no file entry is present explicitly, this is just a copy -- of the reference for the current cross-reference section. Line : Nat; -- Line number for the reference. This is zero when referencing a -- predefined entity, but in this case Name is set. Rtype : Character; -- Indicates type of reference, using code used in ALI file: -- r = reference -- m = modification -- b = body entity -- c = completion of private or incomplete type -- x = type extension -- i = implicit reference -- Array_Index_Reference = reference to the index of an array -- Interface_Reference = reference to an interface implemented -- by the type -- See description in lib-xref.ads for further details Col : Nat; -- Column number for the reference Name : Name_Id := No_Name; -- This is only used when referencing a predefined entity. Currently, -- this only occurs for array indexes. -- Note: for instantiation references, Rtype is set to ' ', and Col is -- set to zero. One or more such entries can follow any other reference. -- When there is more than one such entry, this is to be read as: -- e.g. ref1 ref2 ref3 -- ref1 is a reference to an entity that was instantied at ref2. -- ref2 itself is also the result of an instantiation, that took -- place at ref3 end record; package Xref is new Table.Table ( Table_Component_Type => Xref_Record, Table_Index_Type => Nat, Table_Low_Bound => 1, Table_Initial => 2000, Table_Increment => 300, Table_Name => "Xref"); -------------------------------------- -- Subprograms for Reading ALI File -- -------------------------------------- procedure Initialize_ALI; -- Initialize the ALI tables. Also resets all switch values to defaults function Scan_ALI (F : File_Name_Type; T : Text_Buffer_Ptr; Ignore_ED : Boolean; Err : Boolean; Read_Xref : Boolean := False; Read_Lines : String := ""; Ignore_Lines : String := "X"; Ignore_Errors : Boolean := False; Directly_Scanned : Boolean := False) return ALI_Id; -- Given the text, T, of an ALI file, F, scan and store the information -- from the file, and return the Id of the resulting entry in the ALI -- table. Switch settings may be modified as described above in the -- switch description settings. -- -- Ignore_ED is normally False. If set to True, it indicates that -- all AD/ED (elaboration desirable) indications in the ALI file are -- to be ignored. This parameter is obsolete now that the -f switch -- is removed from gnatbind, and should be removed ??? -- -- Err determines the action taken on an incorrectly formatted file. -- If Err is False, then an error message is output, and the program -- is terminated. If Err is True, then no error message is output, -- and No_ALI_Id is returned. -- -- Ignore_Lines requests that Scan_ALI ignore any lines that start -- with any given key character. The default value of X causes all -- Xref lines to be ignored. The corresponding data in the ALI -- tables will not be filled in this case. It is not possible -- to ignore U (unit) lines, they are always read. -- -- Read_Lines requests that Scan_ALI process only lines that start -- with one of the given characters. The corresponding data in the -- ALI file for any characters not given in the list will not be -- set. The default value of the null string indicates that all -- lines should be read (unless Ignore_Lines is specified). U -- (unit) lines are always read regardless of the value of this -- parameter. -- -- Note: either Ignore_Lines or Read_Lines should be non-null, but not -- both. If both are provided then only the Read_Lines value is used, -- and the Ignore_Lines parameter is ignored. -- -- Read_XREF is set True to read and acquire the cross-reference -- information. If Read_XREF is set to True, then the effect is to ignore -- all lines other than U, W, D and X lines and the Ignore_Lines and -- Read_Lines parameters are ignored (i.e. the use of True for Read_XREF -- is equivalent to specifying an argument of "UWDX" for Read_Lines. -- -- Ignore_Errors is normally False. If it is set True, then Scan_ALI -- will do its best to scan through a file and extract all information -- it can, even if there are errors. In this case Err is only set if -- Scan_ALI was completely unable to process the file (e.g. it did not -- look like an ALI file at all). Ignore_Errors is intended to improve -- the downward compatibility of new compilers with old tools. -- -- Directly_Scanned is normally False. If it is set to True, then the -- units (spec and/or body) corresponding to the ALI file are marked as -- such. It is used to decide for what units gnatbind should generate -- the symbols corresponding to 'Version or 'Body_Version in -- Stand-Alone Libraries. end ALI;
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- G N A T . C R C 3 2 -- -- -- -- S p e c -- -- -- -- $Revision$ -- -- -- Copyright (C) 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). -- -- -- ------------------------------------------------------------------------------ -- This package provides routines for computing a commonly used checksum -- called CRC-32. This is a checksum based on treating the binary data -- as a polynomial over a binary field, and the exact specifications of -- the CRC-32 algorithm are as follows: -- -- Name : "CRC-32" -- Width : 32 -- Poly : 04C11DB7 -- Init : FFFFFFFF -- RefIn : True -- RefOut : True -- XorOut : FFFFFFFF -- Check : CBF43926 -- -- Note that this is the algorithm used by PKZip, Ethernet and FDDI. -- -- For more information about this algorithm see: -- -- ftp://ftp.rocksoft.com/papers/crc_v3.txt -- "A Painless Guide to CRC Error Detection Algorithms", Ross N. Williams -- -- "Computation of Cyclic Redundancy Checks via Table Look-Up", Communications -- of the ACM, Vol. 31 No. 8, pp.1008-1013 Aug. 1988. Sarwate, D.V. with Ada.Streams; with Interfaces; with System.CRC32; package GNAT.CRC32 is subtype CRC32 is System.CRC32.CRC32; -- Used to represent CRC32 values, which are 32 bit bit-strings procedure Initialize (C : out CRC32) renames System.CRC32.Initialize; -- Initialize CRC value by assigning the standard Init value (16#FFFF_FFFF) procedure Update (C : in out CRC32; Value : Character) renames System.CRC32.Update; -- Evolve CRC by including the contribution from Character'Pos (Value) procedure Update (C : in out CRC32; Value : String); pragma Inline (Update); -- For each character in the Value string call above routine procedure Wide_Update (C : in out CRC32; Value : Wide_Character); pragma Inline (Update); -- Evolve CRC by including the contribution from Wide_Character'Pos (Value) -- with the bytes being included in the natural memory order. procedure Wide_Update (C : in out CRC32; Value : Wide_String); pragma Inline (Update); -- For each character in the Value string call above routine procedure Update (C : in out CRC32; Value : Ada.Streams.Stream_Element); pragma Inline (Update); -- Evolve CRC by including the contribution from Value procedure Update (C : in out CRC32; Value : Ada.Streams.Stream_Element_Array); pragma Inline (Update); -- For each element in the Value array call above routine function Get_Value (C : CRC32) return Interfaces.Unsigned_32 renames System.CRC32.Get_Value; -- Get_Value computes the CRC32 value by performing an XOR with the -- standard XorOut value (16#FFFF_FFFF). Note that this does not -- change the value of C, so it may be used to retrieve intermediate -- values of the CRC32 value during a sequence of Update calls. end GNAT.CRC32;
-- This package is intended to set up and tear down the test environment. -- Once created by GNATtest, this package will never be overwritten -- automatically. Contents of this package can be modified in any way -- except for sections surrounded by a 'read only' marker. package body Ships.Test_Data.Tests.Modules_Container.Test_Data is procedure Set_Up(Gnattest_T: in out Test) is pragma Unreferenced(Gnattest_T); begin null; end Set_Up; procedure Tear_Down(Gnattest_T: in out Test) is pragma Unreferenced(Gnattest_T); begin null; end Tear_Down; procedure User_Set_Up(Gnattest_T: in out New_Test) is pragma Unreferenced(Gnattest_T); begin null; end User_Set_Up; procedure User_Tear_Down(Gnattest_T: in out New_Test) is pragma Unreferenced(Gnattest_T); begin null; end User_Tear_Down; end Ships.Test_Data.Tests.Modules_Container.Test_Data;
with Text_IO; use Text_IO; procedure Add is package My_Int_IO is new Integer_IO(Integer); use My_Int_IO; begin Put(2 + 2); New_Line; end Add;
----------------------------------------------------------------------- -- util-processes-tests - Test for processes -- Copyright (C) 2011, 2012, 2016, 2018, 2019 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.Loggers; with Util.Test_Caller; with Util.Files; with Util.Strings.Vectors; with Util.Streams.Pipes; with Util.Streams.Buffered; with Util.Streams.Texts; with Util.Processes.Tools; package body Util.Processes.Tests is -- The logger Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Util.Processes.Tests"); package Caller is new Util.Test_Caller (Test, "Processes"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test Util.Processes.Is_Running", Test_No_Process'Access); Caller.Add_Test (Suite, "Test Util.Processes.Spawn/Wait/Get_Exit_Status", Test_Spawn'Access); Caller.Add_Test (Suite, "Test Util.Processes.Spawn(READ pipe)", Test_Output_Pipe'Access); Caller.Add_Test (Suite, "Test Util.Processes.Spawn(WRITE pipe)", Test_Input_Pipe'Access); Caller.Add_Test (Suite, "Test Util.Processes.Spawn/Shell(WRITE pipe)", Test_Shell_Splitting_Pipe'Access); Caller.Add_Test (Suite, "Test Util.Processes.Spawn(OUTPUT redirect)", Test_Output_Redirect'Access); Caller.Add_Test (Suite, "Test Util.Processes.Spawn(INPUT redirect)", Test_Input_Redirect'Access); Caller.Add_Test (Suite, "Test Util.Streams.Pipes.Open/Read/Close (Multi spawn)", Test_Multi_Spawn'Access); Caller.Add_Test (Suite, "Test Util.Processes.Tools.Execute", Test_Tools_Execute'Access); end Add_Tests; -- ------------------------------ -- Tests when the process is not launched -- ------------------------------ procedure Test_No_Process (T : in out Test) is P : Process; begin T.Assert (not P.Is_Running, "Process should not be running"); T.Assert (P.Get_Pid < 0, "Invalid process id"); end Test_No_Process; -- ------------------------------ -- Test executing a process -- ------------------------------ procedure Test_Spawn (T : in out Test) is P : Process; begin -- Launch the test process => exit code 2 P.Spawn ("bin/util_test_process"); T.Assert (P.Is_Running, "Process is running"); P.Wait; T.Assert (not P.Is_Running, "Process has stopped"); T.Assert (P.Get_Pid > 0, "Invalid process id"); Util.Tests.Assert_Equals (T, 2, P.Get_Exit_Status, "Invalid exit status"); -- Launch the test process => exit code 0 P.Spawn ("bin/util_test_process 0 write b c d e f"); T.Assert (P.Is_Running, "Process is running"); P.Wait; T.Assert (not P.Is_Running, "Process has stopped"); T.Assert (P.Get_Pid > 0, "Invalid process id"); Util.Tests.Assert_Equals (T, 0, P.Get_Exit_Status, "Invalid exit status"); end Test_Spawn; -- ------------------------------ -- Test output pipe redirection: read the process standard output -- ------------------------------ procedure Test_Output_Pipe (T : in out Test) is P : aliased Util.Streams.Pipes.Pipe_Stream; begin P.Open ("bin/util_test_process 0 write b c d e f test_marker"); declare Buffer : Util.Streams.Buffered.Input_Buffer_Stream; Content : Ada.Strings.Unbounded.Unbounded_String; begin Buffer.Initialize (P'Unchecked_Access, 19); Buffer.Read (Content); P.Close; Util.Tests.Assert_Matches (T, "b\s+c\s+d\s+e\s+f\s+test_marker\s+", Content, "Invalid content"); end; T.Assert (not P.Is_Running, "Process has stopped"); Util.Tests.Assert_Equals (T, 0, P.Get_Exit_Status, "Invalid exit status"); end Test_Output_Pipe; -- ------------------------------ -- Test shell splitting. -- ------------------------------ procedure Test_Shell_Splitting_Pipe (T : in out Test) is P : aliased Util.Streams.Pipes.Pipe_Stream; begin P.Open ("bin/util_test_process 0 write ""b c d e f"" test_marker"); declare Buffer : Util.Streams.Buffered.Input_Buffer_Stream; Content : Ada.Strings.Unbounded.Unbounded_String; begin Buffer.Initialize (P'Unchecked_Access, 19); Buffer.Read (Content); P.Close; Util.Tests.Assert_Matches (T, "b c d e f\s+test_marker\s+", Content, "Invalid content"); end; T.Assert (not P.Is_Running, "Process has stopped"); Util.Tests.Assert_Equals (T, 0, P.Get_Exit_Status, "Invalid exit status"); end Test_Shell_Splitting_Pipe; -- ------------------------------ -- Test input pipe redirection: write the process standard input -- At the same time, read the process standard output. -- ------------------------------ procedure Test_Input_Pipe (T : in out Test) is P : aliased Util.Streams.Pipes.Pipe_Stream; begin P.Open ("bin/util_test_process 0 read -", READ_WRITE); declare Buffer : Util.Streams.Buffered.Input_Buffer_Stream; Content : Ada.Strings.Unbounded.Unbounded_String; Print : Util.Streams.Texts.Print_Stream; begin -- Write on the process input stream. Print.Initialize (P'Unchecked_Access); Print.Write ("Write test on the input pipe"); Print.Close; -- Read the output. Buffer.Initialize (P'Unchecked_Access, 19); Buffer.Read (Content); -- Wait for the process to finish. P.Close; Util.Tests.Assert_Matches (T, "Write test on the input pipe-\s", Content, "Invalid content"); end; T.Assert (not P.Is_Running, "Process has stopped"); Util.Tests.Assert_Equals (T, 0, P.Get_Exit_Status, "Invalid exit status"); end Test_Input_Pipe; -- ------------------------------ -- Test launching several processes through pipes in several threads. -- ------------------------------ procedure Test_Multi_Spawn (T : in out Test) is Task_Count : constant Natural := 8; Count_By_Task : constant Natural := 10; type State_Array is array (1 .. Task_Count) of Boolean; States : State_Array; begin declare task type Worker is entry Start (Count : in Natural); entry Result (Status : out Boolean); end Worker; task body Worker is Cnt : Natural; State : Boolean := True; begin accept Start (Count : in Natural) do Cnt := Count; end Start; declare type Pipe_Array is array (1 .. Cnt) of aliased Util.Streams.Pipes.Pipe_Stream; Pipes : Pipe_Array; begin -- Launch the processes. -- They will print their arguments on stdout, one by one on each line. -- The expected exit status is the first argument. for I in 1 .. Cnt loop Pipes (I).Open ("bin/util_test_process 0 write b c d e f test_marker"); end loop; -- Read their output for I in 1 .. Cnt loop declare Buffer : Util.Streams.Buffered.Input_Buffer_Stream; Content : Ada.Strings.Unbounded.Unbounded_String; begin Buffer.Initialize (Pipes (I)'Unchecked_Access, 19); Buffer.Read (Content); Pipes (I).Close; -- Check status and output. State := State and Pipes (I).Get_Exit_Status = 0; State := State and Ada.Strings.Unbounded.Index (Content, "test_marker") > 0; end; end loop; exception when E : others => Log.Error ("Exception raised", E); State := False; end; accept Result (Status : out Boolean) do Status := State; end Result; end Worker; type Worker_Array is array (1 .. Task_Count) of Worker; Tasks : Worker_Array; begin for I in Tasks'Range loop Tasks (I).Start (Count_By_Task); end loop; -- Get the results (do not raise any assertion here because we have to call -- 'Result' to ensure the thread terminates. for I in Tasks'Range loop Tasks (I).Result (States (I)); end loop; -- Leaving the Worker task scope means we are waiting for our tasks to finish. end; for I in States'Range loop T.Assert (States (I), "Task " & Natural'Image (I) & " failed"); end loop; end Test_Multi_Spawn; -- ------------------------------ -- Test output file redirection. -- ------------------------------ procedure Test_Output_Redirect (T : in out Test) is P : Process; Path : constant String := Util.Tests.Get_Test_Path ("regtests/result/proc-output.txt"); Content : Ada.Strings.Unbounded.Unbounded_String; begin Util.Processes.Set_Output_Stream (P, Path); Util.Processes.Spawn (P, "bin/util_test_process 0 write b c d e f test_marker"); Util.Processes.Wait (P); T.Assert (not P.Is_Running, "Process has stopped"); Util.Tests.Assert_Equals (T, 0, P.Get_Exit_Status, "Process failed"); Util.Files.Read_File (Path, Content); Util.Tests.Assert_Matches (T, ".*test_marker", Content, "Invalid content"); Util.Processes.Set_Output_Stream (P, Path, True); Util.Processes.Spawn (P, "bin/util_test_process 0 write appended_text"); Util.Processes.Wait (P); Content := Ada.Strings.Unbounded.Null_Unbounded_String; Util.Files.Read_File (Path, Content); Util.Tests.Assert_Matches (T, ".*appended_text", Content, "Invalid content"); Util.Tests.Assert_Matches (T, ".*test_marker.*", Content, "Invalid content"); end Test_Output_Redirect; -- ------------------------------ -- Test input file redirection. -- ------------------------------ procedure Test_Input_Redirect (T : in out Test) is P : Process; In_Path : constant String := Util.Tests.Get_Test_Path ("regtests/files/proc-input.txt"); Out_Path : constant String := Util.Tests.Get_Test_Path ("regtests/result/proc-inres.txt"); Exp_Path : constant String := Util.Tests.Get_Test_Path ("regtests/expect/proc-inres.txt"); begin Util.Processes.Set_Input_Stream (P, In_Path); Util.Processes.Set_Output_Stream (P, Out_Path); Util.Processes.Spawn (P, "bin/util_test_process 0 read -"); Util.Processes.Wait (P); T.Assert (not P.Is_Running, "Process has stopped"); Util.Tests.Assert_Equals (T, 0, P.Get_Exit_Status, "Process failed"); Util.Tests.Assert_Equal_Files (T => T, Expect => Exp_Path, Test => Out_Path, Message => "Process input/output redirection"); end Test_Input_Redirect; -- ------------------------------ -- Test the Tools.Execute operation. -- ------------------------------ procedure Test_Tools_Execute (T : in out Test) is List : Util.Strings.Vectors.Vector; Status : Integer; begin Tools.Execute (Command => "bin/util_test_process 23 write ""b c d e f"" test_marker", Output => List, Status => Status); Util.Tests.Assert_Equals (T, 23, Status, "Invalid exit status"); Util.Tests.Assert_Equals (T, 2, Integer (List.Length), "Invalid output collected by Execute"); Util.Tests.Assert_Equals (T, "b c d e f", List.Element (1), ""); Util.Tests.Assert_Equals (T, "test_marker", List.Element (2), ""); end Test_Tools_Execute; end Util.Processes.Tests;
-------------------------------------------------------------------------------------------------------------------- -- Copyright (c) 2013-2020, Luke A. Guest -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages -- arising from the use of this software. -- -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it -- freely, subject to the following restrictions: -- -- 1. The origin of this software must not be misrepresented; you must not -- claim that you wrote the original software. If you use this software -- in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. -- -- 2. Altered source versions must be plainly marked as such, and must not be -- misrepresented as being the original software. -- -- 3. This notice may not be removed or altered from any source -- distribution. -------------------------------------------------------------------------------------------------------------------- package body SDL.TTFs.Versions is procedure Linked_With (Info : in out SDL.Versions.Version) is function TTF_Linked_Version return access SDL.Versions.Version with Import => True, Convention => C, External_Name => "TTF_Linked_Version"; Data : constant access SDL.Versions.Version := TTF_Linked_Version; begin Info := Data.all; end Linked_With; end SDL.TTFs.Versions;
package Protypo.Api is end Protypo.Api;
-------------------------------------------- -- -- -- PACKAGE GAME - PARTIE ADA -- -- -- -- GAME-DISPLAY-FONT.ADS -- -- -- -- Gestion de l'affichage du texte -- -- -- -- Créateur : CAPELLE Mikaël -- -- Adresse : capelle.mikael@gmail.com -- -- -- -- Dernière modification : 14 / 06 / 2011 -- -- -- -------------------------------------------- with Interfaces.C, Game.Gtype; use Interfaces.C, Game.Gtype; with Ada.Finalization; package Game.Display.Font is -- Type stockant les polices type Font is limited private; -- Type gérant l'encodage -- Je ne détaillerais pas ici les règles d'encodage -- Sachez juste que UTF8 gère un plus grand nombre de caractère -- Faites des tests, mais il sera très rare d'utilisé LATIN1 type Encodage is (LATIN1, UTF8); -- Type gérant le rendu -- SOLID : Le texte sera assez brut (pas de lissage), aura un fond -- transparent, et la création sera très rapide (idéal pour des -- compteurs, etc... ) -- SHADED : Le texte sera lissé mais devra avoir un fond unie (définie par -- fond), création très rapide aussi -- BLENDED : Le texte sera lissé sur un fond transparent, en revanche la -- création sera lente type Type_Rendu is (SOLID,SHADED,BLENDED); -- Ouvre / Ferme une police -- Utilisez une police déjà ouverte dans les fonctions d'affichage -- de texte accélère leur fonctionnement -- Lève l'exception Font_Error si une erreur survient procedure Open_Font (F : out Font; Nom : in String; Taille : in Integer); -- Retourne une surface contenant le texte fournit en argument avec le -- format demandé -- Lève l'exception Font_Error si une erreur survient function Get_Text_Surf (Text : in String; -- Texte à afficher Police : in Font; -- Police (sous le format d'un type Font) F_Type : in Type_Rendu := BLENDED; -- Type de rendu (cf. au dessus) Bold : in Boolean := False; -- Gras (True) Underline : in Boolean := False; -- Souligné (True) Italic : in Boolean := False; -- Italic (True) Encode : in Encodage := UTF8; -- Encodage (cf. au dessus) Coul : in Color := (0,0,0); -- Couleur du texte Fond : in Color := (255,255,255)) -- Couleur de fond return Surface; function Get_Text_Surf(Text : in String; -- Texte à afficher Police : in String; -- Nom de la police (fichier .ttf) Taille : in Natural; -- Taille de la police F_Type : in Type_Rendu := BLENDED; -- Type de rendu (cf. au dessus) Bold : in Boolean := False; -- Gras (True) Underline : in Boolean := False; -- Souligné (True) Italic : in Boolean := False; -- Italic (True) Encode : in Encodage := UTF8; -- Encodage (cf. au dessus) Coul : in Color := (0,0,0); -- Couleur du texte Fond : in Color := (255,255,255)) -- Couleur de fond return Surface; -- Ecrit le texte passé en argument à la position demandé sur la surface -- Surf avec le formatage adéquat -- Lève l'exception Font_Error si une erreur survient procedure Print_Text(Surf : in out Surface; -- Surface sur laquelle affiché le texte Pos : in out Rect; -- Position d'affichage du texte (sert aussi à stocker la taille du bloc pris par le texte) Text : in String; -- Texte à afficher Police : in Font; -- Police (sous le format d'un type Font) F_Type : in Type_Rendu := BLENDED; -- Type de rendu (cf. au dessus) Bold : in Boolean := False; -- Gras (True) Underline : in Boolean := False; -- Souligné (True) Italic : in Boolean := False; -- Italic (True) Encode : in Encodage := UTF8; -- Encodage (cf. au dessus) Coul : in Color := (0,0,0); -- Couleur du texte Fond : in Color := (255,255,255)); -- Couleur de fond procedure Print_Text(Surf : in out Surface; -- Surface sur laquelle affiché le texte Pos : in out Rect; -- Position d'affichage du texte (sert aussi à stocker la taille du bloc pris par le texte) Text : in String; -- Texte à afficher Police : in String; -- Nom de la police (fichier .ttf) Taille : in Natural; -- Taille de la police F_Type : in Type_Rendu := BLENDED; -- Type de rendu (cf. au dessus) Bold : in Boolean := False; -- Gras (True) Underline : in Boolean := False; -- Souligné (True) Italic : in Boolean := False; -- Italic (True) Encode : in Encodage := UTF8; -- Encodage (cf. au dessus) Coul : in Color := (0,0,0); -- Couleur du texte Fond : in Color := (255,255,255)); -- Couleur de fond private package AF renames Ada.Finalization; type SDL_Font is access all Interfaces.C.Int; Null_SDL_Font : constant SDL_Font := null; procedure Close_Font (F : in out Font); type Font is new AF.Limited_Controlled with record Fon : SDL_Font; end record; procedure Initialize (F : in out Font); procedure Finalize (F : in out Font); end Game.Display.Font;
-- This spec has been automatically generated from STM32F40x.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; with System; -- STM32F40x package STM32_SVD is pragma Preelaborate; -------------------- -- Base addresses -- -------------------- RNG_Base : constant System.Address := System'To_Address (16#50060800#); DCMI_Base : constant System.Address := System'To_Address (16#50050000#); FSMC_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#); 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#); GPIOD_Base : constant System.Address := System'To_Address (16#40020C00#); GPIOC_Base : constant System.Address := System'To_Address (16#40020800#); 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#); I2S2ext_Base : constant System.Address := System'To_Address (16#40003400#); I2S3ext_Base : constant System.Address := System'To_Address (16#40004000#); SDIO_Base : constant System.Address := System'To_Address (16#40012C00#); 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#); USART6_Base : constant System.Address := System'To_Address (16#40011400#); USART1_Base : constant System.Address := System'To_Address (16#40011000#); USART2_Base : constant System.Address := System'To_Address (16#40004400#); USART3_Base : constant System.Address := System'To_Address (16#40004800#); DAC_Base : constant System.Address := System'To_Address (16#40007400#); PWR_Base : constant System.Address := System'To_Address (16#40007000#); I2C3_Base : constant System.Address := System'To_Address (16#40005C00#); I2C2_Base : constant System.Address := System'To_Address (16#40005800#); I2C1_Base : constant System.Address := System'To_Address (16#40005400#); IWDG_Base : constant System.Address := System'To_Address (16#40003000#); WWDG_Base : constant System.Address := System'To_Address (16#40002C00#); RTC_Base : constant System.Address := System'To_Address (16#40002800#); UART4_Base : constant System.Address := System'To_Address (16#40004C00#); UART5_Base : constant System.Address := System'To_Address (16#40005000#); 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#); TIM13_Base : constant System.Address := System'To_Address (16#40001C00#); TIM14_Base : constant System.Address := System'To_Address (16#40002000#); TIM11_Base : constant System.Address := System'To_Address (16#40014800#); 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#); 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#); CAN1_Base : constant System.Address := System'To_Address (16#40006400#); CAN2_Base : constant System.Address := System'To_Address (16#40006800#); FLASH_Base : constant System.Address := System'To_Address (16#40023C00#); EXTI_Base : constant System.Address := System'To_Address (16#40013C00#); 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#); NVIC_Base : constant System.Address := System'To_Address (16#E000E000#); end STM32_SVD;
-- AOC 2020, Day 2 with Ada.Containers.Vectors; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package Day is type Password_Entry is record Min : Natural := 0; Max : Natural := 0; Pattern : Unbounded_String := Null_Unbounded_String; Password : Unbounded_String := Null_Unbounded_String; end record; package Password_Vector is new Ada.Containers.Vectors (Index_Type => Natural, Element_Type => Password_Entry); function load_passwords(filename : in String) return Password_Vector.Vector; procedure put(value : in Password_Vector.Vector); function count_valid(passwords : in Password_Vector.Vector) return Ada.Containers.Count_Type; function count_valid_positions(passwords : in Password_Vector.Vector) return Ada.Containers.Count_Type; end Day;
-- 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 = "Robtex" type = "api" function start() setratelimit(1) end function vertical(ctx, domain) local cfg = datasrc_config() if (cfg == nil) then return end local url = "https://freeapi.robtex.com/pdns/forward/" .. domain local resp, err = request(ctx, { ['url']=url, headers={['Content-Type']="application/json"}, }) if (err ~= nil and err ~= "") then return end local j = json.decode("{\"results\": [" .. resp .. "]}") if (j == nil or #(j.results) == 0) then return end for _, rr in pairs(j.results) do if (rr.rrtype == "A") then local d = ipinfo(ctx, rr.rrdata, cfg.ttl) if (d == nil) then return end extractnames(ctx, d) elseif (rr.rrtype == "NS" or rr.rrtype == "MX") then sendnames(ctx, rr.rrdata) end end end function asn(ctx, addr, asn) local cfg = datasrc_config() if (cfg == nil) then return end local d local prefix if (asn == 0) then if (addr == "") then return end d = ipinfo(ctx, addr, cfg.ttl) if (d == nil) then return end asn = d.as prefix = d.bgproute end local cidrs = netblocks(ctx, asn, cfg.ttl) if (cidrs == nil or #cidrs == 0) then return end if (prefix == "") then prefix = cidrs[1] parts = split(prefix, "/") addr = parts[1] d = ipinfo(ctx, addr, cfg.ttl) if (d == nil) then return end end extractnames(ctx, d) local desc = d.asname if (desc == nil) then desc = "" end if (string.len(desc) < string.len(d.whoisdesc)) then desc = d.whoisdesc end if (d.asdesc ~= nil and string.len(d.asdesc) > 0) then desc = desc .. " - " .. d.asdesc elseif (d.routedesc ~= nil and string.len(d.routedesc) > 0) then desc = desc .. " - " .. d.routedesc end newasn(ctx, { ['addr']=addr, ['asn']=asn, ['prefix']=prefix, ['desc']=desc, ['netblocks']=cidrs, }) end function ipinfo(ctx, addr, ttl) local url = "https://freeapi.robtex.com/ipquery/" .. addr local resp, err = request(ctx, { ['url']=url, headers={['Content-Type']="application/json"}, }) if (err ~= nil and err ~= "") then return nil end local j = json.decode(resp) if (j == nil or j.status ~= "ok") then return nil end return j end function extractnames(ctx, djson) local sections = {"act", "acth", "pas", "pash"} for _, s in pairs(sections) do if (djson[s] ~= nil and #(djson[s]) > 0) then for _, name in pairs(djson[s]) do if inscope(ctx, name.o) then newname(ctx, name.o) end end end end end function netblocks(ctx, asn, ttl) local url = "https://freeapi.robtex.com/asquery/" .. tostring(asn) local resp, err = request(ctx, { ['url']=url, headers={['Content-Type']="application/json"}, }) if (err ~= nil and err ~= "") then return nil end local j = json.decode(resp) if (j == nil or j.status ~= "ok") then return nil end local netblocks = {} for _, net in pairs(j.nets) do table.insert(netblocks, net.n) end if (#netblocks == 0) then return nil end return netblocks end function sendnames(ctx, content) local names = find(content, subdomainre) if (names == nil) then return end local found = {} for i, v in pairs(names) do if (found[v] == nil) then newname(ctx, v) found[v] = true end end end function split(str, delim) local result = {} local pattern = "[^%" .. delim .. "]+" local matches = find(str, pattern) if (matches == nil or #matches == 0) then return result end for i, match in pairs(matches) do table.insert(result, match) end return result end
pragma License (Unrestricted); -- extended unit with Ada.Containers.Access_Holders; generic type Base (<>) is abstract tagged limited private; type Base_Name is access all Base'Class; with package Base_Holders is new Access_Holders (Base_Name, Free => <>); type Derived (<>) is abstract limited new Base with private; type Derived_Name is access all Derived'Class; with package Derived_Holders is new Access_Holders (Derived_Name, Free => <>); package Ada.Containers.Access_Holders_Derivational_Conversions is -- It converts reference counted access types from derived to base. pragma Preelaborate; procedure Assign ( Target : in out Base_Holders.Holder; Source : Derived_Holders.Holder); procedure Move ( Target : in out Base_Holders.Holder; Source : in out Derived_Holders.Holder); end Ada.Containers.Access_Holders_Derivational_Conversions;
-- This spec has been automatically generated from STM32F411xx.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with Interfaces; use Interfaces; with System; -- STM32F411xx package STM32_SVD is pragma Preelaborate; --------------- -- Base type -- --------------- type UInt32 is new Interfaces.Unsigned_32; type UInt16 is new Interfaces.Unsigned_16; type Byte is new Interfaces.Unsigned_8; type Bit is mod 2**1 with Size => 1; type UInt2 is mod 2**2 with Size => 2; type UInt3 is mod 2**3 with Size => 3; type UInt4 is mod 2**4 with Size => 4; type UInt5 is mod 2**5 with Size => 5; type UInt6 is mod 2**6 with Size => 6; type UInt7 is mod 2**7 with Size => 7; type UInt9 is mod 2**9 with Size => 9; type UInt10 is mod 2**10 with Size => 10; type UInt11 is mod 2**11 with Size => 11; type UInt12 is mod 2**12 with Size => 12; type UInt13 is mod 2**13 with Size => 13; type UInt14 is mod 2**14 with Size => 14; type UInt15 is mod 2**15 with Size => 15; type UInt17 is mod 2**17 with Size => 17; type UInt18 is mod 2**18 with Size => 18; type UInt19 is mod 2**19 with Size => 19; type UInt20 is mod 2**20 with Size => 20; type UInt21 is mod 2**21 with Size => 21; type UInt22 is mod 2**22 with Size => 22; type UInt23 is mod 2**23 with Size => 23; type UInt24 is mod 2**24 with Size => 24; type UInt25 is mod 2**25 with Size => 25; type UInt26 is mod 2**26 with Size => 26; type UInt27 is mod 2**27 with Size => 27; type UInt28 is mod 2**28 with Size => 28; type UInt29 is mod 2**29 with Size => 29; type UInt30 is mod 2**30 with Size => 30; type UInt31 is mod 2**31 with Size => 31; -------------------- -- Base addresses -- -------------------- ADC_Common_Base : constant System.Address := System'To_Address (16#40012300#); ADC1_Base : constant System.Address := System'To_Address (16#40012000#); CRC_Base : constant System.Address := System'To_Address (16#40023000#); DBG_Base : constant System.Address := System'To_Address (16#E0042000#); EXTI_Base : constant System.Address := System'To_Address (16#40013C00#); FLASH_Base : constant System.Address := System'To_Address (16#40023C00#); IWDG_Base : constant System.Address := System'To_Address (16#40003000#); OTG_FS_DEVICE_Base : constant System.Address := System'To_Address (16#50000800#); 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_PWRCLK_Base : constant System.Address := System'To_Address (16#50000E00#); PWR_Base : constant System.Address := System'To_Address (16#40007000#); RCC_Base : constant System.Address := System'To_Address (16#40023800#); RTC_Base : constant System.Address := System'To_Address (16#40002800#); SDIO_Base : constant System.Address := System'To_Address (16#40012C00#); SYSCFG_Base : constant System.Address := System'To_Address (16#40013800#); TIM1_Base : constant System.Address := System'To_Address (16#40010000#); TIM8_Base : constant System.Address := System'To_Address (16#40010400#); TIM10_Base : constant System.Address := System'To_Address (16#40014400#); TIM11_Base : constant System.Address := System'To_Address (16#40014800#); 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#); USART1_Base : constant System.Address := System'To_Address (16#40011000#); USART2_Base : constant System.Address := System'To_Address (16#40004400#); USART6_Base : constant System.Address := System'To_Address (16#40011400#); WWDG_Base : constant System.Address := System'To_Address (16#40002C00#); DMA2_Base : constant System.Address := System'To_Address (16#40026400#); DMA1_Base : constant System.Address := System'To_Address (16#40026000#); GPIOH_Base : constant System.Address := System'To_Address (16#40021C00#); GPIOE_Base : constant System.Address := System'To_Address (16#40021000#); GPIOD_Base : constant System.Address := System'To_Address (16#40020C00#); GPIOC_Base : constant System.Address := System'To_Address (16#40020800#); GPIOB_Base : constant System.Address := System'To_Address (16#40020400#); GPIOA_Base : constant System.Address := System'To_Address (16#40020000#); I2C3_Base : constant System.Address := System'To_Address (16#40005C00#); I2C2_Base : constant System.Address := System'To_Address (16#40005800#); I2C1_Base : constant System.Address := System'To_Address (16#40005400#); I2S2ext_Base : constant System.Address := System'To_Address (16#40003400#); I2S3ext_Base : constant System.Address := System'To_Address (16#40004000#); 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#); NVIC_Base : constant System.Address := System'To_Address (16#E000E000#); end STM32_SVD;
-- C34014R.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 A DERIVED OPERATOR IS VISIBLE AND FURTHER DERIVABLE -- UNDER APPROPRIATE CIRCUMSTANCES. -- CHECK WHEN THE DERIVED OPERATOR IS IMPLICITLY DECLARED IN THE -- VISIBLE PART OF A PACKAGE AND A HOMOGRAPHIC OPERATOR IS LATER -- DECLARED EXPLICITLY IN THE PACKAGE BODY. -- HISTORY: -- JRK 09/22/87 CREATED ORIGINAL TEST. -- GJD 11/15/95 REMOVED ADA 83 INCOMPATIBILITIES. -- PWN 04/11/96 Restored subtests in Ada95 legal format. WITH REPORT; USE REPORT; PROCEDURE C34014R IS PACKAGE P IS TYPE T IS RANGE -100 .. 100; FUNCTION "+" (X : T) RETURN T; END P; USE P; PACKAGE BODY P IS FUNCTION "+" (X : T) RETURN T IS BEGIN RETURN X + T (IDENT_INT (1)); END "+"; END P; BEGIN TEST ("C34014R", "CHECK THAT A DERIVED OPERATOR IS VISIBLE " & "AND FURTHER DERIVABLE UNDER APPROPRIATE " & "CIRCUMSTANCES. CHECK WHEN THE DERIVED " & "OPERATOR IS IMPLICITLY DECLARED IN THE " & "VISIBLE PART OF A PACKAGE AND A HOMOGRAPHIC " & "OPERATOR IS LATER DECLARED EXPLICITLY IN " & "THE PACKAGE BODY"); ----------------------------------------------------------------- COMMENT ("NEW OPERATOR DECLARED BY SUBPROGRAM DECLARATION"); DECLARE PACKAGE Q IS TYPE QT IS NEW T; X : QT := +0; END Q; USE Q; PACKAGE BODY Q IS FUNCTION "+" (Y : QT) RETURN QT; TYPE QR IS RECORD C : QT := +0; END RECORD; TYPE QS IS NEW QT; FUNCTION "+" (Y : QT) RETURN QT IS BEGIN RETURN Y + QT (IDENT_INT (2)); END "+"; PACKAGE R IS Y : QR; Z : QS := +0; END R; USE R; BEGIN IF X /= 1 THEN FAILED ("OLD OPERATOR NOT VISIBLE - SUBPROG " & "DECL - 1"); END IF; IF Y.C /= 2 THEN FAILED ("NEW OPERATOR NOT VISIBLE - SUBPROG " & "DECL"); END IF; IF Z /= 2 THEN FAILED ("OLD OPERATOR NOT DERIVED - SUBPROG " & "DECL - 1"); END IF; END Q; PACKAGE R IS Y : QT := +0; TYPE RT IS NEW QT; Z : RT := +0; END R; USE R; BEGIN IF Y /= 1 THEN FAILED ("OLD OPERATOR NOT VISIBLE - SUBPROG DECL - 2"); END IF; IF Z /= 1 THEN FAILED ("OLD OPERATOR NOT DERIVED - SUBPROG DECL - 2"); END IF; END; ----------------------------------------------------------------- COMMENT ("NEW OPERATOR DECLARED BY RENAMING"); DECLARE PACKAGE Q IS TYPE QT IS NEW T; X : QT := +0; END Q; USE Q; PACKAGE BODY Q IS FUNCTION G (X : QT) RETURN QT; FUNCTION "+" (Y : QT) RETURN QT RENAMES G; TYPE QR IS RECORD C : QT := +0; END RECORD; TYPE QS IS NEW QT; FUNCTION G (X : QT) RETURN QT IS BEGIN RETURN X + QT (IDENT_INT (2)); END G; PACKAGE R IS Y : QR; Z : QS := +0; END R; USE R; BEGIN IF X /= 1 THEN FAILED ("OLD OPERATOR NOT VISIBLE - RENAMING - " & "1"); END IF; IF Y.C /= 2 THEN FAILED ("NEW OPERATOR NOT VISIBLE - RENAMING"); END IF; IF Z /= 2 THEN FAILED ("OLD OPERATOR NOT DERIVED - RENAMING - " & "1"); END IF; END Q; PACKAGE R IS Y : QT := +0; TYPE RT IS NEW QT; Z : RT := +0; END R; USE R; BEGIN IF Y /= 1 THEN FAILED ("OLD OPERATOR NOT VISIBLE - RENAMING - 2"); END IF; IF Z /= 1 THEN FAILED ("OLD OPERATOR NOT DERIVED - RENAMING - 2"); END IF; END; ----------------------------------------------------------------- COMMENT ("NEW OPERATOR DECLARED BY GENERIC INSTANTIATION"); DECLARE GENERIC TYPE T IS RANGE <>; FUNCTION G (Y : T) RETURN T; FUNCTION G (Y : T) RETURN T IS BEGIN RETURN Y + T (IDENT_INT (2)); END G; PACKAGE Q IS TYPE QT IS NEW T; X : QT := +0; END Q; USE Q; PACKAGE BODY Q IS FUNCTION "+" IS NEW G (QT); W : QT := +0; TYPE QS IS NEW QT; Z : QS := +0; BEGIN IF X /= 1 THEN FAILED ("OLD OPERATOR NOT VISIBLE - " & "INSTANTIATION - 1"); END IF; IF W /= 2 THEN FAILED ("NEW OPERATOR NOT VISIBLE - " & "INSTANTIATION"); END IF; IF Z /= 2 THEN FAILED ("OLD OPERATOR NOT DERIVED - " & "INSTANTIATION - 1"); END IF; END Q; PACKAGE R IS Y : QT := +0; TYPE RT IS NEW QT; Z : RT := +0; END R; USE R; BEGIN IF Y /= 1 THEN FAILED ("OLD OPERATOR NOT VISIBLE - INSTANTIATION - " & "2"); END IF; IF Z /= 1 THEN FAILED ("OLD OPERATOR NOT DERIVED - INSTANTIATION - " & "2"); END IF; END; ----------------------------------------------------------------- RESULT; END C34014R;